PageSourceSearch

https://www.av.se/Static/js/app.js?v=Fyb6MKOT4FvXjCb_5PU9nNrIC-2d68Dj4f7vNW4cg5k1

js av.se collected 2026-09-24 09:03:33 UTC 935,013 bytes, 12,701 lines download raw bytes

1/* Minification failed. Returning unminified contents.
2(1717,85-86): run-time error JS1100: Expected ',': =
3(1728,44-45): run-time error JS1195: Expected expression: .
4(1728,45-46): run-time error JS1010: Expected identifier: .
5(1728,46-47): run-time error JS1010: Expected identifier: .
6(1728,72-73): run-time error JS1004: Expected ';': ]
7(1728,82-83): run-time error JS1195: Expected expression: >
8(1728,89-90): run-time error JS1004: Expected ';': )
9(1728,90-91): run-time error JS1004: Expected ';': )
10(1733,25-26): run-time error JS1002: Syntax error: }
11(1739,21-22): run-time error JS1002: Syntax error: }
12(1761,69-70): run-time error JS1100: Expected ',': =
13(1781,139-140): run-time error JS1195: Expected expression: >
14(1781,150-151): run-time error JS1003: Expected ':': )
15(1781,152-153): run-time error JS1004: Expected ';': :
16(1787,17-18): run-time error JS1002: Syntax error: }
17(1789,58-59): run-time error JS1004: Expected ';': {
18(1800,18-19): run-time error JS1195: Expected expression: )
19(1802,32-40): run-time error JS1197: Too many errors. The file might not be a JavaScript file: 'change'
20(1786,21-33): run-time error JS1018: 'return' statement outside of function: return false
21 */
22/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */�
vendor: 15,037 bytes, lines 22-23
22
23!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(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&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}
vendor: 4,356 bytes, line 23
23:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];
vendor: 10,068 bytes, line 23
23if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pe
vendor: 8,547 bytes, line 23
23nding",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone
vendor: 51,404 bytes, line 23
23=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={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 ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.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},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"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(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,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":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
23
24;
25/*! jQuery UI - v1.13.2 - 2022-07-14
26* http://jqueryui.com
vendor: 59,368 bytes, lines 27-30
27* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
28* Copyright jQuery Foundation and other contributors; Licensed MIT */
29
30!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(V.isPlainObject(i)?t[e]=V.isPlainObject(t[e])?V.widget.extend({},t[e],i):V.widget.extend({},i):t[e]=i);return t},V.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;V.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=V.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V.data(this,a);t?(t.option(i||{}),t._init&&t._init()):V.data(this,a,new e(i,this))})),n}},V.Widget=function(){},V.Widget._childConstructors=[],V.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=V(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||V(),i=n.add?(function(){var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})}(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}});var s,x,k,o,l,h,c,u,C;V.widget;function D(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function I(t,e){return parseInt(V.css(t,e),10)||0}function T(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,C=V.fn.position,V.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=V("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?V.position.scrollbarWidth():0,height:e?V.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=V(t||window),i=T(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?V(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},V.fn.position=function(u){if(!u||!u.of)return C.apply(this,arguments);var d,p,f,g,m,t,_="string"==typeof(u=V.extend({},u)).of?V(document).find(u.of):V(u.of),v=V.position.getWithinInfo(u.within),b=V.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:T(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=V.extend({},g=e.offset),V.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=D(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=V(this),r=a.outerWidth(),l=a.outerHeight(),e=I(this,"marginLeft"),s=I(this,"marginTop"),n=r+e+I(this,"marginRight")+b.width,o=l+s+I(this,"marginBottom")+b.height,h=V.extend({},m),c=D(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},V.each(["left","top"],function(t,e){V.ui.position[y[t]]&&V.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&k(e+i)<p&&(o.horizontal="center"),f<l&&k(s+n)<f&&(o.vertical="middle"),x(k(e),k(i))>x(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<k(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||k(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<k(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||k(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){V.ui.position.flip.left.apply(this,arguments),V.ui.position.fit.left.apply(this,arguments)},top:function(){V.ui.position.flip.top.apply(this,arguments),V.ui.position.fit.top.apply(this,arguments)}}};V.ui.position,V.extend(V.expr.pseudos,{data:V.expr.createPseudo?V.expr.createPseudo(function(e){return function(t){return!!V.data(t,e)}}):function(t,e,i){return!!V.data(t,i[3])}}),V.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});var t,d=V,p={},e=p.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,g=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],m=d.Color=function(t,e,i,s){return new d.Color.fn.parse(t,e,i,s)},_={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},v={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},b=m.support={},y=d("<p>")[0],w=d.each;function P(t){return null==t?t+"":"object"==typeof t?p[e.call(t)]||"object":typeof t}function M(t,e,i){var s=v[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function S(s){var n=m(),o=n._rgba=[];return s=s.toLowerCase(),w(g,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[_[e].cache]=i[_[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&d.extend(o,B.transparent),n):B[s]}function H(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}y.style.cssText="background-color:rgba(1,1,1,.5)",b.rgba=-1<y.style.backgroundColor.indexOf("rgba"),w(_,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),d.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){p["[object "+e+"]"]=e.toLowerCase()}),(m.fn=d.extend(m.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=d(n).css(t),t=void 0);var o=this,s=P(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(S(n)||B._default):"array"===s?(w(_.rgba.props,function(t,e){a[e.idx]=M(n[e.idx],e)}),this):"object"===s?(w(_,n instanceof m?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;w(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=M(n[t],e,!0)}),o[s]&&d.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=m(t),o=!0,a=this;return w(_,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],w(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return w(_,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=m(t))._space(),i=_[e],t=0===this.alpha()?m("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return w(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=v[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=M((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=m(t)._rgba;return m(d.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=d.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=d.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+d.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=m.fn,_.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},_.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*H(s,i,e+1/3)),Math.round(255*H(s,i,e)),Math.round(255*H(s,i,e-1/3)),t]},w(_,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;m.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=P(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return w(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=M(t,e)}),r?((t=m(r(n)))[o]=n,t):m(n)},w(e,function(a,r){m.fn[a]||(m.fn[a]=function(t){var e,i=P(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=P(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(m.hook=function(t){t=t.split(" ");w(t,function(t,o){d.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==P(e)||(i=S(e)))){if(e=m(i||e),!b.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=d.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},d.fx.step[o]=function(t){t.colorInit||(t.start=m(t.elem,o),t.end=m(t.end),t.colorInit=!0),d.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),d.cssHooks.borderColor={expand:function(i){var s={};return w(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var z,A,O,N,E,W,F,L,R,Y,B=d.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},j="ui-effects-",q="ui-effects-style",K="ui-effects-animated";function U(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function X(t,e,i,s){return t={effect:t=V.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!V.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&V.extend(t,e),i=i||e.duration,t.duration=V.fx.off?0:"number"==typeof i?i:i in V.fx.speeds?V.fx.speeds[i]:V.fx.speeds._default,t.complete=s||e.complete,t}function $(t){return!t||"number"==typeof t||V.fx.speeds[t]||("string"==typeof t&&!V.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function G(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}V.effects={effect:{}},N=["add","remove","toggle"],E={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},V.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){V.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(d.style(t.elem,e,t.end),t.setAttr=!0)}}),V.fn.addBack||(V.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),V.effects.animateClass=function(n,t,e,i){var o=V.speed(t,e,i);return this.queue(function(){var i=V(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:V(this),start:U(this)}}),s=function(){V.each(N,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=U(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(E[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:(O=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):O.apply(this,arguments)}),removeClass:(A=V.fn.removeClass,function(t,e,i,s){return 1<arguments.length?V.effects.animateClass.call(this,{remove:t},e,i,s):A.apply(this,arguments)}),toggleClass:(z=V.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?V.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):z.apply(this,arguments):V.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return V.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),V.expr&&V.expr.pseudos&&V.expr.pseudos.animated&&(V.expr.pseudos.animated=(W=V.expr.pseudos.animated,function(t){return!!V(t).data(K)||W(t)})),!1!==V.uiBackCompat&&V.extend(V.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(j+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(j+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=V("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(q,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(q)||"",t.removeData(q)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=V("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=j+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),V.fn.extend({effect:function(){function t(t){var e=V(this),i=V.effects.mode(e,r)||o;e.data(K,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||V.effects.saveStyle(e),"function"==typeof t&&t()}var s=X.apply(this,arguments),n=V.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return V.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=V(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===V.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(K),V.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(R=V.fn.show,function(t){if($(t))return R.apply(this,arguments);t=X.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(L=V.fn.hide,function(t){if($(t))return L.apply(this,arguments);t=X.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(F=V.fn.toggle,function(t){if($(t)||"boolean"==typeof t)return F.apply(this,arguments);t=X.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return V.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):G(this.css("clip"),this)},transfer:function(t,e){var i=V(this),s=V(t.to),n="fixed"===s.css("position"),o=V("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=V("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=G(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},Y={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){Y[t]=function(t){return Math.pow(t,e+2)}}),V.extend(Y,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(Y,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});y=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g<c;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),V.effects.unshift(n,t,1+o)}),V.effects.define("clip","hide",function(t,e){var i={},s=V(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},V.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("drop","hide",function(t,e){var i=V(this),s="show"===t.mode,n=t.direction||"left",o="up"===n||"down"===n?"top":"left",a="up"===n||"left"===n?"-=":"+=",r="+="==a?"-=":"+=",l={opacity:0};V.effects.createPlaceholder(i),n=t.distance||i["top"==o?"outerHeight":"outerWidth"](!0)/2,l[o]=a+n,s&&(i.css(l),l[o]=r+n,l.opacity=1),i.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=V(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/h),f=Math.ceil(c.outerHeight()/l),g=[];function m(){g.push(this),g.length===l*h&&(c.css({visibility:"visible"}),V(g).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*f,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*p,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l<o;l++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),V.effects.unshift(i,s,1+o)}),V.effects.define("shake",function(t,e){var i=1,s=V(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,l=Math.round(t.duration/r),h="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},n=s.queue().length;for(V.effects.createPlaceholder(s),u[h]=(c?"-=":"+=")+o,d[h]=(c?"+=":"-=")+2*o,p[h]=(c?"-=":"+=")+2*o,s.animate(u,l,t.easing);i<a;i++)s.animate(d,l,t.easing).animate(p,l,t.easing);s.animate(d,l,t.easing).animate(u,l/2,t.easing).queue(e),V.effects.unshift(s,n,1+r)}),V.effects.define("slide","show",function(t,e){var i,s,n=V(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};V.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),y=!1!==V.uiBackCompat?V.effects.define("transfer",function(t,e){V(this).transfer(t,e)}):y;V.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=V("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=V(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&V(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(V(t)))},V.extend(V.expr.pseudos,{focusable:function(t){return V.ui.focusable(t,null!=V.attr(t,"tabindex"))}});var Q,J;V.ui.focusable,V.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):V(this[0].form)},V.ui.formResetMixin={_formResetHandler:function(){var e=V(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");V.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(V.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};V.expr.pseudos||(V.expr.pseudos=V.expr[":"]),V.uniqueSort||(V.uniqueSort=V.unique),V.escapeSelector||(Q=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,J=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},V.escapeSelector=function(t){return(t+"").replace(Q,J)}),V.fn.even&&V.fn.odd||V.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});var Z;V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+V.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},V.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=V(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:V(this[0].ownerDocument||document)},V.extend(V.expr.pseudos,{tabbable:function(t){var e=V.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&V.ui.focusable(t,i)}}),V.fn.extend({uniqueId:(Z=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++Z)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}}),V.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),V.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},V.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=V.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:V(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
30se")},_closeOnDocumentClick:function(t){return!V(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=V(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=V(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||V(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(V(this).children(".ui-menu-item-wrapper").text()))})}});V.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value(
vendor: 12,087 bytes, line 30
30)},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:V.map(t,function(t){return"string"==typeof t?{label:t,value:t}:V.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(V.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;V.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return V("<li>").append(V("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(e))},100))}});V.ui.autocomplete;var tt=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(tt,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();
vendor: 1,426 bytes, line 30
30this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V("<span>"),this.iconSpace=V("<span> </span>
30"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var et;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===V.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=V("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconS
vendor: 13,579 bytes, line 30
30pace||(this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==V.uiBackCompat&&(V.widget("ui.button",V.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),V.fn.button=(et=V.fn.button,function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t=V(this).attr("type"),e=V.data(this,"ui-"+("checkbox"!==t&&"radio"!==t?"button":"checkboxradio"));return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for button widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V(this).attr("type"),e="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",t=V.data(this,"ui-"+e);t?(t.option(i||{}),t._init&&t._init()):"button"!=e?V(this).checkboxradio(V.extend({icon:!1},i)):et.call(V(this),i)})),n}),V.fn.buttonset=function(){return V.ui.controlgroup||V.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var it;V.ui.button;function st(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=nt(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function nt(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,ot)}function ot(){V.datepicker._isDisabledDatepicker((it.inline?it.dpDiv.parent():it.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function at(t,e){for(var i in V.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(st.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return at(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(V(t),n)).settings=V.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?nt(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=V(t);e.append=V([]),e.trigger=V([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),V.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=V("<span>").addClass(this._appendClass).text(s),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),this._get(e,"buttonImageOnly")?e.trigger=V("<img>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):(e.trigger=V("<button type='button'>").addClass(this._triggerClass),i?e.trigger.html(V("<img>").attr({src:i,alt:s,title:s})):e.trigger.text(s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===t[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==t[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=V(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),V.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",a)),at(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=V(t),s=V.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),V.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),it===s&&(it=null,this._curInst=null))},_enableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return V.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?V.extend({},V.datepicker._defaults):o?"all"===e?V.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),e=this._getMinMaxDate(o,"min"),i=this._getMinMaxDate(o,"max"),at(o.settings,s),null!==e&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,e)),null!==i&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,i)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(V(t),o),this._autoSize(o),this._setDate(o,n),this._updateAlternate(o),this._updateDatepicker(o))}
vendor: 3,508 bytes, line 30
30,_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=V.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,V.datepicker._datepickerShowing)switch(t.keyCode){case 9:V.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",s.dpDiv))[0]&&V.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=V.datepicker._get(s,"onSelect"))?(i=V.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&V.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&V.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?V.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=V.datepicker._getInst(t.target);if(V.datepicker._get(i,"constrainInput"))return e=V.datepicker._possibleChars(V.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){t=V.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{V.datepicker.parseDate(V.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,V.datepicker._getFormatConfig(t))&&(V.datepicker._setDateFromField(t),V.datepicker._updateAlternate(t),V.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=V("input",t.parentNode)[0]),V.datepicker._isDisabledDatepicker(t)||V.datepicker._lastInput===t||(n=V.datepicker._getInst(t),V.datepicker._curInst&&V.datepicker._curInst!==n&&(V.datepicker._curInst.dpDiv.stop(!0,!0),n&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(i=(s=V.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(at(n.settings,i),n.lastVal=null,V.datepicker._lastInput=t,V.datepicker._setDateFromField(n),V.datepicker._inDialog&&(t.value=""),
vendor: 32,153 bytes, line 30
30V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(t),V.datepicker._pos[1]+=t.offsetHeight),e=!1,V(t).parents().each(function(){return!(e|="fixed"===V(this).css("position"))}),s={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(n),s=V.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=V.datepicker._get(n,"showAnim"),s=V.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(V(t))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[i]?n.dpDiv.show(i,V.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),V.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),V.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(it=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a"),o=V.datepicker._get(t,"onUpdateDatepicker");0<n.length&&ot.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),e=t.yearshtml=null},0)),o&&o.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:V(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:V(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?V(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?V(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||V.expr.pseudos.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=V(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==V.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){V.datepicker._tidyDialog(s)},V.effects&&(V.effects.effect[e]||V.effects[e])?s.dpDiv.hide(e,V.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;V.datepicker._curInst&&(e=V(t.target),t=V.datepicker._getInst(e[0]),(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!e.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===t)||V.datepicker._hideDatepicker())},_adjustDate:function(t,e,i){var s=V(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e,i),this._updateDatepicker(t))},_gotoToday:function(t){var e=V(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=V(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=V(t);V(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=parseInt(V("a",s).attr("data-date")),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=V(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=V(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),V(document).find(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o,a=0,r=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,r="string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10),l=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,c=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,u=(t?t.monthNames:null)||this._defaults.monthNames,d=-1,p=-1,f=-1,g=-1,m=!1,_=function(t){t=w+1<e.length&&e.charAt(w+1)===t;return t&&w++,t},v=function(t){var e=_(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(a).match(e);if(!e)throw"Missing number at position "+a;return a+=e[0].length,parseInt(e[0],10)},b=function(t,e,i){var s=-1,e=V.map(_(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(V.each(e,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase())return s=e[0],a+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+a},y=function(){if(n.charAt(a)!==e.charAt(w))throw"Unexpected literal at position "+a;a++},w=0;w<e.length;w++)if(m)"'"!==e.charAt(w)||_("'")?y():m=!1;else switch(e.charAt(w)){case"d":f=v("d");break;case"D":b("D",l,h);break;case"o":g=v("o");break;case"m":p=v("m");break;case"M":p=b("M",c,u);break;case"y":d=v("y");break;case"@":d=(o=new Date(v("@"))).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"!":d=(o=new Date((v("!")-this._ticksTo1970)/1e4)).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"'":_("'")?y():m=!0;break;default:y()}if(a<n.length&&(s=n.substr(a),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===d?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=r?0:-100)),-1<g)for(p=1,f=g;;){if(f<=(i=this._getDaysInMonth(d,p-1)))break;p++,f-=i}if((o=this._daylightSavingAdjust(new Date(d,p-1,f))).getFullYear()!==d||o.getMonth()+1!==p||o.getDate()!==f)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,h=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),l,h);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return V.datepicker.parseDate(V.datepicker._get(r,"dateFormat"),t,V.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?V.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){V.datepicker._adjustDate(i,-e,"M")},next:function(){V.datepicker._adjustDate(i,+e,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(i)},selectDay:function(){return V.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(i,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,x,k,C,D,I,T,P,M,S,H,z,A=new Date,O=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),N=this._get(t,"isRTL"),E=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),F=this._get(t,"navigationAsDateFormat"),L=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),A=this._get(t,"stepMonths"),Y=1!==L[0]||1!==L[1],B=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),j=this._getMinMaxDate(t,"min"),q=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),q)for(e=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-L[0]*L[1]+1,q.getDate())),e=j&&e<j?j:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-A,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML,R=this._get(t,"nextText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+A,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:R}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML,A=this._get(t,"currentText"),W=this._get(t,"gotoCurrent")&&t.currentDay?B:O,A=F?this.formatDate(A,W,this._getFormatConfig(t)):A,R="",t.inline||(R=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),F="",E&&(F=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(N?R:"").append(this._isInRange(t,W)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(N?"":R)[0].outerHTML),n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),a=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),c=this._get(t,"beforeShowDay"),u=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<L[0];m++){for(_="",this.maxRows=4,v=0;v<L[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),y=" ui-corner-all",w="",Y){if(w+="<div class='ui-datepicker-group",1<L[1])switch(v){case 0:w+=" ui-datepicker-group-first",y=" ui-corner-"+(N?"right":"left");break;case L[1]-1:w+=" ui-datepicker-group-last",y=" ui-corner-"+(N?"left":"right");break;default:w+=" ui-datepicker-group-middle",y=""}w+="'>"}for(w+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===m?N?s:i:"")+(/all|right/.test(y)&&0===m?N?i:s:"")+this._generateMonthYearHeader(t,K,U,j,q,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)x+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+a[k=(g+n)%7]+"'>"+r[k]+"</span></th>";for(w+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P<I;P++){for(w+="<tr>",M=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(T)+"</td>":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T<j||q&&q<T,M+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(T.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===T.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(z?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!u?"":" "+S[1]+(T.getTime()===B.getTime()?" "+this._currentClass:"")+(T.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(H&&!u||!S[2]?"":" title='"+S[2].replace(/'/g,"&#39;")+"'")+(z?"":" data-handler='selectDay' data-event='click' data-month='"+T.getMonth()+"' data-year='"+T.getFullYear()+"'")+">"+(H&&!u?"&#xa0;":z?"<span class='ui-state-default'>"+T.getDate()+"</span>":"<a class='ui-state-default"+(T.getTime()===O.getTime()?" ui-state-highlight":"")+(T.getTime()===B.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#' aria-current='"+(T.getTime()===B.getTime()?"true":"false")+"' data-date='"+T.getDate()+"'>"+T.getDate()+"</a>")+"</td>",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+"</tr>"}11<++K&&(K=0,U++),_+=w+="</tbody></table>"+(Y?"</div>"+(0<L[0]&&v===L[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=F,t._keyEvent=!1,f},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="<div class='ui-datepicker-title'>",y="";if(o||!f)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+_+"' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!l||c>=s.getMonth())&&(!h||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(m||(b+=y+(!o&&f&&g?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!g)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' aria-label='"+v+"' data-handler='selectYear' data-event='change'>";d<=p;d++)t.yearshtml+="<option value='"+d+"'"+(d===i?" selected='selected'":"")+">"+d+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,o=null,a=this._get(t,"yearRange");return a&&(t=a.split(":"),a=(new Date).getFullYear(),n=parseInt(t[0],10),o=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=a),t[1].match(/[+\-].*/)&&(o+=a)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new st,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker,V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var rt=!1;V(document).on("mouseup",function(){rt=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!rt){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),rt=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,rt=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},V.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&V(t).trigger("blur")};V.widget("ui.draggable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<V(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=V(this);return V("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===V(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),V.ui.ddmanager&&!e.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),V.ui.ddmanager&&V.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new V.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return V.ui.ddmanager&&!this.options.dropBehaviour&&(i=V.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,i)?V(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),V.ui.ddmanager&&V.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),V.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new V.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!V(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i="function"==typeof e.helper,t=i?V(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}
vendor: 4,254 bytes, line 30
30:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=V(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,V(n).width()-this.helperProportions.width-this.margins.left,(V(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[V(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,V(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,V(window).scrollLeft()+V(window).width()-this.helperProportions.width-this.margins.left,V(window).scrollTop()+(V(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>
vendor: 586 bytes, line 30
30i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a
vendor: 6,471 bytes, line 30
30-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-V(a).scrollTop()<s.scrollSensitivity?n=V(a).scrollTop(V(a).scrollTop()-s.scrollSpeed):V(window).height()-(t.pageY-V(a).scrollTop())<s.scrollSensitivity&&(n=V(a).scrollTop(V(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-V(a).scrollLeft()<s.scrollSensitivity?n=V(a).scrollLeft(V(a).scrollLeft()-s.scrollSpeed):V(window).width()-(t.pageX-V(a).scrollLeft())<s.scrollSensitivity&&(n=V(a).scrollLeft(V(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&V.ui.ddmanager&&!s.dropBehaviour&&V.ui.ddmanager.prepareOffsets(i,t)}}),V.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],V(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=V(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,l,h,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||c+p<m||!V.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a
vendor: 9,875 bytes, line 30
30&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),V.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=V.makeArray(V(i.stack)).sort(function(t,e){return(parseInt(V(t).css("zIndex"),10)||0)-(parseInt(V(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(V(i[0]).css("zIndex"),10)||0,V(i).each(function(t){V(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),V.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&V(e.helper).css("zIndex",i._zIndex)}});V.ui.draggable;V.widget("ui.resizable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===V(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),V.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(V("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=String.prototype.trim.call(i[e])),n=V("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left
vendor: 5,511 bytes, line 30
30=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||V("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0}
vendor: 2,289 bytes, line 30
30,r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left
vendor: 32,344 bytes, line 30
30:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=o.top-u):(p=h-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=o.left-c):(d=l-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});V.ui.resizable;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("<button type='button'></button>").button({label:V("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=V("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog;function lt(t,e,i){return e<=t&&t<e+i}V.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){V.ui.ddmanager.droppables[t]=V.ui.ddmanager.droppables[t]||[],V.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=V.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept="function"==typeof e?e:function(t){return t.is(e)}:"scope"===t&&(i=V.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=V.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=V.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||V.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=V(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&V.ui.intersect(i,V.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),V.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,c=l+e.proportions().width,u=h+e.proportions().height;switch(i){case"fit":return l<=n&&a<=c&&h<=o&&r<=u;case"intersect":return l<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&h<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return lt(s.pageY,h,e.proportions().height)&&lt(s.pageX,l,e.proportions().width);case"touch":return(h<=o&&o<=u||h<=r&&r<=u||o<h&&u<r)&&(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a);default:return!1}},!(V.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=V.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return V.each((V.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&V.ui.intersect(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&V.ui.ddmanager.prepareOffsets(n,o),V.each(V.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=V.ui.intersect(n,this,this.options.tolerance,o))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return V(this).droppable("instance").options.scope===e})).length&&((t=V(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)}})!==V.uiBackCompat&&V.widget("ui.droppable",V.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});V.ui.droppable,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;return l<a&&(t=l,l=a,a=t),h<r&&(t=h,h=r,r=t),this.helper.css({left:a,top:r,width:l-a,height:h-r}),this.selectees.each(function(){var t=V.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>l||i.right<a||i.top>h||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<l&&i.top>r&&i.bottom<h),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,V(".ui-unselecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),V(".ui-selecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=V("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(V.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=V("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";V.each(t,function(t,e){var i;e.optgroup!==o&&(i=V("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=V("<li>"),s=V("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")}
vendor: 4,336 bytes, line 30
30,_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.trigger("focus"))},_documentClick:{mousedown:function(t){this.isOpen&&(V(t.target).closest(".ui-selectmenu-menu, #"+V.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case V.ui.keyCode.TAB:case V.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case V.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case V.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case V.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case V.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case V.ui.keyCode.LEFT:this._move("prev",t);break;case V.ui.keyCode.RIGHT:this._move("next",t);break;case V.ui.keyCode.HOME:case V.ui.keyCode.PAGE_UP:this._move("first",t);break;case V.ui.keyCode.END:case V.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){e.hidden||s.push(i._parseOption(V(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),V.widget("ui.slider",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null}
vendor: 4,689 bytes, line 30
30,numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(V(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){V(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=V("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),a={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(a),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=V(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!V(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value(
vendor: 4,839 bytes, line 30
30)},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!Array.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,l=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",V(this).stop(1,1)[l?"animate":"css"](h,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=V(t.target).data("ui-slider-handle-index");switch(t.keyCode){case V.ui.keyCode.HOME:case V.ui.keyCode.END:case V.ui.keyCode.PAGE_UP:case V.ui.keyCode.PAGE_DOWN:case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(V(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case V.ui.keyCode.HOME:i=this._valueMin();break;case V.ui.keyCode.END:i=this._valueMax();break;case V.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;
vendor: 10,695 bytes, line 30
30case V.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=V(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(V(t.target),null,"ui-state-active"))}}}),V.widget("ui.sortable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),V.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),V(t.target).parents().each(function(){if(V.data(this,n.widgetName+"-item")===n)return i=V(this),!1}),!!(i=V.data(t.target,n.widgetName+"-item")===n?V(t.target):i)&&(!(this.options.handle&&!e&&(V(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=V("parent"!==o.appendTo?o.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},V.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),V.extend(this.offset,{parent:this._getParentOffset()}),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=V("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,n,o=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),o.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||V.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&V.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return V.ui.ddmanager&&!this.options.dropBehaviour&&V.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,V(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new V.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),V.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?V(this.domPosition.prev).after(this.currentItem):V(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},V(t).each(function(){var t=(V(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(V(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,h="x"===this.options.axis||r<s+h&&s+h<l,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s
vendor: 4,080 bytes, line 30
30&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=V(r[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push(["function"==typeof n.options.items?n.options.items.call(n.element):V(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){o.push(this)}for(a.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):V(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(l);return V(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=V.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,l,h=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):V(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=V(u[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],t,{item:this.currentItem}):V(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],l=(a=c[e][i=0]).length;i<l;i++)(r=V(a[i])).data(this.widgetName+"-item",o),h.push({item:r,instance:o,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?V(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,n=i.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var t=V("<"+n+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("<tr>",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()
vendor: 35,950 bytes, lines 30-35
30||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V("<td>&#160;</td>",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)<i&&(i=Math.abs(t[h]-a),s=this.items[e],this.direction=r?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[u]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?V(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&V.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=V(i.containment)[0],e=V(i.containment).offset(),i="hidden"!==V(t).css("overflow"),this.containment=[e.left+(parseInt(V(t).css("borderLeftWidth"),10)||0)+(parseInt(V(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(V(t).css("borderTopWidth"),10)||0)+(parseInt(V(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(V(t).css("borderLeftWidth"),10)||0)-(parseInt(V(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(V(t).css("borderTopWidth"),10)||0)-(parseInt(V(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===V.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||V([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});function ht(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}V.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===V.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===V.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(V(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=V.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?"function"==typeof e?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:ht(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:ht(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:ht(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:ht(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:ht(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());ht(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==V.uiBackCompat&&V.widget("ui.spinner",V.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var ct;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(ct=/#.*$/,function(t){var e=t.href.replace(ct,""),i=location.href.replace(ct,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=V.uniqueSort(t.disabled.concat(V.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=V(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(V(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):V()}},_tabKeydown:function(t){var e=V(V.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:i++;break;case V.ui.keyCode.UP:case V.ui.keyCode.LEFT:s=!1,i--;break;case V.ui.keyCode.END:i=this.anchors.length-1;break;case V.ui.keyCode.HOME:i=0;break;case V.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case V.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===V.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===V.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===V.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==V.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("<div>").attr("role","tooltip"),i=V("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip});;
31// Unobtrusive Ajax support library for jQuery
32// Copyright (c) .NET Foundation. All rights reserved.
33// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
34// @version v3.2.6
35// 
36// Microsoft grants you the right to use these script files for the sole
37// purpose of either: (i) interacting through your browser with the Microsoft
38// website or online service, subject to the applicable licensing or use
39// terms; or (ii) using the files as included with a Microsoft product subject
40// to that product's license terms. Microsoft reserves all other rights to the
41// files not expressly granted by Microsoft, whether by implication, estoppel
42// or otherwise. Insofar as a script file is dual licensed under GPL,
43// Microsoft neither took the code under GPL nor distributes it thereunder but
44// under the terms set out in this paragraph. All notices and licenses
45// below are for informational purposes only.
46!function(t){function a(t,a){for(var e=window,r=(t||"").split(".");e&&r.length;)e=e[r.shift()];return"function"==typeof e?e:(a.push(t),Function.constructor.apply(null,a))}function e(t){return"GET"===t||"POST"===t}function r(t,a){e(a)||t.setRequestHeader("X-HTTP-Method-Override",a)}function n(a,e,r){var n;r.indexOf("application/x-javascript")===-1&&(n=(a.getAttribute("data-ajax-mode")||"").toUpperCase(),t(a.getAttribute("data-ajax-update")).each(function(a,r){switch(n){case"BEFORE":t(r).prepend(e);break;case"AFTER":t(r).append(e);break;case"REPLACE-WITH":t(r).replaceWith(e);break;default:t(r).html(e)}}))}function i(i,u){var o,c,d,s;if(o=i.getAttribute("data-ajax-confirm"),!o||window.confirm(o)){c=t(i.getAttribute("data-ajax-loading")),s=parseInt(i.getAttribute("data-ajax-loading-duration"),10)||0,t.extend(u,{type:i.getAttribute("data-ajax-method")||void 0,url:i.getAttribute("data-ajax-url")||void 0,cache:"true"===(i.getAttribute("data-ajax-cache")||"").toLowerCase(),beforeSend:function(t){var e;return r(t,d),e=a(i.getAttribute("data-ajax-begin"),["xhr"]).apply(i,arguments),e!==!1&&c.show(s),e},complete:function(){c.hide(s),a(i.getAttribute("data-ajax-complete"),["xhr","status"]).apply(i,arguments)},success:function(t,e,r){n(i,t,r.getResponseHeader("Content-Type")||"text/html"),a(i.getAttribute("data-ajax-success"),["data","status","xhr"]).apply(i,arguments)},error:function(){a(i.getAttribute("data-ajax-failure"),["xhr","status","error"]).apply(i,arguments)}}),u.data.push({name:"X-Requested-With",value:"XMLHttpRequest"}),d=u.type.toUpperCase(),e(d)||(u.type="POST",u.data.push({name:"X-HTTP-Method-Override",value:d}));var p=t(i);if(p.is("form")&&"multipart/form-data"==p.attr("enctype")){var f=new FormData;t.each(u.data,function(t,a){f.append(a.name,a.value)}),t("input[type=file]",p).each(function(){var a=this;t.each(a.files,function(t,e){f.append(a.name,e)})}),t.extend(u,{processData:!1,contentType:!1,data:f})}t.ajax(u)}}function u(a){var e=t(a).data(d);return!e||!e.validate||e.validate()}var o="unobtrusiveAjaxClick",c="unobtrusiveAjaxClickTarget",d="unobtrusiveValidation";t(document).on("click","a[data-ajax=true]",function(t){t.preventDefault(),i(this,{url:this.href,type:"GET",data:[]})}),t(document).on("click","form[data-ajax=true] input[type=image]",function(a){var e=a.target.name,r=t(a.target),n=t(r.parents("form")[0]),i=r.offset();n.data(o,[{name:e+".x",value:Math.round(a.pageX-i.left)},{name:e+".y",value:Math.round(a.pageY-i.top)}]),setTimeout(function(){n.removeData(o)},0)}),t(document).on("click","form[data-ajax=true] :submit",function(a){var e=a.currentTarget.name,r=t(a.target),n=t(r.parents("form")[0]);n.data(o,e?[{name:e,value:a.currentTarget.value}]:[]),n.data(c,r),setTimeout(function(){n.removeData(o),n.removeData(c)},0)}),t(document).on("submit","form[data-ajax=true]",function(a){var e=t(this).data(o)||[],r=t(this).data(c),n=r&&(r.hasClass("cancel")||void 0!==r.attr("formnovalidate"));a.preventDefault(),(n||u(this))&&i(this,{url:this.action,type:this.method||"GET",data:e.concat(t(this).serializeArray())})})}(jQuery);;
47/*! jQuery Validation Plugin - v1.19.5 - 7/1/2022
48 * https://jqueryvalidation.org/
49 * Copyright (c) 2022 Jörn Zaefferer; Licensed MIT */
50!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element
vendor: 18,761 bytes, line 50
50(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=".  Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return void 0===a?"":a.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()&&0===this.pendingRequest?(a(this.currentForm).trigger("submit"),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a["date"===b?"dateISO":c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(a,d){b[a]="function"==typeof d&&"normalizer"!==a?d(c):d}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var a;b[this]&&(Array.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(a=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(a[0]),Number(a[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.val
50idator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c},maxlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d<=c},rangelength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c[0]&&d<=c[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,c){var e=a.port;"abort"===a.mode&&(d[e]&&d[e].abort(),d[e]=c)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(d[f]&&d[f].abort(),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a});;
51/**
52 * @license
53 * Unobtrusive validation support library for jQuery and jQuery Validate
54 * Copyright (c) .NET Foundation. All rights reserved.
55 * Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
56 * @version v4.0.0
57 */
58!function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(s){var a,o=s.validator,d="unobtrusiveValidation";function l(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function u(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function n(a){return a.substr(0,a.lastIndexOf(".")+1)}function m(a,e){return a=0===a.indexOf("*.")?a.replace("*.",e):a}function f(a){var e=s(this),n="__jquery_unobtrusive_validation_form_reset";if(!e.data(n)){e.data(n,!0);try{e.data("validator").resetForm()}finally{e.removeData(n)}
vendor: 4,665 bytes, line 58
58e.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),e.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function p(n){function a(a,e){(a=r[a])&&s.isFunction(a)&&a.apply(n,e)}var e=s(n),t=e.data(d),i=s.proxy(f,n),r=o.unobtrusive.options||{};return t||(t={options:{errorClass:r.errorClass||"input-validation-error",errorElement:r.errorElement||"span",errorPlacement:function(){!function(a,e){var e=s(this).find("[data-valmsg-for='"+u(e[0].name)+"']"),n=(n=e.attr("data-valmsg-replace"))?!1!==s.parseJSON(n):null;e.removeClass("field-validation-valid").addClass("field-validation-error"),a.data("unobtrusiveContainer",e),n?(e.empty(),a.removeClass("input-validation-error").appendTo(e)):a.hide()}.apply(n,arguments),a("errorPlacement",arguments)},invalidHandler:function(){!function(a,e){var n=s(this).find("[data-valmsg-summary=true]"),t=n.find("ul");t&&t.length&&e.errorList.length&&(t.empty(),n.addClass("validation-summary-errors").removeClass("validation-summary-valid"),s.each(e.errorList,function(){s("<li />").html(this.message).appendTo(t)}))}.apply(n,arguments),a("invalidHandler",arguments)},messages:{},rules:{},success:function(){!function(a){var e,n=a.data("unobtrusiveContainer");n&&(e=(e=n.attr("data-valmsg-replace"))?s.parseJSON(e):null,n.addClass("field-validation-valid").removeClass("field-validation-error"),a.removeData("unobtrusiveContainer"),e&&n.empty())}.apply(n,arguments),a("success",arguments)}},attachValidation:function(){e.off("reset."+d,i).on("reset."+d,i).validate(this.options)},validate:function(){return e.validate(),e.valid()}},e.data(d,t)),t}return o.unobtrusive={adapters:[],parseElement:function(t,a){var e,i,r,o=s(t),d=o.parents("form")[0];d&&((e=p(d)).options.rules[t.name]=i={},e.options.messages[t.name]=r={},s.each(this.adapters,function(){var a="data-val-"+this.name,e=o.attr(a),n={};void 0!==e&&(a+="-",s.each(this.params,function(){n[this]=o.attr(a+this)}),this.adapt({element:t,form:d,message:e,params:n,rules:i,messages:r}))}),s.extend(i,{__dummy__:!0}),a||e.attachValidation())},parse:function(a){var a=s(a),e=a.parents().addBack().filter("form").add(a.find("form")).has("[data-val=true]");a.find("[data-val=true]").each(function(){o.unobtrusive.parseElement(this,!0)}),e.each(function(){var a=p(this);a&&a.attachValidation()})}},(a=o.unobtrusive.adapters).add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},a.addBool=function(e,n){return this.add(e,function(a){l(a,n||e,!0)})},a.addMinMax=function(a,t,i,r,e,n){return this.add(a,[e||"min",n||"max"],function(a){var e=a.params.min,n=a.params.max;e&&n?l(a,r,[e,n]):e?l(a,t,e):n&&l(a,i,n)})},a.addSingleVal=function(e,n,t){return this.add(e,[n||"val"],function(a){l(a,t||e,a.params[n])})},o.addMethod("__dummy__",function(a,e,n){return!0}),o.addMethod("regex",function(a,e,n){return!!this.optional(e)||(e=new RegExp(n).exec(a))&&0===e.index&&e[0].length===a.length}),o.addMethod("nonalphamin",function(a,e,n){var t;return t=n?(t=a.match(/\W/g))&&t.length>=n:t}),o.methods.extension?(a.addSingleVal("accept","mimtype"),a.addSingleVal("extension","extension")):a.addSingleVal("extension","extension","accept"),a.addSingleVal("regex","pattern"),a.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),a.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),a.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),a.add("equalto",["other"],function(a){var e=n(a.element.name),e=m(a.params.other,e);l(a,"equalTo",s(a.form).find(":input").filter("[name='"+u(e)+"']")[0])}),a.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||l(a,"required",!0)}),a.add("remote",["url","type","additionalfields"],function(t){var i={url:t.params.url,type:t.params.type||"GET",data:{}},r=n(t.element.name);s.each((t.params.additionalfields||t.element.name).replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g),function(a,e){var n=m(e,r);i.data[n]=function(){var a=s(t.form).find(":input").filter("[name='"+u(n)+"']");return a.is(":checkbox")?a.filter(":checked").val()||a.filter(":hidden").val()||"":a.is(":radio")?a.filter(":checked").val()||"":a.val()}}),l(t,"remote",i)}),a.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&l(a,"minlength",a.params.min),a.params.nonalphamin&&l(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&l(a,"regex",a.params.regex)}
58),a.add("fileextensions",["extensions"],function(a){l(a,"extension",a.params.extensions)}),s(function(){o.unobtrusive.parse(document)}),o.unobtrusive});
59// SIG // Begin signature block
60// SIG // MIInuAYJKoZIhvcNAQcCoIInqTCCJ6UCAQExDzANBglg
61// SIG // hkgBZQMEAgEFADB3BgorBgEEAYI3AgEEoGkwZzAyBgor
62// SIG // BgEEAYI3AgEeMCQCAQEEEBDgyQbOONQRoqMAEEvTUJAC
63// SIG // AQACAQACAQACAQACAQAwMTANBglghkgBZQMEAgEFAAQg
64// SIG // YeqK02aCVsrSZ55r492l8ca/IFf5F+DLPiYYB6e5igeg
65// SIG // gg2BMIIF/zCCA+egAwIBAgITMwAAAlKLM6r4lfM52wAA
66// SIG // AAACUjANBgkqhkiG9w0BAQsFADB+MQswCQYDVQQGEwJV
67// SIG // UzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMH
68// SIG // UmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv
69// SIG // cmF0aW9uMSgwJgYDVQQDEx9NaWNyb3NvZnQgQ29kZSBT
70// SIG // aWduaW5nIFBDQSAyMDExMB4XDTIxMDkwMjE4MzI1OVoX
71// SIG // DTIyMDkwMTE4MzI1OVowdDELMAkGA1UEBhMCVVMxEzAR
72// SIG // BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v
73// SIG // bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlv
74// SIG // bjEeMBwGA1UEAxMVTWljcm9zb2Z0IENvcnBvcmF0aW9u
75// SIG // MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
76// SIG // 0OTPj7P1+wTbr+Qf9COrqA8I9DSTqNSq1UKju4IEV3HJ
77// SIG // Jck61i+MTEoYyKLtiLG2Jxeu8F81QKuTpuKHvi380gzs
78// SIG // 43G+prNNIAaNDkGqsENQYo8iezbw3/NCNX1vTi++irdF
79// SIG // qXNs6xoc3B3W+7qT678b0jTVL8St7IMO2E7d9eNdL6RK
80// SIG // fMnwRJf4XfGcwL+OwwoCeY9c5tvebNUVWRzaejKIkBVT
81// SIG // hApuAMCtpdvIvmBEdSTuCKZUx+OLr81/aEZyR2jL1s2R
82// SIG // KaMz8uIzTtgw6m3DbOM4ewFjIRNT1hVQPghyPxJ+ZwEr
83// SIG // wry5rkf7fKuG3PF0fECGSUEqftlOptpXTQIDAQABo4IB
84// SIG // fjCCAXowHwYDVR0lBBgwFgYKKwYBBAGCN0wIAQYIKwYB
85// SIG // BQUHAwMwHQYDVR0OBBYEFDWSWhFBi9hrsLe2TgLuHnxG
86// SIG // F3nRMFAGA1UdEQRJMEekRTBDMSkwJwYDVQQLEyBNaWNy
87// SIG // b3NvZnQgT3BlcmF0aW9ucyBQdWVydG8gUmljbzEWMBQG
88// SIG // A1UEBRMNMjMwMDEyKzQ2NzU5NzAfBgNVHSMEGDAWgBRI
89// SIG // bmTlUAXTgqoXNzcitW2oynUClTBUBgNVHR8ETTBLMEmg
90// SIG // R6BFhkNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtp
91// SIG // b3BzL2NybC9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDct
92// SIG // MDguY3JsMGEGCCsGAQUFBwEBBFUwUzBRBggrBgEFBQcw
93// SIG // AoZFaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w
94// SIG // cy9jZXJ0cy9NaWNDb2RTaWdQQ0EyMDExXzIwMTEtMDct
95// SIG // MDguY3J0MAwGA1UdEwEB/wQCMAAwDQYJKoZIhvcNAQEL
96// SIG // BQADggIBABZJN7ksZExAYdTbQJewYryBLAFnYF9amfhH
97// SIG // WTGG0CmrGOiIUi10TMRdQdzinUfSv5HHKZLzXBpfA+2M
98// SIG // mEuJoQlDAUflS64N3/D1I9/APVeWomNvyaJO1mRTgJoz
99// SIG // 0TTRp8noO5dJU4k4RahPtmjrOvoXnoKgHXpRoDSSkRy1
100// SIG // kboRiriyMOZZIMfSsvkL2a5/w3YvLkyIFiqfjBhvMWOj
101// SIG // wb744LfY0EoZZz62d1GPAb8Muq8p4VwWldFdE0y9IBMe
102// SIG // 3ofytaPDImq7urP+xcqji3lEuL0x4fU4AS+Q7cQmLq12
103// SIG // 0gVbS9RY+OPjnf+nJgvZpr67Yshu9PWN0Xd2HSY9n9xi
104// SIG // au2OynVqtEGIWrSoQXoOH8Y4YNMrrdoOmjNZsYzT6xOP
105// SIG // M+h1gjRrvYDCuWbnZXUcOGuOWdOgKJLaH9AqjskxK76t
106// SIG // GI6BOF6WtPvO0/z1VFzan+2PqklO/vS7S0LjGEeMN3Ej
107// SIG // 47jbrLy3/YAZ3IeUajO5Gg7WFg4C8geNhH7MXjKsClsA
108// SIG // Pk1YtB61kan0sdqJWxOeoSXBJDIzkis97EbrqRQl91K6
109// SIG // MmH+di/tolU63WvF1nrDxutjJ590/ALi383iRbgG3zkh
110// SIG // EceyBWTvdlD6FxNbhIy+bJJdck2QdzLm4DgOBfCqETYb
111// SIG // 4hQBEk/pxvHPLiLG2Xm9PEnmEDKo1RJpMIIHejCCBWKg
112// SIG // AwIBAgIKYQ6Q0gAAAAAAAzANBgkqhkiG9w0BAQsFADCB
113// SIG // iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
114// SIG // b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p
115// SIG // Y3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMpTWlj
116// SIG // cm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
117// SIG // IDIwMTEwHhcNMTEwNzA4MjA1OTA5WhcNMjYwNzA4MjEw
118// SIG // OTA5WjB+MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz
119// SIG // aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE
120// SIG // ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSgwJgYDVQQD
121// SIG // Ex9NaWNyb3NvZnQgQ29kZSBTaWduaW5nIFBDQSAyMDEx
122// SIG // MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA
123// SIG // q/D6chAcLq3YbqqCEE00uvK2WCGfQhsqa+laUKq4Bjga
124// SIG // BEm6f8MMHt03a8YS2AvwOMKZBrDIOdUBFDFC04kNeWSH
125// SIG // fpRgJGyvnkmc6Whe0t+bU7IKLMOv2akrrnoJr9eWWcpg
126// SIG // GgXpZnboMlImEi/nqwhQz7NEt13YxC4Ddato88tt8zpc
127// SIG // oRb0RrrgOGSsbmQ1eKagYw8t00CT+OPeBw3VXHmlSSnn
128// SIG // Db6gE3e+lD3v++MrWhAfTVYoonpy4BI6t0le2O3tQ5GD
129// SIG // 2Xuye4Yb2T6xjF3oiU+EGvKhL1nkkDstrjNYxbc+/jLT
130// SIG // swM9sbKvkjh+0p2ALPVOVpEhNSXDOW5kf1O6nA+tGSOE
131// SIG // y/S6A4aN91/w0FK/jJSHvMAhdCVfGCi2zCcoOCWYOUo2
132// SIG // z3yxkq4cI6epZuxhH2rhKEmdX4jiJV3TIUs+UsS1Vz8k
133// SIG // A/DRelsv1SPjcF0PUUZ3s/gA4bysAoJf28AVs70b1FVL
134// SIG // 5zmhD+kjSbwYuER8ReTBw3J64HLnJN+/RpnF78IcV9uD
135// SIG // jexNSTCnq47f7Fufr/zdsGbiwZeBe+3W7UvnSSmnEyim
136// SIG // p31ngOaKYnhfsi+E11ecXL93KCjx7W3DKI8sj0A3T8Hh
137// SIG // hUSJxAlMxdSlQy90lfdu+HggWCwTXWCVmj5PM4TasIgX
138// SIG // 3p5O9JawvEagbJjS4NaIjAsCAwEAAaOCAe0wggHpMBAG
139// SIG // CSsGAQQBgjcVAQQDAgEAMB0GA1UdDgQWBBRIbmTlUAXT
140// SIG // gqoXNzcitW2oynUClTAZBgkrBgEEAYI3FAIEDB4KAFMA
141// SIG // dQBiAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
142// SIG // AwEB/zAfBgNVHSMEGDAWgBRyLToCMZBDuRQFTuHqp8cx
143// SIG // 0SOJNDBaBgNVHR8EUzBRME+gTaBLhklodHRwOi8vY3Js
144// SIG // Lm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9N
145// SIG // aWNSb29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3JsMF4G
146// SIG // CCsGAQUFBwEBBFIwUDBOBggrBgEFBQcwAoZCaHR0cDov
147// SIG // L3d3dy5taWNyb3NvZnQuY29tL3BraS9jZXJ0cy9NaWNS
148// SIG // b29DZXJBdXQyMDExXzIwMTFfMDNfMjIuY3J0MIGfBgNV
149// SIG // HSAEgZcwgZQwgZEGCSsGAQQBgjcuAzCBgzA/BggrBgEF
150// SIG // BQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3Br
151// SIG // aW9wcy9kb2NzL3ByaW1hcnljcHMuaHRtMEAGCCsGAQUF
152// SIG // BwICMDQeMiAdAEwAZQBnAGEAbABfAHAAbwBsAGkAYwB5
153// SIG // AF8AcwB0AGEAdABlAG0AZQBuAHQALiAdMA0GCSqGSIb3
154// SIG // DQEBCwUAA4ICAQBn8oalmOBUeRou09h0ZyKbC5YR4WOS
155// SIG // mUKWfdJ5DJDBZV8uLD74w3LRbYP+vj/oCso7v0epo/Np
156// SIG // 22O/IjWll11lhJB9i0ZQVdgMknzSGksc8zxCi1LQsP1r
157// SIG // 4z4HLimb5j0bpdS1HXeUOeLpZMlEPXh6I/MTfaaQdION
158// SIG // 9MsmAkYqwooQu6SpBQyb7Wj6aC6VoCo/KmtYSWMfCWlu
159// SIG // WpiW5IP0wI/zRive/DvQvTXvbiWu5a8n7dDd8w6vmSiX
160// SIG // mE0OPQvyCInWH8MyGOLwxS3OW560STkKxgrCxq2u5bLZ
161// SIG // 2xWIUUVYODJxJxp/sfQn+N4sOiBpmLJZiWhub6e3dMNA
162// SIG // BQamASooPoI/E01mC8CzTfXhj38cbxV9Rad25UAqZaPD
163// SIG // XVJihsMdYzaXht/a8/jyFqGaJ+HNpZfQ7l1jQeNbB5yH
164// SIG // PgZ3BtEGsXUfFL5hYbXw3MYbBL7fQccOKO7eZS/sl/ah
165// SIG // XJbYANahRr1Z85elCUtIEJmAH9AAKcWxm6U/RXceNcbS
166// SIG // oqKfenoi+kiVH6v7RyOA9Z74v2u3S5fi63V4GuzqN5l5
167// SIG // GEv/1rMjaHXmr/r8i+sLgOppO6/8MO0ETI7f33VtY5E9
168// SIG // 0Z1WTk+/gFcioXgRMiF670EKsT/7qMykXcGhiJtXcVZO
169// SIG // SEXAQsmbdlsKgEhr/Xmfwb1tbWrJUnMTDXpQzTGCGY8w
170// SIG // ghmLAgEBMIGVMH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQI
171// SIG // EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w
172// SIG // HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAm
173// SIG // BgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENB
174// SIG // IDIwMTECEzMAAAJSizOq+JXzOdsAAAAAAlIwDQYJYIZI
175// SIG // AWUDBAIBBQCgga4wGQYJKoZIhvcNAQkDMQwGCisGAQQB
176// SIG // gjcCAQQwHAYKKwYBBAGCNwIBCzEOMAwGCisGAQQBgjcC
177// SIG // ARUwLwYJKoZIhvcNAQkEMSIEIA8gk75dBVW0cJeTmpvK
178// SIG // QLP5PtnqdlCfg5B25SbzzOt+MEIGCisGAQQBgjcCAQwx
179// SIG // NDAyoBSAEgBNAGkAYwByAG8AcwBvAGYAdKEagBhodHRw
180// SIG // Oi8vd3d3Lm1pY3Jvc29mdC5jb20wDQYJKoZIhvcNAQEB
181// SIG // BQAEggEAcY2o2MsKMj10hvirJ7cJGyVIqeplVvOkKZoG
182// SIG // /o0ecpgYQkWnuRwAuiIuIZRHlB1fTMLyWfqMt5OJVN7B
183// SIG // kAYi8ctxfBVSovB9FaGdMgx/PCCUc1odmCfGXAZXDNKp
184// SIG // Z5kg1yrEaXG20MJNbo1evuXrRn/pxxfg6Vv2YFuQVtxP
185// SIG // fLukS/5sIUqUIhTZd9KXPr3izofaMj4xNG1hcezwyLeK
186// SIG // K08cHpV3YRg5ZssHfJFnvDrxriZHQh17duI66aUmXAlq
187// SIG // /kkrgTu+JdEfGV56rajsaTjC9cVC83nOEwcHxGFKcWWk
188// SIG // 9BowZSkDHZwMFaI/NCH78dT8vkG67ya4VYhVUyKfu6GC
189// SIG // FxkwghcVBgorBgEEAYI3AwMBMYIXBTCCFwEGCSqGSIb3
190// SIG // DQEHAqCCFvIwghbuAgEDMQ8wDQYJYIZIAWUDBAIBBQAw
191// SIG // ggFZBgsqhkiG9w0BCRABBKCCAUgEggFEMIIBQAIBAQYK
192// SIG // KwYBBAGEWQoDATAxMA0GCWCGSAFlAwQCAQUABCDv2irB
193// SIG // TlS2S4b55E3kSotVUvJovD+zkqs5YiAZ6eI2xgIGYrMq
194// SIG // qs3QGBMyMDIyMDcxOTIzMTcxMi4zOTJaMASAAgH0oIHY
195// SIG // pIHVMIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz
196// SIG // aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE
197// SIG // ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQL
198// SIG // EyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25zIExp
199// SIG // bWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNOOjE3
200// SIG // OUUtNEJCMC04MjQ2MSUwIwYDVQQDExxNaWNyb3NvZnQg
201// SIG // VGltZS1TdGFtcCBTZXJ2aWNloIIRaDCCBxQwggT8oAMC
202// SIG // AQICEzMAAAGKPjiN0g4C+ugAAQAAAYowDQYJKoZIhvcN
203// SIG // AQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh
204// SIG // c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNV
205// SIG // BAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE
206// SIG // AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAw
207// SIG // HhcNMjExMDI4MTkyNzQyWhcNMjMwMTI2MTkyNzQyWjCB
208// SIG // 0jELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0
209// SIG // b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p
210// SIG // Y3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj
211// SIG // cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVk
212// SIG // MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjoxNzlFLTRC
213// SIG // QjAtODI0NjElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt
214// SIG // U3RhbXAgU2VydmljZTCCAiIwDQYJKoZIhvcNAQEBBQAD
215// SIG // ggIPADCCAgoCggIBALf/rrehgwMgGb3oAYWoFndBqKk/
216// SIG // JRRzHqaFjTizzxBKC7smuF95/iteBb5WcBZisKmqegfu
217// SIG // hJCE0o5HnE0gekEQOJIr3ScnZS7yq4PLnbQbuuyyso0K
218// SIG // sEcw0E0YRAsaVN9LXQRPwHsj/eZO6p3YSLvzqU+EBshi
219// SIG // VIjA5ZmQIgz2ORSZIrVIBr8DAR8KICc/BVRARZ1YgFEU
220// SIG // yeJAQ4lOqaW7+DyPe/r0IabKQyvvN4GsmokQt4DUxst4
221// SIG // jonuj7JdN3L2CIhXACUT+DtEZHhZb/0kKKJs9ybbDHfa
222// SIG // KEv1ztL0jfYdg1SjjTI2hToJzeUZOYgqsJp+qrJnvoWq
223// SIG // Ef06wgUtM1417Fk4JJY1Abbde1AW1vES/vSzcN3IzyfB
224// SIG // GEYJTDVwmCzOhswg1xLxPU//7AL/pNXPOLZqImQ2QagY
225// SIG // K/0ry/oFbDs9xKA2UNuqk2tWxJ/56cTJl3LaGUnvEkQ6
226// SIG // oCtCVFoYyl4J8mjgAxAfhbXyIvo3XFCW6T7QC+JFr1Uk
227// SIG // SoqVb/DBLmES3sVxAxAYvleLXygKWYROIGtKfkAomsBy
228// SIG // wWTaI91EDczOUFZhmotzJ0BW2ZIam1A8qaPb2lhHlXjt
229// SIG // +SX3S1o8EYLzF91SmS+e3e45kY4lZZbl42RS8fq4SS+y
230// SIG // WFabTj7RdTALTGJaejroJzqRvuFuDBh6o+2GHz9FAgMB
231// SIG // AAGjggE2MIIBMjAdBgNVHQ4EFgQUI9pD2P1sGdSXrqdJ
232// SIG // R4Q+MZBpJAMwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXS
233// SIG // ZacbUzUZ6XIwXwYDVR0fBFgwVjBUoFKgUIZOaHR0cDov
234// SIG // L3d3dy5taWNyb3NvZnQuY29tL3BraW9wcy9jcmwvTWlj
235// SIG // cm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo
236// SIG // MSkuY3JsMGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcw
237// SIG // AoZQaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w
238// SIG // cy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIw
239// SIG // UENBJTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADAT
240// SIG // BgNVHSUEDDAKBggrBgEFBQcDCDANBgkqhkiG9w0BAQsF
241// SIG // AAOCAgEAxfTBErD1w3kbXxaNX+e+Yj3xfQEVm3rrjXzO
242// SIG // fNyH08X82X9nb/5ntwzYvynDTRJ0dUym2bRuy7INHMv6
243// SIG // SiBEDiRtn2GlsCCCmMLsgySNkOJFYuZs21f9Aufr0ELE
244// SIG // HAr37DPCuV9n34nyYu7anhtK+fAo4MHu8QWL4Lj5o1Dc
245// SIG // cE1rxI2SD36Y1VKGjwpeqqrNHhVG+23C4c0xBGAZwI/D
246// SIG // BDYYj+SCXeD6eZRah07aXnOu2BZhrjv7iAP04zwX3LTO
247// SIG // ZFCPrs38of8iHbQzbZCM/nv8Zl0hYYkBEdLgY0aG0GVe
248// SIG // nPtEzbb0TS2slOLuxHpHezmg180EdEblhmkosLTel3Pz
249// SIG // 6DT9K3sxujr3MqMNajKFJFBEO6qg9EKvEBcCtAygnWUi
250// SIG // bcgSjAaY1GApzVGW2L001puA1yuUWIH9t21QSVuF6OcO
251// SIG // PdBx6OE41jas9ez6j8jAk5zPB3AKk5z3jBNHT2L23cMw
252// SIG // zIG7psnWyWqv9OhSJpCeyl7PY8ag4hNj03mJ2o/Np+kP
253// SIG // /z6mx7scSZsEDuH83ToFagBJBtVw5qaVSlv6ycQTdyMc
254// SIG // la+kD/XIWNjGFWtG2wAiNnb1PkdkCZROQI6DCsuvFiNa
255// SIG // ZhU9ySga62nKcuh1Ixq7Vfv9VOdm66xJQpVcuRW/PlGV
256// SIG // mS6fNnLgs7STDEqlvpD+c8lQUryzPuAwggdxMIIFWaAD
257// SIG // AgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3
258// SIG // DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
259// SIG // V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG
260// SIG // A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIwMAYD
261// SIG // VQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBB
262// SIG // dXRob3JpdHkgMjAxMDAeFw0yMTA5MzAxODIyMjVaFw0z
263// SIG // MDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVTMRMwEQYD
264// SIG // VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25k
265// SIG // MR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24x
266// SIG // JjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBD
267// SIG // QSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
268// SIG // CgKCAgEA5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9Kp
269// SIG // bE51yMo1V/YBf2xK4OK9uT4XYDP/XE/HZveVU3Fa4n5K
270// SIG // Wv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTz
271// SIG // xXb1hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9
272// SIG // cmmvHaus9ja+NSZk2pg7uhp7M62AW36MEBydUv626GIl
273// SIG // 3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K
274// SIG // Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3t
275// SIG // pK56KTesy+uDRedGbsoy1cCGMFxPLOJiss254o2I5Jas
276// SIG // AUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF803RKJ
277// SIG // 1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHo
278// SIG // vwUDo9Fzpk03dJQcNIIP8BDyt0cY7afomXw/TNuvXsLz
279// SIG // 1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahhaYQFzymei
280// SIG // XtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8w
281// SIG // dJGUlNi5UPkLiWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFd
282// SIG // Etsluq9QBXpsxREdcu+N+VLEhReTwDwV2xo3xwgVGD94
283// SIG // q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0w
284// SIG // ggHZMBIGCSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGC
285// SIG // NxUCBBYEFCqnUv5kxJq+gpE8RjUpzxD/LwTuMB0GA1Ud
286// SIG // DgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAE
287// SIG // VTBTMFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIB
288// SIG // FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3Bz
289// SIG // L0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI
290// SIG // KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBD
291// SIG // AEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8w
292// SIG // HwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186aGMQw
293// SIG // VgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNy
294// SIG // b3NvZnQuY29tL3BraS9jcmwvcHJvZHVjdHMvTWljUm9v
295// SIG // Q2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsGAQUFBwEB
296// SIG // BE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNy
297// SIG // b3NvZnQuY29tL3BraS9jZXJ0cy9NaWNSb29DZXJBdXRf
298// SIG // MjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcNAQELBQADggIB
299// SIG // AJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEG
300// SIG // k5c9MTO1OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi
301// SIG // 7ulmZzpTTd2YurYeeNg2LpypglYAA7AFvonoaeC6Ce57
302// SIG // 32pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OO
303// SIG // PcbzaN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECW
304// SIG // OKz3+SmJw7wXsFSFQrP8DJ6LGYnn8AtqgcKBGUIZUnWK
305// SIG // NsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m
306// SIG // Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSw
307// SIG // ethQ/gpY3UA8x1RtnWN0SCyxTkctwRQEcb9k+SS+c23K
308// SIG // jgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxkoJLo4
309// SIG // S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFE
310// SIG // fnyhYWxz/gq77EFmPWn9y8FBSX5+k77L+DvktxW/tM4+
311// SIG // pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC4822rpM+Zv/
312// SIG // Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7t
313// SIG // fqAxM328y+l7vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJt
314// SIG // pQUQwXEGahC0HVUzWLOhcGbyoYIC1zCCAkACAQEwggEA
315// SIG // oYHYpIHVMIHSMQswCQYDVQQGEwJVUzETMBEGA1UECBMK
316// SIG // V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG
317// SIG // A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYD
318// SIG // VQQLEyRNaWNyb3NvZnQgSXJlbGFuZCBPcGVyYXRpb25z
319// SIG // IExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1MgRVNO
320// SIG // OjE3OUUtNEJCMC04MjQ2MSUwIwYDVQQDExxNaWNyb3Nv
321// SIG // ZnQgVGltZS1TdGFtcCBTZXJ2aWNloiMKAQEwBwYFKw4D
322// SIG // AhoDFQCA8PNjrxtTBQQdp/+MHlaqc1fEoaCBgzCBgKR+
323// SIG // MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n
324// SIG // dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN
325// SIG // aWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1p
326// SIG // Y3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwMA0GCSqG
327// SIG // SIb3DQEBBQUAAgUA5oFAzDAiGA8yMDIyMDcxOTIyNDAx
328// SIG // MloYDzIwMjIwNzIwMjI0MDEyWjB3MD0GCisGAQQBhFkK
329// SIG // BAExLzAtMAoCBQDmgUDMAgEAMAoCAQACAhQGAgH/MAcC
330// SIG // AQACAhFaMAoCBQDmgpJMAgEAMDYGCisGAQQBhFkKBAIx
331// SIG // KDAmMAwGCisGAQQBhFkKAwKgCjAIAgEAAgMHoSChCjAI
332// SIG // AgEAAgMBhqAwDQYJKoZIhvcNAQEFBQADgYEADlfdoFr3
333// SIG // CfalVXHA6h2bmOudfLi11U8UcUNGw2lOz0itWj43Um7L
334// SIG // VxAb3lITaJC7GmZcf7xJF02Mum9DGC/odGxJpN1pCEF0
335// SIG // i4K5NsaUAHeI/pKLeciftrk5bnE63Iu7pP3NWZO7IPyC
336// SIG // 6gsmM/wnd6dFyjPZe487N3EwgBCnnyYxggQNMIIECQIB
337// SIG // ATCBkzB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2Fz
338// SIG // aGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UE
339// SIG // ChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQD
340// SIG // Ex1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAIT
341// SIG // MwAAAYo+OI3SDgL66AABAAABijANBglghkgBZQMEAgEF
342// SIG // AKCCAUowGgYJKoZIhvcNAQkDMQ0GCyqGSIb3DQEJEAEE
343// SIG // MC8GCSqGSIb3DQEJBDEiBCCq1CIykXwRJDzmMpT5Dl8w
344// SIG // YkQlKXkJSz4ivqMwUc2hxTCB+gYLKoZIhvcNAQkQAi8x
345// SIG // geowgecwgeQwgb0EIPS94Kt130q+fvO/fzD4MbWQhQaE
346// SIG // 7RHkOH6AkjlNVCm9MIGYMIGApH4wfDELMAkGA1UEBhMC
347// SIG // VVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT
348// SIG // B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jw
349// SIG // b3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUt
350// SIG // U3RhbXAgUENBIDIwMTACEzMAAAGKPjiN0g4C+ugAAQAA
351// SIG // AYowIgQgbQiL8sezvVK0Xaup4cFg25L8CF+3je0VcxNK
352// SIG // r9k365cwDQYJKoZIhvcNAQELBQAEggIAnms8SNy9QK0z
353// SIG // SPk1pz1MP+cM53zYVJhXBTfzHlgpy3ww6lhSSGUh+k14
354// SIG // 9RX/8AbIgNsEO4BCCbwP7E+/g14DLX/xA1khE3MDN/r/
355// SIG // iIw2jp18UafBtPJGaVtx5zIaG6Co+OnzUPGC9dcNzFEt
356// SIG // jyyYPnq3CP411rqN/V+nJMD1PHuUFYh0rl6zhJq/tCKA
357// SIG // Bwzgmjfw0G+E6Hs889A56eRlTZLXdT6wzcn2a2xmYUY6
358// SIG // khmWY0tongqzqx1q7JxbkdSy+V2VfQMExefYdCNRMfYu
359// SIG // XEhe+FHmcsgJlVf9gIaayXobwF/AO//+ip/kzx/f7J9d
360// SIG // /rdolnw2ylgVYr0DE37eKCCLUD35ft8YJOvA4ncybmrK
361// SIG // ncr9njvafWs5d0dmb4KN7XAfBzDJ5tyozxU39QA6l9Z4
362// SIG // bBl/JKGUiMGCzPrmR7zFyWLuxlu6T1ZtO7NqI/PbQzSY
363// SIG // cUolcFgeDqRlOT3bGcJzu/UIxW6vB3rGuVdgyd7TbgX5
364// SIG // SZ0xqDGFhmCiziFzzIxVyUhP3PPSefqdUlSktNRGVzTc
365// SIG // SIYE7n/8bXlFOtMsklNfYSgEnyGqseu0uPWeaby3wpeJ
366// SIG // ydnRDEL0iNY79/GlFVhP+6fG61D23PLguyNUPipgV0Lc
367// SIG // G2+l5SEdvO48r2IlXgFigA2xjB5tDUbOvNKQoJ/+4T9q
368// SIG // bezjeETcZv0=
369// SIG // End signature block
370;
371/*
372 *
373 * Copyright (c) 2006 Sam Collett (http://www.texotela.co.uk)
374 * Licensed under the MIT License:
375 * http://www.opensource.org/licenses/mit-license.php
376 * 
377 */
378 
379/*
380 * Allows only valid characters to be entered into input boxes.
381 * Note: does not validate that the final text is a valid number
382 * (that could be done by another script, or server-side)
383 *
384 * @name     numeric
385 * @param    decimal      Decimal separator (e.g. '.' or ',' - default is '.')
386 * @param    callback     A function that runs if the number is not valid (fires onblur)
387 * @author   Sam Collett (http://www.texotela.co.uk)
388 * @example  $(".numeric").numeric();
389 * @example  $(".numeric").numeric(",");
390 * @example  $(".numeric").numeric(null, callback);
391 *
392 */
393jQuery.fn.numeric = function(decimal, callback)
394{
395	decimal = decimal || ".";
396	callback = typeof callback == "function" ? callback : function(){};
397	this.keypress(
398		function(e)
399		{
400			var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
401			// allow enter/return key (only when in an input box)
402			if(key == 13 && this.nodeName.toLowerCase() == "input")
403			{
404				return true;
405			}
406			else if(key == 13)
407			{
408				return false;
409			}
410			var allow = false;
411			// allow Ctrl+A
412			if((e.ctrlKey && key == 97 /* firefox */) || (e.ctrlKey && key == 65) /* opera */) return true;
413			// allow Ctrl+X (cut)
414			if((e.ctrlKey && key == 120 /* firefox */) || (e.ctrlKey && key == 88) /* opera */) return true;
415			// allow Ctrl+C (copy)
416			if((e.ctrlKey && key == 99 /* firefox */) || (e.ctrlKey && key == 67) /* opera */) return true;
417			// allow Ctrl+Z (undo)
418			if((e.ctrlKey && key == 122 /* firefox */) || (e.ctrlKey && key == 90) /* opera */) return true;
419			// allow or deny Ctrl+V (paste), Shift+Ins
420			if((e.ctrlKey && key == 118 /* firefox */) || (e.ctrlKey && key == 86) /* opera */
421			|| (e.shiftKey && key == 45)) return true;
422			// if a number was not pressed
423			if(key < 48 || key > 57)
424			{
425				/* '-' only allowed at start */
426				if(key == 45 && this.value.length == 0) return true;
427				/* only one decimal separator allowed */
428				if(key == decimal.charCodeAt(0) && this.value.indexOf(decimal) != -1)
429				{
430					allow = false;
431				}
432				// check for other keys that have special purposes
433				if(
434					key != 8 /* backspace */ &&
435					key != 9 /* tab */ &&
436					key != 13 /* enter */ &&
437					key != 35 /* end */ &&
438					key != 36 /* home */ &&
439					key != 37 /* left */ &&
440					key != 39 /* right */ &&
441					key != 46 /* del */
442				)
443				{
444					allow = false;
445				}
446				else
447				{
448					// for detecting special keys (listed above)
449					// IE does not support 'charCode' and ignores them in keypress anyway
450					if(typeof e.charCode != "undefined")
451					{
452						// special keys have 'keyCode' and 'which' the same (e.g. backspace)
453						if(e.keyCode == e.which && e.which != 0)
454						{
455							allow = true;
456						}
457						// or keyCode != 0 and 'charCode'/'which' = 0
458						else if(e.keyCode != 0 && e.charCode == 0 && e.which == 0)
459						{
460							allow = true;
461						}
462					}
463				}
464				// if key pressed is the decimal and it is not already in the field
465				if(key == decimal.charCodeAt(0) && this.value.indexOf(decimal) == -1)
466				{
467					allow = true;
468				}
469			}
470			else
471			{
472				allow = true;
473			}
474			return allow;
475		}
476	)
477	.blur(
478		function()
479		{
480			var val = jQuery(this).val();
481			if(val != "")
482			{
483				var re = new RegExp("^\\d+$|\\d*" + decimal + "\\d+");
484				if(!re.exec(val))
485				{
486					callback.apply(this);
487				}
488			}
489		}
490	)
491	return this;
492};
493/**
494 * @popperjs/core v2.4.0 - MIT License
495 */
496
497"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return"[object Window]"!==e.toString()?(e=e.ownerDocument)?e.defaultView:window:e}function r(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function o(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return e?(e.nodeName||"").toLowerCase():null}function s(e){return(o(e)?e.ownerDocument:e.document).documentElement}function f(e){return t(s(e)).left+r(e).scrollLeft}function p(e){return n(e).getComputedStyle(e)}function c(e){return e=p(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,o,p){void 0===p&&(p=!1);var u=s(o);e=t(e);var d={scrollLeft:0,scrollTop:0},l={x:0,y:0};return p||(("body"!==a(o)||c(u))&&(d=o!==n(o)&&i(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:r(o)),i(o)?((l=t(o)).x+=o.clientLeft,l.y+=o.clientTop):u&&(l.x=f(u))),{x:e.left+d.scrollLeft-l.x,y:e.top+d.scrollTop-l.y,width:e.width,height:e.height}}function d(e){return{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}}function l(e){return"html"===a(e)?e:e.assignedSlot||e.parentNode||e.host||s(e)}function m(e,t){void 0===t&&(t=[]);var r=function e(t){return 0<=["html","body","#document"].indexOf(a(t))?t.ownerDocument.body:i(t)&&c(t)?t:e(l(t))}(e);e="body"===a(r);var o=n(r);
497return r=e?[o].concat(o.visualViewport||[],c(r)?r:[]):r,t=t.concat(r),e?t:t.concat(m(l(r)))}function h(e){return i(e)&&"fixed"!==p(e).position?e.offsetParent:null}function v(e){var t=n(e);for(e=h(e);e&&0<=["table","td","th"].indexOf(a(e));)e=h(e);return e&&"body"===a(e)&&"static"===p(e).position?t:e||t}function g(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(o){n.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach((function(r){n.has(r)||(r=t.get(r))&&e(r)})),r.push(o)}(e)})),r}function b(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function y(e){return e.split("-")[0]}function x(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function w(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?N:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=r);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},N,{},r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],p=!1,c={state:s,setOptions:function(i){return a(),s.options=Object.assign({},r,{},s.options,{},i),s.scrollParents={reference:o(e)?m(e):e.contextElement?m(e.contextElement):[],popper:m(t)},i=function(e){var t=g(e);return F.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,{},t,{options:Object.assign({},n.options,{},t.options),data:Object.assign({},n.data,{},t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:c,options:n}),f.push(t||function(){}))})),c.update()},forceUpdate:function(){if(!p){var e=s.elements,t=e.reference;if(x(t,e=e.popper))for(s.rects={reference:u(t,v(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var r=n.options;r=void 0===r?{}:r,n=n.name,"function"==typeof e&&(s=e({state:s,options:r,name:n,instance:c})||s)}}},update:b((function(){return new Promise((function(e){c.forceUpdate(),e(s)}))})),destroy:function(){a(),p=!0}};return x(e,t)?(c.setOptions(i).then((function(e){!p&&i.onFirstUpdate&&i.onFirstUpdate(e)})),c):c}}function O(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function M(e){var t=e.reference,n=e.element,r=(e=e.placement)?y(e):null;e=e?e.split("-")[1]:null;var o=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(r){case"top":o={x:o,y:t.y-n.height};break;case"bottom":o={x:o,y:t.y+t.height};break;case"right":o={x:t.x+t.width,y:i};break;case"left":o={x:t.x-n.width,y:i};break;default:o={x:t.x,y:t.y}}if(null!=(r=r?O(r):null))switch(i="y"===r?"height":"width",e){case"start":o[r]=Math.floor(o[r])-Math.floor(t[i]/2-n[i]/2);break;case"end":o[r]=Math.floor(o[r])+Math.ceil(t[i]/2-n[i]/2)}return o}function j(e){var t,r=e.popper,o=e.popperRect,i=e.placement,a=e.offsets,f=e.position,p=e.gpuAcceleration,c=e.adaptive,u=window.devicePixelRatio||1;e=Math.round(a.x*u)/u||0,u=Math.round(a.y*u)/u||0;var d=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var l,m="left",h="top",g=window;if(c){var b=v(r);b===n(r)&&(b=s(r)),"top"===i&&(h="bottom",u-=b.clientHeight-o.height,u*=p?1:-1),"left"===i&&(m="right",e-=b.clientWidth-o.width,e*=p?1:-1)}return r=Object.assign({position:f},c&&I),p?Object.assign({},r,((l={})[h]=a?"0":"",l[m]=d?"0":"",l.transform=2>(g.devicePixelRatio||1)?"translate("+e+"px, "+u+"px)":"translate3d("+e+"px, "+u+"px, 0)",l)):Object.assign({},r,((t={})[h]=a?u+"px":"",t[m]=d?e+"px":"",t.transform="",t))}function E(e){return e.replace(/left|right|bottom|top/g,(function(e){return _[e]}))}function D(e){return e.replace(/start|end/g,(function(e){return U[e]}))}function P(e,t){var n=!(!t.getRootNode||!t.getRootNode().host);if(e.contains(t))return!0;
497if(n)do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function L(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function k(e,o){if("viewport"===o){var a=n(e);e=a.visualViewport,o=a.innerWidth,a=a.innerHeight,e&&/iPhone|iPod|iPad/.test(navigator.platform)&&(o=e.width,a=e.height),e=L({width:o,height:a,x:0,y:0})}else i(o)?e=t(o):(e=n(a=s(e)),o=r(a),(a=u(s(a),e)).height=Math.max(a.height,e.innerHeight),a.width=Math.max(a.width,e.innerWidth),a.x=-o.scrollLeft,a.y=-o.scrollTop,e=L(a));return e}function B(e,t,r){return t="clippingParents"===t?function(e){var t=m(e),n=0<=["absolute","fixed"].indexOf(p(e).position)&&i(e)?v(e):e;return o(n)?t.filter((function(e){return o(e)&&P(e,n)})):[]}(e):[].concat(t),(r=(r=[].concat(t,[r])).reduce((function(t,r){var o=k(e,r),c=n(r=i(r)?r:s(e)),u=i(r)?p(r):{};parseFloat(u.borderTopWidth);var d=parseFloat(u.borderRightWidth)||0,l=parseFloat(u.borderBottomWidth)||0,m=parseFloat(u.borderLeftWidth)||0;u="html"===a(r);var h=f(r),v=r.clientWidth+d,g=r.clientHeight+l;return u&&50<c.innerHeight-r.clientHeight&&(g=c.innerHeight-l),l=u?0:r.clientTop,d=r.clientLeft>m?d:u?c.innerWidth-v-h:r.offsetWidth-v,c=u?c.innerHeight-g:r.offsetHeight-g,r=u?h:r.clientLeft,t.top=Math.max(o.top+l,t.top),t.right=Math.min(o.right-d,t.right),t.bottom=Math.min(o.bottom-c,t.bottom),t.left=Math.max(o.left+r,t.left),t}),k(e,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function W(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},{},e)}function A(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function H(e,n){void 0===n&&(n={});var r=n;n=void 0===(n=r.placement)?e.placement:n;var i=r.boundary,a=void 0===i?"clippingParents":i,f=void 0===(i=r.rootBoundary)?"viewport":i;i=void 0===(i=r.elementContext)?"popper":i;var p=r.altBoundary,c=void 0!==p&&p;r=W("number"!=typeof(r=void 0===(r=r.padding)?0:r)?r:A(r,q));var u=e.elements.reference;p=e.rects.popper,a=B(o(c=e.elements[c?"popper"===i?"reference":"popper":i])?c:c.contextElement||s(e.elements.popper),a,f),c=M({reference:f=t(u),element:p,strategy:"absolute",placement:n}),p=L(Object.assign({},p,{},c)),f="popper"===i?p:f;
497var d={top:a.top-f.top+r.top,bottom:f.bottom-a.bottom+r.bottom,left:a.left-f.left+r.left,right:f.right-a.right+r.right};if(e=e.modifiersData.offset,"popper"===i&&e){var l=e[n];Object.keys(d).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";d[e]+=l[n]*t}))}return d}function T(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function R(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var q=["top","bottom","right","left"],S=q.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),C=[].concat(q,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),F="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),N={placement:"bottom",modifiers:[],strategy:"absolute"},V={passive:!0},I={top:"auto",right:"auto",bottom:"auto",left:"auto"},_={left:"right",right:"left",bottom:"top",top:"bottom"},U={start:"end",end:"start"},z=[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,o=(e=e.options).scroll,i=void 0===o||o,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",r.update,V)})),a&&s.addEventListener("resize",r.update,V),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",r.update,V)})),a&&s.removeEventListener("resize",r.update,V)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=M({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e,n=void 0===(n=n.adaptive)||n,e={placement:y(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,{},j(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,{},j(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];i(o)&&a(o)&&(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(r)&&a(r)&&(Object.assign(r.style,e),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,r=void 0===(e=e.options.offset)?[0,0]:e,o=(e=C.reduce((function(e,n){var o=t.rects,i=y(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof r?r(Object.assign({},o,{placement:n})):r;return o=(o=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:o}:{x:o,y:s},e[n]=i,e}),{}))[t.placement],i=o.x;o=o.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=o),t.modifiersData[n]=e}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var r=n.mainAxis;r=void 0===r||r;var o=n.altAxis;o=void 0===o||o;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,u=void 0===c||c,d=n.allowedAutoPlacements;c=y(n=t.options.placement),i=i||(c!==n&&u?function(e){if("auto"===y(e))return[];var t=E(e);return[D(e),t,D(t)]}(n):[E(n)]);var l=[n].concat(i).reduce((function(e,n){return e.concat("auto"===y(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,r=t.rootBoundary,o=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?C:a,f=t.placement.split("-")[1],p=(f?i?S:S.filter((function(e){return e.split("-")[1]===f})):q).filter((function(e){return 0<=s.indexOf(e)})).reduce((function(t,i){return t[i]=H(e,{placement:i,boundary:n,rootBoundary:r,padding:o})[y(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:u,allowedAutoPlacements:d}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;c=!0;for(var h=l[0],v=0;v<l.length;v++){var g=l[v],b=y(g),x="start"===g.split("-")[1],w=0<=["top","bottom"].indexOf(b),O=w?"width":"height",M=H(t,{placement:g,boundary:s,rootBoundary:f,altBoundary:p,padding:a});if(x=w?x?"right":"left":x?"bottom":"top",n[O]>i[O]&&(x=E(x)),O=E(x),w=[],r&&w.push(0>=M[b]),o&&w.push(0>=M[x],0>=M[O]),w.every((function(e){return e}))){h=g,c=!1;break}m.set(g,w)}if(c)for(r=function(e){var t=l.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},o=u?3:1;0<o&&"break"!==r(o);o--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var r=n.mainAxis,o=void 0===r||r;r=void 0!==(r=n.altAxis)&&r;var i=n.tether;i=void 0===i||i;var a=n.tetherOffset,s=void 0===a?0:a;n=H(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),a=y(t.placement);var f=t.placement.split("-")[1],p=!f,c=O(a);a="x"===c?"y":"x";var u=t.modifiersData.popperOffsets,l=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s;if(s={x:0,y:0},u){if(o){var g="y"===c?"top":"left",b="y"===c?"bottom":"right",x="y"===c?"height":"width";o=u[c];var w=u[c]+n[g],M=u[c]-n[b],j=i?-m[x]/2:0,E="start"===f?l[x]:m[x];f="start"===f?-m[x]:-l[x],m=t.elements.arrow,m=i&&m?d(m):{width:0,height:0};var D=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};g=D[g],b=D[b],m=Math.max(0,Math.min(l[x],m[x])),E=p?l[x]/2-j-m-g-h:E-m-g-h,p=
497p?-l[x]/2+j+m+b+h:f+m+b+h,h=t.elements.arrow&&v(t.elements.arrow),l=t.modifiersData.offset?t.modifiersData.offset[t.placement][c]:0,h=u[c]+E-l-(h?"y"===c?h.clientTop||0:h.clientLeft||0:0),p=u[c]+p-l,i=Math.max(i?Math.min(w,h):w,Math.min(o,i?Math.max(M,p):M)),u[c]=i,s[c]=i-o}r&&(r=u[a],i=Math.max(r+n["x"===c?"top":"left"],Math.min(r,r-n["x"===c?"bottom":"right"])),u[a]=i,s[a]=i-r),t.modifiersData[e]=s}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state;e=e.name;var r=n.elements.arrow,o=n.modifiersData.popperOffsets,i=y(n.placement),a=O(i);if(i=0<=["left","right"].indexOf(i)?"height":"width",r&&o){var s=n.modifiersData[e+"#persistent"].padding,f=d(r),p="y"===a?"top":"left",c="y"===a?"bottom":"right",u=n.rects.reference[i]+n.rects.reference[a]-o[a]-n.rects.popper[i];o=o[a]-n.rects.reference[a],u=(r=(r=v(r))?"y"===a?r.clientHeight||0:r.clientWidth||0:0)/2-f[i]/2+(u/2-o/2),i=Math.max(s[p],Math.min(u,r-f[i]-s[c])),n.modifiersData[e]=((t={})[a]=i,t.centerOffset=i-u,t)}},effect:function(e){var t=e.state,n=e.options;e=e.name;var r=n.element;if(r=void 0===r?"[data-popper-arrow]":r,n=void 0===(n=n.padding)?0:n,null!=r){if("string"==typeof r&&!(r=t.elements.popper.querySelector(r)))return;P(t.elements.popper,r)&&(t.elements.arrow=r,t.modifiersData[e+"#persistent"]={padding:W("number"!=typeof n?n:A(n,q))})}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=H(t,{elementContext:"reference"}),a=H(t,{altBoundary:!0});n=T(i,n),r=T(a,r,o),o=R(n),a=R(r),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:r,isReferenceHidden:o,hasPopperEscaped:a},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":o,"data-popper-escaped":a})}}],X=w({defaultModifiers:z});e.createPopper=X,e.defaultModifiers=z,e.detectOverflow=H,e.popperGenerator=w,Object.defineProperty(e,"__esModule",{value:!0})}));
498//# sourceMappingURL=popper.min.js.map
499;
500/*! Picturefill - v2.3.0 - 2015-03-23
501* http://scottjehl.github.io/picturefill
502* Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
503/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */
504
505window.matchMedia || (window.matchMedia = function () {
506    "use strict";
507
508    // For browsers that support matchMedium api such as IE 9 and webkit
509    var styleMedia = (window.styleMedia || window.media);
510
511    // For those that don't support matchMedium
512    if (!styleMedia) {
513        var style = document.createElement('style'),
514			script = document.getElementsByTagName('script')[0],
515			info = null;
516
517        style.type = 'text/css';
518        style.id = 'matchmediajs-test';
519
520        script.parentNode.insertBefore(style, script);
521
522        // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers
523        info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle;
524
525        styleMedia = {
526            matchMedium: function (media) {
527                var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }';
528
529                // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers
530                if (style.styleSheet) {
531                    style.styleSheet.cssText = text;
532                } else {
533                    style.textContent = text;
534                }
535
536                // Test if media query is true or false
537                return info.width === '1px';
538            }
539        };
540    }
541
542    return function (media) {
543        return {
544            matches: styleMedia.matchMedium(media || 'all'),
545            media: media || 'all'
546        };
547    };
548}());
549/*! Picturefill - Responsive Images that work today.
550*  Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar )
551*  License: MIT/GPLv2
552*  Spec: http://picture.responsiveimages.org/
553*/
554(function (w, doc, image) {
555    // Enable strict mode
556    "use strict";
557
558    function expose(picturefill) {
559        /* expose picturefill */
560        if (typeof module === "object" && typeof module.exports === "object") {
561            // CommonJS, just export
562            module.exports = picturefill;
563        } else if (typeof define === "function" && define.amd) {
564            // AMD support
565            define("picturefill", function () { return picturefill; });
566        }
567        if (typeof w === "object") {
568            // If no AMD and we are in the browser, attach to window
569            w.picturefill = picturefill;
570        }
571    }
572
573    // If picture is supported, well, that's awesome. Let's get outta here...
574    if (w.HTMLPictureElement) {
575        expose(function () { });
576        return;
577    }
578
579    // HTML shim|v it for old IE (IE9 will still need the HTML video tag workaround)
580    doc.createElement("picture");
581
582    // local object for method references and testing exposure
583    var pf = w.picturefill || {};
584
585    var regWDesc = /\s+\+?\d+(e\d+)?w/;
586
587    // namespace
588    pf.ns = "picturefill";
589
590    // srcset support test
591    (function () {
592        pf.srcsetSupported = "srcset" in image;
593        pf.sizesSupported = "sizes" in image;
594    })();
595
596    // just a string trim workaround
597    pf.trim = function (str) {
598        return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
599    };
600
601    /**
602	 * Gets a string and returns the absolute URL
603	 * @param src
604	 * @returns {String} absolute URL
605	 */
606    pf.makeUrl = (function () {
607        var anchor = doc.createElement("a");
608        return function (src) {
609            anchor.href = src;
610            return anchor.href;
611        };
612    })();
613
614    /**
615	 * Shortcut method for https://w3c.github.io/webappsec/specs/mixedcontent/#restricts-mixed-content ( for easy overriding in tests )
616	 */
617    pf.restrictsMixedContent = function () {
618        return w.location.protocol === "https:";
619    };
620    /**
621	 * Shortcut method for matchMedia ( for easy overriding in tests )
622	 */
623
624    pf.matchesMedia = function (media) {
625        return w.matchMedia && w.matchMedia(media).matches;
626    };
627
628    // Shortcut method for `devicePixelRatio` ( for easy overriding in tests )
629    pf.getDpr = function () {
630        return (w.devicePixelRatio || 1);
631    };
632
633    /**
634	 * Get width in css pixel value from a "length" value
635	 * http://dev.w3.org/csswg/css-values-3/#length-value
636	 */
637    pf.getWidthFromLength = function (length) {
638        var cssValue;
639        // If a length is specified and doesn’t contain a percentage, and it is greater than 0 or using `calc`, use it. Else, abort.
640        if (!(length && length.indexOf("%") > -1 === false && (parseFloat(length) > 0 || length.indexOf("calc(") > -1))) {
641            return false;
642        }
643
644        /**
645		 * If length is specified in  `vw` units, use `%` instead since the div we’re measuring
646		 * is injected at the top of the document.
647		 *
648		 * TODO: maybe we should put this behind a feature test for `vw`? The risk of doing this is possible browser inconsistancies with vw vs %
649		 */
650        length = length.replace("vw", "%");
651
652        // Create a cached element for getting length value widths
653        if (!pf.lengthEl) {
654            pf.lengthEl = doc.createElement("div");
655
656            // Positioning styles help prevent padding/margin/width on `html` or `body` from throwing calculations off.
657            pf.lengthEl.style.cssText = "border:0;display:block;font-size:1em;
657left:0;margin:0;padding:0;position:absolute;visibility:hidden";
658
659            // Add a class, so that everyone knows where this element comes from
660            pf.lengthEl.className = "helper-from-picturefill-js";
661        }
662
663        pf.lengthEl.style.width = "0px";
664
665        try {
666            pf.lengthEl.style.width = length;
667        } catch (e) { }
668
669        doc.body.appendChild(pf.lengthEl);
670
671        cssValue = pf.lengthEl.offsetWidth;
672
673        if (cssValue <= 0) {
674            cssValue = false;
675        }
676
677        doc.body.removeChild(pf.lengthEl);
678
679        return cssValue;
680    };
681
682    pf.detectTypeSupport = function (type, typeUri) {
683        // based on Modernizr's lossless img-webp test
684        // note: asynchronous
685        var image = new w.Image();
686        image.onerror = function () {
687            pf.types[type] = false;
688            picturefill();
689        };
690        image.onload = function () {
691            pf.types[type] = image.width === 1;
692            picturefill();
693        };
694        image.src = typeUri;
695
696        return "pending";
697    };
698    // container of supported mime types that one might need to qualify before using
699    pf.types = pf.types || {};
700
701    pf.initTypeDetects = function () {
702        // Add support for standard mime types
703        pf.types["image/jpeg"] = true;
704        pf.types["image/gif"] = true;
705        pf.types["image/png"] = true;
706        pf.types["image/svg+xml"] = doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1");
707        pf.types["image/webp"] = pf.detectTypeSupport("image/webp", "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=");
708    };
709
710    pf.verifyTypeSupport = function (source) {
711        var type = source.getAttribute("type");
712        // if type attribute exists, return test result, otherwise return true
713        if (type === null || type === "") {
714            return true;
715        } else {
716            var pfType = pf.types[type];
717            // if the type test is a function, run it and return "pending" status. The function will rerun picturefill on pending elements once finished.
718            if (typeof pfType === "string" && pfType !== "pending") {
719                pf.types[type] = pf.detectTypeSupport(type, pfType);
720                return "pending";
721            } else if (typeof pfType === "function") {
722                pfType();
723                return "pending";
724            } else {
725                return pfType;
726            }
727        }
728    };
729
730    // Parses an individual `size` and returns the length, and optional media query
731    pf.parseSize = function (sourceSizeStr) {
732        var match = /(\([^)]+\))?\s*(.+)/g.exec(sourceSizeStr);
733        return {
734            media: match && match[1],
735            length: match && match[2]
736        };
737    };
738
739    // Takes a string of sizes and returns the width in pixels as a number
740    pf.findWidthFromSourceSize = function (sourceSizeListStr) {
741        // Split up source size list, ie ( max-width: 30em ) 100%, ( max-width: 50em ) 50%, 33%
742        //                            or (min-width:30em) calc(30% - 15px)
743        var sourceSizeList = pf.trim(sourceSizeListStr).split(/\s*,\s*/),
744			winningLength;
745
746        for (var i = 0, len = sourceSizeList.length; i < len; i++) {
747            // Match <media-condition>? length, ie ( min-width: 50em ) 100%
748            var sourceSize = sourceSizeList[i],
749				// Split "( min-width: 50em ) 100%" into separate strings
750				parsedSize = pf.parseSize(sourceSize),
751				length = parsedSize.length,
752				media = parsedSize.media;
753
754            if (!length) {
755                continue;
756            }
757            // if there is no media query or it matches, choose this as our winning length
758            if ((!media || pf.matchesMedia(media)) &&
759                // pass the length to a method that can properly determine length
760                // in pixels based on these formats: http://dev.w3.org/csswg/css-values-3/#length-value
761				(winningLength = pf.getWidthFromLength(length))) {
762                break;
763            }
764        }
765
766        //if we have no winningLength fallback to 100vw
767        return winningLength || Math.max(w.innerWidth || 0, doc.documentElement.clientWidth);
768    };
769
770    pf.parseSrcset = function (srcset) {
771        /**
772		 * A lot of this was pulled from Boris Smus’ parser for the now-defunct WHATWG `srcset`
773		 * https://github.com/borismus/srcset-polyfill/blob/master/js/srcset-info.js
774		 *
775		 * 1. Let input (`srcset`) be the value passed to this algorithm.
776		 * 2. Let position be a pointer into input, initially pointing at the start of the string.
777		 * 3. Let raw candidates be an initially empty ordered list of URLs with associated
778		 *    unparsed descriptors. The order of entries in the list is the order in which entries
779		 *    are added to the list.
780		 */
781        var candidates = [];
782
783        while (srcset !== "") {
784            srcset = srcset.replace(/^\s+/g, "");
785
786            // 5. Collect a sequence of characters that are not space characters, and let that be url.
787            var pos = srcset.search(/\s/g),
788				url, descriptor = null;
789
790            if (pos !== -1) {
791                url = srcset.slice(0, pos);
792
793                var last = url.slice(-1);
794
795                // 6. If url ends with a U+002C COMMA character (,), remove that character from url
796                // and let descriptors be the empty string. Otherwise, follow these substeps
797                // 6.1. If url is empty, then jump to the step labeled descriptor parser.
798
799                if (last === "," || url === "") {
800                    url = url.replace(/,+$/, "");
801                    descriptor = "";
802                }
803                srcset = srcset.slice(pos + 1);
804
805                // 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and
806                // let that be descriptors.
807                if (descriptor === null) {
808                    var descpos = srcset.indexOf(",");
809                    if (descpos !== -1) {
810                        descriptor = srcset.slice(0, descpos);
811                        srcset = srcset.slice(descpos + 1);
812                    } else {
813                        descriptor = srcset;
814                        srcset = "";
815                    }
816                }
817            } else {
818                url = srcset;
819                srcset = "";
820            }
821
822            // 7. Add url to raw candidates, associated with descriptors.
823            if (url || descriptor) {
824                candidates.push({
825                    url: url,
826                    descriptor: descriptor
827                });
828            }
829        }
830        return candidates;
831    };
832
833    pf.parseDescriptor = function (descriptor, sizesattr) {
834        // 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list
835        // is the order in which entries are added to the list.
836        var sizes = sizesattr || "100vw",
837			sizeDescriptor = descriptor && descriptor.replace(/(^\s+|\s+$)/g, ""),
838			widthInCssPixels = pf.findWidthFromSourceSize(sizes),
839			resCandidate;
840
841        if (sizeDescriptor) {
842            var splitDescriptor = sizeDescriptor.split(" ");
843
844            for (var i = splitDescriptor.length - 1; i >= 0; i--) {
845                var curr = splitDescriptor[i],
846                    lastchar = curr && curr.slice(curr.length - 1);
847
848                if ((lastchar === "h" || lastchar === "w") && !pf.sizesSupported) {
849                    resCandidate = parseFloat((parseInt(curr, 10) / widthInCssPixels));
850                } else if (lastchar === "x") {
851                    var res = curr && parseFloat(curr, 10);
852                    resCandidate = res && !isNaN(res) ? res : 1;
853                }
854            }
855        }
856        return resCandidate || 1;
857    };
858
859    /**
860	 * Takes a srcset in the form of url/
861	 * ex. "images/pic-medium.png 1x, images/pic-medium-2x.png 2x" or
862	 *     "images/pic-medium.png 400w, images/pic-medium-2x.png 800w" or
863	 *     "images/pic-small.png"
864	 * Get an array of image candidates in the form of
865	 *      {url: "/foo/bar.png", resolution: 1}
866	 * where resolution is http://dev.w3.org/csswg/css-values-3/#resolution-value
867	 * If sizes is specified, resolution is calculated
868	 */
869    pf.getCandidatesFromSourceSet = function (srcset, sizes) {
870        var candidates = pf.parseSrcset(srcset),
871			formattedCandidates = [];
872
873        for (var i = 0, len = candidates.length; i < len; i++) {
874            var candidate = candidates[i];
875
876            formattedCandidates.push({
877                url: candidate.url,
878                resolution: pf.parseDescriptor(candidate.descriptor, sizes)
879            });
880        }
881        return formattedCandidates;
882    };
883
884    /**
885	 * if it's an img element and it has a srcset property,
886	 * we need to remove the attribute so we can manipulate src
887	 * (the property's existence infers native srcset support, and a srcset-supporting browser will prioritize srcset's value over our winning picture candidate)
888	 * this moves srcset's value to memory for later use and removes the attr
889	 */
890    pf.dodgeSrcset = function (img) {
891        if (img.srcset) {
892            img[pf.ns].srcset = img.srcset;
893            img.srcset = "";
894            img.setAttribute("data-pfsrcset", img[pf.ns].srcset);
895        }
896    };
897
898    // Accept a source or img element and process its srcset and sizes attrs
899    pf.processSourceSet = function (el) {
900        var srcset = el.getAttribute("srcset"),
901			sizes = el.getAttribute("sizes"),
902			candidates = [];
903
904        // if it's an img element, use the cached srcset property (defined or not)
905        if (el.nodeName.toUpperCase() === "IMG" && el[pf.ns] && el[pf.ns].srcset) {
906            srcset = el[pf.ns].srcset;
907        }
908
909        if (srcset) {
910            candidates = pf.getCandidatesFromSourceSet(srcset, sizes);
911        }
912        return candidates;
913    };
914
915    pf.backfaceVisibilityFix = function (picImg) {
916        // See: https://github.com/scottjehl/picturefill/issues/332
917        var style = picImg.style || {},
918			WebkitBackfaceVisibility = "webkitBackfaceVisibility" in style,
919			currentZoom = style.zoom;
920
921        if (WebkitBackfaceVisibility) {
922            style.zoom = ".999";
923
924            WebkitBackfaceVisibility = picImg.offsetWidth;
925
926            style.zoom = currentZoom;
927        }
928    };
929
930    pf.setIntrinsicSize = (function () {
931        var urlCache = {};
932        var setSize = function (picImg, width, res) {
933            if (width) {
934                picImg.setAttribute("width", parseInt(width / res, 10));
935            }
936        };
937        return function (picImg, bestCandidate) {
938            var img;
939            if (!picImg[pf.ns] || w.pfStopIntrinsicSize) {
940                return;
941            }
942            if (picImg[pf.ns].dims === undefined) {
943                picImg[pf.ns].dims = picImg.getAttribute("width") || picImg.getAttribute("height");
944            }
945            if (picImg[pf.ns].dims) { return; }
946
947            if (bestCandidate.url in urlCache) {
948                setSize(picImg, urlCache[bestCandidate.url], bestCandidate.resolution);
949            } else {
950                img = doc.createElement("img");
951                img.onload = function () {
952                    urlCache[bestCandidate.url] = img.width;
953
954                    //IE 10/11 don't calculate width for svg outside document
955                    if (!urlCache[bestCandidate.url]) {
956                        try {
957                            doc.body.appendChild(img);
958                            urlCache[bestCandidate.url] = img.width || img.offsetWidth;
959                            doc.body.removeChild(img);
960                        } catch (e) { }
961                    }
962
963                    if (picImg.src === bestCandidate.url) {
964                        setSize(picImg, urlCache[bestCandidate.url], bestCandidate.resolution);
965                    }
966                    picImg = null;
967                    img.onload = null;
968                    img = null;
969                };
970                img.src = bestCandidate.url;
971            }
972        };
973    })();
974
975    pf.applyBestCandidate = function (candidates, picImg) {
976        var candidate,
977			length,
978			bestCandidate;
979
980        candidates.sort(pf.ascendingSort);
981
982        length = candidates.length;
983        bestCandidate = candidates[length - 1];
984
985        for (var i = 0; i < length; i++) {
986            candidate = candidates[i];
987            if (candidate.resolution >= pf.getDpr()) {
988                bestCandidate = candidate;
989                break;
990            }
991        }
992
993        if (bestCandidate) {
994
995            bestCandidate.url = pf.makeUrl(bestCandidate.url);
996
997            if (picImg.src !== bestCandidate.url) {
998                if (pf.restrictsMixedContent() && bestCandidate.url.substr(0, "http:".length).toLowerCase() === "http:") {
999                    if (window.console !== undefined) {
1000                        console.warn("Blocked mixed content image " + bestCandidate.url);
1001                    }
1002                } else {
1003                    picImg.src = bestCandidate.url;
1004                    // currentSrc attribute and property to match
1005                    // http://picture.responsiveimages.org/#the-img-element
1006                    picImg.currentSrc = picImg.src;
1007
1008                    pf.backfaceVisibilityFix(picImg);
1009                }
1010            }
1011
1012            pf.setIntrinsicSize(picImg, bestCandidate);
1013        }
1014    };
1015
1016    pf.ascendingSort = function (a, b) {
1017        return a.resolution - b.resolution;
1018    };
1019
1020    /**
1021	 * In IE9, <source> elements get removed if they aren't children of
1022	 * video elements. Thus, we conditionally wrap source elements
1023	 * using <!--[if IE 9]><video style="display: none;"><![endif]-->
1024	 * and must account for that here by moving those source elements
1025	 * back into the picture element.
1026	 */
1027    pf.removeVideoShim = function (picture) {
1028        var videos = picture.getElementsByTagName("video");
1029        if (videos.length) {
1030            var video = videos[0],
1031				vsources = video.getElementsByTagName("source");
1032            while (vsources.length) {
1033                picture.insertBefore(vsources[0], video);
1034            }
1035            // Remove the video element once we're finished removing its children
1036            video.parentNode.removeChild(video);
1037        }
1038    };
1039
1040    /**
1041	 * Find all `img` elements, and add them to the candidate list if they have
1042	 * a `picture` parent, a `sizes` attribute in basic `srcset` supporting browsers,
1043	 * a `srcset` attribute at all, and they haven’t been evaluated already.
1044	 */
1045    pf.getAllElements = function () {
1046        var elems = [],
1047			imgs = doc.getElementsByTagName("img");
1048
1049        for (var h = 0, len = imgs.length; h < len; h++) {
1050            var currImg = imgs[h];
1051
1052            if (currImg.parentNode.nodeName.toUpperCase() === "PICTURE" ||
1053			(currImg.getAttribute("srcset") !== null) || currImg[pf.ns] && currImg[pf.ns].srcset !== null) {
1054                elems.push(currImg);
1055            }
1056        }
1057        return elems;
1058    };
1059
1060    pf.getMatch = function (img, picture) {
1061        var sources = picture.childNodes,
1062			match;
1063
1064        // Go through each child, and if they have media queries, evaluate them
1065        for (var j = 0, slen = sources.length; j < slen; j++) {
1066            var source = sources[j];
1067
1068            // ignore non-element nodes
1069            if (source.nodeType !== 1) {
1070                continue;
1071            }
1072
1073            // Hitting the `img` element that started everything stops the search for `sources`.
1074            // If no previous `source` matches, the `img` itself is evaluated later.
1075            if (source === img) {
1076                return match;
1077            }
1078
1079            // ignore non-`source` nodes
1080            if (source.nodeName.toUpperCase() !== "SOURCE") {
1081                continue;
1082            }
1083            // if it's a source element that has the `src` property set, throw a warning in the console
1084            if (source.getAttribute("src") !== null && typeof console !== undefined) {
1085                console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");
1086            }
1087
1088            var media = source.getAttribute("media");
1089
1090            // if source does not have a srcset attribute, skip
1091            if (!source.getAttribute("srcset")) {
1092                continue;
1093            }
1094
1095            // if there's no media specified, OR w.matchMedia is supported
1096            if ((!media || pf.matchesMedia(media))) {
1097                var typeSupported = pf.verifyTypeSupport(source);
1098
1099                if (typeSupported === true) {
1100                    match = source;
1101                    break;
1102                } else if (typeSupported === "pending") {
1103                    return false;
1104                }
1105            }
1106        }
1107
1108        return match;
1109    };
1110
1111    function picturefill(opt) {
1112        var elements,
1113			element,
1114			parent,
1115			firstMatch,
1116			candidates,
1117			options = opt || {};
1118
1119        elements = options.elements || pf.getAllElements();
1120
1121        // Loop through all elements
1122        for (var i = 0, plen = elements.length; i < plen; i++) {
1123            element = elements[i];
1124            parent = element.parentNode;
1125            firstMatch = undefined;
1126            candidates = undefined;
1127
1128            // immediately skip non-`img` nodes
1129            if (element.nodeName.toUpperCase() !== "IMG") {
1130                continue;
1131            }
1132
1133            // expando for caching data on the img
1134            if (!element[pf.ns]) {
1135                element[pf.ns] = {};
1136            }
1137
1138            // if the element has already been evaluated, skip it unless
1139            // `options.reevaluate` is set to true ( this, for example,
1140            // is set to true when running `picturefill` on `resize` ).
1141            if (!options.reevaluate && element[pf.ns].evaluated && 1 == 2) {
1142                continue;
1143            }
1144
1145            // if `img` is in a `picture` element
1146            if (parent && parent.nodeName.toUpperCase() === "PICTURE") {
1147
1148                // IE9 video workaround
1149                pf.removeVideoShim(parent);
1150
1151                // return the first match which might undefined
1152                // returns false if there is a pending source
1153                // TODO the return type here is brutal, cleanup
1154                firstMatch = pf.getMatch(element, parent);
1155
1156                // if any sources are pending in this picture due to async type test(s)
1157                // remove the evaluated attr and skip for now ( the pending test will
1158                // rerun picturefill on this element when complete)
1159                if (firstMatch === false) {
1160                    continue;
1161                }
1162            } else {
1163                firstMatch = undefined;
1164            }
1165
1166            // Cache and remove `srcset` if present and we’re going to be doing `picture`/`srcset`/`sizes` polyfilling to it.
1167            if ((parent && parent.nodeName.toUpperCase() === "PICTURE") ||
1168			(!pf.sizesSupported && (element.srcset && regWDesc.test(element.srcset)))) {
1169                pf.dodgeSrcset(element);
1170            }
1171
1172            if (firstMatch) {
1173                candidates = pf.processSourceSet(firstMatch);
1174                pf.applyBestCandidate(candidates, element);
1175            } else {
1176                // No sources matched, so we’re down to processing the inner `img` as a source.
1177                candidates = pf.processSourceSet(element);
1178
1179                if (element.srcset === undefined || element[pf.ns].srcset) {
1180                    // Either `srcset` is completely unsupported, or we need to polyfill `sizes` functionality.
1181                    pf.applyBestCandidate(candidates, element);
1182                } // Else, resolution-only `srcset` is supported natively.
1183            }
1184
1185            // set evaluated to true to avoid unnecessary reparsing
1186            element[pf.ns].evaluated = true;
1187        }
1188    }
1189
1190    /**
1191	 * Sets up picture polyfill by polling the document and running
1192	 * the polyfill every 250ms until the document is ready.
1193	 * Also attaches picturefill on resize
1194	 */
1195    function runPicturefill() {
1196        pf.initTypeDetects();
1197        picturefill();
1198        var intervalId = setInterval(function () {
1199            // When the document has finished loading, stop checking for new images
1200            // https://github.com/ded/domready/blob/master/ready.js#L15
1201            picturefill();
1202
1203            if (/^loaded|^i|^c/.test(doc.readyState)) {
1204                clearInterval(intervalId);
1205                return;
1206            }
1207        }, 250);
1208
1209        function checkResize() {
1210            var resizeThrottle;
1211
1212            if (!w._picturefillWorking) {
1213                w._picturefillWorking = true;
1214                w.clearTimeout(resizeThrottle);
1215                resizeThrottle = w.setTimeout(function () {
1216                    picturefill({ reevaluate: true });
1217                    w._picturefillWorking = false;
1218                }, 60);
1219            }
1220        }
1221
1222        if (w.addEventListener) {
1223            w.addEventListener("resize", checkResize, false);
1224        } else if (w.attachEvent) {
1225            w.attachEvent("onresize", checkResize);
1226        }
1227    }
1228
1229    runPicturefill();
1230
1231    /* expose methods for testing */
1232    picturefill._ = pf;
1233
1234    expose(picturefill);
1235
1236})(window, window.document, new window.Image());;
1237//shiv for browsers without console
1238(function () {
1239    var method,
1240    noop = function () { },
1241    methods = [
1242        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
1243        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
1244        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
1245        'timeStamp', 'trace', 'warn'
1246    ],
1247    length = methods.length,
1248    console = (window.console = window.console || {});
1249
1250    while (length--) {
1251        method = methods[length];
1252
1253        // Only stub undefined methods.
1254        if (!console[method]) {
1255            console[method] = noop;
1256        }
1257    }
1258}());
1259
1260/**
1261* jquery.matchHeight-min.js v0.5.2
1262* http://brm.io/jquery-match-height/
1263* License: MIT
1264*/
1265(function (c) {
1266    var n = -1, f = -1, r = function (a) { var b = null, d = []; c(a).each(function () { var a = c(this), k = a.offset().top - h(a.css("margin-top")), l = 0 < d.length ? d[d.length - 1] : null; null === l ? d.push(a) : 1 >= Math.floor(Math.abs(b - k)) ? d[d.length - 1] = l.add(a) : d.push(a); b = k }); return d }, h = function (a) { return parseFloat(a) || 0 }, p = function (a) { var b = { byRow: !0, remove: !1, property: "height" }; if ("object" === typeof a) return c.extend(b, a); "boolean" === typeof a ? b.byRow = a : "remove" === a && (b.remove = !0); return b }, b = c.fn.matchHeight = function (a) {
1267        a =
1268        p(a); if (a.remove) { var e = this; this.css(a.property, ""); c.each(b._groups, function (a, b) { b.elements = b.elements.not(e) }); return this } if (1 >= this.length) return this; b._groups.push({ elements: this, options: a }); b._apply(this, a); return this
1269    }; b._groups = []; b._throttle = 80; b._maintainScroll = !1; b._beforeUpdate = null; b._afterUpdate = null; b._apply = function (a, e) {
1270        var d = p(e), g = c(a), k = [g], l = c(window).scrollTop(), f = c("html").outerHeight(!0), m = g.parents().filter(":hidden"); m.each(function () {
1271            var a = c(this); a.data("style-cache",
1272            a.attr("style"))
1273        }); m.css("display", "block"); d.byRow && (g.each(function () { var a = c(this), b = "inline-block" === a.css("display") ? "inline-block" : "block"; a.data("style-cache", a.attr("style")); a.css({ display: b, "padding-top": "0", "padding-bottom": "0", "margin-top": "0", "margin-bottom": "0", "border-top-width": "0", "border-bottom-width": "0", height: "100px" }) }), k = r(g), g.each(function () { var a = c(this); a.attr("style", a.data("style-cache") || "") })); c.each(k, function (a, b) {
1274            var e = c(b), f = 0; d.byRow && 1 >= e.length ? e.css(d.property,
1275            "") : (e.each(function () { var a = c(this), b = { display: "inline-block" === a.css("display") ? "inline-block" : "block" }; b[d.property] = ""; a.css(b); a.outerHeight(!1) > f && (f = a.outerHeight(!1)); a.css("display", "") }), e.each(function () { var a = c(this), b = 0; "border-box" !== a.css("box-sizing") && (b += h(a.css("border-top-width")) + h(a.css("border-bottom-width")), b += h(a.css("padding-top")) + h(a.css("padding-bottom"))); a.css(d.property, f - b) }))
1276        }); m.each(function () { var a = c(this); a.attr("style", a.data("style-cache") || null) }); b._maintainScroll &&
1277        c(window).scrollTop(l / f * c("html").outerHeight(!0)); return this
1278    }; b._applyDataApi = function () { var a = {}; c("[data-match-height], [data-mh]").each(function () { var b = c(this), d = b.attr("data-match-height") || b.attr("data-mh"); a[d] = d in a ? a[d].add(b) : b }); c.each(a, function () { this.matchHeight(!0) }) }; var q = function (a) { b._beforeUpdate && b._beforeUpdate(a, b._groups); c.each(b._groups, function () { b._apply(this.elements, this.options) }); b._afterUpdate && b._afterUpdate(a, b._groups) }; b._update = function (a, e) {
1279        if (e && "resize" ===
1280        e.type) { var d = c(window).width(); if (d === n) return; n = d } a ? -1 === f && (f = setTimeout(function () { q(e); f = -1 }, b._throttle)) : q(e)
1281    }; c(b._applyDataApi); c(window).on("load", function (a) { b._update(!1, a) }); c(window).on("resize orientationchange", function (a) { b._update(!0, a) })
1282})(jQuery);
1283
1284/*\
1285|*|
1286|*|  :: cookies.js ::
1287|*|
1288|*|  A complete cookies reader/writer framework with full unicode support.
1289|*|
1290|*|  Revision #1 - September 4, 2014
1291|*|
1292|*|  https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
1293|*|  https://developer.mozilla.org/User:fusionchess
1294|*|
1295|*|  This framework is released under the GNU Public License, version 3 or later.
1296|*|  http://www.gnu.org/licenses/gpl-3.0-standalone.html
1297|*|
1298|*|  Syntaxes:
1299|*|
1300|*|  * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])
1301|*|  * docCookies.getItem(name)
1302|*|  * docCookies.removeItem(name[, path[, domain]])
1303|*|  * docCookies.hasItem(name)
1304|*|  * docCookies.keys()
1305|*|
1306\*/
1307
1308var docCookies = {
1309    getItem: function (sKey) {
1310        if (!sKey) { return null; }
1311        return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
1312    },
1313    setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
1314        if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; }
1315        var sExpires = "";
1316        if (vEnd) {
1317            switch (vEnd.constructor) {
1318                case Number:
1319                    sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
1320                    break;
1321                case String:
1322                    sExpires = "; expires=" + vEnd;
1323                    break;
1324                case Date:
1325                    sExpires = "; expires=" + vEnd.toUTCString();
1326                    break;
1327            }
1328        }
1329        document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
1330        return true;
1331    },
1332    removeItem: function (sKey, sPath, sDomain) {
1333        if (!this.hasItem(sKey)) { return false; }
1334        document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
1335        return true;
1336    },
1337    hasItem: function (sKey) {
1338        if (!sKey) { return false; }
1339        return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
1340    },
1341    keys: function () {
1342        var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
1343        for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) { aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]); }
1344        return aKeys;
1345    }
1346};;
1347var postingSearchPage = (function ($) {
1348    var returnObject = {
1349        init: function () {
1350            this.self = this;
1351        },
1352        wireUp: function () {
1353
1354            if (Modernizr.history && $('#posting-search-form').length) {
1355                $(window).on('popstate', function (e) {
1356                    if (history.state) {
1357                        updateContent(history.state);
1358                    }
1359                });
1360
1361                $(document).ready(function () {
1362                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
1363                });
1364
1365                $(document).on('submit', '#posting-search-form', function(event) {
1366                    var form = $('#posting-search-form');
1367                    var query = $(form).serialize();
1368                    var action = $(form).attr('action');
1369                    history.pushState({ urlPath: action + '?' + query, method: 'POST' }, $(document).attr('title'), action + '?' + query);
1370                    updateContent(history.state);
1371                    event.preventDefault();
1372                    return false;
1373                });
1374
1375                var loadAjaxContent = function (target, urlBase, method) {
1376                    $('#posting-search-form i').show();
1377                    $.ajax({
1378                        url: urlBase,
1379                        method: method
1380                    }).done(function (data) {
1381                        
1382                        //var table = $('.result').find('table');
1383
1384                        //if (table.length) {
1385                        //    var result = $(data).find('.result tbody');
1386                        //    table.find('tbody').remove();
1387                        //    table.find('thead').after(result);
1388
1389                        //    var paginationResult = $(data).find('.pagination');
1390                        //    var paginationContainer = $('.pager').find('.pagination-container');
1391
1392                        //    paginationContainer.find('.pagination').remove();
1393                        //    paginationContainer.append(paginationResult);
1394
1395                        //} else {
1396                            $(target).html($(data));
1397                        //}
1398
1399                        InitResponsiveTables(target);
1400                        $('#posting-search-form i').hide();
1401                    }).fail(function(data) {
1402                        //console.log(data);
1403                    });
1404                };
1405
1406                var updateContent = function (state) {
1407                    loadAjaxContent('#main', state.urlPath, state.method);
1408                };
1409
1410                var removeSelectedfilters = function () {
1411                    var table = $('.result').find('table th a').removeClass('selected');
1412                }
1413
1414                $(document).on('click', 'a.ajaxlink', function (event) {
1415                    var href = $(this).attr('href');
1416                    var title = $(document).attr('title');
1417
1418                    if ($(this).closest('thead').length) {
1419                        removeSelectedfilters();
1420                        $(this).addClass('selected');
1421                    }
1422
1423                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1424                    updateContent(history.state);
1425                    event.preventDefault();
1426                    return false;
1427                });
1428            }
1429        }
1430    };
1431
1432    returnObject.init();
1433    return returnObject;
1434})(jQuery);;
1435var handlingSearchPage = (function ($) {
1436    var returnObject = {
1437        init: function () {
1438            this.self = this;
1439        },
1440        wireUp: function () {
1441
1442            if (Modernizr.history && $('#handling-search-form').length) {
1443                $(window).on('popstate', function (e) {
1444                    if (history.state) {
1445                        updateContent(history.state);
1446                    }
1447                });
1448
1449                $(document).ready(function () {
1450                 //   setDatepickers();
1451                    fixSelects();
1452                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
1453                    
1454                });
1455
1456                $(document).on('change', '.selected-county', function () {
1457                    var form = $('#handling-search-form');
1458                    var query = $(form).serialize();
1459                    var newQuery = "";
1460                    $.each(query.split('&'), function (key, value) {
1461                        var split = value.split('=');
1462                        if (split[0] == 'SelectedMunicipality') {
1463                            value = 'SelectedMunicipality=0';
1464                        }
1465                        newQuery += value + '&';
1466                    });
1467                    var action = $(form).attr('action');
1468                    history.pushState({ urlPath: action + '?' + query, method: 'POST' }, $(document).attr('title'), action + '?' + query);
1469                    updateContent(history.state);
1470                    //event.preventDefault();
1471                    //return false;
1472                });
1473
1474                $(document).on('change', '.selected-municipality, .selected-handlingtype', function () {
1475                    var form = $('#handling-search-form');
1476                    var query = $(form).serialize();
1477                    var action = $(form).attr('action');
1478                    history.pushState({ urlPath: action + '?' + query, method: 'POST' }, $(document).attr('title'), action + '?' + query);
1479                    updateContent(history.state);
1480                    //event.preventDefault();
1481                    //return false;
1482                });
1483
1484                $(document).on('submit', '#handling-search-form', function (event) {
1485                    var form = $('#handling-search-form');
1486
1487                    var query = $(form).serialize();
1488                    var action = $(form).attr('action');
1489                    history.pushState({ urlPath: action + '?' + query, method: 'POST' }, $(document).attr('title'), action + '?' + query);
1490                    updateContent(history.state);
1491                    event.preventDefault();
1492                    return false;
1493                });
1494
1495                var loadAjaxContent = function (target, urlBase, method) {
1496                    
1497                    $('#handling-search-form .spinner').show();
1498                    $.ajax({
1499                        url: urlBase,
1500                        method: method
1501                    }).done(function (data) {
1502                        //$(target).html($(data));
1503
1504                        //var table = $('.result').find('table');
1505
1506                        //if (table.length) {
1507                        //    var result = $(data).find('.result tbody');
1508                        //    table.find('tbody').remove();
1509                        //    table.find('thead').after(result);
1510
1511                        //    var paginationResult = $(data).find('.pagination');
1512                        //    var paginationContainer = $('.pager').find('.pagination-container');
1513
1514                        //    paginationContainer.find('.pagination').remove();
1515                        //    paginationContainer.append(paginationResult);
1516
1517                        //} else {
1518                        //$(target).html($(data));
1519
1520                        $(target).prop('outerHTML', data);
1521                        //}
1522
1523                        InitResponsiveTables(target);
1524                       //setDatepickers();
1525                        $('#handling-search-form .spinner').hide();
1526                    }).fail(function(data) {
1527                        //console.log(data);
1528                    });
1529                };
1530
1531
1532                var clearInputs = function () {
1533                    $('#SearchText').val('');
1534                    $('#OrganisationNumber').val('');
1535                    $('#RegisterNumber').val('');
1536                    $('#OrganisationNumber').val('');
1537                    $('#SelectedCounty').val('');
1538                    $('#SelectedMunicipality').val('');
1539                    $('#SelectedHandlingType').val('');
1540                    $('#OnlyActive').prop("checked", false);
1541                    $('#FromDate').val('');
1542                    $('#ToDate').val('');
1543
1544                    $('#SearchText').focus();
1545                }
1546
1547                var fixSelects = function() {
1548                    $('select').each(function () {
1549                        var select = $(this);
1550                        var selectedValue = select.find('option[selected]').val();
1551
1552                        if (selectedValue) {
1553                            select.val(selectedValue);
1554                        } else {
1555                            select.prop('selectedIndex', 0);
1556                        }
1557                    });
1558                }
1559
1560                var updateContent = function (state) {
1561                    loadAjaxContent('#handling-search-page', state.urlPath, state.method);
1562                };
1563
1564                var removeSelectedfilters = function () {
1565                    var table = $('.result').find('table th a').removeClass('selected');
1566                }
1567
1568                $(document).on('click', 'a.ajaxlink', function (event) {
1569                    var href = $(this).attr('href');
1570                    var title = $(document).attr('title');
1571
1572                    if ($(this).closest('thead').length) {
1573                        removeSelectedfilters();
1574                        $(this).addClass('selected');
1575                    }
1576
1577                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1578                    updateContent(history.state);
1579                    event.preventDefault();
1580                    return false;
1581                });
1582
1583                $(document).on('click', '#clearBtn', function () {
1584                    clearInputs();
1585                });
1586
1587            }
1588        }
1589    };
1590
1591    returnObject.init();
1592    return returnObject;
1593})(jQuery);;
1594var reportDangerousProductPage = (function ($) {
1595    var returnObject = {
1596        init: function () {
1597            this.self = this;
1598        },
1599        wireUp: function () {
1600
1601
1602            
1603            if (Modernizr.history && $("#report-dangerous-product-form").length) {
1604
1605                $('form').submit(function (e) {
1606                    if (!$(this).valid()) {
1607
1608                        $(".validation-summary-errors").attr('role', 'alert');
1609                        $(".validation-summary-errors").attr("tabindex", -1).focus();
1610
1611                    return false;
1612                        
1613                    }
1614                });
1615
1616                // Spinner
1617                $(document).on("submit", "#report-dangerous-product-form", function (event) {
1618                    $("#report-dangerous-product-form i").show();
1619                    $("#report-dangerous-product-form input:submit").attr("disabled", true);
1620                });
1621
1622                // INPUT File
1623                $('.inputfile').each(function () {
1624                    var $input = $(this);
1625                    var $label = $input.next('label');
1626                    var labelVal = $label.next('span').html();
1627
1628                    $input.on('change', function (e) {
1629                        var fileName = '';
1630                        if (e.target.value) fileName = e.target.value.split('\\').pop();
1631                        if (fileName)
1632                            $label.next('span').html(fileName);
1633                        else
1634                            $label.next('span').html(labelVal);
1635                    });
1636
1637                    // Firefox bug fix
1638                    $input
1639                    .on('focus', function () { $input.addClass('has-focus'); })
1640                    .on('blur', function () { $input.removeClass('has-focus'); });
1641                });
1642                // Style file input ref
1643                // Ref: http://tympanus.net/codrops/2015/09/15/styling-customizing-file-inputs-smart-way/
1644                // Ref: http://robertnyman.com/2008/11/20/why-inline-css-and-javascript-code-is-such-a-bad-thing/
1645
1646
1647            }
1648        }
1649    };
1650
1651    returnObject.init();
1652    return returnObject;
1653})(jQuery);;
1654var newsListBlock = {
1655    OnComplete: function (data) {
1656        $('.div-newsListBlockShowMore').remove();
1657        $('.newsListItems').append(data);
1658    },
1659    OnFailure: function (data) {
1660        console.log(data.responseText);
1661    }
1662};
1663var newsArchivePage = (function ($) {
1664    var returnObject = {
1665        init: function () {
1666            this.self = this;
1667        },
1668        wireUp: function () {
1669
1670            if (Modernizr.history && $('#newsarchivepage').length) {
1671                $(window).on('popstate', function (e) {
1672                    if (history.state) {
1673                        updateContent(history.state);
1674                    }
1675                });
1676
1677                $(document).ready(function () {
1678                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
1679                });
1680
1681                var loadAjaxContent = function (target, urlBase, method) {
1682                    $.ajax({
1683                        url: urlBase,
1684                        method: method
1685                    }).done(function (data) {
1686                        $(target).html(data);
1687                    });
1688                };
1689
1690                var updateContent = function (state) {
1691                    loadAjaxContent('#newsarchivepage', state.urlPath, state.method);
1692                };
1693
1694                $(document).on('click', 'button.ajaxlink', function (event) {
1695                    if ($(this).hasClass('newsitem__meta__category') || $(this).hasClass('newsArchiveitem__category')) {
1696                        $.each($(this).parent().parent().find('li'), function () {
1697                            if ($(this).removeClass('active'));
1698                        });
1699                        $(this).parent().addClass('active');
1700                        $(this).blur();
1701                    }
1702                    var href = $(this).attr('data-url');
1703                    href = href.replace('#newsarchivepageshowmore', '');
1704                    var title = $(document).attr('title');
1705                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1706                    updateContent(history.state);
1707                    event.preventDefault();
1708                    return false;
1709                });
1710            }
1711        }
1712    };
1713
1714    returnObject.init();
1715    return returnObject;
1716})(jQuery);;
1717var searchResultsPage = (function ($) {
1718    var returnObject = {
1719        init: function () {
1720            this.self = this;
1721        },
1722        wireUp: function () {
1723            var that = this;
1724
1725            if (Modernizr.history && $('#searchresultspage').length) {
1726                $(window).on('popstate', function (e) {
1727                    if (history.state) {
1728                        updateContent(history.state);
1729                    }
1730                });
1731
1732                that.ajaxing = false;
1733
1734                $(document).ready(function () {
1735                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
1736                });
1737
1738                var loadAjaxContent = function (target, urlBase, method, elementIds = []) {
1739                    $('.searchresultspage .aside__menu--filter').toggleClass('mute');
1740                    $('.searchresultspage .search-filter-selections').toggleClass('mute');
1741                    that.ajaxing = true;
1742                    $.ajax({
1743                        url: urlBase,
1744                        method: method
1745                    }).done(function (data) {
1746                        that.ajaxing = false;
1747                        $('.searchresultspage .aside__menu--filter').toggleClass('mute');
1748                        $('.searchresultspage .search-filter-selections').toggleClass('mute');
1749                        elementIds.concat([...$('.ajax-update', target)].map(el => el.id)).forEach(id => {
1750                            if (id != null);
1751                            {
1752                                $("#" + id, target).html($('#' + id, data).html());
1753                            }
1754                        });
1755
1756                        var firstresult = $("#result-list .pagelist").data("firstresult");
1757                        if (firstresult !== undefined && !isNaN(firstresult) && firstresult > 1) {
1758                            $("#result-list .searchhit:eq(" + firstresult + ") a:first").focus();
1759                        }
1760                    });
1761                };
1762
1763                var updateContent = function (state) {
1764                    loadAjaxContent('#searchresultspage', state.urlPath, state.method);
1765                };
1766
1767                var toggleFilterGroup = function (filterGroup) {
1768                    var filterButton = $('> button', filterGroup);
1769                    var expandButtons = filterGroup.closest('.expand-buttons');
1770
1771                    if (filterGroup.hasClass('expanded')) {
1772                        filterGroup.removeClass('expanded');
1773                        filterButton.attr('aria-expanded', "false");
1774                    } else {
1775                        $('.filter-group', expandButtons).removeClass('expanded');
1776                        $('button', expandButtons).attr('aria-expanded', "false");
1777                        filterGroup.addClass('expanded');
1778                        filterButton.attr('aria-expanded', "true");
1779                    }
1780                };
1781
1782                var updateContent = function (state, extraUpdateIds = []) {
1783                    loadAjaxContent('#searchresultspage', state.urlPath, state.method, extraUpdateIds);
1784                };
1785
1786                $(document).on('click', 'button.ajaxlink', function (event) {
1787                    if (that.ajaxing === true) {
1788                        event.preventDefault();
1789                        return false;
1790                    }
1791
1792                    if ($(this).hasClass('searchitem__meta__category') || $(this).hasClass('searchArchiveitem__category')) {
1793                        if ($(this).parent().hasClass('active'))
1794                            $(this).parent().removeClass('active');
1795                        else
1796                            $(this).parent().addClass('active');
1797                        $(this).blur();
1798                    }
1799                    var href = $(this).attr('data-url');
1800                    href = href.replace('#showmore', '');
1801
1802                    var extraUpdateIds = $(this).attr('data-extra-update-ids') ? $(this).attr('data-extra-update-ids').split(',').map(id => id.trim()) : [];
1803                    var title = $(document).attr('title');
1804                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1805                    updateContent(history.state, extraUpdateIds);
1806                    event.preventDefault();
1807                    return false;
1808                });
1809
1810                $(document).on('click', function (event) {
1811                    var filterGroup = $(event.target).closest('.filter-group');
1812                    if (filterGroup.length > 0) {
1813                        if ($(event.target).closest('button.filter-toggle').length > 0) {
1814                            toggleFilterGroup(filterGroup);
1815                        }
1816                    } else {
1817                        $('.filter-group.expanded').each(function() {
1818                            toggleFilterGroup($(this));
1819                        });
1820                    }
1821                });
1822
1823                $(document).on('change', '.form-check-input', function (event) {
1824                    var form = $('#searchform');
1825                    var actionUrl = form.attr('action');
1826                    var href = actionUrl + "?" + form.serialize();
1827                    var title = $(document).attr('title');
1828                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1829                    updateContent(history.state);
1830                });
1831            }
1832        }
1833    };
1834
1835    returnObject.init();
1836    return returnObject;
1837})(jQuery);;
1838var afsSearchPage = (function ($) {
1839    var returnObject = {
1840        init: function () {
1841            this.self = this;
1842        },
1843        wireUp: function () {
1844            var that = this;
1845            
1846            if (Modernizr.history && $('.afssearchpage').length && app.viewport.isDesktop) {
1847                $(window).on('popstate', function (e) {
1848                    if (history.state) {
1849                        updateContent(history.state);
1850                    }
1851                });
1852
1853                that.ajaxing = false;
1854
1855                $(document).ready(function () {
1856                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
1857                });
1858
1859                var loadAjaxContent = function (target, urlBase, method) {
1860                    that.ajaxing = true;
1861                    $.ajax({
1862                        url: urlBase,
1863                        method: method
1864                    }).done(function (data) {
1865                        that.ajaxing = false;
1866                        $(target).html(data);
1867                    });
1868                };
1869
1870                var updateContent = function (state) {
1871                    loadAjaxContent('.main-content', state.urlPath, state.method);
1872                };
1873
1874                $(document).on('click', 'button.ajaxlink', function (event) {
1875                    if (that.ajaxing === true) {
1876                        event.preventDefault();
1877                        return false;
1878                    }
1879
1880                    var href = $(this).attr('data-url');
1881                    href = href.replace('#showmore', '');
1882                    var title = $(document).attr('title');
1883                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
1884                    updateContent(history.state);
1885                    event.preventDefault();
1886                    return false;
1887                });
1888            }
1889        }
1890    };
1891
1892    returnObject.init();
1893    return returnObject;
1894})(jQuery);;
1895var languageSelector = (function ($) {
1896    var returnObject = {
1897        init: function () {
1898        },
1899        wireUp: function () {
1900
1901            $('.languagetoggle').each(function () {
1902                var self = $(this);
1903                self.removeClass('hover');
1904                self.on('click', function () {
1905                    if (self.hasClass('open')) {
1906                        self.removeClass('open');
1907                        self.attr('aria-expanded', "false");
1908                    } else {
1909                        self.addClass('open');
1910                        self.attr('aria-expanded', "true");
1911                    }
1912                });
1913            });
1914
1915        }
1916    };
1917
1918    returnObject.init();
1919    return returnObject;
1920})(jQuery);;
1921var doctorsReportPage = (function ($) {
1922    var returnObject = {
1923        init: function() {
1924            this.self = this;
1925        },
1926        wireUp: function() {
1927
1928            $('form').submit(function (e) {
1929                if (!$(this).valid()) {
1930
1931                    $(".validation-summary-errors").attr('role', 'alert');
1932                    $(".validation-summary-errors").attr("tabindex", -1).focus();
1933
1934                    return false;
1935
1936                }
1937            });
1938
1939            $(document).on('click', 'a.remove-affected-people', function (event) {
1940                // We must keep at least one, since it's a required field.
1941                if ($('#doctors-report-affected .affected-row').length > 1) {
1942                    $(this).closest('.affected-row').remove();
1943                }
1944                event.preventDefault();
1945                return false;
1946            });
1947        }
1948    };
1949
1950    returnObject.init();
1951    return returnObject;
1952})(jQuery);;
1953var readspeakerPdf = (function ($) {
1954    var returnObject = {
1955        init: function () {
1956            this.self = this;
1957        },
1958        wireUp: function () {
1959
1960            $(document).ready(function () {
1961                var link = document.getElementsByTagName('a');
1962                var lang = 'en_uk';
1963                if ($('html').attr('lang') === 'sv') {
1964                    lang = 'sv_se';
1965                }
1966                for (var i = 0; i < link.length; i++) {
1967                    var href = link[i].getAttribute('href');
1968                    var dataUrl = link[i].getAttribute('data-readerurl');
1969                    if (href != null && href.toLowerCase().indexOf('.pdf') > 0 && dataUrl == null) {
1970                        var url = window.location.protocol + '//' + window.location.host + href;
1971                        link[i].setAttribute('data-readerurl', 'https://docreader.readspeaker.com/docreader/?cid=bqsds&amp;lang=' + lang + '&amp;url=' + url);
1972                    }
1973                }
1974            });
1975
1976            $('.main-container').on('click', 'a[data-readerurl]', function () {
1977                var self = $(this);
1978                if ($('.rsexpanded').length > 0) {
1979                    var dialog = $('#accDialog');
1980                    if (dialog.length > 0) {
1981                        $('#accYes').focus();
1982                    } else {
1983                        var accessibleDialog = '<div id="accDialog" role="dialog" aria-labelledby="accTitle" aria-describedby="accDesc">' +
1984                            '<div class="box">' +
1985                            '<button id="accClose" type="button" aria-labelledby="closeDescription" aria-describedby="closeDescription">' +
1986                            '<i>&#xf05c;</i><span id="closeDescription">' + translate('close') + '</span></button>' +
1987                            '<h1 id="accTitle">' + translate('title') + '</h1>' +
1988                            '<div id="accDesc">' + translate('description') + '</div>' +
1989                            '<button id="accYes" type="button">' + translate('yes') + '</button>' +
1990                            '<button id="accNo" type="button">' + translate('no') + '</button>' +
1991                            '</div></div>';
1992                        $('body').append(accessibleDialog);
1993
1994                        $('#accYes').focus();
1995
1996                        $('#accNo').on("click", function () {
1997                            $("#accDialog").remove();
1998                            window.open(self.attr("href"), "_blank");
1999                        });
2000
2001                        $('#accYes').on("click", function () {
2002                            $("#accDialog").remove();
2003                            window.open(self.data("readerurl"), "_blank");
2004                        });
2005
2006                        $('#accClose').on("click", function () {
2007                            $("#accDialog").remove();
2008                        });
2009                    }
2010
2011                    return false;
2012                }
2013            });
2014
2015            $('body').on("keydown", function (event) {
2016
2017                /* on ESC, closes accessible dialog */
2018                if (event.which === 27) {
2019                    $("#accClose").trigger('click');
2020                }
2021
2022                // on tab/shift-tab, keep focus on dialog
2023                if (event.which === 9) {
2024                    var dialog = $("#accDialog");
2025                    if (dialog.length === 1) {
2026                        var buttons = $('button', dialog);
2027                        var numButtons = buttons.length;
2028                        var focusIndex = buttons.index($(':focus'));
2029
2030                        if (event.shiftKey) {
2031                            if (focusIndex === 0) {
2032                                buttons.get(numButtons - 1).focus();
2033                                event.preventDefault();
2034                            }
2035
2036                        } else {
2037                            if (focusIndex === numButtons - 1) {
2038                                buttons.get(0).focus();
2039                                event.preventDefault();
2040                            }
2041                        }
2042                    }
2043                }
2044            });
2045
2046            var translatedStrings = {
2047                sv: {
2048                    title: 'Öppna i skärmläsare?',
2049                    description: 'Vill du öppna den här pdf:en i en uppläsningsbar version?',
2050                    yes: 'Ja',
2051                    no: 'Nej',
2052                    close: 'Stäng'
2053                },
2054                en: {
2055                    title: 'Open in screenreader?',
2056                    description: 'Do you want to open this pdf in a screenreader?',
2057                    yes: 'Yes',
2058                    no: 'No',
2059                    close: 'Close'
2060                }
2061            };
2062
2063            function translate(key) {
2064                var lang = $('html').attr('lang');
2065                if (lang != undefined && translatedStrings[lang] != undefined) {
2066                    return translatedStrings[lang][key];
2067                } else {
2068                    return translatedStrings.en[key];
2069                }
2070            }
2071        }
2072    };
2073
2074    returnObject.init();
2075    return returnObject;
2076})(jQuery);;
2077var exposureCalculator = (function ($) {
2078    var returnObject = {
2079        init: function () {
2080            this.self = this;
2081        },
2082        wireUp: function () {
2083
2084            if ($('#exposureCalculator').length) {
2085
2086                $(document).ready(function () {
2087                    addEs();
2088                    addPerson();
2089                    $('#hygenicLimit').numeric(',');
2090                    $('#exposureCalculator #hygenicLimit').keyup(function () {
2091                        calculate();
2092                    });
2093                    //$('#date').datepicker({
2094                    //    lang: 'sv-SE',
2095                    //    weekStart: 1,
2096                    //    format: 'yyyy-mm-dd',
2097                    //    days: ['Söndag', 'Måndag', 'Tisdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lördag'],
2098                    //    daysShort: ['Sön', 'Mån', 'Tis', 'Ons', 'Tors', 'Fre', 'Lör'],
2099                    //    daysMin: ['Sö', 'Må', 'Ti', 'On', 'To', 'Fr', 'Lö'],
2100                    //    months: ['Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December'],
2101                    //    monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec']
2102                    //});
2103                });
2104
2105                var esTemplate = '<tbody class="exposureScenario es{esNum}" data-esnum="{esNum}">' +
2106                                    '<tr>' +
2107	                                    '<td colspan="5"><strong>Exponeringsscenario {esNum} (ES{esNum})</strong></td>' +
2108                                    '</tr>' +
2109                                    '<tr>' +
2110	                                    '<td colspan="5">' +
2111                                            'Beskrivning av vad exponeringsscenariot innefattar - ingående arbetsuppgifter<br />' +
2112                                            '<textarea name="textareaEs{esNum}" class="exposureTextArea"></textarea>' +
2113                                        '</td>' +
2114                                    '</tr>' +
2115                                    '<tr>' +
2116	                                    '<td colspan="3">Metod</td>' +
2117	                                    '<td colspan="2">Resultat</td>' +
2118                                    '</tr>' +
2119                                    '<tr>' +
2120	                                    '<td colspan="3" style="vertical-align: top;">' +
2121		                                    '<select id="selectES{esNum}" class="exposureMethod"></select>' +
2122	                                    '</td>' +
2123	                                    '<td style="vertical-align: top;"><input type="text" class="mgPerCubicMetre" placeholder="Fyll i ditt resultat" /> (mg/m³)</td>' +
2124	                                    '<td style="vertical-align: top;"><input type="text" class="percentOfHgv" /> (% av HGV)</td>' +
2125                                    '</tr>' +
2126                                    '</tbody>';
2127
2128                var persTemplate = '<tbody class="person p{pNum}">' +
2129                                    '<tr>' +
2130	                                    '<td rowspan="2">P{pNum}</td>' +
2131	                                    '<td>Aktivitetstid per ES (min)</td>' +
2132	                                    '<td><input type="text" class="dailyExposureMins es1" /></td>' +
2133	                                    '<td><input type="text" class="dailyExposureMins es2" readonly="readonly" /></td>' +
2134	                                    '<td><input type="text" class="dailyExposureMins es3" readonly="readonly" /></td>' +
2135	                                    '<td><input type="text" class="dailyExposureMins es4" readonly="readonly" /></td>' +
2136	                                    '<td><input type="text" class="dailyExposureMins es5" readonly="readonly" /></td>' +
2137	                                    '<td><input type="text" class="dailyExposureMins es6" readonly="readonly" /></td>' +
2138                                    '</tr>' +
2139                                    '<tr>' +
2140	                                    '<td>Exponering under 480 min</td>' +
2141	                                    '<td colspan="6">' +
2142		                                    '<span class="MgPer480Mins">0.00 mg/m³</span>' +
2143		                                    ' vilket motsvarar ' +
2144		                                    '<span class="HgvPer480Mins">0% av HGV</span>' +
2145	                                    '</td>' +
2146                                    '</tr>' +
2147                                    '</tbody>';
2148
2149                function addEs() {
2150                    var esNum = $('#exposureCalculator .exposureScenario').length + 1;
2151                    var es = esTemplate.replace(/{esNum}/g, esNum);
2152                    $('#exposureCalculator .addEs').before(es);
2153                    initExposureScenario($('#exposureCalculator .es' + esNum));
2154                    if (esNum >= 6) {
2155                        $(".addEs").hide();
2156                    }
2157                }
2158
2159                function addPerson() {
2160                    var pNum = $('#exposureCalculator .person').length + 1;
2161                    var person = persTemplate.replace(/{pNum}/g, pNum);
2162                    $('#exposureCalculator .addPerson').before(person);
2163                    initPerson($('#exposureCalculator .p' + pNum));
2164                }
2165
2166                $(document).on('click', '.addEs', function () {
2167                    addEs();
2168                });
2169
2170                $(document).on('click', '.addPerson', function () {
2171                    addPerson();
2172                });
2173
2174                function initPerson(p) {
2175                    $('.dailyExposureMins', p).numeric(',').keyup(function () {
2176                        calculate();
2177                    });
2178                    updateEsInputs();
2179                }
2180
2181                function initExposureScenario(es) {
2182                    $('.exposureMethod', es).append('<option value="-1">-- Välj metod --</option>');
2183                    $('.exposureMethod', es).append('<option value="0">Grov bedömning</option>');
2184                    $('.exposureMethod', es).append('<option value="1">Modellering</option>');
2185                    $('.exposureMethod', es).append('<option value="2">
2185Tidigare mätningar</option>');
2186                    $('.exposureMethod', es).append('<option value="3">Exponeringsmätning</option>');
2187                    $('.percentOfHgv', es).attr({ readonly: 'readonly' });
2188                    $('.mgPerCubicMetre', es).numeric(',');
2189                    $('.mgPerCubicMetre', es).keyup(function () {
2190                        calculate();
2191                    });
2192                    updateEsInputs();
2193                }
2194
2195                function updateEsInputs() {
2196                    $('#exposureCalculator .exposureScenario').each(function () {
2197                        var es = $(this);
2198                        $('#exposureCalculator .person .es' + es.data('esnum')).removeAttr('readonly');
2199                    });
2200                }
2201
2202                function clearInputs() {
2203                    $('.exposureMethod').val('-1');
2204                    $('.percentOfHgv').val('');
2205                    $('.mgPerCubicMetre').val('');
2206                    $('.exposureTextArea').val('');
2207                    $('#chemicalSubstance').val('');
2208                    $('#date').val('');
2209                    $('#department').val('');
2210                    $('#inspector').val('');
2211                    $('#hygenicLimit').val('');
2212                    $('.dailyExposureMins').val('');
2213                    $('.MgPer480Mins').html('0.00 mg/m³');
2214                    $('.HgvPer480Mins').html('0% av HGV');
2215                    $('#date').val();
2216                }
2217
2218                function calculate() {
2219                    var limit = $('#hygenicLimit');
2220                    if (limit.val() === "") {
2221                        return;
2222                    }
2223                    $('#exposureCalculator .mgPerCubicMetre').each(function () {
2224                        var element = $(this);
2225                        if (element.val() !== '') {
2226                            var resVal = (element.val().replace(',', '.') * 100) / limit.val().replace(',', '.');
2227                            var resInput = element.parent().parent().find('.percentOfHgv');
2228                            $(resInput).val(parseFloat(resVal.toPrecision(2)));
2229                        }
2230                    });
2231
2232                    $('#exposureCalculator .person').each(function () {
2233                        var curPerson = $(this);
2234                        var cubicsum = 0;
2235                        $('#exposureCalculator .exposureScenario').each(function () {
2236                            var curEs = $(this);
2237                            var x = $('.mgPerCubicMetre', curEs).val();
2238                            var y = $('.es' + curEs.data('esnum'), curPerson).val();
2239                            if (x !== '' && y !== '') {
2240                                var esSum = x * y;
2241                                cubicsum = cubicsum + esSum;
2242                            }
2243                        });
2244
2245                        var MgPer480 = (cubicsum / 480);
2246                        $('.MgPer480Mins', curPerson).html(parseFloat(MgPer480.toPrecision(2)) + ' mg/m³');
2247
2248                        var percentHgv = ((cubicsum / 480) / $('#hygenicLimit').val()) * 100;
2249                        $('.HgvPer480Mins', curPerson).html(parseFloat(percentHgv.toPrecision(2)) + '% av HGV');
2250                    });
2251                }
2252
2253                $(document).on('click', '#calculateDailyExposureBtn', function () {
2254                    var limit = $('#hygenicLimit');
2255                    if (limit.val() === "") {
2256                        alert('Du måste ange ett hygieniskt gränsvärde.');
2257                        return;
2258                    }
2259                    $('.exposureMethod').each(function () {
2260                        var method = $(this);
2261                        if (method.val() == -1) {
2262                            var esnum = method.closest('.exposureScenario').data('esnum');
2263                            alert('Du måste ange metod för Exponeringsscenario ' + esnum + ' (ES' + esnum + ').');
2264                            return;
2265                        }
2266                    });
2267                    $('.mgPerCubicMetre').each(function() {
2268                        var mgPerCubicMetre = $(this);
2269                        if (mgPerCubicMetre.val() === "") {
2270                            var esnum = mgPerCubicMetre.closest('.exposureScenario').data('esnum');
2271                            alert('Du måste fylla i ditt resultat för Exponeringsscenario ' + esnum + ' (ES' + esnum + ')');
2272                            return;
2273                        }
2274                    });
2275                    calculate();
2276                });
2277
2278                $(document).on('click', '#clearDailyExposureBtn', function () {
2279                    clearInputs();
2280                });
2281            }
2282
2283        }
2284    };
2285
2286    returnObject.init();
2287    return returnObject;
2288})(jQuery);;
2289var app = {
2290    noop: function () { },
2291    //runs on document.ready
2292    init: function () {
2293        require.config({
2294            baseUrl: "/static/scripts",
2295            paths: {
2296                "vendor": "/static/scripts/vendor/",
2297                "typeahead": "/static/scripts/vendor/typeahead",
2298/*                "jquery": "/Static/scripts/vendor/jquery-1.11.2",*/
2299                "bloodhound": "/static/scripts/vendor/bloodhound",
2300                "jquerynumeric": "/static/scripts/vendor/jquery.numeric",
2301/*                "datepicker": "/static/scripts/vendor/datepicker",*/
2302                "chart": "/static/scripts/vendor/chart.min",
2303                "accessible-autocomplete": "/static/scripts/vendor/accessible-autocomplete.min"
2304            },
2305            shim: {
2306                "typeahead": ["jquery"],
2307                "jquerynumeric": ["jquery"],
2308/*                "datepicker": ["jquery"],*/
2309                "bloodhound": {
2310                    deps: ["jquery"],
2311                    exports: "Bloodhound"
2312                }
2313            }
2314        });
2315        // stop requirejs from reloading jQuery
2316        if (typeof jQuery === 'function') {
2317            define('jquery', function () { return jQuery; });
2318        }
2319
2320        this.viewport.isPhone = $('#is-phone').is(':visible');
2321        this.viewport.isTablet = $('#is-tablet').is(':visible');
2322        this.viewport.isTabletOrSmaller = this.viewport.isPhone || this.viewport.isTablet;
2323        this.viewport.isDesktop = !this.viewport.isPhone && !this.viewport.isTablet;
2324
2325        this.features.transitions = Modernizr.csstransitions;
2326        this.features.transforms = Modernizr.csstransforms;
2327        this.features.flexbox = Modernizr.flexbox;
2328
2329        shareBox.wireUp();
2330        shareDialog.wireUp();
2331        commentBox.wireUp();
2332        xFormBlock.wireUp();
2333        //certifiedCompaniesPage.wireUp();
2334        postingSearchPage.wireUp();
2335        handlingSearchPage.wireUp();
2336        newsArchivePage.wireUp();
2337        searchResultsPage.wireUp();
2338        afsSearchPage.wireUp();
2339        reportDangerousProductPage.wireUp();
2340        reportAsbestrivningPage.wireUp();
2341        asbestApplicationPage.wireUp();
2342        ratpoisonApplicationPage.wireUp();
2343        languageSelector.wireUp();
2344        doctorsReportPage.wireUp();
2345        readspeakerPdf.wireUp();
2346        highlighter.wireUp();
2347        exposureCalculator.wireUp();
2348        gdprrequestwithelegPage.wireUp();
2349        eLegPage.wireUp();
2350        eLeveransPage.wireUp();
2351        minderarigApplicationPage.wireUp();
2352        postingApplicationPage.wireUp();
2353        multistepForm.wireUp();
2354        avTipsApplicationPage.wireUp();
2355        contactPage.wireUp();
2356        checklist.wireUp();
2357        forhandsanmalanByggarbetsplatsPage.wireUp();
2358        mobilequartzApplicationPage.wireUp();
2359        atl19aPage.wireUp();
2360        begaran66aPage.wireUp();
2361        ansokanStatsBidragAkrimPage.wireUp();
2362        ansokanAkrimReportingBackPage.wireUp();
2363        anmalanbearbetningbehandlingasbestPage.wireUp();
2364        ansokanundantagarbetstidslagenPage.wireUp();
2365        ansokanbearbetningbehandlingasbestPage.wireUp();
2366        ansokanhanteringasbestPage.wireUp();
2367        searchcompany.wireUp();
2368        findcompany.wireUp();
2369        searchorg.wireUp();
2370        anmalansmittamnenriskklass2Page.wireUp();
2371        ansokanfarligakemiskaamnen.wireUp();
2372        tablet.init();
2373        sidemenu.init();
2374        accessiblityIssuePage.wireUp();
2375        InitResponsiveTables(document);
2376        provisionPage.wireUp();
2377        provisionSearch.wireUp();
2378        paragraphkey.init();
2379        infotooltip.init();
2380        accordion.init();
2381        cookieaccept.init();
2382        imageblock.wireUp();
2383        referenceBlock.wireUp();
2384        provisionSearchModule.wireUp();
2385
2386        if ($('form.xform').length !== 0) {
2387            require(['xforms'], function (xforms) {
2388                xforms.init();
2389            });
2390        }
2391
2392        if ($('body').hasClass("searchresultspage") || $('.header__search').length !== 0) {
2393            require(['search'], function (search) {
2394                search.init();
2395            });
2396        }
2397
2398        if ($('html.oldie').length !== 0) {
2399            oldie.init();
2400        }
2401
2402        //find on page desktop open
2403        let findonpagenav = $('.onpagenavigation');
2404        if (findonpagenav.length !== 0 && findonpagenav.find('h2').length !== 0) {
2405            findonpagenav.find('h2').on('click', this.findOnPageNavClick);
2406        }        
2407
2408        // link whole news element on first page
2409        $(".newslistblock .pageitem, .js-linkarea").on('click', function () {
2410            window.location = $(this).find("a").attr("href");
2411        });
2412
2413
2414        //polyfill for setting equals heights on block when flexbox can't be used
2415        if ($('html.no-flexbox').length !== 0) {
2416            $('.blocks .block').matchHeight();
2417        }
2418
2419        $('.tabs').accessibleTabs({
2420            tabhead: '.tabh',
2421            tabbody: '.tabbody',
2422            fx: 'fadeIn'
2423        });
2424
2425        $('.tabs .tabs-list a').each(function (index) {
2426            var $this = $(this);
2427            if (index === 0) {
2428                $(this).attr('aria-selected', 'true');
2429            } else {
2430                $(this).attr('aria-selected', 'false');
2431            }
2432
2433            $(this).on('av:tabselect', function (e, selectedTab) {
2434                if (selectedTab === $this.get(0)) {
2435                    $(this).attr('aria-selected', 'true');
2436                } else {
2437                    $(this).attr('aria-selected', 'false');
2438                }
2439            });
2440
2441            $(this).on('click', function () {
2442                $('.tabs .tabs-list a').trigger('av:tabselect', [$this.get(0)]);
2443                $this.get(0).focus();
2444            });
2445
2446            $(this).on('keypress', function (event) {
2447                var key = event.which || event.keyCode;
2448                if (key === aria.KeyCode.SPACE || key === aria.KeyCode.RETURN) {
2449                    $(event.target).trigger("click");
2450                    event.preventDefault();
2451                }
2452            });
2453        });
2454
2455
2456        $('.expandablefield').each(function () {
2457            var self = $(this);
2458            var isEditMode = $(self).attr('data-edit-mode').toLowerCase();
2459            if (isEditMode === 'false') {
2460                self.addClass('enabled');
2461
2462                $('.tabh', self).on('click', function () {
2463                    var tab = $(this).closest('.tab');
2464                    if (tab.hasClass('expanded')) {
2465                        tab.removeClass('expanded');
2466                        $(this).attr('aria-expanded', "false");
2467                    } else {
2468                        tab.addClass('expanded');
2469                        $(this).attr('aria-expanded', "true");
2470                    }
2471                });
2472
2473                $('.tabh', self).on('keypress', function (event) {
2474                    var key = event.which || event.keyCode;
2475                    if (key === aria.KeyCode.SPACE || key === aria.KeyCode.RETURN) {
2476                        $(event.target).trigger("click");
2477                        event.preventDefault();
2478                    }
2479                });
2480
2481                // tabs containing search highlighted words should start expanded
2482                $('.tab', self).each(function () {
2483                    var curTab = $(this);
2484                    var curTabh = curTab.find('.highlight');
2485                    if (curTabh.length > 0) {
2486                        curTab.addClass('expanded');
2487                        curTabh.attr('aria-expanded', "true");
2488                    }
2489                });
2490            } else {
2491                $(self).removeClass('enabled');
2492            }
2493        });
2494
2495        $('.sortable').each(function () {
2496            var self = $(this);
2497            $("th:not([data-sort])", self).each(function () {
2498                var th = $(this);
2499                var sortInt = true;
2500
2501                $("tr>td:nth-child(" + (th.index() + 1) + ")", self).each(function () {
2502                    var td = $(this);
2503                    var result = isInt(td.text());
2504                    if (!result) {
2505                        sortInt = false;
2506                        return false;
2507                    }
2508                    return true;
2509                });
2510                th.attr("data-sort", sortInt ? "int" : "string");
2511            });
2512
2513            self.stupidtable();
2514        });
2515
2516        // $('.cookie-info').on('click', 'button', function () {
2517        //     docCookies.setItem('cookieaccept', 1, Infinity, '/');
2518        //     if (app.features.transforms && app.features.transitions) {
2519        //         var bannerHeight = $('.cookie-info').height();
2520        //         $('.cookie-info').css({ "margin-top": -bannerHeight + "px" });
2521        //     } else {
2522        //         $('.cookie-info').slideUp(500);
2523        //     }
2524        // });
2525
2526        // temporarily hide servernotification if it's in the way
2527        $('.servernotification').on('click', function () {
2528            var self = $(this);
2529            self.hide();
2530            setTimeout(function () { self.show(); }, 5000);
2531        });
2532
2533        // fixed pagenav on scroll
2534        var nav = $('.onpagenavigation');
2535        if (nav.length !== 0 && !this.viewport.isTabletOrSmaller) {
2536            var navtop = nav.position().top;
2537            $(window).scroll(function () {
2538                if ($(this).scrollTop() > navtop) {
2539                    nav.addClass('fixed-navigation');
2540                } else {
2541                    nav.removeClass('fixed-navigation');
2542                }
2543            });
2544        }
2545
2546        $("#scrolltop").addClass("scrolling").on('click', function () {
2547            $('html, body').animate({ scrollTop: 0 }, 500);
2548            return false;
2549        });
2550
2551        $(window).on('scroll', function () {
2552            if ($(this).scrollTop() > 700) {
2553                $('#scrolltop').addClass("visible");
2554            } else {
2555                $('#scrolltop').removeClass("visible");
2556            }
2557        });
2558
2559        $('.newslistblock .yearPicker span').on('click', function () {
2560            $(this).parent().toggleClass('open');
2561        });
2562
2563        $('.header__menu li span').each(function () {
2564            if ($(this).height() > 58) {
2565                $(this).parent().parent().addClass('center');
2566            }
2567        });
2568
2569        $('form button.clear-form').on('click', function (e) {
2570            e.preventDefault();
2571            var form = $(this).closest('form');
2572            $('input[type="text"]', form).val('');
2573
2574            $('select', form).each(function () {
2575                $(this).val($('option:first', $(this)).val());
2576            });
2577
2578            $('input[type="text"]:first', form).focus();
2579        });
2580    },
2581
2582    //runs on window.load
2583    onload: function () {
2584        if ($('html.oldie').length !== 0) {
2585            oldie.onload();
2586        }
2587
2588        //Twitter-typeahead klonar #query-elementet, så vi lägger till accesskey efter kloningen, så det inte blir dublett på accesskey.
2589        //$('#query').attr("accesskey", "4");
2590    },
2591
2592    destroy: function () {
2593    },
2594
2595    findOnPageNavClick: function (event) {
2596        $('.onpagenavigation').toggleClass('open');
2597    },
2598   
2599    viewport: {
2600        isPhone: false,
2601        isTablet: false,
2602        isDesktop: true
2603    },
2604
2605    features: {
2606        transitions: false,
2607        transforms: false,
2608        flexbox: false
2609    }
2610};
2611
2612function InitResponsiveTables(ctx) {
2613    if (app.viewport.isPhone || app.viewport.isTablet) {
2614        var tableResponsive = 'table.responsive';
2615        var isSortable = $(tableResponsive).find('thead th').children('a').is('a');
2616
2617        if (!isSortable) {
2618            $(tableResponsive).addClass('responsive--hide-thead');
2619        }
2620
2621        $(tableResponsive, ctx).each(function () {
2622            var curTable = $(this);
2623            var headers = new Array();
2624            $('thead td, th', curTable).each(function () {
2625                headers.push($(this).text().trim());
2626            });
2627            $('tr', curTable).each(function () {
2628                for (var i = 0; i < headers.length; i++) {
2629                    $('td', this).eq(i).attr('data-th', headers[i]);
2630                }
2631            });
2632        });
2633    }
2634}
2635
2636function isInt(x) {
2637    var y = parseInt(x, 10);
2638    return !isNaN(y) && x == y && x.toString() == y.toString();
2639}
2640
2641function ValidRecaptcha(response) {
2642    $("button[type=submit]", $(".g-recaptcha").closest("form")).prop('disabled', false);
2643}
2644
2645function ResetRecaptcha() {
2646    $("button[type=submit]", $(".g-recaptcha").closest("form")).prop('disabled', true);
2647    grecaptcha.reset();
2648}
2649
2650var oldie = {
2651    init: function () {
2652        $('.d--hidden').hide();
2653    },
2654
2655    onload: function () {
2656        this.fixHeroImage();
2657        $('body').addClass('onloaded');
2658    },
2659
2660    fixHeroImage: function () {
2661        var $hero = $('.hero');
2662        if ($hero.length === 0) {
2663            return;
2664        }
2665
2666        var $inner = $hero.find('.hero__image__inner'),
2667            imageWidth = $inner.find('img').width(),
2668            containerWidth = $hero.width();
2669
2670        $inner.css('margin-left', -(imageWidth - containerWidth / 2));
2671    }
2672};
2673
2674// Looks for all elements in [orgElem] with data-updateasync attribute and update their content
2675// with correseponding element with matching data-updateasync value in [newElem]
2676const updateElements = (orgElem, newElem) => {
2677    if (orgElem === undefined || newElem === undefined) {
2678        return;
2679    }
2680
2681    if (typeof newElem === 'string') {
2682        newElem = new DOMParser().parseFromString(newElem, "text/html");
2683    }
2684
2685    const firstElements = orgElem.querySelectorAll('[data-updateasync]');
2686    const secondElements = newElem.querySelectorAll('[data-updateasync]');
2687
2688    firstElements.forEach(firstEl => {
2689        const dataValue = firstEl.getAttribute('data-updateasync');
2690        const correspondingSecondEl = Array.from(secondElements).find(secondEl =>
2691            secondEl.getAttribute('data-updateasync') === dataValue);
2692
2693        if (correspondingSecondEl) {
2694            firstEl.innerHTML = correspondingSecondEl.innerHTML;
2695        }
2696    });
2697}
2698
2699$(document).ready(function () {
2700    app.init();
2701});
2702
2703$(window).on("load", function () {
2704    app.onload();
2705});
2706;
2707var shareBox = (function ($) {
2708    var returnObject = {
2709        init: function () {
2710            
2711        },
2712        wireUp: function () {
2713            $('.share-box').each(function () {
2714                var sharebox = $(this);
2715                var url = sharebox.data('shareurl') === undefined ? location.href : sharebox.data('shareurl');
2716                url = encodeURIComponent(url);
2717                
2718                sharebox.on('click', '.facebook', function (event) {
2719                    event.preventDefault();
2720                    window.open('https://www.facebook.com/sharer/sharer.php?u=' + url,
2721                          'facebook-share-dialog',
2722                          'width=626,height=436');
2723                    return false;
2724                });
2725
2726                sharebox.on('click', '.twitter', function (event) {
2727                    event.preventDefault();
2728                    window.open('https://twitter.com/share?url=' + url,
2729                          'twitter-share-dialog',
2730                          'width=626,height=436');
2731                    return false;
2732                });
2733                
2734                sharebox.on('click', '.linkedin', function (event) {
2735                    event.preventDefault();
2736                    window.open('https://www.linkedin.com/shareArticle?mini=true&url=' + url,
2737                          'linkedin-share-dialog',
2738                          'width=626,height=436');
2739                    return false;
2740                });
2741
2742                sharebox.on('click', '.shareEmail', function (event) {
2743                    event.preventDefault();
2744                    var link = 'mailto:' + '?subject=' + document.title + '&body=' + url;
2745                    window.location.href = link;
2746                    return false;
2747                });
2748            });
2749        }
2750    };
2751
2752    returnObject.init();
2753    return returnObject;
2754})(jQuery);;
2755// js to the new share dialog.
2756// requires a overlay tag like provision
2757var shareDialog = (function ($) {
2758
2759    let tabletWidth = 970;
2760    let multiShareSelector = '.share-dialog';
2761    let shareDictionary = {
2762        '.facebook': "https://www.facebook.com/sharer/sharer.php?u=",
2763        ".twitter": "https://twitter.com/share?url=",
2764        ".linkedin": "https://www.linkedin.com/sharing/share-offsite?mini=true&url=",
2765        ".shareemail": 'mailto:' + '?subject=' + document.title + '&body=',
2766        ".copylink": ''
2767    };
2768
2769    var returnObject = {
2770        init: function () {
2771
2772        },
2773        wireUp: function () {
2774
2775            // Multishare
2776            MultiShare(multiShareSelector, shareDictionary);
2777
2778        }
2779    };
2780
2781    function MultiShare(selector, shareDict) {
2782
2783        let overlay = "#provisionpageoverlay";
2784        // Multishare
2785        // Set - aria-expanded on button.
2786        //let selector = '.multishare';
2787
2788        var url = $(selector).data('shareurl') === undefined ? location.href : $(selector).data('shareurl');
2789        url = encodeURIComponent(url);
2790
2791        $(selector + '-btn').on('click', function (event) {
2792            event.preventDefault();
2793            if ($(this).attr('aria-expanded') === "true") {
2794                $(this).attr("aria-expanded", "false").next(selector).hide();
2795                $(overlay).removeClass("active");
2796            }
2797            else {
2798                $(this).attr("aria-expanded", "true").next(selector).show();
2799
2800                if ($(window).width() < tabletWidth) {
2801                    $(overlay).addClass("active");
2802                }
2803
2804            }
2805        });
2806
2807        $(selector).on('focusout', function (event) {
2808            if ($(selector).has(event.relatedTarget).length === 0) {
2809                $(selector).hide();
2810                $(selector + '-btn').attr("aria-expanded", "false");
2811                $(overlay).removeClass("active");
2812            }
2813        });
2814
2815        //$(selector).on('mouseleave', function () {
2816        //    $(this).hide();
2817        //    $(selector + '-btn').attr("aria-expanded", "false");
2818        //});
2819
2820        $(selector + '-close').on('click', function (event) {
2821            event.preventDefault();
2822            $(selector).hide();
2823            $(selector + '-btn').attr("aria-expanded", "false");
2824            $(overlay).removeClass("active");
2825        });
2826
2827        $(selector + ',' + selector + '-btn').on('keydown', function (e) {
2828            // close with 'esc'
2829            if (e.keyCode == 27) {
2830                $(selector).hide();
2831                $(selector + '-btn').attr("aria-expanded", "false");
2832                $(overlay).removeClass("active");
2833            }
2834        });
2835
2836        $(overlay).on('click', function () {
2837            $(selector).hide();
2838            $(selector + '-btn').attr("aria-expanded", "false");
2839            $(overlay).removeClass("active");
2840        });
2841
2842        for (var key in shareDict) {
2843            //console.log(key + " --- " + shareDict[key]);
2844            (function (key) {
2845                $(selector).on('click', key, function (event) {
2846                    event.preventDefault();
2847                    if (key === '.shareemail')
2848                        window.location.href = 'mailto:' + '?subject=' + document.title + '&body=' + url;
2849                    else if (key === '.copylink') {
2850
2851                        try {
2852                            copyToClipboard(decodeURIComponent(url));
2853                            // console.log('Copied: ' + decodeURIComponent(url));
2854                            // checkmark copied.
2855                            $($(selector)).find(".copycheck").show();
2856
2857                        } catch (error) {
2858                            console.error(error);
2859                        }
2860
2861                    }
2862                    else
2863                        window.open(shareDict[key] + url, key.replace('.', '') + '-share-dialog', 'width=626,height=436');
2864                    return false;
2865                });
2866            })(key);
2867        }
2868    }
2869
2870
2871    function copyToClipboard(textToCopy) {
2872        // Navigator clipboard api needs a secure context (https)
2873        if (navigator.clipboard && window.isSecureContext) {
2874            navigator.clipboard.writeText(textToCopy);
2875        } else {
2876            // Use the 'out of viewport hidden text area' trick
2877            const textArea = document.createElement("textarea");
2878            textArea.value = textToCopy;
2879
2880            // Move textarea out of the viewport so it's not visible
2881            textArea.style.position = "absolute";
2882            textArea.style.left = "-999999px";
2883
2884            document.body.prepend(textArea);
2885            textArea.select();
2886
2887            try {
2888                document.execCommand('copy');
2889            } catch (error) {
2890                console.error(error);
2891            } finally {
2892                textArea.remove();
2893            }
2894        }
2895    }
2896
2897    returnObject.init();
2898    return returnObject;
2899})(jQuery);;
2900var commentBox = (function ($) {
2901    var returnObject = {
2902/*        $block: $('.commentboxblock'),*/
2903        init: function () {
2904            this.self = this;
2905        },
2906        wireUp: function () {
2907            if ($('#commentboxblock').length) {
2908                $(document).on('click',
2909                    '.vote-buttons button',
2910                    function(event) {
2911                        var self = $(this);
2912                        var commentblock = self.closest('.commentboxblock');
2913                        commentblock.addClass('expanded');
2914                        $('.vote-buttons button', commentblock).attr('aria-expanded', "true");
2915                        commentblock.find('textarea').focus();
2916                    });
2917
2918                this.self.ReloadChart();
2919            }
2920        },
2921        ReloadChart: function () {
2922            if ($('#votesChart')) {
2923                require(['chart'], function () {
2924                    var config = {
2925                        type: 'pie',
2926                        data: {
2927                            datasets: [{
2928                                data: [
2929                                    parseInt($("#upvotes").val()),
2930                                    parseInt($("#downvotes").val())
2931                                ],
2932                                backgroundColor: [
2933                                    '#2EA836',
2934                                    '#C90C0F'
2935                                ],
2936                                label: 'Feedback'
2937                            }],
2938                            labels: [
2939                                $("#upvotes").data('label'),
2940                                $("#downvotes").data('label')
2941                            ]
2942                        },
2943                        options: {
2944                            responsive: true,
2945                            legend: {
2946                                display: true,
2947                                position: 'right',
2948                                fullWidth: false,
2949                                labels: {
2950                                    boxWidth: 13
2951                                }
2952                            },
2953                            tooltips: {
2954                                callbacks: {
2955                                    label: function (tooltipItem, data) {
2956                                        var allData = data.datasets[tooltipItem.datasetIndex].data;
2957                                        var tooltipLabel = data.labels[tooltipItem.index];
2958                                        var tooltipData = allData[tooltipItem.index];
2959                                        var total = 0;
2960                                        for (var i in allData) {
2961                                            total += allData[i];
2962                                        }
2963                                        var tooltipPercentage = Math.round((tooltipData / total) * 100);
2964                                        return tooltipLabel + ': ' + tooltipData + ' (' + tooltipPercentage + '%)';
2965                                    }
2966                                }
2967                            }
2968                        }
2969                    };
2970
2971                    if (document.getElementById("votesChart")) {
2972                        var ctx = document.getElementById("votesChart").getContext("2d");
2973                        window.mychart = new Chart(ctx, config);
2974                    }
2975
2976                    $('.chartjs-hidden-iframe').attr('title', 'Röstningsdiagram');
2977                });
2978            }
2979        },
2980        ResetVotes: function () {
2981            $("#upvotes").val(0);
2982            $("#downvotes").val(0);
2983            $("#totalvotes").text(0);
2984            returnObject.ReloadChart();
2985        }
2986    };
2987
2988    returnObject.init();
2989    return returnObject;
2990})(jQuery);;
2991var checklist = (function ($) {
2992    var returnObject = {
2993        init: function () {
2994            this.self = this;
2995        },
2996        wireUp: function () {
2997            $(document).ready(function () {
2998                if ($('body').hasClass('checklistpage')) {
2999                    $('#check-list-form').on("submit", function (e) {
3000                        var chkd = $('input[name^="q-"]:checked').length;
3001                        const unique = $('input[name^="q-"]').get().map(i => i.name).filter((value, index, self) => self.indexOf(value) === index).length;
3002                        if (chkd === unique)
3003                            return true;
3004                        if (confirm($(this).find('input[type="submit"]').attr('data-alert')))
3005                            return true;
3006                        e.preventDefault();
3007                        return false;
3008                    });
3009
3010                    $(document).on('click', 'input[type="reset"]', function (e) {
3011                        if (confirm($(this).attr('data-alert')))
3012                            return true;
3013                        e.preventDefault();
3014                        return false;
3015                    });
3016                }
3017            });
3018        }
3019    };
3020
3021    returnObject.init();
3022    return returnObject;
3023})(jQuery);;
3024/*
3025 RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
3026 Available via the MIT or new BSD license.
3027 see: http://github.com/jrburke/requirejs for details
3028*/
3029var requirejs, require, define;
3030(function (ba) {
3031    function G(b) { return "[object Function]" === K.call(b) } function H(b) { return "[object Array]" === K.call(b) } function v(b, c) { if (b) { var d; for (d = 0; d < b.length && (!b[d] || !c(b[d], d, b)) ; d += 1); } } function T(b, c) { if (b) { var d; for (d = b.length - 1; -1 < d && (!b[d] || !c(b[d], d, b)) ; d -= 1); } } function t(b, c) { return fa.call(b, c) } function m(b, c) { return t(b, c) && b[c] } function B(b, c) { for (var d in b) if (t(b, d) && c(b[d], d)) break } function U(b, c, d, e) {
3032        c && B(c, function (c, g) {
3033            if (d || !t(b, g)) e && "object" === typeof c && c && !H(c) && !G(c) && !(c instanceof
3034            RegExp) ? (b[g] || (b[g] = {}), U(b[g], c, d, e)) : b[g] = c
3035        }); return b
3036    } function u(b, c) { return function () { return c.apply(b, arguments) } } function ca(b) { throw b; } function da(b) { if (!b) return b; var c = ba;
3036 v(b.split("."), function (b) { c = c[b] }); return c } function C(b, c, d, e) { c = Error(c + "\nhttp://requirejs.org/docs/errors.html#" + b); c.requireType = b; c.requireModules = e; d && (c.originalError = d); return c } function ga(b) {
3037        function c(a, k, b) {
3038            var f, l, c, d, e, g, i, p, k = k && k.split("/"), h = j.map, n = h && h["*"]; if (a) {
3039                a = a.split("/"); l = a.length - 1; j.nodeIdCompat &&
3040                Q.test(a[l]) && (a[l] = a[l].replace(Q, "")); "." === a[0].charAt(0) && k && (l = k.slice(0, k.length - 1), a = l.concat(a)); l = a; for (c = 0; c < l.length; c++) if (d = l[c], "." === d) l.splice(c, 1), c -= 1; else if (".." === d && !(0 === c || 1 === c && ".." === l[2] || ".." === l[c - 1]) && 0 < c) l.splice(c - 1, 2), c -= 2; a = a.join("/")
3041            } if (b && h && (k || n)) {
3042                l = a.split("/"); c = l.length; a: for (; 0 < c; c -= 1) { e = l.slice(0, c).join("/"); if (k) for (d = k.length; 0 < d; d -= 1) if (b = m(h, k.slice(0, d).join("/"))) if (b = m(b, e)) { f = b; g = c; break a } !i && (n && m(n, e)) && (i = m(n, e), p = c) } !f && i && (f = i, g = p); f && (l.splice(0,
3043                g, f), a = l.join("/"))
3044            } return (f = m(j.pkgs, a)) ? f : a
3045        } function d(a) { z && v(document.getElementsByTagName("script"), function (k) { if (k.getAttribute("data-requiremodule") === a && k.getAttribute("data-requirecontext") === i.contextName) return k.parentNode.removeChild(k), !0 }) } function e(a) { var k = m(j.paths, a); if (k && H(k) && 1 < k.length) return k.shift(), i.require.undef(a), i.makeRequire(null, { skipMap: !0 })([a]), !0 } function n(a) { var k, c = a ? a.indexOf("!") : -1; -1 < c && (k = a.substring(0, c), a = a.substring(c + 1, a.length)); return [k, a] } function p(a,
3046        k, b, f) { var l, d, e = null, g = k ? k.name : null, j = a, p = !0, h = ""; a || (p = !1, a = "_@r" + (K += 1)); a = n(a); e = a[0]; a = a[1]; e && (e = c(e, g, f), d = m(r, e)); a && (e ? h = d && d.normalize ? d.normalize(a, function (a) { return c(a, g, f) }) : -1 === a.indexOf("!") ? c(a, g, f) : a : (h = c(a, g, f), a = n(h), e = a[0], h = a[1], b = !0, l = i.nameToUrl(h))); b = e && !d && !b ? "_unnormalized" + (O += 1) : ""; return { prefix: e, name: h, parentMap: k, unnormalized: !!b, url: l, originalName: j, isDefine: p, id: (e ? e + "!" + h : h) + b } } function s(a) { var k = a.id, b = m(h, k); b || (b = h[k] = new i.Module(a)); return b } function q(a,
3047        k, b) { var f = a.id, c = m(h, f); if (t(r, f) && (!c || c.defineEmitComplete)) "defined" === k && b(r[f]); else if (c = s(a), c.error && "error" === k) b(c.error); else c.on(k, b) } function w(a, b) { var c = a.requireModules, f = !1; if (b) b(a); else if (v(c, function (b) { if (b = m(h, b)) b.error = a, b.events.error && (f = !0, b.emit("error", a)) }), !f) g.onError(a) } function x() { R.length && (ha.apply(A, [A.length, 0].concat(R)), R = []) } function y(a) { delete h[a]; delete V[a] } function F(a, b, c) {
3048            var f = a.map.id; a.error ? a.emit("error", a.error) : (b[f] = !0, v(a.depMaps, function (f,
3049            d) { var e = f.id, g = m(h, e); g && (!a.depMatched[d] && !c[e]) && (m(b, e) ? (a.defineDep(d, r[e]), a.check()) : F(g, b, c)) }), c[f] = !0)
3050        } function D() {
3051            var a, b, c = (a = 1E3 * j.waitSeconds) && i.startTime + a < (new Date).getTime(), f = [], l = [], g = !1, h = !0; if (!W) {
3052                W = !0; B(V, function (a) { var i = a.map, j = i.id; if (a.enabled && (i.isDefine || l.push(a), !a.error)) if (!a.inited && c) e(j) ? g = b = !0 : (f.push(j), d(j)); else if (!a.inited && (a.fetched && i.isDefine) && (g = !0, !i.prefix)) return h = !1 }); if (c && f.length) return a = C("timeout", "Load timeout for modules: " + f, null,
3053                f), a.contextName = i.contextName, w(a); h && v(l, function (a) { F(a, {}, {}) }); if ((!c || b) && g) if ((z || ea) && !X) X = setTimeout(function () { X = 0; D() }, 50); W = !1
3054            }
3055        } function E(a) { t(r, a[0]) || s(p(a[0], null, !0)).init(a[1], a[2]) } function I(a) { var a = a.currentTarget || a.srcElement, b = i.onScriptLoad; a.detachEvent && !Y ? a.detachEvent("onreadystatechange", b) : a.removeEventListener("load", b, !1); b = i.onScriptError; (!a.detachEvent || Y) && a.removeEventListener("error", b, !1); return { node: a, id: a && a.getAttribute("data-requiremodule") } } function J() {
3056            var a;
3057            for (x() ; A.length;
3057) { a = A.shift(); if (null === a[0]) return w(C("mismatch", "Mismatched anonymous define() module: " + a[a.length - 1])); E(a) }
3058        } var W, Z, i, L, X, j = { waitSeconds: 7, baseUrl: "./", paths: {}, bundles: {}, pkgs: {}, shim: {}, config: {} }, h = {}, V = {}, $ = {}, A = [], r = {}, S = {}, aa = {}, K = 1, O = 1; L = {
3059            require: function (a) { return a.require ? a.require : a.require = i.makeRequire(a.map) }, exports: function (a) { a.usingExports = !0; if (a.map.isDefine) return a.exports ? r[a.map.id] = a.exports : a.exports = r[a.map.id] = {} }, module: function (a) {
3060                return a.module ?
3061                a.module : a.module = { id: a.map.id, uri: a.map.url, config: function () { return m(j.config, a.map.id) || {} }, exports: a.exports || (a.exports = {}) }
3062            }
3063        }; Z = function (a) { this.events = m($, a.id) || {}; this.map = a; this.shim = m(j.shim, a.id); this.depExports = []; this.depMaps = []; this.depMatched = []; this.pluginMaps = {}; this.depCount = 0 }; Z.prototype = {
3064            init: function (a, b, c, f) {
3065                f = f || {}; if (!this.inited) {
3066                    this.factory = b; if (c) this.on("error", c); else this.events.error && (c = u(this, function (a) { this.emit("error", a) })); this.depMaps = a && a.slice(0); this.errback =
3067                    c; this.inited = !0; this.ignore = f.ignore; f.enabled || this.enabled ? this.enable() : this.check()
3068                }
3069            }, defineDep: function (a, b) { this.depMatched[a] || (this.depMatched[a] = !0, this.depCount -= 1, this.depExports[a] = b) }, fetch: function () { if (!this.fetched) { this.fetched = !0; i.startTime = (new Date).getTime(); var a = this.map; if (this.shim) i.makeRequire(this.map, { enableBuildCallback: !0 })(this.shim.deps || [], u(this, function () { return a.prefix ? this.callPlugin() : this.load() })); else return a.prefix ? this.callPlugin() : this.load() } }, load: function () {
3070                var a =
3071                this.map.url; S[a] || (S[a] = !0, i.load(this.map.id, a))
3072            }, check: function () {
3073                if (this.enabled && !this.enabling) {
3074                    var a, b, c = this.map.id; b = this.depExports; var f = this.exports, l = this.factory; if (this.inited) if (this.error) this.emit("error", this.error); else {
3075                        if (!this.defining) {
3076                            this.defining = !0; if (1 > this.depCount && !this.defined) {
3077                                if (G(l)) {
3078                                    if (this.events.error && this.map.isDefine || g.onError !== ca) try { f = i.execCb(c, l, b, f) } catch (d) { a = d } else f = i.execCb(c, l, b, f); this.map.isDefine && void 0 === f && ((b = this.module) ? f = b.exports : this.usingExports &&
3079                                    (f = this.exports)); if (a) return a.requireMap = this.map, a.requireModules = this.map.isDefine ? [this.map.id] : null, a.requireType = this.map.isDefine ? "define" : "require", w(this.error = a)
3080                                } else f = l; this.exports = f; if (this.map.isDefine && !this.ignore && (r[c] = f, g.onResourceLoad)) g.onResourceLoad(i, this.map, this.depMaps); y(c); this.defined = !0
3081                            } this.defining = !1; this.defined && !this.defineEmitted && (this.defineEmitted = !0, this.emit("defined", this.exports), this.defineEmitComplete = !0)
3082                        }
3083                    } else this.fetch()
3084                }
3085            }, callPlugin: function () {
3086                var a =
3087                this.map, b = a.id, d = p(a.prefix); this.depMaps.push(d); q(d, "defined", u(this, function (f) {
3088                    var l, d; d = m(aa, this.map.id); var e = this.map.name, P = this.map.parentMap ? this.map.parentMap.name : null, n = i.makeRequire(a.parentMap, { enableBuildCallback: !0 }); if (this.map.unnormalized) {
3089                        if (f.normalize && (e = f.normalize(e, function (a) { return c(a, P, !0) }) || ""), f = p(a.prefix + "!" + e, this.map.parentMap), q(f, "defined", u(this, function (a) { this.init([], function () { return a }, null, { enabled: !0, ignore: !0 }) })), d = m(h, f.id)) {
3090                            this.depMaps.push(f);
3091                            if (this.events.error) d.on("error", u(this, function (a) { this.emit
3091("error", a) })); d.enable()
3092                        }
3093                    } else d ? (this.map.url = i.nameToUrl(d), this.load()) : (l = u(this, function (a) { this.init([], function () { return a }, null, { enabled: !0 }) }), l.error = u(this, function (a) { this.inited = !0; this.error = a; a.requireModules = [b]; B(h, function (a) { 0 === a.map.id.indexOf(b + "_unnormalized") && y(a.map.id) }); w(a) }), l.fromText = u(this, function (f, c) {
3094                        var d = a.name, e = p(d), P = M; c && (f = c); P && (M = !1); s(e); t(j.config, b) && (j.config[d] = j.config[b]); try { g.exec(f) } catch (h) {
3095                            return w(C("fromtexteval",
3096                            "fromText eval for " + b + " failed: " + h, h, [b]))
3097                        } P && (M = !0); this.depMaps.push(e); i.completeLoad(d); n([d], l)
3098                    }), f.load(a.name, n, l, j))
3099                })); i.enable(d, this); this.pluginMaps[d.id] = d
3100            }, enable: function () {
3101                V[this.map.id] = this; this.enabling = this.enabled = !0; v(this.depMaps, u(this, function (a, b) {
3102                    var c, f; if ("string" === typeof a) {
3103                        a = p(a, this.map.isDefine ? this.map : this.map.parentMap, !1, !this.skipMap); this.depMaps[b] = a; if (c = m(L, a.id)) { this.depExports[b] = c(this); return } this.depCount += 1; q(a, "defined", u(this, function (a) {
3104                            this.defineDep(b,
3105                            a); this.check()
3106                        })); this.errback ? q(a, "error", u(this, this.errback)) : this.events.error && q(a, "error", u(this, function (a) { this.emit("error", a) }))
3107                    } c = a.id; f = h[c]; !t(L, c) && (f && !f.enabled) && i.enable(a, this)
3108                })); B(this.pluginMaps, u(this, function (a) { var b = m(h, a.id); b && !b.enabled && i.enable(a, this) })); this.enabling = !1; this.check()
3109            }, on: function (a, b) { var c = this.events[a]; c || (c = this.events[a] = []); c.push(b) }, emit: function (a, b) { v(this.events[a], function (a) { a(b) }); "error" === a && delete this.events[a] }
3110        }; i = {
3111            config: j, contextName: b,
3112            registry: h, defined: r, urlFetched: S, defQueue: A, Module: Z, makeModuleMap: p, nextTick: g.nextTick, onError: w, configure: function (a) {
3113                a.baseUrl && "/" !== a.baseUrl.charAt(a.baseUrl.length - 1) && (a.baseUrl += "/"); var b = j.shim, c = { paths: !0, bundles: !0, config: !0, map: !0 }; B(a, function (a, b) { c[b] ? (j[b] || (j[b] = {}), U(j[b], a, !0, !0)) : j[b] = a }); a.bundles && B(a.bundles, function (a, b) { v(a, function (a) { a !== b && (aa[a] = b) }) }); a.shim && (B(a.shim, function (a, c) {
3114                    H(a) && (a = { deps: a }); if ((a.exports || a.init) && !a.exportsFn) a.exportsFn = i.makeShimExports(a);
3115                    b[c] = a
3116                }), j.shim = b); a.packages && v(a.packages, function (a) { var b, a = "string" === typeof a ? { name: a } : a; b = a.name; a.location && (j.paths[b] = a.location); j.pkgs[b] = a.name + "/" + (a.main || "main").replace(ia, "").replace(Q, "") }); B(h, function (a, b) { !a.inited && !a.map.unnormalized && (a.map = p(b)) }); if (a.deps || a.callback) i.require(a.deps || [], a.callback)
3117            }, makeShimExports: function (a) { return function () { var b; a.init && (b = a.init.apply(ba, arguments)); return b || a.exports && da(a.exports) } }, makeRequire: function (a, e) {
3118                function j(c, d, m) {
3119                    var n,
3120                    q; e.enableBuildCallback && (d && G(d)) && (d.__requireJsBuild = !0); if ("string" === typeof c) { if (G(d)) return w(C("requireargs", "Invalid require call"), m); if (a && t(L, c)) return L[c](h[a.id]); if (g.get) return g.get(i, c, a, j); n = p(c, a, !1, !0); n = n.id; return !t(r, n) ? w(C("notloaded", 'Module name "' + n + '" has not been loaded yet for context: ' + b + (a ? "" : ". Use require([])"))) : r[n] } J(); i.nextTick(function () { J(); q = s(p(null, a)); q.skipMap = e.skipMap; q.init(c, d, m, { enabled: !0 }); D() }); return j
3121                } e = e || {}; U(j, {
3122                    isBrowser: z, toUrl: function (b) {
3123                        var d,
3124                        e = b.lastIndexOf("."), k = b.split("/")[0]; if (-1 !== e && (!("." === k || ".." === k) || 1 < e)) d = b.substring(e, b.length), b = b.substring(0, e); return i.nameToUrl(c(b, a && a.id, !0), d, !0)
3125                    }, defined: function (b) { return t(r, p(b, a, !1, !0).id) }, specified: function (b) { b = p(b, a, !1, !0).id; return t(r, b) || t(h, b) }
3126                }); a || (j.undef = function (b) { x(); var c = p(b, a, !0), e = m(h, b); d(b); delete r[b]; delete S[c.url]; delete $[b]; T(A, function (a, c) { a[0] === b && A.splice(c, 1) }); e && (e.events.defined && ($[b] = e.events), y(b)) }); return j
3127            }, enable: function (a) {
3128                m(h, a.id) &&
3129                s(a).enable()
3130            }, completeLoad: function (a) { var b, c, d = m(j.shim, a) || {}, g = d.exports; for (x() ; A.length;) { c = A.shift(); if (null === c[0]) { c[0] = a; if (b) break; b = !0 } else c[0] === a && (b = !0); E(c) } c = m(h, a); if (!b && !t(r, a) && c && !c.inited) { if (j.enforceDefine && (!g || !da(g))) return e(a) ? void 0 : w(C("nodefine", "No define call for " + a, null, [a])); E([a, d.deps || [], d.exportsFn]) } D() }, nameToUrl: function (a, b, c) {
3131                var d, e, h; (d = m(j.pkgs, a)) && (a = d); if (d = m(aa, a)) return i.nameToUrl(d, b, c); if (g.jsExtRegExp.test(a)) d = a + (b || ""); else {
3132                    d = j.paths;
3133                    a = a.split("/"); for (e = a.length; 0 < e;
3133 e -= 1) if (h = a.slice(0, e).join("/"), h = m(d, h)) { H(h) && (h = h[0]); a.splice(0, e, h); break } d = a.join("/"); d += b || (/^data\:|\?/.test(d) || c ? "" : ".js"); d = ("/" === d.charAt(0) || d.match(/^[\w\+\.\-]+:/) ? "" : j.baseUrl) + d
3134                } return j.urlArgs ? d + ((-1 === d.indexOf("?") ? "?" : "&") + j.urlArgs) : d
3135            }, load: function (a, b) { g.load(i, a, b) }, execCb: function (a, b, c, d) { return b.apply(d, c) }, onScriptLoad: function (a) { if ("load" === a.type || ja.test((a.currentTarget || a.srcElement).readyState)) N = null, a = I(a), i.completeLoad(a.id) },
3136            onScriptError: function (a) { var b = I(a); if (!e(b.id)) return w(C("scripterror", "Script error for: " + b.id, a, [b.id])) }
3137        }; i.require = i.makeRequire(); return i
3138    } var g, x, y, D, I, E, N, J, s, O, ka = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, la = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, Q = /\.js$/, ia = /^\.\//; x = Object.prototype; var K = x.toString, fa = x.hasOwnProperty, ha = Array.prototype.splice, z = !!("undefined" !== typeof window && "undefined" !== typeof navigator && window.document), ea = !z && "undefined" !== typeof importScripts, ja =
3139    z && "PLAYSTATION 3" === navigator.platform ? /^complete$/ : /^(complete|loaded)$/, Y = "undefined" !== typeof opera && "[object Opera]" === opera.toString(), F = {}, q = {}, R = [], M = !1; if ("undefined" === typeof define) {
3140        if ("undefined" !== typeof requirejs) { if (G(requirejs)) return; q = requirejs; requirejs = void 0 } "undefined" !== typeof require && !G(require) && (q = require, require = void 0); g = requirejs = function (b, c, d, e) {
3141            var n, p = "_"; !H(b) && "string" !== typeof b && (n = b, H(c) ? (b = c, c = d, d = e) : b = []); n && n.context && (p = n.context); (e = m(F, p)) || (e = F[p] = g.s.newContext(p));
3142            n && e.configure(n); return e.require(b, c, d)
3143        }; g.config = function (b) { return g(b) }; g.nextTick = "undefined" !== typeof setTimeout ? function (b) { setTimeout(b, 4) } : function (b) { b() }; require || (require = g); g.version = "2.1.17"; g.jsExtRegExp = /^\/|:|\?|\.js$/; g.isBrowser = z; x = g.s = { contexts: F, newContext: ga }; g({}); v(["toUrl", "undef", "defined", "specified"], function (b) { g[b] = function () { var c = F._; return c.require[b].apply(c, arguments) } }); if (z && (y = x.head = document.getElementsByTagName("head")[0], D = document.getElementsByTagName("base")[0])) y =
3144        x.head = D.parentNode; g.onError = ca; g.createNode = function (b) { var c = b.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script"); c.type = b.scriptType || "text/javascript"; c.charset = "utf-8"; c.async = !0; return c }; g.load = function (b, c, d) {
3145            var e = b && b.config || {}; if (z) return e = g.createNode(e, c, d), e.setAttribute("data-requirecontext", b.contextName), e.setAttribute("data-requiremodule", c), e.attachEvent && !(e.attachEvent.toString && 0 > e.attachEvent.toString().indexOf("[native code")) &&
3146            !Y ? (M = !0, e.attachEvent("onreadystatechange", b.onScriptLoad)) : (e.addEventListener("load", b.onScriptLoad, !1), e.addEventListener("error", b.onScriptError, !1)), e.src = d, J = e, D ? y.insertBefore(e, D) : y.appendChild(e), J = null, e; if (ea) try { importScripts(d), b.completeLoad(c) } catch (m) { b.onError(C("importscripts", "importScripts failed for " + c + " at " + d, m, [c])) }
3147        }; z && !q.skipDataMain && T(document.getElementsByTagName("script"), function (b) {
3148            y || (y = b.parentNode); if (I = b.getAttribute("data-main")) return s = I, q.baseUrl || (E = s.split("/"),
3149            s = E.pop(), O = E.length ? E.join("/") + "/" : "./", q.baseUrl = O), s = s.replace(Q, ""), g.jsExtRegExp.test(s) && (s = I), q.deps = q.deps ? q.deps.concat(s) : [s], !0
3150        }); define = function (b, c, d) {
3151            var e, g; "string" !== typeof b && (d = c, c = b, b = null); H(c) || (d = c, c = null); !c && G(d) && (c = [], d.length && (d.toString().replace(ka, "").replace(la, function (b, d) { c.push(d) }), c = (1 === d.length ? ["require"] : ["require", "exports", "module"]).concat(c))); if (M) {
3152                if (!(e = J)) N && "interactive" === N.readyState || T(document.getElementsByTagName("script"), function (b) {
3153                    if ("interactive" ===
3154                    b.readyState) return N = b
3155                }), e = N; e && (b || (b = e.getAttribute("data-requiremodule")), g = F[e.getAttribute("data-requirecontext")])
3156            } (g ? g.defQueue : R).push([b, c, d])
3157        }; define.amd = { jQuery: !0 }; g.exec = function (b) { return eval(b) }; g(q)
3158    }
3159})(this);;
3160var contactPage = (function ($) {
3161    var returnObject = {
3162        init: function () {
3163            this.self = this;
3164        },
3165        wireUp: function () {
3166
3167
3168
3169          //  $('#SelectedAreaId').on('change', setOptionalStatus);
3170
3171
3172            if (Modernizr.history && $('#contact-form').length) {
3173
3174
3175                $('form').submit(function (e) {
3176                    if (!$(this).valid()) {
3177
3178                        $(".validation-summary-errors").attr('role', 'alert');
3179                        $(".validation-summary-errors").attr("tabindex", -1).focus();
3180
3181                        return false;
3182
3183                    }
3184                });
3185
3186                contactPage.submitTimer($("posting-add-company-form"), 10000);
3187
3188            }
3189
3190        },
3191        submitTimer: function (form, wait) {
3192            $("button[type=submit]").prop('disabled', true);
3193            var timerFinished = false;
3194            form.on("submit", function (event) {
3195                if (timerFinished === false) {
3196                    return false;
3197                } else {
3198                    return true;
3199                }
3200            });
3201
3202            setTimeout(function () {
3203                timerFinished = true;
3204                $("button[type=submit]").prop('disabled', false);
3205            }, wait);
3206        }
3207    };
3208
3209    //function setOptionalStatus() {
3210    //    var selectedAreaId = $('#SelectedAreaId').val();
3211    //    var areaids = $('#Email').data('val-requiredforarea-areaids');
3212    //    var pos = $.inArray(selectedAreaId, areaids.split(","));
3213
3214    //    if (pos < 0) {
3215    //        $('label[optional]').each(function () {
3216    //            if ($(this).children('.optional').length <= 0) {
3217    //                $(this).append(' <span class="optional">' + $(this).attr('optional') + '</span>');
3218    //            }
3219    //        });
3220    //    }
3221    //    else {
3222    //        $('label[optional] .optional').remove();
3223    //    }
3224    //}
3225    returnObject.init();
3226    return returnObject;
3227})(jQuery);;
3228var reportAsbestrivningPage = (function ($) {
3229    var returnObject = {
3230        init: function () {
3231            this.self = this;
3232        },
3233        wireUp: function () {
3234
3235            $("#noclick").on('click', function () {
3236                return false;
3237            });
3238
3239            if (Modernizr.history && $('#report-asbestrivning-form').length) {
3240
3241                $('form').on("submit", function () {
3242                    var $form = $(this);
3243
3244                    if (!$form.valid()) {
3245
3246                        var $summary = $(".validation-summary-errors:visible").first();
3247
3248                        if ($summary.length) {
3249                            $summary.attr('role', 'alert').attr("tabindex", -1).focus();
3250                        }
3251
3252                        // Default-target = summary om den finns, annars första invali
3252d i formuläret
3253                        var $target = $summary.length
3254                            ? $summary
3255                            : $form.find(".input-validation-error").first();
3256
3257                        var validator = $form.data("validator");
3258                        var firstInvalidEl = (validator && validator.errorList && validator.errorList.length)
3259                            ? validator.errorList[0].element
3260                            : null;
3261
3262                        // fix i Safari: scrolla till valmsg om det finns, annars checkbox-container
3263                        if (firstInvalidEl) {
3264                            var $first = $(firstInvalidEl);
3265
3266                            if ($first.is(":checkbox")) {
3267                                var name = $first.attr("name");
3268
3269                                // Försök scrolla till felmeddelandet kopplat till checkboxen
3270                                var $valMsg = name
3271                                    ? $form.find('[data-valmsg-for="' + name + '"]').first()
3272                                    : $();
3273
3274                                if ($valMsg.length) {
3275                                    $target = $valMsg;
3276                                } else {
3277                                    // Fallback: checkbox-container
3278                                    var $container = $first.closest(".checkbox-container");
3279                                    $target = $container.length ? $container : $first;
3280                                }
3281                            }
3282                        }
3283
3284                        if (!$target || !$target.length || !$target.offset()) {
3285                            return false;
3286                        }
3287
3288                        $("html, body").stop(true).animate({
3289                            scrollTop: $target.offset().top - 120
3290                        }, 0);
3291
3292                        if (firstInvalidEl && $(firstInvalidEl).is(":checkbox")) {
3293                            setTimeout(function () {
3294                                try { firstInvalidEl.focus({ preventScroll: true }); }
3295                                catch (e) { firstInvalidEl.focus(); }
3296                            }, 350);
3297                        }
3298
3299                        return false;
3300                    }
3301                });
3302
3303                $(window).on('popstate', function (e) {
3304                    if (history.state) {
3305                        updateContent(history.state);
3306                    }
3307                });
3308
3309                $(document).ready(function () {
3310
3311                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
3312                });
3313
3314                $(document).on('click', '.GetCompaniesReportAsbest', function (e) {
3315                    let spinner = $('#SearchCompany .spinner');
3316                    var form = $('#report-asbestrivning-form');
3317                    var query = $(form).serialize();
3318                    var action = $(form).attr('action');
3319                    spinner.show('inline-block');
3320                    $.ajax({
3321                        url: action + '?' + query + '&GetCompany=SearchCompany',
3322                        method: 'POST'
3323                    }).done(function (data) {
3324                        $('#SearchCompany').html(data);
3325                        spinner.hide();
3326                    });
3327                    return false;
3328                });
3329
3330                $(document).on('click', '.GetNewCompaniesReportAsbest', function (e) {
3331                    var form = $('#report-asbestrivning-form');
3332                    let spinner = $('#SearchCompany .spinner');
3333                    var query = $(form).serialize();
3334                    var action = $(form).attr('action');
3335                    spinner.show('inline-block');
3336                    $.ajax({
3337                        url: action + '?' + query + '&GetCompany=SearchNewCompany',
3338                        method: 'POST'
3339                    }).done(function (data) {
3340                        $('#SearchCompany').html(data);
3341                        spinner.hide();
3342                    });
3343                    return false;
3344                });
3345
3346                // Text-area character counter
3347                $(document).on("input", ".counter", function () {
3348                    var max = parseInt($(this).attr("data-val-maxlength-max"));
3349                    var val = $(this).val();
3350
3351                    if (val.length > max) {
3352                        $(this).val(val.substring(0, max));
3353                    }
3354
3355                    $(this)
3356                        .closest("div")
3357                        .find(".displaycounter")
3358                        .text(max - $(this).val().length);
3359                });
3360                
3361                // Manage multiple Employees
3362                (function() {
3363                    const firstEntry = document.querySelector('.employee-entry');
3364                    if (firstEntry) {
3365                        updateIndices(firstEntry, 0);
3366                    }
3367
3368                    const addBtn = document.getElementById('add-employee-btn');
3369                    if(addBtn) {
3370                        addBtn.addEventListener('click', function() {
3371                            const container = document.getElementById('affected-employees-container');
3372                            const firstEntry = container.querySelector('.employee-entry');
3373                            const clone = firstEntry.cloneNode(true);
3374    
3375                            const entries = document.querySelectorAll('.employee-entry');
3376                            let maxIndex = -1;
3377                            entries.forEach(entry => {
3378                                const index = parseInt(entry.dataset.index);
3379                                if (index > maxIndex) {
3380                                    maxIndex = index;
3381                                }
3382                            });
3383    
3384                            const newIndex = maxIndex + 1;
3385    
3386                            clone.querySelectorAll('input, textarea, select').forEach(el => {
3387                                el.value = '';
3388                                el.classList.remove('valid', 'input-validation-error');
3389                            });
3390                            
3391                            updateIndices(clone, newIndex);
3392                            container.appendChild(clone);
3393                            attachEventListeners();
3394                        })
3395                    }
3396
3397                    function updateIndices(element, newIndex) {
3398                        element.dataset.index = newIndex;
3399
3400                        const baseLabel = document.querySelector('.employee-entry h3').textContent.match(/^[^0-9]*/)[0].trim();
3401
3402                        element.querySelectorAll('input, textarea, select').forEach(el => {
3403                            const propertyName = el.name.match(/Name|CertificateEducation|LastHealthcheck/)?.[0];
3404                            if (propertyName) {
3405                                el.id = `AffectedEmployees_${newIndex}__${propertyName}`;
3406                                el.name = `AffectedEmployees[${newIndex}].${propertyName}`;
3407                            }
3408                        });
3409
3410                        element.querySelectorAll('label').forEach(label => {
3411                            if (label.htmlFor) {
3412                                const propertyMatch = label.htmlFor.match(/Name|CertificateEducation|LastHealthcheck/);
3413                                if (propertyMatch) {
3414                                    label.htmlFor = `AffectedEmployees_${newIndex}__${propertyMatch[0]}`;
3415                                }
3416                            }
3417                        });
3418
3419                        element.querySelectorAll('[data-index]').forEach(el => {
3420                            el.dataset.index = newIndex;
3421                        });
3422
3423                        element.querySelector('h3').textContent = `${baseLabel} ${newIndex + 1}`;
3424
3425                        const removeBtn = element.querySelector('.btn--remove-employee');
3426                        if (removeBtn) {
3427                            removeBtn.dataset.index = newIndex;
3428                            removeBtn.style.display = 'none';
3429                        }
3430
3431                        element.querySelectorAll('.inputfiletext').forEach(el => {
3432                            el.textContent = '';
3433                        });
3434
3435                        element.querySelectorAll('.btn--clear-file').forEach(el => {
3436                            el.style.display = 'none';
3437                        });
3438                        
3439                        setTimeout(() => {
3440                            const $form = $(element).closest('form');
3441                            $.validator.setDefaults({ ignore: ':hidden:not(.do-not-ignore)' });
3442                            $form.removeData('validator');
3443                            $form.removeData('unobtrusiveValidation');
3444                            $.validator.unobtrusive.parse($form);
3445                        }, 100);
3446                    }
3447
3448                    function updateRemoveButtons() {
3449                        const entries = document.querySelectorAll('.employee-entry');
3450                        entries.forEach((entry, index) => {
3451                            const removeBtn = entry.querySelector('.btn--remove-employee');
3452                            if (removeBtn) {
3453                                removeBtn.style.display = (index === entries.length - 1 && entries.length > 1) ? 'inline-block' : 'none';
3454                            }
3455                        });
3456                    }
3457
3458                    function attachEventListeners() {
3459                        document.querySelectorAll('.employee-file').forEach(input => {
3460                            input.removeEventListener('change', handleFileChange);
3461                            input.addEventListener('change', handleFileChange);
3462                        });
3463
3464                        document.querySelectorAll('.btn--clear-file').forEach(btn => {
3465                            btn.removeEventListener('click', handleFileClear);
3466                            btn.addEventListener('click', handleFileClear);
3467                        });
3468
3469                        document.querySelectorAll('.btn--remove-employee').forEach(btn => {
3470                            btn.removeEventListener('click', handleRemoveEmployee);
3471                            btn.addEventListener('click', handleRemoveEmployee);
3472                        });
3473
3474                        updateRemoveButtons();
3475                    }
3476
3477                    function handleFileChange(e) {
3478                        const input = e.target;
3479                        const fileName = input.files[0]?.name || '';
3480                        const fileTextSpan = input.closest('div').querySelector('.inputfiletext');
3481                        const clearBtn = input.closest('div').querySelector('.btn--clear-file');
3482
3483                        fileTextSpan.textContent = fileName;
3484                        clearBtn.style.display = fileName ? 'inline-block' : 'none';
3485                    }
3486
3487                    function handleFileClear(e) {
3488                        e.preventDefault();
3489                        const clearBtn = e.target;
3490                        const fileInput = clearBtn.closest('div').querySelector('.employee-file');
3491                        const fileTextSpan = clearBtn.closest('div').querySelector('.inputfiletext');
3492
3493                        fileInput.value = '';
3494                        clearBtn.style.display = 'none';
3495                        fileTextSpan.textContent = '';
3496                    }
3497
3498                    function handleRemoveEmployee(e) {
3499                        e.preventDefault();
3500                        e.target.closest('.employee-entry').remove();
3501                        updateRemoveButtons();
3502                    }
3503
3504                    attachEventListeners();
3505                })();
3506                
3507            }
3508        }
3509    };
3510
3511    returnObject.init();
3512    return returnObject;
3513})(jQuery);;
3514var asbestApplicationPage = (function ($) {
3515    var returnObject = {
3516        init: function () {
3517            this.self = this;
3518        },
3519        wireUp: function () {
3520
3521            if (Modernizr.history && $('#asbest-application-form').length) {
3522                $(window).on('popstate', function (e) {
3523                    if (history.state) {
3524                        updateContent(history.state);
3525                    }
3526                });
3527
3528                $(document).ready(function () {
3529                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
3530                });
3531
3532                $(document).on('change', '.SelectedOrt', function (e) {
3533                    var form = $('#asbest-application-form');
3534                    var query = $(form).serialize();
3535                    var action = $(form).attr('action');
3536                    $.ajax({
3537                        url: action + '?' + query + '&GetCompany=ortUpdated',
3538                        method: 'POST'
3539                    }).done(function (data) {
3540                        updateElements(document.getElementById("SearchCompany"), data);
3541                    });
3542                });
3543
3544                $(document).on('change', '.SelectedAstId', function (e) {
3545                    var form = $('#asbest-application-form');
3546                    var query = $(form).serialize();
3547                    var action = $(form).attr('action');
3548
3549                    $.ajax({
3550                        url: action + '?' + query + '&GetCompany=astUpdated',
3551                        method: 'POST'
3552                    }).done(function (data) {
3553                        updateElements(document.getElementById("SearchCompany"), data);
3554                    });
3555                });
3556
3557                $(document).on('click', '.GetCompanies', function (e) {
3558                    var form = $('#asbest-application-form');
3559                    var query = $(form).serialize();
3560                    var action = $(form).attr('action');
3561                    $('.spinner').show();
3562
3563                    $.ajax({
3564                        url: action + '?' + query + '&GetCompany=SearchCompany',
3565                        method: 'POST'
3566                    }).done(function (data) {
3567                        updateElements(document.getElementById("SearchCompany"), data);
3568                        $('.spinner').hide();
3569                    });
3570
3571                    return false;
3572                });
3573
3574                $(document).on("submit", "#asbest-application-form", function (event) {
3575                    //Hide send button to prevent double posting 
3576                    $(".btn--send").hide();
3577                    //Show spinner
3578                    $("#asbest-application-form i").show();
3579                });
3580
3581                $('form').on("submit", function () {
3582                    var $form = $(this);
3583
3584                    if (!$form.valid()) {
3585
3586                        var $summary = $(".validation-summary-errors:visible").first();
3587
3588                        if ($summary.length) {
3589                            $summary.attr('role', 'alert').attr("tabindex", -1).focus();
3590                        }
3591                        
3592                        // Default-target = summary om den finns, annars första invali
3592d i formuläret
3593                        var $target = $summary.length
3594                            ? $summary
3595                            : $form.find(".input-validation-error").first();
3596
3597                        var validator = $form.data("validator");
3598                        var firstInvalidEl = (validator && validator.errorList && validator.errorList.length)
3599                            ? validator.errorList[0].element
3600                            : null;
3601
3602                        // Fix för Safari för focus+scroll för checkbox-container
3603                        if (firstInvalidEl) {
3604                            var $first = $(firstInvalidEl);
3605
3606                            if ($first.is(":checkbox")) {
3607                                var $container = $first.closest(".checkbox-container");
3608                                if ($container.length) {
3609                                    $target = $container;
3610                                } else {
3611                                    // fallback om container ej hittas
3612                                    $target = $first;
3613                                }
3614                            }
3615                        }
3616
3617                        // om target fortfarande saknas, scrolla inte alls
3618                        if (!$target || !$target.length || !$target.offset()) {
3619                            return false;
3620                        }
3621
3622                        // Scrolla (animate är oftast bäst i iOS)
3623                        $("html, body").stop(true).animate({
3624                            scrollTop: $target.offset().top - 120
3625                        }, 0);
3626
3627                        // Fokus på checkbox efter scroll (utan ny scroll om möjligt)
3628                        if (firstInvalidEl && $(firstInvalidEl).is(":checkbox")) {
3629                            setTimeout(function () {
3630                                try { firstInvalidEl.focus({ preventScroll: true }); }
3631                                catch (e) { firstInvalidEl.focus(); }
3632                            }, 350);
3633                        }
3634
3635                        return false;
3636                    }
3637                });
3638
3639                // INPUT File
3640                $('.inputfile').each(function () {
3641                    var $input = $(this);
3642                    var $label = $input.next('label');
3643                    var labelVal = $label.next('span').html();
3644
3645                    $input.on('change', function (e) {
3646                        var fileName = '';
3647                        if (e.target.value) fileName = e.target.value.split('\\').pop();
3648                        if (fileName) {
3649                            $label.next('span').html(fileName);
3650
3651                            if (fileName !== "Ingen fil har valts.") {
3652                                $("#" + $input.attr("id") + "Clear").show();
3653                                $("#" + $input.attr("id") + "Clear").removeClass("rs_skip");
3654                                $("#" + $input.attr("id") + "Next").show();
3655                                $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
3656                            }
3657                        }
3658                        else
3659                            $label.next('span').html(labelVal);
3660                    });
3661
3662                    // Firefox bug fix
3663                    $input
3664                        .on('focus', function () { $input.addClass('has-focus'); })
3665                        .on('blur', function () { $input.removeClass('has-focus'); });
3666                });
3667            }
3668        }
3669    };
3670
3671    returnObject.init();
3672    return returnObject;
3673})(jQuery);
3674
3675function ClearFileUpload(id) {
3676    var fileTextDiv = document.getElementById(id + "Filename");
3677
3678    fileTextDiv.textContent = "Ingen fil har valts.";
3679    $("#" + id).replaceWith($("#" + id).val('').clone(true));
3680    $("#" + id + "Clear").hide();
3681    $("#" + id + "Clear").addClass("rs_skip");
3682};;
3683var ratpoisonApplicationPage = (function ($) {
3684    var returnObject = {
3685        init: function () {
3686            this.self = this;
3687        },
3688        wireUp: function () {
3689
3690
3691            if (Modernizr.history && $('#ratpoison-application-form').length) {
3692                $(window).on('popstate', function (e) {
3693                    if (history.state) {
3694                        updateContent(history.state);
3695                    }
3696                });
3697
3698                $(document).ready(function () {                    
3699                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
3700                });
3701
3702
3703
3704
3705                $(document).on("submit", "#ratpoison-application-form", function (event) {
3706
3707                    if (!$(this).valid()) {
3708
3709                        $(".validation-summary-errors").attr('role', 'alert');
3710                        $(".validation-summary-errors").attr("tabindex", -1).focus();
3711
3712                        return false;
3713
3714                    }
3715                    //Hide send button to prevent double posting 
3716                    $(".btn--send").hide();
3717                    //Show spinner
3718                    $(".spinner").show();
3719                });
3720
3721
3722
3723
3724                // INPUT File
3725
3726                $('.inputfile').each(function () {
3727                    var $input = $(this);
3728                    var $label = $input.next('label');
3729                    var labelVal = $label.next('span').html();
3730
3731                    $input.on('change', function (e) {
3732                        var fileName = '';
3733                        if (e.target.value) fileName = e.target.value.split('\\').pop();
3734                        if (fileName) {
3735                            $label.next('span').html(fileName);
3736
3737                            if (fileName != "") {
3738                                $("#" + $input.attr("id") + "Clear").show();
3739                                $("#" + $input.attr("id") + "Clear").removeClass("rs_skip");
3740
3741                                $("#" + $input.attr("id") + "Next").show();
3742                                $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
3743                                
3744                                $("#" + $input.attr("id") + "Button").hide();
3745                            }
3746                        }
3747                        else
3748                            $label.next('span').html(labelVal);
3749                    });
3750
3751
3752                    // Firefox bug fix
3753                    $input
3754                    .on('focus', function () { $input.addClass('has-focus'); })
3755                    .on('blur', function () { $input.removeClass('has-focus'); });
3756                });
3757
3758            }
3759        }
3760    };
3761
3762
3763
3764    returnObject.init();
3765    return returnObject;
3766})(jQuery);
3767
3768function ClearFileUpload(id) {
3769    //var fileDiv = document.getElementById(id + "Holder");
3770    //var fileInputDiv = document.getElementById(id);    
3771    var fileTextDiv = document.getElementById(id + "Filename");
3772    //var fileLabel = document.getElementById(id + "Label");
3773
3774
3775    //fileDiv.remove(fileTextDiv);
3776    //fileDiv.remove(fileInputDiv);
3777    //fileDiv.remove(fileLabel);
3778
3779    fileTextDiv.textContent = "";
3780    $("#" + id).replaceWith($("#" + id).val('').clone(true));
3781
3782    $("#" + id + "Clear").hide();
3783    $("#" + id + "Clear").addClass("rs_skip");
3784    $("#" + id + "Button").show();
3785
3786    // $("#" + id + "Next").show("fold", 1000);
3787
3788    //var fileDiv = document.getElementById("fileDiv1");
3789    //var fileInputDiv = document.getElementById("fileInputDiv" + index);
3790    //var fileTextDiv = document.getElementById("fileTextDiv" + index);   
3791    //fileDiv.removeChild(fileTextDiv);
3792    //fileDiv.removeChild(fileInputDiv);
3793};
3794
3795
3796
3797
3798;
3799var accessiblityIssuePage = (function ($) {
3800    var returnObject = {
3801        init: function () {
3802            this.self = this;
3803        },
3804        wireUp: function () {
3805            if (Modernizr.history && $('#accessibility-issue-form').length) {
3806                $('form').submit(function (e) {
3807                    if (!$(this).valid()) {
3808                        $(".validation-summary-errors").attr('role', 'alert');
3809                        $(".validation-summary-errors").attr("tabindex", -1).focus();
3810
3811                        return false;
3812                    }
3813                });
3814
3815                accessiblityIssuePage.submitTimer(10000);
3816            }
3817        },
3818        submitTimer: function (wait) {
3819            $("button[type=submit]").prop('disabled', true);
3820
3821            setTimeout(function () {
3822                timerFinished = true;
3823                $("button[type=submit]").prop('disabled', false);
3824            }, wait);
3825        }
3826    };
3827
3828    returnObject.init();
3829
3830    return returnObject;
3831})(jQuery);
3832;
3833/**
3834 * Accessible Tabs - jQuery plugin for accessible, unobtrusive tabs
3835 * Build to seemlessly work with the CCS-Framework YAML (yaml.de) not depending on YAML though
3836 * @requires jQuery - tested with 1.9.1, 1.7 and 1.4.2 but might as well work with older versions
3837 *
3838 * english article: http://blog.ginader.de/archives/2009/02/07/jQuery-Accessible-Tabs-How-to-make-tabs-REALLY-accessible.php
3839 * german article: http://blog.ginader.de/archives/2009/02/07/jQuery-Accessible-Tabs-Wie-man-Tabs-WIRKLICH-zugaenglich-macht.php
3840 * 
3841 * code: http://github.com/ginader/Accessible-Tabs
3842 * please report issues at: http://github.com/ginader/Accessible-Tabs/issues
3843 *
3844 * Copyright (c) 2007 Dirk Ginader (ginader.de)
3845 * Dual licensed under the MIT and GPL licenses:
3846 * http://www.opensource.org/licenses/mit-license.php
3847 * http://www.gnu.org/licenses/gpl.html
3848 *
3849 */
3850
3851(function($) {
3852    var debugMode = true;
3853    $.fn.extend({
3854        // We assume there could be multiple sets of tabs on a page, so,
3855        // the unique id for each invididual tab's heading is identified with params q and r (e.g., id="accessibletabscontent0-2")
3856        getUniqueId: function(p, q, r){
3857            if (r===undefined) {r='';} else {r='-'+r;}
3858            return p + q + r;
3859        },
3860        accessibleTabs: function(config) {
3861            var defaults = {
3862                wrapperClass: 'content', // Classname to apply to the div that is wrapped around the original Markup
3863                currentClass: 'current', // Classname to apply to the LI of the selected Tab
3864                tabhead: 'h4', // Tag or valid Query Selector of the Elements to Transform the Tabs-Navigation from (originals are removed)
3865                tabheadClass: 'tabhead', // Classname to apply to the target heading element for each tab div
3866                tabbody: '.tabbody', // Tag or valid Query Selector of the Elements to be treated as the Tab Body
3867                fx:'show', // can be "fadeIn", "slideDown", "show"
3868                fxspeed: 'normal', // speed (String|Number): "slow", "normal", or "fast") or the number of milliseconds to run the animation
3869                currentInfoText: 'current tab: ', // text to indicate for screenreaders which tab is the current one
3870                currentInfoPosition: 'prepend', // Definition where to insert the Info Text. Can be either "prepend" or "append"
3871                currentInfoClass: 'current-info', // Class to apply to the span wrapping the CurrentInfoText
3872                tabsListClass:'tabs-list', // Class to apply to the generated list of tabs above the content
3873                syncheights:false, // syncs the heights of the tab contents when the SyncHeight plugin is available http://blog.ginader.de/dev/jquery/syncheight/index.php
3874                syncHeightMethodName:'syncHeight', // set the Method name of the plugin you want to use to sync the tab contents. Defaults to the SyncHeight plugin: http://github.com/ginader/syncHeight
3875                cssClassAvailable:false, // Enable individual css classes for tabs. Gets the appropriate class name of a tabhead element and apply it to the tab list element. Boolean value
3876                saveState:false, // save the selected tab into a cookie so it stays selected after a reload. This requires that the wrapping div needs to have an ID (so we know which tab we're saving)
3877                autoAnchor:false, // will move over any existing id of a headline in tabs markup so it can be linked to it
3878                pagination:false, // adds buttons to each tab to switch to the next/previous tab
3879                position:'top', // can be 'top' or 'bottom'. Defines where the tabs list is inserted.
3880                wrapInnerNavLinks: '', // inner wrap for a-tags in tab navigation. See http://api.jquery.com/wrapInner/ for further informations
3881                firstNavItemClass: 'first', // Classname of the first list item in the tab navigation
3882                lastNavItemClass: 'last', // Classname of the last list item in the tab navigation
3883                clearfixClass: 'clearfix' // Name of the Class that is used to clear/contain floats
3884            };
3885            var keyCodes = {
3886                37 : -1, //LEFT
3887                38 : -1, //UP
3888                39 : +1, //RIGHT 
3889                40 : +1 //DOWN
3890            };
3891            var positions = {
3892                top : 'prepend',
3893                bottom : 'append'
3894            };
3895            this.options = $.extend(defaults, config);
3896
3897            var tabsCount = 0;
3898            if($("body").data('accessibleTabsCount') !== undefined){
3899                tabsCount = $("body").data('accessibleTabsCount');
3900            }
3901
3902            // Query.fn.size() is deprecated and removed; use the.length property
3903            //$("body").data('accessibleTabsCount', this.size() + tabsCount);
3904            $("body").data('accessibleTabsCount', this.length + tabsCount);
3905
3906            var o = this;
3907            return this.each(function(t) {
3908                var el = $(this);
3909                var list = '';
3910                var tabCount = 0;
3911                var ids = [];
3912
3913                $(el).wrapInner('<div class="'+o.options.wrapperClass+'"></div>');
3914
3915                $(el).find(o.options.tabhead).each(function(i){
3916                    var id = '';
3917                    var elId = $(this).attr('id');
3918                    if(elId){
3919                        // Skip this item if it already exists.
3920                        if(elId.indexOf('accessibletabscontent') === 0) {
3921                            return;
3922                        }
3923                        id =' id="'+elId+'"';
3924                    }
3925                    var tabId = o.getUniqueId('accessibletabscontent', tabsCount+t, i);//get a unique id to assign to this tab's heading
3926                    var navItemId = o.getUniqueId('accessibletabsnavigation', tabsCount+t, i);//get a unique id for this navigation item
3927                    ids.push(tabId);
3928                    if(o.options.cssClassAvailable === true) {
3929                        var cssClass = '';
3930                        if($(this).attr('class')) {
3931                            cssClass = $(this).attr('class');
3932                            cssClass = ' class="'+cssClass+'"';
3933                        }
3934                        list += '<li id="'+navItemId+'"><a'+id+''+cssClass+' href="#'+tabId+'">'+$(this).html()+'</a></li>';
3935                    } else {
3936                      list += '<li id="'+navItemId+'"><a'+id+' href="#'+tabId+'">'+$(this).html()+'</a></li>';
3937                    }
3938                    $(this).attr({"id": tabId, "class": o.options.tabheadClass, "tabindex": "-1"});//assign the unique id and the tabheadClass class name to this tab's heading
3939                    tabCount++;
3940                });
3941
3942                if (o.options.syncheights && $.fn[o.options.syncHeightMethodName]) {
3943                    $(el).find(o.options.tabbody)[o.options.syncHeightMethodName]();
3944                    $(window).resize(function(){
3945                        $(el).find(o.options.tabbody)[o.options.syncHeightMethodName]();
3946                    });
3947                }
3948
3949                // Ensure that the call to setup tabs is re-runnable
3950                var tabs_selector = '.' + o.options.tabsListClass;
3951                if(!$(el).find(tabs_selector).length) {
3952                    $(el)[positions[o.options.position]]('<ul class="'+o.options.clearfixClass+' '+o.options.tabsListClass+' tabamount'+tabCount+'"></ul>');
3953                }
3954
3955                $(el).find(tabs_selector).append(list);
3956
3957                // initial show first content block and hide the others
3958                var content = $(el).find(o.options.tabbody);
3959                if (content.length > 0) {
3960                    $(content).hide();
3961                    $(content[0]).show();
3962                }
3963                $(el).find("ul."+o.options.tabsListClass+">li:first").addClass(o.options.currentClass).addClass(o.options.firstNavItemClass)
3964                  .find('a')[o.options.currentInfoPosition]('<span class="'+o.options.currentInfoClass+'">'+o.options.currentInfoText+'</span>')
3965                  .parents("ul."+o.options.tabsListClass).children('li:last').addClass(o.options.lastNavItemClass);
3966
3967                if (o.options.wrapInnerNavLinks) {
3968                  $(el).find('ul.'+o.options.tabsListClass+'>li>a').wrapInner(o.options.wrapInnerNavLinks);
3969                }
3970
3971                $(el).find('ul.'+o.options.tabsListClass+'>li>a').each(function(i){
3972                    $(this).on("click", function(event){
3973                        event.preventDefault();
3974                        el.trigger("showTab.accessibleTabs", [$(event.target)]);
3975                        if(o.options.saveState && $.cookie){
3976                            $.cookie('accessibletab_'+el.attr('id')+'_active',i);
3977                        }
3978                        $(el).find('ul.'+o.options.tabsListClass+'>li.'+o.options.currentClass).removeClass(o.options.currentClass)
3979                        .find("span."+o.options.currentInfoClass).remove();
3980                        $(this).blur();
3981                        $(el).find(o.options.tabbody+':visible').hide();
3982                        $(el).find(o.options.tabbody).eq(i)[o.options.fx](o.options.fxspeed);
3983                        $(this)[o.options.currentInfoPosition]('<span class="'+o.options.currentInfoClass+'">'+o.options.currentInfoText+'</span>')
3984                        .parent().addClass(o.options.currentClass);
3985                        //now, only after writing the currentInfoText span to the tab list link, set focus to the tab's heading
3986
3987                        $($(this).attr("href")).focus().keyup(function(event){
3988                            if(keyCodes[event.keyCode]){
3989                                o.showAccessibleTab(i+keyCodes[event.keyCode]);
3990                                $(this).unbind( "keyup" );
3991                            }
3992                        });
3993
3994                        // $(el).find('.accessibletabsanchor').keyup(function(event){
3995                        //     if(keyCodes[event.keyCode]){
3996                        //         o.showAccessibleTab(i+keyCodes[event.keyCode]);
3997                        //     }
3998                        // });
3999                    });
4000
4001                    $(this).focus(function(){
4002                        $(document).keyup(function(event){
4003                            if(keyCodes[event.keyCode]){
4004                                o.showAccessibleTab(i+keyCodes[event.keyCode]);
4005                            }
4006                        });
4007                    });
4008                    $(this).blur(function(){
4009                        $(document).unbind( "keyup" );
4010                    });
4011
4012                });
4013
4014                if(o.options.saveState && $.cookie){
4015                    var savedState = $.cookie('accessibletab_'+el.attr('id')+'_active');
4016                    debug($.cookie('accessibletab_'+el.attr('id')+'_active'));
4017                    if(savedState !== null){
4018                        o.showAccessibleTab(savedState,el.attr('id'));
4019                    }
4020                }
4021
4022                if(o.options.autoAnchor && window.location.hash){
4023                    var anchorTab = $('.'+o.options.tabsListClass).find(window.location.hash);
4024                    if(anchorTab.size()){
4025                        anchorTab.click();
4026                    }
4027                }
4028
4029                if(o.options.pagination){
4030                    var m = '<ul class="pagination">';
4031                    m +='    <li class="previous"><a href="#{previousAnchor}"><span>{previousHeadline}</span></a></li>';
4032                    m +='    <li class="next"><a href="#{nextAnchor}"><span>{nextHeadline}</span></a></li>';
4033                    m +='</ul>';
4034                    var tabs = $(el).find('.tabbody');
4035                    var tabcount = tabs.size();
4036                    tabs.each(function(idx){
4037                        $(this).append(m);
4038                        var next = idx+1;
4039                        if(next>=tabcount){next = 0;}
4040                        var previous = idx-1;
4041                        if(previous<0){previous = tabcount-1;}
4042                        var p = $(this).find('.pagination');
4043                        var previousEl = p.find('.previous');
4044                        previousEl.find('span').text($('#'+ids[previous]).text());
4045                        previousEl.find('a').attr('href','#'+ids[previous])
4046                        .click(function(event){
4047                            event.preventDefault();
4048                            $(el).find('.tabs-list a').eq(previous).click();
4049                        });
4050                        var nextEl = p.find('.next');
4051                        nextEl.find('span').text($('#'+ids[next]).text());
4052                        nextEl.find('a').attr('href','#'+ids[next])
4053                        .click(function(event){
4054                            event.preventDefault();
4055                            $(el).find('.tabs-list a').eq(next).click();
4056                        });
4057                    });
4058                }
4059            });
4060        },
4061        showAccessibleTab: function(index,id){
4062            debug('showAccessibleTab');
4063            var o = this;
4064            if(id) {
4065                var el = $('#'+id);
4066                var links = el.find('ul.'+o.options.tabsListClass+'>li>a');
4067                el.trigger("showTab.accessibleTabs", [links.eq(index)]);
4068                links.eq(index).click();
4069            } else {
4070                return this.each(function() {
4071                    var el = $(this);
4072                    el.trigger("showTab.accessibleTabs");
4073                    var links = el.find('ul.'+o.options.tabsListClass+'>li>a');
4074                    el.trigger("showTab.accessibleTabs", [links.eq(index)]);
4075                    links.eq(index).click();
4076                });
4077            }
4078        },
4079        showAccessibleTabSelector: function(selector){
4080            debug('showAccessibleTabSelector');
4081            var el = $(selector);
4082            if(el){
4083                if(el.get(0).nodeName.toLowerCase() === 'a'){
4084                    el.click();
4085                }else{
4086                    debug('the selector of a showAccessibleTabSelector() call needs to point to a tabs headline!');
4087                }
4088            }
4089        }
4090    });
4091    // private Methods
4092    function debug(msg,info){
4093        if(debugMode && window.console && window.console.log){
4094            if(info){
4095                window.console.log(info+': ',msg);
4096            }else{
4097                window.console.log(msg);
4098            }
4099        }
4100    }
4101})(jQuery);
4102;
4103var provisionSearch = (function ($) {
4104    const DEBUG = true;
4105
4106    var provisionSearchIndex = -1;
4107    var provisionSearchTermChanged = false;
4108    var isSearchScrolling = false;
4109    var minimumSearchChars = 2;
4110    var contextSelector = "#provision-content";
4111    var searchInputSelector = ".provision-search-input";
4112    var searchButtonSelector = ".provision-search-button";
4113    var getNextSelector = ".searchNext";
4114    var getPrevSelector = ".searchPrev";
4115    var currentHitSelector = ".provision-current-hit";
4116    var searchHitsSelector = ".provision-search-hits";
4117    var searchWordSelector = ".provision-search-word";
4118    var searchHitsPanelSelector = ".provision__search__hits";
4119    var searchNoHitsPanelSelector = ".provision__search__no__hits";
4120    var searchColorClass = "btn-yellow";
4121
4122    var returnObject = {
4123        init: function () {
4124            this.self = this;
4125        },
4126        wireUp: function () {
4127
4128            dynamicMenu();
4129
4130            // todo fix this with an id on the page.....
4131            if (!$(".provisionpage").length) { return }
4132
4133            $('.provision__searchform').on('submit', function (e) {
4134                    e.preventDefault();
4135            });
4136
4137            reset();
4138            // wire up search
4139            $(searchInputSelector).on('keyup', function (e) {
4140                if (e.which == 13) {
4141                    e.preventDefault(); 
4142                    searchButtonClick();
4143                } else {
4144                    $(searchInputSelector).val($(this).val());
4145                    provisionSearchTermChanged = true;
4146                }
4147            });
4148
4149            $(searchButtonSelector).on('click', searchButtonClick);
4150            $(getNextSelector).on('click', getNext);
4151            $(getPrevSelector).on('click', getPrev);
4152
4153            // search box color
4154            $(searchInputSelector).on('input', function () {
4155                const btn = $(this).next('button');
4156                if ($(this).val().length < minimumSearchChars) {
4157
4158                    $(btn).removeClass(searchColorClass);
4159                    $('.provision__search').removeClass('bg-yellow');
4160                    $('.provision__menu').removeClass('search-mode');
4161                    reset();
4162
4163                }
4164                else {
4165                    $(btn).addClass(searchColorClass);
4166                    $('.provision__search').addClass('bg-yellow');
4167                    $('.provision__menu').addClass('search-mode');
4168                }
4169            });
4170        }
4171    };
4172
4173    // ====================================================================
4174    // Private functions
4175    // ====================================================================
4176
4177    function searchButtonClick() {
4178        var searchTerm = $(searchInputSelector).val();
4179        if (searchTerm.length < minimumSearchChars) {
4180            reset();
4181            return;
4182        }
4183        if (provisionSearchIndex == -1 || provisionSearchTermChanged) {
4184            reset();
4185            if (searchAndHighlight(searchTerm))
4186                getNext();
4187        }
4188        else getNext();
4189    }
4190
4191    // ---------------------------------------------------------------------
4192    function searchAndHighlight(searchTerm) {
4193        if (searchTerm) {
4194            var searchTermRegEx, matches;
4195            try {
4196                let escapedSearchTerm = searchTerm.replace(/\s/g, '(?:\\s|&nbsp;)');
4197                searchTermRegEx = new RegExp('(?<!<[^>]*)' + escapedSearchTerm, 'gi');
4198            } catch (e) {
4199                return false;
4200            }
4201            matches = $(contextSelector).html().match(searchTermRegEx);
4202
4203            if (matches !== null && matches.length > 0) {
4204
4205                provisionSearchTermChanged = false;
4206                $(searchHitsPanelSelector).css('display', 'flex');
4207
4208                $(searchHitsSelector).text(matches.length);
4209
4210                var txt = $(contextSelector).html().replace(searchTermRegEx, function (x) {
4211                    provisionSearchIndex++;
4212                    return '<mark id="hit-' + provisionSearchIndex + '" class="match">' + x + '</mark>';
4213                });
4214                $(contextSelector).html(txt);
4215                $('.match:first').addClass('highlighted');
4216                highlightMenu();
4217
4218                // mark footnote button when hits inside footnote
4219                $('button.footnote').each(function () {
4220                    if ($(this).parent().next(".provision__dialog-wrapper").find('mark').length) {
4221                        $(this).addClass("mark-footnote");
4222                    }
4223                });
4224                // mark tble button when hits inside table
4225                $('button.provision__table').each(function () {
4226                    if ($(this).prev(".provision__dialog-wrapper").find('mark').length) {
4227                        $(this).addClass("mark-table");
4228                    }
4229                });
4230
4231                // rebind events 
4232                provisionPage.wireUpLight();
4233
4234                // Re-init scroll observer after search
4235                if (window.refreshScrollObserver) {
4236                    window.refreshScrollObserver();
4237                }
4238
4239                return true;
4240            }
4241
4242            $(searchWordSelector).text(searchTerm);
4243            $(searchNoHitsPanelSelector).css('display', 'flex');
4244            return false;
4245        }
4246        return false;
4247    }
4248
4249    // ---------------------------------------------------------------------
4250    function getNext() {
4251        provisionSearchIndex++;
4252        if (provisionSearchIndex >= $('.match').length) provisionSearchIndex = 0;
4253        highlightCurrentIndex();
4254        DEBUG && console.log('button-next index: ' + provisionSearchIndex);
4255    }
4256    // ---------------------------------------------------------------------
4257    function getPrev() {
4258        provisionSearchIndex--;
4259        if (provisionSearchIndex < 0) provisionSearchIndex = $('.match').length - 1;
4260        highlightCurrentIndex();
4261        DEBUG && console.log('button-prev index: ' + provisionSearchIndex);
4262    }
4263    // ---------------------------------------------------------------------
4264    function highlightCurrentIndex() {
4265        $(currentHitSelector).text(provisionSearchIndex + 1);
4266        $('.highlighted').removeClass('highlighted');
4267
4268        let matched = $('.match').eq(provisionSearchIndex);
4269        if (matched !== undefined) {
4270            let scrollOffset = 0;
4271
4272            // if inside footnote
4273            if (matched.closest('div.footnote').length) {
4274                matched.closest('div.footnote').closest('div.provision__dialog-wrapper').prev().find('button.footnote').addClass('highlighted');
4275                scrollOffset = 25;
4276            // if inside table
4277            } else if (matched.closest('table.provision__table').length) {
4278                matched.closest('table.provision__table').closest('div.provision__dialog-wrapper').next('button.provision__table').addClass('highlighted');
4279                scrollOffset = 225;
4280            }
4281
4282            if (window.matchMedia('(max-width: 970px)').matches) {
4283                matched.addClass('highlighted');
4284                scrollOffset = 400;
4285            } else {
4286                matched.addClass('highlighted');
4287                scrollOffset = 25;
4288            }
4289            
4290            isSearchScrolling = true;
4291            
4292            $(document).scrollTop($('.highlighted').offset().top - scrollOffset);
4293            
4294            setTimeout(() => {
4295                isSearchScrolling = false;
4296            }, 100);
4297
4298            // Trigger menu highlighting based on closest header
4299            const closestHeader = findClosestHeaderAbove(matched[0]);
4300            if (closestHeader && closestHeader.id) {
4301                closeAllMenuItems();
4302                setActiveMenuItem(closestHeader.id);
4303            }
4304        }
4305    }
4306    
4307    // ---------------------------------------------------------------------
4308
4309    var markedClickHandler = function (event) {
4310        event.preventDefault();
4311        // find closest match-tag and scroll
4312        var tag = $($(this).attr('href')).nextAll().find('.match').first();
4313        $(document).scrollTop($($(this).attr('href')).nextAll().find('.match').first().offset().top - 25);
4314        // change searchindex & highlight
4315        provisionSearchIndex = $('mark').index(tag);
4316        highlightCurrentIndex();
4317    }
4318
4319    function highlightMenu() {
4320        let anchorIds = [];
4321        // get above anchor id from marked search term
4322        $('mark').each(function () {
4323
4324            // TODO send as variable?
4325            let testValue =
4326                $(this).parents(':header[data-menu="true"]').attr('id') ||  //headings
4327                $(this).parents().prevAll('[data-menu="true"]').first().attr('id')
4328                ;
4329
4330            if (testValue !== undefined) {
4331                if (anchorIds.indexOf(testValue) === -1) anchorIds.push(testValue);
4332            }
4333            else {
4334                DEBUG && console.log("Menu id is undefiend:" + $(this).attr('id'));
4335            }
4336        });
4337
4338        // highlight menu 
4339        $.each(anchorIds, function (index, value) {
4340            $('a[href="#' + value + '"]')
4341                .addClass('marked')
4342                .parents('ul')
4343                .prev('span.menurow')
4344                .children('a')
4345                .addClass('marked')
4346        });
4347
4348        $('a.marked').append(' <span class="visually-hidden">' + $("#nonvisiblemenutext").val() + '</span>');
4349
4350        // wire up menu
4351        $('a.marked').on('click', markedClickHandler);
4352    }
4353    // ---------------------------------------------------------------------
4354    function reset() {
4355        // reset index
4356        provisionSearchIndex = -1;
4357        //remove highligted
4358        $('.highlighted').removeClass('highlighted');
4359
4360        //remove all matches
4361        $(contextSelector + ' mark.match').each(function () {
4362            $(this).replaceWith($(this).html());
4363        });
4364
4365        // hide no. of results info
4366        $(searchHitsPanelSelector).hide();
4367        $(searchNoHitsPanelSelector).hide();
4368
4369        // unbind and remove marked from menu
4370        $('a.marked').unbind('click', markedClickHandler);
4371        $('.marked').removeClass('marked');
4372        $(".marked span.visually-hidden").remove()
4373        $("button").removeClass('mark-footnote').removeClass('mark-table');
4374    }
4375
4376    function findClosestHeaderAbove(element) {
4377        let current = element;
4378
4379        while (current && current !== document.body) {
4380            current = current.previousElementSibling || current.parentElement;
4381
4382            if (current && (current.tagName === 'H2' || current.tagName === 'H3') && current.id) {
4383                return current;
4384            }
4385
4386            if (current && current.previousElementSibling) {
4387                const headers = current.previousElementSibling.querySelectorAll('h2[id], h3[id]');
4388                if (headers.length > 0) {
4389                    return headers[headers.length - 1];
4390                }
4391            }
4392        }
4393
4394        return null;
4395    }
4396
4397    function closeAllMenuItems() {
4398        const menuContainer = document.querySelector('.provision__menu');
4399        const activeElements = menuContainer.querySelectorAll('.active');
4400
4401        activeElements.forEach(el => {
4402            el.classList.remove('active');
4403            // Remove any inline style caused by slideDown()
4404            el.style = '';
4405        });
4406
4407        // Select all elements with 'aria-expanded' attribute in the menu and set to false
4408        const elementsWithAriaExpanded = menuContainer.querySelectorAll('[aria-expanded]');
4409        elementsWithAriaExpanded.forEach(el => el.setAttribute('aria-expanded', 'false'));
4410        // HÄR stängs menyn
4411    }
4412
4413    function setActiveMenuItem(targetId) {
4414        const menuContainer = document.querySelector('.provision__menu');
4415        const menuLink = menuContainer.querySelector(`a[href="#${targetId}"]`);
4416        if (menuLink) {
4417            let currentLi = menuLink.closest('li');
4418
4419            while (currentLi) {
4420                currentLi.classList.add('active');
4421
4422                const toggleButton = currentLi.querySelector('button');
4423                if (toggleButton) {
4424                    toggleButton.classList.add('active');
4425                    toggleButton.setAttribute('aria-expanded', 'true');
4426                }
4427
4428                const childUl = currentLi.querySelector(':scope > ul');
4429                if (childUl) {
4430                    childUl.classList.add('active');
4431                    childUl.style.display = 'block';
4432                }
4433
4434                currentLi = currentLi.parentElement?.closest('li');
4435            }
4436        }
4437    }
4438    
4439    // Highlights current menu item during scrolling and scrolls to the active item
4440    const dynamicMenu = function () {
4441        const handleIntersection = function (entries, observer) {
4442            if (isSearchScrolling) {
4443                return;
4444            }
4445            entries.forEach(entry => {
4446                if (entry.isIntersecting) {
4447                    // Close all open submenus and remove all active classes 
4448                    closeAllMenuItems();
4449
4450                    // Find the menu link that corresponds to the current entry and set it as active
4451                    setActiveMenuItem(entry.target.id);
4452                }
4453            });
4454        }
4455
4456        const observer = new IntersectionObserver(handleIntersection, {
4457            root: null,
4458            threshold: 0.1
4459        });
4460
4461        // Select all <h2> and <h3> elements with an ID inside the #provision-content element
4462        const h2Elements = document.querySelectorAll('#provision-content h2[id]');
4463        const h3Elements = document.querySelectorAll('#provision-content h3[id]');
4464        h2Elements.forEach(h2 => observer.observe(h2));
4465        h3Elements.forEach(h3 => observer.observe(h3));
4466
4467        // Refresh scroll observer so dynamic menu tracking works after search
4468        window.refreshScrollObserver = function () {
4469            if (observer) observer.disconnect();
4470            const h2Elements = document.querySelectorAll('#provision-content h2[id]');
4471            const h3Elements = document.querySelectorAll('#provision-content h3[id]');
4472            h2Elements.forEach(h2 => observer.observe(h2));
4473            h3Elements.forEach(h3 => observer.observe(h3));
4474        }
4475    }
4476    // ---------------------------------------------------------------------
4477    returnObject.init();
4478    return returnObject;
4479})(jQuery);;
4480var provisionSearchModule = (function () {
4481    var self = this;
4482    var searchFormSelector = ".provision-search-form";
4483    var resetButtonSelector = "#resetFilters";
4484    var searchInputSelector = "#provisions-search-query";
4485
4486    var returnObject = {
4487        init: function () {
4488            this.self = this;
4489            this.wireUp();
4490        },
4491
4492        wireUp: function () {
4493
4494            if (!$('.provisionsearchpage').length && !$('.provision-search-form').length) return;
4495
4496            document.querySelector("form.provision-search-form").addEventListener("submit", function (event) {
4497                const qryInput = this.querySelector("[name='qry']");
4498                const hlInput = this.querySelector("[name='hl']");
4499
4500                if (qryInput && hlInput) {
4501                    hlInput.value = qryInput.value;
4502                }
4503            });
4504
4505            $(document).on('click', '.clear-query', function () {
4506                const $input = $("#provisions-search-query");
4507                $input.val("");
4508                $(".provisionssearch__search form").submit();
4509            });
4510
4511            $("#resetFilters").on("click", function () {
4512                localStorage.clear();
4513                $("input[type='checkbox']").prop("checked", false);
4514                $("input[type='text']").val("");
4515                $("select").val("");
4516                $(".provisionssearch__search form").submit();
4517            });
4518
4519            $(resetButtonSelector).on("click", function () {
4520                provisionSearchModule.resetFilters();
4521            });
4522
4523            $(searchInputSelector).on("keydown", function (e) {
4524                if (e.which == 13) {
4525                    e.preventDefault();
4526                    provisionSearchModule.search();
4527                    $(".provisionssearch__search form").submit();
4528                }
4529            });
4530
4531            const getCurrentUrl = () => {
4532                return location.protocol + '//' + location.host + location.pathname.replace(/\/$/, "");
4533            }
4534
4535            const loadMoreButton = document.querySelector('.js-paragraphSearch-loadMore');
4536            if (loadMoreButton !== null) {
4537                loadMoreButton.onclick = (e) => {
4538                    loadMoreButton.dataset.currentpage++;
4539
4540                    const params = new URLSearchParams(window.location.search);
4541                    params.set('p', loadMoreButton.dataset.currentpage);
4542
4543                    fetch(getCurrentUrl() + '/LoadMore?' + params.toString())
4544                        .then(response => response.text())
4545                        .then(htmlString => {
4546                            const provisionList = document.querySelector('.pagelist');
4547
4548                            provisionList.insertAdjacentHTML("beforeend", htmlString);
4549
4550                            // Check if all items are loaded, if so, hide 'loadMoreButton'
4551                            if (provisionList.querySelectorAll('.pagelist_item').length >= loadMoreButton.dataset.total) {
4552                                loadMoreButton.style.display = 'none';
4553                            }
4554                        })
4555                        .catch(function (err) {
4556                            console.warn('LoadMore error:', err);
4557                        });
4558                };
4559            }
4560
4561        },
4562
4563        search: function () {
4564            var query = $(searchInputSelector).val();
4565            var currentUrl = new URL(window.location.href);
4566            currentUrl.searchParams.set("q", query);
4567            window.location.href = currentUrl.toString();
4568        },
4569    };
4570
4571    returnObject.init();
4572    return returnObject;
4573})(jQuery);
4574
4575$(document).ready(function () {
4576    provisionSearchModule.init();
4577});;
4578let provisionPage = (function ($) {
4579    let useModalButton = true; // set false if only show with faded tables
4580    let tableRowsMaxHeight = 600;
4581
4582    let returnObject = {
4583        init: function () {
4584            this.self = this;
4585        },
4586
4587        wireUp: function () {
4588            // todo fix this with an id on the page.....
4589            if (!$(".provisionpage").length && !$(".referenceblock").length) { return }
4590
4591            // Table accessibility 
4592            $("table.provision__table").each(function () {
4593                setTableButtonAriaLabel($(this));
4594            });
4595
4596            // wire up side menu 
4597            $('.provision__menu').on('click', 'button', onNavExpandClick);
4598            $('.provision__menu').on('click', 'a', onNavExpandClick);
4599
4600            /* Gets the amount of height of the element from the viewport and adds the pageYOffset to get the height relative to the page */
4601            let stickyElem = document.querySelector(".sticky-div");
4602
4603            if (stickyElem != undefined) {
4604                //undefined for shared partial block view
4605                let stickPosition = stickyElem.getBoundingClientRect().top + window.pageYOffset;
4606                let sideMenu = $('.provision__menu');
4607                let complementary = $('.complementary');
4608
4609                // Handle sticky menu
4610                // init 
4611                stickStickyMenu(stickyElem, stickPosition);
4612                maxHeightStickyMenu(sideMenu, complementary);
4613                // browser scroll
4614                $(window).scroll(function () {
4615                    stickStickyMenu(stickyElem, stickPosition);
4616                    maxHeightStickyMenu(sideMenu, complementary);
4617                });
4618                // browser resize
4619                $(window).resize(function () {
4620                    maxHeightStickyMenu(sideMenu, complementary);
4621                });
4622            }
4623
4624            // Fade colors on table when overflowing
4625            $(".provision__dialog").each(provisionFadeTables);
4626            // Open Dialog
4627            $(".provision__opendialog").on("click", provisionOpenDialogs);
4628            // Close dialog
4629            $(".provision__closedialog").on("click", provisionCloseDialogs);
4630            $("#provisionpageoverlay").click(function (e) {
4631                if ($(e.target).is("#provisionpageoverlay")) {
4632                    provisionCloseDialogs();
4633                }
4634            });
4635
4636            $(document).keyup(function (e) {
4637                if (e.key === "Escape") {
4638                    provisionCloseDialogs();
4639                }
4640            });
4641
4642            let currentHash = decodeURIComponent(window.location.hash);
4643
4644            // Scroll back to the anchor link if it exists since modified tables
4645            // screws up original anchor scroll
4646            if (currentHash) {
4647                window.location.href = currentHash;
4648            }
4649
4650            // PDF link select
4651            // Trix för iPhone Safari, window.open funkar inte med nuvarande gui-design
4652            $("select.pdf-select").on("change", function () {
4653                if (this.selectedIndex > 0) {
4654                    let win = window.open(this.value);
4655                    if (!win) {
4656                        window.location.assign(this.value);
4657                    }
4658                }
4659            });
4660
4661            // Test: skriv ut tabell
4662            $("button#print-first-table").on("click", function () {
4663                let table = $("table").first();
4664                let print = window.open();
4665                print.document.write("<style>table{border-collapse:collapse;}th,td{border:1px solid;padding:6px;vertical-align:top;}table caption{text-align:left;font-weight:700;}table caption span{display:block;font-weight:400;}</style>");
4666                print.document.write(table[0].outerHTML);
4667                print.document.close();
4668                print.focus();
4669                print.print();
4670                print.close();
4671            });
4672
4673            const container = document.querySelector('.expandable-info-footer');
4674            if (container) {
4675                const button = container.querySelector('.toggle-button');
4676                const collapseElement = container.querySelector('.collapse');
4677                button.addEventListener('click', function () {
4678                    const isExpanded = button.getAttribute('aria-expanded') === 'true';
4679                    button.setAttribute('aria-expanded', !isExpanded);
4680                    collapseElement.classList.toggle('show');
4681                });
4682            }
4683        },
4684        wireUpLight: function () {
4685            $(".provision__opendialog").on("click", provisionOpenDialogs);
4686            $(".provision__closedialog").on("click", provisionCloseDialogs);
4687            $("#provisionpageoverlay").on("click", provisionCloseDialogs);
4688        },
4689        hideProvisionPartsOfTable: function () {
4690            provisionCloseDialogs()
4691        }
4692    };
4693
4694    function stickStickyMenu(stickyElem, currStickyPos) {
4695        if (window.pageYOffset > currStickyPos) {
4696
4697            if (window.matchMedia('(max-width: 970px)').matches) {
4698                stickyElem.style.position = "fixed";
4699            }
4700            else {
4701                stickyElem.style.position = "sticky";
4702            }
4703
4704            stickyElem.style.top = "0px";
4705            $(".showonlyonsticky").addClass("stickyvisibility");
4706
4707        } else {
4708            stickyElem.style.position = "relative";
4709            stickyElem.style.top = "initial";
4710            $(".showonlyonsticky").removeClass("stickyvisibility");
4711        }
4712    }
4713
4714    function maxHeightStickyMenu(menuElem, complementaryElem) {
4715        let calculatedHeight = window.innerHeight
4716            - menuElem.position().top
4717            - (Math.max(0, complementaryElem.position().top - window.pageYOffset))
4718            - 5;
4719        menuElem.css({ 'max-height': calculatedHeight });
4720    }
4721
4722    let provisionOpenCount = 0;
4723    let previousBodyOverflow = null;
4724
4725    function lockBodyScroll() {
4726        if (provisionOpenCount === 0) {
4727            previousBodyOverflow = $("body").css("overflow");
4728            $("body").css("overflow", "hidden");
4729            $("#provisionpageoverlay").addClass("active");
4730        }
4731        provisionOpenCount++;
4732    }
4733
4734    function unlockBodyScrollIfNeeded() {
4735        provisionOpenCount = Math.max(0, provisionOpenCount - 1);
4736
4737        if (provisionOpenCount === 0) {
4738            $("body").css("overflow", previousBodyOverflow || "auto");
4739            $("#provisionpageoverlay").removeClass("active");
4740        }
4741    }
4742
4743    // Accesibility hacks!
4744    // Set aria-label on button
4745    let setTableButtonAriaLabel = function (currentTable) {
4746        if (currentTable.has("caption").length) {
4747            let tableButton = currentTable.closest(".provision__dialog-wrapper").next("button.provision__opendialog");
4748            let current = tableButton.text();
4749            tableButton.attr("aria-label", current + ", " + currentTable.find('caption').text());
4750        }
4751    }
4752
4753    // Fade colors on table when overflowing
4754    let provisionFadeTables = function () {
4755        let dialog_wrapper = $(this);
4756        let table_width = dialog_wrapper.children("table.provision__table").width();
4757
4758        // Fade table end when overflowing (width)
4759        if (table_width > dialog_wrapper.width()) {
4760            useModalButton = true;
4761            dialog_wrapper.children(".provision__table-overlay").addClass("overflown").addClass("X");
4762        }
4763
4764        // Fade table end when overflowing max height
4765        hideTableRows(dialog_wrapper.children("table.provision__table"));
4766
4767        // set button visible if overflown X or Y
4768        if (useModalButton === true) {
4769            $(this).parent(".provision__dialog-wrapper").next("button.provision__opendialog").show();
4770        }
4771    }
4772
4773    // Hide all table rows
4774    let hideAllTableRows = function () {
4775        $("table.provision__table").each(function () {
4776            hideTableRows($(this));
4777        });
4778    }
4779
4780    // Hide table rows
4781    let hideTableRows = function (currentTable) {
4782        let rowElements = currentTable.children("tbody").children("tr");
4783        let rows = rowElements.length;
4784        let currentHeight = 0;
4785
4786        rowElements.each(
4787            function (index) {
4788                currentHeight += $(this).height();
4789
4790                if (index > 1 && currentHeight > tableRowsMaxHeight) {
4791                    useModalButton = true;
4792
4793                    rowElements.slice(index, rows).addClass("visually-hidden"); // hide();
4794
4795                    currentTable.parent(".provision__dialog").children(".provision__table-overlay").addClass("overflown").addClass("Y");
4796                    return false;
4797                }
4798            }
4799        );
4800    }
4801
4802    // Show all table rows
4803    let showAllTableRows = function (currentTable) {
4804        currentTable.children("tbody").children("tr").removeClass("visually-hidden");
4805    }
4806
4807    // Open dialogs
4808    let provisionOpenDialogs = function (e) {
4809        lockBodyScroll();
4810
4811        // Open footnote
4812        let note = $(this).data("footnote");
4813        if (typeof note !== "undefined") {
4814            e.preventDefault();
4815            e.stopPropagation(); // IMPORTANT: don't bubble footnoots
4816
4817            $(".provision__dialog-wrapper.active").filter(function () {
4818                return $(this).find(".footnote.active").closest(".provision__dialog-wrapper")[0] === this;
4819            }).each(function () {
4820                closeOneWrapper($(this));
4821            });
4822
4823            let $footWrapper = $(this).parent().nextAll(".provision__dialog-wrapper").first();
4824            if (!$footWrapper.length) return;
4825
4826            // Save where we came from, return focus on close
4827            $footWrapper.attr("data-dialog-type", "footnote");
4828            $footWrapper.data("returnFocusEl", this);
4829
4830            //  Open only this footnoot-wrapepr
4831            $footWrapper
4832                .removeAttr("inert")
4833                .prop("inert", false)
4834                .addClass("active")
4835                .attr("aria-hidden", "false")
4836                .children(".provision__dialog, .provision__closedialog")
4837                .addClass("active");
4838
4839            let $footnote = $footWrapper.find(".footnote").first();
4840            $footnote.addClass("active").attr("aria-hidden", "false");
4841
4842            // Avoid dubble footnoot number, update if it exsist
4843            let $num = $footnote.children(".footnotenumber");
4844            if ($num.length) $num.text(note);
4845            else $footnote.prepend(`<span class="footnotenumber">${note}</span>`);
4846
4847            //  Focus close
4848            $footWrapper.children(".provision__closedialog").focus();
4849
4850            return;
4851        }
4852        // Open table
4853        else if ($(this).hasClass("provision__table")) {
4854            e.preventDefault();
4855            e.stopPropagation();
4856
4857            let $tableWrapper = $(this).prev(".provision__dialog-wrapper");
4858            if (!$tableWrapper.length) return;
4859
4860            $tableWrapper.attr("data-dialog-type", "table");
4861            $tableWrapper.data("returnFocusEl", this);
4862
4863            $tableWrapper
4864                .removeAttr("inert")
4865                .prop("inert", false)
4866                .addClass("active")
4867                .attr("aria-hidden", "false")
4868                .children(".provision__dialog, .provision__closedialog")
4869                .addClass("active")
4870                .children(".provision__table-overlay, .provision__table")
4871                .addClass("active");
4872
4873            showAllTableRows($tableWrapper.find("table.provision__table"));
4874
4875            $tableWrapper.children(".provision__closedialog").focus();
4876        }
4877    };
4878
4879    function closeAllProvisionDialogs() {
4880        // set focus outside of element before close
4881        let $top = $(".provision__dialog-wrapper.active").last();
4882        let returnEl = $top.data("returnFocusEl");
4883
4884        if (returnEl && document.contains(returnEl)) {
4885            $(returnEl).trigger("focus");
4886        } else {
4887            $("#provisionpageoverlay").attr("tabindex", "-1").trigger("focus");
4888        }
4889
4890        // Close all open wrappers
4891        $(".provision__dialog-wrapper.active").each(function () {
4892            $(this)
4893                .removeClass("active")
4894                .prop("inert", true)
4895                .attr("aria-hidden", "true")
4896                .removeAttr("data-dialog-type")
4897                .find(".provision__dialog, .provision__table-overlay, .provision__table, .provision__closedialog")
4898                .removeClass("active");
4899
4900            $(this).find(".footnote").removeClass("active").attr("aria-hidden", "true");
4901            $(this).find(".footnotenumber").remove();
4902        });
4903
4904        // Overlay + body scroll
4905        provisionOpenCount = 0;
4906        $("body").css("overflow", previousBodyOverflow || "auto");
4907        $("#provisionpageoverlay").removeClass("active").removeAttr("tabindex");
4908
4909        hideAllTableRows();
4910    }
4911
4912    // Close dialogs
4913    let provisionCloseDialogs = function (e) {
4914        // overlay click => close top-most
4915        if ($(this).is("#provisionpageoverlay")) {
4916            let $top = $(".provision__dialog-wrapper.active").last();
4917            if ($top.length) closeOneWrapper($top);
4918            return;
4919        }
4920
4921        // Close all if on big modal close
4922        let $clickedWrapper = $(this).closest(".provision__dialog-wrapper");
4923        if ($clickedWrapper.find(".provision__table").length || $clickedWrapper.find(".provision__table-overlay").length) {
4924            closeAllProvisionDialogs();
4925            return;
4926        }
4927
4928        // else: close closest wrapper (footnoot close)
4929        if ($clickedWrapper.length) closeOneWrapper($clickedWrapper);
4930    };
4931
4932    // close one wrapper (footnoots)
4933    function closeOneWrapper($wrapper) {
4934        //  Move focus out before hiding
4935        let returnEl = $wrapper.data("returnFocusEl");
4936        if ($wrapper.has(document.activeElement).length) {
4937            if (returnEl) $(returnEl).focus();
4938            else $("#provisionpageoverlay").attr("tabindex", "-1").focus();
4939        }
4940
4941        //  remove footnote number only inside this wrapper
4942        $wrapper.find(".footnotenumber").remove();
4943
4944        $wrapper
4945            .removeClass("active")
4946            .attr("aria-hidden", "true")
4947            .prop("inert", true)   
4948            .find(".provision__dialog, .provision__table-overlay, .provision__table, .provision__closedialog")
4949            .removeClass("active");
4950
4951        $wrapper.find(".footnote").removeClass("active").attr("aria-hidden", "true");
4952
4953        unlockBodyScrollIfNeeded();
4954
4955        // Only run this when you close the big table dialog
4956        if ($wrapper.find(".provision__table").length) {
4957            hideAllTableRows();
4958        }
4959    }
4960
4961    function getFocusable($root) {
4962        return $root
4963            .find('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not
4963([tabindex="-1"])')
4964            .filter(":visible");
4965    }
4966
4967    $(document).on("click", "#provisionpageoverlay", function (e) {
4968        if (e.target !== this) return;
4969        closeAllProvisionDialogs();
4970    });
4971
4972    $(document).on("keydown", function (e) {
4973        if (e.key !== "Tab") return;
4974
4975        let $top = $(".provision__dialog-wrapper.active").last();
4976        if (!$top.length) return;
4977
4978        let $focusables = getFocusable($top);
4979        if ($focusables.length === 0) return;
4980
4981        let first = $focusables.get(0);
4982        let last = $focusables.get($focusables.length - 1);
4983
4984        if (e.shiftKey && document.activeElement === first) {
4985            e.preventDefault();
4986            last.focus();
4987        } else if (!e.shiftKey && document.activeElement === last) {
4988            e.preventDefault();
4989            first.focus();
4990        }
4991    });
4992
4993    // ESC closes top-most
4994    $(document).on("keydown", function (e) {
4995        if (e.key !== "Escape") return;
4996
4997        let $top = $(".provision__dialog-wrapper.active").last();
4998        if ($top.length) closeOneWrapper($top);
4999    });
5000
5001    //Menu expand
5002    let onNavExpandClick = function () {
5003        let clickedElementParentAIsExpanded;
5004        var $this = $(this);
5005
5006        if ($this.is('a')) {
5007            clickedElementParentAIsExpanded = $this.parent().parent().parent().siblings('.menurow').children('button').attr('aria-expanded');
5008            $this = $this.siblings('button').first();
5009        } else {
5010            clickedElementParentAIsExpanded = $this.parent().parent().parent().siblings('.menurow').children('button').attr('aria-expanded');
5011        }
5012
5013        let parentLi = $this.parent().parent('li');
5014        let rootNav = $(".provision__menu");
5015        let clickedElement = $this;
5016        let clickedElementIsExpanded = $this.attr('aria-expanded');
5017        let clickedElementHasChildren = $this.parent().siblings('ul').length;
5018
5019        // If children exists
5020        if (clickedElementHasChildren) {
5021            // If NOT elment is expanded
5022            if (clickedElementIsExpanded === "false") {
5023                // If NOT inside active node
5024                if (clickedElementParentAIsExpanded !== "true") {
5025                    hideAll();
5026                }
5027                // If inside active node
5028                else {
5029                    hideSiblings();
5030                }
5031
5032                // Show clicked element
5033                parentLi.addClass('active');
5034                $this.parent().siblings('ul').addClass('active').slideDown();
5035                $this.attr("aria-expanded", "true").addClass('active');
5036
5037                // show children
5038                parentLi.addClass('active');
5039                $this.children('ul').addClass('active').slideDown();
5040                $this.find('button').attr("aria-expanded", "true").addClass('active');
5041            }
5042            // If elment is expanded
5043            else if (clickedElementIsExpanded === "true") {
5044                hideChildren();
5045            }
5046        }
5047        // If NOT children exists
5048        else {
5049            // If NOT inside active node
5050            if (clickedElementParentAIsExpanded !== "true") {
5051                hideAll();
5052            }
5053            // If inside active node
5054            else {
5055                hideSiblings();
5056            }
5057            // Set active active
5058            clickedElement.addClass('active');
5059            parentLi.addClass('active');
5060        }
5061
5062        // Private menu functions
5063        function hideAll() {
5064            $(".active").removeClass('active');
5065            rootNav.children('ul').find('ul').slideUp();
5066            rootNav.find('button').attr("aria-expanded", "false");
5067        }
5068
5069        function hideSiblings() {
5070            parentLi.siblings('li').find('ul').slideUp();
5071            parentLi.siblings('li').find('.active').removeClass('active');
5072            parentLi.siblings('li').find('button').attr("aria-expanded", "false")
5073        }
5074
5075        function hideChildren() {
5076            parentLi.removeClass('active').find('li').removeClass('active');
5077            parentLi.find('ul').removeClass('active').slideUp();
5078            parentLi.find('button').attr("aria-expanded", "false").removeClass('active');
5079        }
5080    }
5081
5082    // ------------------------------
5083    returnObject.init();
5084    return returnObject;
5085})(jQuery);;
5086
5087var RequiredIfValidator = (function() {
5088
5089    function isConditionTrue(otherPropertyValue, conditionValue, operator) {
5090        switch (operator) {
5091            default:
5092            case "Equal":
5093                return otherPropertyValue.localeCompare(conditionValue) === 0;
5094            case "GreaterThan":
5095                return otherPropertyValue.localeCompare(conditionValue) > 0;
5096            case "GreaterThanOrEqual":
5097                return otherPropertyValue.localeCompare(conditionValue) >= 0;
5098            case "LessThan":
5099                return otherPropertyValue.localeCompare(conditionValue) < 0;
5100            case "LessThanOrEqual":
5101                return otherPropertyValue.localeCompare(conditionValue) <= 0;
5102            case "NotEqual":
5103                return otherPropertyValue.localeCompare(conditionValue) !== 0;
5104        }
5105    }
5106
5107    function getPropertyValue($control) {
5108        if ($control.attr("type") === 'checkbox') {
5109            return $control.is(':checked') ? 'true' : 'false';
5110        }
5111        else if ($control.attr("type") === 'radio') {
5112            return $control.filter(':checked').val() || "";
5113        }
5114        else {
5115            return $control.val();
5116        }
5117    }
5118
5119    function evaluateConditions(propertyValues, requirements) {
5120        var isPropertiesTrue = false;
5121        var ifAnyPropertyTrue = (requirements.ifAny ?? false) === true;
5122
5123        for (var i = 0; i < requirements.properties.length; i++) {
5124            var propertyName = requirements.properties[i].property;
5125            var ifAny = requirements.properties[i].ifAny ?? false;
5126            var isConditionsTrue = false;
5127
5128            for (var j = 0; j < requirements.properties[i].conditions.length; j++) {
5129                var compareOperator = requirements.properties[i].conditions[j].operator;
5130                var expectedValue = requirements.properties[i].conditions[j].value ?? "";
5131                var propertyValue = propertyValues[propertyName] ?? "";
5132
5133                isConditionsTrue = isConditionTrue(propertyValue, expectedValue, compareOperator);
5134
5135                if (isConditionsTrue) {
5136                    if (ifAny) break;
5137                } else {
5138                    if (!ifAny) break;
5139                }
5140            }
5141
5142            isPropertiesTrue = isConditionsTrue;
5143
5144            if (isPropertiesTrue) {
5145                if (ifAnyPropertyTrue) break;
5146            } else {
5147                if (!ifAnyPropertyTrue) break;
5148            }
5149        }
5150
5151        return isPropertiesTrue;
5152    }
5153
5154    function getPropertyValuesFromForm($form, requirements) {
5155        var propertyValues = {};
5156
5157        for (var i = 0; i < requirements.properties.length; i++) {
5158            var propertyName = requirements.properties[i].property;
5159            var selector = '[name=' + propertyName + ']';
5160            var $control = $form.find(selector);
5161
5162            propertyValues[propertyName] = getPropertyValue($control);
5163        }
5164
5165        return propertyValues;
5166    }
5167
5168    function toggleContainerVisibility($form, elementName, isVisible) {
5169        var $container = $form.find('[data-requiredifcontainer="' + elementName + '"]');
5170        if ($container.length) {
5171            $container.toggle(isVisible);
5172        }
5173    }
5174
5175    return {
5176        isConditionTrue: isConditionTrue,
5177        getPropertyValue: getPropertyValue,
5178        evaluateConditions: evaluateConditions,
5179        getPropertyValuesFromForm: getPropertyValuesFromForm,
5180        toggleContainerVisibility: toggleContainerVisibility
5181    };
5182})();
5183
5184(function ($) {
5185
5186    jQuery.validator.unobtrusive.adapters.add(
5187        'combined', ['properties'], function (options) {
5188            options.rules['combined'] = options.params;
5189            options.messages['combined'] = options.message;
5190        }
5191    );
5192
5193    jQuery.validator.addMethod('combined', function (value, element, params) {
5194        var properties = params.properties.split(',');
5195        var foundValue = true;
5196
5197        var values = $.map(properties, function (property, index) {
5198
5199            if ($('#' + property).val() == "") {
5200
5201                foundValue = false;
5202            }
5203        });
5204
5205        return foundValue;
5206    }, '');
5207
5208    jQuery.validator.unobtrusive.adapters.add('filesizemax', ['size'], function (options) {
5209        options.rules['filesizemax'] = options.params;
5210        options.messages['filesizemax'] = options.message;
5211    });
5212
5213    jQuery.validator.addMethod('filesizemax', function (value, element, params) {
5214        if (element.files === null) return true;
5215        if (element.files.length > 0 && element.files[0].size > parseInt(params.size)) {
5216            return false;
5217        }
5218        return true;
5219    });
5220
5221    var filesizemaxinlistfilename;
5222    jQuery.validator.unobtrusive.adapters.add('filesizemaxinlist', ['size', 'istotalsize'], function (options) {
5223        options.rules['filesizemaxinlist'] = options.params;
5224        options.messages['filesizemaxinlist'] = function() {
5225            return options.message.replace('{0}', filesizemaxinlistfilename);
5226        };
5227    });
5228
5229    jQuery.validator.addMethod('filesizemaxinlist', function (value, element, params) {
5230        var isValid = true;
5231
5232        var maxFileSize = parseInt(params.size);
5233        var istotalFileSize = parseInt(params.istotalsize) === 1 ? true : false;
5234
5235        var fileSection = element.id.substring(3, 4);
5236        var $divFilSection = $("#Fil" + fileSection + "Section");
5237
5238        var $fileHolders = $divFilSection.find('div.fileholder').not($('.hidden'));
5239
5240        var totalBytes = 0;
5241
5242        $(($fileHolders)).each(function () {
5243            var $inputfile = $(this).find('.inputfile:first:file');
5244
5245            if ($inputfile[0].files.length > 0) {
5246
5247                var file = $inputfile[0].files[0];
5248
5249                if (istotalFileSize === true) {
5250                    totalBytes += file.size;
5251
5252                    if (totalBytes > maxFileSize) {
5253                        isValid = false;
5254                        return false;
5255                    }
5256
5257                } else {
5258                    if (file.size > maxFileSize) {
5259                        isValid = false;
5260                        // set error message parameter
5261                        filesizemaxinlistfilename = file.name;
5262
5263                        return false;
5264                    }
5265                }
5266            }
5267            return true;
5268        });
5269
5270        return isValid;
5271    });
5272
5273    jQuery.validator.unobtrusive.adapters.add('fileextension', ['extensions'], function (options) {
5274        options.rules['fileextension'] = options.params;
5275        options.messages['fileextension'] = options.message;
5276    });
5277
5278    jQuery.validator.addMethod('fileextension', function (value, element, params) {
5279        if (element.files === null) return true;
5280        var extList = params.extensions.split(',');
5281        if (element.files.length > 0 && $.inArray(getFileExtension(element.files[0].name), extList) === -1) {
5282            return false;
5283        }
5284        return true;
5285    });
5286
5287    var fileextensioninlistfilename;
5288    jQuery.validator.unobtrusive.adapters.add('fileextensioninlist', ['extensions'], function (options) {
5289        options.rules['fileextensioninlist'] = options.params;
5290        options.messages['fileextensioninlist'] = function () {
5291            return options.message.replace('{0}', fileextensioninlistfilename);
5292        };
5293    });
5294
5295    jQuery.validator.addMethod('fileextensioninlist', function (value, element, params) {
5296        var isValid = true;
5297
5298        var extList = params.extensions.split(',');
5299
5300        var fileSection = element.id.substring(3, 4);
5301        var $divFilSection = $("#Fil" + fileSection + "Section");
5302
5303        var $fileHolders = $divFilSection.find('div.fileholder').not($('.hidden'));
5304
5305        $(($fileHolders)).each(function () {
5306            var $inputfile = $(this).find('.inputfile:first:file');
5307
5308            if ($inputfile[0].files.length > 0) {
5309
5310                var file = $inputfile[0].files[0];
5311
5312                if ($.inArray(getFileExtension(file.name), extList) === -1) {
5313                    isValid = false;
5314                    // set error message parameter
5315                    fileextensioninlistfilename= file.name;
5316
5317                    return false;
5318                }
5319            }
5320            return true;
5321        });
5322
5323        return isValid;
5324    });
5325
5326    function getFileExtension(fileName) {
5327        if (/[.]/.exec(fileName)) {
5328            return /[^.]+$/.exec(fileName)[0].toLowerCase();
5329        }
5330        return "";
5331    }
5332
5333    jQuery.validator.unobtrusive.adapters.add('pnr', function (options) {
5334        options.rules['pnr'] = options.params;
5335        options.messages['pnr'] = options.message;
5336    });
5337
5338    jQuery.validator.addMethod('pnr', function (value, element, params) {
5339        var reg = $(element).attr('data-val-pnr-pattern');
5340        var regex = new RegExp(reg);
5341        if (regex.exec(value))
5342            return true;
5343        else
5344            return false;
5345    });
5346
5347    jQuery.validator.unobtrusive.adapters.add('todayandafter', function (options) {
5348        options.rules['todayandafter'] = options.params;
5349        options.messages['todayandafter'] = options.message;
5350    });
5351
5352    jQuery.validator.addMethod('todayandafter', function (value, element, params) {
5353        if ($(element).is(":hidden")) return true;
5354        var today = $(element).attr('data-val-todayandafter-mindate');
5355        var inputdate = (isNaN(value) ? Date.parse(value) : eval(value));
5356        var inputToday = (isNaN(today) ? Date.parse(today) : eval(today));
5357        return inputdate >= inputToday;
5358    });
5359
5360    jQuery.validator.unobtrusive.adapters.add('restrictdaysahead', ['mindate'], function (options) {
5361        options.rules['restrictdaysahead'] = options.params.mindate;
5362        options.messages['restrictdaysahead'] = options.message;
5363    });
5364
5365    jQuery.validator.addMethod('restrictdaysahead', function (value, element, minDateStr) {
5366        if (!value || $(element).is(":hidden")) return true;
5367        const selectedDate = new Date(value);
5368        const minDate = new Date(minDateStr);
5369        return selectedDate >= minDate;
5370    });
5371
5372    jQuery.validator.unobtrusive.adapters.add('datetimemax', function (options) {
5373        options.rules['datetimemax'] = options.params;
5374        options.messages['datetimemax'] = options.message;
5375    });
5376
5377    jQuery.validator.addMethod('datetimemax', function (value, element, params) {
5378        if ($(element).is(":hidden")) return true;
5379        var maxdate = $(element).attr('data-val-datetimemax-maxdate');
5380
5381        var inputdate = (isNaN(value) ? Date.parse(value) : eval(value));
5382        var maxDate = (isNaN(maxdate) ? Date.parse(maxdate) : eval(maxdate));
5383        return inputdate < maxDate;
5384    });
5385
5386    jQuery.validator.unobtrusive.adapters.add('regexextra', function (options) {
5387        options.rules['regexextra'] = options.params;
5388        options.messages['regexextra'] = options.message;
5389    });
5390
5391    jQuery.validator.addMethod('regexextra', function (value, element, params) {
5392        var reg = $(element).attr('data-val-regexextra-pattern');
5393        var regex = new RegExp(reg);
5394        if (regex.exec(value))
5395            return true;
5396        else
5397            return false;
5398    });
5399
5400    //atleastonefilerequired
5401    jQuery.validator.unobtrusive.adapters.add(
5402        'atleastonefilerequired', ['properties'], function (options) {
5403            options.rules['atleastonefilerequired'] = options.params;
5404            options.messages['atleastonefilerequired'] = options.message;
5405        }
5406    );
5407
5408    jQuery.validator.addMethod('atleastonefilerequired', function (value, element, params) {
5409  
5410        var properties = params.properties.split(',');
5411    
5412        var foundValue = false;
5413        var values = $.map(properties, function (property, index) {
5414
5415            if ($('#' + property).hasClass("ignore")) {
5416                foundValue = true;
5417            }
5418
5419            if ($('#' + property).val() != "") {
5420                foundValue = true;
5421            }
5422        });
5423        return foundValue;
5424    }, '');
5425
5426    //fileexistinlistrequired
5427    jQuery.validator.unobtrusive.adapters.add(
5428        'fileexistinlistrequired', ['propertyname', 'propertyvalue'], function (options) {
5429            options.rules['fileexistinlistrequired'] = options.params;
5430            options.messages['fileexistinlistrequired'] = options.message;
5431        }
5432    );
5433
5434    jQuery.validator.addMethod('fileexistinlistrequired', function (value, element, params) {
5435
5436        var foundValue = false;
5437
5438        var propertyName = params.propertyname;
5439        var propertyValue = params.propertyvalue;
5440
5441        if (propertyName !== undefined && propertyName !== "") {
5442            var name = '[name=' + propertyName + ']',
5443                $form = $(element).closest('form'),
5444                $control = $form.find(name);
5445
5446            var propertyActualValue;
5447
5448            if ($control.attr("type") === 'radio' || $control.attr("type") === 'checkbox') {
5449                propertyActualValue = $control.filter(':checked').val();
5450            }
5451            else {
5452                propertyActualValue = $control.val();
5453            }
5454
5455            if (propertyActualValue !== propertyValue) {
5456                return true;
5457            }
5458        }
5459
5460        var fileSection = element.id.substring(3, 4);
5461        var $divFilSection = $("#Fil" + fileSection + "Section");
5462
5463        var $fileHolders = $divFilSection.find('div.fileholder:visible');
5464
5465        if (!$fileHolders.length)
5466            return true;
5467
5468        $(($fileHolders)).each(function () {
5469            const $inputfile = $(this).find('.inputfile:first');
5470    
5471            if ($inputfile.val() !== "") {
5472                foundValue = true;
5473                return false;
5474            }
5475        });
5476
5477        return foundValue;
5478    }, '');
5479
5480    //atleastonerequired
5481    jQuery.validator.unobtrusive.adapters.add(
5482        'atleastonerequired', ['properties'], function (options) {
5483            options.rules['atleastonerequired'] = options.params;
5484            options.messages['atleastonerequired'] = options.message;
5485        }
5486    );
5487
5488    jQuery.validator.addMethod('atleastonerequired', function (value, element, params) {
5489        var properties = params.properties.split(',');
5490        var foundValue = false;
5491        var values = $.map(properties, function (property, index) {
5492            if ($('#' + property).is(':checked'))
5493                foundValue = true;
5494            if ($('#' + property).val() != "" && $('#' + property).val() != "true")
5495                foundValue = true;
5496        });
5497        return foundValue;
5498    }, '');
5499
5500    //allisrequired
5501    jQuery.validator.unobtrusive.adapters.add(
5502        'allisrequired', ['properties'], function (options) {
5503            options.rules['allisrequired'] = options.params;
5504            options.messages['allisrequired'] = options.message;
5505        }
5506    );
5507
5508    jQuery.validator.addMethod('allisrequired', function (value, element, params) {
5509        var properties = params.properties.split(',');
5510        var foundValue = true;
5511        var values = $.map(properties, function (property, index) {
5512
5513            if ($('#' + property).is(':checked')) {
5514                var t = "";
5515            }
5516            else {
5517                foundValue = false;
5518            }
5519            if ($('#' + property).val() !== "" && $('#' + property).val() === "false") {
5520                foundValue = false;
5521
5522            }
5523        });
5524        return foundValue;
5525    }, '');
5526
5527    var defaultRangeValidator = $.validator.methods.range;
5528    $.validator.methods.range = function (value, element, param) {
5529        if (element.type === 'checkbox') {
5530            // if it's a checkbox return true if it is checked
5531            return element.checked;
5532        } else {
5533            // otherwise run the default validation function
5534            return defaultRangeValidator.call(this, value, element, param);
5535        }
5536    };
5537
5538    //atleastonefilerequired
5539    jQuery.validator.unobtrusive.adapters.add(
5540        'atleastonefilerequired', ['properties'], function (options) {
5541            options.rules['atleastonefilerequired'] = options.params;
5542            options.messages['atleastonefilerequired'] = options.message;
5543        }
5544    );
5545
5546    jQuery.validator.addMethod('atleastonefilerequired', function (value, element, params) {
5547        var properties = params.properties.split(',');
5548        var foundValue = false;
5549        var values = $.map(properties, function (property, index) {
5550
5551            if ($('#' + property).val() != "")
5552                foundValue = true;
5553        });
5554        return foundValue;
5555    }, '');
5556
5557    $.validator.addMethod("genericcompare", function (value, element, params) {
5558        var propelename = params.split(",")[0];
5559        var operName = params.split(",")[1];
5560        if (params == undefined || params == null || params.length == 0 ||
5561            value == undefined || value == null || value.length == 0 ||
5562            propelename == undefined || propelename == null || propelename.length == 0 ||
5563            operName == undefined || operName == null || operName.length == 0)
5564            return true;
5565        var valueOther = $(propelename).val();
5566        var val1 = (isNaN(value) ? Date.parse(value) : eval(value));
5567        var val2 = (isNaN(valueOther) ? Date.parse(valueOther) : eval(valueOther));
5568
5569        if (operName == "GreaterThan")
5570            return val1 > val2;
5571        if (operName == "LessThan")
5572            return val1 < val2;
5573        if (operName == "GreaterThanOrEqual")
5574            return val1 >= val2;
5575        if (operName == "LessThanOrEqual")
5576            return val1 <= val2;
5577    });
5578
5579    $.validator.unobtrusive.adapters.add("genericcompare",
5580        ["comparetopropertyname", "operatorname"], function (options) {
5581            options.rules["genericcompare"] = "#" +
5582                options.params.comparetopropertyname + "," + options.params.operatorname;
5583            options.messages["genericcompare"] = options.message;
5584        });
5585
5586    $.validator.addMethod("localizedgenericcompare", function (value, element, params) {
5587        var propelename = params.split(",")[0];
5588        // if object is in a collection
5589        if (element.id.split("__")[1]) {
5590            propelename = element.id.split("__")[0] + "__" + propelename;
5591        }
5592
5593        var operName = params.split(",")[1];
5594        if (params == undefined || params == null || params.length == 0 ||
5595            value == undefined || value == null || value.length == 0 ||
5596            propelename == undefined || propelename == null || propelename.length == 0 ||
5597            operName == undefined || operName == null || operName.length == 0)
5598            return true;
5599
5600        var valueOther = $("input[id*='" + propelename + "']").val();
5601        var val1 = (isNaN(value) ? Date.parse(value) : eval(value));
5602        var val2 = (isNaN(valueOther) ? Date.parse(valueOther) : eval(valueOther));
5603
5604        if (operName == "GreaterThan")
5605            return val1 > val2;
5606        if (operName == "LessThan")
5607            return val1 < val2;
5608        if (operName == "GreaterThanOrEqual")
5609            return val1 >= val2;
5610        if (operName == "LessThanOrEqual")
5611            return val1 <= val2;
5612    });
5613
5614    $.validator.unobtrusive.adapters.add("localizedgenericcompare",
5615        ["comparetopropertyname", "operatorname"], function (options) {
5616            options.rules["localizedgenericcompare"] = options.params.comparetopropertyname + "," + options.params.operatorname;
5617            options.messages["localizedgenericcompare"] = options.message;
5618        });
5619
5620    $.validator.addMethod("requiredforarea", function (email, element, areaids) {
5621        var ctx = $(element).closest('form');
5622        var selectedAreaId = $('#SelectedAreaId', ctx).val();
5623
5624        var pos = $.inArray(selectedAreaId, areaids.split(","));
5625
5626        if (pos >= 0 && email === "") {
5627            return false;
5628        }
5629
5630        return true;
5631    });
5632
5633    $.validator.unobtrusive.adapters.addSingleVal("requiredforarea", "areaids");
5634
5635    jQuery.validator.unobtrusive.adapters.add(
5636        'ischecked', ['properties'], function (options) {
5637            options.rules['ischecked'] = options.params;
5638            options.messages['ischecked'] = options.message;
5639        }
5640    );
5641
5642    jQuery.validator.addMethod('ischecked', function (value, element, params) {
5643        return element.checked;
5644    }, '');
5645
5646
5647    jQuery.validator.unobtrusive.adapters.add(
5648        'requiredif', ["requirements"], function (options) {
5649            options.rules['requiredif'] = options.params;
5650            options.messages['requiredif'] = options.message;
5651        }
5652    );
5653
5654    jQuery.validator.addMethod('requiredif', function (value, element, params) {
5655
5656        var jsonRequirements = params.requirements;
5657        const requirements = JSON.parse(jsonRequirements);
5658        var $form = $(element).closest('form');
5659
5660        var propertyValues = RequiredIfValidator.getPropertyValuesFromForm($form, requirements);
5661        var isPropertiesTrue = RequiredIfValidator.evaluateConditions(propertyValues, requirements);
5662        var isValueRequired = isPropertiesTrue === true;
5663
5664        if (isValueRequired === true) {
5665            if (value === "" && (requirements.allowEmptyStrings ?? false) === true) {
5666                return true;
5667            }
5668
5669            var validationResult = $.validator.methods.required.call(this, value, element, params);
5670            return validationResult;
5671        }
5672
5673        return true;
5674
5675    }, '');
5676
5677    function initializeRequiredIfContainers() {
5678        var $form = $('form');
5679        
5680        $form.find('[data-val-requiredif]').each(function() {
5681            var $element = $(this);
5682            var elementName = $element.attr('name');
5683            var requirementsJson = $element.attr('data-val-requiredif-requirements');
5684            
5685            if (!requirementsJson) {
5686                return;
5687            }
5688
5689            try {
5690                var requirements = JSON.parse(requirementsJson);
5691
5692                for (var i = 0; i < requirements.properties.length; i++) {
5693                    var propertyName = requirements.properties[i].property;
5694                    var selector = '[name=' + propertyName + ']';
5695                    var $dependentElement = $form.find(selector);
5696                    
5697                    if ($dependentElement.length) {
5698                        if (!$dependentElement.data('requiredif-initialized-' + elementName)) {
5699                            $dependentElement.data('requiredif-initialized-' + elementName, true);
5700
5701                            $dependentElement.on('change', function() {
5702                                
5703                                var propertyValues = RequiredIfValidator.getPropertyValuesFromForm($form, requirements);
5704                                var isConditionMet = RequiredIfValidator.evaluateConditions(propertyValues, requirements);
5705                                RequiredIfValidator.toggleContainerVisibility($form, elementName, isConditionMet);
5706                            });
5707                        }
5708                    }
5709                }
5710
5711                var propertyValues = RequiredIfValidator.getPropertyValuesFromForm($form, requirements);
5712                var isConditionMet = RequiredIfValidator.evaluateConditions(propertyValues, requirements);
5713                RequiredIfValidator.toggleContainerVisibility($form, elementName, isConditionMet);
5714
5715            } catch (e) {
5716                console.error('Error parsing requiredif requirements for element: ' + elementName, e);
5717            }
5718        });
5719    }
5720
5721    initializeRequiredIfContainers();
5722
5723    jQuery.validator.unobtrusive.adapters.add(
5724        'datetimerequired', ["allowemptystrings"], function (options) {
5725            options.rules['datetimerequired'] = options.params;
5726            options.messages['datetimerequired'] = options.message;
5727        }
5728    );
5729
5730    jQuery.validator.addMethod('datetimerequired', function (value, element, params) {
5731
5732        function isValidDate(dateStr) {
5733
5734            var timestamp = Date.parse(dateStr);
5735
5736            if (typeof timestamp !== 'number' || Number.isNaN(timestamp)) {
5737                return false;
5738            }
5739
5740            return true;
5741        }
5742
5743        var jsonValue = params.allowemptystrings;
5744        const parsedValue = JSON.parse(jsonValue);
5745
5746        if (value === "" && (parsedValue ?? false) === true) {
5747            return true;
5748        }
5749
5750        var isDate = isValidDate(value);
5751        
5752        return isDate;
5753
5754    }, '');
5755
5756    jQuery.validator.unobtrusive.adapters.add(
5757        'numericrequired', ["allowemptystrings", "onlyintegers"], function (options) {
5758            options.rules['numericrequired'] = options.params;
5759            options.messages['numericrequired'] = options.message;
5760        }
5761    );
5762
5763    jQuery.validator.addMethod('numericrequired', function (value, element, params) {
5764
5765        function isValidNumber(numberStr) {
5766            return !isNaN(parseFloat(numberStr)) && !isNaN(numberStr - 0);
5767        }
5768
5769        function isValidInteger(numberStr) {
5770            const decimal = Number(numberStr);
5771
5772            if (isNaN(decimal)) {
5773                return false;
5774            }
5775
5776            const remainder = decimal - parseInt(decimal);
5777            return remainder === 0;
5778        }
5779
5780        const allowEmptyStrings = JSON.parse(params.allowemptystrings);
5781        const onlyIntegers = JSON.parse(params.onlyintegers);
5782
5783        if (value === "" && (allowEmptyStrings ?? false) === true) {
5784            return true;
5785        }
5786
5787        var isNumeric = isValidNumber(value);
5788
5789        if (isNumeric && onlyIntegers) {
5790            isNumeric = isValidInteger(value);
5791        }
5792
5793        return isNumeric;
5794
5795    }, '');
5796
5797    jQuery.validator.unobtrusive.adapters.add(
5798        'localizedmultiplecompare', ["compareconditions"], function (options) {
5799            options.rules['localizedmultiplecompare'] = options.params;
5800            options.messages['localizedmultiplecompare'] = options.message;
5801        }
5802    );
5803
5804    jQuery.validator.addMethod('localizedmultiplecompare', function multiplecompare(value, element, params) {
5805
5806        function isConditionTrue(otherPropertyValue, actualValue, operator) {
5807
5808                switch (operator) {
5809                default:
5810                case "Equal":
5811                        return actualValue.localeCompare(otherPropertyValue) === 0;
5812                case "GreaterThan":
5813                        return actualValue.localeCompare(otherPropertyValue) > 0;
5814                case "GreaterThanOrEqual":
5815                        return actualValue.localeCompare(otherPropertyValue) >= 0;
5816                case "LessThan":
5817                        return actualValue.localeCompare(otherPropertyValue) < 0;
5818                case "LessThanOrEqual":
5819                        return actualValue.localeCompare(otherPropertyValue) <= 0;
5820                case "NotEqual":
5821                        return actualValue.localeCompare(otherPropertyValue) !== 0;
5822                }
5823            }
5824
5825            const jsonCompareConditions = params.compareconditions;
5826            const compareConditions = JSON.parse(jsonCompareConditions);
5827
5828            if (value === "" && (compareConditions.allowEmptyStrings ?? false) === true) {
5829                return true;
5830            }
5831
5832            var validationResult = true;
5833
5834            for (var i = 0; i < compareConditions.propertyConditions.length; i++) {
5835                var compareToPropertyName = compareConditions.propertyConditions[i].compareToPropertyName,
5836                    compareOperator = compareConditions.propertyConditions[i].operatorName,
5837                    compareServerValue = compareConditions.propertyConditions[i].compareServerValue,
5838                    serverValue = compareConditions.propertyConditions[i].serverValue,
5839                    errorMessage = compareConditions.propertyConditions[i].errorMessage;
5840
5841                var propertyValue;
5842
5843                if (compareServerValue === true) {
5844                    propertyValue = serverValue;
5845                }
5846                else {
5847                    var name = '[name=' + compareToPropertyName + ']';
5848                    var $form = $(element).closest('form');
5849                    var $control = $form.find(name);
5850
5851                    if ($control.attr("type") === 'radio' || $control.attr("type") === 'checkbox') {
5852                        propertyValue = $control.filter(':checked').val();
5853                    }
5854                    else {
5855                        propertyValue = $control.val();
5856                    }
5857                }
5858                
5859                if (propertyValue === "" && (compareConditions.allowEmptyCompareStrings ?? true) === true) {
5860                    continue;
5861                }
5862
5863                if (!isConditionTrue(propertyValue, value, compareOperator)) {
5864
5865                    this.settings.messages[element.name]['localizedmultiplecompare'] = errorMessage;
5866
5867                    validationResult = false;
5868                    break;
5869                }
5870            }
5871
5872            return validationResult;
5873
5874        }
5875        , '');
5876
5877    $.validator.addMethod("safestringvalidation", function (value, element, params) {
5878        if (!value) return true;
5879
5880        var dangerousPattern = /(\<[a-z!/?])|(&#)/ig;
5881        return !dangerousPattern.test(value);
5882    });
5883
5884    $.validator.unobtrusive.adapters.add("safestringvalidation", function (options) {
5885        options.rules["safestringvalidation"] = true;
5886        if (options.message) {
5887            options.messages["safestringvalidation"] = options.message;
5888        }
5889    });
5890
5891}(jQuery));
5892;
5893var xFormBlock = (function ($) {
5894
5895    //these need to be outside to run right off the bat, and this script must be loaded after jquery and unobtrusive validation scripts
5896    $.validator.unobtrusive.adapters.addBool("brequired", "required");
5897    $.validator.unobtrusive.parse();
5898
5899    var returnObject = {
5900        init: function () {
5901            this.self = this;
5902        },
5903        wireUp: function () {
5904            //$('table#id_matrix').each(function (index, element) {
5905            //    var $cbs = $(element).find('input[type=checkbox]');
5906
5907            //    if ($cbs.length === 0) {
5908            //        return;
5909            //    }
5910
5911            //    $cbs.each(function(index, checkbox) {
5912            //        var $hidden = $(checkbox).next();
5913            //        if (!$hidden.is('[type=hidden]')) {
5914            //            console.warn('Element after checkbox is not hidden, client-side validation might fail.');
5915            //            return;
5916            //        }
5917
5918            //        if ($(checkbox).is('[data-val]') && $(checkbox).is('[data-val-required]')) {
5919            //            $hidden.attr('data-val', $(checkbox).attr('data-val'));
5920            //            $hidden.attr('data-val-required', $(checkbox).attr('data-val-required'));
5921            //        }
5922            //    });
5923            //});
5924
5925            //$(document).on('submit', 'form.xform', function (event) {
5926            //    // We intercept the submit click and make an Ajax post instead
5927            //    var query = $(this).serialize();
5928            //    var action = $(this).attr('action');
5929            //    var form = $(this);
5930            //    $.ajax({
5931            //        url: action,
5932            //        data: query,
5933            //        method: 'POST'
5934            //    }).done(function (data) {
5935            //        var responseDiv = form.parent();
5936            //        responseDiv.html(data);
5937            //    });
5938            //    event.preventDefault();
5939            //    return false;
5940            //});
5941        }
5942    };
5943
5944    returnObject.init();
5945    return returnObject;
5946})(jQuery);;
5947tablet = {
5948    $header: $('.header__main'),
5949    $search: $('.header__search'),
5950    $searchButton: $('.header__mobile__search_button'),
5951    $onpagenav: $('aside.m--full .onpagenavigation'),
5952    $mobileNav: $('.header__mobile-menu__nav'),
5953    $menu_toggle: $('.menu-toggle'),
5954    searchToggled: false,
5955    pageNavToggled: false,
5956    $calendareventlist__filter: $('.calendareventlistpage .main-content .calendareventlist__filter'),
5957    $newsarchive__filter: $('.newsarchivepage .main-content .newsfilter'),
5958    $searchresult__filter: $('body.searchresultspage .result__list__wrapper .searchfilter'),
5959
5960    init: function () {
5961        this.$searchButton.on('click', this.onSearchClick);
5962        //ios might need this noop to enable touch and focusing, disabled until someone reports weird behaviour
5963        //$('label').click(app.noop);
5964
5965        this.$mobileNav.on('click', 'label', this.onNavLabelClick);
5966
5967        this.$mobileNav.on('click', 'button', this.onNavExpandClick);
5968
5969        this.$menu_toggle.on('click', this.onMenuToggleClick);
5970
5971        if (this.$onpagenav.length !== 0 && this.$onpagenav.find('h2').length !== 0) {
5972            this.$onpagenav.find('h2').on('click', this.onPageNavClick);
5973        }
5974
5975        if (this.$searchresult__filter.length !== 0) {
5976            this.$searchresult__filter.find('h2').on('click', this.onSearchFilterClick);
5977        }
5978
5979        if (this.$calendareventlist__filter.length !== 0) {
5980            this.$calendareventlist__filter.find('h2').on('click', this.onCalendarFilterClick);
5981        }
5982
5983        if (this.$newsarchive__filter.length !== 0) {
5984            this.$newsarchive__filter.find('button').on('click', this.onNewsFilterClick);
5985        }
5986    },
5987
5988    onNavExpandClick: function () {
5989        var self = $(this);
5990        var parent = self.parent();
5991
5992        if (parent.hasClass('open')) {
5993            parent.removeClass('open');
5994            self.attr('aria-expanded', "false");
5995        } else {
5996            parent.addClass('open');
5997            self.attr('aria-expanded', "true");
5998        }
5999        parent.focus();
6000    },
6001
6002    onSearchFilterClick: function () {
6003        tablet.$searchresult__filter.toggleClass('open');
6004    },
6005
6006    onCalendarFilterClick: function () {
6007        tablet.$calendareventlist__filter.toggleClass('open');
6008    },
6009
6010    onNewsFilterClick: function () {
6011        let button = tablet.$newsarchive__filter.find('#filtersearch-toggle');
6012        if (tablet.$newsarchive__filter.hasClass('open')) {
6013            tablet.$newsarchive__filter.removeClass('open');
6014            button.attr('aria-expanded', "false");
6015        } else {
6016            tablet.$newsarchive__filter.addClass('open');
6017            button.attr('aria-expanded', "true");
6018        }
6019    },
6020
6021    onPageNavClick: function (event) {
6022        tablet.$onpagenav.toggleClass('open');
6023    },
6024
6025    onSearchClick: function (event) {
6026        //if (tablet.menuOpened()) {
6027        //    tablet.$menu_toggle.prop('checked', false);
6028
6029        //    if (this.searchToggled) {
6030        //        $('.header__search input').focus();
6031        //        return;
6032        //    }
6033        //}
6034
6035        if (tablet.$menu_toggle.hasClass('expanded')) {
6036            tablet.$menu_toggle.attr('aria-expanded', "false");
6037            tablet.$menu_toggle.removeClass('expanded');
6038            tablet.$menu_toggle.parent().find('.header__mobile-menu__nav').css('display', 'none');
6039
6040            if (this.searchToggled) {
6041                $('.header__search input').focus();
6042                return;
6043            }
6044        }
6045
6046        this.searchToggled = !this.searchToggled;
6047        tablet.$searchButton.attr('aria-expanded', this.searchToggled);
6048
6049        tablet.$header.toggleClass('search-open');
6050        $('.header__search input').focus();
6051    },
6052
6053    onMenuToggleClick: function (event) {
6054        //if (tablet.menuOpened()) {
6055        //    $(this).attr('aria-expanded', "true");
6056        //    $(this).addClass('expanded');
6057        //} else {
6058        //    $(this).attr('aria-expanded', "false");
6059        //    $(this).removeClass('expanded');
6060        //}
6061        if ($(this).hasClass('expanded')) {
6062            $(this).attr('aria-expanded', "false");
6063            $(this).removeClass('expanded');
6064            $(this).parent().find('.header__mobile-menu__nav').css('display', 'none');
6065        } else {
6066            $(this).attr('aria-expanded', "true");
6067            $(this).addClass('expanded');
6068            $(this).parent().find('.header__mobile-menu__nav').css('display', 'block');
6069        }
6070    },
6071
6072    onNavLabelClick: function (event) {
6073        //ios safari 💔 
6074        $(this).parent().find('input').focus();
6075    },
6076
6077    //menuOpened: function () {
6078    //    //return this.$menu_toggle.is(':checked');
6079    //    var isExpanded = this.$menu_toggle.attr('aria-expanded');
6080    //    console.log(this.$menu_toggle.attr('aria-expanded'));
6081    //    return isExpanded;
6082    //}
6083};;
6084sidemenu = {
6085
6086    $mobileNav: $('.sidemenu__nav'),
6087
6088    init: function () {
6089
6090        this.$mobileNav.on('click', 'label', this.onNavLabelClick);
6091
6092        this.$mobileNav.on('click', 'button', this.onNavExpandClick);
6093
6094
6095    },
6096
6097    onNavExpandClick: function () {
6098        var self = $(this);
6099        var parent = self.parent();
6100
6101        if (parent.hasClass('open')) {
6102            parent.removeClass('open');
6103            self.attr('aria-expanded', "false");
6104        } else {
6105            parent.addClass('open');
6106            self.attr('aria-expanded', "true");
6107        }
6108        parent.focus();
6109    },
6110
6111    onNavLabelClick: function (event) {
6112        //ios safari 💔 
6113        $(this).parent().find('input').focus();
6114    },
6115
6116
6117};;
6118(function(c){c.fn.stupidtable=function(b){return this.each(function(){var a=c(this);b=b||{};b=c.extend({},c.fn.stupidtable.default_sort_fns,b);a.data("sortFns",b);a.on("click.stupidtable","thead th",function(){c(this).stupidsort()})})};c.fn.stupidsort=function(b){var a=c(this),g=0,f=c.fn.stupidtable.dir,e=a.closest("table"),k=a.data("sort")||null;if(null!==k){a.parents("tr").find("th").slice(0,c(this).index()).each(function(){var a=c(this).attr("colspan")||1;g+=parseInt(a,10)});var d;1==arguments.length?
6119d=b:(d=b||a.data("sort-default")||f.ASC,a.data("sort-dir")&&(d=a.data("sort-dir")===f.ASC?f.DESC:f.ASC));e.trigger("beforetablesort",{column:g,direction:d});e.css("display");setTimeout(function(){var b=[],l=e.data("sortFns")[k],h=e.children("tbody").children("tr");h.each(function(a,e){var d=c(e).children().eq(g),f=d.data("sort-value");"undefined"===typeof f&&(f=d.text(),d.data("sort-value",f));b.push([f,e])});b.sort(function(a,b){return l(a[0],b[0])});d!=f.ASC&&b.reverse();h=c.map(b,function(a){return a[1]});
6120e.children("tbody").append(h);e.find("th").data("sort-dir",null).removeClass("sorting-desc sorting-asc");a.data("sort-dir",d).addClass("sorting-"+d);e.trigger("aftertablesort",{column:g,direction:d});e.css("display")},10);return a}};c.fn.updateSortVal=function(b){var a=c(this);a.is("[data-sort-value]")&&a.attr("data-sort-value",b);a.data("sort-value",b);return a};c.fn.stupidtable.dir={ASC:"asc",DESC:"desc"};c.fn.stupidtable.default_sort_fns={"int":function(b,a){return parseInt(b,10)-parseInt(a,10)},
6121"float":function(b,a){return parseFloat(b)-parseFloat(a)},string:function(b,a){return b.localeCompare(a)},"string-ins":function(b,a){b=b.toLocaleLowerCase();a=a.toLocaleLowerCase();return b.localeCompare(a)}}})(jQuery);
6122;
6123var highlighter = (function ($) {
6124    var returnObject = {
6125        init: function () {
6126            this.self = this;
6127        },
6128
6129        wireUp: function () {
6130            // Constant for query string parameter
6131            const QUERY_PARAM = 'hl';
6132
6133            // Get the query string parameter value
6134            const urlParams = new URLSearchParams(window.location.search);
6135            const searchText = urlParams.get(QUERY_PARAM);
6136            if (!searchText) {
6137                return;
6138            }
6139
6140            // Highlights one or multiple search terms from the 'hl' qeury params
6141            const searchTerms = searchText
6142                .split(',')
6143                .map(term => term.trim())
6144                .filter(term => term.length > 0);
6145            if (!searchTerms.length) {
6146                return;
6147            }
6148            
6149            // Create a regular expression for the search text with case insensitivity
6150            const searchRegex = new RegExp(`(${searchTerms.join('|')})`, 'gi');
6151
6152            // Function to recursively collect all text nodes
6153            const textNodes = [];
6154            (function getTextNodes(node) {
6155                if (node.nodeType === Node.TEXT_NODE) {
6156                    textNodes.push(node);
6157                } else {
6158                    for (let child of node.childNodes) {
6159                        getTextNodes(child);
6160                    }
6161                }
6162            })(document.body);
6163
6164            // Wrap the matching text in a span and handle accordions
6165            textNodes.forEach(textNode => {
6166                const parent = textNode.parentNode;
6167                const textContent = textNode.textContent;
6168                if (searchRegex.test(textContent)) {
6169                    // Wrap the searchText in a span with the highlight class
6170                    const highlightedHTML = textContent.replace(searchRegex, match => `<span class="highlight">${match}</span>`);
6171                    // Temporary div to parse the highlighted HTML
6172                    const tempDiv = document.createElement('div');
6173                    tempDiv.innerHTML = highlightedHTML;
6174                    // Insert the new nodes and remove the old text node
6175                    while (tempDiv.firstChild) {
6176                        parent.insertBefore(tempDiv.firstChild, textNode);
6177                    }
6178                    parent.removeChild(textNode);
6179
6180                    // If inside an accordion-collapse, make the accordion visible
6181                    const accordionCollapse = parent.closest('.accordion-collapse');
6182                    if (accordionCollapse) {
6183                        accordionCollapse.classList.add('show');
6184
6185                        // Find the control element associated with the accordion
6186                        const accordionId = accordionCollapse.id;
6187                        const controlElement = document.querySelector(`[aria-controls="${accordionId}"]`);
6188                        if (controlElement) {
6189                            controlElement.classList.remove('collapsed');
6190                            controlElement.setAttribute('aria-expanded', 'true');
6191                        }
6192                    }
6193                }
6194            });
6195        }
6196    };
6197
6198    returnObject.init();
6199    return returnObject;
6200})(jQuery);;
6201var gdprrequestwithelegPage = (function ($) {
6202    var returnObject = {
6203        init: function () {
6204            this.self = this;
6205        },
6206        wireUp: function () {
6207
6208            $(document).on("submit", "#gdprrequestwitheleg-form", function (event) {               
6209                $('button[type=submit], input[type=submit]').prop('disabled', true);
6210           
6211            });           
6212
6213        }
6214    };
6215    
6216    returnObject.init();
6217    return returnObject;
6218})(jQuery);
6219
6220
6221
6222
6223
6224;
6225var eLegPage = (function ($) {
6226    var qrCodeIntervalHandler;
6227    var dateqrCodeStart = new Date();
6228    var counter = 0;
6229    var finalCallMade = false;
6230
6231    var returnObject = {
6232
6233        init: function () {
6234            this.self = this;
6235        },
6236        wireUp: function () {
6237
6238            if (Modernizr.history && $('#elegitimation-selectloginpage-form').length) {
6239                $(window).on('popstate', function (e) {
6240                    if (history.state) {
6241                        updateContent(history.state);
6242                    }
6243                });
6244
6245                $(document).ready(function () {
6246                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
6247
6248
6249                    $(document).on('click', '#btnMobileBankId', function (e) {
6250                        $('#useMobileBankId').val(true);
6251                        $('#useBankId').val(false);
6252                        $('#useForeignId').val(false);
6253                        selectLogin(false);
6254                    });
6255
6256
6257                    $(document).on('click', '#btnBankId', function (e) {
6258                        $('#useBankId').val(true);
6259                        $('#useMobileBankId').val(false);
6260                        $('#useForeignId').val(false);
6261                        selectLogin(false);
6262                    });
6263
6264                    $(document).on('click', '#btnForeignId', function (e) {
6265                        $('#useForeignId').val(true);
6266                        //selectLogin(false);
6267                        $('#elegitimation-selectloginpage-form').attr("action", "selectlogin");
6268                        $('#elegitimation-selectloginpage-form').trigger("submit");
6269                    });
6270
6271                    function selectLogin(isRestart) {
6272                        var form = $('#elegitimation-selectloginpage-form');
6273                        var serialized = $(form).serialize();
6274                        if (isRestart == true) {
6275                            serialized = 'UseMobileBankId=' + $('#useMobileBankId').val() + '&RedirectUrl=' + $('#redirectUrl').val();
6276                        }
6277
6278
6279                        var action = $(form).attr('action');
6280                        $.ajax({
6281                            url: action,
6282                            method: 'POST',
6283                            data: serialized,
6284                            success: function (data) {
6285                                $('#BankIdMessage').html(data);
6286                                //console.log('done selectLogin call initializeLogin');
6287                                initializeLogin();
6288                            },
6289                            error: function (xhr) {
6290                                //console.log(xhr.statusText);
6291                                $('#bankIdError').text(xhr.statusText);
6292                                //console.log('collectStatus fail, stop intervals.');
6293                                stopIntervals();
6294                            }
6295                        });
6296                    }
6297
6298
6299                    //initialize the loop
6300                    function initializeLogin() {
6301                        counter++;
6302
6303                        if ($('#useMobileBankId').val() == 'True') {
6304                            refreshQrCode();
6305                            refreshCollectStatus();
6306                        }
6307                        else if ($('#useBankId').val() == 'True') {
6308                            //console.log('use bankid, initialize collect');
6309                            //open bankid current device
6310                            let autoStartToken = $('#autoStartToken').val();
6311                            //bankid url
6312                            scheme = (isAndroid() || isIOS()) ? "https://app.bankid.com/" : "bankid:///";
6313                            window.location.href = `${scheme}?autostarttoken=${autoStartToken}&redirect=${null}`;
6314
6315                            refreshCollectStatus();
6316                        }
6317                    }
6318
6319                    function refreshQrCode() {
6320                        //this will wait 1 second and then fire the load function
6321                        //console.log('start refreshQrCode');
6322                        dateqrCodeStart = Date.now();
6323                        qrCodeIntervalHandler = setInterval(function () {
6324                            loadQrCode();
6325                        }, 1000);
6326                    }
6327
6328                    function loadQrCode() {
6329                        if (exceededTimeLimit()) {
6330                            clearInterval(qrCodeIntervalHandler);
6331                            return;
6332                        }
6333                        //eLegitimationLogInPage/refreshQr
6334                        var form = $('#bankid-qrcode-form');
6335                        var serialized = $(form).serialize();
6336                        var action = $(form).attr('action');
6337
6338                        $.ajax({
6339                            url: action,
6340                            method: 'POST',
6341                            data: serialized,
6342
6343                            success: function (data) {
6344                                $('#partialQr').html(data);
6345                            },
6346                            error: function (e) {
6347                                $('#qrErrorDiv').removeClass('qrmessage').addClass('qr'); 
6348                                $('#qrError').text("Misslyckades att hämta qrkod.");
6349                                //console.log('loadQr fail, stop intervals');
6350                                stopIntervals();
6351                            }
6352                        });
6353                    }
6354
6355                    function exceededTimeLimit() {
6356                        var timeDiff = new Date() - dateqrCodeStart; //in ms
6357                        // strip the ms
6358                        timeDiff /= 1000;
6359
6360                        // get seconds 
6361                        var seconds = Math.round(timeDiff);
6362                        return seconds > 90;
6363                    }
6364                    function stopIntervals() {
6365                        clearInterval(qrCodeIntervalHandler);
6366                    }
6367
6368                    function refreshCollectStatus() {
6369                        //console.log('start refreshCollectStatus');
6370                        collectStatus();
6371                    }
6372                    async function collectStatus() {
6373                        //console.log('COLLECTSTATUS ISMOBILE: ' + $('#useMobileBankId').val());
6374                        //console.log('ORDERREF: ' + $('#orderRef').val());
6375
6376                        if (exceededTimeLimit()) {
6377                            return;
6378                        }
6379
6380                        var isMobile = $('#useMobileBankId').val();
6381                        var form = $('#bankid-status-form');
6382                        var serialized = $('#bankid-status-form').serialize();
6383
6384                        var action = $(form).attr('action');
6385
6386                        $.ajax({
6387                            url: action,
6388                            method: 'POST',
6389                            data: serialized,
6390                            Headers: { Accept: 'application/json' },
6391
6392                            success: function (data) {
6393                                if (data == 202) {
6394                                    RedirectAfterCompletedLogin($('#redirectUrl2').val());
6395                                    //$('#elegStatus').html("");
6396                                }
6397                                else {
6398                                    $('#elegStatus').html(data); // to be able to get value of collectFailed below, we must first render data.
6399                                    //console.log('collectFailed: ' + $('#collectFailed').val());
6400                                    if (isMobile != "True") {
6401                                        //when on same device, always show message
6402                                        $('#collectMessage').text($('#collectMsg').val());
6403                                    }
6404                                    if ($('#collectFailed').val() != 'True') {
6405
6406                                        //keep calling every 2 seconds                                                              
6407                                        setTimeout(collectStatus, 2000);
6408                                    }
6409                                    else {
6410                                        if (ShouldRestart(isMobile) == true) {
6411                                            return Restart();
6412                                        }
6413                                        else {
6414                                            //console.log('collectMsg värde: ' + $('#collectMsg').val());
6415                                            //show collect fail message from hidden collectMsg field
6416                                            $('#collectMessage').text($('#collectMsg').val());
6417                                            
6418                                            if (finalCallMade == false) {
6419                                                setTimeout(collectStatus, 5000); //give time to read message, then get final session timeout message
6420                                                finalCallMade = true;
6421                                                stopIntervals();
6422                                            }                                           
6423                                        }                                            
6424                                    }
6425
6426                                }
6427                            },
6428                            error: function (xhr, textStatus) {
6429                                stopIntervals();
6430                                $('#BankidSpinner').text("");
6431                                $('#collectMessage').text(xhr.statusText);
6432                                $('#collectError').text(xhr.statusText);
6433                                //console.log('collectStatus fail, stop intervals. ' + textStatus);
6434                            }
6435                        });
6436
6437                    }
6438
6439                    function ShouldRestart(isMobile) {
6440                        return finalCallMade == false && counter < 3 && isMobile == "True";
6441                    }
6442                    function RedirectAfterCompletedLogin(urlToRedirect) {                                                
6443                        window.location.replace(urlToRedirect);
6444                    }
6445
6446                    function Restart() {
6447                        $('#orderRef').val('');
6448                        stopIntervals();
6449                        selectLogin(true);
6450                    }
6451
6452                    function isAndroid() {
6453                        //todo how do we find out?
6454                        let isExisting = /android/.test(getUAString());
6455
6456                        return isExisting;
6457                    }
6458                    function isIOS() {
6459                        let isExisting = /iP(hone|od|ad)/.test(getUAString());
6460
6461                        return isExisting;
6462                    }
6463                    function getUAString() {
6464                        let uaData = navigator.userAgentData;
6465                        if (undefined !== uaData && null !== uaData && uaData.brands) {
6466                            return uaData.brands.map(item => item.brand + '/' + item.version).join(' ');
6467                        }
6468                        return navigator.userAgent;
6469                    }
6470
6471                    $(document).on('click', '#cancel', function (e) {
6472                        stopIntervals();
6473                        var form = $('#bankid-cancel-form');
6474                        var serialized = $(form).serialize();
6475                        var action = $(form).attr('action');
6476
6477                        $.ajax({
6478                            url: action,
6479                            method: 'POST',
6480                            data: serialized,
6481                        }).done(function (data) {
6482                            $('#BankIdMessage').html(data);
6483
6484                        });
6485                        return false;
6486                    });
6487
6488                });
6489
6490            }
6491
6492        }
6493    };
6494
6495
6496    returnObject.init();
6497    return returnObject;
6498})(jQuery)
6499
6500
6501
6502;
6503var eLeveransPage = (function ($) {
6504    var returnObject = {
6505        init: function () {
6506            this.self = this;
6507        },
6508        wireUp: function () {
6509
6510            if (Modernizr.history && $('#eleverans-page').length) {
6511                $(window).on('popstate', function (e) {
6512                    if (history.state) {
6513                        updateContent(history.state);
6514                    }
6515                });
6516
6517                $(document).ready(function () {
6518                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
6519                });
6520
6521                $(document).on('click', '#open-file-link', function (event) {
6522                    window.open(event.target.href, '_blank');
6523                    //alert(event.target.href);
6524                    event.preventDefault();
6525                    return false;
6526                });
6527
6528                //$(document).on('submit', '#eleverans-form', function (event) {
6529                //    var form = $('#eleverans-form');
6530                //    var query = $(form).serialize();
6531                //    var action = $(form).attr('action');
6532                //    history.pushState({ urlPath: action + '?' + query, method: 'POST' }, $(document).attr('title'), action + '?' + query);
6533                //    updateContent(history.state);
6534                //    event.preventDefault();
6535                //    return false;
6536                //});
6537
6538                var loadAjaxContent = function (target, urlBase, method) {
6539                    //$('#eleverans-form i').show();
6540                    $.ajax({
6541                        url: urlBase,
6542                        method: method
6543                    }).done(function (data) {
6544
6545                        //var table = $('.result').find('table');
6546
6547                        //if (table.length) {
6548                        //    var result = $(data).find('.result tbody');
6549                        //    table.find('tbody').remove();
6550                        //    table.find('thead').after(result);
6551
6552                        //    var paginationResult = $(data).find('.pagination');
6553                        //    var paginationContainer = $('.pager').find('.pagination-container');
6554
6555                        //    paginationContainer.find('.pagination').remove();
6556                        //    paginationContainer.append(paginationResult);
6557
6558                        //} else {
6559                        $(target).html($(data));
6560                        //}
6561
6562                        InitResponsiveTables(target);
6563                        //$('#eleverans-form i').hide();
6564                    }).fail(function (data) {
6565                        //console.log(data);
6566                    });
6567                };
6568
6569                var updateContent = function (state) {
6570                    loadAjaxContent('#main', state.urlPath, state.method);
6571                };
6572
6573                var removeSelectedfilters = function() {
6574                    var table = $('.result').find('table th a').removeClass('selected');
6575                };
6576
6577                $(document).on('click', 'a.ajaxlink', function (event) {
6578                    var href = $(this).attr('href');
6579                    var title = $(document).attr('title');
6580
6581                    if ($(this).closest('thead').length) {
6582                        removeSelectedfilters();
6583                        $(this).addClass('selected');
6584                    }
6585
6586                    history.pushState({ urlPath: href, method: 'POST' }, title, href);
6587                    updateContent(history.state);
6588                    event.preventDefault();
6589                    return false;
6590                });
6591            }
6592        }
6593    };
6594
6595    returnObject.init();
6596    return returnObject;
6597})(jQuery);;
6598var minderarigApplicationPage = (function ($) {
6599    var returnObject = {
6600        init: function () {
6601            this.self = this;
6602        },
6603        wireUp: function () {
6604
6605            $("#noclick").on('click', function () {
6606                return false;
6607            });
6608
6609
6610
6611
6612            if (Modernizr.history && $('#minderarig-application-form').length) {
6613                $(window).on('popstate', function (e) {
6614                    if (history.state) {
6615                        updateContent(history.state);
6616                    }
6617                });
6618
6619                $(document).ready(function () {
6620                    
6621                    //Disable validering på fält som inte är synliga
6622                    $("#minderarig-application-form").data("validator").settings.ignore = ".ignore, :hidden";                    
6623
6624
6625                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
6626
6627                    $('#skyddsombud').prop('checked', false); // Unchecks it
6628
6629                });
6630
6631                $('form').submit(function (e) {
6632                    if (!$(this).valid()) {
6633
6634                        $(".validation-summary-errors").attr('role', 'alert');
6635                        $(".validation-summary-errors").attr("tabindex", -1).focus();
6636
6637                        return false;
6638
6639                    }
6640                });
6641
6642
6643                // INPUT File
6644
6645                $('.inputfile').each(function () {
6646                    var $input = $(this);
6647                    var $label = $input.next('label');
6648                    var labelVal = $label.next('span').html();
6649
6650                    $input.on('change', function (e) {
6651                        var fileName = '';
6652                        if (e.target.value) fileName = e.target.value.split('\\').pop();
6653                        if (fileName) {
6654                            $label.next('span').html(fileName);
6655
6656                            //Namn och födelsedatum är inte längre obligatorsikt uppgift, när man valt att ladda upp en deltagarlista.
6657                            $('.namn').rules('add', {
6658                                required: false
6659                            });
6660
6661                            $('.fodelsedatum').rules('add', {
6662                                required: false
6663                            });
6664
6665                            if (fileName !== "Ingen fil har valts.") {
6666                                $("." + $input.attr("id") + "Clear").show();
6667                                $("." + $input.attr("id") + "Clear").removeClass("rs_skip");
6668
6669                                $("#" + $input.attr("id") + "Next").show();
6670                                $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
6671                            }
6672                        }
6673                        else
6674                            $label.next('span').html(labelVal);
6675                    });
6676
6677
6678                    // Firefox bug fix
6679                    $input
6680                        .on('focus', function () { $input.addClass('has-focus'); })
6681                        .on('blur', function () { $input.removeClass('has-focus'); });
6682                });
6683
6684                $('input:radio').on("click", function () {
6685                    var n = this.name;
6686                    $("input[name='" + n + "']").removeClass("input-validation-error");
6687                });
6688
6689                $(document).on('click', '.GetCompanies', function (e) {
6690                    var form = $('#minderarig-application-form');
6691                    var query = $(form).serialize();
6692
6693                    var action = $(form).attr('action');
6694                    $('.spinner').show('inline-block');
6695                    $.ajax({
6696                        url: action + '?' + query + '&GetCompany=SearchCompany',
6697                        method: 'POST'
6698                    }).done(function (data) {
6699                        $('#SearchCompany').html(data);
6700                        
6701                    });
6702                    $('.spinner').hide();
6703                    return false;
6704                });
6705
6706
6707
6708                $(document).on('change', '#skyddsombud', function (e) {
6709
6710                    if ($("#skyddsombud").is(':checked')) {
6711
6712                        $("#skyddsombudfields").hide();
6713                    }
6714                    else {
6715                        $("#skyddsombudfields").show();
6716                    }
6717
6718                    
6719                });
6720
6721
6722                $(document).on('click', '.Fil1Clear', function (e) {
6723
6724                    var id = this.id.replace("Clear","");
6725                    var fileTextDiv = document.getElementById(id + "Filename");
6726
6727                    fileTextDiv.textContent = "Ingen fil har valts.";
6728                    $("#" + id).replaceWith($("#" + id).val('').clone(true));
6729
6730                    $("." + id + "Clear").hide();
6731                    $("." + id + "Clear").addClass("rs_skip");
6732
6733                    $('.namn').rules('add', {
6734                        required: true
6735                    });
6736                    $('.fodelsedatum').rules('add', {
6737                        required: true
6738                    });
6739
6740                    return false;
6741                });
6742
6743                $(document).on('click', '.GetNewCompanies', function (e) {
6744
6745                    var form = $('#minderarig-application-form');
6746                    var query = $(form).serialize();
6747
6748                    var action = $(form).attr('action');
6749                    $('.spinner').show('inline-block');
6750                    $.ajax({
6751                        url: action + '?' + query + '&GetCompany=SearchNewCompany',
6752                        method: 'POST'
6753                    }).done(function (data) {
6754                        $('#SearchCompany').html(data);
6755                        
6756                    });
6757
6758                    $('.spinner').hide();
6759                    return false;
6760                });
6761
6762                $(document).on('click', 'a.remove-affected-people', function (event) {
6763                    // We must keep at least one, since it's a required field.
6764                    if ($('#minderariga-deltagare .affected-row').length > 1) {
6765                        $(this).closest('.affected-row').remove();
6766                    }
6767                    event.preventDefault();
6768                    return false;
6769                });
6770
6771            }
6772        }
6773    };
6774
6775    returnObject.init();
6776    return returnObject;
6777})(jQuery);
6778
6779;
6780let postingApplicationPage = (function ($) {
6781    let returnObject = {
6782        init: function () {
6783            this.self = this;
6784        },
6785        wireUp: function () {
6786            require(['vendor/popper'], function (popper) {
6787                if ($('.postingapplicationpage').length || $('.postingarticlepage').length) {
6788                    postingApplicationPage.fixTruncatedOptionsIPhone();
6789
6790                    if ($("#posting-add-company-form").length) {
6791                        postingApplicationPage.submitTimer($("posting-add-company-form"), 10000);
6792                    }
6793
6794                    // Remove added persons posting-add-person-form
6795                    if ($("#posting-add-person-form").length) {
6796
6797                        // remove person from list func
6798                        $(document).on('click',
6799                            'a.remove-person',
6800                            function (event) {
6801                                // We must keep at least one, since it's a required field.
6802                                if ($('#posting-application-postedemployees .div-row').length > 1) {
6803                                    $(this).closest('.div-row').remove();
6804                                }
6805                                event.preventDefault();
6806                                return false;
6807                            });
6808
6809                        // Init typeahead posted emplyee suggestions
6810                        require(['postingapplicationsearchperson'], function (postingapplicationsearch) {
6811                            postingapplicationsearch.init();
6812                        });
6813                    }
6814
6815                    if ($("#posting-add-ordercompany-form").length) {
6816                        require(['postingapplicationsearch'], function (postingapplicationsearch) {
6817                            postingapplicationsearch.init();
6818                        });
6819                    }
6820
6821                    if ($("#posting-add-place-form").length) {
6822                        require(['postingapplicationsearchplace2'], function (postingapplicationsearch) {
6823                            postingapplicationsearch.init();
6824                        });
6825                    }
6826
6827                    if ($("#posting-add-contact-form").length || $("#posting-edit-contact-form").length) {
6828                        require(['postingapplicationsearchcontact'], function (postingapplicationsearch) {
6829                            postingapplicationsearch.init();
6830                        });
6831                    }
6832
6833                    // Drop down presentor industy code
6834                    if ($("#posting-add-person-form").length) {
6835                        postingApplicationPage.industyCodeHighlighter();
6836                        postingApplicationPage.copyIndustyToAllRows();
6837
6838                        const rowCount = $('#posting-application-postedemployees .div-row').length;
6839                        // If there is only one .div-row, hide the button with the class copyindustry
6840                        if (rowCount === 1) {
6841                            $('.copynrg-div').hide();
6842                        }
6843                    }
6844
6845                    if ($("#posting-add-inteval-form").length) {
6846                        postingApplicationPage.copyDateToAllRows();
6847                    }
6848
6849                    // Posting type (hired employees)
6850                    if ($("#posting-add-postingtype-form").length) {
6851
6852                        // Main default (if any)
6853                        let startValue = $("#MainPostingTypeDefualt")[0].value;
6854                        if (startValue !== null && startValue !== "0" && startValue !== "") $("select[id='MainSituation']").val($("#MainPostingTypeDefualt")[0].value);
6855
6856                        if ($("#MainSituation")[0].value === "0" || $("#MainSituation")[0].value === "" || $("#MainSituation")[0].value === null) {
6857                            $("select[id^='PostedEmployeesInsert_']").prop("disabled", true);
6858                        }
6859
6860                        $("#MainSituation").change(function (event) {
6861                            if ($("#MainSituation")[0].selectedIndex && $("#MainSituation")[0].selectedIndex !== 0) {
6862
6863                                $("select[id^='PostedEmployeesInsert_']").prop("disabled", false);
6864                                $("select[id^='PostedEmployeesInsert_']").val($("#MainSituation")[0].value);
6865                            }
6866                        });
6867                    }
6868
6869                    // fix tab problem
6870                    let tabs = $('.tabs').accessibleTabs({
6871                        tabhead: '.tabh',
6872                        tabbody: '.tabbody',
6873                        fx: 'show',
6874                        fxspeed: 'fast'
6875                    });
6876
6877                    if ($("#ViewPrivate").val() === "True") {
6878                        tabs.showAccessibleTab(1);
6879                    }
6880
6881                    // Substitute link...add font awesome
6882                    $('.substituteLink').prepend("<span class='fa fa-lg fa-chevron-circle-down' role='img' aria-label='Replaced'></span>");
6883
6884                    $(".substituteLink").on('click', function () {
6885                        // toggle chevron
6886                        $(this).find('span').toggleClass('fa-chevron-circle-down fa-chevron-circle-up');
6887                        // remove substitutes and add hidden replace tr
6888                        if ($(this).parent().parent().next().hasClass('substituteRow')) {
6889                            $(this).parent().parent().next().nextUntil('[id^=employee-]').andSelf().remove();
6890                            let temp = $(this).parent().parent().attr('id').substring(9, 50);
6891                            $('<tr id="substitues-' + temp + '" style="display:none"><td colspan="5"></td></tr>').insertAfter($(this).closest('tr'));
6892                            return false;
6893                        }
6894                    });
6895
6896                    // Filter/Search
6897                    $("#filter").on("keyup", function () {
6898                        let value = $(this).val().toLowerCase();
6899                        $('tbody tr[id^="employee-"]').filter(function () {
6900                            $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1);
6901                        });
6902
6903                        // expandera alla om filter innehåller tecken
6904                        $(".tabh").attr('aria-expanded', "true");
6905                        $(".tabh").closest('.tab').addClass('expanded');
6906
6907                        //Hide substitutes
6908                        $('div .expandablefield tr[class*="substituteRow"]').hide();
6909                        $('.substituteLink span').each(function (index, element) {
6910                            $(element).addClass('fa-chevron-circle-down');
6911                            $(element).removeClass('fa-chevron-circle-up');
6912                        });
6913
6914                        // kolla om det finns arbetstagare kvar på företaget. Om inte göm.
6915                        $('div .expandablefield').each(function () {
6916                            if ($(this).find('tr[id^="employee-"]:not([style*="display: none"])').length < 1) { $(this).hide() }
6917                            else { $(this).show() }
6918                        });
6919                    });
6920
6921                    // Sort table
6922                    $('th').on('click', function () {
6923                        // Remove all substitue when sorting & remove all replaceid tag
6924                        $('.substituteRow').remove();
6925                        $('[id^=substitues-]').remove();
6926
6927                        let table = $(this).parents('table').eq(0);
6928                        let rows = table.find('tr:gt(0)').toArray().sort(comparer($(this).index()));
6929                        this.asc = !this.asc;
6930                        if (!this.asc) {
6931                            rows = rows.reverse();
6932                        }
6933                        for (const element of rows) {
6934                            table.append(element);
6935                            table.append('<tr id="substitues-' + element.i
6935d.substring(9, 50) + '" style="display:none"><td colspan=5></td></tr>');
6936                        }
6937                    });
6938
6939                    // Sort table comparer
6940                    function comparer(index) {
6941                        return function (a, b) {
6942                            let valA = getCellValue(a, index), valB = getCellValue(b, index);
6943                            return $.isNumeric(valA) && $.isNumeric(valB) ? valA - valB : valA.toString().localeCompare(valB);
6944                        }
6945                    }
6946
6947                    // Sort table get cell value
6948                    function getCellValue(row, index) { return $(row).children('td').eq(index).text() }
6949
6950                    // Info boxes
6951                    $('.info-btn').each(function (e) {
6952                        if (!$(this).prev().hasClass('inline')) {
6953                            $(this).prev().addClass('inline');
6954                            if ($(this).css('display') === 'none')
6955                                $(this).css('display', 'inline-block');
6956                            else
6957                                $(this).css('display', 'none');
6958                            let listBoxLabel = $(this).parent().find('.listbox-area > .left-area > span');
6959                            if (listBoxLabel.length > 0)
6960                                $(listBoxLabel).remove();
6961                            // Do popper stuff
6962                            $(this).on('click keypress', function (e) {
6963                                if (e.type === 'keypress') {
6964                                    let key = e.charCode || e.keyCode;
6965                                    if (key !== 32 && key !== 13)
6966                                        return;
6967                                }
6968                                e.preventDefault();
6969                                let infoDiv = $(this).next()[0];
6970                                $(infoDiv).toggle();
6971                                popper.createPopper($(this)[0], infoDiv, {
6972                                    placement: 'top',
6973                                    modifiers: [
6974                                        {
6975                                            name: 'offset',
6976                                            options: {
6977                                                offset: [0, 10]
6978                                            }
6979                                        }
6980                                    ]
6981                                });
6982                            });
6983                            $(this).on('blur', function (e) {
6984                                e.preventDefault();
6985                                let infoDiv = $(this).next()[0];
6986                                $(infoDiv).hide();
6987                            });
6988                        }
6989                    });
6990
6991                    // main menu
6992                    let menutoggle = $('#menu-toggle')[0];
6993                    let mainmenu = $('#menu-div')[0];
6994                    let menuclose = $('#menu-close')[0];
6995                    const menuIsOpen = mainmenu.classList.contains('is-open');
6996
6997                    function closeMenu() {
6998                        mainmenu.classList.remove('is-open');
6999                        mainmenu.setAttribute('aria-hidden', 'true');
7000                        mainmenu.setAttribute('inert', '');
7001
7002                        // focus trap + scroll
7003                        disableFocusTrap();
7004                        unlockBodyScroll();
7005
7006                        // återställ fokus till där användaren var (oftast togglen)
7007                        if (lastFocusedElement) {
7008                            lastFocusedElement.focus();
7009                            lastFocusedElement = null;
7010                        }
7011
7012                        $(menutoggle).find('>:first-child')
7013                            .removeClass('expanded')
7014                            .addClass('collapsed');
7015                        $(menutoggle).attr('aria-expanded', 'false');
7016                    }
7017
7018                    function openMenu() {
7019                        lastFocusedElement = document.activeElement;
7020                        mainmenu.classList.add('is-open');
7021                        mainmenu.setAttribute('aria-hidden', 'false');
7022                        mainmenu.removeAttribute('inert');
7023
7024                        // scroll-lock + focus trap
7025                        lockBodyScroll();
7026                        enableFocusTrap();
7027
7028                        // sätt fokus på stäng-knappen
7029                        $(menuclose).focus();
7030
7031                        $(menutoggle).find('>:first-child')
7032                            .addClass('expanded')
7033                            .removeClass('collapsed');
7034                        $(menutoggle).attr('aria-expanded', 'true');
7035                    }
7036
7037                    $(menutoggle).on('click keyup', function (e) {
7038                        if (e.type === 'keyup') {
7039                            let key = e.charCode || e.keyCode;
7040                            if (key !== 32) return;
7041                        }
7042
7043                        e.preventDefault();
7044
7045                        if (menuIsOpen) {
7046                            closeMenu();
7047                        } else {
7048                            openMenu();
7049                        }
7050                    });
7051
7052                    $(menuclose).on('click keyup', function (e) {
7053                        if (e.type === 'keyup') {
7054                            let key = e.charCode || e.keyCode;
7055                            if (key !== 27) return;
7056                        }
7057
7058                        e.preventDefault();
7059                        closeMenu();
7060                    });
7061
7062                    // Stäng meny via esc-knappen
7063                    $(document).on('keydown', function (e) {
7064                        if (e.key === 'Escape' || e.keyCode === 27) {
7065                            if (menuIsOpen) {
7066                                e.preventDefault();
7067                                closeMenu();
7068                            }
7069                        }
7070                    });
7071
7072                    // Stäng meny om man klickar utanför meny
7073                    $(document).on('click', function (e) {
7074                        const menuIsOpen = mainmenu.classList.contains('is-open');
7075                        if (!menuIsOpen) return;
7076
7077                        const $target = $(e.target);
7078
7079                        if (
7080                            !$target.closest('.menu').length &&
7081                            !$target.closest(menutoggle).length
7082                        ) {
7083                            closeMenu();
7084                        }
7085                    });
7086
7087                    // Toggle menu items
7088                    const accordionToggles = document.querySelectorAll('[aria-controls]');
7089
7090                    function updateAriaExpanded(toggle, target) {
7091                        const isOpen = target.getAttribute('aria-hidden') !== 'true';
7092                        toggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
7093                    }
7094
7095                    accordionToggles.forEach(toggle => {
7096                        const targetId = toggle.getAttribute('aria-controls');
7097                        const target = document.getElementById(targetId);
7098
7099                        if (!target) return;
7100
7101                        target.setAttribute('aria-hidden', 'true');
7102                        target.setAttribute('inert', '');
7103                        updateAriaExpanded(toggle, target);
7104
7105                        toggle.addEventListener('click', () => {
7106                            const isOpen = target.getAttribute('aria-hidden') !== 'true';
7107
7108                            target.setAttribute('aria-hidden', isOpen ? 'true' : 'false');
7109
7110                            if (isOpen) {
7111                                target.setAttribute('inert', '');
7112                            } else {
7113                                target.removeAttribute('inert');
7114                            }
7115
7116                            updateAriaExpanded(toggle, target);
7117                        });
7118                    });
7119
7120                    let lastFocusedElement = null;
7121
7122                    function lockBodyScroll() {
7123                        // iOS-säkert: lås scroll genom att fixa body och behålla position
7124                        scrollY = window.scrollY || document.documentElement.scrollTop;
7125                        $('body').addClass('menu-open')
7126                    }
7127
7128                    function unlockBodyScroll() {
7129                        $('body').removeClass('menu-open')
7130                    }
7131
7132                    // Tillgänglighet: Tab-loop i mobil för att hindra användaren att tabba bakom menyn
7133                    function getFocusableElements($container) {
7134                        return $container
7135                            .find('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')
7136                            .filter(':visible');
7137                    }
7138
7139                    function enableFocusTrap() {
7140                        $(document).on('keydown.menuTrap', function (e) {
7141                            if (!$(mainmenu).is(':visible')) return;
7142                            if (e.key !== 'Tab' && e.keyCode !== 9) return;
7143
7144                            const $focusables = getFocusableElements($(mainmenu));
7145                            if (!$focusables.length) return;
7146
7147                            const first = $focusables[0];
7148                            const last = $focusables[$focusables.length - 1];
7149
7150                            if (e.shiftKey && document.activeElement === first) {
7151                                e.preventDefault();
7152                                last.focus();
7153                                return;
7154                            }
7155
7156                            if (!e.shiftKey && document.activeElement === last) {
7157                                e.preventDefault();
7158                                first.focus();
7159                            }
7160                        });
7161                    }
7162
7163                    function disableFocusTrap() {
7164                        $(document).off('keydown.menuTrap');
7165                    }
7166                }
7167            });
7168        },
7169
7170        industyCodeHighlighter: function () {
7171            $('select option[value="0000"]').remove();
7172            if (!$('#CompanyAreaOfActivity').val() || $('#CompanyAreaOfActivity').val() !== '00' || $('#CompanyAreaOfActivity').val() !== '0') {
7173
7174                //gör för varje SELECT
7175                $('select').each(
7176                    function (index) {
7177                        let currentSelect = $(this);
7178                        currentSelect.find('option:not([value^="' + $('#CompanyAreaOfActivity').val() + '"])').addClass("dim");
7179                        let primaryoptionvalues = currentSelect.find(' option[value^="' + $('#CompanyAreaOfActivity').val() + '"]');
7180
7181                        $.each(primaryoptionvalues,
7182                            function (i) {
7183                                currentSelect.prepend(primaryoptionvalues[i]);
7184                            });
7185
7186                        let selectoptionvalues = currentSelect.find('option[value=""]');
7187                        currentSelect.find('option[value=""]').remove();
7188                        currentSelect.prepend(selectoptionvalues);
7189                        currentSelect.find('option[value=""]').removeClass("dim");
7190                    }
7191                );
7192            }
7193
7194            $('select').on('change', function () {
7195                $(this).find('option').removeClass('selected');
7196                $(this).find('option:selected').addClass('selected');
7197            });
7198        },
7199
7200        copyDateToAllRows: function () {
7201            $("#copyintervaldate").on('click', function (event) {
7202                event.preventDefault();
7203                //Copy start date
7204                let dateValue = $('#PostedEmployeesInsert_0__PostedEmployeeStart').val();
7205                $("input[id^='PostedEmployeesInsert_'][id$='__PostedEmployeeStart']").each(function () {
7206                    $(this).val(dateValue);
7207                });
7208
7209                //Copy end date
7210                dateValue = $('#PostedEmployeesInsert_0__PostedEmployeeEnd').val();
7211                $("input[id^='PostedEmployeesInsert_'][id$='__PostedEmployeeEnd']").each(function () {
7212                    $(this).val(dateValue);
7213                });
7214            });
7215        },
7216        copyIndustyToAllRows: function () {
7217            $("button.copyindustry").on('click', function (event) {
7218                event.preventDefault();
7219
7220                //Copy industry
7221                const $selects = $('select[id^="PostedEmployeesInsert"][id$="__PostedEmployeeAreaOfActivity"]');
7222                if ($selects.length > 0) {
7223                    const firstValue = $selects.first().val();
7224                    $selects.each(function (index) {
7225                        if (index !== 0) { // Skip the first element
7226                            $(this).val(firstValue);
7227                        }
7228                    });
7229                }
7230            });
7231        },
7232
7233        submitTimer: function (form, wait) {
7234            $("button[type=submit]").prop('disabled', true);
7235            let timerFinished = false;
7236            form.on("submit", function (event) {
7237                return timerFinished !== false;
7238            });
7239
7240            setTimeout(function () {
7241                timerFinished = true;
7242                $("button[type=submit]").prop('disabled', false);
7243            }, wait);
7244        },
7245
7246        fixTruncatedOptionsIPhone: function () {
7247            // iOS  hack: Add an optgroup to every select in order to avoid truncating the content
7248            if (!$('Select').next('optgroup').length)
7249
7250                if (!$('#posting-add-company-form').length)
7251
7252                    $('Select').append($('<optgroup>', {
7253
7254                    }));
7255        },
7256
7257        addPersonCallback: function () {
7258            //// re-add validation
7259            $("#posting-add-person-form").removeData('validator');
7260            $("#posting-add-person-form").removeData('unobtrusiveValidation');
7261            $.validator.unobtrusive.parse("#posting-add-person-form");
7262            // HACK: problem! When parse generating empty/unknown rule. Typeahead.js problem????
7263            delete $("#posting-add-person-form").data("validator").settings.rules[""];
7264
7265            require(['postingapplicationsearchperson'], function (postingapplicationsearch) {
7266                postingapplicationsearch.init();
7267            });
7268
7269            postingApplicationPage.industyCodeHighlighter();
7270            postingApplicationPage.fixTruncatedOptionsIPhone();
7271            $('#posting-application-postedemployees .div-row:first-child .copynrg-div').show();
7272        }
7273    };
7274
7275    returnObject.init();
7276    return returnObject;
7277})(jQuery);;
7278var avTipsApplicationPage = (function ($) {
7279    var returnObject = {
7280        init: function () {
7281            this.self = this;
7282        },
7283        wireUp: function () {
7284            require(["vendor/typeahead", "vendor/bloodhound"], function (typeahead) {
7285                if (Modernizr.history && $('#avtips-application-page').length) {
7286
7287                    if ($('#avtips-application-form').length) {
7288                        avTipsApplicationPage.submitTimer($('#avtips-application-form'), 10000);
7289                    }
7290
7291                    $(window).on('popstate',
7292                        function (e) {
7293                            if (history.state) {
7294                                updateContent(history.state);
7295                            }
7296                        });
7297
7298                    $(document).ready(function () {
7299                        history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
7300                    });
7301
7302                    const localizedStrings = {
7303                        loading: {
7304                            'sv': '  Laddar...',
7305                            'en': '  Loading...'
7306                        },
7307                        noResults: {
7308                            'sv': 'Inga träffar',
7309                            'en': 'No hits'
7310                        },
7311                        more: {
7312                            'sv': 'Det finns fler...',
7313                            'en': 'There are more...'
7314                        },
7315                        wordcount: {
7316                            'sv': 'Texten överstiger 250 ord.',
7317                            'en': 'The text exceeds 250 words.'
7318                        },
7319                        addressincorrect: {
7320                            'sv': 'Du måste ange en adress i listan.',
7321                            'en': 'You must enter an address in the list'
7322                        }
7323                    }
7324
7325                    const locale = document.querySelector('#avtips-application-page').getAttribute('data-locale');
7326                    const loading = localizedStrings['loading'][locale];
7327                    const noResults = localizedStrings['noResults'][locale];
7328                    const more = localizedStrings['more'][locale];
7329                    const wordcount = localizedStrings['wordcount'][locale];
7330                    const addressincorrect = localizedStrings['addressincorrect'][locale];
7331
7332                    var onceposted = false;
7333
7334                    $('#sendtip').click(function () {
7335
7336                        if (!onceposted) {
7337
7338                            $.validator.addMethod("validateIssuetypes", function (value, element) {
7339
7340                                var isValid = false;
7341
7342                                if ($(".issuetype:checked").length === 0) {
7343                                    $('#issuetypeError').removeClass('hidden').addClass('visible').addClass('field-validation-error');
7344                                    $('#issuetypeError').text($('#issuetypeError').data('val-required'));
7345                                    isValid = false;
7346                                }
7347                                else {
7348                                    $('#issuetypeError').removeClass('visible').removeClass('field-validation-error').addClass('hidden');
7349                                    $('#issuetypeError').text('');
7350                                    isValid = true;
7351                                }
7352
7353                                return this.optional(element) || isValid;
7354                            });
7355
7356                            $.validator.addMethod("wordCount", function (value, element) {
7357
7358                                var isValid = value.trim().split(/\s+/).length <= 250;
7359
7360                                return this.optional(element) || isValid;
7361                            }, wordcount);
7362
7363                            $.validator.addMethod("validateAddress", function (value, element) {
7364
7365                                var isValid = false;
7366
7367                                var $addressnotfound = $('#AddressNotFound');
7368                                if ($addressnotfound[0].checked) {
7369
7370                                    isValid = true;
7371                                }
7372                                else {
7373                                    var $workplaceaddress = $('#WorkplaceAddress');
7374                                    var $workplaceaddressselected = $('#WorkplaceAddressSelected');
7375
7376                                    if ($workplaceaddress.val() === $workplaceaddressselected.val()) {
7377                                        isValid = true;
7378                                    }
7379                                }
7380                                return this.optional(element) || isValid;
7381                            }, addressincorrect);
7382
7383                            $.validator.addClassRules({
7384                                'issuetype': {
7385                                    validateIssuetypes: true
7386                                }
7387                            });
7388
7389                            $.validator.addClassRules({
7390                                'workplacedescription': {
7391                                    wordCount: true
7392                                }
7393                            });
7394
7395                            $.validator.addClassRules({
7396                                'workplaceaddress': {
7397                                    validateAddress: true
7398                                }
7399                            });
7400
7401                            $('#avtips-application-form').removeData("unobtrusiveValidation").removeData("validator")
7402                            $.validator.unobtrusive.parse(document);
7403
7404                            $(".issuetype").change(function () {
7405                                $(this).valid();
7406                            })
7407
7408                            $(".workplacedescription").change(function () {
7409                                $(this).valid();
7410                            })
7411
7412                            onceposted = true;
7413                        }
7414
7415                        var isValid = $('#avtips-application-form').valid();
7416                        
7417                        if (isValid) {
7418
7419                            $('#avtips-application-form').submit();
7420                        }
7421                    });
7422
7423                    $(".workplacenotfound").change(function () {
7424
7425                        var checked = this.checked;
7426
7427                        if (checked) {
7428                            var $chk = $('input[type = "checkbox"].addressnotfound');
7429                            if ($chk[0].checked) {
7430                                $chk[0].checked = false;
7431                            }
7432                        }
7433
7434                        if (onceposted) {
7435                            $("#WorkplaceName").valid();
7436                            $("#WorkplaceAddress").valid();
7437
7438                        }
7439                    });
7440
7441                    $(".addressnotfound").change(function () {
7442
7443                        var checked = this.checked;
7444
7445                        if (checked) {
7446                            var $chk = $('input[type = "checkbox"].workplacenotfound');
7447                            if ($chk[0].checked) {
7448                                $chk[0].checked = false;
7449                            }
7450                        }
7451
7452                        if (onceposted) {
7453                            $("#WorkplaceName").valid();
7454                            $(".workplaceaddress").valid();
7455                        }
7456                    })
7457
7458                    var placeSuggestions = new Bloodhound({
7459                        datumTokenizer: Bloodhound.tokenizers.obj.whitespace('Id', 'Totaladress'),
7460                        queryTokenizer: Bloodhound.tokenizers.whitespace,
7461                        remote: {
7462                            wildcard: encodeURIComponent('%QUERY'),
7463                            url: '/avtipsapi/addressregister?search=' + encodeURIComponent('%QUERY'),
7464                        },
7465                    });
7466
7467                    $('#WorkplaceAddress').typeahead(
7468                        {
7469                            minLength: 3,
7470                            highlight: true
7471                        }, {
7472                        name: 'places',
7473                        source: placeSuggestions,
7474                        display: function (item) {
7475                            return item.Totaladress;
7476                        },
7477                        limit: 10,
7478                        templates: {
7479                            suggestion: function (item) { return '<div>' + item.Totaladress + '</div>'; },
7480                            pending: function (query) { return '<div class="typeahead-loading"><div class="loader"></div>' + loading + '</div>'; },
7481                            empty: function (context) { return '<div class="typeahead-empty">' + noResults + '</div>'; },
7482                            footer: function (context) {
7483                                if (context.suggestions.length >= 10) { return '<div class="typeahead-footer">' + more + '</div>'; }
7484                                return null;
7485                            }
7486                        }
7487                    });
7488
7489                    $('#WorkplaceAddress').on('typeahead:selected',
7490                        function (evt, item) {
7491                            var $addressSelected = $('#WorkplaceAddressSelected');
7492                            $addressSelected.val(item.Totaladress);
7493
7494                            $("span[data-valmsg-for='WorkplaceAddress']").empty();
7495                            $(this).removeClass("input-validation-error");
7496                        });
7497
7498                    $('#WorkplaceAddress').on('typeahead:close',
7499                        function (evt, item) {
7500                            var $address = $('#WorkplaceAddress');
7501                            var $addressSelected = $('#WorkplaceAddressSelected');
7502
7503                            if ($address.val() !== $addressSelected.val()) {
7504                                $addressSelected.val('');
7505                            }
7506
7507                            $(this).removeAttr("aria-expanded")
7508                        });
7509
7510                    $("#WorkplaceAddress").on("keydown", function (event) {
7511                        if (event.which == 13) {
7512                            var exp = $(this).attr("aria-expanded");
7513                            /*console.log('exp:' + exp)*/
7514                            if (exp === 'true') {
7515                                event.preventDefault = true;
7516                            }
7517                        }
7518                    });
7519
7520                    $(document).on('click',
7521                        '#employee',
7522                        function (event) {
7523                            $('#employeewarning').show();
7524                            $('#employeeinfo').show();
7525                            $('#notemployeewarning').hide();
7526                            $('#notemployeeinfo').hide();
7527                            $('#otherauthoritywarning').hide();
7528                            $('#otherauthorityinfo').hide();
7529
7530                            $('#employeemessage').show();
7531                        });
7532                    $(document).on('click',
7533                        '#notemployee',
7534                        function (event) {
7535                            $('#employeewarning').hide();
7536                            $('#employeeinfo').hide();
7537                            $('#notemployeewarning').show();
7538                            $('#notemployeeinfo').show();
7539                            $('#otherauthoritywarning').hide();
7540                            $('#otherauthorityinfo').hide();
7541
7542                            $('#employeemessage').show();
7543                        });
7544                    $(document).on('click',
7545                        '#otherauthority',
7546                        function (event) {
7547                            $('#employeewarning').hide();
7548                            $('#employeeinfo').hide();
7549                            $('#notemployeewarning').hide();
7550                            $('#notemployeeinfo').hide();
7551                            $('#otherauthoritywarning').show();
7552                            $('#otherauthorityinfo').show();
7553
7554                            $('#employeemessage').show();
7555                        });
7556
7557                    require(["vendor/popper"], function (popper) {
7558                        $('.info-btn').each(function (e) {
7559                            if (!$(this).prev().hasClass('inline')) {
7560                                $(this).prev().addClass('inline');
7561                                if ($(this).css('display') === 'none')
7562                                    $(this).css('display', 'inline-block');
7563                                else
7564                                    $(this).css('display', 'none');
7565                                var listBoxLabel = $(this).parent().find('.listbox-area > .left-area > span');
7566                                if (listBoxLabel.length > 0)
7567                                    $(listBoxLabel).remove();
7568                                // Do popper stuff
7569                                $(this).on('click keypress', function (e) {
7570                                    if (e.type === 'keypress') {
7571                                        var key = e.charCode || e.keyCode;
7572                                        if (key !== 32 && key !== 13)
7573                                            return;
7574                                    }
7575                                    e.preventDefault();
7576                                    var infoDiv = $(this).next()[0];
7577                                    $(infoDiv).toggle();
7578                                    popper.createPopper($(this)[0], infoDiv, {
7579                                        placement: 'top',
7580                                        modifiers: [
7581                                            {
7582                                                name: 'offset',
7583                                                options: {
7584                                                    offset: [0, 10]
7585                                                }
7586                                            }
7587                                        ]
7588
7589                                    });
7590                                });
7591                                $(this).on('blur', function (e) {
7592                                    e.preventDefault();
7593                                    var infoDiv = $(this).next()[0];
7594                                    $(infoDiv).hide();
7595                                });
7596                            }
7597                        });
7598                    });
7599
7600                    // fix tab problem
7601
7602                    $('.tabh').on('click', function (event) {
7603                        event.preventDefault();
7604                    });
7605
7606                    var tabs = $('.tabs').accessibleTabs({
7607                        tabhead: '.tabh',
7608                        tabbody: '.tabbody',
7609                        fx: 'show',
7610                        fxspeed: 'fast'
7611                    });
7612                }
7613
7614            });
7615        },
7616
7617        submitTimer: function (form, wait) {
7618            $('#sendtip').prop('disabled', true);
7619            var timerFinished = false;
7620            form.on("submit", function (event) {
7621                if (timerFinished === false) {
7622                    return false;
7623                } else {
7624                    return true;
7625                }
7626            });
7627
7628            setTimeout(function () {
7629                timerFinished = true;
7630                $('#sendtip').prop('disabled', false);
7631            }, wait);
7632        }
7633    };
7634
7635    returnObject.init();
7636    return returnObject;
7637})(jQuery);;
7638var multistepForm = (function ($) {
7639    var returnObject = {
7640        init: function () {
7641            this.self = this;
7642        },
7643        wireUp: function () {
7644            var formPage = document.querySelector("body.formpage");
7645            if (!formPage) {
7646                return;
7647            }
7648
7649            var cookieName = 'formsteps';
7650            var currentTab = 0; // Current tab is set to be the first tab (0)
7651            var tabs = document.getElementsByClassName("form-tab");
7652            var nrOfTabs = tabs.length;
7653            var summaryIndex = nrOfTabs - 2;
7654            var thankYouIndex = nrOfTabs - 1;
7655            var nrOfQuestionsSteps = nrOfTabs - 2;
7656            var stepsTimerMultiplier = 500; // 500ms
7657            var onLoadDate = new Date();
7658            loadExistingAnswers();
7659            showTab(currentTab); // Display the current tab
7660
7661            function showTab(n) {
7662                // This function will display the specified tab of the form ...
7663                tabs[n].style.display = "block";
7664                // ... and fix the Previous/Next buttons:
7665                if (n == 0) {
7666                    document.getElementById("prevBtn").style.display = "none";
7667                } else {
7668                    document.getElementById("prevBtn").style.display = "block";
7669                }
7670                if (n == summaryIndex) {
7671                    var nextBtn = document.getElementById("nextBtn");
7672                    nextBtn.innerHTML = nextBtn.getAttribute("data-save-label");
7673                } else if (n == thankYouIndex) {
7674                    document.getElementById("prevBtn").style.display = "none";
7675                    document.getElementById("nextBtn").style.display = "none";
7676                } else {
7677                    var nextBtn = document.getElementById("nextBtn");
7678                    nextBtn.innerHTML = nextBtn.getAttribute("data-next-label");
7679                }
7680            };
7681
7682            function nextPrev(n) {
7683                // This function will figure out which tab to display
7684                // If the form is a group form and you have reached the thank you page:
7685                if (currentTab + 1 == thankYouIndex && document.querySelector(".form-question-group").hasAttribute("data-submit")) {
7686                    if (tresholdPassed()) {
7687                        submitGroupForm();
7688                    } else {
7689                        updateTreshold();
7690                        var treshold = getTreshold();
7691                        alert('You have to wait ' + treshold / 1000 + 'seconds before submiting the form.');
7692                        return;
7693                    }
7694                }
7695
7696                // Exit the function if any field in the current tab is invali
7696d:
7697                if (n == 1 && !validateForm())
7698                    return false;
7699                // Hide the current tab:
7700                tabs[currentTab].style.display = "none";
7701                // Increase or decrease the current tab by 1:
7702                currentTab = currentTab + n;
7703                // if you have reached the summary index:
7704                if (currentTab == summaryIndex) {
7705                    showSummary();
7706                }
7707                
7708                // Otherwise, display the correct tab:
7709                showTab(currentTab);
7710                document.getElementById("formpage-top").scrollIntoView();
7711
7712                if (currentTab > 0 && $('#q1-intro'))
7713                    $('#q1-intro').hide();
7714                else
7715                    $('#q1-intro').show();
7716
7717                var firstCheckbox = $(document.getElementById("formpage-top")).find('input[type="radio"]:visible').first();
7718                if ($(firstCheckbox).length) {
7719                    $(firstCheckbox)[0].focus();
7720                }
7721            };
7722
7723            function getTreshold() {
7724                return (nrOfTabs - 2) * stepsTimerMultiplier;
7725            };
7726
7727            function updateTreshold() {
7728                stepsTimerMultiplier = stepsTimerMultiplier * 2;
7729            };
7730
7731            function tresholdPassed() {
7732                var submitDate = new Date();
7733                var diff = submitDate - onLoadDate;
7734                var treshold = getTreshold();
7735                if (diff > treshold) {
7736                    return true;
7737                }
7738
7739                return false;
7740            };
7741
7742            function submitGroupForm() {
7743                var form = document.querySelector(".form-question-group");
7744                var targetUrl = form.getAttribute("data-submit");
7745
7746                $.ajax({
7747                    url: targetUrl,
7748                    data: $(form).serialize(),
7749                    type: "POST",
7750                    error: function (xhr, status) {
7751                        console.log("Fetch Error: ", xhr, status);
7752                        form.innerHTML = "Something went wrong.";
7753                    }
7754                });
7755            };
7756
7757            function showSummary() {
7758                var form = document.querySelector(".form-question-group");
7759                var targetUrl = form.getAttribute("data-show-summary");
7760                var summaryContainer = document.querySelector(".js-summary-container");
7761
7762                $.ajax({
7763                    url: targetUrl,
7764                    data: $(form).serialize(),
7765                    type: "POST",
7766                    success: function (html) {
7767                        summaryContainer.innerHTML = html;
7768                        accordion.init();
7769                    },
7770                    error: function (xhr, status) {
7771                        console.log("Fetch Error: ", xhr, status);
7772                        summaryContainer.innerHTML = "Something went wrong.";
7773                    }
7774                });
7775            }
7776
7777            function validateForm() {
7778                // This function deals with validation of the form fields
7779                // Get the questions for the current step
7780                $('.form-error-text').hide();
7781                var y = tabs[currentTab].getElementsByClassName("question-container");
7782                var unansweredQuestions = [];
7783                // Check if any radio button for each question is checked. If not, add to unansweredQuestions array
7784                for (var i = 0; i < y.length; i++) {
7785                    var z = y[i].getElementsByTagName("input");
7786                    var isQuestionAnswered = false;
7787                    for (var j = 0; j < z.length; j++) {
7788                        if (z[j].checked) {
7789                            isQuestionAnswered = true;
7790                            break;
7791                        }
7792                    }
7793                    $(y[i]).find('.question').css('color', 'black');
7794                    if (!isQuestionAnswered) {
7795                        unansweredQuestions.push(y[i]);
7796                    }
7797                }
7798
7799                var valid = !unansweredQuestions.length;
7800                // If the valid status is true, update progress bar
7801                if (valid) {
7802                    updateProgressBar();
7803                } else {
7804                //    for (var k = 0; k < unansweredQuestions.length; k++) {
7805                //        $(unansweredQuestions[k]).find('.question').css('color', '#cf0000');
7806                //    }
7807                    $('.form-error-text').show();
7808                }
7809
7810                return valid;
7811            }
7812
7813            function updateProgressBar() {
7814                if (currentTab + 1 <= nrOfQuestionsSteps) {
7815                    var progress = ((currentTab + 1) / nrOfQuestionsSteps) * 100;
7816                    document.getElementsByClassName("progress-bar__progress")[0].style.width = progress + "%";
7817                }
7818            }
7819
7820            function initExpandableField() {
7821                // TODO: Copied from main.js and extended - refactor
7822                $('.expandablefield').each(function () {
7823                    var self = $(this);
7824                    var isEditMode = $(self).attr('data-edit-mode').toLowerCase();
7825                    if (isEditMode === 'false') {
7826                        self.addClass('enabled');
7827                        $('.tabh', self).on("click", function (event) {
7828                            event.preventDefault();
7829                            var tab = $(this).closest('.tab');
7830                            if (tab.hasClass('expanded')) {
7831                                tab.removeClass('expanded');
7832                                $(this).attr('aria-expanded', "false");
7833                            } else {
7834                                tab.addClass('expanded');
7835                                $(this).attr('aria-expanded', "true");
7836                            }
7837                        });
7838                    } else {
7839                        $(self).removeClass('enabled');
7840                    }
7841                });
7842            }
7843
7844            var prevBtn = document.getElementById("prevBtn");
7845            prevBtn.addEventListener('click', function () {
7846                nextPrev(-1);
7847            });
7848
7849            var nextBtn = document.getElementById("nextBtn");
7850            nextBtn.addEventListener('click', function () {
7851                nextPrev(1);
7852            });
7853
7854            /******************* Cookies functionality *******************/
7855            function loadExistingAnswers() {
7856                var pageId = document.querySelector(".form-question-group").getAttribute("data-page-id");
7857                var formCookie = docCookies.getItem('${cookieName}${pageId}');
7858                if (!formCookie) {
7859                    return;
7860                }
7861                var split = formCookie.split(",");
7862                $(split).each(function (i, value) {
7863                    var splitValue = value.split("=");
7864                    questionContainer = document.querySelector('[data-question-number="${splitValue[0]}"]');
7865                    var radiobutton = questionContainer.querySelector('[type=radio][value="${splitValue[1]}"]');
7866                    radiobutton.checked = true;
7867                });
7868            }
7869
7870            function getCookiesDate() {
7871                var originalDate = new Date();
7872                var year = originalDate.getFullYear();
7873                var month = originalDate.getMonth();
7874                var date = originalDate.getDate();
7875                var hours = originalDate.getHours();
7876                var minutes = originalDate.getMinutes();
7877
7878                return new Date(year, month, date, hours + 2, minutes).toUTCString();
7879            };
7880
7881            function getAnsweredQuestions() {
7882                var answeredQuestions = [];
7883                var checkedRadioButtons = $("[type=radio]:checked");
7884                checkedRadioButtons.each(function (i, value) {
7885                    var questionContainer = $(value).closest(".question-container");
7886                    var questionCounter = questionContainer.attr("data-question-number");
7887                    answeredQuestions.push('${questionCounter}=${value.value}');
7888                });
7889
7890                return answeredQuestions;
7891            }
7892
7893            function writeAnswerToCookie() {
7894                var pageId = document.querySelector(".form-question-group").getAttribute("data-page-id");
7895                var answeredQuestions = getAnsweredQuestions();
7896                var answeredQuestionsStr = answeredQuestions.join();
7897                var cookiesDate = getCookiesDate();
7898                document.cookie = '${cookieName}${pageId}=${answeredQuestionsStr}; path=/;expires=${cookiesDate}';
7899            }
7900
7901            var radioButtons = $("[type=radio]");
7902            radioButtons.each(function (i, value) {
7903                $(value).on("click", function (event) {
7904                    writeAnswerToCookie(event.currentTarget);
7905                });
7906            });
7907
7908            /******************* End cookies functionality *******************/
7909        }
7910    }
7911    returnObject.init();
7912    return returnObject;
7913})(jQuery);;
7914/**
7915 * @namespace aria
7916 */
7917
7918var aria = aria || {};
7919
7920/**
7921 * @desc
7922 *  Key code constants
7923 */
7924aria.KeyCode = {
7925    BACKSPACE: 8,
7926    TAB: 9,
7927    RETURN: 13,
7928    ESC: 27,
7929    SPACE: 32,
7930    PAGE_UP: 33,
7931    PAGE_DOWN: 34,
7932    END: 35,
7933    HOME: 36,
7934    LEFT: 37,
7935    UP: 38,
7936    RIGHT: 39,
7937    DOWN: 40,
7938    DELETE: 46
7939};
7940
7941aria.Utils = aria.Utils || {};
7942
7943// Polyfill src https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
7944aria.Utils.matches = function (element, selector) {
7945    if (!Element.prototype.matches) {
7946        Element.prototype.matches =
7947            Element.prototype.matchesSelector ||
7948            Element.prototype.mozMatchesSelector ||
7949            Element.prototype.msMatchesSelector ||
7950            Element.prototype.oMatchesSelector ||
7951            Element.prototype.webkitMatchesSelector ||
7952            function (s) {
7953                var matches = element.parentNode.querySelectorAll(s);
7954                var i = matches.length;
7955                while (--i >= 0 && matches.item(i) !== this) { }
7956                return i > -1;
7957            };
7958    }
7959
7960    return element.matches(selector);
7961};
7962
7963aria.Utils.remove = function (item) {
7964    if (item.remove && typeof item.remove === 'function') {
7965        return item.remove();
7966    }
7967    if (item.parentNode &&
7968        item.parentNode.removeChild &&
7969        typeof item.parentNode.removeChild === 'function') {
7970        return item.parentNode.removeChild(item);
7971    }
7972    return false;
7973};
7974
7975aria.Utils.isFocusable = function (element) {
7976    if (element.tabIndex > 0 || (element.tabIndex === 0 && element.getAttribute('tabIndex') !== null)) {
7977        return true;
7978    }
7979
7980    if (element.disabled) {
7981        return false;
7982    }
7983
7984    switch (element.nodeName) {
7985        case 'A':
7986            return !!element.href && element.rel != 'ignore';
7987        case 'INPUT':
7988            return element.type != 'hidden' && element.type != 'file';
7989        case 'BUTTON':
7990        case 'SELECT':
7991        case 'TEXTAREA':
7992            return true;
7993        default:
7994            return false;
7995    }
7996};
7997
7998aria.Utils.getAncestorBySelector = function (element, selector) {
7999    if (!aria.Utils.matches(element, selector + ' ' + element.tagName)) {
8000        // Element is not inside an element that matches selector
8001        return null;
8002    }
8003
8004    // Move up the DOM tree until a parent matching the selector is found
8005    var currentNode = element;
8006    var ancestor = null;
8007    while (ancestor === null) {
8008        if (aria.Utils.matches(currentNode.parentNode, selector)) {
8009            ancestor = currentNode.parentNode;
8010        }
8011        else {
8012            currentNode = currentNode.parentNode;
8013        }
8014    }
8015
8016    return ancestor;
8017};
8018
8019aria.Utils.hasClass = function (element, className) {
8020    return (new RegExp('(\\s|^)' + className + '(\\s|$)')).test(element.className);
8021};
8022
8023aria.Utils.addClass = function (element, className) {
8024    if (!aria.Utils.hasClass(element, className)) {
8025        element.className += ' ' + className;
8026    }
8027};
8028
8029aria.Utils.removeClass = function (element, className) {
8030    var classRegex = new RegExp('(\\s|^)' + className + '(\\s|$)');
8031    element.className = element.className.replace(classRegex, ' ').trim();
8032};
8033
8034aria.Utils.focusedElement = function(document) {
8035    return document.activeElement.tagName;
8036}
8037
8038aria.Utils.bindMethods = function (object /* , ...methodNames */) {
8039    var methodNames = Array.prototype.slice.call(arguments, 1);
8040    methodNames.forEach(function (method) {
8041        object[method] = object[method].bind(object);
8042    });
8043};
8044;
8045/*
8046*   This content is licensed according to the W3C Software License at
8047*   https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
8048*/
8049/**
8050 * @namespace aria
8051 */
8052var aria = aria || {};
8053var isClicked = false;
8054
8055/**
8056 * @constructor
8057 *
8058 * @desc
8059 *  Listbox object representing the state and interactions for a listbox widget
8060 *
8061 * @param listboxNode
8062 *  The DOM node pointing to the listbox
8063 */
8064aria.Listbox = function (listboxNode) {
8065    this.listboxNode = listboxNode;
8066    this.activeDescendant = this.listboxNode.getAttribute('aria-activedescendant');
8067    this.multiselectable = this.listboxNode.hasAttribute('aria-multiselectable');
8068    this.moveUpDownEnabled = false;
8069    this.isClicked = false;
8070    this.siblingList = null;
8071    this.upButton = null;
8072    this.downButton = null;
8073    this.moveButton = null;
8074    this.keysSoFar = '';
8075    this.handleFocusChange = function () { };
8076    this.handleItemChange = function (event, items) { };
8077    this.registerEvents();
8078};
8079
8080/**
8081 * @desc
8082 *  Register events for the listbox interactions
8083 */
8084aria.Listbox.prototype.registerEvents = function () {
8085    this.listboxNode.addEventListener('focus', this.setupFocus.bind(this));
8086    this.listboxNode.addEventListener('keydown', this.checkKeyPress.bind(this));
8087    this.listboxNode.addEventListener('click', this.checkClickItem.bind(this));
8088};
8089
8090/**
8091 * @desc
8092 *  If there is no activeDescendant, focus on the first option
8093 */
8094aria.Listbox.prototype.setupFocus = function () {
8095    if (this.activeDescendant) {
8096        return;
8097    }
8098
8099    this.focusFirstItem();
8100};
8101
8102/**
8103 * @desc
8104 *  Focus on the first option
8105 */
8106aria.Listbox.prototype.focusFirstItem = function () {
8107    var firstItem;
8108
8109    firstItem = this.listboxNode.querySelector('[role="option"]');
8110
8111    if (firstItem) {
8112        this.focusItem(firstItem);
8113    }
8114};
8115
8116/**
8117 * @desc
8118 *  Focus on the last option
8119 */
8120aria.Listbox.prototype.focusLastItem = function () {
8121    var itemList = this.listboxNode.querySelectorAll('[role="option"]');
8122
8123    if (itemList.length) {
8124        this.focusItem(itemList[itemList.length - 1]);
8125    }
8126};
8127
8128/**
8129 * @desc
8130 *  Handle various keyboard controls; UP/DOWN will shift focus; SPACE selects
8131 *  an item.
8132 *
8133 * @param evt
8134 *  The keydown event object
8135 */
8136aria.Listbox.prototype.checkKeyPress = function (evt) {
8137    var key = evt.which || evt.keyCode;
8138    var nextItem = document.getElementById(this.activeDescendant);
8139
8140    if (!nextItem) {
8141        return;
8142    }
8143
8144    switch (key) {
8145        case aria.KeyCode.PAGE_UP:
8146        case aria.KeyCode.PAGE_DOWN:
8147            if (this.moveUpDownEnabled) {
8148                evt.preventDefault();
8149
8150                if (key === aria.KeyCode.PAGE_UP) {
8151                    this.moveUpItems();
8152                }
8153                else {
8154                    this.moveDownItems();
8155                }
8156            }
8157
8158            break;
8159        case aria.KeyCode.UP:
8160        case aria.KeyCode.DOWN:
8161            evt.preventDefault();
8162
8163            if (this.moveUpDownEnabled && evt.altKey) {
8164                if (key === aria.KeyCode.UP) {
8165                    this.moveUpItems();
8166                }
8167                else {
8168                    this.moveDownItems();
8169                }
8170                return;
8171            }
8172
8173            if (key === aria.KeyCode.UP) {
8174                nextItem = nextItem.previousElementSibling;
8175            }
8176            else {
8177                nextItem = nextItem.nextElementSibling;
8178            }
8179
8180            if (nextItem) {
8181                this.focusItem(nextItem);
8182            }
8183
8184            break;
8185        case aria.KeyCode.HOME:
8186            evt.preventDefault();
8187            this.focusFirstItem();
8188            break;
8189        case aria.KeyCode.END:
8190            evt.preventDefault();
8191            this.focusLastItem();
8192            break;
8193        case aria.KeyCode.SPACE:
8194            evt.preventDefault();
8195            this.toggleSelectItem(nextItem);
8196            break;
8197        case aria.KeyCode.BACKSPACE:
8198        case aria.KeyCode.DELETE:
8199        case aria.KeyCode.RETURN:
8200            isClicked = !isClicked;
8201            if (!this.moveButton) {
8202                return;
8203            }
8204
8205            var keyshortcuts = this.moveButton.getAttribute('aria-keyshortcuts');
8206            if (key === aria.KeyCode.RETURN && keyshortcuts.indexOf('Enter') === -1) {
8207                return;
8208            }
8209            if (
8210                (key === aria.KeyCode.BACKSPACE || key === aria.KeyCode.DELETE) &&
8211                keyshortcuts.indexOf('Delete') === -1
8212            ) {
8213                return;
8214            }
8215
8216            evt.preventDefault();
8217
8218            var nextUnselected = nextItem.nextElementSibling;
8219            while (nextUnselected) {
8220                if (nextUnselected.getAttribute('aria-selected') != 'true') {
8221                    break;
8222                }
8223                nextUnselected = nextUnselected.nextElementSibling;
8224            }
8225            if (!nextUnselected) {
8226                nextUnselected = nextItem.previousElementSibling;
8227                while (nextUnselected) {
8228                    if (nextUnselected.getAttribute('aria-selected') != 'true') {
8229                        break;
8230                    }
8231                    nextUnselected = nextUnselected.previousElementSibling;
8232                }
8233            }
8234
8235            this.moveItems();
8236
8237            if (!this.activeDescendant && nextUnselected) {
8238                this.focusItem(nextUnselected);
8239            }
8240            break;
8241        default:
8242            var itemToFocus = this.findItemToFocus(key);
8243            if (itemToFocus) {
8244                this.focusItem(itemToFocus);
8245            }
8246            break;
8247    }
8248};
8249
8250aria.Listbox.prototype.findItemToFocus = function (key) {
8251    var itemList = this.listboxNode.querySelectorAll('[role="option"]');
8252    var character = String.fromCharCode(key);
8253
8254    if (!this.keysSoFar) {
8255        for (var i = 0; i < itemList.length; i++) {
8256            if (itemList[i].getAttribute('id') == this.activeDescendant) {
8257                this.searchIndex = i;
8258            }
8259        }
8260    }
8261    this.keysSoFar += character;
8262    this.clearKeysSoFarAfterDelay();
8263
8264    var nextMatch = this.findMatchInRange(
8265        itemList,
8266        this.searchIndex + 1,
8267        itemList.length
8268    );
8269    if (!nextMatch) {
8270        nextMatch = this.findMatchInRange(
8271            itemList,
8272            0,
8273            this.searchIndex
8274        );
8275    }
8276    return nextMatch;
8277};
8278
8279aria.Listbox.prototype.clearKeysSoFarAfterDelay = function () {
8280    if (this.keyClear) {
8281        clearTimeout(this.keyClear);
8282        this.keyClear = null;
8283    }
8284    this.keyClear = setTimeout((function () {
8285        this.keysSoFar = '';
8286        this.keyClear = null;
8287    }).bind(this), 500);
8288};
8289
8290aria.Listbox.prototype.findMatchInRange = function (list, startIndex, endIndex) {
8291    // Find the first item starting with the keysSoFar substring, searching in
8292    // the specified range of items
8293    for (var n = startIndex; n < endIndex; n++) {
8294        var label = list[n].innerText;
8295        if (label && label.toUpperCase().indexOf(this.keysSoFar) === 0) {
8296            return list[n];
8297        }
8298    }
8299    return null;
8300};
8301
8302/**
8303 * @desc
8304 *  Check if an item is clicked on. If so, focus on it and select it.
8305 *
8306 * @param evt
8307 *  The click event object
8308 */
8309aria.Listbox.prototype.checkClickItem = function (evt) {
8310    if (evt.target.getAttribute('role') === 'option') {
8311        this.focusItem(evt.target);
8312        this.toggleSelectItem(evt.target);
8313    }
8314};
8315
8316/**
8317 * @desc
8318 *  Toggle the aria-selected value
8319 *
8320 * @param element
8321 *  The element to select
8322 */
8323aria.Listbox.prototype.toggleSelectItem = function (element) {
8324    if (this.multiselectable) {
8325        element.setAttribute(
8326            'aria-selected',
8327            element.getAttribute('aria-selected') === 'true' ? 'false' : 'true'
8328        );
8329
8330        if (this.moveButton) {
8331            if (this.listboxNode.querySelector('[aria-selected="true"]')) {
8332                this.moveButton.setAttribute('aria-disabled', 'false');
8333            }
8334            else {
8335                this.moveButton.setAttribute('aria-disabled', 'true');
8336            }
8337        }
8338    }
8339};
8340
8341/**
8342 * @desc
8343 *  Defocus the specified item
8344 *
8345 * @param element
8346 *  The element to defocus
8347 */
8348aria.Listbox.prototype.defocusItem = function (element) {
8349    if (!element) {
8350        return;
8351    }
8352    if (!this.multiselectable) {
8353        //element.removeAttribute('aria-selected');
8354        element.setAttribute('aria-selected','false');
8355    }
8356    aria.Utils.removeClass(element, 'focused');
8357};
8358
8359/**
8360 * @desc
8361 *  Focus on the specified item
8362 *
8363 * @param element
8364 *  The element to focus
8365 */
8366aria.Listbox.prototype.focusItem = function (element) {
8367    this.defocusItem(document.getElementById(this.activeDescendant));
8368    if (!this.multiselectable) {
8369        element.setAttribute('aria-selected', 'true');
8370    }
8371    aria.Utils.addClass(element, 'focused');
8372    this.listboxNode.setAttribute('aria-activedescendant', element.id);
8373    this.activeDescendant = element.id;
8374
8375    if (this.listboxNode.scrollHeight > this.listboxNode.clientHeight) {
8376        var scrollBottom = this.listboxNode.clientHeight + this.listboxNode.scrollTop;
8377        var elementBottom = element.offsetTop + element.offsetHeight;
8378        if (elementBottom > scrollBottom) {
8379            this.listboxNode.scrollTop = elementBottom - this.listboxNode.clientHeight;
8380        }
8381        else if (element.offsetTop < this.listboxNode.scrollTop) {
8382            this.listboxNode.scrollTop = element.offsetTop;
8383        }
8384    }
8385
8386    if (!this.multiselectable && this.moveButton) {
8387        this.moveButton.setAttribute('aria-disabled', false);
8388    }
8389
8390    this.checkUpDownButtons();
8391    this.handleFocusChange(element);
8392};
8393
8394/**
8395 * @desc
8396 *  Enable/disable the up/down arrows based on the activeDescendant.
8397 */
8398aria.Listbox.prototype.checkUpDownButtons = function () {
8399    var activeElement = document.getElementById(this.activeDescendant);
8400
8401    if (!this.moveUpDownEnabled) {
8402        return false;
8403    }
8404
8405    if (!activeElement) {
8406        this.upButton.setAttribute('aria-disabled', 'true');
8407        this.downButton.setAttribute('aria-disabled', 'true');
8408        return;
8409    }
8410
8411    if (this.upButton) {
8412        if (activeElement.previousElementSibling) {
8413            this.upButton.setAttribute('aria-disabled', false);
8414        }
8415        else {
8416            this.upButton.setAttribute('aria-disabled', 'true');
8417        }
8418    }
8419
8420    if (this.downButton) {
8421        if (activeElement.nextElementSibling) {
8422            this.downButton.setAttribute('aria-disabled', false);
8423        }
8424        else {
8425            this.downButton.setAttribute('aria-disabled', 'true');
8426        }
8427    }
8428};
8429
8430/**
8431 * @desc
8432 *  Add the specified items to the listbox. Assumes items are valid options.
8433 *
8434 * @param items
8435 *  An array of items to add to the listbox
8436 */
8437aria.Listbox.prototype.addItems = function (items) {
8438    if (!items || !items.length) {
8439        return false;
8440    }
8441
8442    items.forEach((function (item) {
8443        this.defocusItem(item);
8444        this.toggleSelectItem(item);
8445        this.listboxNode.append(item);
8446    }).bind(this));
8447
8448    if (!this.activeDescendant) {
8449        this.focusItem(items[0]);
8450    }
8451
8452    this.handleItemChange('added', items);
8453};
8454
8455/**
8456 * @desc
8457 *  Remove all of the selected items from the listbox; Removes the focused items
8458 *  in a single select listbox and the items with aria-selected in a multi
8459 *  select listbox.
8460 *
8461 * @returns items
8462 *  An array of items that were removed from the listbox
8463 */
8464aria.Listbox.prototype.deleteItems = function () {
8465    var itemsToDelete;
8466
8467    if (this.multiselectable) {
8468        itemsToDelete = this.listboxNode.querySelectorAll('[aria-selected="true"]');
8469    }
8470    else if (this.activeDescendant) {
8471        itemsToDelete = [document.getElementById(this.activeDescendant)];
8472    }
8473
8474    if (!itemsToDelete || !itemsToDelete.length) {
8475        return [];
8476    }
8477
8478    itemsToDelete.forEach((function (item) {
8479        item.remove();
8480
8481        if (item.id === this.activeDescendant) {
8482            this.clearActiveDescendant();
8483        }
8484    }).bind(this));
8485
8486    this.handleItemChange('removed', itemsToDelete);
8487
8488    return itemsToDelete;
8489};
8490
8491aria.Listbox.prototype.clearActiveDescendant = function () {
8492    this.activeDescendant = null;
8493    this.listboxNode.setAttribute('aria-activedescendant', null);
8494
8495    if (this.moveButton) {
8496        this.moveButton.setAttribute('aria-disabled', 'true');
8497    }
8498
8499    this.checkUpDownButtons();
8500};
8501
8502/**
8503 * @desc
8504 *  Shifts the currently focused item up on the list. No shifting occurs if the
8505 *  item is already at the top of the list.
8506 */
8507aria.Listbox.prototype.moveUpItems = function () {
8508    var previousItem;
8509
8510    if (!this.activeDescendant) {
8511        return;
8512    }
8513
8514    currentItem = document.getElementById(this.activeDescendant);
8515    previousItem = currentItem.previousElementSibling;
8516
8517    if (previousItem) {
8518        this.listboxNode.insertBefore(currentItem, previousItem);
8519        this.handleItemChange('moved_up', [currentItem]);
8520    }
8521
8522    this.checkUpDownButtons();
8523};
8524
8525/**
8526 * @desc
8527 *  Shifts the currently focused item down on the list. No shifting occurs if
8528 *  the item is already at the end of the list.
8529 */
8530aria.Listbox.prototype.moveDownItems = function () {
8531    var nextItem;
8532
8533    if (!this.activeDescendant) {
8534        return;
8535    }
8536
8537    currentItem = document.getElementById(this.activeDescendant);
8538    nextItem = currentItem.nextElementSibling;
8539
8540    if (nextItem) {
8541        this.listboxNode.insertBefore(nextItem, currentItem);
8542        this.handleItemChange('moved_down', [currentItem]);
8543    }
8544
8545    this.checkUpDownButtons();
8546};
8547
8548/**
8549 * @desc
8550 *  Delete the currently selected items and add them to the sibling list.
8551 */
8552aria.Listbox.prototype.moveItems = function () {
8553    if (!this.siblingList) {
8554        return;
8555    }
8556
8557    var itemsToMove = this.deleteItems();
8558    this.siblingList.addItems(itemsToMove);
8559};
8560
8561/**
8562 * @desc
8563 *  Enable Up/Down controls to shift items up and down.
8564 *
8565 * @param upButton
8566 *   Up button to trigger up shift
8567 *
8568 * @param downButton
8569 *   Down button to trigger down shift
8570 */
8571aria.Listbox.prototype.enableMoveUpDown = function (upButton, downButton) {
8572    this.moveUpDownEnabled = true;
8573    this.upButton = upButton;
8574    this.downButton = downButton;
8575    upButton.addEventListener('click', this.moveUpItems.bind(this));
8576    downButton.addEventListener('click', this.moveDownItems.bind(this));
8577};
8578
8579/**
8580 * @desc
8581 *  Enable Move controls. Moving removes selected items from the current
8582 *  list and adds them to the sibling list.
8583 *
8584 * @param button
8585 *   Move button to trigger delete
8586 *
8587 * @param siblingList
8588 *   Listbox to move items to
8589 */
8590aria.Listbox.prototype.setupMove = function (button, siblingList) {
8591    this.siblingList = siblingList;
8592    this.moveButton = button;
8593    button.addEventListener('click', this.moveItems.bind(this));
8594};
8595
8596aria.Listbox.prototype.setHandleItemChange = function (handlerFn) {
8597    this.handleItemChange = handlerFn;
8598};
8599
8600aria.Listbox.prototype.setHandleFocusChange = function (focusChangeHandler) {
8601    this.handleFocusChange = focusChangeHandler;
8602};
8603
8604
8605
8606var aria = aria || {};
8607
8608aria.ListboxButton = function (button, listbox) {
8609    this.button = button;
8610    this.listbox = listbox;
8611    this.registerEvents();
8612};
8613
8614aria.ListboxButton.prototype.registerEvents = function () {
8615    this.button.addEventListener('click', this.showListbox.bind(this));
8616    this.button.addEventListener('keyup', this.checkShow.bind(this));
8617    this.button.addEventListener('blur', this.buttonBlur.bind(this));
8618    this.listbox.listboxNode.addEventListener('blur', this.hideListbox.bind(this));
8619    this.listbox.listboxNode.addEventListener('keydown', this.checkHide.bind(this));
8620    this.listbox.listboxNode.addEventListener('click', this.listBoxClick.bind(this));
8621    this.listbox.setHandleFocusChange(this.onFocusChange.bind(this));
8622};
8623
8624aria.ListboxButton.prototype.checkShow = function (evt) {
8625    var key = evt.which || evt.keyCode;
8626
8627    switch (key) {
8628        case aria.KeyCode.UP:
8629        case aria.KeyCode.DOWN:
8630            evt.preventDefault();
8631            this.showListbox();
8632            this.listbox.checkKeyPress(evt);
8633            break;
8634    }
8635};
8636
8637aria.ListboxButton.prototype.checkHide = function (evt) {
8638    var key = evt.which || evt.keyCode;
8639
8640    switch (key) {
8641        case aria.KeyCode.RETURN:
8642        case aria.KeyCode.ESC:
8643            evt.preventDefault();
8644            this.hideListbox();
8645            this.button.focus();
8646            break;
8647    }
8648};
8649
8650aria.ListboxButton.prototype.listBoxClick = function (evt) {
8651    isClicked = false;
8652    evt.preventDefault();
8653    this.hideListbox();
8654    this.button.focus();
8655}
8656
8657aria.ListboxButton.prototype.buttonBlur = function (evt) {
8658    if (evt !== undefined && evt.currentTarget !== null && evt.relatedTarget !== null) {
8659        if (evt.currentTarget.nodeName.toLowerCase() === 'button' &&
8660            evt.relatedTarget.nodeName.toLowerCase() === 'button') {
8661            isClicked = true;
8662            evt.currentTarget.trigger("click");
8663        }
8664    }
8665}
8666
8667aria.ListboxButton.prototype.showListbox = function (evt) {
8668    if (!isClicked) {
8669        isClicked = true;
8670        aria.Utils.removeClass(this.listbox.listboxNode, 'hidden');
8671        this.button.setAttribute('aria-expanded', 'true');
8672        this.listbox.listboxNode.focus();
8673    } else {
8674        isClicked = false;
8675        this.hideListbox();
8676    }
8677};
8678
8679aria.ListboxButton.prototype.hideListbox = function (evt) {
8680    if (evt !== undefined) {
8681        if (evt.relatedTarget === null || evt.relatedTarget !== this.button)
8682            isClicked = false;
8683    }
8684    if (!this.listbox.listboxNode.classList.contains('hidden') && isClicked) {
8685        isClicked = true;
8686    } else {
8687        aria.Utils.addClass(this.listbox.listboxNode, 'hidden');
8688        this.button.removeAttribute('aria-expanded');
8689    }
8690};
8691;
8692$(function () {
8693    $('.listbox').each(function () {
8694        const listbox = $(this);
8695        const label = $('label[for="' + listbox.attr('id') + '"]');
8696        const d = document;
8697
8698        listbox.hide();
8699        label.hide();
8700
8701        let buttonId = 'exp_button_' + listbox.attr('name').replace('.', '_');
8702        let elemId = 'exp_elem_' + listbox.attr('name').replace('.', '_');
8703
8704        let area = d.createElement('div');
8705        area.classList = listbox[0].classList;
8706        area.classList.remove('listbox');
8707        area.classList.add('listbox-area');
8708        area.setAttribute('data-selectname', elemId);
8709
8710        let leftarea = d.createElement('div');
8711        leftarea.setAttribute('class', 'left-area');
8712
8713        let spanLabel = d.createElement('span');
8714        spanLabel.setAttribute('id', elemId);
8715        spanLabel.innerText = $('label[for="' + listbox.attr('id').replace('.', '_') + '"]').text();
8716        spanLabel.classList.add('listbox-label');
8717        leftarea.appendChild(spanLabel);
8718
8719        let wrapper = d.createElement('div');
8720        wrapper.classList.add('listbox-wrapper');
8721        leftarea.appendChild(wrapper);
8722
8723        let button = d.createElement('button');
8724        button.setAttribute('aria-haspopup', 'listbox');
8725        button.setAttribute('aria-labelledby', elemId + ' ' + buttonId);
8726        button.setAttribute('id', buttonId);
8727        let btn_class = 'exp_button';
8728        if (listbox.attr('data-listbox-btn-class') !== undefined)
8729            btn_class = listbox.attr('data-listbox-btn-class');
8730        button.classList.add(btn_class);
8731        button.innerText = $('option:selected', listbox).text();
8732        button.addEventListener("click", function (event) {
8733            event.preventDefault();
8734        });
8735        wrapper.appendChild(button);
8736
8737        let list = d.createElement('ul');
8738        list.setAttribute('tabindex', '-1');
8739        list.setAttribute('role', 'listbox');
8740        list.setAttribute('aria-labelledby', buttonId);
8741        list.classList.add('hidden');
8742        list.classList.add('exp_elem_list');
8743
8744        $('option', listbox).each(function () {
8745            let option = $(this);
8746            let item = d.createElement('li');
8747            item.setAttribute('role', 'option');
8748            item.setAttribute('id', elemId + '_' + option.val());
8749            item.classList.add('exp_elem');
8750            item.setAttribute('data-optionval', option.val());
8751            item.setAttribute('data-listbox-usetext', listbox.data('listbox-usetext'));
8752            item.setAttribute('aria-selected', 'false');
8753            item.innerText = option.text();
8754            list.appendChild(item);
8755        });
8756
8757        wrapper.appendChild(list);
8758
8759        area.appendChild(leftarea);
8760        listbox.after(area);
8761
8762        var exListbox = new aria.Listbox(list);
8763        var listboxButton = new aria.ListboxButton(button, exListbox);
8764    });
8765});
8766
8767aria.ListboxButton.prototype.onFocusChange = function (focusedItem) {
8768    this.button.innerText = focusedItem.innerText;
8769    let listbox = $(focusedItem).closest('.listbox-area');
8770    let form = listbox.closest('form');
8771    let select = $('select[name="' + listbox.data('selectname').substring(9).replace('_', '.') + '"]', form);
8772    select.val($(focusedItem).data('optionval')).change();
8773};;
8774var newProjektorAdded = function () {
8775    $("form")
8776        .removeData("validator")
8777        .removeData("unobtrusiveValidation");
8778    $.validator.unobtrusive.parse("form");
8779    $("#addprojektor").blur();
8780
8781    infotooltip.init();
8782}
8783
8784var newEntrepenorAdded = function () {
8785    $("form")
8786        .removeData("validator")
8787        .removeData("unobtrusiveValidation");
8788    $.validator.unobtrusive.parse("form");
8789    $("#addentrepenor").blur();
8790
8791    infotooltip.init();
8792}
8793
8794// Kopplar adressfält till hidden field för RequiredIf-validering
8795$(".searchadress-js").each(function () {
8796    var $section = $(this);
8797    var $sourceInput = $section.find(".adressexists");
8798    var $externalIdInput = $section.find("input[id$='ExternalAdressId']");
8799    var $hiddenInput = $section.find("input[id$='Hidden']"); // För RequiredIf, om den finns
8800
8801    $sourceInput.on('typeahead:selected', function (evt, item) {
8802        $externalIdInput.val(item.Id);
8803        if ($hiddenInput.length) {
8804            $hiddenInput.val(item.Totaladress).trigger('change');
8805        }
8806        // Rensa valideringsfel
8807        $(this).removeClass("input-validation-error");
8808        $(this).closest("form").validate().resetForm();
8809    });
8810    $sourceInput.on('change keyup', function () {
8811        if ($hiddenInput.length) {
8812            $hiddenInput.val($(this).val()).trigger('change');
8813        }
8814    });
8815});
8816
8817// Kopplar searchorg till hidden field för RequiredIf-validering
8818function initOrgSync(containerIdPrefix) {
8819    var $sourceInput = $("#" + containerIdPrefix + "_Organisationsnummer");
8820    var $hiddenInput = $("#" + containerIdPrefix + "_Hidden");
8821
8822    if ($sourceInput.length && $hiddenInput.length) {
8823        $sourceInput.on('typeahead:selected change keyup', function () {
8824            $hiddenInput.val($sourceInput.val()).trigger('change');
8825        });
8826    } 
8827}
8828
8829initOrgSync("SearchOrgByggherre");
8830initOrgSync("SearchOrgByggarbetsmiljosamordnare1");
8831
8832//Validate the IP addresses
8833$.validator.addMethod("ipv4validate", function (value, element) {
8834    return this.optional(element) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(value);
8835});
8836
8837$.validator.addMethod("ipv6validate", function (value, element) {
8838    return this.optional(element) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(value);
8839});
8840
8841var forhandsanmalanByggarbetsplatsPage = (function ($) {
8842    var returnObject = {
8843        init: function () {
8844            this.self = this;
8845        },
8846        wireUp: function () {
8847            require(['vendor/popper'], function (popper) {
8848
8849                //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
8850                $("#Place_PlaceArea").on('keyup', function (e) {
8851                    e.stopPropagation();
8852                    $(this).removeClass('input-validation-error')
8853                    $(this).removeClass('valid')
8854                });
8855
8856                //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att lägga till span-taggen på rätt plats efteråt.
8857                $(document).on('focus', '#Place_PlaceArea', function (e) {
8858                    if ($("#adressspan").length == 0) {
8859                        var div = $('<span id="adressspan"></span>');
8860                        $(this).after(div);
8861                    }
8862                });
8863
8864                $(document).ready(function () {
8865                    //Tillse att hidden-fileds ingår i valideringen                
8866                    var validator = $("#forhandsanmalan-byggarbetsplats-form").data('validator');
8867                    if (validator != null) {
8868                        validator.settings.ignore = ":hidden:not(.validate-hidden)";
8869                    }
8870
8871                    $('#ByggherrePersonnummer').rules('add', {
8872                        required: false
8873                    });
8874
8875                    $('div[style*="z-index: 30000"]').hide()
8876
8877                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
8878
8879                    require(['searchadress'], function (postingapplicationsearch) {
8880                        postingapplicationsearch.init();
8881                    });
8882                });
8883
8884                $(".onlynumbers").keydown(function (e) {
8885                    var key = e.charCode || e.keyCode || 0;
8886                    // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
8887                    // home, end, period, and numpad decimal
8888                    return (
8889                        key == 8 ||
8890                        key == 9 ||
8891                        key == 13 ||
8892                        key == 46 ||
8893                        key == 110 ||
8894                        key == 190 ||
8895                        (key >= 35 && key <= 40) ||
8896                        (key >= 48 && key <= 57) ||
8897                        (key >= 96 && key <= 105));
8898                });
8899
8900                var t = $(".projektorindex").last().text();
8901                $(".projektorindex").last().text(t + " 1");
8902
8903                $(document).on('click', '.GetByggCompanies', function (e) {
8904                    var themodule = $(this).closest(".searchcompanymodule");
8905                    var orgnr = themodule.find(".organisationsnummer").val();
8906                    var type = themodule.find(".organisationsnummer").attr('data-type');
8907                    var spinner = themodule.find(".spinner");
8908
8909                    if (type == "entrepenor") {
8910                        var Fornamn = $(themodule).find(".Fornamn").val();
8911                        var Efternamn = $(themodule).find(".Efternamn").val();
8912                        var EntrepenorerTelefonnummer = $(themodule).find(".EntrepenorerTelefonnummer").val();
8913                        var EntrepenorerEpost = $(themodule).find(".EntrepenorerEpost").val();
8914                        var Index = $(themodule).find(".Index").val();
8915
8916                        var query = "&fornamn=" + Fornamn + "&efternamn=" + Efternamn + "&EntrepenorerTelefonnummer=" + EntrepenorerTelefonnummer + "&EntrepenorerEpost=" + EntrepenorerEpost + "&Index=" + Index;
8917                    }
8918
8919                    if (type == "projektor") {
8920                        var ProjektorerTyp = $(themodule).find(".ProjektorerTyp").val();
8921                        var ProjektorerOmfattning = $(themodule).find(".ProjektorerOmfattning").val();
8922                        var ProjektorerTelefonnummer = $(themodule).find(".ProjektorerTelefonnummer").val();
8923                        var Efternamn = $(themodule).find(".Efternamn").val();
8924                        var Fornamn = $(themodule).find(".Fornamn").val();
8925                        var ProjektorerEpost = $(themodule).find(".ProjektorerEpost").val();
8926                        var Index = $(themodule).find(".Index").val();
8927
8928                        var query = "&ProjektorerTyp=" + ProjektorerTyp + "&ProjektorerOmfattning=" + ProjektorerOmfattning + "&ProjektorerTelefonnummer=" + ProjektorerTelefonnummer + "&Fornamn=" + Fornamn + "&Efternamn=" + Efternamn + "&ProjektorerEpost=" + ProjektorerEpost + "&Index=" + Index;
8929                    }
8930
8931                    $.ajax({
8932                        url: window.location.pathname + "/search" + type + "/" + '?orgnummer=' + orgnr + '&GetCompany=SearchOrg' + query,
8933                        method: 'POST'
8934                    }).done(function (data) {
8935                        themodule.html(data);
8936                        newProjektorAdded();
8937                        if (type == "projektor") {
8938                            themodule.find(".ProjektorerTyp").valid();
8939                            themodule.find(".ProjektorerTyp").valid();
8940                            themodule.find(".ProjektorerOmfattning").valid();
8941                            themodule.find(".ProjektorerTelefonnummer").valid();
8942                            themodule.find(".Efternamn").valid();
8943                            themodule.find(".Fornamn").valid();
8944                            themodule.find(".ProjektorerEpost").valid();
8945                        }
8946                        $('.spinner').hide();
8947                    });
8948
8949                    return false;
8950                });
8951
8952                $(document).on('click', '.ClearOrg1', function (e) {
8953                    var themodule = $(this).closest(".searchcompanymodule");
8954                    var orgnr = themodule.find(".organisationsnummer").val();
8955                    var type = themodule.find(".typ").val();
8956
8957                    if (type == "entrepenor") {
8958                        var Fornamn = $(themodule).find(".Fornamn").val();
8959                        var Efternamn = $(themodule).find(".Efternamn").val();
8960                        var EntrepenorerTelefonnummer = $(themodule).find(".EntrepenorerTelefonnummer").val();
8961                        var EntrepenorerEpost = $(themodule).find(".EntrepenorerEpost").val();
8962                        var Index = $(themodule).find(".Index").val();
8963
8964                        var query = "&fornamn=" + Fornamn + "&efternamn=" + Efternamn + "&EntrepenorerTelefonnummer=" + EntrepenorerTelefonnummer + "&EntrepenorerEpost=" + EntrepenorerEpost + "&Index=" + Index;
8965                    }
8966
8967                    if (type == "projektor") {
8968                        var ProjektorerTyp = $(themodule).find(".ProjektorerTyp").val();
8969                        var ProjektorerOmfattning = $(themodule).find(".ProjektorerOmfattning").val();
8970                        var ProjektorerTelefonnummer = $(themodule).find(".ProjektorerTelefonnummer").val();
8971                        var Efternamn = $(themodule).find(".Efternamn").val();
8972                        var Fornamn = $(themodule).find(".Fornamn").val();
8973                        var ProjektorerEpost = $(themodule).find(".ProjektorerEpost").val();
8974                        var Index = $(themodule).find(".Index").val();
8975
8976                        var query = "&ProjektorerTyp=" + ProjektorerTyp + "&ProjektorerOmfattning=" + ProjektorerOmfattning + "&ProjektorerTelefonnummer=" + ProjektorerTelefonnummer + "&Fornamn=" + Fornamn + "&Efternamn=" + Efternamn + "&ProjektorerEpost=" + ProjektorerEpost + "&Index=" + Index;
8977                    }
8978
8979                    $.ajax({
8980                        url: "./search" + type + "/" + '?GetCompany=clear' + query,
8981                        method: 'POST'
8982                    }).done(function (data) {
8983                        themodule.html(data);
8984                        newProjektorAdded();
8985                        if (type == "projektor") {
8986                            themodule.find(".ProjektorerTyp").valid();
8987                            themodule.find(".ProjektorerTyp").valid();
8988                            themodule.find(".ProjektorerOmfattning").valid();
8989                            themodule.find(".ProjektorerTelefonnummer").valid();
8990                            themodule.find(".Efternamn").valid();
8991                            themodule.find(".Fornamn").valid();
8992                            themodule.find(".ProjektorerEpost").valid();
8993                            themodule.find(".organisationsnummer").valid();
8994                        }
8995                        $('.spinner').hide();
8996                    });
8997
8998                    return false;
8999                });
9000
9001                $(".validateorg1").on('contextmenu input', function (e) {
9002                    var resultcontrol = $(".validateorg").closest("div").next("div").find(".validateorgresult").first();
9003
9004                    var orgnr = $(this).val().replace(/ /g, '');
9005                    orgnr = orgnr.replace(/-/g, '');
9006
9007                    var controlnumber = orgnr.substring(2, 3);
9008                    //Om tredje siffran är större än 1 är det inte en enskild firma och då får vi visa företagsnamnet.
9009
9010                    if (orgnr.length == 10 && !e.ctrlKey && controlnumber >= 2) {
9011                        var t = $(this).attr('id');
9012                        var test = /[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/;
9013
9014                        if (orgnr.match(test)) {
9015
9016                            var url = "/SearchOrg"
9017
9018                            $.ajax({
9019                                url: window.location.pathname + url,
9020                                type: "GET",
9021                                cache: false,
9022                                data: { organisationsnummer: orgnr }
9023                            }).done(function (result) {
9024                                if (result != null && result.length > 1) {
9025                                    resultcontrol.val(result);
9026                                    if (result.indexOf("Organisationsnummer") >= 0) {
9027
9028                                        $("#" + t).addClass("input-validation-error");
9029                                        $("#" + t).removeClass("valid");
9030                                    }
9031                                }
9032                                else {
9033                                    //resultcontrol.text("Inget ärende med diarenummer " + orgnr + " kunde hittas.");
9034                                    //$(this).addClass("input-validation-error");
9035                                    //$(this).removeClass("valid");
9036                                }
9037                            });
9038
9039                            return false;
9040                        }
9041                    }
9042                    else {
9043                        resultcontrol.val("");
9044                    }
9045                });
9046
9047                $("#noclick").click(function () {
9048                    return false;
9049                });
9050
9051                $(document).on('click', 'a.remove-projektor', function (event) {
9052                    // We must keep at least one, since it's a required field.
9053                    if ($('#projektorlista .affected-row').length > 1) {
9054                        $(this).closest('.affected-row').remove();
9055                    }
9056                    event.preventDefault();
9057                    return false;
9058                });
9059
9060                $(document).on('click', 'a.remove-entrepenor', function (event) {
9061                    // We must keep at least one, since it's a required field.
9062                    if ($('#entrepenorlista .affected-row').length > 1) {
9063                        $(this).closest('.affected-row').remove();
9064                    }
9065                    event.preventDefault();
9066                    return false;
9067                });
9068
9069                $(document).on('change', '#radiofraga1', function (event) {
9070                    if (($(this).is(":checked"))) {
9071                        $("#byggherreforetag").show();
9072                        $("#byggherreprivatperson").hide();
9073                        $("#ByggherrePersonnummer").val("");
9074                        $('#SearchOrgByggherre_Organisationsnummer').rules('add', {
9075                            required: true
9076                        });
9077                        $('#SearchOrgByggherre_SelectedOrgnr').rules('add', {
9078                            required: true
9079                        });
9080                    }
9081                });
9082
9083                //Visa privatperson
9084                $(document).on('change', '#radiofraga2', function (event) {
9085                    if (($(this).is(":checked"))) {
9086                        $("#byggherreforetag").hide();
9087                        $("#byggherreprivatperson").show();
9088                        $('#SearchOrgByggherre_Organisationsnummer').rules('add', {
9089                            required: false
9090                        });
9091                        $('#SearchOrgByggherre_SelectedOrgnr').rules('add', {
9092                            required: false
9093                        });
9094                    }
9095                });
9096
9097                /*  uppdragstagare start ===============================*/
9098                //$('#adduppdragstagare1btn').on('click', function (e) {
9099                //    $("#uppdragstagare1div").show();
9100                // /*   $('#IsCompanyHiddenid').val(false);*/
9101                //    $('#adduppdragstagare1btn').hide();
9102                //});
9103
9104                //$('#removeuppdragstagare1btn').on('click', function (e) {
9105                //    $("#uppdragstagare1div").hide();
9106                ///*    $('#IsCompanyHiddenid').val(true);*/
9107                //    $('#adduppdragstagare1btn').show();
9108                //});
9109                /* uppdragstagare stlut ===============================*/
9110
9111                $(document).on('click', '#fillbygg', function (event) {
9112                    $('form').find('input[type=radio]').each(function (e) {
9113                        $(this).attr("checked", "checked");
9114                    });
9115
9116                    var now = new Date();
9117                    var day = ("0" + now.getDate()).slice(-2);
9118                    var month = ("0" + (now.getMonth() + 1)).slice(-2);
9119                    var today = now.getFullYear() + "-" + (month) + "-" + (day);
9120
9121                    $('form').find('input[type=text], textarea').each(function (e) {
9122                        var id = $(this).attr('id');
9123                        if (id != undefined) {
9124
9125                            if ($(this).is(":visible")) {
9126
9127                                $(this).val(id.substring(0, 40));
9128
9129                                if (id.toLowerCase().indexOf("organisationsnummer") >= 0) { $(this).val("5592110505"); }
9130
9131                                if (id.toLowerCase().indexOf("start") >= 0) { $(this).val("04/04/2023"); }
9132
9133                                if (id.toLowerCase().indexOf("slut") >= 0) { $(this).val("04/05/2023"); }
9134
9135                                if (id.toLowerCase().indexOf("antal") >= 0) { $(this).val("12"); }
9136
9137                                if (id.toLowerCase().indexOf("epost") >= 0) { $(this).val(id.substring(0, 10) + "@1test.ttw"); }
9138
9139                            }
9140                        }
9141                    });
9142
9143                    $('form').find('.GetOrg').each(function (e) {
9144                        $(this).click();
9145                    });
9146
9147                    $('form').find('.GetByggCompanies').each(function (e) {
9148                        $(this).click();
9149                    });
9150
9151                });
9152
9153                if (Modernizr.history && $('#forhandsanmalan-byggarbetsplats-form').length) {
9154
9155                    $('input[type=date]').on('input', function (e) {
9156                        updateDates($("#InfoombyggarbetsplatsByggstartdatum"), $("#InfoombyggarbetsplatsByggslutdatum"));
9157                        updateDates($("#Uppdragstagare1Startdatum"), $("#Uppdragstagare1Slutdatum"));
9158                        updateDates($("#Uppdragstagare2Startdatum"), $("#Uppdragstagare2Slutdatum"));
9159                        updateDates($("#Byggarbetsmiljosamordnare1Startdatum"), $("#Byggarbetsmiljosamordnare1Slutdatum"));
9160                        updateDates($("#Byggarbetsmiljosamordnare2Startdatum"), $("#Byggarbetsmiljosamordnare2Slutdatum"));
9161                    });
9162
9163                    function updateDates($date1, $date2) {
9164                        if ($date1.val()) {
9165                            if ($date2.val() && $date2.val() <= $date1.val()) {
9166                                $date2.val(undefined);
9167                                $date2.removeClass('valid input-validation-error');
9168                            }
9169                            $date2.attr("min", addDays($date1.val(), 1));
9170                        }
9171                        else {
9172                            $date1.removeClass('valid input-validation-error');
9173                        }
9174
9175                        if (!$date2.val()) {
9176                            $date2.removeClass('valid input-validation-error');
9177                        }
9178                    }
9179
9180                    function addDays(date, days) {
9181                        var result = new Date(date);
9182                        result.setDate(result.getDate() + days);
9183
9184                        return result.toLocaleDateString("sv-SE", {
9185                            year: "numeric",
9186                            month: "2-digit",
9187                            day: "2-digit"
9188                        });
9189                    }
9190
9191                    forhandsanmalanByggarbetsplatsPage.submitTimer($('#forhandsanmalan-byggarbetsplats-form'), 10000);
9192
9193                    $(window).on('popstate', function (e) {
9194                        if (history.state) {
9195                            updateContent(history.state);
9196                        }
9197                    });
9198
9199                    $('input:radio').click(function () {
9200                        var n = this.name;
9201                        $("input[name='" + n + "']").removeClass("input-validation-error");
9202                    });
9203
9204                    $(document).on("submit",
9205                        "#forhandsanmalan-byggarbetsplats-form",
9206                        function () {
9207                            //Hide send button to prevent double posting 
9208                            $(".btn--send").hide();
9209                            //Show spinner
9210                            $("#forhandsanmalan-byggarbetsplats-form i").show();
9211                        });
9212
9213                    $('form').submit(function () {
9214                        if (!$(this).valid()) {
9215
9216                            $(".validation-summary-errors").attr('role', 'alert');
9217                            $(".validation-summary-errors").attr("tabindex", -1).focus();
9218
9219                            return false;
9220                        }
9221                    });
9222                }
9223            })
9224        },
9225        submitTimer: function (form, wait) {
9226            $('#send-btn').prop('disabled', true);
9227            var timerFinished = false;
9228            form.on("submit", function (event) {
9229                if (timerFinished === false) {
9230                    return false;
9231                } else {
9232                    return true;
9233                }
9234            });
9235
9236            setTimeout(function () {
9237                timerFinished = true;
9238                $('#send-btn').prop('disabled', false);
9239            }, wait);
9240        }
9241    };
9242
9243    returnObject.init();
9244    return returnObject;
9245})(jQuery);
9246;
9247var mobilequartzApplicationPage = (function ($) {
9248    var returnObject = {
9249        init: function () {
9250            this.self = this;
9251        },
9252        wireUp: function () {
9253
9254            //console.log('mobilequartzApplicationPage');
9255         
9256            if (Modernizr.history && $('#mobilequartz-application-form').length) {
9257
9258                mobilequartzApplicationPage.submitTimer($('#mobilequartz-application-form'), 10000);
9259
9260                $(document).ready(function () {
9261
9262                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
9263                        $(document).attr('title'));
9264
9265                    updateSelections();
9266                });
9267
9268                $(document).on('blur change',
9269                    '.location-group',
9270                    function () {
9271                        $(this).valid();
9272                    });
9273
9274                $(document).on('blur change',
9275                    '.othertext',
9276                    function () {
9277                        $(this).valid();
9278                    });
9279
9280                $(document).on('blur change',
9281                    '.selected-mobileplant-type',
9282                    function () {
9283                        updateSelections();
9284                        $(this).valid();
9285                    });
9286
9287                $(document).on('blur change',
9288                    '.selected-whatiscrushed',
9289                    function () {
9290                        updateSelections();
9291                        $(this).valid();
9292                    });
9293
9294                $(document).on("submit",
9295                    "#mobilequartz-application-form",
9296                    function () {
9297                        //Hide send button to prevent double posting 
9298                        $(".btn--send").hide();
9299                        //Show spinner
9300                        $("#mobilequartz-application-form i").show();
9301                    });
9302
9303                $('form').submit(function () {
9304                    if (!$(this).valid()) {
9305
9306                        $(".validation-summary-errors").attr('role', 'alert');
9307                        $(".validation-summary-errors").attr("tabindex", -1).focus();
9308
9309                        return false;
9310                    }
9311                });
9312
9313                $('input[type=date]').on('input', function () {
9314                    updateDates();
9315                });
9316            }
9317        },
9318        submitTimer: function (form, wait) {
9319            $('#send-btn').prop('disabled', true);
9320            var timerFinished = false;
9321            form.on("submit", function (event) {
9322                if (timerFinished === false) {
9323                    return false;
9324                } else {
9325                    return true;
9326                }
9327            });
9328
9329            setTimeout(function () {
9330                timerFinished = true;
9331                $('#send-btn').prop('disabled', false);
9332            }, wait);
9333        }
9334    };
9335
9336    function updateSelections() {
9337        var mobileplant = $('.selected-mobileplant-type option:selected').val();
9338
9339        if (mobileplant === "0") {
9340            
9341            $('#div-whatiscrushed').show();
9342
9343            var whatiscrushed = $('.selected-whatiscrushed option:selected').val();
9344
9345            if (whatiscrushed === "3") {
9346                
9347                $('#div-othertext').show();
9348            }
9349            else {
9350                $('#div-othertext').hide();
9351            }
9352        }
9353        else {
9354            $('#div-whatiscrushed').hide();
9355            $('#div-othertext').hide();
9356        }
9357    }
9358
9359    function updateDates() {
9360
9361        var $date1 = $('input[type=date]').eq(0);
9362        var $date2 = $('input[type=date]').eq(1);
9363        var $date3 = $('input[type=date]').eq(2);
9364
9365        if ($date1.val()) {
9366            if ($date2.val() && $date2.val() <= $date1.val()) {
9367                $date2.val(undefined);
9368                $date2.removeClass('valid input-validation-error');
9369            }
9370            else {
9371                $date3.attr("min", addDays($date1.val(), 1));
9372            }
9373            $date2.attr("min", addDays($date1.val(), 1));
9374            if ($date3.val() && $date3.val() <= $date1.val()) {
9375                $date3.val(undefined);
9376                $date3.removeClass('valid input-validation-error');
9377            }
9378        }
9379        else {
9380            $date1.removeClass('valid input-validation-error');
9381        }
9382
9383        if ($date2.val()) {
9384            if ($date3.val() && $date3.val() <= $date2.val()) {
9385                $date3.val(undefined);
9386                $date3.removeClass('valid input-validation-error');
9387            }
9388            $date3.attr("min", addDays($date2.val(), 1));
9389        }
9390        else {
9391            $date2.removeClass('valid input-validation-error');
9392        }
9393
9394        if (!$date3.val()) {
9395            $date3.removeClass('valid input-validation-error');
9396        }
9397    }
9398
9399    function addDays(date, days) {
9400        var result = new Date(date);
9401        result.setDate(result.getDate() + days);
9402
9403        return result.toLocaleDateString("sv-SE", {
9404            year: "numeric",
9405            month: "2-digit",
9406            day: "2-digit"
9407        });
9408    }
9409
9410    returnObject.init();
9411    return returnObject;
9412})(jQuery);
9413;
9414var atl19aPage = (function ($) {
9415    var returnObject = {
9416        init: function () {
9417            this.self = this;
9418        },
9419        wireUp: function () {
9420            $("#noclick").click(function () {
9421                return false;
9422            });
9423            if (Modernizr.history && $('#atl19-application-form').length) {
9424
9425                atl19aPage.submitTimer($('#atl19-application-form'), 10000);
9426
9427                $(document).ready(function () {
9428
9429                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
9430                        $(document).attr('title'));
9431                    enableValidationOnHidden('#atl19-application-form');
9432                });
9433
9434                $(document).on("submit",
9435                    "#atl19-application-form",
9436                    function (event) {
9437                        //Hide send button to prevent double posting 
9438                        $(".btn--send").hide();
9439                        //Show spinner
9440                        $("#atl19-application-form i").show();
9441                    });
9442
9443                $(document).ready(function () {
9444                    $("#SvarFil1Filename").on('DOMSubtreeModified', function () {
9445                        if ($("#SvarFil1Filename").text().length > 0 && $("#SvarFil1Filename").text() !== "") {
9446                            $("#ArbetsgivareSvar").prop("checked", false);
9447                            $("#arbetsgivaresvardiv").hide();
9448                            $("#ArbetsgivareSvar").valid();
9449                        }
9450                        else {
9451                            $("#arbetsgivaresvardiv").show();
9452                            $("#ArbetsgivareSvar").valid();
9453                          
9454                        }
9455                    });
9456
9457                });
9458
9459                $(document).on('change', '#ArbetsgivareSvar', function (event) {
9460                    if (($(this).is(":checked"))) {
9461
9462                        $("#FilBSection").hide();
9463                    }
9464                    else {
9465                        $("#FilBSection").show();
9466                    }
9467                });
9468
9469                $('.undofileselection').each(function () {
9470                   
9471                    $(this).on('click', function (e) {
9472                        $(this).parent().find(".inputfiletext").html("");
9473                        $(this).parent().find(".inputfile").replaceWith($(this).parent().find(".inputfile").val('').clone(true));
9474                        $(this).parent().find(".undofileselection").hide();
9475                        $(this).parent().find(".undofileselection").addClass("rs_skip");
9476                        $(this).parent().find(".inputfile").valid();
9477                        $(this).parent().find(".filelabel").show();
9478                    });
9479                })
9480
9481                // Input file
9482                $('.inputfile').each(function () {
9483                    const $input = $(this);
9484                    const id = $input.attr('id');
9485                    const $btnChoose = $('#' + id).next('label');
9486                    const $btnClear = $('#' + id + 'Clear');
9487                    const $filename = $('#' + id + 'Filename');
9488
9489                    const fileSection = id.substring(3, 4);
9490                    const $section = $('#Fil' + fileSection + 'Section');
9491                    const $maxCountText = $('#Fil' + fileSection + 'MaxCount');
9492
9493                    const noFileText = $input.val();
9494
9495                    const showHolder = function ($holder) {
9496                        $holder.removeClass('hidden rs_skip').show();
9497                    };
9498
9499                    const hideHolder = function ($holder) {
9500                        $holder.addClass('hidden rs_skip').hide();
9501                    };
9502
9503                    const showElement = function ($el) {
9504                        $el.removeClass('hidden rs_skip').show();
9505                    };
9506
9507                    const hideElement = function ($el) {
9508                        $el.addClass('hidden rs_skip').hide();
9509                    };
9510
9511                    const visibleHolders = function () {
9512                        return $section.find('div.fileholder').not('.hidden');
9513                    };
9514
9515                    const hiddenHolders = function () {
9516                        return $section.find('div.fileholder.hidden');
9517                    };
9518
9519                    const refreshMaxCountText = function () {
9520                        const slotsLeft = hiddenHolders().length;
9521
9522                        if (slotsLeft > 0) {
9523                            hideElement($maxCountText);
9524                            return;
9525                        }
9526
9527                        const $lastInput = visibleHolders().last().find('.inputfile:first');
9528                        if ($lastInput.val() !== '') {
9529                            showElement($maxCountText);
9530                        } else {
9531                            hideElement($maxCountText);
9532                        }
9533                    };
9534
9535                    $input.on('change', function (e) {
9536                        const rawValue = e.target.value || '';
9537                        const fileName = rawValue ? rawValue.split('\\').pop() : '';
9538
9539                        if (!fileName) {
9540                            return;
9541                        }
9542
9543                        const $nextHolder = hiddenHolders().first();
9544                        if ($nextHolder.length) {
9545                            $nextHolder.appendTo($section);
9546                            showHolder($nextHolder);
9547                        }
9548
9549                        $filename.html(fileName);
9550                        showElement($btnClear);
9551                        hideElement($btnChoose);
9552
9553                        $section.find('.inputfile').removeClass('input-validation-error');
9554
9555                        refreshMaxCountText();
9556                    });
9557
9558                    $btnClear.on('click', function (e) {
9559                        e.preventDefault();
9560
9561                        $input.val('');
9562                        $filename.html(noFileText);
9563
9564                        hideElement($btnClear);
9565                        showElement($btnChoose);
9566
9567                        let emptySlotKept = false;
9568
9569                        $(visibleHolders().get().reverse()).each(function () {
9570                            const $holder = $(this);
9571                            const $holderInput = $holder.find('.inputfile:first');
9572
9573                            if ($holderInput.val() !== '') {
9574                                $holder.prependTo($section);
9575                            } else if (emptySlotKept) {
9576                                hideHolder($holder);
9577                            } else {
9578                                emptySlotKept = true;
9579                            }
9580                        });
9581
9582                        refreshMaxCountText();
9583                    });
9584
9585                    $input
9586                        .on('focus', function () { $input.addClass('has-focus'); })
9587                        .on('blur', function () { $input.removeClass('has-focus'); });
9588                });
9589
9590                $('input:radio').click(function () {
9591                    var n = this.name;
9592                    $("input[name='" + n + "']").removeClass("input-validation-error");
9593                });
9594            }
9595        },
9596        submitTimer: function (form, wait) {
9597            $('#send-btn').prop('disabled', true);
9598            var timerFinished = false;
9599            form.on("submit", function (event) {
9600                if (timerFinished === false) {
9601                    return false;
9602                } else {
9603                    return true;
9604                }
9605            });
9606
9607            setTimeout(function () {
9608                timerFinished = true;
9609                $('#send-btn').prop('disabled', false);
9610            }, wait);
9611        }
9612    };
9613
9614    function enableValidationOnHidden(formId) {
9615        $.validator.setDefaults({ ignore: '' });
9616        $(formId)
9617            .removeData("validator")
9618            .removeData("unobtrusiveValidation");
9619        $.validator
9620            .unobtrusive
9621            .parse(formId);
9622    }
9623
9624
9625    $('form').submit(function () {
9626
9627        //enableValidationOnHidden('#atl19-application-form');
9628
9629        //if (!$(this).valid()) {
9630
9631        //    $(".validation-summary-errors").attr('role', 'alert');
9632        //    $(".validation-summary-errors").attr("tabindex", -1).focus();
9633
9634        //    return false;
9635        //}
9636    });
9637
9638    returnObject.init();
9639    return returnObject;
9640})(jQuery);
9641;
9642var begaran66aPage = (function ($) {
9643    var returnObject = {
9644        init: function () {
9645            this.self = this;
9646        },
9647        wireUp: function () {
9648            $("#noclick").click(function () {
9649                return false;
9650            });
9651
9652            if (Modernizr.history && $('#Begaran66a-application-form').length) {
9653
9654                begaran66aPage.submitTimer($('#Begaran66a-application-form'), 10000);
9655
9656                $(document).ready(function () {
9657
9658                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
9659                        $(document).attr('title'));
9660                    enableValidationOnHidden('#Begaran66a-application-form');
9661                });
9662
9663
9664                $(document).on("submit",
9665                    "#Begaran66a-application-form",
9666                    function (event) {
9667                        //Hide send button to prevent double posting 
9668                        $(".btn--send").hide();
9669                        //Show spinner
9670                        $("#Begaran66a-application-form i").show();
9671                    });
9672
9673                $('form').submit(function () {
9674
9675                    enableValidationOnHidden('#Begaran66a-application-form');
9676
9677                    if (!$(this).valid()) {
9678
9679                        $(".validation-summary-errors").attr('role', 'alert');
9680                        $(".validation-summary-errors").attr("tabindex", -1).focus();
9681
9682                        return false;
9683                    }
9684                });
9685
9686                $(document).ready(function () {
9687                    $("#SvarFil1Filename").on('DOMSubtreeModified', function () {
9688                        if ($("#SvarFil1Filename").text().length > 0) {
9689                            $("#ArbetsgivareSvar").prop("checked", false);
9690                            $("#arbetsgivaresvardiv").hide();
9691                        }
9692                    });
9693                });
9694
9695                $(document).ready(function () {
9696                    $("#SvarFil1Filename").on('DOMSubtreeModified', function () {
9697                        if ($("#SvarFil1Filename").text().length > 0 && $("#SvarFil1Filename").text() !== "") {
9698                            $("#ArbetsgivareSvar").prop("checked", false);
9699                            $("#arbetsgivaresvardiv").hide();
9700                            $("#ArbetsgivareSvar").valid();
9701                        }
9702                        else {
9703                            $("#arbetsgivaresvardiv").show();
9704                            $("#ArbetsgivareSvar").valid();
9705
9706                        }
9707                    });
9708
9709                });
9710
9711                $(document).on('change', '#ArbetsgivareSvar', function (event) {
9712                    if (($(this).is(":checked"))) {
9713
9714                        $("#FilBSection").hide();
9715                    }
9716                    else {
9717                        $("#FilBSection").show();
9718                    }
9719                });
9720
9721                // INPUT File
9722
9723                $('.undofileselection').each(function () {
9724
9725                    $(this).on('click', function (e) {
9726                        $(this).parent().find(".inputfiletext").html("");
9727                        $(this).parent().find(".inputfile").replaceWith($(this).parent().find(".inputfile").val('').clone(true));
9728                        $(this).parent().find(".undofileselection").hide();
9729                        $(this).parent().find(".undofileselection").addClass("rs_skip");
9730                        $(this).parent().find(".inputfile").valid();
9731                        $(this).parent().find(".filelabel").show();
9732                    });
9733                })
9734
9735                // INPUT File
9736                $('.inputfile').each(function () {
9737                    const $input = $(this);
9738                    const id = $input.attr('id');
9739                    const $btnChoose = $('#' + id).next('label');
9740                    const $btnClear = $('#' + id + 'Clear');
9741                    const $filename = $('#' + id + 'Filename');
9742
9743                    const fileSection = id.substring(3, 4);
9744                    const $section = $('#Fil' + fileSection + 'Section');
9745                    const $maxCountText = $('#Fil' + fileSection + 'MaxCount');
9746
9747                    const noFileText = $input.val();
9748
9749                    const showHolder = function ($holder) {
9750                        $holder.removeClass('hidden rs_skip').show();
9751                    };
9752
9753                    const hideHolder = function ($holder) {
9754                        $holder.addClass('hidden rs_skip').hide();
9755                    };
9756
9757                    const showElement = function ($el) {
9758                        $el.removeClass('hidden rs_skip').show();
9759                    };
9760
9761                    const hideElement = function ($el) {
9762                        $el.addClass('hidden rs_skip').hide();
9763                    };
9764
9765                    const visibleHolders = function () {
9766                        return $section.find('div.fileholder').not('.hidden');
9767                    };
9768
9769                    const hiddenHolders = function () {
9770                        return $section.find('div.fileholder.hidden');
9771                    };
9772
9773                    const refreshMaxCountText = function () {
9774                        const slotsLeft = hiddenHolders().length;
9775
9776                        if (slotsLeft > 0) {
9777                            hideElement($maxCountText);
9778                            return;
9779                        }
9780
9781                        const $lastInput = visibleHolders().last(
9781).find('.inputfile:first');
9782                        if ($lastInput.val() !== '') {
9783                            showElement($maxCountText);
9784                        } else {
9785                            hideElement($maxCountText);
9786                        }
9787                    };
9788
9789                    $input.on('change', function (e) {
9790                        const rawValue = e.target.value || '';
9791                        const fileName = rawValue ? rawValue.split('\\').pop() : '';
9792
9793                        if (!fileName) {
9794                            return;
9795                        }
9796
9797                        const $nextHolder = hiddenHolders().first();
9798                        if ($nextHolder.length) {
9799                            $nextHolder.appendTo($section);
9800                            showHolder($nextHolder);
9801                        }
9802
9803                        $filename.html(fileName);
9804                        showElement($btnClear);
9805                        hideElement($btnChoose);
9806
9807                        $section.find('.inputfile').removeClass('input-validation-error');
9808
9809                        refreshMaxCountText();
9810                    });
9811
9812                    $btnClear.on('click', function (e) {
9813                        e.preventDefault();
9814
9815                        $input.val('');
9816                        $filename.html(noFileText);
9817
9818                        hideElement($btnClear);
9819                        showElement($btnChoose);
9820
9821                        let emptySlotKept = false;
9822
9823                        $(visibleHolders().get().reverse()).each(function () {
9824                            const $holder = $(this);
9825                            const $holderInput = $holder.find('.inputfile:first');
9826
9827                            if ($holderInput.val() !== '') {
9828                                $holder.prependTo($section);
9829                            } else if (emptySlotKept) {
9830                                hideHolder($holder);
9831                            } else {
9832                                emptySlotKept = true;
9833                            }
9834                        });
9835
9836                        refreshMaxCountText();
9837                    });
9838
9839                    $input
9840                        .on('focus', function () { $input.addClass('has-focus'); })
9841                        .on('blur', function () { $input.removeClass('has-focus'); });
9842                });
9843
9844                $('input:radio').click(function () {
9845                    var n = this.name;
9846                    $("input[name='" + n + "']").removeClass("input-validation-error");
9847                });
9848            }
9849        },
9850        submitTimer: function (form, wait) {
9851            $('#send-btn').prop('disabled', true);
9852            var timerFinished = false;
9853            form.on("submit", function (event) {
9854                if (timerFinished === false) {
9855                    return false;
9856                } else {
9857                    return true;
9858                }
9859            });
9860
9861            setTimeout(function () {
9862                timerFinished = true;
9863                $('#send-btn').prop('disabled', false);
9864            }, wait);
9865        }
9866    };
9867
9868    $('form').submit(function () {
9869
9870    });
9871
9872    function enableValidationOnHidden(formId) {
9873        $.validator.setDefaults({ ignore: '' });
9874        $(formId)
9875            .removeData("validator")
9876            .removeData("unobtrusiveValidation");
9877        $.validator
9878            .unobtrusive
9879            .parse(formId);
9880    }
9881
9882    returnObject.init();
9883    return returnObject;
9884})(jQuery);
9885
9886
9887
9888
9889;
9890var ansokanStatsBidragAkrimPage = (function ($) {
9891    var returnObject = {
9892        init: function () {
9893            this.self = this;
9894        },
9895        wireUp: function () {
9896            $("#noclick").click(function () {
9897                return false;
9898            });
9899            if (Modernizr.history && $('#ansokanAkrim-application-form').length) {
9900
9901                ansokanStatsBidragAkrimPage.submitTimer($('#ansokanAkrim-application-form'), 10000);
9902
9903                $(document).ready(function () {
9904
9905                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
9906                        $(document).attr('title'));
9907                });
9908
9909                $(document).on("submit",
9910                    "#ansokanAkrim-application-form",
9911                    function (event) {
9912                        //Hide send button to prevent double posting 
9913                        $(".btn--send").hide();
9914                        //Show spinner
9915                        $("#ansokanAkrim-application-form i").show();
9916                    });
9917
9918                $('#addcompanybtn').on('click', function (e) {
9919                    $("#newcompanyinfodiv").show();
9920                    $('#IsCompanyHiddenid').val(false);
9921                    $('#addcompanybtn').hide();
9922                });
9923
9924                $('#removecompanybtn').on('click', function (e) {
9925                    $("#newcompanyinfodiv").hide();
9926                    $('#IsCompanyHiddenid').val(true);
9927                    $('#addcompanybtn').show();
9928                });
9929
9930                $("#BidragMottagare").on("change", function () {
9931                    if ($(this).is(":checked")) {
9932                        $("#bankplusgirohuvudorg").show();
9933                        $("#Org2BidragMottagare").prop("checked", false);
9934                        $("#org2bankplusgirohuvudorg").hide();
9935                        $("#Org2BankPlusGiro").val(undefined);
9936                    } else {
9937                        $("#bankplusgirohuvudorg").hide();
9938                        $("#BankPlusGiro").val(undefined);
9939                    }
9940                });
9941
9942                $("#Org2BidragMottagare").on("change", function () {
9943                    if ($(this).is(":checked")) {
9944                        $("#org2bankplusgirohuvudorg").show();
9945                        $("#BidragMottagare").prop("checked", false);
9946                        $("#bankplusgirohuvudorg").hide();
9947                        $("#BankPlusGiro").val(undefined);
9948                    } else {
9949                        $("#org2bankplusgirohuvudorg").hide();
9950                        $("#Org2BankPlusGiro").val(undefined);
9951                    }
9952                });
9953
9954                $("#otherFinancingja").on("change", function () {
9955                    $("#divotherFinancinginfo").show();
9956                });
9957
9958                $("#otherFinancingno").on("change", function () {
9959                    $("#divotherFinancinginfo").hide();
9960                });
9961
9962                $(".counter").keyup(function () {
9963                    var max = parseInt($(this).attr("data-val-maxlength-max"));    
9964                    var current = $(this).val().length;
9965
9966                    $(this)
9967                        .parent("div")
9968                        .find(".displaycounter")
9969                        .text(max - current);
9970                });
9971
9972                $(document).on('click', 'button.remove-morecosts', function (event) {
9973                    if ($('#morecostslista .affected-row').length > 0) {
9974                        $(this).closest('.affected-row').remove();
9975                    }
9976                    event.preventDefault();
9977                    return false;
9978                });
9979           
9980                $('#addmorecostbtn').on('click', function (e) {
9981                    $("#morecostslista").show();
9982                });
9983
9984                $(".onlynumbersBankgiro").keydown(function (e) {
9985                    var key = e.charCode || e.keyCode || 0;
9986                    // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
9987                    // home, end, period, and numpad decimal
9988                    return (
9989                        key == 8 ||
9990                        key == 9 ||
9991                        key == 13 ||
9992                        key == 46 ||
9993                        key == 110 ||
9994                        key == 189 ||
9995                        key == 190 ||
9996                        (key >= 35 && key <= 40) ||
9997                        (key >= 48 && key <= 57) ||
9998                        (key >= 96 && key <= 105));
9999                });
10000
10001                $(".onlynumbers").keydown(function (e) {
10002                    var key = e.charCode || e.keyCode || 0;
10003                    // allow backspace, tab, delete, enter, arrows, numbers and ke
10003ypad numbers ONLY
10004                    // home, end, period, and numpad decimal
10005                    return (
10006                        key == 8 ||
10007                        key == 9 ||
10008                        key == 13 ||
10009                        key == 46 ||
10010                        key == 110 ||
10011                        key == 190 ||
10012                        (key >= 35 && key <= 40) ||
10013                        (key >= 48 && key <= 57) ||
10014                        (key >= 96 && key <= 105));
10015                });
10016
10017                // INPUT File
10018                $('.inputfile').each(function () {
10019                    var $input = $(this);
10020                    var $label = $input.next('label');
10021                    var labelVal = $label.next('span').html();
10022                    $input.on('change', function (e) {
10023                        var fileName = '';
10024                        if (e.target.value) fileName = e.target.value.split('\\').pop();
10025                        if (fileName) {
10026                            $label.next('span').html(fileName);
10027                            if (fileName !== "Ingen fil har valts.") {
10028                                $("#" + $input.attr("id") + "Clear").show();
10029                                $("#" + $input.attr("id") + "Clear").removeClass("rs_skip");
10030                                $("#" + $input.attr("id") + "Next").show();
10031                                $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
10032                            }
10033                        }
10034                        else
10035                            $label.next('span').html(labelVal);
10036                    });
10037
10038                    // Firefox bug fix
10039                    $input
10040                        .on('focus', function () { $input.addClass('has-focus'); })
10041                        .on('blur', function () { $input.removeClass('has-focus'); });
10042                });
10043            }
10044        },
10045        submitTimer: function (form, wait) {
10046            $('#send-btn').prop('disabled', true);
10047            var timerFinished = false;
10048            form.on("submit", function (event) {
10049                if (timerFinished === false) {
10050                    return false;
10051                } else {
10052                    return true;
10053                }
10054            });
10055
10056            setTimeout(function () {
10057                timerFinished = true;
10058                $('#send-btn').prop('disabled', false);
10059            }, wait);
10060        }
10061    };
10062
10063    $('form').submit(function () {
10064
10065        /* enableValidationOnHidden('#ansokanAkrim-application-form');*/
10066
10067        if (!$(this).valid()) {
10068
10069            $(".validation-summary-errors").attr('role', 'alert');
10070            $(".validation-summary-errors").attr("tabindex", -1).focus();
10071
10072            return false;
10073        }
10074    });
10075
10076    returnObject.init();
10077    return returnObject;
10078})(jQuery);
10079
10080
10081function upploadmorecostsakrim() {
10082    reloadValidation('#ansokanAkrim-application-form');
10083    $(".onlynumbers").keydown(function (e) {
10084        var key = e.charCode || e.keyCode || 0;
10085        // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
10086        // home, end, period, and numpad decimal
10087        return (
10088            key == 8 ||
10089            key == 9 ||
10090            key == 13 ||
10091            key == 46 ||
10092            key == 110 ||
10093            key == 190 ||
10094            (key >= 35 && key <= 40) ||
10095            (key >= 48 && key <= 57) ||
10096            (key >= 96 && key <= 105));
10097    });
10098}
10099
10100function ClearFileUploadAnsokanAkrim(id) {
10101    var fileTextDiv = document.getElementById(id + "Filename");
10102    fileTextDiv.textContent = "Ingen fil har valts.";
10103    $("#" + id).replaceWith($("#" + id).val('').clone(true));
10104
10105    $("#" + id + "Clear").hide();
10106    $("#" + id + "Clear").addClass("rs_skip");
10107};
10108;
10109var ansokanAkrimReportingBackPage = (function ($) {
10110    var returnObject = {
10111        init: function () {
10112            this.self = this;
10113        },
10114        wireUp: function () {
10115            $("#noclick").click(function () {
10116                return false;
10117            });
10118            if (Modernizr.history && $('#ansokanAkrimRepportback-application-form').length) {
10119
10120                ansokanAkrimReportingBackPage.submitTimer($('#ansokanAkrimRepportback-application-form'), 10000);
10121
10122                $(document).ready(function () {
10123
10124                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
10125                        $(document).attr('title'));
10126                });
10127
10128                $(document).on("submit",
10129                    "#ansokanAkrimRepportback-application-form",
10130                    function (event) {
10131                        //Hide send button to prevent double posting 
10132                        $(".btn--send").hide();
10133                        //Show spinner
10134                        $("#ansokanAkrimRepportback-application-form i").show();
10135                    });
10136
10137                $('#addcompanybtn').on('click', function (e) {
10138                    $("#newcompanyinfodiv").show();
10139                    $('#IsCompanyHiddenid').val(false);
10140                    $('#addcompanybtn').hide();
10141                });
10142
10143                $('#removecompanybtn').on('click', function (e) {
10144                    $("#newcompanyinfodiv").hide();
10145                    $('#IsCompanyHiddenid').val(true);
10146                    $('#addcompanybtn').show();
10147                });
10148
10149                $(".counter").keyup(function () {
10150                    var max = parseInt($(this).attr("data-val-maxlength-max"));
10151                    var current = $(this).val().length;
10152
10153                    $(this)
10154                        .parent("div")
10155                        .find(".displaycounter")
10156                        .text(max - current);
10157                });
10158
10159                $("#resourceconsumptionno").on("change", function () {
10160                    $("#divresourceconsumption").show();
10161                });
10162
10163                $("#resourceconsumptionja").on("change", function () {
10164                    $("#divresourceconsumption").hide();
10165                });
10166
10167                $("#otherFinancingja").on("change", function () {
10168                    $("#divotherFinancinginfo").show();
10169                });
10170
10171                $("#otherFinancingno").on("change", function () {
10172                    $("#divotherFinancinginfo").hide();
10173                });
10174
10175                $("#conditiontermsja").on("change", function () {
10176                    $("#divconditionterms").show();
10177                });
10178
10179                $("#conditiontermsno").on("change", function () {
10180                    $("#divconditionterms").hide();
10181                });
10182
10183                $(".onlynumbers").keydown(function (e) {
10184                    var key = e.charCode || e.keyCode || 0;
10185                    // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
10186                    // home, end, period, and numpad decimal
10187                    return (
10188                        key == 8 ||
10189                        key == 9 ||
10190                        key == 13 ||
10191                        key == 46 ||
10192                        key == 110 ||
10193                        key == 190 ||
10194                        (key >= 35 && key <= 40) ||
10195                        (key >= 48 && key <= 57) ||
10196                        (key >= 96 && key <= 105));
10197                });
10198
10199                $(document).on('click', 'button.remove-morecosts', function (event) {
10200                    if ($('#morecostslista .affected-row').length > 1) {
10201                        $(this).closest('.affected-row').remove();
10202                    }
10203                    event.preventDefault();
10204                    return false;
10205                });
10206
10207                // INPUT File
10208                $('.inputfile').each(function () {
10209                    var $input = $(this);
10210                    var $label = $input.next('label');
10211                    var labelVal = $label.next('span').html();
10212                    $input.on('change', function (e) {
10213                        var fileName = '';
10214                        if (e.target.value) fileName = e.target.value.split('\\').pop();
10215                        if (fileName) {
10216                            $label.next('span').html(fileName);
10217                            if (fileName !== "Ingen fil har valts.") {
10218                                $("#" + $input.attr("id") + "Clear").show();
10219                                $("#" + $input.attr("id") + "Clear").removeClass("rs_skip");
10220                                $("#" + $input.attr("id") + "Next").show();
10221                                $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
10222                            }
10223                        }
10224                        else
10225                            $label.next('span').html(labelVal);
10226                    });
10227
10228                    // Firefox bug fix
10229                    $input
10230                        .on('focus', function () { $input.addClass('has-focus'); })
10231                        .on('blur', function () { $input.removeClass('has-focus'); });
10232                });
10233            }
10234        },
10235        submitTimer: function (form, wait) {
10236            $('#send-btn').prop('disabled', true);
10237            var timerFinished = false;
10238            form.on("submit", function (event) {
10239                if (timerFinished === false) {
10240                    return false;
10241                } else {
10242                    return true;
10243                }
10244            });
10245
10246            setTimeout(function () {
10247                timerFinished = true;
10248                $('#send-btn').prop('disabled', false);
10249            }, wait);
10250        }
10251    };
10252
10253    $('form').submit(function () {
10254
10255        /* enableValidationOnHidden('#ansokanAkrimRepportback-application-form');*/
10256
10257        if (!$(this).valid()) {
10258
10259            $(".validation-summary-errors").attr('role', 'alert');
10260            $(".validation-summary-errors").attr("tabindex", -1).focus();
10261
10262            return false;
10263        }
10264    });
10265
10266    returnObject.init();
10267    return returnObject;
10268})(jQuery);
10269
10270function upploadmorecostsakrimreportback() {
10271    reloadValidation('#ansokanAkrimRepportback-application-form');
10272    $(".onlynumbers").keydown(function (e) {
10273        var key = e.charCode || e.keyCode || 0;
10274        // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
10275        // home, end, period, and numpad decimal
10276        return (
10277            key == 8 ||
10278            key == 9 ||
10279            key == 13 ||
10280            key == 46 ||
10281            key == 110 ||
10282            key == 190 ||
10283            (key >= 35 && key <= 40) ||
10284            (key >= 48 && key <= 57) ||
10285            (key >= 96 && key <= 105));
10286    });
10287}
10288
10289function reloadValidation(formId) {
10290
10291    var validator = $(formId).data('validator');
10292
10293    if (validator) {
10294        $(formId)
10295            .removeData("validator")
10296            .removeData("unobtrusiveValidation");
10297        $.validator
10298            .unobtrusive
10299            .parse(formId);
10300    }
10301}
10302
10303function ClearFileUploadAkrimreportBack(id) {
10304    var fileTextDiv = document.getElementById(id + "Filename");
10305    fileTextDiv.textContent = "Ingen fil har valts.";
10306    $("#" + id).replaceWith($("#" + id).val('').clone(true));
10307
10308    $("#" + id + "Clear").hide();
10309    $("#" + id + "Clear").addClass("rs_skip");
10310};
10311
10312
10313
10314;
10315var searchcompany = (function ($) {
10316    var returnObject = {
10317        init: function () {
10318            this.self = this;
10319        },
10320        wireUp: function () {
10321            $(document).ready(function () {
10322
10323                    $(document).on('click', '.GetCompanies', function (e) {
10324                        var action = "/modules/AV.Web/searchcompany/search/";
10325                        var themodule = $(this).closest(".searchcompanymodule");
10326                        var orgnr = themodule.find(".organisationsnummer").val();
10327                        var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10328                        var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10329                        var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10330
10331                        $('.spinner', themodule).show();
10332                        $.ajax({
10333                            url: action + '?orgnummer=' + orgnr + '&GetCompany=SearchCompany&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText,
10334                            method: 'POST'
10335                        }).done(function (data) {
10336                            updateElements(themodule[0], data);
10337                            $('.spinner', themodule).hide();
10338                        });
10339                        return false;
10340                    });
10341
10342                    $(document).on('change', '.SelectedOrt', function (e) {
10343                        var themodule = $(this).closest(".searchcompanymodule");
10344                        var orgnr = themodule.find(".organisationsnummer").val();
10345                        var ort = themodule.find(".SelectedOrt").val();
10346                        var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10347                        var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10348                        var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10349                        var action = "/modules/AV.Web/searchcompany/search/"
10350                        $.ajax({
10351                            url: action + '?orgnummer=' + orgnr + '&ort=' + ort + '&GetCompany=ortUpdated&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText,
10352                            method: 'POST'
10353                        }).done(function (data) {
10354                            themodule.replaceWith(data);
10355                        });
10356                        return false;
10357                    });
10358
10359
10360                    $(document).on('change', '.SelectedAstId', function (e) {
10361                        var themodule = $(this).closest(".searchcompanymodule");
10362                        var orgnr = themodule.find(".organisationsnummer").val();
10363                        var ort = themodule.find(".SelectedOrt").val();
10364                        var astcfar = themodule.find(".SelectedAstId").val();
10365                        var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10366                        var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10367                        var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10368                        var action = "/modules/AV.Web/searchcompany/search/"
10369                        $.ajax({
10370                            url: action + '?AstCfar=' + astcfar + '&orgnummer=' + orgnr + '&ort=' + ort + '&GetCompany=astUpdated&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText,
10371                            method: 'POST'
10372                        }).done(function (data) {
10373                            themodule.replaceWith(data);
10374                        });
10375                        return false;
10376                    });
10377
10378
10379                    $(document).on('click', '.GetNewCompanies', function (e) {
10380                        var form = $('#report-asbestrivning-form');
10381                        var query = $(form).serialize();
10382                        var action = $(form).attr('action');
10383                     /*   $('.spinner').show('inline-block');*/
10384                        $.ajax({
10385                            url: action + '?' + query + '&GetCompany=SearchNewCompany',
10386                            method: 'POST'
10387                        }).done(function (data) {
10388                            $('#SearchCompany').html(data);
10389                         /*   $('.spinner').hide();*/
10390                        });
10391                        return false;
10392                    });
10393
10394
10395            });
10396        }
10397    };
10398
10399    returnObject.init();
10400    return returnObject;
10401})(jQuery);;
10402var searchorg = (function ($) {
10403    var returnObject = {
10404        init: function () {
10405            this.self = this;
10406        },
10407        wireUp: function () {
10408            $(document).ready(function () {
10409
10410                $(document).on('contextmenu input paste', '.validateorg_________', function (e) {
10411                    var action = "/modules/AV.Web/searchorg/search/";
10412                    var resultcontrol = $(this).closest(".validateorgresult");
10413                    var themodule = $(this).closest(".searchcompanymodule");
10414
10415                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10416                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10417                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val()
10418                    var language = themodule.find('input[name="language"]').val();
10419                    var t = $(this).attr('id');
10420
10421                    $("#" + t).removeClass("valid");
10422
10423                    var orgnr = $(this).val().replace(/ /g, '');
10424                    orgnr = orgnr.replace(/-/g, '');
10425
10426                    var controlnumber = orgnr.substring(2, 3);
10427                    //Om tredje siffran är större än 1 är det inte en enskild firma och då får vi visa företagsnamnet.
10428
10429                    if (orgnr.length == 10 && !e.ctrlKey && controlnumber >= 2) {
10430
10431                        var test = /[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/;
10432
10433                        if (orgnr.match(test)) {
10434
10435                            var url = action + '?orgnummer=' + orgnr + '&GetCompany=SearchCompany&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText + "&language=" + language;
10436                            $.ajax({
10437                                url: url,
10438                                type: "GET",
10439                                cache: false,
10440                                data: { organisationsnummer: orgnr }
10441                            }).done(function (result) {
10442                                if (result != null && result.length > 1) {
10443                                    //  alert(result);
10444                                    //resultcontrol.replaceWith(result);
10445                                    updateElements(themodule[0], data);
10446                                    if (result.indexOf("Organisationsnummer") >= 0) {
10447
10448                                        $("#" + t).addClass("input-validation-error");
10449                                        $("#" + t).removeClass("valid");
10450                                        //   alert("2");
10451                                    }
10452                                }
10453                                else {
10454                                    //resultcontrol.text("Inget ärende med diarenummer " + orgnr + " kunde hittas.");
10455                                    //$(this).addClass("input-validation-error");
10456                                    //$(this).removeClass("valid");
10457                                }
10458                            });
10459
10460                            return false;
10461                        }
10462                    }
10463                    else {
10464                        resultcontrol.val("");
10465                    }
10466                });
10467
10468                /* Sök företag*/
10469                $(document).on('click', '.GetOrg', function (e) {
10470                    var action = "/modules/AV.Web/searchorg/search/";
10471                    var themodule = $(this).closest(".searchorgmodule");
10472                    var orgnr = themodule.find(".organisationsnummer").val();
10473                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10474                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10475                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10476                    var language = themodule.find('input[name="language"]').val();
10477
10478                    $('.spinner', themodule).show();
10479                
10480                    $.ajax({
10481                        url: action + '?orgnummer=' + orgnr + '&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText + "&language=" + language,
10482                        method: 'POST'
10483                    }).done(function (data) {
10484                        //themodule.replaceWith(data);
10485                        updateElements(themodule[0], data);
10486                        $('.spinner', themodule).hide();
10487                    });
10488                    return false;
10489                });
10490
10491                $(document).on('click', '.ClearOrg', function (e) {
10492                    var action = "/modules/AV.Web/searchorg/clear/";
10493                    var themodule = $(this).closest(".searchorgmodule");
10494                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10495                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10496                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10497
10498                   
10499                    $.ajax({
10500                        url: action + '?prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText,
10501                        method: 'POST'
10502                    }).done(function (data) {
10503                        //themodule.replaceWith(data);
10504                        updateElements(themodule[0], data);
10505                        $('.spinner').hide();
10506                    });
10507                    return false;
10508                });
10509
10510
10511               /* Sök organisation*/
10512                $(document).on('click', '.GetOrganisation', function (e) {
10513                    var action = "/modules/AV.Web/SearchOrganisation/search/";
10514                    var themodule = $(this).closest(".searchorgmodule");
10515                    var orgnr = themodule.find(".organisationsnummer").val();
10516                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10517                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10518                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10519                    var language = themodule.find('input[name="language"]').val();
10520
10521                    $('.spinner', themodule).show();
10522
10523                    $.ajax({
10524                        url: action + '?orgnummer=' + orgnr + '&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText + "&language=" + language,
10525                        method: 'POST'
10526                    }).done(function (data) {
10527                        //themodule.replaceWith(data);
10528                        updateElements(themodule[0], data);
10529                        $('.spinner', themodule).hide();
10530                    });
10531                    return false;
10532                });
10533
10534                $(document).on('click', '.ClearOrganisation', function (e) {
10535                    var action = "/modules/AV.Web/SearchOrganisation/clear/";
10536                    var themodule = $(this).closest(".searchorgmodule");
10537                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10538                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10539                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10540
10541
10542                    $.ajax({
10543                        url: action + '?prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText,
10544                        method: 'POST'
10545                    }).done(function (data) {
10546                        //themodule.replaceWith(data);
10547                        updateElements(themodule[0], data);
10548                        $('.spinner').hide();
10549                    });
10550                    return false;
10551                });
10552
10553                //Sök förtetag no required
10554
10555                $(document).on('click', '.GetOrgNotRequired', function (e) {
10556                    var action = "/modules/AV.Web/SearchOrgNotRequired/search/";
10557                    var themodule = $(this).closest(".searchorgmodule");
10558                    var orgnr = themodule.find(".organisationsnummer").val();
10559                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10560                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10561                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10562                    var spinner = themodule.find(".spinner");
10563                    var language = themodule.find('input[name="language"]').val();
10564
10565                    $('.spinner', themodule).show();
10566
10567                    $.ajax({
10568                        url: action + '?orgnummer=' + orgnr + '&prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText + "&ValdLabelText=" + ValdLabelText  + "&language=" + language,
10569                        method: 'POST'
10570                    }).done(function (data) {
10571                        //themodule.replaceWith(data);
10572                        updateElements(themodule[0], data);
10573                        $('.spinner', themodule).hide();
10574                    });
10575                    return false;
10576                });
10577
10578                $(document).on('click', '.ClearOrgNotRequired', function (e) {
10579                    var action = "/modules/AV.Web/SearchOrgNotRequired/clear/";
10580                    var themodule = $(this).closest(".searchorgmodule");
10581                    var prefix = themodule.parent().find(".HtmlFieldPrefix").val();
10582                    var OrganisationsnummerLabelText = themodule.parent().find(".OrganisationsnummerLabelText").val();
10583                    var ValdLabelText = themodule.parent().find(".ValdLabelText").val();
10584
10585
10586                    $.ajax({
10587                        url: action + '?prefix=' + prefix + "&OrganisationsnummerLabelText=" + OrganisationsnummerLabelText,
10588                        method: 'POST'
10589                    }).done(function (data) {
10590                        //themodule.replaceWith(data);
10591                        updateElements(themodule[0], data);
10592                        $('.spinner').hide();
10593                    });
10594                    return false;
10595                });
10596
10597            });
10598        }
10599    };
10600
10601    returnObject.init();
10602    return returnObject;
10603})(jQuery);;
10604const findcompany = (function () {
10605    var returnObject = {
10606        init: function () {
10607            this.self = this;
10608        },
10609        wireUp: function () {
10610            const modules = document.querySelectorAll('.findcompanymodule');
10611
10612            modules.forEach(module => {
10613                const searchcompanymodule = (function (themodule) {
10614                    var returnObject = {
10615                        init: function () {
10616                            this.self = this;
10617                            this.themodule = themodule;
10618                            this.IncludeAstSelection = themodule.dataset.includeastselection;
10619                            this.initComponents();
10620                        },
10621                        initComponents: function () {
10622                            this.components = {
10623                                organisationsnummer: this.themodule.querySelector(".organisationsnummer"),
10624                                HtmlFieldPrefix: this.themodule.parentElement.querySelector(".HtmlFieldPrefix"),
10625                                OrganisationsnummerLabelText: this.themodule.parentElement.querySelector(".OrganisationsnummerLabelText"),
10626                                ValdLabelText: this.themodule.parentElement.querySelector(".ValdLabelText"),
10627                                spinner: this.themodule.querySelector('.spinner'),
10628                                SelectedOrt: this.themodule.querySelector(".NewSelectedOrt"),
10629                                SelectedAstId: this.themodule.querySelector(".NewSelectedAstId"),
10630                                language: this.themodule.querySelector(".language")
10631                            };
10632                        },
10633                        wireUp: function () {
10634                            this.addClickListener('.NewGetCompanies', this.fetchCompanyData);
10635                            this.addChangeListener('.NewSelectedOrt', this.fetchOrtData);
10636                            this.addChangeListener('.NewSelectedAstId', this.fetchAstData);
10637                        },
10638                        addClickListener: function (selector, handler) {
10639                            this.themodule.addEventListener('click', e => {
10640                                if (!e.target.matches(selector)) {
10641                                    return;
10642                                }
10643                                handler.call(this, e);
10644                                e.preventDefault();
10645                            }, false);
10646                        },
10647                        addChangeListener: function (selector, handler) {
10648                            this.themodule.addEventListener('change', e => {
10649                                if (!e.target.matches(selector)) {
10650                                    return;
10651                                }
10652                                handler.call(this, e);
10653                                e.preventDefault();
10654                            }, false);
10655                        },
10656                        extractParams: function (additionalParams) {
10657                            let params = {
10658                                orgnummer: this.components.organisationsnummer?.value,
10659                                prefix: this.components.HtmlFieldPrefix?.value,
10660                                OrganisationsnummerLabelText: this.components.OrganisationsnummerLabelText?.value,
10661                                ValdLabelText: this.components.ValdLabelText?.value,
10662                                IncludeAstSelection: this.IncludeAstSelection,
10663                                language: this.components.language?.value
10664                            };
10665                            return Object.assign(params, additionalParams);
10666                        },
10667                        createFetchUrl: function (additionalParams) {
10668                            let params = this.extractParams(additionalParams);
10669                            let action = "/findcompany/search/";
10670                            let urlParams = new URLSearchParams(Object.entries(params));
10671                            return action + '?' + urlParams;
10672                        },
10673                        fetchCompanyData: function (e) {
10674                            this.components.spinner.style.display = "block";
10675                            let additionalParams = {
10676                                GetCompany: "SearchCompany"
10677                            };
10678                            fetch(this.createFetchUrl(additionalParams), {
10679                                method: 'POST'
10680                            })
10681                                .then(response => response.text())
10682                                .then(data => {
10683                                    updateElements(this.themodule, data);
10684                                    this.initComponents();
10685                                    this.components.spinner.style.display = "none";
10686                                });
10687                        },
10688                        fetchOrtData: function (e) {
10689                            let additionalParams = {
10690                                ort: this.components.SelectedOrt?.value,
10691                                GetCompany: "ortUpdated"
10692                            };
10693                            fetch(this.createFetchUrl(additionalParams), {
10694                                method: 'POST'
10695                            })
10696                                .then(response => response.text())
10697                                .then(data => {
10698                                    updateElements(this.themodule, data);
10699                                    this.initComponents();
10700                                });
10701                        },
10702                        fetchAstData: function (e) {
10703                            let additionalParams = {
10704                                AstCfar: this.components.SelectedAstId?.value,
10705                                ort: this.components.SelectedOrt?.value,
10706                                GetCompany: "astUpdated"
10707                            };
10708                            fetch(this.createFetchUrl(additionalParams), {
10709                                method: 'POST'
10710                            })
10711                                .then(response => response.text())
10712                                .then(data => {
10713                                    updateElements(this.themodule, data);
10714                                    this.initComponents();
10715                                });
10716                        }
10717                    };
10718
10719                    returnObject.init();
10720                    return returnObject;
10721                })(module);
10722
10723                searchcompanymodule.wireUp();
10724            });
10725        }
10726    };
10727
10728    returnObject.init();
10729    return returnObject;
10730})();
10731
10732
10733;
10734var anmalanbearbetningbehandlingasbestPage = (function ($) {
10735    var returnObject = {
10736        init: function () {
10737            this.self = this;
10738        },
10739        wireUp: function () {
10740
10741            //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
10742            $("#Place_PlaceArea").on('keyup', function (e) {
10743                e.stopPropagation();
10744                $(this).removeClass('input-validation-error')
10745                $(this).removeClass('valid')
10746            });
10747
10748            //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att l
10748ägga till span-taggen på rätt plats efteråt.
10749            $(document).on('focus', '#Place_PlaceArea', function (e) {
10750                if ($("#adressspan").length == 0) {
10751                    var div = $('<span id="adressspan"></span>');
10752                    $(this).after(div);
10753                }
10754            });
10755
10756
10757            $("#noclick").click(function () {
10758                return false;
10759            });
10760
10761
10762            $(document).on('click', '#fill', function (event) {
10763
10764                //    $(this).toggle();
10765                $('form').find('input[type=text]').each(function (e) {
10766                    var id = $(this).attr('id');
10767                    if (id != undefined) {
10768                        // alert(id);
10769
10770                        $(this).val(id.substring(0, 40));
10771
10772                        if (id.toLowerCase().indexOf("organisationsnummer") >= 0) { $(this).val("5592110505"); }
10773
10774                        if (id.toLowerCase().indexOf("startdatum") >= 0) { $(this).val("2020-10-10"); }
10775
10776                        if (id.toLowerCase().indexOf("slutdatum") >= 0) { $(this).val("2020-10-12"); }
10777
10778                        if (id.toLowerCase().indexOf("epost") >= 0) { $(this).val(id.substring(0, 10) + "@test.ttw"); }
10779
10780                    }
10781                })
10782
10783            });
10784
10785            if (Modernizr.history && $('#anmalan-bearbetning-behandling-asbest-page-form').length) {
10786
10787
10788                $('input[type=date]').on('input', function (e) {
10789                    updateDates();
10790                });
10791
10792                function updateDates() {
10793                    var $date1 = $('input[type=date]').eq(0);
10794                    var $date2 = $('input[type=date]').eq(1);
10795
10796                    if ($date1.val()) {
10797                        if ($date2.val() && $date2.val() <= $date1.val()) {
10798                            $date2.val(undefined);
10799                            $date2.removeClass('valid input-validation-error');
10800                        }
10801                        $date2.attr("min", addDays($date1.val(), 1));
10802                    }
10803                    else {
10804                        $date1.removeClass('valid input-validation-error');
10805                    }
10806
10807                    if (!$date2.val()) {
10808                        $date2.removeClass('valid input-validation-error');
10809                    }
10810                }
10811
10812                function addDays(date, days) {
10813                    var result = new Date(date);
10814                    result.setDate(result.getDate() + days);
10815
10816                    return result.toLocaleDateString("sv-SE", {
10817                        year: "numeric",
10818                        month: "2-digit",
10819                        day: "2-digit"
10820                    });
10821                }
10822
10823
10824                anmalanbearbetningbehandlingasbestPage.submitTimer($('#anmalan-bearbetning-behandling-asbest-page-form'), 10000);
10825
10826                $(window).on('popstate', function (e) {
10827                    if (history.state) {
10828                        updateContent(history.state);
10829                    }
10830                });
10831
10832                $(document).ready(function () {
10833
10834                    //Disable validering på fält som inte är synliga
10835                    // $("form").data("validator").settings.ignore = ".ignore, :hidden";
10836
10837                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
10838
10839                });
10840
10841                $('input:radio').click(function () {
10842                    var n = this.name;
10843                    $("input[name='" + n + "']").removeClass("input-validation-error");
10844                });
10845            }
10846        },
10847        submitTimer: function (form, wait) {
10848            $('#send-btn').prop('disabled', true);
10849            var timerFinished = false;
10850            form.on("submit", function (event) {
10851                if (timerFinished === false) {
10852                    return false;
10853                } else {
10854                    return true;
10855                }
10856            });
10857
10858            setTimeout(function () {
10859                timerFinished = true;
10860                $('#send-btn').prop('disabled', false);
10861            }, wait);
10862        }
10863    };
10864
10865    returnObject.init();
10866    return returnObject;
10867})(jQuery);
10868
10869;
10870
10871
10872var ansokanundantagarbetstidslagenPage = (function ($) {
10873    var returnObject = {
10874        init: function () {
10875            this.self = this;
10876        },
10877        wireUp: function () {
10878
10879
10880
10881            $("#noclick").click(function () {
10882                return false;
10883            });
10884
10885
10886            //$(document).on('click', '#fill', function (event) {
10887
10888
10889            //    $('form').find('input[type=text], textarea').each(function (e) {
10890            //        var id = $(this).attr('id');
10891            //        if (id != undefined) {
10892
10893            //            $(this).val(id.substring(0, 40));
10894
10895            //            if (id.toLowerCase().indexOf("organisationsnummer") >= 0) { $(this).val("5592110505"); }
10896
10897            //            if (id.toLowerCase().indexOf("startdatum") >= 0) { $(this).val("2020-10-10"); }
10898
10899            //            if (id.toLowerCase().indexOf("slutdatum") >= 0) { $(this).val("2020-10-12"); }
10900
10901            //            if (id.toLowerCase().indexOf("epost") >= 0) { $(this).val(id.substring(0, 10) + "@test.ttw"); }
10902
10903            //        }
10904            //    })
10905
10906            //});
10907
10908            if (Modernizr.history && $('#ansokan-undantag-arbetstidslagen').length) {
10909
10910
10911                $('input[type=date]').on('input', function (e) {
10912                    updateDates();
10913                });
10914
10915                function updateDates() {
10916                    var $date1 = $('input[type=date]').eq(0);
10917                    var $date2 = $('input[type=date]').eq(1);
10918                    if ($date1.val()) {
10919                        if ($date2.val() && $date2.val() <= $date1.val()) {
10920                            $date2.val(undefined);
10921                            $date2.removeClass('valid input-validation-error');
10922                        }
10923                        $date2.attr("min", addDays($date1.val(), 2));
10924                    }
10925                    else {
10926                        $date1.removeClass('valid input-validation-error');
10927                    }
10928
10929                    if (!$date2.val()) {
10930                        $date2.removeClass('valid input-validation-error');
10931                    }
10932                }
10933
10934                function addDays(date, days) {
10935                    var result = new Date(date);
10936                    result.setDate(result.getDate() + days);
10937
10938                    return result.toLocaleDateString("sv-SE", {
10939                        year: "numeric",
10940                        month: "2-digit",
10941                        day: "2-digit"
10942                    });
10943                }
10944
10945                //function addDays(date, days) {
10946                //    var result = new Date(date);
10947                //    result.setDate(result.getDate() + days);
10948
10949                //    return result.toISOString();
10950                //}
10951
10952                ansokanundantagarbetstidslagenPage.submitTimer($('#ansokan-undantag-arbetstidslagen'), 10000);
10953
10954                $(window).on('popstate', function (e) {
10955                    if (history.state) {
10956                        updateContent(history.state);
10957                    }
10958                });
10959
10960                $(document).ready(function () {
10961
10962                    //Tillse att hidden-fileds ingår i valideringen                
10963                    var validator = $("#ansokan-undantag-arbetstidslagen").data('validator');
10964                    if (validator != null) {
10965                        validator.settings.ignore = "";
10966                    }
10967
10968                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
10969
10970                });
10971
10972                $(document).on("submit",
10973                    "#ansokan-undantag-arbetstidslagen",
10974                    function (event) {
10975                        //Hide send button to prevent double posting 
10976                        $(".btn--send").hide();
10977                        //Show spinner
10978                        $("#ansokan-undantag-arbetstidslagen i").show();
10979                    });
10980
10981                $(".counter").keyup(function () {
10982                  /*  var max = parseInt($(this).attr("data-val-maxlength-max"));*/
10983                    var max = $(this).attr("data-val-length-max");           
10984                    var current = $(this).val().length;
10985                    $(this)
10986                        .parent("div")
10987                        .find(".displaycounter")
10988                        .text(max - current);
10989                });
10990
10991                //$('input:radio').click(function () {
10992                //    var n = this.name;
10993                //    $("input[name='" + n + "']").removeClass("input-validation-error");
10994                //});
10995
10996                $('.undofileselection').each(function () {
10997
10998                    $(this).on('click', function (e) {
10999                        $(this).parent().find(".inputfiletext").html("Ingen fil har valts.");
11000                        $(this).parent().find(".inputfile").replaceWith($(this).parent().find(".inputfile").val('').clone(true));
11001                        $(this).parent().find(".undofileselection").hide();
11002                        $(this).parent().find(".undofileselection").addClass("rs_skip");
11003                        $(this).parent().find(".inputfile").valid();
11004                        $("#Fil1Button").show(); 
11005                    });
11006                })
11007
11008                // INPUT File
11009                $('.inputfile').each(function () {
11010
11011                    var $label = $(this).next('label');
11012                    var labelVal = $label.next('span').html();
11013                    $(this).on('change', function (e) {
11014                        $(this).valid();
11015                        var fileName = '';
11016                        if (e.target.value) fileName = e.target.value.split('\\').pop();
11017                        if (fileName) {
11018                            $label.next('span').html(fileName);
11019                            if (fileName !== "Ingen fil har valts.") {
11020                                $("#" + $(this).attr("id") + "Clear").show();
11021                                $("#" + $(this).attr("id") + "Clear").removeClass("rs_skip");
11022                                $("#" + $(this).attr("id") + "Next").show();
11023                                $("#" + $(this).attr("id") + "Next").removeClass("rs_skip");
11024                                $("#Fil1Button").hide();
11025                            }
11026
11027                        }
11028                        else
11029                            $label.next('span').html(labelVal);
11030                    });
11031
11032                    // Firefox bug fix
11033                    $(this)
11034                        .on('focus', function () { $(this).addClass('has-focus'); })
11035                        .on('blur', function () { $(this).removeClass('has-focus'); });
11036                });
11037
11038                //Kollektivavtal, finns eller inte finns.
11039                $(document).on('change', '#radiofraga11', function (event) {
11040                    if (($(this).is(":checked"))) {
11041
11042                        $("#fileuploadpanel").hide();
11043                        $('#Fil1').addClass("ignore");
11044                        $('#Fil1').rules('add', {
11045                            required: false
11046                        });
11047                    }
11048                });
11049
11050                $(document).on('change', '#radiofraga22', function (event) {
11051                    if (($(this).is(":checked"))) {
11052                        $("#fileuploadpanel").show();
11053                        $('#Fil1').removeClass("ignore");
11054                        $('#Fil1').rules('add', {
11055                            required: true
11056                        });
11057
11058                    }
11059                });
11060
11061
11062            }
11063        },
11064        submitTimer: function (form, wait) {
11065            $('#send-btn').prop('disabled', true);
11066            var timerFinished = false;
11067            form.on("submit", function (event) {
11068                if (timerFinished === false) {
11069                    return false;
11070                } else {
11071                    return true;
11072                }
11073            });
11074
11075            setTimeout(function () {
11076                timerFinished = true;
11077                $('#send-btn').prop('disabled', false);
11078            }, wait);
11079        }
11080    };
11081
11082    $(".onlynumbers").keydown(function (e) {
11083        var key = e.charCode || e.keyCode || 0;
11084        // allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY
11085        // home, end, period, and numpad decimal
11086        return (
11087            key == 8 ||
11088            key == 9 ||
11089            key == 13 ||
11090            key == 46 ||
11091            key == 110 ||
11092            key == 190 ||
11093            (key >= 35 && key <= 40) ||
11094            (key >= 48 && key <= 57) ||
11095            (key >= 96 && key <= 105));
11096    });
11097
11098    //$('#ansokan-undantag-arbetstidslagen').validate({
11099    //    ignore: ".hidden"
11100    //});
11101
11102    returnObject.init();
11103    return returnObject;
11104})(jQuery);
11105
11106;
11107var ansokanbearbetningbehandlingasbestPage = (function ($) {
11108    var returnObject = {
11109        init: function () {
11110            this.self = this;
11111        },
11112        wireUp: function () {
11113
11114
11115            //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
11116            $("#Place_PlaceArea").on('keyup', function (e) {
11117                e.stopPropagation();
11118                $(this).removeClass('input-validation-error')
11119                $(this).removeClass('valid')
11120            });
11121
11122            //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att l
11122ägga till span-taggen på rätt plats efteråt.
11123            $(document).on('focus', '#Place_PlaceArea', function (e) {
11124                if ($("#adressspan").length == 0) {
11125                    var div = $('<span id="adressspan"></span>');
11126                    $(this).after(div);
11127                }
11128            });
11129
11130            enableValidationOnHidden('#ansokan-bearbetning-behandling-asbest-form');
11131
11132            if (Modernizr.history && $('#ansokan-bearbetning-behandling-asbest-form').length) {
11133
11134                ansokanbearbetningbehandlingasbestPage.submitTimer($('#ansokan-bearbetning-behandling-asbest-form'), 10000);
11135
11136                $(document).ready(function () {
11137
11138                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
11139                        $(document).attr('title'));
11140                });
11141
11142                $(document).on("submit",
11143                    "#ansokan-bearbetning-behandling-asbest-form",
11144                    function () {
11145                        //Hide send button to prevent double posting 
11146                        $(".btn--send").hide();
11147                        //Show spinner
11148                        $("#ansokan-bearbetning-behandling-asbest-form i").show();
11149                    });
11150
11151
11152                $("#scopeofwork1").on("change", function () { 
11153                    $('#FileserviceabilityHiddenId').val(false);
11154                    $("#serviceabilitycertificatescontractorsdiv").show();
11155                });
11156
11157                $("#scopeofwork2").on("change", function () {
11158                    $('#FileserviceabilityHiddenId').val(true);
11159                    $("#serviceabilitycertificatescontractorsdiv").hide();
11160                  /*  $("#AttacheddocumentServiceabilitycertificatescontractors").hide();*/
11161                });
11162
11163
11164                $("#applicationtype1").on("change", function () {
11165                    $('#PlaceAreaHiddenId').val(false);
11166                    $("#workplacediv").show();
11167                });
11168
11169                $("#applicationtype2").on("change", function () {
11170                    $("#workplacediv").hide();
11171                    $('#PlaceAreaHiddenId').val(true);
11172                    $("#Place_PlaceArea").val("");
11173                });
11174
11175
11176                $(document).on('change', '#SkyddsombudFinnsEj', function (event) {
11177                    if (($(this).is(":checked"))) {
11178
11179                        $("#FilESectionContainer").hide();
11180                    }
11181                    else {
11182                        $("#FilESectionContainer").show();
11183                    }
11184                });
11185
11186                // Input file
11187                $('.inputfile').each(function () {
11188
11189                    var $input = $(this);
11190                    var id = $input.attr("id");
11191                    var $btnChoose = $('#' + id).next('label');
11192                    var $btnClear = $('#' + id + 'Clear');
11193                    // Id is on form FilA10
11194                    // Get A, B, C, D or E
11195                    var fileSection = id.substring(3, 4);
11196                    var $divFilSection = $("#Fil" + fileSection + "Section");
11197
11198                    const nofile = "Ingen fil har valts.";
11199
11200                    $input.on('change',
11201                        function (e) {
11202                            var fileName = '';
11203                            if (e.target.value) {
11204                                fileName = e.target.value.split('\\').pop();
11205                            }
11206                            if (fileName) {
11207
11208                                var $divNext = $divFilSection.find('div.fileholder.hidden:first');
11209
11210                                // append div
11211                                if ($("#" + id + "Filename").html() === nofile) { 
11212                                    $('#' + $divNext.attr("id")).appendTo('#' + $divFilSection.attr("id"));
11213                                    $divNext.removeClass("rs_skip");
11214                                    $divNext.removeClass("hidden");
11215                                    $divNext.show();
11216                                }
11217
11218                                $("#" + id + "Filename").html(fileName);
11219
11220                                $btnClear.removeClass("rs_skip");
11221                                $btnClear.removeClass("hidden");
11222                                $btnClear.show();
11223
11224                                $btnChoose.addClass("rs_skip");
11225                                $btnChoose.addClass("hidden");
11226                                $btnChoose.hide();
11227
11228                                // clear error
11229                                $divFilSection.find('.inputfile').each(function () {
11230                                    $(this).removeClass('input-validation-error');
11231                                });
11232
11233                                // show text if maxfilecount is reached
11234                                var filesleft = $divFilSection.find('div.fileholder.hidden').length;
11235                                var $maxCountText = $("#Fil" + fileSection + "MaxCount");
11236                                if (filesleft === 0) {
11237
11238                                    var $lastFileHolder = $divFilSection.find('div.fileholder').not($('.hidden')).last(
11238);
11239                                    var $lastFile = $lastFileHolder.find('.inputfile:first');
11240                                    if ($lastFile.val() !== "") {
11241                                        $maxCountText.removeClass('hidden');
11242                                        $maxCountText.show();
11243                                    }
11244                                } else {
11245                                    $maxCountText.addClass('hidden');
11246                                    $maxCountText.hide();
11247                                }
11248                            }
11249                            $('#ansokan-bearbetning-behandling-asbest-form').valid();
11250                        });
11251
11252                    $btnClear.on('click',
11253                        function (e) {
11254                            // clear
11255                            $("#" + id + "Filename").html(nofile);
11256                            console.log("clearclick");
11257
11258                            $input.replaceWith($("#" + id).val('').clone(true));
11259
11260                            $btnClear.hide();
11261                            $btnClear.addClass("hidden");
11262                            $btnClear.addClass("rs_skip");
11263
11264                            $btnChoose.removeClass("rs_skip");
11265                            $btnChoose.removeClass("hidden");
11266                            $btnChoose.show();
11267
11268                            // reorder fileholder divs
11269                            var $fileHolders = $divFilSection.find('div.fileholder').not($('.hidden'));
11270
11271                            var firstEmptyIsFound = false;
11272
11273                            $(($fileHolders).get().reverse()).each(function () {
11274                                const $inputfile = $(this).find('.inputfile:first');
11275
11276                                if ($inputfile.val() !== "") {
11277                                    var srcId = $(this).attr("id");
11278                                    var destId = $divFilSection.attr("id");
11279                                    $('#' + srcId).prependTo('#' + destId);
11280                                } else {
11281                                    if (firstEmptyIsFound) {
11282                                        $(this).hide();
11283                                        $(this).addClass("hidden");
11284                                        $(this).addClass("rs_skip");
11285                                    } else {
11286                                        firstEmptyIsFound = true;
11287                                    }
11288                                }
11289                            });
11290
11291                            var $maxCountText = $("#Fil" + fileSection + "MaxCount");
11292                            $maxCountText.addClass('hidden');
11293                            $maxCountText.hide();
11294                            $('#ansokan-bearbetning-behandling-asbest-form').valid();
11295                            e.preventDefault();
11296                        });
11297
11298                    // Firefox bug fix
11299                    $input
11300                        .on('focus', function () { $input.addClass('has-focus'); })
11301                        .on('blur', function () { $input.removeClass('has-focus'); });
11302                });
11303
11304                $('input:radio').click(function () {
11305                    var n = this.name;
11306                    $("input[name='" + n + "']").removeClass("input-validation-error");
11307                });
11308
11309                $('input[type=date]').on('input', function (e) {
11310                    updateDates();
11311                });
11312
11313                function updateDates() {
11314                    var $date1 = $('input[type=date]').eq(0);
11315                    var $date2 = $('input[type=date]').eq(1);
11316
11317                    if ($date1.val()) {
11318                        if ($date2.val() && $date2.val() <= $date1.val()) {
11319                            $date2.val(undefined);
11320                            $date2.removeClass('valid input-validation-error');
11321                        }
11322                        $date2.attr("min", addDays($date1.val(), 1));
11323                    }
11324                    else {
11325                        $date1.removeClass('valid input-validation-error');
11326                    }
11327
11328                    if (!$date2.val()) {
11329                        $date2.removeClass('valid input-validation-error');
11330                    }
11331                }
11332
11333                function addDays(date, days) {
11334                    var result = new Date(date);
11335                    result.setDate(result.getDate() + days);
11336
11337                    return result.toLocaleDateString("sv-SE", {
11338                        year: "numeric",
11339                        month: "2-digit",
11340                        day: "2-digit"
11341                    });
11342                }
11343            }
11344        },
11345        submitTimer: function (form, wait) {
11346            $('#send-btn').prop('disabled', true);
11347            var timerFinished = false;
11348            form.on("submit", function (event) {
11349                if (timerFinished === false) {
11350                    return false;
11351                } else {
11352                    return true;
11353                }
11354            });
11355
11356            setTimeout(function () {
11357                timerFinished = true;
11358                $('#send-btn').prop('disabled', false);
11359            }, wait);
11360        }
11361    };
11362
11363    function enableValidationOnHidden(formId) {
11364
11365        var validator = $(formId).data('validator');
11366
11367        if (validator) {
11368          /*  $.validator.setDefaults({ ignore: '' });*/
11369            $.validator.setDefaults({ ignore: ':hidden:not(.do-not-ignore)' });
11370            $(formId)
11371                .removeData("validator")
11372                .removeData("unobtrusiveValidation");
11373            $.validator
11374                .unobtrusive
11375                .parse(formId);
11376        }
11377    }
11378    returnObject.init();
11379    return returnObject;
11380})(jQuery);
11381;
11382var ansokanhanteringasbestPage = (function ($) {
11383    var returnObject = {
11384        init: function () {
11385            this.self = this;
11386        },
11387        wireUp: function () {
11388
11389
11390            //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
11391            $("#Place_PlaceArea").on('keyup', function (e) {
11392                e.stopPropagation();
11393                $(this).removeClass('input-validation-error')
11394                $(this).removeClass('valid')
11395            });
11396
11397            //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att l
11397ägga till span-taggen på rätt plats efteråt.
11398            $(document).on('focus', '#Place_PlaceArea', function (e) {
11399                if ($("#adressspan").length == 0) {
11400                    var div = $('<span id="adressspan"></span>');
11401                    $(this).after(div);
11402                }
11403            });
11404
11405            enableValidationOnHidden('#ansokan-hantering-asbest-form');
11406
11407            if (Modernizr.history && $('#ansokan-hantering-asbest-form').length) {
11408
11409                ansokanhanteringasbestPage.submitTimer($('#ansokan-hantering-asbest-form'), 10000);
11410
11411                $(document).ready(function () {
11412
11413                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' },
11414                        $(document).attr('title'));
11415                });
11416
11417                $(document).on('change', '#SkyddsombudFinnsEj', function (event) {
11418                    if (($(this).is(":checked"))) {
11419
11420                        $("#FilDSectionContainer").hide();
11421                    }
11422                    else {
11423                        $("#FilDSectionContainer").show();
11424                    }
11425                });
11426
11427                $(document).on("submit",
11428                    "#ansokan-hantering-asbest-form",
11429                    function () {
11430                        //Hide send button to prevent double posting 
11431                        $(".btn--send").hide();
11432                        //Show spinner
11433                        $("#ansokan-hantering-asbest-form i").show();
11434                    });
11435
11436                // Input file
11437                $('.inputfile').each(function () {
11438                    var $input = $(this);
11439                    var id = $input.attr("id");
11440                    var $btnChoose = $('#' + id).next('label');
11441                    var $btnClear = $('#' + id + 'Clear');
11442                    // Id is on form FilA10
11443                    // Get A, B, C, D or E
11444                    var fileSection = id.substring(3, 4);
11445                    var $divFilSection = $("#Fil" + fileSection + "Section");
11446
11447                    const nofile = "Ingen fil har valts.";
11448
11449                    $input.on('change',
11450                        function (e) {
11451                            var fileName = '';
11452                            if (e.target.value) {
11453                                fileName = e.target.value.split('\\').pop();
11454                            }
11455                            if (fileName) {
11456
11457                                var $divNext = $divFilSection.find('div.fileholder.hidden:first');
11458
11459                                // append div
11460                                if ($("#" + id + "Filename").html() === nofile) {
11461                                    $('#' + $divNext.attr("id")).appendTo('#' + $divFilSection.attr("id"));
11462                                    $divNext.removeClass("rs_skip");
11463                                    $divNext.removeClass("hidden");
11464                                    $divNext.show();
11465                                }
11466
11467                                $("#" + id + "Filename").html(fileName);
11468
11469                                $btnClear.removeClass("rs_skip");
11470                                $btnClear.removeClass("hidden");
11471                                $btnClear.show();
11472
11473                                $btnChoose.addClass("rs_skip");
11474                                $btnChoose.addClass("hidden");
11475                                $btnChoose.hide();
11476
11477                                // clear error
11478                                $divFilSection.find('.inputfile').each(function () {
11479                                    $(this).removeClass('input-validation-error');
11480                                });
11481
11482                                // show text if maxfilecount is reached
11483                                var filesleft = $divFilSection.find('div.fileholder.hidden').length;
11484                                var $maxCountText = $("#Fil" + fileSection + "MaxCount");
11485                                if (filesleft === 0) {
11486
11487                                    var $lastFileHolder = $divFilSection.find('div.fileholder').not($('.hidden')).last(
11487);
11488                                    var $lastFile = $lastFileHolder.find('.inputfile:first');
11489                                    if ($lastFile.val() !== "") {
11490                                        $maxCountText.removeClass('hidden');
11491                                        $maxCountText.show();
11492                                    }
11493                                } else {
11494                                    $maxCountText.addClass('hidden');
11495                                    $maxCountText.hide();
11496                                }
11497                            }
11498                        });
11499
11500                    $btnClear.on('click',
11501                        function (e) {
11502                            // clear
11503                            $("#" + id + "Filename").html(nofile);
11504
11505                            $input.replaceWith($("#" + id).val('').clone(true));
11506
11507                            $btnClear.hide();
11508                            $btnClear.addClass("hidden");
11509                            $btnClear.addClass("rs_skip");
11510
11511                            $btnChoose.removeClass("rs_skip");
11512                            $btnChoose.removeClass("hidden");
11513                            $btnChoose.show();
11514
11515                            // reorder fileholder divs
11516                            var $fileHolders = $divFilSection.find('div.fileholder').not($('.hidden'));
11517
11518                            var firstEmptyIsFound = false;
11519
11520                            $(($fileHolders).get().reverse()).each(function () {
11521                                const $inputfile = $(this).find('.inputfile:first');
11522
11523                                if ($inputfile.val() !== "") {
11524                                    var srcId = $(this).attr("id");
11525                                    var destId = $divFilSection.attr("id");
11526                                    $('#' + srcId).prependTo('#' + destId);
11527                                } else {
11528                                    if (firstEmptyIsFound) {
11529                                        $(this).hide();
11530                                        $(this).addClass("hidden");
11531                                        $(this).addClass("rs_skip");
11532                                    } else {
11533                                        firstEmptyIsFound = true;
11534                                    }
11535                                }
11536                            });
11537
11538                            var $maxCountText = $("#Fil" + fileSection + "MaxCount");
11539                            $maxCountText.addClass('hidden');
11540                            $maxCountText.hide();
11541
11542                            e.preventDefault();
11543                        });
11544
11545                    // Firefox bug fix
11546                    $input
11547                        .on('focus', function () { $input.addClass('has-focus'); })
11548                        .on('blur', function () { $input.removeClass('has-focus'); });
11549                });
11550
11551                $('input:radio').click(function () {
11552                    var n = this.name;
11553                    $("input[name='" + n + "']").removeClass("input-validation-error");
11554                });
11555
11556                $('form').submit(function () {
11557
11558                    if (!$(this).valid()) {
11559
11560                        $(".validation-summary-errors").attr('role', 'alert');
11561                        $(".validation-summary-errors").attr("tabindex", -1).focus();
11562
11563                        return false;
11564                    }
11565                });
11566
11567                $('input[type=date]').on('change', function (e) {
11568                    updateDates();
11569                });
11570            }
11571        },
11572        submitTimer: function (form, wait) {
11573            $('#send-btn').prop('disabled', true);
11574            var timerFinished = false;
11575            form.on("submit", function (event) {
11576                if (timerFinished === false) {
11577                    return false;
11578                } else {
11579                    return true;
11580                }
11581            });
11582
11583            setTimeout(function () {
11584                timerFinished = true;
11585                $('#send-btn').prop('disabled', false);
11586            }, wait);
11587        }
11588    };
11589
11590    function enableValidationOnHidden(formId) {
11591
11592        var validator = $(formId).data('validator');
11593
11594        if (validator) {
11595            $.validator.setDefaults({ ignore: '' });
11596            $(formId)
11597                .removeData("validator")
11598                .removeData("unobtrusiveValidation");
11599            $.validator
11600                .unobtrusive
11601                .parse(formId);
11602        }
11603    }
11604
11605    function updateDates() {
11606        var $date1 = $('input[type=date]').eq(0);
11607        var $date2 = $('input[type=date]').eq(1);
11608
11609        if ($date1.val()) {
11610            if ($date2.val() && $date2.val() <= $date1.val()) {
11611                $date2.val(undefined);
11612                $date2.removeClass('valid input-validation-error');
11613            }
11614            $date2.attr("min", addDays($date1.val(), 1));
11615        }
11616        else {
11617            $date1.removeClass('valid input-validation-error');
11618        }
11619
11620        if (!$date2.val()) {
11621            $date2.removeClass('valid input-validation-error');
11622        }
11623    }
11624
11625    function addDays(date, days) {
11626        var result = new Date(date);
11627        result.setDate(result.getDate() + days);
11628
11629        return result.toLocaleDateString("sv-SE", {
11630            year: "numeric",
11631            month: "2-digit",
11632            day: "2-digit"
11633        });
11634    }
11635
11636    returnObject.init();
11637    return returnObject;
11638})(jQuery);
11639;
11640var anmalansmittamnenriskklass2Page = (function ($) {
11641    var returnObject = {
11642        init: function () {
11643            this.self = this;
11644        },
11645        wireUp: function () {
11646
11647            //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
11648            $("#Place_PlaceArea").on('keyup', function (e) {
11649                e.stopPropagation();
11650                $(this).removeClass('input-validation-error')
11651                $(this).removeClass('valid')
11652            });
11653
11654            //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att l
11654ägga till span-taggen på rätt plats efteråt.
11655            $(document).on('focus', '#Place_PlaceArea', function (e) {
11656                if ($("#adressspan").length == 0) {
11657                    var div = $('<span id="adressspan"></span>');
11658                    $(this).after(div);
11659                }
11660            });
11661
11662            if (Modernizr.history && $('#anmalansmittamnenriskklass2-application-form').length) {
11663
11664                anmalansmittamnenriskklass2Page.submitTimer($('#anmalansmittamnenriskklass2-application-form'), 10000);
11665
11666                $(window).on('popstate', function (e) {
11667                    if (history.state) {
11668                        updateContent(history.state);
11669                    }
11670                });
11671
11672                $(document).ready(function () {
11673                    var validator = $("#anmalansmittamnenriskklass2-application-form").data('validator');
11674                    if (validator != null) {
11675                        validator.settings.ignore = "";
11676                    }       
11677                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
11678                    $('#InriktningBeskriv').rules('add', {
11679                        required: false
11680                    });
11681                    
11682                });
11683
11684                $(document).on('click', 'button.remove-smittamne', function (event) {
11685                    // We must keep at least one, since it's a required field.
11686                    if ($('#smittamnelista .affected-row').length > 1) {
11687                        $(this).closest('.affected-row').remove();
11688                    }
11689                    event.preventDefault();
11690                    return false;
11691                });
11692
11693                $(".counter").keyup(function () {
11694                    var max = parseInt($(this).attr("data-val-maxlength-max"));    
11695                    var current = $(this).val().length;
11696                    $(this)
11697                        .parent("div")
11698                        .find(".displaycounter")
11699                        .text(max - current);
11700                });
11701
11702                $(document).on("submit", "#anmalansmittamnenriskklass2-application-form", function (event) {
11703                    //Hide send button to prevent double posting 
11704                    $(".btn--send").hide();
11705                    //Show spinner
11706                    $("#anmalansmittamnenriskklass2-application-form i").show();
11707                });
11708
11709                $('form').submit(function () {
11710                    if (!$(this).valid()) {
11711                       
11712                        if ($("input.input-validation-error:checkbox")[0]) {
11713                            
11714                            var errorDiv = $('.validation-summary-errors:visible').first();
11715                            var scrollPos = errorDiv.offset().top;
11716                          //  alert(scrollPos);
11717
11718                            $(window).scrollTop(scrollPos);
11719                        }
11720
11721                        return false;
11722                    }
11723                });
11724      
11725                $(document).on('change', '#InriktningCheck5', function (event) {
11726                    if (($(this).is(":checked"))) {
11727                        $("#annat").show();
11728                     
11729                        $('#InriktningBeskriv').rules('add', {
11730                            required: true
11731                        });           
11732                    }
11733                    else {
11734                        $("#annat").hide();
11735                        $("#InriktningBeskriv").val("");
11736                        $('#InriktningBeskriv').rules('add', {
11737                            required: false
11738                        });
11739                    }
11740                });
11741               
11742     
11743            }
11744        },
11745        submitTimer: function (form, wait) {
11746            $('#send-btn').prop('disabled', true);
11747            var timerFinished = false;
11748            form.on("submit", function (event) {
11749                if (timerFinished === false) {
11750                    return false;
11751                } else {
11752                    return true;
11753                }
11754            });
11755
11756            setTimeout(function () {
11757                timerFinished = true;
11758                $('#send-btn').prop('disabled', false);
11759            }, wait);
11760        }
11761    };
11762
11763    returnObject.init();
11764    return returnObject;
11765})(jQuery);
11766
11767
11768
11769
11770
11771;
11772var ansokanfarligakemiskaamnen = (function ($) {
11773    var returnObject = {
11774        init: function () {
11775            this.self = this;
11776        },
11777        wireUp: function () {
11778
11779            enableValidationOnHidden('#ansokan-farliga-kemiska-amnen');
11780
11781            //Vi kan inte fråga tjänsten vid varje knapptryck om inmatad gatadress är giltig. Så vi stoppar och nollställer valideringen när man skriver något.
11782            $("#Place_PlaceArea").on('keyup', function (e) {
11783                e.stopPropagation();
11784                $(this).removeClass('input-validation-error')
11785                $(this).removeClass('valid')
11786            });
11787
11788            //Typeahed-scriptet lägger element mellan kontroll och den förväntade span-taggen för valideringen. Vi måste justera detta med att lägga till span-taggen på rätt plats efteråt.
11789            $(document).on('focus', '#Place_PlaceArea', function (e) {
11790                if ($("#adressspan").length == 0) {
11791                    var div = $('<span id="adressspan"></span>');
11792                    $(this).after(div);
11793                }
11794            });
11795
11796
11797            $("#radiogagafraga1,#radiogagafraga2,#radiogagafraga3").change(function () {
11798                $('#SelectedFarligtAmne option:first-child').attr("selected", "selected");            
11799                $("#SelectedFarligtAmne option:selected").removeAttr("selected");             
11800                $("#SelectedFarligtAmne").prop("disabled", true);
11801                $('#SelectedFarligtAmne').rules('remove');
11802                $("#SelectedFarligtAmne").removeClass("input-validation-error");
11803                $("#SelectedFarligtAmne").removeClass("valid");
11804                
11805            });
11806
11807            $("#radiogagafraga4").change(function () {
11808                $("#SelectedFarligtAmne").prop("disabled", false);
11809                $("#SelectedFarligtAmne").rules("add", { required: true });
11810            });
11811          
11812
11813            $("#noclick").click(function () {
11814                return false;
11815            });
11816
11817         
11818            if (Modernizr.history && $('#ansokan-farliga-kemiska-amnen').length) {
11819
11820                $('input[type=date]').on('input', function (e) {
11821                    updateDates();
11822                });
11823
11824                function updateDates() {
11825                    var $date1 = $('input[type=date]').eq(0);
11826                    var $date2 = $('input[type=date]').eq(1);
11827
11828                    if ($date1.val()) {
11829                        if ($date2.val() && $date2.val() <= $date1.val()) {
11830                            $date2.val(undefined);
11831                            $date2.removeClass('valid input-validation-error');
11832                        }
11833                        $date2.attr("min", addDays($date1.val(), 1));
11834                    }
11835                    else {
11836                        $date1.removeClass('valid input-validation-error');
11837                    }
11838
11839                    if (!$date2.val()) {
11840                        $date2.removeClass('valid input-validation-error');
11841                    }
11842                }
11843
11844                function addDays(date, days) {
11845                    var result = new Date(date);
11846                    result.setDate(result.getDate() + days);
11847
11848                    return result.toLocaleDateString("sv-SE", {
11849                        year: "numeric",
11850                        month: "2-digit",
11851                        day: "2-digit"
11852                    });
11853                }
11854
11855                ansokanfarligakemiskaamnen.submitTimer($('#ansokan-farliga-kemiska-amnen'), 10000);
11856
11857                $(document).on("submit",
11858                    "#ansokan-farliga-kemiska-amnen",
11859                    function () {
11860                        //Hide send button to prevent double posting 
11861                        $(".btn--send").hide();
11862                        //Show spinner
11863                        $("#ansokan-farliga-kemiska-amnen i").show();
11864                    });
11865
11866                $('form').submit(function () {
11867                    if (!$(this).valid()) {
11868
11869                        $(".validation-summary-errors").attr('role', 'alert');
11870                        $(".validation-summary-errors").attr("tabindex", -1).focus();
11871
11872                        return false;
11873                    }
11874                });
11875
11876                $(window).on('popstate', function (e) {
11877                    if (history.state) {
11878                        updateContent(history.state);
11879                    }
11880                });
11881
11882                $(".counter").keyup(function () {
11883                     var max = parseInt($(this).attr("data-val-maxlength-max"));    
11884                    var current = $(this).val().length;
11885                
11886                    $(this)
11887                        .parent("div")
11888                        .find(".displaycounter")
11889                        .text(max - current);
11890                });
11891
11892
11893                $(".onlynumbers").keydown(function (e) {
11894                    var key = e.charCode || e.keyCode || 0;
11895                    // allow backspace, tab, delete, enter, arrows, numbers and ke
11895ypad numbers ONLY
11896                    // home, end, period, and numpad decimal
11897                    return (
11898                        key == 8 ||
11899                        key == 9 ||
11900                        key == 13 ||
11901                        key == 46 ||
11902                        key == 110 ||
11903                        key == 190 ||
11904                        (key >= 35 && key <= 40) ||
11905                        (key >= 48 && key <= 57) ||
11906                        (key >= 96 && key <= 105));
11907                });
11908
11909                $(document).on('change', '#SkyddsombudFinns', function (event) {
11910                    if (($(this).is(":checked"))) {
11911                   
11912                        $("#Fil3Section").hide();
11913                    }
11914                    else {
11915                        $("#Fil3Section").show();
11916                    }
11917                });
11918
11919                $(document).ready(function ()
11920                {
11921
11922                    $("option[value='']").css("font-weight", "bold");
11923
11924                    // Input file
11925                    $('.inputfile').each(function () {
11926                        var $input = $(this);
11927                        var id = $input.attr("id");
11928                        var $btnClear = $('#' + id + 'Clear');
11929                        // Id is on form FilA10
11930                        // Get A, B, C, D or E
11931                        var fileSection = id.substring(3, 4);
11932                        var $divFilSection = $("#Fil" + fileSection + "Section");
11933
11934                        const nofile = "Ingen fil har valts.";
11935
11936                        $input.on('change',
11937                            function (e) {
11938                                var fileName = '';
11939                                if (e.target.value) {
11940                                    fileName = e.target.value.split('\\').pop();
11941                                }
11942                                if (fileName) {
11943
11944                                    var $divNext = $divFilSection.find('div.fileholder.hidden:first');
11945
11946                                    // append div
11947                                    if ($("#" + id + "Filename").html() === nofile) {
11948                                        $('#' + $divNext.attr("id")).appendTo('#' + $divFilSection.attr("id"));
11949                                        $divNext.removeClass("rs_skip");
11950                                        $divNext.removeClass("hidden");
11951                                        $divNext.show();
11952                                    }
11953
11954                                    $("#" + id + "Filename").html(fileName);
11955
11956                                    $btnClear.removeClass("rs_skip");
11957                                    $btnClear.removeClass("hidden");
11958                                    $btnClear.show();
11959
11960                                    // clear error
11961                                    $divFilSection.find('.inputfile').each(function () {
11962                                        $(this).removeClass('input-validation-error');
11963                                    });
11964
11965                                    // show text if maxfilecount is reached
11966                                    var filesleft = $divFilSection.find('div.fileholder.hidden').length;
11967                                    var $maxCountText = $("#Fil" + fileSection + "MaxCount");
11968                                    if (filesleft === 0) {
11969
11970                                        var $lastFileHolder = $divFilSection.find('div.fileholder').not($('.hidden')).last();
11971                                        var $lastFile = $lastFileHolder.find('.inputfile:first');
11972                                        if ($lastFile.val() !== "") {
11973                                            $maxCountText.removeClass('hidden');
11974                                            $maxCountText.show();
11975                                        }
11976                                    } else {
11977                                        $maxCountText.addClass('hidden');
11978                                        $maxCountText.hide();
11979                                    }
11980                                }
11981                            });
11982
11983                        $btnClear.on('click',
11984                            function (e) {
11985                                // clear
11986                                $("#" + id + "Filename").html(nofile);
11987
11988                                $input.replaceWith($("#" + id).val('').clone(true));
11989
11990                                $btnClear.hide();
11991                                $btnClear.addClass("hidden");
11992                                $btnClear.addClass("rs_skip");
11993
11994                                // reorder fileholder divs
11995                                var $fileHolders = $divFilSection.find('div.fileholder').not($('.hidden'));
11996
11997                                var firstEmptyIsFound = false;
11998
11999                                $(($fileHolders).get().reverse()).each(function () {
12000                                    const $inputfile = $(this).find('.inputfile:first');
12001
12002                                    if ($inputfile.val() !== "") {
12003                                        var srcId = $(this).attr("id");
12004                                        var destId = $divFilSection.attr("id");
12005                                        $('#' + srcId).prependTo('#' + destId);
12006                                    } else {
12007                                        if (firstEmptyIsFound) {
12008                                            $(this).hide();
12009                                            $(this).addClass("hidden");
12010                                            $(this).addClass("rs_skip");
12011                                        } else {
12012                                            firstEmptyIsFound = true;
12013                                        }
12014                                    }
12015                                });
12016
12017                                var $maxCountText = $("#Fil" + fileSection + "MaxCount");
12018                                $maxCountText.addClass('hidden');
12019                                $maxCountText.hide();
12020
12021                                e.preventDefault();
12022                            });
12023
12024                        // Firefox bug fix
12025                        $input
12026                            .on('focus', function () { $input.addClass('has-focus'); })
12027                            .on('blur', function () { $input.removeClass('has-focus'); });
12028                    });
12029                    // INPUT File
12030                    $('.inputfilexxx').each(function () {
12031                        var $input = $(this);
12032                        var $label = $input.next('label');
12033                        var labelVal = $label.next('span').html();
12034
12035                        $input.on('change', function (e) {
12036
12037                            var fileName = '';
12038                            if (e.target.value) fileName = e.target.value.split('\\').pop();
12039                            if (fileName) {
12040                                $label.next('span').html(fileName);
12041
12042                                if (fileName != "") {
12043                                    $("#" + $input.attr("id") + "Clear").show();
12044                                    $("#" + $input.attr("id") + "Clear").removeClass("rs_skip");
12045
12046                                    //$("#" + $input.attr("id") + "Next").show();
12047                                    $("#" + $input.attr("id") + "Next").removeClass("rs_skip");
12048
12049                                    $("#" + $input.attr("id") + "Button").hide();
12050                                }
12051                            }
12052                            else
12053                                $label.next('span').html(labelVal);
12054                        });
12055
12056
12057                        // Firefox bug fix
12058                        $input
12059                            .on('focus', function () { $input.addClass('has-focus'); })
12060                            .on('blur', function () { $input.removeClass('has-focus'); });
12061                    });
12062
12063                    $.validator.addMethod(
12064                        "SelectLetter",
12065                        function (value, element) {
12066                            if ($("#SelectedFarligtAmne").val() === '') {
12067                                return false;
12068                            } else return true;
12069                        },
12070                        "Please Select a Letter"
12071                    );
12072                    var validator = $("#ansokan-farliga-kemiska-amnen").validate({
12073                        rules: {
12074                            DropDown: {
12075                                SelectLetter: true
12076                            }
12077                        }
12078
12079                    });
12080
12081                    $("#SelectedFarligtAmne").click(function () {
12082                        $("#ansokan-farliga-kemiska-amnen").validate().element("#SelectedFarligtAmne");
12083                    });
12084
12085                    history.replaceState({ urlPath: window.location.pathname + window.location.search, method: 'POST' }, $(document).attr('title'));
12086
12087                });
12088
12089
12090            }
12091        },
12092        submitTimer: function (form, wait) {
12093            $('#send-btn').prop('disabled', true);
12094            var timerFinished = false;
12095            form.on("submit", function (event) {
12096                if (timerFinished === false) {
12097                    return false;
12098                } else {
12099                    return true;
12100                }
12101            });
12102
12103            setTimeout(function () {
12104                timerFinished = true;
12105                $('#send-btn').prop('disabled', false);
12106            }, wait);
12107        }
12108    };
12109
12110    function enableValidationOnHidden(formId) {
12111
12112        var validator = $(formId).data('validator');
12113
12114        if (validator) {
12115            $.validator.setDefaults({ ignore: '' });
12116            $(formId)
12117                .removeData("validator")
12118                .removeData("unobtrusiveValidation");
12119            $.validator
12120                .unobtrusive
12121                .parse(formId);
12122        }
12123    }
12124
12125    returnObject.init();
12126    return returnObject;
12127})(jQuery);
12128
12129
12130;
12131paragraphkey = {
12132    /**
12133     * Initializes the Paragraph Key function
12134     */
12135    init: function () {
12136        // Checks if we are not on the page that needs 'paragraphkey' functionality
12137        if (document.querySelector('body.paragraphkeypage') === null) {
12138            return;
12139        }
12140
12141        // Constants for different keys
12142        const KEYS = Object.freeze({
12143            ESCAPE: 'Escape',
12144            ARROW_DOWN: 'ArrowDown',
12145            ARROW_UP: 'ArrowUp',
12146            ENTER: 'Enter',
12147            SPACE: ' ',
12148            TAB: 'Tab',
12149            SHIFT: 'Shift'
12150        });
12151
12152        // Selectors for various elements on the page
12153        const paragraphkeySearchContainer = document.getElementById('js-paragraphkey-search-container');
12154        const searchResultList = document.getElementById('js-paragraphkey-searchresults');
12155        const searchInput = paragraphkeySearchContainer.querySelector('input[type="text"]');
12156        const resultTable = document.querySelector('table.paragraphKey__links');
12157        const clearButton = document.querySelector('.clear-form');
12158
12159        // Debounce function to delay the invoking of the function 
12160        // to avoid unnecessary processing while typing in the search box
12161        const debounce = (func, timeout = 300) => {
12162            let timer;
12163            return (...args) => {
12164                clearTimeout(timer);
12165                timer = setTimeout(() => { func.apply(this, args); }, timeout);
12166            };
12167        }
12168
12169        // Function to get current url
12170        const getCurrentUrl = () => {
12171            return location.protocol + '//' + location.host + location.pathname.replace(/\/$/, "");
12172        }
12173
12174        // Function to control navigation inside the 'paragraphkeySearchContainer' using ARROW_UP and ARROW_DOWN
12175        // Skips any elements that can't be focused
12176        const shiftFocus = moveUp => {
12177            let items = Array.from(
12178                paragraphkeySearchContainer.querySelectorAll('a, input[type="text"]')
12179            );
12180            const curIndex = items.indexOf(document.activeElement);
12181            if (moveUp) {
12182                if (curIndex > 0) {
12183                    items[curIndex - 1].focus();
12184                }
12185            } else if (curIndex + 1 < items.length) {
12186                items[curIndex + 1].focus();
12187            }
12188        };
12189
12190        // Updates the searchResultList based on the data received from the doSearch function
12191        // Also sets the `aria-expanded` attribute on the search input
12192        const updateResultList = data => {
12193            if (data.trim().length > 0) {
12194                searchResultList.classList.remove('d-none');
12195                searchInput.setAttribute('aria-expanded', 'true');
12196            } else {
12197                searchResultList.classList.add('d-none');
12198                searchInput.setAttribute('aria-expanded', 'false');
12199            }
12200            searchResultList.innerHTML = data;
12201        };
12202
12203        // Function to perform search operation. Fetches from the server and then calls 'updateResultList' 
12204        const doSearch = (form) => {
12205            if (searchInput.value.length < 1) {
12206                updateResultList('');
12207                return;
12208            }
12209            const searchParams = new URLSearchParams(new FormData(form));
12210            fetch(form.action + '?' + searchParams)
12211                .then(response => response.text())
12212                .then(data => updateResultList(data));
12213        };
12214
12215        // Debounce 'doSearch' function to avoid unnecessary server calls while typing
12216        const debounceSearch = debounce((form) => doSearch(form));
12217
12218        // Toggles boolean attribute for a given element (e.g. toggle aria-expanded)
12219        const toggleBoolAttribute = (elem, attribute) => {
12220            const attributeValue = elem.getAttribute(attribute);
12221            if (attributeValue === 'false') {
12222                elem.setAttribute(attribute, 'true');
12223            } else {
12224                elem.setAttribute(attribute, 'false');
12225            }
12226        }
12227
12228        // Toggles visibility of 'clearButton' based on if 'searchInput' has any value
12229        const toggleClearButton = (clearButton) => {
12230            if (searchInput.value === '') {
12231                clearButton.classList.add('d-none');
12232            } else {
12233                clearButton.classList.remove('d-none');
12234            }
12235        }
12236
12237        // Get all "paragraphKey__list" elements and attach click event listener to each of them
12238        const paragraphKeys = document.querySelectorAll('.paragraphKey__list');
12239        for (let i = 0; i < paragraphKeys.length; i++) {
12240            paragraphKeys[i].onclick = (e) => {
12241                const button = e.target;
12242                // We are only interested in buttons with 'js-paragraphKey-toggle' class
12243                if (!button.classList.contains('js-paragraphKey-toggle')) {
12244                    return;
12245                }
12246                const item = button.closest('.paragraphKey__item');
12247                const tableContainer = item.querySelector('.paragraphKey__tableContainer');
12248                // If tableContainer is not already fetched, fetch the data for the table
12249                if (tableContainer.children.length === 0) {
12250                    fetch(getCurrentUrl() + '/LoadTable?' + new URLSearchParams({
12251                        sourceProvisionName: button.textContent.trim()
12252                    })).then(function (response) {
12253                        return response.text();
12254                    }).then(function (html) {
12255                        tableContainer.innerHTML = html;
12256                    }).catch(function (err) {
12257                        console.warn('LoadTable error:', err);
12258                    });
12259                }
12260                item.classList.toggle('closed');
12261                toggleBoolAttribute(button, 'aria-expanded');
12262            };
12263        }
12264
12265        // Get the loadMore element, listen for click events and fetch more results if clicked
12266        const loadMoreButton = document.querySelector('.js-paragraphKey-loadMore');
12267        if (loadMoreButton !== null) {
12268            loadMoreButton.onclick = (e) => {
12269                loadMoreButton.dataset.currentpage++;
12270                fetch(getCurrentUrl() + '/LoadMore?' + new URLSearchParams({
12271                    p: e.target.dataset.currentpage,
12272                    q: e.target.dataset.query
12273                }))
12274                    .then(response => response.text())
12275                    .then(htmlString => {
12276                        const paragraphKeyList = loadMoreButton.closest('.paragraphKey').querySelector('.paragraphKey__list');
12277                        paragraphKeyList.innerHTML = htmlString;
12278                        let doc = new DOMParser().parseFromString(htmlString, "text/html");
12279
12280                        // Focus on the button of first new item
12281                        document.querySelectorAll('.paragraphKey__item button')[(loadMoreButton.dataset.currentpage - 1) * loadMoreButton.dataset.pagesize].focus();
12282
12283                        // Check if all items are loaded, if so, hide 'loadMoreButton'
12284                        if (doc.querySelectorAll('.paragraphKey__item').length >= loadMoreButton.dataset.total) {
12285                            loadMoreButton.style.display = 'none';
12286                        }
12287                    }).catch(function (err) {
12288                        console.warn('LoadMore error:', err);
12289                    });
12290            }
12291        }
12292
12293        const filterForm = document.getElementById('paragraphkey-filterform');
12294        if (filterForm !== null) {
12295            searchInput.scrollIntoView(true);
12296
12297            const chapterFilter = document.getElementById('paragraphkey-chapterfilter');
12298            const paragraphFilter = document.getElementById('paragraphkey-paragraphfilter');
12299            const resultRows = resultTable.querySelectorAll('tbody tr');
12300
12301            // Updating the select options in response to the filters applied
12302            const updateSelectOptions = (selectElement, validElements) => {
12303                const prevValue = selectElement.value;
12304                while (selectElement.firstChild) {
12305                    selectElement.removeChild(selectElement.firstChild);
12306                }
12307
12308                const option = document.createElement('option');
12309                selectElement.append(option);
12310
12311                const options = selectElement.dataset.options.split('|');
12312                options.forEach(function (optionValue) {
12313                    if (validElements !== undefined) {
12314                        if (!validElements.includes(optionValue) && validElements.length !== 0) {
12315                            return;
12316                        }
12317                    }
12318                    let option = document.createElement('option');
12319
12320                    option.append(optionValue);
12321                    selectElement.append(option);
12322                });
12323                selectElement.value = prevValue;
12324            };
12325
12326            updateSelectOptions(paragraphFilter);
12327            updateSelectOptions(chapterFilter);
12328
12329            // Adding event listeners for filter form
12330            filterForm.addEventListener('change', event => {
12331                event.preventDefault();
12332                let validParagraphOptions = [];
12333                let validChapterOptions = [];
12334
12335                resultRows.forEach(function (el) {
12336
12337                    if (chapterFilter.value !== '' && el.dataset.chapter === chapterFilter.value) {
12338                        validParagraphOptions.push(el.dataset.paragraph);
12339                    }
12340                    if (paragraphFilter.value !== '' && el.dataset.paragraph === paragraphFilter.value) {
12341                        validChapterOptions.push(el.dataset.chapter);
12342                    }
12343                });
12344
12345                updateSelectOptions(paragraphFilter, validParagraphOptions);
12346                updateSelectOptions(chapterFilter, validChapterOptions);
12347            });
12348
12349            filterForm.addEventListener('submit', event => {
12350                event.preventDefault();
12351                let even = false;
12352                resultRows.forEach(function (el) {
12353                    el.classList.remove('d-none');
12354                    el.classList.remove('even');
12355                    el.classList.remove('odd');
12356                    if (chapterFilter.value !== '' && el.dataset.chapter !== chapterFilter.value) {
12357                        el.classList.add('d-none');
12358                    } else if (paragraphFilter.value !== '' && el.dataset.paragraph !== paragraphFilter.value) {
12359                        el.classList.add('d-none');
12360                    } else {
12361                        if (even) {
12362                            el.classList.add('even');
12363                        } else {
12364                            el.classList.add('odd');
12365                        }
12366                        even = !even;
12367                    }
12368                });
12369            });
12370        }
12371
12372        // Handling search inside the 'paragraphkeySearchContainer'
12373        paragraphkeySearchContainer.addEventListener('keydown', event => {
12374            switch (event.key) {
12375                case KEYS.TAB:
12376                    break;
12377                case KEYS.SHIFT:
12378                    break;
12379                case KEYS.ESCAPE:
12380                    updateResultList('');
12381                    break;
12382                case KEYS.ARROW_DOWN:
12383                    event.preventDefault();
12384                    shiftFocus(false);
12385                    break;
12386                case KEYS.ARROW_UP:
12387                    event.preventDefault();
12388                    shiftFocus(true);
12389                    break;
12390                default:
12391                    debounceSearch(event.target.closest('form'));
12392                    break;
12393            }
12394        });
12395
12396        // Performing search when form is submitted
12397        paragraphkeySearchContainer.addEventListener('submit', event => {
12398            event.preventDefault();
12399            doSearch(event.target);
12400        });
12401
12402        // Toggle clear button visibility as per search input value
12403        searchInput.addEventListener('keyup', e => {
12404            toggleClearButton(clearButton);
12405        });
12406
12407        // Clear search input and result list when clear button is clicked
12408        if (clearButton !== null) {
12409            clearButton.onclick = (e) => {
12410                e.preventDefault();
12411                searchInput.value = '';
12412                updateResultList('');
12413                toggleClearButton(clearButton);
12414            };
12415        }
12416    }
12417};;
12418infotooltip = {
12419    init: function () {
12420        require(['vendor/popper'], function (popper) {
12421            $('.infotooltip-btn').off('click keypress blur');
12422
12423            $('.infotooltip-btn').each(function (e) {
12424                var listBoxLabel = $(this).parent().find('.listbox-area > .left-area > span');
12425                if (listBoxLabel.length > 0)
12426                    $(listBoxLabel).remove();
12427                // Do popper stuff
12428                $(this).on('click keypress', function (e) {
12429                    if (e.type === 'keypress') {
12430                        var key = e.charCode || e.keyCode;
12431                        if (key !== 32 && key !== 13)
12432                            return;
12433                    }
12434                    e.preventDefault();
12435                    var infoDiv = $(this).siblings('.infotooltip')[0];
12436                    $(infoDiv).toggle();
12437                    popper.createPopper($(this)[0], infoDiv, {
12438                        placement: 'top',
12439                        modifiers: [
12440                            {
12441                                name: 'offset',
12442                                options: {
12443                                    offset: [0, 10]
12444                                }
12445                            }
12446                        ]
12447
12448                    });
12449                });
12450                $(this).on('blur', function (e) {
12451                    e.preventDefault();
12452                    var infoDiv = $(this).siblings('.infotooltip')[0];
12453                    $(infoDiv).hide();
12454                });
12455            });
12456        });
12457    }
12458};;
12459accordion = {
12460    init: function () {
12461        // Grab all elements with the data-accordion-target attribute
12462        const accordionToggles = document.querySelectorAll('[data-accordion-target]');
12463
12464        // Function to set aria-expanded based on the class 'show'
12465        function updateAriaExpanded(toggle, targetElement) {
12466            const isExpanded = targetElement.classList.contains('show');
12467            toggle.setAttribute('aria-expanded', isExpanded);
12468        }
12469
12470        accordionToggles.forEach(toggle => {
12471            const targetId = toggle.getAttribute('data-accordion-target');
12472            const targetElement = document.getElementById(targetId);
12473
12474            if (targetElement) {
12475                // If target element contains an element with the class 'highlight', expand it
12476                if (targetElement.querySelector('.highlight')) {
12477                    targetElement.classList.add('show');
12478                    updateAriaExpanded(toggle, targetElement);
12479                }
12480
12481                // Add click event listener to each toggle
12482                toggle.addEventListener('click', function () {
12483                    targetElement.classList.toggle('show');
12484                    updateAriaExpanded(toggle, targetElement);
12485                });
12486            }
12487        });
12488    }
12489};;
12490cookieaccept = {
12491    init: function () {
12492        const forms = document.querySelectorAll('.cookieAcceptForm');
12493
12494        forms.forEach(form => {
12495            form.addEventListener('submit', function (event) {
12496                event.preventDefault();
12497
12498                const formData = new FormData(form);
12499                const url = form.action;
12500
12501                const urlSearchParams = new URLSearchParams(formData);
12502
12503                fetch(url, {
12504                    method: 'POST',
12505                    body: urlSearchParams,
12506                    headers: {
12507                        'Content-Type': 'application/x-www-form-urlencoded'
12508                    }
12509                })
12510                    .then(response => response.json())
12511                    .then(data => {
12512
12513                        const responseTextElement = form.querySelector('.response-text');
12514                        if (responseTextElement) {
12515                            responseTextElement.style.display = 'block';
12516                            responseTextElement.setAttribute('role', 'alert');
12517                            responseTextElement.setAttribute('aria-live', 'assertive');
12518
12519                            setTimeout(() => {
12520                                responseTextElement.style.display = 'none';
12521                                responseTextElement.removeAttribute('role');
12522                                responseTextElement.removeAttribute('aria-live');
12523                            }, 5000);
12524                        }
12525                        
12526                    })
12527                    .catch(error => {
12528                        console.error('Error:', error);
12529                    });
12530            });
12531        });
12532    }
12533};
12534;
12535var imageblock = (function ($) {
12536    var returnObject = {
12537        init: function () {
12538            this.self = this;
12539        },
12540
12541        wireUp: function () {
12542            const expandableImgWrapper = document.querySelectorAll(".expandable-img-wrapper");
12543            const modalDiv = document.createElement("div");
12544            modalDiv.classList.add("modal-display-none");         
12545
12546            if (expandableImgWrapper.length > 0) {
12547                makeImgExpandable();
12548
12549                document.querySelector("body").addEventListener("click", function (event) {
12550                    if (event.target.classList.contains("magnify-img") || event.target.classList.contains("expandable-img")) {
12551                        let img = event.target.closest(".expandable-img-wrapper").querySelector(".expandable-img-original");
12552                        handler(img);
12553                    }
12554
12555                    if (event.target.classList.contains("img-modal") || event.target.classList.contains("close-modal")) {
12556                        handler();
12557                    }
12558                });
12559
12560                //handles keyboard inputs when the modal is displayed
12561                document.querySelector("body").addEventListener("keydown", (event) => {
12562                    if (event.key === "Escape" && modalDiv.classList.contains("img-modal")) {
12563                        handler();
12564                    }
12565
12566                    if (event.key === "Tab" && modalDiv.classList.contains("img-modal")) {
12567                        if (document.activeElement === document.querySelector(".expanded-img")) {
12568                            handleModalFocus(event ,".close-modal");
12569                        }
12570                        else if (document.activeElement === document.querySelector(".close-modal")) {
12571                            handleModalFocus(event, ".expanded-img");
12572                        }
12573                        else if (event.shiftKey && document.activeElement === document.querySelector(".expanded-img")) {
12574                            handleModalFocus(event, ".close-modal");
12575                        }
12576                        else if (event.shiftKey && document.activeElement === document.querySelector(".close-modal")) {
12577                            handleModalFocus(event, ".expanded-img");
12578                        }
12579                    }
12580                })
12581            }
12582
12583            //appends the modal to the dom if it's the first time the expandable image is clicked
12584            //if it's not the first time the expandable image is being clicked, handle styling and set tabfocus
12585            function handler(tinyImg) {
12586                if (document.querySelector(".expanded-img") === null) {
12587                    appendModal();
12588                }
12589                toggleModal();
12590                handleExpandedImg(tinyImg);
12591                setInitialFocus();
12592            }
12593
12594            //inserts expand image icon on all expandable images
12595            function makeImgExpandable() {
12596                expandableImgWrapper.forEach((index) => {
12597                    index.insertAdjacentHTML("afterbegin",
12598                        `<div class="magnify-img-wrapper">
12599                            <div class="magnify-img"></div>
12600                        </div>`);
12601
12602                    index.querySelector("img").classList.add("expandable-img");
12603                });
12604            }
12605
12606            function toggleModal() {
12607                modalDiv.classList.toggle("img-modal");
12608                modalDiv.classList.toggle("modal-display-none");
12609                document.querySelector("body").classList.toggle("overflow-hidden");
12610            }
12611
12612            function appendModal() {
12613                document.body.appendChild(modalDiv);
12614                modalDiv.insertAdjacentHTML("afterbegin",
12615                    `<div class="expanded-img-wrapper">
12616                        <button tabindex="-1" class="close-modal"></button>
12617                    </div>`);
12618            }
12619
12620            //gets the data-src for the high res image and uses it as src it in the img tag placed inside the modal
12621            function handleExpandedImg(tinyImg) {
12622                if (!document.querySelector(".expanded-img")) {
12623                    document.querySelector(".expanded-img-wrapper").insertAdjacentHTML("afterbegin", `<img tabindex="-1" class="expanded-img">`);
12624                }
12625
12626                if (tinyImg !== undefined) {
12627                    document.querySelector(".expanded-img").src = tinyImg.getAttribute("data-src");
12628                    document.querySelector(".expanded-img").alt = tinyImg.closest(".expandable-img-wrapper").querySelector(".expandable-img").alt;
12629                }
12630            }
12631
12632            function setInitialFocus() {
12633                document.querySelector(".close-modal").focus();
12634            }
12635
12636            //prevents default tab focus
12637            function handleModalFocus(event, focusClass) {
12638                document.querySelector(focusClass).focus();
12639                event.preventDefault();
12640                return false;
12641            }
12642        }
12643    };
12644    returnObject.init();
12645    return returnObject;
12646})(jQuery);
12647;
12648var referenceBlock = (function ($) {
12649    var returnObject = {
12650        init: function () {
12651            this.self = this;
12652        },
12653        wireUp: function () {
12654
12655            if (!$(".referenceblock").length) { return }
12656
12657            //add reference block paragraph sign click event
12658            let referenceBlockParagraph = $('.referenceblock');
12659            if (referenceBlockParagraph.length !== 0) {
12660                referenceBlockParagraph.find('.section-sign').on('click', paragraphSignClick);
12661            }
12662
12663            //add tabindex and keypress
12664            $('.referenceblock-puff-content').each(function () {
12665                var self = $(this);
12666
12667                $('.section-sign', self).attr('tabindex', '0');
12668                //set h3 class on section-sign
12669                $('.section-sign', self).addClass('h3')
12670
12671                $('.section-sign', self).on('keypress', function (event) {
12672                    var key = event.which || event.keyCode;
12673                    if (key === aria.KeyCode.SPACE || key === aria.KeyCode.RETURN) {
12674                        $(event.target).trigger("click");
12675                        event.preventDefault();
12676                    }
12677                });              
12678            });
12679
12680        },
12681    };
12682
12683    let paragraphSignClick = function (event) {
12684        //clicked section-sign toggle        
12685        var sectionSignEl = $(this);
12686        sectionSignEl.toggleClass( 'open')
12687
12688        // to show/hide section-sign siblings we set class on parent
12689        var elReferenceBlockContent = sectionSignEl.parent();
12690        if (elReferenceBlockContent.length > 0) {
12691            elReferenceBlockContent.toggleClass('active');
12692        }
12693        //fade any provision table
12694        if (elReferenceBlockContent.find('table').length > 0) {
12695            provisionPage.hideProvisionPartsOfTable();
12696        }
12697    };
12698
12699    returnObject.init();
12700    return returnObject;
12701})(jQuery);;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.