vendor: 14,212 bytes, lines 1-2
1/*! jQuery v3.6.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2!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:undefined,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,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},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.1",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=y.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:v}),"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,y,s,c,v,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+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=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))&&v(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+" "]&&(!y||!y.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)&&ve(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(B,"$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 ye(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 ve(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=[],y=[],(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&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.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&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.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);}),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=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&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(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))&&(!y||!y.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),v(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);}
vendor: 15,453 bytes, line 2
2else 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}: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($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return !!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){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-=y)===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(B,"$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:ye(function(){return [0]}),last:ye(function(e,t){return [t-1]}),eq:ye(function(e,t,n){return [n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(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];if(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,y,v,e){return y&&!y[S]&&(y=Ce(y)),v&&!v[S]&&(v=Ce(v,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?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a));}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r);}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a));}}else p=Te(p===t?p.splice(l,p.length):p),v?v(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(B,"$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(B," ")}),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,y,v,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,(y=o,m=0<(v=i).length,x=0<y.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=y[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=v[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+v.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)&&ve(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)&&ve(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
2nding",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 $(){E.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),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",$),C.addEventListener("load",$));var B=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)B(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);}):B(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),v.checkClone
vendor: 14,264 bytes, line 2
2=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.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 ye(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 ve(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,v.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=ye(f.appendChild(o),"script"),l&&ve(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,y=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=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.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,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.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,y.handle)||S.removeEvent(e,d,y.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(t,e){S.event.special[t]={setup:function(){return Se(this,t,Ce),!1},trigger:function(){return Se(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e};}),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&&!v.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(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ye(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(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(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(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(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||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(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 B(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(ye(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 B(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(ye(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(ye(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=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=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},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return (n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&(a=a.replace($e,"$1")),""!==a||ie(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(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;
2left:-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="",v.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(v,{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 ze=["Webkit","Moz","ms"],Ue=E.createElement("div").style,Xe={};function Ve(e){var t=S.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(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 Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto";}return (!v.boxSizingReliable()&&i||!v.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)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"o
2pacity");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=Re.test(t),l=e.style;if(u||(t=Ve(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")),v.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 Re.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[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 !Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}};}),S.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return (parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(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=Je);}),S.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(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=et).prototype={constructor:et,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=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.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):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.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[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit);}}}).scrollTop=et.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=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick());}function ut(){return C.setTimeout(function(){tt=void 0;}),tt=Date.now()}function lt(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 ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem;}),u=function(){if(a)return !1;for(var e=tt||ut(),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:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.o
vendor: 4,788 bytes, line 2
2pts,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=ft.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,ct,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(ft,{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],ft.tweeners[n]=ft.tweeners[n]||[],ft.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),y=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],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0;}d[r]=y&&y[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=y&&y.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||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.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=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0));}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.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=ft(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&&at.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(lt(r,!0),e,t,n)};}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("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(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0;}
vendor: 16,097 bytes, line 2
2,S.fx.timer=function(e){S.timers.push(e),S.fx.start();},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st());},S.fx.stop=function(){nt=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);};})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(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)?pt: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(!v.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);}}),pt={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=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r};});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return (e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return B(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):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.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;return m(t)?this.each(function(e){S(this).addClass(t.call(this,e,vt(this)));}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a);}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).removeClass(t.call(this,e,vt(this)));}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ");}a=yt(n),r!==a&&this.setAttribute("class",a);}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){S(this).toggleClass(t.call(this,e,vt(this),n),n);}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=S(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""));}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return !0;return !1}});var xt=/\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(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(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)}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value});}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=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=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.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,bt.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,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),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)}}),v.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 Tt=C.location,Ct={guid:Date.now()},Et=/\?/;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 St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i);});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(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)jt(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")&&Nt.test(this.nodeName)&&!At.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(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(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 $t(t,i,o,a){var s={},u=t===Mt;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 Bt(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}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,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?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),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,y=S.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?S(v):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.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&&(y.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),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=E.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host;}catch(e){y.crossDomain=!0;}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=S.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in (g=S.event&&y.global)&&0==S.active++&&S.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(Et.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout");},y.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]}(y,T,n)),!i&&-1<S.inArray("script",y.dataTypes)&&S.inArray("json",y.dataTypes)<0&&(y.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}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===y.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(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--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(){}}
vendor: 4,873 bytes, line 2
2,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 _t={0:200,1223:204},zt=S.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!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(_t[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 Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.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(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.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,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0;}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return "string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.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=yt(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,"to
2p"),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 B(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]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(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 B(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 Gt=/^[\s\uFEFF\xA0]+|([^\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(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S}); 3 4/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 5"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window);}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return -1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0;},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]];},s.migrateIsPatchEnabled=function(e){return !t[e]}
5,n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()));}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e;}});}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)};}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0;},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t);}catch(e){t=t.replace(g,function(e,t,r,n){return "["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t;}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0]);}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return ("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase();}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return "function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated");}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return !(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1));}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"");}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e});}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={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},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t);}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments);},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e;}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={}
5,r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop());}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return "load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3");}),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,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated");}),s(function(){s(n.document).triggerHandler("ready");}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated");}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags");},i(s,"htmlPrefilter",function(e){var t,r;return (r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return !e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments);});}),o=null;}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s}); 6 7/** 8 * jQuery.timers - Timer abstractions for jQuery 9 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) 10 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). 11 * Date: 2009/10/16 12 * 13 * @author Blair Mitchelmore 14 * @version 1.2 15 * 16 **/ 17 18jQuery.fn.extend({ 19 everyTime: function(interval, label, fn, times) { 20 return this.each(function() { 21 jQuery.timer.add(this, interval, label, fn, times); 22 }); 23 }, 24 oneTime: function(interval, label, fn) { 25 return this.each(function() { 26 jQuery.timer.add(this, interval, label, fn, 1); 27 }); 28 }, 29 stopTime: function(label, fn) { 30 return this.each(function() { 31 jQuery.timer.remove(this, label, fn); 32 }); 33 } 34}); 35 36jQuery.extend({ 37 timer: { 38 global: [], 39 guid: 1, 40 dataKey: "jQuery.timer", 41 regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, 42 powers: { 43 // Yeah this is major overkill... 44 'ms': 1, 45 'cs': 10, 46 'ds': 100, 47 's': 1000, 48 'das': 10000, 49 'hs': 100000, 50 'ks': 1000000 51 }, 52 timeParse: function(value) { 53 if (value == undefined || value == null) 54 return null; 55 var result = this.regex.exec(jQuery.trim(value.toString())); 56 if (result[2]) { 57 var num = parseFloat(result[1]); 58 var mult = this.powers[result[2]] || 1; 59 return num * mult; 60 } else { 61 return value; 62 } 63 }, 64 add: function(element, interval, label, fn, times) { 65 var counter = 0; 66 67 if (jQuery.isFunction(label)) { 68 if (!times) 69 times = fn; 70 fn = label; 71 label = interval; 72 } 73 74 interval = jQuery.timer.timeParse(interval); 75 76 if (typeof interval != 'number' || isNaN(interval) || interval < 0) 77 return; 78 79 if (typeof times != 'number' || isNaN(times) || times < 0) 80 times = 0; 81 82 times = times || 0; 83 84 var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); 85 86 if (!timers[label]) 87 timers[label] = {}; 88 89 fn.timerID = fn.timerID || this.guid++; 90 91 var handler = function() { 92 if ((++counter > times && times !== 0) || fn.call(element, counter) === false) 93 jQuery.timer.remove(element, label, fn); 94 }; 95 96 handler.timerID = fn.timerID; 97 98 if (!timers[label][fn.timerID]) 99 timers[label][fn.timerID] = window.setInterval(handler,interval); 100 101 this.global.push( element ); 102 103 }, 104 remove: function(element, label, fn) { 105 var timers = jQuery.data(element, this.dataKey), ret; 106 107 if ( timers ) { 108 109 if (!label) { 110 for ( label in timers ) 111 this.remove(element, label, fn); 112 } else if ( timers[label] ) { 113 if ( fn ) { 114 if ( fn.timerID ) { 115 window.clearInterval(timers[label][fn.timerID]); 116 delete timers[label][fn.timerID]; 117 } 118 } else { 119 for ( var fn in timers[label] ) { 120 window.clearInterval(timers[label][fn]); 121 delete timers[label][fn]; 122 } 123 } 124 125 for ( ret in timers[label] ) break; 126 if ( !ret ) { 127 ret = null; 128 delete timers[label]; 129 } 130 } 131 132 for ( ret in timers ) break; 133 if ( !ret ) 134 jQuery.removeData(element, this.dataKey); 135 } 136 } 137 } 138}); 139 140jQuery(window).on("unload", function() { 141 jQuery.each(jQuery.timer.global, function(index, item) { 142 jQuery.timer.remove(item); 143 }); 144}); 145 146// Lock a submit button when clicked from being clicking again and change the value of the submit to a message, while preserving the submits name and value in a hidden input. 147// License: http://www.gnu.org/licenses/lgpl.txt 148// Homepage: http://blog.leenix.co.uk/2009/09/jquery-plugin-locksubmit-stop-submit.html 149// Version 1.03 150 151jQuery.fn.lockSubmit = function(options) { 152 153 //Default text to change submit button too 154 var settings = jQuery.extend({ 155 submitText: null, 156 onAddCSS: null, 157 onClickCSS: null 158 }, options); 159 160 //add CSS to this button 161 if(settings.onAddCSS) {this.addClass(settings.onAddCSS);} 162 163 return this.click(function(e) { 164 165 // If this button is already hidden, then don't continue with locking process. 166 // This might occur if e.g. the user presses 'Enter' multiple times. 167 // For a more nuclear option at preventing multiple submissions, see: https://pastebin.com/JGn86V3a 168 if ($(this).css('display') === 'none') { 169 // Returning 'false' here will also stop event propogation and browser behaviour. 170 return false; 171 } 172 173 //Hide current submit and insert a dummy submit which is disabled. 174 //The reason for doing this and not just disabling the normal submit, is that in some browsers 175 //the disabled submit will stop the form being submited at all. 176 w = jQuery(this).outerWidth(); 177 178 targetselect = jQuery(this); 179 180 targetselect.addClass('locked-submit'); 181 targetselect.hide(); 182
183 //new buttons value 184 if(settings.submitText) { 185 var newValue = settings.submitText; 186 } else { 187 var newValue = jQuery(this).val(); 188 } 189 190 //insert hidden field with name and value of submit 191 targetselect.after("<input id='dummySubmit' disabled='disabled' type='submit' name='"+jQuery(this).attr("name")+"DUMMY' value='"+newValue+"'>"); 192 jQuery("#dummySubmit").innerWidth( w ) ; 193 194 //add onClick CSS 195 if(settings.onClickCSS) { 196 jQuery("#dummySubmit").addClass(settings.onClickCSS); 197 } 198 199 return true; 200 }); 201 202}; 203 204jQuery.fn.lockSubmitReset = function() { 205 this.removeClass('locked-submit'); 206 this.show(); 207 jQuery("#dummySubmit").remove(); 208}; 209 210/*! 211 * hoverIntent v1.10.1 // 2019.10.05 // jQuery v1.7.0+ 212 * http://briancherne.github.io/jquery-hoverIntent/ 213 * 214 * You may use hoverIntent under the terms of the MIT license. Basically that 215 * means you are free to use hoverIntent as long as this header is left intact. 216 * Copyright 2007-2019 Brian Cherne 217 */ 218!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof module&&module.exports?module.exports=factory(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery);}(function($){"use strict";function track(ev){cX=ev.pageX,cY=ev.pageY;}var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg);},cfg.interval);};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});function handleHover(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg);},cfg.interval);}else {if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){!function(ev,$el,s,out){var data=$el.data("hoverIntent");data&&delete data[s.id],out.apply($el[0],[ev]);}(ev,$el,state,cfg.out);},cfg.timeout);}}return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)};}); 219 220!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?exports=n(require("jquery")):n(jQuery);}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,c=1.70158,o=1.525*c,s=2*a/3,f=2*a/4.5;n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return -(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2}
220,easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-(t(2,20*n-10)*r((20*n-11.125)*f))/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return (c+1)*n*n*n-c*n*n},easeOutBack:function(n){return 1+(c+1)*t(n-1,3)+c*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-o)/2:(t(2*n-2,2)*((o+1)*(2*n-2)+o)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}});}); 221 222/* 223 * Capslock 0.2 - jQuery plugin to detect if a user's caps lock is on or not. 224 * 225 * Provides events, "caps_lock_on" and "caps_lock_off", that custom functions can be bound to. 226 * The capslock function can be called on a specific element, a set of elements, or globally: 227 * $("#my_textarea").capslock(options); // One textarea 228 * $("textarea").capslock(options); // All textareas 229 * $().capslock(options); // Globally 230 * 231 * Copyright (c) 2009 Arthur McLean 232 * 233 * Dual licensed under the MIT and GPL licenses: 234 * http://www.opensource.org/licenses/mit-license.php 235 * http://www.gnu.org/licenses/gpl.html 236 * 237 */ 238 239; // Just in case the previously included plug-in failed to close with a semi-colon. 240(function($) { 241 242 $.fn.capslock = function(options) { 243 244 if (options) $.extend($.fn.capslock.defaults, options); 245 246 this.each(function() { 247 $(this).bind("caps_lock_on", $.fn.capslock.defaults.caps_lock_on); 248 $(this).bind("caps_lock_off", $.fn.capslock.defaults.caps_lock_off); 249 250 $(this).keypress(function(e){ 251 check_caps_lock(e); 252 }); 253 }); 254 255 return this; 256 }; 257 258 259 260 // The actual check: 261 function check_caps_lock(e) 262 { 263 var ascii_code = e.which; 264 var shift_key = e.shiftKey; 265 if( (65 <= ascii_code) && (ascii_code <= 90) && !shift_key) 266 { 267 $(e.target).trigger("caps_lock_on"); 268 } 269 else 270 { 271 $(e.target).trigger("caps_lock_off"); 272 } 273 274 } 275 276 // Public definition of defaults for easy overriding: 277 $.fn.capslock.defaults = { 278 caps_lock_on: function() {}, 279 caps_lock_off: function() {} 280 }; 281 282})(jQuery); 283 284/*! jQuery UI - v1.13.2 - 2022-07-14 285* http://jqueryui.com 286* 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 287* Copyright jQuery Foundation and other contributors; Licensed MIT */ 288 289( function( factory ) { 290 "use strict"; 291 292 if ( typeof define === "function" && define.amd ) { 293 294 // AMD. Register as an anonymous module. 295 define( [ "jquery" ], factory ); 296 } else { 297 298 // Browser globals 299 factory( jQuery ); 300 } 301} )( function( $ ) { 302"use strict"; 303 304$.ui = $.ui || {}; 305 306var version = $.ui.version = "1.13.2"; 307 308 309/*! 310 * jQuery UI Widget 1.13.2 311 * http://jqueryui.com 312 * 313 * Copyright jQuery Foundation and other contributors 314 * Released under the MIT license. 315 * http://jquery.org/license 316 */ 317 318//>>label: Widget 319//>>group: Core 320//>>description: Provides a factory for creating stateful widgets with a common API. 321//>>docs: http://api.jqueryui.com/jQuery.widget/ 322//>>demos: http://jqueryui.com/widget/ 323 324 325var widgetUuid = 0; 326var widgetHasOwnProperty = Array.prototype.hasOwnProperty; 327var widgetSlice = Array.prototype.slice; 328 329$.cleanData = ( function( orig ) { 330 return function( elems ) { 331 var events, elem, i; 332 for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 333 334 // Only trigger remove when necessary to save time 335 events = $._data( elem, "events" ); 336 if ( events && events.remove ) { 337 $( elem ).triggerHandler( "remove" ); 338 } 339 } 340 orig( elems ); 341 }; 342} )( $.cleanData ); 343 344$.widget = function( name, base, prototype ) { 345 var existingConstructor, constructor, basePrototype; 346 347 // ProxiedPrototype allows the provided prototype to remain unmodified 348 // so that it can be used as a mixin for multiple widgets (#8876) 349 var proxiedPrototype = {}; 350 351 var namespace = name.split( "." )[ 0 ]; 352 name = name.split( "." )[ 1 ]; 353 var fullName = namespace + "-" + name; 354 355 if ( !prototype ) { 356 prototype = base; 357 base = $.Widget; 358 } 359 360 if ( Array.isArray( prototype ) ) { 361 prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 362 } 363 364 // Create selector for plugin 365 $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { 366 return !!$.data( elem, fullName ); 367 }; 368 369 $[ namespace ] = $[ namespace ] || {}; 370 existingConstructor = $[ namespace ][ name ]; 371 constructor = $[ namespace ][ name ] = function( options, element ) { 372 373 // Allow instantiation without "new" keyword 374 if ( !this || !this._createWidget ) { 375 return new constructor( options, element ); 376 } 377 378 // Allow instantiation without initializing for simple inheritance 379 // must use "new" keyword (the code above always passes args) 380 if ( arguments.length ) { 381 this._createWidget( options, element ); 382 } 383 }; 384 385 // Extend with the existing constructor to carry over any static properties 386 $.extend( constructor, existingConstructor, { 387 version: prototype.version, 388 389 // Copy the object used to create the prototype in case we need to 390 // redefine the widget later 391 _proto: $.extend( {}, prototype ), 392 393 // Track widgets that inherit from this widget in case this widget is 394 // redefined after a widget inherits from it 395 _childConstructors: [] 396 } ); 397 398 basePrototype = new base(); 399 400 // We need to make the options hash a property directly on the new instance 401 // otherwise we'll modify the options hash on the prototype that we're 402 // inheriting from 403 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 404 $.each( prototype, function( prop, value ) { 405 if ( typeof value !== "function" ) { 406 proxiedPrototype[ prop ] = value; 407 return; 408 } 409 proxiedPrototype[ prop ] = ( function() { 410 function _super() { 411 return base.prototype[ prop ].apply( this, arguments ); 412 } 413 414 function _superApply( args ) { 415 return base.prototype[ prop ].apply( this, args ); 416 } 417 418 return function() { 419 var __super = this._super; 420 var __superApply = this._superApply; 421 var returnValue; 422 423 this._super = _super; 424 this._superApply = _superApply; 425
vendor: 32,706 bytes, lines 426-1550
426 returnValue = value.apply( this, arguments ); 427 428 this._super = __super; 429 this._superApply = __superApply; 430 431 return returnValue; 432 }; 433 } )(); 434 } ); 435 constructor.prototype = $.widget.extend( basePrototype, { 436 437 // TODO: remove support for widgetEventPrefix 438 // always use the name + a colon as the prefix, e.g., draggable:start 439 // don't prefix for widgets that aren't DOM-based 440 widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 441 }, proxiedPrototype, { 442 constructor: constructor, 443 namespace: namespace, 444 widgetName: name, 445 widgetFullName: fullName 446 } ); 447 448 // If this widget is being redefined then we need to find all widgets that 449 // are inheriting from it and redefine all of them so that they inherit from 450 // the new version of this widget. We're essentially trying to replace one 451 // level in the prototype chain. 452 if ( existingConstructor ) { 453 $.each( existingConstructor._childConstructors, function( i, child ) { 454 var childPrototype = child.prototype; 455 456 // Redefine the child widget using the same prototype that was 457 // originally used, but inherit from the new version of the base 458 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 459 child._proto ); 460 } ); 461 462 // Remove the list of existing child constructors from the old constructor 463 // so the old child constructors can be garbage collected 464 delete existingConstructor._childConstructors; 465 } else { 466 base._childConstructors.push( constructor ); 467 } 468 469 $.widget.bridge( name, constructor ); 470 471 return constructor; 472}; 473 474$.widget.extend = function( target ) { 475 var input = widgetSlice.call( arguments, 1 ); 476 var inputIndex = 0; 477 var inputLength = input.length; 478 var key; 479 var value; 480 481 for ( ; inputIndex < inputLength; inputIndex++ ) { 482 for ( key in input[ inputIndex ] ) { 483 value = input[ inputIndex ][ key ]; 484 if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { 485 486 // Clone objects 487 if ( $.isPlainObject( value ) ) { 488 target[ key ] = $.isPlainObject( target[ key ] ) ? 489 $.widget.extend( {}, target[ key ], value ) : 490 491 // Don't extend strings, arrays, etc. with objects 492 $.widget.extend( {}, value ); 493 494 // Copy everything else by reference 495 } else { 496 target[ key ] = value; 497 } 498 } 499 } 500 } 501 return target; 502}; 503 504$.widget.bridge = function( name, object ) { 505 var fullName = object.prototype.widgetFullName || name; 506 $.fn[ name ] = function( options ) { 507 var isMethodCall = typeof options === "string"; 508 var args = widgetSlice.call( arguments, 1 ); 509 var returnValue = this; 510 511 if ( isMethodCall ) { 512 513 // If this is an empty collection, we need to have the instance method 514 // return undefined instead of the jQuery instance 515 if ( !this.length && options === "instance" ) { 516 returnValue = undefined; 517 } else { 518 this.each( function() { 519 var methodValue; 520 var instance = $.data( this, fullName ); 521 522 if ( options === "instance" ) { 523 returnValue = instance; 524 return false; 525 } 526 527 if ( !instance ) { 528 return $.error( "cannot call methods on " + name + 529 " prior to initialization; " + 530 "attempted to call method '" + options + "'" ); 531 } 532 533 if ( typeof instance[ options ] !== "function" || 534 options.charAt( 0 ) === "_" ) { 535 return $.error( "no such method '" + options + "' for " + name + 536 " widget instance" ); 537 } 538 539 methodValue = instance[ options ].apply( instance, args ); 540 541 if ( methodValue !== instance && methodValue !== undefined ) { 542 returnValue = methodValue && methodValue.jquery ? 543 returnValue.pushStack( methodValue.get() ) : 544 methodValue; 545 return false; 546 } 547 } ); 548 } 549 } else { 550 551 // Allow multiple hashes to be passed on init 552 if ( args.length ) { 553 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 554 } 555 556 this.each( function() { 557 var instance = $.data( this, fullName ); 558 if ( instance ) { 559 instance.option( options || {} ); 560 if ( instance._init ) { 561 instance._init(); 562 } 563 } else { 564 $.data( this, fullName, new object( options, this ) ); 565 } 566 } ); 567 } 568 569 return returnValue; 570 }; 571}; 572 573$.Widget = function( /* options, element */ ) {}; 574$.Widget._childConstructors = []; 575 576$.Widget.prototype = { 577 widgetName: "widget", 578 widgetEventPrefix: "", 579 defaultElement: "<div>", 580 581 options: { 582 classes: {}, 583 disabled: false, 584 585 // Callbacks 586 create: null 587 }, 588 589 _createWidget: function( options, element ) { 590 element = $( element || this.defaultElement || this )[ 0 ]; 591 this.element = $( element ); 592 this.uuid = widgetUuid++; 593 this.eventNamespace = "." + this.widgetName + this.uuid; 594 595 this.bindings = $(); 596 this.hoverable = $(); 597 this.focusable = $(); 598 this.classesElementLookup = {}; 599 600 if ( element !== this ) { 601 $.data( element, this.widgetFullName, this ); 602 this._on( true, this.element, { 603 remove: function( event ) { 604 if ( event.target === element ) { 605 this.destroy(); 606 } 607 } 608 } ); 609 this.document = $( element.style ? 610 611 // Element within the document 612 element.ownerDocument : 613 614 // Element is window or document 615 element.document || element ); 616 this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 617 } 618 619 this.options = $.widget.extend( {}, 620 this.options, 621 this._getCreateOptions(), 622 options ); 623 624 this._create(); 625 626 if ( this.options.disabled ) { 627 this._setOptionDisabled( this.options.disabled ); 628 } 629 630 this._trigger( "create", null, this._getCreateEventData() ); 631 this._init(); 632 }, 633 634 _getCreateOptions: function() { 635 return {}; 636 }, 637 638 _getCreateEventData: $.noop, 639 640 _create: $.noop, 641 642 _init: $.noop, 643 644 destroy: function() { 645 var that = this; 646 647 this._destroy(); 648 $.each( this.classesElementLookup, function( key, value ) { 649 that._removeClass( value, key ); 650 } ); 651 652 // We can probably remove the unbind calls in 2.0 653 // all event bindings should go through this._on() 654 this.element 655 .off( this.eventNamespace ) 656 .removeData( this.widgetFullName ); 657 this.widget() 658 .off( this.eventNamespace ) 659 .removeAttr( "aria-disabled" ); 660 661 // Clean up events and states 662 this.bindings.off( this.eventNamespace ); 663 }, 664 665 _destroy: $.noop, 666 667 widget: function() { 668 return this.element; 669 }, 670 671 option: function( key, value ) { 672 var options = key; 673 var parts; 674 var curOption; 675 var i; 676 677 if ( arguments.length === 0 ) { 678 679 // Don't return a reference to the internal hash 680 return $.widget.extend( {}, this.options ); 681 } 682 683 if ( typeof key === "string" ) { 684 685 // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 686 options = {}; 687 parts = key.split( "." ); 688 key = parts.shift(); 689 if ( parts.length ) { 690 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 691 for ( i = 0; i < parts.length - 1; i++ ) { 692 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 693 curOption = curOption[ parts[ i ] ]; 694 } 695 key = parts.pop(); 696 if ( arguments.length === 1 ) { 697 return curOption[ key ] === undefined ? null : curOption[ key ]; 698 } 699 curOption[ key ] = value; 700 } else { 701 if ( arguments.length === 1 ) { 702 return this.options[ key ] === undefined ? null : this.options[ key ]; 703 } 704 options[ key ] = value; 705 } 706 } 707 708 this._setOptions( options ); 709 710 return this; 711 }, 712 713 _setOptions: function( options ) { 714 var key; 715 716 for ( key in options ) { 717 this._setOption( key, options[ key ] ); 718 } 719 720 return this; 721 }, 722 723 _setOption: function( key, value ) { 724 if ( key === "classes" ) { 725 this._setOptionClasses( value ); 726 } 727 728 this.options[ key ] = value; 729 730 if ( key === "disabled" ) { 731 this._setOptionDisabled( value ); 732 } 733 734 return this; 735 }, 736 737 _setOptionClasses: function( value ) { 738 var classKey, elements, currentElements; 739 740 for ( classKey in value ) { 741 currentElements = this.classesElementLookup[ classKey ]; 742 if ( value[ classKey ] === this.options.classes[ classKey ] || 743 !currentElements || 744 !currentElements.length ) { 745 continue; 746 } 747 748 // We are doing this to create a new jQuery object because the _removeClass() call 749 // on the next line is going to destroy the reference to the current elements being 750 // tracked. We need to save a copy of this collection so that we can add the new classes 751 // below. 752 elements = $( currentElements.get() ); 753 this._removeClass( currentElements, classKey ); 754 755 // We don't use _addClass() here, because that uses this.options.classes 756 // for generating the string of classes. We want to use the value passed in from 757 // _setOption(), this is the new value of the classes option which was passed to 758 // _setOption(). We pass this value directly to _classes(). 759 elements.addClass( this._classes( { 760 element: elements, 761 keys: classKey, 762 classes: value, 763 add: true 764 } ) ); 765 } 766 }, 767 768 _setOptionDisabled: function( value ) { 769 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); 770 771 // If the widget is becoming disabled, then nothing is interactive 772 if ( value ) { 773 this._removeClass( this.hoverable, null, "ui-state-hover" ); 774 this._removeClass( this.focusable, null, "ui-state-focus" ); 775 } 776 }, 777 778 enable: function() { 779 return this._setOptions( { disabled: false } ); 780 }, 781 782 disable: function() { 783 return this._setOptions( { disabled: true } ); 784 }, 785 786 _classes: function( options ) { 787 var full = []; 788 var that = this; 789 790 options = $.extend( { 791 element: this.element, 792 classes: this.options.classes || {} 793 }, options ); 794 795 function bindRemoveEvent() { 796 var nodesToBind = []; 797 798 options.element.each( function( _, element ) { 799 var isTracked = $.map( that.classesElementLookup, function( elements ) { 800 return elements; 801 } ) 802 .some( function( elements ) { 803 return elements.is( element ); 804 } ); 805 806 if ( !isTracked ) { 807 nodesToBind.push( element ); 808 } 809 } ); 810 811 that._on( $( nodesToBind ), { 812 remove: "_untrackClassesElement" 813 } ); 814 } 815 816 function processClassString( classes, checkOption ) { 817 var current, i; 818 for ( i = 0; i < classes.length; i++ ) { 819 current = that.classesElementLookup[ classes[ i ] ] || $(); 820 if ( options.add ) { 821 bindRemoveEvent(); 822 current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); 823 } else { 824 current = $( current.not( options.element ).get() ); 825 } 826 that.classesElementLookup[ classes[ i ] ] = current; 827 full.push( classes[ i ] ); 828 if ( checkOption && options.classes[ classes[ i ] ] ) { 829 full.push( options.classes[ classes[ i ] ] ); 830 } 831 } 832 } 833 834 if ( options.keys ) { 835 processClassString( options.keys.match( /\S+/g ) || [], true ); 836 } 837 if ( options.extra ) { 838 processClassString( options.extra.match( /\S+/g ) || [] ); 839 } 840 841 return full.join( " " ); 842 }, 843 844 _untrackClassesElement: function( event ) { 845 var that = this; 846 $.each( that.classesElementLookup, function( key, value ) { 847 if ( $.inArray( event.target, value ) !== -1 ) { 848 that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); 849 } 850 } ); 851 852 this._off( $( event.target ) ); 853 }, 854 855 _removeClass: function( element, keys, extra ) { 856 return this._toggleClass( element, keys, extra, false ); 857 }, 858 859 _addClass: function( element, keys, extra ) { 860 return this._toggleClass( element, keys, extra, true ); 861 }, 862 863 _toggleClass: function( element, keys, extra, add ) { 864 add = ( typeof add === "boolean" ) ? add : extra; 865 var shift = ( typeof element === "string" || element === null ), 866 options = { 867 extra: shift ? keys : extra, 868 keys: shift ? element : keys, 869 element: shift ? this.element : element, 870 add: add 871 }; 872 options.element.toggleClass( this._classes( options ), add ); 873 return this; 874 }, 875 876 _on: function( suppressDisabledCheck, element, handlers ) { 877 var delegateElement; 878 var instance = this; 879 880 // No suppressDisabledCheck flag, shuffle arguments 881 if ( typeof suppressDisabledCheck !== "boolean" ) { 882 handlers = element; 883 element = suppressDisabledCheck; 884 suppressDisabledCheck = false; 885 } 886 887 // No element argument, shuffle and use this.element 888 if ( !handlers ) { 889 handlers = element; 890 element = this.element; 891 delegateElement = this.widget(); 892 } else { 893 element = delegateElement = $( element ); 894 this.bindings = this.bindings.add( element ); 895 } 896 897 $.each( handlers, function( event, handler ) { 898 function handlerProxy() { 899 900 // Allow widgets to customize the disabled handling 901 // - disabled as an array instead of boolean 902 // - disabled class as method for disabling individual parts 903 if ( !suppressDisabledCheck && 904 ( instance.options.disabled === true || 905 $( this ).hasClass( "ui-state-disabled" ) ) ) { 906 return; 907 } 908 return ( typeof handler === "string" ? instance[ handler ] : handler ) 909 .apply( instance, arguments ); 910 } 911 912 // Copy the guid so direct unbinding works 913 if ( typeof handler !== "string" ) { 914 handlerProxy.guid = handler.guid = 915 handler.guid || handlerProxy.guid || $.guid++; 916 } 917 918 var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 919 var eventName = match[ 1 ] + instance.eventNamespace; 920 var selector = match[ 2 ]; 921 922 if ( selector ) { 923 delegateElement.on( eventName, selector, handlerProxy ); 924 } else { 925 element.on( eventName, handlerProxy ); 926 } 927 } ); 928 }, 929 930 _off: function( element, eventName ) { 931 eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 932 this.eventNamespace; 933 element.off( eventName ); 934 935 // Clear the stack to avoid memory leaks (#10056) 936 this.bindings = $( this.bindings.not( element ).get() ); 937 this.focusable = $( this.focusable.not( element ).get() ); 938 this.hoverable = $( this.hoverable.not( element ).get() ); 939 }, 940 941 _delay: function( handler, delay ) { 942 function handlerProxy() { 943 return ( typeof handler === "string" ? instance[ handler ] : handler ) 944 .apply( instance, arguments ); 945 } 946 var instance = this; 947 return setTimeout( handlerProxy, delay || 0 ); 948 }, 949 950 _hoverable: function( element ) { 951 this.hoverable = this.hoverable.add( element ); 952 this._on( element, { 953 mouseenter: function( event ) { 954 this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 955 }, 956 mouseleave: function( event ) { 957 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 958 } 959 } ); 960 }, 961 962 _focusable: function( element ) { 963 this.focusable = this.focusable.add( element ); 964 this._on( element, { 965 focusin: function( event ) { 966 this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 967 }, 968 focusout: function( event ) { 969 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 970 } 971 } ); 972 }, 973 974 _trigger: function( type, event, data ) { 975 var prop, orig; 976 var callback = this.options[ type ]; 977 978 data = data || {}; 979 event = $.Event( event ); 980 event.type = ( type === this.widgetEventPrefix ? 981 type : 982 this.widgetEventPrefix + type ).toLowerCase(); 983 984 // The original event may come from any element 985 // so we need to reset the target on the new event 986 event.target = this.element[ 0 ]; 987 988 // Copy original event properties over to the new event 989 orig = event.originalEvent; 990 if ( orig ) { 991 for ( prop in orig ) { 992 if ( !( prop in event ) ) { 993 event[ prop ] = orig[ prop ]; 994 } 995 } 996 } 997 998 this.element.trigger( event, data ); 999 return !( typeof callback === "function" && 1000 callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 1001 event.isDefaultPrevented() ); 1002 } 1003}; 1004 1005$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 1006 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 1007 if ( typeof options === "string" ) { 1008 options = { effect: options }; 1009 } 1010 1011 var hasOptions; 1012 var effectName = !options ? 1013 method : 1014 options === true || typeof options === "number" ? 1015 defaultEffect : 1016 options.effect || defaultEffect; 1017 1018 options = options || {}; 1019 if ( typeof options === "number" ) { 1020 options = { duration: options }; 1021 } else if ( options === true ) { 1022 options = {}; 1023 } 1024 1025 hasOptions = !$.isEmptyObject( options ); 1026 options.complete = callback; 1027 1028 if ( options.delay ) { 1029 element.delay( options.delay ); 1030 } 1031 1032 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 1033 element[ method ]( options ); 1034 } else if ( effectName !== method && element[ effectName ] ) { 1035 element[ effectName ]( options.duration, options.easing, callback ); 1036 } else { 1037 element.queue( function( next ) { 1038 $( this )[ method ](); 1039 if ( callback ) { 1040 callback.call( element[ 0 ] ); 1041 } 1042 next(); 1043 } ); 1044 } 1045 }; 1046} ); 1047 1048var widget = $.widget; 1049 1050 1051/*! 1052 * jQuery UI Position 1.13.2 1053 * http://jqueryui.com 1054 * 1055 * Copyright jQuery Foundation and other contributors 1056 * Released under the MIT license. 1057 * http://jquery.org/license 1058 * 1059 * http://api.jqueryui.com/position/ 1060 */ 1061 1062//>>label: Position 1063//>>group: Core 1064//>>description: Positions elements relative to other elements. 1065//>>docs: http://api.jqueryui.com/position/ 1066//>>demos: http://jqueryui.com/position/ 1067 1068 1069( function() { 1070var cachedScrollbarWidth, 1071 max = Math.max, 1072 abs = Math.abs, 1073 rhorizontal = /left|center|right/, 1074 rvertical = /top|center|bottom/, 1075 roffset = /[\+\-]\d+(\.[\d]+)?%?/, 1076 rposition = /^\w+/, 1077 rpercent = /%$/, 1078 _position = $.fn.position; 1079 1080function getOffsets( offsets, width, height ) { 1081 return [ 1082 parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), 1083 parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) 1084 ]; 1085} 1086 1087function parseCss( element, property ) { 1088 return parseInt( $.css( element, property ), 10 ) || 0; 1089} 1090 1091function isWindow( obj ) { 1092 return obj != null && obj === obj.window; 1093} 1094 1095function getDimensions( elem ) { 1096 var raw = elem[ 0 ]; 1097 if ( raw.nodeType === 9 ) { 1098 return { 1099 width: elem.width(), 1100 height: elem.height(), 1101 offset: { top: 0, left: 0 } 1102 }; 1103 } 1104 if ( isWindow( raw ) ) { 1105 return { 1106 width: elem.width(), 1107 height: elem.height(), 1108 offset: { top: elem.scrollTop(), left: elem.scrollLeft() } 1109 }; 1110 } 1111 if ( raw.preventDefault ) { 1112 return { 1113 width: 0, 1114 height: 0, 1115 offset: { top: raw.pageY, left: raw.pageX } 1116 }; 1117 } 1118 return { 1119 width: elem.outerWidth(), 1120 height: elem.outerHeight(), 1121 offset: elem.offset() 1122 }; 1123} 1124 1125$.position = { 1126 scrollbarWidth: function() { 1127 if ( cachedScrollbarWidth !== undefined ) { 1128 return cachedScrollbarWidth; 1129 } 1130 var w1, w2, 1131 div = $( "<div style=" + 1132 "'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" + 1133 "<div style='height:300px;width:auto;'></div></div>" ), 1134 innerDiv = div.children()[ 0 ]; 1135 1136 $( "body" ).append( div ); 1137 w1 = innerDiv.offsetWidth; 1138 div.css( "overflow", "scroll" ); 1139 1140 w2 = innerDiv.offsetWidth; 1141 1142 if ( w1 === w2 ) { 1143 w2 = div[ 0 ].clientWidth; 1144 } 1145 1146 div.remove(); 1147 1148 return ( cachedScrollbarWidth = w1 - w2 ); 1149 }, 1150 getScrollInfo: function( within ) { 1151 var overflowX = within.isWindow || within.isDocument ? "" : 1152 within.element.css( "overflow-x" ), 1153 overflowY = within.isWindow || within.isDocument ? "" : 1154 within.element.css( "overflow-y" ), 1155 hasOverflowX = overflowX === "scroll" || 1156 ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), 1157 hasOverflowY = overflowY === "scroll" || 1158 ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); 1159 return { 1160 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 1161 height: hasOverflowX ? $.position.scrollbarWidth() : 0 1162 }; 1163 }, 1164 getWithinInfo: function( element ) { 1165 var withinElement = $( element || window ), 1166 isElemWindow = isWindow( withinElement[ 0 ] ), 1167 isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, 1168 hasOffset = !isElemWindow && !isDocument; 1169 return { 1170 element: withinElement, 1171 isWindow: isElemWindow, 1172 isDocument: isDocument, 1173 offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, 1174 scrollLeft: withinElement.scrollLeft(), 1175 scrollTop: withinElement.scrollTop(), 1176 width: withinElement.outerWidth(), 1177 height: withinElement.outerHeight() 1178 }; 1179 } 1180}; 1181 1182$.fn.position = function( options ) { 1183 if ( !options || !options.of ) { 1184 return _position.apply( this, arguments ); 1185 } 1186 1187 // Make a copy, we don't want to modify arguments 1188 options = $.extend( {}, options ); 1189 1190 var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 1191 1192 // Make sure string options are treated as CSS selectors 1193 target = typeof options.of === "string" ? 1194 $( document ).find( options.of ) : 1195 $( options.of ), 1196 1197 within = $.position.getWithinInfo( options.within ), 1198 scrollInfo = $.position.getScrollInfo( within ), 1199 collision = ( options.collision || "flip" ).split( " " ), 1200 offsets = {}; 1201 1202 dimensions = getDimensions( target ); 1203 if ( target[ 0 ].preventDefault ) { 1204 1205 // Force left top to allow flipping 1206 options.at = "left top"; 1207 } 1208 targetWidth = dimensions.width; 1209 targetHeight = dimensions.height; 1210 targetOffset = dimensions.offset; 1211 1212 // Clone to reuse original targetOffset later 1213 basePosition = $.extend( {}, targetOffset ); 1214 1215 // Force my and at to have valid horizontal and vertical positions 1216 // if a value is missing or invalid, it will be converted to center 1217 $.each( [ "my", "at" ], function() { 1218 var pos = ( options[ this ] || "" ).split( " " ), 1219 horizontalOffset, 1220 verticalOffset; 1221 1222 if ( pos.length === 1 ) { 1223 pos = rhorizontal.test( pos[ 0 ] ) ? 1224 pos.concat( [ "center" ] ) : 1225 rvertical.test( pos[ 0 ] ) ? 1226 [ "center" ].concat( pos ) : 1227 [ "center", "center" ]; 1228 } 1229 pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; 1230 pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; 1231 1232 // Calculate offsets 1233 horizontalOffset = roffset.exec( pos[ 0 ] ); 1234 verticalOffset = roffset.exec( pos[ 1 ] ); 1235 offsets[ this ] = [ 1236 horizontalOffset ? horizontalOffset[ 0 ] : 0, 1237 verticalOffset ? verticalOffset[ 0 ] : 0 1238 ]; 1239 1240 // Reduce to just the positions without the offsets 1241 options[ this ] = [ 1242 rposition.exec( pos[ 0 ] )[ 0 ], 1243 rposition.exec( pos[ 1 ] )[ 0 ] 1244 ]; 1245 } ); 1246 1247 // Normalize collision option 1248 if ( collision.length === 1 ) { 1249 collision[ 1 ] = collision[ 0 ]; 1250 } 1251 1252 if ( options.at[ 0 ] === "right" ) { 1253 basePosition.left += targetWidth; 1254 } else if ( options.at[ 0 ] === "center" ) { 1255 basePosition.left += targetWidth / 2; 1256 } 1257 1258 if ( options.at[ 1 ] === "bottom" ) { 1259 basePosition.top += targetHeight; 1260 } else if ( options.at[ 1 ] === "center" ) { 1261 basePosition.top += targetHeight / 2; 1262 } 1263 1264 atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); 1265 basePosition.left += atOffset[ 0 ]; 1266 basePosition.top += atOffset[ 1 ]; 1267 1268 return this.each( function() { 1269 var collisionPosition, using, 1270 elem = $( this ), 1271 elemWidth = elem.outerWidth(), 1272 elemHeight = elem.outerHeight(), 1273 marginLeft = parseCss( this, "marginLeft" ), 1274 marginTop = parseCss( this, "marginTop" ), 1275 collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + 1276 scrollInfo.width, 1277 collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + 1278 scrollInfo.height, 1279 position = $.extend( {}, basePosition ), 1280 myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); 1281 1282 if ( options.my[ 0 ] === "right" ) { 1283 position.left -= elemWidth; 1284 } else if ( options.my[ 0 ] === "center" ) { 1285 position.left -= elemWidth / 2; 1286 } 1287 1288 if ( options.my[ 1 ] === "bottom" ) { 1289 position.top -= elemHeight; 1290 } else if ( options.my[ 1 ] === "center" ) { 1291 position.top -= elemHeight / 2; 1292 } 1293 1294 position.left += myOffset[ 0 ]; 1295 position.top += myOffset[ 1 ]; 1296 1297 collisionPosition = { 1298 marginLeft: marginLeft, 1299 marginTop: marginTop 1300 }; 1301 1302 $.each( [ "left", "top" ], function( i, dir ) { 1303 if ( $.ui.position[ collision[ i ] ] ) { 1304 $.ui.position[ collision[ i ] ][ dir ]( position, { 1305 targetWidth: targetWidth, 1306 targetHeight: targetHeight, 1307 elemWidth: elemWidth, 1308 elemHeight: elemHeight, 1309 collisionPosition: collisionPosition, 1310 collisionWidth: collisionWidth, 1311 collisionHeight: collisionHeight, 1312 offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], 1313 my: options.my, 1314 at: options.at, 1315 within: within, 1316 elem: elem 1317 } ); 1318 } 1319 } ); 1320 1321 if ( options.using ) { 1322 1323 // Adds feedback as second argument to using callback, if present 1324 using = function( props ) { 1325 var left = targetOffset.left - position.left, 1326 right = left + targetWidth - elemWidth, 1327 top = targetOffset.top - position.top, 1328 bottom = top + targetHeight - elemHeight, 1329 feedback = { 1330 target: { 1331 element: target, 1332 left: targetOffset.left, 1333 top: targetOffset.top, 1334 width: targetWidth, 1335 height: targetHeight 1336 }, 1337 element: { 1338 element: elem, 1339 left: position.left, 1340 top: position.top, 1341 width: elemWidth, 1342 height: elemHeight 1343 }, 1344 horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", 1345 vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" 1346 }; 1347 if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { 1348 feedback.horizontal = "center"; 1349 } 1350 if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { 1351 feedback.vertical = "middle"; 1352 } 1353 if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { 1354 feedback.important = "horizontal"; 1355 } else { 1356 feedback.important = "vertical"; 1357 } 1358 options.using.call( this, props, feedback ); 1359 }; 1360 } 1361 1362 elem.offset( $.extend( position, { using: using } ) ); 1363 } ); 1364}; 1365 1366$.ui.position = { 1367 fit: { 1368 left: function( position, data ) { 1369 var within = data.within, 1370 withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, 1371 outerWidth = within.width, 1372 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1373 overLeft = withinOffset - collisionPosLeft, 1374 overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 1375 newOverRight; 1376 1377 // Element is wider than within 1378 if ( data.collisionWidth > outerWidth ) { 1379 1380 // Element is initially over the left side of within 1381 if ( overLeft > 0 && overRight <= 0 ) { 1382 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - 1383 withinOffset; 1384 position.left += overLeft - newOverRight; 1385 1386 // Element is initially over right side of within 1387 } else if ( overRight > 0 && overLeft <= 0 ) { 1388 position.left = withinOffset; 1389 1390 // Element is initially over both left and right sides of within 1391 } else { 1392 if ( overLeft > overRight ) { 1393 position.left = withinOffset + outerWidth - data.collisionWidth; 1394 } else { 1395 position.left = withinOffset; 1396 } 1397 } 1398 1399 // Too far left -> align with left edge 1400 } else if ( overLeft > 0 ) { 1401 position.left += overLeft; 1402 1403 // Too far right -> align with right edge 1404 } else if ( overRight > 0 ) { 1405 position.left -= overRight; 1406 1407 // Adjust based on position and margin 1408 } else { 1409 position.left = max( position.left - collisionPosLeft, position.left ); 1410 } 1411 }, 1412 top: function( position, data ) { 1413 var within = data.within, 1414 withinOffset = within.isWindow ? within.scrollTop : within.offset.top, 1415 outerHeight = data.within.height, 1416 collisionPosTop = position.top - data.collisionPosition.marginTop, 1417 overTop = withinOffset - collisionPosTop, 1418 overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 1419 newOverBottom; 1420 1421 // Element is taller than within 1422 if ( data.collisionHeight > outerHeight ) { 1423 1424 // Element is initially over the top of within 1425 if ( overTop > 0 && overBottom <= 0 ) { 1426 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - 1427 withinOffset; 1428 position.top += overTop - newOverBottom; 1429 1430 // Element is initially over bottom of within 1431 } else if ( overBottom > 0 && overTop <= 0 ) { 1432 position.top = withinOffset; 1433 1434 // Element is initially over both top and bottom of within 1435 } else { 1436 if ( overTop > overBottom ) { 1437 position.top = withinOffset + outerHeight - data.collisionHeight; 1438 } else { 1439 position.top = withinOffset; 1440 } 1441 } 1442 1443 // Too far up -> align with top 1444 } else if ( overTop > 0 ) { 1445 position.top += overTop; 1446 1447 // Too far down -> align with bottom edge 1448 } else if ( overBottom > 0 ) { 1449 position.top -= overBottom; 1450 1451 // Adjust based on position and margin 1452 } else { 1453 position.top = max( position.top - collisionPosTop, position.top ); 1454 } 1455 } 1456 }, 1457 flip: { 1458 left: function( position, data ) { 1459 var within = data.within, 1460 withinOffset = within.offset.left + within.scrollLeft, 1461 outerWidth = within.width, 1462 offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, 1463 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1464 overLeft = collisionPosLeft - offsetLeft, 1465 overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 1466 myOffset = data.my[ 0 ] === "left" ? 1467 -data.elemWidth : 1468 data.my[ 0 ] === "right" ? 1469 data.elemWidth : 1470 0, 1471 atOffset = data.at[ 0 ] === "left" ? 1472 data.targetWidth : 1473 data.at[ 0 ] === "right" ? 1474 -data.targetWidth : 1475 0, 1476 offset = -2 * data.offset[ 0 ], 1477 newOverRight, 1478 newOverLeft; 1479 1480 if ( overLeft < 0 ) { 1481 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - 1482 outerWidth - withinOffset; 1483 if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { 1484 position.left += myOffset + atOffset + offset; 1485 } 1486 } else if ( overRight > 0 ) { 1487 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + 1488 atOffset + offset - offsetLeft; 1489 if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { 1490 position.left += myOffset + atOffset + offset; 1491 } 1492 } 1493 }, 1494 top: function( position, data ) { 1495 var within = data.within, 1496 withinOffset = within.offset.top + within.scrollTop, 1497 outerHeight = within.height, 1498 offsetTop = within.isWindow ? within.scrollTop : within.offset.top, 1499 collisionPosTop = position.top - data.collisionPosition.marginTop, 1500 overTop = collisionPosTop - offsetTop, 1501 overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 1502 top = data.my[ 1 ] === "top", 1503 myOffset = top ? 1504 -data.elemHeight : 1505 data.my[ 1 ] === "bottom" ? 1506 data.elemHeight : 1507 0, 1508 atOffset = data.at[ 1 ] === "top" ? 1509 data.targetHeight : 1510 data.at[ 1 ] === "bottom" ? 1511 -data.targetHeight : 1512 0, 1513 offset = -2 * data.offset[ 1 ], 1514 newOverTop, 1515 newOverBottom; 1516 if ( overTop < 0 ) { 1517 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - 1518 outerHeight - withinOffset; 1519 if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { 1520 position.top += myOffset + atOffset + offset; 1521 } 1522 } else if ( overBottom > 0 ) { 1523 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + 1524 offset - offsetTop; 1525 if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { 1526 position.top += myOffset + atOffset + offset; 1527 } 1528 } 1529 } 1530 }, 1531 flipfit: { 1532 left: function() { 1533 $.ui.position.flip.left.apply( this, arguments ); 1534 $.ui.position.fit.left.apply( this, arguments ); 1535 }, 1536 top: function() { 1537 $.ui.position.flip.top.apply( this, arguments ); 1538 $.ui.position.fit.top.apply( this, arguments ); 1539 } 1540 } 1541}; 1542 1543} )(); 1544 1545var position = $.ui.position; 1546 1547 1548/*! 1549 * jQuery UI :data 1.13.2 1550 * http://jqueryui.com
vendor: 29,600 bytes, lines 1551-2704
1551 * 1552 * Copyright jQuery Foundation and other contributors 1553 * Released under the MIT license. 1554 * http://jquery.org/license 1555 */ 1556 1557//>>label: :data Selector 1558//>>group: Core 1559//>>description: Selects elements which have data stored under the specified key. 1560//>>docs: http://api.jqueryui.com/data-selector/ 1561 1562 1563var data = $.extend( $.expr.pseudos, { 1564 data: $.expr.createPseudo ? 1565 $.expr.createPseudo( function( dataName ) { 1566 return function( elem ) { 1567 return !!$.data( elem, dataName ); 1568 }; 1569 } ) : 1570 1571 // Support: jQuery <1.8 1572 function( elem, i, match ) { 1573 return !!$.data( elem, match[ 3 ] ); 1574 } 1575} ); 1576 1577/*! 1578 * jQuery UI Disable Selection 1.13.2 1579 * http://jqueryui.com 1580 * 1581 * Copyright jQuery Foundation and other contributors 1582 * Released under the MIT license. 1583 * http://jquery.org/license 1584 */ 1585 1586//>>label: disableSelection 1587//>>group: Core 1588//>>description: Disable selection of text content within the set of matched elements. 1589//>>docs: http://api.jqueryui.com/disableSelection/ 1590 1591// This file is deprecated 1592 1593var disableSelection = $.fn.extend( { 1594 disableSelection: ( function() { 1595 var eventType = "onselectstart" in document.createElement( "div" ) ? 1596 "selectstart" : 1597 "mousedown"; 1598 1599 return function() { 1600 return this.on( eventType + ".ui-disableSelection", function( event ) { 1601 event.preventDefault(); 1602 } ); 1603 }; 1604 } )(), 1605 1606 enableSelection: function() { 1607 return this.off( ".ui-disableSelection" ); 1608 } 1609} ); 1610 1611 1612 1613// Create a local jQuery because jQuery Color relies on it and the 1614// global may not exist with AMD and a custom build (#10199). 1615// This module is a noop if used as a regular AMD module. 1616// eslint-disable-next-line no-unused-vars 1617var jQuery = $; 1618 1619 1620/*! 1621 * jQuery Color Animations v2.2.0 1622 * https://github.com/jquery/jquery-color 1623 * 1624 * Copyright OpenJS Foundation and other contributors 1625 * Released under the MIT license. 1626 * http://jquery.org/license 1627 * 1628 * Date: Sun May 10 09:02:36 2020 +0200 1629 */ 1630 1631 1632 1633 var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " + 1634 "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", 1635 1636 class2type = {}, 1637 toString = class2type.toString, 1638 1639 // plusequals test for += 100 -= 100 1640 rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, 1641 1642 // a set of RE's that can match strings and generate color tuples. 1643 stringParsers = [ { 1644 re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1645 parse: function( execResult ) { 1646 return [ 1647 execResult[ 1 ], 1648 execResult[ 2 ], 1649 execResult[ 3 ], 1650 execResult[ 4 ] 1651 ]; 1652 } 1653 }, { 1654 re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1655 parse: function( execResult ) { 1656 return [ 1657 execResult[ 1 ] * 2.55, 1658 execResult[ 2 ] * 2.55, 1659 execResult[ 3 ] * 2.55, 1660 execResult[ 4 ] 1661 ]; 1662 } 1663 }, { 1664 1665 // this regex ignores A-F because it's compared against an already lowercased string 1666 re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/, 1667 parse: function( execResult ) { 1668 return [ 1669 parseInt( execResult[ 1 ], 16 ), 1670 parseInt( execResult[ 2 ], 16 ), 1671 parseInt( execResult[ 3 ], 16 ), 1672 execResult[ 4 ] ? 1673 ( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) : 1674 1 1675 ]; 1676 } 1677 }, { 1678 1679 // this regex ignores A-F because it's compared against an already lowercased string 1680 re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/, 1681 parse: function( execResult ) { 1682 return [ 1683 parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), 1684 parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), 1685 parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ), 1686 execResult[ 4 ] ? 1687 ( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 ) 1688 .toFixed( 2 ) : 1689 1 1690 ]; 1691 } 1692 }, { 1693 re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1694 space: "hsla", 1695 parse: function( execResult ) { 1696 return [ 1697 execResult[ 1 ], 1698 execResult[ 2 ] / 100, 1699 execResult[ 3 ] / 100, 1700 execResult[ 4 ] 1701 ]; 1702 } 1703 } ], 1704 1705 // jQuery.Color( ) 1706 color = jQuery.Color = function( color, green, blue, alpha ) { 1707 return new jQuery.Color.fn.parse( color, green, blue, alpha ); 1708 }, 1709 spaces = { 1710 rgba: { 1711 props: { 1712 red: { 1713 idx: 0, 1714 type: "byte" 1715 }, 1716 green: { 1717 idx: 1, 1718 type: "byte" 1719 }, 1720 blue: { 1721 idx: 2, 1722 type: "byte" 1723 } 1724 } 1725 }, 1726 1727 hsla: { 1728 props: { 1729 hue: { 1730 idx: 0, 1731 type: "degrees" 1732 }, 1733 saturation: { 1734 idx: 1, 1735 type: "percent" 1736 }, 1737 lightness: { 1738 idx: 2, 1739 type: "percent" 1740 } 1741 } 1742 } 1743 }, 1744 propTypes = { 1745 "byte": { 1746 floor: true, 1747 max: 255 1748 }, 1749 "percent": { 1750 max: 1 1751 }, 1752 "degrees": { 1753 mod: 360, 1754 floor: true 1755 } 1756 }, 1757 support = color.support = {}, 1758 1759 // element for support tests 1760 supportElem = jQuery( "<p>" )[ 0 ], 1761 1762 // colors = jQuery.Color.names 1763 colors, 1764 1765 // local aliases of functions called often 1766 each = jQuery.each; 1767 1768// determine rgba support immediately 1769supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; 1770support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; 1771 1772// define cache name and alpha properties 1773// for rgba and hsla spaces 1774each( spaces, function( spaceName, space ) { 1775 space.cache = "_" + spaceName; 1776 space.props.alpha = { 1777 idx: 3, 1778 type: "percent", 1779 def: 1 1780 }; 1781} ); 1782 1783// Populate the class2type map 1784jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 1785 function( _i, name ) { 1786 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 1787 } ); 1788 1789function getType( obj ) { 1790 if ( obj == null ) { 1791 return obj + ""; 1792 } 1793 1794 return typeof obj === "object" ? 1795 class2type[ toString.call( obj ) ] || "object" : 1796 typeof obj; 1797} 1798 1799function clamp( value, prop, allowEmpty ) { 1800 var type = propTypes[ prop.type ] || {}; 1801 1802 if ( value == null ) { 1803 return ( allowEmpty || !prop.def ) ? null : prop.def; 1804 } 1805 1806 // ~~ is an short way of doing floor for positive numbers 1807 value = type.floor ? ~~value : parseFloat( value ); 1808 1809 // IE will pass in empty strings as value for alpha, 1810 // which will hit this case 1811 if ( isNaN( value ) ) { 1812 return prop.def; 1813 } 1814 1815 if ( type.mod ) { 1816 1817 // we add mod before modding to make sure that negatives values 1818 // get converted properly: -10 -> 350 1819 return ( value + type.mod ) % type.mod; 1820 } 1821 1822 // for now all property types without mod have min and max 1823 return Math.min( type.max, Math.max( 0, value ) ); 1824} 1825 1826function stringParse( string ) { 1827 var inst = color(), 1828 rgba = inst._rgba = []; 1829 1830 string = string.toLowerCase(); 1831 1832 each( stringParsers, function( _i, parser ) { 1833 var parsed, 1834 match = parser.re.exec( string ), 1835 values = match && parser.parse( match ), 1836 spaceName = parser.space || "rgba"; 1837 1838 if ( values ) { 1839 parsed = inst[ spaceName ]( values ); 1840 1841 // if this was an rgba parse the assignment might happen twice 1842 // oh well.... 1843 inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; 1844 rgba = inst._rgba = parsed._rgba; 1845 1846 // exit each( stringParsers ) here because we matched 1847 return false; 1848 } 1849 } ); 1850 1851 // Found a stringParser that handled it 1852 if ( rgba.length ) { 1853 1854 // if this came from a parsed string, force "transparent" when alpha is 0 1855 // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) 1856 if ( rgba.join() === "0,0,0,0" ) { 1857 jQuery.extend( rgba, colors.transparent ); 1858 } 1859 return inst; 1860 } 1861 1862 // named colors 1863 return colors[ string ]; 1864} 1865 1866color.fn = jQuery.extend( color.prototype, { 1867 parse: function( red, green, blue, alpha ) { 1868 if ( red === undefined ) { 1869 this._rgba = [ null, null, null, null ]; 1870 return this; 1871 } 1872 if ( red.jquery || red.nodeType ) { 1873 red = jQuery( red ).css( green ); 1874 green = undefined; 1875 } 1876 1877 var inst = this, 1878 type = getType( red ), 1879 rgba = this._rgba = []; 1880 1881 // more than 1 argument specified - assume ( red, green, blue, alpha ) 1882 if ( green !== undefined ) { 1883 red = [ red, green, blue, alpha ]; 1884 type = "array"; 1885 } 1886 1887 if ( type === "string" ) { 1888 return this.parse( stringParse( red ) || colors._default ); 1889 } 1890 1891 if ( type === "array" ) { 1892 each( spaces.rgba.props, function( _key, prop ) { 1893 rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); 1894 } ); 1895 return this; 1896 } 1897 1898 if ( type === "object" ) { 1899 if ( red instanceof color ) { 1900 each( spaces, function( _spaceName, space ) { 1901 if ( red[ space.cache ] ) { 1902 inst[ space.cache ] = red[ space.cache ].slice(); 1903 } 1904 } ); 1905 } else { 1906 each( spaces, function( _spaceName, space ) { 1907 var cache = space.cache; 1908 each( space.props, function( key, prop ) { 1909 1910 // if the cache doesn't exist, and we know how to convert 1911 if ( !inst[ cache ] && space.to ) { 1912 1913 // if the value was null, we don't need to copy it 1914 // if the key was alpha, we don't need to copy it either 1915 if ( key === "alpha" || red[ key ] == null ) { 1916 return; 1917 } 1918 inst[ cache ] = space.to( inst._rgba ); 1919 } 1920 1921 // this is the only case where we allow nulls for ALL properties. 1922 // call clamp with alwaysAllowEmpty 1923 inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); 1924 } ); 1925 1926 // everything defined but alpha? 1927 if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { 1928 1929 // use the default of 1 1930 if ( inst[ cache ][ 3 ] == null ) { 1931 inst[ cache ][ 3 ] = 1; 1932 } 1933 1934 if ( space.from ) { 1935 inst._rgba = space.from( inst[ cache ] ); 1936 } 1937 } 1938 } ); 1939 } 1940 return this; 1941 } 1942 }, 1943 is: function( compare ) { 1944 var is = color( compare ), 1945 same = true, 1946 inst = this; 1947 1948 each( spaces, function( _, space ) { 1949 var localCache, 1950 isCache = is[ space.cache ]; 1951 if ( isCache ) { 1952 localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; 1953 each( space.props, function( _, prop ) { 1954 if ( isCache[ prop.idx ] != null ) { 1955 same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); 1956 return same; 1957 } 1958 } ); 1959 } 1960 return same; 1961 } ); 1962 return same; 1963 }, 1964 _space: function() { 1965 var used = [], 1966 inst = this; 1967 each( spaces, function( spaceName, space ) { 1968 if ( inst[ space.cache ] ) { 1969 used.push( spaceName ); 1970 } 1971 } ); 1972 return used.pop(); 1973 }, 1974 transition: function( other, distance ) { 1975 var end = color( other ), 1976 spaceName = end._space(), 1977 space = spaces[ spaceName ], 1978 startColor = this.alpha() === 0 ? color( "transparent" ) : this, 1979 start = startColor[ space.cache ] || space.to( startColor._rgba ), 1980 result = start.slice(); 1981 1982 end = end[ space.cache ]; 1983 each( space.props, function( _key, prop ) { 1984 var index = prop.idx, 1985 startValue = start[ index ], 1986 endValue = end[ index ], 1987 type = propTypes[ prop.type ] || {}; 1988 1989 // if null, don't override start value 1990 if ( endValue === null ) { 1991 return; 1992 } 1993 1994 // if null - use end 1995 if ( startValue === null ) { 1996 result[ index ] = endValue; 1997 } else { 1998 if ( type.mod ) { 1999 if ( endValue - startValue > type.mod / 2 ) { 2000 startValue += type.mod; 2001 } else if ( startValue - endValue > type.mod / 2 ) { 2002 startValue -= type.mod; 2003 } 2004 } 2005 result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); 2006 } 2007 } ); 2008 return this[ spaceName ]( result ); 2009 }, 2010 blend: function( opaque ) { 2011 2012 // if we are already opaque - return ourself 2013 if ( this._rgba[ 3 ] === 1 ) { 2014 return this; 2015 } 2016 2017 var rgb = this._rgba.slice(), 2018 a = rgb.pop(), 2019 blend = color( opaque )._rgba; 2020 2021 return color( jQuery.map( rgb, function( v, i ) { 2022 return ( 1 - a ) * blend[ i ] + a * v; 2023 } ) ); 2024 }, 2025 toRgbaString: function() { 2026 var prefix = "rgba(", 2027 rgba = jQuery.map( this._rgba, function( v, i ) { 2028 if ( v != null ) { 2029 return v; 2030 } 2031 return i > 2 ? 1 : 0; 2032 } ); 2033 2034 if ( rgba[ 3 ] === 1 ) { 2035 rgba.pop(); 2036 prefix = "rgb("; 2037 } 2038 2039 return prefix + rgba.join() + ")"; 2040 }, 2041 toHslaString: function() { 2042 var prefix = "hsla(", 2043 hsla = jQuery.map( this.hsla(), function( v, i ) { 2044 if ( v == null ) { 2045 v = i > 2 ? 1 : 0; 2046 } 2047 2048 // catch 1 and 2 2049 if ( i && i < 3 ) { 2050 v = Math.round( v * 100 ) + "%"; 2051 } 2052 return v; 2053 } ); 2054 2055 if ( hsla[ 3 ] === 1 ) { 2056 hsla.pop(); 2057 prefix = "hsl("; 2058 } 2059 return prefix + hsla.join() + ")"; 2060 }, 2061 toHexString: function( includeAlpha ) { 2062 var rgba = this._rgba.slice(), 2063 alpha = rgba.pop(); 2064 2065 if ( includeAlpha ) { 2066 rgba.push( ~~( alpha * 255 ) ); 2067 } 2068 2069 return "#" + jQuery.map( rgba, function( v ) { 2070 2071 // default to 0 when nulls exist 2072 v = ( v || 0 ).toString( 16 ); 2073 return v.length === 1 ? "0" + v : v; 2074 } ).join( "" ); 2075 }, 2076 toString: function() { 2077 return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); 2078 } 2079} ); 2080color.fn.parse.prototype = color.fn; 2081 2082// hsla conversions adapted from: 2083// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 2084 2085function hue2rgb( p, q, h ) { 2086 h = ( h + 1 ) % 1; 2087 if ( h * 6 < 1 ) { 2088 return p + ( q - p ) * h * 6; 2089 } 2090 if ( h * 2 < 1 ) { 2091 return q; 2092 } 2093 if ( h * 3 < 2 ) { 2094 return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6; 2095 } 2096 return p; 2097} 2098 2099spaces.hsla.to = function( rgba ) { 2100 if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { 2101 return [ null, null, null, rgba[ 3 ] ]; 2102 } 2103 var r = rgba[ 0 ] / 255, 2104 g = rgba[ 1 ] / 255, 2105 b = rgba[ 2 ] / 255, 2106 a = rgba[ 3 ], 2107 max = Math.max( r, g, b ), 2108 min = Math.min( r, g, b ), 2109 diff = max - min, 2110 add = max + min, 2111 l = add * 0.5, 2112 h, s; 2113 2114 if ( min === max ) { 2115 h = 0; 2116 } else if ( r === max ) { 2117 h = ( 60 * ( g - b ) / diff ) + 360; 2118 } else if ( g === max ) { 2119 h = ( 60 * ( b - r ) / diff ) + 120; 2120 } else { 2121 h = ( 60 * ( r - g ) / diff ) + 240; 2122 } 2123 2124 // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% 2125 // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) 2126 if ( diff === 0 ) { 2127 s = 0; 2128 } else if ( l <= 0.5 ) { 2129 s = diff / add; 2130 } else { 2131 s = diff / ( 2 - add ); 2132 } 2133 return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ]; 2134}; 2135 2136spaces.hsla.from = function( hsla ) { 2137 if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { 2138 return [ null, null, null, hsla[ 3 ] ]; 2139 } 2140 var h = hsla[ 0 ] / 360, 2141 s = hsla[ 1 ], 2142 l = hsla[ 2 ], 2143 a = hsla[ 3 ], 2144 q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, 2145 p = 2 * l - q; 2146 2147 return [ 2148 Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), 2149 Math.round( hue2rgb( p, q, h ) * 255 ), 2150 Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), 2151 a 2152 ]; 2153}; 2154 2155 2156each( spaces, function( spaceName, space ) { 2157 var props = space.props, 2158 cache = space.cache, 2159 to = space.to, 2160 from = space.from; 2161 2162 // makes rgba() and hsla() 2163 color.fn[ spaceName ] = function( value ) { 2164 2165 // generate a cache for this space if it doesn't exist 2166 if ( to && !this[ cache ] ) { 2167 this[ cache ] = to( this._rgba ); 2168 } 2169 if ( value === undefined ) { 2170 return this[ cache ].slice(); 2171 } 2172 2173 var ret, 2174 type = getType( value ), 2175 arr = ( type === "array" || type === "object" ) ? value : arguments, 2176 local = this[ cache ].slice(); 2177 2178 each( props, function( key, prop ) { 2179 var val = arr[ type === "object" ? key : prop.idx ]; 2180 if ( val == null ) { 2181 val = local[ prop.idx ]; 2182 } 2183 local[ prop.idx ] = clamp( val, prop ); 2184 } ); 2185 2186 if ( from ) { 2187 ret = color( from( local ) ); 2188 ret[ cache ] = local; 2189 return ret; 2190 } else { 2191 return color( local ); 2192 } 2193 }; 2194 2195 // makes red() green() blue() alpha() hue() saturation() lightness() 2196 each( props, function( key, prop ) { 2197 2198 // alpha is included in more than one space 2199 if ( color.fn[ key ] ) { 2200 return; 2201 } 2202 color.fn[ key ] = function( value ) { 2203 var local, cur, match, fn, 2204 vtype = getType( value ); 2205 2206 if ( key === "alpha" ) { 2207 fn = this._hsla ? "hsla" : "rgba"; 2208 } else { 2209 fn = spaceName; 2210 } 2211 local = this[ fn ](); 2212 cur = local[ prop.idx ]; 2213 2214 if ( vtype === "undefined" ) { 2215 return cur; 2216 } 2217 2218 if ( vtype === "function" ) { 2219 value = value.call( this, cur ); 2220 vtype = getType( value ); 2221 } 2222 if ( value == null && prop.empty ) { 2223 return this; 2224 } 2225 if ( vtype === "string" ) { 2226 match = rplusequals.exec( value ); 2227 if ( match ) { 2228 value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); 2229 } 2230 } 2231 local[ prop.idx ] = value; 2232 return this[ fn ]( local ); 2233 }; 2234 } ); 2235} ); 2236 2237// add cssHook and .fx.step function for each named hook. 2238// accept a space separated string of properties 2239color.hook = function( hook ) { 2240 var hooks = hook.split( " " ); 2241 each( hooks, function( _i, hook ) { 2242 jQuery.cssHooks[ hook ] = { 2243 set: function( elem, value ) { 2244 var parsed, curElem, 2245 backgroundColor = ""; 2246 2247 if ( value !== "transparent" && ( getType( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { 2248 value = color( parsed || value ); 2249 if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { 2250 curElem = hook === "backgroundColor" ? elem.parentNode : elem; 2251 while ( 2252 ( backgroundColor === "" || backgroundColor === "transparent" ) && 2253 curElem && curElem.style 2254 ) { 2255 try { 2256 backgroundColor = jQuery.css( curElem, "backgroundColor" ); 2257 curElem = curElem.parentNode; 2258 } catch ( e ) { 2259 } 2260 } 2261 2262 value = value.blend( backgroundColor && backgroundColor !== "transparent" ? 2263 backgroundColor : 2264 "_default" ); 2265 } 2266 2267 value = value.toRgbaString(); 2268 } 2269 try { 2270 elem.style[ hook ] = value; 2271 } catch ( e ) { 2272 2273 // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' 2274 } 2275 } 2276 }; 2277 jQuery.fx.step[ hook ] = function( fx ) { 2278 if ( !fx.colorInit ) { 2279 fx.start = color( fx.elem, hook ); 2280 fx.end = color( fx.end ); 2281 fx.colorInit = true; 2282 } 2283 jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); 2284 }; 2285 } ); 2286 2287}; 2288 2289color.hook( stepHooks ); 2290 2291jQuery.cssHooks.borderColor = { 2292 expand: function( value ) { 2293 var expanded = {}; 2294 2295 each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) { 2296 expanded[ "border" + part + "Color" ] = value; 2297 } ); 2298 return expanded; 2299 } 2300}; 2301 2302// Basic color names only. 2303// Usage of any of the other color names requires adding yourself or including 2304// jquery.color.svg-names.js. 2305colors = jQuery.Color.names = { 2306 2307 // 4.1. Basic color keywords 2308 aqua: "#00ffff", 2309 black: "#000000", 2310 blue: "#0000ff", 2311 fuchsia: "#ff00ff", 2312 gray: "#808080", 2313 green: "#008000", 2314 lime: "#00ff00", 2315 maroon: "#800000", 2316 navy: "#000080", 2317 olive: "#808000", 2318 purple: "#800080", 2319 red: "#ff0000", 2320 silver: "#c0c0c0", 2321 teal: "#008080", 2322 white: "#ffffff", 2323 yellow: "#ffff00", 2324 2325 // 4.2.3. "transparent" color keyword 2326 transparent: [ null, null, null, 0 ], 2327 2328 _default: "#ffffff" 2329}; 2330 2331 2332/*! 2333 * jQuery UI Effects 1.13.2 2334 * http://jqueryui.com 2335 * 2336 * Copyright jQuery Foundation and other contributors 2337 * Released under the MIT license. 2338 * http://jquery.org/license 2339 */ 2340 2341//>>label: Effects Core 2342//>>group: Effects 2343/* eslint-disable max-len */ 2344//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects. 2345/* eslint-enable max-len */ 2346//>>docs: http://api.jqueryui.com/category/effects-core/ 2347//>>demos: http://jqueryui.com/effect/ 2348 2349 2350var dataSpace = "ui-effects-", 2351 dataSpaceStyle = "ui-effects-style", 2352 dataSpaceAnimated = "ui-effects-animated"; 2353 2354$.effects = { 2355 effect: {} 2356}; 2357 2358/******************************************************************************/ 2359/****************************** CLASS ANIMATIONS ******************************/ 2360/******************************************************************************/ 2361( function() { 2362 2363var classAnimationActions = [ "add", "remove", "toggle" ], 2364 shorthandStyles = { 2365 border: 1, 2366 borderBottom: 1, 2367 borderColor: 1, 2368 borderLeft: 1, 2369 borderRight: 1, 2370 borderTop: 1, 2371 borderWidth: 1, 2372 margin: 1, 2373 padding: 1 2374 }; 2375 2376$.each( 2377 [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], 2378 function( _, prop ) { 2379 $.fx.step[ prop ] = function( fx ) { 2380 if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { 2381 jQuery.style( fx.elem, prop, fx.end ); 2382 fx.setAttr = true; 2383 } 2384 }; 2385 } 2386); 2387 2388function camelCase( string ) { 2389 return string.replace( /-([\da-z])/gi, function( all, letter ) { 2390 return letter.toUpperCase(); 2391 } ); 2392} 2393 2394function getElementStyles( elem ) { 2395 var key, len, 2396 style = elem.ownerDocument.defaultView ? 2397 elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : 2398 elem.currentStyle, 2399 styles = {}; 2400 2401 if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { 2402 len = style.length; 2403 while ( len-- ) { 2404 key = style[ len ]; 2405 if ( typeof style[ key ] === "string" ) { 2406 styles[ camelCase( key ) ] = style[ key ]; 2407 } 2408 } 2409 2410 // Support: Opera, IE <9 2411 } else { 2412 for ( key in style ) { 2413 if ( typeof style[ key ] === "string" ) { 2414 styles[ key ] = style[ key ]; 2415 } 2416 } 2417 } 2418 2419 return styles; 2420} 2421 2422function styleDifference( oldStyle, newStyle ) { 2423 var diff = {}, 2424 name, value; 2425 2426 for ( name in newStyle ) { 2427 value = newStyle[ name ]; 2428 if ( oldStyle[ name ] !== value ) { 2429 if ( !shorthandStyles[ name ] ) { 2430 if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { 2431 diff[ name ] = value; 2432 } 2433 } 2434 } 2435 } 2436 2437 return diff; 2438} 2439 2440// Support: jQuery <1.8 2441if ( !$.fn.addBack ) { 2442 $.fn.addBack = function( selector ) { 2443 return this.add( selector == null ? 2444 this.prevObject : this.prevObject.filter( selector ) 2445 ); 2446 }; 2447} 2448 2449$.effects.animateClass = function( value, duration, easing, callback ) { 2450 var o = $.speed( duration, easing, callback ); 2451 2452 return this.queue( function() { 2453 var animated = $( this ), 2454 baseClass = animated.attr( "class" ) || "", 2455 applyClassChange, 2456 allAnimations = o.children ? animated.find( "*" ).addBack() : animated; 2457 2458 // Map the animated objects to store the original styles. 2459 allAnimations = allAnimations.map( function() { 2460 var el = $( this ); 2461 return { 2462 el: el, 2463 start: getElementStyles( this ) 2464 }; 2465 } ); 2466 2467 // Apply class change 2468 applyClassChange = function() { 2469 $.each( classAnimationActions, function( i, action ) { 2470 if ( value[ action ] ) { 2471 animated[ action + "Class" ]( value[ action ] ); 2472 } 2473 } ); 2474 }; 2475 applyClassChange(); 2476 2477 // Map all animated objects again - calculate new styles and diff 2478 allAnimations = allAnimations.map( function() { 2479 this.end = getElementStyles( this.el[ 0 ] ); 2480 this.diff = styleDifference( this.start, this.end ); 2481 return this; 2482 } ); 2483 2484 // Apply original class 2485 animated.attr( "class", baseClass ); 2486 2487 // Map all animated objects again - this time collecting a promise 2488 allAnimations = allAnimations.map( function() { 2489 var styleInfo = this, 2490 dfd = $.Deferred(), 2491 opts = $.extend( {}, o, { 2492 queue: false, 2493 complete: function() { 2494 dfd.resolve( styleInfo ); 2495 } 2496 } ); 2497 2498 this.el.animate( this.diff, opts ); 2499 return dfd.promise(); 2500 } ); 2501 2502 // Once all animations have completed: 2503 $.when.apply( $, allAnimations.get() ).done( function() { 2504 2505 // Set the final class 2506 applyClassChange(); 2507 2508 // For each animated element, 2509 // clear all css properties that were animated 2510 $.each( arguments, function() { 2511 var el = this.el; 2512 $.each( this.diff, function( key ) { 2513 el.css( key, "" ); 2514 } ); 2515 } ); 2516 2517 // This is guarnteed to be there if you use jQuery.speed() 2518 // it also handles dequeuing the next anim... 2519 o.complete.call( animated[ 0 ] ); 2520 } ); 2521 } ); 2522}; 2523 2524$.fn.extend( { 2525 addClass: ( function( orig ) { 2526 return function( classNames, speed, easing, callback ) { 2527 return speed ? 2528 $.effects.animateClass.call( this, 2529 { add: classNames }, speed, easing, callback ) : 2530 orig.apply( this, arguments ); 2531 }; 2532 } )( $.fn.addClass ), 2533 2534 removeClass: ( function( orig ) { 2535 return function( classNames, speed, easing, callback ) { 2536 return arguments.length > 1 ? 2537 $.effects.animateClass.call( this, 2538 { remove: classNames }, speed, easing, callback ) : 2539 orig.apply( this, arguments ); 2540 }; 2541 } )( $.fn.removeClass ), 2542 2543 toggleClass: ( function( orig ) { 2544 return function( classNames, force, speed, easing, callback ) { 2545 if ( typeof force === "boolean" || force === undefined ) { 2546 if ( !speed ) { 2547 2548 // Without speed parameter 2549 return orig.apply( this, arguments ); 2550 } else { 2551 return $.effects.animateClass.call( this, 2552 ( force ? { add: classNames } : { remove: classNames } ), 2553 speed, easing, callback ); 2554 } 2555 } else { 2556 2557 // Without force parameter 2558 return $.effects.animateClass.call( this, 2559 { toggle: classNames }, force, speed, easing ); 2560 } 2561 }; 2562 } )( $.fn.toggleClass ), 2563 2564 switchClass: function( remove, add, speed, easing, callback ) { 2565 return $.effects.animateClass.call( this, { 2566 add: add, 2567 remove: remove 2568 }, speed, easing, callback ); 2569 } 2570} ); 2571 2572} )(); 2573 2574/******************************************************************************/ 2575/*********************************** EFFECTS **********************************/ 2576/******************************************************************************/ 2577 2578( function() { 2579 2580if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) { 2581 $.expr.pseudos.animated = ( function( orig ) { 2582 return function( elem ) { 2583 return !!$( elem ).data( dataSpaceAnimated ) || orig( elem ); 2584 }; 2585 } )( $.expr.pseudos.animated ); 2586} 2587 2588if ( $.uiBackCompat !== false ) { 2589 $.extend( $.effects, { 2590 2591 // Saves a set of properties in a data storage 2592 save: function( element, set ) { 2593 var i = 0, length = set.length; 2594 for ( ; i < length; i++ ) { 2595 if ( set[ i ] !== null ) { 2596 element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); 2597 } 2598 } 2599 }, 2600 2601 // Restores a set of previously saved properties from a data storage 2602 restore: function( element, set ) { 2603 var val, i = 0, length = set.length; 2604 for ( ; i < length; i++ ) { 2605 if ( set[ i ] !== null ) { 2606 val = element.data( dataSpace + set[ i ] ); 2607 element.css( set[ i ], val ); 2608 } 2609 } 2610 }, 2611 2612 setMode: function( el, mode ) { 2613 if ( mode === "toggle" ) { 2614 mode = el.is( ":hidden" ) ? "show" : "hide"; 2615 } 2616 return mode; 2617 }, 2618 2619 // Wraps the element around a wrapper that copies position properties 2620 createWrapper: function( element ) { 2621 2622 // If the element is already wrapped, return it 2623 if ( element.parent().is( ".ui-effects-wrapper" ) ) { 2624 return element.parent(); 2625 } 2626 2627 // Wrap the element 2628 var props = { 2629 width: element.outerWidth( true ), 2630 height: element.outerHeight( true ), 2631 "float": element.css( "float" ) 2632 }, 2633 wrapper = $( "<div></div>" ) 2634 .addClass( "ui-effects-wrapper" ) 2635 .css( { 2636 fontSize: "100%", 2637 background: "transparent", 2638 border: "none", 2639 margin: 0, 2640 padding: 0 2641 } ), 2642 2643 // Store the size in case width/height are defined in % - Fixes #5245 2644 size = { 2645 width: element.width(), 2646 height: element.height() 2647 }, 2648 active = document.activeElement; 2649 2650 // Support: Firefox 2651 // Firefox incorrectly exposes anonymous content 2652 // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 2653 try { 2654 // eslint-disable-next-line no-unused-expressions 2655 active.id; 2656 } catch ( e ) { 2657 active = document.body; 2658 } 2659 2660 element.wrap( wrapper ); 2661 2662 // Fixes #7595 - Elements lose focus when wrapped. 2663 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 2664 $( active ).trigger( "focus" ); 2665 } 2666 2667 // Hotfix for jQuery 1.4 since some change in wrap() seems to actually 2668 // lose the reference to the wrapped element 2669 wrapper = element.parent(); 2670 2671 // Transfer positioning properties to the wrapper 2672 if ( element.css( "position" ) === "static" ) { 2673 wrapper.css( { position: "relative" } ); 2674 element.css( { position: "relative" } ); 2675 } else { 2676 $.extend( props, { 2677 position: element.css( "position" ), 2678 zIndex: element.css( "z-index" ) 2679 } ); 2680 $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) { 2681 props[ pos ] = element.css( pos ); 2682 if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { 2683 props[ pos ] = "auto"; 2684 } 2685 } ); 2686 element.css( { 2687 position: "relative", 2688 top: 0, 2689 left: 0, 2690 right: "auto", 2691 bottom: "auto" 2692 } ); 2693 } 2694 element.css( size ); 2695 2696 return wrapper.css( props ).show(); 2697 }, 2698 2699 removeWrapper: function( element ) { 2700 var active = document.activeElement; 2701 2702 if ( element.parent().is( ".ui-effects-wrapper" ) ) { 2703 element.parent().replaceWith( element ); 2704
vendor: 6,832 bytes, lines 2705-2985
2705 // Fixes #7595 - Elements lose focus when wrapped. 2706 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 2707 $( active ).trigger( "focus" ); 2708 } 2709 } 2710 2711 return element; 2712 } 2713 } ); 2714} 2715 2716$.extend( $.effects, { 2717 version: "1.13.2", 2718 2719 define: function( name, mode, effect ) { 2720 if ( !effect ) { 2721 effect = mode; 2722 mode = "effect"; 2723 } 2724 2725 $.effects.effect[ name ] = effect; 2726 $.effects.effect[ name ].mode = mode; 2727 2728 return effect; 2729 }, 2730 2731 scaledDimensions: function( element, percent, direction ) { 2732 if ( percent === 0 ) { 2733 return { 2734 height: 0, 2735 width: 0, 2736 outerHeight: 0, 2737 outerWidth: 0 2738 }; 2739 } 2740 2741 var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1, 2742 y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1; 2743 2744 return { 2745 height: element.height() * y, 2746 width: element.width() * x, 2747 outerHeight: element.outerHeight() * y, 2748 outerWidth: element.outerWidth() * x 2749 }; 2750 2751 }, 2752 2753 clipToBox: function( animation ) { 2754 return { 2755 width: animation.clip.right - animation.clip.left, 2756 height: animation.clip.bottom - animation.clip.top, 2757 left: animation.clip.left, 2758 top: animation.clip.top 2759 }; 2760 }, 2761 2762 // Injects recently queued functions to be first in line (after "inprogress") 2763 unshift: function( element, queueLength, count ) { 2764 var queue = element.queue(); 2765 2766 if ( queueLength > 1 ) { 2767 queue.splice.apply( queue, 2768 [ 1, 0 ].concat( queue.splice( queueLength, count ) ) ); 2769 } 2770 element.dequeue(); 2771 }, 2772 2773 saveStyle: function( element ) { 2774 element.data( dataSpaceStyle, element[ 0 ].style.cssText ); 2775 }, 2776 2777 restoreStyle: function( element ) { 2778 element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || ""; 2779 element.removeData( dataSpaceStyle ); 2780 }, 2781 2782 mode: function( element, mode ) { 2783 var hidden = element.is( ":hidden" ); 2784 2785 if ( mode === "toggle" ) { 2786 mode = hidden ? "show" : "hide"; 2787 } 2788 if ( hidden ? mode === "hide" : mode === "show" ) { 2789 mode = "none"; 2790 } 2791 return mode; 2792 }, 2793 2794 // Translates a [top,left] array into a baseline value 2795 getBaseline: function( origin, original ) { 2796 var y, x; 2797 2798 switch ( origin[ 0 ] ) { 2799 case "top": 2800 y = 0; 2801 break; 2802 case "middle": 2803 y = 0.5; 2804 break; 2805 case "bottom": 2806 y = 1; 2807 break; 2808 default: 2809 y = origin[ 0 ] / original.height; 2810 } 2811 2812 switch ( origin[ 1 ] ) { 2813 case "left": 2814 x = 0; 2815 break; 2816 case "center": 2817 x = 0.5; 2818 break; 2819 case "right": 2820 x = 1; 2821 break; 2822 default: 2823 x = origin[ 1 ] / original.width; 2824 } 2825 2826 return { 2827 x: x, 2828 y: y 2829 }; 2830 }, 2831 2832 // Creates a placeholder element so that the original element can be made absolute 2833 createPlaceholder: function( element ) { 2834 var placeholder, 2835 cssPosition = element.css( "position" ), 2836 position = element.position(); 2837 2838 // Lock in margins first to account for form elements, which 2839 // will change margin if you explicitly set height 2840 // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380 2841 // Support: Safari 2842 element.css( { 2843 marginTop: element.css( "marginTop" ), 2844 marginBottom: element.css( "marginBottom" ), 2845 marginLeft: element.css( "marginLeft" ), 2846 marginRight: element.css( "marginRight" ) 2847 } ) 2848 .outerWidth( element.outerWidth() ) 2849 .outerHeight( element.outerHeight() ); 2850 2851 if ( /^(static|relative)/.test( cssPosition ) ) { 2852 cssPosition = "absolute"; 2853 2854 placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( { 2855 2856 // Convert inline to inline block to account for inline elements 2857 // that turn to inline block based on content (like img) 2858 display: /^(inline|ruby)/.test( element.css( "display" ) ) ? 2859 "inline-block" : 2860 "block", 2861 visibility: "hidden", 2862 2863 // Margins need to be set to account for margin collapse 2864 marginTop: element.css( "marginTop" ), 2865 marginBottom: element.css( "marginBottom" ), 2866 marginLeft: element.css( "marginLeft" ), 2867 marginRight: element.css( "marginRight" ), 2868 "float": element.css( "float" ) 2869 } ) 2870 .outerWidth( element.outerWidth() ) 2871 .outerHeight( element.outerHeight() ) 2872 .addClass( "ui-effects-placeholder" ); 2873 2874 element.data( dataSpace + "placeholder", placeholder ); 2875 } 2876 2877 element.css( { 2878 position: cssPosition, 2879 left: position.left, 2880 top: position.top 2881 } ); 2882 2883 return placeholder; 2884 }, 2885 2886 removePlaceholder: function( element ) { 2887 var dataKey = dataSpace + "placeholder", 2888 placeholder = element.data( dataKey ); 2889 2890 if ( placeholder ) { 2891 placeholder.remove(); 2892 element.removeData( dataKey ); 2893 } 2894 }, 2895 2896 // Removes a placeholder if it exists and restores 2897 // properties that were modified during placeholder creation 2898 cleanUp: function( element ) { 2899 $.effects.restoreStyle( element ); 2900 $.effects.removePlaceholder( element ); 2901 }, 2902 2903 setTransition: function( element, list, factor, value ) { 2904 value = value || {}; 2905 $.each( list, function( i, x ) { 2906 var unit = element.cssUnit( x ); 2907 if ( unit[ 0 ] > 0 ) { 2908 value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; 2909 } 2910 } ); 2911 return value; 2912 } 2913} ); 2914 2915// Return an effect options object for the given parameters: 2916function _normalizeArguments( effect, options, speed, callback ) { 2917 2918 // Allow passing all options as the first parameter 2919 if ( $.isPlainObject( effect ) ) { 2920 options = effect; 2921 effect = effect.effect; 2922 } 2923 2924 // Convert to an object 2925 effect = { effect: effect }; 2926 2927 // Catch (effect, null, ...) 2928 if ( options == null ) { 2929 options = {}; 2930 } 2931 2932 // Catch (effect, callback) 2933 if ( typeof options === "function" ) { 2934 callback = options; 2935 speed = null; 2936 options = {}; 2937 } 2938 2939 // Catch (effect, speed, ?) 2940 if ( typeof options === "number" || $.fx.speeds[ options ] ) { 2941 callback = speed; 2942 speed = options; 2943 options = {}; 2944 } 2945 2946 // Catch (effect, options, callback) 2947 if ( typeof speed === "function" ) { 2948 callback = speed; 2949 speed = null; 2950 } 2951 2952 // Add options to effect 2953 if ( options ) { 2954 $.extend( effect, options ); 2955 } 2956 2957 speed = speed || options.duration; 2958 effect.duration = $.fx.off ? 0 : 2959 typeof speed === "number" ? speed : 2960 speed in $.fx.speeds ? $.fx.speeds[ speed ] : 2961 $.fx.speeds._default; 2962 2963 effect.complete = callback || options.complete; 2964 2965 return effect; 2966} 2967 2968function standardAnimationOption( option ) { 2969 2970 // Valid standard speeds (nothing, number, named speed) 2971 if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { 2972 return true; 2973 } 2974 2975 // Invalid strings - treat as "normal" speed 2976 if ( typeof option === "string" && !$.effects.effect[ option ] ) { 2977 return true; 2978 } 2979 2980 // Complete callback 2981 if ( typeof option === "function" ) { 2982 return true; 2983 } 2984 2985 // Options hash (but not naming an effect)
vendor: 4,998 bytes, lines 2986-3169
2986 if ( typeof option === "object" && !option.effect ) { 2987 return true; 2988 } 2989 2990 // Didn't match any standard API 2991 return false; 2992} 2993 2994$.fn.extend( { 2995 effect: function( /* effect, options, speed, callback */ ) { 2996 var args = _normalizeArguments.apply( this, arguments ), 2997 effectMethod = $.effects.effect[ args.effect ], 2998 defaultMode = effectMethod.mode, 2999 queue = args.queue, 3000 queueName = queue || "fx", 3001 complete = args.complete, 3002 mode = args.mode, 3003 modes = [], 3004 prefilter = function( next ) { 3005 var el = $( this ), 3006 normalizedMode = $.effects.mode( el, mode ) || defaultMode; 3007 3008 // Sentinel for duck-punching the :animated pseudo-selector 3009 el.data( dataSpaceAnimated, true ); 3010 3011 // Save effect mode for later use, 3012 // we can't just call $.effects.mode again later, 3013 // as the .show() below destroys the initial state 3014 modes.push( normalizedMode ); 3015 3016 // See $.uiBackCompat inside of run() for removal of defaultMode in 1.14 3017 if ( defaultMode && ( normalizedMode === "show" || 3018 ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) { 3019 el.show(); 3020 } 3021 3022 if ( !defaultMode || normalizedMode !== "none" ) { 3023 $.effects.saveStyle( el ); 3024 } 3025 3026 if ( typeof next === "function" ) { 3027 next(); 3028 } 3029 }; 3030 3031 if ( $.fx.off || !effectMethod ) { 3032 3033 // Delegate to the original method (e.g., .show()) if possible 3034 if ( mode ) { 3035 return this[ mode ]( args.duration, complete ); 3036 } else { 3037 return this.each( function() { 3038 if ( complete ) { 3039 complete.call( this ); 3040 } 3041 } ); 3042 } 3043 } 3044 3045 function run( next ) { 3046 var elem = $( this ); 3047 3048 function cleanup() { 3049 elem.removeData( dataSpaceAnimated ); 3050 3051 $.effects.cleanUp( elem ); 3052 3053 if ( args.mode === "hide" ) { 3054 elem.hide(); 3055 } 3056 3057 done(); 3058 } 3059 3060 function done() { 3061 if ( typeof complete === "function" ) { 3062 complete.call( elem[ 0 ] ); 3063 } 3064 3065 if ( typeof next === "function" ) { 3066 next(); 3067 } 3068 } 3069 3070 // Override mode option on a per element basis, 3071 // as toggle can be either show or hide depending on element state 3072 args.mode = modes.shift(); 3073 3074 if ( $.uiBackCompat !== false && !defaultMode ) { 3075 if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { 3076 3077 // Call the core method to track "olddisplay" properly 3078 elem[ mode ](); 3079 done(); 3080 } else { 3081 effectMethod.call( elem[ 0 ], args, done ); 3082 } 3083 } else { 3084 if ( args.mode === "none" ) { 3085 3086 // Call the core method to track "olddisplay" properly 3087 elem[ mode ](); 3088 done(); 3089 } else { 3090 effectMethod.call( elem[ 0 ], args, cleanup ); 3091 } 3092 } 3093 } 3094 3095 // Run prefilter on all elements first to ensure that 3096 // any showing or hiding happens before placeholder creation, 3097 // which ensures that any layout changes are correctly captured. 3098 return queue === false ? 3099 this.each( prefilter ).each( run ) : 3100 this.queue( queueName, prefilter ).queue( queueName, run ); 3101 }, 3102 3103 show: ( function( orig ) { 3104 return function( option ) { 3105 if ( standardAnimationOption( option ) ) { 3106 return orig.apply( this, arguments ); 3107 } else { 3108 var args = _normalizeArguments.apply( this, arguments ); 3109 args.mode = "show"; 3110 return this.effect.call( this, args ); 3111 } 3112 }; 3113 } )( $.fn.show ), 3114 3115 hide: ( function( orig ) { 3116 return function( option ) { 3117 if ( standardAnimationOption( option ) ) { 3118 return orig.apply( this, arguments ); 3119 } else { 3120 var args = _normalizeArguments.apply( this, arguments ); 3121 args.mode = "hide"; 3122 return this.effect.call( this, args ); 3123 } 3124 }; 3125 } )( $.fn.hide ), 3126 3127 toggle: ( function( orig ) { 3128 return function( option ) { 3129 if ( standardAnimationOption( option ) || typeof option === "boolean" ) { 3130 return orig.apply( this, arguments ); 3131 } else { 3132 var args = _normalizeArguments.apply( this, arguments ); 3133 args.mode = "toggle"; 3134 return this.effect.call( this, args ); 3135 } 3136 }; 3137 } )( $.fn.toggle ), 3138 3139 cssUnit: function( key ) { 3140 var style = this.css( key ), 3141 val = []; 3142 3143 $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { 3144 if ( style.indexOf( unit ) > 0 ) { 3145 val = [ parseFloat( style ), unit ]; 3146 } 3147 } ); 3148 return val; 3149 }, 3150 3151 cssClip: function( clipObj ) { 3152 if ( clipObj ) { 3153 return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + 3154 clipObj.bottom + "px " + clipObj.left + "px)" ); 3155 } 3156 return parseClip( this.css( "clip" ), this ); 3157 }, 3158 3159 transfer: function( options, done ) { 3160 var element = $( this ), 3161 target = $( options.to ), 3162 targetFixed = target.css( "position" ) === "fixed", 3163 body = $( "body" ), 3164 fixTop = targetFixed ? body.scrollTop() : 0, 3165 fixLeft = targetFixed ? body.scrollLeft() : 0, 3166 endPosition = target.offset(), 3167 animation = { 3168 top: endPosition.top - fixTop, 3169 left: endPosition.left - fixLeft,
vendor: 26,433 bytes, lines 3170-4136
3170 height: target.innerHeight(), 3171 width: target.innerWidth() 3172 }, 3173 startPosition = element.offset(), 3174 transfer = $( "<div class='ui-effects-transfer'></div>" ); 3175 3176 transfer 3177 .appendTo( "body" ) 3178 .addClass( options.className ) 3179 .css( { 3180 top: startPosition.top - fixTop, 3181 left: startPosition.left - fixLeft, 3182 height: element.innerHeight(), 3183 width: element.innerWidth(), 3184 position: targetFixed ? "fixed" : "absolute" 3185 } ) 3186 .animate( animation, options.duration, options.easing, function() { 3187 transfer.remove(); 3188 if ( typeof done === "function" ) { 3189 done(); 3190 } 3191 } ); 3192 } 3193} ); 3194 3195function parseClip( str, element ) { 3196 var outerWidth = element.outerWidth(), 3197 outerHeight = element.outerHeight(), 3198 clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/, 3199 values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ]; 3200 3201 return { 3202 top: parseFloat( values[ 1 ] ) || 0, 3203 right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ), 3204 bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ), 3205 left: parseFloat( values[ 4 ] ) || 0 3206 }; 3207} 3208 3209$.fx.step.clip = function( fx ) { 3210 if ( !fx.clipInit ) { 3211 fx.start = $( fx.elem ).cssClip(); 3212 if ( typeof fx.end === "string" ) { 3213 fx.end = parseClip( fx.end, fx.elem ); 3214 } 3215 fx.clipInit = true; 3216 } 3217 3218 $( fx.elem ).cssClip( { 3219 top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top, 3220 right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right, 3221 bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom, 3222 left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left 3223 } ); 3224}; 3225 3226} )(); 3227 3228/******************************************************************************/ 3229/*********************************** EASING ***********************************/ 3230/******************************************************************************/ 3231 3232( function() { 3233 3234// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing) 3235 3236var baseEasings = {}; 3237 3238$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { 3239 baseEasings[ name ] = function( p ) { 3240 return Math.pow( p, i + 2 ); 3241 }; 3242} ); 3243 3244$.extend( baseEasings, { 3245 Sine: function( p ) { 3246 return 1 - Math.cos( p * Math.PI / 2 ); 3247 }, 3248 Circ: function( p ) { 3249 return 1 - Math.sqrt( 1 - p * p ); 3250 }, 3251 Elastic: function( p ) { 3252 return p === 0 || p === 1 ? p : 3253 -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); 3254 }, 3255 Back: function( p ) { 3256 return p * p * ( 3 * p - 2 ); 3257 }, 3258 Bounce: function( p ) { 3259 var pow2, 3260 bounce = 4; 3261 3262 while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} 3263 return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); 3264 } 3265} ); 3266 3267$.each( baseEasings, function( name, easeIn ) { 3268 $.easing[ "easeIn" + name ] = easeIn; 3269 $.easing[ "easeOut" + name ] = function( p ) { 3270 return 1 - easeIn( 1 - p ); 3271 }; 3272 $.easing[ "easeInOut" + name ] = function( p ) { 3273 return p < 0.5 ? 3274 easeIn( p * 2 ) / 2 : 3275 1 - easeIn( p * -2 + 2 ) / 2; 3276 }; 3277} ); 3278 3279} )(); 3280 3281var effect = $.effects; 3282 3283 3284/*! 3285 * jQuery UI Effects Blind 1.13.2 3286 * http://jqueryui.com 3287 * 3288 * Copyright jQuery Foundation and other contributors 3289 * Released under the MIT license. 3290 * http://jquery.org/license 3291 */ 3292 3293//>>label: Blind Effect 3294//>>group: Effects 3295//>>description: Blinds the element. 3296//>>docs: http://api.jqueryui.com/blind-effect/ 3297//>>demos: http://jqueryui.com/effect/ 3298 3299 3300var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) { 3301 var map = { 3302 up: [ "bottom", "top" ], 3303 vertical: [ "bottom", "top" ], 3304 down: [ "top", "bottom" ], 3305 left: [ "right", "left" ], 3306 horizontal: [ "right", "left" ], 3307 right: [ "left", "right" ] 3308 }, 3309 element = $( this ), 3310 direction = options.direction || "up", 3311 start = element.cssClip(), 3312 animate = { clip: $.extend( {}, start ) }, 3313 placeholder = $.effects.createPlaceholder( element ); 3314 3315 animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ]; 3316 3317 if ( options.mode === "show" ) { 3318 element.cssClip( animate.clip ); 3319 if ( placeholder ) { 3320 placeholder.css( $.effects.clipToBox( animate ) ); 3321 } 3322 3323 animate.clip = start; 3324 } 3325 3326 if ( placeholder ) { 3327 placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing ); 3328 } 3329 3330 element.animate( animate, { 3331 queue: false, 3332 duration: options.duration, 3333 easing: options.easing, 3334 complete: done 3335 } ); 3336} ); 3337 3338 3339/*! 3340 * jQuery UI Effects Bounce 1.13.2 3341 * http://jqueryui.com 3342 * 3343 * Copyright jQuery Foundation and other contributors 3344 * Released under the MIT license. 3345 * http://jquery.org/license 3346 */ 3347 3348//>>label: Bounce Effect 3349//>>group: Effects 3350//>>description: Bounces an element horizontally or vertically n times. 3351//>>docs: http://api.jqueryui.com/bounce-effect/ 3352//>>demos: http://jqueryui.com/effect/ 3353 3354 3355var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) { 3356 var upAnim, downAnim, refValue, 3357 element = $( this ), 3358 3359 // Defaults: 3360 mode = options.mode, 3361 hide = mode === "hide", 3362 show = mode === "show", 3363 direction = options.direction || "up", 3364 distance = options.distance, 3365 times = options.times || 5, 3366 3367 // Number of internal animations 3368 anims = times * 2 + ( show || hide ? 1 : 0 ), 3369 speed = options.duration / anims, 3370 easing = options.easing, 3371 3372 // Utility: 3373 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3374 motion = ( direction === "up" || direction === "left" ), 3375 i = 0, 3376 3377 queuelen = element.queue().length; 3378 3379 $.effects.createPlaceholder( element ); 3380 3381 refValue = element.css( ref ); 3382 3383 // Default distance for the BIGGEST bounce is the outer Distance / 3 3384 if ( !distance ) { 3385 distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; 3386 } 3387 3388 if ( show ) { 3389 downAnim = { opacity: 1 }; 3390 downAnim[ ref ] = refValue; 3391 3392 // If we are showing, force opacity 0 and set the initial position 3393 // then do the "first" animation 3394 element 3395 .css( "opacity", 0 ) 3396 .css( ref, motion ? -distance * 2 : distance * 2 ) 3397 .animate( downAnim, speed, easing ); 3398 } 3399 3400 // Start at the smallest distance if we are hiding 3401 if ( hide ) { 3402 distance = distance / Math.pow( 2, times - 1 ); 3403 } 3404 3405 downAnim = {}; 3406 downAnim[ ref ] = refValue; 3407 3408 // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here 3409 for ( ; i < times; i++ ) { 3410 upAnim = {}; 3411 upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; 3412 3413 element 3414 .animate( upAnim, speed, easing ) 3415 .animate( downAnim, speed, easing ); 3416 3417 distance = hide ? distance * 2 : distance / 2; 3418 } 3419 3420 // Last Bounce when Hiding 3421 if ( hide ) { 3422 upAnim = { opacity: 0 }; 3423 upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; 3424 3425 element.animate( upAnim, speed, easing ); 3426 } 3427 3428 element.queue( done ); 3429 3430 $.effects.unshift( element, queuelen, anims + 1 ); 3431} ); 3432 3433 3434/*! 3435 * jQuery UI Effects Clip 1.13.2 3436 * http://jqueryui.com 3437 * 3438 * Copyright jQuery Foundation and other contributors 3439 * Released under the MIT license. 3440 * http://jquery.org/license 3441 */ 3442 3443//>>label: Clip Effect 3444//>>group: Effects 3445//>>description: Clips the element on and off like an old TV. 3446//>>docs: http://api.jqueryui.com/clip-effect/ 3447//>>demos: http://jqueryui.com/effect/ 3448 3449 3450var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) { 3451 var start, 3452 animate = {}, 3453 element = $( this ), 3454 direction = options.direction || "vertical", 3455 both = direction === "both", 3456 horizontal = both || direction === "horizontal", 3457 vertical = both || direction === "vertical"; 3458 3459 start = element.cssClip(); 3460 animate.clip = { 3461 top: vertical ? ( start.bottom - start.top ) / 2 : start.top, 3462 right: horizontal ? ( start.right - start.left ) / 2 : start.right, 3463 bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom, 3464 left: horizontal ? ( start.right - start.left ) / 2 : start.left 3465 }; 3466 3467 $.effects.createPlaceholder( element ); 3468 3469 if ( options.mode === "show" ) { 3470 element.cssClip( animate.clip ); 3471 animate.clip = start; 3472 } 3473 3474 element.animate( animate, { 3475 queue: false, 3476 duration: options.duration, 3477 easing: options.easing, 3478 complete: done 3479 } ); 3480 3481} ); 3482 3483 3484/*! 3485 * jQuery UI Effects Drop 1.13.2 3486 * http://jqueryui.com 3487 * 3488 * Copyright jQuery Foundation and other contributors 3489 * Released under the MIT license. 3490 * http://jquery.org/license 3491 */ 3492 3493//>>label: Drop Effect 3494//>>group: Effects 3495//>>description: Moves an element in one direction and hides it at the same time. 3496//>>docs: http://api.jqueryui.com/drop-effect/ 3497//>>demos: http://jqueryui.com/effect/ 3498 3499 3500var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) { 3501 3502 var distance, 3503 element = $( this ), 3504 mode = options.mode, 3505 show = mode === "show", 3506 direction = options.direction || "left", 3507 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3508 motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=", 3509 oppositeMotion = ( motion === "+=" ) ? "-=" : "+=", 3510 animation = { 3511 opacity: 0 3512 }; 3513 3514 $.effects.createPlaceholder( element ); 3515 3516 distance = options.distance || 3517 element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2; 3518 3519 animation[ ref ] = motion + distance; 3520 3521 if ( show ) { 3522 element.css( animation ); 3523 3524 animation[ ref ] = oppositeMotion + distance; 3525 animation.opacity = 1; 3526 } 3527 3528 // Animate 3529 element.animate( animation, { 3530 queue: false, 3531 duration: options.duration, 3532 easing: options.easing, 3533 complete: done 3534 } ); 3535} ); 3536 3537 3538/*! 3539 * jQuery UI Effects Explode 1.13.2 3540 * http://jqueryui.com 3541 * 3542 * Copyright jQuery Foundation and other contributors 3543 * Released under the MIT license. 3544 * http://jquery.org/license 3545 */ 3546 3547//>>label: Explode Effect 3548//>>group: Effects 3549/* eslint-disable max-len */ 3550//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness. 3551/* eslint-enable max-len */ 3552//>>docs: http://api.jqueryui.com/explode-effect/ 3553//>>demos: http://jqueryui.com/effect/ 3554 3555 3556var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) { 3557 3558 var i, j, left, top, mx, my, 3559 rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3, 3560 cells = rows, 3561 element = $( this ), 3562 mode = options.mode, 3563 show = mode === "show", 3564 3565 // Show and then visibility:hidden the element before calculating offset 3566 offset = element.show().css( "visibility", "hidden" ).offset(), 3567 3568 // Width and height of a piece 3569 width = Math.ceil( element.outerWidth() / cells ), 3570 height = Math.ceil( element.outerHeight() / rows ), 3571 pieces = []; 3572 3573 // Children animate complete: 3574 function childComplete() { 3575 pieces.push( this ); 3576 if ( pieces.length === rows * cells ) { 3577 animComplete(); 3578 } 3579 } 3580 3581 // Clone the element for each row and cell. 3582 for ( i = 0; i < rows; i++ ) { // ===> 3583 top = offset.top + i * height; 3584 my = i - ( rows - 1 ) / 2; 3585 3586 for ( j = 0; j < cells; j++ ) { // ||| 3587 left = offset.left + j * width; 3588 mx = j - ( cells - 1 ) / 2; 3589 3590 // Create a clone of the now hidden main element that will be absolute positioned 3591 // within a wrapper div off the -left and -top equal to size of our pieces 3592 element 3593 .clone() 3594 .appendTo( "body" ) 3595 .wrap( "<div></div>" ) 3596 .css( { 3597 position: "absolute", 3598 visibility: "visible", 3599 left: -j * width, 3600 top: -i * height 3601 } ) 3602 3603 // Select the wrapper - make it overflow: hidden and absolute positioned based on 3604 // where the original was located +left and +top equal to the size of pieces 3605 .parent() 3606 .addClass( "ui-effects-explode" ) 3607 .css( { 3608 position: "absolute", 3609 overflow: "hidden", 3610 width: width, 3611 height: height, 3612 left: left + ( show ? mx * width : 0 ), 3613 top: top + ( show ? my * height : 0 ), 3614 opacity: show ? 0 : 1 3615 } ) 3616 .animate( { 3617 left: left + ( show ? 0 : mx * width ), 3618 top: top + ( show ? 0 : my * height ), 3619 opacity: show ? 1 : 0 3620 }, options.duration || 500, options.easing, childComplete ); 3621 } 3622 } 3623 3624 function animComplete() { 3625 element.css( { 3626 visibility: "visible" 3627 } ); 3628 $( pieces ).remove(); 3629 done(); 3630 } 3631} ); 3632 3633 3634/*! 3635 * jQuery UI Effects Fade 1.13.2 3636 * http://jqueryui.com 3637 * 3638 * Copyright jQuery Foundation and other contributors 3639 * Released under the MIT license. 3640 * http://jquery.org/license 3641 */ 3642 3643//>>label: Fade Effect 3644//>>group: Effects 3645//>>description: Fades the element. 3646//>>docs: http://api.jqueryui.com/fade-effect/ 3647//>>demos: http://jqueryui.com/effect/ 3648 3649 3650var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) { 3651 var show = options.mode === "show"; 3652 3653 $( this ) 3654 .css( "opacity", show ? 0 : 1 ) 3655 .animate( { 3656 opacity: show ? 1 : 0 3657 }, { 3658 queue: false, 3659 duration: options.duration, 3660 easing: options.easing, 3661 complete: done 3662 } ); 3663} ); 3664 3665 3666/*! 3667 * jQuery UI Effects Fold 1.13.2 3668 * http://jqueryui.com 3669 * 3670 * Copyright jQuery Foundation and other contributors 3671 * Released under the MIT license. 3672 * http://jquery.org/license 3673 */ 3674 3675//>>label: Fold Effect 3676//>>group: Effects 3677//>>description: Folds an element first horizontally and then vertically. 3678//>>docs: http://api.jqueryui.com/fold-effect/ 3679//>>demos: http://jqueryui.com/effect/ 3680 3681 3682var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) { 3683 3684 // Create element 3685 var element = $( this ), 3686 mode = options.mode, 3687 show = mode === "show", 3688 hide = mode === "hide", 3689 size = options.size || 15, 3690 percent = /([0-9]+)%/.exec( size ), 3691 horizFirst = !!options.horizFirst, 3692 ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ], 3693 duration = options.duration / 2, 3694 3695 placeholder = $.effects.createPlaceholder( element ), 3696 3697 start = element.cssClip(), 3698 animation1 = { clip: $.extend( {}, start ) }, 3699 animation2 = { clip: $.extend( {}, start ) }, 3700 3701 distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ], 3702 3703 queuelen = element.queue().length; 3704 3705 if ( percent ) { 3706 size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; 3707 } 3708 animation1.clip[ ref[ 0 ] ] = size; 3709 animation2.clip[ ref[ 0 ] ] = size; 3710 animation2.clip[ ref[ 1 ] ] = 0; 3711 3712 if ( show ) { 3713 element.cssClip( animation2.clip ); 3714 if ( placeholder ) { 3715 placeholder.css( $.effects.clipToBox( animation2 ) ); 3716 } 3717 3718 animation2.clip = start; 3719 } 3720 3721 // Animate 3722 element 3723 .queue( function( next ) { 3724 if ( placeholder ) { 3725 placeholder 3726 .animate( $.effects.clipToBox( animation1 ), duration, options.easing ) 3727 .animate( $.effects.clipToBox( animation2 ), duration, options.easing ); 3728 } 3729 3730 next(); 3731 } ) 3732 .animate( animation1, duration, options.easing ) 3733 .animate( animation2, duration, options.easing ) 3734 .queue( done ); 3735 3736 $.effects.unshift( element, queuelen, 4 ); 3737} ); 3738 3739 3740/*! 3741 * jQuery UI Effects Highlight 1.13.2 3742 * http://jqueryui.com 3743 * 3744 * Copyright jQuery Foundation and other contributors 3745 * Released under the MIT license. 3746 * http://jquery.org/license 3747 */ 3748 3749//>>label: Highlight Effect 3750//>>group: Effects 3751//>>description: Highlights the background of an element in a defined color for a custom duration. 3752//>>docs: http://api.jqueryui.com/highlight-effect/ 3753//>>demos: http://jqueryui.com/effect/ 3754 3755 3756var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) { 3757 var element = $( this ), 3758 animation = { 3759 backgroundColor: element.css( "backgroundColor" ) 3760 }; 3761 3762 if ( options.mode === "hide" ) { 3763 animation.opacity = 0; 3764 } 3765 3766 $.effects.saveStyle( element ); 3767 3768 element 3769 .css( { 3770 backgroundImage: "none", 3771 backgroundColor: options.color || "#ffff99" 3772 } ) 3773 .animate( animation, { 3774 queue: false, 3775 duration: options.duration, 3776 easing: options.easing, 3777 complete: done 3778 } ); 3779} ); 3780 3781 3782/*! 3783 * jQuery UI Effects Size 1.13.2 3784 * http://jqueryui.com 3785 * 3786 * Copyright jQuery Foundation and other contributors 3787 * Released under the MIT license. 3788 * http://jquery.org/license 3789 */ 3790 3791//>>label: Size Effect 3792//>>group: Effects 3793//>>description: Resize an element to a specified width and height. 3794//>>docs: http://api.jqueryui.com/size-effect/ 3795//>>demos: http://jqueryui.com/effect/ 3796 3797 3798var effectsEffectSize = $.effects.define( "size", function( options, done ) { 3799 3800 // Create element 3801 var baseline, factor, temp, 3802 element = $( this ), 3803 3804 // Copy for children 3805 cProps = [ "fontSize" ], 3806 vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], 3807 hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], 3808 3809 // Set options 3810 mode = options.mode, 3811 restore = mode !== "effect", 3812 scale = options.scale || "both", 3813 origin = options.origin || [ "middle", "center" ], 3814 position = element.css( "position" ), 3815 pos = element.position(), 3816 original = $.effects.scaledDimensions( element ), 3817 from = options.from || original, 3818 to = options.to || $.effects.scaledDimensions( element, 0 ); 3819 3820 $.effects.createPlaceholder( element ); 3821 3822 if ( mode === "show" ) { 3823 temp = from; 3824 from = to; 3825 to = temp; 3826 } 3827 3828 // Set scaling factor 3829 factor = { 3830 from: { 3831 y: from.height / original.height, 3832 x: from.width / original.width 3833 }, 3834 to: { 3835 y: to.height / original.height, 3836 x: to.width / original.width 3837 } 3838 }; 3839 3840 // Scale the css box 3841 if ( scale === "box" || scale === "both" ) { 3842 3843 // Vertical props scaling 3844 if ( factor.from.y !== factor.to.y ) { 3845 from = $.effects.setTransition( element, vProps, factor.from.y, from ); 3846 to = $.effects.setTransition( element, vProps, factor.to.y, to ); 3847 } 3848 3849 // Horizontal props scaling 3850 if ( factor.from.x !== factor.to.x ) { 3851 from = $.effects.setTransition( element, hProps, factor.from.x, from ); 3852 to = $.effects.setTransition( element, hProps, factor.to.x, to ); 3853 } 3854 } 3855 3856 // Scale the content 3857 if ( scale === "content" || scale === "both" ) { 3858 3859 // Vertical props scaling 3860 if ( factor.from.y !== factor.to.y ) { 3861 from = $.effects.setTransition( element, cProps, factor.from.y, from ); 3862 to = $.effects.setTransition( element, cProps, factor.to.y, to ); 3863 } 3864 } 3865 3866 // Adjust the position properties based on the provided origin points 3867 if ( origin ) { 3868 baseline = $.effects.getBaseline( origin, original ); 3869 from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top; 3870 from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left; 3871 to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top; 3872 to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left; 3873 } 3874 delete from.outerHeight; 3875 delete from.outerWidth; 3876 element.css( from ); 3877 3878 // Animate the children if desired 3879 if ( scale === "content" || scale === "both" ) { 3880 3881 vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps ); 3882 hProps = hProps.concat( [ "marginLeft", "marginRight" ] ); 3883 3884 // Only animate children with width attributes specified 3885 // TODO: is this right? should we include anything with css width specified as well 3886 element.find( "*[width]" ).each( function() { 3887 var child = $( this ), 3888 childOriginal = $.effects.scaledDimensions( child ), 3889 childFrom = { 3890 height: childOriginal.height * factor.from.y, 3891 width: childOriginal.width * factor.from.x, 3892 outerHeight: childOriginal.outerHeight * factor.from.y, 3893 outerWidth: childOriginal.outerWidth * factor.from.x 3894 }, 3895 childTo = { 3896 height: childOriginal.height * factor.to.y, 3897 width: childOriginal.width * factor.to.x, 3898 outerHeight: childOriginal.height * factor.to.y, 3899 outerWidth: childOriginal.width * factor.to.x 3900 }; 3901 3902 // Vertical props scaling 3903 if ( factor.from.y !== factor.to.y ) { 3904 childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom ); 3905 childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo ); 3906 } 3907 3908 // Horizontal props scaling 3909 if ( factor.from.x !== factor.to.x ) { 3910 childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom ); 3911 childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo ); 3912 } 3913 3914 if ( restore ) { 3915 $.effects.saveStyle( child ); 3916 } 3917 3918 // Animate children 3919 child.css( childFrom ); 3920 child.animate( childTo, options.duration, options.easing, function() { 3921 3922 // Restore children 3923 if ( restore ) { 3924 $.effects.restoreStyle( child ); 3925 } 3926 } ); 3927 } ); 3928 } 3929 3930 // Animate 3931 element.animate( to, { 3932 queue: false, 3933 duration: options.duration, 3934 easing: options.easing, 3935 complete: function() { 3936 3937 var offset = element.offset(); 3938 3939 if ( to.opacity === 0 ) { 3940 element.css( "opacity", from.opacity ); 3941 } 3942 3943 if ( !restore ) { 3944 element 3945 .css( "position", position === "static" ? "relative" : position ) 3946 .offset( offset ); 3947 3948 // Need to save style here so that automatic style restoration 3949 // doesn't restore to the original styles from before the animation. 3950 $.effects.saveStyle( element ); 3951 } 3952 3953 done(); 3954 } 3955 } ); 3956 3957} ); 3958 3959 3960/*! 3961 * jQuery UI Effects Scale 1.13.2 3962 * http://jqueryui.com 3963 * 3964 * Copyright jQuery Foundation and other contributors 3965 * Released under the MIT license. 3966 * http://jquery.org/license 3967 */ 3968 3969//>>label: Scale Effect 3970//>>group: Effects 3971//>>description: Grows or shrinks an element and its content. 3972//>>docs: http://api.jqueryui.com/scale-effect/ 3973//>>demos: http://jqueryui.com/effect/ 3974 3975 3976var effectsEffectScale = $.effects.define( "scale", function( options, done ) { 3977 3978 // Create element 3979 var el = $( this ), 3980 mode = options.mode, 3981 percent = parseInt( options.percent, 10 ) || 3982 ( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ), 3983 3984 newOptions = $.extend( true, { 3985 from: $.effects.scaledDimensions( el ), 3986 to: $.effects.scaledDimensions( el, percent, options.direction || "both" ), 3987 origin: options.origin || [ "middle", "center" ] 3988 }, options ); 3989 3990 // Fade option to support puff 3991 if ( options.fade ) { 3992 newOptions.from.opacity = 1; 3993 newOptions.to.opacity = 0; 3994 } 3995 3996 $.effects.effect.size.call( this, newOptions, done ); 3997} ); 3998 3999 4000/*! 4001 * jQuery UI Effects Puff 1.13.2 4002 * http://jqueryui.com 4003 * 4004 * Copyright jQuery Foundation and other contributors 4005 * Released under the MIT license. 4006 * http://jquery.org/license 4007 */ 4008 4009//>>label: Puff Effect 4010//>>group: Effects 4011//>>description: Creates a puff effect by scaling the element up and hiding it at the same time. 4012//>>docs: http://api.jqueryui.com/puff-effect/ 4013//>>demos: http://jqueryui.com/effect/ 4014 4015 4016var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) { 4017 var newOptions = $.extend( true, {}, options, { 4018 fade: true, 4019 percent: parseInt( options.percent, 10 ) || 150 4020 } ); 4021 4022 $.effects.effect.scale.call( this, newOptions, done ); 4023} ); 4024 4025 4026/*! 4027 * jQuery UI Effects Pulsate 1.13.2 4028 * http://jqueryui.com 4029 * 4030 * Copyright jQuery Foundation and other contributors 4031 * Released under the MIT license. 4032 * http://jquery.org/license 4033 */ 4034 4035//>>label: Pulsate Effect 4036//>>group: Effects 4037//>>description: Pulsates an element n times by changing the opacity to zero and back. 4038//>>docs: http://api.jqueryui.com/pulsate-effect/ 4039//>>demos: http://jqueryui.com/effect/ 4040 4041 4042var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) { 4043 var element = $( this ), 4044 mode = options.mode, 4045 show = mode === "show", 4046 hide = mode === "hide", 4047 showhide = show || hide, 4048 4049 // Showing or hiding leaves off the "last" animation 4050 anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), 4051 duration = options.duration / anims, 4052 animateTo = 0, 4053 i = 1, 4054 queuelen = element.queue().length; 4055 4056 if ( show || !element.is( ":visible" ) ) { 4057 element.css( "opacity", 0 ).show(); 4058 animateTo = 1; 4059 } 4060 4061 // Anims - 1 opacity "toggles" 4062 for ( ; i < anims; i++ ) { 4063 element.animate( { opacity: animateTo }, duration, options.easing ); 4064 animateTo = 1 - animateTo; 4065 } 4066 4067 element.animate( { opacity: animateTo }, duration, options.easing ); 4068 4069 element.queue( done ); 4070 4071 $.effects.unshift( element, queuelen, anims + 1 ); 4072} ); 4073 4074 4075/*! 4076 * jQuery UI Effects Shake 1.13.2 4077 * http://jqueryui.com 4078 * 4079 * Copyright jQuery Foundation and other contributors 4080 * Released under the MIT license. 4081 * http://jquery.org/license 4082 */ 4083 4084//>>label: Shake Effect 4085//>>group: Effects 4086//>>description: Shakes an element horizontally or vertically n times. 4087//>>docs: http://api.jqueryui.com/shake-effect/ 4088//>>demos: http://jqueryui.com/effect/ 4089 4090 4091var effectsEffectShake = $.effects.define( "shake", function( options, done ) { 4092 4093 var i = 1, 4094 element = $( this ), 4095 direction = options.direction || "left", 4096 distance = options.distance || 20, 4097 times = options.times || 3, 4098 anims = times * 2 + 1, 4099 speed = Math.round( options.duration / anims ), 4100 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 4101 positiveMotion = ( direction === "up" || direction === "left" ), 4102 animation = {}, 4103 animation1 = {}, 4104 animation2 = {}, 4105 4106 queuelen = element.queue().length; 4107 4108 $.effects.createPlaceholder( element ); 4109 4110 // Animation 4111 animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; 4112 animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; 4113 animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; 4114 4115 // Animate 4116 element.animate( animation, speed, options.easing ); 4117 4118 // Shakes 4119 for ( ; i < times; i++ ) { 4120 element 4121 .animate( animation1, speed, options.easing ) 4122 .animate( animation2, speed, options.easing ); 4123 } 4124 4125 element 4126 .animate( animation1, speed, options.easing ) 4127 .animate( animation, speed / 2, options.easing ) 4128 .queue( done ); 4129 4130 $.effects.unshift( element, queuelen, anims + 1 ); 4131} ); 4132 4133 4134/*! 4135 * jQuery UI Effects Slide 1.13.2 4136 * http://jqueryui.com
vendor: 19,531 bytes, lines 4137-4884
4137 * 4138 * Copyright jQuery Foundation and other contributors 4139 * Released under the MIT license. 4140 * http://jquery.org/license 4141 */ 4142 4143//>>label: Slide Effect 4144//>>group: Effects 4145//>>description: Slides an element in and out of the viewport. 4146//>>docs: http://api.jqueryui.com/slide-effect/ 4147//>>demos: http://jqueryui.com/effect/ 4148 4149 4150var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) { 4151 var startClip, startRef, 4152 element = $( this ), 4153 map = { 4154 up: [ "bottom", "top" ], 4155 down: [ "top", "bottom" ], 4156 left: [ "right", "left" ], 4157 right: [ "left", "right" ] 4158 }, 4159 mode = options.mode, 4160 direction = options.direction || "left", 4161 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 4162 positiveMotion = ( direction === "up" || direction === "left" ), 4163 distance = options.distance || 4164 element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ), 4165 animation = {}; 4166 4167 $.effects.createPlaceholder( element ); 4168 4169 startClip = element.cssClip(); 4170 startRef = element.position()[ ref ]; 4171 4172 // Define hide animation 4173 animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef; 4174 animation.clip = element.cssClip(); 4175 animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ]; 4176 4177 // Reverse the animation if we're showing 4178 if ( mode === "show" ) { 4179 element.cssClip( animation.clip ); 4180 element.css( ref, animation[ ref ] ); 4181 animation.clip = startClip; 4182 animation[ ref ] = startRef; 4183 } 4184 4185 // Actually animate 4186 element.animate( animation, { 4187 queue: false, 4188 duration: options.duration, 4189 easing: options.easing, 4190 complete: done 4191 } ); 4192} ); 4193 4194 4195/*! 4196 * jQuery UI Effects Transfer 1.13.2 4197 * http://jqueryui.com 4198 * 4199 * Copyright jQuery Foundation and other contributors 4200 * Released under the MIT license. 4201 * http://jquery.org/license 4202 */ 4203 4204//>>label: Transfer Effect 4205//>>group: Effects 4206//>>description: Displays a transfer effect from one element to another. 4207//>>docs: http://api.jqueryui.com/transfer-effect/ 4208//>>demos: http://jqueryui.com/effect/ 4209 4210 4211var effect; 4212if ( $.uiBackCompat !== false ) { 4213 effect = $.effects.define( "transfer", function( options, done ) { 4214 $( this ).transfer( options, done ); 4215 } ); 4216} 4217var effectsEffectTransfer = effect; 4218 4219 4220/*! 4221 * jQuery UI Focusable 1.13.2 4222 * http://jqueryui.com 4223 * 4224 * Copyright jQuery Foundation and other contributors 4225 * Released under the MIT license. 4226 * http://jquery.org/license 4227 */ 4228 4229//>>label: :focusable Selector 4230//>>group: Core 4231//>>description: Selects elements which can be focused. 4232//>>docs: http://api.jqueryui.com/focusable-selector/ 4233 4234 4235// Selectors 4236$.ui.focusable = function( element, hasTabindex ) { 4237 var map, mapName, img, focusableIfVisible, fieldset, 4238 nodeName = element.nodeName.toLowerCase(); 4239 4240 if ( "area" === nodeName ) { 4241 map = element.parentNode; 4242 mapName = map.name; 4243 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 4244 return false; 4245 } 4246 img = $( "img[usemap='#" + mapName + "']" ); 4247 return img.length > 0 && img.is( ":visible" ); 4248 } 4249 4250 if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { 4251 focusableIfVisible = !element.disabled; 4252 4253 if ( focusableIfVisible ) { 4254 4255 // Form controls within a disabled fieldset are disabled. 4256 // However, controls within the fieldset's legend do not get disabled. 4257 // Since controls generally aren't placed inside legends, we skip 4258 // this portion of the check. 4259 fieldset = $( element ).closest( "fieldset" )[ 0 ]; 4260 if ( fieldset ) { 4261 focusableIfVisible = !fieldset.disabled; 4262 } 4263 } 4264 } else if ( "a" === nodeName ) { 4265 focusableIfVisible = element.href || hasTabindex; 4266 } else { 4267 focusableIfVisible = hasTabindex; 4268 } 4269 4270 return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); 4271}; 4272 4273// Support: IE 8 only 4274// IE 8 doesn't resolve inherit to visible/hidden for computed values 4275function visible( element ) { 4276 var visibility = element.css( "visibility" ); 4277 while ( visibility === "inherit" ) { 4278 element = element.parent(); 4279 visibility = element.css( "visibility" ); 4280 } 4281 return visibility === "visible"; 4282} 4283 4284$.extend( $.expr.pseudos, { 4285 focusable: function( element ) { 4286 return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); 4287 } 4288} ); 4289 4290var focusable = $.ui.focusable; 4291 4292 4293 4294// Support: IE8 Only 4295// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop 4296// with a string, so we need to find the proper form. 4297var form = $.fn._form = function() { 4298 return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); 4299}; 4300 4301 4302/*! 4303 * jQuery UI Form Reset Mixin 1.13.2 4304 * http://jqueryui.com 4305 * 4306 * Copyright jQuery Foundation and other contributors 4307 * Released under the MIT license. 4308 * http://jquery.org/license 4309 */ 4310 4311//>>label: Form Reset Mixin 4312//>>group: Core 4313//>>description: Refresh input widgets when their form is reset 4314//>>docs: http://api.jqueryui.com/form-reset-mixin/ 4315 4316 4317var formResetMixin = $.ui.formResetMixin = { 4318 _formResetHandler: function() { 4319 var form = $( this ); 4320 4321 // Wait for the form reset to actually happen before refreshing 4322 setTimeout( function() { 4323 var instances = form.data( "ui-form-reset-instances" ); 4324 $.each( instances, function() { 4325 this.refresh(); 4326 } ); 4327 } ); 4328 }, 4329 4330 _bindFormResetHandler: function() { 4331 this.form = this.element._form(); 4332 if ( !this.form.length ) { 4333 return; 4334 } 4335 4336 var instances = this.form.data( "ui-form-reset-instances" ) || []; 4337 if ( !instances.length ) { 4338 4339 // We don't use _on() here because we use a single event handler per form 4340 this.form.on( "reset.ui-form-reset", this._formResetHandler ); 4341 } 4342 instances.push( this ); 4343 this.form.data( "ui-form-reset-instances", instances ); 4344 }, 4345 4346 _unbindFormResetHandler: function() { 4347 if ( !this.form.length ) { 4348 return; 4349 } 4350 4351 var instances = this.form.data( "ui-form-reset-instances" ); 4352 instances.splice( $.inArray( this, instances ), 1 ); 4353 if ( instances.length ) { 4354 this.form.data( "ui-form-reset-instances", instances ); 4355 } else { 4356 this.form 4357 .removeData( "ui-form-reset-instances" ) 4358 .off( "reset.ui-form-reset" ); 4359 } 4360 } 4361}; 4362 4363 4364/*! 4365 * jQuery UI Support for jQuery core 1.8.x and newer 1.13.2 4366 * http://jqueryui.com 4367 * 4368 * Copyright jQuery Foundation and other contributors 4369 * Released under the MIT license. 4370 * http://jquery.org/license 4371 * 4372 */ 4373 4374//>>label: jQuery 1.8+ Support 4375//>>group: Core 4376//>>description: Support version 1.8.x and newer of jQuery core 4377 4378 4379// Support: jQuery 1.9.x or older 4380// $.expr[ ":" ] is deprecated. 4381if ( !$.expr.pseudos ) { 4382 $.expr.pseudos = $.expr[ ":" ]; 4383} 4384 4385// Support: jQuery 1.11.x or older 4386// $.unique has been renamed to $.uniqueSort 4387if ( !$.uniqueSort ) { 4388 $.uniqueSort = $.unique; 4389} 4390 4391// Support: jQuery 2.2.x or older. 4392// This method has been defined in jQuery 3.0.0. 4393// Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js 4394if ( !$.escapeSelector ) { 4395 4396 // CSS string/identifier serialization 4397 // https://drafts.csswg.org/cssom/#common-serializing-idioms 4398 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 4399 4400 var fcssescape = function( ch, asCodePoint ) { 4401 if ( asCodePoint ) { 4402 4403 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 4404 if ( ch === "\0" ) { 4405 return "\uFFFD"; 4406 } 4407 4408 // Control characters and (dependent upon position) numbers get escaped as code points 4409 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 4410 } 4411 4412 // Other potentially-special ASCII characters get backslash-escaped 4413 return "\\" + ch; 4414 }; 4415 4416 $.escapeSelector = function( sel ) { 4417 return ( sel + "" ).replace( rcssescape, fcssescape ); 4418 }; 4419} 4420 4421// Support: jQuery 3.4.x or older 4422// These methods have been defined in jQuery 3.5.0. 4423if ( !$.fn.even || !$.fn.odd ) { 4424 $.fn.extend( { 4425 even: function() { 4426 return this.filter( function( i ) { 4427 return i % 2 === 0; 4428 } ); 4429 }, 4430 odd: function() { 4431 return this.filter( function( i ) { 4432 return i % 2 === 1; 4433 } ); 4434 } 4435 } ); 4436} 4437 4438; 4439/*! 4440 * jQuery UI Keycode 1.13.2 4441 * http://jqueryui.com 4442 * 4443 * Copyright jQuery Foundation and other contributors 4444 * Released under the MIT license. 4445 * http://jquery.org/license 4446 */ 4447 4448//>>label: Keycode 4449//>>group: Core 4450//>>description: Provide keycodes as keynames 4451//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ 4452 4453 4454var keycode = $.ui.keyCode = { 4455 BACKSPACE: 8, 4456 COMMA: 188, 4457 DELETE: 46, 4458 DOWN: 40, 4459 END: 35, 4460 ENTER: 13, 4461 ESCAPE: 27, 4462 HOME: 36, 4463 LEFT: 37, 4464 PAGE_DOWN: 34, 4465 PAGE_UP: 33, 4466 PERIOD: 190, 4467 RIGHT: 39, 4468 SPACE: 32, 4469 TAB: 9, 4470 UP: 38 4471}; 4472 4473 4474/*! 4475 * jQuery UI Labels 1.13.2 4476 * http://jqueryui.com 4477 * 4478 * Copyright jQuery Foundation and other contributors 4479 * Released under the MIT license. 4480 * http://jquery.org/license 4481 */ 4482 4483//>>label: labels 4484//>>group: Core 4485//>>description: Find all the labels associated with a given input 4486//>>docs: http://api.jqueryui.com/labels/ 4487 4488 4489var labels = $.fn.labels = function() { 4490 var ancestor, selector, id, labels, ancestors; 4491 4492 if ( !this.length ) { 4493 return this.pushStack( [] ); 4494 } 4495 4496 // Check control.labels first 4497 if ( this[ 0 ].labels && this[ 0 ].labels.length ) { 4498 return this.pushStack( this[ 0 ].labels ); 4499 } 4500 4501 // Support: IE <= 11, FF <= 37, Android <= 2.3 only 4502 // Above browsers do not support control.labels. Everything below is to support them 4503 // as well as document fragments. control.labels does not work on document fragments 4504 labels = this.eq( 0 ).parents( "label" ); 4505 4506 // Look for the label based on the id 4507 id = this.attr( "id" ); 4508 if ( id ) { 4509 4510 // We don't search against the document in case the element 4511 // is disconnected from the DOM 4512 ancestor = this.eq( 0 ).parents().last(); 4513 4514 // Get a full set of top level ancestors 4515 ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); 4516 4517 // Create a selector for the label based on the id 4518 selector = "label[for='" + $.escapeSelector( id ) + "']"; 4519 4520 labels = labels.add( ancestors.find( selector ).addBack( selector ) ); 4521 4522 } 4523 4524 // Return whatever we have found for labels 4525 return this.pushStack( labels ); 4526}; 4527 4528 4529/*! 4530 * jQuery UI Scroll Parent 1.13.2 4531 * http://jqueryui.com 4532 * 4533 * Copyright jQuery Foundation and other contributors 4534 * Released under the MIT license. 4535 * http://jquery.org/license 4536 */ 4537 4538//>>label: scrollParent 4539//>>group: Core 4540//>>description: Get the closest ancestor element that is scrollable. 4541//>>docs: http://api.jqueryui.com/scrollParent/ 4542 4543 4544var scrollParent = $.fn.scrollParent = function( includeHidden ) { 4545 var position = this.css( "position" ), 4546 excludeStaticParent = position === "absolute", 4547 overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 4548 scrollParent = this.parents().filter( function() { 4549 var parent = $( this ); 4550 if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 4551 return false; 4552 } 4553 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + 4554 parent.css( "overflow-x" ) ); 4555 } ).eq( 0 ); 4556 4557 return position === "fixed" || !scrollParent.length ? 4558 $( this[ 0 ].ownerDocument || document ) : 4559 scrollParent; 4560}; 4561 4562 4563/*! 4564 * jQuery UI Tabbable 1.13.2 4565 * http://jqueryui.com 4566 * 4567 * Copyright jQuery Foundation and other contributors 4568 * Released under the MIT license. 4569 * http://jquery.org/license 4570 */ 4571 4572//>>label: :tabbable Selector 4573//>>group: Core 4574//>>description: Selects elements which can be tabbed to. 4575//>>docs: http://api.jqueryui.com/tabbable-selector/ 4576 4577 4578var tabbable = $.extend( $.expr.pseudos, { 4579 tabbable: function( element ) { 4580 var tabIndex = $.attr( element, "tabindex" ), 4581 hasTabindex = tabIndex != null; 4582 return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex ); 4583 } 4584} ); 4585 4586 4587/*! 4588 * jQuery UI Unique ID 1.13.2 4589 * http://jqueryui.com 4590 * 4591 * Copyright jQuery Foundation and other contributors 4592 * Released under the MIT license. 4593 * http://jquery.org/license 4594 */ 4595 4596//>>label: uniqueId 4597//>>group: Core 4598//>>description: Functions to generate and remove uniqueId's 4599//>>docs: http://api.jqueryui.com/uniqueId/ 4600 4601 4602var uniqueId = $.fn.extend( { 4603 uniqueId: ( function() { 4604 var uuid = 0; 4605 4606 return function() { 4607 return this.each( function() { 4608 if ( !this.id ) { 4609 this.id = "ui-id-" + ( ++uuid ); 4610 } 4611 } ); 4612 }; 4613 } )(), 4614 4615 removeUniqueId: function() { 4616 return this.each( function() { 4617 if ( /^ui-id-\d+$/.test( this.id ) ) { 4618 $( this ).removeAttr( "id" ); 4619 } 4620 } ); 4621 } 4622} ); 4623 4624 4625/*! 4626 * jQuery UI Accordion 1.13.2 4627 * http://jqueryui.com 4628 * 4629 * Copyright jQuery Foundation and other contributors 4630 * Released under the MIT license. 4631 * http://jquery.org/license 4632 */ 4633 4634//>>label: Accordion 4635//>>group: Widgets 4636/* eslint-disable max-len */ 4637//>>description: Displays collapsible content panels for presenting information in a limited amount of space. 4638/* eslint-enable max-len */ 4639//>>docs: http://api.jqueryui.com/accordion/ 4640//>>demos: http://jqueryui.com/accordion/ 4641//>>css.structure: ../../themes/base/core.css 4642//>>css.structure: ../../themes/base/accordion.css 4643//>>css.theme: ../../themes/base/theme.css 4644 4645 4646var widgetsAccordion = $.widget( "ui.accordion", { 4647 version: "1.13.2", 4648 options: { 4649 active: 0, 4650 animate: {}, 4651 classes: { 4652 "ui-accordion-header": "ui-corner-top", 4653 "ui-accordion-header-collapsed": "ui-corner-all", 4654 "ui-accordion-content": "ui-corner-bottom" 4655 }, 4656 collapsible: false, 4657 event: "click", 4658 header: function( elem ) { 4659 return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() ); 4660 }, 4661 heightStyle: "auto", 4662 icons: { 4663 activeHeader: "ui-icon-triangle-1-s", 4664 header: "ui-icon-triangle-1-e" 4665 }, 4666 4667 // Callbacks 4668 activate: null, 4669 beforeActivate: null 4670 }, 4671 4672 hideProps: { 4673 borderTopWidth: "hide", 4674 borderBottomWidth: "hide", 4675 paddingTop: "hide", 4676 paddingBottom: "hide", 4677 height: "hide" 4678 }, 4679 4680 showProps: { 4681 borderTopWidth: "show", 4682 borderBottomWidth: "show", 4683 paddingTop: "show", 4684 paddingBottom: "show", 4685 height: "show" 4686 }, 4687 4688 _create: function() { 4689 var options = this.options; 4690 4691 this.prevShow = this.prevHide = $(); 4692 this._addClass( "ui-accordion", "ui-widget ui-helper-reset" ); 4693 this.element.attr( "role", "tablist" ); 4694 4695 // Don't allow collapsible: false and active: false / null 4696 if ( !options.collapsible && ( options.active === false || options.active == null ) ) { 4697 options.active = 0; 4698 } 4699 4700 this._processPanels(); 4701 4702 // handle negative values 4703 if ( options.active < 0 ) { 4704 options.active += this.headers.length; 4705 } 4706 this._refresh(); 4707 }, 4708 4709 _getCreateEventData: function() { 4710 return { 4711 header: this.active, 4712 panel: !this.active.length ? $() : this.active.next() 4713 }; 4714 }, 4715 4716 _createIcons: function() { 4717 var icon, children, 4718 icons = this.options.icons; 4719 4720 if ( icons ) { 4721 icon = $( "<span>" ); 4722 this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header ); 4723 icon.prependTo( this.headers ); 4724 children = this.active.children( ".ui-accordion-header-icon" ); 4725 this._removeClass( children, icons.header ) 4726 ._addClass( children, null, icons.activeHeader ) 4727 ._addClass( this.headers, "ui-accordion-icons" ); 4728 } 4729 }, 4730 4731 _destroyIcons: function() { 4732 this._removeClass( this.headers, "ui-accordion-icons" ); 4733 this.headers.children( ".ui-accordion-header-icon" ).remove(); 4734 }, 4735 4736 _destroy: function() { 4737 var contents; 4738 4739 // Clean up main element 4740 this.element.removeAttr( "role" ); 4741 4742 // Clean up headers 4743 this.headers 4744 .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) 4745 .removeUniqueId(); 4746 4747 this._destroyIcons(); 4748 4749 // Clean up content panels 4750 contents = this.headers.next() 4751 .css( "display", "" ) 4752 .removeAttr( "role aria-hidden aria-labelledby" ) 4753 .removeUniqueId(); 4754 4755 if ( this.options.heightStyle !== "content" ) { 4756 contents.css( "height", "" ); 4757 } 4758 }, 4759 4760 _setOption: function( key, value ) { 4761 if ( key === "active" ) { 4762 4763 // _activate() will handle invalid values and update this.options 4764 this._activate( value ); 4765 return; 4766 } 4767 4768 if ( key === "event" ) { 4769 if ( this.options.event ) { 4770 this._off( this.headers, this.options.event ); 4771 } 4772 this._setupEvents( value ); 4773 } 4774 4775 this._super( key, value ); 4776 4777 // Setting collapsible: false while collapsed; open first panel 4778 if ( key === "collapsible" && !value && this.options.active === false ) { 4779 this._activate( 0 ); 4780 } 4781 4782 if ( key === "icons" ) { 4783 this._destroyIcons(); 4784 if ( value ) { 4785 this._createIcons(); 4786 } 4787 } 4788 }, 4789 4790 _setOptionDisabled: function( value ) { 4791 this._super( value ); 4792 4793 this.element.attr( "aria-disabled", value ); 4794 4795 // Support: IE8 Only 4796 // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE 4797 // so we need to add the disabled class to the headers and panels 4798 this._toggleClass( null, "ui-state-disabled", !!value ); 4799 this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled", 4800 !!value ); 4801 }, 4802 4803 _keydown: function( event ) { 4804 if ( event.altKey || event.ctrlKey ) { 4805 return; 4806 } 4807 4808 var keyCode = $.ui.keyCode, 4809 length = this.headers.length, 4810 currentIndex = this.headers.index( event.target ), 4811 toFocus = false; 4812 4813 switch ( event.keyCode ) { 4814 case keyCode.RIGHT: 4815 case keyCode.DOWN: 4816 toFocus = this.headers[ ( currentIndex + 1 ) % length ]; 4817 break; 4818 case keyCode.LEFT: 4819 case keyCode.UP: 4820 toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; 4821 break; 4822 case keyCode.SPACE: 4823 case keyCode.ENTER: 4824 this._eventHandler( event ); 4825 break; 4826 case keyCode.HOME: 4827 toFocus = this.headers[ 0 ]; 4828 break; 4829 case keyCode.END: 4830 toFocus = this.headers[ length - 1 ]; 4831 break; 4832 } 4833 4834 if ( toFocus ) { 4835 $( event.target ).attr( "tabIndex", -1 ); 4836 $( toFocus ).attr( "tabIndex", 0 ); 4837 $( toFocus ).trigger( "focus" ); 4838 event.preventDefault(); 4839 } 4840 }, 4841 4842 _panelKeyDown: function( event ) { 4843 if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { 4844 $( event.currentTarget ).prev().trigger( "focus" ); 4845 } 4846 }, 4847 4848 refresh: function() { 4849 var options = this.options; 4850 this._processPanels(); 4851 4852 // Was collapsed or no panel 4853 if ( ( options.active === false && options.collapsible === true ) || 4854 !this.headers.length ) { 4855 options.active = false; 4856 this.active = $(); 4857 4858 // active false only when collapsible is true 4859 } else if ( options.active === false ) { 4860 this._activate( 0 ); 4861 4862 // was active, but active panel is gone 4863 } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 4864 4865 // all remaining panel are disabled 4866 if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) { 4867 options.active = false; 4868 this.active = $(); 4869 4870 // activate previous panel 4871 } else { 4872 this._activate( Math.max( 0, options.active - 1 ) ); 4873 } 4874 4875 // was active, active panel still exists 4876 } else { 4877 4878 // make sure active index is correct 4879 options.active = this.headers.index( this.active ); 4880 } 4881 4882 this._destroyIcons(); 4883 4884 this._refresh();
vendor: 6,928 bytes, lines 4885-5126
4885 }, 4886 4887 _processPanels: function() { 4888 var prevHeaders = this.headers, 4889 prevPanels = this.panels; 4890 4891 if ( typeof this.options.header === "function" ) { 4892 this.headers = this.options.header( this.element ); 4893 } else { 4894 this.headers = this.element.find( this.options.header ); 4895 } 4896 this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", 4897 "ui-state-default" ); 4898 4899 this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide(); 4900 this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); 4901 4902 // Avoid memory leaks (#10056) 4903 if ( prevPanels ) { 4904 this._off( prevHeaders.not( this.headers ) ); 4905 this._off( prevPanels.not( this.panels ) ); 4906 } 4907 }, 4908 4909 _refresh: function() { 4910 var maxHeight, 4911 options = this.options, 4912 heightStyle = options.heightStyle, 4913 parent = this.element.parent(); 4914 4915 this.active = this._findActive( options.active ); 4916 this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" ) 4917 ._removeClass( this.active, "ui-accordion-header-collapsed" ); 4918 this._addClass( this.active.next(), "ui-accordion-content-active" ); 4919 this.active.next().show(); 4920 4921 this.headers 4922 .attr( "role", "tab" ) 4923 .each( function() { 4924 var header = $( this ), 4925 headerId = header.uniqueId().attr( "id" ), 4926 panel = header.next(), 4927 panelId = panel.uniqueId().attr( "id" ); 4928 header.attr( "aria-controls", panelId ); 4929 panel.attr( "aria-labelledby", headerId ); 4930 } ) 4931 .next() 4932 .attr( "role", "tabpanel" ); 4933 4934 this.headers 4935 .not( this.active ) 4936 .attr( { 4937 "aria-selected": "false", 4938 "aria-expanded": "false", 4939 tabIndex: -1 4940 } ) 4941 .next() 4942 .attr( { 4943 "aria-hidden": "true" 4944 } ) 4945 .hide(); 4946 4947 // Make sure at least one header is in the tab order 4948 if ( !this.active.length ) { 4949 this.headers.eq( 0 ).attr( "tabIndex", 0 ); 4950 } else { 4951 this.active.attr( { 4952 "aria-selected": "true", 4953 "aria-expanded": "true", 4954 tabIndex: 0 4955 } ) 4956 .next() 4957 .attr( { 4958 "aria-hidden": "false" 4959 } ); 4960 } 4961 4962 this._createIcons(); 4963 4964 this._setupEvents( options.event ); 4965 4966 if ( heightStyle === "fill" ) { 4967 maxHeight = parent.height(); 4968 this.element.siblings( ":visible" ).each( function() { 4969 var elem = $( this ), 4970 position = elem.css( "position" ); 4971 4972 if ( position === "absolute" || position === "fixed" ) { 4973 return; 4974 } 4975 maxHeight -= elem.outerHeight( true ); 4976 } ); 4977 4978 this.headers.each( function() { 4979 maxHeight -= $( this ).outerHeight( true ); 4980 } ); 4981 4982 this.headers.next() 4983 .each( function() { 4984 $( this ).height( Math.max( 0, maxHeight - 4985 $( this ).innerHeight() + $( this ).height() ) ); 4986 } ) 4987 .css( "overflow", "auto" ); 4988 } else if ( heightStyle === "auto" ) { 4989 maxHeight = 0; 4990 this.headers.next() 4991 .each( function() { 4992 var isVisible = $( this ).is( ":visible" ); 4993 if ( !isVisible ) { 4994 $( this ).show(); 4995 } 4996 maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); 4997 if ( !isVisible ) { 4998 $( this ).hide(); 4999 } 5000 } ) 5001 .height( maxHeight ); 5002 } 5003 }, 5004 5005 _activate: function( index ) { 5006 var active = this._findActive( index )[ 0 ]; 5007 5008 // Trying to activate the already active panel 5009 if ( active === this.active[ 0 ] ) { 5010 return; 5011 } 5012 5013 // Trying to collapse, simulate a click on the currently active header 5014 active = active || this.active[ 0 ]; 5015 5016 this._eventHandler( { 5017 target: active, 5018 currentTarget: active, 5019 preventDefault: $.noop 5020 } ); 5021 }, 5022 5023 _findActive: function( selector ) { 5024 return typeof selector === "number" ? this.headers.eq( selector ) : $(); 5025 }, 5026 5027 _setupEvents: function( event ) { 5028 var events = { 5029 keydown: "_keydown" 5030 }; 5031 if ( event ) { 5032 $.each( event.split( " " ), function( index, eventName ) { 5033 events[ eventName ] = "_eventHandler"; 5034 } ); 5035 } 5036 5037 this._off( this.headers.add( this.headers.next() ) ); 5038 this._on( this.headers, events ); 5039 this._on( this.headers.next(), { keydown: "_panelKeyDown" } ); 5040 this._hoverable( this.headers ); 5041 this._focusable( this.headers ); 5042 }, 5043 5044 _eventHandler: function( event ) { 5045 var activeChildren, clickedChildren, 5046 options = this.options, 5047 active = this.active, 5048 clicked = $( event.currentTarget ), 5049 clickedIsActive = clicked[ 0 ] === active[ 0 ], 5050 collapsing = clickedIsActive && options.collapsible, 5051 toShow = collapsing ? $() : clicked.next(), 5052 toHide = active.next(), 5053 eventData = { 5054 oldHeader: active, 5055 oldPanel: toHide, 5056 newHeader: collapsing ? $() : clicked, 5057 newPanel: toShow 5058 }; 5059 5060 event.preventDefault(); 5061 5062 if ( 5063 5064 // click on active header, but not collapsible 5065 ( clickedIsActive && !options.collapsible ) || 5066 5067 // allow canceling activation 5068 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 5069 return; 5070 } 5071 5072 options.active = collapsing ? false : this.headers.index( clicked ); 5073 5074 // When the call to ._toggle() comes after the class changes 5075 // it causes a very odd bug in IE 8 (see #6720) 5076 this.active = clickedIsActive ? $() : clicked; 5077 this._toggle( eventData ); 5078 5079 // Switch classes 5080 // corner classes on the previously active header stay after the animation 5081 this._removeClass( active, "ui-accordion-header-active", "ui-state-active" ); 5082 if ( options.icons ) { 5083 activeChildren = active.children( ".ui-accordion-header-icon" ); 5084 this._removeClass( activeChildren, null, options.icons.activeHeader ) 5085 ._addClass( activeChildren, null, options.icons.header ); 5086 } 5087 5088 if ( !clickedIsActive ) { 5089 this._removeClass( clicked, "ui-accordion-header-collapsed" ) 5090 ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" ); 5091 if ( options.icons ) { 5092 clickedChildren = clicked.children( ".ui-accordion-header-icon" ); 5093 this._removeClass( clickedChildren, null, options.icons.header ) 5094 ._addClass( clickedChildren, null, options.icons.activeHeader ); 5095 } 5096 5097 this._addClass( clicked.next(), "ui-accordion-content-active" ); 5098 } 5099 }, 5100 5101 _toggle: function( data ) { 5102 var toShow = data.newPanel, 5103 toHide = this.prevShow.length ? this.prevShow : data.oldPanel; 5104 5105 // Handle activating a panel during the animation for another activation 5106 this.prevShow.add( this.prevHide ).stop( true, true ); 5107 this.prevShow = toShow; 5108 this.prevHide = toHide; 5109 5110 if ( this.options.animate ) { 5111 this._animate( toShow, toHide, data ); 5112 } else { 5113 toHide.hide(); 5114 toShow.show(); 5115 this._toggleComplete( data ); 5116 } 5117 5118 toHide.attr( { 5119 "aria-hidden": "true" 5120 } ); 5121 toHide.prev().attr( { 5122 "aria-selected": "false", 5123 "aria-expanded": "false" 5124 } ); 5125 5126 // if we're switching panels, remove the old header from the tab order
vendor: 6,870 bytes, lines 5127-5378
5127 // if we're opening from collapsed state, remove the previous header from the tab order 5128 // if we're collapsing, then keep the collapsing header in the tab order 5129 if ( toShow.length && toHide.length ) { 5130 toHide.prev().attr( { 5131 "tabIndex": -1, 5132 "aria-expanded": "false" 5133 } ); 5134 } else if ( toShow.length ) { 5135 this.headers.filter( function() { 5136 return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; 5137 } ) 5138 .attr( "tabIndex", -1 ); 5139 } 5140 5141 toShow 5142 .attr( "aria-hidden", "false" ) 5143 .prev() 5144 .attr( { 5145 "aria-selected": "true", 5146 "aria-expanded": "true", 5147 tabIndex: 0 5148 } ); 5149 }, 5150 5151 _animate: function( toShow, toHide, data ) { 5152 var total, easing, duration, 5153 that = this, 5154 adjust = 0, 5155 boxSizing = toShow.css( "box-sizing" ), 5156 down = toShow.length && 5157 ( !toHide.length || ( toShow.index() < toHide.index() ) ), 5158 animate = this.options.animate || {}, 5159 options = down && animate.down || animate, 5160 complete = function() { 5161 that._toggleComplete( data ); 5162 }; 5163 5164 if ( typeof options === "number" ) { 5165 duration = options; 5166 } 5167 if ( typeof options === "string" ) { 5168 easing = options; 5169 } 5170 5171 // fall back from options to animation in case of partial down settings 5172 easing = easing || options.easing || animate.easing; 5173 duration = duration || options.duration || animate.duration; 5174 5175 if ( !toHide.length ) { 5176 return toShow.animate( this.showProps, duration, easing, complete ); 5177 } 5178 if ( !toShow.length ) { 5179 return toHide.animate( this.hideProps, duration, easing, complete ); 5180 } 5181 5182 total = toShow.show().outerHeight(); 5183 toHide.animate( this.hideProps, { 5184 duration: duration, 5185 easing: easing, 5186 step: function( now, fx ) { 5187 fx.now = Math.round( now ); 5188 } 5189 } ); 5190 toShow 5191 .hide() 5192 .animate( this.showProps, { 5193 duration: duration, 5194 easing: easing, 5195 complete: complete, 5196 step: function( now, fx ) { 5197 fx.now = Math.round( now ); 5198 if ( fx.prop !== "height" ) { 5199 if ( boxSizing === "content-box" ) { 5200 adjust += fx.now; 5201 } 5202 } else if ( that.options.heightStyle !== "content" ) { 5203 fx.now = Math.round( total - toHide.outerHeight() - adjust ); 5204 adjust = 0; 5205 } 5206 } 5207 } ); 5208 }, 5209 5210 _toggleComplete: function( data ) { 5211 var toHide = data.oldPanel, 5212 prev = toHide.prev(); 5213 5214 this._removeClass( toHide, "ui-accordion-content-active" ); 5215 this._removeClass( prev, "ui-accordion-header-active" ) 5216 ._addClass( prev, "ui-accordion-header-collapsed" ); 5217 5218 // Work around for rendering bug in IE (#5421) 5219 if ( toHide.length ) { 5220 toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; 5221 } 5222 this._trigger( "activate", null, data ); 5223 } 5224} ); 5225 5226 5227 5228var safeActiveElement = $.ui.safeActiveElement = function( document ) { 5229 var activeElement; 5230 5231 // Support: IE 9 only 5232 // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> 5233 try { 5234 activeElement = document.activeElement; 5235 } catch ( error ) { 5236 activeElement = document.body; 5237 } 5238 5239 // Support: IE 9 - 11 only 5240 // IE may return null instead of an element 5241 // Interestingly, this only seems to occur when NOT in an iframe 5242 if ( !activeElement ) { 5243 activeElement = document.body; 5244 } 5245 5246 // Support: IE 11 only 5247 // IE11 returns a seemingly empty object in some cases when accessing 5248 // document.activeElement from an <iframe> 5249 if ( !activeElement.nodeName ) { 5250 activeElement = document.body; 5251 } 5252 5253 return activeElement; 5254}; 5255 5256 5257/*! 5258 * jQuery UI Menu 1.13.2 5259 * http://jqueryui.com 5260 * 5261 * Copyright jQuery Foundation and other contributors 5262 * Released under the MIT license. 5263 * http://jquery.org/license 5264 */ 5265 5266//>>label: Menu 5267//>>group: Widgets 5268//>>description: Creates nestable menus. 5269//>>docs: http://api.jqueryui.com/menu/ 5270//>>demos: http://jqueryui.com/menu/ 5271//>>css.structure: ../../themes/base/core.css 5272//>>css.structure: ../../themes/base/menu.css 5273//>>css.theme: ../../themes/base/theme.css 5274 5275 5276var widgetsMenu = $.widget( "ui.menu", { 5277 version: "1.13.2", 5278 defaultElement: "<ul>", 5279 delay: 300, 5280 options: { 5281 icons: { 5282 submenu: "ui-icon-caret-1-e" 5283 }, 5284 items: "> *", 5285 menus: "ul", 5286 position: { 5287 my: "left top", 5288 at: "right top" 5289 }, 5290 role: "menu", 5291 5292 // Callbacks 5293 blur: null, 5294 focus: null, 5295 select: null 5296 }, 5297 5298 _create: function() { 5299 this.activeMenu = this.element; 5300 5301 // Flag used to prevent firing of the click handler 5302 // as the event bubbles up through nested menus 5303 this.mouseHandled = false; 5304 this.lastMousePosition = { x: null, y: null }; 5305 this.element 5306 .uniqueId() 5307 .attr( { 5308 role: this.options.role, 5309 tabIndex: 0 5310 } ); 5311 5312 this._addClass( "ui-menu", "ui-widget ui-widget-content" ); 5313 this._on( { 5314 5315 // Prevent focus from sticking to links inside menu after clicking 5316 // them (focus should always stay on UL during navigation). 5317 "mousedown .ui-menu-item": function( event ) { 5318 event.preventDefault(); 5319 5320 this._activateItem( event ); 5321 }, 5322 "click .ui-menu-item": function( event ) { 5323 var target = $( event.target ); 5324 var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); 5325 if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { 5326 this.select( event ); 5327 5328 // Only set the mouseHandled flag if the event will bubble, see #9469. 5329 if ( !event.isPropagationStopped() ) { 5330 this.mouseHandled = true; 5331 } 5332 5333 // Open submenu on click 5334 if ( target.has( ".ui-menu" ).length ) { 5335 this.expand( event ); 5336 } else if ( !this.element.is( ":focus" ) && 5337 active.closest( ".ui-menu" ).length ) { 5338 5339 // Redirect focus to the menu 5340 this.element.trigger( "focus", [ true ] ); 5341 5342 // If the active item is on the top level, let it stay active. 5343 // Otherwise, blur the active item since it is no longer visible. 5344 if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { 5345 clearTimeout( this.timer ); 5346 } 5347 } 5348 } 5349 }, 5350 "mouseenter .ui-menu-item": "_activateItem", 5351 "mousemove .ui-menu-item": "_activateItem", 5352 mouseleave: "collapseAll", 5353 "mouseleave .ui-menu": "collapseAll", 5354 focus: function( event, keepActiveItem ) { 5355 5356 // If there's already an active item, keep it active 5357 // If not, activate the first item 5358 var item = this.active || this._menuItems().first(); 5359 5360 if ( !keepActiveItem ) { 5361 this.focus( event, item ); 5362 } 5363 }, 5364 blur: function( event ) { 5365 this._delay( function() { 5366 var notContained = !$.contains( 5367 this.element[ 0 ], 5368 $.ui.safeActiveElement( this.document[ 0 ] ) 5369 ); 5370 if ( notContained ) { 5371 this.collapseAll( event ); 5372 } 5373 } ); 5374 }, 5375 keydown: "_keydown" 5376 } ); 5377 5378 this.refresh();
vendor: 13,612 bytes, lines 5379-5867
5379 5380 // Clicks outside of a menu collapse any open menus 5381 this._on( this.document, { 5382 click: function( event ) { 5383 if ( this._closeOnDocumentClick( event ) ) { 5384 this.collapseAll( event, true ); 5385 } 5386 5387 // Reset the mouseHandled flag 5388 this.mouseHandled = false; 5389 } 5390 } ); 5391 }, 5392 5393 _activateItem: function( event ) { 5394 5395 // Ignore mouse events while typeahead is active, see #10458. 5396 // Prevents focusing the wrong item when typeahead causes a scroll while the mouse 5397 // is over an item in the menu 5398 if ( this.previousFilter ) { 5399 return; 5400 } 5401 5402 // If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356) 5403 if ( event.clientX === this.lastMousePosition.x && 5404 event.clientY === this.lastMousePosition.y ) { 5405 return; 5406 } 5407 5408 this.lastMousePosition = { 5409 x: event.clientX, 5410 y: event.clientY 5411 }; 5412 5413 var actualTarget = $( event.target ).closest( ".ui-menu-item" ), 5414 target = $( event.currentTarget ); 5415 5416 // Ignore bubbled events on parent items, see #11641 5417 if ( actualTarget[ 0 ] !== target[ 0 ] ) { 5418 return; 5419 } 5420 5421 // If the item is already active, there's nothing to do 5422 if ( target.is( ".ui-state-active" ) ) { 5423 return; 5424 } 5425 5426 // Remove ui-state-active class from siblings of the newly focused menu item 5427 // to avoid a jump caused by adjacent elements both having a class with a border 5428 this._removeClass( target.siblings().children( ".ui-state-active" ), 5429 null, "ui-state-active" ); 5430 this.focus( event, target ); 5431 }, 5432 5433 _destroy: function() { 5434 var items = this.element.find( ".ui-menu-item" ) 5435 .removeAttr( "role aria-disabled" ), 5436 submenus = items.children( ".ui-menu-item-wrapper" ) 5437 .removeUniqueId() 5438 .removeAttr( "tabIndex role aria-haspopup" ); 5439 5440 // Destroy (sub)menus 5441 this.element 5442 .removeAttr( "aria-activedescendant" ) 5443 .find( ".ui-menu" ).addBack() 5444 .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " + 5445 "tabIndex" ) 5446 .removeUniqueId() 5447 .show(); 5448 5449 submenus.children().each( function() { 5450 var elem = $( this ); 5451 if ( elem.data( "ui-menu-submenu-caret" ) ) { 5452 elem.remove(); 5453 } 5454 } ); 5455 }, 5456 5457 _keydown: function( event ) { 5458 var match, prev, character, skip, 5459 preventDefault = true; 5460 5461 switch ( event.keyCode ) { 5462 case $.ui.keyCode.PAGE_UP: 5463 this.previousPage( event ); 5464 break; 5465 case $.ui.keyCode.PAGE_DOWN: 5466 this.nextPage( event ); 5467 break; 5468 case $.ui.keyCode.HOME: 5469 this._move( "first", "first", event ); 5470 break; 5471 case $.ui.keyCode.END: 5472 this._move( "last", "last", event ); 5473 break; 5474 case $.ui.keyCode.UP: 5475 this.previous( event ); 5476 break; 5477 case $.ui.keyCode.DOWN: 5478 this.next( event ); 5479 break; 5480 case $.ui.keyCode.LEFT: 5481 this.collapse( event ); 5482 break; 5483 case $.ui.keyCode.RIGHT: 5484 if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { 5485 this.expand( event ); 5486 } 5487 break; 5488 case $.ui.keyCode.ENTER: 5489 case $.ui.keyCode.SPACE: 5490 this._activate( event ); 5491 break; 5492 case $.ui.keyCode.ESCAPE: 5493 this.collapse( event ); 5494 break; 5495 default: 5496 preventDefault = false; 5497 prev = this.previousFilter || ""; 5498 skip = false; 5499 5500 // Support number pad values 5501 character = event.keyCode >= 96 && event.keyCode <= 105 ? 5502 ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode ); 5503 5504 clearTimeout( this.filterTimer ); 5505 5506 if ( character === prev ) { 5507 skip = true; 5508 } else { 5509 character = prev + character; 5510 } 5511 5512 match = this._filterMenuItems( character ); 5513 match = skip && match.index( this.active.next() ) !== -1 ? 5514 this.active.nextAll( ".ui-menu-item" ) : 5515 match; 5516 5517 // If no matches on the current filter, reset to the last character pressed 5518 // to move down the menu to the first item that starts with that character 5519 if ( !match.length ) { 5520 character = String.fromCharCode( event.keyCode ); 5521 match = this._filterMenuItems( character ); 5522 } 5523 5524 if ( match.length ) { 5525 this.focus( event, match ); 5526 this.previousFilter = character; 5527 this.filterTimer = this._delay( function() { 5528 delete this.previousFilter; 5529 }, 1000 ); 5530 } else { 5531 delete this.previousFilter; 5532 } 5533 } 5534 5535 if ( preventDefault ) { 5536 event.preventDefault(); 5537 } 5538 }, 5539 5540 _activate: function( event ) { 5541 if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { 5542 if ( this.active.children( "[aria-haspopup='true']" ).length ) { 5543 this.expand( event ); 5544 } else { 5545 this.select( event ); 5546 } 5547 } 5548 }, 5549 5550 refresh: function() { 5551 var menus, items, newSubmenus, newItems, newWrappers, 5552 that = this, 5553 icon = this.options.icons.submenu, 5554 submenus = this.element.find( this.options.menus ); 5555 5556 this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length ); 5557 5558 // Initialize nested menus 5559 newSubmenus = submenus.filter( ":not(.ui-menu)" ) 5560 .hide() 5561 .attr( { 5562 role: this.options.role, 5563 "aria-hidden": "true", 5564 "aria-expanded": "false" 5565 } ) 5566 .each( function() { 5567 var menu = $( this ), 5568 item = menu.prev(), 5569 submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true ); 5570 5571 that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon ); 5572 item 5573 .attr( "aria-haspopup", "true" ) 5574 .prepend( submenuCaret ); 5575 menu.attr( "aria-labelledby", item.attr( "id" ) ); 5576 } ); 5577 5578 this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" ); 5579 5580 menus = submenus.add( this.element ); 5581 items = menus.find( this.options.items ); 5582 5583 // Initialize menu-items containing spaces and/or dashes only as dividers 5584 items.not( ".ui-menu-item" ).each( function() { 5585 var item = $( this ); 5586 if ( that._isDivider( item ) ) { 5587 that._addClass( item, "ui-menu-divider", "ui-widget-content" ); 5588 } 5589 } ); 5590 5591 // Don't refresh list items that are already adapted 5592 newItems = items.not( ".ui-menu-item, .ui-menu-divider" ); 5593 newWrappers = newItems.children() 5594 .not( ".ui-menu" ) 5595 .uniqueId() 5596 .attr( { 5597 tabIndex: -1, 5598 role: this._itemRole() 5599 } ); 5600 this._addClass( newItems, "ui-menu-item" ) 5601 ._addClass( newWrappers, "ui-menu-item-wrapper" ); 5602 5603 // Add aria-disabled attribute to any disabled menu item 5604 items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); 5605 5606 // If the active item has been removed, blur the menu 5607 if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 5608 this.blur(); 5609 } 5610 }, 5611 5612 _itemRole: function() { 5613 return { 5614 menu: "menuitem", 5615 listbox: "option" 5616 }[ this.options.role ]; 5617 }, 5618 5619 _setOption: function( key, value ) { 5620 if ( key === "icons" ) { 5621 var icons = this.element.find( ".ui-menu-icon" ); 5622 this._removeClass( icons, null, this.options.icons.submenu ) 5623 ._addClass( icons, null, value.submenu ); 5624 } 5625 this._super( key, value ); 5626 }, 5627 5628 _setOptionDisabled: function( value ) { 5629 this._super( value ); 5630 5631 this.element.attr( "aria-disabled", String( value ) ); 5632 this._toggleClass( null, "ui-state-disabled", !!value ); 5633 }, 5634 5635 focus: function( event, item ) { 5636 var nested, focused, activeParent; 5637 this.blur( event, event && event.type === "focus" ); 5638 5639 this._scrollIntoView( item ); 5640 5641 this.active = item.first(); 5642 5643 focused = this.active.children( ".ui-menu-item-wrapper" ); 5644 this._addClass( focused, null, "ui-state-active" ); 5645 5646 // Only update aria-activedescendant if there's a role 5647 // otherwise we assume focus is managed elsewhere 5648 if ( this.options.role ) { 5649 this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); 5650 } 5651 5652 // Highlight active parent menu item, if any 5653 activeParent = this.active 5654 .parent() 5655 .closest( ".ui-menu-item" ) 5656 .children( ".ui-menu-item-wrapper" ); 5657 this._addClass( activeParent, null, "ui-state-active" ); 5658 5659 if ( event && event.type === "keydown" ) { 5660 this._close(); 5661 } else { 5662 this.timer = this._delay( function() { 5663 this._close(); 5664 }, this.delay ); 5665 } 5666 5667 nested = item.children( ".ui-menu" ); 5668 if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { 5669 this._startOpening( nested ); 5670 } 5671 this.activeMenu = item.parent(); 5672 5673 this._trigger( "focus", event, { item: item } ); 5674 }, 5675 5676 _scrollIntoView: function( item ) { 5677 var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; 5678 if ( this._hasScroll() ) { 5679 borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0; 5680 paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0; 5681 offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; 5682 scroll = this.activeMenu.scrollTop(); 5683 elementHeight = this.activeMenu.height(); 5684 itemHeight = item.outerHeight(); 5685 5686 if ( offset < 0 ) { 5687 this.activeMenu.scrollTop( scroll + offset ); 5688 } else if ( offset + itemHeight > elementHeight ) { 5689 this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); 5690 } 5691 } 5692 }, 5693 5694 blur: function( event, fromFocus ) { 5695 if ( !fromFocus ) { 5696 clearTimeout( this.timer ); 5697 } 5698 5699 if ( !this.active ) { 5700 return; 5701 } 5702 5703 this._removeClass( this.active.children( ".ui-menu-item-wrapper" ), 5704 null, "ui-state-active" ); 5705 5706 this._trigger( "blur", event, { item: this.active } ); 5707 this.active = null; 5708 }, 5709 5710 _startOpening: function( submenu ) { 5711 clearTimeout( this.timer ); 5712 5713 // Don't open if already open fixes a Firefox bug that caused a .5 pixel 5714 // shift in the submenu position when mousing over the caret icon 5715 if ( submenu.attr( "aria-hidden" ) !== "true" ) { 5716 return; 5717 } 5718 5719 this.timer = this._delay( function() { 5720 this._close(); 5721 this._open( submenu ); 5722 }, this.delay ); 5723 }, 5724 5725 _open: function( submenu ) { 5726 var position = $.extend( { 5727 of: this.active 5728 }, this.options.position ); 5729 5730 clearTimeout( this.timer ); 5731 this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) 5732 .hide() 5733 .attr( "aria-hidden", "true" ); 5734 5735 submenu 5736 .show() 5737 .removeAttr( "aria-hidden" ) 5738 .attr( "aria-expanded", "true" ) 5739 .position( position ); 5740 }, 5741 5742 collapseAll: function( event, all ) { 5743 clearTimeout( this.timer ); 5744 this.timer = this._delay( function() { 5745 5746 // If we were passed an event, look for the submenu that contains the event 5747 var currentMenu = all ? this.element : 5748 $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); 5749 5750 // If we found no valid submenu ancestor, use the main menu to close all 5751 // sub menus anyway 5752 if ( !currentMenu.length ) { 5753 currentMenu = this.element; 5754 } 5755 5756 this._close( currentMenu ); 5757 5758 this.blur( event ); 5759 5760 // Work around active item staying active after menu is blurred 5761 this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" ); 5762 5763 this.activeMenu = currentMenu; 5764 }, all ? 0 : this.delay ); 5765 }, 5766 5767 // With no arguments, closes the currently active menu - if nothing is active 5768 // it closes all menus. If passed an argument, it will search for menus BELOW 5769 _close: function( startMenu ) { 5770 if ( !startMenu ) { 5771 startMenu = this.active ? this.active.parent() : this.element; 5772 } 5773 5774 startMenu.find( ".ui-menu" ) 5775 .hide() 5776 .attr( "aria-hidden", "true" ) 5777 .attr( "aria-expanded", "false" ); 5778 }, 5779 5780 _closeOnDocumentClick: function( event ) { 5781 return !$( event.target ).closest( ".ui-menu" ).length; 5782 }, 5783 5784 _isDivider: function( item ) { 5785 5786 // Match hyphen, em dash, en dash 5787 return !/[^\-\u2014\u2013\s]/.test( item.text() ); 5788 }, 5789 5790 collapse: function( event ) { 5791 var newItem = this.active && 5792 this.active.parent().closest( ".ui-menu-item", this.element ); 5793 if ( newItem && newItem.length ) { 5794 this._close(); 5795 this.focus( event, newItem ); 5796 } 5797 }, 5798 5799 expand: function( event ) { 5800 var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first(); 5801 5802 if ( newItem && newItem.length ) { 5803 this._open( newItem.parent() ); 5804 5805 // Delay so Firefox will not hide activedescendant change in expanding submenu from AT 5806 this._delay( function() { 5807 this.focus( event, newItem ); 5808 } ); 5809 } 5810 }, 5811 5812 next: function( event ) { 5813 this._move( "next", "first", event ); 5814 }, 5815 5816 previous: function( event ) { 5817 this._move( "prev", "last", event ); 5818 }, 5819 5820 isFirstItem: function() { 5821 return this.active && !this.active.prevAll( ".ui-menu-item" ).length; 5822 }, 5823 5824 isLastItem: function() { 5825 return this.active && !this.active.nextAll( ".ui-menu-item" ).length; 5826 }, 5827 5828 _menuItems: function( menu ) { 5829 return ( menu || this.element ) 5830 .find( this.options.items ) 5831 .filter( ".ui-menu-item" ); 5832 }, 5833 5834 _move: function( direction, filter, event ) { 5835 var next; 5836 if ( this.active ) { 5837 if ( direction === "first" || direction === "last" ) { 5838 next = this.active 5839 [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) 5840 .last(); 5841 } else { 5842 next = this.active 5843 [ direction + "All" ]( ".ui-menu-item" ) 5844 .first(); 5845 } 5846 } 5847 if ( !next || !next.length || !this.active ) { 5848 next = this._menuItems( this.activeMenu )[ filter ](); 5849 } 5850 5851 this.focus( event, next ); 5852 }, 5853 5854 nextPage: function( event ) { 5855 var item, base, height; 5856 5857 if ( !this.active ) { 5858 this.next( event ); 5859 return; 5860 } 5861 if ( this.isLastItem() ) { 5862 return; 5863 } 5864 if ( this._hasScroll() ) { 5865 base = this.active.offset().top; 5866 height = this.element.innerHeight(); 5867
vendor: 20,225 bytes, lines 5868-6606
5868 // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. 5869 if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { 5870 height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); 5871 } 5872 5873 this.active.nextAll( ".ui-menu-item" ).each( function() { 5874 item = $( this ); 5875 return item.offset().top - base - height < 0; 5876 } ); 5877 5878 this.focus( event, item ); 5879 } else { 5880 this.focus( event, this._menuItems( this.activeMenu ) 5881 [ !this.active ? "first" : "last" ]() ); 5882 } 5883 }, 5884 5885 previousPage: function( event ) { 5886 var item, base, height; 5887 if ( !this.active ) { 5888 this.next( event ); 5889 return; 5890 } 5891 if ( this.isFirstItem() ) { 5892 return; 5893 } 5894 if ( this._hasScroll() ) { 5895 base = this.active.offset().top; 5896 height = this.element.innerHeight(); 5897 5898 // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. 5899 if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { 5900 height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); 5901 } 5902 5903 this.active.prevAll( ".ui-menu-item" ).each( function() { 5904 item = $( this ); 5905 return item.offset().top - base + height > 0; 5906 } ); 5907 5908 this.focus( event, item ); 5909 } else { 5910 this.focus( event, this._menuItems( this.activeMenu ).first() ); 5911 } 5912 }, 5913 5914 _hasScroll: function() { 5915 return this.element.outerHeight() < this.element.prop( "scrollHeight" ); 5916 }, 5917 5918 select: function( event ) { 5919 5920 // TODO: It should never be possible to not have an active item at this 5921 // point, but the tests don't trigger mouseenter before click. 5922 this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); 5923 var ui = { item: this.active }; 5924 if ( !this.active.has( ".ui-menu" ).length ) { 5925 this.collapseAll( event, true ); 5926 } 5927 this._trigger( "select", event, ui ); 5928 }, 5929 5930 _filterMenuItems: function( character ) { 5931 var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), 5932 regex = new RegExp( "^" + escapedCharacter, "i" ); 5933 5934 return this.activeMenu 5935 .find( this.options.items ) 5936 5937 // Only match on items, not dividers or other content (#10571) 5938 .filter( ".ui-menu-item" ) 5939 .filter( function() { 5940 return regex.test( 5941 String.prototype.trim.call( 5942 $( this ).children( ".ui-menu-item-wrapper" ).text() ) ); 5943 } ); 5944 } 5945} ); 5946 5947 5948/*! 5949 * jQuery UI Autocomplete 1.13.2 5950 * http://jqueryui.com 5951 * 5952 * Copyright jQuery Foundation and other contributors 5953 * Released under the MIT license. 5954 * http://jquery.org/license 5955 */ 5956 5957//>>label: Autocomplete 5958//>>group: Widgets 5959//>>description: Lists suggested words as the user is typing. 5960//>>docs: http://api.jqueryui.com/autocomplete/ 5961//>>demos: http://jqueryui.com/autocomplete/ 5962//>>css.structure: ../../themes/base/core.css 5963//>>css.structure: ../../themes/base/autocomplete.css 5964//>>css.theme: ../../themes/base/theme.css 5965 5966 5967$.widget( "ui.autocomplete", { 5968 version: "1.13.2", 5969 defaultElement: "<input>", 5970 options: { 5971 appendTo: null, 5972 autoFocus: false, 5973 delay: 300, 5974 minLength: 1, 5975 position: { 5976 my: "left top", 5977 at: "left bottom", 5978 collision: "none" 5979 }, 5980 source: null, 5981 5982 // Callbacks 5983 change: null, 5984 close: null, 5985 focus: null, 5986 open: null, 5987 response: null, 5988 search: null, 5989 select: null 5990 }, 5991 5992 requestIndex: 0, 5993 pending: 0, 5994 liveRegionTimer: null, 5995 5996 _create: function() { 5997 5998 // Some browsers only repeat keydown events, not keypress events, 5999 // so we use the suppressKeyPress flag to determine if we've already 6000 // handled the keydown event. #7269 6001 // Unfortunately the code for & in keypress is the same as the up arrow, 6002 // so we use the suppressKeyPressRepeat flag to avoid handling keypress 6003 // events when we know the keydown event was used to modify the 6004 // search term. #7799 6005 var suppressKeyPress, suppressKeyPressRepeat, suppressInput, 6006 nodeName = this.element[ 0 ].nodeName.toLowerCase(), 6007 isTextarea = nodeName === "textarea", 6008 isInput = nodeName === "input"; 6009 6010 // Textareas are always multi-line 6011 // Inputs are always single-line, even if inside a contentEditable element 6012 // IE also treats inputs as contentEditable 6013 // All other element types are determined by whether or not they're contentEditable 6014 this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element ); 6015 6016 this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; 6017 this.isNewMenu = true; 6018 6019 this._addClass( "ui-autocomplete-input" ); 6020 this.element.attr( "autocomplete", "off" ); 6021 6022 this._on( this.element, { 6023 keydown: function( event ) { 6024 if ( this.element.prop( "readOnly" ) ) { 6025 suppressKeyPress = true; 6026 suppressInput = true; 6027 suppressKeyPressRepeat = true; 6028 return; 6029 } 6030 6031 suppressKeyPress = false; 6032 suppressInput = false; 6033 suppressKeyPressRepeat = false; 6034 var keyCode = $.ui.keyCode; 6035 switch ( event.keyCode ) { 6036 case keyCode.PAGE_UP: 6037 suppressKeyPress = true; 6038 this._move( "previousPage", event ); 6039 break; 6040 case keyCode.PAGE_DOWN: 6041 suppressKeyPress = true; 6042 this._move( "nextPage", event ); 6043 break; 6044 case keyCode.UP: 6045 suppressKeyPress = true; 6046 this._keyEvent( "previous", event ); 6047 break; 6048 case keyCode.DOWN: 6049 suppressKeyPress = true; 6050 this._keyEvent( "next", event ); 6051 break; 6052 case keyCode.ENTER: 6053 6054 // when menu is open and has focus 6055 if ( this.menu.active ) { 6056 6057 // #6055 - Opera still allows the keypress to occur 6058 // which causes forms to submit 6059 suppressKeyPress = true; 6060 event.preventDefault(); 6061 this.menu.select( event ); 6062 } 6063 break; 6064 case keyCode.TAB: 6065 if ( this.menu.active ) { 6066 this.menu.select( event ); 6067 } 6068 break; 6069 case keyCode.ESCAPE: 6070 if ( this.menu.element.is( ":visible" ) ) { 6071 if ( !this.isMultiLine ) { 6072 this._value( this.term ); 6073 } 6074 this.close( event ); 6075 6076 // Different browsers have different default behavior for escape 6077 // Single press can mean undo or clear 6078 // Double press in IE means clear the whole form 6079 event.preventDefault(); 6080 } 6081 break; 6082 default: 6083 suppressKeyPressRepeat = true; 6084 6085 // search timeout should be triggered before the input value is changed 6086 this._searchTimeout( event ); 6087 break; 6088 } 6089 }, 6090 keypress: function( event ) { 6091 if ( suppressKeyPress ) { 6092 suppressKeyPress = false; 6093 if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { 6094 event.preventDefault(); 6095 } 6096 return; 6097 } 6098 if ( suppressKeyPressRepeat ) { 6099 return; 6100 } 6101 6102 // Replicate some key handlers to allow them to repeat in Firefox and Opera 6103 var keyCode = $.ui.keyCode; 6104 switch ( event.keyCode ) { 6105 case keyCode.PAGE_UP: 6106 this._move( "previousPage", event ); 6107 break; 6108 case keyCode.PAGE_DOWN: 6109 this._move( "nextPage", event ); 6110 break; 6111 case keyCode.UP: 6112 this._keyEvent( "previous", event ); 6113 break; 6114 case keyCode.DOWN: 6115 this._keyEvent( "next", event ); 6116 break; 6117 } 6118 }, 6119 input: function( event ) { 6120 if ( suppressInput ) { 6121 suppressInput = false; 6122 event.preventDefault(); 6123 return; 6124 } 6125 this._searchTimeout( event ); 6126 }, 6127 focus: function() { 6128 this.selectedItem = null; 6129 this.previous = this._value(); 6130 }, 6131 blur: function( event ) { 6132 clearTimeout( this.searching ); 6133 this.close( event ); 6134 this._change( event ); 6135 } 6136 } ); 6137 6138 this._initSource(); 6139 this.menu = $( "<ul>" ) 6140 .appendTo( this._appendTo() ) 6141 .menu( { 6142 6143 // disable ARIA support, the live region takes care of that 6144 role: null 6145 } ) 6146 .hide() 6147 6148 // Support: IE 11 only, Edge <= 14 6149 // For other browsers, we preventDefault() on the mousedown event 6150 // to keep the dropdown from taking focus from the input. This doesn't 6151 // work for IE/Edge, causing problems with selection and scrolling (#9638) 6152 // Happily, IE and Edge support an "unselectable" attribute that 6153 // prevents an element from receiving focus, exactly what we want here. 6154 .attr( { 6155 "unselectable": "on" 6156 } ) 6157 .menu( "instance" ); 6158 6159 this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); 6160 this._on( this.menu.element, { 6161 mousedown: function( event ) { 6162 6163 // Prevent moving focus out of the text field 6164 event.preventDefault(); 6165 }, 6166 menufocus: function( event, ui ) { 6167 var label, item; 6168 6169 // support: Firefox 6170 // Prevent accidental activation of menu items in Firefox (#7024 #9118) 6171 if ( this.isNewMenu ) { 6172 this.isNewMenu = false; 6173 if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { 6174 this.menu.blur(); 6175 6176 this.document.one( "mousemove", function() { 6177 $( event.target ).trigger( event.originalEvent ); 6178 } ); 6179 6180 return; 6181 } 6182 } 6183 6184 item = ui.item.data( "ui-autocomplete-item" ); 6185 if ( false !== this._trigger( "focus", event, { item: item } ) ) { 6186 6187 // use value to match what will end up in the input, if it was a key event 6188 if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { 6189 this._value( item.value ); 6190 } 6191 } 6192 6193 // Announce the value in the liveRegion 6194 label = ui.item.attr( "aria-label" ) || item.value; 6195 if ( label && String.prototype.trim.call( label ).length ) { 6196 clearTimeout( this.liveRegionTimer ); 6197 this.liveRegionTimer = this._delay( function() { 6198 this.liveRegion.html( $( "<div>" ).text( label ) ); 6199 }, 100 ); 6200 } 6201 }, 6202 menuselect: function( event, ui ) { 6203 var item = ui.item.data( "ui-autocomplete-item" ), 6204 previous = this.previous; 6205 6206 // Only trigger when focus was lost (click on menu) 6207 if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { 6208 this.element.trigger( "focus" ); 6209 this.previous = previous; 6210 6211 // #6109 - IE triggers two focus events and the second 6212 // is asynchronous, so we need to reset the previous 6213 // term synchronously and asynchronously :-( 6214 this._delay( function() { 6215 this.previous = previous; 6216 this.selectedItem = item; 6217 } ); 6218 } 6219 6220 if ( false !== this._trigger( "select", event, { item: item } ) ) { 6221 this._value( item.value ); 6222 } 6223 6224 // reset the term after the select event 6225 // this allows custom select handling to work properly 6226 this.term = this._value(); 6227 6228 this.close( event ); 6229 this.selectedItem = item; 6230 } 6231 } ); 6232 6233 this.liveRegion = $( "<div>", { 6234 role: "status", 6235 "aria-live": "assertive", 6236 "aria-relevant": "additions" 6237 } ) 6238 .appendTo( this.document[ 0 ].body ); 6239 6240 this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); 6241 6242 // Turning off autocomplete prevents the browser from remembering the 6243 // value when navigating through history, so we re-enable autocomplete 6244 // if the page is unloaded before the widget is destroyed. #7790 6245 this._on( this.window, { 6246 beforeunload: function() { 6247 this.element.removeAttr( "autocomplete" ); 6248 } 6249 } ); 6250 }, 6251 6252 _destroy: function() { 6253 clearTimeout( this.searching ); 6254 this.element.removeAttr( "autocomplete" ); 6255 this.menu.element.remove(); 6256 this.liveRegion.remove(); 6257 }, 6258 6259 _setOption: function( key, value ) { 6260 this._super( key, value ); 6261 if ( key === "source" ) { 6262 this._initSource(); 6263 } 6264 if ( key === "appendTo" ) { 6265 this.menu.element.appendTo( this._appendTo() ); 6266 } 6267 if ( key === "disabled" && value && this.xhr ) { 6268 this.xhr.abort(); 6269 } 6270 }, 6271 6272 _isEventTargetInWidget: function( event ) { 6273 var menuElement = this.menu.element[ 0 ]; 6274 6275 return event.target === this.element[ 0 ] || 6276 event.target === menuElement || 6277 $.contains( menuElement, event.target ); 6278 }, 6279 6280 _closeOnClickOutside: function( event ) { 6281 if ( !this._isEventTargetInWidget( event ) ) { 6282 this.close(); 6283 } 6284 }, 6285 6286 _appendTo: function() { 6287 var element = this.options.appendTo; 6288 6289 if ( element ) { 6290 element = element.jquery || element.nodeType ? 6291 $( element ) : 6292 this.document.find( element ).eq( 0 ); 6293 } 6294 6295 if ( !element || !element[ 0 ] ) { 6296 element = this.element.closest( ".ui-front, dialog" ); 6297 } 6298 6299 if ( !element.length ) { 6300 element = this.document[ 0 ].body; 6301 } 6302 6303 return element; 6304 }, 6305 6306 _initSource: function() { 6307 var array, url, 6308 that = this; 6309 if ( Array.isArray( this.options.source ) ) { 6310 array = this.options.source; 6311 this.source = function( request, response ) { 6312 response( $.ui.autocomplete.filter( array, request.term ) ); 6313 }; 6314 } else if ( typeof this.options.source === "string" ) { 6315 url = this.options.source; 6316 this.source = function( request, response ) { 6317 if ( that.xhr ) { 6318 that.xhr.abort(); 6319 } 6320 that.xhr = $.ajax( { 6321 url: url, 6322 data: request, 6323 dataType: "json", 6324 success: function( data ) { 6325 response( data ); 6326 }, 6327 error: function() { 6328 response( [] ); 6329 } 6330 } ); 6331 }; 6332 } else { 6333 this.source = this.options.source; 6334 } 6335 }, 6336 6337 _searchTimeout: function( event ) { 6338 clearTimeout( this.searching ); 6339 this.searching = this._delay( function() { 6340 6341 // Search if the value has changed, or if the user retypes the same value (see #7434) 6342 var equalValues = this.term === this._value(), 6343 menuVisible = this.menu.element.is( ":visible" ), 6344 modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey; 6345 6346 if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) { 6347 this.selectedItem = null; 6348 this.search( null, event ); 6349 } 6350 }, this.options.delay ); 6351 }, 6352 6353 search: function( value, event ) { 6354 value = value != null ? value : this._value(); 6355 6356 // Always save the actual value, not the one passed as an argument 6357 this.term = this._value(); 6358 6359 if ( value.length < this.options.minLength ) { 6360 return this.close( event ); 6361 } 6362 6363 if ( this._trigger( "search", event ) === false ) { 6364 return; 6365 } 6366 6367 return this._search( value ); 6368 }, 6369 6370 _search: function( value ) { 6371 this.pending++; 6372 this._addClass( "ui-autocomplete-loading" ); 6373 this.cancelSearch = false; 6374 6375 this.source( { term: value }, this._response() ); 6376 }, 6377 6378 _response: function() { 6379 var index = ++this.requestIndex; 6380 6381 return function( content ) { 6382 if ( index === this.requestIndex ) { 6383 this.__response( content ); 6384 } 6385 6386 this.pending--; 6387 if ( !this.pending ) { 6388 this._removeClass( "ui-autocomplete-loading" ); 6389 } 6390 }.bind( this ); 6391 }, 6392 6393 __response: function( content ) { 6394 if ( content ) { 6395 content = this._normalize( content ); 6396 } 6397 this._trigger( "response", null, { content: content } ); 6398 if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { 6399 this._suggest( content ); 6400 this._trigger( "open" ); 6401 } else { 6402 6403 // use ._close() instead of .close() so we don't cancel future searches 6404 this._close(); 6405 } 6406 }, 6407 6408 close: function( event ) { 6409 this.cancelSearch = true; 6410 this._close( event ); 6411 }, 6412 6413 _close: function( event ) { 6414 6415 // Remove the handler that closes the menu on outside clicks 6416 this._off( this.document, "mousedown" ); 6417 6418 if ( this.menu.element.is( ":visible" ) ) { 6419 this.menu.element.hide(); 6420 this.menu.blur(); 6421 this.isNewMenu = true; 6422 this._trigger( "close", event ); 6423 } 6424 }, 6425 6426 _change: function( event ) { 6427 if ( this.previous !== this._value() ) { 6428 this._trigger( "change", event, { item: this.selectedItem } ); 6429 } 6430 }, 6431 6432 _normalize: function( items ) { 6433 6434 // assume all items have the right format when the first item is complete 6435 if ( items.length && items[ 0 ].label && items[ 0 ].value ) { 6436 return items; 6437 } 6438 return $.map( items, function( item ) { 6439 if ( typeof item === "string" ) { 6440 return { 6441 label: item, 6442 value: item 6443 }; 6444 } 6445 return $.extend( {}, item, { 6446 label: item.label || item.value, 6447 value: item.value || item.label 6448 } ); 6449 } ); 6450 }, 6451 6452 _suggest: function( items ) { 6453 var ul = this.menu.element.empty(); 6454 this._renderMenu( ul, items ); 6455 this.isNewMenu = true; 6456 this.menu.refresh(); 6457 6458 // Size and position menu 6459 ul.show(); 6460 this._resizeMenu(); 6461 ul.position( $.extend( { 6462 of: this.element 6463 }, this.options.position ) ); 6464 6465 if ( this.options.autoFocus ) { 6466 this.menu.next(); 6467 } 6468 6469 // Listen for interactions outside of the widget (#6642) 6470 this._on( this.document, { 6471 mousedown: "_closeOnClickOutside" 6472 } ); 6473 }, 6474 6475 _resizeMenu: function() { 6476 var ul = this.menu.element; 6477 ul.outerWidth( Math.max( 6478 6479 // Firefox wraps long text (possibly a rounding bug) 6480 // so we add 1px to avoid the wrapping (#7513) 6481 ul.width( "" ).outerWidth() + 1, 6482 this.element.outerWidth() 6483 ) ); 6484 }, 6485 6486 _renderMenu: function( ul, items ) { 6487 var that = this; 6488 $.each( items, function( index, item ) { 6489 that._renderItemData( ul, item ); 6490 } ); 6491 }, 6492 6493 _renderItemData: function( ul, item ) { 6494 return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); 6495 }, 6496 6497 _renderItem: function( ul, item ) { 6498 return $( "<li>" ) 6499 .append( $( "<div>" ).text( item.label ) ) 6500 .appendTo( ul ); 6501 }, 6502 6503 _move: function( direction, event ) { 6504 if ( !this.menu.element.is( ":visible" ) ) { 6505 this.search( null, event ); 6506 return; 6507 } 6508 if ( this.menu.isFirstItem() && /^previous/.test( direction ) || 6509 this.menu.isLastItem() && /^next/.test( direction ) ) { 6510 6511 if ( !this.isMultiLine ) { 6512 this._value( this.term ); 6513 } 6514 6515 this.menu.blur(); 6516 return; 6517 } 6518 this.menu[ direction ]( event ); 6519 }, 6520 6521 widget: function() { 6522 return this.menu.element; 6523 }, 6524 6525 _value: function() { 6526 return this.valueMethod.apply( this.element, arguments ); 6527 }, 6528 6529 _keyEvent: function( keyEvent, event ) { 6530 if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { 6531 this._move( keyEvent, event ); 6532 6533 // Prevents moving cursor to beginning/end of the text field in some browsers 6534 event.preventDefault(); 6535 } 6536 }, 6537 6538 // Support: Chrome <=50 6539 // We should be able to just use this.element.prop( "isContentEditable" ) 6540 // but hidden elements always report false in Chrome. 6541 // https://code.google.com/p/chromium/issues/detail?id=313082 6542 _isContentEditable: function( element ) { 6543 if ( !element.length ) { 6544 return false; 6545 } 6546 6547 var editable = element.prop( "contentEditable" ); 6548 6549 if ( editable === "inherit" ) { 6550 return this._isContentEditable( element.parent() ); 6551 } 6552 6553 return editable === "true"; 6554 } 6555} ); 6556 6557$.extend( $.ui.autocomplete, { 6558 escapeRegex: function( value ) { 6559 return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); 6560 }, 6561 filter: function( array, term ) { 6562 var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" ); 6563 return $.grep( array, function( value ) { 6564 return matcher.test( value.label || value.value || value ); 6565 } ); 6566 } 6567} ); 6568 6569// Live region extension, adding a `messages` option 6570// NOTE: This is an experimental API. We are still investigating 6571// a full solution for string manipulation and internationalization. 6572$.widget( "ui.autocomplete", $.ui.autocomplete, { 6573 options: { 6574 messages: { 6575 noResults: "No search results.", 6576 results: function( amount ) { 6577 return amount + ( amount > 1 ? " results are" : " result is" ) + 6578 " available, use up and down arrow keys to navigate."; 6579 } 6580 } 6581 }, 6582 6583 __response: function( content ) { 6584 var message; 6585 this._superApply( arguments ); 6586 if ( this.options.disabled || this.cancelSearch ) { 6587 return; 6588 } 6589 if ( content && content.length ) { 6590 message = this.options.messages.results( content.length ); 6591 } else { 6592 message = this.options.messages.noResults; 6593 } 6594 clearTimeout( this.liveRegionTimer ); 6595 this.liveRegionTimer = this._delay( function() { 6596 this.liveRegion.html( $( "<div>" ).text( message ) ); 6597 }, 100 ); 6598 } 6599} ); 6600 6601var widgetsAutocomplete = $.ui.autocomplete; 6602 6603 6604/*! 6605 * jQuery UI Controlgroup 1.13.2 6606 * http://jqueryui.com
vendor: 7,245 bytes, lines 6607-6844
6607 * 6608 * Copyright jQuery Foundation and other contributors 6609 * Released under the MIT license. 6610 * http://jquery.org/license 6611 */ 6612 6613//>>label: Controlgroup 6614//>>group: Widgets 6615//>>description: Visually groups form control widgets 6616//>>docs: http://api.jqueryui.com/controlgroup/ 6617//>>demos: http://jqueryui.com/controlgroup/ 6618//>>css.structure: ../../themes/base/core.css 6619//>>css.structure: ../../themes/base/controlgroup.css 6620//>>css.theme: ../../themes/base/theme.css 6621 6622 6623var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; 6624 6625var widgetsControlgroup = $.widget( "ui.controlgroup", { 6626 version: "1.13.2", 6627 defaultElement: "<div>", 6628 options: { 6629 direction: "horizontal", 6630 disabled: null, 6631 onlyVisible: true, 6632 items: { 6633 "button": "input[type=button], input[type=submit], input[type=reset], button, a", 6634 "controlgroupLabel": ".ui-controlgroup-label", 6635 "checkboxradio": "input[type='checkbox'], input[type='radio']", 6636 "selectmenu": "select", 6637 "spinner": ".ui-spinner-input" 6638 } 6639 }, 6640 6641 _create: function() { 6642 this._enhance(); 6643 }, 6644 6645 // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation 6646 _enhance: function() { 6647 this.element.attr( "role", "toolbar" ); 6648 this.refresh(); 6649 }, 6650 6651 _destroy: function() { 6652 this._callChildMethod( "destroy" ); 6653 this.childWidgets.removeData( "ui-controlgroup-data" ); 6654 this.element.removeAttr( "role" ); 6655 if ( this.options.items.controlgroupLabel ) { 6656 this.element 6657 .find( this.options.items.controlgroupLabel ) 6658 .find( ".ui-controlgroup-label-contents" ) 6659 .contents().unwrap(); 6660 } 6661 }, 6662 6663 _initWidgets: function() { 6664 var that = this, 6665 childWidgets = []; 6666 6667 // First we iterate over each of the items options 6668 $.each( this.options.items, function( widget, selector ) { 6669 var labels; 6670 var options = {}; 6671 6672 // Make sure the widget has a selector set 6673 if ( !selector ) { 6674 return; 6675 } 6676 6677 if ( widget === "controlgroupLabel" ) { 6678 labels = that.element.find( selector ); 6679 labels.each( function() { 6680 var element = $( this ); 6681 6682 if ( element.children( ".ui-controlgroup-label-contents" ).length ) { 6683 return; 6684 } 6685 element.contents() 6686 .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" ); 6687 } ); 6688 that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); 6689 childWidgets = childWidgets.concat( labels.get() ); 6690 return; 6691 } 6692 6693 // Make sure the widget actually exists 6694 if ( !$.fn[ widget ] ) { 6695 return; 6696 } 6697 6698 // We assume everything is in the middle to start because we can't determine 6699 // first / last elements until all enhancments are done. 6700 if ( that[ "_" + widget + "Options" ] ) { 6701 options = that[ "_" + widget + "Options" ]( "middle" ); 6702 } else { 6703 options = { classes: {} }; 6704 } 6705 6706 // Find instances of this widget inside controlgroup and init them 6707 that.element 6708 .find( selector ) 6709 .each( function() { 6710 var element = $( this ); 6711 var instance = element[ widget ]( "instance" ); 6712 6713 // We need to clone the default options for this type of widget to avoid 6714 // polluting the variable options which has a wider scope than a single widget. 6715 var instanceOptions = $.widget.extend( {}, options ); 6716 6717 // If the button is the child of a spinner ignore it 6718 // TODO: Find a more generic solution 6719 if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { 6720 return; 6721 } 6722 6723 // Create the widget if it doesn't exist 6724 if ( !instance ) { 6725 instance = element[ widget ]()[ widget ]( "instance" ); 6726 } 6727 if ( instance ) { 6728 instanceOptions.classes = 6729 that._resolveClassesValues( instanceOptions.classes, instance ); 6730 } 6731 element[ widget ]( instanceOptions ); 6732 6733 // Store an instance of the controlgroup to be able to reference 6734 // from the outermost element for changing options and refresh 6735 var widgetElement = element[ widget ]( "widget" ); 6736 $.data( widgetElement[ 0 ], "ui-controlgroup-data", 6737 instance ? instance : element[ widget ]( "instance" ) ); 6738 6739 childWidgets.push( widgetElement[ 0 ] ); 6740 } ); 6741 } ); 6742 6743 this.childWidgets = $( $.uniqueSort( childWidgets ) ); 6744 this._addClass( this.childWidgets, "ui-controlgroup-item" ); 6745 }, 6746 6747 _callChildMethod: function( method ) { 6748 this.childWidgets.each( function() { 6749 var element = $( this ), 6750 data = element.data( "ui-controlgroup-data" ); 6751 if ( data && data[ method ] ) { 6752 data[ method ](); 6753 } 6754 } ); 6755 }, 6756 6757 _updateCornerClass: function( element, position ) { 6758 var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; 6759 var add = this._buildSimpleOptions( position, "label" ).classes.label; 6760 6761 this._removeClass( element, null, remove ); 6762 this._addClass( element, null, add ); 6763 }, 6764 6765 _buildSimpleOptions: function( position, key ) { 6766 var direction = this.options.direction === "vertical"; 6767 var result = { 6768 classes: {} 6769 }; 6770 result.classes[ key ] = { 6771 "middle": "", 6772 "first": "ui-corner-" + ( direction ? "top" : "left" ), 6773 "last": "ui-corner-" + ( direction ? "bottom" : "right" ), 6774 "only": "ui-corner-all" 6775 }[ position ]; 6776 6777 return result; 6778 }, 6779 6780 _spinnerOptions: function( position ) { 6781 var options = this._buildSimpleOptions( position, "ui-spinner" ); 6782 6783 options.classes[ "ui-spinner-up" ] = ""; 6784 options.classes[ "ui-spinner-down" ] = ""; 6785 6786 return options; 6787 }, 6788 6789 _buttonOptions: function( position ) { 6790 return this._buildSimpleOptions( position, "ui-button" ); 6791 }, 6792 6793 _checkboxradioOptions: function( position ) { 6794 return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); 6795 }, 6796 6797 _selectmenuOptions: function( position ) { 6798 var direction = this.options.direction === "vertical"; 6799 return { 6800 width: direction ? "auto" : false, 6801 classes: { 6802 middle: { 6803 "ui-selectmenu-button-open": "", 6804 "ui-selectmenu-button-closed": "" 6805 }, 6806 first: { 6807 "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), 6808 "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) 6809 }, 6810 last: { 6811 "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", 6812 "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) 6813 }, 6814 only: { 6815 "ui-selectmenu-button-open": "ui-corner-top", 6816 "ui-selectmenu-button-closed": "ui-corner-all" 6817 } 6818 6819 }[ position ] 6820 }; 6821 }, 6822 6823 _resolveClassesValues: function( classes, instance ) { 6824 var result = {}; 6825 $.each( classes, function( key ) { 6826 var current = instance.options.classes[ key ] || ""; 6827 current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) ); 6828 result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); 6829 } ); 6830 return result; 6831 }, 6832 6833 _setOption: function( key, value ) { 6834 if ( key === "direction" ) { 6835 this._removeClass( "ui-controlgroup-" + this.options.direction ); 6836 } 6837 6838 this._super( key, value ); 6839 if ( key === "disabled" ) { 6840 this._callChildMethod( value ? "disable" : "enable" ); 6841 return; 6842 } 6843 6844 this.refresh();
vendor: 6,618 bytes, lines 6845-7073
6845 }, 6846 6847 refresh: function() { 6848 var children, 6849 that = this; 6850 6851 this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); 6852 6853 if ( this.options.direction === "horizontal" ) { 6854 this._addClass( null, "ui-helper-clearfix" ); 6855 } 6856 this._initWidgets(); 6857 6858 children = this.childWidgets; 6859 6860 // We filter here because we need to track all childWidgets not just the visible ones 6861 if ( this.options.onlyVisible ) { 6862 children = children.filter( ":visible" ); 6863 } 6864 6865 if ( children.length ) { 6866 6867 // We do this last because we need to make sure all enhancment is done 6868 // before determining first and last 6869 $.each( [ "first", "last" ], function( index, value ) { 6870 var instance = children[ value ]().data( "ui-controlgroup-data" ); 6871 6872 if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { 6873 var options = that[ "_" + instance.widgetName + "Options" ]( 6874 children.length === 1 ? "only" : value 6875 ); 6876 options.classes = that._resolveClassesValues( options.classes, instance ); 6877 instance.element[ instance.widgetName ]( options ); 6878 } else { 6879 that._updateCornerClass( children[ value ](), value ); 6880 } 6881 } ); 6882 6883 // Finally call the refresh method on each of the child widgets. 6884 this._callChildMethod( "refresh" ); 6885 } 6886 } 6887} ); 6888 6889/*! 6890 * jQuery UI Checkboxradio 1.13.2 6891 * http://jqueryui.com 6892 * 6893 * Copyright jQuery Foundation and other contributors 6894 * Released under the MIT license. 6895 * http://jquery.org/license 6896 */ 6897 6898//>>label: Checkboxradio 6899//>>group: Widgets 6900//>>description: Enhances a form with multiple themeable checkboxes or radio buttons. 6901//>>docs: http://api.jqueryui.com/checkboxradio/ 6902//>>demos: http://jqueryui.com/checkboxradio/ 6903//>>css.structure: ../../themes/base/core.css 6904//>>css.structure: ../../themes/base/button.css 6905//>>css.structure: ../../themes/base/checkboxradio.css 6906//>>css.theme: ../../themes/base/theme.css 6907 6908 6909$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { 6910 version: "1.13.2", 6911 options: { 6912 disabled: null, 6913 label: null, 6914 icon: true, 6915 classes: { 6916 "ui-checkboxradio-label": "ui-corner-all", 6917 "ui-checkboxradio-icon": "ui-corner-all" 6918 } 6919 }, 6920 6921 _getCreateOptions: function() { 6922 var disabled, labels, labelContents; 6923 var options = this._super() || {}; 6924 6925 // We read the type here, because it makes more sense to throw a element type error first, 6926 // rather then the error for lack of a label. Often if its the wrong type, it 6927 // won't have a label (e.g. calling on a div, btn, etc) 6928 this._readType(); 6929 6930 labels = this.element.labels(); 6931 6932 // If there are multiple labels, use the last one 6933 this.label = $( labels[ labels.length - 1 ] ); 6934 if ( !this.label.length ) { 6935 $.error( "No label found for checkboxradio widget" ); 6936 } 6937 6938 this.originalLabel = ""; 6939 6940 // We need to get the label text but this may also need to make sure it does not contain the 6941 // input itself. 6942 // The label contents could be text, html, or a mix. We wrap all elements 6943 // and read the wrapper's `innerHTML` to get a string representation of 6944 // the label, without the input as part of it. 6945 labelContents = this.label.contents().not( this.element[ 0 ] ); 6946 6947 if ( labelContents.length ) { 6948 this.originalLabel += labelContents 6949 .clone() 6950 .wrapAll( "<div></div>" ) 6951 .parent() 6952 .html(); 6953 } 6954 6955 // Set the label option if we found label text 6956 if ( this.originalLabel ) { 6957 options.label = this.originalLabel; 6958 } 6959 6960 disabled = this.element[ 0 ].disabled; 6961 if ( disabled != null ) { 6962 options.disabled = disabled; 6963 } 6964 return options; 6965 }, 6966 6967 _create: function() { 6968 var checked = this.element[ 0 ].checked; 6969 6970 this._bindFormResetHandler(); 6971 6972 if ( this.options.disabled == null ) { 6973 this.options.disabled = this.element[ 0 ].disabled; 6974 } 6975 6976 this._setOption( "disabled", this.options.disabled ); 6977 this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" ); 6978 this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" ); 6979 6980 if ( this.type === "radio" ) { 6981 this._addClass( this.label, "ui-checkboxradio-radio-label" ); 6982 } 6983 6984 if ( this.options.label && this.options.label !== this.originalLabel ) { 6985 this._updateLabel(); 6986 } else if ( this.originalLabel ) { 6987 this.options.label = this.originalLabel; 6988 } 6989 6990 this._enhance(); 6991 6992 if ( checked ) { 6993 this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); 6994 } 6995 6996 this._on( { 6997 change: "_toggleClasses", 6998 focus: function() { 6999 this._addClass( this.label, null, "ui-state-focus ui-visual-focus" ); 7000 }, 7001 blur: function() { 7002 this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" ); 7003 } 7004 } ); 7005 }, 7006 7007 _readType: function() { 7008 var nodeName = this.element[ 0 ].nodeName.toLowerCase(); 7009 this.type = this.element[ 0 ].type; 7010 if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) { 7011 $.error( "Can't create checkboxradio on element.nodeName=" + nodeName + 7012 " and element.type=" + this.type ); 7013 } 7014 }, 7015 7016 // Support jQuery Mobile enhanced option 7017 _enhance: function() { 7018 this._updateIcon( this.element[ 0 ].checked ); 7019 }, 7020 7021 widget: function() { 7022 return this.label; 7023 }, 7024 7025 _getRadioGroup: function() { 7026 var group; 7027 var name = this.element[ 0 ].name; 7028 var nameSelector = "input[name='" + $.escapeSelector( name ) + "']"; 7029 7030 if ( !name ) { 7031 return $( [] ); 7032 } 7033 7034 if ( this.form.length ) { 7035 group = $( this.form[ 0 ].elements ).filter( nameSelector ); 7036 } else { 7037 7038 // Not inside a form, check all inputs that also are not inside a form 7039 group = $( nameSelector ).filter( function() { 7040 return $( this )._form().length === 0; 7041 } ); 7042 } 7043 7044 return group.not( this.element ); 7045 }, 7046 7047 _toggleClasses: function() { 7048 var checked = this.element[ 0 ].checked; 7049 this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); 7050 7051 if ( this.options.icon && this.type === "checkbox" ) { 7052 this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked ) 7053 ._toggleClass( this.icon, null, "ui-icon-blank", !checked ); 7054 } 7055 7056 if ( this.type === "radio" ) { 7057 this._getRadioGroup() 7058 .each( function() { 7059 var instance = $( this ).checkboxradio( "instance" ); 7060 7061 if ( instance ) { 7062 instance._removeClass( instance.label, 7063 "ui-checkboxradio-checked", "ui-state-active" ); 7064 } 7065 } ); 7066 } 7067 }, 7068 7069 _destroy: function() { 7070 this._unbindFormResetHandler(); 7071 7072 if ( this.icon ) { 7073 this.icon.remove();
vendor: 4,657 bytes, lines 7074-7246
7074 this.iconSpace.remove(); 7075 } 7076 }, 7077 7078 _setOption: function( key, value ) { 7079 7080 // We don't allow the value to be set to nothing 7081 if ( key === "label" && !value ) { 7082 return; 7083 } 7084 7085 this._super( key, value ); 7086 7087 if ( key === "disabled" ) { 7088 this._toggleClass( this.label, null, "ui-state-disabled", value ); 7089 this.element[ 0 ].disabled = value; 7090 7091 // Don't refresh when setting disabled 7092 return; 7093 } 7094 this.refresh(); 7095 }, 7096 7097 _updateIcon: function( checked ) { 7098 var toAdd = "ui-icon ui-icon-background "; 7099 7100 if ( this.options.icon ) { 7101 if ( !this.icon ) { 7102 this.icon = $( "<span>" ); 7103 this.iconSpace = $( "<span> </span>" ); 7104 this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" ); 7105 } 7106 7107 if ( this.type === "checkbox" ) { 7108 toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank"; 7109 this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" ); 7110 } else { 7111 toAdd += "ui-icon-blank"; 7112 } 7113 this._addClass( this.icon, "ui-checkboxradio-icon", toAdd ); 7114 if ( !checked ) { 7115 this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" ); 7116 } 7117 this.icon.prependTo( this.label ).after( this.iconSpace ); 7118 } else if ( this.icon !== undefined ) { 7119 this.icon.remove(); 7120 this.iconSpace.remove(); 7121 delete this.icon; 7122 } 7123 }, 7124 7125 _updateLabel: function() { 7126 7127 // Remove the contents of the label ( minus the icon, icon space, and input ) 7128 var contents = this.label.contents().not( this.element[ 0 ] ); 7129 if ( this.icon ) { 7130 contents = contents.not( this.icon[ 0 ] ); 7131 } 7132 if ( this.iconSpace ) { 7133 contents = contents.not( this.iconSpace[ 0 ] ); 7134 } 7135 contents.remove(); 7136 7137 this.label.append( this.options.label ); 7138 }, 7139 7140 refresh: function() { 7141 var checked = this.element[ 0 ].checked, 7142 isDisabled = this.element[ 0 ].disabled; 7143 7144 this._updateIcon( checked ); 7145 this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); 7146 if ( this.options.label !== null ) { 7147 this._updateLabel(); 7148 } 7149 7150 if ( isDisabled !== this.options.disabled ) { 7151 this._setOptions( { "disabled": isDisabled } ); 7152 } 7153 } 7154 7155} ] ); 7156 7157var widgetsCheckboxradio = $.ui.checkboxradio; 7158 7159 7160/*! 7161 * jQuery UI Button 1.13.2 7162 * http://jqueryui.com 7163 * 7164 * Copyright jQuery Foundation and other contributors 7165 * Released under the MIT license. 7166 * http://jquery.org/license 7167 */ 7168 7169//>>label: Button 7170//>>group: Widgets 7171//>>description: Enhances a form with themeable buttons. 7172//>>docs: http://api.jqueryui.com/button/ 7173//>>demos: http://jqueryui.com/button/ 7174//>>css.structure: ../../themes/base/core.css 7175//>>css.structure: ../../themes/base/button.css 7176//>>css.theme: ../../themes/base/theme.css 7177 7178 7179$.widget( "ui.button", { 7180 version: "1.13.2", 7181 defaultElement: "<button>", 7182 options: { 7183 classes: { 7184 "ui-button": "ui-corner-all" 7185 }, 7186 disabled: null, 7187 icon: null, 7188 iconPosition: "beginning", 7189 label: null, 7190 showLabel: true 7191 }, 7192 7193 _getCreateOptions: function() { 7194 var disabled, 7195 7196 // This is to support cases like in jQuery Mobile where the base widget does have 7197 // an implementation of _getCreateOptions 7198 options = this._super() || {}; 7199 7200 this.isInput = this.element.is( "input" ); 7201 7202 disabled = this.element[ 0 ].disabled; 7203 if ( disabled != null ) { 7204 options.disabled = disabled; 7205 } 7206 7207 this.originalLabel = this.isInput ? this.element.val() : this.element.html(); 7208 if ( this.originalLabel ) { 7209 options.label = this.originalLabel; 7210 } 7211 7212 return options; 7213 }, 7214 7215 _create: function() { 7216 if ( !this.option.showLabel & !this.options.icon ) { 7217 this.options.showLabel = true; 7218 } 7219 7220 // We have to check the option again here even though we did in _getCreateOptions, 7221 // because null may have been passed on init which would override what was set in 7222 // _getCreateOptions 7223 if ( this.options.disabled == null ) { 7224 this.options.disabled = this.element[ 0 ].disabled || false; 7225 } 7226 7227 this.hasTitle = !!this.element.attr( "title" ); 7228 7229 // Check to see if the label needs to be set or if its already correct 7230 if ( this.options.label && this.options.label !== this.originalLabel ) { 7231 if ( this.isInput ) { 7232 this.element.val( this.options.label ); 7233 } else { 7234 this.element.html( this.options.label ); 7235 } 7236 } 7237 this._addClass( "ui-button", "ui-widget" ); 7238 this._setOption( "disabled", this.options.disabled ); 7239 this._enhance(); 7240 7241 if ( this.element.is( "a" ) ) { 7242 this._on( { 7243 "keyup": function( event ) { 7244 if ( event.keyCode === $.ui.keyCode.SPACE ) { 7245 event.preventDefault(); 7246
vendor: 8,360 bytes, lines 7247-7547
7247 // Support: PhantomJS <= 1.9, IE 8 Only 7248 // If a native click is available use it so we actually cause navigation 7249 // otherwise just trigger a click event 7250 if ( this.element[ 0 ].click ) { 7251 this.element[ 0 ].click(); 7252 } else { 7253 this.element.trigger( "click" ); 7254 } 7255 } 7256 } 7257 } ); 7258 } 7259 }, 7260 7261 _enhance: function() { 7262 if ( !this.element.is( "button" ) ) { 7263 this.element.attr( "role", "button" ); 7264 } 7265 7266 if ( this.options.icon ) { 7267 this._updateIcon( "icon", this.options.icon ); 7268 this._updateTooltip(); 7269 } 7270 }, 7271 7272 _updateTooltip: function() { 7273 this.title = this.element.attr( "title" ); 7274 7275 if ( !this.options.showLabel && !this.title ) { 7276 this.element.attr( "title", this.options.label ); 7277 } 7278 }, 7279 7280 _updateIcon: function( option, value ) { 7281 var icon = option !== "iconPosition", 7282 position = icon ? this.options.iconPosition : value, 7283 displayBlock = position === "top" || position === "bottom"; 7284 7285 // Create icon 7286 if ( !this.icon ) { 7287 this.icon = $( "<span>" ); 7288 7289 this._addClass( this.icon, "ui-button-icon", "ui-icon" ); 7290 7291 if ( !this.options.showLabel ) { 7292 this._addClass( "ui-button-icon-only" ); 7293 } 7294 } else if ( icon ) { 7295 7296 // If we are updating the icon remove the old icon class 7297 this._removeClass( this.icon, null, this.options.icon ); 7298 } 7299 7300 // If we are updating the icon add the new icon class 7301 if ( icon ) { 7302 this._addClass( this.icon, null, value ); 7303 } 7304 7305 this._attachIcon( position ); 7306 7307 // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove 7308 // the iconSpace if there is one. 7309 if ( displayBlock ) { 7310 this._addClass( this.icon, null, "ui-widget-icon-block" ); 7311 if ( this.iconSpace ) { 7312 this.iconSpace.remove(); 7313 } 7314 } else { 7315 7316 // Position is beginning or end so remove the ui-widget-icon-block class and add the 7317 // space if it does not exist 7318 if ( !this.iconSpace ) { 7319 this.iconSpace = $( "<span> </span>" ); 7320 this._addClass( this.iconSpace, "ui-button-icon-space" ); 7321 } 7322 this._removeClass( this.icon, null, "ui-wiget-icon-block" ); 7323 this._attachIconSpace( position ); 7324 } 7325 }, 7326 7327 _destroy: function() { 7328 this.element.removeAttr( "role" ); 7329 7330 if ( this.icon ) { 7331 this.icon.remove(); 7332 } 7333 if ( this.iconSpace ) { 7334 this.iconSpace.remove(); 7335 } 7336 if ( !this.hasTitle ) { 7337 this.element.removeAttr( "title" ); 7338 } 7339 }, 7340 7341 _attachIconSpace: function( iconPosition ) { 7342 this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace ); 7343 }, 7344 7345 _attachIcon: function( iconPosition ) { 7346 this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon ); 7347 }, 7348 7349 _setOptions: function( options ) { 7350 var newShowLabel = options.showLabel === undefined ? 7351 this.options.showLabel : 7352 options.showLabel, 7353 newIcon = options.icon === undefined ? this.options.icon : options.icon; 7354 7355 if ( !newShowLabel && !newIcon ) { 7356 options.showLabel = true; 7357 } 7358 this._super( options ); 7359 }, 7360 7361 _setOption: function( key, value ) { 7362 if ( key === "icon" ) { 7363 if ( value ) { 7364 this._updateIcon( key, value ); 7365 } else if ( this.icon ) { 7366 this.icon.remove(); 7367 if ( this.iconSpace ) { 7368 this.iconSpace.remove(); 7369 } 7370 } 7371 } 7372 7373 if ( key === "iconPosition" ) { 7374 this._updateIcon( key, value ); 7375 } 7376 7377 // Make sure we can't end up with a button that has neither text nor icon 7378 if ( key === "showLabel" ) { 7379 this._toggleClass( "ui-button-icon-only", null, !value ); 7380 this._updateTooltip(); 7381 } 7382 7383 if ( key === "label" ) { 7384 if ( this.isInput ) { 7385 this.element.val( value ); 7386 } else { 7387 7388 // If there is an icon, append it, else nothing then append the value 7389 // this avoids removal of the icon when setting label text 7390 this.element.html( value ); 7391 if ( this.icon ) { 7392 this._attachIcon( this.options.iconPosition ); 7393 this._attachIconSpace( this.options.iconPosition ); 7394 } 7395 } 7396 } 7397 7398 this._super( key, value ); 7399 7400 if ( key === "disabled" ) { 7401 this._toggleClass( null, "ui-state-disabled", value ); 7402 this.element[ 0 ].disabled = value; 7403 if ( value ) { 7404 this.element.trigger( "blur" ); 7405 } 7406 } 7407 }, 7408 7409 refresh: function() { 7410 7411 // Make sure to only check disabled if its an element that supports this otherwise 7412 // check for the disabled class to determine state 7413 var isDisabled = this.element.is( "input, button" ) ? 7414 this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" ); 7415 7416 if ( isDisabled !== this.options.disabled ) { 7417 this._setOptions( { disabled: isDisabled } ); 7418 } 7419 7420 this._updateTooltip(); 7421 } 7422} ); 7423 7424// DEPRECATED 7425if ( $.uiBackCompat !== false ) { 7426 7427 // Text and Icons options 7428 $.widget( "ui.button", $.ui.button, { 7429 options: { 7430 text: true, 7431 icons: { 7432 primary: null, 7433 secondary: null 7434 } 7435 }, 7436 7437 _create: function() { 7438 if ( this.options.showLabel && !this.options.text ) { 7439 this.options.showLabel = this.options.text; 7440 } 7441 if ( !this.options.showLabel && this.options.text ) { 7442 this.options.text = this.options.showLabel; 7443 } 7444 if ( !this.options.icon && ( this.options.icons.primary || 7445 this.options.icons.secondary ) ) { 7446 if ( this.options.icons.primary ) { 7447 this.options.icon = this.options.icons.primary; 7448 } else { 7449 this.options.icon = this.options.icons.secondary; 7450 this.options.iconPosition = "end"; 7451 } 7452 } else if ( this.options.icon ) { 7453 this.options.icons.primary = this.options.icon; 7454 } 7455 this._super(); 7456 }, 7457 7458 _setOption: function( key, value ) { 7459 if ( key === "text" ) { 7460 this._super( "showLabel", value ); 7461 return; 7462 } 7463 if ( key === "showLabel" ) { 7464 this.options.text = value; 7465 } 7466 if ( key === "icon" ) { 7467 this.options.icons.primary = value; 7468 } 7469 if ( key === "icons" ) { 7470 if ( value.primary ) { 7471 this._super( "icon", value.primary ); 7472 this._super( "iconPosition", "beginning" ); 7473 } else if ( value.secondary ) { 7474 this._super( "icon", value.secondary ); 7475 this._super( "iconPosition", "end" ); 7476 } 7477 } 7478 this._superApply( arguments ); 7479 } 7480 } ); 7481 7482 $.fn.button = ( function( orig ) { 7483 return function( options ) { 7484 var isMethodCall = typeof options === "string"; 7485 var args = Array.prototype.slice.call( arguments, 1 ); 7486 var returnValue = this; 7487 7488 if ( isMethodCall ) { 7489 7490 // If this is an empty collection, we need to have the instance method 7491 // return undefined instead of the jQuery instance 7492 if ( !this.length && options === "instance" ) { 7493 returnValue = undefined; 7494 } else { 7495 this.each( function() { 7496 var methodValue; 7497 var type = $( this ).attr( "type" ); 7498 var name = type !== "checkbox" && type !== "radio" ? 7499 "button" : 7500 "checkboxradio"; 7501 var instance = $.data( this, "ui-" + name ); 7502 7503 if ( options === "instance" ) { 7504 returnValue = instance; 7505 return false; 7506 } 7507 7508 if ( !instance ) { 7509 return $.error( "cannot call methods on button" + 7510 " prior to initialization; " + 7511 "attempted to call method '" + options + "'" ); 7512 } 7513 7514 if ( typeof instance[ options ] !== "function" || 7515 options.charAt( 0 ) === "_" ) { 7516 return $.error( "no such method '" + options + "' for button" + 7517 " widget instance" ); 7518 } 7519 7520 methodValue = instance[ options ].apply( instance, args ); 7521 7522 if ( methodValue !== instance && methodValue !== undefined ) { 7523 returnValue = methodValue && methodValue.jquery ? 7524 returnValue.pushStack( methodValue.get() ) : 7525 methodValue; 7526 return false; 7527 } 7528 } ); 7529 } 7530 } else { 7531 7532 // Allow multiple hashes to be passed on init 7533 if ( args.length ) { 7534 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 7535 } 7536 7537 this.each( function() { 7538 var type = $( this ).attr( "type" ); 7539 var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio"; 7540 var instance = $.data( this, "ui-" + name ); 7541 7542 if ( instance ) { 7543 instance.option( options || {} ); 7544 if ( instance._init ) { 7545 instance._init(); 7546 } 7547 } else {
vendor: 19,025 bytes, lines 7548-7992
7548 if ( name === "button" ) { 7549 orig.call( $( this ), options ); 7550 return; 7551 } 7552 7553 $( this ).checkboxradio( $.extend( { icon: false }, options ) ); 7554 } 7555 } ); 7556 } 7557 7558 return returnValue; 7559 }; 7560 } )( $.fn.button ); 7561 7562 $.fn.buttonset = function() { 7563 if ( !$.ui.controlgroup ) { 7564 $.error( "Controlgroup widget missing" ); 7565 } 7566 if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) { 7567 return this.controlgroup.apply( this, 7568 [ arguments[ 0 ], "items.button", arguments[ 2 ] ] ); 7569 } 7570 if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) { 7571 return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] ); 7572 } 7573 if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) { 7574 arguments[ 0 ].items = { 7575 button: arguments[ 0 ].items 7576 }; 7577 } 7578 return this.controlgroup.apply( this, arguments ); 7579 }; 7580} 7581 7582var widgetsButton = $.ui.button; 7583 7584 7585/* eslint-disable max-len, camelcase */ 7586/*! 7587 * jQuery UI Datepicker 1.13.2 7588 * http://jqueryui.com 7589 * 7590 * Copyright jQuery Foundation and other contributors 7591 * Released under the MIT license. 7592 * http://jquery.org/license 7593 */ 7594 7595//>>label: Datepicker 7596//>>group: Widgets 7597//>>description: Displays a calendar from an input or inline for selecting dates. 7598//>>docs: http://api.jqueryui.com/datepicker/ 7599//>>demos: http://jqueryui.com/datepicker/ 7600//>>css.structure: ../../themes/base/core.css 7601//>>css.structure: ../../themes/base/datepicker.css 7602//>>css.theme: ../../themes/base/theme.css 7603 7604 7605$.extend( $.ui, { datepicker: { version: "1.13.2" } } ); 7606 7607var datepicker_instActive; 7608 7609function datepicker_getZindex( elem ) { 7610 var position, value; 7611 while ( elem.length && elem[ 0 ] !== document ) { 7612 7613 // Ignore z-index if position is set to a value where z-index is ignored by the browser 7614 // This makes behavior of this function consistent across browsers 7615 // WebKit always returns auto if the element is positioned 7616 position = elem.css( "position" ); 7617 if ( position === "absolute" || position === "relative" || position === "fixed" ) { 7618 7619 // IE returns 0 when zIndex is not specified 7620 // other browsers return a string 7621 // we ignore the case of nested elements with an explicit value of 0 7622 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> 7623 value = parseInt( elem.css( "zIndex" ), 10 ); 7624 if ( !isNaN( value ) && value !== 0 ) { 7625 return value; 7626 } 7627 } 7628 elem = elem.parent(); 7629 } 7630 7631 return 0; 7632} 7633 7634/* Date picker manager. 7635 Use the singleton instance of this class, $.datepicker, to interact with the date picker. 7636 Settings for (groups of) date pickers are maintained in an instance object, 7637 allowing multiple different settings on the same page. */ 7638 7639function Datepicker() { 7640 this._curInst = null; // The current instance in use 7641 this._keyEvent = false; // If the last event was a key event 7642 this._disabledInputs = []; // List of date picker inputs that have been disabled 7643 this._datepickerShowing = false; // True if the popup picker is showing , false if not 7644 this._inDialog = false; // True if showing within a "dialog", false if not 7645 this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division 7646 this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class 7647 this._appendClass = "ui-datepicker-append"; // The name of the append marker class 7648 this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class 7649 this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class 7650 this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class 7651 this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class 7652 this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class 7653 this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class 7654 this.regional = []; // Available regional settings, indexed by language code 7655 this.regional[ "" ] = { // Default regional settings 7656 closeText: "Done", // Display text for close link 7657 prevText: "Prev", // Display text for previous month link 7658 nextText: "Next", // Display text for next month link 7659 currentText: "Today", // Display text for current month link 7660 monthNames: [ "January", "February", "March", "April", "May", "June", 7661 "July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting 7662 monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting 7663 dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting 7664 dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting 7665 dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday 7666 weekHeader: "Wk", // Column header for week of the year 7667 dateFormat: "mm/dd/yy", // See format options on parseDate 7668 firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... 7669 isRTL: false, // True if right-to-left language, false if left-to-right 7670 showMonthAfterYear: false, // True if the year select precedes month, false for month then year 7671 yearSuffix: "", // Additional text to append to the year in the month headers, 7672 selectMonthLabel: "Select month", // Invisible label for month selector 7673 selectYearLabel: "Select year" // Invisible label for year selector 7674 }; 7675 this._defaults = { // Global defaults for all the date picker instances 7676 showOn: "focus", // "focus" for popup on focus, 7677 // "button" for trigger button, or "both" for either 7678 showAnim: "fadeIn", // Name of jQuery animation for popup 7679 showOptions: {}, // Options for enhanced animations 7680 defaultDate: null, // Used when field is blank: actual date, 7681 // +/-number for offset from today, null for today 7682 appendText: "", // Display text following the input box, e.g. showing the format 7683 buttonText: "...", // Text for trigger button 7684 buttonImage: "", // URL for trigger button image 7685 buttonImageOnly: false, // True if the image appears alone, false if it appears on a button 7686 hideIfNoPrevNext: false, // True to hide next/previous month links 7687 // if not applicable, false to just disable them 7688 navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links 7689 gotoCurrent: false, // True if today link goes back to current selection instead 7690 changeMonth: false, // True if month can be selected directly, false if only prev/next 7691 changeYear: false, // True if year can be selected directly, false if only prev/next 7692 yearRange: "c-10:c+10", // Range of years to display in drop-down, 7693 // either relative to today's year (-nn:+nn), relative to currently displayed year 7694 // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) 7695 showOtherMonths: false, // True to show dates in other months, false to leave blank 7696 selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable 7697 showWeek: false, // True to show week of the year, false to not show it 7698 calculateWeek: this.iso8601Week, // How to calculate the week of the year, 7699 // takes a Date and returns the number of the week for it 7700 shortYearCutoff: "+10", // Short year values < this are in the current century, 7701 // > this are in the previous century, 7702 // string value starting with "+" for current year + value 7703 minDate: null, // The earliest selectable date, or null for no limit 7704 maxDate: null, // The latest selectable date, or null for no limit 7705 duration: "fast", // Duration of display/closure 7706 beforeShowDay: null, // Function that takes a date and returns an array with 7707 // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "", 7708 // [2] = cell title (optional), e.g. $.datepicker.noWeekends 7709 beforeShow: null, // Function that takes an input field and 7710 // returns a set of custom settings for the date picker 7711 onSelect: null, // Define a callback function when a date is selected 7712 onChangeMonthYear: null, // Define a callback function when the month or year is changed 7713 onClose: null, // Define a callback function when the datepicker is closed 7714 onUpdateDatepicker: null, // Define a callback function when the datepicker is updated 7715 numberOfMonths: 1, // Number of months to show at a time 7716 showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) 7717 stepMonths: 1, // Number of months to step back/forward 7718 stepBigMonths: 12, // Number of months to step back/forward for the big links 7719 altField: "", // Selector for an alternate field to store selected dates into 7720 altFormat: "", // The date format to use for the alternate field 7721 constrainInput: true, // The input is constrained by the current date format 7722 showButtonPanel: false, // True to show button panel, false to not show it 7723 autoSize: false, // True to size the input for the date format, false to leave as is 7724 disabled: false // The initial disabled state 7725 }; 7726 $.extend( this._defaults, this.regional[ "" ] ); 7727 this.regional.en = $.extend( true, {}, this.regional[ "" ] ); 7728 this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en ); 7729 this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ); 7730} 7731 7732$.extend( Datepicker.prototype, { 7733 7734 /* Class name added to elements to indicate already configured with a date picker. */ 7735 markerClassName: "hasDatepicker", 7736 7737 //Keep track of the maximum number of rows displayed (see #7043) 7738 maxRows: 4, 7739 7740 // TODO rename to "widget" when switching to widget factory 7741 _widgetDatepicker: function() { 7742 return this.dpDiv; 7743 }, 7744 7745 /* Override the default settings for all instances of the date picker. 7746 * @param settings object - the new settings to use as defaults (anonymous object) 7747 * @return the manager object 7748 */ 7749 setDefaults: function( settings ) { 7750 datepicker_extendRemove( this._defaults, settings || {} ); 7751 return this; 7752 }, 7753 7754 /* Attach the date picker to a jQuery selection. 7755 * @param target element - the target input field or division or span 7756 * @param settings object - the new settings to use for this date picker instance (anonymous) 7757 */ 7758 _attachDatepicker: function( target, settings ) { 7759 var nodeName, inline, inst; 7760 nodeName = target.nodeName.toLowerCase(); 7761 inline = ( nodeName === "div" || nodeName === "span" ); 7762 if ( !target.id ) { 7763 this.uuid += 1; 7764 target.id = "dp" + this.uuid; 7765 } 7766 inst = this._newInst( $( target ), inline ); 7767 inst.settings = $.extend( {}, settings || {} ); 7768 if ( nodeName === "input" ) { 7769 this._connectDatepicker( target, inst ); 7770 } else if ( inline ) { 7771 this._inlineDatepicker( target, inst ); 7772 } 7773 }, 7774 7775 /* Create a new instance object. */ 7776 _newInst: function( target, inline ) { 7777 var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars 7778 return { id: id, input: target, // associated target 7779 selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection 7780 drawMonth: 0, drawYear: 0, // month being drawn 7781 inline: inline, // is datepicker inline or not 7782 dpDiv: ( !inline ? this.dpDiv : // presentation div 7783 datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) }; 7784 }, 7785 7786 /* Attach the date picker to an input field. */ 7787 _connectDatepicker: function( target, inst ) { 7788 var input = $( target ); 7789 inst.append = $( [] ); 7790 inst.trigger = $( [] ); 7791 if ( input.hasClass( this.markerClassName ) ) { 7792 return; 7793 } 7794 this._attachments( input, inst ); 7795 input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ). 7796 on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp ); 7797 this._autoSize( inst ); 7798 $.data( target, "datepicker", inst ); 7799 7800 //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) 7801 if ( inst.settings.disabled ) { 7802 this._disableDatepicker( target ); 7803 } 7804 }, 7805 7806 /* Make attachments based on settings. */ 7807 _attachments: function( input, inst ) { 7808 var showOn, buttonText, buttonImage, 7809 appendText = this._get( inst, "appendText" ), 7810 isRTL = this._get( inst, "isRTL" ); 7811 7812 if ( inst.append ) { 7813 inst.append.remove(); 7814 } 7815 if ( appendText ) { 7816 inst.append = $( "<span>" ) 7817 .addClass( this._appendClass ) 7818 .text( appendText ); 7819 input[ isRTL ? "before" : "after" ]( inst.append ); 7820 } 7821 7822 input.off( "focus", this._showDatepicker ); 7823 7824 if ( inst.trigger ) { 7825 inst.trigger.remove(); 7826 } 7827 7828 showOn = this._get( inst, "showOn" ); 7829 if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field 7830 input.on( "focus", this._showDatepicker ); 7831 } 7832 if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked 7833 buttonText = this._get( inst, "buttonText" ); 7834 buttonImage = this._get( inst, "buttonImage" ); 7835 7836 if ( this._get( inst, "buttonImageOnly" ) ) { 7837 inst.trigger = $( "<img>" ) 7838 .addClass( this._triggerClass ) 7839 .attr( { 7840 src: buttonImage, 7841 alt: buttonText, 7842 title: buttonText 7843 } ); 7844 } else { 7845 inst.trigger = $( "<button type='button'>" ) 7846 .addClass( this._triggerClass ); 7847 if ( buttonImage ) { 7848 inst.trigger.html( 7849 $( "<img>" ) 7850 .attr( { 7851 src: buttonImage, 7852 alt: buttonText, 7853 title: buttonText 7854 } ) 7855 ); 7856 } else { 7857 inst.trigger.text( buttonText ); 7858 } 7859 } 7860 7861 input[ isRTL ? "before" : "after" ]( inst.trigger ); 7862 inst.trigger.on( "click", function() { 7863 if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) { 7864 $.datepicker._hideDatepicker(); 7865 } else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) { 7866 $.datepicker._hideDatepicker(); 7867 $.datepicker._showDatepicker( input[ 0 ] ); 7868 } else { 7869 $.datepicker._showDatepicker( input[ 0 ] ); 7870 } 7871 return false; 7872 } ); 7873 } 7874 }, 7875 7876 /* Apply the maximum length for the date format. */ 7877 _autoSize: function( inst ) { 7878 if ( this._get( inst, "autoSize" ) && !inst.inline ) { 7879 var findMax, max, maxI, i, 7880 date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits 7881 dateFormat = this._get( inst, "dateFormat" ); 7882 7883 if ( dateFormat.match( /[DM]/ ) ) { 7884 findMax = function( names ) { 7885 max = 0; 7886 maxI = 0; 7887 for ( i = 0; i < names.length; i++ ) { 7888 if ( names[ i ].length > max ) { 7889 max = names[ i ].length; 7890 maxI = i; 7891 } 7892 } 7893 return maxI; 7894 }; 7895 date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ? 7896 "monthNames" : "monthNamesShort" ) ) ) ); 7897 date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ? 7898 "dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() ); 7899 } 7900 inst.input.attr( "size", this._formatDate( inst, date ).length ); 7901 } 7902 }, 7903 7904 /* Attach an inline date picker to a div. */ 7905 _inlineDatepicker: function( target, inst ) { 7906 var divSpan = $( target ); 7907 if ( divSpan.hasClass( this.markerClassName ) ) { 7908 return; 7909 } 7910 divSpan.addClass( this.markerClassName ).append( inst.dpDiv ); 7911 $.data( target, "datepicker", inst ); 7912 this._setDate( inst, this._getDefaultDate( inst ), true ); 7913 this._updateDatepicker( inst ); 7914 this._updateAlternate( inst ); 7915 7916 //If disabled option is true, disable the datepicker before showing it (see ticket #5665) 7917 if ( inst.settings.disabled ) { 7918 this._disableDatepicker( target ); 7919 } 7920 7921 // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements 7922 // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height 7923 inst.dpDiv.css( "display", "block" ); 7924 }, 7925 7926 /* Pop-up the date picker in a "dialog" box. 7927 * @param input element - ignored 7928 * @param date string or Date - the initial date to display 7929 * @param onSelect function - the function to call when a date is selected 7930 * @param settings object - update the dialog date picker instance's settings (anonymous object) 7931 * @param pos int[2] - coordinates for the dialog's position within the screen or 7932 * event - with x/y coordinates or 7933 * leave empty for default (screen centre) 7934 * @return the manager object 7935 */ 7936 _dialogDatepicker: function( input, date, onSelect, settings, pos ) { 7937 var id, browserWidth, browserHeight, scrollX, scrollY, 7938 inst = this._dialogInst; // internal instance 7939 7940 if ( !inst ) { 7941 this.uuid += 1; 7942 id = "dp" + this.uuid; 7943 this._dialogInput = $( "<input type='text' id='" + id + 7944 "' style='position: absolute; top: -100px; width: 0px;'/>" ); 7945 this._dialogInput.on( "keydown", this._doKeyDown ); 7946 $( "body" ).append( this._dialogInput ); 7947 inst = this._dialogInst = this._newInst( this._dialogInput, false ); 7948 inst.settings = {}; 7949 $.data( this._dialogInput[ 0 ], "datepicker", inst ); 7950 } 7951 datepicker_extendRemove( inst.settings, settings || {} ); 7952 date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date ); 7953 this._dialogInput.val( date ); 7954 7955 this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null ); 7956 if ( !this._pos ) { 7957 browserWidth = document.documentElement.clientWidth; 7958 browserHeight = document.documentElement.clientHeight; 7959 scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 7960 scrollY = document.documentElement.scrollTop || document.body.scrollTop; 7961 this._pos = // should use actual width/height below 7962 [ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ]; 7963 } 7964 7965 // Move input on screen for focus, but hidden behind dialog 7966 this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" ); 7967 inst.settings.onSelect = onSelect; 7968 this._inDialog = true; 7969 this.dpDiv.addClass( this._dialogClass ); 7970 this._showDatepicker( this._dialogInput[ 0 ] ); 7971 if ( $.blockUI ) { 7972 $.blockUI( this.dpDiv ); 7973 } 7974 $.data( this._dialogInput[ 0 ], "datepicker", inst ); 7975 return this; 7976 }, 7977 7978 /* Detach a datepicker from its control. 7979 * @param target element - the target input field or division or span 7980 */ 7981 _destroyDatepicker: function( target ) { 7982 var nodeName, 7983 $target = $( target ), 7984 inst = $.data( target, "datepicker" ); 7985 7986 if ( !$target.hasClass( this.markerClassName ) ) { 7987 return; 7988 } 7989 7990 nodeName = target.nodeName.toLowerCase(); 7991 $.removeData( target, "datepicker" ); 7992 if ( nodeName === "input" ) {
vendor: 12,182 bytes, lines 7993-8344
7993 inst.append.remove(); 7994 inst.trigger.remove(); 7995 $target.removeClass( this.markerClassName ). 7996 off( "focus", this._showDatepicker ). 7997 off( "keydown", this._doKeyDown ). 7998 off( "keypress", this._doKeyPress ). 7999 off( "keyup", this._doKeyUp ); 8000 } else if ( nodeName === "div" || nodeName === "span" ) { 8001 $target.removeClass( this.markerClassName ).empty(); 8002 } 8003 8004 if ( datepicker_instActive === inst ) { 8005 datepicker_instActive = null; 8006 this._curInst = null; 8007 } 8008 }, 8009 8010 /* Enable the date picker to a jQuery selection. 8011 * @param target element - the target input field or division or span 8012 */ 8013 _enableDatepicker: function( target ) { 8014 var nodeName, inline, 8015 $target = $( target ), 8016 inst = $.data( target, "datepicker" ); 8017 8018 if ( !$target.hasClass( this.markerClassName ) ) { 8019 return; 8020 } 8021 8022 nodeName = target.nodeName.toLowerCase(); 8023 if ( nodeName === "input" ) { 8024 target.disabled = false; 8025 inst.trigger.filter( "button" ). 8026 each( function() { 8027 this.disabled = false; 8028 } ).end(). 8029 filter( "img" ).css( { opacity: "1.0", cursor: "" } ); 8030 } else if ( nodeName === "div" || nodeName === "span" ) { 8031 inline = $target.children( "." + this._inlineClass ); 8032 inline.children().removeClass( "ui-state-disabled" ); 8033 inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). 8034 prop( "disabled", false ); 8035 } 8036 this._disabledInputs = $.map( this._disabledInputs, 8037 8038 // Delete entry 8039 function( value ) { 8040 return ( value === target ? null : value ); 8041 } ); 8042 }, 8043 8044 /* Disable the date picker to a jQuery selection. 8045 * @param target element - the target input field or division or span 8046 */ 8047 _disableDatepicker: function( target ) { 8048 var nodeName, inline, 8049 $target = $( target ), 8050 inst = $.data( target, "datepicker" ); 8051 8052 if ( !$target.hasClass( this.markerClassName ) ) { 8053 return; 8054 } 8055 8056 nodeName = target.nodeName.toLowerCase(); 8057 if ( nodeName === "input" ) { 8058 target.disabled = true; 8059 inst.trigger.filter( "button" ). 8060 each( function() { 8061 this.disabled = true; 8062 } ).end(). 8063 filter( "img" ).css( { opacity: "0.5", cursor: "default" } ); 8064 } else if ( nodeName === "div" || nodeName === "span" ) { 8065 inline = $target.children( "." + this._inlineClass ); 8066 inline.children().addClass( "ui-state-disabled" ); 8067 inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). 8068 prop( "disabled", true ); 8069 } 8070 this._disabledInputs = $.map( this._disabledInputs, 8071 8072 // Delete entry 8073 function( value ) { 8074 return ( value === target ? null : value ); 8075 } ); 8076 this._disabledInputs[ this._disabledInputs.length ] = target; 8077 }, 8078 8079 /* Is the first field in a jQuery collection disabled as a datepicker? 8080 * @param target element - the target input field or division or span 8081 * @return boolean - true if disabled, false if enabled 8082 */ 8083 _isDisabledDatepicker: function( target ) { 8084 if ( !target ) { 8085 return false; 8086 } 8087 for ( var i = 0; i < this._disabledInputs.length; i++ ) { 8088 if ( this._disabledInputs[ i ] === target ) { 8089 return true; 8090 } 8091 } 8092 return false; 8093 }, 8094 8095 /* Retrieve the instance data for the target control. 8096 * @param target element - the target input field or division or span 8097 * @return object - the associated instance data 8098 * @throws error if a jQuery problem getting data 8099 */ 8100 _getInst: function( target ) { 8101 try { 8102 return $.data( target, "datepicker" ); 8103 } catch ( err ) { 8104 throw "Missing instance data for this datepicker"; 8105 } 8106 }, 8107 8108 /* Update or retrieve the settings for a date picker attached to an input field or division. 8109 * @param target element - the target input field or division or span 8110 * @param name object - the new settings to update or 8111 * string - the name of the setting to change or retrieve, 8112 * when retrieving also "all" for all instance settings or 8113 * "defaults" for all global defaults 8114 * @param value any - the new value for the setting 8115 * (omit if above is an object or to retrieve a value) 8116 */ 8117 _optionDatepicker: function( target, name, value ) { 8118 var settings, date, minDate, maxDate, 8119 inst = this._getInst( target ); 8120 8121 if ( arguments.length === 2 && typeof name === "string" ) { 8122 return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) : 8123 ( inst ? ( name === "all" ? $.extend( {}, inst.settings ) : 8124 this._get( inst, name ) ) : null ) ); 8125 } 8126 8127 settings = name || {}; 8128 if ( typeof name === "string" ) { 8129 settings = {}; 8130 settings[ name ] = value; 8131 } 8132 8133 if ( inst ) { 8134 if ( this._curInst === inst ) { 8135 this._hideDatepicker(); 8136 } 8137 8138 date = this._getDateDatepicker( target, true ); 8139 minDate = this._getMinMaxDate( inst, "min" ); 8140 maxDate = this._getMinMaxDate( inst, "max" ); 8141 datepicker_extendRemove( inst.settings, settings ); 8142 8143 // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided 8144 if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) { 8145 inst.settings.minDate = this._formatDate( inst, minDate ); 8146 } 8147 if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) { 8148 inst.settings.maxDate = this._formatDate( inst, maxDate ); 8149 } 8150 if ( "disabled" in settings ) { 8151 if ( settings.disabled ) { 8152 this._disableDatepicker( target ); 8153 } else { 8154 this._enableDatepicker( target ); 8155 } 8156 } 8157 this._attachments( $( target ), inst ); 8158 this._autoSize( inst ); 8159 this._setDate( inst, date ); 8160 this._updateAlternate( inst ); 8161 this._updateDatepicker( inst ); 8162 } 8163 }, 8164 8165 // Change method deprecated 8166 _changeDatepicker: function( target, name, value ) { 8167 this._optionDatepicker( target, name, value ); 8168 }, 8169 8170 /* Redraw the date picker attached to an input field or division. 8171 * @param target element - the target input field or division or span 8172 */ 8173 _refreshDatepicker: function( target ) { 8174 var inst = this._getInst( target ); 8175 if ( inst ) { 8176 this._updateDatepicker( inst ); 8177 } 8178 }, 8179 8180 /* Set the dates for a jQuery selection. 8181 * @param target element - the target input field or division or span 8182 * @param date Date - the new date 8183 */ 8184 _setDateDatepicker: function( target, date ) { 8185 var inst = this._getInst( target ); 8186 if ( inst ) { 8187 this._setDate( inst, date ); 8188 this._updateDatepicker( inst ); 8189 this._updateAlternate( inst ); 8190 } 8191 }, 8192 8193 /* Get the date(s) for the first entry in a jQuery selection. 8194 * @param target element - the target input field or division or span 8195 * @param noDefault boolean - true if no default date is to be used 8196 * @return Date - the current date 8197 */ 8198 _getDateDatepicker: function( target, noDefault ) { 8199 var inst = this._getInst( target ); 8200 if ( inst && !inst.inline ) { 8201 this._setDateFromField( inst, noDefault ); 8202 } 8203 return ( inst ? this._getDate( inst ) : null ); 8204 }, 8205 8206 /* Handle keystrokes. */ 8207 _doKeyDown: function( event ) { 8208 var onSelect, dateStr, sel, 8209 inst = $.datepicker._getInst( event.target ), 8210 handled = true, 8211 isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" ); 8212 8213 inst._keyEvent = true; 8214 if ( $.datepicker._datepickerShowing ) { 8215 switch ( event.keyCode ) { 8216 case 9: $.datepicker._hideDatepicker(); 8217 handled = false; 8218 break; // hide on tab out 8219 case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." + 8220 $.datepicker._currentClass + ")", inst.dpDiv ); 8221 if ( sel[ 0 ] ) { 8222 $.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] ); 8223 } 8224 8225 onSelect = $.datepicker._get( inst, "onSelect" ); 8226 if ( onSelect ) { 8227 dateStr = $.datepicker._formatDate( inst ); 8228 8229 // Trigger custom callback 8230 onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); 8231 } else { 8232 $.datepicker._hideDatepicker(); 8233 } 8234 8235 return false; // don't submit the form 8236 case 27: $.datepicker._hideDatepicker(); 8237 break; // hide on escape 8238 case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 8239 -$.datepicker._get( inst, "stepBigMonths" ) : 8240 -$.datepicker._get( inst, "stepMonths" ) ), "M" ); 8241 break; // previous month/year on page up/+ ctrl 8242 case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 8243 +$.datepicker._get( inst, "stepBigMonths" ) : 8244 +$.datepicker._get( inst, "stepMonths" ) ), "M" ); 8245 break; // next month/year on page down/+ ctrl 8246 case 35: if ( event.ctrlKey || event.metaKey ) { 8247 $.datepicker._clearDate( event.target ); 8248 } 8249 handled = event.ctrlKey || event.metaKey; 8250 break; // clear on ctrl or command +end 8251 case 36: if ( event.ctrlKey || event.metaKey ) { 8252 $.datepicker._gotoToday( event.target ); 8253 } 8254 handled = event.ctrlKey || event.metaKey; 8255 break; // current on ctrl or command +home 8256 case 37: if ( event.ctrlKey || event.metaKey ) { 8257 $.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" ); 8258 } 8259 handled = event.ctrlKey || event.metaKey; 8260 8261 // -1 day on ctrl or command +left 8262 if ( event.originalEvent.altKey ) { 8263 $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 8264 -$.datepicker._get( inst, "stepBigMonths" ) : 8265 -$.datepicker._get( inst, "stepMonths" ) ), "M" ); 8266 } 8267 8268 // next month/year on alt +left on Mac 8269 break; 8270 case 38: if ( event.ctrlKey || event.metaKey ) { 8271 $.datepicker._adjustDate( event.target, -7, "D" ); 8272 } 8273 handled = event.ctrlKey || event.metaKey; 8274 break; // -1 week on ctrl or command +up 8275 case 39: if ( event.ctrlKey || event.metaKey ) { 8276 $.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" ); 8277 } 8278 handled = event.ctrlKey || event.metaKey; 8279 8280 // +1 day on ctrl or command +right 8281 if ( event.originalEvent.altKey ) { 8282 $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 8283 +$.datepicker._get( inst, "stepBigMonths" ) : 8284 +$.datepicker._get( inst, "stepMonths" ) ), "M" ); 8285 } 8286 8287 // next month/year on alt +right 8288 break; 8289 case 40: if ( event.ctrlKey || event.metaKey ) { 8290 $.datepicker._adjustDate( event.target, +7, "D" ); 8291 } 8292 handled = event.ctrlKey || event.metaKey; 8293 break; // +1 week on ctrl or command +down 8294 default: handled = false; 8295 } 8296 } else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home 8297 $.datepicker._showDatepicker( this ); 8298 } else { 8299 handled = false; 8300 } 8301 8302 if ( handled ) { 8303 event.preventDefault(); 8304 event.stopPropagation(); 8305 } 8306 }, 8307 8308 /* Filter entered characters - based on date format. */ 8309 _doKeyPress: function( event ) { 8310 var chars, chr, 8311 inst = $.datepicker._getInst( event.target ); 8312 8313 if ( $.datepicker._get( inst, "constrainInput" ) ) { 8314 chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) ); 8315 chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode ); 8316 return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 ); 8317 } 8318 }, 8319 8320 /* Synchronise manual entry and field/alternate field. */ 8321 _doKeyUp: function( event ) { 8322 var date, 8323 inst = $.datepicker._getInst( event.target ); 8324 8325 if ( inst.input.val() !== inst.lastVal ) { 8326 try { 8327 date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), 8328 ( inst.input ? inst.input.val() : null ), 8329 $.datepicker._getFormatConfig( inst ) ); 8330 8331 if ( date ) { // only if valid 8332 $.datepicker._setDateFromField( inst ); 8333 $.datepicker._updateAlternate( inst ); 8334 $.datepicker._updateDatepicker( inst ); 8335 } 8336 } catch ( err ) { 8337 } 8338 } 8339 return true; 8340 }, 8341 8342 /* Pop-up the date picker for a given input field. 8343 * If false returned from beforeShow event handler do not show. 8344 * @param input element - the input field attached to the date picker or
vendor: 1,885 bytes, lines 8345-8402
8345 * event - if triggered by focus 8346 */ 8347 _showDatepicker: function( input ) { 8348 input = input.target || input; 8349 if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger 8350 input = $( "input", input.parentNode )[ 0 ]; 8351 } 8352 8353 if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here 8354 return; 8355 } 8356 8357 var inst, beforeShow, beforeShowSettings, isFixed, 8358 offset, showAnim, duration; 8359 8360 inst = $.datepicker._getInst( input ); 8361 if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) { 8362 $.datepicker._curInst.dpDiv.stop( true, true ); 8363 if ( inst && $.datepicker._datepickerShowing ) { 8364 $.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] ); 8365 } 8366 } 8367 8368 beforeShow = $.datepicker._get( inst, "beforeShow" ); 8369 beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {}; 8370 if ( beforeShowSettings === false ) { 8371 return; 8372 } 8373 datepicker_extendRemove( inst.settings, beforeShowSettings ); 8374 8375 inst.lastVal = null; 8376 $.datepicker._lastInput = input; 8377 $.datepicker._setDateFromField( inst ); 8378 8379 if ( $.datepicker._inDialog ) { // hide cursor 8380 input.value = ""; 8381 } 8382 if ( !$.datepicker._pos ) { // position below input 8383 $.datepicker._pos = $.datepicker._findPos( input ); 8384 $.datepicker._pos[ 1 ] += input.offsetHeight; // add the height 8385 } 8386 8387 isFixed = false; 8388 $( input ).parents().each( function() { 8389 isFixed |= $( this ).css( "position" ) === "fixed"; 8390 return !isFixed; 8391 } ); 8392 8393 offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] }; 8394 $.datepicker._pos = null; 8395 8396 //to avoid flashes on Firefox 8397 inst.dpDiv.empty(); 8398 8399 // determine sizing offscreen 8400 inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } ); 8401 $.datepicker._updateDatepicker( inst ); 8402
vendor: 8,237 bytes, lines 8403-8626
8403 // fix width for dynamic number of date pickers 8404 // and adjust position before showing 8405 offset = $.datepicker._checkOffset( inst, offset, isFixed ); 8406 inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ? 8407 "static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none", 8408 left: offset.left + "px", top: offset.top + "px" } ); 8409 8410 if ( !inst.inline ) { 8411 showAnim = $.datepicker._get( inst, "showAnim" ); 8412 duration = $.datepicker._get( inst, "duration" ); 8413 inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); 8414 $.datepicker._datepickerShowing = true; 8415 8416 if ( $.effects && $.effects.effect[ showAnim ] ) { 8417 inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration ); 8418 } else { 8419 inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null ); 8420 } 8421 8422 if ( $.datepicker._shouldFocusInput( inst ) ) { 8423 inst.input.trigger( "focus" ); 8424 } 8425 8426 $.datepicker._curInst = inst; 8427 } 8428 }, 8429 8430 /* Generate the date picker content. */ 8431 _updateDatepicker: function( inst ) { 8432 this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) 8433 datepicker_instActive = inst; // for delegate hover events 8434 inst.dpDiv.empty().append( this._generateHTML( inst ) ); 8435 this._attachHandlers( inst ); 8436 8437 var origyearshtml, 8438 numMonths = this._getNumberOfMonths( inst ), 8439 cols = numMonths[ 1 ], 8440 width = 17, 8441 activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ), 8442 onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" ); 8443 8444 if ( activeCell.length > 0 ) { 8445 datepicker_handleMouseover.apply( activeCell.get( 0 ) ); 8446 } 8447 8448 inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" ); 8449 if ( cols > 1 ) { 8450 inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" ); 8451 } 8452 inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) + 8453 "Class" ]( "ui-datepicker-multi" ); 8454 inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) + 8455 "Class" ]( "ui-datepicker-rtl" ); 8456 8457 if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { 8458 inst.input.trigger( "focus" ); 8459 } 8460 8461 // Deffered render of the years select (to avoid flashes on Firefox) 8462 if ( inst.yearshtml ) { 8463 origyearshtml = inst.yearshtml; 8464 setTimeout( function() { 8465 8466 //assure that inst.yearshtml didn't change. 8467 if ( origyearshtml === inst.yearshtml && inst.yearshtml ) { 8468 inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml ); 8469 } 8470 origyearshtml = inst.yearshtml = null; 8471 }, 0 ); 8472 } 8473 8474 if ( onUpdateDatepicker ) { 8475 onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] ); 8476 } 8477 }, 8478 8479 // #6694 - don't focus the input if it's already focused 8480 // this breaks the change event in IE 8481 // Support: IE and jQuery <1.9 8482 _shouldFocusInput: function( inst ) { 8483 return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); 8484 }, 8485 8486 /* Check positioning to remain on screen. */ 8487 _checkOffset: function( inst, offset, isFixed ) { 8488 var dpWidth = inst.dpDiv.outerWidth(), 8489 dpHeight = inst.dpDiv.outerHeight(), 8490 inputWidth = inst.input ? inst.input.outerWidth() : 0, 8491 inputHeight = inst.input ? inst.input.outerHeight() : 0, 8492 viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ), 8493 viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() ); 8494 8495 offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 ); 8496 offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0; 8497 offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0; 8498 8499 // Now check if datepicker is showing outside window viewport - move to a better place if so. 8500 offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ? 8501 Math.abs( offset.left + dpWidth - viewWidth ) : 0 ); 8502 offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ? 8503 Math.abs( dpHeight + inputHeight ) : 0 ); 8504 8505 return offset; 8506 }, 8507 8508 /* Find an object's position on the screen. */ 8509 _findPos: function( obj ) { 8510 var position, 8511 inst = this._getInst( obj ), 8512 isRTL = this._get( inst, "isRTL" ); 8513 8514 while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) { 8515 obj = obj[ isRTL ? "previousSibling" : "nextSibling" ]; 8516 } 8517 8518 position = $( obj ).offset(); 8519 return [ position.left, position.top ]; 8520 }, 8521 8522 /* Hide the date picker from view. 8523 * @param input element - the input field attached to the date picker 8524 */ 8525 _hideDatepicker: function( input ) { 8526 var showAnim, duration, postProcess, onClose, 8527 inst = this._curInst; 8528 8529 if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) { 8530 return; 8531 } 8532 8533 if ( this._datepickerShowing ) { 8534 showAnim = this._get( inst, "showAnim" ); 8535 duration = this._get( inst, "duration" ); 8536 postProcess = function() { 8537 $.datepicker._tidyDialog( inst ); 8538 }; 8539 8540 // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed 8541 if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { 8542 inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess ); 8543 } else { 8544 inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" : 8545 ( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess ); 8546 } 8547 8548 if ( !showAnim ) { 8549 postProcess(); 8550 } 8551 this._datepickerShowing = false; 8552 8553 onClose = this._get( inst, "onClose" ); 8554 if ( onClose ) { 8555 onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] ); 8556 } 8557 8558 this._lastInput = null; 8559 if ( this._inDialog ) { 8560 this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } ); 8561 if ( $.blockUI ) { 8562 $.unblockUI(); 8563 $( "body" ).append( this.dpDiv ); 8564 } 8565 } 8566 this._inDialog = false; 8567 } 8568 }, 8569 8570 /* Tidy up after a dialog display. */ 8571 _tidyDialog: function( inst ) { 8572 inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" ); 8573 }, 8574 8575 /* Close date picker if clicked elsewhere. */ 8576 _checkExternalClick: function( event ) { 8577 if ( !$.datepicker._curInst ) { 8578 return; 8579 } 8580 8581 var $target = $( event.target ), 8582 inst = $.datepicker._getInst( $target[ 0 ] ); 8583 8584 if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId && 8585 $target.parents( "#" + $.datepicker._mainDivId ).length === 0 && 8586 !$target.hasClass( $.datepicker.markerClassName ) && 8587 !$target.closest( "." + $.datepicker._triggerClass ).length && 8588 $.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) || 8589 ( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) { 8590 $.datepicker._hideDatepicker(); 8591 } 8592 }, 8593 8594 /* Adjust one of the date sub-fields. */ 8595 _adjustDate: function( id, offset, period ) { 8596 var target = $( id ), 8597 inst = this._getInst( target[ 0 ] ); 8598 8599 if ( this._isDisabledDatepicker( target[ 0 ] ) ) { 8600 return; 8601 } 8602 this._adjustInstDate( inst, offset, period ); 8603 this._updateDatepicker( inst ); 8604 }, 8605 8606 /* Action for current link. */ 8607 _gotoToday: function( id ) { 8608 var date, 8609 target = $( id ), 8610 inst = this._getInst( target[ 0 ] ); 8611 8612 if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) { 8613 inst.selectedDay = inst.currentDay; 8614 inst.drawMonth = inst.selectedMonth = inst.currentMonth; 8615 inst.drawYear = inst.selectedYear = inst.currentYear; 8616 } else { 8617 date = new Date(); 8618 inst.selectedDay = date.getDate(); 8619 inst.drawMonth = inst.selectedMonth = date.getMonth(); 8620 inst.drawYear = inst.selectedYear = date.getFullYear(); 8621 } 8622 this._notifyChange( inst ); 8623 this._adjustDate( target ); 8624 }, 8625 8626 /* Action for selecting a new month/year. */
vendor: 43,873 bytes, lines 8627-9797
8627 _selectMonthYear: function( id, select, period ) { 8628 var target = $( id ), 8629 inst = this._getInst( target[ 0 ] ); 8630 8631 inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] = 8632 inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] = 8633 parseInt( select.options[ select.selectedIndex ].value, 10 ); 8634 8635 this._notifyChange( inst ); 8636 this._adjustDate( target ); 8637 }, 8638 8639 /* Action for selecting a day. */ 8640 _selectDay: function( id, month, year, td ) { 8641 var inst, 8642 target = $( id ); 8643 8644 if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) { 8645 return; 8646 } 8647 8648 inst = this._getInst( target[ 0 ] ); 8649 inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) ); 8650 inst.selectedMonth = inst.currentMonth = month; 8651 inst.selectedYear = inst.currentYear = year; 8652 this._selectDate( id, this._formatDate( inst, 8653 inst.currentDay, inst.currentMonth, inst.currentYear ) ); 8654 }, 8655 8656 /* Erase the input field and hide the date picker. */ 8657 _clearDate: function( id ) { 8658 var target = $( id ); 8659 this._selectDate( target, "" ); 8660 }, 8661 8662 /* Update the input field with the selected date. */ 8663 _selectDate: function( id, dateStr ) { 8664 var onSelect, 8665 target = $( id ), 8666 inst = this._getInst( target[ 0 ] ); 8667 8668 dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) ); 8669 if ( inst.input ) { 8670 inst.input.val( dateStr ); 8671 } 8672 this._updateAlternate( inst ); 8673 8674 onSelect = this._get( inst, "onSelect" ); 8675 if ( onSelect ) { 8676 onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback 8677 } else if ( inst.input ) { 8678 inst.input.trigger( "change" ); // fire the change event 8679 } 8680 8681 if ( inst.inline ) { 8682 this._updateDatepicker( inst ); 8683 } else { 8684 this._hideDatepicker(); 8685 this._lastInput = inst.input[ 0 ]; 8686 if ( typeof( inst.input[ 0 ] ) !== "object" ) { 8687 inst.input.trigger( "focus" ); // restore focus 8688 } 8689 this._lastInput = null; 8690 } 8691 }, 8692 8693 /* Update any alternate field to synchronise with the main field. */ 8694 _updateAlternate: function( inst ) { 8695 var altFormat, date, dateStr, 8696 altField = this._get( inst, "altField" ); 8697 8698 if ( altField ) { // update alternate field too 8699 altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" ); 8700 date = this._getDate( inst ); 8701 dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); 8702 $( document ).find( altField ).val( dateStr ); 8703 } 8704 }, 8705 8706 /* Set as beforeShowDay function to prevent selection of weekends. 8707 * @param date Date - the date to customise 8708 * @return [boolean, string] - is this date selectable?, what is its CSS class? 8709 */ 8710 noWeekends: function( date ) { 8711 var day = date.getDay(); 8712 return [ ( day > 0 && day < 6 ), "" ]; 8713 }, 8714 8715 /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. 8716 * @param date Date - the date to get the week for 8717 * @return number - the number of the week within the year that contains this date 8718 */ 8719 iso8601Week: function( date ) { 8720 var time, 8721 checkDate = new Date( date.getTime() ); 8722 8723 // Find Thursday of this week starting on Monday 8724 checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) ); 8725 8726 time = checkDate.getTime(); 8727 checkDate.setMonth( 0 ); // Compare with Jan 1 8728 checkDate.setDate( 1 ); 8729 return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1; 8730 }, 8731 8732 /* Parse a string value into a date object. 8733 * See formatDate below for the possible formats. 8734 * 8735 * @param format string - the expected format of the date 8736 * @param value string - the date in the above format 8737 * @param settings Object - attributes include: 8738 * shortYearCutoff number - the cutoff year for determining the century (optional) 8739 * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) 8740 * dayNames string[7] - names of the days from Sunday (optional) 8741 * monthNamesShort string[12] - abbreviated names of the months (optional) 8742 * monthNames string[12] - names of the months (optional) 8743 * @return Date - the extracted date value or null if value is blank 8744 */ 8745 parseDate: function( format, value, settings ) { 8746 if ( format == null || value == null ) { 8747 throw "Invalid arguments"; 8748 } 8749 8750 value = ( typeof value === "object" ? value.toString() : value + "" ); 8751 if ( value === "" ) { 8752 return null; 8753 } 8754 8755 var iFormat, dim, extra, 8756 iValue = 0, 8757 shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff, 8758 shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : 8759 new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ), 8760 dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, 8761 dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, 8762 monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, 8763 monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, 8764 year = -1, 8765 month = -1, 8766 day = -1, 8767 doy = -1, 8768 literal = false, 8769 date, 8770 8771 // Check whether a format character is doubled 8772 lookAhead = function( match ) { 8773 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 8774 if ( matches ) { 8775 iFormat++; 8776 } 8777 return matches; 8778 }, 8779 8780 // Extract a number from the string value 8781 getNumber = function( match ) { 8782 var isDoubled = lookAhead( match ), 8783 size = ( match === "@" ? 14 : ( match === "!" ? 20 : 8784 ( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ), 8785 minSize = ( match === "y" ? size : 1 ), 8786 digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ), 8787 num = value.substring( iValue ).match( digits ); 8788 if ( !num ) { 8789 throw "Missing number at position " + iValue; 8790 } 8791 iValue += num[ 0 ].length; 8792 return parseInt( num[ 0 ], 10 ); 8793 }, 8794 8795 // Extract a name from the string value and convert to an index 8796 getName = function( match, shortNames, longNames ) { 8797 var index = -1, 8798 names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) { 8799 return [ [ k, v ] ]; 8800 } ).sort( function( a, b ) { 8801 return -( a[ 1 ].length - b[ 1 ].length ); 8802 } ); 8803 8804 $.each( names, function( i, pair ) { 8805 var name = pair[ 1 ]; 8806 if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) { 8807 index = pair[ 0 ]; 8808 iValue += name.length; 8809 return false; 8810 } 8811 } ); 8812 if ( index !== -1 ) { 8813 return index + 1; 8814 } else { 8815 throw "Unknown name at position " + iValue; 8816 } 8817 }, 8818 8819 // Confirm that a literal character matches the string value 8820 checkLiteral = function() { 8821 if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) { 8822 throw "Unexpected literal at position " + iValue; 8823 } 8824 iValue++; 8825 }; 8826 8827 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 8828 if ( literal ) { 8829 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 8830 literal = false; 8831 } else { 8832 checkLiteral(); 8833 } 8834 } else { 8835 switch ( format.charAt( iFormat ) ) { 8836 case "d": 8837 day = getNumber( "d" ); 8838 break; 8839 case "D": 8840 getName( "D", dayNamesShort, dayNames ); 8841 break; 8842 case "o": 8843 doy = getNumber( "o" ); 8844 break; 8845 case "m": 8846 month = getNumber( "m" ); 8847 break; 8848 case "M": 8849 month = getName( "M", monthNamesShort, monthNames ); 8850 break; 8851 case "y": 8852 year = getNumber( "y" ); 8853 break; 8854 case "@": 8855 date = new Date( getNumber( "@" ) ); 8856 year = date.getFullYear(); 8857 month = date.getMonth() + 1; 8858 day = date.getDate(); 8859 break; 8860 case "!": 8861 date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 ); 8862 year = date.getFullYear(); 8863 month = date.getMonth() + 1; 8864 day = date.getDate(); 8865 break; 8866 case "'": 8867 if ( lookAhead( "'" ) ) { 8868 checkLiteral(); 8869 } else { 8870 literal = true; 8871 } 8872 break; 8873 default: 8874 checkLiteral(); 8875 } 8876 } 8877 } 8878 8879 if ( iValue < value.length ) { 8880 extra = value.substr( iValue ); 8881 if ( !/^\s+/.test( extra ) ) { 8882 throw "Extra/unparsed characters found in date: " + extra; 8883 } 8884 } 8885 8886 if ( year === -1 ) { 8887 year = new Date().getFullYear(); 8888 } else if ( year < 100 ) { 8889 year += new Date().getFullYear() - new Date().getFullYear() % 100 + 8890 ( year <= shortYearCutoff ? 0 : -100 ); 8891 } 8892 8893 if ( doy > -1 ) { 8894 month = 1; 8895 day = doy; 8896 do { 8897 dim = this._getDaysInMonth( year, month - 1 ); 8898 if ( day <= dim ) { 8899 break; 8900 } 8901 month++; 8902 day -= dim; 8903 } while ( true ); 8904 } 8905 8906 date = this._daylightSavingAdjust( new Date( year, month - 1, day ) ); 8907 if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) { 8908 throw "Invalid date"; // E.g. 31/02/00 8909 } 8910 return date; 8911 }, 8912 8913 /* Standard date formats. */ 8914 ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) 8915 COOKIE: "D, dd M yy", 8916 ISO_8601: "yy-mm-dd", 8917 RFC_822: "D, d M y", 8918 RFC_850: "DD, dd-M-y", 8919 RFC_1036: "D, d M y", 8920 RFC_1123: "D, d M yy", 8921 RFC_2822: "D, d M yy", 8922 RSS: "D, d M y", // RFC 822 8923 TICKS: "!", 8924 TIMESTAMP: "@", 8925 W3C: "yy-mm-dd", // ISO 8601 8926 8927 _ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) + 8928 Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ), 8929 8930 /* Format a date object into a string value. 8931 * The format can be combinations of the following: 8932 * d - day of month (no leading zero) 8933 * dd - day of month (two digit) 8934 * o - day of year (no leading zeros) 8935 * oo - day of year (three digit) 8936 * D - day name short 8937 * DD - day name long 8938 * m - month of year (no leading zero) 8939 * mm - month of year (two digit) 8940 * M - month name short 8941 * MM - month name long 8942 * y - year (two digit) 8943 * yy - year (four digit) 8944 * @ - Unix timestamp (ms since 01/01/1970) 8945 * ! - Windows ticks (100ns since 01/01/0001) 8946 * "..." - literal text 8947 * '' - single quote 8948 * 8949 * @param format string - the desired format of the date 8950 * @param date Date - the date value to format 8951 * @param settings Object - attributes include: 8952 * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) 8953 * dayNames string[7] - names of the days from Sunday (optional) 8954 * monthNamesShort string[12] - abbreviated names of the months (optional) 8955 * monthNames string[12] - names of the months (optional) 8956 * @return string - the date in the above format 8957 */ 8958 formatDate: function( format, date, settings ) { 8959 if ( !date ) { 8960 return ""; 8961 } 8962 8963 var iFormat, 8964 dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, 8965 dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, 8966 monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, 8967 monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, 8968 8969 // Check whether a format character is doubled 8970 lookAhead = function( match ) { 8971 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 8972 if ( matches ) { 8973 iFormat++; 8974 } 8975 return matches; 8976 }, 8977 8978 // Format a number, with leading zero if necessary 8979 formatNumber = function( match, value, len ) { 8980 var num = "" + value; 8981 if ( lookAhead( match ) ) { 8982 while ( num.length < len ) { 8983 num = "0" + num; 8984 } 8985 } 8986 return num; 8987 }, 8988 8989 // Format a name, short or long as requested 8990 formatName = function( match, value, shortNames, longNames ) { 8991 return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] ); 8992 }, 8993 output = "", 8994 literal = false; 8995 8996 if ( date ) { 8997 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 8998 if ( literal ) { 8999 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 9000 literal = false; 9001 } else { 9002 output += format.charAt( iFormat ); 9003 } 9004 } else { 9005 switch ( format.charAt( iFormat ) ) { 9006 case "d": 9007 output += formatNumber( "d", date.getDate(), 2 ); 9008 break; 9009 case "D": 9010 output += formatName( "D", date.getDay(), dayNamesShort, dayNames ); 9011 break; 9012 case "o": 9013 output += formatNumber( "o", 9014 Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 ); 9015 break; 9016 case "m": 9017 output += formatNumber( "m", date.getMonth() + 1, 2 ); 9018 break; 9019 case "M": 9020 output += formatName( "M", date.getMonth(), monthNamesShort, monthNames ); 9021 break; 9022 case "y": 9023 output += ( lookAhead( "y" ) ? date.getFullYear() : 9024 ( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 ); 9025 break; 9026 case "@": 9027 output += date.getTime(); 9028 break; 9029 case "!": 9030 output += date.getTime() * 10000 + this._ticksTo1970; 9031 break; 9032 case "'": 9033 if ( lookAhead( "'" ) ) { 9034 output += "'"; 9035 } else { 9036 literal = true; 9037 } 9038 break; 9039 default: 9040 output += format.charAt( iFormat ); 9041 } 9042 } 9043 } 9044 } 9045 return output; 9046 }, 9047 9048 /* Extract all possible characters from the date format. */ 9049 _possibleChars: function( format ) { 9050 var iFormat, 9051 chars = "", 9052 literal = false, 9053 9054 // Check whether a format character is doubled 9055 lookAhead = function( match ) { 9056 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 9057 if ( matches ) { 9058 iFormat++; 9059 } 9060 return matches; 9061 }; 9062 9063 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 9064 if ( literal ) { 9065 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 9066 literal = false; 9067 } else { 9068 chars += format.charAt( iFormat ); 9069 } 9070 } else { 9071 switch ( format.charAt( iFormat ) ) { 9072 case "d": case "m": case "y": case "@": 9073 chars += "0123456789"; 9074 break; 9075 case "D": case "M": 9076 return null; // Accept anything 9077 case "'": 9078 if ( lookAhead( "'" ) ) { 9079 chars += "'"; 9080 } else { 9081 literal = true; 9082 } 9083 break; 9084 default: 9085 chars += format.charAt( iFormat ); 9086 } 9087 } 9088 } 9089 return chars; 9090 }, 9091 9092 /* Get a setting value, defaulting if necessary. */ 9093 _get: function( inst, name ) { 9094 return inst.settings[ name ] !== undefined ? 9095 inst.settings[ name ] : this._defaults[ name ]; 9096 }, 9097 9098 /* Parse existing date and initialise date picker. */ 9099 _setDateFromField: function( inst, noDefault ) { 9100 if ( inst.input.val() === inst.lastVal ) { 9101 return; 9102 } 9103 9104 var dateFormat = this._get( inst, "dateFormat" ), 9105 dates = inst.lastVal = inst.input ? inst.input.val() : null, 9106 defaultDate = this._getDefaultDate( inst ), 9107 date = defaultDate, 9108 settings = this._getFormatConfig( inst ); 9109 9110 try { 9111 date = this.parseDate( dateFormat, dates, settings ) || defaultDate; 9112 } catch ( event ) { 9113 dates = ( noDefault ? "" : dates ); 9114 } 9115 inst.selectedDay = date.getDate(); 9116 inst.drawMonth = inst.selectedMonth = date.getMonth(); 9117 inst.drawYear = inst.selectedYear = date.getFullYear(); 9118 inst.currentDay = ( dates ? date.getDate() : 0 ); 9119 inst.currentMonth = ( dates ? date.getMonth() : 0 ); 9120 inst.currentYear = ( dates ? date.getFullYear() : 0 ); 9121 this._adjustInstDate( inst ); 9122 }, 9123 9124 /* Retrieve the default date shown on opening. */ 9125 _getDefaultDate: function( inst ) { 9126 return this._restrictMinMax( inst, 9127 this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) ); 9128 }, 9129 9130 /* A date may be specified as an exact value or a relative one. */ 9131 _determineDate: function( inst, date, defaultDate ) { 9132 var offsetNumeric = function( offset ) { 9133 var date = new Date(); 9134 date.setDate( date.getDate() + offset ); 9135 return date; 9136 }, 9137 offsetString = function( offset ) { 9138 try { 9139 return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), 9140 offset, $.datepicker._getFormatConfig( inst ) ); 9141 } catch ( e ) { 9142 9143 // Ignore 9144 } 9145 9146 var date = ( offset.toLowerCase().match( /^c/ ) ? 9147 $.datepicker._getDate( inst ) : null ) || new Date(), 9148 year = date.getFullYear(), 9149 month = date.getMonth(), 9150 day = date.getDate(), 9151 pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, 9152 matches = pattern.exec( offset ); 9153 9154 while ( matches ) { 9155 switch ( matches[ 2 ] || "d" ) { 9156 case "d" : case "D" : 9157 day += parseInt( matches[ 1 ], 10 ); break; 9158 case "w" : case "W" : 9159 day += parseInt( matches[ 1 ], 10 ) * 7; break; 9160 case "m" : case "M" : 9161 month += parseInt( matches[ 1 ], 10 ); 9162 day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); 9163 break; 9164 case "y": case "Y" : 9165 year += parseInt( matches[ 1 ], 10 ); 9166 day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); 9167 break; 9168 } 9169 matches = pattern.exec( offset ); 9170 } 9171 return new Date( year, month, day ); 9172 }, 9173 newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) : 9174 ( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) ); 9175 9176 newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate ); 9177 if ( newDate ) { 9178 newDate.setHours( 0 ); 9179 newDate.setMinutes( 0 ); 9180 newDate.setSeconds( 0 ); 9181 newDate.setMilliseconds( 0 ); 9182 } 9183 return this._daylightSavingAdjust( newDate ); 9184 }, 9185 9186 /* Handle switch to/from daylight saving. 9187 * Hours may be non-zero on daylight saving cut-over: 9188 * > 12 when midnight changeover, but then cannot generate 9189 * midnight datetime, so jump to 1AM, otherwise reset. 9190 * @param date (Date) the date to check 9191 * @return (Date) the corrected date 9192 */ 9193 _daylightSavingAdjust: function( date ) { 9194 if ( !date ) { 9195 return null; 9196 } 9197 date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 ); 9198 return date; 9199 }, 9200 9201 /* Set the date(s) directly. */ 9202 _setDate: function( inst, date, noChange ) { 9203 var clear = !date, 9204 origMonth = inst.selectedMonth, 9205 origYear = inst.selectedYear, 9206 newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) ); 9207 9208 inst.selectedDay = inst.currentDay = newDate.getDate(); 9209 inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); 9210 inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); 9211 if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) { 9212 this._notifyChange( inst ); 9213 } 9214 this._adjustInstDate( inst ); 9215 if ( inst.input ) { 9216 inst.input.val( clear ? "" : this._formatDate( inst ) ); 9217 } 9218 }, 9219 9220 /* Retrieve the date(s) directly. */ 9221 _getDate: function( inst ) { 9222 var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null : 9223 this._daylightSavingAdjust( new Date( 9224 inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); 9225 return startDate; 9226 }, 9227 9228 /* Attach the onxxx handlers. These are declared statically so 9229 * they work with static code transformers like Caja. 9230 */ 9231 _attachHandlers: function( inst ) { 9232 var stepMonths = this._get( inst, "stepMonths" ), 9233 id = "#" + inst.id.replace( /\\\\/g, "\\" ); 9234 inst.dpDiv.find( "[data-handler]" ).map( function() { 9235 var handler = { 9236 prev: function() { 9237 $.datepicker._adjustDate( id, -stepMonths, "M" ); 9238 }, 9239 next: function() { 9240 $.datepicker._adjustDate( id, +stepMonths, "M" ); 9241 }, 9242 hide: function() { 9243 $.datepicker._hideDatepicker(); 9244 }, 9245 today: function() { 9246 $.datepicker._gotoToday( id ); 9247 }, 9248 selectDay: function() { 9249 $.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this ); 9250 return false; 9251 }, 9252 selectMonth: function() { 9253 $.datepicker._selectMonthYear( id, this, "M" ); 9254 return false; 9255 }, 9256 selectYear: function() { 9257 $.datepicker._selectMonthYear( id, this, "Y" ); 9258 return false; 9259 } 9260 }; 9261 $( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] ); 9262 } ); 9263 }, 9264 9265 /* Generate the HTML for the current state of the date picker. */ 9266 _generateHTML: function( inst ) { 9267 var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, 9268 controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, 9269 monthNames, monthNamesShort, beforeShowDay, showOtherMonths, 9270 selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, 9271 cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, 9272 printDate, dRow, tbody, daySettings, otherMonth, unselectable, 9273 tempDate = new Date(), 9274 today = this._daylightSavingAdjust( 9275 new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time 9276 isRTL = this._get( inst, "isRTL" ), 9277 showButtonPanel = this._get( inst, "showButtonPanel" ), 9278 hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ), 9279 navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ), 9280 numMonths = this._getNumberOfMonths( inst ), 9281 showCurrentAtPos = this._get( inst, "showCurrentAtPos" ), 9282 stepMonths = this._get( inst, "stepMonths" ), 9283 isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ), 9284 currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) : 9285 new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ), 9286 minDate = this._getMinMaxDate( inst, "min" ), 9287 maxDate = this._getMinMaxDate( inst, "max" ), 9288 drawMonth = inst.drawMonth - showCurrentAtPos, 9289 drawYear = inst.drawYear; 9290 9291 if ( drawMonth < 0 ) { 9292 drawMonth += 12; 9293 drawYear--; 9294 } 9295 if ( maxDate ) { 9296 maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(), 9297 maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) ); 9298 maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw ); 9299 while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) { 9300 drawMonth--; 9301 if ( drawMonth < 0 ) { 9302 drawMonth = 11; 9303 drawYear--; 9304 } 9305 } 9306 } 9307 inst.drawMonth = drawMonth; 9308 inst.drawYear = drawYear; 9309 9310 prevText = this._get( inst, "prevText" ); 9311 prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText, 9312 this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ), 9313 this._getFormatConfig( inst ) ) ); 9314 9315 if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) { 9316 prev = $( "<a>" ) 9317 .attr( { 9318 "class": "ui-datepicker-prev ui-corner-all", 9319 "data-handler": "prev", 9320 "data-event": "click", 9321 title: prevText 9322 } ) 9323 .append( 9324 $( "<span>" ) 9325 .addClass( "ui-icon ui-icon-circle-triangle-" + 9326 ( isRTL ? "e" : "w" ) ) 9327 .text( prevText ) 9328 )[ 0 ].outerHTML; 9329 } else if ( hideIfNoPrevNext ) { 9330 prev = ""; 9331 } else { 9332 prev = $( "<a>" ) 9333 .attr( { 9334 "class": "ui-datepicker-prev ui-corner-all ui-state-disabled", 9335 title: prevText 9336 } ) 9337 .append( 9338 $( "<span>" ) 9339 .addClass( "ui-icon ui-icon-circle-triangle-" + 9340 ( isRTL ? "e" : "w" ) ) 9341 .text( prevText ) 9342 )[ 0 ].outerHTML; 9343 } 9344 9345 nextText = this._get( inst, "nextText" ); 9346 nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText, 9347 this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ), 9348 this._getFormatConfig( inst ) ) ); 9349 9350 if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) { 9351 next = $( "<a>" ) 9352 .attr( { 9353 "class": "ui-datepicker-next ui-corner-all", 9354 "data-handler": "next", 9355 "data-event": "click", 9356 title: nextText 9357 } ) 9358 .append( 9359 $( "<span>" ) 9360 .addClass( "ui-icon ui-icon-circle-triangle-" + 9361 ( isRTL ? "w" : "e" ) ) 9362 .text( nextText ) 9363 )[ 0 ].outerHTML; 9364 } else if ( hideIfNoPrevNext ) { 9365 next = ""; 9366 } else { 9367 next = $( "<a>" ) 9368 .attr( { 9369 "class": "ui-datepicker-next ui-corner-all ui-state-disabled", 9370 title: nextText 9371 } ) 9372 .append( 9373 $( "<span>" ) 9374 .attr( "class", "ui-icon ui-icon-circle-triangle-" + 9375 ( isRTL ? "w" : "e" ) ) 9376 .text( nextText ) 9377 )[ 0 ].outerHTML; 9378 } 9379 9380 currentText = this._get( inst, "currentText" ); 9381 gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today ); 9382 currentText = ( !navigationAsDateFormat ? currentText : 9383 this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) ); 9384 9385 controls = ""; 9386 if ( !inst.inline ) { 9387 controls = $( "<button>" ) 9388 .attr( { 9389 type: "button", 9390 "class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all", 9391 "data-handler": "hide", 9392 "data-event": "click" 9393 } ) 9394 .text( this._get( inst, "closeText" ) )[ 0 ].outerHTML; 9395 } 9396 9397 buttonPanel = ""; 9398 if ( showButtonPanel ) { 9399 buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" ) 9400 .append( isRTL ? controls : "" ) 9401 .append( this._isInRange( inst, gotoDate ) ? 9402 $( "<button>" ) 9403 .attr( { 9404 type: "button", 9405 "class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all", 9406 "data-handler": "today", 9407 "data-event": "click" 9408 } ) 9409 .text( currentText ) : 9410 "" ) 9411 .append( isRTL ? "" : controls )[ 0 ].outerHTML; 9412 } 9413 9414 firstDay = parseInt( this._get( inst, "firstDay" ), 10 ); 9415 firstDay = ( isNaN( firstDay ) ? 0 : firstDay ); 9416 9417 showWeek = this._get( inst, "showWeek" ); 9418 dayNames = this._get( inst, "dayNames" ); 9419 dayNamesMin = this._get( inst, "dayNamesMin" ); 9420 monthNames = this._get( inst, "monthNames" ); 9421 monthNamesShort = this._get( inst, "monthNamesShort" ); 9422 beforeShowDay = this._get( inst, "beforeShowDay" ); 9423 showOtherMonths = this._get( inst, "showOtherMonths" ); 9424 selectOtherMonths = this._get( inst, "selectOtherMonths" ); 9425 defaultDate = this._getDefaultDate( inst ); 9426 html = ""; 9427 9428 for ( row = 0; row < numMonths[ 0 ]; row++ ) { 9429 group = ""; 9430 this.maxRows = 4; 9431 for ( col = 0; col < numMonths[ 1 ]; col++ ) { 9432 selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) ); 9433 cornerClass = " ui-corner-all"; 9434 calender = ""; 9435 if ( isMultiMonth ) { 9436 calender += "<div class='ui-datepicker-group"; 9437 if ( numMonths[ 1 ] > 1 ) { 9438 switch ( col ) { 9439 case 0: calender += " ui-datepicker-group-first"; 9440 cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break; 9441 case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last"; 9442 cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break; 9443 default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break; 9444 } 9445 } 9446 calender += "'>"; 9447 } 9448 calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + 9449 ( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) + 9450 ( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) + 9451 this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate, 9452 row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers 9453 "</div><table class='ui-datepicker-calendar'><thead>" + 9454 "<tr>"; 9455 thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" ); 9456 for ( dow = 0; dow < 7; dow++ ) { // days of the week 9457 day = ( dow + firstDay ) % 7; 9458 thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" + 9459 "<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>"; 9460 } 9461 calender += thead + "</tr></thead><tbody>"; 9462 daysInMonth = this._getDaysInMonth( drawYear, drawMonth ); 9463 if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) { 9464 inst.selectedDay = Math.min( inst.selectedDay, daysInMonth ); 9465 } 9466 leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7; 9467 curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate 9468 numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043) 9469 this.maxRows = numRows; 9470 printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) ); 9471 for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows 9472 calender += "<tr>"; 9473 tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" + 9474 this._get( inst, "calculateWeek" )( printDate ) + "</td>" ); 9475 for ( dow = 0; dow < 7; dow++ ) { // create date picker days 9476 daySettings = ( beforeShowDay ? 9477 beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] ); 9478 otherMonth = ( printDate.getMonth() !== drawMonth ); 9479 unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] || 9480 ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate ); 9481 tbody += "<td class='" + 9482 ( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends 9483 ( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months 9484 ( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key 9485 ( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ? 9486 9487 // or defaultDate is current printedDate and defaultDate is selectedDate 9488 " " + this._dayOverClass : "" ) + // highlight selected day 9489 ( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) + // highlight unselectable days 9490 ( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates 9491 ( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day 9492 ( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different) 9493 ( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "'" ) + "'" : "" ) + // cell title 9494 ( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions 9495 ( otherMonth && !showOtherMonths ? " " : // display for other months 9496 ( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + 9497 ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) + 9498 ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day 9499 ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months 9500 "' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader 9501 "' data-date='" + printDate.getDate() + // store date as data 9502 "'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date 9503 printDate.setDate( printDate.getDate() + 1 ); 9504 printDate = this._daylightSavingAdjust( printDate ); 9505 } 9506 calender += tbody + "</tr>"; 9507 } 9508 drawMonth++; 9509 if ( drawMonth > 11 ) { 9510 drawMonth = 0; 9511 drawYear++; 9512 } 9513 calender += "</tbody></table>" + ( isMultiMonth ? "</div>" + 9514 ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" ); 9515 group += calender; 9516 } 9517 html += group; 9518 } 9519 html += buttonPanel; 9520 inst._keyEvent = false; 9521 return html; 9522 }, 9523 9524 /* Generate the month and year header. */ 9525 _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate, 9526 secondary, monthNames, monthNamesShort ) { 9527 9528 var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, 9529 changeMonth = this._get( inst, "changeMonth" ), 9530 changeYear = this._get( inst, "changeYear" ), 9531 showMonthAfterYear = this._get( inst, "showMonthAfterYear" ), 9532 selectMonthLabel = this._get( inst, "selectMonthLabel" ), 9533 selectYearLabel = this._get( inst, "selectYearLabel" ), 9534 html = "<div class='ui-datepicker-title'>", 9535 monthHtml = ""; 9536 9537 // Month selection 9538 if ( secondary || !changeMonth ) { 9539 monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>"; 9540 } else { 9541 inMinYear = ( minDate && minDate.getFullYear() === drawYear ); 9542 inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear ); 9543 monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>"; 9544 for ( month = 0; month < 12; month++ ) { 9545 if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) { 9546 monthHtml += "<option value='" + month + "'" + 9547 ( month === drawMonth ? " selected='selected'" : "" ) + 9548 ">" + monthNamesShort[ month ] + "</option>"; 9549 } 9550 } 9551 monthHtml += "</select>"; 9552 } 9553 9554 if ( !showMonthAfterYear ) { 9555 html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? " " : "" ); 9556 } 9557 9558 // Year selection 9559 if ( !inst.yearshtml ) { 9560 inst.yearshtml = ""; 9561 if ( secondary || !changeYear ) { 9562 html += "<span class='ui-datepicker-year'>" + drawYear + "</span>"; 9563 } else { 9564 9565 // determine range of years to display 9566 years = this._get( inst, "yearRange" ).split( ":" ); 9567 thisYear = new Date().getFullYear(); 9568 determineYear = function( value ) { 9569 var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) : 9570 ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) : 9571 parseInt( value, 10 ) ) ); 9572 return ( isNaN( year ) ? thisYear : year ); 9573 }; 9574 year = determineYear( years[ 0 ] ); 9575 endYear = Math.max( year, determineYear( years[ 1 ] || "" ) ); 9576 year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year ); 9577 endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear ); 9578 inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>"; 9579 for ( ; year <= endYear; year++ ) { 9580 inst.yearshtml += "<option value='" + year + "'" + 9581 ( year === drawYear ? " selected='selected'" : "" ) + 9582 ">" + year + "</option>"; 9583 } 9584 inst.yearshtml += "</select>"; 9585 9586 html += inst.yearshtml; 9587 inst.yearshtml = null; 9588 } 9589 } 9590 9591 html += this._get( inst, "yearSuffix" ); 9592 if ( showMonthAfterYear ) { 9593 html += ( secondary || !( changeMonth && changeYear ) ? " " : "" ) + monthHtml; 9594 } 9595 html += "</div>"; // Close datepicker_header 9596 return html; 9597 }, 9598 9599 /* Adjust one of the date sub-fields. */ 9600 _adjustInstDate: function( inst, offset, period ) { 9601 var year = inst.selectedYear + ( period === "Y" ? offset : 0 ), 9602 month = inst.selectedMonth + ( period === "M" ? offset : 0 ), 9603 day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ), 9604 date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) ); 9605 9606 inst.selectedDay = date.getDate(); 9607 inst.drawMonth = inst.selectedMonth = date.getMonth(); 9608 inst.drawYear = inst.selectedYear = date.getFullYear(); 9609 if ( period === "M" || period === "Y" ) { 9610 this._notifyChange( inst ); 9611 } 9612 }, 9613 9614 /* Ensure a date is within any min/max bounds. */ 9615 _restrictMinMax: function( inst, date ) { 9616 var minDate = this._getMinMaxDate( inst, "min" ), 9617 maxDate = this._getMinMaxDate( inst, "max" ), 9618 newDate = ( minDate && date < minDate ? minDate : date ); 9619 return ( maxDate && newDate > maxDate ? maxDate : newDate ); 9620 }, 9621 9622 /* Notify change of month/year. */ 9623 _notifyChange: function( inst ) { 9624 var onChange = this._get( inst, "onChangeMonthYear" ); 9625 if ( onChange ) { 9626 onChange.apply( ( inst.input ? inst.input[ 0 ] : null ), 9627 [ inst.selectedYear, inst.selectedMonth + 1, inst ] ); 9628 } 9629 }, 9630 9631 /* Determine the number of months to show. */ 9632 _getNumberOfMonths: function( inst ) { 9633 var numMonths = this._get( inst, "numberOfMonths" ); 9634 return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) ); 9635 }, 9636 9637 /* Determine the current maximum date - ensure no time components are set. */ 9638 _getMinMaxDate: function( inst, minMax ) { 9639 return this._determineDate( inst, this._get( inst, minMax + "Date" ), null ); 9640 }, 9641 9642 /* Find the number of days in a given month. */ 9643 _getDaysInMonth: function( year, month ) { 9644 return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate(); 9645 }, 9646 9647 /* Find the day of the week of the first of a month. */ 9648 _getFirstDayOfMonth: function( year, month ) { 9649 return new Date( year, month, 1 ).getDay(); 9650 }, 9651 9652 /* Determines if we should allow a "next/prev" month display change. */ 9653 _canAdjustMonth: function( inst, offset, curYear, curMonth ) { 9654 var numMonths = this._getNumberOfMonths( inst ), 9655 date = this._daylightSavingAdjust( new Date( curYear, 9656 curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) ); 9657 9658 if ( offset < 0 ) { 9659 date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) ); 9660 } 9661 return this._isInRange( inst, date ); 9662 }, 9663 9664 /* Is the given date in the accepted range? */ 9665 _isInRange: function( inst, date ) { 9666 var yearSplit, currentYear, 9667 minDate = this._getMinMaxDate( inst, "min" ), 9668 maxDate = this._getMinMaxDate( inst, "max" ), 9669 minYear = null, 9670 maxYear = null, 9671 years = this._get( inst, "yearRange" ); 9672 if ( years ) { 9673 yearSplit = years.split( ":" ); 9674 currentYear = new Date().getFullYear(); 9675 minYear = parseInt( yearSplit[ 0 ], 10 ); 9676 maxYear = parseInt( yearSplit[ 1 ], 10 ); 9677 if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) { 9678 minYear += currentYear; 9679 } 9680 if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) { 9681 maxYear += currentYear; 9682 } 9683 } 9684 9685 return ( ( !minDate || date.getTime() >= minDate.getTime() ) && 9686 ( !maxDate || date.getTime() <= maxDate.getTime() ) && 9687 ( !minYear || date.getFullYear() >= minYear ) && 9688 ( !maxYear || date.getFullYear() <= maxYear ) ); 9689 }, 9690 9691 /* Provide the configuration settings for formatting/parsing. */ 9692 _getFormatConfig: function( inst ) { 9693 var shortYearCutoff = this._get( inst, "shortYearCutoff" ); 9694 shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff : 9695 new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) ); 9696 return { shortYearCutoff: shortYearCutoff, 9697 dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ), 9698 monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) }; 9699 }, 9700 9701 /* Format the given date for display. */ 9702 _formatDate: function( inst, day, month, year ) { 9703 if ( !day ) { 9704 inst.currentDay = inst.selectedDay; 9705 inst.currentMonth = inst.selectedMonth; 9706 inst.currentYear = inst.selectedYear; 9707 } 9708 var date = ( day ? ( typeof day === "object" ? day : 9709 this._daylightSavingAdjust( new Date( year, month, day ) ) ) : 9710 this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); 9711 return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) ); 9712 } 9713} ); 9714 9715/* 9716 * Bind hover events for datepicker elements. 9717 * Done via delegate so the binding only occurs once in the lifetime of the parent div. 9718 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. 9719 */ 9720function datepicker_bindHover( dpDiv ) { 9721 var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; 9722 return dpDiv.on( "mouseout", selector, function() { 9723 $( this ).removeClass( "ui-state-hover" ); 9724 if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { 9725 $( this ).removeClass( "ui-datepicker-prev-hover" ); 9726 } 9727 if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { 9728 $( this ).removeClass( "ui-datepicker-next-hover" ); 9729 } 9730 } ) 9731 .on( "mouseover", selector, datepicker_handleMouseover ); 9732} 9733 9734function datepicker_handleMouseover() { 9735 if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) { 9736 $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" ); 9737 $( this ).addClass( "ui-state-hover" ); 9738 if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { 9739 $( this ).addClass( "ui-datepicker-prev-hover" ); 9740 } 9741 if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { 9742 $( this ).addClass( "ui-datepicker-next-hover" ); 9743 } 9744 } 9745} 9746 9747/* jQuery extend now ignores nulls! */ 9748function datepicker_extendRemove( target, props ) { 9749 $.extend( target, props ); 9750 for ( var name in props ) { 9751 if ( props[ name ] == null ) { 9752 target[ name ] = props[ name ]; 9753 } 9754 } 9755 return target; 9756} 9757 9758/* Invoke the datepicker functionality. 9759 @param options string - a command, optionally followed by additional parameters or 9760 Object - settings for attaching new datepicker functionality 9761 @return jQuery object */ 9762$.fn.datepicker = function( options ) { 9763 9764 /* Verify an empty collection wasn't passed - Fixes #6976 */ 9765 if ( !this.length ) { 9766 return this; 9767 } 9768 9769 /* Initialise the date picker. */ 9770 if ( !$.datepicker.initialized ) { 9771 $( document ).on( "mousedown", $.datepicker._checkExternalClick ); 9772 $.datepicker.initialized = true; 9773 } 9774 9775 /* Append datepicker main container to body if not exist. */ 9776 if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) { 9777 $( "body" ).append( $.datepicker.dpDiv ); 9778 } 9779 9780 var otherArgs = Array.prototype.slice.call( arguments, 1 ); 9781 if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) { 9782 return $.datepicker[ "_" + options + "Datepicker" ]. 9783 apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); 9784 } 9785 if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) { 9786 return $.datepicker[ "_" + options + "Datepicker" ]. 9787 apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); 9788 } 9789 return this.each( function() { 9790 if ( typeof options === "string" ) { 9791 $.datepicker[ "_" + options + "Datepicker" ] 9792 .apply( $.datepicker, [ this ].concat( otherArgs ) ); 9793 } else { 9794 $.datepicker._attachDatepicker( this, options ); 9795 } 9796 } ); 9797};
vendor: 14,641 bytes, lines 9798-10349
9798 9799$.datepicker = new Datepicker(); // singleton instance 9800$.datepicker.initialized = false; 9801$.datepicker.uuid = new Date().getTime(); 9802$.datepicker.version = "1.13.2"; 9803 9804var widgetsDatepicker = $.datepicker; 9805 9806 9807 9808// This file is deprecated 9809var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 9810 9811/*! 9812 * jQuery UI Mouse 1.13.2 9813 * http://jqueryui.com 9814 * 9815 * Copyright jQuery Foundation and other contributors 9816 * Released under the MIT license. 9817 * http://jquery.org/license 9818 */ 9819 9820//>>label: Mouse 9821//>>group: Widgets 9822//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. 9823//>>docs: http://api.jqueryui.com/mouse/ 9824 9825 9826var mouseHandled = false; 9827$( document ).on( "mouseup", function() { 9828 mouseHandled = false; 9829} ); 9830 9831var widgetsMouse = $.widget( "ui.mouse", { 9832 version: "1.13.2", 9833 options: { 9834 cancel: "input, textarea, button, select, option", 9835 distance: 1, 9836 delay: 0 9837 }, 9838 _mouseInit: function() { 9839 var that = this; 9840 9841 this.element 9842 .on( "mousedown." + this.widgetName, function( event ) { 9843 return that._mouseDown( event ); 9844 } ) 9845 .on( "click." + this.widgetName, function( event ) { 9846 if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { 9847 $.removeData( event.target, that.widgetName + ".preventClickEvent" ); 9848 event.stopImmediatePropagation(); 9849 return false; 9850 } 9851 } ); 9852 9853 this.started = false; 9854 }, 9855 9856 // TODO: make sure destroying one instance of mouse doesn't mess with 9857 // other instances of mouse 9858 _mouseDestroy: function() { 9859 this.element.off( "." + this.widgetName ); 9860 if ( this._mouseMoveDelegate ) { 9861 this.document 9862 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9863 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9864 } 9865 }, 9866 9867 _mouseDown: function( event ) { 9868 9869 // don't let more than one widget handle mouseStart 9870 if ( mouseHandled ) { 9871 return; 9872 } 9873 9874 this._mouseMoved = false; 9875 9876 // We may have missed mouseup (out of window) 9877 if ( this._mouseStarted ) { 9878 this._mouseUp( event ); 9879 } 9880 9881 this._mouseDownEvent = event; 9882 9883 var that = this, 9884 btnIsLeft = ( event.which === 1 ), 9885 9886 // event.target.nodeName works around a bug in IE 8 with 9887 // disabled inputs (#7620) 9888 elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? 9889 $( event.target ).closest( this.options.cancel ).length : false ); 9890 if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { 9891 return true; 9892 } 9893 9894 this.mouseDelayMet = !this.options.delay; 9895 if ( !this.mouseDelayMet ) { 9896 this._mouseDelayTimer = setTimeout( function() { 9897 that.mouseDelayMet = true; 9898 }, this.options.delay ); 9899 } 9900 9901 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 9902 this._mouseStarted = ( this._mouseStart( event ) !== false ); 9903 if ( !this._mouseStarted ) { 9904 event.preventDefault(); 9905 return true; 9906 } 9907 } 9908 9909 // Click event may never have fired (Gecko & Opera) 9910 if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { 9911 $.removeData( event.target, this.widgetName + ".preventClickEvent" ); 9912 } 9913 9914 // These delegates are required to keep context 9915 this._mouseMoveDelegate = function( event ) { 9916 return that._mouseMove( event ); 9917 }; 9918 this._mouseUpDelegate = function( event ) { 9919 return that._mouseUp( event ); 9920 }; 9921 9922 this.document 9923 .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9924 .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9925 9926 event.preventDefault(); 9927 9928 mouseHandled = true; 9929 return true; 9930 }, 9931 9932 _mouseMove: function( event ) { 9933 9934 // Only check for mouseups outside the document if you've moved inside the document 9935 // at least once. This prevents the firing of mouseup in the case of IE<9, which will 9936 // fire a mousemove event if content is placed under the cursor. See #7778 9937 // Support: IE <9 9938 if ( this._mouseMoved ) { 9939 9940 // IE mouseup check - mouseup happened when mouse was out of window 9941 if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && 9942 !event.button ) { 9943 return this._mouseUp( event ); 9944 9945 // Iframe mouseup check - mouseup occurred in another document 9946 } else if ( !event.which ) { 9947 9948 // Support: Safari <=8 - 9 9949 // Safari sets which to 0 if you press any of the following keys 9950 // during a drag (#14461) 9951 if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || 9952 event.originalEvent.metaKey || event.originalEvent.shiftKey ) { 9953 this.ignoreMissingWhich = true; 9954 } else if ( !this.ignoreMissingWhich ) { 9955 return this._mouseUp( event ); 9956 } 9957 } 9958 } 9959 9960 if ( event.which || event.button ) { 9961 this._mouseMoved = true; 9962 } 9963 9964 if ( this._mouseStarted ) { 9965 this._mouseDrag( event ); 9966 return event.preventDefault(); 9967 } 9968 9969 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 9970 this._mouseStarted = 9971 ( this._mouseStart( this._mouseDownEvent, event ) !== false ); 9972 if ( this._mouseStarted ) { 9973 this._mouseDrag( event ); 9974 } else { 9975 this._mouseUp( event ); 9976 } 9977 } 9978 9979 return !this._mouseStarted; 9980 }, 9981 9982 _mouseUp: function( event ) { 9983 this.document 9984 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9985 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9986 9987 if ( this._mouseStarted ) { 9988 this._mouseStarted = false; 9989 9990 if ( event.target === this._mouseDownEvent.target ) { 9991 $.data( event.target, this.widgetName + ".preventClickEvent", true ); 9992 } 9993 9994 this._mouseStop( event ); 9995 } 9996 9997 if ( this._mouseDelayTimer ) { 9998 clearTimeout( this._mouseDelayTimer ); 9999 delete this._mouseDelayTimer; 10000 } 10001 10002 this.ignoreMissingWhich = false; 10003 mouseHandled = false; 10004 event.preventDefault(); 10005 }, 10006 10007 _mouseDistanceMet: function( event ) { 10008 return ( Math.max( 10009 Math.abs( this._mouseDownEvent.pageX - event.pageX ), 10010 Math.abs( this._mouseDownEvent.pageY - event.pageY ) 10011 ) >= this.options.distance 10012 ); 10013 }, 10014 10015 _mouseDelayMet: function( /* event */ ) { 10016 return this.mouseDelayMet; 10017 }, 10018 10019 // These are placeholder methods, to be overriden by extending plugin 10020 _mouseStart: function( /* event */ ) {}, 10021 _mouseDrag: function( /* event */ ) {}, 10022 _mouseStop: function( /* event */ ) {}, 10023 _mouseCapture: function( /* event */ ) { 10024 return true; 10025 } 10026} ); 10027 10028 10029 10030// $.ui.plugin is deprecated. Use $.widget() extensions instead. 10031var plugin = $.ui.plugin = { 10032 add: function( module, option, set ) { 10033 var i, 10034 proto = $.ui[ module ].prototype; 10035 for ( i in set ) { 10036 proto.plugins[ i ] = proto.plugins[ i ] || []; 10037 proto.plugins[ i ].push( [ option, set[ i ] ] ); 10038 } 10039 }, 10040 call: function( instance, name, args, allowDisconnected ) { 10041 var i, 10042 set = instance.plugins[ name ]; 10043 10044 if ( !set ) { 10045 return; 10046 } 10047 10048 if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || 10049 instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 10050 return; 10051 } 10052 10053 for ( i = 0; i < set.length; i++ ) { 10054 if ( instance.options[ set[ i ][ 0 ] ] ) { 10055 set[ i ][ 1 ].apply( instance.element, args ); 10056 } 10057 } 10058 } 10059}; 10060 10061 10062 10063var safeBlur = $.ui.safeBlur = function( element ) { 10064 10065 // Support: IE9 - 10 only 10066 // If the <body> is blurred, IE will switch windows, see #9420 10067 if ( element && element.nodeName.toLowerCase() !== "body" ) { 10068 $( element ).trigger( "blur" ); 10069 } 10070}; 10071 10072 10073/*! 10074 * jQuery UI Draggable 1.13.2 10075 * http://jqueryui.com 10076 * 10077 * Copyright jQuery Foundation and other contributors 10078 * Released under the MIT license. 10079 * http://jquery.org/license 10080 */ 10081 10082//>>label: Draggable 10083//>>group: Interactions 10084//>>description: Enables dragging functionality for any element. 10085//>>docs: http://api.jqueryui.com/draggable/ 10086//>>demos: http://jqueryui.com/draggable/ 10087//>>css.structure: ../../themes/base/draggable.css 10088 10089 10090$.widget( "ui.draggable", $.ui.mouse, { 10091 version: "1.13.2", 10092 widgetEventPrefix: "drag", 10093 options: { 10094 addClasses: true, 10095 appendTo: "parent", 10096 axis: false, 10097 connectToSortable: false, 10098 containment: false, 10099 cursor: "auto", 10100 cursorAt: false, 10101 grid: false, 10102 handle: false, 10103 helper: "original", 10104 iframeFix: false, 10105 opacity: false, 10106 refreshPositions: false, 10107 revert: false, 10108 revertDuration: 500, 10109 scope: "default", 10110 scroll: true, 10111 scrollSensitivity: 20, 10112 scrollSpeed: 20, 10113 snap: false, 10114 snapMode: "both", 10115 snapTolerance: 20, 10116 stack: false, 10117 zIndex: false, 10118 10119 // Callbacks 10120 drag: null, 10121 start: null, 10122 stop: null 10123 }, 10124 _create: function() { 10125 10126 if ( this.options.helper === "original" ) { 10127 this._setPositionRelative(); 10128 } 10129 if ( this.options.addClasses ) { 10130 this._addClass( "ui-draggable" ); 10131 } 10132 this._setHandleClassName(); 10133 10134 this._mouseInit(); 10135 }, 10136 10137 _setOption: function( key, value ) { 10138 this._super( key, value ); 10139 if ( key === "handle" ) { 10140 this._removeHandleClassName(); 10141 this._setHandleClassName(); 10142 } 10143 }, 10144 10145 _destroy: function() { 10146 if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { 10147 this.destroyOnClear = true; 10148 return; 10149 } 10150 this._removeHandleClassName(); 10151 this._mouseDestroy(); 10152 }, 10153 10154 _mouseCapture: function( event ) { 10155 var o = this.options; 10156 10157 // Among others, prevent a drag on a resizable-handle 10158 if ( this.helper || o.disabled || 10159 $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { 10160 return false; 10161 } 10162 10163 //Quit if we're not on a valid handle 10164 this.handle = this._getHandle( event ); 10165 if ( !this.handle ) { 10166 return false; 10167 } 10168 10169 this._blurActiveElement( event ); 10170 10171 this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); 10172 10173 return true; 10174 10175 }, 10176 10177 _blockFrames: function( selector ) { 10178 this.iframeBlocks = this.document.find( selector ).map( function() { 10179 var iframe = $( this ); 10180 10181 return $( "<div>" ) 10182 .css( "position", "absolute" ) 10183 .appendTo( iframe.parent() ) 10184 .outerWidth( iframe.outerWidth() ) 10185 .outerHeight( iframe.outerHeight() ) 10186 .offset( iframe.offset() )[ 0 ]; 10187 } ); 10188 }, 10189 10190 _unblockFrames: function() { 10191 if ( this.iframeBlocks ) { 10192 this.iframeBlocks.remove(); 10193 delete this.iframeBlocks; 10194 } 10195 }, 10196 10197 _blurActiveElement: function( event ) { 10198 var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), 10199 target = $( event.target ); 10200 10201 // Don't blur if the event occurred on an element that is within 10202 // the currently focused element 10203 // See #10527, #12472 10204 if ( target.closest( activeElement ).length ) { 10205 return; 10206 } 10207 10208 // Blur any element that currently has focus, see #4261 10209 $.ui.safeBlur( activeElement ); 10210 }, 10211 10212 _mouseStart: function( event ) { 10213 10214 var o = this.options; 10215 10216 //Create and append the visible helper 10217 this.helper = this._createHelper( event ); 10218 10219 this._addClass( this.helper, "ui-draggable-dragging" ); 10220 10221 //Cache the helper size 10222 this._cacheHelperProportions(); 10223 10224 //If ddmanager is used for droppables, set the global draggable 10225 if ( $.ui.ddmanager ) { 10226 $.ui.ddmanager.current = this; 10227 } 10228 10229 /* 10230 * - Position generation - 10231 * This block generates everything position related - it's the core of draggables. 10232 */ 10233 10234 //Cache the margins of the original element 10235 this._cacheMargins(); 10236 10237 //Store the helper's css position 10238 this.cssPosition = this.helper.css( "position" ); 10239 this.scrollParent = this.helper.scrollParent( true ); 10240 this.offsetParent = this.helper.offsetParent(); 10241 this.hasFixedAncestor = this.helper.parents().filter( function() { 10242 return $( this ).css( "position" ) === "fixed"; 10243 } ).length > 0; 10244 10245 //The element's absolute position on the page minus margins 10246 this.positionAbs = this.element.offset(); 10247 this._refreshOffsets( event ); 10248 10249 //Generate the original position 10250 this.originalPosition = this.position = this._generatePosition( event, false ); 10251 this.originalPageX = event.pageX; 10252 this.originalPageY = event.pageY; 10253 10254 //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 10255 if ( o.cursorAt ) { 10256 this._adjustOffsetFromHelper( o.cursorAt ); 10257 } 10258 10259 //Set a containment if given in the options 10260 this._setContainment(); 10261 10262 //Trigger event + callbacks 10263 if ( this._trigger( "start", event ) === false ) { 10264 this._clear(); 10265 return false; 10266 } 10267 10268 //Recache the helper size 10269 this._cacheHelperProportions(); 10270 10271 //Prepare the droppable offsets 10272 if ( $.ui.ddmanager && !o.dropBehaviour ) { 10273 $.ui.ddmanager.prepareOffsets( this, event ); 10274 } 10275 10276 // Execute the drag once - this causes the helper not to be visible before getting its 10277 // correct position 10278 this._mouseDrag( event, true ); 10279 10280 // If the ddmanager is used for droppables, inform the manager that dragging has started 10281 // (see #5003) 10282 if ( $.ui.ddmanager ) { 10283 $.ui.ddmanager.dragStart( this, event ); 10284 } 10285 10286 return true; 10287 }, 10288 10289 _refreshOffsets: function( event ) { 10290 this.offset = { 10291 top: this.positionAbs.top - this.margins.top, 10292 left: this.positionAbs.left - this.margins.left, 10293 scroll: false, 10294 parent: this._getParentOffset(), 10295 relative: this._getRelativeOffset() 10296 }; 10297 10298 this.offset.click = { 10299 left: event.pageX - this.offset.left, 10300 top: event.pageY - this.offset.top 10301 }; 10302 }, 10303 10304 _mouseDrag: function( event, noPropagation ) { 10305 10306 // reset any necessary cached properties (see #5009) 10307 if ( this.hasFixedAncestor ) { 10308 this.offset.parent = this._getParentOffset(); 10309 } 10310 10311 //Compute the helpers position 10312 this.position = this._generatePosition( event, true ); 10313 this.positionAbs = this._convertPositionTo( "absolute" ); 10314 10315 //Call plugins and callbacks and use the resulting position if something is returned 10316 if ( !noPropagation ) { 10317 var ui = this._uiHash(); 10318 if ( this._trigger( "drag", event, ui ) === false ) { 10319 this._mouseUp( new $.Event( "mouseup", event ) ); 10320 return false; 10321 } 10322 this.position = ui.position; 10323 } 10324 10325 this.helper[ 0 ].style.left = this.position.left + "px"; 10326 this.helper[ 0 ].style.top = this.position.top + "px"; 10327 10328 if ( $.ui.ddmanager ) { 10329 $.ui.ddmanager.drag( this, event ); 10330 } 10331 10332 return false; 10333 }, 10334 10335 _mouseStop: function( event ) { 10336 10337 //If we are using droppables, inform the manager about the drop 10338 var that = this, 10339 dropped = false; 10340 if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 10341 dropped = $.ui.ddmanager.drop( this, event ); 10342 } 10343 10344 //if a drop comes from outside (a sortable) 10345 if ( this.dropped ) { 10346 dropped = this.dropped; 10347 this.dropped = false; 10348 } 10349
vendor: 29,295 bytes, lines 10350-11310
10350 if ( ( this.options.revert === "invalid" && !dropped ) || 10351 ( this.options.revert === "valid" && dropped ) || 10352 this.options.revert === true || ( typeof this.options.revert === "function" && 10353 this.options.revert.call( this.element, dropped ) ) 10354 ) { 10355 $( this.helper ).animate( 10356 this.originalPosition, 10357 parseInt( this.options.revertDuration, 10 ), 10358 function() { 10359 if ( that._trigger( "stop", event ) !== false ) { 10360 that._clear(); 10361 } 10362 } 10363 ); 10364 } else { 10365 if ( this._trigger( "stop", event ) !== false ) { 10366 this._clear(); 10367 } 10368 } 10369 10370 return false; 10371 }, 10372 10373 _mouseUp: function( event ) { 10374 this._unblockFrames(); 10375 10376 // If the ddmanager is used for droppables, inform the manager that dragging has stopped 10377 // (see #5003) 10378 if ( $.ui.ddmanager ) { 10379 $.ui.ddmanager.dragStop( this, event ); 10380 } 10381 10382 // Only need to focus if the event occurred on the draggable itself, see #10527 10383 if ( this.handleElement.is( event.target ) ) { 10384 10385 // The interaction is over; whether or not the click resulted in a drag, 10386 // focus the element 10387 this.element.trigger( "focus" ); 10388 } 10389 10390 return $.ui.mouse.prototype._mouseUp.call( this, event ); 10391 }, 10392 10393 cancel: function() { 10394 10395 if ( this.helper.is( ".ui-draggable-dragging" ) ) { 10396 this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); 10397 } else { 10398 this._clear(); 10399 } 10400 10401 return this; 10402 10403 }, 10404 10405 _getHandle: function( event ) { 10406 return this.options.handle ? 10407 !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : 10408 true; 10409 }, 10410 10411 _setHandleClassName: function() { 10412 this.handleElement = this.options.handle ? 10413 this.element.find( this.options.handle ) : this.element; 10414 this._addClass( this.handleElement, "ui-draggable-handle" ); 10415 }, 10416 10417 _removeHandleClassName: function() { 10418 this._removeClass( this.handleElement, "ui-draggable-handle" ); 10419 }, 10420 10421 _createHelper: function( event ) { 10422 10423 var o = this.options, 10424 helperIsFunction = typeof o.helper === "function", 10425 helper = helperIsFunction ? 10426 $( o.helper.apply( this.element[ 0 ], [ event ] ) ) : 10427 ( o.helper === "clone" ? 10428 this.element.clone().removeAttr( "id" ) : 10429 this.element ); 10430 10431 if ( !helper.parents( "body" ).length ) { 10432 helper.appendTo( ( o.appendTo === "parent" ? 10433 this.element[ 0 ].parentNode : 10434 o.appendTo ) ); 10435 } 10436 10437 // Http://bugs.jqueryui.com/ticket/9446 10438 // a helper function can return the original element 10439 // which wouldn't have been set to relative in _create 10440 if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) { 10441 this._setPositionRelative(); 10442 } 10443 10444 if ( helper[ 0 ] !== this.element[ 0 ] && 10445 !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { 10446 helper.css( "position", "absolute" ); 10447 } 10448 10449 return helper; 10450 10451 }, 10452 10453 _setPositionRelative: function() { 10454 if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) { 10455 this.element[ 0 ].style.position = "relative"; 10456 } 10457 }, 10458 10459 _adjustOffsetFromHelper: function( obj ) { 10460 if ( typeof obj === "string" ) { 10461 obj = obj.split( " " ); 10462 } 10463 if ( Array.isArray( obj ) ) { 10464 obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 10465 } 10466 if ( "left" in obj ) { 10467 this.offset.click.left = obj.left + this.margins.left; 10468 } 10469 if ( "right" in obj ) { 10470 this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 10471 } 10472 if ( "top" in obj ) { 10473 this.offset.click.top = obj.top + this.margins.top; 10474 } 10475 if ( "bottom" in obj ) { 10476 this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 10477 } 10478 }, 10479 10480 _isRootNode: function( element ) { 10481 return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ]; 10482 }, 10483 10484 _getParentOffset: function() { 10485 10486 //Get the offsetParent and cache its position 10487 var po = this.offsetParent.offset(), 10488 document = this.document[ 0 ]; 10489 10490 // This is a special case where we need to modify a offset calculated on start, since the 10491 // following happened: 10492 // 1. The position of the helper is absolute, so it's position is calculated based on the 10493 // next positioned parent 10494 // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 10495 // the document, which means that the scroll is included in the initial calculation of the 10496 // offset of the parent, and never recalculated upon drag 10497 if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && 10498 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 10499 po.left += this.scrollParent.scrollLeft(); 10500 po.top += this.scrollParent.scrollTop(); 10501 } 10502 10503 if ( this._isRootNode( this.offsetParent[ 0 ] ) ) { 10504 po = { top: 0, left: 0 }; 10505 } 10506 10507 return { 10508 top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 10509 left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 10510 }; 10511 10512 }, 10513 10514 _getRelativeOffset: function() { 10515 if ( this.cssPosition !== "relative" ) { 10516 return { top: 0, left: 0 }; 10517 } 10518 10519 var p = this.element.position(), 10520 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); 10521 10522 return { 10523 top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 10524 ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), 10525 left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 10526 ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) 10527 }; 10528 10529 }, 10530 10531 _cacheMargins: function() { 10532 this.margins = { 10533 left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), 10534 top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), 10535 right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), 10536 bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) 10537 }; 10538 }, 10539 10540 _cacheHelperProportions: function() { 10541 this.helperProportions = { 10542 width: this.helper.outerWidth(), 10543 height: this.helper.outerHeight() 10544 }; 10545 }, 10546 10547 _setContainment: function() { 10548 10549 var isUserScrollable, c, ce, 10550 o = this.options, 10551 document = this.document[ 0 ]; 10552 10553 this.relativeContainer = null; 10554 10555 if ( !o.containment ) { 10556 this.containment = null; 10557 return; 10558 } 10559 10560 if ( o.containment === "window" ) { 10561 this.containment = [ 10562 $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, 10563 $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, 10564 $( window ).scrollLeft() + $( window ).width() - 10565 this.helperProportions.width - this.margins.left, 10566 $( window ).scrollTop() + 10567 ( $( window ).height() || document.body.parentNode.scrollHeight ) - 10568 this.helperProportions.height - this.margins.top 10569 ]; 10570 return; 10571 } 10572 10573 if ( o.containment === "document" ) { 10574 this.containment = [ 10575 0, 10576 0, 10577 $( document ).width() - this.helperProportions.width - this.margins.left, 10578 ( $( document ).height() || document.body.parentNode.scrollHeight ) - 10579 this.helperProportions.height - this.margins.top 10580 ]; 10581 return; 10582 } 10583 10584 if ( o.containment.constructor === Array ) { 10585 this.containment = o.containment; 10586 return; 10587 } 10588 10589 if ( o.containment === "parent" ) { 10590 o.containment = this.helper[ 0 ].parentNode; 10591 } 10592 10593 c = $( o.containment ); 10594 ce = c[ 0 ]; 10595 10596 if ( !ce ) { 10597 return; 10598 } 10599 10600 isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) ); 10601 10602 this.containment = [ 10603 ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + 10604 ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), 10605 ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + 10606 ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), 10607 ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 10608 ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - 10609 ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - 10610 this.helperProportions.width - 10611 this.margins.left - 10612 this.margins.right, 10613 ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - 10614 ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - 10615 ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - 10616 this.helperProportions.height - 10617 this.margins.top - 10618 this.margins.bottom 10619 ]; 10620 this.relativeContainer = c; 10621 }, 10622 10623 _convertPositionTo: function( d, pos ) { 10624 10625 if ( !pos ) { 10626 pos = this.position; 10627 } 10628 10629 var mod = d === "absolute" ? 1 : -1, 10630 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); 10631 10632 return { 10633 top: ( 10634 10635 // The absolute mouse position 10636 pos.top + 10637 10638 // Only for relative positioned nodes: Relative offset from element to offset parent 10639 this.offset.relative.top * mod + 10640 10641 // The offsetParent's offset without borders (offset + border) 10642 this.offset.parent.top * mod - 10643 ( ( this.cssPosition === "fixed" ? 10644 -this.offset.scroll.top : 10645 ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) 10646 ), 10647 left: ( 10648 10649 // The absolute mouse position 10650 pos.left + 10651 10652 // Only for relative positioned nodes: Relative offset from element to offset parent 10653 this.offset.relative.left * mod + 10654 10655 // The offsetParent's offset without borders (offset + border) 10656 this.offset.parent.left * mod - 10657 ( ( this.cssPosition === "fixed" ? 10658 -this.offset.scroll.left : 10659 ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) 10660 ) 10661 }; 10662 10663 }, 10664 10665 _generatePosition: function( event, constrainPosition ) { 10666 10667 var containment, co, top, left, 10668 o = this.options, 10669 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ), 10670 pageX = event.pageX, 10671 pageY = event.pageY; 10672 10673 // Cache the scroll 10674 if ( !scrollIsRootNode || !this.offset.scroll ) { 10675 this.offset.scroll = { 10676 top: this.scrollParent.scrollTop(), 10677 left: this.scrollParent.scrollLeft() 10678 }; 10679 } 10680 10681 /* 10682 * - Position constraining - 10683 * Constrain the position to a mix of grid, containment. 10684 */ 10685 10686 // If we are not dragging yet, we won't check for options 10687 if ( constrainPosition ) { 10688 if ( this.containment ) { 10689 if ( this.relativeContainer ) { 10690 co = this.relativeContainer.offset(); 10691 containment = [ 10692 this.containment[ 0 ] + co.left, 10693 this.containment[ 1 ] + co.top, 10694 this.containment[ 2 ] + co.left, 10695 this.containment[ 3 ] + co.top 10696 ]; 10697 } else { 10698 containment = this.containment; 10699 } 10700 10701 if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { 10702 pageX = containment[ 0 ] + this.offset.click.left; 10703 } 10704 if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { 10705 pageY = containment[ 1 ] + this.offset.click.top; 10706 } 10707 if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { 10708 pageX = containment[ 2 ] + this.offset.click.left; 10709 } 10710 if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { 10711 pageY = containment[ 3 ] + this.offset.click.top; 10712 } 10713 } 10714 10715 if ( o.grid ) { 10716 10717 //Check for grid elements set to 0 to prevent divide by 0 error causing invalid 10718 // argument errors in IE (see ticket #6950) 10719 top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - 10720 this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; 10721 pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || 10722 top - this.offset.click.top > containment[ 3 ] ) ? 10723 top : 10724 ( ( top - this.offset.click.top >= containment[ 1 ] ) ? 10725 top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; 10726 10727 left = o.grid[ 0 ] ? this.originalPageX + 10728 Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : 10729 this.originalPageX; 10730 pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || 10731 left - this.offset.click.left > containment[ 2 ] ) ? 10732 left : 10733 ( ( left - this.offset.click.left >= containment[ 0 ] ) ? 10734 left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; 10735 } 10736 10737 if ( o.axis === "y" ) { 10738 pageX = this.originalPageX; 10739 } 10740 10741 if ( o.axis === "x" ) { 10742 pageY = this.originalPageY; 10743 } 10744 } 10745 10746 return { 10747 top: ( 10748 10749 // The absolute mouse position 10750 pageY - 10751 10752 // Click offset (relative to the element) 10753 this.offset.click.top - 10754 10755 // Only for relative positioned nodes: Relative offset from element to offset parent 10756 this.offset.relative.top - 10757 10758 // The offsetParent's offset without borders (offset + border) 10759 this.offset.parent.top + 10760 ( this.cssPosition === "fixed" ? 10761 -this.offset.scroll.top : 10762 ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) 10763 ), 10764 left: ( 10765 10766 // The absolute mouse position 10767 pageX - 10768 10769 // Click offset (relative to the element) 10770 this.offset.click.left - 10771 10772 // Only for relative positioned nodes: Relative offset from element to offset parent 10773 this.offset.relative.left - 10774 10775 // The offsetParent's offset without borders (offset + border) 10776 this.offset.parent.left + 10777 ( this.cssPosition === "fixed" ? 10778 -this.offset.scroll.left : 10779 ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) 10780 ) 10781 }; 10782 10783 }, 10784 10785 _clear: function() { 10786 this._removeClass( this.helper, "ui-draggable-dragging" ); 10787 if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { 10788 this.helper.remove(); 10789 } 10790 this.helper = null; 10791 this.cancelHelperRemoval = false; 10792 if ( this.destroyOnClear ) { 10793 this.destroy(); 10794 } 10795 }, 10796 10797 // From now on bulk stuff - mainly helpers 10798 10799 _trigger: function( type, event, ui ) { 10800 ui = ui || this._uiHash(); 10801 $.ui.plugin.call( this, type, [ event, ui, this ], true ); 10802 10803 // Absolute position and offset (see #6884 ) have to be recalculated after plugins 10804 if ( /^(drag|start|stop)/.test( type ) ) { 10805 this.positionAbs = this._convertPositionTo( "absolute" ); 10806 ui.offset = this.positionAbs; 10807 } 10808 return $.Widget.prototype._trigger.call( this, type, event, ui ); 10809 }, 10810 10811 plugins: {}, 10812 10813 _uiHash: function() { 10814 return { 10815 helper: this.helper, 10816 position: this.position, 10817 originalPosition: this.originalPosition, 10818 offset: this.positionAbs 10819 }; 10820 } 10821 10822} ); 10823 10824$.ui.plugin.add( "draggable", "connectToSortable", { 10825 start: function( event, ui, draggable ) { 10826 var uiSortable = $.extend( {}, ui, { 10827 item: draggable.element 10828 } ); 10829 10830 draggable.sortables = []; 10831 $( draggable.options.connectToSortable ).each( function() { 10832 var sortable = $( this ).sortable( "instance" ); 10833 10834 if ( sortable && !sortable.options.disabled ) { 10835 draggable.sortables.push( sortable ); 10836 10837 // RefreshPositions is called at drag start to refresh the containerCache 10838 // which is used in drag. This ensures it's initialized and synchronized 10839 // with any changes that might have happened on the page since initialization. 10840 sortable.refreshPositions(); 10841 sortable._trigger( "activate", event, uiSortable ); 10842 } 10843 } ); 10844 }, 10845 stop: function( event, ui, draggable ) { 10846 var uiSortable = $.extend( {}, ui, { 10847 item: draggable.element 10848 } ); 10849 10850 draggable.cancelHelperRemoval = false; 10851 10852 $.each( draggable.sortables, function() { 10853 var sortable = this; 10854 10855 if ( sortable.isOver ) { 10856 sortable.isOver = 0; 10857 10858 // Allow this sortable to handle removing the helper 10859 draggable.cancelHelperRemoval = true; 10860 sortable.cancelHelperRemoval = false; 10861 10862 // Use _storedCSS To restore properties in the sortable, 10863 // as this also handles revert (#9675) since the draggable 10864 // may have modified them in unexpected ways (#8809) 10865 sortable._storedCSS = { 10866 position: sortable.placeholder.css( "position" ), 10867 top: sortable.placeholder.css( "top" ), 10868 left: sortable.placeholder.css( "left" ) 10869 }; 10870 10871 sortable._mouseStop( event ); 10872 10873 // Once drag has ended, the sortable should return to using 10874 // its original helper, not the shared helper from draggable 10875 sortable.options.helper = sortable.options._helper; 10876 } else { 10877 10878 // Prevent this Sortable from removing the helper. 10879 // However, don't set the draggable to remove the helper 10880 // either as another connected Sortable may yet handle the removal. 10881 sortable.cancelHelperRemoval = true; 10882 10883 sortable._trigger( "deactivate", event, uiSortable ); 10884 } 10885 } ); 10886 }, 10887 drag: function( event, ui, draggable ) { 10888 $.each( draggable.sortables, function() { 10889 var innermostIntersecting = false, 10890 sortable = this; 10891 10892 // Copy over variables that sortable's _intersectsWith uses 10893 sortable.positionAbs = draggable.positionAbs; 10894 sortable.helperProportions = draggable.helperProportions; 10895 sortable.offset.click = draggable.offset.click; 10896 10897 if ( sortable._intersectsWith( sortable.containerCache ) ) { 10898 innermostIntersecting = true; 10899 10900 $.each( draggable.sortables, function() { 10901 10902 // Copy over variables that sortable's _intersectsWith uses 10903 this.positionAbs = draggable.positionAbs; 10904 this.helperProportions = draggable.helperProportions; 10905 this.offset.click = draggable.offset.click; 10906 10907 if ( this !== sortable && 10908 this._intersectsWith( this.containerCache ) && 10909 $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) { 10910 innermostIntersecting = false; 10911 } 10912 10913 return innermostIntersecting; 10914 } ); 10915 } 10916 10917 if ( innermostIntersecting ) { 10918 10919 // If it intersects, we use a little isOver variable and set it once, 10920 // so that the move-in stuff gets fired only once. 10921 if ( !sortable.isOver ) { 10922 sortable.isOver = 1; 10923 10924 // Store draggable's parent in case we need to reappend to it later. 10925 draggable._parent = ui.helper.parent(); 10926 10927 sortable.currentItem = ui.helper 10928 .appendTo( sortable.element ) 10929 .data( "ui-sortable-item", true ); 10930 10931 // Store helper option to later restore it 10932 sortable.options._helper = sortable.options.helper; 10933 10934 sortable.options.helper = function() { 10935 return ui.helper[ 0 ]; 10936 }; 10937 10938 // Fire the start events of the sortable with our passed browser event, 10939 // and our own helper (so it doesn't create a new one) 10940 event.target = sortable.currentItem[ 0 ]; 10941 sortable._mouseCapture( event, true ); 10942 sortable._mouseStart( event, true, true ); 10943 10944 // Because the browser event is way off the new appended portlet, 10945 // modify necessary variables to reflect the changes 10946 sortable.offset.click.top = draggable.offset.click.top; 10947 sortable.offset.click.left = draggable.offset.click.left; 10948 sortable.offset.parent.left -= draggable.offset.parent.left - 10949 sortable.offset.parent.left; 10950 sortable.offset.parent.top -= draggable.offset.parent.top - 10951 sortable.offset.parent.top; 10952 10953 draggable._trigger( "toSortable", event ); 10954 10955 // Inform draggable that the helper is in a valid drop zone, 10956 // used solely in the revert option to handle "valid/invalid". 10957 draggable.dropped = sortable.element; 10958 10959 // Need to refreshPositions of all sortables in the case that 10960 // adding to one sortable changes the location of the other sortables (#9675) 10961 $.each( draggable.sortables, function() { 10962 this.refreshPositions(); 10963 } ); 10964 10965 // Hack so receive/update callbacks work (mostly) 10966 draggable.currentItem = draggable.element; 10967 sortable.fromOutside = draggable; 10968 } 10969 10970 if ( sortable.currentItem ) { 10971 sortable._mouseDrag( event ); 10972 10973 // Copy the sortable's position because the draggable's can potentially reflect 10974 // a relative position, while sortable is always absolute, which the dragged 10975 // element has now become. (#8809) 10976 ui.position = sortable.position; 10977 } 10978 } else { 10979 10980 // If it doesn't intersect with the sortable, and it intersected before, 10981 // we fake the drag stop of the sortable, but make sure it doesn't remove 10982 // the helper by using cancelHelperRemoval. 10983 if ( sortable.isOver ) { 10984 10985 sortable.isOver = 0; 10986 sortable.cancelHelperRemoval = true; 10987 10988 // Calling sortable's mouseStop would trigger a revert, 10989 // so revert must be temporarily false until after mouseStop is called. 10990 sortable.options._revert = sortable.options.revert; 10991 sortable.options.revert = false; 10992 10993 sortable._trigger( "out", event, sortable._uiHash( sortable ) ); 10994 sortable._mouseStop( event, true ); 10995 10996 // Restore sortable behaviors that were modfied 10997 // when the draggable entered the sortable area (#9481) 10998 sortable.options.revert = sortable.options._revert; 10999 sortable.options.helper = sortable.options._helper; 11000 11001 if ( sortable.placeholder ) { 11002 sortable.placeholder.remove(); 11003 } 11004 11005 // Restore and recalculate the draggable's offset considering the sortable 11006 // may have modified them in unexpected ways. (#8809, #10669) 11007 ui.helper.appendTo( draggable._parent ); 11008 draggable._refreshOffsets( event ); 11009 ui.position = draggable._generatePosition( event, true ); 11010 11011 draggable._trigger( "fromSortable", event ); 11012 11013 // Inform draggable that the helper is no longer in a valid drop zone 11014 draggable.dropped = false; 11015 11016 // Need to refreshPositions of all sortables just in case removing 11017 // from one sortable changes the location of other sortables (#9675) 11018 $.each( draggable.sortables, function() { 11019 this.refreshPositions(); 11020 } ); 11021 } 11022 } 11023 } ); 11024 } 11025} ); 11026 11027$.ui.plugin.add( "draggable", "cursor", { 11028 start: function( event, ui, instance ) { 11029 var t = $( "body" ), 11030 o = instance.options; 11031 11032 if ( t.css( "cursor" ) ) { 11033 o._cursor = t.css( "cursor" ); 11034 } 11035 t.css( "cursor", o.cursor ); 11036 }, 11037 stop: function( event, ui, instance ) { 11038 var o = instance.options; 11039 if ( o._cursor ) { 11040 $( "body" ).css( "cursor", o._cursor ); 11041 } 11042 } 11043} ); 11044 11045$.ui.plugin.add( "draggable", "opacity", { 11046 start: function( event, ui, instance ) { 11047 var t = $( ui.helper ), 11048 o = instance.options; 11049 if ( t.css( "opacity" ) ) { 11050 o._opacity = t.css( "opacity" ); 11051 } 11052 t.css( "opacity", o.opacity ); 11053 }, 11054 stop: function( event, ui, instance ) { 11055 var o = instance.options; 11056 if ( o._opacity ) { 11057 $( ui.helper ).css( "opacity", o._opacity ); 11058 } 11059 } 11060} ); 11061 11062$.ui.plugin.add( "draggable", "scroll", { 11063 start: function( event, ui, i ) { 11064 if ( !i.scrollParentNotHidden ) { 11065 i.scrollParentNotHidden = i.helper.scrollParent( false ); 11066 } 11067 11068 if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && 11069 i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { 11070 i.overflowOffset = i.scrollParentNotHidden.offset(); 11071 } 11072 }, 11073 drag: function( event, ui, i ) { 11074 11075 var o = i.options, 11076 scrolled = false, 11077 scrollParent = i.scrollParentNotHidden[ 0 ], 11078 document = i.document[ 0 ]; 11079 11080 if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { 11081 if ( !o.axis || o.axis !== "x" ) { 11082 if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < 11083 o.scrollSensitivity ) { 11084 scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; 11085 } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { 11086 scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed; 11087 } 11088 } 11089 11090 if ( !o.axis || o.axis !== "y" ) { 11091 if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < 11092 o.scrollSensitivity ) { 11093 scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; 11094 } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { 11095 scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed; 11096 } 11097 } 11098 11099 } else { 11100 11101 if ( !o.axis || o.axis !== "x" ) { 11102 if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { 11103 scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); 11104 } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < 11105 o.scrollSensitivity ) { 11106 scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); 11107 } 11108 } 11109 11110 if ( !o.axis || o.axis !== "y" ) { 11111 if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { 11112 scrolled = $( document ).scrollLeft( 11113 $( document ).scrollLeft() - o.scrollSpeed 11114 ); 11115 } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < 11116 o.scrollSensitivity ) { 11117 scrolled = $( document ).scrollLeft( 11118 $( document ).scrollLeft() + o.scrollSpeed 11119 ); 11120 } 11121 } 11122 11123 } 11124 11125 if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { 11126 $.ui.ddmanager.prepareOffsets( i, event ); 11127 } 11128 11129 } 11130} ); 11131 11132$.ui.plugin.add( "draggable", "snap", { 11133 start: function( event, ui, i ) { 11134 11135 var o = i.options; 11136 11137 i.snapElements = []; 11138 11139 $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) 11140 .each( function() { 11141 var $t = $( this ), 11142 $o = $t.offset(); 11143 if ( this !== i.element[ 0 ] ) { 11144 i.snapElements.push( { 11145 item: this, 11146 width: $t.outerWidth(), height: $t.outerHeight(), 11147 top: $o.top, left: $o.left 11148 } ); 11149 } 11150 } ); 11151 11152 }, 11153 drag: function( event, ui, inst ) { 11154 11155 var ts, bs, ls, rs, l, r, t, b, i, first, 11156 o = inst.options, 11157 d = o.snapTolerance, 11158 x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, 11159 y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; 11160 11161 for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { 11162 11163 l = inst.snapElements[ i ].left - inst.margins.left; 11164 r = l + inst.snapElements[ i ].width; 11165 t = inst.snapElements[ i ].top - inst.margins.top; 11166 b = t + inst.snapElements[ i ].height; 11167 11168 if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || 11169 !$.contains( inst.snapElements[ i ].item.ownerDocument, 11170 inst.snapElements[ i ].item ) ) { 11171 if ( inst.snapElements[ i ].snapping ) { 11172 if ( inst.options.snap.release ) { 11173 inst.options.snap.release.call( 11174 inst.element, 11175 event, 11176 $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) 11177 ); 11178 } 11179 } 11180 inst.snapElements[ i ].snapping = false; 11181 continue; 11182 } 11183 11184 if ( o.snapMode !== "inner" ) { 11185 ts = Math.abs( t - y2 ) <= d; 11186 bs = Math.abs( b - y1 ) <= d; 11187 ls = Math.abs( l - x2 ) <= d; 11188 rs = Math.abs( r - x1 ) <= d; 11189 if ( ts ) { 11190 ui.position.top = inst._convertPositionTo( "relative", { 11191 top: t - inst.helperProportions.height, 11192 left: 0 11193 } ).top; 11194 } 11195 if ( bs ) { 11196 ui.position.top = inst._convertPositionTo( "relative", { 11197 top: b, 11198 left: 0 11199 } ).top; 11200 } 11201 if ( ls ) { 11202 ui.position.left = inst._convertPositionTo( "relative", { 11203 top: 0, 11204 left: l - inst.helperProportions.width 11205 } ).left; 11206 } 11207 if ( rs ) { 11208 ui.position.left = inst._convertPositionTo( "relative", { 11209 top: 0, 11210 left: r 11211 } ).left; 11212 } 11213 } 11214 11215 first = ( ts || bs || ls || rs ); 11216 11217 if ( o.snapMode !== "outer" ) { 11218 ts = Math.abs( t - y1 ) <= d; 11219 bs = Math.abs( b - y2 ) <= d; 11220 ls = Math.abs( l - x1 ) <= d; 11221 rs = Math.abs( r - x2 ) <= d; 11222 if ( ts ) { 11223 ui.position.top = inst._convertPositionTo( "relative", { 11224 top: t, 11225 left: 0 11226 } ).top; 11227 } 11228 if ( bs ) { 11229 ui.position.top = inst._convertPositionTo( "relative", { 11230 top: b - inst.helperProportions.height, 11231 left: 0 11232 } ).top; 11233 } 11234 if ( ls ) { 11235 ui.position.left = inst._convertPositionTo( "relative", { 11236 top: 0, 11237 left: l 11238 } ).left; 11239 } 11240 if ( rs ) { 11241 ui.position.left = inst._convertPositionTo( "relative", { 11242 top: 0, 11243 left: r - inst.helperProportions.width 11244 } ).left; 11245 } 11246 } 11247 11248 if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { 11249 if ( inst.options.snap.snap ) { 11250 inst.options.snap.snap.call( 11251 inst.element, 11252 event, 11253 $.extend( inst._uiHash(), { 11254 snapItem: inst.snapElements[ i ].item 11255 } ) ); 11256 } 11257 } 11258 inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); 11259 11260 } 11261 11262 } 11263} ); 11264 11265$.ui.plugin.add( "draggable", "stack", { 11266 start: function( event, ui, instance ) { 11267 var min, 11268 o = instance.options, 11269 group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { 11270 return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - 11271 ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); 11272 } ); 11273 11274 if ( !group.length ) { 11275 return; 11276 } 11277 11278 min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; 11279 $( group ).each( function( i ) { 11280 $( this ).css( "zIndex", min + i ); 11281 } ); 11282 this.css( "zIndex", ( min + group.length ) ); 11283 } 11284} ); 11285 11286$.ui.plugin.add( "draggable", "zIndex", { 11287 start: function( event, ui, instance ) { 11288 var t = $( ui.helper ), 11289 o = instance.options; 11290 11291 if ( t.css( "zIndex" ) ) { 11292 o._zIndex = t.css( "zIndex" ); 11293 } 11294 t.css( "zIndex", o.zIndex ); 11295 }, 11296 stop: function( event, ui, instance ) { 11297 var o = instance.options; 11298 11299 if ( o._zIndex ) { 11300 $( ui.helper ).css( "zIndex", o._zIndex ); 11301 } 11302 } 11303} ); 11304 11305var widgetsDraggable = $.ui.draggable; 11306 11307 11308/*! 11309 * jQuery UI Resizable 1.13.2 11310 * http://jqueryui.com
vendor: 18,161 bytes, lines 11311-12023
11311 * 11312 * Copyright jQuery Foundation and other contributors 11313 * Released under the MIT license. 11314 * http://jquery.org/license 11315 */ 11316 11317//>>label: Resizable 11318//>>group: Interactions 11319//>>description: Enables resize functionality for any element. 11320//>>docs: http://api.jqueryui.com/resizable/ 11321//>>demos: http://jqueryui.com/resizable/ 11322//>>css.structure: ../../themes/base/core.css 11323//>>css.structure: ../../themes/base/resizable.css 11324//>>css.theme: ../../themes/base/theme.css 11325 11326 11327$.widget( "ui.resizable", $.ui.mouse, { 11328 version: "1.13.2", 11329 widgetEventPrefix: "resize", 11330 options: { 11331 alsoResize: false, 11332 animate: false, 11333 animateDuration: "slow", 11334 animateEasing: "swing", 11335 aspectRatio: false, 11336 autoHide: false, 11337 classes: { 11338 "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" 11339 }, 11340 containment: false, 11341 ghost: false, 11342 grid: false, 11343 handles: "e,s,se", 11344 helper: false, 11345 maxHeight: null, 11346 maxWidth: null, 11347 minHeight: 10, 11348 minWidth: 10, 11349 11350 // See #7960 11351 zIndex: 90, 11352 11353 // Callbacks 11354 resize: null, 11355 start: null, 11356 stop: null 11357 }, 11358 11359 _num: function( value ) { 11360 return parseFloat( value ) || 0; 11361 }, 11362 11363 _isNumber: function( value ) { 11364 return !isNaN( parseFloat( value ) ); 11365 }, 11366 11367 _hasScroll: function( el, a ) { 11368 11369 if ( $( el ).css( "overflow" ) === "hidden" ) { 11370 return false; 11371 } 11372 11373 var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", 11374 has = false; 11375 11376 if ( el[ scroll ] > 0 ) { 11377 return true; 11378 } 11379 11380 // TODO: determine which cases actually cause this to happen 11381 // if the element doesn't have the scroll set, see if it's possible to 11382 // set the scroll 11383 try { 11384 el[ scroll ] = 1; 11385 has = ( el[ scroll ] > 0 ); 11386 el[ scroll ] = 0; 11387 } catch ( e ) { 11388 11389 // `el` might be a string, then setting `scroll` will throw 11390 // an error in strict mode; ignore it. 11391 } 11392 return has; 11393 }, 11394 11395 _create: function() { 11396 11397 var margins, 11398 o = this.options, 11399 that = this; 11400 this._addClass( "ui-resizable" ); 11401 11402 $.extend( this, { 11403 _aspectRatio: !!( o.aspectRatio ), 11404 aspectRatio: o.aspectRatio, 11405 originalElement: this.element, 11406 _proportionallyResizeElements: [], 11407 _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null 11408 } ); 11409 11410 // Wrap the element if it cannot hold child nodes 11411 if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) { 11412 11413 this.element.wrap( 11414 $( "<div class='ui-wrapper'></div>" ).css( { 11415 overflow: "hidden", 11416 position: this.element.css( "position" ), 11417 width: this.element.outerWidth(), 11418 height: this.element.outerHeight(), 11419 top: this.element.css( "top" ), 11420 left: this.element.css( "left" ) 11421 } ) 11422 ); 11423 11424 this.element = this.element.parent().data( 11425 "ui-resizable", this.element.resizable( "instance" ) 11426 ); 11427 11428 this.elementIsWrapper = true; 11429 11430 margins = { 11431 marginTop: this.originalElement.css( "marginTop" ), 11432 marginRight: this.originalElement.css( "marginRight" ), 11433 marginBottom: this.originalElement.css( "marginBottom" ), 11434 marginLeft: this.originalElement.css( "marginLeft" ) 11435 }; 11436 11437 this.element.css( margins ); 11438 this.originalElement.css( "margin", 0 ); 11439 11440 // support: Safari 11441 // Prevent Safari textarea resize 11442 this.originalResizeStyle = this.originalElement.css( "resize" ); 11443 this.originalElement.css( "resize", "none" ); 11444 11445 this._proportionallyResizeElements.push( this.originalElement.css( { 11446 position: "static", 11447 zoom: 1, 11448 display: "block" 11449 } ) ); 11450 11451 // Support: IE9 11452 // avoid IE jump (hard set the margin) 11453 this.originalElement.css( margins ); 11454 11455 this._proportionallyResize(); 11456 } 11457 11458 this._setupHandles(); 11459 11460 if ( o.autoHide ) { 11461 $( this.element ) 11462 .on( "mouseenter", function() { 11463 if ( o.disabled ) { 11464 return; 11465 } 11466 that._removeClass( "ui-resizable-autohide" ); 11467 that._handles.show(); 11468 } ) 11469 .on( "mouseleave", function() { 11470 if ( o.disabled ) { 11471 return; 11472 } 11473 if ( !that.resizing ) { 11474 that._addClass( "ui-resizable-autohide" ); 11475 that._handles.hide(); 11476 } 11477 } ); 11478 } 11479 11480 this._mouseInit(); 11481 }, 11482 11483 _destroy: function() { 11484 11485 this._mouseDestroy(); 11486 this._addedHandles.remove(); 11487 11488 var wrapper, 11489 _destroy = function( exp ) { 11490 $( exp ) 11491 .removeData( "resizable" ) 11492 .removeData( "ui-resizable" ) 11493 .off( ".resizable" ); 11494 }; 11495 11496 // TODO: Unwrap at same DOM position 11497 if ( this.elementIsWrapper ) { 11498 _destroy( this.element ); 11499 wrapper = this.element; 11500 this.originalElement.css( { 11501 position: wrapper.css( "position" ), 11502 width: wrapper.outerWidth(), 11503 height: wrapper.outerHeight(), 11504 top: wrapper.css( "top" ), 11505 left: wrapper.css( "left" ) 11506 } ).insertAfter( wrapper ); 11507 wrapper.remove(); 11508 } 11509 11510 this.originalElement.css( "resize", this.originalResizeStyle ); 11511 _destroy( this.originalElement ); 11512 11513 return this; 11514 }, 11515 11516 _setOption: function( key, value ) { 11517 this._super( key, value ); 11518 11519 switch ( key ) { 11520 case "handles": 11521 this._removeHandles(); 11522 this._setupHandles(); 11523 break; 11524 case "aspectRatio": 11525 this._aspectRatio = !!value; 11526 break; 11527 default: 11528 break; 11529 } 11530 }, 11531 11532 _setupHandles: function() { 11533 var o = this.options, handle, i, n, hname, axis, that = this; 11534 this.handles = o.handles || 11535 ( !$( ".ui-resizable-handle", this.element ).length ? 11536 "e,s,se" : { 11537 n: ".ui-resizable-n", 11538 e: ".ui-resizable-e", 11539 s: ".ui-resizable-s", 11540 w: ".ui-resizable-w", 11541 se: ".ui-resizable-se", 11542 sw: ".ui-resizable-sw", 11543 ne: ".ui-resizable-ne", 11544 nw: ".ui-resizable-nw" 11545 } ); 11546 11547 this._handles = $(); 11548 this._addedHandles = $(); 11549 if ( this.handles.constructor === String ) { 11550 11551 if ( this.handles === "all" ) { 11552 this.handles = "n,e,s,w,se,sw,ne,nw"; 11553 } 11554 11555 n = this.handles.split( "," ); 11556 this.handles = {}; 11557 11558 for ( i = 0; i < n.length; i++ ) { 11559 11560 handle = String.prototype.trim.call( n[ i ] ); 11561 hname = "ui-resizable-" + handle; 11562 axis = $( "<div>" ); 11563 this._addClass( axis, "ui-resizable-handle " + hname ); 11564 11565 axis.css( { zIndex: o.zIndex } ); 11566 11567 this.handles[ handle ] = ".ui-resizable-" + handle; 11568 if ( !this.element.children( this.handles[ handle ] ).length ) { 11569 this.element.append( axis ); 11570 this._addedHandles = this._addedHandles.add( axis ); 11571 } 11572 } 11573 11574 } 11575 11576 this._renderAxis = function( target ) { 11577 11578 var i, axis, padPos, padWrapper; 11579 11580 target = target || this.element; 11581 11582 for ( i in this.handles ) { 11583 11584 if ( this.handles[ i ].constructor === String ) { 11585 this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show(); 11586 } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) { 11587 this.handles[ i ] = $( this.handles[ i ] ); 11588 this._on( this.handles[ i ], { "mousedown": that._mouseDown } ); 11589 } 11590 11591 if ( this.elementIsWrapper && 11592 this.originalElement[ 0 ] 11593 .nodeName 11594 .match( /^(textarea|input|select|button)$/i ) ) { 11595 axis = $( this.handles[ i ], this.element ); 11596 11597 padWrapper = /sw|ne|nw|se|n|s/.test( i ) ? 11598 axis.outerHeight() : 11599 axis.outerWidth(); 11600 11601 padPos = [ "padding", 11602 /ne|nw|n/.test( i ) ? "Top" : 11603 /se|sw|s/.test( i ) ? "Bottom" : 11604 /^e$/.test( i ) ? "Right" : "Left" ].join( "" ); 11605 11606 target.css( padPos, padWrapper ); 11607 11608 this._proportionallyResize(); 11609 } 11610 11611 this._handles = this._handles.add( this.handles[ i ] ); 11612 } 11613 }; 11614 11615 // TODO: make renderAxis a prototype function 11616 this._renderAxis( this.element ); 11617 11618 this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) ); 11619 this._handles.disableSelection(); 11620 11621 this._handles.on( "mouseover", function() { 11622 if ( !that.resizing ) { 11623 if ( this.className ) { 11624 axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i ); 11625 } 11626 that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se"; 11627 } 11628 } ); 11629 11630 if ( o.autoHide ) { 11631 this._handles.hide(); 11632 this._addClass( "ui-resizable-autohide" ); 11633 } 11634 }, 11635 11636 _removeHandles: function() { 11637 this._addedHandles.remove(); 11638 }, 11639 11640 _mouseCapture: function( event ) { 11641 var i, handle, 11642 capture = false; 11643 11644 for ( i in this.handles ) { 11645 handle = $( this.handles[ i ] )[ 0 ]; 11646 if ( handle === event.target || $.contains( handle, event.target ) ) { 11647 capture = true; 11648 } 11649 } 11650 11651 return !this.options.disabled && capture; 11652 }, 11653 11654 _mouseStart: function( event ) { 11655 11656 var curleft, curtop, cursor, 11657 o = this.options, 11658 el = this.element; 11659 11660 this.resizing = true; 11661 11662 this._renderProxy(); 11663 11664 curleft = this._num( this.helper.css( "left" ) ); 11665 curtop = this._num( this.helper.css( "top" ) ); 11666 11667 if ( o.containment ) { 11668 curleft += $( o.containment ).scrollLeft() || 0; 11669 curtop += $( o.containment ).scrollTop() || 0; 11670 } 11671 11672 this.offset = this.helper.offset(); 11673 this.position = { left: curleft, top: curtop }; 11674 11675 this.size = this._helper ? { 11676 width: this.helper.width(), 11677 height: this.helper.height() 11678 } : { 11679 width: el.width(), 11680 height: el.height() 11681 }; 11682 11683 this.originalSize = this._helper ? { 11684 width: el.outerWidth(), 11685 height: el.outerHeight() 11686 } : { 11687 width: el.width(), 11688 height: el.height() 11689 }; 11690 11691 this.sizeDiff = { 11692 width: el.outerWidth() - el.width(), 11693 height: el.outerHeight() - el.height() 11694 }; 11695 11696 this.originalPosition = { left: curleft, top: curtop }; 11697 this.originalMousePosition = { left: event.pageX, top: event.pageY }; 11698 11699 this.aspectRatio = ( typeof o.aspectRatio === "number" ) ? 11700 o.aspectRatio : 11701 ( ( this.originalSize.width / this.originalSize.height ) || 1 ); 11702 11703 cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" ); 11704 $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor ); 11705 11706 this._addClass( "ui-resizable-resizing" ); 11707 this._propagate( "start", event ); 11708 return true; 11709 }, 11710 11711 _mouseDrag: function( event ) { 11712 11713 var data, props, 11714 smp = this.originalMousePosition, 11715 a = this.axis, 11716 dx = ( event.pageX - smp.left ) || 0, 11717 dy = ( event.pageY - smp.top ) || 0, 11718 trigger = this._change[ a ]; 11719 11720 this._updatePrevProperties(); 11721 11722 if ( !trigger ) { 11723 return false; 11724 } 11725 11726 data = trigger.apply( this, [ event, dx, dy ] ); 11727 11728 this._updateVirtualBoundaries( event.shiftKey ); 11729 if ( this._aspectRatio || event.shiftKey ) { 11730 data = this._updateRatio( data, event ); 11731 } 11732 11733 data = this._respectSize( data, event ); 11734 11735 this._updateCache( data ); 11736 11737 this._propagate( "resize", event ); 11738 11739 props = this._applyChanges(); 11740 11741 if ( !this._helper && this._proportionallyResizeElements.length ) { 11742 this._proportionallyResize(); 11743 } 11744 11745 if ( !$.isEmptyObject( props ) ) { 11746 this._updatePrevProperties(); 11747 this._trigger( "resize", event, this.ui() ); 11748 this._applyChanges(); 11749 } 11750 11751 return false; 11752 }, 11753 11754 _mouseStop: function( event ) { 11755 11756 this.resizing = false; 11757 var pr, ista, soffseth, soffsetw, s, left, top, 11758 o = this.options, that = this; 11759 11760 if ( this._helper ) { 11761 11762 pr = this._proportionallyResizeElements; 11763 ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ); 11764 soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height; 11765 soffsetw = ista ? 0 : that.sizeDiff.width; 11766 11767 s = { 11768 width: ( that.helper.width() - soffsetw ), 11769 height: ( that.helper.height() - soffseth ) 11770 }; 11771 left = ( parseFloat( that.element.css( "left" ) ) + 11772 ( that.position.left - that.originalPosition.left ) ) || null; 11773 top = ( parseFloat( that.element.css( "top" ) ) + 11774 ( that.position.top - that.originalPosition.top ) ) || null; 11775 11776 if ( !o.animate ) { 11777 this.element.css( $.extend( s, { top: top, left: left } ) ); 11778 } 11779 11780 that.helper.height( that.size.height ); 11781 that.helper.width( that.size.width ); 11782 11783 if ( this._helper && !o.animate ) { 11784 this._proportionallyResize(); 11785 } 11786 } 11787 11788 $( "body" ).css( "cursor", "auto" ); 11789 11790 this._removeClass( "ui-resizable-resizing" ); 11791 11792 this._propagate( "stop", event ); 11793 11794 if ( this._helper ) { 11795 this.helper.remove(); 11796 } 11797 11798 return false; 11799 11800 }, 11801 11802 _updatePrevProperties: function() { 11803 this.prevPosition = { 11804 top: this.position.top, 11805 left: this.position.left 11806 }; 11807 this.prevSize = { 11808 width: this.size.width, 11809 height: this.size.height 11810 }; 11811 }, 11812 11813 _applyChanges: function() { 11814 var props = {}; 11815 11816 if ( this.position.top !== this.prevPosition.top ) { 11817 props.top = this.position.top + "px"; 11818 } 11819 if ( this.position.left !== this.prevPosition.left ) { 11820 props.left = this.position.left + "px"; 11821 } 11822 if ( this.size.width !== this.prevSize.width ) { 11823 props.width = this.size.width + "px"; 11824 } 11825 if ( this.size.height !== this.prevSize.height ) { 11826 props.height = this.size.height + "px"; 11827 } 11828 11829 this.helper.css( props ); 11830 11831 return props; 11832 }, 11833 11834 _updateVirtualBoundaries: function( forceAspectRatio ) { 11835 var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, 11836 o = this.options; 11837 11838 b = { 11839 minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0, 11840 maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity, 11841 minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0, 11842 maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity 11843 }; 11844 11845 if ( this._aspectRatio || forceAspectRatio ) { 11846 pMinWidth = b.minHeight * this.aspectRatio; 11847 pMinHeight = b.minWidth / this.aspectRatio; 11848 pMaxWidth = b.maxHeight * this.aspectRatio; 11849 pMaxHeight = b.maxWidth / this.aspectRatio; 11850 11851 if ( pMinWidth > b.minWidth ) { 11852 b.minWidth = pMinWidth; 11853 } 11854 if ( pMinHeight > b.minHeight ) { 11855 b.minHeight = pMinHeight; 11856 } 11857 if ( pMaxWidth < b.maxWidth ) { 11858 b.maxWidth = pMaxWidth; 11859 } 11860 if ( pMaxHeight < b.maxHeight ) { 11861 b.maxHeight = pMaxHeight; 11862 } 11863 } 11864 this._vBoundaries = b; 11865 }, 11866 11867 _updateCache: function( data ) { 11868 this.offset = this.helper.offset(); 11869 if ( this._isNumber( data.left ) ) { 11870 this.position.left = data.left; 11871 } 11872 if ( this._isNumber( data.top ) ) { 11873 this.position.top = data.top; 11874 } 11875 if ( this._isNumber( data.height ) ) { 11876 this.size.height = data.height; 11877 } 11878 if ( this._isNumber( data.width ) ) { 11879 this.size.width = data.width; 11880 } 11881 }, 11882 11883 _updateRatio: function( data ) { 11884 11885 var cpos = this.position, 11886 csize = this.size, 11887 a = this.axis; 11888 11889 if ( this._isNumber( data.height ) ) { 11890 data.width = ( data.height * this.aspectRatio ); 11891 } else if ( this._isNumber( data.width ) ) { 11892 data.height = ( data.width / this.aspectRatio ); 11893 } 11894 11895 if ( a === "sw" ) { 11896 data.left = cpos.left + ( csize.width - data.width ); 11897 data.top = null; 11898 } 11899 if ( a === "nw" ) { 11900 data.top = cpos.top + ( csize.height - data.height ); 11901 data.left = cpos.left + ( csize.width - data.width ); 11902 } 11903 11904 return data; 11905 }, 11906 11907 _respectSize: function( data ) { 11908 11909 var o = this._vBoundaries, 11910 a = this.axis, 11911 ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ), 11912 ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ), 11913 isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ), 11914 isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ), 11915 dw = this.originalPosition.left + this.originalSize.width, 11916 dh = this.originalPosition.top + this.originalSize.height, 11917 cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a ); 11918 if ( isminw ) { 11919 data.width = o.minWidth; 11920 } 11921 if ( isminh ) { 11922 data.height = o.minHeight; 11923 } 11924 if ( ismaxw ) { 11925 data.width = o.maxWidth; 11926 } 11927 if ( ismaxh ) { 11928 data.height = o.maxHeight; 11929 } 11930 11931 if ( isminw && cw ) { 11932 data.left = dw - o.minWidth; 11933 } 11934 if ( ismaxw && cw ) { 11935 data.left = dw - o.maxWidth; 11936 } 11937 if ( isminh && ch ) { 11938 data.top = dh - o.minHeight; 11939 } 11940 if ( ismaxh && ch ) { 11941 data.top = dh - o.maxHeight; 11942 } 11943 11944 // Fixing jump error on top/left - bug #2330 11945 if ( !data.width && !data.height && !data.left && data.top ) { 11946 data.top = null; 11947 } else if ( !data.width && !data.height && !data.top && data.left ) { 11948 data.left = null; 11949 } 11950 11951 return data; 11952 }, 11953 11954 _getPaddingPlusBorderDimensions: function( element ) { 11955 var i = 0, 11956 widths = [], 11957 borders = [ 11958 element.css( "borderTopWidth" ), 11959 element.css( "borderRightWidth" ), 11960 element.css( "borderBottomWidth" ), 11961 element.css( "borderLeftWidth" ) 11962 ], 11963 paddings = [ 11964 element.css( "paddingTop" ), 11965 element.css( "paddingRight" ), 11966 element.css( "paddingBottom" ), 11967 element.css( "paddingLeft" ) 11968 ]; 11969 11970 for ( ; i < 4; i++ ) { 11971 widths[ i ] = ( parseFloat( borders[ i ] ) || 0 ); 11972 widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 ); 11973 } 11974 11975 return { 11976 height: widths[ 0 ] + widths[ 2 ], 11977 width: widths[ 1 ] + widths[ 3 ] 11978 }; 11979 }, 11980 11981 _proportionallyResize: function() { 11982 11983 if ( !this._proportionallyResizeElements.length ) { 11984 return; 11985 } 11986 11987 var prel, 11988 i = 0, 11989 element = this.helper || this.element; 11990 11991 for ( ; i < this._proportionallyResizeElements.length; i++ ) { 11992 11993 prel = this._proportionallyResizeElements[ i ]; 11994 11995 // TODO: Seems like a bug to cache this.outerDimensions 11996 // considering that we are in a loop. 11997 if ( !this.outerDimensions ) { 11998 this.outerDimensions = this._getPaddingPlusBorderDimensions( prel ); 11999 } 12000 12001 prel.css( { 12002 height: ( element.height() - this.outerDimensions.height ) || 0, 12003 width: ( element.width() - this.outerDimensions.width ) || 0 12004 } ); 12005 12006 } 12007 12008 }, 12009 12010 _renderProxy: function() { 12011 12012 var el = this.element, o = this.options; 12013 this.elementOffset = el.offset(); 12014 12015 if ( this._helper ) { 12016 12017 this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } ); 12018 12019 this._addClass( this.helper, this._helper ); 12020 this.helper.css( { 12021 width: this.element.outerWidth(), 12022 height: this.element.outerHeight(), 12023 position: "absolute",
vendor: 6,636 bytes, lines 12024-12264
12024 left: this.elementOffset.left + "px", 12025 top: this.elementOffset.top + "px", 12026 zIndex: ++o.zIndex //TODO: Don't modify option 12027 } ); 12028 12029 this.helper 12030 .appendTo( "body" ) 12031 .disableSelection(); 12032 12033 } else { 12034 this.helper = this.element; 12035 } 12036 12037 }, 12038 12039 _change: { 12040 e: function( event, dx ) { 12041 return { width: this.originalSize.width + dx }; 12042 }, 12043 w: function( event, dx ) { 12044 var cs = this.originalSize, sp = this.originalPosition; 12045 return { left: sp.left + dx, width: cs.width - dx }; 12046 }, 12047 n: function( event, dx, dy ) { 12048 var cs = this.originalSize, sp = this.originalPosition; 12049 return { top: sp.top + dy, height: cs.height - dy }; 12050 }, 12051 s: function( event, dx, dy ) { 12052 return { height: this.originalSize.height + dy }; 12053 }, 12054 se: function( event, dx, dy ) { 12055 return $.extend( this._change.s.apply( this, arguments ), 12056 this._change.e.apply( this, [ event, dx, dy ] ) ); 12057 }, 12058 sw: function( event, dx, dy ) { 12059 return $.extend( this._change.s.apply( this, arguments ), 12060 this._change.w.apply( this, [ event, dx, dy ] ) ); 12061 }, 12062 ne: function( event, dx, dy ) { 12063 return $.extend( this._change.n.apply( this, arguments ), 12064 this._change.e.apply( this, [ event, dx, dy ] ) ); 12065 }, 12066 nw: function( event, dx, dy ) { 12067 return $.extend( this._change.n.apply( this, arguments ), 12068 this._change.w.apply( this, [ event, dx, dy ] ) ); 12069 } 12070 }, 12071 12072 _propagate: function( n, event ) { 12073 $.ui.plugin.call( this, n, [ event, this.ui() ] ); 12074 if ( n !== "resize" ) { 12075 this._trigger( n, event, this.ui() ); 12076 } 12077 }, 12078 12079 plugins: {}, 12080 12081 ui: function() { 12082 return { 12083 originalElement: this.originalElement, 12084 element: this.element, 12085 helper: this.helper, 12086 position: this.position, 12087 size: this.size, 12088 originalSize: this.originalSize, 12089 originalPosition: this.originalPosition 12090 }; 12091 } 12092 12093} ); 12094 12095/* 12096 * Resizable Extensions 12097 */ 12098 12099$.ui.plugin.add( "resizable", "animate", { 12100 12101 stop: function( event ) { 12102 var that = $( this ).resizable( "instance" ), 12103 o = that.options, 12104 pr = that._proportionallyResizeElements, 12105 ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ), 12106 soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height, 12107 soffsetw = ista ? 0 : that.sizeDiff.width, 12108 style = { 12109 width: ( that.size.width - soffsetw ), 12110 height: ( that.size.height - soffseth ) 12111 }, 12112 left = ( parseFloat( that.element.css( "left" ) ) + 12113 ( that.position.left - that.originalPosition.left ) ) || null, 12114 top = ( parseFloat( that.element.css( "top" ) ) + 12115 ( that.position.top - that.originalPosition.top ) ) || null; 12116 12117 that.element.animate( 12118 $.extend( style, top && left ? { top: top, left: left } : {} ), { 12119 duration: o.animateDuration, 12120 easing: o.animateEasing, 12121 step: function() { 12122 12123 var data = { 12124 width: parseFloat( that.element.css( "width" ) ), 12125 height: parseFloat( that.element.css( "height" ) ), 12126 top: parseFloat( that.element.css( "top" ) ), 12127 left: parseFloat( that.element.css( "left" ) ) 12128 }; 12129 12130 if ( pr && pr.length ) { 12131 $( pr[ 0 ] ).css( { width: data.width, height: data.height } ); 12132 } 12133 12134 // Propagating resize, and updating values for each animation step 12135 that._updateCache( data ); 12136 that._propagate( "resize", event ); 12137 12138 } 12139 } 12140 ); 12141 } 12142 12143} ); 12144 12145$.ui.plugin.add( "resizable", "containment", { 12146 12147 start: function() { 12148 var element, p, co, ch, cw, width, height, 12149 that = $( this ).resizable( "instance" ), 12150 o = that.options, 12151 el = that.element, 12152 oc = o.containment, 12153 ce = ( oc instanceof $ ) ? 12154 oc.get( 0 ) : 12155 ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc; 12156 12157 if ( !ce ) { 12158 return; 12159 } 12160 12161 that.containerElement = $( ce ); 12162 12163 if ( /document/.test( oc ) || oc === document ) { 12164 that.containerOffset = { 12165 left: 0, 12166 top: 0 12167 }; 12168 that.containerPosition = { 12169 left: 0, 12170 top: 0 12171 }; 12172 12173 that.parentData = { 12174 element: $( document ), 12175 left: 0, 12176 top: 0, 12177 width: $( document ).width(), 12178 height: $( document ).height() || document.body.parentNode.scrollHeight 12179 }; 12180 } else { 12181 element = $( ce ); 12182 p = []; 12183 $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) { 12184 p[ i ] = that._num( element.css( "padding" + name ) ); 12185 } ); 12186 12187 that.containerOffset = element.offset(); 12188 that.containerPosition = element.position(); 12189 that.containerSize = { 12190 height: ( element.innerHeight() - p[ 3 ] ), 12191 width: ( element.innerWidth() - p[ 1 ] ) 12192 }; 12193 12194 co = that.containerOffset; 12195 ch = that.containerSize.height; 12196 cw = that.containerSize.width; 12197 width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw ); 12198 height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch ); 12199 12200 that.parentData = { 12201 element: ce, 12202 left: co.left, 12203 top: co.top, 12204 width: width, 12205 height: height 12206 }; 12207 } 12208 }, 12209 12210 resize: function( event ) { 12211 var woset, hoset, isParent, isOffsetRelative, 12212 that = $( this ).resizable( "instance" ), 12213 o = that.options, 12214 co = that.containerOffset, 12215 cp = that.position, 12216 pRatio = that._aspectRatio || event.shiftKey, 12217 cop = { 12218 top: 0, 12219 left: 0 12220 }, 12221 ce = that.containerElement, 12222 continueResize = true; 12223 12224 if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { 12225 cop = co; 12226 } 12227 12228 if ( cp.left < ( that._helper ? co.left : 0 ) ) { 12229 that.size.width = that.size.width + 12230 ( that._helper ? 12231 ( that.position.left - co.left ) : 12232 ( that.position.left - cop.left ) ); 12233 12234 if ( pRatio ) { 12235 that.size.height = that.size.width / that.aspectRatio; 12236 continueResize = false; 12237 } 12238 that.position.left = o.helper ? co.left : 0; 12239 } 12240 12241 if ( cp.top < ( that._helper ? co.top : 0 ) ) { 12242 that.size.height = that.size.height + 12243 ( that._helper ? 12244 ( that.position.top - co.top ) : 12245 that.position.top ); 12246 12247 if ( pRatio ) { 12248 that.size.width = that.size.height * that.aspectRatio; 12249 continueResize = false; 12250 } 12251 that.position.top = that._helper ? co.top : 0; 12252 } 12253 12254 isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 ); 12255 isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) ); 12256 12257 if ( isParent && isOffsetRelative ) { 12258 that.offset.left = that.parentData.left + that.position.left; 12259 that.offset.top = that.parentData.top + that.position.top; 12260 } else { 12261 that.offset.left = that.element.offset().left; 12262 that.offset.top = that.element.offset().top; 12263 } 12264
vendor: 4,533 bytes, lines 12265-12439
12265 woset = Math.abs( that.sizeDiff.width + 12266 ( that._helper ? 12267 that.offset.left - cop.left : 12268 ( that.offset.left - co.left ) ) ); 12269 12270 hoset = Math.abs( that.sizeDiff.height + 12271 ( that._helper ? 12272 that.offset.top - cop.top : 12273 ( that.offset.top - co.top ) ) ); 12274 12275 if ( woset + that.size.width >= that.parentData.width ) { 12276 that.size.width = that.parentData.width - woset; 12277 if ( pRatio ) { 12278 that.size.height = that.size.width / that.aspectRatio; 12279 continueResize = false; 12280 } 12281 } 12282 12283 if ( hoset + that.size.height >= that.parentData.height ) { 12284 that.size.height = that.parentData.height - hoset; 12285 if ( pRatio ) { 12286 that.size.width = that.size.height * that.aspectRatio; 12287 continueResize = false; 12288 } 12289 } 12290 12291 if ( !continueResize ) { 12292 that.position.left = that.prevPosition.left; 12293 that.position.top = that.prevPosition.top; 12294 that.size.width = that.prevSize.width; 12295 that.size.height = that.prevSize.height; 12296 } 12297 }, 12298 12299 stop: function() { 12300 var that = $( this ).resizable( "instance" ), 12301 o = that.options, 12302 co = that.containerOffset, 12303 cop = that.containerPosition, 12304 ce = that.containerElement, 12305 helper = $( that.helper ), 12306 ho = helper.offset(), 12307 w = helper.outerWidth() - that.sizeDiff.width, 12308 h = helper.outerHeight() - that.sizeDiff.height; 12309 12310 if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) { 12311 $( this ).css( { 12312 left: ho.left - cop.left - co.left, 12313 width: w, 12314 height: h 12315 } ); 12316 } 12317 12318 if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) { 12319 $( this ).css( { 12320 left: ho.left - cop.left - co.left, 12321 width: w, 12322 height: h 12323 } ); 12324 } 12325 } 12326} ); 12327 12328$.ui.plugin.add( "resizable", "alsoResize", { 12329 12330 start: function() { 12331 var that = $( this ).resizable( "instance" ), 12332 o = that.options; 12333 12334 $( o.alsoResize ).each( function() { 12335 var el = $( this ); 12336 el.data( "ui-resizable-alsoresize", { 12337 width: parseFloat( el.width() ), height: parseFloat( el.height() ), 12338 left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) ) 12339 } ); 12340 } ); 12341 }, 12342 12343 resize: function( event, ui ) { 12344 var that = $( this ).resizable( "instance" ), 12345 o = that.options, 12346 os = that.originalSize, 12347 op = that.originalPosition, 12348 delta = { 12349 height: ( that.size.height - os.height ) || 0, 12350 width: ( that.size.width - os.width ) || 0, 12351 top: ( that.position.top - op.top ) || 0, 12352 left: ( that.position.left - op.left ) || 0 12353 }; 12354 12355 $( o.alsoResize ).each( function() { 12356 var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {}, 12357 css = el.parents( ui.originalElement[ 0 ] ).length ? 12358 [ "width", "height" ] : 12359 [ "width", "height", "top", "left" ]; 12360 12361 $.each( css, function( i, prop ) { 12362 var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 ); 12363 if ( sum && sum >= 0 ) { 12364 style[ prop ] = sum || null; 12365 } 12366 } ); 12367 12368 el.css( style ); 12369 } ); 12370 }, 12371 12372 stop: function() { 12373 $( this ).removeData( "ui-resizable-alsoresize" ); 12374 } 12375} ); 12376 12377$.ui.plugin.add( "resizable", "ghost", { 12378 12379 start: function() { 12380 12381 var that = $( this ).resizable( "instance" ), cs = that.size; 12382 12383 that.ghost = that.originalElement.clone(); 12384 that.ghost.css( { 12385 opacity: 0.25, 12386 display: "block", 12387 position: "relative", 12388 height: cs.height, 12389 width: cs.width, 12390 margin: 0, 12391 left: 0, 12392 top: 0 12393 } ); 12394 12395 that._addClass( that.ghost, "ui-resizable-ghost" ); 12396 12397 // DEPRECATED 12398 // TODO: remove after 1.12 12399 if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) { 12400 12401 // Ghost option 12402 that.ghost.addClass( this.options.ghost ); 12403 } 12404 12405 that.ghost.appendTo( that.helper ); 12406 12407 }, 12408 12409 resize: function() { 12410 var that = $( this ).resizable( "instance" ); 12411 if ( that.ghost ) { 12412 that.ghost.css( { 12413 position: "relative", 12414 height: that.size.height, 12415 width: that.size.width 12416 } ); 12417 } 12418 }, 12419 12420 stop: function() { 12421 var that = $( this ).resizable( "instance" ); 12422 if ( that.ghost && that.helper ) { 12423 that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) ); 12424 } 12425 } 12426 12427} ); 12428 12429$.ui.plugin.add( "resizable", "grid", { 12430 12431 resize: function() { 12432 var outerDimensions, 12433 that = $( this ).resizable( "instance" ), 12434 o = that.options, 12435 cs = that.size, 12436 os = that.originalSize, 12437 op = that.originalPosition, 12438 a = that.axis, 12439 grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
vendor: 4,398 bytes, lines 12440-12619
12440 gridX = ( grid[ 0 ] || 1 ), 12441 gridY = ( grid[ 1 ] || 1 ), 12442 ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX, 12443 oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY, 12444 newWidth = os.width + ox, 12445 newHeight = os.height + oy, 12446 isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ), 12447 isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ), 12448 isMinWidth = o.minWidth && ( o.minWidth > newWidth ), 12449 isMinHeight = o.minHeight && ( o.minHeight > newHeight ); 12450 12451 o.grid = grid; 12452 12453 if ( isMinWidth ) { 12454 newWidth += gridX; 12455 } 12456 if ( isMinHeight ) { 12457 newHeight += gridY; 12458 } 12459 if ( isMaxWidth ) { 12460 newWidth -= gridX; 12461 } 12462 if ( isMaxHeight ) { 12463 newHeight -= gridY; 12464 } 12465 12466 if ( /^(se|s|e)$/.test( a ) ) { 12467 that.size.width = newWidth; 12468 that.size.height = newHeight; 12469 } else if ( /^(ne)$/.test( a ) ) { 12470 that.size.width = newWidth; 12471 that.size.height = newHeight; 12472 that.position.top = op.top - oy; 12473 } else if ( /^(sw)$/.test( a ) ) { 12474 that.size.width = newWidth; 12475 that.size.height = newHeight; 12476 that.position.left = op.left - ox; 12477 } else { 12478 if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) { 12479 outerDimensions = that._getPaddingPlusBorderDimensions( this ); 12480 } 12481 12482 if ( newHeight - gridY > 0 ) { 12483 that.size.height = newHeight; 12484 that.position.top = op.top - oy; 12485 } else { 12486 newHeight = gridY - outerDimensions.height; 12487 that.size.height = newHeight; 12488 that.position.top = op.top + os.height - newHeight; 12489 } 12490 if ( newWidth - gridX > 0 ) { 12491 that.size.width = newWidth; 12492 that.position.left = op.left - ox; 12493 } else { 12494 newWidth = gridX - outerDimensions.width; 12495 that.size.width = newWidth; 12496 that.position.left = op.left + os.width - newWidth; 12497 } 12498 } 12499 } 12500 12501} ); 12502 12503var widgetsResizable = $.ui.resizable; 12504 12505 12506/*! 12507 * jQuery UI Dialog 1.13.2 12508 * http://jqueryui.com 12509 * 12510 * Copyright jQuery Foundation and other contributors 12511 * Released under the MIT license. 12512 * http://jquery.org/license 12513 */ 12514 12515//>>label: Dialog 12516//>>group: Widgets 12517//>>description: Displays customizable dialog windows. 12518//>>docs: http://api.jqueryui.com/dialog/ 12519//>>demos: http://jqueryui.com/dialog/ 12520//>>css.structure: ../../themes/base/core.css 12521//>>css.structure: ../../themes/base/dialog.css 12522//>>css.theme: ../../themes/base/theme.css 12523 12524 12525$.widget( "ui.dialog", { 12526 version: "1.13.2", 12527 options: { 12528 appendTo: "body", 12529 autoOpen: true, 12530 buttons: [], 12531 classes: { 12532 "ui-dialog": "ui-corner-all", 12533 "ui-dialog-titlebar": "ui-corner-all" 12534 }, 12535 closeOnEscape: true, 12536 closeText: "Close", 12537 draggable: true, 12538 hide: null, 12539 height: "auto", 12540 maxHeight: null, 12541 maxWidth: null, 12542 minHeight: 150, 12543 minWidth: 150, 12544 modal: false, 12545 position: { 12546 my: "center", 12547 at: "center", 12548 of: window, 12549 collision: "fit", 12550 12551 // Ensure the titlebar is always visible 12552 using: function( pos ) { 12553 var topOffset = $( this ).css( pos ).offset().top; 12554 if ( topOffset < 0 ) { 12555 $( this ).css( "top", pos.top - topOffset ); 12556 } 12557 } 12558 }, 12559 resizable: true, 12560 show: null, 12561 title: null, 12562 width: 300, 12563 12564 // Callbacks 12565 beforeClose: null, 12566 close: null, 12567 drag: null, 12568 dragStart: null, 12569 dragStop: null, 12570 focus: null, 12571 open: null, 12572 resize: null, 12573 resizeStart: null, 12574 resizeStop: null 12575 }, 12576 12577 sizeRelatedOptions: { 12578 buttons: true, 12579 height: true, 12580 maxHeight: true, 12581 maxWidth: true, 12582 minHeight: true, 12583 minWidth: true, 12584 width: true 12585 }, 12586 12587 resizableRelatedOptions: { 12588 maxHeight: true, 12589 maxWidth: true, 12590 minHeight: true, 12591 minWidth: true 12592 }, 12593 12594 _create: function() { 12595 this.originalCss = { 12596 display: this.element[ 0 ].style.display, 12597 width: this.element[ 0 ].style.width, 12598 minHeight: this.element[ 0 ].style.minHeight, 12599 maxHeight: this.element[ 0 ].style.maxHeight, 12600 height: this.element[ 0 ].style.height 12601 }; 12602 this.originalPosition = { 12603 parent: this.element.parent(), 12604 index: this.element.parent().children().index( this.element ) 12605 }; 12606 this.originalTitle = this.element.attr( "title" ); 12607 if ( this.options.title == null && this.originalTitle != null ) { 12608 this.options.title = this.originalTitle; 12609 } 12610 12611 // Dialogs can't be disabled 12612 if ( this.options.disabled ) { 12613 this.options.disabled = false; 12614 } 12615 12616 this._createWrapper(); 12617 12618 this.element 12619 .show()
vendor: 25,862 bytes, lines 12620-13612
12620 .removeAttr( "title" ) 12621 .appendTo( this.uiDialog ); 12622 12623 this._addClass( "ui-dialog-content", "ui-widget-content" ); 12624 12625 this._createTitlebar(); 12626 this._createButtonPane(); 12627 12628 if ( this.options.draggable && $.fn.draggable ) { 12629 this._makeDraggable(); 12630 } 12631 if ( this.options.resizable && $.fn.resizable ) { 12632 this._makeResizable(); 12633 } 12634 12635 this._isOpen = false; 12636 12637 this._trackFocus(); 12638 }, 12639 12640 _init: function() { 12641 if ( this.options.autoOpen ) { 12642 this.open(); 12643 } 12644 }, 12645 12646 _appendTo: function() { 12647 var element = this.options.appendTo; 12648 if ( element && ( element.jquery || element.nodeType ) ) { 12649 return $( element ); 12650 } 12651 return this.document.find( element || "body" ).eq( 0 ); 12652 }, 12653 12654 _destroy: function() { 12655 var next, 12656 originalPosition = this.originalPosition; 12657 12658 this._untrackInstance(); 12659 this._destroyOverlay(); 12660 12661 this.element 12662 .removeUniqueId() 12663 .css( this.originalCss ) 12664 12665 // Without detaching first, the following becomes really slow 12666 .detach(); 12667 12668 this.uiDialog.remove(); 12669 12670 if ( this.originalTitle ) { 12671 this.element.attr( "title", this.originalTitle ); 12672 } 12673 12674 next = originalPosition.parent.children().eq( originalPosition.index ); 12675 12676 // Don't try to place the dialog next to itself (#8613) 12677 if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { 12678 next.before( this.element ); 12679 } else { 12680 originalPosition.parent.append( this.element ); 12681 } 12682 }, 12683 12684 widget: function() { 12685 return this.uiDialog; 12686 }, 12687 12688 disable: $.noop, 12689 enable: $.noop, 12690 12691 close: function( event ) { 12692 var that = this; 12693 12694 if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) { 12695 return; 12696 } 12697 12698 this._isOpen = false; 12699 this._focusedElement = null; 12700 this._destroyOverlay(); 12701 this._untrackInstance(); 12702 12703 if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) { 12704 12705 // Hiding a focused element doesn't trigger blur in WebKit 12706 // so in case we have nothing to focus on, explicitly blur the active element 12707 // https://bugs.webkit.org/show_bug.cgi?id=47182 12708 $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); 12709 } 12710 12711 this._hide( this.uiDialog, this.options.hide, function() { 12712 that._trigger( "close", event ); 12713 } ); 12714 }, 12715 12716 isOpen: function() { 12717 return this._isOpen; 12718 }, 12719 12720 moveToTop: function() { 12721 this._moveToTop(); 12722 }, 12723 12724 _moveToTop: function( event, silent ) { 12725 var moved = false, 12726 zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() { 12727 return +$( this ).css( "z-index" ); 12728 } ).get(), 12729 zIndexMax = Math.max.apply( null, zIndices ); 12730 12731 if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) { 12732 this.uiDialog.css( "z-index", zIndexMax + 1 ); 12733 moved = true; 12734 } 12735 12736 if ( moved && !silent ) { 12737 this._trigger( "focus", event ); 12738 } 12739 return moved; 12740 }, 12741 12742 open: function() { 12743 var that = this; 12744 if ( this._isOpen ) { 12745 if ( this._moveToTop() ) { 12746 this._focusTabbable(); 12747 } 12748 return; 12749 } 12750 12751 this._isOpen = true; 12752 this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); 12753 12754 this._size(); 12755 this._position(); 12756 this._createOverlay(); 12757 this._moveToTop( null, true ); 12758 12759 // Ensure the overlay is moved to the top with the dialog, but only when 12760 // opening. The overlay shouldn't move after the dialog is open so that 12761 // modeless dialogs opened after the modal dialog stack properly. 12762 if ( this.overlay ) { 12763 this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 ); 12764 } 12765 12766 this._show( this.uiDialog, this.options.show, function() { 12767 that._focusTabbable(); 12768 that._trigger( "focus" ); 12769 } ); 12770 12771 // Track the dialog immediately upon opening in case a focus event 12772 // somehow occurs outside of the dialog before an element inside the 12773 // dialog is focused (#10152) 12774 this._makeFocusTarget(); 12775 12776 this._trigger( "open" ); 12777 }, 12778 12779 _focusTabbable: function() { 12780 12781 // Set focus to the first match: 12782 // 1. An element that was focused previously 12783 // 2. First element inside the dialog matching [autofocus] 12784 // 3. Tabbable element inside the content element 12785 // 4. Tabbable element inside the buttonpane 12786 // 5. The close button 12787 // 6. The dialog itself 12788 var hasFocus = this._focusedElement; 12789 if ( !hasFocus ) { 12790 hasFocus = this.element.find( "[autofocus]" ); 12791 } 12792 if ( !hasFocus.length ) { 12793 hasFocus = this.element.find( ":tabbable" ); 12794 } 12795 if ( !hasFocus.length ) { 12796 hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); 12797 } 12798 if ( !hasFocus.length ) { 12799 hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" ); 12800 } 12801 if ( !hasFocus.length ) { 12802 hasFocus = this.uiDialog; 12803 } 12804 hasFocus.eq( 0 ).trigger( "focus" ); 12805 }, 12806 12807 _restoreTabbableFocus: function() { 12808 var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), 12809 isActive = this.uiDialog[ 0 ] === activeElement || 12810 $.contains( this.uiDialog[ 0 ], activeElement ); 12811 if ( !isActive ) { 12812 this._focusTabbable(); 12813 } 12814 }, 12815 12816 _keepFocus: function( event ) { 12817 event.preventDefault(); 12818 this._restoreTabbableFocus(); 12819 12820 // support: IE 12821 // IE <= 8 doesn't prevent moving focus even with event.preventDefault() 12822 // so we check again later 12823 this._delay( this._restoreTabbableFocus ); 12824 }, 12825 12826 _createWrapper: function() { 12827 this.uiDialog = $( "<div>" ) 12828 .hide() 12829 .attr( { 12830 12831 // Setting tabIndex makes the div focusable 12832 tabIndex: -1, 12833 role: "dialog" 12834 } ) 12835 .appendTo( this._appendTo() ); 12836 12837 this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" ); 12838 this._on( this.uiDialog, { 12839 keydown: function( event ) { 12840 if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && 12841 event.keyCode === $.ui.keyCode.ESCAPE ) { 12842 event.preventDefault(); 12843 this.close( event ); 12844 return; 12845 } 12846 12847 // Prevent tabbing out of dialogs 12848 if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) { 12849 return; 12850 } 12851 var tabbables = this.uiDialog.find( ":tabbable" ), 12852 first = tabbables.first(), 12853 last = tabbables.last(); 12854 12855 if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) && 12856 !event.shiftKey ) { 12857 this._delay( function() { 12858 first.trigger( "focus" ); 12859 } ); 12860 event.preventDefault(); 12861 } else if ( ( event.target === first[ 0 ] || 12862 event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) { 12863 this._delay( function() { 12864 last.trigger( "focus" ); 12865 } ); 12866 event.preventDefault(); 12867 } 12868 }, 12869 mousedown: function( event ) { 12870 if ( this._moveToTop( event ) ) { 12871 this._focusTabbable(); 12872 } 12873 } 12874 } ); 12875 12876 // We assume that any existing aria-describedby attribute means 12877 // that the dialog content is marked up properly 12878 // otherwise we brute force the content as the description 12879 if ( !this.element.find( "[aria-describedby]" ).length ) { 12880 this.uiDialog.attr( { 12881 "aria-describedby": this.element.uniqueId().attr( "id" ) 12882 } ); 12883 } 12884 }, 12885 12886 _createTitlebar: function() { 12887 var uiDialogTitle; 12888 12889 this.uiDialogTitlebar = $( "<div>" ); 12890 this._addClass( this.uiDialogTitlebar, 12891 "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" ); 12892 this._on( this.uiDialogTitlebar, { 12893 mousedown: function( event ) { 12894 12895 // Don't prevent click on close button (#8838) 12896 // Focusing a dialog that is partially scrolled out of view 12897 // causes the browser to scroll it into view, preventing the click event 12898 if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) { 12899 12900 // Dialog isn't getting focus when dragging (#8063) 12901 this.uiDialog.trigger( "focus" ); 12902 } 12903 } 12904 } ); 12905 12906 // Support: IE 12907 // Use type="button" to prevent enter keypresses in textboxes from closing the 12908 // dialog in IE (#9312) 12909 this.uiDialogTitlebarClose = $( "<button type='button'></button>" ) 12910 .button( { 12911 label: $( "<a>" ).text( this.options.closeText ).html(), 12912 icon: "ui-icon-closethick", 12913 showLabel: false 12914 } ) 12915 .appendTo( this.uiDialogTitlebar ); 12916 12917 this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" ); 12918 this._on( this.uiDialogTitlebarClose, { 12919 click: function( event ) { 12920 event.preventDefault(); 12921 this.close( event ); 12922 } 12923 } ); 12924 12925 uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar ); 12926 this._addClass( uiDialogTitle, "ui-dialog-title" ); 12927 this._title( uiDialogTitle ); 12928 12929 this.uiDialogTitlebar.prependTo( this.uiDialog ); 12930 12931 this.uiDialog.attr( { 12932 "aria-labelledby": uiDialogTitle.attr( "id" ) 12933 } ); 12934 }, 12935 12936 _title: function( title ) { 12937 if ( this.options.title ) { 12938 title.text( this.options.title ); 12939 } else { 12940 title.html( " " ); 12941 } 12942 }, 12943 12944 _createButtonPane: function() { 12945 this.uiDialogButtonPane = $( "<div>" ); 12946 this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane", 12947 "ui-widget-content ui-helper-clearfix" ); 12948 12949 this.uiButtonSet = $( "<div>" ) 12950 .appendTo( this.uiDialogButtonPane ); 12951 this._addClass( this.uiButtonSet, "ui-dialog-buttonset" ); 12952 12953 this._createButtons(); 12954 }, 12955 12956 _createButtons: function() { 12957 var that = this, 12958 buttons = this.options.buttons; 12959 12960 // If we already have a button pane, remove it 12961 this.uiDialogButtonPane.remove(); 12962 this.uiButtonSet.empty(); 12963 12964 if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) { 12965 this._removeClass( this.uiDialog, "ui-dialog-buttons" ); 12966 return; 12967 } 12968 12969 $.each( buttons, function( name, props ) { 12970 var click, buttonOptions; 12971 props = typeof props === "function" ? 12972 { click: props, text: name } : 12973 props; 12974 12975 // Default to a non-submitting button 12976 props = $.extend( { type: "button" }, props ); 12977 12978 // Change the context for the click callback to be the main element 12979 click = props.click; 12980 buttonOptions = { 12981 icon: props.icon, 12982 iconPosition: props.iconPosition, 12983 showLabel: props.showLabel, 12984 12985 // Deprecated options 12986 icons: props.icons, 12987 text: props.text 12988 }; 12989 12990 delete props.click; 12991 delete props.icon; 12992 delete props.iconPosition; 12993 delete props.showLabel; 12994 12995 // Deprecated options 12996 delete props.icons; 12997 if ( typeof props.text === "boolean" ) { 12998 delete props.text; 12999 } 13000 13001 $( "<button></button>", props ) 13002 .button( buttonOptions ) 13003 .appendTo( that.uiButtonSet ) 13004 .on( "click", function() { 13005 click.apply( that.element[ 0 ], arguments ); 13006 } ); 13007 } ); 13008 this._addClass( this.uiDialog, "ui-dialog-buttons" ); 13009 this.uiDialogButtonPane.appendTo( this.uiDialog ); 13010 }, 13011 13012 _makeDraggable: function() { 13013 var that = this, 13014 options = this.options; 13015 13016 function filteredUi( ui ) { 13017 return { 13018 position: ui.position, 13019 offset: ui.offset 13020 }; 13021 } 13022 13023 this.uiDialog.draggable( { 13024 cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", 13025 handle: ".ui-dialog-titlebar", 13026 containment: "document", 13027 start: function( event, ui ) { 13028 that._addClass( $( this ), "ui-dialog-dragging" ); 13029 that._blockFrames(); 13030 that._trigger( "dragStart", event, filteredUi( ui ) ); 13031 }, 13032 drag: function( event, ui ) { 13033 that._trigger( "drag", event, filteredUi( ui ) ); 13034 }, 13035 stop: function( event, ui ) { 13036 var left = ui.offset.left - that.document.scrollLeft(), 13037 top = ui.offset.top - that.document.scrollTop(); 13038 13039 options.position = { 13040 my: "left top", 13041 at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + 13042 "top" + ( top >= 0 ? "+" : "" ) + top, 13043 of: that.window 13044 }; 13045 that._removeClass( $( this ), "ui-dialog-dragging" ); 13046 that._unblockFrames(); 13047 that._trigger( "dragStop", event, filteredUi( ui ) ); 13048 } 13049 } ); 13050 }, 13051 13052 _makeResizable: function() { 13053 var that = this, 13054 options = this.options, 13055 handles = options.resizable, 13056 13057 // .ui-resizable has position: relative defined in the stylesheet 13058 // but dialogs have to use absolute or fixed positioning 13059 position = this.uiDialog.css( "position" ), 13060 resizeHandles = typeof handles === "string" ? 13061 handles : 13062 "n,e,s,w,se,sw,ne,nw"; 13063 13064 function filteredUi( ui ) { 13065 return { 13066 originalPosition: ui.originalPosition, 13067 originalSize: ui.originalSize, 13068 position: ui.position, 13069 size: ui.size 13070 }; 13071 } 13072 13073 this.uiDialog.resizable( { 13074 cancel: ".ui-dialog-content", 13075 containment: "document", 13076 alsoResize: this.element, 13077 maxWidth: options.maxWidth, 13078 maxHeight: options.maxHeight, 13079 minWidth: options.minWidth, 13080 minHeight: this._minHeight(), 13081 handles: resizeHandles, 13082 start: function( event, ui ) { 13083 that._addClass( $( this ), "ui-dialog-resizing" ); 13084 that._blockFrames(); 13085 that._trigger( "resizeStart", event, filteredUi( ui ) ); 13086 }, 13087 resize: function( event, ui ) { 13088 that._trigger( "resize", event, filteredUi( ui ) ); 13089 }, 13090 stop: function( event, ui ) { 13091 var offset = that.uiDialog.offset(), 13092 left = offset.left - that.document.scrollLeft(), 13093 top = offset.top - that.document.scrollTop(); 13094 13095 options.height = that.uiDialog.height(); 13096 options.width = that.uiDialog.width(); 13097 options.position = { 13098 my: "left top", 13099 at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + 13100 "top" + ( top >= 0 ? "+" : "" ) + top, 13101 of: that.window 13102 }; 13103 that._removeClass( $( this ), "ui-dialog-resizing" ); 13104 that._unblockFrames(); 13105 that._trigger( "resizeStop", event, filteredUi( ui ) ); 13106 } 13107 } ) 13108 .css( "position", position ); 13109 }, 13110 13111 _trackFocus: function() { 13112 this._on( this.widget(), { 13113 focusin: function( event ) { 13114 this._makeFocusTarget(); 13115 this._focusedElement = $( event.target ); 13116 } 13117 } ); 13118 }, 13119 13120 _makeFocusTarget: function() { 13121 this._untrackInstance(); 13122 this._trackingInstances().unshift( this ); 13123 }, 13124 13125 _untrackInstance: function() { 13126 var instances = this._trackingInstances(), 13127 exists = $.inArray( this, instances ); 13128 if ( exists !== -1 ) { 13129 instances.splice( exists, 1 ); 13130 } 13131 }, 13132 13133 _trackingInstances: function() { 13134 var instances = this.document.data( "ui-dialog-instances" ); 13135 if ( !instances ) { 13136 instances = []; 13137 this.document.data( "ui-dialog-instances", instances ); 13138 } 13139 return instances; 13140 }, 13141 13142 _minHeight: function() { 13143 var options = this.options; 13144 13145 return options.height === "auto" ? 13146 options.minHeight : 13147 Math.min( options.minHeight, options.height ); 13148 }, 13149 13150 _position: function() { 13151 13152 // Need to show the dialog to get the actual offset in the position plugin 13153 var isVisible = this.uiDialog.is( ":visible" ); 13154 if ( !isVisible ) { 13155 this.uiDialog.show(); 13156 } 13157 this.uiDialog.position( this.options.position ); 13158 if ( !isVisible ) { 13159 this.uiDialog.hide(); 13160 } 13161 }, 13162 13163 _setOptions: function( options ) { 13164 var that = this, 13165 resize = false, 13166 resizableOptions = {}; 13167 13168 $.each( options, function( key, value ) { 13169 that._setOption( key, value ); 13170 13171 if ( key in that.sizeRelatedOptions ) { 13172 resize = true; 13173 } 13174 if ( key in that.resizableRelatedOptions ) { 13175 resizableOptions[ key ] = value; 13176 } 13177 } ); 13178 13179 if ( resize ) { 13180 this._size(); 13181 this._position(); 13182 } 13183 if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { 13184 this.uiDialog.resizable( "option", resizableOptions ); 13185 } 13186 }, 13187 13188 _setOption: function( key, value ) { 13189 var isDraggable, isResizable, 13190 uiDialog = this.uiDialog; 13191 13192 if ( key === "disabled" ) { 13193 return; 13194 } 13195 13196 this._super( key, value ); 13197 13198 if ( key === "appendTo" ) { 13199 this.uiDialog.appendTo( this._appendTo() ); 13200 } 13201 13202 if ( key === "buttons" ) { 13203 this._createButtons(); 13204 } 13205 13206 if ( key === "closeText" ) { 13207 this.uiDialogTitlebarClose.button( { 13208 13209 // Ensure that we always pass a string 13210 label: $( "<a>" ).text( "" + this.options.closeText ).html() 13211 } ); 13212 } 13213 13214 if ( key === "draggable" ) { 13215 isDraggable = uiDialog.is( ":data(ui-draggable)" ); 13216 if ( isDraggable && !value ) { 13217 uiDialog.draggable( "destroy" ); 13218 } 13219 13220 if ( !isDraggable && value ) { 13221 this._makeDraggable(); 13222 } 13223 } 13224 13225 if ( key === "position" ) { 13226 this._position(); 13227 } 13228 13229 if ( key === "resizable" ) { 13230 13231 // currently resizable, becoming non-resizable 13232 isResizable = uiDialog.is( ":data(ui-resizable)" ); 13233 if ( isResizable && !value ) { 13234 uiDialog.resizable( "destroy" ); 13235 } 13236 13237 // Currently resizable, changing handles 13238 if ( isResizable && typeof value === "string" ) { 13239 uiDialog.resizable( "option", "handles", value ); 13240 } 13241 13242 // Currently non-resizable, becoming resizable 13243 if ( !isResizable && value !== false ) { 13244 this._makeResizable(); 13245 } 13246 } 13247 13248 if ( key === "title" ) { 13249 this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) ); 13250 } 13251 }, 13252 13253 _size: function() { 13254 13255 // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content 13256 // divs will both have width and height set, so we need to reset them 13257 var nonContentHeight, minContentHeight, maxContentHeight, 13258 options = this.options; 13259 13260 // Reset content sizing 13261 this.element.show().css( { 13262 width: "auto", 13263 minHeight: 0, 13264 maxHeight: "none", 13265 height: 0 13266 } ); 13267 13268 if ( options.minWidth > options.width ) { 13269 options.width = options.minWidth; 13270 } 13271 13272 // Reset wrapper sizing 13273 // determine the height of all the non-content elements 13274 nonContentHeight = this.uiDialog.css( { 13275 height: "auto", 13276 width: options.width 13277 } ) 13278 .outerHeight(); 13279 minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); 13280 maxContentHeight = typeof options.maxHeight === "number" ? 13281 Math.max( 0, options.maxHeight - nonContentHeight ) : 13282 "none"; 13283 13284 if ( options.height === "auto" ) { 13285 this.element.css( { 13286 minHeight: minContentHeight, 13287 maxHeight: maxContentHeight, 13288 height: "auto" 13289 } ); 13290 } else { 13291 this.element.height( Math.max( 0, options.height - nonContentHeight ) ); 13292 } 13293 13294 if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { 13295 this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); 13296 } 13297 }, 13298 13299 _blockFrames: function() { 13300 this.iframeBlocks = this.document.find( "iframe" ).map( function() { 13301 var iframe = $( this ); 13302 13303 return $( "<div>" ) 13304 .css( { 13305 position: "absolute", 13306 width: iframe.outerWidth(), 13307 height: iframe.outerHeight() 13308 } ) 13309 .appendTo( iframe.parent() ) 13310 .offset( iframe.offset() )[ 0 ]; 13311 } ); 13312 }, 13313 13314 _unblockFrames: function() { 13315 if ( this.iframeBlocks ) { 13316 this.iframeBlocks.remove(); 13317 delete this.iframeBlocks; 13318 } 13319 }, 13320 13321 _allowInteraction: function( event ) { 13322 if ( $( event.target ).closest( ".ui-dialog" ).length ) { 13323 return true; 13324 } 13325 13326 // TODO: Remove hack when datepicker implements 13327 // the .ui-front logic (#8989) 13328 return !!$( event.target ).closest( ".ui-datepicker" ).length; 13329 }, 13330 13331 _createOverlay: function() { 13332 if ( !this.options.modal ) { 13333 return; 13334 } 13335 13336 var jqMinor = $.fn.jquery.substring( 0, 4 ); 13337 13338 // We use a delay in case the overlay is created from an 13339 // event that we're going to be cancelling (#2804) 13340 var isOpening = true; 13341 this._delay( function() { 13342 isOpening = false; 13343 } ); 13344 13345 if ( !this.document.data( "ui-dialog-overlays" ) ) { 13346 13347 // Prevent use of anchors and inputs 13348 // This doesn't use `_on()` because it is a shared event handler 13349 // across all open modal dialogs. 13350 this.document.on( "focusin.ui-dialog", function( event ) { 13351 if ( isOpening ) { 13352 return; 13353 } 13354 13355 var instance = this._trackingInstances()[ 0 ]; 13356 if ( !instance._allowInteraction( event ) ) { 13357 event.preventDefault(); 13358 instance._focusTabbable(); 13359 13360 // Support: jQuery >=3.4 <3.6 only 13361 // Focus re-triggering in jQuery 3.4/3.5 makes the original element 13362 // have its focus event propagated last, breaking the re-targeting. 13363 // Trigger focus in a delay in addition if needed to avoid the issue 13364 // See https://github.com/jquery/jquery/issues/4382 13365 if ( jqMinor === "3.4." || jqMinor === "3.5." ) { 13366 instance._delay( instance._restoreTabbableFocus ); 13367 } 13368 } 13369 }.bind( this ) ); 13370 } 13371 13372 this.overlay = $( "<div>" ) 13373 .appendTo( this._appendTo() ); 13374 13375 this._addClass( this.overlay, null, "ui-widget-overlay ui-front" ); 13376 this._on( this.overlay, { 13377 mousedown: "_keepFocus" 13378 } ); 13379 this.document.data( "ui-dialog-overlays", 13380 ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 ); 13381 }, 13382 13383 _destroyOverlay: function() { 13384 if ( !this.options.modal ) { 13385 return; 13386 } 13387 13388 if ( this.overlay ) { 13389 var overlays = this.document.data( "ui-dialog-overlays" ) - 1; 13390 13391 if ( !overlays ) { 13392 this.document.off( "focusin.ui-dialog" ); 13393 this.document.removeData( "ui-dialog-overlays" ); 13394 } else { 13395 this.document.data( "ui-dialog-overlays", overlays ); 13396 } 13397 13398 this.overlay.remove(); 13399 this.overlay = null; 13400 } 13401 } 13402} ); 13403 13404// DEPRECATED 13405// TODO: switch return back to widget declaration at top of file when this is removed 13406if ( $.uiBackCompat !== false ) { 13407 13408 // Backcompat for dialogClass option 13409 $.widget( "ui.dialog", $.ui.dialog, { 13410 options: { 13411 dialogClass: "" 13412 }, 13413 _createWrapper: function() { 13414 this._super(); 13415 this.uiDialog.addClass( this.options.dialogClass ); 13416 }, 13417 _setOption: function( key, value ) { 13418 if ( key === "dialogClass" ) { 13419 this.uiDialog 13420 .removeClass( this.options.dialogClass ) 13421 .addClass( value ); 13422 } 13423 this._superApply( arguments ); 13424 } 13425 } ); 13426} 13427 13428var widgetsDialog = $.ui.dialog; 13429 13430 13431/*! 13432 * jQuery UI Droppable 1.13.2 13433 * http://jqueryui.com 13434 * 13435 * Copyright jQuery Foundation and other contributors 13436 * Released under the MIT license. 13437 * http://jquery.org/license 13438 */ 13439 13440//>>label: Droppable 13441//>>group: Interactions 13442//>>description: Enables drop targets for draggable elements. 13443//>>docs: http://api.jqueryui.com/droppable/ 13444//>>demos: http://jqueryui.com/droppable/ 13445 13446 13447$.widget( "ui.droppable", { 13448 version: "1.13.2", 13449 widgetEventPrefix: "drop", 13450 options: { 13451 accept: "*", 13452 addClasses: true, 13453 greedy: false, 13454 scope: "default", 13455 tolerance: "intersect", 13456 13457 // Callbacks 13458 activate: null, 13459 deactivate: null, 13460 drop: null, 13461 out: null, 13462 over: null 13463 }, 13464 _create: function() { 13465 13466 var proportions, 13467 o = this.options, 13468 accept = o.accept; 13469 13470 this.isover = false; 13471 this.isout = true; 13472 13473 this.accept = typeof accept === "function" ? accept : function( d ) { 13474 return d.is( accept ); 13475 }; 13476 13477 this.proportions = function( /* valueToWrite */ ) { 13478 if ( arguments.length ) { 13479 13480 // Store the droppable's proportions 13481 proportions = arguments[ 0 ]; 13482 } else { 13483 13484 // Retrieve or derive the droppable's proportions 13485 return proportions ? 13486 proportions : 13487 proportions = { 13488 width: this.element[ 0 ].offsetWidth, 13489 height: this.element[ 0 ].offsetHeight 13490 }; 13491 } 13492 }; 13493 13494 this._addToManager( o.scope ); 13495 13496 if ( o.addClasses ) { 13497 this._addClass( "ui-droppable" ); 13498 } 13499 13500 }, 13501 13502 _addToManager: function( scope ) { 13503 13504 // Add the reference and positions to the manager 13505 $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || []; 13506 $.ui.ddmanager.droppables[ scope ].push( this ); 13507 }, 13508 13509 _splice: function( drop ) { 13510 var i = 0; 13511 for ( ; i < drop.length; i++ ) { 13512 if ( drop[ i ] === this ) { 13513 drop.splice( i, 1 ); 13514 } 13515 } 13516 }, 13517 13518 _destroy: function() { 13519 var drop = $.ui.ddmanager.droppables[ this.options.scope ]; 13520 13521 this._splice( drop ); 13522 }, 13523 13524 _setOption: function( key, value ) { 13525 13526 if ( key === "accept" ) { 13527 this.accept = typeof value === "function" ? value : function( d ) { 13528 return d.is( value ); 13529 }; 13530 } else if ( key === "scope" ) { 13531 var drop = $.ui.ddmanager.droppables[ this.options.scope ]; 13532 13533 this._splice( drop ); 13534 this._addToManager( value ); 13535 } 13536 13537 this._super( key, value ); 13538 }, 13539 13540 _activate: function( event ) { 13541 var draggable = $.ui.ddmanager.current; 13542 13543 this._addActiveClass(); 13544 if ( draggable ) { 13545 this._trigger( "activate", event, this.ui( draggable ) ); 13546 } 13547 }, 13548 13549 _deactivate: function( event ) { 13550 var draggable = $.ui.ddmanager.current; 13551 13552 this._removeActiveClass(); 13553 if ( draggable ) { 13554 this._trigger( "deactivate", event, this.ui( draggable ) ); 13555 } 13556 }, 13557 13558 _over: function( event ) { 13559 13560 var draggable = $.ui.ddmanager.current; 13561 13562 // Bail if draggable and droppable are same element 13563 if ( !draggable || ( draggable.currentItem || 13564 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13565 return; 13566 } 13567 13568 if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || 13569 draggable.element ) ) ) { 13570 this._addHoverClass(); 13571 this._trigger( "over", event, this.ui( draggable ) ); 13572 } 13573 13574 }, 13575 13576 _out: function( event ) { 13577 13578 var draggable = $.ui.ddmanager.current; 13579 13580 // Bail if draggable and droppable are same element 13581 if ( !draggable || ( draggable.currentItem || 13582 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13583 return; 13584 } 13585 13586 if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || 13587 draggable.element ) ) ) { 13588 this._removeHoverClass(); 13589 this._trigger( "out", event, this.ui( draggable ) ); 13590 } 13591 13592 }, 13593 13594 _drop: function( event, custom ) { 13595 13596 var draggable = custom || $.ui.ddmanager.current, 13597 childrenIntersection = false; 13598 13599 // Bail if draggable and droppable are same element 13600 if ( !draggable || ( draggable.currentItem || 13601 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13602 return false; 13603 } 13604 13605 this.element 13606 .find( ":data(ui-droppable)" ) 13607 .not( ".ui-draggable-dragging" ) 13608 .each( function() { 13609 var inst = $( this ).droppable( "instance" ); 13610 if ( 13611 inst.options.greedy && 13612 !inst.options.disabled &&
vendor: 4,579 bytes, lines 13613-13773
13613 inst.options.scope === draggable.options.scope && 13614 inst.accept.call( 13615 inst.element[ 0 ], ( draggable.currentItem || draggable.element ) 13616 ) && 13617 $.ui.intersect( 13618 draggable, 13619 $.extend( inst, { offset: inst.element.offset() } ), 13620 inst.options.tolerance, event 13621 ) 13622 ) { 13623 childrenIntersection = true; 13624 return false; 13625 } 13626 } ); 13627 if ( childrenIntersection ) { 13628 return false; 13629 } 13630 13631 if ( this.accept.call( this.element[ 0 ], 13632 ( draggable.currentItem || draggable.element ) ) ) { 13633 this._removeActiveClass(); 13634 this._removeHoverClass(); 13635 13636 this._trigger( "drop", event, this.ui( draggable ) ); 13637 return this.element; 13638 } 13639 13640 return false; 13641 13642 }, 13643 13644 ui: function( c ) { 13645 return { 13646 draggable: ( c.currentItem || c.element ), 13647 helper: c.helper, 13648 position: c.position, 13649 offset: c.positionAbs 13650 }; 13651 }, 13652 13653 // Extension points just to make backcompat sane and avoid duplicating logic 13654 // TODO: Remove in 1.14 along with call to it below 13655 _addHoverClass: function() { 13656 this._addClass( "ui-droppable-hover" ); 13657 }, 13658 13659 _removeHoverClass: function() { 13660 this._removeClass( "ui-droppable-hover" ); 13661 }, 13662 13663 _addActiveClass: function() { 13664 this._addClass( "ui-droppable-active" ); 13665 }, 13666 13667 _removeActiveClass: function() { 13668 this._removeClass( "ui-droppable-active" ); 13669 } 13670} ); 13671 13672$.ui.intersect = ( function() { 13673 function isOverAxis( x, reference, size ) { 13674 return ( x >= reference ) && ( x < ( reference + size ) ); 13675 } 13676 13677 return function( draggable, droppable, toleranceMode, event ) { 13678 13679 if ( !droppable.offset ) { 13680 return false; 13681 } 13682 13683 var x1 = ( draggable.positionAbs || 13684 draggable.position.absolute ).left + draggable.margins.left, 13685 y1 = ( draggable.positionAbs || 13686 draggable.position.absolute ).top + draggable.margins.top, 13687 x2 = x1 + draggable.helperProportions.width, 13688 y2 = y1 + draggable.helperProportions.height, 13689 l = droppable.offset.left, 13690 t = droppable.offset.top, 13691 r = l + droppable.proportions().width, 13692 b = t + droppable.proportions().height; 13693 13694 switch ( toleranceMode ) { 13695 case "fit": 13696 return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b ); 13697 case "intersect": 13698 return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half 13699 x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half 13700 t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half 13701 y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half 13702 case "pointer": 13703 return isOverAxis( event.pageY, t, droppable.proportions().height ) && 13704 isOverAxis( event.pageX, l, droppable.proportions().width ); 13705 case "touch": 13706 return ( 13707 ( y1 >= t && y1 <= b ) || // Top edge touching 13708 ( y2 >= t && y2 <= b ) || // Bottom edge touching 13709 ( y1 < t && y2 > b ) // Surrounded vertically 13710 ) && ( 13711 ( x1 >= l && x1 <= r ) || // Left edge touching 13712 ( x2 >= l && x2 <= r ) || // Right edge touching 13713 ( x1 < l && x2 > r ) // Surrounded horizontally 13714 ); 13715 default: 13716 return false; 13717 } 13718 }; 13719} )(); 13720 13721/* 13722 This manager tracks offsets of draggables and droppables 13723*/ 13724$.ui.ddmanager = { 13725 current: null, 13726 droppables: { "default": [] }, 13727 prepareOffsets: function( t, event ) { 13728 13729 var i, j, 13730 m = $.ui.ddmanager.droppables[ t.options.scope ] || [], 13731 type = event ? event.type : null, // workaround for #2317 13732 list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack(); 13733 13734 droppablesLoop: for ( i = 0; i < m.length; i++ ) { 13735 13736 // No disabled and non-accepted 13737 if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], 13738 ( t.currentItem || t.element ) ) ) ) { 13739 continue; 13740 } 13741 13742 // Filter out elements in the current dragged item 13743 for ( j = 0; j < list.length; j++ ) { 13744 if ( list[ j ] === m[ i ].element[ 0 ] ) { 13745 m[ i ].proportions().height = 0; 13746 continue droppablesLoop; 13747 } 13748 } 13749 13750 m[ i ].visible = m[ i ].element.css( "display" ) !== "none"; 13751 if ( !m[ i ].visible ) { 13752 continue; 13753 } 13754 13755 // Activate the droppable if used directly from draggables 13756 if ( type === "mousedown" ) { 13757 m[ i ]._activate.call( m[ i ], event ); 13758 } 13759 13760 m[ i ].offset = m[ i ].element.offset(); 13761 m[ i ].proportions( { 13762 width: m[ i ].element[ 0 ].offsetWidth, 13763 height: m[ i ].element[ 0 ].offsetHeight 13764 } ); 13765 13766 } 13767 13768 }, 13769 drop: function( draggable, event ) { 13770 13771 var dropped = false; 13772 13773 // Create a copy of the droppables in case the list changes during the drop (#9116)
vendor: 4,304 bytes, lines 13774-13916
13774 $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() { 13775 13776 if ( !this.options ) { 13777 return; 13778 } 13779 if ( !this.options.disabled && this.visible && 13780 $.ui.intersect( draggable, this, this.options.tolerance, event ) ) { 13781 dropped = this._drop.call( this, event ) || dropped; 13782 } 13783 13784 if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], 13785 ( draggable.currentItem || draggable.element ) ) ) { 13786 this.isout = true; 13787 this.isover = false; 13788 this._deactivate.call( this, event ); 13789 } 13790 13791 } ); 13792 return dropped; 13793 13794 }, 13795 dragStart: function( draggable, event ) { 13796 13797 // Listen for scrolling so that if the dragging causes scrolling the position of the 13798 // droppables can be recalculated (see #5003) 13799 draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() { 13800 if ( !draggable.options.refreshPositions ) { 13801 $.ui.ddmanager.prepareOffsets( draggable, event ); 13802 } 13803 } ); 13804 }, 13805 drag: function( draggable, event ) { 13806 13807 // If you have a highly dynamic page, you might try this option. It renders positions 13808 // every time you move the mouse. 13809 if ( draggable.options.refreshPositions ) { 13810 $.ui.ddmanager.prepareOffsets( draggable, event ); 13811 } 13812 13813 // Run through all droppables and check their positions based on specific tolerance options 13814 $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { 13815 13816 if ( this.options.disabled || this.greedyChild || !this.visible ) { 13817 return; 13818 } 13819 13820 var parentInstance, scope, parent, 13821 intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ), 13822 c = !intersects && this.isover ? 13823 "isout" : 13824 ( intersects && !this.isover ? "isover" : null ); 13825 if ( !c ) { 13826 return; 13827 } 13828 13829 if ( this.options.greedy ) { 13830 13831 // find droppable parents with same scope 13832 scope = this.options.scope; 13833 parent = this.element.parents( ":data(ui-droppable)" ).filter( function() { 13834 return $( this ).droppable( "instance" ).options.scope === scope; 13835 } ); 13836 13837 if ( parent.length ) { 13838 parentInstance = $( parent[ 0 ] ).droppable( "instance" ); 13839 parentInstance.greedyChild = ( c === "isover" ); 13840 } 13841 } 13842 13843 // We just moved into a greedy child 13844 if ( parentInstance && c === "isover" ) { 13845 parentInstance.isover = false; 13846 parentInstance.isout = true; 13847 parentInstance._out.call( parentInstance, event ); 13848 } 13849 13850 this[ c ] = true; 13851 this[ c === "isout" ? "isover" : "isout" ] = false; 13852 this[ c === "isover" ? "_over" : "_out" ].call( this, event ); 13853 13854 // We just moved out of a greedy child 13855 if ( parentInstance && c === "isout" ) { 13856 parentInstance.isout = false; 13857 parentInstance.isover = true; 13858 parentInstance._over.call( parentInstance, event ); 13859 } 13860 } ); 13861 13862 }, 13863 dragStop: function( draggable, event ) { 13864 draggable.element.parentsUntil( "body" ).off( "scroll.droppable" ); 13865 13866 // Call prepareOffsets one final time since IE does not fire return scroll events when 13867 // overflow was caused by drag (see #5003) 13868 if ( !draggable.options.refreshPositions ) { 13869 $.ui.ddmanager.prepareOffsets( draggable, event ); 13870 } 13871 } 13872}; 13873 13874// DEPRECATED 13875// TODO: switch return back to widget declaration at top of file when this is removed 13876if ( $.uiBackCompat !== false ) { 13877 13878 // Backcompat for activeClass and hoverClass options 13879 $.widget( "ui.droppable", $.ui.droppable, { 13880 options: { 13881 hoverClass: false, 13882 activeClass: false 13883 }, 13884 _addActiveClass: function() { 13885 this._super(); 13886 if ( this.options.activeClass ) { 13887 this.element.addClass( this.options.activeClass ); 13888 } 13889 }, 13890 _removeActiveClass: function() { 13891 this._super(); 13892 if ( this.options.activeClass ) { 13893 this.element.removeClass( this.options.activeClass ); 13894 } 13895 }, 13896 _addHoverClass: function() { 13897 this._super(); 13898 if ( this.options.hoverClass ) { 13899 this.element.addClass( this.options.hoverClass ); 13900 } 13901 }, 13902 _removeHoverClass: function() { 13903 this._super(); 13904 if ( this.options.hoverClass ) { 13905 this.element.removeClass( this.options.hoverClass ); 13906 } 13907 } 13908 } ); 13909} 13910 13911var widgetsDroppable = $.ui.droppable; 13912 13913 13914/*! 13915 * jQuery UI Progressbar 1.13.2 13916 * http://jqueryui.com
vendor: 12,231 bytes, lines 13917-14377
13917 * 13918 * Copyright jQuery Foundation and other contributors 13919 * Released under the MIT license. 13920 * http://jquery.org/license 13921 */ 13922 13923//>>label: Progressbar 13924//>>group: Widgets 13925/* eslint-disable max-len */ 13926//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators. 13927/* eslint-enable max-len */ 13928//>>docs: http://api.jqueryui.com/progressbar/ 13929//>>demos: http://jqueryui.com/progressbar/ 13930//>>css.structure: ../../themes/base/core.css 13931//>>css.structure: ../../themes/base/progressbar.css 13932//>>css.theme: ../../themes/base/theme.css 13933 13934 13935var widgetsProgressbar = $.widget( "ui.progressbar", { 13936 version: "1.13.2", 13937 options: { 13938 classes: { 13939 "ui-progressbar": "ui-corner-all", 13940 "ui-progressbar-value": "ui-corner-left", 13941 "ui-progressbar-complete": "ui-corner-right" 13942 }, 13943 max: 100, 13944 value: 0, 13945 13946 change: null, 13947 complete: null 13948 }, 13949 13950 min: 0, 13951 13952 _create: function() { 13953 13954 // Constrain initial value 13955 this.oldValue = this.options.value = this._constrainedValue(); 13956 13957 this.element.attr( { 13958 13959 // Only set static values; aria-valuenow and aria-valuemax are 13960 // set inside _refreshValue() 13961 role: "progressbar", 13962 "aria-valuemin": this.min 13963 } ); 13964 this._addClass( "ui-progressbar", "ui-widget ui-widget-content" ); 13965 13966 this.valueDiv = $( "<div>" ).appendTo( this.element ); 13967 this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" ); 13968 this._refreshValue(); 13969 }, 13970 13971 _destroy: function() { 13972 this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" ); 13973 13974 this.valueDiv.remove(); 13975 }, 13976 13977 value: function( newValue ) { 13978 if ( newValue === undefined ) { 13979 return this.options.value; 13980 } 13981 13982 this.options.value = this._constrainedValue( newValue ); 13983 this._refreshValue(); 13984 }, 13985 13986 _constrainedValue: function( newValue ) { 13987 if ( newValue === undefined ) { 13988 newValue = this.options.value; 13989 } 13990 13991 this.indeterminate = newValue === false; 13992 13993 // Sanitize value 13994 if ( typeof newValue !== "number" ) { 13995 newValue = 0; 13996 } 13997 13998 return this.indeterminate ? false : 13999 Math.min( this.options.max, Math.max( this.min, newValue ) ); 14000 }, 14001 14002 _setOptions: function( options ) { 14003 14004 // Ensure "value" option is set after other values (like max) 14005 var value = options.value; 14006 delete options.value; 14007 14008 this._super( options ); 14009 14010 this.options.value = this._constrainedValue( value ); 14011 this._refreshValue(); 14012 }, 14013 14014 _setOption: function( key, value ) { 14015 if ( key === "max" ) { 14016 14017 // Don't allow a max less than min 14018 value = Math.max( this.min, value ); 14019 } 14020 this._super( key, value ); 14021 }, 14022 14023 _setOptionDisabled: function( value ) { 14024 this._super( value ); 14025 14026 this.element.attr( "aria-disabled", value ); 14027 this._toggleClass( null, "ui-state-disabled", !!value ); 14028 }, 14029 14030 _percentage: function() { 14031 return this.indeterminate ? 14032 100 : 14033 100 * ( this.options.value - this.min ) / ( this.options.max - this.min ); 14034 }, 14035 14036 _refreshValue: function() { 14037 var value = this.options.value, 14038 percentage = this._percentage(); 14039 14040 this.valueDiv 14041 .toggle( this.indeterminate || value > this.min ) 14042 .width( percentage.toFixed( 0 ) + "%" ); 14043 14044 this 14045 ._toggleClass( this.valueDiv, "ui-progressbar-complete", null, 14046 value === this.options.max ) 14047 ._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate ); 14048 14049 if ( this.indeterminate ) { 14050 this.element.removeAttr( "aria-valuenow" ); 14051 if ( !this.overlayDiv ) { 14052 this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv ); 14053 this._addClass( this.overlayDiv, "ui-progressbar-overlay" ); 14054 } 14055 } else { 14056 this.element.attr( { 14057 "aria-valuemax": this.options.max, 14058 "aria-valuenow": value 14059 } ); 14060 if ( this.overlayDiv ) { 14061 this.overlayDiv.remove(); 14062 this.overlayDiv = null; 14063 } 14064 } 14065 14066 if ( this.oldValue !== value ) { 14067 this.oldValue = value; 14068 this._trigger( "change" ); 14069 } 14070 if ( value === this.options.max ) { 14071 this._trigger( "complete" ); 14072 } 14073 } 14074} ); 14075 14076 14077/*! 14078 * jQuery UI Selectable 1.13.2 14079 * http://jqueryui.com 14080 * 14081 * Copyright jQuery Foundation and other contributors 14082 * Released under the MIT license. 14083 * http://jquery.org/license 14084 */ 14085 14086//>>label: Selectable 14087//>>group: Interactions 14088//>>description: Allows groups of elements to be selected with the mouse. 14089//>>docs: http://api.jqueryui.com/selectable/ 14090//>>demos: http://jqueryui.com/selectable/ 14091//>>css.structure: ../../themes/base/selectable.css 14092 14093 14094var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, { 14095 version: "1.13.2", 14096 options: { 14097 appendTo: "body", 14098 autoRefresh: true, 14099 distance: 0, 14100 filter: "*", 14101 tolerance: "touch", 14102 14103 // Callbacks 14104 selected: null, 14105 selecting: null, 14106 start: null, 14107 stop: null, 14108 unselected: null, 14109 unselecting: null 14110 }, 14111 _create: function() { 14112 var that = this; 14113 14114 this._addClass( "ui-selectable" ); 14115 14116 this.dragged = false; 14117 14118 // Cache selectee children based on filter 14119 this.refresh = function() { 14120 that.elementPos = $( that.element[ 0 ] ).offset(); 14121 that.selectees = $( that.options.filter, that.element[ 0 ] ); 14122 that._addClass( that.selectees, "ui-selectee" ); 14123 that.selectees.each( function() { 14124 var $this = $( this ), 14125 selecteeOffset = $this.offset(), 14126 pos = { 14127 left: selecteeOffset.left - that.elementPos.left, 14128 top: selecteeOffset.top - that.elementPos.top 14129 }; 14130 $.data( this, "selectable-item", { 14131 element: this, 14132 $element: $this, 14133 left: pos.left, 14134 top: pos.top, 14135 right: pos.left + $this.outerWidth(), 14136 bottom: pos.top + $this.outerHeight(), 14137 startselected: false, 14138 selected: $this.hasClass( "ui-selected" ), 14139 selecting: $this.hasClass( "ui-selecting" ), 14140 unselecting: $this.hasClass( "ui-unselecting" ) 14141 } ); 14142 } ); 14143 }; 14144 this.refresh(); 14145 14146 this._mouseInit(); 14147 14148 this.helper = $( "<div>" ); 14149 this._addClass( this.helper, "ui-selectable-helper" ); 14150 }, 14151 14152 _destroy: function() { 14153 this.selectees.removeData( "selectable-item" ); 14154 this._mouseDestroy(); 14155 }, 14156 14157 _mouseStart: function( event ) { 14158 var that = this, 14159 options = this.options; 14160 14161 this.opos = [ event.pageX, event.pageY ]; 14162 this.elementPos = $( this.element[ 0 ] ).offset(); 14163 14164 if ( this.options.disabled ) { 14165 return; 14166 } 14167 14168 this.selectees = $( options.filter, this.element[ 0 ] ); 14169 14170 this._trigger( "start", event ); 14171 14172 $( options.appendTo ).append( this.helper ); 14173 14174 // position helper (lasso) 14175 this.helper.css( { 14176 "left": event.pageX, 14177 "top": event.pageY, 14178 "width": 0, 14179 "height": 0 14180 } ); 14181 14182 if ( options.autoRefresh ) { 14183 this.refresh(); 14184 } 14185 14186 this.selectees.filter( ".ui-selected" ).each( function() { 14187 var selectee = $.data( this, "selectable-item" ); 14188 selectee.startselected = true; 14189 if ( !event.metaKey && !event.ctrlKey ) { 14190 that._removeClass( selectee.$element, "ui-selected" ); 14191 selectee.selected = false; 14192 that._addClass( selectee.$element, "ui-unselecting" ); 14193 selectee.unselecting = true; 14194 14195 // selectable UNSELECTING callback 14196 that._trigger( "unselecting", event, { 14197 unselecting: selectee.element 14198 } ); 14199 } 14200 } ); 14201 14202 $( event.target ).parents().addBack().each( function() { 14203 var doSelect, 14204 selectee = $.data( this, "selectable-item" ); 14205 if ( selectee ) { 14206 doSelect = ( !event.metaKey && !event.ctrlKey ) || 14207 !selectee.$element.hasClass( "ui-selected" ); 14208 that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" ) 14209 ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" ); 14210 selectee.unselecting = !doSelect; 14211 selectee.selecting = doSelect; 14212 selectee.selected = doSelect; 14213 14214 // selectable (UN)SELECTING callback 14215 if ( doSelect ) { 14216 that._trigger( "selecting", event, { 14217 selecting: selectee.element 14218 } ); 14219 } else { 14220 that._trigger( "unselecting", event, { 14221 unselecting: selectee.element 14222 } ); 14223 } 14224 return false; 14225 } 14226 } ); 14227 14228 }, 14229 14230 _mouseDrag: function( event ) { 14231 14232 this.dragged = true; 14233 14234 if ( this.options.disabled ) { 14235 return; 14236 } 14237 14238 var tmp, 14239 that = this, 14240 options = this.options, 14241 x1 = this.opos[ 0 ], 14242 y1 = this.opos[ 1 ], 14243 x2 = event.pageX, 14244 y2 = event.pageY; 14245 14246 if ( x1 > x2 ) { 14247 tmp = x2; x2 = x1; x1 = tmp; 14248 } 14249 if ( y1 > y2 ) { 14250 tmp = y2; y2 = y1; y1 = tmp; 14251 } 14252 this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } ); 14253 14254 this.selectees.each( function() { 14255 var selectee = $.data( this, "selectable-item" ), 14256 hit = false, 14257 offset = {}; 14258 14259 //prevent helper from being selected if appendTo: selectable 14260 if ( !selectee || selectee.element === that.element[ 0 ] ) { 14261 return; 14262 } 14263 14264 offset.left = selectee.left + that.elementPos.left; 14265 offset.right = selectee.right + that.elementPos.left; 14266 offset.top = selectee.top + that.elementPos.top; 14267 offset.bottom = selectee.bottom + that.elementPos.top; 14268 14269 if ( options.tolerance === "touch" ) { 14270 hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 || 14271 offset.bottom < y1 ) ); 14272 } else if ( options.tolerance === "fit" ) { 14273 hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 && 14274 offset.bottom < y2 ); 14275 } 14276 14277 if ( hit ) { 14278 14279 // SELECT 14280 if ( selectee.selected ) { 14281 that._removeClass( selectee.$element, "ui-selected" ); 14282 selectee.selected = false; 14283 } 14284 if ( selectee.unselecting ) { 14285 that._removeClass( selectee.$element, "ui-unselecting" ); 14286 selectee.unselecting = false; 14287 } 14288 if ( !selectee.selecting ) { 14289 that._addClass( selectee.$element, "ui-selecting" ); 14290 selectee.selecting = true; 14291 14292 // selectable SELECTING callback 14293 that._trigger( "selecting", event, { 14294 selecting: selectee.element 14295 } ); 14296 } 14297 } else { 14298 14299 // UNSELECT 14300 if ( selectee.selecting ) { 14301 if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) { 14302 that._removeClass( selectee.$element, "ui-selecting" ); 14303 selectee.selecting = false; 14304 that._addClass( selectee.$element, "ui-selected" ); 14305 selectee.selected = true; 14306 } else { 14307 that._removeClass( selectee.$element, "ui-selecting" ); 14308 selectee.selecting = false; 14309 if ( selectee.startselected ) { 14310 that._addClass( selectee.$element, "ui-unselecting" ); 14311 selectee.unselecting = true; 14312 } 14313 14314 // selectable UNSELECTING callback 14315 that._trigger( "unselecting", event, { 14316 unselecting: selectee.element 14317 } ); 14318 } 14319 } 14320 if ( selectee.selected ) { 14321 if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) { 14322 that._removeClass( selectee.$element, "ui-selected" ); 14323 selectee.selected = false; 14324 14325 that._addClass( selectee.$element, "ui-unselecting" ); 14326 selectee.unselecting = true; 14327 14328 // selectable UNSELECTING callback 14329 that._trigger( "unselecting", event, { 14330 unselecting: selectee.element 14331 } ); 14332 } 14333 } 14334 } 14335 } ); 14336 14337 return false; 14338 }, 14339 14340 _mouseStop: function( event ) { 14341 var that = this; 14342 14343 this.dragged = false; 14344 14345 $( ".ui-unselecting", this.element[ 0 ] ).each( function() { 14346 var selectee = $.data( this, "selectable-item" ); 14347 that._removeClass( selectee.$element, "ui-unselecting" ); 14348 selectee.unselecting = false; 14349 selectee.startselected = false; 14350 that._trigger( "unselected", event, { 14351 unselected: selectee.element 14352 } ); 14353 } ); 14354 $( ".ui-selecting", this.element[ 0 ] ).each( function() { 14355 var selectee = $.data( this, "selectable-item" ); 14356 that._removeClass( selectee.$element, "ui-selecting" ) 14357 ._addClass( selectee.$element, "ui-selected" ); 14358 selectee.selecting = false; 14359 selectee.selected = true; 14360 selectee.startselected = true; 14361 that._trigger( "selected", event, { 14362 selected: selectee.element 14363 } ); 14364 } ); 14365 this._trigger( "stop", event ); 14366 14367 this.helper.remove(); 14368 14369 return false; 14370 } 14371 14372} ); 14373 14374 14375/*! 14376 * jQuery UI Selectmenu 1.13.2 14377 * http://jqueryui.com
vendor: 5,542 bytes, lines 14378-14583
14378 * 14379 * Copyright jQuery Foundation and other contributors 14380 * Released under the MIT license. 14381 * http://jquery.org/license 14382 */ 14383 14384//>>label: Selectmenu 14385//>>group: Widgets 14386/* eslint-disable max-len */ 14387//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select. 14388/* eslint-enable max-len */ 14389//>>docs: http://api.jqueryui.com/selectmenu/ 14390//>>demos: http://jqueryui.com/selectmenu/ 14391//>>css.structure: ../../themes/base/core.css 14392//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css 14393//>>css.theme: ../../themes/base/theme.css 14394 14395 14396var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { 14397 version: "1.13.2", 14398 defaultElement: "<select>", 14399 options: { 14400 appendTo: null, 14401 classes: { 14402 "ui-selectmenu-button-open": "ui-corner-top", 14403 "ui-selectmenu-button-closed": "ui-corner-all" 14404 }, 14405 disabled: null, 14406 icons: { 14407 button: "ui-icon-triangle-1-s" 14408 }, 14409 position: { 14410 my: "left top", 14411 at: "left bottom", 14412 collision: "none" 14413 }, 14414 width: false, 14415 14416 // Callbacks 14417 change: null, 14418 close: null, 14419 focus: null, 14420 open: null, 14421 select: null 14422 }, 14423 14424 _create: function() { 14425 var selectmenuId = this.element.uniqueId().attr( "id" ); 14426 this.ids = { 14427 element: selectmenuId, 14428 button: selectmenuId + "-button", 14429 menu: selectmenuId + "-menu" 14430 }; 14431 14432 this._drawButton(); 14433 this._drawMenu(); 14434 this._bindFormResetHandler(); 14435 14436 this._rendered = false; 14437 this.menuItems = $(); 14438 }, 14439 14440 _drawButton: function() { 14441 var icon, 14442 that = this, 14443 item = this._parseOption( 14444 this.element.find( "option:selected" ), 14445 this.element[ 0 ].selectedIndex 14446 ); 14447 14448 // Associate existing label with the new button 14449 this.labels = this.element.labels().attr( "for", this.ids.button ); 14450 this._on( this.labels, { 14451 click: function( event ) { 14452 this.button.trigger( "focus" ); 14453 event.preventDefault(); 14454 } 14455 } ); 14456 14457 // Hide original select element 14458 this.element.hide(); 14459 14460 // Create button 14461 this.button = $( "<span>", { 14462 tabindex: this.options.disabled ? -1 : 0, 14463 id: this.ids.button, 14464 role: "combobox", 14465 "aria-expanded": "false", 14466 "aria-autocomplete": "list", 14467 "aria-owns": this.ids.menu, 14468 "aria-haspopup": "true", 14469 title: this.element.attr( "title" ) 14470 } ) 14471 .insertAfter( this.element ); 14472 14473 this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed", 14474 "ui-button ui-widget" ); 14475 14476 icon = $( "<span>" ).appendTo( this.button ); 14477 this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button ); 14478 this.buttonItem = this._renderButtonItem( item ) 14479 .appendTo( this.button ); 14480 14481 if ( this.options.width !== false ) { 14482 this._resizeButton(); 14483 } 14484 14485 this._on( this.button, this._buttonEvents ); 14486 this.button.one( "focusin", function() { 14487 14488 // Delay rendering the menu items until the button receives focus. 14489 // The menu may have already been rendered via a programmatic open. 14490 if ( !that._rendered ) { 14491 that._refreshMenu(); 14492 } 14493 } ); 14494 }, 14495 14496 _drawMenu: function() { 14497 var that = this; 14498 14499 // Create menu 14500 this.menu = $( "<ul>", { 14501 "aria-hidden": "true", 14502 "aria-labelledby": this.ids.button, 14503 id: this.ids.menu 14504 } ); 14505 14506 // Wrap menu 14507 this.menuWrap = $( "<div>" ).append( this.menu ); 14508 this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" ); 14509 this.menuWrap.appendTo( this._appendTo() ); 14510 14511 // Initialize menu widget 14512 this.menuInstance = this.menu 14513 .menu( { 14514 classes: { 14515 "ui-menu": "ui-corner-bottom" 14516 }, 14517 role: "listbox", 14518 select: function( event, ui ) { 14519 event.preventDefault(); 14520 14521 // Support: IE8 14522 // If the item was selected via a click, the text selection 14523 // will be destroyed in IE 14524 that._setSelection(); 14525 14526 that._select( ui.item.data( "ui-selectmenu-item" ), event ); 14527 }, 14528 focus: function( event, ui ) { 14529 var item = ui.item.data( "ui-selectmenu-item" ); 14530 14531 // Prevent inital focus from firing and check if its a newly focused item 14532 if ( that.focusIndex != null && item.index !== that.focusIndex ) { 14533 that._trigger( "focus", event, { item: item } ); 14534 if ( !that.isOpen ) { 14535 that._select( item, event ); 14536 } 14537 } 14538 that.focusIndex = item.index; 14539 14540 that.button.attr( "aria-activedescendant", 14541 that.menuItems.eq( item.index ).attr( "id" ) ); 14542 } 14543 } ) 14544 .menu( "instance" ); 14545 14546 // Don't close the menu on mouseleave 14547 this.menuInstance._off( this.menu, "mouseleave" ); 14548 14549 // Cancel the menu's collapseAll on document click 14550 this.menuInstance._closeOnDocumentClick = function() { 14551 return false; 14552 }; 14553 14554 // Selects often contain empty items, but never contain dividers 14555 this.menuInstance._isDivider = function() { 14556 return false; 14557 }; 14558 }, 14559 14560 refresh: function() { 14561 this._refreshMenu(); 14562 this.buttonItem.replaceWith( 14563 this.buttonItem = this._renderButtonItem( 14564 14565 // Fall back to an empty object in case there are no options 14566 this._getSelectedItem().data( "ui-selectmenu-item" ) || {} 14567 ) 14568 ); 14569 if ( this.options.width === null ) { 14570 this._resizeButton(); 14571 } 14572 }, 14573 14574 _refreshMenu: function() { 14575 var item, 14576 options = this.element.find( "option" ); 14577 14578 this.menu.empty(); 14579 14580 this._parseOptions( options ); 14581 this._renderMenu( this.menu, this.items ); 14582 14583 this.menuInstance.refresh();
vendor: 4,148 bytes, lines 14584-14766
14584 this.menuItems = this.menu.find( "li" ) 14585 .not( ".ui-selectmenu-optgroup" ) 14586 .find( ".ui-menu-item-wrapper" ); 14587 14588 this._rendered = true; 14589 14590 if ( !options.length ) { 14591 return; 14592 } 14593 14594 item = this._getSelectedItem(); 14595 14596 // Update the menu to have the correct item focused 14597 this.menuInstance.focus( null, item ); 14598 this._setAria( item.data( "ui-selectmenu-item" ) ); 14599 14600 // Set disabled state 14601 this._setOption( "disabled", this.element.prop( "disabled" ) ); 14602 }, 14603 14604 open: function( event ) { 14605 if ( this.options.disabled ) { 14606 return; 14607 } 14608 14609 // If this is the first time the menu is being opened, render the items 14610 if ( !this._rendered ) { 14611 this._refreshMenu(); 14612 } else { 14613 14614 // Menu clears focus on close, reset focus to selected item 14615 this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" ); 14616 this.menuInstance.focus( null, this._getSelectedItem() ); 14617 } 14618 14619 // If there are no options, don't open the menu 14620 if ( !this.menuItems.length ) { 14621 return; 14622 } 14623 14624 this.isOpen = true; 14625 this._toggleAttr(); 14626 this._resizeMenu(); 14627 this._position(); 14628 14629 this._on( this.document, this._documentClick ); 14630 14631 this._trigger( "open", event ); 14632 }, 14633 14634 _position: function() { 14635 this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) ); 14636 }, 14637 14638 close: function( event ) { 14639 if ( !this.isOpen ) { 14640 return; 14641 } 14642 14643 this.isOpen = false; 14644 this._toggleAttr(); 14645 14646 this.range = null; 14647 this._off( this.document ); 14648 14649 this._trigger( "close", event ); 14650 }, 14651 14652 widget: function() { 14653 return this.button; 14654 }, 14655 14656 menuWidget: function() { 14657 return this.menu; 14658 }, 14659 14660 _renderButtonItem: function( item ) { 14661 var buttonItem = $( "<span>" ); 14662 14663 this._setText( buttonItem, item.label ); 14664 this._addClass( buttonItem, "ui-selectmenu-text" ); 14665 14666 return buttonItem; 14667 }, 14668 14669 _renderMenu: function( ul, items ) { 14670 var that = this, 14671 currentOptgroup = ""; 14672 14673 $.each( items, function( index, item ) { 14674 var li; 14675 14676 if ( item.optgroup !== currentOptgroup ) { 14677 li = $( "<li>", { 14678 text: item.optgroup 14679 } ); 14680 that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" + 14681 ( item.element.parent( "optgroup" ).prop( "disabled" ) ? 14682 " ui-state-disabled" : 14683 "" ) ); 14684 14685 li.appendTo( ul ); 14686 14687 currentOptgroup = item.optgroup; 14688 } 14689 14690 that._renderItemData( ul, item ); 14691 } ); 14692 }, 14693 14694 _renderItemData: function( ul, item ) { 14695 return this._renderItem( ul, item ).data( "ui-selectmenu-item", item ); 14696 }, 14697 14698 _renderItem: function( ul, item ) { 14699 var li = $( "<li>" ), 14700 wrapper = $( "<div>", { 14701 title: item.element.attr( "title" ) 14702 } ); 14703 14704 if ( item.disabled ) { 14705 this._addClass( li, null, "ui-state-disabled" ); 14706 } 14707 this._setText( wrapper, item.label ); 14708 14709 return li.append( wrapper ).appendTo( ul ); 14710 }, 14711 14712 _setText: function( element, value ) { 14713 if ( value ) { 14714 element.text( value ); 14715 } else { 14716 element.html( " " ); 14717 } 14718 }, 14719 14720 _move: function( direction, event ) { 14721 var item, next, 14722 filter = ".ui-menu-item"; 14723 14724 if ( this.isOpen ) { 14725 item = this.menuItems.eq( this.focusIndex ).parent( "li" ); 14726 } else { 14727 item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); 14728 filter += ":not(.ui-state-disabled)"; 14729 } 14730 14731 if ( direction === "first" || direction === "last" ) { 14732 next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 ); 14733 } else { 14734 next = item[ direction + "All" ]( filter ).eq( 0 ); 14735 } 14736 14737 if ( next.length ) { 14738 this.menuInstance.focus( event, next ); 14739 } 14740 }, 14741 14742 _getSelectedItem: function() { 14743 return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); 14744 }, 14745 14746 _toggle: function( event ) { 14747 this[ this.isOpen ? "close" : "open" ]( event ); 14748 }, 14749 14750 _setSelection: function() { 14751 var selection; 14752 14753 if ( !this.range ) { 14754 return; 14755 } 14756 14757 if ( window.getSelection ) { 14758 selection = window.getSelection(); 14759 selection.removeAllRanges(); 14760 selection.addRange( this.range ); 14761 14762 // Support: IE8 14763 } else { 14764 this.range.select(); 14765 } 14766
vendor: 11,066 bytes, lines 14767-15208
14767 // Support: IE 14768 // Setting the text selection kills the button focus in IE, but 14769 // restoring the focus doesn't kill the selection. 14770 this.button.trigger( "focus" ); 14771 }, 14772 14773 _documentClick: { 14774 mousedown: function( event ) { 14775 if ( !this.isOpen ) { 14776 return; 14777 } 14778 14779 if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + 14780 $.escapeSelector( this.ids.button ) ).length ) { 14781 this.close( event ); 14782 } 14783 } 14784 }, 14785 14786 _buttonEvents: { 14787 14788 // Prevent text selection from being reset when interacting with the selectmenu (#10144) 14789 mousedown: function() { 14790 var selection; 14791 14792 if ( window.getSelection ) { 14793 selection = window.getSelection(); 14794 if ( selection.rangeCount ) { 14795 this.range = selection.getRangeAt( 0 ); 14796 } 14797 14798 // Support: IE8 14799 } else { 14800 this.range = document.selection.createRange(); 14801 } 14802 }, 14803 14804 click: function( event ) { 14805 this._setSelection(); 14806 this._toggle( event ); 14807 }, 14808 14809 keydown: function( event ) { 14810 var preventDefault = true; 14811 switch ( event.keyCode ) { 14812 case $.ui.keyCode.TAB: 14813 case $.ui.keyCode.ESCAPE: 14814 this.close( event ); 14815 preventDefault = false; 14816 break; 14817 case $.ui.keyCode.ENTER: 14818 if ( this.isOpen ) { 14819 this._selectFocusedItem( event ); 14820 } 14821 break; 14822 case $.ui.keyCode.UP: 14823 if ( event.altKey ) { 14824 this._toggle( event ); 14825 } else { 14826 this._move( "prev", event ); 14827 } 14828 break; 14829 case $.ui.keyCode.DOWN: 14830 if ( event.altKey ) { 14831 this._toggle( event ); 14832 } else { 14833 this._move( "next", event ); 14834 } 14835 break; 14836 case $.ui.keyCode.SPACE: 14837 if ( this.isOpen ) { 14838 this._selectFocusedItem( event ); 14839 } else { 14840 this._toggle( event ); 14841 } 14842 break; 14843 case $.ui.keyCode.LEFT: 14844 this._move( "prev", event ); 14845 break; 14846 case $.ui.keyCode.RIGHT: 14847 this._move( "next", event ); 14848 break; 14849 case $.ui.keyCode.HOME: 14850 case $.ui.keyCode.PAGE_UP: 14851 this._move( "first", event ); 14852 break; 14853 case $.ui.keyCode.END: 14854 case $.ui.keyCode.PAGE_DOWN: 14855 this._move( "last", event ); 14856 break; 14857 default: 14858 this.menu.trigger( event ); 14859 preventDefault = false; 14860 } 14861 14862 if ( preventDefault ) { 14863 event.preventDefault(); 14864 } 14865 } 14866 }, 14867 14868 _selectFocusedItem: function( event ) { 14869 var item = this.menuItems.eq( this.focusIndex ).parent( "li" ); 14870 if ( !item.hasClass( "ui-state-disabled" ) ) { 14871 this._select( item.data( "ui-selectmenu-item" ), event ); 14872 } 14873 }, 14874 14875 _select: function( item, event ) { 14876 var oldIndex = this.element[ 0 ].selectedIndex; 14877 14878 // Change native select element 14879 this.element[ 0 ].selectedIndex = item.index; 14880 this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) ); 14881 this._setAria( item ); 14882 this._trigger( "select", event, { item: item } ); 14883 14884 if ( item.index !== oldIndex ) { 14885 this._trigger( "change", event, { item: item } ); 14886 } 14887 14888 this.close( event ); 14889 }, 14890 14891 _setAria: function( item ) { 14892 var id = this.menuItems.eq( item.index ).attr( "id" ); 14893 14894 this.button.attr( { 14895 "aria-labelledby": id, 14896 "aria-activedescendant": id 14897 } ); 14898 this.menu.attr( "aria-activedescendant", id ); 14899 }, 14900 14901 _setOption: function( key, value ) { 14902 if ( key === "icons" ) { 14903 var icon = this.button.find( "span.ui-icon" ); 14904 this._removeClass( icon, null, this.options.icons.button ) 14905 ._addClass( icon, null, value.button ); 14906 } 14907 14908 this._super( key, value ); 14909 14910 if ( key === "appendTo" ) { 14911 this.menuWrap.appendTo( this._appendTo() ); 14912 } 14913 14914 if ( key === "width" ) { 14915 this._resizeButton(); 14916 } 14917 }, 14918 14919 _setOptionDisabled: function( value ) { 14920 this._super( value ); 14921 14922 this.menuInstance.option( "disabled", value ); 14923 this.button.attr( "aria-disabled", value ); 14924 this._toggleClass( this.button, null, "ui-state-disabled", value ); 14925 14926 this.element.prop( "disabled", value ); 14927 if ( value ) { 14928 this.button.attr( "tabindex", -1 ); 14929 this.close(); 14930 } else { 14931 this.button.attr( "tabindex", 0 ); 14932 } 14933 }, 14934 14935 _appendTo: function() { 14936 var element = this.options.appendTo; 14937 14938 if ( element ) { 14939 element = element.jquery || element.nodeType ? 14940 $( element ) : 14941 this.document.find( element ).eq( 0 ); 14942 } 14943 14944 if ( !element || !element[ 0 ] ) { 14945 element = this.element.closest( ".ui-front, dialog" ); 14946 } 14947 14948 if ( !element.length ) { 14949 element = this.document[ 0 ].body; 14950 } 14951 14952 return element; 14953 }, 14954 14955 _toggleAttr: function() { 14956 this.button.attr( "aria-expanded", this.isOpen ); 14957 14958 // We can't use two _toggleClass() calls here, because we need to make sure 14959 // we always remove classes first and add them second, otherwise if both classes have the 14960 // same theme class, it will be removed after we add it. 14961 this._removeClass( this.button, "ui-selectmenu-button-" + 14962 ( this.isOpen ? "closed" : "open" ) ) 14963 ._addClass( this.button, "ui-selectmenu-button-" + 14964 ( this.isOpen ? "open" : "closed" ) ) 14965 ._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen ); 14966 14967 this.menu.attr( "aria-hidden", !this.isOpen ); 14968 }, 14969 14970 _resizeButton: function() { 14971 var width = this.options.width; 14972 14973 // For `width: false`, just remove inline style and stop 14974 if ( width === false ) { 14975 this.button.css( "width", "" ); 14976 return; 14977 } 14978 14979 // For `width: null`, match the width of the original element 14980 if ( width === null ) { 14981 width = this.element.show().outerWidth(); 14982 this.element.hide(); 14983 } 14984 14985 this.button.outerWidth( width ); 14986 }, 14987 14988 _resizeMenu: function() { 14989 this.menu.outerWidth( Math.max( 14990 this.button.outerWidth(), 14991 14992 // Support: IE10 14993 // IE10 wraps long text (possibly a rounding bug) 14994 // so we add 1px to avoid the wrapping 14995 this.menu.width( "" ).outerWidth() + 1 14996 ) ); 14997 }, 14998 14999 _getCreateOptions: function() { 15000 var options = this._super(); 15001 15002 options.disabled = this.element.prop( "disabled" ); 15003 15004 return options; 15005 }, 15006 15007 _parseOptions: function( options ) { 15008 var that = this, 15009 data = []; 15010 options.each( function( index, item ) { 15011 if ( item.hidden ) { 15012 return; 15013 } 15014 15015 data.push( that._parseOption( $( item ), index ) ); 15016 } ); 15017 this.items = data; 15018 }, 15019 15020 _parseOption: function( option, index ) { 15021 var optgroup = option.parent( "optgroup" ); 15022 15023 return { 15024 element: option, 15025 index: index, 15026 value: option.val(), 15027 label: option.text(), 15028 optgroup: optgroup.attr( "label" ) || "", 15029 disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" ) 15030 }; 15031 }, 15032 15033 _destroy: function() { 15034 this._unbindFormResetHandler(); 15035 this.menuWrap.remove(); 15036 this.button.remove(); 15037 this.element.show(); 15038 this.element.removeUniqueId(); 15039 this.labels.attr( "for", this.ids.element ); 15040 } 15041} ] ); 15042 15043 15044/*! 15045 * jQuery UI Slider 1.13.2 15046 * http://jqueryui.com 15047 * 15048 * Copyright jQuery Foundation and other contributors 15049 * Released under the MIT license. 15050 * http://jquery.org/license 15051 */ 15052 15053//>>label: Slider 15054//>>group: Widgets 15055//>>description: Displays a flexible slider with ranges and accessibility via keyboard. 15056//>>docs: http://api.jqueryui.com/slider/ 15057//>>demos: http://jqueryui.com/slider/ 15058//>>css.structure: ../../themes/base/core.css 15059//>>css.structure: ../../themes/base/slider.css 15060//>>css.theme: ../../themes/base/theme.css 15061 15062 15063var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, { 15064 version: "1.13.2", 15065 widgetEventPrefix: "slide", 15066 15067 options: { 15068 animate: false, 15069 classes: { 15070 "ui-slider": "ui-corner-all", 15071 "ui-slider-handle": "ui-corner-all", 15072 15073 // Note: ui-widget-header isn't the most fittingly semantic framework class for this 15074 // element, but worked best visually with a variety of themes 15075 "ui-slider-range": "ui-corner-all ui-widget-header" 15076 }, 15077 distance: 0, 15078 max: 100, 15079 min: 0, 15080 orientation: "horizontal", 15081 range: false, 15082 step: 1, 15083 value: 0, 15084 values: null, 15085 15086 // Callbacks 15087 change: null, 15088 slide: null, 15089 start: null, 15090 stop: null 15091 }, 15092 15093 // Number of pages in a slider 15094 // (how many times can you page up/down to go through the whole range) 15095 numPages: 5, 15096 15097 _create: function() { 15098 this._keySliding = false; 15099 this._mouseSliding = false; 15100 this._animateOff = true; 15101 this._handleIndex = null; 15102 this._detectOrientation(); 15103 this._mouseInit(); 15104 this._calculateNewMax(); 15105 15106 this._addClass( "ui-slider ui-slider-" + this.orientation, 15107 "ui-widget ui-widget-content" ); 15108 15109 this._refresh(); 15110 15111 this._animateOff = false; 15112 }, 15113 15114 _refresh: function() { 15115 this._createRange(); 15116 this._createHandles(); 15117 this._setupEvents(); 15118 this._refreshValue(); 15119 }, 15120 15121 _createHandles: function() { 15122 var i, handleCount, 15123 options = this.options, 15124 existingHandles = this.element.find( ".ui-slider-handle" ), 15125 handle = "<span tabindex='0'></span>", 15126 handles = []; 15127 15128 handleCount = ( options.values && options.values.length ) || 1; 15129 15130 if ( existingHandles.length > handleCount ) { 15131 existingHandles.slice( handleCount ).remove(); 15132 existingHandles = existingHandles.slice( 0, handleCount ); 15133 } 15134 15135 for ( i = existingHandles.length; i < handleCount; i++ ) { 15136 handles.push( handle ); 15137 } 15138 15139 this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); 15140 15141 this._addClass( this.handles, "ui-slider-handle", "ui-state-default" ); 15142 15143 this.handle = this.handles.eq( 0 ); 15144 15145 this.handles.each( function( i ) { 15146 $( this ) 15147 .data( "ui-slider-handle-index", i ) 15148 .attr( "tabIndex", 0 ); 15149 } ); 15150 }, 15151 15152 _createRange: function() { 15153 var options = this.options; 15154 15155 if ( options.range ) { 15156 if ( options.range === true ) { 15157 if ( !options.values ) { 15158 options.values = [ this._valueMin(), this._valueMin() ]; 15159 } else if ( options.values.length && options.values.length !== 2 ) { 15160 options.values = [ options.values[ 0 ], options.values[ 0 ] ]; 15161 } else if ( Array.isArray( options.values ) ) { 15162 options.values = options.values.slice( 0 ); 15163 } 15164 } 15165 15166 if ( !this.range || !this.range.length ) { 15167 this.range = $( "<div>" ) 15168 .appendTo( this.element ); 15169 15170 this._addClass( this.range, "ui-slider-range" ); 15171 } else { 15172 this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" ); 15173 15174 // Handle range switching from true to min/max 15175 this.range.css( { 15176 "left": "", 15177 "bottom": "" 15178 } ); 15179 } 15180 if ( options.range === "min" || options.range === "max" ) { 15181 this._addClass( this.range, "ui-slider-range-" + options.range ); 15182 } 15183 } else { 15184 if ( this.range ) { 15185 this.range.remove(); 15186 } 15187 this.range = null; 15188 } 15189 }, 15190 15191 _setupEvents: function() { 15192 this._off( this.handles ); 15193 this._on( this.handles, this._handleEvents ); 15194 this._hoverable( this.handles ); 15195 this._focusable( this.handles ); 15196 }, 15197 15198 _destroy: function() { 15199 this.handles.remove(); 15200 if ( this.range ) { 15201 this.range.remove(); 15202 } 15203 15204 this._mouseDestroy(); 15205 }, 15206 15207 _mouseCapture: function( event ) { 15208 var position, normValue, distance, closestHandle, index, allowed, offset, mou
vendor: 22,163 bytes, lines 15208-16034
15208seOverHandle, 15209 that = this, 15210 o = this.options; 15211 15212 if ( o.disabled ) { 15213 return false; 15214 } 15215 15216 this.elementSize = { 15217 width: this.element.outerWidth(), 15218 height: this.element.outerHeight() 15219 }; 15220 this.elementOffset = this.element.offset(); 15221 15222 position = { x: event.pageX, y: event.pageY }; 15223 normValue = this._normValueFromMouse( position ); 15224 distance = this._valueMax() - this._valueMin() + 1; 15225 this.handles.each( function( i ) { 15226 var thisDistance = Math.abs( normValue - that.values( i ) ); 15227 if ( ( distance > thisDistance ) || 15228 ( distance === thisDistance && 15229 ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) { 15230 distance = thisDistance; 15231 closestHandle = $( this ); 15232 index = i; 15233 } 15234 } ); 15235 15236 allowed = this._start( event, index ); 15237 if ( allowed === false ) { 15238 return false; 15239 } 15240 this._mouseSliding = true; 15241 15242 this._handleIndex = index; 15243 15244 this._addClass( closestHandle, null, "ui-state-active" ); 15245 closestHandle.trigger( "focus" ); 15246 15247 offset = closestHandle.offset(); 15248 mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); 15249 this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { 15250 left: event.pageX - offset.left - ( closestHandle.width() / 2 ), 15251 top: event.pageY - offset.top - 15252 ( closestHandle.height() / 2 ) - 15253 ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) - 15254 ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) + 15255 ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 ) 15256 }; 15257 15258 if ( !this.handles.hasClass( "ui-state-hover" ) ) { 15259 this._slide( event, index, normValue ); 15260 } 15261 this._animateOff = true; 15262 return true; 15263 }, 15264 15265 _mouseStart: function() { 15266 return true; 15267 }, 15268 15269 _mouseDrag: function( event ) { 15270 var position = { x: event.pageX, y: event.pageY }, 15271 normValue = this._normValueFromMouse( position ); 15272 15273 this._slide( event, this._handleIndex, normValue ); 15274 15275 return false; 15276 }, 15277 15278 _mouseStop: function( event ) { 15279 this._removeClass( this.handles, null, "ui-state-active" ); 15280 this._mouseSliding = false; 15281 15282 this._stop( event, this._handleIndex ); 15283 this._change( event, this._handleIndex ); 15284 15285 this._handleIndex = null; 15286 this._clickOffset = null; 15287 this._animateOff = false; 15288 15289 return false; 15290 }, 15291 15292 _detectOrientation: function() { 15293 this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; 15294 }, 15295 15296 _normValueFromMouse: function( position ) { 15297 var pixelTotal, 15298 pixelMouse, 15299 percentMouse, 15300 valueTotal, 15301 valueMouse; 15302 15303 if ( this.orientation === "horizontal" ) { 15304 pixelTotal = this.elementSize.width; 15305 pixelMouse = position.x - this.elementOffset.left - 15306 ( this._clickOffset ? this._clickOffset.left : 0 ); 15307 } else { 15308 pixelTotal = this.elementSize.height; 15309 pixelMouse = position.y - this.elementOffset.top - 15310 ( this._clickOffset ? this._clickOffset.top : 0 ); 15311 } 15312 15313 percentMouse = ( pixelMouse / pixelTotal ); 15314 if ( percentMouse > 1 ) { 15315 percentMouse = 1; 15316 } 15317 if ( percentMouse < 0 ) { 15318 percentMouse = 0; 15319 } 15320 if ( this.orientation === "vertical" ) { 15321 percentMouse = 1 - percentMouse; 15322 } 15323 15324 valueTotal = this._valueMax() - this._valueMin(); 15325 valueMouse = this._valueMin() + percentMouse * valueTotal; 15326 15327 return this._trimAlignValue( valueMouse ); 15328 }, 15329 15330 _uiHash: function( index, value, values ) { 15331 var uiHash = { 15332 handle: this.handles[ index ], 15333 handleIndex: index, 15334 value: value !== undefined ? value : this.value() 15335 }; 15336 15337 if ( this._hasMultipleValues() ) { 15338 uiHash.value = value !== undefined ? value : this.values( index ); 15339 uiHash.values = values || this.values(); 15340 } 15341 15342 return uiHash; 15343 }, 15344 15345 _hasMultipleValues: function() { 15346 return this.options.values && this.options.values.length; 15347 }, 15348 15349 _start: function( event, index ) { 15350 return this._trigger( "start", event, this._uiHash( index ) ); 15351 }, 15352 15353 _slide: function( event, index, newVal ) { 15354 var allowed, otherVal, 15355 currentValue = this.value(), 15356 newValues = this.values(); 15357 15358 if ( this._hasMultipleValues() ) { 15359 otherVal = this.values( index ? 0 : 1 ); 15360 currentValue = this.values( index ); 15361 15362 if ( this.options.values.length === 2 && this.options.range === true ) { 15363 newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal ); 15364 } 15365 15366 newValues[ index ] = newVal; 15367 } 15368 15369 if ( newVal === currentValue ) { 15370 return; 15371 } 15372 15373 allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) ); 15374 15375 // A slide can be canceled by returning false from the slide callback 15376 if ( allowed === false ) { 15377 return; 15378 } 15379 15380 if ( this._hasMultipleValues() ) { 15381 this.values( index, newVal ); 15382 } else { 15383 this.value( newVal ); 15384 } 15385 }, 15386 15387 _stop: function( event, index ) { 15388 this._trigger( "stop", event, this._uiHash( index ) ); 15389 }, 15390 15391 _change: function( event, index ) { 15392 if ( !this._keySliding && !this._mouseSliding ) { 15393 15394 //store the last changed value index for reference when handles overlap 15395 this._lastChangedValue = index; 15396 this._trigger( "change", event, this._uiHash( index ) ); 15397 } 15398 }, 15399 15400 value: function( newValue ) { 15401 if ( arguments.length ) { 15402 this.options.value = this._trimAlignValue( newValue ); 15403 this._refreshValue(); 15404 this._change( null, 0 ); 15405 return; 15406 } 15407 15408 return this._value(); 15409 }, 15410 15411 values: function( index, newValue ) { 15412 var vals, 15413 newValues, 15414 i; 15415 15416 if ( arguments.length > 1 ) { 15417 this.options.values[ index ] = this._trimAlignValue( newValue ); 15418 this._refreshValue(); 15419 this._change( null, index ); 15420 return; 15421 } 15422 15423 if ( arguments.length ) { 15424 if ( Array.isArray( arguments[ 0 ] ) ) { 15425 vals = this.options.values; 15426 newValues = arguments[ 0 ]; 15427 for ( i = 0; i < vals.length; i += 1 ) { 15428 vals[ i ] = this._trimAlignValue( newValues[ i ] ); 15429 this._change( null, i ); 15430 } 15431 this._refreshValue(); 15432 } else { 15433 if ( this._hasMultipleValues() ) { 15434 return this._values( index ); 15435 } else { 15436 return this.value(); 15437 } 15438 } 15439 } else { 15440 return this._values(); 15441 } 15442 }, 15443 15444 _setOption: function( key, value ) { 15445 var i, 15446 valsLength = 0; 15447 15448 if ( key === "range" && this.options.range === true ) { 15449 if ( value === "min" ) { 15450 this.options.value = this._values( 0 ); 15451 this.options.values = null; 15452 } else if ( value === "max" ) { 15453 this.options.value = this._values( this.options.values.length - 1 ); 15454 this.options.values = null; 15455 } 15456 } 15457 15458 if ( Array.isArray( this.options.values ) ) { 15459 valsLength = this.options.values.length; 15460 } 15461 15462 this._super( key, value ); 15463 15464 switch ( key ) { 15465 case "orientation": 15466 this._detectOrientation(); 15467 this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) 15468 ._addClass( "ui-slider-" + this.orientation ); 15469 this._refreshValue(); 15470 if ( this.options.range ) { 15471 this._refreshRange( value ); 15472 } 15473 15474 // Reset positioning from previous orientation 15475 this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); 15476 break; 15477 case "value": 15478 this._animateOff = true; 15479 this._refreshValue(); 15480 this._change( null, 0 ); 15481 this._animateOff = false; 15482 break; 15483 case "values": 15484 this._animateOff = true; 15485 this._refreshValue(); 15486 15487 // Start from the last handle to prevent unreachable handles (#9046) 15488 for ( i = valsLength - 1; i >= 0; i-- ) { 15489 this._change( null, i ); 15490 } 15491 this._animateOff = false; 15492 break; 15493 case "step": 15494 case "min": 15495 case "max": 15496 this._animateOff = true; 15497 this._calculateNewMax(); 15498 this._refreshValue(); 15499 this._animateOff = false; 15500 break; 15501 case "range": 15502 this._animateOff = true; 15503 this._refresh(); 15504 this._animateOff = false; 15505 break; 15506 } 15507 }, 15508 15509 _setOptionDisabled: function( value ) { 15510 this._super( value ); 15511 15512 this._toggleClass( null, "ui-state-disabled", !!value ); 15513 }, 15514 15515 //internal value getter 15516 // _value() returns value trimmed by min and max, aligned by step 15517 _value: function() { 15518 var val = this.options.value; 15519 val = this._trimAlignValue( val ); 15520 15521 return val; 15522 }, 15523 15524 //internal values getter 15525 // _values() returns array of values trimmed by min and max, aligned by step 15526 // _values( index ) returns single value trimmed by min and max, aligned by step 15527 _values: function( index ) { 15528 var val, 15529 vals, 15530 i; 15531 15532 if ( arguments.length ) { 15533 val = this.options.values[ index ]; 15534 val = this._trimAlignValue( val ); 15535 15536 return val; 15537 } else if ( this._hasMultipleValues() ) { 15538 15539 // .slice() creates a copy of the array 15540 // this copy gets trimmed by min and max and then returned 15541 vals = this.options.values.slice(); 15542 for ( i = 0; i < vals.length; i += 1 ) { 15543 vals[ i ] = this._trimAlignValue( vals[ i ] ); 15544 } 15545 15546 return vals; 15547 } else { 15548 return []; 15549 } 15550 }, 15551 15552 // Returns the step-aligned value that val is closest to, between (inclusive) min and max 15553 _trimAlignValue: function( val ) { 15554 if ( val <= this._valueMin() ) { 15555 return this._valueMin(); 15556 } 15557 if ( val >= this._valueMax() ) { 15558 return this._valueMax(); 15559 } 15560 var step = ( this.options.step > 0 ) ? this.options.step : 1, 15561 valModStep = ( val - this._valueMin() ) % step, 15562 alignValue = val - valModStep; 15563 15564 if ( Math.abs( valModStep ) * 2 >= step ) { 15565 alignValue += ( valModStep > 0 ) ? step : ( -step ); 15566 } 15567 15568 // Since JavaScript has problems with large floats, round 15569 // the final value to 5 digits after the decimal point (see #4124) 15570 return parseFloat( alignValue.toFixed( 5 ) ); 15571 }, 15572 15573 _calculateNewMax: function() { 15574 var max = this.options.max, 15575 min = this._valueMin(), 15576 step = this.options.step, 15577 aboveMin = Math.round( ( max - min ) / step ) * step; 15578 max = aboveMin + min; 15579 if ( max > this.options.max ) { 15580 15581 //If max is not divisible by step, rounding off may increase its value 15582 max -= step; 15583 } 15584 this.max = parseFloat( max.toFixed( this._precision() ) ); 15585 }, 15586 15587 _precision: function() { 15588 var precision = this._precisionOf( this.options.step ); 15589 if ( this.options.min !== null ) { 15590 precision = Math.max( precision, this._precisionOf( this.options.min ) ); 15591 } 15592 return precision; 15593 }, 15594 15595 _precisionOf: function( num ) { 15596 var str = num.toString(), 15597 decimal = str.indexOf( "." ); 15598 return decimal === -1 ? 0 : str.length - decimal - 1; 15599 }, 15600 15601 _valueMin: function() { 15602 return this.options.min; 15603 }, 15604 15605 _valueMax: function() { 15606 return this.max; 15607 }, 15608 15609 _refreshRange: function( orientation ) { 15610 if ( orientation === "vertical" ) { 15611 this.range.css( { "width": "", "left": "" } ); 15612 } 15613 if ( orientation === "horizontal" ) { 15614 this.range.css( { "height": "", "bottom": "" } ); 15615 } 15616 }, 15617 15618 _refreshValue: function() { 15619 var lastValPercent, valPercent, value, valueMin, valueMax, 15620 oRange = this.options.range, 15621 o = this.options, 15622 that = this, 15623 animate = ( !this._animateOff ) ? o.animate : false, 15624 _set = {}; 15625 15626 if ( this._hasMultipleValues() ) { 15627 this.handles.each( function( i ) { 15628 valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - 15629 that._valueMin() ) * 100; 15630 _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 15631 $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 15632 if ( that.options.range === true ) { 15633 if ( that.orientation === "horizontal" ) { 15634 if ( i === 0 ) { 15635 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15636 left: valPercent + "%" 15637 }, o.animate ); 15638 } 15639 if ( i === 1 ) { 15640 that.range[ animate ? "animate" : "css" ]( { 15641 width: ( valPercent - lastValPercent ) + "%" 15642 }, { 15643 queue: false, 15644 duration: o.animate 15645 } ); 15646 } 15647 } else { 15648 if ( i === 0 ) { 15649 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15650 bottom: ( valPercent ) + "%" 15651 }, o.animate ); 15652 } 15653 if ( i === 1 ) { 15654 that.range[ animate ? "animate" : "css" ]( { 15655 height: ( valPercent - lastValPercent ) + "%" 15656 }, { 15657 queue: false, 15658 duration: o.animate 15659 } ); 15660 } 15661 } 15662 } 15663 lastValPercent = valPercent; 15664 } ); 15665 } else { 15666 value = this.value(); 15667 valueMin = this._valueMin(); 15668 valueMax = this._valueMax(); 15669 valPercent = ( valueMax !== valueMin ) ? 15670 ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 15671 0; 15672 _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 15673 this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 15674 15675 if ( oRange === "min" && this.orientation === "horizontal" ) { 15676 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15677 width: valPercent + "%" 15678 }, o.animate ); 15679 } 15680 if ( oRange === "max" && this.orientation === "horizontal" ) { 15681 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15682 width: ( 100 - valPercent ) + "%" 15683 }, o.animate ); 15684 } 15685 if ( oRange === "min" && this.orientation === "vertical" ) { 15686 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15687 height: valPercent + "%" 15688 }, o.animate ); 15689 } 15690 if ( oRange === "max" && this.orientation === "vertical" ) { 15691 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15692 height: ( 100 - valPercent ) + "%" 15693 }, o.animate ); 15694 } 15695 } 15696 }, 15697 15698 _handleEvents: { 15699 keydown: function( event ) { 15700 var allowed, curVal, newVal, step, 15701 index = $( event.target ).data( "ui-slider-handle-index" ); 15702 15703 switch ( event.keyCode ) { 15704 case $.ui.keyCode.HOME: 15705 case $.ui.keyCode.END: 15706 case $.ui.keyCode.PAGE_UP: 15707 case $.ui.keyCode.PAGE_DOWN: 15708 case $.ui.keyCode.UP: 15709 case $.ui.keyCode.RIGHT: 15710 case $.ui.keyCode.DOWN: 15711 case $.ui.keyCode.LEFT: 15712 event.preventDefault(); 15713 if ( !this._keySliding ) { 15714 this._keySliding = true; 15715 this._addClass( $( event.target ), null, "ui-state-active" ); 15716 allowed = this._start( event, index ); 15717 if ( allowed === false ) { 15718 return; 15719 } 15720 } 15721 break; 15722 } 15723 15724 step = this.options.step; 15725 if ( this._hasMultipleValues() ) { 15726 curVal = newVal = this.values( index ); 15727 } else { 15728 curVal = newVal = this.value(); 15729 } 15730 15731 switch ( event.keyCode ) { 15732 case $.ui.keyCode.HOME: 15733 newVal = this._valueMin(); 15734 break; 15735 case $.ui.keyCode.END: 15736 newVal = this._valueMax(); 15737 break; 15738 case $.ui.keyCode.PAGE_UP: 15739 newVal = this._trimAlignValue( 15740 curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) 15741 ); 15742 break; 15743 case $.ui.keyCode.PAGE_DOWN: 15744 newVal = this._trimAlignValue( 15745 curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); 15746 break; 15747 case $.ui.keyCode.UP: 15748 case $.ui.keyCode.RIGHT: 15749 if ( curVal === this._valueMax() ) { 15750 return; 15751 } 15752 newVal = this._trimAlignValue( curVal + step ); 15753 break; 15754 case $.ui.keyCode.DOWN: 15755 case $.ui.keyCode.LEFT: 15756 if ( curVal === this._valueMin() ) { 15757 return; 15758 } 15759 newVal = this._trimAlignValue( curVal - step ); 15760 break; 15761 } 15762 15763 this._slide( event, index, newVal ); 15764 }, 15765 keyup: function( event ) { 15766 var index = $( event.target ).data( "ui-slider-handle-index" ); 15767 15768 if ( this._keySliding ) { 15769 this._keySliding = false; 15770 this._stop( event, index ); 15771 this._change( event, index ); 15772 this._removeClass( $( event.target ), null, "ui-state-active" ); 15773 } 15774 } 15775 } 15776} ); 15777 15778 15779/*! 15780 * jQuery UI Sortable 1.13.2 15781 * http://jqueryui.com 15782 * 15783 * Copyright jQuery Foundation and other contributors 15784 * Released under the MIT license. 15785 * http://jquery.org/license 15786 */ 15787 15788//>>label: Sortable 15789//>>group: Interactions 15790//>>description: Enables items in a list to be sorted using the mouse. 15791//>>docs: http://api.jqueryui.com/sortable/ 15792//>>demos: http://jqueryui.com/sortable/ 15793//>>css.structure: ../../themes/base/sortable.css 15794 15795 15796var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, { 15797 version: "1.13.2", 15798 widgetEventPrefix: "sort", 15799 ready: false, 15800 options: { 15801 appendTo: "parent", 15802 axis: false, 15803 connectWith: false, 15804 containment: false, 15805 cursor: "auto", 15806 cursorAt: false, 15807 dropOnEmpty: true, 15808 forcePlaceholderSize: false, 15809 forceHelperSize: false, 15810 grid: false, 15811 handle: false, 15812 helper: "original", 15813 items: "> *", 15814 opacity: false, 15815 placeholder: false, 15816 revert: false, 15817 scroll: true, 15818 scrollSensitivity: 20, 15819 scrollSpeed: 20, 15820 scope: "default", 15821 tolerance: "intersect", 15822 zIndex: 1000, 15823 15824 // Callbacks 15825 activate: null, 15826 beforeStop: null, 15827 change: null, 15828 deactivate: null, 15829 out: null, 15830 over: null, 15831 receive: null, 15832 remove: null, 15833 sort: null, 15834 start: null, 15835 stop: null, 15836 update: null 15837 }, 15838 15839 _isOverAxis: function( x, reference, size ) { 15840 return ( x >= reference ) && ( x < ( reference + size ) ); 15841 }, 15842 15843 _isFloating: function( item ) { 15844 return ( /left|right/ ).test( item.css( "float" ) ) || 15845 ( /inline|table-cell/ ).test( item.css( "display" ) ); 15846 }, 15847 15848 _create: function() { 15849 this.containerCache = {}; 15850 this._addClass( "ui-sortable" ); 15851 15852 //Get the items 15853 this.refresh(); 15854 15855 //Let's determine the parent's offset 15856 this.offset = this.element.offset(); 15857 15858 //Initialize mouse events for interaction 15859 this._mouseInit(); 15860 15861 this._setHandleClassName(); 15862 15863 //We're ready to go 15864 this.ready = true; 15865 15866 }, 15867 15868 _setOption: function( key, value ) { 15869 this._super( key, value ); 15870 15871 if ( key === "handle" ) { 15872 this._setHandleClassName(); 15873 } 15874 }, 15875 15876 _setHandleClassName: function() { 15877 var that = this; 15878 this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); 15879 $.each( this.items, function() { 15880 that._addClass( 15881 this.instance.options.handle ? 15882 this.item.find( this.instance.options.handle ) : 15883 this.item, 15884 "ui-sortable-handle" 15885 ); 15886 } ); 15887 }, 15888 15889 _destroy: function() { 15890 this._mouseDestroy(); 15891 15892 for ( var i = this.items.length - 1; i >= 0; i-- ) { 15893 this.items[ i ].item.removeData( this.widgetName + "-item" ); 15894 } 15895 15896 return this; 15897 }, 15898 15899 _mouseCapture: function( event, overrideHandle ) { 15900 var currentItem = null, 15901 validHandle = false, 15902 that = this; 15903 15904 if ( this.reverting ) { 15905 return false; 15906 } 15907 15908 if ( this.options.disabled || this.options.type === "static" ) { 15909 return false; 15910 } 15911 15912 //We have to refresh the items data once first 15913 this._refreshItems( event ); 15914 15915 //Find out if the clicked node (or one of its parents) is a actual item in this.items 15916 $( event.target ).parents().each( function() { 15917 if ( $.data( this, that.widgetName + "-item" ) === that ) { 15918 currentItem = $( this ); 15919 return false; 15920 } 15921 } ); 15922 if ( $.data( event.target, that.widgetName + "-item" ) === that ) { 15923 currentItem = $( event.target ); 15924 } 15925 15926 if ( !currentItem ) { 15927 return false; 15928 } 15929 if ( this.options.handle && !overrideHandle ) { 15930 $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { 15931 if ( this === event.target ) { 15932 validHandle = true; 15933 } 15934 } ); 15935 if ( !validHandle ) { 15936 return false; 15937 } 15938 } 15939 15940 this.currentItem = currentItem; 15941 this._removeCurrentsFromItems(); 15942 return true; 15943 15944 }, 15945 15946 _mouseStart: function( event, overrideHandle, noActivation ) { 15947 15948 var i, body, 15949 o = this.options; 15950 15951 this.currentContainer = this; 15952 15953 //We only need to call refreshPositions, because the refreshItems call has been moved to 15954 // mouseCapture 15955 this.refreshPositions(); 15956 15957 //Prepare the dragged items parent 15958 this.appendTo = $( o.appendTo !== "parent" ? 15959 o.appendTo : 15960 this.currentItem.parent() ); 15961 15962 //Create and append the visible helper 15963 this.helper = this._createHelper( event ); 15964 15965 //Cache the helper size 15966 this._cacheHelperProportions(); 15967 15968 /* 15969 * - Position generation - 15970 * This block generates everything position related - it's the core of draggables. 15971 */ 15972 15973 //Cache the margins of the original element 15974 this._cacheMargins(); 15975 15976 //The element's absolute position on the page minus margins 15977 this.offset = this.currentItem.offset(); 15978 this.offset = { 15979 top: this.offset.top - this.margins.top, 15980 left: this.offset.left - this.margins.left 15981 }; 15982 15983 $.extend( this.offset, { 15984 click: { //Where the click happened, relative to the element 15985 left: event.pageX - this.offset.left, 15986 top: event.pageY - this.offset.top 15987 }, 15988 15989 // This is a relative to absolute position minus the actual position calculation - 15990 // only used for relative positioned helper 15991 relative: this._getRelativeOffset() 15992 } ); 15993 15994 // After we get the helper offset, but before we get the parent offset we can 15995 // change the helper's position to absolute 15996 // TODO: Still need to figure out a way to make relative sorting possible 15997 this.helper.css( "position", "absolute" ); 15998 this.cssPosition = this.helper.css( "position" ); 15999 16000 //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 16001 if ( o.cursorAt ) { 16002 this._adjustOffsetFromHelper( o.cursorAt ); 16003 } 16004 16005 //Cache the former DOM position 16006 this.domPosition = { 16007 prev: this.currentItem.prev()[ 0 ], 16008 parent: this.currentItem.parent()[ 0 ] 16009 }; 16010 16011 // If the helper is not the original, hide the original so it's not playing any role during 16012 // the drag, won't cause anything bad this way 16013 if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { 16014 this.currentItem.hide(); 16015 } 16016 16017 //Create the placeholder 16018 this._createPlaceholder(); 16019 16020 //Get the next scrolling parent 16021 this.scrollParent = this.placeholder.scrollParent(); 16022 16023 $.extend( this.offset, { 16024 parent: this._getParentOffset() 16025 } ); 16026 16027 //Set a containment if given in the options 16028 if ( o.containment ) { 16029 this._setContainment(); 16030 } 16031 16032 if ( o.cursor && o.cursor !== "auto" ) { // cursor option 16033 body = this.document.find( "body" ); 16034
vendor: 10,284 bytes, lines 16035-16395
16035 // Support: IE 16036 this.storedCursor = body.css( "cursor" ); 16037 body.css( "cursor", o.cursor ); 16038 16039 this.storedStylesheet = 16040 $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); 16041 } 16042 16043 // We need to make sure to grab the zIndex before setting the 16044 // opacity, because setting the opacity to anything lower than 1 16045 // causes the zIndex to change from "auto" to 0. 16046 if ( o.zIndex ) { // zIndex option 16047 if ( this.helper.css( "zIndex" ) ) { 16048 this._storedZIndex = this.helper.css( "zIndex" ); 16049 } 16050 this.helper.css( "zIndex", o.zIndex ); 16051 } 16052 16053 if ( o.opacity ) { // opacity option 16054 if ( this.helper.css( "opacity" ) ) { 16055 this._storedOpacity = this.helper.css( "opacity" ); 16056 } 16057 this.helper.css( "opacity", o.opacity ); 16058 } 16059 16060 //Prepare scrolling 16061 if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16062 this.scrollParent[ 0 ].tagName !== "HTML" ) { 16063 this.overflowOffset = this.scrollParent.offset(); 16064 } 16065 16066 //Call callbacks 16067 this._trigger( "start", event, this._uiHash() ); 16068 16069 //Recache the helper size 16070 if ( !this._preserveHelperProportions ) { 16071 this._cacheHelperProportions(); 16072 } 16073 16074 //Post "activate" events to possible containers 16075 if ( !noActivation ) { 16076 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16077 this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); 16078 } 16079 } 16080 16081 //Prepare possible droppables 16082 if ( $.ui.ddmanager ) { 16083 $.ui.ddmanager.current = this; 16084 } 16085 16086 if ( $.ui.ddmanager && !o.dropBehaviour ) { 16087 $.ui.ddmanager.prepareOffsets( this, event ); 16088 } 16089 16090 this.dragging = true; 16091 16092 this._addClass( this.helper, "ui-sortable-helper" ); 16093 16094 //Move the helper, if needed 16095 if ( !this.helper.parent().is( this.appendTo ) ) { 16096 this.helper.detach().appendTo( this.appendTo ); 16097 16098 //Update position 16099 this.offset.parent = this._getParentOffset(); 16100 } 16101 16102 //Generate the original position 16103 this.position = this.originalPosition = this._generatePosition( event ); 16104 this.originalPageX = event.pageX; 16105 this.originalPageY = event.pageY; 16106 this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" ); 16107 16108 this._mouseDrag( event ); 16109 16110 return true; 16111 16112 }, 16113 16114 _scroll: function( event ) { 16115 var o = this.options, 16116 scrolled = false; 16117 16118 if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16119 this.scrollParent[ 0 ].tagName !== "HTML" ) { 16120 16121 if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - 16122 event.pageY < o.scrollSensitivity ) { 16123 this.scrollParent[ 0 ].scrollTop = 16124 scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; 16125 } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { 16126 this.scrollParent[ 0 ].scrollTop = 16127 scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; 16128 } 16129 16130 if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - 16131 event.pageX < o.scrollSensitivity ) { 16132 this.scrollParent[ 0 ].scrollLeft = scrolled = 16133 this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; 16134 } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { 16135 this.scrollParent[ 0 ].scrollLeft = scrolled = 16136 this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; 16137 } 16138 16139 } else { 16140 16141 if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { 16142 scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); 16143 } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < 16144 o.scrollSensitivity ) { 16145 scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); 16146 } 16147 16148 if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { 16149 scrolled = this.document.scrollLeft( 16150 this.document.scrollLeft() - o.scrollSpeed 16151 ); 16152 } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < 16153 o.scrollSensitivity ) { 16154 scrolled = this.document.scrollLeft( 16155 this.document.scrollLeft() + o.scrollSpeed 16156 ); 16157 } 16158 16159 } 16160 16161 return scrolled; 16162 }, 16163 16164 _mouseDrag: function( event ) { 16165 var i, item, itemElement, intersection, 16166 o = this.options; 16167 16168 //Compute the helpers position 16169 this.position = this._generatePosition( event ); 16170 this.positionAbs = this._convertPositionTo( "absolute" ); 16171 16172 //Set the helper position 16173 if ( !this.options.axis || this.options.axis !== "y" ) { 16174 this.helper[ 0 ].style.left = this.position.left + "px"; 16175 } 16176 if ( !this.options.axis || this.options.axis !== "x" ) { 16177 this.helper[ 0 ].style.top = this.position.top + "px"; 16178 } 16179 16180 //Do scrolling 16181 if ( o.scroll ) { 16182 if ( this._scroll( event ) !== false ) { 16183 16184 //Update item positions used in position checks 16185 this._refreshItemPositions( true ); 16186 16187 if ( $.ui.ddmanager && !o.dropBehaviour ) { 16188 $.ui.ddmanager.prepareOffsets( this, event ); 16189 } 16190 } 16191 } 16192 16193 this.dragDirection = { 16194 vertical: this._getDragVerticalDirection(), 16195 horizontal: this._getDragHorizontalDirection() 16196 }; 16197 16198 //Rearrange 16199 for ( i = this.items.length - 1; i >= 0; i-- ) { 16200 16201 //Cache variables and intersection, continue if no intersection 16202 item = this.items[ i ]; 16203 itemElement = item.item[ 0 ]; 16204 intersection = this._intersectsWithPointer( item ); 16205 if ( !intersection ) { 16206 continue; 16207 } 16208 16209 // Only put the placeholder inside the current Container, skip all 16210 // items from other containers. This works because when moving 16211 // an item from one container to another the 16212 // currentContainer is switched before the placeholder is moved. 16213 // 16214 // Without this, moving items in "sub-sortables" can cause 16215 // the placeholder to jitter between the outer and inner container. 16216 if ( item.instance !== this.currentContainer ) { 16217 continue; 16218 } 16219 16220 // Cannot intersect with itself 16221 // no useless actions that have been done before 16222 // no action if the item moved is the parent of the item checked 16223 if ( itemElement !== this.currentItem[ 0 ] && 16224 this.placeholder[ intersection === 1 ? 16225 "next" : "prev" ]()[ 0 ] !== itemElement && 16226 !$.contains( this.placeholder[ 0 ], itemElement ) && 16227 ( this.options.type === "semi-dynamic" ? 16228 !$.contains( this.element[ 0 ], itemElement ) : 16229 true 16230 ) 16231 ) { 16232 16233 this.direction = intersection === 1 ? "down" : "up"; 16234 16235 if ( this.options.tolerance === "pointer" || 16236 this._intersectsWithSides( item ) ) { 16237 this._rearrange( event, item ); 16238 } else { 16239 break; 16240 } 16241 16242 this._trigger( "change", event, this._uiHash() ); 16243 break; 16244 } 16245 } 16246 16247 //Post events to containers 16248 this._contactContainers( event ); 16249 16250 //Interconnect with droppables 16251 if ( $.ui.ddmanager ) { 16252 $.ui.ddmanager.drag( this, event ); 16253 } 16254 16255 //Call callbacks 16256 this._trigger( "sort", event, this._uiHash() ); 16257 16258 this.lastPositionAbs = this.positionAbs; 16259 return false; 16260 16261 }, 16262 16263 _mouseStop: function( event, noPropagation ) { 16264 16265 if ( !event ) { 16266 return; 16267 } 16268 16269 //If we are using droppables, inform the manager about the drop 16270 if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 16271 $.ui.ddmanager.drop( this, event ); 16272 } 16273 16274 if ( this.options.revert ) { 16275 var that = this, 16276 cur = this.placeholder.offset(), 16277 axis = this.options.axis, 16278 animation = {}; 16279 16280 if ( !axis || axis === "x" ) { 16281 animation.left = cur.left - this.offset.parent.left - this.margins.left + 16282 ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 16283 0 : 16284 this.offsetParent[ 0 ].scrollLeft 16285 ); 16286 } 16287 if ( !axis || axis === "y" ) { 16288 animation.top = cur.top - this.offset.parent.top - this.margins.top + 16289 ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 16290 0 : 16291 this.offsetParent[ 0 ].scrollTop 16292 ); 16293 } 16294 this.reverting = true; 16295 $( this.helper ).animate( 16296 animation, 16297 parseInt( this.options.revert, 10 ) || 500, 16298 function() { 16299 that._clear( event ); 16300 } 16301 ); 16302 } else { 16303 this._clear( event, noPropagation ); 16304 } 16305 16306 return false; 16307 16308 }, 16309 16310 cancel: function() { 16311 16312 if ( this.dragging ) { 16313 16314 this._mouseUp( new $.Event( "mouseup", { target: null } ) ); 16315 16316 if ( this.options.helper === "original" ) { 16317 this.currentItem.css( this._storedCSS ); 16318 this._removeClass( this.currentItem, "ui-sortable-helper" ); 16319 } else { 16320 this.currentItem.show(); 16321 } 16322 16323 //Post deactivating events to containers 16324 for ( var i = this.containers.length - 1; i >= 0; i-- ) { 16325 this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); 16326 if ( this.containers[ i ].containerCache.over ) { 16327 this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); 16328 this.containers[ i ].containerCache.over = 0; 16329 } 16330 } 16331 16332 } 16333 16334 if ( this.placeholder ) { 16335 16336 //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 16337 // it unbinds ALL events from the original node! 16338 if ( this.placeholder[ 0 ].parentNode ) { 16339 this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 16340 } 16341 if ( this.options.helper !== "original" && this.helper && 16342 this.helper[ 0 ].parentNode ) { 16343 this.helper.remove(); 16344 } 16345 16346 $.extend( this, { 16347 helper: null, 16348 dragging: false, 16349 reverting: false, 16350 _noFinalSort: null 16351 } ); 16352 16353 if ( this.domPosition.prev ) { 16354 $( this.domPosition.prev ).after( this.currentItem ); 16355 } else { 16356 $( this.domPosition.parent ).prepend( this.currentItem ); 16357 } 16358 } 16359 16360 return this; 16361 16362 }, 16363 16364 serialize: function( o ) { 16365 16366 var items = this._getItemsAsjQuery( o && o.connected ), 16367 str = []; 16368 o = o || {}; 16369 16370 $( items ).each( function() { 16371 var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) 16372 .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); 16373 if ( res ) { 16374 str.push( 16375 ( o.key || res[ 1 ] + "[]" ) + 16376 "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); 16377 } 16378 } ); 16379 16380 if ( !str.length && o.key ) { 16381 str.push( o.key + "=" ); 16382 } 16383 16384 return str.join( "&" ); 16385 16386 }, 16387 16388 toArray: function( o ) { 16389 16390 var items = this._getItemsAsjQuery( o && o.connected ), 16391 ret = []; 16392 16393 o = o || {}; 16394 16395 items.each( function() {
vendor: 9,873 bytes, lines 16396-16708
16396 ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); 16397 } ); 16398 return ret; 16399 16400 }, 16401 16402 /* Be careful with the following core functions */ 16403 _intersectsWith: function( item ) { 16404 16405 var x1 = this.positionAbs.left, 16406 x2 = x1 + this.helperProportions.width, 16407 y1 = this.positionAbs.top, 16408 y2 = y1 + this.helperProportions.height, 16409 l = item.left, 16410 r = l + item.width, 16411 t = item.top, 16412 b = t + item.height, 16413 dyClick = this.offset.click.top, 16414 dxClick = this.offset.click.left, 16415 isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && 16416 ( y1 + dyClick ) < b ), 16417 isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && 16418 ( x1 + dxClick ) < r ), 16419 isOverElement = isOverElementHeight && isOverElementWidth; 16420 16421 if ( this.options.tolerance === "pointer" || 16422 this.options.forcePointerForContainers || 16423 ( this.options.tolerance !== "pointer" && 16424 this.helperProportions[ this.floating ? "width" : "height" ] > 16425 item[ this.floating ? "width" : "height" ] ) 16426 ) { 16427 return isOverElement; 16428 } else { 16429 16430 return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half 16431 x2 - ( this.helperProportions.width / 2 ) < r && // Left Half 16432 t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half 16433 y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half 16434 16435 } 16436 }, 16437 16438 _intersectsWithPointer: function( item ) { 16439 var verticalDirection, horizontalDirection, 16440 isOverElementHeight = ( this.options.axis === "x" ) || 16441 this._isOverAxis( 16442 this.positionAbs.top + this.offset.click.top, item.top, item.height ), 16443 isOverElementWidth = ( this.options.axis === "y" ) || 16444 this._isOverAxis( 16445 this.positionAbs.left + this.offset.click.left, item.left, item.width ), 16446 isOverElement = isOverElementHeight && isOverElementWidth; 16447 16448 if ( !isOverElement ) { 16449 return false; 16450 } 16451 16452 verticalDirection = this.dragDirection.vertical; 16453 horizontalDirection = this.dragDirection.horizontal; 16454 16455 return this.floating ? 16456 ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) : 16457 ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); 16458 16459 }, 16460 16461 _intersectsWithSides: function( item ) { 16462 16463 var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + 16464 this.offset.click.top, item.top + ( item.height / 2 ), item.height ), 16465 isOverRightHalf = this._isOverAxis( this.positionAbs.left + 16466 this.offset.click.left, item.left + ( item.width / 2 ), item.width ), 16467 verticalDirection = this.dragDirection.vertical, 16468 horizontalDirection = this.dragDirection.horizontal; 16469 16470 if ( this.floating && horizontalDirection ) { 16471 return ( ( horizontalDirection === "right" && isOverRightHalf ) || 16472 ( horizontalDirection === "left" && !isOverRightHalf ) ); 16473 } else { 16474 return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || 16475 ( verticalDirection === "up" && !isOverBottomHalf ) ); 16476 } 16477 16478 }, 16479 16480 _getDragVerticalDirection: function() { 16481 var delta = this.positionAbs.top - this.lastPositionAbs.top; 16482 return delta !== 0 && ( delta > 0 ? "down" : "up" ); 16483 }, 16484 16485 _getDragHorizontalDirection: function() { 16486 var delta = this.positionAbs.left - this.lastPositionAbs.left; 16487 return delta !== 0 && ( delta > 0 ? "right" : "left" ); 16488 }, 16489 16490 refresh: function( event ) { 16491 this._refreshItems( event ); 16492 this._setHandleClassName(); 16493 this.refreshPositions(); 16494 return this; 16495 }, 16496 16497 _connectWith: function() { 16498 var options = this.options; 16499 return options.connectWith.constructor === String ? 16500 [ options.connectWith ] : 16501 options.connectWith; 16502 }, 16503 16504 _getItemsAsjQuery: function( connected ) { 16505 16506 var i, j, cur, inst, 16507 items = [], 16508 queries = [], 16509 connectWith = this._connectWith(); 16510 16511 if ( connectWith && connected ) { 16512 for ( i = connectWith.length - 1; i >= 0; i-- ) { 16513 cur = $( connectWith[ i ], this.document[ 0 ] ); 16514 for ( j = cur.length - 1; j >= 0; j-- ) { 16515 inst = $.data( cur[ j ], this.widgetFullName ); 16516 if ( inst && inst !== this && !inst.options.disabled ) { 16517 queries.push( [ typeof inst.options.items === "function" ? 16518 inst.options.items.call( inst.element ) : 16519 $( inst.options.items, inst.element ) 16520 .not( ".ui-sortable-helper" ) 16521 .not( ".ui-sortable-placeholder" ), inst ] ); 16522 } 16523 } 16524 } 16525 } 16526 16527 queries.push( [ typeof this.options.items === "function" ? 16528 this.options.items 16529 .call( this.element, null, { options: this.options, item: this.currentItem } ) : 16530 $( this.options.items, this.element ) 16531 .not( ".ui-sortable-helper" ) 16532 .not( ".ui-sortable-placeholder" ), this ] ); 16533 16534 function addItems() { 16535 items.push( this ); 16536 } 16537 for ( i = queries.length - 1; i >= 0; i-- ) { 16538 queries[ i ][ 0 ].each( addItems ); 16539 } 16540 16541 return $( items ); 16542 16543 }, 16544 16545 _removeCurrentsFromItems: function() { 16546 16547 var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); 16548 16549 this.items = $.grep( this.items, function( item ) { 16550 for ( var j = 0; j < list.length; j++ ) { 16551 if ( list[ j ] === item.item[ 0 ] ) { 16552 return false; 16553 } 16554 } 16555 return true; 16556 } ); 16557 16558 }, 16559 16560 _refreshItems: function( event ) { 16561 16562 this.items = []; 16563 this.containers = [ this ]; 16564 16565 var i, j, cur, inst, targetData, _queries, item, queriesLength, 16566 items = this.items, 16567 queries = [ [ typeof this.options.items === "function" ? 16568 this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : 16569 $( this.options.items, this.element ), this ] ], 16570 connectWith = this._connectWith(); 16571 16572 //Shouldn't be run the first time through due to massive slow-down 16573 if ( connectWith && this.ready ) { 16574 for ( i = connectWith.length - 1; i >= 0; i-- ) { 16575 cur = $( connectWith[ i ], this.document[ 0 ] ); 16576 for ( j = cur.length - 1; j >= 0; j-- ) { 16577 inst = $.data( cur[ j ], this.widgetFullName ); 16578 if ( inst && inst !== this && !inst.options.disabled ) { 16579 queries.push( [ typeof inst.options.items === "function" ? 16580 inst.options.items 16581 .call( inst.element[ 0 ], event, { item: this.currentItem } ) : 16582 $( inst.options.items, inst.element ), inst ] ); 16583 this.containers.push( inst ); 16584 } 16585 } 16586 } 16587 } 16588 16589 for ( i = queries.length - 1; i >= 0; i-- ) { 16590 targetData = queries[ i ][ 1 ]; 16591 _queries = queries[ i ][ 0 ]; 16592 16593 for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { 16594 item = $( _queries[ j ] ); 16595 16596 // Data for target checking (mouse manager) 16597 item.data( this.widgetName + "-item", targetData ); 16598 16599 items.push( { 16600 item: item, 16601 instance: targetData, 16602 width: 0, height: 0, 16603 left: 0, top: 0 16604 } ); 16605 } 16606 } 16607 16608 }, 16609 16610 _refreshItemPositions: function( fast ) { 16611 var i, item, t, p; 16612 16613 for ( i = this.items.length - 1; i >= 0; i-- ) { 16614 item = this.items[ i ]; 16615 16616 //We ignore calculating positions of all connected containers when we're not over them 16617 if ( this.currentContainer && item.instance !== this.currentContainer && 16618 item.item[ 0 ] !== this.currentItem[ 0 ] ) { 16619 continue; 16620 } 16621 16622 t = this.options.toleranceElement ? 16623 $( this.options.toleranceElement, item.item ) : 16624 item.item; 16625 16626 if ( !fast ) { 16627 item.width = t.outerWidth(); 16628 item.height = t.outerHeight(); 16629 } 16630 16631 p = t.offset(); 16632 item.left = p.left; 16633 item.top = p.top; 16634 } 16635 }, 16636 16637 refreshPositions: function( fast ) { 16638 16639 // Determine whether items are being displayed horizontally 16640 this.floating = this.items.length ? 16641 this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : 16642 false; 16643 16644 // This has to be redone because due to the item being moved out/into the offsetParent, 16645 // the offsetParent's position will change 16646 if ( this.offsetParent && this.helper ) { 16647 this.offset.parent = this._getParentOffset(); 16648 } 16649 16650 this._refreshItemPositions( fast ); 16651 16652 var i, p; 16653 16654 if ( this.options.custom && this.options.custom.refreshContainers ) { 16655 this.options.custom.refreshContainers.call( this ); 16656 } else { 16657 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16658 p = this.containers[ i ].element.offset(); 16659 this.containers[ i ].containerCache.left = p.left; 16660 this.containers[ i ].containerCache.top = p.top; 16661 this.containers[ i ].containerCache.width = 16662 this.containers[ i ].element.outerWidth(); 16663 this.containers[ i ].containerCache.height = 16664 this.containers[ i ].element.outerHeight(); 16665 } 16666 } 16667 16668 return this; 16669 }, 16670 16671 _createPlaceholder: function( that ) { 16672 that = that || this; 16673 var className, nodeName, 16674 o = that.options; 16675 16676 if ( !o.placeholder || o.placeholder.constructor === String ) { 16677 className = o.placeholder; 16678 nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(); 16679 o.placeholder = { 16680 element: function() { 16681 16682 var element = $( "<" + nodeName + ">", that.document[ 0 ] ); 16683 16684 that._addClass( element, "ui-sortable-placeholder", 16685 className || that.currentItem[ 0 ].className ) 16686 ._removeClass( element, "ui-sortable-helper" ); 16687 16688 if ( nodeName === "tbody" ) { 16689 that._createTrPlaceholder( 16690 that.currentItem.find( "tr" ).eq( 0 ), 16691 $( "<tr>", that.document[ 0 ] ).appendTo( element ) 16692 ); 16693 } else if ( nodeName === "tr" ) { 16694 that._createTrPlaceholder( that.currentItem, element ); 16695 } else if ( nodeName === "img" ) { 16696 element.attr( "src", that.currentItem.attr( "src" ) ); 16697 } 16698 16699 if ( !className ) { 16700 element.css( "visibility", "hidden" ); 16701 } 16702 16703 return element; 16704 }, 16705 update: function( container, p ) { 16706 16707 // 1. If a className is set as 'placeholder option, we don't force sizes - 16708 // the class is responsible for that
vendor: 10,802 bytes, lines 16709-17023
16709 // 2. The option 'forcePlaceholderSize can be enabled to force it even if a 16710 // class name is specified 16711 if ( className && !o.forcePlaceholderSize ) { 16712 return; 16713 } 16714 16715 // If the element doesn't have a actual height or width by itself (without 16716 // styles coming from a stylesheet), it receives the inline height and width 16717 // from the dragged item. Or, if it's a tbody or tr, it's going to have a height 16718 // anyway since we're populating them with <td>s above, but they're unlikely to 16719 // be the correct height on their own if the row heights are dynamic, so we'll 16720 // always assign the height of the dragged item given forcePlaceholderSize 16721 // is true. 16722 if ( !p.height() || ( o.forcePlaceholderSize && 16723 ( nodeName === "tbody" || nodeName === "tr" ) ) ) { 16724 p.height( 16725 that.currentItem.innerHeight() - 16726 parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - 16727 parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); 16728 } 16729 if ( !p.width() ) { 16730 p.width( 16731 that.currentItem.innerWidth() - 16732 parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - 16733 parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); 16734 } 16735 } 16736 }; 16737 } 16738 16739 //Create the placeholder 16740 that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); 16741 16742 //Append it after the actual current item 16743 that.currentItem.after( that.placeholder ); 16744 16745 //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) 16746 o.placeholder.update( that, that.placeholder ); 16747 16748 }, 16749 16750 _createTrPlaceholder: function( sourceTr, targetTr ) { 16751 var that = this; 16752 16753 sourceTr.children().each( function() { 16754 $( "<td> </td>", that.document[ 0 ] ) 16755 .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) 16756 .appendTo( targetTr ); 16757 } ); 16758 }, 16759 16760 _contactContainers: function( event ) { 16761 var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, 16762 floating, axis, 16763 innermostContainer = null, 16764 innermostIndex = null; 16765 16766 // Get innermost container that intersects with item 16767 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16768 16769 // Never consider a container that's located within the item itself 16770 if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { 16771 continue; 16772 } 16773 16774 if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { 16775 16776 // If we've already found a container and it's more "inner" than this, then continue 16777 if ( innermostContainer && 16778 $.contains( 16779 this.containers[ i ].element[ 0 ], 16780 innermostContainer.element[ 0 ] ) ) { 16781 continue; 16782 } 16783 16784 innermostContainer = this.containers[ i ]; 16785 innermostIndex = i; 16786 16787 } else { 16788 16789 // container doesn't intersect. trigger "out" event if necessary 16790 if ( this.containers[ i ].containerCache.over ) { 16791 this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); 16792 this.containers[ i ].containerCache.over = 0; 16793 } 16794 } 16795 16796 } 16797 16798 // If no intersecting containers found, return 16799 if ( !innermostContainer ) { 16800 return; 16801 } 16802 16803 // Move the item into the container if it's not there already 16804 if ( this.containers.length === 1 ) { 16805 if ( !this.containers[ innermostIndex ].containerCache.over ) { 16806 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 16807 this.containers[ innermostIndex ].containerCache.over = 1; 16808 } 16809 } else { 16810 16811 // When entering a new container, we will find the item with the least distance and 16812 // append our item near it 16813 dist = 10000; 16814 itemWithLeastDistance = null; 16815 floating = innermostContainer.floating || this._isFloating( this.currentItem ); 16816 posProperty = floating ? "left" : "top"; 16817 sizeProperty = floating ? "width" : "height"; 16818 axis = floating ? "pageX" : "pageY"; 16819 16820 for ( j = this.items.length - 1; j >= 0; j-- ) { 16821 if ( !$.contains( 16822 this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) 16823 ) { 16824 continue; 16825 } 16826 if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { 16827 continue; 16828 } 16829 16830 cur = this.items[ j ].item.offset()[ posProperty ]; 16831 nearBottom = false; 16832 if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { 16833 nearBottom = true; 16834 } 16835 16836 if ( Math.abs( event[ axis ] - cur ) < dist ) { 16837 dist = Math.abs( event[ axis ] - cur ); 16838 itemWithLeastDistance = this.items[ j ]; 16839 this.direction = nearBottom ? "up" : "down"; 16840 } 16841 } 16842 16843 //Check if dropOnEmpty is enabled 16844 if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { 16845 return; 16846 } 16847 16848 if ( this.currentContainer === this.containers[ innermostIndex ] ) { 16849 if ( !this.currentContainer.containerCache.over ) { 16850 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); 16851 this.currentContainer.containerCache.over = 1; 16852 } 16853 return; 16854 } 16855 16856 if ( itemWithLeastDistance ) { 16857 this._rearrange( event, itemWithLeastDistance, null, true ); 16858 } else { 16859 this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); 16860 } 16861 this._trigger( "change", event, this._uiHash() ); 16862 this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); 16863 this.currentContainer = this.containers[ innermostIndex ]; 16864 16865 //Update the placeholder 16866 this.options.placeholder.update( this.currentContainer, this.placeholder ); 16867 16868 //Update scrollParent 16869 this.scrollParent = this.placeholder.scrollParent(); 16870 16871 //Update overflowOffset 16872 if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16873 this.scrollParent[ 0 ].tagName !== "HTML" ) { 16874 this.overflowOffset = this.scrollParent.offset(); 16875 } 16876 16877 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 16878 this.containers[ innermostIndex ].containerCache.over = 1; 16879 } 16880 16881 }, 16882 16883 _createHelper: function( event ) { 16884 16885 var o = this.options, 16886 helper = typeof o.helper === "function" ? 16887 $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : 16888 ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); 16889 16890 //Add the helper to the DOM if that didn't happen already 16891 if ( !helper.parents( "body" ).length ) { 16892 this.appendTo[ 0 ].appendChild( helper[ 0 ] ); 16893 } 16894 16895 if ( helper[ 0 ] === this.currentItem[ 0 ] ) { 16896 this._storedCSS = { 16897 width: this.currentItem[ 0 ].style.width, 16898 height: this.currentItem[ 0 ].style.height, 16899 position: this.currentItem.css( "position" ), 16900 top: this.currentItem.css( "top" ), 16901 left: this.currentItem.css( "left" ) 16902 }; 16903 } 16904 16905 if ( !helper[ 0 ].style.width || o.forceHelperSize ) { 16906 helper.width( this.currentItem.width() ); 16907 } 16908 if ( !helper[ 0 ].style.height || o.forceHelperSize ) { 16909 helper.height( this.currentItem.height() ); 16910 } 16911 16912 return helper; 16913 16914 }, 16915 16916 _adjustOffsetFromHelper: function( obj ) { 16917 if ( typeof obj === "string" ) { 16918 obj = obj.split( " " ); 16919 } 16920 if ( Array.isArray( obj ) ) { 16921 obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 16922 } 16923 if ( "left" in obj ) { 16924 this.offset.click.left = obj.left + this.margins.left; 16925 } 16926 if ( "right" in obj ) { 16927 this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 16928 } 16929 if ( "top" in obj ) { 16930 this.offset.click.top = obj.top + this.margins.top; 16931 } 16932 if ( "bottom" in obj ) { 16933 this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 16934 } 16935 }, 16936 16937 _getParentOffset: function() { 16938 16939 //Get the offsetParent and cache its position 16940 this.offsetParent = this.helper.offsetParent(); 16941 var po = this.offsetParent.offset(); 16942 16943 // This is a special case where we need to modify a offset calculated on start, since the 16944 // following happened: 16945 // 1. The position of the helper is absolute, so it's position is calculated based on the 16946 // next positioned parent 16947 // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 16948 // the document, which means that the scroll is included in the initial calculation of the 16949 // offset of the parent, and never recalculated upon drag 16950 if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && 16951 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 16952 po.left += this.scrollParent.scrollLeft(); 16953 po.top += this.scrollParent.scrollTop(); 16954 } 16955 16956 // This needs to be actually done for all browsers, since pageX/pageY includes this 16957 // information with an ugly IE fix 16958 if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || 16959 ( this.offsetParent[ 0 ].tagName && 16960 this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { 16961 po = { top: 0, left: 0 }; 16962 } 16963 16964 return { 16965 top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 16966 left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 16967 }; 16968 16969 }, 16970 16971 _getRelativeOffset: function() { 16972 16973 if ( this.cssPosition === "relative" ) { 16974 var p = this.currentItem.position(); 16975 return { 16976 top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 16977 this.scrollParent.scrollTop(), 16978 left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 16979 this.scrollParent.scrollLeft() 16980 }; 16981 } else { 16982 return { top: 0, left: 0 }; 16983 } 16984 16985 }, 16986 16987 _cacheMargins: function() { 16988 this.margins = { 16989 left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), 16990 top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) 16991 }; 16992 }, 16993 16994 _cacheHelperProportions: function() { 16995 this.helperProportions = { 16996 width: this.helper.outerWidth(), 16997 height: this.helper.outerHeight() 16998 }; 16999 }, 17000 17001 _setContainment: function() { 17002 17003 var ce, co, over, 17004 o = this.options; 17005 if ( o.containment === "parent" ) { 17006 o.containment = this.helper[ 0 ].parentNode; 17007 } 17008 if ( o.containment === "document" || o.containment === "window" ) { 17009 this.containment = [ 17010 0 - this.offset.relative.left - this.offset.parent.left, 17011 0 - this.offset.relative.top - this.offset.parent.top, 17012 o.containment === "document" ? 17013 this.document.width() : 17014 this.window.width() - this.helperProportions.width - this.margins.left, 17015 ( o.containment === "document" ? 17016 ( this.document.height() || document.body.parentNode.scrollHeight ) : 17017 this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight 17018 ) - this.helperProportions.height - this.margins.top 17019 ]; 17020 } 17021 17022 if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { 17023 ce = $( o.containment )[ 0 ];
vendor: 2,294 bytes, lines 17024-17084
17024 co = $( o.containment ).offset(); 17025 over = ( $( ce ).css( "overflow" ) !== "hidden" ); 17026 17027 this.containment = [ 17028 co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + 17029 ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, 17030 co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + 17031 ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, 17032 co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 17033 ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - 17034 ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - 17035 this.helperProportions.width - this.margins.left, 17036 co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - 17037 ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - 17038 ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - 17039 this.helperProportions.height - this.margins.top 17040 ]; 17041 } 17042 17043 }, 17044 17045 _convertPositionTo: function( d, pos ) { 17046 17047 if ( !pos ) { 17048 pos = this.position; 17049 } 17050 var mod = d === "absolute" ? 1 : -1, 17051 scroll = this.cssPosition === "absolute" && 17052 !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 17053 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 17054 this.offsetParent : 17055 this.scrollParent, 17056 scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 17057 17058 return { 17059 top: ( 17060 17061 // The absolute mouse position 17062 pos.top + 17063 17064 // Only for relative positioned nodes: Relative offset from element to offset parent 17065 this.offset.relative.top * mod + 17066 17067 // The offsetParent's offset without borders (offset + border) 17068 this.offset.parent.top * mod - 17069 ( ( this.cssPosition === "fixed" ? 17070 -this.scrollParent.scrollTop() : 17071 ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) 17072 ), 17073 left: ( 17074 17075 // The absolute mouse position 17076 pos.left + 17077 17078 // Only for relative positioned nodes: Relative offset from element to offset parent 17079 this.offset.relative.left * mod + 17080 17081 // The offsetParent's offset without borders (offset + border) 17082 this.offset.parent.left * mod - 17083 ( ( this.cssPosition === "fixed" ? 17084 -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
vendor: 42,069 bytes, lines 17085-18598
17085 scroll.scrollLeft() ) * mod ) 17086 ) 17087 }; 17088 17089 }, 17090 17091 _generatePosition: function( event ) { 17092 17093 var top, left, 17094 o = this.options, 17095 pageX = event.pageX, 17096 pageY = event.pageY, 17097 scroll = this.cssPosition === "absolute" && 17098 !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 17099 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 17100 this.offsetParent : 17101 this.scrollParent, 17102 scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 17103 17104 // This is another very weird special case that only happens for relative elements: 17105 // 1. If the css position is relative 17106 // 2. and the scroll parent is the document or similar to the offset parent 17107 // we have to refresh the relative offset during the scroll so there are no jumps 17108 if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 17109 this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { 17110 this.offset.relative = this._getRelativeOffset(); 17111 } 17112 17113 /* 17114 * - Position constraining - 17115 * Constrain the position to a mix of grid, containment. 17116 */ 17117 17118 if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options 17119 17120 if ( this.containment ) { 17121 if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { 17122 pageX = this.containment[ 0 ] + this.offset.click.left; 17123 } 17124 if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { 17125 pageY = this.containment[ 1 ] + this.offset.click.top; 17126 } 17127 if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { 17128 pageX = this.containment[ 2 ] + this.offset.click.left; 17129 } 17130 if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { 17131 pageY = this.containment[ 3 ] + this.offset.click.top; 17132 } 17133 } 17134 17135 if ( o.grid ) { 17136 top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / 17137 o.grid[ 1 ] ) * o.grid[ 1 ]; 17138 pageY = this.containment ? 17139 ( ( top - this.offset.click.top >= this.containment[ 1 ] && 17140 top - this.offset.click.top <= this.containment[ 3 ] ) ? 17141 top : 17142 ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? 17143 top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : 17144 top; 17145 17146 left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / 17147 o.grid[ 0 ] ) * o.grid[ 0 ]; 17148 pageX = this.containment ? 17149 ( ( left - this.offset.click.left >= this.containment[ 0 ] && 17150 left - this.offset.click.left <= this.containment[ 2 ] ) ? 17151 left : 17152 ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? 17153 left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : 17154 left; 17155 } 17156 17157 } 17158 17159 return { 17160 top: ( 17161 17162 // The absolute mouse position 17163 pageY - 17164 17165 // Click offset (relative to the element) 17166 this.offset.click.top - 17167 17168 // Only for relative positioned nodes: Relative offset from element to offset parent 17169 this.offset.relative.top - 17170 17171 // The offsetParent's offset without borders (offset + border) 17172 this.offset.parent.top + 17173 ( ( this.cssPosition === "fixed" ? 17174 -this.scrollParent.scrollTop() : 17175 ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) 17176 ), 17177 left: ( 17178 17179 // The absolute mouse position 17180 pageX - 17181 17182 // Click offset (relative to the element) 17183 this.offset.click.left - 17184 17185 // Only for relative positioned nodes: Relative offset from element to offset parent 17186 this.offset.relative.left - 17187 17188 // The offsetParent's offset without borders (offset + border) 17189 this.offset.parent.left + 17190 ( ( this.cssPosition === "fixed" ? 17191 -this.scrollParent.scrollLeft() : 17192 scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) 17193 ) 17194 }; 17195 17196 }, 17197 17198 _rearrange: function( event, i, a, hardRefresh ) { 17199 17200 if ( a ) { 17201 a[ 0 ].appendChild( this.placeholder[ 0 ] ); 17202 } else { 17203 i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], 17204 ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); 17205 } 17206 17207 //Various things done here to improve the performance: 17208 // 1. we create a setTimeout, that calls refreshPositions 17209 // 2. on the instance, we have a counter variable, that get's higher after every append 17210 // 3. on the local scope, we copy the counter variable, and check in the timeout, 17211 // if it's still the same 17212 // 4. this lets only the last addition to the timeout stack through 17213 this.counter = this.counter ? ++this.counter : 1; 17214 var counter = this.counter; 17215 17216 this._delay( function() { 17217 if ( counter === this.counter ) { 17218 17219 //Precompute after each DOM insertion, NOT on mousemove 17220 this.refreshPositions( !hardRefresh ); 17221 } 17222 } ); 17223 17224 }, 17225 17226 _clear: function( event, noPropagation ) { 17227 17228 this.reverting = false; 17229 17230 // We delay all events that have to be triggered to after the point where the placeholder 17231 // has been removed and everything else normalized again 17232 var i, 17233 delayedTriggers = []; 17234 17235 // We first have to update the dom position of the actual currentItem 17236 // Note: don't do it if the current item is already removed (by a user), or it gets 17237 // reappended (see #4088) 17238 if ( !this._noFinalSort && this.currentItem.parent().length ) { 17239 this.placeholder.before( this.currentItem ); 17240 } 17241 this._noFinalSort = null; 17242 17243 if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { 17244 for ( i in this._storedCSS ) { 17245 if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { 17246 this._storedCSS[ i ] = ""; 17247 } 17248 } 17249 this.currentItem.css( this._storedCSS ); 17250 this._removeClass( this.currentItem, "ui-sortable-helper" ); 17251 } else { 17252 this.currentItem.show(); 17253 } 17254 17255 if ( this.fromOutside && !noPropagation ) { 17256 delayedTriggers.push( function( event ) { 17257 this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); 17258 } ); 17259 } 17260 if ( ( this.fromOutside || 17261 this.domPosition.prev !== 17262 this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || 17263 this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { 17264 17265 // Trigger update callback if the DOM position has changed 17266 delayedTriggers.push( function( event ) { 17267 this._trigger( "update", event, this._uiHash() ); 17268 } ); 17269 } 17270 17271 // Check if the items Container has Changed and trigger appropriate 17272 // events. 17273 if ( this !== this.currentContainer ) { 17274 if ( !noPropagation ) { 17275 delayedTriggers.push( function( event ) { 17276 this._trigger( "remove", event, this._uiHash() ); 17277 } ); 17278 delayedTriggers.push( ( function( c ) { 17279 return function( event ) { 17280 c._trigger( "receive", event, this._uiHash( this ) ); 17281 }; 17282 } ).call( this, this.currentContainer ) ); 17283 delayedTriggers.push( ( function( c ) { 17284 return function( event ) { 17285 c._trigger( "update", event, this._uiHash( this ) ); 17286 }; 17287 } ).call( this, this.currentContainer ) ); 17288 } 17289 } 17290 17291 //Post events to containers 17292 function delayEvent( type, instance, container ) { 17293 return function( event ) { 17294 container._trigger( type, event, instance._uiHash( instance ) ); 17295 }; 17296 } 17297 for ( i = this.containers.length - 1; i >= 0; i-- ) { 17298 if ( !noPropagation ) { 17299 delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); 17300 } 17301 if ( this.containers[ i ].containerCache.over ) { 17302 delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); 17303 this.containers[ i ].containerCache.over = 0; 17304 } 17305 } 17306 17307 //Do what was originally in plugins 17308 if ( this.storedCursor ) { 17309 this.document.find( "body" ).css( "cursor", this.storedCursor ); 17310 this.storedStylesheet.remove(); 17311 } 17312 if ( this._storedOpacity ) { 17313 this.helper.css( "opacity", this._storedOpacity ); 17314 } 17315 if ( this._storedZIndex ) { 17316 this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); 17317 } 17318 17319 this.dragging = false; 17320 17321 if ( !noPropagation ) { 17322 this._trigger( "beforeStop", event, this._uiHash() ); 17323 } 17324 17325 //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 17326 // it unbinds ALL events from the original node! 17327 this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 17328 17329 if ( !this.cancelHelperRemoval ) { 17330 if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { 17331 this.helper.remove(); 17332 } 17333 this.helper = null; 17334 } 17335 17336 if ( !noPropagation ) { 17337 for ( i = 0; i < delayedTriggers.length; i++ ) { 17338 17339 // Trigger all delayed events 17340 delayedTriggers[ i ].call( this, event ); 17341 } 17342 this._trigger( "stop", event, this._uiHash() ); 17343 } 17344 17345 this.fromOutside = false; 17346 return !this.cancelHelperRemoval; 17347 17348 }, 17349 17350 _trigger: function() { 17351 if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { 17352 this.cancel(); 17353 } 17354 }, 17355 17356 _uiHash: function( _inst ) { 17357 var inst = _inst || this; 17358 return { 17359 helper: inst.helper, 17360 placeholder: inst.placeholder || $( [] ), 17361 position: inst.position, 17362 originalPosition: inst.originalPosition, 17363 offset: inst.positionAbs, 17364 item: inst.currentItem, 17365 sender: _inst ? _inst.element : null 17366 }; 17367 } 17368 17369} ); 17370 17371 17372/*! 17373 * jQuery UI Spinner 1.13.2 17374 * http://jqueryui.com 17375 * 17376 * Copyright jQuery Foundation and other contributors 17377 * Released under the MIT license. 17378 * http://jquery.org/license 17379 */ 17380 17381//>>label: Spinner 17382//>>group: Widgets 17383//>>description: Displays buttons to easily input numbers via the keyboard or mouse. 17384//>>docs: http://api.jqueryui.com/spinner/ 17385//>>demos: http://jqueryui.com/spinner/ 17386//>>css.structure: ../../themes/base/core.css 17387//>>css.structure: ../../themes/base/spinner.css 17388//>>css.theme: ../../themes/base/theme.css 17389 17390 17391function spinnerModifier( fn ) { 17392 return function() { 17393 var previous = this.element.val(); 17394 fn.apply( this, arguments ); 17395 this._refresh(); 17396 if ( previous !== this.element.val() ) { 17397 this._trigger( "change" ); 17398 } 17399 }; 17400} 17401 17402$.widget( "ui.spinner", { 17403 version: "1.13.2", 17404 defaultElement: "<input>", 17405 widgetEventPrefix: "spin", 17406 options: { 17407 classes: { 17408 "ui-spinner": "ui-corner-all", 17409 "ui-spinner-down": "ui-corner-br", 17410 "ui-spinner-up": "ui-corner-tr" 17411 }, 17412 culture: null, 17413 icons: { 17414 down: "ui-icon-triangle-1-s", 17415 up: "ui-icon-triangle-1-n" 17416 }, 17417 incremental: true, 17418 max: null, 17419 min: null, 17420 numberFormat: null, 17421 page: 10, 17422 step: 1, 17423 17424 change: null, 17425 spin: null, 17426 start: null, 17427 stop: null 17428 }, 17429 17430 _create: function() { 17431 17432 // handle string values that need to be parsed 17433 this._setOption( "max", this.options.max ); 17434 this._setOption( "min", this.options.min ); 17435 this._setOption( "step", this.options.step ); 17436 17437 // Only format if there is a value, prevents the field from being marked 17438 // as invalid in Firefox, see #9573. 17439 if ( this.value() !== "" ) { 17440 17441 // Format the value, but don't constrain. 17442 this._value( this.element.val(), true ); 17443 } 17444 17445 this._draw(); 17446 this._on( this._events ); 17447 this._refresh(); 17448 17449 // Turning off autocomplete prevents the browser from remembering the 17450 // value when navigating through history, so we re-enable autocomplete 17451 // if the page is unloaded before the widget is destroyed. #7790 17452 this._on( this.window, { 17453 beforeunload: function() { 17454 this.element.removeAttr( "autocomplete" ); 17455 } 17456 } ); 17457 }, 17458 17459 _getCreateOptions: function() { 17460 var options = this._super(); 17461 var element = this.element; 17462 17463 $.each( [ "min", "max", "step" ], function( i, option ) { 17464 var value = element.attr( option ); 17465 if ( value != null && value.length ) { 17466 options[ option ] = value; 17467 } 17468 } ); 17469 17470 return options; 17471 }, 17472 17473 _events: { 17474 keydown: function( event ) { 17475 if ( this._start( event ) && this._keydown( event ) ) { 17476 event.preventDefault(); 17477 } 17478 }, 17479 keyup: "_stop", 17480 focus: function() { 17481 this.previous = this.element.val(); 17482 }, 17483 blur: function( event ) { 17484 if ( this.cancelBlur ) { 17485 delete this.cancelBlur; 17486 return; 17487 } 17488 17489 this._stop(); 17490 this._refresh(); 17491 if ( this.previous !== this.element.val() ) { 17492 this._trigger( "change", event ); 17493 } 17494 }, 17495 mousewheel: function( event, delta ) { 17496 var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ); 17497 var isActive = this.element[ 0 ] === activeElement; 17498 17499 if ( !isActive || !delta ) { 17500 return; 17501 } 17502 17503 if ( !this.spinning && !this._start( event ) ) { 17504 return false; 17505 } 17506 17507 this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event ); 17508 clearTimeout( this.mousewheelTimer ); 17509 this.mousewheelTimer = this._delay( function() { 17510 if ( this.spinning ) { 17511 this._stop( event ); 17512 } 17513 }, 100 ); 17514 event.preventDefault(); 17515 }, 17516 "mousedown .ui-spinner-button": function( event ) { 17517 var previous; 17518 17519 // We never want the buttons to have focus; whenever the user is 17520 // interacting with the spinner, the focus should be on the input. 17521 // If the input is focused then this.previous is properly set from 17522 // when the input first received focus. If the input is not focused 17523 // then we need to set this.previous based on the value before spinning. 17524 previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ? 17525 this.previous : this.element.val(); 17526 function checkFocus() { 17527 var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ); 17528 if ( !isActive ) { 17529 this.element.trigger( "focus" ); 17530 this.previous = previous; 17531 17532 // support: IE 17533 // IE sets focus asynchronously, so we need to check if focus 17534 // moved off of the input because the user clicked on the button. 17535 this._delay( function() { 17536 this.previous = previous; 17537 } ); 17538 } 17539 } 17540 17541 // Ensure focus is on (or stays on) the text field 17542 event.preventDefault(); 17543 checkFocus.call( this ); 17544 17545 // Support: IE 17546 // IE doesn't prevent moving focus even with event.preventDefault() 17547 // so we set a flag to know when we should ignore the blur event 17548 // and check (again) if focus moved off of the input. 17549 this.cancelBlur = true; 17550 this._delay( function() { 17551 delete this.cancelBlur; 17552 checkFocus.call( this ); 17553 } ); 17554 17555 if ( this._start( event ) === false ) { 17556 return; 17557 } 17558 17559 this._repeat( null, $( event.currentTarget ) 17560 .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); 17561 }, 17562 "mouseup .ui-spinner-button": "_stop", 17563 "mouseenter .ui-spinner-button": function( event ) { 17564 17565 // button will add ui-state-active if mouse was down while mouseleave and kept down 17566 if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { 17567 return; 17568 } 17569 17570 if ( this._start( event ) === false ) { 17571 return false; 17572 } 17573 this._repeat( null, $( event.currentTarget ) 17574 .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); 17575 }, 17576 17577 // TODO: do we really want to consider this a stop? 17578 // shouldn't we just stop the repeater and wait until mouseup before 17579 // we trigger the stop event? 17580 "mouseleave .ui-spinner-button": "_stop" 17581 }, 17582 17583 // Support mobile enhanced option and make backcompat more sane 17584 _enhance: function() { 17585 this.uiSpinner = this.element 17586 .attr( "autocomplete", "off" ) 17587 .wrap( "<span>" ) 17588 .parent() 17589 17590 // Add buttons 17591 .append( 17592 "<a></a><a></a>" 17593 ); 17594 }, 17595 17596 _draw: function() { 17597 this._enhance(); 17598 17599 this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" ); 17600 this._addClass( "ui-spinner-input" ); 17601 17602 this.element.attr( "role", "spinbutton" ); 17603 17604 // Button bindings 17605 this.buttons = this.uiSpinner.children( "a" ) 17606 .attr( "tabIndex", -1 ) 17607 .attr( "aria-hidden", true ) 17608 .button( { 17609 classes: { 17610 "ui-button": "" 17611 } 17612 } ); 17613 17614 // TODO: Right now button does not support classes this is already updated in button PR 17615 this._removeClass( this.buttons, "ui-corner-all" ); 17616 17617 this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" ); 17618 this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" ); 17619 this.buttons.first().button( { 17620 "icon": this.options.icons.up, 17621 "showLabel": false 17622 } ); 17623 this.buttons.last().button( { 17624 "icon": this.options.icons.down, 17625 "showLabel": false 17626 } ); 17627 17628 // IE 6 doesn't understand height: 50% for the buttons 17629 // unless the wrapper has an explicit height 17630 if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) && 17631 this.uiSpinner.height() > 0 ) { 17632 this.uiSpinner.height( this.uiSpinner.height() ); 17633 } 17634 }, 17635 17636 _keydown: function( event ) { 17637 var options = this.options, 17638 keyCode = $.ui.keyCode; 17639 17640 switch ( event.keyCode ) { 17641 case keyCode.UP: 17642 this._repeat( null, 1, event ); 17643 return true; 17644 case keyCode.DOWN: 17645 this._repeat( null, -1, event ); 17646 return true; 17647 case keyCode.PAGE_UP: 17648 this._repeat( null, options.page, event ); 17649 return true; 17650 case keyCode.PAGE_DOWN: 17651 this._repeat( null, -options.page, event ); 17652 return true; 17653 } 17654 17655 return false; 17656 }, 17657 17658 _start: function( event ) { 17659 if ( !this.spinning && this._trigger( "start", event ) === false ) { 17660 return false; 17661 } 17662 17663 if ( !this.counter ) { 17664 this.counter = 1; 17665 } 17666 this.spinning = true; 17667 return true; 17668 }, 17669 17670 _repeat: function( i, steps, event ) { 17671 i = i || 500; 17672 17673 clearTimeout( this.timer ); 17674 this.timer = this._delay( function() { 17675 this._repeat( 40, steps, event ); 17676 }, i ); 17677 17678 this._spin( steps * this.options.step, event ); 17679 }, 17680 17681 _spin: function( step, event ) { 17682 var value = this.value() || 0; 17683 17684 if ( !this.counter ) { 17685 this.counter = 1; 17686 } 17687 17688 value = this._adjustValue( value + step * this._increment( this.counter ) ); 17689 17690 if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) { 17691 this._value( value ); 17692 this.counter++; 17693 } 17694 }, 17695 17696 _increment: function( i ) { 17697 var incremental = this.options.incremental; 17698 17699 if ( incremental ) { 17700 return typeof incremental === "function" ? 17701 incremental( i ) : 17702 Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); 17703 } 17704 17705 return 1; 17706 }, 17707 17708 _precision: function() { 17709 var precision = this._precisionOf( this.options.step ); 17710 if ( this.options.min !== null ) { 17711 precision = Math.max( precision, this._precisionOf( this.options.min ) ); 17712 } 17713 return precision; 17714 }, 17715 17716 _precisionOf: function( num ) { 17717 var str = num.toString(), 17718 decimal = str.indexOf( "." ); 17719 return decimal === -1 ? 0 : str.length - decimal - 1; 17720 }, 17721 17722 _adjustValue: function( value ) { 17723 var base, aboveMin, 17724 options = this.options; 17725 17726 // Make sure we're at a valid step 17727 // - find out where we are relative to the base (min or 0) 17728 base = options.min !== null ? options.min : 0; 17729 aboveMin = value - base; 17730 17731 // - round to the nearest step 17732 aboveMin = Math.round( aboveMin / options.step ) * options.step; 17733 17734 // - rounding is based on 0, so adjust back to our base 17735 value = base + aboveMin; 17736 17737 // Fix precision from bad JS floating point math 17738 value = parseFloat( value.toFixed( this._precision() ) ); 17739 17740 // Clamp the value 17741 if ( options.max !== null && value > options.max ) { 17742 return options.max; 17743 } 17744 if ( options.min !== null && value < options.min ) { 17745 return options.min; 17746 } 17747 17748 return value; 17749 }, 17750 17751 _stop: function( event ) { 17752 if ( !this.spinning ) { 17753 return; 17754 } 17755 17756 clearTimeout( this.timer ); 17757 clearTimeout( this.mousewheelTimer ); 17758 this.counter = 0; 17759 this.spinning = false; 17760 this._trigger( "stop", event ); 17761 }, 17762 17763 _setOption: function( key, value ) { 17764 var prevValue, first, last; 17765 17766 if ( key === "culture" || key === "numberFormat" ) { 17767 prevValue = this._parse( this.element.val() ); 17768 this.options[ key ] = value; 17769 this.element.val( this._format( prevValue ) ); 17770 return; 17771 } 17772 17773 if ( key === "max" || key === "min" || key === "step" ) { 17774 if ( typeof value === "string" ) { 17775 value = this._parse( value ); 17776 } 17777 } 17778 if ( key === "icons" ) { 17779 first = this.buttons.first().find( ".ui-icon" ); 17780 this._removeClass( first, null, this.options.icons.up ); 17781 this._addClass( first, null, value.up ); 17782 last = this.buttons.last().find( ".ui-icon" ); 17783 this._removeClass( last, null, this.options.icons.down ); 17784 this._addClass( last, null, value.down ); 17785 } 17786 17787 this._super( key, value ); 17788 }, 17789 17790 _setOptionDisabled: function( value ) { 17791 this._super( value ); 17792 17793 this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value ); 17794 this.element.prop( "disabled", !!value ); 17795 this.buttons.button( value ? "disable" : "enable" ); 17796 }, 17797 17798 _setOptions: spinnerModifier( function( options ) { 17799 this._super( options ); 17800 } ), 17801 17802 _parse: function( val ) { 17803 if ( typeof val === "string" && val !== "" ) { 17804 val = window.Globalize && this.options.numberFormat ? 17805 Globalize.parseFloat( val, 10, this.options.culture ) : +val; 17806 } 17807 return val === "" || isNaN( val ) ? null : val; 17808 }, 17809 17810 _format: function( value ) { 17811 if ( value === "" ) { 17812 return ""; 17813 } 17814 return window.Globalize && this.options.numberFormat ? 17815 Globalize.format( value, this.options.numberFormat, this.options.culture ) : 17816 value; 17817 }, 17818 17819 _refresh: function() { 17820 this.element.attr( { 17821 "aria-valuemin": this.options.min, 17822 "aria-valuemax": this.options.max, 17823 17824 // TODO: what should we do with values that can't be parsed? 17825 "aria-valuenow": this._parse( this.element.val() ) 17826 } ); 17827 }, 17828 17829 isValid: function() { 17830 var value = this.value(); 17831 17832 // Null is invalid 17833 if ( value === null ) { 17834 return false; 17835 } 17836 17837 // If value gets adjusted, it's invalid 17838 return value === this._adjustValue( value ); 17839 }, 17840 17841 // Update the value without triggering change 17842 _value: function( value, allowAny ) { 17843 var parsed; 17844 if ( value !== "" ) { 17845 parsed = this._parse( value ); 17846 if ( parsed !== null ) { 17847 if ( !allowAny ) { 17848 parsed = this._adjustValue( parsed ); 17849 } 17850 value = this._format( parsed ); 17851 } 17852 } 17853 this.element.val( value ); 17854 this._refresh(); 17855 }, 17856 17857 _destroy: function() { 17858 this.element 17859 .prop( "disabled", false ) 17860 .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" ); 17861 17862 this.uiSpinner.replaceWith( this.element ); 17863 }, 17864 17865 stepUp: spinnerModifier( function( steps ) { 17866 this._stepUp( steps ); 17867 } ), 17868 _stepUp: function( steps ) { 17869 if ( this._start() ) { 17870 this._spin( ( steps || 1 ) * this.options.step ); 17871 this._stop(); 17872 } 17873 }, 17874 17875 stepDown: spinnerModifier( function( steps ) { 17876 this._stepDown( steps ); 17877 } ), 17878 _stepDown: function( steps ) { 17879 if ( this._start() ) { 17880 this._spin( ( steps || 1 ) * -this.options.step ); 17881 this._stop(); 17882 } 17883 }, 17884 17885 pageUp: spinnerModifier( function( pages ) { 17886 this._stepUp( ( pages || 1 ) * this.options.page ); 17887 } ), 17888 17889 pageDown: spinnerModifier( function( pages ) { 17890 this._stepDown( ( pages || 1 ) * this.options.page ); 17891 } ), 17892 17893 value: function( newVal ) { 17894 if ( !arguments.length ) { 17895 return this._parse( this.element.val() ); 17896 } 17897 spinnerModifier( this._value ).call( this, newVal ); 17898 }, 17899 17900 widget: function() { 17901 return this.uiSpinner; 17902 } 17903} ); 17904 17905// DEPRECATED 17906// TODO: switch return back to widget declaration at top of file when this is removed 17907if ( $.uiBackCompat !== false ) { 17908 17909 // Backcompat for spinner html extension points 17910 $.widget( "ui.spinner", $.ui.spinner, { 17911 _enhance: function() { 17912 this.uiSpinner = this.element 17913 .attr( "autocomplete", "off" ) 17914 .wrap( this._uiSpinnerHtml() ) 17915 .parent() 17916 17917 // Add buttons 17918 .append( this._buttonHtml() ); 17919 }, 17920 _uiSpinnerHtml: function() { 17921 return "<span>"; 17922 }, 17923 17924 _buttonHtml: function() { 17925 return "<a></a><a></a>"; 17926 } 17927 } ); 17928} 17929 17930var widgetsSpinner = $.ui.spinner; 17931 17932 17933/*! 17934 * jQuery UI Tabs 1.13.2 17935 * http://jqueryui.com 17936 * 17937 * Copyright jQuery Foundation and other contributors 17938 * Released under the MIT license. 17939 * http://jquery.org/license 17940 */ 17941 17942//>>label: Tabs 17943//>>group: Widgets 17944//>>description: Transforms a set of container elements into a tab structure. 17945//>>docs: http://api.jqueryui.com/tabs/ 17946//>>demos: http://jqueryui.com/tabs/ 17947//>>css.structure: ../../themes/base/core.css 17948//>>css.structure: ../../themes/base/tabs.css 17949//>>css.theme: ../../themes/base/theme.css 17950 17951 17952$.widget( "ui.tabs", { 17953 version: "1.13.2", 17954 delay: 300, 17955 options: { 17956 active: null, 17957 classes: { 17958 "ui-tabs": "ui-corner-all", 17959 "ui-tabs-nav": "ui-corner-all", 17960 "ui-tabs-panel": "ui-corner-bottom", 17961 "ui-tabs-tab": "ui-corner-top" 17962 }, 17963 collapsible: false, 17964 event: "click", 17965 heightStyle: "content", 17966 hide: null, 17967 show: null, 17968 17969 // Callbacks 17970 activate: null, 17971 beforeActivate: null, 17972 beforeLoad: null, 17973 load: null 17974 }, 17975 17976 _isLocal: ( function() { 17977 var rhash = /#.*$/; 17978 17979 return function( anchor ) { 17980 var anchorUrl, locationUrl; 17981 17982 anchorUrl = anchor.href.replace( rhash, "" ); 17983 locationUrl = location.href.replace( rhash, "" ); 17984 17985 // Decoding may throw an error if the URL isn't UTF-8 (#9518) 17986 try { 17987 anchorUrl = decodeURIComponent( anchorUrl ); 17988 } catch ( error ) {} 17989 try { 17990 locationUrl = decodeURIComponent( locationUrl ); 17991 } catch ( error ) {} 17992 17993 return anchor.hash.length > 1 && anchorUrl === locationUrl; 17994 }; 17995 } )(), 17996 17997 _create: function() { 17998 var that = this, 17999 options = this.options; 18000 18001 this.running = false; 18002 18003 this._addClass( "ui-tabs", "ui-widget ui-widget-content" ); 18004 this._toggleClass( "ui-tabs-collapsible", null, options.collapsible ); 18005 18006 this._processTabs(); 18007 options.active = this._initialActive(); 18008 18009 // Take disabling tabs via class attribute from HTML 18010 // into account and update option properly. 18011 if ( Array.isArray( options.disabled ) ) { 18012 options.disabled = $.uniqueSort( options.disabled.concat( 18013 $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { 18014 return that.tabs.index( li ); 18015 } ) 18016 ) ).sort(); 18017 } 18018 18019 // Check for length avoids error when initializing empty list 18020 if ( this.options.active !== false && this.anchors.length ) { 18021 this.active = this._findActive( options.active ); 18022 } else { 18023 this.active = $(); 18024 } 18025 18026 this._refresh(); 18027 18028 if ( this.active.length ) { 18029 this.load( options.active ); 18030 } 18031 }, 18032 18033 _initialActive: function() { 18034 var active = this.options.active, 18035 collapsible = this.options.collapsible, 18036 locationHash = location.hash.substring( 1 ); 18037 18038 if ( active === null ) { 18039 18040 // check the fragment identifier in the URL 18041 if ( locationHash ) { 18042 this.tabs.each( function( i, tab ) { 18043 if ( $( tab ).attr( "aria-controls" ) === locationHash ) { 18044 active = i; 18045 return false; 18046 } 18047 } ); 18048 } 18049 18050 // Check for a tab marked active via a class 18051 if ( active === null ) { 18052 active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); 18053 } 18054 18055 // No active tab, set to false 18056 if ( active === null || active === -1 ) { 18057 active = this.tabs.length ? 0 : false; 18058 } 18059 } 18060 18061 // Handle numbers: negative, out of range 18062 if ( active !== false ) { 18063 active = this.tabs.index( this.tabs.eq( active ) ); 18064 if ( active === -1 ) { 18065 active = collapsible ? false : 0; 18066 } 18067 } 18068 18069 // Don't allow collapsible: false and active: false 18070 if ( !collapsible && active === false && this.anchors.length ) { 18071 active = 0; 18072 } 18073 18074 return active; 18075 }, 18076 18077 _getCreateEventData: function() { 18078 return { 18079 tab: this.active, 18080 panel: !this.active.length ? $() : this._getPanelForTab( this.active ) 18081 }; 18082 }, 18083 18084 _tabKeydown: function( event ) { 18085 var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ), 18086 selectedIndex = this.tabs.index( focusedTab ), 18087 goingForward = true; 18088 18089 if ( this._handlePageNav( event ) ) { 18090 return; 18091 } 18092 18093 switch ( event.keyCode ) { 18094 case $.ui.keyCode.RIGHT: 18095 case $.ui.keyCode.DOWN: 18096 selectedIndex++; 18097 break; 18098 case $.ui.keyCode.UP: 18099 case $.ui.keyCode.LEFT: 18100 goingForward = false; 18101 selectedIndex--; 18102 break; 18103 case $.ui.keyCode.END: 18104 selectedIndex = this.anchors.length - 1; 18105 break; 18106 case $.ui.keyCode.HOME: 18107 selectedIndex = 0; 18108 break; 18109 case $.ui.keyCode.SPACE: 18110 18111 // Activate only, no collapsing 18112 event.preventDefault(); 18113 clearTimeout( this.activating ); 18114 this._activate( selectedIndex ); 18115 return; 18116 case $.ui.keyCode.ENTER: 18117 18118 // Toggle (cancel delayed activation, allow collapsing) 18119 event.preventDefault(); 18120 clearTimeout( this.activating ); 18121 18122 // Determine if we should collapse or activate 18123 this._activate( selectedIndex === this.options.active ? false : selectedIndex ); 18124 return; 18125 default: 18126 return; 18127 } 18128 18129 // Focus the appropriate tab, based on which key was pressed 18130 event.preventDefault(); 18131 clearTimeout( this.activating ); 18132 selectedIndex = this._focusNextTab( selectedIndex, goingForward ); 18133 18134 // Navigating with control/command key will prevent automatic activation 18135 if ( !event.ctrlKey && !event.metaKey ) { 18136 18137 // Update aria-selected immediately so that AT think the tab is already selected. 18138 // Otherwise AT may confuse the user by stating that they need to activate the tab, 18139 // but the tab will already be activated by the time the announcement finishes. 18140 focusedTab.attr( "aria-selected", "false" ); 18141 this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); 18142 18143 this.activating = this._delay( function() { 18144 this.option( "active", selectedIndex ); 18145 }, this.delay ); 18146 } 18147 }, 18148 18149 _panelKeydown: function( event ) { 18150 if ( this._handlePageNav( event ) ) { 18151 return; 18152 } 18153 18154 // Ctrl+up moves focus to the current tab 18155 if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { 18156 event.preventDefault(); 18157 this.active.trigger( "focus" ); 18158 } 18159 }, 18160 18161 // Alt+page up/down moves focus to the previous/next tab (and activates) 18162 _handlePageNav: function( event ) { 18163 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { 18164 this._activate( this._focusNextTab( this.options.active - 1, false ) ); 18165 return true; 18166 } 18167 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { 18168 this._activate( this._focusNextTab( this.options.active + 1, true ) ); 18169 return true; 18170 } 18171 }, 18172 18173 _findNextTab: function( index, goingForward ) { 18174 var lastTabIndex = this.tabs.length - 1; 18175 18176 function constrain() { 18177 if ( index > lastTabIndex ) { 18178 index = 0; 18179 } 18180 if ( index < 0 ) { 18181 index = lastTabIndex; 18182 } 18183 return index; 18184 } 18185 18186 while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { 18187 index = goingForward ? index + 1 : index - 1; 18188 } 18189 18190 return index; 18191 }, 18192 18193 _focusNextTab: function( index, goingForward ) { 18194 index = this._findNextTab( index, goingForward ); 18195 this.tabs.eq( index ).trigger( "focus" ); 18196 return index; 18197 }, 18198 18199 _setOption: function( key, value ) { 18200 if ( key === "active" ) { 18201 18202 // _activate() will handle invalid values and update this.options 18203 this._activate( value ); 18204 return; 18205 } 18206 18207 this._super( key, value ); 18208 18209 if ( key === "collapsible" ) { 18210 this._toggleClass( "ui-tabs-collapsible", null, value ); 18211 18212 // Setting collapsible: false while collapsed; open first panel 18213 if ( !value && this.options.active === false ) { 18214 this._activate( 0 ); 18215 } 18216 } 18217 18218 if ( key === "event" ) { 18219 this._setupEvents( value ); 18220 } 18221 18222 if ( key === "heightStyle" ) { 18223 this._setupHeightStyle( value ); 18224 } 18225 }, 18226 18227 _sanitizeSelector: function( hash ) { 18228 return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; 18229 }, 18230 18231 refresh: function() { 18232 var options = this.options, 18233 lis = this.tablist.children( ":has(a[href])" ); 18234 18235 // Get disabled tabs from class attribute from HTML 18236 // this will get converted to a boolean if needed in _refresh() 18237 options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { 18238 return lis.index( tab ); 18239 } ); 18240 18241 this._processTabs(); 18242 18243 // Was collapsed or no tabs 18244 if ( options.active === false || !this.anchors.length ) { 18245 options.active = false; 18246 this.active = $(); 18247 18248 // was active, but active tab is gone 18249 } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { 18250 18251 // all remaining tabs are disabled 18252 if ( this.tabs.length === options.disabled.length ) { 18253 options.active = false; 18254 this.active = $(); 18255 18256 // activate previous tab 18257 } else { 18258 this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); 18259 } 18260 18261 // was active, active tab still exists 18262 } else { 18263 18264 // make sure active index is correct 18265 options.active = this.tabs.index( this.active ); 18266 } 18267 18268 this._refresh(); 18269 }, 18270 18271 _refresh: function() { 18272 this._setOptionDisabled( this.options.disabled ); 18273 this._setupEvents( this.options.event ); 18274 this._setupHeightStyle( this.options.heightStyle ); 18275 18276 this.tabs.not( this.active ).attr( { 18277 "aria-selected": "false", 18278 "aria-expanded": "false", 18279 tabIndex: -1 18280 } ); 18281 this.panels.not( this._getPanelForTab( this.active ) ) 18282 .hide() 18283 .attr( { 18284 "aria-hidden": "true" 18285 } ); 18286 18287 // Make sure one tab is in the tab order 18288 if ( !this.active.length ) { 18289 this.tabs.eq( 0 ).attr( "tabIndex", 0 ); 18290 } else { 18291 this.active 18292 .attr( { 18293 "aria-selected": "true", 18294 "aria-expanded": "true", 18295 tabIndex: 0 18296 } ); 18297 this._addClass( this.active, "ui-tabs-active", "ui-state-active" ); 18298 this._getPanelForTab( this.active ) 18299 .show() 18300 .attr( { 18301 "aria-hidden": "false" 18302 } ); 18303 } 18304 }, 18305 18306 _processTabs: function() { 18307 var that = this, 18308 prevTabs = this.tabs, 18309 prevAnchors = this.anchors, 18310 prevPanels = this.panels; 18311 18312 this.tablist = this._getList().attr( "role", "tablist" ); 18313 this._addClass( this.tablist, "ui-tabs-nav", 18314 "ui-helper-reset ui-helper-clearfix ui-widget-header" ); 18315 18316 // Prevent users from focusing disabled tabs via click 18317 this.tablist 18318 .on( "mousedown" + this.eventNamespace, "> li", function( event ) { 18319 if ( $( this ).is( ".ui-state-disabled" ) ) { 18320 event.preventDefault(); 18321 } 18322 } ) 18323 18324 // Support: IE <9 18325 // Preventing the default action in mousedown doesn't prevent IE 18326 // from focusing the element, so if the anchor gets focused, blur. 18327 // We don't have to worry about focusing the previously focused 18328 // element since clicking on a non-focusable element should focus 18329 // the body anyway. 18330 .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() { 18331 if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { 18332 this.blur(); 18333 } 18334 } ); 18335 18336 this.tabs = this.tablist.find( "> li:has(a[href])" ) 18337 .attr( { 18338 role: "tab", 18339 tabIndex: -1 18340 } ); 18341 this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" ); 18342 18343 this.anchors = this.tabs.map( function() { 18344 return $( "a", this )[ 0 ]; 18345 } ) 18346 .attr( { 18347 tabIndex: -1 18348 } ); 18349 this._addClass( this.anchors, "ui-tabs-anchor" ); 18350 18351 this.panels = $(); 18352 18353 this.anchors.each( function( i, anchor ) { 18354 var selector, panel, panelId, 18355 anchorId = $( anchor ).uniqueId().attr( "id" ), 18356 tab = $( anchor ).closest( "li" ), 18357 originalAriaControls = tab.attr( "aria-controls" ); 18358 18359 // Inline tab 18360 if ( that._isLocal( anchor ) ) { 18361 selector = anchor.hash; 18362 panelId = selector.substring( 1 ); 18363 panel = that.element.find( that._sanitizeSelector( selector ) ); 18364 18365 // remote tab 18366 } else { 18367 18368 // If the tab doesn't already have aria-controls, 18369 // generate an id by using a throw-away element 18370 panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id; 18371 selector = "#" + panelId; 18372 panel = that.element.find( selector ); 18373 if ( !panel.length ) { 18374 panel = that._createPanel( panelId ); 18375 panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); 18376 } 18377 panel.attr( "aria-live", "polite" ); 18378 } 18379 18380 if ( panel.length ) { 18381 that.panels = that.panels.add( panel ); 18382 } 18383 if ( originalAriaControls ) { 18384 tab.data( "ui-tabs-aria-controls", originalAriaControls ); 18385 } 18386 tab.attr( { 18387 "aria-controls": panelId, 18388 "aria-labelledby": anchorId 18389 } ); 18390 panel.attr( "aria-labelledby", anchorId ); 18391 } ); 18392 18393 this.panels.attr( "role", "tabpanel" ); 18394 this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" ); 18395 18396 // Avoid memory leaks (#10056) 18397 if ( prevTabs ) { 18398 this._off( prevTabs.not( this.tabs ) ); 18399 this._off( prevAnchors.not( this.anchors ) ); 18400 this._off( prevPanels.not( this.panels ) ); 18401 } 18402 }, 18403 18404 // Allow overriding how to find the list for rare usage scenarios (#7715) 18405 _getList: function() { 18406 return this.tablist || this.element.find( "ol, ul" ).eq( 0 ); 18407 }, 18408 18409 _createPanel: function( id ) { 18410 return $( "<div>" ) 18411 .attr( "id", id ) 18412 .data( "ui-tabs-destroy", true ); 18413 }, 18414 18415 _setOptionDisabled: function( disabled ) { 18416 var currentItem, li, i; 18417 18418 if ( Array.isArray( disabled ) ) { 18419 if ( !disabled.length ) { 18420 disabled = false; 18421 } else if ( disabled.length === this.anchors.length ) { 18422 disabled = true; 18423 } 18424 } 18425 18426 // Disable tabs 18427 for ( i = 0; ( li = this.tabs[ i ] ); i++ ) { 18428 currentItem = $( li ); 18429 if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { 18430 currentItem.attr( "aria-disabled", "true" ); 18431 this._addClass( currentItem, null, "ui-state-disabled" ); 18432 } else { 18433 currentItem.removeAttr( "aria-disabled" ); 18434 this._removeClass( currentItem, null, "ui-state-disabled" ); 18435 } 18436 } 18437 18438 this.options.disabled = disabled; 18439 18440 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, 18441 disabled === true ); 18442 }, 18443 18444 _setupEvents: function( event ) { 18445 var events = {}; 18446 if ( event ) { 18447 $.each( event.split( " " ), function( index, eventName ) { 18448 events[ eventName ] = "_eventHandler"; 18449 } ); 18450 } 18451 18452 this._off( this.anchors.add( this.tabs ).add( this.panels ) ); 18453 18454 // Always prevent the default action, even when disabled 18455 this._on( true, this.anchors, { 18456 click: function( event ) { 18457 event.preventDefault(); 18458 } 18459 } ); 18460 this._on( this.anchors, events ); 18461 this._on( this.tabs, { keydown: "_tabKeydown" } ); 18462 this._on( this.panels, { keydown: "_panelKeydown" } ); 18463 18464 this._focusable( this.tabs ); 18465 this._hoverable( this.tabs ); 18466 }, 18467 18468 _setupHeightStyle: function( heightStyle ) { 18469 var maxHeight, 18470 parent = this.element.parent(); 18471 18472 if ( heightStyle === "fill" ) { 18473 maxHeight = parent.height(); 18474 maxHeight -= this.element.outerHeight() - this.element.height(); 18475 18476 this.element.siblings( ":visible" ).each( function() { 18477 var elem = $( this ), 18478 position = elem.css( "position" ); 18479 18480 if ( position === "absolute" || position === "fixed" ) { 18481 return; 18482 } 18483 maxHeight -= elem.outerHeight( true ); 18484 } ); 18485 18486 this.element.children().not( this.panels ).each( function() { 18487 maxHeight -= $( this ).outerHeight( true ); 18488 } ); 18489 18490 this.panels.each( function() { 18491 $( this ).height( Math.max( 0, maxHeight - 18492 $( this ).innerHeight() + $( this ).height() ) ); 18493 } ) 18494 .css( "overflow", "auto" ); 18495 } else if ( heightStyle === "auto" ) { 18496 maxHeight = 0; 18497 this.panels.each( function() { 18498 maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); 18499 } ).height( maxHeight ); 18500 } 18501 }, 18502 18503 _eventHandler: function( event ) { 18504 var options = this.options, 18505 active = this.active, 18506 anchor = $( event.currentTarget ), 18507 tab = anchor.closest( "li" ), 18508 clickedIsActive = tab[ 0 ] === active[ 0 ], 18509 collapsing = clickedIsActive && options.collapsible, 18510 toShow = collapsing ? $() : this._getPanelForTab( tab ), 18511 toHide = !active.length ? $() : this._getPanelForTab( active ), 18512 eventData = { 18513 oldTab: active, 18514 oldPanel: toHide, 18515 newTab: collapsing ? $() : tab, 18516 newPanel: toShow 18517 }; 18518 18519 event.preventDefault(); 18520 18521 if ( tab.hasClass( "ui-state-disabled" ) || 18522 18523 // tab is already loading 18524 tab.hasClass( "ui-tabs-loading" ) || 18525 18526 // can't switch durning an animation 18527 this.running || 18528 18529 // click on active header, but not collapsible 18530 ( clickedIsActive && !options.collapsible ) || 18531 18532 // allow canceling activation 18533 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 18534 return; 18535 } 18536 18537 options.active = collapsing ? false : this.tabs.index( tab ); 18538 18539 this.active = clickedIsActive ? $() : tab; 18540 if ( this.xhr ) { 18541 this.xhr.abort(); 18542 } 18543 18544 if ( !toHide.length && !toShow.length ) { 18545 $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); 18546 } 18547 18548 if ( toShow.length ) { 18549 this.load( this.tabs.index( tab ), event ); 18550 } 18551 this._toggle( event, eventData ); 18552 }, 18553 18554 // Handles show/hide for selecting tabs 18555 _toggle: function( event, eventData ) { 18556 var that = this, 18557 toShow = eventData.newPanel, 18558 toHide = eventData.oldPanel; 18559 18560 this.running = true; 18561 18562 function complete() { 18563 that.running = false; 18564 that._trigger( "activate", event, eventData ); 18565 } 18566 18567 function show() { 18568 that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" ); 18569 18570 if ( toShow.length && that.options.show ) { 18571 that._show( toShow, that.options.show, complete ); 18572 } else { 18573 toShow.show(); 18574 complete(); 18575 } 18576 } 18577 18578 // Start out by hiding, then showing, then completing 18579 if ( toHide.length && this.options.hide ) { 18580 this._hide( toHide, this.options.hide, function() { 18581 that._removeClass( eventData.oldTab.closest( "li" ), 18582 "ui-tabs-active", "ui-state-active" ); 18583 show(); 18584 } ); 18585 } else { 18586 this._removeClass( eventData.oldTab.closest( "li" ), 18587 "ui-tabs-active", "ui-state-active" ); 18588 toHide.hide(); 18589 show(); 18590 } 18591 18592 toHide.attr( "aria-hidden", "true" ); 18593 eventData.oldTab.attr( { 18594 "aria-selected": "false", 18595 "aria-expanded": "false" 18596 } ); 18597 18598 // If we're switching tabs, remove the old tab from the tab order.
vendor: 4,129 bytes, lines 18599-18770
18599 // If we're opening from collapsed state, remove the previous tab from the tab order. 18600 // If we're collapsing, then keep the collapsing tab in the tab order. 18601 if ( toShow.length && toHide.length ) { 18602 eventData.oldTab.attr( "tabIndex", -1 ); 18603 } else if ( toShow.length ) { 18604 this.tabs.filter( function() { 18605 return $( this ).attr( "tabIndex" ) === 0; 18606 } ) 18607 .attr( "tabIndex", -1 ); 18608 } 18609 18610 toShow.attr( "aria-hidden", "false" ); 18611 eventData.newTab.attr( { 18612 "aria-selected": "true", 18613 "aria-expanded": "true", 18614 tabIndex: 0 18615 } ); 18616 }, 18617 18618 _activate: function( index ) { 18619 var anchor, 18620 active = this._findActive( index ); 18621 18622 // Trying to activate the already active panel 18623 if ( active[ 0 ] === this.active[ 0 ] ) { 18624 return; 18625 } 18626 18627 // Trying to collapse, simulate a click on the current active header 18628 if ( !active.length ) { 18629 active = this.active; 18630 } 18631 18632 anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; 18633 this._eventHandler( { 18634 target: anchor, 18635 currentTarget: anchor, 18636 preventDefault: $.noop 18637 } ); 18638 }, 18639 18640 _findActive: function( index ) { 18641 return index === false ? $() : this.tabs.eq( index ); 18642 }, 18643 18644 _getIndex: function( index ) { 18645 18646 // meta-function to give users option to provide a href string instead of a numerical index. 18647 if ( typeof index === "string" ) { 18648 index = this.anchors.index( this.anchors.filter( "[href$='" + 18649 $.escapeSelector( index ) + "']" ) ); 18650 } 18651 18652 return index; 18653 }, 18654 18655 _destroy: function() { 18656 if ( this.xhr ) { 18657 this.xhr.abort(); 18658 } 18659 18660 this.tablist 18661 .removeAttr( "role" ) 18662 .off( this.eventNamespace ); 18663 18664 this.anchors 18665 .removeAttr( "role tabIndex" ) 18666 .removeUniqueId(); 18667 18668 this.tabs.add( this.panels ).each( function() { 18669 if ( $.data( this, "ui-tabs-destroy" ) ) { 18670 $( this ).remove(); 18671 } else { 18672 $( this ).removeAttr( "role tabIndex " + 18673 "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" ); 18674 } 18675 } ); 18676 18677 this.tabs.each( function() { 18678 var li = $( this ), 18679 prev = li.data( "ui-tabs-aria-controls" ); 18680 if ( prev ) { 18681 li 18682 .attr( "aria-controls", prev ) 18683 .removeData( "ui-tabs-aria-controls" ); 18684 } else { 18685 li.removeAttr( "aria-controls" ); 18686 } 18687 } ); 18688 18689 this.panels.show(); 18690 18691 if ( this.options.heightStyle !== "content" ) { 18692 this.panels.css( "height", "" ); 18693 } 18694 }, 18695 18696 enable: function( index ) { 18697 var disabled = this.options.disabled; 18698 if ( disabled === false ) { 18699 return; 18700 } 18701 18702 if ( index === undefined ) { 18703 disabled = false; 18704 } else { 18705 index = this._getIndex( index ); 18706 if ( Array.isArray( disabled ) ) { 18707 disabled = $.map( disabled, function( num ) { 18708 return num !== index ? num : null; 18709 } ); 18710 } else { 18711 disabled = $.map( this.tabs, function( li, num ) { 18712 return num !== index ? num : null; 18713 } ); 18714 } 18715 } 18716 this._setOptionDisabled( disabled ); 18717 }, 18718 18719 disable: function( index ) { 18720 var disabled = this.options.disabled; 18721 if ( disabled === true ) { 18722 return; 18723 } 18724 18725 if ( index === undefined ) { 18726 disabled = true; 18727 } else { 18728 index = this._getIndex( index ); 18729 if ( $.inArray( index, disabled ) !== -1 ) { 18730 return; 18731 } 18732 if ( Array.isArray( disabled ) ) { 18733 disabled = $.merge( [ index ], disabled ).sort(); 18734 } else { 18735 disabled = [ index ]; 18736 } 18737 } 18738 this._setOptionDisabled( disabled ); 18739 }, 18740 18741 load: function( index, event ) { 18742 index = this._getIndex( index ); 18743 var that = this, 18744 tab = this.tabs.eq( index ), 18745 anchor = tab.find( ".ui-tabs-anchor" ), 18746 panel = this._getPanelForTab( tab ), 18747 eventData = { 18748 tab: tab, 18749 panel: panel 18750 }, 18751 complete = function( jqXHR, status ) { 18752 if ( status === "abort" ) { 18753 that.panels.stop( false, true ); 18754 } 18755 18756 that._removeClass( tab, "ui-tabs-loading" ); 18757 panel.removeAttr( "aria-busy" ); 18758 18759 if ( jqXHR === that.xhr ) { 18760 delete that.xhr; 18761 } 18762 }; 18763 18764 // Not remote 18765 if ( this._isLocal( anchor[ 0 ] ) ) { 18766 return; 18767 } 18768 18769 this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); 18770
vendor: 16,697 bytes, lines 18771-19347
18771 // Support: jQuery <1.8 18772 // jQuery <1.8 returns false if the request is canceled in beforeSend, 18773 // but as of 1.8, $.ajax() always returns a jqXHR object. 18774 if ( this.xhr && this.xhr.statusText !== "canceled" ) { 18775 this._addClass( tab, "ui-tabs-loading" ); 18776 panel.attr( "aria-busy", "true" ); 18777 18778 this.xhr 18779 .done( function( response, status, jqXHR ) { 18780 18781 // support: jQuery <1.8 18782 // http://bugs.jquery.com/ticket/11778 18783 setTimeout( function() { 18784 panel.html( response ); 18785 that._trigger( "load", event, eventData ); 18786 18787 complete( jqXHR, status ); 18788 }, 1 ); 18789 } ) 18790 .fail( function( jqXHR, status ) { 18791 18792 // support: jQuery <1.8 18793 // http://bugs.jquery.com/ticket/11778 18794 setTimeout( function() { 18795 complete( jqXHR, status ); 18796 }, 1 ); 18797 } ); 18798 } 18799 }, 18800 18801 _ajaxSettings: function( anchor, event, eventData ) { 18802 var that = this; 18803 return { 18804 18805 // Support: IE <11 only 18806 // Strip any hash that exists to prevent errors with the Ajax request 18807 url: anchor.attr( "href" ).replace( /#.*$/, "" ), 18808 beforeSend: function( jqXHR, settings ) { 18809 return that._trigger( "beforeLoad", event, 18810 $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); 18811 } 18812 }; 18813 }, 18814 18815 _getPanelForTab: function( tab ) { 18816 var id = $( tab ).attr( "aria-controls" ); 18817 return this.element.find( this._sanitizeSelector( "#" + id ) ); 18818 } 18819} ); 18820 18821// DEPRECATED 18822// TODO: Switch return back to widget declaration at top of file when this is removed 18823if ( $.uiBackCompat !== false ) { 18824 18825 // Backcompat for ui-tab class (now ui-tabs-tab) 18826 $.widget( "ui.tabs", $.ui.tabs, { 18827 _processTabs: function() { 18828 this._superApply( arguments ); 18829 this._addClass( this.tabs, "ui-tab" ); 18830 } 18831 } ); 18832} 18833 18834var widgetsTabs = $.ui.tabs; 18835 18836 18837/*! 18838 * jQuery UI Tooltip 1.13.2 18839 * http://jqueryui.com 18840 * 18841 * Copyright jQuery Foundation and other contributors 18842 * Released under the MIT license. 18843 * http://jquery.org/license 18844 */ 18845 18846//>>label: Tooltip 18847//>>group: Widgets 18848//>>description: Shows additional information for any element on hover or focus. 18849//>>docs: http://api.jqueryui.com/tooltip/ 18850//>>demos: http://jqueryui.com/tooltip/ 18851//>>css.structure: ../../themes/base/core.css 18852//>>css.structure: ../../themes/base/tooltip.css 18853//>>css.theme: ../../themes/base/theme.css 18854 18855 18856$.widget( "ui.tooltip", { 18857 version: "1.13.2", 18858 options: { 18859 classes: { 18860 "ui-tooltip": "ui-corner-all ui-widget-shadow" 18861 }, 18862 content: function() { 18863 var title = $( this ).attr( "title" ); 18864 18865 // Escape title, since we're going from an attribute to raw HTML 18866 return $( "<a>" ).text( title ).html(); 18867 }, 18868 hide: true, 18869 18870 // Disabled elements have inconsistent behavior across browsers (#8661) 18871 items: "[title]:not([disabled])", 18872 position: { 18873 my: "left top+15", 18874 at: "left bottom", 18875 collision: "flipfit flip" 18876 }, 18877 show: true, 18878 track: false, 18879 18880 // Callbacks 18881 close: null, 18882 open: null 18883 }, 18884 18885 _addDescribedBy: function( elem, id ) { 18886 var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ); 18887 describedby.push( id ); 18888 elem 18889 .data( "ui-tooltip-id", id ) 18890 .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); 18891 }, 18892 18893 _removeDescribedBy: function( elem ) { 18894 var id = elem.data( "ui-tooltip-id" ), 18895 describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ), 18896 index = $.inArray( id, describedby ); 18897 18898 if ( index !== -1 ) { 18899 describedby.splice( index, 1 ); 18900 } 18901 18902 elem.removeData( "ui-tooltip-id" ); 18903 describedby = String.prototype.trim.call( describedby.join( " " ) ); 18904 if ( describedby ) { 18905 elem.attr( "aria-describedby", describedby ); 18906 } else { 18907 elem.removeAttr( "aria-describedby" ); 18908 } 18909 }, 18910 18911 _create: function() { 18912 this._on( { 18913 mouseover: "open", 18914 focusin: "open" 18915 } ); 18916 18917 // IDs of generated tooltips, needed for destroy 18918 this.tooltips = {}; 18919 18920 // IDs of parent tooltips where we removed the title attribute 18921 this.parents = {}; 18922 18923 // Append the aria-live region so tooltips announce correctly 18924 this.liveRegion = $( "<div>" ) 18925 .attr( { 18926 role: "log", 18927 "aria-live": "assertive", 18928 "aria-relevant": "additions" 18929 } ) 18930 .appendTo( this.document[ 0 ].body ); 18931 this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); 18932 18933 this.disabledTitles = $( [] ); 18934 }, 18935 18936 _setOption: function( key, value ) { 18937 var that = this; 18938 18939 this._super( key, value ); 18940 18941 if ( key === "content" ) { 18942 $.each( this.tooltips, function( id, tooltipData ) { 18943 that._updateContent( tooltipData.element ); 18944 } ); 18945 } 18946 }, 18947 18948 _setOptionDisabled: function( value ) { 18949 this[ value ? "_disable" : "_enable" ](); 18950 }, 18951 18952 _disable: function() { 18953 var that = this; 18954 18955 // Close open tooltips 18956 $.each( this.tooltips, function( id, tooltipData ) { 18957 var event = $.Event( "blur" ); 18958 event.target = event.currentTarget = tooltipData.element[ 0 ]; 18959 that.close( event, true ); 18960 } ); 18961 18962 // Remove title attributes to prevent native tooltips 18963 this.disabledTitles = this.disabledTitles.add( 18964 this.element.find( this.options.items ).addBack() 18965 .filter( function() { 18966 var element = $( this ); 18967 if ( element.is( "[title]" ) ) { 18968 return element 18969 .data( "ui-tooltip-title", element.attr( "title" ) ) 18970 .removeAttr( "title" ); 18971 } 18972 } ) 18973 ); 18974 }, 18975 18976 _enable: function() { 18977 18978 // restore title attributes 18979 this.disabledTitles.each( function() { 18980 var element = $( this ); 18981 if ( element.data( "ui-tooltip-title" ) ) { 18982 element.attr( "title", element.data( "ui-tooltip-title" ) ); 18983 } 18984 } ); 18985 this.disabledTitles = $( [] ); 18986 }, 18987 18988 open: function( event ) { 18989 var that = this, 18990 target = $( event ? event.target : this.element ) 18991 18992 // we need closest here due to mouseover bubbling, 18993 // but always pointing at the same event target 18994 .closest( this.options.items ); 18995 18996 // No element to show a tooltip for or the tooltip is already open 18997 if ( !target.length || target.data( "ui-tooltip-id" ) ) { 18998 return; 18999 } 19000 19001 if ( target.attr( "title" ) ) { 19002 target.data( "ui-tooltip-title", target.attr( "title" ) ); 19003 } 19004 19005 target.data( "ui-tooltip-open", true ); 19006 19007 // Kill parent tooltips, custom or native, for hover 19008 if ( event && event.type === "mouseover" ) { 19009 target.parents().each( function() { 19010 var parent = $( this ), 19011 blurEvent; 19012 if ( parent.data( "ui-tooltip-open" ) ) { 19013 blurEvent = $.Event( "blur" ); 19014 blurEvent.target = blurEvent.currentTarget = this; 19015 that.close( blurEvent, true ); 19016 } 19017 if ( parent.attr( "title" ) ) { 19018 parent.uniqueId(); 19019 that.parents[ this.id ] = { 19020 element: this, 19021 title: parent.attr( "title" ) 19022 }; 19023 parent.attr( "title", "" ); 19024 } 19025 } ); 19026 } 19027 19028 this._registerCloseHandlers( event, target ); 19029 this._updateContent( target, event ); 19030 }, 19031 19032 _updateContent: function( target, event ) { 19033 var content, 19034 contentOption = this.options.content, 19035 that = this, 19036 eventType = event ? event.type : null; 19037 19038 if ( typeof contentOption === "string" || contentOption.nodeType || 19039 contentOption.jquery ) { 19040 return this._open( event, target, contentOption ); 19041 } 19042 19043 content = contentOption.call( target[ 0 ], function( response ) { 19044 19045 // IE may instantly serve a cached response for ajax requests 19046 // delay this call to _open so the other call to _open runs first 19047 that._delay( function() { 19048 19049 // Ignore async response if tooltip was closed already 19050 if ( !target.data( "ui-tooltip-open" ) ) { 19051 return; 19052 } 19053 19054 // JQuery creates a special event for focusin when it doesn't 19055 // exist natively. To improve performance, the native event 19056 // object is reused and the type is changed. Therefore, we can't 19057 // rely on the type being correct after the event finished 19058 // bubbling, so we set it back to the previous value. (#8740) 19059 if ( event ) { 19060 event.type = eventType; 19061 } 19062 this._open( event, target, response ); 19063 } ); 19064 } ); 19065 if ( content ) { 19066 this._open( event, target, content ); 19067 } 19068 }, 19069 19070 _open: function( event, target, content ) { 19071 var tooltipData, tooltip, delayedShow, a11yContent, 19072 positionOption = $.extend( {}, this.options.position ); 19073 19074 if ( !content ) { 19075 return; 19076 } 19077 19078 // Content can be updated multiple times. If the tooltip already 19079 // exists, then just update the content and bail. 19080 tooltipData = this._find( target ); 19081 if ( tooltipData ) { 19082 tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); 19083 return; 19084 } 19085 19086 // If we have a title, clear it to prevent the native tooltip 19087 // we have to check first to avoid defining a title if none exists 19088 // (we don't want to cause an element to start matching [title]) 19089 // 19090 // We use removeAttr only for key events, to allow IE to export the correct 19091 // accessible attributes. For mouse events, set to empty string to avoid 19092 // native tooltip showing up (happens only when removing inside mouseover). 19093 if ( target.is( "[title]" ) ) { 19094 if ( event && event.type === "mouseover" ) { 19095 target.attr( "title", "" ); 19096 } else { 19097 target.removeAttr( "title" ); 19098 } 19099 } 19100 19101 tooltipData = this._tooltip( target ); 19102 tooltip = tooltipData.tooltip; 19103 this._addDescribedBy( target, tooltip.attr( "id" ) ); 19104 tooltip.find( ".ui-tooltip-content" ).html( content ); 19105 19106 // Support: Voiceover on OS X, JAWS on IE <= 9 19107 // JAWS announces deletions even when aria-relevant="additions" 19108 // Voiceover will sometimes re-read the entire log region's contents from the beginning 19109 this.liveRegion.children().hide(); 19110 a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); 19111 a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" ); 19112 a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); 19113 a11yContent.appendTo( this.liveRegion ); 19114 19115 function position( event ) { 19116 positionOption.of = event; 19117 if ( tooltip.is( ":hidden" ) ) { 19118 return; 19119 } 19120 tooltip.position( positionOption ); 19121 } 19122 if ( this.options.track && event && /^mouse/.test( event.type ) ) { 19123 this._on( this.document, { 19124 mousemove: position 19125 } ); 19126 19127 // trigger once to override element-relative positioning 19128 position( event ); 19129 } else { 19130 tooltip.position( $.extend( { 19131 of: target 19132 }, this.options.position ) ); 19133 } 19134 19135 tooltip.hide(); 19136 19137 this._show( tooltip, this.options.show ); 19138 19139 // Handle tracking tooltips that are shown with a delay (#8644). As soon 19140 // as the tooltip is visible, position the tooltip using the most recent 19141 // event. 19142 // Adds the check to add the timers only when both delay and track options are set (#14682) 19143 if ( this.options.track && this.options.show && this.options.show.delay ) { 19144 delayedShow = this.delayedShow = setInterval( function() { 19145 if ( tooltip.is( ":visible" ) ) { 19146 position( positionOption.of ); 19147 clearInterval( delayedShow ); 19148 } 19149 }, 13 ); 19150 } 19151 19152 this._trigger( "open", event, { tooltip: tooltip } ); 19153 }, 19154 19155 _registerCloseHandlers: function( event, target ) { 19156 var events = { 19157 keyup: function( event ) { 19158 if ( event.keyCode === $.ui.keyCode.ESCAPE ) { 19159 var fakeEvent = $.Event( event ); 19160 fakeEvent.currentTarget = target[ 0 ]; 19161 this.close( fakeEvent, true ); 19162 } 19163 } 19164 }; 19165 19166 // Only bind remove handler for delegated targets. Non-delegated 19167 // tooltips will handle this in destroy. 19168 if ( target[ 0 ] !== this.element[ 0 ] ) { 19169 events.remove = function() { 19170 var targetElement = this._find( target ); 19171 if ( targetElement ) { 19172 this._removeTooltip( targetElement.tooltip ); 19173 } 19174 }; 19175 } 19176 19177 if ( !event || event.type === "mouseover" ) { 19178 events.mouseleave = "close"; 19179 } 19180 if ( !event || event.type === "focusin" ) { 19181 events.focusout = "close"; 19182 } 19183 this._on( true, target, events ); 19184 }, 19185 19186 close: function( event ) { 19187 var tooltip, 19188 that = this, 19189 target = $( event ? event.currentTarget : this.element ), 19190 tooltipData = this._find( target ); 19191 19192 // The tooltip may already be closed 19193 if ( !tooltipData ) { 19194 19195 // We set ui-tooltip-open immediately upon open (in open()), but only set the 19196 // additional data once there's actually content to show (in _open()). So even if the 19197 // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in 19198 // the period between open() and _open(). 19199 target.removeData( "ui-tooltip-open" ); 19200 return; 19201 } 19202 19203 tooltip = tooltipData.tooltip; 19204 19205 // Disabling closes the tooltip, so we need to track when we're closing 19206 // to avoid an infinite loop in case the tooltip becomes disabled on close 19207 if ( tooltipData.closing ) { 19208 return; 19209 } 19210 19211 // Clear the interval for delayed tracking tooltips 19212 clearInterval( this.delayedShow ); 19213 19214 // Only set title if we had one before (see comment in _open()) 19215 // If the title attribute has changed since open(), don't restore 19216 if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { 19217 target.attr( "title", target.data( "ui-tooltip-title" ) ); 19218 } 19219 19220 this._removeDescribedBy( target ); 19221 19222 tooltipData.hiding = true; 19223 tooltip.stop( true ); 19224 this._hide( tooltip, this.options.hide, function() { 19225 that._removeTooltip( $( this ) ); 19226 } ); 19227 19228 target.removeData( "ui-tooltip-open" ); 19229 this._off( target, "mouseleave focusout keyup" ); 19230 19231 // Remove 'remove' binding only on delegated targets 19232 if ( target[ 0 ] !== this.element[ 0 ] ) { 19233 this._off( target, "remove" ); 19234 } 19235 this._off( this.document, "mousemove" ); 19236 19237 if ( event && event.type === "mouseleave" ) { 19238 $.each( this.parents, function( id, parent ) { 19239 $( parent.element ).attr( "title", parent.title ); 19240 delete that.parents[ id ]; 19241 } ); 19242 } 19243 19244 tooltipData.closing = true; 19245 this._trigger( "close", event, { tooltip: tooltip } ); 19246 if ( !tooltipData.hiding ) { 19247 tooltipData.closing = false; 19248 } 19249 }, 19250 19251 _tooltip: function( element ) { 19252 var tooltip = $( "<div>" ).attr( "role", "tooltip" ), 19253 content = $( "<div>" ).appendTo( tooltip ), 19254 id = tooltip.uniqueId().attr( "id" ); 19255 19256 this._addClass( content, "ui-tooltip-content" ); 19257 this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" ); 19258 19259 tooltip.appendTo( this._appendTo( element ) ); 19260 19261 return this.tooltips[ id ] = { 19262 element: element, 19263 tooltip: tooltip 19264 }; 19265 }, 19266 19267 _find: function( target ) { 19268 var id = target.data( "ui-tooltip-id" ); 19269 return id ? this.tooltips[ id ] : null; 19270 }, 19271 19272 _removeTooltip: function( tooltip ) { 19273 19274 // Clear the interval for delayed tracking tooltips 19275 clearInterval( this.delayedShow ); 19276 19277 tooltip.remove(); 19278 delete this.tooltips[ tooltip.attr( "id" ) ]; 19279 }, 19280 19281 _appendTo: function( target ) { 19282 var element = target.closest( ".ui-front, dialog" ); 19283 19284 if ( !element.length ) { 19285 element = this.document[ 0 ].body; 19286 } 19287 19288 return element; 19289 }, 19290 19291 _destroy: function() { 19292 var that = this; 19293 19294 // Close open tooltips 19295 $.each( this.tooltips, function( id, tooltipData ) { 19296 19297 // Delegate to close method to handle common cleanup 19298 var event = $.Event( "blur" ), 19299 element = tooltipData.element; 19300 event.target = event.currentTarget = element[ 0 ]; 19301 that.close( event, true ); 19302 19303 // Remove immediately; destroying an open tooltip doesn't use the 19304 // hide animation 19305 $( "#" + id ).remove(); 19306 19307 // Restore the title 19308 if ( element.data( "ui-tooltip-title" ) ) { 19309 19310 // If the title attribute has changed since open(), don't restore 19311 if ( !element.attr( "title" ) ) { 19312 element.attr( "title", element.data( "ui-tooltip-title" ) ); 19313 } 19314 element.removeData( "ui-tooltip-title" ); 19315 } 19316 } ); 19317 this.liveRegion.remove(); 19318 } 19319} ); 19320 19321// DEPRECATED 19322// TODO: Switch return back to widget declaration at top of file when this is removed 19323if ( $.uiBackCompat !== false ) { 19324 19325 // Backcompat for tooltipClass option 19326 $.widget( "ui.tooltip", $.ui.tooltip, { 19327 options: { 19328 tooltipClass: null 19329 }, 19330 _tooltip: function() { 19331 var tooltipData = this._superApply( arguments ); 19332 if ( this.options.tooltipClass ) { 19333 tooltipData.tooltip.addClass( this.options.tooltipClass ); 19334 } 19335 return tooltipData; 19336 } 19337 } ); 19338} 19339 19340var widgetsTooltip = $.ui.tooltip; 19341 19342 19343 19344 19345} ); 19346 19347var NBP=function(){var NBP={},LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n;}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
19347+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return "";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256;}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o));}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return "";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else {if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;}else {for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a];}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u);}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;}else {for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a];}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++);}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++;}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return ""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return "";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else {if(l!==d)return null;v=s+s.charAt(0);}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++);}}};return i}();return "function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString),bloom={initalized:!1,hashRounds:null,bitArray:null,bitArrayLe
19347ngth:null},initState=!1,bloom.hashes={djb2:function(str){for(var hash=5381,len=str.length,count=0;len>count;count++)hash=33*hash^str.charCodeAt(count);return (hash>>>0)%bloom.bitArrayLength},sdbm:function(str){for(var hash=0,len=str.length,count=0;len>count;count++)hash=str.charCodeAt(count)+(hash<<6)+(hash<<16)-hash;return (hash>>>0)%bloom.bitArrayLength},getIndices:function(str){var hashes=[];hashes.push(this.djb2(str)),hashes.push(this.sdbm(str));for(var round=2;round<=bloom.hashRounds;round++){var new_hash=(hashes[0]+round*hashes[1]+(2^round))%bloom.bitArrayLength;hashes.push(new_hash);}return hashes}},bloom.init=function(contents,listLength){var raw_data=LZString.decompressFromUTF16(contents),data=raw_data.split(",");bloom.bitArrayLength=8*data.length,bloom.hashRounds=Math.round(Math.log(2)*bloom.bitArrayLength/listLength),bloom.bitArray=new Uint8Array(data),bloom.initalized=!0;},bloom.checkEntry=function(str){if(!bloom.initalized)throw new Error("[NBP] Bloom filter has not been initalized, cannot run.");for(var indices=bloom.hashes.getIndices(str),i=indices.length-1;i>=0;i--){var extra_indices=indices[i]%8,index=(indices[i]-extra_indices)/8;if(0!=extra_indices&&0==(bloom.bitArray[index]&128>>extra_indices-1))return !1;if(0==extra_indices&&0==(1&bloom.bitArray[index]))return !1}return !0},NBP.debug={bloom:bloom},NBP.init=function(){var wordlist=void 0!==arguments[0]?arguments[0]:"mostcommon_10000",path=void 0!==arguments[1]?arguments[1]:"collections/",cache=void 0!==arguments[2]?arguments[2]:!0,wordlistSplit=wordlist.split("_"),wordlistLength=wordlistSplit[wordlistSplit.length-1];if("number"==typeof wordlistLength)return console.error("[NBP] Provided wordlist file must match the format [list description]_[list length]"),console.error("i.e. mostcommon_10000"),!1;if("/"!==path.slice(-1)&&(path+="/"),"undefined"!=typeof localStorage&&"undefined"!=typeof localStorage["NBP_"+wordlist]&&cache)return void bloom.init(localStorage["NBP_"+wordlist],wordlistLength);var ajax=new XMLHttpRequest,bloom_contents="";ajax.onreadystatechange=function(){ajax.readyState===XMLHttpRequest.DONE&&(200===ajax.status?(bloom_contents=ajax.responseText,cache&&(localStorage["NBP_"+wordlist]=bloom_contents),bloom.init(bloom_contents,wordlistLength),initState=!0):(console.error("[NBP] Error retrieving bloom contents. Error code: "+ajax.status),console.error("[NBP] Ensure that the word list is located at "+path+wordlist),console.error("[NBP] Additionally, file must match the format [list description]_[list length]")));},ajax.open("GET",""+path+wordlist,!0),ajax.send(null);},NBP.isCommonPassword=function(password){return ""==password?!1:bloom.checkEntry(password)||bloom.checkEntry(password.toLowerCase())},NBP.testInit=function(){var wordlist=void 0!==arguments[0]?arguments[0]:"mostcommon_100000",fs=require("fs"),wordlistSplit=wordlist.split("_"),wordlistLength=wordlistSplit[wordlistSplit.length-1],bloomContent=fs.readFileSync("collections/"+wordlist,"utf8");bloom.init(bloomContent,wordlistLength);},NBP}();"undefined"!=typeof module&&(module.exports=NBP); 19348 19349!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else {var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r];}}(self,(function(){return function(){var e={3099:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e};},6077:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e};},1223:function(e,t,n){var r=n(5112),i=n(30),o=n(3070),a=r("unscopables"),u=Array.prototype;null==u[a]&&o.f(u,a,{configurable:!0,value:i(null)}),e.exports=function(e){u[a][e]=!0;};},1530:function(e,t,n){"use strict";var r=n(8710).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)};},5787:function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e};},9670:function(e,t,n){var r=n(111);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e};},4019:function(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView;},260:function(e,t,n){"use strict";var r,i=n(4019),o=n(9781),a=n(7854),u=n(111),s=n(6656),l=n(648),c=n(8880),f=n(1320),p=n(3070).f,h=n(9518),d=n(7674),v=n(5112),y=n(9711),g=a.Int8Array,m=g&&g.prototype,b=a.Uint8ClampedArray,x=b&&b.prototype,w=g&&h(g),E=m&&h(m),k=Object.prototype,A=k.isPrototypeOf,S=v("toStringTag"),F=y("TYPED_ARRAY_TAG"),T=i&&!!d&&"Opera"!==l(a.opera),C=!1,L={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},R={BigInt64Array:8,BigUint64Array:8},I=function(e){if(!u(e))return !1;var t=l(e);return s(L,t)||s(R,t)};for(r in L)a[r]||(T=!1);if((!T||"function"!=typeof w||w===Function.prototype)&&(w=function(){throw TypeError("Incorrect invocation")},T))for(r in L)a[r]&&d(a[r],w);if((!T||!E||E===k)&&(E=w.prototype,T))for(r in L)a[r]&&d(a[r].prototype,E);if(T&&h(x)!==E&&d(x,E),o&&!s(E,S))for(r in C=!0,p(E,S,{get:function(){return u(this)?this[F]:void 0}}),L)a[r]&&c(a[r],F,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:T,TYPED_ARRAY_TAG:C&&F,aTypedArray:function(e){if(I(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(d){if(A.call(w,e))return e}else for(var t in L)if(s(L,r)){var n=a[t];if(n&&(e===n||A.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(o){if(n)for(var r in L){var i=a[r];i&&s(i.prototype,e)&&delete i.prototype[e];}E[e]&&!n||f(E,e,n?t:T&&m[e]||t);}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(o){if(d){if(n)for(r in L)(i=a[r])&&s(i,e)&&delete i[e];if(w[e]&&!n)return;try{return f(w,e,n?t:T&&g[e]||t)}catch(e){}}for(r in L)!(i=a[r])||i[e]&&!n||f(i,e,t);}},isView:function(e){if(!u(e))return !1;var t=l(e);return "DataView"===t||s(L,t)||s(R,t)},isTypedArray:I,TypedArray:w,TypedArrayPrototype:E};},3331:function(e,t,n){"use strict";var r=n(7854),i=n(9781),o=n(4019),a=n(8880),u=n(2248),s=n(7293),l=n(5787),c=n(9958),f=n(7466),p=n(7067),h=n(1179),d=n(9518),v=n(7674),y=n(8006).f,g=n(3070).f,m=n(1285),b=n(8003),x=n(9909),w=x.get,E=x.set,k="ArrayBuffer",A="DataView",S="Wrong index",F=r.ArrayBuffer,T=F,C=r.DataView,L=C&&C.prototype,R=Object.prototype,I=r.RangeError,U=h.pack,O=h.unpack,_=function(e){return [255&e]},M=function(e){return [255&e,e>>8&255]},z=function(e){return [255&e,e>>8&255,e>>16&255,e>>24&255]},P=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},j=function(e){return U(e,23,4)},D=function(e){return U(e,52,8)},N=function(e,t){g(e.prototype,t,{get:function(){return w(this)[t]}});},B=function(e,t,n,r){var i=p(n),o=w(e);if(i+t>o.byteLength)throw I(S);var a=w(o.buffer).bytes,u=i+o.byteOffset,s=a.slice(u,u+t);return r?s:s.reverse()},q=function(e,t,n,r,i,o){var a=p(n),u=w(e);if(a+t>u.byteLength)throw I(S);for(var s=w(u.buffer).bytes,l=a+u.byteOffset,c=r(+i),f=0;f<t;f++)s[l+f]=c[o?f:t-f-1];};if(o){if(!s((function(){F(1);}))||!s((function(){new F(-1);}))||s((function(){return new F,new F(1.5),new F(NaN),F.name!=k}
vendor: 15,142 bytes, line 19349
19349))){for(var W,H=(T=function(e){return l(this,T),new F(p(e))}).prototype=F.prototype,Y=y(F),G=0;Y.length>G;)(W=Y[G++])in T||a(T,W,F[W]);H.constructor=T;}v&&d(L)!==R&&v(L,R);var Q=new C(new T(2)),$=L.setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||u(L,{setInt8:function(e,t){$.call(this,e,t<<24>>24);},setUint8:function(e,t){$.call(this,e,t<<24>>24);}},{unsafe:!0});}else T=function(e){l(this,T,k);var t=p(e);E(this,{bytes:m.call(new Array(t),0),byteLength:t}),i||(this.byteLength=t);},C=function(e,t,n){l(this,C,A),l(e,T,A);var r=w(e).byteLength,o=c(t);if(o<0||o>r)throw I("Wrong offset");if(o+(n=void 0===n?r-o:f(n))>r)throw I("Wrong length");E(this,{buffer:e,byteLength:n,byteOffset:o}),i||(this.buffer=e,this.byteLength=n,this.byteOffset=o);},i&&(N(T,"byteLength"),N(C,"buffer"),N(C,"byteLength"),N(C,"byteOffset")),u(C.prototype,{getInt8:function(e){return B(this,1,e)[0]<<24>>24},getUint8:function(e){return B(this,1,e)[0]},getInt16:function(e){var t=B(this,2,e,arguments.length>1?arguments[1]:void 0);return (t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=B(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return P(B(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return P(B(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return O(B(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return O(B(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){q(this,1,e,_,t);},setUint8:function(e,t){q(this,1,e,_,t);},setInt16:function(e,t){q(this,2,e,M,t,arguments.length>2?arguments[2]:void 0);},setUint16:function(e,t){q(this,2,e,M,t,arguments.length>2?arguments[2]:void 0);},setInt32:function(e,t){q(this,4,e,z,t,arguments.length>2?arguments[2]:void 0);},setUint32:function(e,t){q(this,4,e,z,t,arguments.length>2?arguments[2]:void 0);},setFloat32:function(e,t){q(this,4,e,j,t,arguments.length>2?arguments[2]:void 0);},setFloat64:function(e,t){q(this,8,e,D,t,arguments.length>2?arguments[2]:void 0);}});b(T,k),b(C,A),e.exports={ArrayBuffer:T,DataView:C};},1048:function(e,t,n){"use strict";var r=n(7908),i=n(1400),o=n(7466),a=Math.min;e.exports=[].copyWithin||function(e,t){var n=r(this),u=o(n.length),s=i(e,u),l=i(t,u),c=arguments.length>2?arguments[2]:void 0,f=a((void 0===c?u:i(c,u))-l,u-s),p=1;for(l<s&&s<l+f&&(p=-1,l+=f-1,s+=f-1);f-- >0;)l in n?n[s]=n[l]:delete n[s],s+=p,l+=p;return n};},1285:function(e,t,n){"use strict";var r=n(7908),i=n(1400),o=n(7466);e.exports=function(e){for(var t=r(this),n=o(t.length),a=arguments.length,u=i(a>1?arguments[1]:void 0,n),s=a>2?arguments[2]:void 0,l=void 0===s?n:i(s,n);l>u;)t[u++]=e;return t};},8533:function(e,t,n){"use strict";var r=n(2092).forEach,i=n(9341)("forEach");e.exports=i?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)};},8457:function(e,t,n){"use strict";var r=n(9974),i=n(7908),o=n(3411),a=n(7659),u=n(7466),s=n(6135),l=n(1246);e.exports=function(e){var t,n,c,f,p,h,d=i(e),v="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,m=void 0!==g,b=l(d),x=0;if(m&&(g=r(g,y>2?arguments[2]:void 0,2)),null==b||v==Array&&a(b))for(n=new v(t=u(d.length));t>x;x++)h=m?g(d[x],x):d[x],s(n,x,h);else for(p=(f=b.call(d)).next,n=new v;!(c=p.call(f)).done;x++)h=m?o(f,g,[c.value,x],!0):c.value,s(n,x,h);return n.length=x,n};},1318:function(e,t,n){var r=n(5656),i=n(7466),o=n(1400),a=function(e){return function(t,n,a){var u,s=r(t),l=i(s.length),c=o(a,l);if(e&&n!=n){for(;l>c;)if((u=s[c++])!=u)return !0}else for(;l>c;c++)if((e||c in s)&&s[c]===n)return e||c||0;return !e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)};},2092:function(e,t,n){var r=n(9974),i=n(8361),o=n(7908),a=n(7466),u=n(5417),s=[].push,l=function(e){var t=1==e,n=2==e,l=3==e,c=4==e,f=6==e,p=7==e,h=5==e||f;return function(d,v,y,g){for(var m,b,x=o(d),w=i(x),E=r(v,y,3),k=a(w.length),A=0,S=g||u,F=t?S(d,k):n||p?S(d,0):void 0;k>A;A++)if((h||A in w)&&(b=E(m=w[A],A,x),e))if(t)F[A]=b;else if(b)switch(e){case 3:return !0;case 5:return m;case 6:return A;case 2:s.call(F,m);}else switch(e){case 4:return !1;case 7:s.call(F,m);}return f?-1:l||c?c:F}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterOut:l(7)};},6583:function(e,t,n){"use strict";var r=n(5656),i=n(9958),o=n(7466),a=n(9341),u=Math.min,s=[].lastIndexOf,l=!!s&&1/[1].lastIndexOf(1,-0)<0,c=a("lastIndexOf"),f=l||!c;e.exports=f?function(e){if(l)return s.apply(this,arguments)||0;var t=r(this),n=o(t.length),a=n-1;for(arguments.length>1&&(a=u(a,i(arguments[1]))),a<0&&(a=n+a);a>=0;a--)if(a in t&&t[a]===e)return a||0;return -1}:s;},1194:function(e,t,n){var r=n(7293),i=n(5112),o=n(7392),a=i("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return (t.constructor={})[a]=function(){return {foo:1}},1!==t[e](Boolean).foo}))};},9341:function(e,t,n){"use strict";var r=n(7293);e.exports=function(e,t){var n=[][e];return !!n&&r((function(){n.call(null,t||function(){throw 1},1);}))};},3671:function(e,t,n){var r=n(3099),i=n(7908),o=n(8361),a=n(7466),u=function(e){return function(t,n,u,s){r(n);var l=i(t),c=o(l),f=a(l.length),p=e?f-1:0,h=e?-1:1;if(u<2)for(;;){if(p in c){s=c[p],p+=h;break}if(p+=h,e?p<0:f<=p)throw TypeError("Reduce of empty array with no initial value")}for(;e?p>=0:f>p;p+=h)p in c&&(s=n(s,c[p],p,l));return s}};e.exports={left:u(!1),right:u(!0)};},5417:function(e,t,n){var r=n(111),i=n(3157),o=n(5112)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)};},3411:function(e,t,n){var r=n(9670),i=n(9212);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){throw i(e),t}};},7072:function(e,t,n){var r=n(5112)("iterator"),i=!1;try{var o=0,a={next:function(){return {done:!!o++}},return:function(){i=!0;}};a[r]=function(){return this},Array.from(a,(function(){throw 2}));}catch(e){}e.exports=function(e,t){if(!t&&!i)return !1;var n=!1;try{var o={};o[r]=function(){return {next:function(){return {done:n=!0}}}},e(o);}catch(e){}return n};},4326:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)};},648:function(e,t,n){var r=n(1694),i=n(4326),o=n(5112)("toStringTag"),a="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),o))?n:a?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r};},9920:function(e,t,n){var r=n(6656),i=n(3887),o=n(1236),a=n(3070);e.exports=function(e,t){for(var n=i(t),u=a.f,s=o.f,l=0;l<n.length;l++){var c=n[l];r(e,c)||u(e,c,s(t,c));}};},8544:function(e,t,n){var r=n(7293);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}));},4994:function(e,t,n){"use strict";var r=n(3383).IteratorPrototype,i=n(30),o=n(9114),a=n(8003),u=n(7497),s=function(){return this};e.exports=function(e,t,n){var l=t+" Iterator";return e.prototype=i(r,{next:o(1,n)}),a(e,l,!1,!0),u[l]=s,e};},8880:function(e,t,n){var r=n(9781),i=n(3070),o=n(9114);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e};},9114:function(e){e.exports=function(e,t){return {enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}};},6135:function(e,t,n){"use strict";var r=n(7593),i=n(3070),o=n(9114);e.exports=function(e,t,n){var a=r(t);a in e?i.f(e,a,o(0,n)):e[a]=n;};},654:function(e,t,n){"use strict";var r=n(2109),i=n(4994),o=n(9518),a=n(7674),u=n(8003),s=n(8880),l=n(1320),c=n(5112),f=n(1913),p=n(7497),h=n(3383),d=h.IteratorPrototype,v=h.BUGGY_SAFARI_ITERATORS,y=c("iterator"),g="keys",m="values",b="entries",x=function(){return this};e.exports=function(e,t,n,c,h,w,E){i(n,t,c);var k,A,S,F=function(e){if(e===h&&I)return I;if(!v&&e in L)return L[e];switch(e){case g:case m:case b:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",C=!1,L=e.prototype,R=L[y]||L["@@iterator"]||h&&L[h],I=!v&&R||F(h),U="Array"==t&&L.entries||R;if(U&&(k=o(U.call(new e)),d!==Object.prototype&&k.next&&(f||o(k)===d||(a?a(k,d):"function"!=typeof k[y]&&s(k,y,x)),u(k,T,!0,!0),f&&(p[T]=x))),h==m&&R&&R.name!==m&&(C=!0,I=function(){return R.call(this)}),f&&!E||L[y]===I||s(L,y,I),p[t]=I,h)if(A={values:F(m),keys:w?I:F(g),entries:F(b)},E)for(S in A)(v||C||!(S in L))&&l(L,S,A[S]);else r({target:t,proto:!0,forced:v||C},A);return A};},9781:function(e,t,n){var r=n(7293);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}));},317:function(e,t,n){var r=n(7854),i=n(111),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}};},8324:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};},8113:function(e,t,n){var r=n(5005);e.exports=r("navigator","userAgent")||"";},7392:function(e,t,n){var r,i,o=n(7854),a=n(8113),u=o.process,s=u&&u.versions,l=s&&s.v8;l?i=(r=l.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i;},748:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];},2109:function(e,t,n){var r=n(7854),i=n(1236).f,o=n(8880),a=n(1320),u=n(3505),s=n(9920),l=n(4705);e.exports=function(e,t){var n,c,f,p,h,d=e.target,v=e.global,y=e.stat;if(n=v?r:y?r[d]||u(d,{}):(r[d]||{}).prototype)for(c in t){if(p=t[c],f=e.noTargetGet?(h=i(n,c))&&h.value:n[c],!l(v?c:d+(y?".":"#")+c,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;s(p,f);}(e.sham||f&&f.sham)&&o(p,"sham",!0),a(n,c,p,e);}};},7293:function(e){e.exports=function(e){try{return !!e()}catch(e){return !0}};},7007:function(e,t,n){"use strict";n(4916);var r=n(1320),i=n(7293),o=n(5112),a=n(2261),u=n(8880),s=o("species"),l=!i((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),c="$0"==="a".replace(/./,"$0"),f=o("replace"),p=!!/./[f]&&""===/./[f]("a","$0"),h=!i((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));e.exports=function(e,t,n,f){var d=o(e),v=!i((function(){var t={};return t[d]=function(){return 7},7!=""[e](t)})),y=v&&!i((function(){var t=!1,n=/a/;return "split"===e&&((n={}).constructor={},n.constructor[s]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return t=!0,null},n[d](""),!t}));if(!v||!y||"replace"===e&&(!l||!c||p)||"split"===e&&!h){var g=/./[d],m=n(d,""[e],(function(e,t,n,r,i){return t.exec===a?v&&!i?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:c,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=m[0],x=m[1];r(String.prototype,e,b),r(RegExp.prototype,d,2==t?function(e,t){return x.call(e,this,t)}:function(e){return x.call(e,this)});}f&&u(RegExp.prototype[d],"sham",!0);};},9974:function(e,t,n){var r=n(3099);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}};},5005:function(e,t,n){var r=n(857),i=n(7854),o=function(e){return "function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]};},1246:function(e,t,n){var r=n(648),i=n(7497),o=n(5112)("iterator");e.exports=function(e){if(null!=e)return e[o]||e["@@iterator"]||i[r(e)]};},8554:function(e,t,n){var r=n(9670),i=n(1246);e.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))};},647:function(e,t,n){var r=n(7908),i=Math.floor,o="".replace,a=/\$([$&'`]|\d\d?|<[^>]*>)/g,u=/\$([$&'`]|\d\d?)/g;e.exports=function(e,t,n,s,l,c){var f=n+e.length,p=s.length,h=u;return void 0!==l&&(l=r(l),h=a),o.call(c,h,(function(r,o){var a;switch(o.charAt(0)){case"$":return "$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(f);case"<":a=l[o.slice(1,-1)];break;default:var u=+o;if(0===u)return r;if(u>p){var c=i(u/10);return 0===c?r:c<=p?void 0===s[c-1]?o.charAt(1):s[c-1]+o.charAt(1):r}a=s[u-1];}return void 0===a?"":a}))};},7854:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")();},6656:function(e){var t={}.hasOwnProperty;e.exports=function(e,n){return t.call(e,n)};},3501:function(e){e.exports={};},490:function(e,t,n){var r=n(5005);e.exports=r("document","documentElement");},4664:function(e,t,n){var r=n(9781),i=n(7293),o=n(317);e.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}));},1179:function(e){var t=Math.abs,n=Math.pow,r=Math.floor,i=Math.log,o=Math.LN2;e.exports={pack:function(e,a,u){var s,l,c,f=new Array(u),p=8*u-a-1,h=(1<<p)-1,d=h>>1,v=23===a?n(2,-24)-n(2,-77):0,y=e<0||0===e&&1/e<0?1:0,g=0;for((e=t(e))!=e||e===1/0?(l=e!=e?1:0,s=h):(s=r(i(e)/o),e*(c=n(2,-s))<1&&(s--,c*=2),(e+=s+d>=1?v/c:v*n(2,1-d))*c>=2&&(s++,c/=2),s+d>=h?(l=0,s=h):s+d>=1?(l=(e*c-1)*n(2,a),s+=d):(l=e*n(2,d-1)*n(2,a),s=0));a>=8;f[g++]=255&l,l/=256,a-=8);for(s=s<<a|l,p+=a;p>0;f[g++]=255&s,s/=256,p-=8);return f[--g]|=128*y,f},unpack:function(e,t){var r,i=e.length,o=8*i-t-1,a=(1<<o)-1,u=a>>1,s=o-7,l=i-1,c=e[l--],f=127&c;for(c>>=7;s>0;f=256*f+e[l],l--,s-=8);for(r=f&(1<<-s)-1,f>>=-s,s+=t;s>0;r=256*r+e[l],l--,s-=8);if(0===f)f=1-u;else {if(f===a)return r?NaN:c?-1/0:1/0;r+=n(2,t),f-=u;}return (c?-1:1)*r*n(2,f-t)}};},8361:function(e,t,n){var r=n(7293),i=n(4326),o="".split;e.exports=r((function(){return !Object("z").propertyIsEnumerable(0)}))?function(e){return "String"==i(e)?o.call(e,""):Object(e)}:Object;},9587:function(e,t,n){var r=n(111),i=n(7674);e.exports=function(e,t,n){var o,a;return i&&"function"==typeof(o=t.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(e,a),e};},2788:function(e,t,n){var r=n(5465),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource;},9909:function(e,t,n){var r,i,o,a=n(8536),u=n(7854),s=n(111),l=n(8880),c=n(6656),f=n(5465),p=n(6200),h=n(3501),d=u.WeakMap;if(a){var v=f.state||(f.state=new d),y=v.get,g=v.has,m=v.set;r=function(e,t){return t.facade=e,m.call(v,e,t),t}
19349,i=function(e){return y.call(v,e)||{}},o=function(e){return g.call(v,e)};}else {var b=p("state");h[b]=!0,r=function(e,t){return t.facade=e,l(e,b,t),t},i=function(e){return c(e,b)?e[b]:{}},o=function(e){return c(e,b)};}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}};},7659:function(e,t,n){var r=n(5112),i=n(7497),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)};},3157:function(e,t,n){var r=n(4326);e.exports=Array.isArray||function(e){return "Array"==r(e)};},4705:function(e,t,n){var r=n(7293),i=/#|\.prototype\./,o=function(e,t){var n=u[a(e)];return n==l||n!=s&&("function"==typeof t?r(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=o.data={},s=o.NATIVE="N",l=o.POLYFILL="P";e.exports=o;},111:function(e){e.exports=function(e){return "object"==typeof e?null!==e:"function"==typeof e};},1913:function(e){e.exports=!1;},7850:function(e,t,n){var r=n(111),i=n(4326),o=n(5112)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))};},9212:function(e,t,n){var r=n(9670);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value};},3383:function(e,t,n){"use strict";var r,i,o,a=n(7293),u=n(9518),s=n(8880),l=n(6656),c=n(5112),f=n(1913),p=c("iterator"),h=!1;[].keys&&("next"in(o=[].keys())?(i=u(u(o)))!==Object.prototype&&(r=i):h=!0);var d=null==r||a((function(){var e={};return r[p].call(e)!==e}));d&&(r={}),f&&!d||l(r,p)||s(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h};},7497:function(e){e.exports={};},133:function(e,t,n){var r=n(7293);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return !String(Symbol())}));},590:function(e,t,n){var r=n(7293),i=n(5112),o=n(1913),a=i("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e;})),o&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://ÑеÑÑ").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}));},8536:function(e,t,n){var r=n(7854),i=n(2788),o=r.WeakMap;e.exports="function"==typeof o&&/native code/.test(i(o));},1574:function(e,t,n){"use strict";var r=n(9781),i=n(7293),o=n(1956),a=n(5181),u=n(5296),s=n(7908),l=n(8361),c=Object.assign,f=Object.defineProperty;e.exports=!c||i((function(){if(r&&1!==c({b:1},c(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1});}}),{b:2})).b)return !0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e;})),7!=c({},e)[n]||o(c({},t)).join("")!=i}))?function(e,t){for(var n=s(e),i=arguments.length,c=1,f=a.f,p=u.f;i>c;)for(var h,d=l(arguments[c++]),v=f?o(d).concat(f(d)):o(d),y=v.length,g=0;y>g;)h=v[g++],r&&!p.call(d,h)||(n[h]=d[h]);return n}:c;},30:function(e,t,n){var r,i=n(9670),o=n(6048),a=n(748),u=n(3501),s=n(490),l=n(317),c=n(6200)("IE_PROTO"),f=function(){},p=function(e){return "<script>"+e+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile");}catch(e){}var e,t;h=r?function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=l("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F);for(var n=a.length;n--;)delete h.prototype[a[n]];return h()};u[c]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=i(e),n=new f,f.prototype=null,n[c]=e):n=h(),void 0===t?n:o(n,t)};},6048:function(e,t,n){var r=n(9781),i=n(3070),o=n(9670),a=n(1956);e.exports=r?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),u=r.length,s=0;u>s;)i.f(e,n=r[s++],t[n]);return e};},3070:function(e,t,n){var r=n(9781),i=n(4664),o=n(9670),a=n(7593),u=Object.defineProperty;t.f=r?u:function(e,t,n){if(o(e),t=a(t,!0),o(n),i)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return "value"in n&&(e[t]=n.value),e};},1236:function(e,t,n){var r=n(9781),i=n(5296),o=n(9114),a=n(5656),u=n(7593),s=n(6656),l=n(4664),c=Object.getOwnPropertyDescriptor;t.f=r?c:function(e,t){if(e=a(e),t=u(t,!0),l)try{return c(e,t)}catch(e){}if(s(e,t))return o(!i.f.call(e,t),e[t])};},8006:function(e,t,n){var r=n(6324),i=n(748).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)};},5181:function(e,t){t.f=Object.getOwnPropertySymbols;},9518:function(e,t,n){var r=n(6656),i=n(7908),o=n(6200),a=n(8544),u=o("IE_PROTO"),s=Object.prototype;e.exports=a?Object.getPrototypeOf:function(e){return e=i(e),r(e,u)?e[u]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?s:null};},6324:function(e,t,n){var r=n(6656),i=n(5656),o=n(1318).indexOf,a=n(3501);e.exports=function(e,t){var n,u=i(e),s=0,l=[];for(n in u)!r(a,n)&&r(u,n)&&l.push(n);for(;t.length>s;)r(u,n=t[s++])&&(~o(l,n)||l.push(n));return l};},1956:function(e,t,n){var r=n(6324),i=n(748);e.exports=Object.keys||function(e){return r(e,i)};},5296:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return !!t&&t.enumerable}:n;},7674:function(e,t,n){var r=n(9670),i=n(6077);
19349e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array;}catch(e){}return function(n,o){return r(n),i(o),t?e.call(n,o):n.__proto__=o,n}}():void 0);},288:function(e,t,n){"use strict";var r=n(1694),i=n(648);e.exports=r?{}.toString:function(){return "[object "+i(this)+"]"};},3887:function(e,t,n){var r=n(5005),i=n(8006),o=n(5181),a=n(9670);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?t.concat(n(e)):t};},857:function(e,t,n){var r=n(7854);e.exports=r;},2248:function(e,t,n){var r=n(1320);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e};},1320:function(e,t,n){var r=n(7854),i=n(8880),o=n(6656),a=n(3505),u=n(2788),s=n(9909),l=s.get,c=s.enforce,f=String(String).split("String");(e.exports=function(e,t,n,u){var s,l=!!u&&!!u.unsafe,p=!!u&&!!u.enumerable,h=!!u&&!!u.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||i(n,"name",t),(s=c(n)).source||(s.source=f.join("string"==typeof t?t:""))),e!==r?(l?!h&&e[t]&&(p=!0):delete e[t],p?e[t]=n:i(e,t,n)):p?e[t]=n:a(t,n);})(Function.prototype,"toString",(function(){return "function"==typeof this&&l(this).source||u(this)}));},7651:function(e,t,n){var r=n(4326),i=n(2261);e.exports=function(e,t){var n=e.exec;if("function"==typeof n){var o=n.call(e,t);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==r(e))throw TypeError("RegExp#exec called on incompatible receiver");return i.call(e,t)};},2261:function(e,t,n){"use strict";var r,i,o=n(7066),a=n(2999),u=RegExp.prototype.exec,s=String.prototype.replace,l=u,c=(r=/a/,i=/b*/g,u.call(r,"a"),u.call(i,"a"),0!==r.lastIndex||0!==i.lastIndex),f=a.UNSUPPORTED_Y||a.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(c||p||f)&&(l=function(e){var t,n,r,i,a=this,l=f&&a.sticky,h=o.call(a),d=a.source,v=0,y=e;return l&&(-1===(h=h.replace("y","")).indexOf("g")&&(h+="g"),y=String(e).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==e[a.lastIndex-1])&&(d="(?: "+d+")",y=" "+y,v++),n=new RegExp("^(?:"+d+")",h)),p&&(n=new RegExp("^"+d+"$(?!\\s)",h)),c&&(t=a.lastIndex),r=u.call(l?n:a,y),l?r?(r.input=r.input.slice(v),r[0]=r[0].slice(v),r.index=a.lastIndex,a.lastIndex+=r[0].length):a.lastIndex=0:c&&r&&(a.lastIndex=a.global?r.index+r[0].length:t),p&&r&&r.length>1&&s.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0);})),r}),e.exports=l;},7066:function(e,t,n){"use strict";var r=n(9670);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};},2999:function(e,t,n){"use strict";var r=n(7293);function i(e,t){return RegExp(e,t)}t.UNSUPPORTED_Y=r((function(){var e=i("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),t.BROKEN_CARET=r((function(){var e=i("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));},4488:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e};},3505:function(e,t,n){var r=n(7854),i=n(8880);e.exports=function(e,t){try{i(r,e,t);}catch(n){r[e]=t;}return t};},6340:function(e,t,n){"use strict";var r=n(5005),i=n(3070),o=n(5112),a=n(9781),u=o("species");e.exports=function(e){var t=r(e),n=i.f;a&&t&&!t[u]&&n(t,u,{configurable:!0,get:function(){return this}});};},8003:function(e,t,n){var r=n(3070).f,i=n(6656),o=n(5112)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t});};},6200:function(e,t,n){var r=n(2309),i=n(9711),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))};},5465:function(e,t,n){var r=n(7854),i=n(3505),o="__core-js_shared__",a=r[o]||i(o,{});e.exports=a;},2309:function(e,t,n){var r=n(1913),i=n(5465);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.9.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});},6707:function(e,t,n){var r=n(9670),i=n(3099),o=n(5112)("species");e.exports=function(e,t){var n,a=r(e).constructor;return void 0===a||null==(n=r(a)[o])?t:i(n)};},8710:function(e,t,n){var r=n(9958),i=n(4488),o=function(e){return function(t,n){var o,a,u=String(i(t)),s=r(n),l=u.length;return s<0||s>=l?e?"":void 0:(o=u.charCodeAt(s))<55296||o>56319||s+1===l||(a=u.charCodeAt(s+1))<56320||a>57343?e?u.charAt(s):o:e?u.slice(s,s+2):a-56320+(o-55296<<10)+65536}};e.exports={codeAt:o(!1),charAt:o(!0)};},3197:function(e){"use strict";
vendor: 18,739 bytes, line 19349
19349var t=2147483647,n=/[^\0-\u007E]/,r=/[.\u3002\uFF0E\uFF61]/g,i="Overflow: input needs wider integers to process",o=Math.floor,a=String.fromCharCode,u=function(e){return e+22+75*(e<26)},s=function(e,t,n){var r=0;for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},l=function(e){var n,r,l=[],c=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),n--);}else t.push(i);}return t}(e)).length,f=128,p=0,h=72;for(n=0;n<e.length;n++)(r=e[n])<128&&l.push(a(r));var d=l.length,v=d;for(d&&l.push("-");v<c;){var y=t;for(n=0;n<e.length;n++)(r=e[n])>=f&&r<y&&(y=r);var g=v+1;if(y-f>o((t-p)/g))throw RangeError(i);for(p+=(y-f)*g,f=y,n=0;n<e.length;n++){if((r=e[n])<f&&++p>t)throw RangeError(i);if(r==f){for(var m=p,b=36;;b+=36){var x=b<=h?1:b>=h+26?26:b-h;if(m<x)break;var w=m-x,E=36-x;l.push(a(u(x+w%E))),m=o(w/E);}l.push(a(u(m))),h=s(p,g,v==d),p=0,++v;}}++p,++f;}return l.join("")};e.exports=function(e){var t,i,o=[],a=e.toLowerCase().replace(r,".").split(".");for(t=0;t<a.length;t++)i=a[t],o.push(n.test(i)?"xn--"+l(i):i);return o.join(".")};},6091:function(e,t,n){var r=n(7293),i=n(1361);e.exports=function(e){return r((function(){return !!i[e]()||"âÂ
á "!="âÂ
á "[e]()||i[e].name!==e}))};},3111:function(e,t,n){var r=n(4488),i="["+n(1361)+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),u=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(o,"")),2&e&&(n=n.replace(a,"")),n}};e.exports={start:u(1),end:u(2),trim:u(3)};},1400:function(e,t,n){var r=n(9958),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)};},7067:function(e,t,n){var r=n(9958),i=n(7466);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length or index");return n};},5656:function(e,t,n){var r=n(8361),i=n(4488);e.exports=function(e){return r(i(e))};},9958:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)};},7466:function(e,t,n){var r=n(9958),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0};},7908:function(e,t,n){var r=n(4488);e.exports=function(e){return Object(r(e))};},4590:function(e,t,n){var r=n(3002);e.exports=function(e,t){var n=r(e);if(n%t)throw RangeError("Wrong offset");return n};},3002:function(e,t,n){var r=n(9958);e.exports=function(e){var t=r(e);if(t<0)throw RangeError("The argument can't be less than 0");return t};},7593:function(e,t,n){var r=n(111);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")};},1694:function(e,t,n){var r={};r[n(5112)("toStringTag")]="z",e.exports="[object z]"===String(r);},9843:function(e,t,n){"use strict";var r=n(2109),i=n(7854),o=n(9781),a=n(3832),u=n(260),s=n(3331),l=n(5787),c=n(9114),f=n(8880),p=n(7466),h=n(7067),d=n(4590),v=n(7593),y=n(6656),g=n(648),m=n(111),b=n(30),x=n(7674),w=n(8006).f,E=n(7321),k=n(2092).forEach,A=n(6340),S=n(3070),F=n(1236),T=n(9909),C=n(9587),L=T.get,R=T.set,I=S.f,U=F.f,O=Math.round,_=i.RangeError,M=s.ArrayBuffer,z=s.DataView,P=u.NATIVE_ARRAY_BUFFER_VIEWS,j=u.TYPED_ARRAY_TAG,D=u.TypedArray,N=u.TypedArrayPrototype,B=u.aTypedArrayConstructor,q=u.isTypedArray,W="BYTES_PER_ELEMENT",H="Wrong length",Y=function(e,t){for(var n=0,r=t.length,i=new(B(e))(r);r>n;)i[n]=t[n++];return i},G=function(e,t){I(e,t,{get:function(){return L(this)[t]}});},Q=function(e){var t;return e instanceof M||"ArrayBuffer"==(t=g(e))||"SharedArrayBuffer"==t},$=function(e,t){return q(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},V=function(e,t){return $(e,t=v(t,!0))?c(2,e[t]):U(e,t)},X=function(e,t,n){return !($(e,t=v(t,!0))&&m(n)&&y(n,"value"))||y(n,"get")||y(n,"set")||n.configurable||y(n,"writable")&&!n.writable||y(n,"enumerable")&&!n.enumerable?I(e,t,n):(e[t]=n.value,e)};o?(P||(F.f=V,S.f=X,G(N,"buffer"),G(N,"byteOffset"),G(N,"byteLength"),G(N,"length")),r({target:"Object",stat:!0,forced:!P},{getOwnPropertyDescriptor:V,defineProperty:X}),e.exports=function(e,t,n){var o=e.match(/\d+$/)[0]/8,u=e+(n?"Clamped":"")+"Array",s="get"+e,c="set"+e,v=i[u],y=v,g=y&&y.prototype,S={},F=function(e,t){I(e,t,{get:function(){return function(e,t){var n=L(e);return n.view[s](t*o+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=L(e);n&&(r=(r=O(r))<0?0:r>255?255:255&r),i.view[c](t*o+i.byteOffset,r,!0);}(this,t,e)},enumerable:!0});};P?a&&(y=t((function(e,t,n,r){return l(e,y,u),C(m(t)?Q(t)?void 0!==r?new v(t,d(n,o),r):void 0!==n?new v(t,d(n,o)):new v(t):q(t)?Y(y,t):E.call(y,t):new v(h(t)),e,y)})),x&&x(y,D),k(w(v),(function(e){e in y||f(y,e,v[e]);})),y.prototype=g):(y=t((function(e,t,n,r){l(e,y,u);var i,a,s,c=0,f=0;if(m(t)){if(!Q(t))return q(t)?Y(y,t):E.call(y,t);i=t,f=d(n,o);var v=t.byteLength;if(void 0===r){if(v%o)throw _(H);if((a=v-f)<0)throw _(H)}else if((a=p(r)*o)+f>v)throw _(H);s=a/o;}else s=h(t),i=new M(a=s*o);for(R(e,{buffer:i,byteOffset:f,byteLength:a,length:s,view:new z(i)});c<s;)F(e,c++);})),x&&x(y,D),g=y.prototype=b(N)),g.constructor!==y&&f(g,"constructor",y),j&&f(g,j,u),S[u]=y,r({global:!0,forced:y!=v,sham:!P},S),W in y||f(y,W,o),W in g||f(g,W,o),A(u);}):e.exports=function(){};},3832:function(e,t,n){var r=n(7854),i=n(7293),o=n(7072),a=n(260).NATIVE_ARRAY_BUFFER_VIEWS,u=r.ArrayBuffer,s=r.Int8Array;e.exports=!a||!i((function(){s(1);}))||!i((function(){new s(-1);}))||!o((function(e){new s,new s(null),new s(1.5),new s(e);}),!0)||i((function(){return 1!==new s(new u(2),1,void 0).length}));},3074:function(e,t,n){var r=n(260).aTypedArrayConstructor,i=n(6707);e.exports=function(e,t){for(var n=i(e,e.constructor),o=0,a=t.length,u=new(r(n))(a);a>o;)u[o]=t[o++];return u};},7321:function(e,t,n){var r=n(7908),i=n(7466),o=n(1246),a=n(7659),u=n(9974),s=n(260).aTypedArrayConstructor;e.exports=function(e){var t,n,l,c,f,p,h=r(e),d=arguments.length,v=d>1?arguments[1]:void 0,y=void 0!==v,g=o(h);if(null!=g&&!a(g))for(p=(f=g.call(h)).next,h=[];!(c=p.call(f)).done;)h.push(c.value);for(y&&d>2&&(v=u(v,arguments[2],2)),n=i(h.length),l=new(s(this))(n),t=0;n>t;t++)l[t]=y?v(h[t],t):h[t];return l};},9711:function(e){var t=0,n=Math.random();e.exports=function(e){return "Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)};},3307:function(e,t,n){var r=n(133);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator;},5112:function(e,t,n){var r=n(7854),i=n(2309),o=n(6656),a=n(9711),u=n(133),s=n(3307),l=i("wks"),c=r.Symbol,f=s?c:c&&c.withoutSetter||a;e.exports=function(e){return o(l,e)||(u&&o(c,e)?l[e]=c[e]:l[e]=f("Symbol."+e)),l[e]};},1361:function(e){e.exports="\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff";},8264:function(e,t,n){"use strict";var r=n(2109),i=n(7854),o=n(3331),a=n(6340),u=o.ArrayBuffer;r({global:!0,forced:i.ArrayBuffer!==u},{ArrayBuffer:u}),a("ArrayBuffer");},2222:function(e,t,n){"use strict";var r=n(2109),i=n(7293),o=n(3157),a=n(111),u=n(7908),s=n(7466),l=n(6135),c=n(5417),f=n(1194),p=n(5112),h=n(7392),d=p("isConcatSpreadable"),v=9007199254740991,y="Maximum allowed index exceeded",g=h>=51||!i((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),m=f("concat"),b=function(e){if(!a(e))return !1;var t=e[d];return void 0!==t?!!t:o(e)};r({target:"Array",proto:!0,forced:!g||!m},{concat:function(e){var t,n,r,i,o,a=u(this),f=c(a,0),p=0;for(t=-1,r=arguments.length;t<r;t++)if(b(o=-1===t?a:arguments[t])){if(p+(i=s(o.length))>v)throw TypeError(y);for(n=0;n<i;n++,p++)n in o&&l(f,p,o[n]);}else {if(p>=v)throw TypeError(y);l(f,p++,o);}return f.length=p,f}});},7327:function(e,t,n){"use strict";var r=n(2109),i=n(2092).filter;r({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}});},2772:function(e,t,n){"use strict";var r=n(2109),i=n(1318).indexOf,o=n(9341),a=[].indexOf,u=!!a&&1/[1].indexOf(1,-0)<0,s=o("indexOf");r({target:"Array",proto:!0,forced:u||!s},{indexOf:function(e){return u?a.apply(this,arguments)||0:i(this,e,arguments.length>1?arguments[1]:void 0)}});},6992:function(e,t,n){"use strict";var r=n(5656),i=n(1223),o=n(7497),a=n(9909),u=n(654),s="Array Iterator",l=a.set,c=a.getterFor(s);e.exports=u(Array,"Array",(function(e,t){l(this,{type:s,target:r(e),index:0,kind:t});}),(function(){var e=c(this),t=e.target,n=e.kind,r=e.index++;return !t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries");},1249:function(e,t,n){"use strict";var r=n(2109),i=n(2092).map;r({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}});},7042:function(e,t,n){"use strict";var r=n(2109),i=n(111),o=n(3157),a=n(1400),u=n(7466),s=n(5656),l=n(6135),c=n(5112),f=n(1194)("slice"),p=c("species"),h=[].slice,d=Math.max;r({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var n,r,c,f=s(this),v=u(f.length),y=a(e,v),g=a(void 0===t?v:t,v);if(o(f)&&("function"!=typeof(n=f.constructor)||n!==Array&&!o(n.prototype)?i(n)&&null===(n=n[p])&&(n=void 0):n=void 0,n===Array||void 0===n))return h.call(f,y,g);for(r=new(void 0===n?Array:n)(d(g-y,0)),c=0;y<g;y++,c++)y in f&&l(r,c,f[y]);return r.length=c,r}});},561:function(e,t,n){"use strict";var r=n(2109),i=n(1400),o=n(9958),a=n(7466),u=n(7908),s=n(5417),l=n(6135),c=n(1194)("splice"),f=Math.max,p=Math.min,h=9007199254740991,d="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!c},{splice:function(e,t){var n,r,c,v,y,g,m=u(this),b=a(m.length),x=i(e,b),w=arguments.length;if(0===w?n=r=0:1===w?(n=0,r=b-x):(n=w-2,r=p(f(o(t),0),b-x)),b+n-r>h)throw TypeError(d);for(c=s(m,r),v=0;v<r;v++)(y=x+v)in m&&l(c,v,m[y]);if(c.length=r,n<r){for(v=x;v<b-r;v++)g=v+n,(y=v+r)in m?m[g]=m[y]:delete m[g];for(v=b;v>b-r+n;v--)delete m[v-1];}else if(n>r)for(v=b-r;v>x;v--)g=v+n-1,(y=v+r-1)in m?m[g]=m[y]:delete m[g];for(v=0;v<n;v++)m[v+x]=arguments[v+2];return m.length=b-r+n,c}});},8309:function(e,t,n){var r=n(9781),i=n(3070).f,o=Function.prototype,a=o.toString,u=/^\s*function ([^ (]*)/,s="name";r&&!(s in o)&&i(o,s,{configurable:!0,get:function(){try{return a.call(this).match(u)[1]}catch(e){return ""}}});},489:function(e,t,n){var r=n(2109),i=n(7293),o=n(7908),a=n(9518),u=n(8544);r({target:"Object",stat:!0,forced:i((function(){a(1);})),sham:!u},{getPrototypeOf:function(e){return a(o(e))}});},1539:function(e,t,n){var r=n(1694),i=n(1320),o=n(288);r||i(Object.prototype,"toString",o,{unsafe:!0});},4916:function(e,t,n){"use strict";var r=n(2109),i=n(2261);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i});},9714:function(e,t,n){"use strict";var r=n(1320),i=n(9670),o=n(7293),a=n(7066),u="toString",s=RegExp.prototype,l=s.toString,c=o((function(){return "/a/b"!=l.call({source:"a",flags:"b"})})),f=l.name!=u;(c||f)&&r(RegExp.prototype,u,(function(){var e=i(this),t=String(e.source),n=e.flags;return "/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in s)?a.call(e):n)}),{unsafe:!0});},8783:function(e,t,n){"use strict";var r=n(8710).charAt,i=n(9909),o=n(654),a="String Iterator",u=i.set,s=i.getterFor(a);o(String,"String",(function(e){u(this,{type:a,string:String(e),index:0});}),(function(){var e,t=s(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})}));},4723:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7466),a=n(4488),u=n(1530),s=n(7651);r("match",1,(function(e,t,n){return [function(t){var n=a(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var a=i(e),l=String(this);if(!a.global)return s(a,l);var c=a.unicode;a.lastIndex=0;for(var f,p=[],h=0;null!==(f=s(a,l));){var d=String(f[0]);p[h]=d,""===d&&(a.lastIndex=u(l,o(a.lastIndex),c)),h++;}return 0===h?null:p}]}));},5306:function(e,t,n){"use strict";var r=n(7007),i=n(9670),o=n(7466),a=n(9958),u=n(4488),s=n(1530),l=n(647),c=n(7651),f=Math.max,p=Math.min;r("replace",2,(function(e,t,n,r){var h=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,d=r.REPLACE_KEEPS_$0,v=h?"$":"$0";return [function(n,r){var i=u(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!h&&d||"string"==typeof r&&-1===r.indexOf(v)){var u=n(t,e,this,r);if(u.done)return u.value}var y=i(e),g=String(this),m="function"==typeof r;m||(r=String(r));var b=y.global;if(b){var x=y.unicode;y.lastIndex=0;}for(var w=[];;){var E=c(y,g);if(null===E)break;if(w.push(E),!b)break;""===String(E[0])&&(y.lastIndex=s(g,o(y.lastIndex),x));}for(var k,A="",S=0,F=0;F<w.length;F++){E=w[F];for(var T=String(E[0]),C=f(p(a(E.index),g.length),0),L=[],R=1;R<E.length;R++)L.push(void 0===(k=E[R])?k:String(k));var I=E.groups;if(m){var U=[T].concat(L,C,g);void 0!==I&&U.push(I);var O=String(r.apply(void 0,U));}else O=l(T,g,C,L,I,r);C>=S&&(A+=g.slice(S,C)+O,S=C+T.length);}return A+g.slice(S)}]}));},3123:function(e,t,n){"use strict";var r=n(7007),i=n(7850),o=n(9670),a=n(4488),u=n(6707),s=n(1530),l=n(7466),c=n(7651),f=n(2261),p=n(7293),h=[].push,d=Math.min,v=4294967295,y=!p((function(){return !RegExp(v,"y")}));r("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(a(this)),o=void 0===n?v:n>>>0;if(0===o)return [];if(void 0===e)return [r];if(!i(e))return t.call(r,e,o);for(var u,s,l,c=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,y=new RegExp(e.source,p+"g");(u=f.call(y,r))&&!((s=y.lastIndex)>d&&(c.push(r.slice(d,u.index)),u.length>1&&u.index<r.length&&h.apply(c,u.slice(1)),l=u[0].length,d=s,c.length>=o));)y.lastIndex===u.index&&y.lastIndex++;return d===r.length?!l&&y.test("")||c.push(""):c.push(r.slice(d)),c.length>o?c.slice(0,o):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=a(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var a=n(r,e,this,i,r!==t);if(a.done)return a.value;var f=o(e),p=String(this),h=u(f,RegExp),g=f.unicode,m=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(y?"y":"g"),b=new h(y?f:"^(?:"+f.source+")",m),x=void 0===i?v:i>>>0;if(0===x)return [];if(0===p.length)return null===c(b,p)?[p]:[];for(var w=0,E=0,k=[];E<p.length;){b.lastIndex=y?E:0;var A,S=c(b,y?p:p.slice(E));if(null===S||(A=d(l(b.lastIndex+(y?0:E)),p.length))===w)E=s(p,E,g);else {if(k.push(p.slice(w,E)),k.length===x)return k;for(var F=1;F<=S.length-1;F++)if(k.push(S[F]),k.length===x)return k;E=w=A;}}return k.push(p.slice(w)),k}]}),!y);},3210:function(e,t,n){"use strict";var r=n(2109),i=n(3111).trim;r({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return i(this)}});},2990:function(e,t,n){"use strict";var r=n(260),i=n(1048),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("copyWithin",(function(e,t){return i.call(o(this),e,t,arguments.length>2?arguments[2]:void 0)}));},8927:function(e,t,n){"use strict";var r=n(260),i=n(2092).every,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},3105:function(e,t,n){"use strict";var r=n(260),i=n(1285),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("fill",(function(e){return i.apply(o(this),arguments)}));},5035:function(e,t,n){"use strict";var r=n(260),i=n(2092).filter,o=n(3074),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(e){var t=i(a(this),e,arguments.length>1?arguments[1]:void 0);return o(this,t)}));},7174:function(e,t,n){"use strict";var r=n(260),i=n(2092).findIndex,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},4345:function(e,t,n){"use strict";var r=n(260),i=n(2092).find,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},2846:function(e,t,n){"use strict";var r=n(260),i=n(2092).forEach,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(e){i(o(this),e,arguments.length>1?arguments[1]:void 0);}));},4731:function(e,t,n){"use strict";var r=n(260),i=n(1318).includes,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},7209:function(e,t,n){"use strict";var r=n(260),i=n(1318).indexOf,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},6319:function(e,t,n){"use strict";var r=n(7854),i=n(260),o=n(6992),a=n(5112)("iterator"),u=r.Uint8Array,s=o.values,l=o.keys,c=o.entries,f=i.aTypedArray,p=i.exportTypedArrayMethod,h=u&&u.prototype[a],d=!!h&&("values"==h.name||null==h.name),v=function(){return s.call(f(this))};p("entries",(function(){return c.call(f(this))})),p("keys",(function(){return l.call(f(this))})),p("values",v,!d),p(a,v,!d);},8867:function(e,t,n){"use strict";var r=n(260),i=r.aTypedArray,o=r.exportTypedArrayMethod,a=[].join;o("join",(function(e){return a.apply(i(this),arguments)}));},7789:function(e,t,n){"use strict";var r=n(260),i=n(6583),o=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(e){return i.apply(o(this),arguments)}));},3739:function(e,t,n){"use strict";var r=n(260),i=n(2092).map,o=n(6707),a=r.aTypedArray,u=r.aTypedArrayConstructor;(0,r.exportTypedArrayMethod)("map",(function(e){return i(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(u(o(e,e.constructor)))(t)}))}));},4483:function(e,t,n){"use strict";var r=n(260),i=n(3671).right,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(e){return i(o(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));},9368:function(e,t,n){"use strict";var r=n(260),i=n(3671).left,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(e){return i(o(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));},2056:function(e,t,n){"use strict";var r=n(260),i=r.aTypedArray,o=r.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){for(var e,t=this,n=i(t).length,r=a(n/2),o=0;o<r;)e=t[o],t[o++]=t[--n],t[n]=e;return t}));},3462:function(e,t,n){"use strict";var r=n(260),i=n(7466),o=n(4590),a=n(7908),u=n(7293),s=r.aTypedArray;(0,r.exportTypedArrayMethod)("set",(function(e){s(this);var t=o(arguments.length>
193491?arguments[1]:void 0,1),n=this.length,r=a(e),u=i(r.length),l=0;if(u+t>n)throw RangeError("Wrong length");for(;l<u;)this[t+l]=r[l++];}),u((function(){new Int8Array(1).set({});})));},678:function(e,t,n){"use strict";var r=n(260),i=n(6707),o=n(7293),a=r.aTypedArray,u=r.aTypedArrayConstructor,s=r.exportTypedArrayMethod,l=[].slice;s("slice",(function(e,t){for(var n=l.call(a(this),e,t),r=i(this,this.constructor),o=0,s=n.length,c=new(u(r))(s);s>o;)c[o]=n[o++];return c}),o((function(){new Int8Array(1).slice();})));},7462:function(e,t,n){"use strict";var r=n(260),i=n(2092).some,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(e){return i(o(this),e,arguments.length>1?arguments[1]:void 0)}));},3824:function(e,t,n){"use strict";var r=n(260),i=r.aTypedArray,o=r.exportTypedArrayMethod,a=[].sort;o("sort",(function(e){return a.call(i(this),e)}));},5021:function(e,t,n){"use strict";var r=n(260),i=n(7466),o=n(1400),a=n(6707),u=r.aTypedArray;(0,r.exportTypedArrayMethod)("subarray",(function(e,t){var n=u(this),r=n.length,s=o(e,r);return new(a(n,n.constructor))(n.buffer,n.byteOffset+s*n.BYTES_PER_ELEMENT,i((void 0===t?r:o(t,r))-s))}));},2974:function(e,t,n){"use strict";var r=n(7854),i=n(260),o=n(7293),a=r.Int8Array,u=i.aTypedArray,s=i.exportTypedArrayMethod,l=[].toLocaleString,c=[].slice,f=!!a&&o((function(){l.call(new a(1));}));s("toLocaleString",(function(){return l.apply(f?c.call(u(this)):u(this),arguments)}),o((function(){return [1,2].toLocaleString()!=new a([1,2]).toLocaleString()}))||!o((function(){a.prototype.toLocaleString.call([1,2]);})));},5016:function(e,t,n){"use strict";var r=n(260).exportTypedArrayMethod,i=n(7293),o=n(7854).Uint8Array,a=o&&o.prototype||{},u=[].toString,s=[].join;i((function(){u.call({});}))&&(u=function(){return s.call(this)});var l=a.toString!=u;r("toString",u,l);},2472:function(e,t,n){n(9843)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));},4747:function(e,t,n){var r=n(7854),i=n(8324),o=n(8533),a=n(8880);for(var u in i){var s=r[u],l=s&&s.prototype;if(l&&l.forEach!==o)try{a(l,"forEach",o);}catch(e){l.forEach=o;}}},3948:function(e,t,n){var r=n(7854),i=n(8324),o=n(6992),a=n(8880),u=n(5112),s=u("iterator"),l=u("toStringTag"),c=o.values;for(var f in i){var p=r[f],h=p&&p.prototype;if(h){if(h[s]!==c)try{a(h,s,c);}catch(e){h[s]=c;}if(h[l]||a(h,l,f),i[f])for(var d in o)if(h[d]!==o[d])try{a(h,d,o[d]);}catch(e){h[d]=o[d];}}}},1637:function(e,t,n){"use strict";n(6992);var r=n(2109),i=n(5005),o=n(590),a=n(1320),u=n(2248),s=n(8003),l=n(4994),c=n(9909),f=n(5787),p=n(6656),h=n(9974),d=n(648),v=n(9670),y=n(111),g=n(30),m=n(9114),b=n(8554),x=n(1246),w=n(5112),E=i("fetch"),k=i("Headers"),A=w("iterator"),S="URLSearchParams",F="URLSearchParamsIterator",T=c.set,C=c.getterFor(S),L=c.getterFor(F),R=/\+/g,I=Array(4),U=function(e){return I[e-1]||(I[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},O=function(e){try{return decodeURIComponent(e)}catch(t){return e}},_=function(e){var t=e.replace(R," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(U(n--),O);return t}},M=/[!'()~]|%20/g,z={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},P=function(e){return z[e]},j=function(e){return encodeURIComponent(e).replace(M,P)},D=function(e,t){if(t)for(var n,r,i=t.split("&"),o=0;o<i.length;)(n=i[o++]).length&&(r=n.split("="),e.push({key:_(r.shift()),value:_(r.join("="))}));},N=function(e){this.entries.length=0,D(this.entries,e);},B=function(e,t){if(e<t)throw TypeError("Not enough arguments")},q=l((function(e,t){T(this,{type:F,iterator:b(C(e).entries),kind:t});}),"Iterator",(function(){var e=L(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),W=function(){f(this,W,S);var e,t,n,r,i,o,a,u,s,l=arguments.length>0?arguments[0]:void 0,c=this,h=[];if(T(c,{type:S,entries:h,updateURL:function(){},updateSearchParams:N}),void 0!==l)if(y(l))if("function"==typeof(e=x(l)))for(n=(t=e.call(l)).next;!(r=n.call(t)).done;){if((a=(o=(i=b(v(r.value))).next).call(i)).done||(u=o.call(i)).done||!o.call(i).done)throw TypeError("Expected sequence with length 2");h.push({key:a.value+"",value:u.value+""});}
vendor: 13,837 bytes, line 19349
19349else for(s in l)p(l,s)&&h.push({key:s,value:l[s]+""});else D(h,"string"==typeof l?"?"===l.charAt(0)?l.slice(1):l:l+"");},H=W.prototype;u(H,{append:function(e,t){B(arguments.length,2);var n=C(this);n.entries.push({key:e+"",value:t+""}),n.updateURL();},delete:function(e){B(arguments.length,1);for(var t=C(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL();},get:function(e){B(arguments.length,1);for(var t=C(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){B(arguments.length,1);for(var t=C(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){B(arguments.length,1);for(var t=C(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return !0;return !1},set:function(e,t){B(arguments.length,1);for(var n,r=C(this),i=r.entries,o=!1,a=e+"",u=t+"",s=0;s<i.length;s++)(n=i[s]).key===a&&(o?i.splice(s--,1):(o=!0,n.value=u));o||i.push({key:a,value:u}),r.updateURL();},sort:function(){var e,t,n,r=C(this),i=r.entries,o=i.slice();for(i.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e);}r.updateURL();},forEach:function(e){for(var t,n=C(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this);},keys:function(){return new q(this,"keys")},values:function(){return new q(this,"values")},entries:function(){return new q(this,"entries")}},{enumerable:!0}),a(H,A,H.entries),a(H,"toString",(function(){for(var e,t=C(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(j(e.key)+"="+j(e.value));return n.join("&")}),{enumerable:!0}),s(W,S),r({global:!0,forced:!o},{URLSearchParams:W}),o||"function"!=typeof E||"function"!=typeof k||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(y(t=arguments[1])&&(n=t.body,d(n)===S&&((r=t.headers?new k(t.headers):new k).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:m(0,String(n)),headers:m(0,r)}))),i.push(t)),E.apply(this,i)}}),e.exports={URLSearchParams:W,getState:C};},285:function(e,t,n){"use strict";n(8783);var r,i=n(2109),o=n(9781),a=n(590),u=n(7854),s=n(6048),l=n(1320),c=n(5787),f=n(6656),p=n(1574),h=n(8457),d=n(8710).codeAt,v=n(3197),y=n(8003),g=n(1637),m=n(9909),b=u.URL,x=g.URLSearchParams,w=g.getState,E=m.set,k=m.getterFor("URL"),A=Math.floor,S=Math.pow,F="Invalid scheme",T="Invalid host",C="Invalid port",L=/[A-Za-z]/,R=/[\d+-.A-Za-z]/,I=/\d/,U=/^(0x|0X)/,O=/^[0-7]+$/,_=/^\d+$/,M=/^[\dA-Fa-f]+$/,z=/[\u0000\t\u000A\u000D #%/:?@[\\]]/,P=/[\u0000\t\u000A\u000D #/:?@[\\]]/,j=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,D=/[\t\u000A\u000D]/g,N=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return T;if(!(n=q(t.slice(1,-1))))return T;e.host=n;}else if(X(e)){if(t=v(t),z.test(t))return T;if(null===(n=B(t)))return T;e.host=n;}else {if(P.test(t))return T;for(n="",r=h(t),i=0;i<r.length;i++)n+=$(r[i],H);e.host=n;}},B=function(e){var t,n,r,i,o,a,u,s=e.split(".");if(s.length&&""==s[s.length-1]&&s.pop(),(t=s.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=s[r]))return e;if(o=10,i.length>1&&"0"==i.charAt(0)&&(o=U.test(i)?16:8,i=i.slice(8==o?1:2)),""===i)a=0;else {if(!(10==o?_:8==o?O:M).test(i))return e;a=parseInt(i,o);}n.push(a);}for(r=0;r<t;r++)if(a=n[r],r==t-1){if(a>=S(256,5-t))return null}else if(a>255)return null;for(u=n.pop(),r=0;r<n.length;r++)u+=n[r]*S(256,3-r);return u},q=function(e){var t,n,r,i,o,a,u,s=[0,0,0,0,0,0,0,0],l=0,c=null,f=0,p=function(){return e.charAt(f)};if(":"==p()){if(":"!=e.charAt(1))return;f+=2,c=++l;}for(;p();){if(8==l)return;if(":"!=p()){for(t=n=0;n<4&&M.test(p());)t=16*t+parseInt(p(),16),f++,n++;if("."==p()){if(0==n)return;if(f-=n,l>6)return;for(r=0;p();){if(i=null,r>0){if(!("."==p()&&r<4))return;f++;}if(!I.test(p()))return;for(;I.test(p());){if(o=parseInt(p(),10),null===i)i=o;else {if(0==i)return;i=10*i+o;}if(i>255)return;f++;}s[l]=256*s[l]+i,2!=++r&&4!=r||l++;}if(4!=r)return;break}if(":"==p()){if(f++,!p())return}else if(p())return;s[l++]=t;}else {if(null!==c)return;f++,c=++l;}}if(null!==c)for(a=l-c,l=7;0!=l&&a>0;)u=s[l],s[l--]=s[c+a-1],s[c+--a]=u;else if(8!=l)return;return s},W=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=A(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return "["+t+"]"}return e},H={},Y=p({},H,{" ":1,'"':1,"<":1,">":1,"`":1}),G=p({},Y,{"#":1,"?":1,"{":1,"}":1}),Q=p({},G,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$=function(e,t){var n=d(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},V={ftp:21,file:null,http:80,https:443,ws:80,wss:443},X=function(e){return f(V,e.scheme)},K=function(e){return ""!=e.username||""!=e.password},Z=function(e){return !e.host||e.cannotBeABaseURL||"file"==e.scheme},J=function(e,t){var n;return 2==e.length&&L.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ee=function(e){var t;return e.length>1&&J(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},te=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&J(t[0],!0)||t.pop();},ne=function(e){return "."===e||"%2e"===e.toLowerCase()},re={},ie={},oe={},ae={},ue={},se={},le={},ce={},fe={},pe={},he={},de={},ve={},ye={},ge={},me={},be={},xe={},we={},Ee={},ke={},Ae=function(e,t,n,i){var o,a,u,s,l,c=n||re,p=0,d="",v=!1,y=!1,g=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(j,"")),t=t.replace(D,""),o=h(t);p<=o.length;){switch(a=o[p],c){case re:if(!a||!L.test(a)){if(n)return F;c=oe;continue}d+=a.toLowerCase(),c=ie;break;case ie:if(a&&(R.test(a)||"+"==a||"-"==a||"."==a))d+=a.toLowerCase();else {if(":"!=a){if(n)return F;d="",c=oe,p=0;continue}if(n&&(X(e)!=f(V,d)||"file"==d&&(K(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=d,n)return void(X(e)&&V[e.scheme]==e.port&&(e.port=null));d="","file"==e.scheme?c=ye:X(e)&&i&&i.scheme==e.scheme?c=ae:X(e)?c=ce:"/"==o[p+1]?(c=ue,p++):(e.cannotBeABaseURL=!0,e.path.push(""),c=we);}break;case oe:if(!i||i.cannotBeABaseURL&&"#"!=a)return F;if(i.cannotBeABaseURL&&"#"==a){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,c=ke;break}c="file"==i.scheme?ye:se;continue;case ae:if("/"!=a||"/"!=o[p+1]){c=se;continue}c=fe,p++;break;case ue:if("/"==a){c=pe;break}c=xe;continue;case se:if(e.scheme=i.scheme,a==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==a||"\\"==a&&X(e))c=le;else if("?"==a)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",c=Ee;else {if("#"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),c=xe;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=ke;}break;case le:if(!X(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,c=xe;continue}c=pe;}else c=fe;break;case ce:if(c=fe,"/"!=a||"/"!=d.charAt(p+1))continue;p++;break;case fe:if("/"!=a&&"\\"!=a){c=pe;continue}break;case pe:if("@"==a){v&&(d="%40"+d),v=!0,u=h(d);for(var m=0;m<u.length;m++){var b=u[m];if(":"!=b||g){var x=$(b,Q);g?e.password+=x:e.username+=x;}else g=!0;}d="";}else if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&X(e)){if(v&&""==d)return "Invalid authority";p-=h(d).length+1,d="",c=he;}else d+=a;break;case he:case de:if(n&&"file"==e.scheme){c=me;continue}if(":"!=a||y){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&X(e)){if(X(e)&&""==d)return T;if(n&&""==d&&(K(e)||null!==e.port))return;if(s=N(e,d))return s;if(d="",c=be,n)return;continue}"["==a?y=!0:"]"==a&&(y=!1),d+=a;}else {if(""==d)return T;if(s=N(e,d))return s;if(d="",c=ve,n==de)return}break;case ve:if(!I.test(a)){if(a==r||"/"==a||"?"==a||"#"==a||"\\"==a&&X(e)||n){if(""!=d){var w=parseInt(d,10);if(w>65535)return C;e.port=X(e)&&w===V[e.scheme]?null:w,d="";}if(n)return;c=be;continue}return C}d+=a;break;case ye:if(e.scheme="file","/"==a||"\\"==a)c=ge;else {if(!i||"file"!=i.scheme){c=xe;continue}if(a==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==a)e.host=i.host,e.path=i.path.slice(),e.query="",c=Ee;else {if("#"!=a){ee(o.slice(p).join(""))||(e.host=i.host,e.path=i.path.slice(),te(e)),c=xe;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",c=ke;}}break;case ge:if("/"==a||"\\"==a){c=me;break}i&&"file"==i.scheme&&!ee(o.slice(p).join(""))&&(J(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),c=xe;continue;case me:if(a==r||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&J(d))c=xe;else if(""==d){if(e.host="",n)return;c=be;}else {if(s=N(e,d))return s;if("localhost"==e.host&&(e.host=""),n)return;d="",c=be;}continue}d+=a;break;case be:if(X(e)){if(c=xe,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=r&&(c=xe,"/"!=a))continue}else e.fragment="",c=ke;else e.query="",c=Ee;break;case xe:if(a==r||"/"==a||"\\"==a&&X(e)||!n&&("?"==a||"#"==a)){if(".."===(l=(l=d).toLowerCase())||"%2e."===l||".%2e"===l||"%2e%2e"===l?(te(e),"/"==a||"\\"==a&&X(e)||e.path.push("")):ne(d)?"/"==a||"\\"==a&&X(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&J(d)&&(e.host&&(e.host=""),d=d.charAt(0)+":"),e.path.push(d)),d="","file"==e.scheme&&(a==r||"?"==a||"#"==a))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==a?(e.query="",c=Ee):"#"==a&&(e.fragment="",c=ke);}else d+=$(a,G);break;case we:"?"==a?(e.query="",c=Ee):"#"==a?(e.fragment="",c=ke):a!=r&&(e.path[0]+=$(a,H));break;case Ee:n||"#"!=a?a!=r&&("'"==a&&X(e)?e.query+="%27":e.query+="#"==a?"%23":$(a,H)):(e.fragment="",c=ke);break;case ke:a!=r&&(e.fragment+=$(a,Y));}p++;}},Se=function(e){var t,n,r=c(this,Se,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(e),u=E(r,{type:"URL"});if(void 0!==i)if(i instanceof Se)t=k(i);else if(n=Ae(t={},String(i)))throw TypeError(n);if(n=Ae(u,a,null,t))throw TypeError(n);var s=u.searchParams=new x,l=w(s);l.updateSearchParams(u.query),l.updateURL=function(){u.query=String(s)||null;},o||(r.href=Te.call(r),r.origin=Ce.call(r),r.protocol=Le.call(r),r.username=Re.call(r),r.password=Ie.call(r),r.host=Ue.call(r),r.hostname=Oe.call(r),r.port=_e.call(r),r.pathname=Me.call(r),r.search=ze.call(r),r.searchParams=Pe.call(r),r.hash=je.call(r));},Fe=Se.prototype,Te=function(){var e=k(this),t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,a=e.path,u=e.query,s=e.fragment,l=t+":";return null!==i?(l+="//",K(e)&&(l+=n+(r?":"+r:"")+"@"),l+=W(i),null!==o&&(l+=":"+o)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==u&&(l+="?"+u),null!==s&&(l+="#"+s),l},Ce=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return "null"}return "file"!=t&&X(e)?t+"://"+W(e.host)+(null!==n?":"+n:""):"null"},Le=function(){return k(this).scheme+":"},Re=function(){return k(this).username},Ie=function(){return k(this).password},Ue=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?W(t):W(t)+":"+n},Oe=function(){var e=k(this).host;return null===e?"":W(e)},_e=function(){var e=k(this).port;return null===e?"":String(e)},Me=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ze=function(){var e=k(this).query;return e?"?"+e:""},Pe=function(){return k(this).searchParams},je=function(){var e=k(this).fragment;return e?"#"+e:""},De=function(e,t){return {get:e,set:t,configurable:!0,enumerable:!0}};if(o&&s(Fe,{href:De(Te,(function(e){var t=k(this),n=String(e),r=Ae(t,n);if(r)throw TypeError(r);w(t.searchParams).updateSearchParams(t.query);})),origin:De(Ce),protocol:De(Le,(function(e){var t=k(this);Ae(t,String(e)+":",re);})),username:De(Re,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=$(n[r],Q);}})),password:De(Ie,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=$(n[r],Q);}})),host:De(Ue,(function(e){var t=k(this);t.cannotBeABaseURL||Ae(t,String(e),he);})),hostname:De(Oe,(function(e){var t=k(this);t.cannotBeABaseURL||Ae(t,String(e),de);})),port:De(_e,(function(e){var t=k(this);Z(t)||(""==(e=String(e))?t.port=null:Ae(t,e,ve));})),pathname:De(Me,(function(e){var t=k(this);t.cannotBeABaseURL||(t.path=[],Ae(t,e+"",be));})),search:De(ze,(function(e){var t=k(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",Ae(t,e,Ee)),w(t.searchParams).updateSearchParams(t.query);})),searchParams:De(Pe),hash:De(je,(function(e){var t=k(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",Ae(t,e,ke)):t.fragment=null;}))}),l(Fe,"toJSON",(function(){return Te.call(this)}),{enumerable:!0}),l(Fe,"toString",(function(){return Te.call(this)}),{enumerable:!0}),b){var Ne=b.createObjectURL,Be=b.revokeObjectURL;Ne&&l(Se,"createObjectURL",(function(e){return Ne.apply(b,arguments)})),Be&&l(Se,"revokeObjectURL",(function(e){return Be.apply(b,arguments)}));}y(Se,"URL"),i({global:!0,forced:!a,sham:!o},{URL:Se});}},t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]});},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}
19349}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});};var r={};return function(){"use strict";function e(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return "Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return {s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return {s:function(){r=e[Symbol.iterator]();},n:function(){var e=r.next();return u=e.done,e},e:function(e){s=!0,a=e;},f:function(){try{u||null==r.return||r.return();}finally{if(s)throw a}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}n.r(r),n.d(r,{Dropzone:function(){return b},default:function(){return A}}),n(2222),n(7327),n(2772),n(6992),n(1249),n(7042),n(561),n(8264),n(8309),n(489),n(1539),n(4916),n(9714),n(8783),n(4723),n(5306),n(3123),n(3210),n(2472),n(2990),n(8927),n(3105),n(5035),n(4345),n(7174),n(2846),n(4731),n(7209),n(6319),n(8867),n(7789),n(3739),n(9368),n(4483),n(2056),n(3462),n(678),n(7462),n(3824),n(5021),n(2974),n(5016),n(4747),n(3948),n(285);var o=function(){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);}var n,r;return n=t,(r=[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(t){this._callbacks=this._callbacks||{};for(var n=this._callbacks[t],r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(n){var a,u=e(n,!0);try{for(u.s();!(a=u.n()).done;){var s=a.value;s.apply(this,i);}}catch(e){u.e(e);}finally{u.f();}}return this.element&&this.element.dispatchEvent(this.makeEvent("dropzone:"+t,{args:i})),this}},{key:"makeEvent",value:function(e,t){var n={bubbles:!0,cancelable:!0,detail:t};if("function"==typeof window.CustomEvent)return new CustomEvent(e,n);var r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),r}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var r=0;r<n.length;r++){var i=n[r];if(i===t){n.splice(r,1);break}}return this}}])&&i(n.prototype,r),t}();function a(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return {s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return {s:function(){n=e[Symbol.iterator]();},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e;},f:function(){try{a||null==n.return||n.return();}finally{if(s)throw o}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s={url:null,method:"post",withCredentials:!1,timeout:null,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,
vendor: 9,260 bytes, line 19349
19349chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,disablePreviews:!1,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return {dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t();},fallback:function(){var e;this.element.className="".concat(this.element.className," dz-browser-not-supported");var t,n=a(this.element.getElementsByTagName("div"),!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(/(^| )dz-message($| )/.test(r.className)){e=r,r.className="dz-message";break}}}catch(e){n.e(e);}finally{n.f();}e||(e=b.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var i=e.getElementsByTagName("span")[0];return i&&(null!=i.textContent?i.textContent=this.options.dictFallbackMessage:null!=i.innerText&&(i.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,r){var i={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==n?(t=i.srcWidth,n=i.srcHeight):null==t?t=n*o:null==n&&(n=t/o);var a=(t=Math.min(t,i.srcWidth))/(n=Math.min(n,i.srcHeight));if(i.srcWidth>t||i.srcHeight>n)if("crop"===r)o>a?(i.srcHeight=e.height,i.srcWidth=i.srcHeight*a):(i.srcWidth=e.width,i.srcHeight=i.srcWidth/a);else {if("contain"!==r)throw new Error("Unknown resizeMethod '".concat(r,"'"));o>a?n=t/o:t=n*o;}return i.srcX=(e.width-i.srcWidth)/2,i.srcY=(e.height-i.srcHeight)/2,i.trgWidth=t,i.trgHeight=n,i},transformFile:function(e,t){return (this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview"> <div class="dz-image"><img data-dz-thumbnail/></div> <div class="dz-details"> <div class="dz-size"><span data-dz-size></span></div> <div class="dz-filename"><span data-dz-name></span></div> </div> <div class="dz-progress"> <span class="dz-upload" data-dz-uploadprogress></span> </div> <div class="dz-error-message"><span data-dz-errormessage></span></div> <div class="dz-success-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Check</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path> </g> </svg> </div> <div class="dz-error-mark"> <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Error</title> <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475"> <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path> </g> </g> </svg> </div> </div> ',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){e.previewElement=b.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);var n,r=a(e.previewElement.querySelectorAll("[data-dz-name]"),!0);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.textContent=e.name;}}catch(e){r.e(e);}finally{r.f();}var o,u=a(e.previewElement.querySelectorAll("[data-dz-size]"),!0);try{for(u.s();!(o=u.n()).done;)(i=o.value).innerHTML=this.filesize(e.size);}catch(e){u.e(e);}finally{u.f();}this.options.addRemoveLinks&&(e._removeLink=b.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"</a>")),e.previewElement.appendChild(e._removeLink));var s,l=function(n){return n.preventDefault(),n.stopPropagation(),e.status===b.UPLOADING?b.confirm(t.options.dictCancelUploadConfirmation,(function(){return t.removeFile(e)})):t.options.dictRemoveFileConfirmation?b.confirm(t.options.dictRemoveFileConfirmation,(function(){return t.removeFile(e)})):t.removeFile(e)},c=a(e.previewElement.querySelectorAll("[data-dz-remove]"),!0);try{for(c.s();!(s=c.n()).done;)s.value.addEventListener("click",l);}catch(e){c.e(e);}finally{c.f();}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var n,r=a(e.previewElement.querySelectorAll("[data-dz-thumbnail]"),!0);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.alt=e.name,i.src=t;}}catch(e){r.e(e);}finally{r.f();}return setTimeout((function(){return e.previewElement.classList.add("dz-image-preview")}),1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);var n,r=a(e.previewElement.querySelectorAll("[data-dz-errormessage]"),!0);try{for(r.s();!(n=r.n()).done;)n.value.textContent=t;}catch(e){r.e(e);}finally{r.f();}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,n){if(e.previewElement){var r,i=a(e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),!0);try{for(i.s();!(r=i.n()).done;){var o=r.value;"PROGRESS"===o.nodeName?o.value=t:o.style.width="".concat(t,"%");}}catch(e){i.e(e);}finally{i.f();}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){}
vendor: 7,876 bytes, line 19349
19349,canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}};function l(e){return (l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return {s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return {s:function(){n=e[Symbol.iterator]();},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,o=e;},f:function(){try{a||null==n.return||n.return();}finally{if(u)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r);}}function d(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function v(e,t){return (v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(e,t){return !t||"object"!==l(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return (m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t);}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return !1}}(),function(){var e,r=m(t);if(n){var i=m(this).constructor;e=Reflect.construct(r,arguments,i);}else e=r.apply(this,arguments);return y(this,e)});function i(e,t){var n,o,a;if(p(this,i),(n=r.call(this)).element=e,n.version=i.version,n.clickableElements=[],n.listeners=[],n.files=[],"string"==typeof n.element&&(n.element=document.querySelector(n.element)),!n.element||null==n.element.nodeType)throw new Error("Invalid dropzone element.");if(n.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(g(n)),n.element.dropzone=g(n);var u=null!=(a=i.optionsForElement(n.element))?a:{};if(n.options=i.extend({},s,u,null!=t?t:{}),n.options.previewTemplate=n.options.previewTemplate.replace(/\n*/g,""),n.options.forceFallback||!i.isBrowserSupported())return y(n,n.options.fallback.call(g(n)));if(null==n.options.url&&(n.options.url=n.element.getAttribute("action")),!n.options.url)throw new Error("No URL provided.");if(n.options.acceptedFiles&&n.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(n.options.uploadMultiple&&n.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return n.options.acceptedMimeTypes&&(n.options.acceptedFiles=n.options.acceptedMimeTypes,delete n.options.acceptedMimeTypes),null!=n.options.renameFilename&&(n.options.renameFile=function(e){return n.options.renameFilename.call(g(n),e.name,e)}),"string"==typeof n.options.method&&(n.options.method=n.options.method.toUpperCase()),(o=n.getExistingFallback())&&o.parentNode&&o.parentNode.removeChild(o),!1!==n.options.previewsContainer&&(n.options.previewsContainer?n.previewsContainer=i.getElement(n.options.previewsContainer,"previewsContainer"):n.previewsContainer=n.element),n.options.clickable&&(!0===n.options.clickable?n.clickableElements=[n.element]:n.clickableElements=i.getElements(n.options.clickable,"clickable")),n.init(),n}return d(i,[{key:"getAcceptedFiles",value:function(){return this.files.filter((function(e){return e.accepted})).map((function(e){return e}))}},{key:"getRejectedFiles",value:function(){return this.files.filter((function(e){return !e.accepted})).map((function(e){return e}))}},{key:"getFilesWithStatus",value:function(e){return this.files.filter((function(t){return t.status===e})).map((function(e){return e}))}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(i.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(i.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(i.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter((function(e){return e.status===i.UPLOADING||e.status===i.QUEUED})).map((function(e){return e}))}},{key:"init",value:function(){var e=this;"form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"</button></div>"))),this.clickableElements.length&&function t(){e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.setAttribute("tabindex","-1"),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",i.getElement(e.options.hiddenInputContainer,"hiddenInputContainer").appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",(function(){var n=e.hiddenFileInput.files;if(n.length){var r,i=c(n,!0);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.addFile(o);}}catch(e){i.e(e);}finally{i.f();}}e.emit("addedfiles",n),t();}));}(),this.URL=null!==window.URL?window.URL:window.webkitURL;var t,n=c(this.events,!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.on(r,this.options[r]);}}catch(e){n.e(e);}finally{n.f();}this.on("uploadprogress",(function(){return e.updateTotalUploadProgress()})),this.on("removedfile",(function(){return e.updateTotalUploadProgress()})),this.on("canceled",(function(t){return e.emit("complete",t)})),this.on("complete",(function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout((function(){return e.emit("queuecomplete")}
vendor: 8,577 bytes, line 19349
19349),0)}));var o=function(e){if(function(e){if(e.dataTransfer.types)for(var t=0;t<e.dataTransfer.types.length;t++)if("Files"===e.dataTransfer.types[t])return !0;return !1}(e))return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return o(t),e.emit("dragenter",t)},dragover:function(t){var n;try{n=t.dataTransfer.effectAllowed;}catch(e){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",o(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return o(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach((function(t){return e.listeners.push({element:t,events:{click:function(n){return (t!==e.element||n.target===e.element||i.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})})),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e,t=0,n=0;if(this.getActiveFiles().length){var r,i=c(this.getActiveFiles(),!0);try{for(i.s();!(r=i.n()).done;){var o=r.value;t+=o.upload.bytesSent,n+=o.upload.total;}}catch(e){i.e(e);}finally{i.f();}e=100*t/n;}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return "function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){return "function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e,t;if(e=this.getExistingFallback())return e;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>".concat(this.options.dictFallbackText,"</p>")),n+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"></div>');var r=i.createElement(n);return "FORM"!==this.element.tagName?(t=i.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"></form>'))).appendChild(r):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:r}},{key:"getExistingFallback",value:function(){for(var e=function(e){var t,n=c(e,!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(/(^| )fallback($| )/.test(r.className))return r}}catch(e){n.e(e);}finally{n.f();}},t=0,n=["div","form"];t<n.length;t++){var r,i=n[t];if(r=e(this.element.getElementsByTagName(i)))return r}}},{key:"setupEventListeners",value:function(){return this.listeners.map((function(e){return function(){var t=[];for(var n in e.events){var r=e.events[n];t.push(e.element.addEventListener(n,r,!1));}return t}()}))}},{key:"removeEventListeners",value:function(){return this.listeners.map((function(e){return function(){var t=[];for(var n in e.events){var r=e.events[n];t.push(e.element.removeEventListener(n,r,!1));}return t}()}))}},{key:"disable",value:function(){var e=this;return this.clickableElements.forEach((function(e){return e.classList.remove("dz-clickable")})),this.removeEventListeners(),this.disabled=!0,this.files.map((function(t){return e.cancelUpload(t)}))}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach((function(e){return e.classList.add("dz-clickable")})),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(e>0){for(var r=["tb","gb","mb","kb","b"],i=0;i<r.length;i++){var o=r[i];if(e>=Math.pow(this.options.filesizeBase,4-i)/10){t=e/Math.pow(this.options.filesizeBase,4-i),n=o;break}}t=Math.round(10*t)/10;}return "<strong>".concat(t,"</strong> ").concat(this.options.dictFileSizeUnits[n])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],n=0;n<e.dataTransfer.files.length;n++)t[n]=e.dataTransfer.files[n];if(t.length){var r=e.dataTransfer.items;r&&r.length&&null!=r[0].webkitGetAsEntry?this._addFilesFromItems(r):this.handleFiles(t);}this.emit("addedfiles",t);}}},{key:"paste",value:function(e){if(null!=(null!=(t=null!=e?e.clipboardData:void 0)?function(e){return e.items}(t):void 0)){var t;this.emit("paste",e);var n=e.clipboardData.items;return n.length?this._addFilesFromItems(n):void 0}}},{key:"handleFiles",value:function(e){var t,n=c(e,!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.addFile(r);}}catch(e){n.e(e);}finally{n.f();}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){var n,r=[],i=c(e,!0);try{for(i.s();!(n=i.n()).done;){var o,a=n.value;null!=a.webkitGetAsEntry&&(o=a.webkitGetAsEntry())?o.isFile?r.push(t.addFile(a.getAsFile())):o.isDirectory?r.push(t._addFilesFromDirectory(o,o.name)):r.push(void 0):null==a.getAsFile||null!=a.kind&&"file"!==a.kind?r.push(void 0):r.push(t.addFile(a.getAsFile()));}}catch(e){i.e(e);}finally{i.f();}return r}()}},{key:"_addFilesFromDirectory",value:function(e,t){var n=this,r=e.createReader(),i=function(e){return "log",n=function(t){return t.log(e)},null!=(t=console)&&"function"==typeof t.log?n(t):void 0;var t,n;};return function e(){return r.readEntries((function(r){if(r.length>0){var i,o=c(r,!0);try{for(o.s();!(i=o.n()).done;){var a=i.value;a.isFile?a.file((function(e){if(!n.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(t,"/").concat(e.name),n.addFile(e)})):a.isDirectory&&n._addFilesFromDirectory(a,"".concat(t,"/").concat(a.name));}}catch(e){o.e(e);}finally{o.f();}e();}return null}),i)}()}},{key:"accept",value:function(e,t){this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType);}},{key:"addFile",value:function(e){var t=this;e.upload={uuid:i.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=i.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,(function(n){n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass();}));}},{key:"enqueueFiles",value:function(e){var t,n=c(e,!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.enqueueFile(r);}}catch(e){n.e(e);}finally{n.f();}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==i.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout((function(){return t.processQueue()}),0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout((function(){return t._processThumbnailQueue()}),0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,(function(n){return e.emit("thumbnail",t,n),e._processingThumbnail=!1,e._processThumbnailQueue()}))}}},{key:"removeFile",value:function(e){if(e.status===i.UPLOADING&&this.cancelUpload(e),this.files=x(this.files,e),this.emit
19349("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t,n=c(this.files.slice(),!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;(r.status!==i.UPLOADING||e)&&this.removeFile(r);}}catch(e){n.e(e);}finally{n.f();}return null}},{key:"resizeImage",value:function(e,t,n,r,o){var a=this;return this.createThumbnail(e,t,n,r,!0,(function(t,n){if(null==n)return o(e);var r=a.options.resizeMimeType;null==r&&(r=e.type);var u=n.toDataURL(r,a.options.resizeQuality);return "image/jpeg"!==r&&"image/jpg"!==r||(u=k.restore(e.dataURL,u)),o(i.dataURItoBlob(u))}))}},{key:"createThumbnail",value:function(e,t,n,r,i,o){var a=this,u=new FileReader;u.onload=function(){e.dataURL=u.result,"image/svg+xml"!==e.type?a.createThumbnailFromUrl(e,t,n,r,i,o):null!=o&&o(u.result);},u.readAsDataURL(e);}},{key:"displayExistingFile",value:function(e,t,n,r){var i=this,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this.emit("addedfile",e),this.emit("complete",e),o){var a=function(t){i.emit("thumbnail",e,t),n&&n();};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,a,r);}else this.emit("thumbnail",e,t),n&&n();}},{key:"createThumbnailFromUrl",value:function(e,t,n,r,i,o,a){var u=this,s=document.createElement("img");return a&&(s.crossOrigin=a),i="from-image"!=getComputedStyle(document.body).imageOrientation&&i,s.onload=function(){var a=function(e){return e(1)};return "undefined"!=typeof EXIF&&null!==EXIF&&i&&(a=function(e){return EXIF.getData(s,(function(){return e(EXIF.getTag(this,"Orientation"))}))}),a((function(i){e.width=s.width,e.height=s.height;var a=u.options.resize.call(u,e,t,n,r),l=document.createElement("canvas"),c=l.getContext("2d");switch(l.width=a.trgWidth,l.height=a.trgHeight,i>4&&(l.width=a.trgHeight,l.height=a.trgWidth),i){case 2:c.translate(l.width,0),c.scale(-1,1);break;case 3:c.translate(l.width,l.height),c.rotate(Math.PI);break;case 4:c.translate(0,l.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-l.width);break;case 7:c.rotate(.5*Math.PI),c.translate(l.height,-l.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-l.height,0);}E(c,s,null!=a.srcX?a.srcX:0,null!=a.srcY?a.srcY:0,a.srcWidth,a.srcHeight,null!=a.trgX?a.trgX:0,null!=a.trgY?a.trgY:0,a.trgWidth,a.trgHeight);var f=l.toDataURL("image/png");if(null!=o)return o(f,l)}))},null!=o&&(s.onerror=o),s.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(t>=e)){var r=this.getQueuedFiles();if(r.length>0){if(this.options.uploadMultiple)return this.processFiles(r.slice(0,e-t));for(;n<e;){if(!r.length)return;this.processFile(r.shift()),n++;}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){var t,n=c(e,!0);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.processing=!0,r.status=i.UPLOADING,this.emit("processing",r);}}catch(e){n.e(e);}finally{n.f();}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){return this.files.filter((function(t){return t.xhr===e})).map((function(e){return e}))}},{key:"cancelUpload",value:function(e){if(e.status===i.UPLOADING){var t,n=this._getFilesWithXhr(e.xhr),r=c(n,!0);try{for(r.s();!(t=r.n()).done;)t.value.status=i.CANCELED;}catch(e){r.e(e);}finally{r.f();}void 0!==e.xhr&&e.xhr.abort();var o,a=c(n,!0);try{for(a.s();!(o=a.n()).done;){var u=o.value;this.emit("canceled",u);}}catch(e){a.e(e);}finally{a.f();}this.options.uploadMultiple&&this.emit("canceledmultiple",n);}else e.status!==i.ADDED&&e.status!==i.QUEUED||(e.status=i.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.apply(this,n)}return e}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(e){var t=this;this._transformFiles(e,(function(n){if(t.options.chunking){var r=n[0];e[0].upload.chunked=t.options.chunking&&(t.options.forceChunking||r.size>t.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(r.size/t.options.chunkSize);}if(e[0].upload.chunked){var o=e[0],a=n[0];o.upload.chunks=[];var u=function(){for(var n=0;void 0!==o.upload.chunks[n];)n++;if(!(n>=o.upload.totalChunkCount)){var r=n*t.options.chunkSize,u=Math.min(r+t.options.chunkSize,a.size),s={name:t._getParamName(0),data:a.webkitSlice?a.webkitSlice(r,u):a.slice(r,u),filename:o.upload.filename,chunkIndex:n};o.upload.chunks[n]={file:o,index:n,dataBlock:s,status:i.UPLOADING,progress:0,retries:0},t._uploadData(e,[s]);}};if(o.upload.finishedChunkUpload=function(n,r){var a=!0;n.status=i.SUCCESS,n.dataBlock=null,n.xhr=null;for(var s=0;s<o.upload.totalChunkCount;s++){if(void 0===o.upload.chunks[s])return u();o.upload.chunks[s].status!==i.SUCCESS&&(a=!1);}a&&t.options.chunksUploaded(o,(function(){t._finished(e,r,null);}));},t.options.parallelChunkUploads)for(var s=0;s<o.upload.totalChunkCount;s++)u();else u();}else {for(var l=[],c=0;c<e.length;c++)l[c]={name:t._getParamName(c),data:n[c],filename:e[c].upload.filename};t._uploadData(e,l);}}));}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(e,t){var n,r=this,o=new XMLHttpRequest,a=c(e,!0);try{for(a.s();!(n=a.n()).done;)n.value.xhr=o;}catch(e){a.e(e);}finally{a.f();}e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=o);var u=this.resolveOption(this.options.method,e),s=this.resolveOption(this.options.url,e);o.open(u,s,!0),this.resolveOption(this.options.timeout,e)&&(o.timeout=this.resolveOption(this.options.timeout,e)),o.withCredentials=!!this.options.withCredentials,o.onload=function(t){r._finishedUploading(e,o,t);},o.ontimeout=function(){r._handleUploadError(e,o,"Request timedout after ".concat(r.options.timeout/1e3," seconds"));},o.onerror=function(){r._handleUploadError(e,o);},(null!=o.upload?o.upload:o).onprogress=function(t){return r._updateFilesUploadProgress(e,o,t)};var l={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var f in this.options.headers&&i.extend(l,this.options.headers),l){var p=l[f];p&&o.setRequestHeader(f,p);}var h=new FormData;if(this.options.params){var d=this.options.params;for(var v in "function"==typeof d&&(d=d.call(this,e,o,e[0].upload.chunked?this._getChunk(e[0],o):null)),d){var y=d[v];if(Array.isArray(y))for(var g=0;g<y.length;g++)h.append(v,y[g]);else h.append(v,y);}}var m,b=c(e,!0);try{for(b.s();!(m=b.n()).done;){var x=m.value;
19349this.emit("sending",x,o,h);}}catch(e){b.e(e);}finally{b.f();}this.options.uploadMultiple&&this.emit("sendingmultiple",e,o,h),this._addFormElementData(h);for(var w=0;w<t.length;w++){var E=t[w];h.append(E.name,E.data,E.filename);}this.submitRequest(o,h,e);}},{key:"_transformFiles",value:function(e,t){for(var n=this,r=[],i=0,o=function(o){n.options.transformFile.call(n,e[o],(function(n){r[o]=n,++i===e.length&&t(r);}));},a=0;a<e.length;a++)o(a);}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName){var t,n=c(this.element.querySelectorAll("input, textarea, select, button"),!0);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.getAttribute("name"),o=r.getAttribute("type");if(o&&(o=o.toLowerCase()),null!=i)if("SELECT"===r.tagName&&r.hasAttribute("multiple")){var a,u=c(r.options,!0);try{for(u.s();!(a=u.n()).done;){var s=a.value;s.selected&&e.append(i,s.value);}}catch(e){u.e(e);}finally{u.f();}}else (!o||"checkbox"!==o&&"radio"!==o||r.checked)&&e.append(i,r.value);}}catch(e){n.e(e);}finally{n.f();}}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){if(e[0].upload.chunked){var r=e[0],i=this._getChunk(r,t);n?(i.progress=100*n.loaded/n.total,i.total=n.total,i.bytesSent=n.loaded):(i.progress=100,i.bytesSent=i.total),r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var o=0;o<r.upload.totalChunkCount;o++)r.upload.chunks[o]&&void 0!==r.upload.chunks[o].progress&&(r.upload.progress+=r.upload.chunks[o].progress,r.upload.total+=r.upload.chunks[o].total,r.upload.bytesSent+=r.upload.chunks[o].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount,this.emit("uploadprogress",r,r.upload.progress,r.upload.bytesSent);}else {var a,u=c(e,!0);try{for(u.s();!(a=u.n()).done;){var s=a.value;s.upload.total&&s.upload.bytesSent&&s.upload.bytesSent==s.upload.total||(n?(s.upload.progress=100*n.loaded/n.total,s.upload.total=n.total,s.upload.bytesSent=n.loaded):(s.upload.progress=100,s.upload.bytesSent=s.upload.total),this.emit("uploadprogress",s,s.upload.progress,s.upload.bytesSent));}}catch(e){u.e(e);}finally{u.f();}}}},{key:"_finishedUploading",value:function(e,t,n){var r;if(e[0].status!==i.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(r=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{r=JSON.parse(r);}catch(e){n=e,r="Invalid JSON response from server.";}this._updateFilesUploadProgress(e,t),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t),r):this._finished(e,r,n):this._handleUploadError(e,t,r);}}},{key:"_handleUploadError",value:function(e,t,n){if(e[0].status!==i.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var r=this._getChunk(e[0],t);if(r.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[r.dataBlock]);console.warn("Retried this chunk too often. Giving up.");}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t);}}},{key:"submitRequest",value:function(e,t,n){1==e.readyState?e.send(t):console.warn("Cannot send this request because the XMLHttpRequest.readyState is not OPENED.");}},{key:"_finished",value:function(e,t,n){var r,o=c(e,!0);try{for(o.s();!(r=o.n()).done;){var a=r.value;a.status=i.SUCCESS,this.emit("success",a,t,n),this.emit("complete",a);}}catch(e){o.e(e);}finally{o.f();}
vendor: 5,389 bytes, line 19349
19349if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,n){var r,o=c(e,!0);try{for(o.s();!(r=o.n()).done;){var a=r.value;a.status=i.ERROR,this.emit("error",a,t,n),this.emit("complete",a);}}catch(e){o.e(e);}finally{o.f();}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"initClass",value:function(){this.prototype.Emitter=o,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1;}},{key:"extend",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,o=n;i<o.length;i++){var a=o[i];for(var u in a){var s=a[u];e[u]=s;}}return e}},{key:"uuidv4",value:function(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return ("x"===e?t:3&t|8).toString(16)}))}}]),i}(o);b.initClass(),b.version="5.9.3",b.options={},b.optionsForElement=function(e){return e.getAttribute("id")?b.options[w(e.getAttribute("id"))]:void 0},b.instances=[],b.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},b.autoDiscover=!0,b.discover=function(){var e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else {e=[];var t=function(t){return function(){var n,r=[],i=c(t,!0);try{for(i.s();!(n=i.n()).done;){var o=n.value;/(^| )dropzone($| )/.test(o.className)?r.push(e.push(o)):r.push(void 0);}}catch(e){i.e(e);}finally{i.f();}return r}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"));}return function(){var t,n=[],r=c(e,!0);try{for(r.s();!(t=r.n()).done;){var i=t.value;!1!==b.optionsForElement(i)?n.push(new b(i)):n.push(void 0);}}catch(e){r.e(e);}finally{r.f();}return n}()},b.blockedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],b.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){void 0!==b.blacklistedBrowsers&&(b.blockedBrowsers=b.blacklistedBrowsers);var t,n=c(b.blockedBrowsers,!0);try{for(n.s();!(t=n.n()).done;)t.value.test(navigator.userAgent)&&(e=!1);}catch(e){n.e(e);}finally{n.f();}}else e=!1;else e=!1;return e},b.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r),o=0,a=t.length,u=0<=a;u?o<=a:o>=a;u?o++:o--)i[o]=t.charCodeAt(o);return new Blob([r],{type:n})};var x=function(e,t){return e.filter((function(e){return e!==t})).map((function(e){return e}))},w=function(e){return e.replace(/[\-_](\w)/g,(function(e){return e.charAt(1).toUpperCase()}))};b.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},b.elementInside=function(e,t){if(e===t)return !0;for(;e=e.parentNode;)if(e===t)return !0;return !1},b.getElement=function(e,t){var n;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return n},b.getElements=function(e,t){var n,r;if(e instanceof Array){r=[];try{var i,o=c(e,!0);try{for(o.s();!(i=o.n()).done;)n=i.value,r.push(this.getElement(n,t));}catch(e){o.e(e);}finally{o.f();}}catch(e){r=null;}}else if("string"==typeof e){r=[];var a,u=c(document.querySelectorAll(e),!0);try{for(u.s();!(a=u.n()).done;)n=a.value,r.push(n);}catch(e){u.e(e);}finally{u.f();}}else null!=e.nodeType&&(r=[e]);if(null==r||!r.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return r},b.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},b.isValidFile=function(e,t){if(!t)return !0;t=t.split(",");var n,r=e.type,i=r.replace(/\/.*$/,""),o=c(t,!0);try{for(o.s();!(n=o.n()).done;){var a=n.value;if("."===(a=a.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(a.toLowerCase(),e.name.length-a.length))return !0}else if(/\/\*$/.test(a)){if(i===a.replace(/\/.*$/,""))return !0}else if(r===a)return !0}}catch(e){o.e(e);}finally{o.f();}return !1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each((function(){return new b(this,e)}))}),b.ADDED="added",b.QUEUED="queued",b.ACCEPTED=b.QUEUED,b.UPLOADING="uploading",b.PROCESSING=b.UPLOADING,b.CANCELED="canceled",b.ERROR="error",b.SUCCESS="success";var E=function(e,t,n,r,i,o,a,u,s,l){var c=function(e){e.naturalWi
19349dth;var t=e.naturalHeight,n=document.createElement("canvas");n.width=1,n.height=t;var r=n.getContext("2d");r.drawImage(e,0,0);for(var i=r.getImageData(1,0,1,t).data,o=0,a=t,u=t;u>o;)0===i[4*(u-1)+3]?a=u:o=u,u=a+o>>1;var s=u/t;return 0===s?1:s}(t);return e.drawImage(t,n,r,i,o,a,u,s,l/c)},k=function(){function e(){p(this,e);}return d(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";}},{key:"encode64",value:function(e){for(var t="",n=void 0,r=void 0,i="",o=void 0,a=void 0,u=void 0,s="",l=0;o=(n=e[l++])>>2,a=(3&n)<<4|(r=e[l++])>>4,u=(15&r)<<2|(i=e[l++])>>6,s=63&i,isNaN(r)?u=s=64:isNaN(i)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(u)+this.KEY_STR.charAt(s),n=r=i="",o=a=u=s="",l<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),r=this.slice2Segments(n),i=this.exifManipulation(t,r);return "data:image/jpeg;base64,".concat(this.encode64(i))}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),r=this.insertExif(e,n);return new Uint8Array(r)}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(255===(t=e[n])[0]&225===t[1])return t;n++;}return []}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),r=this.decode64(n),i=r.indexOf(255,3),o=r.slice(0,i),a=r.slice(i),u=o;return (u=u.concat(t)).concat(a)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];!(255===e[t]&218===e[t+1]);){if(255===e[t]&216===e[t+1])t+=2;else {var r=t+(256*e[t+2]+e[t+3])+2,i=e.slice(t,r);n.push(i),t=r;}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,r="",i=void 0,o=void 0,a="",u=0,s=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(u++))<<2|(i=this.KEY_STR.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(o=this.KEY_STR.indexOf(e.charAt(u++)))>>2,r=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(u++))),s.push(t),64!==o&&s.push(n),64!==a&&s.push(r),t=n=r="",i=o=a="",u<e.length;);return s}}]),e}();k.initClass(),b._autoDiscoverFunction=function(){if(b.autoDiscover)return b.discover()},function(e,t){var n=!1,r=!0,i=e.document,o=i.documentElement,a=i.addEventListener?"addEventListener":"attachEvent",u=i.addEventListener?"removeEventListener":"detachEvent",s=i.addEventListener?"":"on",l=function r(o){if("readystatechange"!==o.type||"complete"===i.readyState)return ("load"===o.type?e:i)[u](s+o.type,r,!1),!n&&(n=!0)?t.call(e,o.type||o):void 0};if("complete"!==i.readyState){if(i.createEventObject&&o.doScroll){try{r=!e.frameElement;}catch(e){}r&&function e(){try{o.doScroll("left");}catch(t){return void setTimeout(e,50)}return l("poll")}();}i[a](s+"DOMContentLoaded",l,!1),i[a](s+"readystatechange",l,!1),e[a](s+"load",l,!1);}}(window,b._autoDiscoverFunction),window.Dropzone=b;var A=b;}(),r}()})); 19350 19351/** 19352 * dropzone-binding.js - Wrapper for Dropzone.js which manages potentially many file upload 19353 * form elements on the current page and abstracts the form Dropzone element setup. 19354 */ 19355 19356// Disable autoDiscover; dropzones are manually setup 19357Dropzone.autoDiscover = false; 19358 19359// See `firstDropzone.on('successmultiple', ...)` below. 19360window.onpopstate = function(event) { 19361 if (event.state.hasOwnProperty('reloadUrl')) { 19362 // Refresh the page if specified 19363 window.location.href = event.state.reloadUrl; 19364 } 19365}; 19366 19367/** DropzoneUtil **/ 19368window.DropzoneUtil = {}; 19369 19370DropzoneUtil.activeDropzones = {}; 19371// Stores data about the current submission being processed. 19372// This will either be 'anon' if a submitted button couldn't be found, or the submit button jQuery itself. 19373DropzoneUtil.submitRequestInProgress = null; 19374// Stores a jQuery instance of the last button pressed and its form, regardless if a submission is 19375// already in progress. 19376// Storing the exact button is important as some forms have different behaviour depending 19377// on the clicked button (MultiButtons). 19378DropzoneUtil.lastClickedSubmit = {form: null, button: null}; 19379 19380/** 19381 * Generate a Dropzone FileUpload widget from the library, filling a container element 19382 * 19383 * Note: userName here is the user's display name, not login username. 19384 * @param {jQuery} jQ jquery instance. 19385 * @param {string} dzSelector A selector for the Dropzone container element 19386 * @param {string} formName The name of the form this FileUpload is attached to. 19387 * @param {object} options List of DropzoneJS options. Check out their docs. 19388 * @param {MockFile[]} mockFiles An array of existing 'mock' files to list, w/ DL links. 19389 * @param {boolean} readOnly If the Dropzone can be edited. 19390 * @param {object|null} historyData Necessary file version data to populate the dialog. 19391 * @param {WarningElem} warningElem Data about a form element which should prompt for "It seems you forgot to 19392 * upload a file" prompt. 19393 * @param {ImageOptions} imageOptions Compression & resize options for images. 19394 * 19395 * historyData Structure: { <versionID>: { 19396 * 'files': see `mockFiles` above 19397 * 'details': {verDate:<str eg '22-Jun-2018 11:12'}, userName:<str> } 19398 * } 19399 * @see ops_Form_Element_FileUpload.tpl 19400 * @public 19401 */ 19402DropzoneUtil.addDropzone = function 19403( 19404 jQ, 19405 dzSelector, 19406 formName, 19407 options, 19408 mockFiles, 19409 readOnly, 19410 historyData, 19411 warningElem, 19412 imageOptions 19413) 19414{ 19415 var fullOptions = jQ.extend({ 19416 "addRemoveLinks": !readOnly, 19417 "clickable": !readOnly, 19418 "dictDefaultMessage": readOnly ? 'No files available. Upload is currently not permitted.' : 'Click or drop files here to upload', 19419 "autoProcessQueue": false, // Prevent files from being uploaded until submit click. 19420 "uploadMultiple": true, 19421 "parallelUploads": 100, 19422 "formName": formName, 19423 "maxFiles": 100, 19424 }, options); 19425 19426 // Dropzone takes the selector query directly, since it does not rely on jQuery. 19427 var dz = new Dropzone(dzSelector, fullOptions); 19428 19429 dz.on('sendingmultiple', function(files, xhr, formData) { 19430 DropzoneUtil._processDropzoneQueue(xhr, formData, formName); 19431 }); 19432 19433 dz.options.transformFile = async (file, done) => { 19434 let transformedFile = await DropzoneUtil.transformImage(file, dz.custom.imageOptions); 19435 done(transformedFile || file); 19436 }; 19437 19438 if (!DropzoneUtil.activeDropzones.hasOwnProperty(formName)) { 19439 DropzoneUtil.activeDropzones[formName] = []; 19440 } 19441 19442 DropzoneUtil.activeDropzones[formName].push(dz); 19443 DropzoneUtil._setMockFiles(dz, mockFiles); 19444 19445 var $buttonContainer = jQ(dzSelector).next(); 19446 19447 // Custom properties on Dropzone instance itself. 19448 dz.custom = {}; 19449 dz.custom.reassignedVersion = null; 19450 dz.custom.warningElem = warningElem; 19451 dz.custom.$messageBox = $buttonContainer.next(); 19452 dz.custom.imageOptions = imageOptions; 19453 19454 /** Button Handlers & Message box: **/ 19455 19456 if (readOnly) { // Hide buttons for read-only dropzones: 19457 return; 19458 } 19459 19460 dz.options.dictRemoveFileConfirmation = 'Do you want to remove this file?'; 19461 19462 // If data for populating the File History dialog is supplied, then build the necessary callbacks 19463 // to generate this dialog. 19464 if (historyData) { 19465 var $historyBtn = $buttonContainer.find('.dropzone-history'); 19466 $historyBtn.click(function() { 19467 DropzoneHistoryUtil.renderHistoryDialog($(this), dz, historyData); 19468 }); 19469 } 19470 19471 // "Paste" button: hidden by default. Show if this browser supports the Async Clipboard API and the 19472 // suitable (Image) file types are permitted 19473 let $pasteButton = $buttonContainer.find('.dropzone-paste'); 19474 if (DropzoneUtil.asyncPasteSupported() && DropzoneUtil.acceptsPasteType(dz) && $pasteButton.length > 0) { 19475 $pasteButton.removeClass('hidden'); // Show "Paste". 19476 } 19477 // "Paste" button handler, mapped for this dropzone. This will try to use the Async Clipboard API. 19478 $pasteButton.click(function(){ 19479 DropzoneUtil.pasteHandler(dz); 19480 }); 19481 // Ctrl-V Handler. Apply on closest parent form element container (currently taken as a "tr" element): 19482 $buttonContainer.closest('tr').on('paste', function (event) { 19483 DropzoneUtil.pasteHandler(dz, event.originalEvent); 19484 }); 19485 19486 // Prepare Dropzone message box: 19487 dz.custom.$messageBox.hide(); // jQuery hide, for use with slide transition. 19488 dz.custom.$messageBox.removeClass('hidden'); 19489 19490 // Reset dropzone message after any of these events: 19491 ['drop', 'addedfile', 'removedfile'].forEach(function(item){ 19492 dz.on(item, function(){ DropzoneUtil.resetMessage(dz); }); 19493 }); 19494}; 19495 19496 19497/** 19498 * The handler being bound assumes the form has a dropzone element. 19499 * @param {jQuery} $form The form to bind the handler to. 19500 * @public 19501 */ 19502DropzoneUtil.bindSubmitHandler = function($form) { 19503 19504 // Prevent accidental browser file preview when dragging+dropping a file. 19505 disableBrowserFilePreview(); 19506 19507 // Override all submit click handlers so we can identify which submit was clicked when 19508 // submission occurs.
19509 // NOTE: The onClick event always occurs before onSubmit. Should an onClick handler return FALSE, then 19510 // onSubmit won't fire. 19511 $form.find('input[type=submit]').click(function(){ 19512 DropzoneUtil.lastClickedSubmit = {form: $form, button: $(this)}; 19513 }); 19514 19515 // Override the form submit to aggregate all dropzone data 19516 $form.submit(function(e){ 19517 // Do not kick off the submit handler if there is already another submission going on. 19518 if (!DropzoneUtil._submissionInProgress()) { 19519 // No other submissions going on. Flag this as the current submission. 19520 DropzoneUtil._setCurrentSubmission($form); 19521 // Begin file upload / submission 19522 DropzoneUtil._submitHandler($form); 19523 } 19524 return false; 19525 }); 19526}; 19527 19528/** 19529 * Show a message below the dropzone; feedback to the user. 19530 * @param {Dropzone} dz 19531 * @param {string} msg 19532 * @return {Promise} Resolves on message animation end. 19533 * @public 19534 */ 19535DropzoneUtil.setMessage = function(dz, msg) { 19536 // Set message and show box. 19537 return new Promise(function(resolve){ 19538 let $box = dz.custom.$messageBox; 19539 $box.html(msg); 19540 $box.slideDown(undefined, resolve); 19541 }); 19542}; 19543 19544/** 19545 * Hide message box 19546 * @param dz 19547 * @return {Promise} Resolves on message animation end. 19548 * @public 19549 */ 19550DropzoneUtil.resetMessage = function(dz){ 19551 return new Promise(function(resolve) { 19552 dz.custom.$messageBox.slideUp(undefined, resolve); 19553 }); 19554}; 19555 19556/** 19557 * If the current submission was anonymous i.e. was not triggered by the click of a "Submit" button. 19558 * @return {boolean} 19559 * @private 19560 */ 19561DropzoneUtil._isAnonymousSubmission = function() { 19562 return DropzoneUtil.submitRequestInProgress === 'anon'; 19563}; 19564 19565/** 19566 * Are we currently submitting a form? 19567 * @return {boolean} 19568 * @private 19569 */ 19570DropzoneUtil._submissionInProgress = function() { 19571 return Boolean(DropzoneUtil.submitRequestInProgress); 19572}; 19573 19574/** 19575 * Flag a form as in the process of being submitted, so we can reject any other submission attempts. 19576 * @param $form 19577 * @private 19578 */ 19579DropzoneUtil._setCurrentSubmission = function($form) { 19580 // If this submission is from a button on the same form 19581 if ($form.is(DropzoneUtil.lastClickedSubmit.form)) { 19582 this.submitRequestInProgress = DropzoneUtil.lastClickedSubmit.button; 19583 // Else - assume this is an anonymous submission 19584 } else { 19585 this.submitRequestInProgress = 'anon'; 19586 } 19587}; 19588 19589/** 19590 * If a submission is in progress, cancel it. 19591 * @private 19592 */
19593DropzoneUtil._cancelSubmit = function() { 19594 19595 if (!this._isAnonymousSubmission()) { 19596 // Unlock the submit button. 19597 this.submitRequestInProgress.lockSubmitReset(); 19598 } 19599 19600 this.lastClickedSubmit.form = null; 19601 this.lastClickedSubmit.button = null; 19602 this.submitRequestInProgress = null; 19603}; 19604 19605/** 19606 * @param $form 19607 * @private 19608 */ 19609DropzoneUtil._submitHandler = async function ($form) { 19610 19611 // Force all tinyMCE elements to save, allowing the formData aggregation later to include 19612 // these fields 19613 tinyMCE.triggerSave(); 19614 19615 let formId = $form.attr('id'); 19616 var dropzoneSet = DropzoneUtil.activeDropzones[formId]; 19617 var firstDropzone = dropzoneSet[0]; 19618 19619 // Check if any of the dropzones warn about the presence of words such as "attachment" or "embedded". 19620 // If one of these words are detected in the linked field, and that dropzone has a value, then give the 19621 // user a warning prompt before submission. 19622 var fileAttachSubstrings = ['screenshot', 'attach', 'embed', 'upload']; 19623 19624 var matchedDz = null; 19625 var matchedSubstr = null; 19626 19627 for (let dz of dropzoneSet) { 19628 if (matchedDz) { // Break if we find a DZ we need to warn the user about. 19629 break; 19630 } 19631 // If the dropzone needs attach warnings, and is missing files: 19632 if (dz.custom.warningElem.hasOwnProperty('id') && dz.files.length < 1) {
19633 var $elem = $('#'+dz.custom.warningElem.id); 19634 // Warning attachment must be set on a text field: 19635 var submittedTextToCheck = $elem.val().toLowerCase(); 19636 for (let str of fileAttachSubstrings) { 19637 if (submittedTextToCheck.indexOf(str) !== -1) { 19638 matchedSubstr = str; 19639 matchedDz = dz; 19640 break; 19641 } 19642 } 19643 } 19644 } 19645 19646 // If a dropzone is missing files and a keyword is used e.g. "screenshot". 19647 if (matchedDz) { 19648 var attachWarning = 19649 'It seems you forgot to attach a file.\n\n' 19650 +'The field "'+matchedDz.custom.warningElem.label+'" contains the word "' 19651 + matchedSubstr + '" but no files have been uploaded. Submit anyway?' 19652 ; 19653 19654 if (!confirm(attachWarning)) { 19655 // The user does not want to submit. Abort: 19656 DropzoneUtil._cancelSubmit(); 19657 return; 19658 } 19659 } 19660 19661 // Show the window unload transition (menu spinning animation) 19662 window.unloadTransition(); 19663 19664 firstDropzone.on('successmultiple', function(files, responseText, ajaxEvent){ 19665 19666 // Below we are going to replace the DOM state with the HTML from `responseText`. 19667 // To ensure that the current page (before the POST submission) is preserved in the history (back button) log, 19668 // add the current url to the history state. 19669 // Then, add a new history state storing the the POST response url, which can be different from 19670 // `window.location.href` if the response is a redirect. 19671 // This `reloadUrl` can be used to reload the current state regardless of what the browser has cached 19672 // after it's DOM has been replaced. 19673 window.history.replaceState({reloadUrl: window.location.href}, null, null); 19674 window.history.pushState({reloadUrl: ajaxEvent.target.responseURL}, null, ajaxEvent.target.responseURL); 19675 19676 // Replace DOM HTML. Inspired by https://stackoverflow.com/a/11984907 19677 document.open(); 19678 document.write(responseText); 19679 document.close(); 19680 }); 19681 19682 // For the submitted form, aggregate the data in all dropzones in that form into the FIRST 19683 // dropzone. 19684 // See `_processDropzoneQueue` below. 19685 19686 if (firstDropzone.getQueuedFiles().length > 0) { 19687 19688 firstDropzone.processQueue(); 19689 } else { 19690 // If no files are uploaded by the user, we need to manually invoke the upload process as 19691 // dropzone.js won't do it for us. The request object won't count a file named "nofiles" as a 19692 // valid file. 19693 var file = new Blob(); 19694 file.name = 'nofiles'; 19695 file.upload = {filename: 'nofiles'}; 19696 firstDropzone.uploadFiles([file]); 19697 } 19698}; 19699 19700// This should only be called once per form, and assumes that `formData` has already been populated 19701// with the files from the FIRST dropzone element in that form. 19702DropzoneUtil._processDropzoneQueue = function(xhr, formData, formName) { 19703 19704 var $form = $('#'+formName); 19705 19706 // Append all the non-dropzone form data: 19707 // .serializeArray will convert a form into a set of key-value pairs for each element. 19708 $.each($form.serializeArray(), function(index, formElem){ 19709 formData.append(formElem.name, formElem.value); 19710 }); 19711 // Add the submit element, if it exists: 19712 if (!DropzoneUtil._isAnonymousSubmission()) { 19713 formData.append( 19714 DropzoneUtil.submitRequestInProgress.attr('name'), 19715 DropzoneUtil.submitRequestInProgress.attr('value') 19716 ); 19717 } 19718 19719 var setReassignedVer = function(dz) { 19720 if (dz.custom.reassignedVersion !== null) { 19721 formData.append( 19722 dz.options.paramName+'_reassigned', 19723 dz.custom.reassignedVersion 19724 ); 19725 } 19726 }; 19727 19728 var dropzoneSet = DropzoneUtil.activeDropzones[$form.attr('id')]; 19729 DropzoneUtil._markFilesForPreservation(dropzoneSet[0], formData); 19730 setReassignedVer(dropzoneSet[0]); 19731 19732 // Append the files attached to all other dropzone elements. 19733 // Use an incrementing for loop beginning at 1 so we can skip the first dropzone, 19734 // which is this instance. 19735 for (var i = 1; i < dropzoneSet.length; i++) { 19736 // @var files Array 19737 var files = dropzoneSet[i].getQueuedFiles(); 19738 19739 DropzoneUtil._markFilesForPreservation(dropzoneSet[i], formData); 19740 setReassignedVer(dropzoneSet[i]); 19741 19742 for (var fileIdx = 0; fileIdx < files.length; fileIdx++){ 19743 formData.append( 19744 // _getParamName (idx) will provide a array input value POST name for a provided 19745 // index, e.g. "ops_Form__myDropzone[0]" 19746 dropzoneSet[i]._getParamName(fileIdx), 19747 files[fileIdx], 19748 files[fileIdx].name // 3rd param - Filename. 19749 ); 19750 } 19751 } 19752 19753 xhr.setRequestHeader('X-Dropzone-Request', 'true'); 19754};
19755 19756DropzoneUtil._markFilesForPreservation = function(dz, formData){ 19757 $.each(dz.files, function(idx, f){ 19758 if (f.hasOwnProperty('isMock')) { 19759 formData.append( 19760 dz.options.paramName+'_existing[]', 19761 f.name 19762 ); 19763 } 19764 }); 19765}; 19766 19767// Show 'Download' link 19768// See: https://github.com/enyo/dropzone/issues/694 19769/** 19770 * @param {MockFile} file 19771 * @private 19772 */ 19773DropzoneUtil._addDownloadLink = function(file) { 19774 if (!file.downloadURL) { 19775 return; 19776 } 19777 var a = document.createElement('a'); 19778 a.className = 'dropzone-download'; 19779 a.target = '_blank'; 19780 a.setAttribute('href', file['downloadURL']); 19781 19782 e = $(file.previewTemplate).find('.dz-details'); 19783 e.wrap(a); 19784}; 19785 19786/** 19787 * 19788 * Add files to an existing dropzone instance. 19789 * See: https://github.com/enyo/dropzone/wiki/FAQ#how-to-show-files-already-stored-on-server 19790 * @param {Dropzone} dz 19791 * @param {MockFile[]} mockFiles See PHP: `getFileArrJson`. 19792 * @protected 19793 */ 19794DropzoneUtil._setMockFiles = function(dz, mockFiles) { 19795 dz.removeAllFiles(); 19796 for (let f of mockFiles) { 19797 dz.files.push(f); 19798 if (f.kind === 'image') { 19799 dz.displayExistingFile(f, f.downloadURL); 19800 } else { 19801 dz.emit("addedfile", f); 19802 dz.emit("complete", f); 19803 // Make sure that there is no progress bar, etc 19804 } 19805 DropzoneUtil._addDownloadLink(f); 19806 } 19807 19808 // Ensure maxFiles checks are valid 19809 dz._updateMaxFilesReachedClass(); 19810}; 19811 19812/** 19813 * Compress or resize images files before upload. Supports PNG, JPEG and WEBP. 19814 * If compression is enabled, PNG files above 5MB will be converted to JPEG. 19815 * @param {Blob} file 19816 * @param {ImageOptions} options 19817 * @return {?Blob} 19818 * @private 19819 */ 19820DropzoneUtil.transformImage = async function(file, options) { 19821 19822 // Avoid any further processing when not required: 19823 if (!options.compressEnabled && Object.entries(options).length === 1) { 19824 return null; 19825 } 19826 19827 // Ignore mock (already uploaded) files, or files without name property 19828 if (file['isMock'] || !file['name']) { 19829 return null; 19830 } 19831 // Only attempt compression on files with expected extension present in file name. 19832 // MIME Type is not available. 19833 let extension = file.name.split('.').pop().toLowerCase(); 19834 if (!['jpg', 'jpeg', 'jpe', 'png', 'webp'].includes(extension)) { 19835 return null; 19836 } 19837 19838 // Compression is on by default. If disabled, manually set fields to avoid quality loss. 19839 if (!options.compressEnabled) { 19840 options.quality = 1; 19841 options.convertSize = Infinity; // Do not convert PNGs to JPEGs. 19842 } 19843 19844 // Compress + transform promise: 19845 let compress = new Promise((resolve, reject) => { 19846 let currentOptions = Object.assign({ 19847 quality: 0.8, // Default compression level. 19848 success: resolve, // Promise will resolve on compress finish. 19849 error: reject, 19850 }, options); 19851 19852 new Compressor(file, currentOptions); 19853 }); 19854 19855 try { 19856 return await compress; 19857 } catch (err) { 19858 console.error(err); 19859 // Avoid compression and send file as-is: 19860 return null; 19861 } 19862}; 19863 19864/** 19865 * @typedef {{id: ?string, label: ?string, type: ?string}} WarningElem 19866 */ 19867 19868/** 19869 * @typedef {{name: string, size: number, isMock: boolean, accepted: boolean, kind: string, downloadURL: ?string}} MockFile 19870 */ 19871 19872/** 19873 * @see ImageOptions.php Options used by CEDAR. 19874 * @typedef {CompressorJsOptions} ImageOptions 19875 * @property {boolean} compressEnabled 19876 */ 19877/** 19878 * @see https://github.com/fengyuanchen/compressorjs#options 19879 * @typedef {Object} CompressorJsOptions 19880 * @property {?boolean} strict 19881 * @property {?boolean} checkOrientation 19882 * @property {?number} maxWidth 19883 * @property {?number} maxHeight 19884 * @property {?number} minWidth 19885 * @property {?number} minHeight 19886 * @property {?number} width 19887 * @property {?number} height 19888 * @property {?number} quality 19889 * @property {?string} mimeType 19890 * @property {?number} convertSize Minimum threshold (in bytes) for PNGs to be converted to JPEGs. 19891 * @property {?Function} beforeDraw 19892 * @property {?Function} drew 19893 * @property {?Function} success 19894 * @property {?Function} error 19895 */ 19896 19897/* global DropzoneUtil */ 19898 19899/** 19900 * Static object for managing the Dropzone 'File History' dialog. 19901 * @global 19902 */ 19903 19904/** @TODO: responseFlashRedirect reloads assets twice. This is a workaround fix. */ 19905if (typeof DropzoneHistoryUtil$1 === 'undefined') { 19906 var DropzoneHistoryUtil$1; 19907} 19908DropzoneHistoryUtil$1 = {}; 19909 19910/** 19911 * Generate and render on-screen a 'File History' dialog for a specified dropzone. 19912 * @see DropzoneUtil.addDropzone 19913 * @param {jQuery} $histBtn Button which launched this dialog 19914 * @param {Dropzone} dz The dropzone this button is bound to. 19915 * @param {object} historyData History data for the Dropzone's FileRepo. See addDropzone. 19916 */ 19917DropzoneHistoryUtil$1.renderHistoryDialog = function($histBtn, dz, historyData) { 19918 19919 /* Create the modal window and populate its HTML */ 19920 19921 var index = createModal($histBtn); 19922 var $modal = $('.ops_page_modal_instance[id=' + index + ']'); 19923 19924 var selectedVer = dz.custom.reassignedVersion; 19925 19926 var html = DropzoneHistoryUtil$1._generateDialogHTML(historyData, selectedVer); 19927 19928 $modal 19929 .find('.ops_page_modal_content') 19930 .html(html); 19931 19932 /* Create Preview Dropzone */ 19933 19934 var previewDz = new Dropzone('#fs-history-dropzone', { 19935 "addRemoveLinks": false, 19936 "url": '#', 19937 "clickable": false, 19938 "dictDefaultMessage": 'No files to show.', 19939 "autoProcessQueue": false, // Prevent files from being uploaded until submit click. 19940 "uploadMultiple": true, 19941 "parallelUploads": 100, 19942 "maxFiles": 100 19943 }); 19944 19945 /* Bind version management event handlers */ 19946 19947 var $rollbackBtn = $('#fs-history-submit'); 19948 var $versionSelect = $('#fs-history-versions'); 19949
19950 // 'Rollback' submit confirmation 19951 $rollbackBtn.click(function() { 19952 var verId = DropzoneHistoryUtil$1._getSelectedVersion($versionSelect, historyData); 19953 if (verId !== null){ 19954 dz.custom.reassignedVersion = verId; 19955 // Make a deep copy of an array of the files array 19956 var files = JSON.parse(JSON.stringify(historyData[verId].files)); 19957 DropzoneUtil._setMockFiles(dz, files); 19958 closeModal(index, true); 19959 } 19960 }); 19961 19962 // Past version selection -> update information on screen 19963 $versionSelect.change(function(){ 19964 var verId = DropzoneHistoryUtil$1._getSelectedVersion($versionSelect, historyData); 19965 19966 if (verId !== null) { 19967 DropzoneHistoryUtil$1._populateWithVersion($rollbackBtn, previewDz, index, verId, historyData); 19968 } else { 19969 // Failed to validate - Pass with no args to reset the fields and disable rollback. 19970 // noinspection JSCheckFunctionSignatures 19971 DropzoneHistoryUtil$1._populateWithVersion($rollbackBtn, previewDz, index); 19972 } 19973 }); 19974 19975 /* Re-populate if necessary */ 19976 19977 if (selectedVer) { 19978 DropzoneHistoryUtil$1._populateWithVersion($rollbackBtn, previewDz, index, selectedVer, historyData); 19979 } 19980 19981 // Set the modal's positioning now that everything has been populated. 19982 positionModal(index); 19983 19984}; 19985 19986DropzoneHistoryUtil$1._getSelectedVersion = function($versionSelect, historyData) { 19987 var $selectedVerId = $versionSelect.find('option:selected'); 19988 // Ensure they've only selected 1 version. 19989 if ($selectedVerId.length === 1) { 19990 var verId = $selectedVerId.data('versionId'); 19991 if (historyData.hasOwnProperty(verId)) { 19992 return verId; 19993 } 19994 } 19995 return null; 19996}; 19997 19998/** 19999 * Generate the HTML to be inserted into the dialog window. This will only be called 20000 * once when the window is initially generated. 20001 * 20002 * historyData Structure: { <versionID>: { 20003 * 'files': see `mockFiles` above 20004 * 'details': {verDate:<string eg '22-Jun-2018 11:12'}, userName:<string> } 20005 * } 20006 * 20007 * @param {object} historyData 20008 * @param {Dropzone} dz 20009 * @returns {selectedVer: *, html: string} 20010 * @private 20011 */ 20012DropzoneHistoryUtil$1._generateDialogHTML = function(historyData, selectedVer) { 20013 20014 var optionsHtml = ''; 20015 20016 for (let verId in historyData) { 20017 var selectedOrEmpty = ''; 20018 20019 // == comparison is deliberate here. 20020 if (selectedVer == verId) {
20021 selectedOrEmpty = 'selected'; 20022 } 20023 20024 var listing = historyData[verId].details.verDate+' by '+historyData[verId].details.userName; 20025 20026 // Note - we prepend `optionsHTML` because the `for( in )` loop will automatically order numerical keys 20027 // ASC, which we don't want. 20028 optionsHtml = '<option '+selectedOrEmpty+' data-version-id="'+verId+'">'+listing+'</option>'+optionsHtml; 20029 } 20030 20031 var html = '' 20032 + '<div class="dashboard">' 20033 20034 + '<div class="content_sized headed_box">' 20035 + '<h2>Select Version</h2>' 20036 + '<div class="spaced-lesser content_sized dashboard">' 20037 + '<div class="content_sized" style="min-width: 5rem; max-width: 20rem">' 20038 + '<select id="fs-history-versions" multiple class="minimal_scrollbars" style="width:100%">' 20039 + optionsHtml 20040 + '</select>' 20041 + '</div>' 20042 20043 + '<div class="content_sized" style="min-width: 5rem; max-width: 20rem">' 20044 + '<table class="property-table" >' 20045 + '<tbody>' 20046 + '<tr>' 20047 +'<td>Date</td>' 20048 +'<td id="fs-history-date"></td>' 20049 +'</tr>' 20050 +'<tr>' 20051 +'<td>Updated By</td>' 20052 +'<td id="fs-history-user"></td>' 20053 +'</tr>' 20054 + '</tbody>' 20055 + '</table>' 20056 + '</div>' 20057 + '</div>' 20058 20059 + '<div class="centered">' 20060 + '<button disabled id="fs-history-submit" class="centered action">' 20061 + 'Rollback to this Version' 20062 + '</button>' 20063 + '</div>' 20064 + '</div>' 20065 20066 + '<div class="content_sized headed_box">' 20067 + '<h2>File Preview</h2>' 20068 + '<div><div id="fs-history-dropzone" class="dropzone" style="max-width: 32rem"></div></div>' 20069 + '</div>' 20070 20071 + '</div>' 20072 ; 20073 20074 return html; 20075}; 20076 20077/** 20078 * Populate the dialog version widgets with details of a supplied version. 20079 * If `versionId` is null or unset, then instead clear out the widgets and disable the 20080 * reassignment/rollback button. 20081 * @param {jQuery} $rollbackBtn 20082 * @param previewDz 20083 * @param versionId 20084 * @param historyData 20085 * @private 20086 */ 20087DropzoneHistoryUtil$1._populateWithVersion = function($rollbackBtn, previewDz, modalIdx, versionId, historyData) { 20088 20089 var files = []; 20090 var userName = ''; 20091 var verDate = ''; 20092 var canRollback = false; 20093 20094 if (versionId) { 20095 // Make a deep copy of an array of the files array 20096 var files = JSON.parse(JSON.stringify(historyData[versionId].files)); 20097 verDate = historyData[versionId].details.verDate; 20098 userName = historyData[versionId].details.userName; 20099 canRollback = true; 20100 } 20101 DropzoneUtil._setMockFiles(previewDz, files); 20102 $('#fs-history-date').html(verDate); 20103 $('#fs-history-user').html(userName); 20104 $rollbackBtn.attr('disabled', !canRollback); 20105 20106 //positionModal(modalIdx); 20107}; 20108 20109/** 20110 * Dropzone image paste functions, separated from `dropzone-binding.js` to avoid ES6+ syntax errors on IE11. 20111 */ 20112 20113// Permitted MIME types when pasting: 20114DropzoneUtil.supportedPasteTypes = { 20115 'image/png': {extension: 'png'}, 20116 'image/jpeg': {extension: 'jpg'}, 20117}; 20118// Pasted image base name. A "paste index" a file extension is appended to this e.g. "Image 1.png". 20119DropzoneUtil.PASTE_NAME = 'Image'; 20120// Error if no image was found in the clipboard on paste. 20121DropzoneUtil.UNEXPECTED_CLIPBOARD_DATA = 'UNEXPECTED_CLIPBOARD_DATA'; 20122 20123/** 20124 * Can this browser use the Async Clipboard API? 20125 * @return {boolean} 20126 */ 20127DropzoneUtil.asyncPasteSupported = () => { 20128 return Boolean(navigator && navigator.clipboard && navigator.clipboard.read); 20129}; 20130 20131/** 20132 * Check if a dropzone accepts files which can be pasted (images mainly). 20133 * @param {Dropzone} dz 20134 * @return {boolean} 20135 */ 20136DropzoneUtil.acceptsPasteType = (dz) => { 20137 let dzAcceptedStr = (dz.options.acceptedFiles || '').trim(); 20138 if (!dzAcceptedStr) { 20139 // No whitelist required: All possible paste types are valid: 20140 return true; 20141 } 20142 let dzAccepted = dzAcceptedStr.split(','); 20143 // Ensure e.g. "image/*" is still indicated as an accepted type: 20144 let showPasteMimes = new Set(); 20145 for (let mime of Object.keys(DropzoneUtil.supportedPasteTypes)) { 20146 let mimeWildcard = mime.substring(0, mime.indexOf('/')) + '/*';
20147 showPasteMimes.add(mimeWildcard); 20148 showPasteMimes.add(mime); 20149 } 20150 // Check dzAccepted has at-least one of the paste mimes: 20151 for (let mime of showPasteMimes) { 20152 if (dzAccepted.includes(mime)) { 20153 return true; 20154 } 20155 } 20156 return false; 20157}; 20158 20159/** 20160 * Handle paste events. Attempts to populate image data as a file. 20161 * Populates either through an optional ClipboardEvent (supplied if Ctrl-V is pressed) or the Async Clipboard API. 20162 * @param {Dropzone} dz 20163 * @param {ClipboardEvent} clipboardEvent 20164 */ 20165DropzoneUtil.pasteHandler = async (dz, clipboardEvent = null) => { 20166 20167 try { 20168 // If ClipboardEvent is set, populate using data from that. Else, attempt to retrieve clipboard contents 20169 // using Async Clipboard API. 20170 if (clipboardEvent) { 20171 DropzoneUtil._pasteFileFromEvent(dz, clipboardEvent); 20172 } else { 20173 await DropzoneUtil._asyncPasteHandler(dz); 20174 } 20175 20176 } catch (pasteErr) { 20177 20178 // Clear any error messages and wait for the message transition to finish. 20179 await DropzoneUtil.resetMessage(dz); 20180 20181 let msg = `<b>No image found in clipboard.</b> 20182 <br>For simple screenshots, try pressing <b>PrintScreen</b> on your keyboard and paste again.`; 20183 20184 // If the user did not give browser permission on page: 20185 if (pasteErr instanceof DOMException && pasteErr.name === 'NotAllowedError') { 20186 msg = '<b>Permission denied on browser.</b> Try <b>Ctrl-V</b> instead.'; 20187 } 20188 DropzoneUtil.setMessage(dz, msg); 20189 } 20190}; 20191 20192/** 20193 * Attempt to add clipboard image content to the supplied Dropzone via Async Clipboard API. 20194 * This will work in any context and does not require a ClipboardEvent. 20195 * @param {Dropzone} dz 20196 * @return {Promise<boolean>} 20197 * @throws {Error} If no valid image data is in clipboard. 20198 * @throws {DOMException} NotAllowedError if clipboard access is unavailable. 20199 */ 20200DropzoneUtil._asyncPasteHandler = async (dz) => { 20201 // Get file Blob from clipboard, or `null`. 20202 let [blob, mimeType] = await DropzoneUtil._getClipboardImage(); 20203 // Add blob to dropzone: 20204 DropzoneUtil._addBlobAsFile(dz, blob, mimeType); 20205}; 20206 20207/** 20208 * Add file from event data following a "paste" event. 20209 * @param {Dropzone} dz 20210 * @param {ClipboardEvent} event 20211 */ 20212DropzoneUtil._pasteFileFromEvent = (dz, event) => { 20213 for (let item of event.clipboardData.items) { 20214 if (item.kind === 'file' && item.type in DropzoneUtil.supportedPasteTypes) { 20215 let file = item.getAsFile(); 20216 // Extract a Blob instance containing just file content. Necessary to overwrite read-only `File.name`. 20217 let blob = file.slice(0, file.size, file.type); 20218 DropzoneUtil._addBlobAsFile(dz, blob, item.type); 20219 return; 20220 } 20221 } 20222 throw DropzoneUtil.UNEXPECTED_CLIPBOARD_DATA; 20223}; 20224 20225/** 20226 * Add Blob instance for a supported image paste type to this dropzone as a file. 20227 * @param {Dropzone} dz 20228 * @param {Blob} blob 20229 * @param {string} mimeType 20230 * @protected 20231 */ 20232DropzoneUtil._addBlobAsFile = (dz, blob, mimeType) => { 20233 // Prepare blob for dropzone: 20234 let pasteIndex = DropzoneUtil._getPasteIndex(dz); // Include image number e.g. "Image 1.png", "Image 2.png" etc. 20235 let extension = DropzoneUtil.supportedPasteTypes[mimeType].extension; 20236 blob.name = `${DropzoneUtil.PASTE_NAME} ${pasteIndex}.${extension}`; 20237 dz.addFile(blob); 20238}; 20239 20240/** 20241 * Get next available paste index (e.g. "Image 1", "Image 2" etc) on a Dropzone instance. 20242 * @param {Dropzone} dz 20243 * @return {number} 20244 * @protected 20245 */ 20246DropzoneUtil._getPasteIndex = (dz) => { 20247 if (!Array.isArray(dz.files)) { 20248 return 1; 20249 } 20250 20251 let sortedFileNames = dz.files.map(file => {return file.name; }).sort(); 20252 let idx = 1; 20253 for (let name of sortedFileNames) { 20254 // Does a file already exist with this name? (ignoring file extension). 20255 if (!name.startsWith(DropzoneUtil.PASTE_NAME + ' ' + idx)) { 20256 break; 20257 } 20258 idx++; 20259 } 20260 return idx; 20261}; 20262 20263/** 20264 * Retrieve first image Blob from the clipboard. 20265 * @return {Promise<(Array>} Index 0: The image Blob. Index 1: The image MIME type. 20266 * @throws {Error} If no valid image data is in clipboard. 20267 * @throws {DOMException} NotAllowedError if clipboard access is unavailable. 20268 * @protected 20269 */ 20270DropzoneUtil._getClipboardImage = async () => { 20271 // Attempt to retrieve the first item in the clipboard array: 20272 let clipboardItems = await navigator.clipboard.read(); 20273 20274 // Search the clipboard for an image file: 20275 for (let item of clipboardItems) { 20276 for (let mimeType of item.types) { 20277 if (mimeType in DropzoneUtil.supportedPasteTypes) { 20278 return [await item.getType(mimeType), mimeType]; 20279 } 20280 } 20281 } 20282 throw DropzoneUtil.UNEXPECTED_CLIPBOARD_DATA; 20283}; 20284 20285/*! 20286 * Cropper.js v1.5.12 20287 * https://fengyuanchen.github.io/cropperjs 20288 *
20289 * Copyright 2015-present Chen Fengyuan 20290 * Released under the MIT license 20291 * 20292 * Date: 2021-06-12T08:00:17.411Z 20293 */ 20294!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e();}(undefined,function(){"use strict";function e(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function B(a){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach(function(t){var e,i;e=a,t=n[i=t],i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t;}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(n,t));});}return a}function i(t){return (i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a);}}function T(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return "Map"===(i="Object"===i&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}var t="undefined"!=typeof window&&void 0!==window.document,h=t?window:{},o=!(!t||!h.document.documentElement)&&"ontouchstart"in h.document.documentElement,r=t&&"PointerEvent"in h,c="cropper",k="all",O="crop",E="move",W="zoom",H="e",N="w",L="s",z="n",Y="ne",X="nw",R="se",S="sw",s="".concat(c,"-crop"),d="".concat(c,"-disabled"),A="".concat(c,"-hidden"),l="".concat(c,"-hide"),p="".concat(c,"-invisible"),m="".concat(c,"-modal"),u="".concat(c,"-move"),g="".concat(c,"Action"),f="".concat(c,"Preview"),v="crop",w="move",b="none",y="crop",x="cropend",M="cropmove",C="cropstart",D="dblclick",j=r?"pointerdown":o?"touchstart":"mousedown",I=r?"pointermove":o?"touchmove":"mousemove",P=r?"pointerup pointercancel":o?"touchend touchcancel":"mouseup",U="zoom",q="image/jpeg",$=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Q=/^data:/,K=/^data:image\/jpeg;base64,/,Z=/^img|canvas$/i,G={viewMode:0,dragMode:v,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},V=Number.isNaN||h.isNaN;function F(t){return "number"==typeof t&&!V(t)}var J=function(t){return 0<t&&t<1/0};function _(t){return void 0===t}function tt(t){return "object"===i(t)&&null!==t}var et=Object.prototype.hasOwnProperty;function it(t){if(!tt(t))return !1;try{var e=t.constructor,i=e.prototype;return e&&i&&et.call(i,"isPrototypeOf")}catch(t){return !1}}function at(t){return "function"==typeof t}var nt=Array.prototype.slice;function ot(t){return Array.from?Array.from(t):nt.call(t)}function ht(i,a){return i&&at(a)&&(Array.isArray(i)||F(i.length)?ot(i).forEac
20294h(function(t,e){a.call(i,t,e,i);}):tt(i)&&Object.keys(i).forEach(function(t){a.call(i,i[t],t,i);})),i}var rt=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return tt(i)&&0<e.length&&e.forEach(function(e){tt(e)&&Object.keys(e).forEach(function(t){i[t]=e[t];});}),i},st=/\.\d*(?:0|9){12}\d*$/;function ct(t,e){e=1<arguments.length&&void 0!==e?e:1e11;return st.test(t)?Math.round(t*e)/e:t}var dt=/^width|height|left|top|marginLeft|marginTop$/;function lt(t,e){var i=t.style;ht(e,function(t,e){dt.test(e)&&F(t)&&(t="".concat(t,"px")),i[e]=t;});}function pt(t,e){var i;e&&(F(t.length)?ht(t,function(t){pt(t,e);}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e);}function mt(t,e){e&&(F(t.length)?ht(t,function(t){mt(t,e);}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")));}function ut(t,e,i){e&&(F(t.length)?ht(t,function(t){ut(t,e,i);}):(i?pt:mt)(t,e));}var gt=/([a-z\d])([A-Z])/g;function ft(t){return t.replace(gt,"$1-$2").toLowerCase()}function vt(t,e){return tt(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(ft(e)))}function wt(t,e,i){tt(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(ft(e)),i);}var bt,yt,xt=/\s\s*/,Mt=(yt=!1,t&&(bt=!1,At=function(){},It=Object.defineProperty({},"once",{get:function(){return yt=!0,bt},set:function(t){bt=t;}}),h.addEventListener("test",At,It),h.removeEventListener("test",At,It)),yt);function Ct(i,t,a,e){var n=3<arguments.length&&void 0!==e?e:{},o=a;t.trim().split(xt).forEach(function(t){var e;Mt||(e=i.listeners)&&e[t]&&e[t][a]&&(o=e[t][a],delete e[t][a],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length&&delete i.listeners),i.removeEventListener(t,o,n);});}function Dt(o,t,h,e){var r=3<arguments.length&&void 0!==e?e:{},s=h;t.trim().split(xt).forEach(function(a){var t,n;r.once&&!Mt&&(t=o.listeners,s=function(){delete n[a][h],o.removeEventListener(a,s,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];h.apply(o,e);},(n=void 0===t?{}:t)[a]||(n[a]={}),n[a][h]&&o.removeEventListener(a,n[a][h],r),n[a][h]=s,o.listeners=n),o.addEventListener(a,s,r);});}function Bt(t,e,i){var a;return at(Event)&&at(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function kt(t){t=t.getBoundingClientRect();return {left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ot=h.location,Tt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Et(t){t=t.match(Tt);return null!==t&&(t[1]!==Ot.protocol||t[2]!==Ot.hostname||t[3]!==Ot.port)}function Wt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function Ht(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,o=t.translateY,t=[];F(n)&&0!==n&&t.push("translateX(".concat(n,"px)")),F(o)&&0!==o&&t.push("translateY(".concat(o,"px)")),F(e)&&0!==e&&t.push("rotate(".concat(e,"deg)")),F(i)&&1!==i&&t.push("scaleX(".concat(i,")")),F(a)&&1!==a&&t.push("scaleY(".concat(a,")"));t=t.length?t.join(" "):"none";return {WebkitTransform:t,msTransform:t,transform:t}}function Nt(t,e){var i=t.pageX,a=t.pageY,t={endX:i,endY:a};return e?t:B({startX:i,startY:a},t)}function Lt(t,e){var i=t.aspectRatio,a=t.height,n=t.width,o=1<arguments.length&&void 0!==e?e:"contain",h=J(n),t=J(a);return h&&t?(e=a*i,"contain"===o&&n<e||"cover"===o&&e<n?a=n/i:n=a*i):h?a=n/i:t&&(n=a*i),{width:n,height:a}}var zt=String.fromCharCode;var Yt=/^data:.*,/;function Xt(t){var e,i,a,n,o,h,r,s=new DataView(t);try{if(255===s.getUint8(0)&&216===s.getUint8(1))for(var c=s.byteLength,d=2;d+1<c;){if(255===s.getUint8(d)&&225===s.getUint8(d+1)){i=d;break}d+=1;}if(i&&(n=i+10,"Exif"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=zt(t.getUint8(n));return a}(s,i+4,4)&&(!(r=18761===(o=s.getUint16(n)))&&19789!==o||42!==s.getUint16(n+2,r)||8<=(h=s.getUint32(n+4,r))&&(a=n+h))),a)for(var l,p=s.getUint16(a,r),m=0;m<p;m+=1)if(l=a+12*m+2,274===s.getUint16(l,r)){l+=8,e=s.getUint16(l,r),s.setUint16(l,1,r);break}}catch(t){e=1;}return e}var Rt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox();},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper,n=Number(e.minContainerWidth),e=Number(e.minContainerHeight);pt(a,A),mt(t,A);e={width:Math.max(i.offsetWidth,0<=n?n:200),height:Math.max(i.offsetHeight,0<=e?e:100)};lt(a,{width:(this.containerData=e).width,height:e.height}),pt(t,A),mt(a,A);},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,n=a?e.naturalHeight:e.naturalWi
20294dth,o=a?e.naturalWidth:e.naturalHeight,h=n/o,a=t.width,e=t.height;t.height*h>t.width?3===i?a=t.height*h:e=t.width/h:3===i?e=t.width/h:a=t.height*h;e={aspectRatio:h,naturalWidth:n,naturalHeight:o,width:a,height:e};this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=rt({},e);},limitCanvas:function(t,e){var i,a=this.options,n=this.containerData,o=this.canvasData,h=this.cropBoxData,r=a.viewMode,s=o.aspectRatio,c=this.cropped&&h;t&&(t=Number(a.minCanvasWidth)||0,i=Number(a.minCanvasHeight)||0,1<r?(t=Math.max(t,n.width),i=Math.max(i,n.height),3===r&&(t<i*s?t=i*s:i=t/s)):0<r&&(t?t=Math.max(t,c?h.width:0):i?i=Math.max(i,c?h.height:0):c&&((t=h.width)<(i=h.height)*s?t=i*s:i=t/s)),t=(s=Lt({aspectRatio:s,width:t,height:i})).width,i=s.height,o.minWidth=t,o.minHeight=i,o.maxWidth=1/0,o.maxHeight=1/0),e&&((c?0:1)<r?(i=n.width-o.width,e=n.height-o.height,o.minLeft=Math.min(0,i),o.minTop=Math.min(0,e),o.maxLeft=Math.max(0,i),o.maxTop=Math.max(0,e),c&&this.limited&&(o.minLeft=Math.min(h.left,h.left+(h.width-o.width)),o.minTop=Math.min(h.top,h.top+(h.height-o.height)),o.maxLeft=h.left,o.maxTop=h.top,2===r&&(o.width>=n.width&&(o.minLeft=Math.min(0,i),o.maxLeft=Math.max(0,i)),o.height>=n.height&&(o.minTop=Math.min(0,e),o.maxTop=Math.max(0,e))))):(o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=n.width,o.maxTop=n.height));},renderCanvas:function(t,e){var i,a,n=this.canvasData,o=this.imageData;e&&(i=(a=function(t){var e=t.width,i=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))return {width:i,height:e};var n=a%90*Math.PI/180,o=Math.sin(n),t=Math.cos(n),n=e*t+i*o,t=e*o+i*t;return 90<a?{width:t,height:n}:{width:n,height:t}}({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0})).width,e=a.height,o=n.width*(i/n.naturalWidth),a=n.height*(e/n.naturalHeight),n.left-=(o-n.width)/2,n.top-=(a-n.height)/2,n.width=o,n.height=a,n.aspectRatio=i/e,n.naturalWidth=i,n.naturalHeight=e,this.limitCanvas(!0,!1)),(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,lt(this.canvas,rt({width:n.width,height:n.height},Ht({translateX:n.left,translateY:n.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0);},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);rt(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),lt(this.image,rt({width:i.width,height:i.height},Ht(rt({translateX:i.left,translateY:i.top},i)))),t&&this.output();},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,t={width:e.width,height:e.height};i&&(e.height*i>e.width?t.height=t.width/i:t.width=t.height*i),this.cropBoxData=t,this.limitCropBox(!0,!0),t.width=Math.min(Math.max(t.width,t.minWidth),t.maxWidth),t.height=Math.min(Math.max(t.height,t.minHeight),t.maxHeight),t.width=Math.max(t.minWidth,t.width*a),t.height=Math.max(t.minHeight,t.height*a),t.left=e.left+(e.width-t.width)/2,t.top=e.top+(e.height-t.height)/2,t.oldLeft=t.left,t.oldTop=t.top,this.initialCropBoxData=rt({},t);},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,h=this.canvasData,r=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(i=Number(n.minCropBoxWidth)||0,a=Number(n.minCropBoxHeight)||0,t=s?Math.min(o.width,h.width,h.width+h.left,o.width-h.left):o.width,n=s?Math.min(o.height,h.height,h.height+h.top,o.height-h.top):o.height,i=Math.min(i,o.width),a=Math.min(a,o.height),c&&(i&&a?i<a*c?a=i/c:i=a*c:i?a=i/c:a&&(i=a*c),t<n*c?n=t/c:t=n*c),r.minWidth=Math.min(i,t),r.minHeight=Math.min(a,n),r.maxWidth=t,r.maxHeight=n),e&&(s?(r.minLeft=Math.max(0,h.left),r.minTop=Math.max(0,h.top),r.maxLeft=Math.min(o.width,h.left+h.width)-r.width,r.maxTop=Math.min(o.height,h.top+h.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=o.width-r.width,r.maxTop=o.height-r.height));},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>
20294i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&wt(this.face,g,i.width>=e.width&&i.height>=e.height?E:k),lt(this.cropBox,rt({width:i.width,height:i.height},Ht({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output();},output:function(){this.preview(),Bt(this.element,y,this.getData());}},St={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),ht(this.previews=o,function(t){var e=document.createElement("img");wt(t,f,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e);}));},resetPreview:function(){ht(this.previews,function(t){var e=vt(t,f);lt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(e,i){if(tt(e[i]))try{delete e[i];}catch(t){e[i]=void 0;}else if(e.dataset)try{delete e.dataset[i];}catch(t){e.dataset[i]=void 0;}else e.removeAttribute("data-".concat(ft(i)));}(t,f);});},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,r=e.width,s=e.height,c=h.width,d=h.height,l=e.left-t.left-h.left,p=e.top-t.top-h.top;this.cropped&&!this.disabled&&(lt(this.viewBoxImage,rt({width:c,height:d},Ht(rt({translateX:-l,translateY:-p},h)))),ht(this.previews,function(t){var e=vt(t,f),i=e.width,a=e.height,n=i,o=a,e=1;r&&(o=s*(e=i/r)),s&&a<o&&(n=r*(e=a/s),o=a),lt(t,{width:n,height:o}),lt(t.getElementsByTagName("img")[0],rt({width:c*e,height:d*e},Ht(rt({translateX:-l*e,translateY:-p*e},h))));}));}},r={bind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&Dt(t,C,e.cropstart),at(e.cropmove)&&Dt(t,M,e.cropmove),at(e.cropend)&&Dt(t,x,e.cropend),at(e.crop)&&Dt(t,y,e.crop),at(e.zoom)&&Dt(t,U,e.zoom),Dt(i,j,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Dt(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Dt(i,D,this.onDblclick=this.dblclick.bind(this)),Dt(t.ownerDocument,I,this.onCropMove=this.cropMove.bind(this)),Dt(t.ownerDocument,P,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Dt(window,"resize",this.onResize=this.resize.bind(this));},unbind:function(){var t=this.element,e=this.options,i=this.cropper;at(e.cropstart)&&Ct(t,C,e.cropstart),at(e.cropmove)&&Ct(t,M,e.cropmove),at(e.cropend)&&Ct(t,x,e.cropend),at(e.crop)&&Ct(t,y,e.crop),at(e.zoom)&&Ct(t,U,e.zoom),Ct(i,j,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Ct(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Ct(i,D,this.onDblclick),Ct(t.ownerDocument,I,this.onCropMove),Ct(t.ownerDocument,P,this.onCropEnd),e.responsive&&Ct(window,"resize",this.onResize);}},o={resize:function(){var t,e,i,a,n,o,h;this.disabled||(t=this.options,e=this.container,a=this.containerData,i=e.offsetWidth/a.width,a=e.offsetHeight/a.height,1!=(n=Math.abs(i-1)>Math.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),h=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(ht(o,function(t,e){o[e]=t*n;})),this.setCropBoxData(ht(h,function(t,e){h[e]=t*n;})))));},dblclick:function(){var t,e;this.disabled||this.options.dragMode===b||this.setDragMode((t=this.dragBox,e=s,(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))?w:v));},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1;},50),t.deltaY?a=0<t.deltaY?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=0<t.detail?1:-1),this.zoom(-a
20294*i,t)));},cropStart:function(t){var e,i=t.buttons,a=t.button;this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(F(i)&&1!==i||F(a)&&0!==a||t.ctrlKey)||(a=this.options,e=this.pointers,t.changedTouches?ht(t.changedTouches,function(t){e[t.identifier]=Nt(t);}):e[t.pointerId||0]=Nt(t),a=1<Object.keys(e).length&&a.zoomable&&a.zoomOnTouch?W:vt(t.target,g),$.test(a)&&!1!==Bt(this.element,C,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===O&&(this.cropping=!0,pt(this.dragBox,m))));},cropMove:function(t){var e,i=this.action;!this.disabled&&i&&(e=this.pointers,t.preventDefault(),!1!==Bt(this.element,M,{originalEvent:t,action:i})&&(t.changedTouches?ht(t.changedTouches,function(t){rt(e[t.identifier]||{},Nt(t,!0));}):rt(e[t.pointerId||0]||{},Nt(t,!0)),this.change(t)));},cropEnd:function(t){var e,i;this.disabled||(e=this.action,i=this.pointers,t.changedTouches?ht(t.changedTouches,function(t){delete i[t.identifier];}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,ut(this.dragBox,m,this.cropped&&this.options.modal)),Bt(this.element,x,{originalEvent:t,action:e})));}},t={change:function(t){var e=this.options,i=this.canvasData,a=this.containerData,n=this.cropBoxData,o=this.pointers,h=this.action,r=e.aspectRatio,s=n.left,c=n.top,d=n.width,l=n.height,p=s+d,m=c+l,u=0,g=0,f=a.width,v=a.height,w=!0;!r&&t.shiftKey&&(r=d&&l?d/l:1),this.limited&&(u=n.minLeft,g=n.minTop,f=u+Math.min(a.width,i.width,i.left+i.width),v=g+Math.min(a.height,i.height,i.top+i.height));function b(t){switch(t){case H:p+D.x>f&&(D.x=f-p);break;case N:s+D.x<u&&(D.x=u-s);break;case z:c+D.y<g&&(D.y=g-c);break;case L:m+D.y>v&&(D.y=v-m);}}var y,x,M,C=o[Object.keys(o)[0]],D={x:C.endX-C.startX,y:C.endY-C.startY};switch(h){case k:s+=D.x,c+=D.y;break;case H:if(0<=D.x&&(f<=p||r&&(c<=g||v<=m))){w=!1;break}b(H),(d+=D.x)<0&&(h=N,s-=d=-d),r&&(c+=(n.height-(l=d/r))/2);break;case z:if(D.y<=0&&(c<=g||r&&(s<=u||f<=p))){w=!1;break}b(z),l-=D.y,c+=D.y,l<0&&(h=L,c-=l=-l),r&&(s+=(n.width-(d=l*r))/2);break;case N:if(D.x<=0&&(s<=u||r&&(c<=g||v<=m))){w=!1;break}b(N),d-=D.x,s+=D.x,d<0&&(h=H,s-=d=-d),r&&(c+=(n.height-(l=d/r))/2);break;case L:if(0<=D.y&&(v<=m||r&&(s<=u||f<=p))){w=!1;break}b(L),(l+=D.y)<0&&(h=z,c-=l=-l),r&&(s+=(n.width-(d=l*r))/2);break;case Y:if(r){if(D.y<=0&&(c<=g||f<=p)){w=!1;break}b(z),l-=D.y,c+=D.y,d=l*r;}else b(z),b(H),!(0<=D.x)||p<f?d+=D.x:D.y<=0&&c<=g&&(w=!1),D.y<=0&&!(g<c)||(l-=D.y,c+=D.y);d<0&&l<0?(h=S,c-=l=-l,s-=d=-d):d<0?(h=X,s-=d=-d):l<0&&(h=R,c-=l=-l);break;case X:if(r){if(D.y<=0&&(c<=g||s<=u)){w=!1;break}b(z),l-=D.y,c+=D.y,s+=n.width-(d=l*r);}else b(z),b(N),!(D.x<=0)||u<s?(d-=D.x,s+=D.x):D.y<=0&&c<=g&&(w=!1),D.y<=0&&!(g<c)||(l-=D.y,c+=D.y);d<0&&l<0?(h=R,c-=l=-l,s-=d=-d):d<0?(h=Y,s-=d=-d):l<0&&(h=S,c-=l=-l);break;case S:if(r){if(D.x<=0&&(s<=u||v<=m)){w=!1;break}b(N),d-=D.x,s+=D.x,l=d/r;}else b(L),b(N),!(D.x<=0)||u<s?(d-=D.x,s+=D.x):0<=D.y&&v<=m&&(w=!1),0<=D.y&&!(m<v)||(l+=D.y);d<0&&l<0?(h=Y,c-=l=-l,s-=d=-d):d<0?(h=R,s-=d=-d):l<0&&(h=X,c-=l=-l);break;case R:if(r){if(0<=D.x&&(f<=p||v<=m)){w=!1;break}b(H),l=(d+=D.x)/r;}else b(L),b(H),!(0<=D.x)||p<f?d+=D.x:0<=D.y&&v<=m&&(w=!1),0<=D.y&&!(m<v)||(l+=D.y);d<0&&l<0?(h=X,c-=l=-l,s-=d=-d):d<0?(h=S,s-=d=-d):l<0&&(h=Y,c-=l=-l);break;case E:this.move(D.x,D.y),w=!1;break;case W:this.zoom((x=B({},y=o),M=0,ht(y,function(n,t){delete x[t],ht(x,function(t){var e=Math.abs(n.startX-t.startX),i=Math.abs(n.startY-t.startY),a=Math.abs(n.endX-t.endX),t=Math.abs(n.endY-t.endY),i=Math.sqrt(e*e+i*i),i=(Math.sqrt(a*a+t*t)-i)/i;Math.abs(i)>Math.abs(M)&&(M=i);});}),M),t),w=!1;break;case O:if(!D.x||!D.y){w=!1;break}y=kt(this.cropper),s=C.startX-y.left,c=C.startY-y.top,d=n.minWidth,l=n.minHeight,0<D.x?h=0<D.y?R:Y:D.x<0&&(s-=d,h=0<D.y?S:X),D.y<0&&(c-=l),this.cropped||(mt(this.cropBox,A),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));}w&&(n.width=d,n.height=l,n.left=s,n.top=c,this.action=h,this.renderCropBox()),ht(o,function(t){t.startX=t.endX,t.startY=t.endY;});}},At={crop:function(){return !this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&pt(this.dragBox,m),mt(this.cropBox,A),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=rt({},this.initialImageData),this.canvasData=rt({},this.initialCanvasData),this.cropBoxData=rt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(rt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),mt(this.dragBox,m),pt(this.cropBox,A)),this},replace:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return !this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,ht(this.previews,function(t){t.getElementsByTagName("img")[0].src=e;}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,mt(this.cropper,d)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,pt(this.cropper,d)),this},destroy:function(){var t=this.element;return t[c]&&(t[c]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate()),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,i=i.top;return this.moveTo(_(t)?t:a+Number(t),_(e)?e:i+Number(e))},moveTo:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(F(t)&&(i.left
20294=t,a=!0),F(e)&&(i.top=e,a=!0),a&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),this.zoomTo(i.width*(t=t<0?1/(1-t):1+t)/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a,n,o,h=this.options,r=this.canvasData,s=r.width,c=r.height,d=r.naturalWidth,l=r.naturalHeight;if(0<=(t=Number(t))&&this.ready&&!this.disabled&&h.zoomable){h=d*t,l=l*t;if(!1===Bt(this.element,U,{ratio:t,oldRatio:s/d,originalEvent:i}))return this;i?(t=this.pointers,d=kt(this.cropper),i=t&&Object.keys(t).length?(o=n=a=0,ht(t,function(t){var e=t.startX,t=t.startY;a+=e,n+=t,o+=1;}),{pageX:a/=o,pageY:n/=o}):{pageX:i.pageX,pageY:i.pageY},r.left-=(h-s)*((i.pageX-d.left-r.left)/s),r.top-=(l-c)*((i.pageY-d.top-r.top)/c)):it(e)&&F(e.x)&&F(e.y)?(r.left-=(h-s)*((e.x-r.left)/s),r.top-=(l-c)*((e.y-r.top)/c)):(r.left-=(h-s)/2,r.top-=(l-c)/2),r.width=h,r.height=l,this.renderCanvas(!0);}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return F(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,F(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(F(e)?e:1,t)},scale:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(F(t)&&(i.scaleX=t,a=!0),F(e)&&(i.scaleY=e,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var i,a,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.options,n=this.imageData,o=this.canvasData,h=this.cropBoxData;return this.ready&&this.cropped?(i={x:h.left-o.left,y:h.top-o.top,width:h.width,height:h.height},a=n.width/n.naturalWidth,ht(i,function(t,e){i[e]=t/a;}),t&&(h=Math.round(i.y+i.height),t=Math.round(i.x+i.width),i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=t-i.x,i.height=h-i.y)):i={x:0,y:0,width:0,height:0},e.rotatable&&(i.rotate=n.rotate||0),e.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(t){var e,i=this.options,a=this.imageData,n=this.canvasData,o={};return this.ready&&!this.disabled&&it(t)&&(e=!1,i.rotatable&&F(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,e=!0),i.scalable&&(F(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,e=!0),F(t.scaleY)&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,e=!0)),e&&this.renderCanvas(!0,!0),a=a.width/a.naturalWidth,F(t.x)&&(o.left=t.x*a+n.left),F(t.y)&&(o.top=t.y*a+n.top),F(t.width)&&(o.width=t.width*a),F(t.height)&&(o.height=t.height*a),this.setCropBoxData(o)),this},getContainerData:function(){return this.ready?rt({},this.containerData):{}},getImageData:function(){return this.sized?rt({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,i={};return this.ready&&ht(["left","top","width","height","naturalWidth","naturalHeight"],function(t){i[t]=e[t];}),i},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&it(t)&&(F(t.left)&&(e.left=t.left),F(t.top)&&(e.top=t.top),F(t.width)?(e.width=t.width,e.height=t.width/i):F(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return (t=this.ready&&this.cropped?{left:e.left,top:e.top,width:e.width,height:e.height}:t)||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&it(t)&&(F(t.left)&&(a.left=t.left),F(t.top)&&(a.top=t.top),F(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),F(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e,i,a,n,o,h,r,s,c,d,l,p,m,u=this.canvasData,h=(w=this.image,e=this.imageData,i=u,y=t,a=e.aspectRatio,n=e.naturalWidth,b=e.naturalHeight,o=void 0===(m=e.rotate)?0:m,h=void 0===(v=e.scaleX)?1:v,g=void 0===(l=e.scaleY)?1:l,r=i.aspectRatio,s=i.naturalWi
20294dth,c=i.naturalHeight,d=void 0===(p=y.fillColor)?"transparent":p,x=y.imageSmoothingEnabled,f=void 0===x||x,v=void 0===(m=y.imageSmoothingQuality)?"low":m,l=void 0===(e=y.maxWidth)?1/0:e,p=void 0===(i=y.maxHeight)?1/0:i,m=void 0===(x=y.minWidth)?0:x,i=void 0===(e=y.minHeight)?0:e,y=(x=document.createElement("canvas")).getContext("2d"),e=Lt({aspectRatio:r,width:l,height:p}),r=Lt({aspectRatio:r,width:m,height:i},"cover"),s=Math.min(e.width,Math.max(r.width,s)),c=Math.min(e.height,Math.max(r.height,c)),p=Lt({aspectRatio:a,width:l,height:p}),i=Lt({aspectRatio:a,width:m,height:i},"cover"),n=Math.min(p.width,Math.max(i.width,n)),b=Math.min(p.height,Math.max(i.height,b)),b=[-n/2,-b/2,n,b],x.width=ct(s),x.height=ct(c),y.fillStyle=d,y.fillRect(0,0,s,c),y.save(),y.translate(s/2,c/2),y.rotate(o*Math.PI/180),y.scale(h,g),y.imageSmoothingEnabled=f,y.imageSmoothingQuality=v,y.drawImage.apply(y,[w].concat(T(b.map(function(t){return Math.floor(ct(t))})))),y.restore(),x);if(!this.cropped)return h;var g=this.getData(),f=g.x,v=g.y,w=g.width,b=g.height,y=h.width/Math.floor(u.naturalWidth);1!=y&&(f*=y,v*=y,w*=y,b*=y);var x=w/b,g=Lt({aspectRatio:x,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),u=Lt({aspectRatio:x,width:t.minWidth||0,height:t.minHeight||0},"cover"),x=Lt({aspectRatio:x,width:t.width||(1!=y?h.width:w),height:t.height||(1!=y?h.height:b)}),y=x.width,x=x.height,y=Math.min(g.width,Math.max(u.width,y)),x=Math.min(g.height,Math.max(u.height,x)),g=document.createElement("canvas"),u=g.getContext("2d");g.width=ct(y),g.height=ct(x),u.fillStyle=t.fillColor||"transparent",u.fillRect(0,0,y,x);x=t.imageSmoothingEnabled,t=t.imageSmoothingQuality;u.imageSmoothingEnabled=void 0===x||x,t&&(u.imageSmoothingQuality=t);var M,C,D,B,k,x=h.width,t=h.height,f=f,v=v;f<=-w||x<f?B=C=M=f=0:f<=0?(C=-f,f=0,B=M=Math.min(x,w+f)):f<=x&&(C=0,B=M=Math.min(w,x-f)),M<=0||v<=-b||t<v?k=D=O=v=0:v<=0?(D=-v,v=0,k=O=Math.min(t,b+v)):v<=t&&(D=0,k=O=Math.min(b,t-v));var O=[f,v,M,O];return 0<B&&0<k&&O.push(C*(w=y/w),D*w,B*w,k*w),u.drawImage.apply(u,[h].concat(T(O.map(function(t){return Math.floor(ct(t))})))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||_(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e,i,a=this.options,n=this.dragBox,o=this.face;return this.ready&&!this.disabled&&(i=a.movable&&t===w,a.dragMode=t=(e=t===v)||i?t:b,wt(n,g,t),ut(n,s,e),ut(n,u,i),a.cropBoxMovable||(wt(o,g,t),ut(o,s,e),ut(o,u,i))),this}},jt=h.Cropper,It=function(){function i(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),!t||!Z.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=rt({},G,it(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init();}var t,e,a;return t=i,a=[{key:"noConflict",value:function(){return window.Cropper=jt,i}},{key:"setDefaults",value:function(t){rt(G,it(t)&&t);}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src;}else "canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t);}}},{key:"load",value:function(t){var e,i,a,n,o,h,r=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?Q.test(t)?K.test(t)?this.read((h=(h=t).replace(Yt,""),a=atob(h),h=new ArrayBuffer(a.length),ht(n=new Uint8Array(h),function(t,e){n[e]=a.charCodeAt(e);}),h)):this.clone():(o=new XMLHttpRequest,h=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=h,o.onerror=h,o.ontimeout=h,o.onprogress=function(){o.getResponseHeader("content-type")!==q&&o.abort();},o.onload=function(){r.read(o.response);},o.onloadend=function(){r.reloading=!1,r.xhr=null;},i.checkCrossOrigin&&Et(t)&&e.crossOrigin&&(t=Wt(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone());}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=Xt(t),n=0,o=1,h=1;1<a&&(this.url=function(t,e){for(var i=[],a=new Uint8Array(t);0<a.length;)i.push(zt.apply(null,ot(a.subarray(0,8192)))),a=a.subarray(8192);return "data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,q),n=(a=function(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90;}return {rotate:e,scaleX:i,scaleY:a}}(a)).rotate,o=a.scaleX,h=a.scaleY),e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=o,i.scaleY=h),this.clone();}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e;this.options.checkCrossOrigin&&Et(e)&&(i=i||"anonymous",a=Wt(e)),this.crossOrigin=i,this.crossOriginUrl=a;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",(this.image=n).onload=this.start.bind(this),n.onerror=this.stop.bind(this),pt(n,l),t.parentNode.insertBefore(n,t.nextSibling);}},{key:"start",value:function(){var i=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;
20294function e(t,e){rt(i.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),i.initialImageData=rt({},i.imageData),i.sizing=!1,i.sized=!0,i.build();}var a,n,o=h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent);!t.naturalWidth||o?(a=document.createElement("img"),n=document.body||document.documentElement,(this.sizingImage=a).onload=function(){e(a.width,a.height),o||n.removeChild(a);},a.src=t.src,o||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",n.appendChild(a))):e(t.naturalWidth,t.naturalHeight);}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null;}},{key:"build",value:function(){var t,e,i,a,n,o,h,r,s;this.sized&&!this.ready&&(t=this.element,e=this.options,i=this.image,a=t.parentNode,(s=document.createElement("div")).innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',o=(n=s.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),h=n.querySelector(".".concat(c,"-drag-box")),s=(r=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=h,this.cropBox=r,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),pt(t,A),a.insertBefore(n,t.nextSibling),this.isImg||mt(i,l),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,pt(r,A),e.guides||pt(r.getElementsByClassName("".concat(c,"-dashed")),A),e.center||pt(r.getElementsByClassName("".concat(c,"-center")),A),e.background&&pt(n,"".concat(c,"-bg")),e.highlight||pt(s,p),e.cropBoxMovable&&(pt(s,u),wt(s,g,k)),e.cropBoxResizable||(pt(r.getElementsByClassName("".concat(c,"-line")),A),pt(r.getElementsByClassName("".concat(c,"-point")),A)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),at(e.ready)&&Dt(t,"ready",e.ready,{once:!0}),Bt(t,"ready"));}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),mt(this.element,A));}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop();}}])&&n(t.prototype,e),a&&n(t,a),i}();return rt(It.prototype,Rt,St,r,o,t,At),It}); 20295 20296/*! 20297 * jQuery Cropper v1.0.1 20298 * https://fengyuanchen.github.io/jquery-cropper 20299 * 20300 * Copyright 2018-present Chen Fengyuan 20301 * Released under the MIT license 20302 * 20303 * Date: 2019-10-19T08:48:33.062Z 20304 */ 20305!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(require("jquery"),require("cropperjs")):"function"==typeof define&&define.amd?define(["jquery","cropperjs"],r):r((e=e||self).jQuery,e.Cropper);}(undefined,function(c,s){"use strict";if(c=c&&c.hasOwnProperty("default")?c.default:c,s=s&&s.hasOwnProperty("default")?
20305s.default:s,c&&c.fn&&s){var e=c.fn.cropper,d="cropper";c.fn.cropper=function(p){for(var e=arguments.length,a=new Array(1<e?e-1:0),r=1;r<e;r++)a[r-1]=arguments[r];var u;return this.each(function(e,r){var t=c(r),n="destroy"===p,o=t.data(d);if(!o){if(n)return;var f=c.extend({},t.data(),c.isPlainObject(p)&&p);o=new s(r,f),t.data(d,o);}if("string"==typeof p){var i=o[p];c.isFunction(i)&&((u=i.apply(o,a))===o&&(u=void 0),n&&t.removeData(d));}}),void 0!==u?u:this},c.fn.cropper.Constructor=s,c.fn.cropper.setDefaults=s.setDefaults,c.fn.cropper.noConflict=function(){return c.fn.cropper=e,this};}}); 20306 20307"use strict";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}();(function(){var ImagePicker,ImagePickerOption,both_array_are_equal,sanitized_options,indexOf=[].indexOf;jQuery.fn.extend({imagepicker:function(){var opts=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.each(function(){var select;if((select=jQuery(this)).data("picker")&&select.data("picker").destroy(),select.data("picker",new ImagePicker(this,sanitized_options(opts))),null!=opts.initialized)return opts.initialized.call(select.data("picker"))})}}),sanitized_options=function(opts){var default_options;return default_options={hide_select:!0,show_label:!1,initialized:void 0,changed:void 0,clicked:void 0,selected:void 0,limit:void 0,limit_reached:void 0,font_awesome:!1},jQuery.extend(default_options,opts)},both_array_are_equal=function(a,b){var i,j,len,x;if(!a||!b||a.length!==b.length)return !1;for(a=a.slice(0),b=b.slice(0),a.sort(),b.sort(),i=j=0,len=a.length;j<len;i=++j)if(x=a[i],b[i]!==x)return !1;return !0},ImagePicker=function(){function ImagePicker(select_element){var opts1=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,ImagePicker),this.sync_picker_with_select=this.sync_picker_with_select.bind(this),this.opts=opts1,this.select=jQuery(select_element),this.multiple="multiple"===this.select.attr("multiple"),null!=this.select.data("limit")&&(this.opts.limit=parseInt(this.select.data("limit"))),this.build_and_append_picker();}return _createClass(ImagePicker,[{key:"destroy",value:function(){var j,len,ref;for(j=0,len=(ref=this.picker_options).length;j<len;j++)ref[j].destroy();return this.picker.remove(),this.select.off("change",this.sync_picker_with_select),this.select.removeData("picker"),this.select.show()}},{key:"build_and_append_picker",value:function(){return this.opts.hide_select&&this.select.hide(),this.select.on("change",this.sync_picker_with_select),null!=this.picker&&this.picker.remove(),this.create_picker(),this.select.after(this.picker),this.sync_picker_with_select()}},{key:"sync_picker_with_select",value:function(){var j,len,option,ref,results;for(results=[],j=0,len=(ref=this.picker_options).length;j<len;j++)(option=ref[j]).is_selected()?results.push(option.mark_as_selected()):results.push(option.unmark_as_selected());return results}},{key:"create_picker",value:function(){return this.picker=jQuery("<ul class='thumbnails image_picker_selector'></ul>"),this.picker_options=[],this.recursively_parse_option_groups(this.select,this.picker),this.picker}},{key:"recursively_parse_option_groups",value:function(scoped_dom,target_container){var container,j,k,len,len1,option,option_group,ref,ref1,results;for(j=0,len=(ref=scoped_dom.children("optgroup")).length;j<len;j++)option_group=ref[j],option_group=jQuery(option_group),(container=jQuery("<ul></ul>")).append(jQuery("<li class='group_title'>"+option_group.attr("label")+"</li>")),target_container.append(jQuery("<li class='group'>").append(container)),this.recursively_parse_option_groups(option_group,container);for(ref1=function(){var l,len1,ref1,results1;for(results1=[],l=0,len1=(ref1=scoped_dom.children("option")).length;l<len1;l++)option=ref1[l],results1.push(new ImagePickerOption(option,this,this.opts));return results1}.call(this),results=[],k=0,len1=ref1.length;k<len1;
20307k++)option=ref1[k],this.picker_options.push(option),option.has_image()&&results.push(target_container.append(option.node));return results}},{key:"has_implicit_blanks",value:function(){var option;return function(){var j,len,ref,results;for(results=[],j=0,len=(ref=this.picker_options).length;j<len;j++)(option=ref[j]).is_blank()&&!option.has_image()&&results.push(option);return results}.call(this).length>0}},{key:"selected_values",value:function(){return this.multiple?this.select.val()||[]:[this.select.val()]}},{key:"toggle",value:function(imagepicker_option,original_event){var new_values,old_values,selected_value;if(old_values=this.selected_values(),selected_value=imagepicker_option.value().toString(),this.multiple?indexOf.call(this.selected_values(),selected_value)>=0?((new_values=this.selected_values()).splice(jQuery.inArray(selected_value,old_values),1),this.select.val([]),this.select.val(new_values)):null!=this.opts.limit&&this.selected_values().length>=this.opts.limit?null!=this.opts.limit_reached&&this.opts.limit_reached.call(this.select):this.select.val(this.selected_values().concat(selected_value)):this.has_implicit_blanks()&&imagepicker_option.is_selected()?this.select.val(""):this.select.val(selected_value),!both_array_are_equal(old_values,this.selected_values())&&(this.select.change(),null!=this.opts.changed))return this.opts.changed.call(this.select,old_values,this.selected_values(),original_event)}}]),ImagePicker}(),ImagePickerOption=function(){function ImagePickerOption(option_element,picker){var opts1=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck(this,ImagePickerOption),this.clicked=this.clicked.bind(this),this.picker=picker,this.opts=opts1,this.option=jQuery(option_element),this.create_node();}return _createClass(ImagePickerOption,[{key:"destroy",value:function(){return this.node.find(".thumbnail").off("click",this.clicked)}},{key:"has_image",value:function(){return null!=this.option.data("img-src")}},{key:"is_blank",value:function(){return !(null!=this.value()&&""!==this.value())}},{key:"is_selected",value:function(){var select_value;return select_value=this.picker.select.val(),this.picker.multiple?jQuery.inArray(this.value(),select_value)>=0:this.value()===select_value}},{key:"mark_as_selected",value:function(){return this.node.find(".thumbnail").addClass("selected")}},{key:"unmark_as_selected",value:function(){return this.node.find(".thumbnail").removeClass("selected")}},{key:"value",value:function(){return this.option.val()}},{key:"label",value:function(){return this.option.data("img-label")?this.option.data("img-label"):this.option.text()}},{key:"clicked",value:function(event){if(this.picker.toggle(this,event),null!=this.opts.clicked&&this.opts.clicked.call(this.picker.select,this,event),null!=this.opts.selected&&this.is_selected())return this.opts.selected.call(this.picker.select,this,event)}},{key:"create_node",value:function(){var image,imgAlt,imgClass,thumbnail;return this.node=jQuery("<li/>"),this.option.data("font_awesome")?(image=jQuery("<i>")).attr("class","fa-fw "+this.option.data("img-src")):(image=jQuery("<img class='image_picker_image'/>")).attr("src",this.option.data("img-src")),thumbnail=jQuery("<div class='thumbnail'>"),(imgClass=this.option.data("img-class"))&&(this.node.addClass(imgClass),image.addClass(imgClass),thumbnail.addClass(imgClass)),(imgAlt=this.option.data("img-alt"))&&image.attr("alt",imgAlt),thumbnail.on("click",this.clicked),thumbnail.append(image),this.opts.show_label&&thumbnail.append(jQuery("<p/>").html(this.label())),this.node.append(thumbnail),this.node}}]),ImagePickerOption}();}).call(void 0); 20308 20309/** 20310 * @popperjs/core v2.10.1 - MIT License 20311 */ 20312 20313"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={});}(undefined,(function(e){function t(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function n(e){return e instanceof t(e).Element||e instanceof Element}function o(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function r(e){return "undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}function i(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;return o(e)&&t&&(t=e.offsetHeight,0<(e=e.offsetWidth)&&(r=n.width/e||1),0<t&&(i=n.height/t||1)),{width:N(n.width/r),height:N(n.height/i),top:N(n.top/i),right:N(n.right/r),bottom:N(n.bottom/i),left:N(n.left/r),x:N(n.left/r),y:N(n.top/i)}}function a(e){return {scrollLeft:(e=t(e)).pageXOffset,scrollTop:e.pageYOffset}}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return ((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return i(f(e)).left+a(e).scrollLeft}function c(e){return t(e).getComputedStyle(e)}function l(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,n,r){void 0===r&&(r=!1);var c,u=o(n);if(c=o(n)){var d=(c=n.getBoundingClientRect()).height/n.offsetHeight||1;c=1!==(c.width/n.offsetWidth||1)||1!==d;}d=c,c=f(n),e=i(e,d),d={scrollLeft:0,scrollTop:0};var h={x:0,y:0};return (u||!u&&!r)&&(("body"!==s(n)||l(c))&&(d=n!==t(n)&&o(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:a(n)),o(n)?((h=i(n,!0)).x+=n.clientLeft,h.y+=n.clientTop):c&&(h.x=p(c))),{x:e.left+d.scrollLeft-h.x,y:e.top+d.scrollTop-h.y,width:e.width,height:e.height}}function d(e){var t=i(e),n=e.offsetWidth,o=e.offsetHeight;return 1>=Math.abs(t.width-n)&&(n=t.width),1>=Math.abs(t.height-o)&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function h(e){return "html"===s(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||f(e)}function m(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:o(e)&&l(e)?e:m(h(e))}function v(e,n){var o;void 0===n&&(n=[]);var r=m(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=t(r),r=e?[o].concat(o.visualVie
vendor: 16,186 bytes, line 20313
20313wport||[],l(r)?r:[]):r,n=n.concat(r),e?n:n.concat(v(h(r)))}function g(e){return o(e)&&"fixed"!==c(e).position?e.offsetParent:null}function b(e){for(var n=t(e),r=g(e);r&&0<=["table","td","th"].indexOf(s(r))&&"static"===c(r).position;)r=g(r);if(r&&("html"===s(r)||"body"===s(r)&&"static"===c(r).position))return n;if(!r)e:{if(r=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!o(e)||"fixed"!==c(e).position)for(e=h(e);o(e)&&0>["html","body"].indexOf(s(e));){var i=c(e);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||r&&"filter"===i.willChange||r&&i.filter&&"none"!==i.filter){r=e;break e}e=e.parentNode;}r=null;}return r||n}function y(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e);})),r.push(e);}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e);})),e.forEach((function(e){o.has(e.name)||t(e);})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e());}));}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return !0;if(n&&r(n))do{if(t&&e.isSameNode(t))return !0;t=t.parentNode||t.host;}while(t);return !1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,n){if("viewport"===n){n=t(e);var r=f(e);n=n.visualViewport;var s=r.clientWidth;r=r.clientHeight;var l=0,u=0;n&&(s=n.width,r=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=n.offsetLeft,u=n.offsetTop)),e=j(e={width:s,height:r,x:l+p(e),y:u});}else o(n)?((e=i(n)).top+=n.clientTop,e.left+=n.clientLeft,e.bottom=e.top+n.clientHeight,e.right=e.left+n.clientWidth,e.width=n.clientWidth,e.height=n.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=a(u),n=null==(r=u.ownerDocument)?void 0:r.body,r=z(e.scrollWidth,e.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),l=z(e.scrollHeight,e.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(n||e).direction&&(u+=z(e.clientWidth,n?n.clientWidth:0)-r),e=j({width:r,height:l,x:u,y:s}));return e}function D(e,t,r){return t="clippingParents"===t?function(e){var t=v(h(e)),r=0<=["absolute","fixed"].indexOf(c(e).position)&&o(e)?b(e):e;return n(r)?t.filter((function(e){return n(e)&&O(e,r)&&"body"!==s(e)})):[]}(e):[].concat(t),(r=(r=[].concat(t,[r])).reduce((function(t,n){return n=E(e,n),t.top=z(n.top,t.top),t.right=F(n.right,t.right),t.bottom=F(n.bottom,t.bottom),t.left=z(n.left,t.left),t}),E(e,r[0]))).width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function L(e){return e.split("-")[1]}function M(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function P(e){var t=e.reference,n=e.element,o=(e=e.placement)?x(e):null;e=e?L(e):null;var r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(o){case"top":r={x:r,y:t.y-n.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-n.width,y:i};break;default:r={x:t.x,y:t.y};}if(null!=(o=o?M(o):null))switch(i="y"===o?"height":"width",e){case"start":r[o]-=t[i]/2-n[i]/2;break;case"end":r[o]+=t[i]/2-n[i]/2;}return r}function k(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function W(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function A(e,t){void 0===t&&(t={});var o=t;t=void 0===(t=o.placement)?e.placement:t;var r=o.boundary,a=void 0===r?"clippingParents":r,s=void 0===(r=o.rootBoundary)?"viewport":r;r=void 0===(r=o.elementContext)?"popper":r;var p=o.altBoundary,c=void 0!==p&&p;o=k("number"!=typeof(o=void 0===(o=o.padding)?0:o)?o:W(o,V)),p=e.rects.popper,a=D(n(c=e.elements[c?"popper"===r?"reference":"popper":r])?c:c.contextElement||f(e.elements.popper),a,s),c=P({reference:s=i(e.elements.reference),element:p,strategy:"absolute",placement:t}),p=j(Object.assign({},p,c)),s="popper"===r?p:s;var l={top:a.top-s.top+o.top,bottom:s.bottom-a.bottom+o.bottom,left:a.left-s.left+o.left,right:s.right-a.right+o.right};if(e=e.modifiersData.offset,"popper"===r&&e){var u=e[t];Object.keys(l).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";l[e]+=u[n]*t;}));}return l}function B(){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 H(e){void 0===e&&(e={});var t=e.defaultModifiers,o=void 0===t?[]:t,r=void 0===(e=e.defaultOptions)?Y: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({},Y,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],p=!1,c={state:s,setOptions:function(i){return i="function"==typeof i?i(s.options):i,a(),s.options=Object.assign({},r,s.options,i),s.scrollParents={reference:n(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)},i=function(e){var t=y(e);return U.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(o,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(B(t,e=e.popper))for(s.rects={reference:u(t,b(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 o=n.options;o=void 0===o?{}:o,n=n.name,"function"==typeof e&&(s=e({state:s,options:o,name:n,instance:c})||s);}}},update:w((function(){return new Promise((function(e){c.forceUpdate(),e(s);}))})),destroy:function(){a(),p=!0;}};return B(e,t)?(c.setOptions(i).then((function(e){!p&&i.onFirstUpdate&&i.onFirstUpdate(e);})),c):c}}function T(e){var n,o=e.popper,r=e.popperRect,i=e.placement,a=e.variation,s=e.offsets,p=e.position,l=e.gpuAcceleration,u=e.adaptive;if(!0===(e=e.roundOffsets)){e=s.y;var d=window.devicePixelRatio||1;e={x:X(X(s.x*d)/d)||0,y:X(X(e*d)/d)||0};}else e="function"==typeof e?e(s):s;e=void 0===(e=(d=e).x)?0:e,d=void 0===(d=d.y)?0:d;var h=s.hasOwnProperty("x");s=s.hasOwnProperty("y");var m,v="left",g="top",y=window;if(u){var w=b(o),x="clientHeight",O="clientWidth";w===t(o)&&("static"!==c(w=f(o)).position&&"absolute"===p&&(x="scrollHeight",O="scrollWidth")),"top"!==i&&("left"!==i&&"right"!==i||"end"!==a)||(g="bottom",d-=w[x]-r.height,d*=l?1:-1),"left"!==i&&("top"!==i&&"bottom"!==i||"end"!==a)||(v="right",e-=w[O]-r.width,e*=l?1:-1);}return o=Object.assign({position:p},u&&Q),l?Object.assign({},o,((m={})[g]=s?"0":"",m[v]=h?"0":"",m.transform=1>=(y.devicePixelRatio||1)?"translate("+e+"px, "+d+"px)":"translate3d("+e+"px, "+d+"px, 0)",m)):Object.assign({},o,((n={})[g]=s?d+"px":"",n[v]=h?e+"px":"",n.transform="",n))}function R(e){return e.replace(/left|right|bottom|top/g,(function(e){return te[e]}))}function S(e){return e.replace(/start|end/g,(function(e){return ne[e]}))}function C(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 q(e){return ["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var N=Math.round,V=["top","bottom","right","left"],I=V.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),_=[].concat(V,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),U="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),z=Math.max,F=Math.min,X=Math.round,Y={placement:"bottom",modifiers:[],strategy:"absolute"},G={passive:!0},J={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,o=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=t(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",o.update,G);})),a&&s.addEventListener("resize",o.update,G),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",o.update,G);})),a&&s.removeEventListener("resize",o.update,G);}},data:{}},K={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=P({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement});},data:{}},Q={top:"auto",right:"auto",bottom:"auto",left:"auto"},Z={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var o=n.adaptive;o=void 0===o||o,n=void 0===(n=n.roundOffsets)||n,e={placement:x(t.placement),variation:L(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,T(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,T(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),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]||{},i=t.elements[e];o(i)&&s(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.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.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),o(r)&&s(r)&&(Object.assign(r.style,e),Object.keys(i).forEach((function(e){r.removeAttribute(e);})));}));}},requires:["computeStyles"]},ee={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=void 0===(e=e.options.offset)?[0,0]:e,r=(e=_.reduce((function(e,n){var r=t.rects,i=x(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof o?o(Object.assign({},r,{placement:n})):o;return r=(r=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:r}:{x:r,y:s},e[n]=i,e}),{}))[t.placement],i=r.x;r=r.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=r),t.modifiersData[n]=e;}},te={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"},oe={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 o=n.mainAxis;o=void 0===o||o;var r=n.altAxis;r=void 0===r||r;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,l=void 0===c||c,u=n.allowedAutoPlacements;c=x(n=t.options.placement),i=i||(c!==n&&l?function(e){if("auto"===x(e))return [];var t=R(e);return [S(e),t,S(t)]}(n):[R(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===x(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,o=t.rootBoundary,r=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?_:a,f=L(t.placement);0===(i=(t=f?i?I:I.filter((function(e){return L(e)===f})):V).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var p=i.reduce((function(t,i){return t[i]=A(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[x(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:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var h=new Map;c=!0;for(var m=d[0],v=0;v<d.length;v++){var g=d[v],b=x(g),y="start"===L(g),w=0<=["top","bottom"].indexOf(b),O=w?"width":"height",j=A(t,{placement:g,boundary:s,rootBoundary:f,altBoundary:p,padding:a});if(y=w?y?"right":"left":y?"bottom":"top",n[O]>i[O]&&(y=R(y)),O=R(y),w=[],o&&w.push(0>=j[b]),r&&w.push(0>=j[y],0>=j[O]),w.every((function(e){return e}))){m=g,c=!1;break}h.set(g,w);}if(c)for(o=function(e){var t=d.find((function(t){if(t=h.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return m=t,"break"},r=l?3:1;0<r&&"break"!==o(r);r--);t.placement!==m&&(t.modifiersData[e]._skip=!0,t.placement=m,t.reset=!0);}},requiresIfExists:["offset"],data:{_skip:!1}},re={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var o=n.mainAxis,r=void 0===o||o,i=void 0!==(o=n.altAxis)&&o;o=void 0===(o=n.tether)||o;var a=n.tetherOffset,s=void 0===a?0:a,f=A(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary});n=x(t.placement);var p=L(t.placement),c=!p,l=M(n);n="x"===l?"y":"x",a=t.modifiersData.popperOffsets;var u=t.rects.reference,h=t.rects.popper,m="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s;if(s={x:0,y:0},a){if(r||i){var v="y"===l?"top":"left",g="y"===l?"bottom":"right",y="y"===l?"height":"width",w=a[l],O=a[l]+f[v],j=a[l]-f[g],E=o?-h[y]/2:0,D="start"===p?u[y]:h[y];p="start"===p?-h[y]:-u[y],h=t.elements.arrow,h=o&&h?d(h):{width:0,height:0};var P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};v=P[v],g=P[g],h=z(0,F(u[y],h[y])),D=c?u[y]/2-E-h-v-m:D-h-v-m,u=c?-u[y]/2+E+h+g+m:p+h+g+m,c=t.elements.arrow&&b(t.elements.arrow),m=t.modifiersData.offset?t.modifiersData.offset[t.placement][l]:0,c=a[l]+D-m-(c?"y"===l?c.clientTop||0:c.clientLeft||0:0),u=a[l]+u-m,r&&(r=o?F(O,c):O,j=o?z(j,u):j,r=z(r,F(w,j)),a[l]=r,s[l]=r-w),i&&(r=(i=a[n])+f["x"===l?"top":"left"],f=i-f["x"===l?"bottom":"right"],r=o?F(r,c):r,o=o?z(f,u):f,o=z(r,F(i,o)),a[n]=o,s[n]=o-i);}t.modifiersData[e]=s;}},requiresIfExists:["offset"]},ie={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=x(n.placement);if(e=M(s),s=0<=["left","right"].indexOf(s)?"height":"width",i&&a){r=k("number"!=typeof(r="function"==typeof(r=r.padding)?r(Object.assign({},n.rects,{placement:n.placement})):r)?r:W(r,V));var f=d(i),p="y"===e?"top":"left",c="y"===e?"bottom":"right",l=n.rects.reference[s]+n.rects.reference[e]-a[e]-n.rects.popper[s];a=a[e]-n.rects.reference[e],a=(i=(i=b(i))?"y"===e?i.clientHeight||0:i.clientWidth||0:0)/2-f[s]/2+(l/2-a/2),s=z(r[p],F(a,i-f[s]-r[c])),n.modifiersData[o]=((t={})[e]=s,t.centerOffset=s-a,t);}},effect:function(e){var t=e.state;if(null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)){if("string"==typeof e&&!(e=t.elements.popper.querySelector(e)))return;O(t.elements.popper,e)&&(t.elements.arrow=e);}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},ae={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,i=A(t,{elementContext:"reference"}),a=A(t,{altBoundary:!0});n=C(i,n),o=C(a,o,r),r=q(n),a=q(o),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:o,isReferenceHidden:r,hasPopperEscaped:a},t.attributes.popper=Object.assign({}
20313,t.attributes.popper,{"data-popper-reference-hidden":r,"data-popper-escaped":a});}},se=H({defaultModifiers:[J,K,Z,$]}),fe=[J,K,Z,$,ee,oe,re,ie,ae],pe=H({defaultModifiers:fe});e.applyStyles=$,e.arrow=ie,e.computeStyles=Z,e.createPopper=pe,e.createPopperLite=se,e.defaultModifiers=fe,e.detectOverflow=A,e.eventListeners=J,e.flip=oe,e.hide=ae,e.offset=ee,e.popperGenerator=H,e.popperOffsets=K,e.preventOverflow=re,Object.defineProperty(e,"__esModule",{value:!0});})); 20314 20315!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper);}(undefined,(function(t){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof document,n=e?navigator.userAgent:"",r=/MSIE |Trident\//.test(n),i={passive:!0,capture:!0};function o(t,e,n){if(Array.isArray(t)){var r=t[e];return null==r?Array.isArray(n)?n[e]:n:r}return t}function a(t,e){var n={}.toString.call(t);return 0===n.indexOf("[object")&&n.indexOf(e+"]")>-1}function s(t,e){return "function"==typeof t?t.apply(void 0,e):t}function p(t,e){return 0===e?t:function(r){clearTimeout(n),n=setTimeout((function(){t(r);}),e);};var n;}function u(t,e){var n=Object.assign({},t);return e.forEach((function(t){delete n[t];})),n}function c(t){return [].concat(t)}function f(t,e){-1===t.indexOf(e)&&t.push(e);}function l(t){return t.split("-")[0]}function d(t){return [].slice.call(t)}function v(){return document.createElement("div")}function m(t){return ["Element","Fragment"].some((function(e){return a(t,e)}))}function g(t){return a(t,"MouseEvent")}function h(t){return !(!t||!t._tippy||t._tippy.reference!==t)}function b(t){return m(t)?[t]:function(t){return a(t,"NodeList")}(t)?d(t):Array.isArray(t)?t:d(document.querySelectorAll(t))}function y(t,e){t.forEach((function(t){t&&(t.style.transitionDuration=e+"ms");}));}function w(t,e){t.forEach((function(t){t&&t.setAttribute("data-state",e);}));}function x(t){var e,n=c(t)[0];return (null==n||null==(e=n.ownerDocument)?void 0:e.body)?n.ownerDocument:document}function E(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(e){t[r](e,n);}));}var O={isTouch:!1},C=0;function T(){O.isTouch||(O.isTouch=!0,window.performance&&document.addEventListener("mousemove",A));}function A(){var t=performance.now();t-C<20&&(O.isTouch=!1,document.removeEventListener("mousemove",A)),C=t;}function L(){var t=document.activeElement;if(h(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur();}}var D=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),k=Object.keys(D);function R(t){var e=(t.plugins||[]).reduce((function(e,n){var r=n.name,i=n.defaultValue;return r&&(e[r]=void 0!==t[r]?t[r]:i),e}),{});return Object.assign({},t,{},e)}function j(t,e){var n=Object.assign({},e,{content:s(e.content,[t])},e.ignoreAttributes?{}:function(t,e){return (e?Object.keys(R(Object.assign({},D,{plugins:e}))):k).reduce((function(e,n){var r=(t.getAttribute("data-tippy-"+n)||"").trim();if(!r)return e;if("content"===n)e[n]=r;else try{e[n]=JSON.parse(r);}catch(t){e[n]=r;}return e}),{})}(t,e.plugins));return n.aria=Object.assign({},D.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?e.interactive:n.aria.expanded,content:"auto"===n.aria.content?e.
20315interactive?null:"describedby":n.aria.content},n}function M(t,e){t.innerHTML=e;}function P(t){var e=v();return !0===t?e.className="tippy-arrow":(e.className="tippy-svg-arrow",m(t)?e.appendChild(t):M(e,t)),e}function V(t,e){m(e.content)?(M(t,""),t.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?M(t,e.content):t.textContent=e.content);}function I(t){var e=t.firstElementChild,n=d(e.children);return {box:e,content:n.find((function(t){return t.classList.contains("tippy-content")})),arrow:n.find((function(t){return t.classList.contains("tippy-arrow")||t.classList.contains("tippy-svg-arrow")})),backdrop:n.find((function(t){return t.classList.contains("tippy-backdrop")}))}}function S(t){var e=v(),n=v();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=v();function i(n,r){var i=I(e),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||V(a,t.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(P(r.arrow))):o.appendChild(P(r.arrow)):s&&o.removeChild(s);}return r.className="tippy-content",r.setAttribute("data-state","hidden"),V(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props),{popper:e,onUpdate:i}}S.$$tippy=!0;var B=1,H=[],N=[];function U(e,n){var a,u,m,h,b,C,T,A,L,k=j(e,Object.assign({},D,{},R((a=n,Object.keys(a).reduce((function(t,e){return void 0!==a[e]&&(t[e]=a[e]),t}),{}))))),M=!1,P=!1,V=!1,S=!1,U=[],_=p(bt,k.interactiveDebounce),z=B++,F=(L=k.plugins).filter((function(t,e){return L.indexOf(t)===e})),W={id:z,reference:e,popper:v(),popperInstance:null,props:k,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:F,clearDelayTimeouts:function(){clearTimeout(u),clearTimeout(m),cancelAnimationFrame(h);},setProps:function(t){if(W.state.isDestroyed)return;it("onBeforeUpdate",[W,t]),gt();var n=W.props,r=j(e,Object.assign({},W.props,{},t,{ignoreAttributes:!0}));W.props=r,mt(),n.interactiveDebounce!==r.interactiveDebounce&&(st(),_=p(bt,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?c(n.triggerTarget).forEach((function(t){t.removeAttribute("aria-expanded");})):r.triggerTarget&&e.removeAttribute("aria-expanded");at(),rt(),q&&q(n,r);W.popperInstance&&(Et(),Ct().forEach((function(t){requestAnimationFrame(t._tippy.popperInstance.forceUpdate);})));it("onAfterUpdate",[W,t]);},setContent:function(t){W.setProps({content:t});},show:function(){var t=W.state.isVisible,e=W.state.isDestroyed,n=!W.state.isEnabled,r=O.isTouch&&!W.props.touch,i=o(W.props.duration,0,D.duration);if(t||e||n||r)return;if(Z().hasAttribute("disabled"))return;if(it("onShow",[W],!1),!1===W.props.onShow(W))return;W.state.isVisible=!0,Q()&&(Y.style.visibility="visible");rt(),ft(),W.state.isMounted||(Y.style.transition="none");if(Q()){var a=et(),p=a.box,u=a.content;y([p,u],0);}T=function(){var t;if(W.state.isVisible&&!S){if(S=!0,Y.offsetHeight,Y.style.transition=W.props.moveTransition,Q()&&W.props.animation){var e=et(),n=e.box,r=e.content;y([n,r],i),w([n,r],"visible");}ot(),at(),f(N,W),null==(t=W.popperInstance)||t.forceUpdate(),W.state.isMounted=!0,it("onMount",[W]),W.props.animation&&Q()&&function(t,e){dt(t,e);}(i,(function(){W.state.isShown=!0,it("onShown",[W]);}));}},function(){var t,e=W.props.appendTo,n=Z();t=W.props.interactive&&e===D.appendTo||"parent"===e?n.parentNode:s(e,[n]);t.contains(Y)||t.appendChild(Y);Et();}();},hide:function(){var t=!W.state.isVisible,e=W.state.isDestroyed,n=!W.state.isEnabled,r=o(W.props.duration,1,D.duration);if(t||e||n)return;if(it("onHide",[W],!1),!1===W.props.onHide(W))return;W.state.isVisible=!1,W.state.isShown=!1,S=!1,M=!1,Q()&&(Y.style.visibility="hidden");if(st(),lt(),rt(),Q()){var i=et(),a=i.box,s=i.content;W.props.animation&&(y([a,s],r),w([a,s],"hidden"));}ot(),at(),W.props.animation?Q()&&function(t,e){dt(t,(function(){!W.state.isVisible&&Y.parentNode&&Y.parentNode.contains(Y)&&e(
20315);}));}(r,W.unmount):W.unmount();},hideWithInteractivity:function(t){tt().addEventListener("mousemove",_),f(H,_),_(t);},enable:function(){W.state.isEnabled=!0;},disable:function(){W.hide(),W.state.isEnabled=!1;},unmount:function(){W.state.isVisible&&W.hide();if(!W.state.isMounted)return;Ot(),Ct().forEach((function(t){t._tippy.unmount();})),Y.parentNode&&Y.parentNode.removeChild(Y);N=N.filter((function(t){return t!==W})),W.state.isMounted=!1,it("onHidden",[W]);},destroy:function(){if(W.state.isDestroyed)return;W.clearDelayTimeouts(),W.unmount(),gt(),delete e._tippy,W.state.isDestroyed=!0,it("onDestroy",[W]);}};if(!k.render)return W;var X=k.render(W),Y=X.popper,q=X.onUpdate;Y.setAttribute("data-tippy-root",""),Y.id="tippy-"+W.id,W.popper=Y,e._tippy=W,Y._tippy=W;var $=F.map((function(t){return t.fn(W)})),J=e.hasAttribute("aria-expanded");return mt(),at(),rt(),it("onCreate",[W]),k.showOnCreate&&Tt(),Y.addEventListener("mouseenter",(function(){W.props.interactive&&W.state.isVisible&&W.clearDelayTimeouts();})),Y.addEventListener("mouseleave",(function(t){W.props.interactive&&W.props.trigger.indexOf("mouseenter")>=0&&(tt().addEventListener("mousemove",_),_(t));})),W;function G(){var t=W.props.touch;return Array.isArray(t)?t:[t,0]}function K(){return "hold"===G()[0]}function Q(){var t;return !!(null==(t=W.props.render)?void 0:t.$$tippy)}function Z(){return A||e}function tt(){var t=Z().parentNode;return t?x(t):document}function et(){return I(Y)}function nt(t){return W.state.isMounted&&!W.state.isVisible||O.isTouch||b&&"focus"===b.type?0:o(W.props.delay,t?0:1,D.delay)}function rt(){Y.style.pointerEvents=W.props.interactive&&W.state.isVisible?"":"none",Y.style.zIndex=""+W.props.zIndex;}function it(t,e,n){var r;(void 0===n&&(n=!0),$.forEach((function(n){n[t]&&n[t].apply(void 0,e);})),n)&&(r=W.props)[t].apply(r,e);}function ot(){var t=W.props.aria;if(t.content){var n="aria-"+t.content,r=Y.id;c(W.props.triggerTarget||e).forEach((function(t){var e=t.getAttribute(n);if(W.state.isVisible)t.setAttribute(n,e?e+" "+r:r);else {var i=e&&e.replace(r,"").trim();i?t.setAttribute(n,i):t.removeAttribute(n);}}));}}function at(){!J&&W.props.aria.expanded&&c(W.props.triggerTarget||e).forEach((function(t){W.props.interactive?t.setAttribute("aria-expanded",W.state.isVisible&&t===Z()?"true":"false"):t.removeAttribute("aria-expanded");}));}function st(){tt().removeEventListener("mousemove",_),H=H.filter((function(t){return t!==_}));}function pt(t){if(!(O.isTouch&&(V||"mousedown"===t.type)||W.props.interactive&&Y.contains(t.target))){if(Z().contains(t.target)){if(O.isTouch)return;if(W.state.isVisible&&W.props.trigger.indexOf("click")>=0)return}else it("onClickOutside",[W,t]);!0===W.props.hideOnClick&&(W.clearDelayTimeouts(),W.hide(),P=!0,setTimeout((function(){P=!1;})),W.state.isMounted||lt());}}function ut(){V=!0;}function ct(){V=!1;}function ft(){var t=tt();t.addEventListener("mousedown",pt,!0),t.addEventListener("touchend",pt,i),t.addEventListener("touchstart",ct,i),t.addEventListener("touchmove",ut,i);}function lt(){var t=tt();t.removeEventListener("mousedown",pt,!0),t.removeEventListener("touchend",pt,i),t.removeEventListener("touchstart",ct,i),t.removeEventListener("touchmove",ut,i);}function dt(t,e){var n=et().box;function r(t){t.target===n&&(E(n,"remove",r),e());}if(0===t)return e();E(n,"remove",C),E(n,"add",r),C=r;}function vt(t,n,r){void 0===r&&(r=!1),c(W.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),U.push({node:e,eventType:t,handler:n,options:r});}));}function mt(){var t;K()&&(vt("touchstart",ht,{passive:!0}),vt("touchend",yt,{passive:!0})),(t=W.props.trigger,t.split(/\s+/).filter(Boolean)).forEach((function(t){if("manual"!==t)switch(vt(t,ht),t){case"mouseenter":vt("mouseleave",yt);break;case"focus":vt(r?"focusout":"blur",wt);break;case"focusin":vt("focusout",wt);}}));}function gt(){U.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,i=t.options;e.removeEventListener(n,r,i);})),U=[];}function ht(t){var e,n=!1;if(W.state.isEnabled&&!xt(t)&&!P){var r="focus"===(null==(e=b)?void 0:e.type);b=t,A=t.currentTarget,at(),!W.state.isVisible&&g(t)&&H.forEach((function(e){return e(t)}
20315)),"click"===t.type&&(W.props.trigger.indexOf("mouseenter")<0||M)&&!1!==W.props.hideOnClick&&W.state.isVisible?n=!0:Tt(t),"click"===t.type&&(M=!n),n&&!r&&At(t);}}function bt(t){var e=t.target,n=Z().contains(e)||Y.contains(e);"mousemove"===t.type&&n||function(t,e){var n=e.clientX,r=e.clientY;return t.every((function(t){var e=t.popperRect,i=t.popperState,o=t.props.interactiveBorder,a=l(i.placement),s=i.modifiersData.offset;if(!s)return !0;var p="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,c="right"===a?s.left.x:0,f="left"===a?s.right.x:0,d=e.top-r+p>o,v=r-e.bottom-u>o,m=e.left-n+c>o,g=n-e.right-f>o;return d||v||m||g}))}(Ct().concat(Y).map((function(t){var e,n=null==(e=t._tippy.popperInstance)?void 0:e.state;return n?{popperRect:t.getBoundingClientRect(),popperState:n,props:k}:null})).filter(Boolean),t)&&(st(),At(t));}function yt(t){xt(t)||W.props.trigger.indexOf("click")>=0&&M||(W.props.interactive?W.hideWithInteractivity(t):At(t));}function wt(t){W.props.trigger.indexOf("focusin")<0&&t.target!==Z()||W.props.interactive&&t.relatedTarget&&Y.contains(t.relatedTarget)||At(t);}function xt(t){return !!O.isTouch&&K()!==t.type.indexOf("touch")>=0}function Et(){Ot();var n=W.props,r=n.popperOptions,i=n.placement,o=n.offset,a=n.getReferenceClientRect,s=n.moveTransition,p=Q()?I(Y).arrow:null,u=a?{getBoundingClientRect:a,contextElement:a.contextElement||Z()}:e,c=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!s}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(t){var e=t.state;if(Q()){var n=et().box;["placement","reference-hidden","escaped"].forEach((function(t){"placement"===t?n.setAttribute("data-placement",e.placement):e.attributes.popper["data-popper-"+t]?n.setAttribute("data-"+t,""):n.removeAttribute("data-"+t);})),e.attributes.popper={};}}}];Q()&&p&&c.push({name:"arrow",options:{element:p,padding:3}}),c.push.apply(c,(null==r?void 0:r.modifiers)||[]),W.popperInstance=t.createPopper(u,Y,Object.assign({},r,{placement:i,onFirstUpdate:T,modifiers:c}));}function Ot(){W.popperInstance&&(W.popperInstance.destroy(),W.popperInstance=null);}function Ct(){return d(Y.querySelectorAll("[data-tippy-root]"))}function Tt(t){W.clearDelayTimeouts(),t&&it("onTrigger",[W,t]),ft();var e=nt(!0),n=G(),r=n[0],i=n[1];O.isTouch&&"hold"===r&&i&&(e=i),e?u=setTimeout((function(){W.show();}),e):W.show();}function At(t){if(W.clearDelayTimeouts(),it("onUntrigger",[W,t]),W.state.isVisible){if(!(W.props.trigger.indexOf("mouseenter")>=0&&W.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(t.type)>=0&&M)){var e=nt(!1);e?m=setTimeout((function(){W.state.isVisible&&W.hide();}),e):h=requestAnimationFrame((function(){W.hide();}));}}else lt();}}function _(t,e){void 0===e&&(e={});var n=D.plugins.concat(e.plugins||[]);document.addEventListener("touchstart",T,i),window.addEventListener("blur",L);var r=Object.assign({},e,{plugins:n}),o=b(t).reduce((function(t,e){var n=e&&U(e,r);return n&&t.push(n),t}),[]);return m(t)?o[0]:o}_.defaultProps=D,_.setDefaultProps=function(t){Object.keys(t).forEach((function(e){D[e]=t[e];}));},_.currentInput=O;var z=Object.assign({},t.applyStyles,{effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow);}}),F={mouseover:"mouseenter",focusin:"focus",click:"click"};var W={name:"animateFill",defaultValue:!1,fn:function(t){var e;if(!(null==(e=t.props.render)?void 0:e.$$tippy))return {};var n=I(t.popper),r=n.box,i=n.content,o=t.props.animateFill?function(){var t=v();return t.className="tippy-backdrop",w([t],"hidden"),t}():null;return {onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",t.setProps({arrow:!1,animation:"shift-away"}));},onMount:function(){if(o){var t=r.style.transitionDuration,e=Number(t.replace("ms",""));i.style.transitionDelay=Math.round(e/10)+"ms",o.style.transitionDuration=t,w([o],"visible");}},onShow:function(){o&&(o.style.transitionDuration="0ms");},onHide:function(){o&&w([o],"hidden");}}}};var X={clientX:0,clientY:0},Y=[];function q(t){var e=t.clientX,n=t.clientY;X={clientX:e,clientY:n};}var $={name:"followCursor",defaultValue:!1,fn:function(t){var e=t.reference,n=x(t.props.triggerTarget||e),r=!1,i=!1,o=!0,a=t.props;function s(){return "initial"===t.props.followCursor&&t.state.isVisible}function p(){n.addEventListener("mousemove",f);}function u(){n.removeEventListener("mousemove",f);}function c(){r=!0,t.setProps({getReferenceClientRect:null}),r=!1;}function f(n){var r=!n.target||e.contains(n.target),i=t.props.followCursor,o=n.clientX,a=n.clientY,s=e.getBoundingClientRect(),p=o-s.left,u=a-s.top;!r&&t.props.interactive||t.setProps({getReferenceClientRect:function(){var t=e.getBoundingClientRect(),n=o,r=a;"initial"===i&&(n=t.left+p,r=t.top+u);var s="horizontal"===i?t.top:r,c="vertical"===i?t.right:n,f="horizontal"===i?t.bottom:r,l="vertical"===i?t.left:n;return {width:c-l,height:f-s,top:s,right:c,bottom:f,left:l}}});}function l(){t.props.followCursor&&(Y.push({instance:t,doc:n}),function(t){t.addEventListener("mousemove",q);}(n));}function d(){0===(Y=Y.filter((function(e){return e.instance!==t}))).filter((function(t){return t.doc===n})).length&&function(t){t.removeEventListener("mousemove",q);}(n);}return {onCreate:l,onDestroy:d,onBeforeUpdate:function(){a=t.props;},onAfterUpdate:function(e,n){var o=n.followCursor;r||void 0!==o&&a.followCursor!==o&&(d(),o?(l(),!t.state.isMounted||i||s()||p()):(u(),c()));}
20315,onMount:function(){t.props.followCursor&&!i&&(o&&(f(X),o=!1),s()||p());},onTrigger:function(t,e){g(e)&&(X={clientX:e.clientX,clientY:e.clientY}),i="focus"===e.type;},onHidden:function(){t.props.followCursor&&(c(),u(),o=!0);}}}};var J={name:"inlinePositioning",defaultValue:!1,fn:function(t){var e,n=t.reference;var r=-1,i=!1,o={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(i){var o=i.state;t.props.inlinePositioning&&(e!==o.placement&&t.setProps({getReferenceClientRect:function(){return function(t){return function(t,e,n,r){if(n.length<2||null===t)return e;if(2===n.length&&r>=0&&n[0].left>n[1].right)return n[r]||e;switch(t){case"top":case"bottom":var i=n[0],o=n[n.length-1],a="top"===t,s=i.top,p=o.bottom,u=a?i.left:o.left,c=a?i.right:o.right;return {top:s,bottom:p,left:u,right:c,width:c-u,height:p-s};case"left":case"right":var f=Math.min.apply(Math,n.map((function(t){return t.left}))),l=Math.max.apply(Math,n.map((function(t){return t.right}))),d=n.filter((function(e){return "left"===t?e.left===f:e.right===l})),v=d[0].top,m=d[d.length-1].bottom;return {top:v,bottom:m,left:f,right:l,width:l-f,height:m-v};default:return e}}(l(t),n.getBoundingClientRect(),d(n.getClientRects()),r)}(o.placement)}}),e=o.placement);}};function a(){var e;i||(e=function(t,e){var n;return {popperOptions:Object.assign({},t.popperOptions,{modifiers:[].concat(((null==(n=t.popperOptions)?void 0:n.modifiers)||[]).filter((function(t){return t.name!==e.name})),[e])})}}(t.props,o),i=!0,t.setProps(e),i=!1);}return {onCreate:a,onAfterUpdate:a,onTrigger:function(e,n){if(g(n)){var i=d(t.reference.getClientRects()),o=i.find((function(t){return t.left-2<=n.clientX&&t.right+2>=n.clientX&&t.top-2<=n.clientY&&t.bottom+2>=n.clientY}));r=i.indexOf(o);}},onUntrigger:function(){r=-1;}}}};var G={name:"sticky",defaultValue:!1,fn:function(t){var e=t.reference,n=t.popper;function r(e){return !0===t.props.sticky||t.props.sticky===e}var i=null,o=null;function a(){var s=r("reference")?(t.popperInstance?t.popperInstance.state.elements.reference:e).getBoundingClientRect():null,p=r("popper")?n.getBoundingClientRect():null;(s&&K(i,s)||p&&K(o,p))&&t.popperInstance&&t.popperInstance.update(),i=s,o=p,t.state.isMounted&&requestAnimationFrame(a);}return {onMount:function(){t.props.sticky&&a();}}}};function K(t,e){return !t||!e||(t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom||t.left!==e.left)}return e&&function(t){var e=document.createElement("style");e.textContent=t,e.setAttribute("data-tippy-stylesheet","");var n=document.head,r=document.querySelector("head>style,head>link");r?n.insertBefore(e,r):n.appendChild(e);}('.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}'),_.setDefaultProps({plugins:[W,$,J,G],render:S}),_.createSingleton=function(t,e){var n;void 0===e&&(e={});var r,i=t,o=[],a=e.overrides,s=[],p=!1;function c(){o=i.map((function(t){return t.reference}));}
20315function f(t){i.forEach((function(e){t?e.enable():e.disable();}));}function l(t){return i.map((function(e){var n=e.setProps;return e.setProps=function(i){n(i),e.reference===r&&t.setProps(i);},function(){e.setProps=n;}}))}function d(t,e){var n=o.indexOf(e);if(e!==r){r=e;var s=(a||[]).concat("content").reduce((function(t,e){return t[e]=i[n].props[e],t}),{});t.setProps(Object.assign({},s,{getReferenceClientRect:"function"==typeof s.getReferenceClientRect?s.getReferenceClientRect:function(){return e.getBoundingClientRect()}}));}}f(!1),c();var m={fn:function(){return {onDestroy:function(){f(!0);},onHidden:function(){r=null;},onClickOutside:function(t){t.props.showOnCreate&&!p&&(p=!0,r=null);},onShow:function(t){t.props.showOnCreate&&!p&&(p=!0,d(t,o[0]));},onTrigger:function(t,e){d(t,e.currentTarget);}}}},g=_(v(),Object.assign({},u(e,["overrides"]),{plugins:[m].concat(e.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat((null==(n=e.popperOptions)?void 0:n.modifiers)||[],[z])})})),h=g.show;g.show=function(t){if(h(),!r&&null==t)return d(g,o[0]);if(!r||null!=t){if("number"==typeof t)return o[t]&&d(g,o[t]);if(i.includes(t)){var e=t.reference;return d(g,e)}return o.includes(t)?d(g,t):void 0}},g.showNext=function(){var t=o[0];if(!r)return g.show(0);var e=o.indexOf(r);g.show(o[e+1]||t);},g.showPrevious=function(){var t=o[o.length-1];if(!r)return g.show(t);var e=o.indexOf(r),n=o[e-1]||t;g.show(n);};var b=g.setProps;return g.setProps=function(t){a=t.overrides||a,b(t);},g.setInstances=function(t){f(!0),s.forEach((function(t){return t()}
20315)),i=t,f(!1),c(),l(g),g.setProps({triggerTarget:o});},s=l(g),g},_.delegate=function(t,e){var n=[],r=[],o=!1,a=e.target,s=u(e,["target"]),p=Object.assign({},s,{trigger:"manual",touch:!1}),f=Object.assign({},s,{showOnCreate:!0}),l=_(t,p);function d(t){if(t.target&&!o){var n=t.target.closest(a);if(n){var i=n.getAttribute("data-tippy-trigger")||e.trigger||D.trigger;if(!n._tippy&&!("touchstart"===t.type&&"boolean"==typeof f.touch||"touchstart"!==t.type&&i.indexOf(F[t.type])<0)){var s=_(n,f);s&&(r=r.concat(s));}}}}function v(t,e,r,i){void 0===i&&(i=!1),t.addEventListener(e,r,i),n.push({node:t,eventType:e,handler:r,options:i});}return c(l).forEach((function(t){var e=t.destroy,a=t.enable,s=t.disable;t.destroy=function(t){void 0===t&&(t=!0),t&&r.forEach((function(t){t.destroy();})),r=[],n.forEach((function(t){var e=t.node,n=t.eventType,r=t.handler,i=t.options;e.removeEventListener(n,r,i);})),n=[],e();},t.enable=function(){a(),r.forEach((function(t){return t.enable()})),o=!1;},t.disable=function(){s(),r.forEach((function(t){return t.disable()})),o=!0;},function(t){var e=t.reference;v(e,"touchstart",d,i),v(e,"mouseover",d),v(e,"focusin",d),v(e,"click",d);}(t);})),l},_.hideAll=function(t){var e=void 0===t?{}:t,n=e.exclude,r=e.duration;N.forEach((function(t){var e=!1;if(n&&(e=h(n)?t.reference===n:t.popper===n.popper),!e){var i=t.props.duration;t.setProps({duration:r}),t.hide(),t.state.isDestroyed||t.setProps({duration:i});}}));},_.roundArrow='<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>',_})); 20316 20317(function ($) { 20318 20319 $.fn.tableHeadFixer = function (param) { 20320 20321 return this.each(function () { 20322 table.call(this); 20323 }); 20324 20325 function table() { 20326 /* 20327 This function solver z-index problem in corner cell where fix row and column at the same time, 20328 set corner cells z-index 1 more then other fixed cells 20329 */ 20330 function setCorner() { 20331 var table = $(settings.table); 20332 20333 if (settings.head) { 20334 if (settings.left > 0) { 20335 var tr = table.find("> thead > tr"); 20336 20337 tr.each(function (k, row) { 20338 solverLeftColspan(row, function (cell) { 20339 $(cell).css("z-index", settings['z-index'] + 1); 20340 }); 20341 }); 20342 } 20343 20344 if (settings.right > 0) { 20345 var tr = table.find("> thead > tr"); 20346 20347 tr.each(function (k, row) { 20348 solveRightColspan(row, function (cell) { 20349 $(cell).css("z-index", settings['z-index'] + 1); 20350 }); 20351 }); 20352 } 20353 } 20354 20355 if (settings.foot) { 20356 if (settings.left > 0) { 20357 var tr = table.find("> tfoot > tr"); 20358 20359 tr.each(function (k, row) { 20360 solverLeftColspan(row, function (cell) { 20361 $(cell).css("z-index", settings['z-index']); 20362 }); 20363 }); 20364 } 20365 20366 if (settings.right > 0) { 20367 var tr = table.find("> tfoot > tr"); 20368 20369 tr.each(function (k, row) { 20370 solveRightColspan(row, function (cell) { 20371 $(cell).css("z-index", settings['z-index']); 20372 }); 20373 }); 20374 } 20375 } 20376 } 20377 20378 // Set style of table parent 20379 function setParent() { 20380 var parent = $(settings.parent); 20381 var table = $(settings.table); 20382 20383 parent.append(table); 20384 parent 20385 .css({ 20386 'overflow-x': 'auto', 20387 'overflow-y': 'auto' 20388 }); 20389 20390 parent.scroll(function () { 20391 var scrollWidth = parent[0].scrollWidth; 20392 var clientWidth = parent[0].clientWidth; 20393 var scrollHeight = parent[0].scrollHeight; 20394 var clientHeight = parent[0].clientHeight; 20395 var top = parent.scrollTop(); 20396 var left = parent.scrollLeft(); 20397 20398 if (settings.head) 20399 this.find("> thead > tr > *").css("top", top); 20400 20401 if (settings.foot) 20402 this.find("> tfoot > tr > *").css("bottom", scrollHeight - clientHeight - top); 20403 20404 if (settings.left > 0) 20405 settings.leftColumns.css("left", left); 20406 20407 if (settings.right > 0) 20408 settings.rightColumns.css("right", scrollWidth - clientWidth - left); 20409 }.bind(table)); 20410 } 20411 20412 // Set table head fixed 20413 function fixHead() { 20414 var thead = $(settings.table).find("> thead"); 20415 var cells = thead.find("> tr > *"); 20416
20417 setBackground(cells); 20418 cells.css({ 20419 'position': 'relative' 20420 }); 20421 } 20422 20423 // Set table foot fixed 20424 function fixFoot() { 20425 var tfoot = $(settings.table).find("> tfoot"); 20426 var cells = tfoot.find("> tr > *"); 20427 20428 setBackground(cells); 20429 cells.css({ 20430 'position': 'relative' 20431 }); 20432 } 20433 20434 // Set table left column fixed 20435 function fixLeft() { 20436 var table = $(settings.table); 20437 20438 // var fixColumn = settings.left; 20439 20440 settings.leftColumns = $(); 20441 20442 var tr = table.find("> thead > tr, > tbody > tr, > tfoot > tr"); 20443 tr.each(function (k, row) { 20444 20445 solverLeftColspan(row, function (cell) { 20446 settings.leftColumns = settings.leftColumns.add(cell); 20447 }); 20448 // var inc = 1; 20449 20450 // for(var i = 1; i <= fixColumn; i = i + inc) { 20451 // var nth = inc > 1 ? i - 1 : i; 20452 20453 // var cell = $(row).find("*:nth-child(" + nth + ")"); 20454 // var colspan = cell.prop("colspan"); 20455 20456 // settings.leftColumns = settings.leftColumns.add(cell); 20457 20458 // inc = colspan; 20459 // } 20460 }); 20461 20462 var column = settings.leftColumns; 20463 20464 column.each(function (k, cell) { 20465 var cell = $(cell); 20466 20467 setBackground(cell); 20468 cell.css({ 20469 'position': 'relative' 20470 }); 20471 }); 20472 } 20473 20474 // Set table right column fixed 20475 function fixRight() { 20476 var table = $(settings.table); 20477 20478 settings.rightColumns = $(); 20479 20480 var tr_head = table.find('> thead').find("> tr"); 20481 var tr_body = table.find('> tbody').find("> tr"); 20482 var fcell = null; 20483 tr_head.each(function (k, row) { 20484 solveRightColspanHead(row, function (cell) { 20485 if (k === 0) { 20486 fcell = cell; 20487 } 20488 settings.rightColumns = settings.rightColumns.add(fcell); 20489 }); 20490 }); 20491 20492 tr_body.each(function (k, row) { 20493 solveRightColspanBody(row, function (cell) { 20494 settings.rightColumns = settings.rightColumns.add(cell); 20495 }); 20496 }); 20497 20498 var column = settings.rightColumns; 20499 20500 column.each(function (k, cell) { 20501 var cell = $(cell); 20502 20503 setBackground(cell); 20504 cell.css({ 20505 'position': 'relative', 20506 'z-index': '9999' 20507 }); 20508 }); 20509 20510 } 20511 20512 // Set fixed cells backgrounds 20513 function setBackground(elements) { 20514 elements.each(function (k, element) { 20515 var element = $(element); 20516 var parent = $(element).parent(); 20517 20518 var elementBackground = element.css("background-color"); 20519 elementBackground = (elementBackground == "transparent" || elementBackground == "rgba(0, 0, 0, 0)") ? null : elementBackground; 20520 20521 var parentBackground = parent.css("background-color"); 20522 parentBackground = (parentBackground == "transparent" || parentBackground == "rgba(0, 0, 0, 0)") ? null : parentBackground; 20523 20524 var background = parentBackground ? parentBackground : "white"; 20525 background = elementBackground ? elementBackground : background; 20526 20527 element.css("background-color", background); 20528 }); 20529 } 20530 20531 function solverLeftColspan(row, action) { 20532 var fixColumn = settings.left; 20533 var inc = 1; 20534 20535 for (var i = 1; i <= fixColumn; i = i + inc) { 20536 var nth = inc > 1 ? i - 1 : i; 20537 20538 var cell = $(row).find("> *:nth-child(" + nth + ")"); 20539 var colspan = cell.prop("colspan"); 20540 20541 if (typeof cell.cellPos() != 'undefined' && cell.cellPos().left < fixColumn) { 20542 action(cell); 20543 } 20544 20545 inc = colspan; 20546 } 20547 } 20548 20549 function solveRightColspanHead(row, action) { 20550 var fixColumn = settings.right; 20551 var inc = 1; 20552 for (var i = 1; i <= fixColumn; i = i + inc) { 20553 var nth = inc > 1 ? i - 1 : i; 20554 20555 var cell = $(row).find("> *:nth-last-child(" + nth + ")"); 20556 var colspan = cell.prop("colspan"); 20557 20558 action(cell); 20559 20560 inc = colspan; 20561 } 20562 } 20563 20564 function solveRightColspanBody(row, action) { 20565 var fixColumn = settings.right; 20566 var inc = 1; 20567 for (var i = 1; i <= fixColumn; i = i + inc) { 20568 var nth = inc > 1 ? i - 1 : i; 20569 20570 var cell = $(row).find("> *:nth-last-child(" + nth + ")"); 20571 var colspan = cell.prop("colspan"); 20572 action(cell); 20573 inc = colspan; 20574 } 20575 } 20576 20577 var defaults = { 20578 head: true, 20579 foot: false, 20580 left: 0, 20581 right: 0, 20582 'z-index': 0 20583 }; 20584 20585 var settings = $.extend({}, defaults, param); 20586 20587 settings.table = this; 20588 settings.parent = $(settings.table).parent(); 20589 setParent(); 20590 20591 if (settings.head == true) { 20592 fixHead();
20593 } 20594 20595 if (settings.foot == true) { 20596 fixFoot(); 20597 } 20598 20599 if (settings.left > 0) { 20600 fixLeft(); 20601 } 20602 20603 if (settings.right > 0) { 20604 fixRight(); 20605 } 20606 20607 setCorner(); 20608 20609 $(settings.parent).trigger("scroll"); 20610 20611 $(window).resize(function () { 20612 $(settings.parent).trigger("scroll"); 20613 }); 20614 } 20615 }; 20616 20617})(jQuery); 20618 20619/* cellPos jQuery plugin 20620 --------------------- 20621 Get visual position of cell in HTML table (or its block like thead). 20622 Return value is object with "top" and "left" properties set to row and column index of top-left cell corner. 20623 Example of use: 20624 $("#myTable tbody td").each(function(){ 20625 $(this).text( $(this).cellPos().top +", "+ $(this).cellPos().left ); 20626 }); 20627 */ 20628(function ($) { 20629 /* scan individual table and set "cellPos" data in the form { left: x-coord, top: y-coord } */ 20630 function scanTable($table) { 20631 var m = []; 20632 $table.children("tr").each(function (y, row) { 20633 $(row).children("td, th").each(function (x, cell) { 20634 var $cell = $(cell), 20635 cspan = $cell.attr("colspan") | 0, 20636 rspan = $cell.attr("rowspan") | 0, 20637 tx, ty; 20638 cspan = cspan ? cspan : 1; 20639 rspan = rspan ? rspan : 1; 20640 for (; m[y] && m[y][x]; ++x); //skip already occupied cells in current row 20641 for (tx = x; tx < x + cspan; ++tx) { //mark matrix elements occupied by current cell with true 20642 for (ty = y; ty < y + rspan; ++ty) { 20643 if (!m[ty]) { //fill missing rows 20644 m[ty] = []; 20645 } 20646 m[ty][tx] = true; 20647 } 20648 } 20649 var pos = {top: y, left: x}; 20650 $cell.data("cellPos", pos); 20651 }); 20652 }); 20653 }; 20654 20655 /* plugin */ 20656 $.fn.cellPos = function (rescan) { 20657 var $cell = this.first(), 20658 pos = $cell.data("cellPos"); 20659 if (!pos || rescan) { 20660 var $table = $cell.closest("table, thead, tbody, tfoot"); 20661 scanTable($table); 20662 } 20663 pos = $cell.data("cellPos"); 20664 return pos; 20665 }; 20666})(jQuery); 20667 20668/*! 20669 * jQuery UI Touch Punch 0.2.3 20670 * 20671 * Copyright 2011â2014, Dave Furfero 20672 * Dual licensed under the MIT or GPL Version 2 licenses. 20673 * 20674 * Depends: 20675 * jquery.ui.widget.js 20676 * jquery.ui.mouse.js 20677 */ 20678!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d);}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"));},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"));},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1);},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b);},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b);};}}(jQuery); 20679 20680/** 20681 * If a variable (likely a function parameter) is undefined / wasn't supplied, then 20682 * coalesce to a different value. 20683 * @param arg 20684 * @param defaultToVal 20685 * @returns {*} 20686 */ 20687function defaultTo(arg, defaultToVal) { 20688 return typeof arg !== 'undefined' ? arg : defaultToVal; 20689} 20690 20691// See https://stackoverflow.com/questions/6756583/prevent-browser-from-loading-a-drag-and-dropped-file/6756680#6756680 20692function disableBrowserFilePreview$1() { 20693 20694 window.addEventListener("dragover", function(e){
20695 e = e || event; 20696 e.preventDefault(); 20697 }, false); 20698 20699 window.addEventListener("drop", function(e){ 20700 e = e || event; 20701 e.preventDefault(); 20702 }, false); 20703} 20704 20705 20706/** 20707 * Implementation of Java's String.hashCode() in JS. 20708 * http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/ 20709 * @param absolute 20710 * @returns {number} 20711 */ 20712String.prototype.hashCode = function(absolute){ 20713 20714 absolute = defaultTo(absolute, false); 20715 20716 var hash = 0; 20717 if (this.length === 0) return hash; 20718 for (let i = 0; i < this.length; i++) { 20719 let char = this.charCodeAt(i); 20720 hash = ((hash<<5)-hash)+char; 20721 hash = hash & hash; // Convert to 32bit integer 20722 } 20723 20724 if (absolute) { 20725 hash = Math.abs(hash); 20726 } 20727 return hash; 20728}; 20729 20730 20731/** 20732 * Recursively build a HTML form compatible key-value set from a potentially multidimensional 20733 * key-value set 20734 * @param string name POST key/name. 20735 * @param mixed val POST value, which may be an object or array. 20736 * @returns {unresolved} 20737 */ 20738function buildHTMLFormAttributes(name, val) { 20739 var postKeyVals = {}; 20740 if (typeof val === 'string') { 20741 postKeyVals[name] = val; 20742 } else { 20743 $.each(val , function(valEntryName, valEntryVal) { 20744 $.extend( 20745 postKeyVals, 20746 buildHTMLFormAttributes( 20747 name+'['+valEntryName+']', 20748 valEntryVal 20749 ) 20750 ); 20751 }); 20752 } 20753 20754 return postKeyVals; 20755} 20756 20757/** 20758 * Create a deep-clone of a simple object. 20759 * 20760 * Should only be used for simple JSON-compliant objects and shouldn't be used for objects with prototypes, 20761 * functions or circular references. 20762 * @return Object 20763 */ 20764function deepClone(yourObj) { 20765 return JSON.parse(JSON.stringify(yourObj)); 20766} 20767 20768/** 20769 * Toggle browser fullscreen, if it's available. 20770 * Taken from: https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API#Toggling_fullscreen_mode 20771 */ 20772function toggleFullScreen(forceEnable) { 20773 20774 forceEnable = defaultTo(forceEnable, null); 20775 20776 var doc = window.document; 20777 var docEl = doc.documentElement; 20778 20779 var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen; 20780 var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen; 20781 20782 if (forceEnable === null) { 20783 forceEnable = !doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement; 20784 } 20785 20786 if(forceEnable) { 20787 requestFullScreen.call(docEl); 20788 } else { 20789 cancelFullScreen.call(doc); 20790 } 20791} 20792 20793/** 20794 * Very simple pluralizer. 20795 */ 20796function pluralize(word, quantity) { 20797 return quantity + ' ' + (quantity === 1 ? word : word + 's'); 20798} 20799 20800/** 20801 * 20802 * @param {Date} [date] 20803 */ 20804function getWelcomeMessage(date) { 20805 date = defaultTo(date, new Date()); 20806 20807 var hours = date.getHours(); 20808 if (hours < 12) { 20809 return 'Good morning'; 20810 } else if (hours < 17) { 20811 return 'Good afternoon'; 20812 } else { 20813 return 'Good evening'; 20814 } 20815} 20816 20817function round(num, decimalPlaces) { 20818 decimalPlaces = defaultTo(decimalPlaces, 2); 20819 var coefficient = Math.pow(10, decimalPlaces); 20820 return (Math.round(num * coefficient) / coefficient); 20821} 20822 20823 20824function formatDate(date, incDate, incTime) { 20825 20826 incDate = defaultTo(incDate, true); 20827 incTime = defaultTo(incTime, true); 20828 20829 if (!(date instanceof Date) || (!incDate && !incTime)) { 20830 return null; 20831 } 20832 20833 var opts = {}; 20834 20835 if (incDate) { 20836 Object.assign(opts, {day: 'numeric', month: 'short', year:'numeric'}); 20837 } 20838 if (incTime) { 20839 Object.assign(opts, {hour:'2-digit', minute:'2-digit'}); 20840 } 20841 20842 return date.toLocaleString('en-GB', opts); 20843} 20844 20845/** 20846 * Convert time string to equivalent total number of seconds. E.g. "16:30" -> 59400. 20847 * An invalid time string e.g. "25:30" would be rejected. 20848 * @param {string} timeString e.g. "16:30", or "4:15" etc. 20849 * @returns {?int} Total seconds, or NULL if supplied arg is invalid. 20850 */ 20851function timeToSeconds(timeString) { 20852 const [hours, minutes] = timeString.split(':').map(val => parseInt(val)); 20853 // Values which are not-a-number will fail this check: 20854 if (!(hours >= 0 && hours <= 23 && minutes >= 0 && minutes <= 59)) { 20855 return null; 20856 } 20857 return (hours * 3600) + (minutes * 60); 20858} 20859 20860 20861/** 20862 * Convert HTML metacharacters into to their HTML entities. 20863 * @param {string} str 20864 * @return {string} 20865 */ 20866function escapeHtml(str) { 20867 var entityMap = { 20868 '&': '&', 20869 '<': '<', 20870 '>': '>', 20871 '"': '"', 20872 "'": ''', 20873 '/': '/', 20874 '`': '`', 20875 '=': '=' 20876 }; 20877 20878 return String(str).replace(/[&<>"'`=\/]/g, function(s) { 20879 return entityMap[s]; 20880 }); 20881} 20882 20883/** 20884 * Return string to given length + ellipsis.
20885 * @todo Enhance to prevent word breaking. 20886 * @param {string} str 20887 * @param {number} len 20888 * @return {string} 20889 */ 20890function makeNiceString(str, len) { 20891 if (str.length <= len) { 20892 return str; 20893 } else { 20894 return str.substr(0, len - 3) + '...'; 20895 } 20896} 20897 20898/** 20899 * Parse a PHP or JS JSON encoded DateTime value and return a corresponding JS Date object. 20900 * @param {(Object|string)} d 20901 */ 20902function parseDate(d) { 20903 // Encoded from JS via JSON.stringify 20904 if (typeof d === 'string') { 20905 return new Date(d); 20906 // Encoded from PHP via json_encode: 20907 } else { 20908 // return new Date(Date.parse(d.date)); 20909 // Altered for Safari support. See https://stackoverflow.com/questions/5324178 20910 var arr = d.date.split(/[- :]/); 20911 return new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]); 20912 } 20913 20914} 20915 20916/** 20917 * See https://stackoverflow.com/a/14706877 20918 * @param {*} val 20919 * @return {boolean} TRUE if the argument is an Object or an Array. 20920 */ 20921function isObject(val) { 20922 var type = typeof val; 20923 return type === 'function' || type === 'object' && !!val; 20924} 20925 20926/** 20927 * Upper-case the first character in a string. 20928 * @param {string} str 20929 * @return {string} 20930 */ 20931function ucFirst(str) { 20932 return str.charAt(0).toUpperCase() + str.substring(1); 20933} 20934 20935/** 20936 * Remove HTML from a string. 20937 * Similar to `strip_tags(..)` in PHP. 20938 * Source: https://stackoverflow.com/a/47140708 20939 * @param {string} html e.g. "<p>Hello</p>" 20940 * @return {string} e.g. "Hello" 20941 */ 20942function stripTags(html) { 20943 var doc = new DOMParser().parseFromString(html, 'text/html'); 20944 return doc.body.textContent || ""; 20945} 20946 20947function setClipboard(text){ 20948 var input = document.createElement('input'); 20949 document.body.appendChild(input); 20950 input.value = text; 20951 input.select(); 20952 document.execCommand('copy', false); 20953 input.remove(); 20954} 20955 20956function createTooltip(tooltipProps) { 20957 const {id, heading, content, allowHtml, hideMobile, delayMs, hideOnBlur, autoload, maxWidth} = tooltipProps; 20958 20959 // Optionally hide on mobile: 20960 if (isMobileDevice() && hideMobile) { 20961 return; 20962 } 20963 20964 let title = heading ? "<p class='tippy-header'>" + heading + "</p>" : ''; 20965 20966 let contentWithTitle = 20967 "<div class='tippy-wrapper'>" + 20968 title + 20969 "<div class='tippy-inner-content'>" + content + "</div>" + 20970 "</div>"; 20971 20972 let parent = $("#" + id).parent(); 20973 20974 // Don't apply tooltip if the wrapper is tablesorter - this creates duplicates! 20975 if (parent.hasClass("tablesorter-header-inner")) { 20976 return; 20977 } 20978 20979 // Set tooltip props: 20980 parent.attr('data-tippy-content', contentWithTitle); 20981 parent.attr('data-tippy-allowHTML', allowHtml); 20982 parent.attr('data-tippy-delay', delayMs); 20983 parent.attr('data-tippy-hideOnClick', hideOnBlur); 20984 parent.attr('data-tippy-showOnCreate', autoload); 20985 parent.attr('data-tippy-maxWidth', maxWidth); 20986 parent.attr('aria-label', heading); 20987} 20988 20989/** 20990 * @return {number} Time in milliseconds since initial page load. 20991 */ 20992function uptime() 20993{ 20994 // List of performance types - see https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType 20995 const [currPage] = performance.getEntriesByType("navigation"); 20996 return (performance.now() - currPage.startTime); 20997} 20998 20999 21000/** 21001 * If `arrOrVal` is an array, return it as it is. 21002 * If `arrOrVal` is anything else, box it inside an array and return that. 21003 * 21004 * @param {*|Array} arrOrVal 21005 */ 21006Array.box = function(arrOrVal) { 21007 if (Array.isArray(arrOrVal)) { 21008 return arrOrVal; 21009 } else { 21010 return [arrOrVal]; 21011 } 21012}; 21013 21014// Based on addHours from: https://stackoverflow.com/a/1050782 21015Date.prototype.addMinutes = function(m) { 21016 this.setTime(this.getTime() + (m*60*1000)); 21017 return this; 21018}; 21019 21020 21021/** IE11 Polyfills: **/ 21022 21023/* 21024 `Element.closest` https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill 21025*/ 21026 21027if (!Element.prototype.matches) { 21028 Element.prototype.matches = Element.prototype.msMatchesSelector || 21029 Element.prototype.webkitMatchesSelector; 21030} 21031 21032if (!Element.prototype.closest) { 21033 Element.prototype.closest = function(s) { 21034 var el = this; 21035 21036 do { 21037 if (el.matches(s)) return el; 21038 el = el.parentElement || el.parentNode; 21039 } while (el !== null && el.nodeType === 1); 21040 return null; 21041 }; 21042} 21043 21044/* 21045 `NodeList.forEach` https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill 21046 */ 21047if (window.NodeList && !NodeList.prototype.forEach) { 21048 NodeList.prototype.forEach = Array.prototype.forEach; 21049} 21050 21051/* 21052 `ChildNode.remove` https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove#Polyfill 21053 */ 21054(function (arr) { 21055 arr.forEach(function (item) { 21056 if (item.hasOwnProperty('remove')) { 21057 return; 21058 }
21059 Object.defineProperty(item, 'remove', { 21060 configurable: true, 21061 enumerable: true, 21062 writable: true, 21063 value: function remove() { 21064 if (this.parentNode === null) { 21065 return; 21066 } 21067 this.parentNode.removeChild(this); 21068 } 21069 }); 21070 }); 21071})([Element.prototype, CharacterData.prototype, DocumentType.prototype]); 21072 21073 21074// Function to load the image when it's about to come into the viewport 21075const lazyLoadImages = () => { 21076 const images = document.querySelectorAll('img.lazy'); 21077 const observer = new IntersectionObserver((entries, observer) => { 21078 entries.forEach(entry => { 21079 if (entry.isIntersecting) { 21080 const img = entry.target; 21081 const cacheBuster = new Date().getTime(); // or a server-side version string 21082 const imgSrc = img.getAttribute('data-src'); 21083 if (imgSrc) { 21084 // Add a fallback for broken or missing images 21085 img.onerror = () => { 21086 img.src = '/images/placeholder.jpg'; // â path to your default placeholder 21087 img.classList.add('broken-image'); 21088 }; 21089 21090 // Trigger actual image load with cache-busting param 21091 img.src = `${imgSrc}?v=${cacheBuster}`; 21092 } 21093 img.classList.remove('lazy'); 21094 observer.unobserve(img); 21095 } 21096 }); 21097 }, { threshold: 0.1 }); // Load earlier (10% visible) 21098 21099 images.forEach(img => observer.observe(img)); 21100 21101 // ð Watch for dynamically added images 21102 const mutationObserver = new MutationObserver((mutations) => { 21103 mutations.forEach(mutation => { 21104 mutation.addedNodes.forEach(node => { 21105 if (node.nodeType === 1) { 21106 if (node.tagName === 'IMG' && node.classList.contains('lazy')) { 21107 observer.observe(node); 21108 } else { 21109 // Check inside the added node (e.g., in modal) 21110 node.querySelectorAll && node.querySelectorAll('img.lazy').forEach(img => observer.observe(img)); 21111 } 21112 } 21113 }); 21114 }); 21115 }); 21116 21117 mutationObserver.observe(document.body, { 21118 childList: true, 21119 subtree: true 21120 }); 21121}; 21122 21123// Run on page load 21124document.addEventListener('DOMContentLoaded', lazyLoadImages); 21125 21126/******************************************************* 21127 * ops_modal.js - Modal box scripts 21128 ******************************************************/ 21129 21130// Used to put modal window to top on click or drag 21131modal_z_index = 901; 21132 21133/** 21134 * Define an element on the page as a trigger for a modal window. 21135 * @param trigger The element which initiates the modal window 21136 * @param triggerType The aspect of the element which causes the trigger e.g. 'link', 'formSubmit'. 21137 * @param form The form element, if one is involved. 21138 * @param styles CSS Classes to apply to the modal window. 21139 * @returns {*|jQuery|number} 21140 */ 21141function initiateModal(trigger, triggerType, form, styles) { 21142 21143 var triggerJq = $(trigger); 21144 var hasHeader = true;
21145 var isLocked = false; 21146 21147 if (triggerType == 'link') { 21148 var link = $(trigger).attr('href'); 21149 var text = $(trigger).attr('title'); 21150 $('body').append("<form class='ops_page_modal_hiddenform' action='" + link + "' method='post'></form>"); 21151 var form = $('.ops_page_modal_hiddenform'); 21152 } else if (triggerType == 'formSubmit') { 21153 var text = "text etc"; 21154 } else if (triggerType == 'dialogueConfirm') { 21155 } else if (triggerType == 'option') { 21156 var text = $(trigger).parent('select').attr('title'); 21157 } else if (triggerType == 'cell') { 21158 var link = $(trigger).attr('href'); 21159 $('body').append("<form class='ops_page_modal_hiddenform' action='" + link + "' method='post'></form>"); 21160 var form = $('.ops_page_modal_hiddenform'); 21161 } else if (triggerType == 'lock') { 21162 // Lock until system action (Esc and header+button disabled) 21163 var text = $('.ops_page_modal_message', triggerJq).first().html(); 21164 if (!text) { 21165 text = '<p class="ops_page_default_modal_message">Please wait…</p>'; 21166 } 21167 hasHeader = false; 21168 isLocked = true; 21169 } 21170 21171 if ($(trigger).is('.ops_page_modal_self')) { 21172 var index = $(trigger).closest('.ops_page_modal_instance').attr('id'); 21173 } else { 21174 var index = createModal$1(trigger, styles, hasHeader, isLocked); 21175 } 21176 21177 // Two ways of determining type? By class and by triggerType? 21178 if ($(trigger).is('.ops_page_modal_lock')) { 21179 setModalDialogueMessage(index, text, true); 21180 positionModal$1(index, true); 21181 return index; 21182 } 21183 21184 // If the triggered modal is just a confirm box (no external content). 21185 if ($(trigger).is('.ops_page_modal_confirm')) { 21186 setModalDialogue(index); 21187 var strippedTrigger = $(trigger) 21188 .removeClass('ops_page_modal_confirm') 21189 .addClass('ops_page_modal_confirm_supressed'); 21190 21191 setModalDialogueConfirm(index, text, form, strippedTrigger); 21192 positionModal$1(index, true); 21193 return index; 21194 } 21195 21196 // If the triggered modal is a webpage - AJAX and return its content. 21197 if ($(trigger).is('.ops_page_modal')) { 21198 getModalContent(index, form); 21199 positionModal$1(index, false); 21200 if ($(trigger).is('.ops_page_modal_confirm_supressed')) { 21201 $(trigger).removeClass('ops_page_modal_confirm_supressed').addClass('ops_page_modal_confirm'); 21202 } 21203 } else { 21204 form.submit(); 21205 } 21206} 21207 21208/** 21209 * Generate the HTML for the modal background and window. 21210 * @param trigger The triggering element. Can be JS Element or jQuery. 21211 * @param styles CSS Classes to apply to the modal window. 21212 * @param showHeader The window header containing the 'X' close button. 21213 * @param isLocked FALSE if the modal window can be closed with an ESC press, TRUE otherwise. 21214 * @returns {number|jQuery} 21215 */ 21216function createModal$1(trigger, styles, showHeader, isLocked) { 21217 21218 if (styles === undefined) { 21219 styles = ''; 21220 } 21221 if (showHeader === undefined) { 21222 showHeader = true; 21223 } 21224 if (isLocked === undefined) { 21225 isLocked = false; 21226 } 21227 21228 var windowWidth = document.documentElement.scrollWidth; 21229 21230 var modalIndex = $('.ops_page_modal_instance').length; 21231 createModalBackground() ; 21232 21233 html = "<div class='ops_page_modal_instance " + styles + "' id='" + modalIndex + "'>"; 21234 // Optional header 21235 if (showHeader) { 21236 html += "<div class='ops_page_modal_header'><button class='ops_page_modal_button_close' tabindex='0' aria-label='Close'></button></div>"; 21237 } 21238 html += "<div class='ops_page_modal_content' tabindex='-1'></div></div>"; 21239 21240 $(html).hide().appendTo('body').fadeIn(300); 21241 21242 var modal = $('.ops_page_modal_instance[id=' + modalIndex + ']'); 21243 var modalWidth = $(modal).width(); 21244 21245 $(modal).find('.ops_page_modal_button_close').on('click touchstart', function () { 21246 closeModal$1(modalIndex, true); 21247 if ($(trigger).is('.ops_page_modal_confirm_supressed')) { 21248 $(trigger).removeClass('ops_page_modal_confirm_supressed').addClass('ops_page_modal_confirm'); 21249 } 21250 }); 21251 21252 $(modal).click(function () { 21253 modalToFront(modalIndex, isLocked); 21254 }).on('dragstart', function () { 21255 modalToFront(modalIndex, isLocked); 21256 }); 21257 21258 if (!isLocked) { 21259 $(document).keyup(function (e) { 21260 if (e.keyCode == 27) { 21261 closeModal$1(modalIndex, true); 21262 } 21263 }); 21264 } 21265 21266 modalToFront(modalIndex, isLocked); 21267 var modal_z_index = modal_z_index - 1; 21268 21269 makeWindowed$1(modal); 21270 makeWindowed$1($('.ops_page_modal_background')); 21271 21272 $(modal).draggable({ 21273 handle: '.ops_page_modal_header', 21274 containment: [0, 0, windowWidth - modalWidth, 10000] 21275 }); 21276 21277 return modalIndex; 21278 21279} 21280 21281function closeModal$1(index, modalComplete) { 21282 21283 $('.ops_page_modal_instance[id=' + index + ']').fadeOut(200, function () { 21284 $(this).remove(); 21285 }); 21286 21287 // Remove lightbox effect only when the last modal instance is being removed 21288 if ($('.ops_page_modal_instance').length <= 1) {
21289 destroyModalBackground(); 21290 } 21291 21292 if (modalComplete == true) { 21293 $('.ops_datagrid_options_selections_tasks').each(function () { 21294 $(this).find('option:first-child').attr('selected', 'selected'); 21295 }); 21296 $('form').find('input[name=ops_page_modal_dialogue_confirm]').remove(); 21297 } 21298 $(document).unbind('keyup'); 21299 21300} 21301 21302function createModalBackground() { 21303 if ($('.ops_page_modal_background').length == 0) { 21304 html = "<div class='ops_page_modal_background'></div>"; 21305 $(html).hide().appendTo('body').fadeIn(200); 21306 21307 } 21308} 21309 21310function destroyModalBackground() { 21311 $('.ops_page_modal_background').fadeOut(200, function () { 21312 $(this).remove(); 21313 }); 21314} 21315 21316function positionModal$1(index, centre) { 21317 21318 var modal = $('.ops_page_modal_instance[id=' + index + ']'); 21319 21320 var scroll_y = getScrollPosY(); 21321 21322 var windowWidth = document.documentElement.clientWidth; 21323 var windowHeight = document.documentElement.clientHeight; 21324 var modalHeight = $(modal).height(); 21325 var modalWidth = $(modal).width(); 21326 var displace_top = ((windowHeight / 2 - modalHeight / 2) + scroll_y); 21327 var displace_left = (windowWidth / 2 - modalWidth / 2); 21328 if (displace_top < scroll_y) { 21329 displace_top = scroll_y; 21330 } 21331 $(modal).css({ 21332 'top': displace_top + "px", 21333 'left': displace_left + "px" 21334 }); 21335 positionModalBackground$1(); 21336 21337} 21338 21339function positionModalBackground$1() { 21340 21341 var scroll_y = getScrollPosY(); 21342 21343 $('.ops_page_modal_background').css({'top': scroll_y + "px"}); 21344 21345} 21346 21347/** 21348 * Populate a modal window's content with an AJAX HTTP response from an endpoint specified in the 21349 * modal trigger. 21350 * @param index The index of the modal window waiting to be filled with content. 21351 * @param form A form element storing the details of the modal trigger. This form may be 21352 * taken from the modal trigger or was generated earlier in this script as a hidden element. 21353 */ 21354function getModalContent(index, form) { 21355 21356 var modal = $('.ops_page_modal_instance[id=' + index + ']'); 21357 $(document).ajaxError(function (e, xhr, settings, exception) { 21358 //alert(exception);
21359 if ($(form).is('.ops_form_modal')) { 21360 closeModal$1(index, true); 21361 } else { 21362 $(modal).find('.ops_page_modal_content').empty(); 21363 setModalDialogue(index); 21364 setModalDialogueError(index, settings.url); 21365 } 21366 }); 21367 21368 $(modal) 21369 .find('.ops_page_modal_content') 21370 .html("<p class='ops_page_ajaxloading modal_loading'>Please wait</p></div>"); 21371 21372 var link = $(form).attr('action'); 21373 $(form).append("<input type='hidden' name='ops_page_modal' value='1' />"); 21374 $.ajax({ 21375 type: "POST", 21376 url: link, 21377 data: encodeURIComponent($(form).serialize()), 21378 dataType: 'text', //change to just text from text/html for jquery 1.5 and higher 21379 success: function (data, status, XMLHttpRequest) { 21380 $(modal).find('.ops_page_modal_content').html(data); 21381 21382 bindModalTrigger$1(modal); 21383 $(modal).unbind('ajaxError'); 21384 var maxWidth = 800; 21385 $(modal).find('.ops_page_modal_content').find('html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td').each(function () { 21386 if ($(this).width() > maxWidth) { 21387 maxWidth = $(this).width(); 21388 } 21389 }); 21390 $(modal).css({'width': (maxWidth + 20) + "px"}); 21391 $(modal).find('.ops_form.ops_page_modal').submit(function (event) { 21392 event.preventDefault(); 21393 }); 21394 positionModal$1(index, false); 21395 $(modal).find('.ops_page_modal_content').focus(); 21396 } 21397 }); 21398 $('.ops_page_modal_hiddenform').remove(); 21399} 21400 21401function setModalDialogue(index) { 21402 var windowWidth = document.documentElement.scrollWidth; 21403 var modalWidth = $('.ops_page_modal_instance[id=' + index + ']').width(); 21404 21405 $('.ops_page_modal_instance[id=' + index + ']').addClass('ops_page_modal_dialogue').children('.ops_page_modal_content').append( 21406 "<div class='ops_page_modal_dialogue_text'></div>" + 21407 "<div class='ops_page_modal_dialogue_buttons'></div>" 21408 ); 21409 21410 $('.ops_page_modal_instance[id=' + index + ']').draggable({ 21411 handle: '.ops_page_modal_header', 21412 containment: [0, 0, windowWidth - modalWidth, 10000] 21413 }); 21414 positionModal$1(index); 21415} 21416 21417/** 21418 * Find the text container, if none found get the 21419 * content container, add a text container to it and return ref 21420 */ 21421function findModalDialogueText(index) { 21422 var dialogue = $('.ops_page_modal_instance[id=' + index + ']').first(); 21423 var textTarget = $('.ops_page_modal_dialogue_text', dialogue); 21424 if (!textTarget.length) { 21425 var content = dialogue.find('.ops_page_modal_content').first(); 21426 if (content.length) { 21427 textTarget = content.append('<p class=".ops_page_modal_text"></p>'); 21428 } else throw "No modal content container was found!" 21429 } 21430 return textTarget; 21431} 21432 21433/** 21434 * Sets modal text message by appending or optionally replacing 21435 */ 21436function setModalDialogueMessage(index, text, replace) { 21437 if (replace === undefined) { 21438 replace = false; 21439 } 21440 var textTarget = findModalDialogueText(index); 21441 if (replace) { 21442 textTarget.html("<p>" + text + "</p>"); 21443 } else { 21444 textTarget.append("<p>" + text + "</p>"); 21445 } 21446} 21447 21448function setModalDialogueConfirm(index, text, prevForm, prevTrigger) { 21449 21450 var dialogue = $('.ops_page_modal_instance[id=' + index + ']'); 21451 setModalDialogueMessage(index, text); 21452 21453 $(dialogue).find('.ops_page_modal_dialogue_buttons').append( 21454 "<div class='ops_page_modal_dialogue_button ops_page_modal_dialogue_button_confirm ops_page_hovershadow'>Confirm</div>" + 21455 "<div class='ops_page_modal_dialogue_button ops_page_modal_dialogue_button_cancel ops_page_hovershadow'>Cancel</div>" 21456 ); 21457 21458 $('.ops_page_modal_dialogue_button_confirm').click(function () { 21459 var modalIndex = $(this).closest('.ops_page_modal_instance').attr('id'); 21460 closeModal$1(modalIndex); 21461 $(prevForm).append("<input type='hidden' name='ops_page_modal_dialogue_confirm' value='1' />"); 21462 initiateModal(prevTrigger, 'dialogueConfirm', prevForm); 21463 }); 21464 21465 $('.ops_page_modal_dialogue_button_cancel').click(function () { 21466 closeModal$1(index, true);
21467 if ($(prevTrigger).is('.ops_page_modal_confirm_supressed')) { 21468 $(prevTrigger).removeClass('ops_page_modal_confirm_supressed').addClass('ops_page_modal_confirm'); 21469 } 21470 }); 21471 21472} 21473 21474function setModalDialogueError(index, page) { 21475 21476 var dialogue = $('.ops_page_modal_instance[id=' + index + ']'); 21477 21478 21479 $(dialogue).find('.ops_page_modal_dialogue_text').append("<p>An error has occured whilst requesting: <br/>" + document.URL + "</p>"); 21480 21481 $(dialogue).find('.ops_page_modal_dialogue_buttons').append( 21482 "<div class='ops_page_modal_dialogue_button ops_page_modal_dialogue_button_confirm ops_page_hovershadow'>OK</div>" 21483 ); 21484 $('.ops_page_modal_dialogue_button_confirm').click(function () { 21485 var modalIndex = $(this).closest('.ops_page_modal_instance').attr('id'); 21486 closeModal$1(modalIndex); 21487 // 21488 window.location = page; 21489 }); 21490 $('.ops_page_modal_button_close').remove(); 21491 $('.ops_page_modal_dialogue_buttons').css({'width': '142px'}); 21492 21493 21494} 21495 21496/** 21497 * Bind the modal trigger events to an element or any of its descendants provided they are marked 21498 * as a modal trigger. 21499 * @param element 21500 */ 21501function bindModalTrigger$1(element) { 21502 21503 if (!element) { 21504 var element = $('body'); 21505 } 21506 21507 // Bind modals that are set to automatically load on page load. 21508 // Limit of one auto-loading modal per page, to stop potentially overflowing 21509 // users with multiple popups. 21510 $(element).find('a.ops_page_modal_autoload').eq(0).each(function () { 21511 initiateModal($(this), 'link'); 21512 }); 21513 21514 $(element).find('a.ops_page_modal, a.ops_page_modal_confirm').click(function (event) { 21515 initiateModal($(this), 'link'); 21516 event.preventDefault(); 21517 }); 21518 $(element).find('select').change(function (event) {
21519 if ($(this).find('option:selected').is('.ops_page_modal') || $(this).find('option:selected').is('.ops_page_modal_confirm')) { 21520 initiateModal($(this).find('option:selected'), 'option', $(this).parent('form')); 21521 } else if ($(this).is('.ops_form_select_submit')) { 21522 if ($(this).find('option:selected').index() == 0) { 21523 21524 } else { 21525 this.form.submit(); 21526 } 21527 } 21528 }); 21529 $(element).find('form.ops_page_modal, form.ops_page_modal_dialogue').submit(function (event) { 21530 initiateModal($(this), 'formSubmit', $(this)); 21531 }); 21532 $(element).find('td.ops_page_modal, th.ops_page_modal').each(function () { 21533 $(this).click(function () { 21534 initiateModal($(this), 'cell'); 21535 }); 21536 }); 21537 21538} 21539 21540function bindFormSubmit(index) { 21541 21542 $('.ops_page_modal_instance:eq(' + index + ')').find('.ops_form.ops_page_modal').each(function () { 21543 $(this).submit(function (event) { 21544 event.preventDefault(); 21545 getModalContent(index, this); 21546 }); 21547 }); 21548 21549} 21550 21551/** 21552 * 21553 * @param index The index of the modal window to bring to front. 21554 * @param isLocked If the modal window can be closed with an ESC press. 21555 */ 21556function modalToFront(index, isLocked) { 21557 21558 if (isLocked === undefined) { 21559 isLocked = false; 21560 } 21561 21562 $(document).unbind('keyup'); 21563 $('.ops_page_modal_instance:eq(' + index + ')').css({'z-index': modal_z_index}); 21564 modal_z_index++; 21565 if (!isLocked) { 21566 $(document).keyup(function (e) { 21567 if (e.keyCode == 27) { 21568 closeModal$1(index, true); 21569 } 21570 }); 21571 } 21572} 21573 21574function getScrollPosY() { 21575 21576 if (typeof (window.pageYOffset) == 'number') { // Netscape compliant 21577 var scroll_y = window.pageYOffset; 21578 } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) { // DOM compliant 21579 var scroll_y = document.body.scrollTop; 21580 } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) { // IE6 standards compliant mode 21581 var scroll_y = document.documentElement.scrollTop; 21582 } else { 21583 var scroll_y = 0; 21584 } 21585 21586 return scroll_y; 21587 21588} 21589 21590/** 21591 * Make the specified div a windowed control in IE6. 21592 * This will do nothing for all other browsers. 21593 * This masks an iframe (which is a windowed control) onto the div, turning the div into a windowed control itself. 21594 * @param p_div 21595 */ 21596function makeWindowed$1(p_div) { 21597
21598 var is_ie6 = 21599 document.all && 21600 (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1); 21601 21602 if (is_ie6) { 21603 var html = "<iframe style=\"position: absolute; display: block; " + 21604 "z-index: -1; width: 100%; height: 100%; top: 0; left: 0;" + 21605 "filter: mask(); background-color: #ffffff; \"></iframe>"; 21606 if (p_div) $(p_div).append(html); 21607 // force refresh of div 21608 var olddisplay = $(p_div).css('display'); 21609 $(p_div).css({'display': 'none'}); 21610 $(p_div).css({'display': olddisplay}); 21611 } 21612 ; 21613 21614} 21615 21616// var notifications = { count:0, items:[] } ; 21617 21618/** @constant {number} */ 21619 21620/** @TODO: responseFlashRedirect reloads assets twice. This is a workaround fix. */ 21621if (typeof NOTIFICATION_DEFAULT$1 === 'undefined') { 21622 var NOTIFICATION_DEFAULT$1; 21623} 21624NOTIFICATION_DEFAULT$1 = 2 ; 21625 21626/** @constant {number} */ 21627if (typeof NOTIFICATION_ALERT$1 === 'undefined') { 21628 var NOTIFICATION_ALERT$1; 21629} 21630 NOTIFICATION_ALERT$1 = 8 ; 21631 21632/** @constant {number} */ 21633if (typeof NOTIFICATION_COMM === 'undefined') { 21634 var NOTIFICATION_COMM; 21635} 21636NOTIFICATION_COMM = 16 ; 21637 21638 21639class NotificationPanel{ 21640 constructor(){ 21641 this.items = [] ; 21642 this.styles = { 21643 2: "navigation" , 21644 8: "alert" , 21645 16: "comms" 21646 } ; 21647 this.debug = location.hostname == 'localhost' ; 21648 } 21649 21650 get nextID() { 21651 return this.items.length + 1 ; 21652 } 21653 21654 /** 21655 * Creates, stores and presents a new notification 21656 * @constructor 21657 * @param {NotificationTypes} style - NOTIFICATION_DEFAULT, NOTIFICATION_ALERT or NOTIFICATION_COMM. 21658 * @param {string} name - Unique name for this notification. Used to avoid duplicating, finding, destroying. 21659 * @param {string} icon - Specify the location and file name to use instead of the style's default. 21660 * @param {string} redirect - URL to redirect the agent when the 'open' action is used. 21661 * @param {boolean} force - Force a duplicate of this notification even if it already exists 21662 */ 21663 new( style, content, name, icon='', redirect='', force=false ) { 21664 // Fall back to a default style if no valid style is provided 21665 if ( !(style in this.styles) ) { 21666 style = NOTIFICATION_DEFAULT$1 ; 21667 } 21668 21669 // Don't duplicate unless we're being forced to 21670 if( !force && this.find( name ) ) { 21671 console.log("Notification of name '" + name + "' has already been created. " + 21672 "If you wish to duplicate, use the \'force\' option." ); 21673 return ; 21674 } 21675 21676 // Build the notification, attach it, and present it 21677 var notification = new Notification( content, name, icon, redirect); 21678 notification.id = this.nextID; 21679 notification.style = style ; 21680 21681 // Attach to the notification array 21682 this.items[ notification.id ] = notification ; 21683 21684 // Present to the user 21685 this.present( notification ); 21686 21687 } 21688 21689 present( notification ) { 21690 if( !notification instanceof Object || !notification instanceof Notification ) { 21691 return false ; 21692 } 21693 21694 if( typeof notification.html === "function" ) { 21695 var npanel = $('#notifications') ; 21696 npanel.append(notification.html()); 21697 } 21698 } 21699 21700 find( name ) { 21701 for( var i in this.items ) { 21702 var item = this.items[ i ] ; 21703 if( item instanceof Notification && item.name === name ) { 21704 return item ; 21705 } 21706 } 21707 return false ; 21708 } 21709 21710 destroy( name ) { 21711 for( var i in this.items ) { 21712 var item = this.items[ i ] ; 21713 if( item instanceof Notification && item.name === name ) { 21714 this.items.splice( i, 1 ) ; 21715 // Remove from the HTML panel, if it exists 21716 var npanel = $('#notifications') ; 21717 npanel.find( "[data-notification-name='" + name + "']").fadeOut() ; 21718 } 21719 } 21720 } 21721 21722} 21723 21724class Notification{ 21725 21726 constructor( content, name, icon = '', redirect = '' ) { 21727 this.id = null ; // set by the creation method of the notifications collection 21728 this.content = content ; 21729 this.name = name ; 21730 this.icon = icon ; 21731 this.redirect = redirect ; 21732 this.actions = { ok: true, open: (redirect.length > 0) } ; 21733 this.style = NOTIFICATION_DEFAULT$1 ; 21734 } 21735 21736 html() { 21737 var html = '\n\t\t\t<div data-redirect="' + this.redirect + '" ' + 21738 'data-notification-name="' + this.name + '" ' + 21739 'data-notification-id="' + this.id + '" ' + 21740 'class="panel ' + notificationPanel$1.styles[ this.style ] + '" ' 21741 ; 21742 if ( this.icon.length > 0 ) { 21743 html += 'style="background-image:url(\'' + this.icon + '\');" ' ; 21744 } 21745 21746 html += '>\n'; 21747 21748 if ( this.actions.ok || this.actions.open ) { 21749 html += '\t\t\t\t<form>\n'; 21750 if ( this.actions.ok ) { 21751 html += '\t\t\t\t\t<input type="button" value="OK" data-value="OK">\n'; 21752 } 21753 if ( this.actions.open ) { 21754 html += '\t\t\t\t\t<input type="button" value="Open" data-value="Open">\n'; 21755 } 21756 html += '\t\t\t\t</form>\n'; 21757 } 21758 html += '\t\t\t\t' + this.content + '\n\t\t\t</div>'; 21759 return html ; 21760 } 21761} 21762 21763/*class Alert extends Notification { 21764 constructor( content, name, icon, redirect ){ 21765 super( content, name, icon, redirect ) ; 21766 this.style = 'alert' ; 21767 } 21768} 21769 21770class Comm extends Notification { 21771 constructor( content, name, icon, redirect ){ 21772 super( content, name, icon, redirect ) ; 21773 this.style = 'comms' ; 21774 } 21775}*/ 21776 21777/*function notification( content, style, name, icon=null, showOK=true, showOpen=false, redirect=null ){ 21778 this.content = content ; 21779 this.style = style ; 21780 this.name = name ; 21781 this.icon = icon ; 21782 this.actions = { ok: showOK, open: showOpen } ; 21783 this.redirect = redirect ; 21784 21785 this.html = function() { 21786 var html = '\n\t\t\t<div data-redirect="\' + redirect + \'" data-notification-id="' + notifications.count + '" class="panel ' + style + '">\n'; 21787 if ( this.actions.ok || this.actions.open ) { 21788 html += '\t\t\t\t<form>\n'; 21789 if (showOK) { 21790 html += '\t\t\t\t\t<input type="button" value="OK" data-value="OK">\n'; 21791 } 21792 if (showOpen) { 21793 html += '\t\t\t\t\t<input type="button" value="Open" data-value="Open">\n'; 21794 } 21795 html += '\t\t\t\t</form>\n'; 21796 } 21797 html += '\t\t\t\t' + content + '\n\t\t\t</div>'; 21798 return html ; 21799 } 21800} 21801 21802function createNotification( content, style, name, icon=null, showOK=true, showOpen=false, redirect=null ) { 21803 notifications.count ++ ; 21804 21805 var npanel = $('#notifications') ; 21806 var html = '\n\t\t\t<div data-redirect="\' + redirect + \'" data-notification-id="' + notifications.count + '" class="panel ' + style + '">\n' ; 21807 if( showOK || showOpen ) { 21808 html += '\t\t\t\t<form>\n' ; 21809 if ( showOK ) { 21810 html += '\t\t\t\t\t<input type="button" value="OK" data-value="OK">\n'; 21811 } 21812 if ( showOpen ) { 21813 html += '\t\t\t\t\t<input type="button" value="Open" data-value="Open">\n'; 21814 } 21815 html += '\t\t\t\t</form>\n' ; 21816 } 21817 html += '\t\t\t\t' + content + '\n\t\t\t</div>' ; 21818 21819 npanel.append( html ) ; 21820 21821 var item = {} ; 21822 item.id = notifications.count ; 21823 item.name = name ; 21824 21825 notifications.items.push( item ) ; 21826} 21827*/ 21828$(function(){ 21829 $('#notifications').on( 'click' , 'input', function(){ 21830 switch( $(this).data( 'value' ) ) { 21831 case "OK": 21832 $(this).closest( '.panel' ).fadeOut() ; 21833 break; 21834 case "Open": 21835 window.location = $(this).closest( '.panel' ).data( 'redirect' ) ; 21836 break; 21837 } 21838 }) ; 21839}); 21840 21841const notificationPanel$1 = new NotificationPanel() ; 21842 21843(function ($) { 21844 var dropdownJSProcessed = false; 21845 21846 21847 $.fn.extend({ 21848 21849 datagrid: function (options) { 21850 21851 return this.each(function () { 21852 21853 var o = options; 21854 var obj = $(this); 21855 var dropdown_open = -1; 21856 var header_pos = 0; 21857 var dropdown_position_x = 0; 21858 21859 // Removes action button and sets on select behaviour to dropdown 21860 $(obj).find('.ops_datagrid_options_actions input:submit').remove(); 21861 21862 if ( $(obj).attr("id").indexOf("_data") != -1 ) { 21863 // Hover and click behaviour on rows for grids with fixed rows/columns 21864 var re = /_data$/; 21865 var dgID = $(obj).attr("id").replace(re, ""); 21866 21867 var $trs = $('table#' + dgID + '_data tr, table#' + dgID + '_rowLabels tr'); 21868 $trs.hover( 21869 function() { 21870 var i = $(this).index() + 1; 21871 $trs.filter(':nth-child(' + i + ')').addClass('hover'); 21872 }, 21873 function() { 21874 var i = $(this).index() + 1; 21875 $trs.filter(':nth-child(' + i + ')').removeClass('hover'); 21876 } 21877 ); 21878 } else { 21879 // Hover and click behaviour on rows of standard datagrids 21880 $(obj).find('tbody td').hover(function () { 21881 $(this).closest('tr').addClass('hover'); 21882 }, function () { 21883 $(this).closest('tr').removeClass('hover'); 21884 }).click(function () { 21885 if ($(this).is(':not(.ops_datagrid_blocklink)')) { 21886 var togglerow = $(this).closest('tr'); 21887 toggleselect(togglerow, "toggle"); 21888 } 21889 }); 21890 } 21891 21892 21893 // All, invert selections 21894 $(obj).find('.ops_datagrid_options_selections_icon_all').each(function () { 21895 $(this).click(function () { 21896 if ($(this).is('.checked')) { 21897 var togglerow = $(this).closest('.ops_datagrid').find('tbody > tr'); 21898 toggleselect(togglerow, "unset"); 21899 $(this).removeClass('checked'); 21900 $(this).attr('src', 'Static/Icons/C/checkbox_empty.png'); 21901 } else { 21902 var togglerow = $(this).closest('.ops_datagrid').find('tbody > tr:visible'); 21903 toggleselect(togglerow, "set"); 21904 $(this).addClass('checked'); 21905 $(this).attr('src', 'Static/Icons/C/checkbox_checked.png'); 21906 } 21907 }); 21908 }); 21909 $(obj).find('.ops_datagrid_options_selections_icon.ops_datagrid_options_selections_icon_invert').each(function () { 21910 $(this).click(function () { 21911 $(this).closest('.ops_datagrid').find('tbody > tr:visible').each(function () { 21912 var togglerow = $(this); 21913 toggleselect(togglerow, "toggle"); 21914 });
21915 }); 21916 }); 21917 21918 // Closes dropdown if click event is on body, has class .ops_datagrid_dropdown_open or if click is within dropdown 21919 $('body').click(function (event) { 21920 if ($(event.target).is('.ops_datagrid_dropdown') || $(event.target).is('.ops_datagrid_dropdown_open') || $(event.target).closest('.ops_datagrid_dropdown').length > 0) { 21921 // Do nothing 21922 } else { 21923 if (dropdown_open !== -1) { 21924 close_dropdown(); 21925 } 21926 } 21927 }); 21928 21929 // Sets pre checked rows to be highlighted 21930 $(obj).find('.ops_datagrid_rowselect:checked').each(function () { 21931 var togglerow = $(this).closest('tr'); 21932 toggleselect(togglerow, "set"); 21933 }); 21934 21935 // Opens dropdown menu when .ops_datagrid_dropdown_open is clicked 21936 $(obj).find('.ops_datagrid_dropdown_open').click(function (event) { 21937 21938 var header = $(this); 21939 if (dropdown_open == -1 || $('.ops_datagrid_dropdown_open').index($(event.target)) !== dropdown_open) { 21940 21941 // Create dropdown within <body> 21942 $(obj).append( 21943 "<div class='ops_datagrid_dropdown' style='opacity: 0;'></div>" 21944 ); 21945 $('.ops_datagrid_dropdown').animate({ opacity: 1 }, 200); 21946 21947 makeWindowed($('.ops_datagrid_dropdown')); 21948 21949 // Create array to contain information for template 21950 var dropdown_content = {}; 21951 21952 // Sets sortable status 21953 if ($(header).is('.ops_datagrid_column_sortable')) { 21954 dropdown_content.sort_status = 'true'; 21955 } else { 21956 dropdown_content.sort_status = 'false'; 21957 } 21958 21959 // Sets sortable status 21960 if ($(header).is('.ops_datagrid_column_filterable_search')) { 21961 dropdown_content.search_status = 'true'; 21962 } else { 21963 dropdown_content.search_status = 'false'; 21964 } 21965 21966 // Creates information for discreet filtering 21967 if ($(header).is('.ops_datagrid_column_filterable_discreet')) { 21968 21969 var discreet_searchable_tr = $(header).parent(); 21970 var discreet_searchable_th_index; 21971 21972 var i = $(header).attr('class').indexOf("ops_datagrid_column_index_"); 21973 if (i > -1) { 21974 discreet_searchable_th_index = $(header).attr('class').substring(i + 26, i + 27); 21975 } 21976 if ($(header).closest('.ops_datagrid').find('.ops_datagrid_column_rowselect').length == 1) { 21977 discreet_searchable_th_index++; 21978 } 21979 21980 if ($(header).parent().siblings().length == 0) { 21981 discreet_searchable_th_index = $(discreet_searchable_tr).children('th').index(header); 21982 } else if ($(header).parent().siblings().length == 1) { 21983 if ($(header).closest('thead').children().index($(header).parent()) == 0) { 21984 //on first row 21985 21986 } else { 21987 //on second row 21988 var index_thisrow = $(discreet_searchable_tr).children('th').index(header); 21989 21990 var row = $(header).parent().siblings().children(); 21991 //var teeaitches = $(row).children(); 21992 var teeaitch = $(row).find('th:not([rowspan])').eq(index_thisrow); 21993 21994 var thing = $(teeaitches).index($(teeaitch)); 21995 21996 21997 var ache = $(row).children().filter(':lt(' + thing + ')').filter('[rowspan]'); 21998 21999 22000 discreet_searchable_th_index = $(ache).length + index_thisrow; 22001 } 22002 } else { 22003 22004 } 22005 22006 var discreet_options = new Array(); 22007 22008 $(this).closest('.ops_datagrid').find('tbody > tr').each(function () { 22009 if ($(this).is('.no_results')) { 22010 return; 22011 } 22012 var td_content = $(this).children('td').eq(discreet_searchable_th_index); 22013 var bool = 'false'; 22014 var visible = 'false'; 22015 for (var i in discreet_options) { 22016 if (discreet_options[i].value == td_content.text()) { 22017 bool = 'true'; 22018 } 22019 } 22020 if ($(td_content).is(':visible')) { 22021 visible = 'true'; 22022 } 22023 if (bool == 'false') { 22024 discreet_options.push({ name: 'something', value: td_content.text(), visible: visible }); 22025 } 22026 }); 22027 22028 discreet_options.sort(); 22029 22030 dropdown_content.discreet_options = discreet_options; 22031 } 22032 22033 // Apply and process template 22034 $(".ops_datagrid_dropdown").setTemplate($("#dropdown_template").html()); 22035 $(".ops_datagrid_dropdown").processTemplate(dropdown_content); 22036 22037 update_checkbox(); 22038 22039 // Position dropdown 22040 header_pos = $(this).position(); 22041 header_width = $(this).width(); 22042 dropdown_width = $('.ops_datagrid_dropdown').width(); 22043 22044 if (header_pos.left + header_width + 12 + dropdown_width < document.documentElement.clientWidth) { 22045 dropdown_position_x = header_pos.left + header_width + 12; 22046 } else { 22047 dropdown_position_x = header_pos.left - dropdown_width - 10; 22048 } 22049 $('.ops_datagrid_dropdown').css({ 'top': header_pos.top + 31, 'left': dropdown_position_x }); 22050 22051 dropdown_open = $('.ops_datagrid_dropdown_open').index($(this)); 22052 22053 $('.ops_datagrid_dropdown_searching_searchfield').focus(); 22054 22055 // Binds click events to submit buttons with dropdown 22056 // Binds click event to sort links 22057 $('.ops_datagrid_dropdown_sorting_sort').click(function () {
22058 var table = $(header).closest('.ops_datagrid'); 22059 var headers = $(header).parent().children(); 22060 var column = headers.index(header); 22061 if ($(this).is('.ops_datagrid_dropdown_sorting_sort_asc')) { 22062 sort_table(table, header, column, 'asc'); 22063 } else if ($(this).is('.ops_datagrid_dropdown_sorting_sort_desc')) { 22064 sort_table(table, header, column, 'desc'); 22065 } 22066 close_dropdown(); 22067 }); 22068 22069 // Binds click event for search field 22070 $('.ops_datagrid_dropdown_searching_searchfield').keyup(function () { 22071 var table_id = $('.ops_datagrid').index($(header).closest('.ops_datagrid')); 22072 22073 var search_field = $(header).text(); 22074 search_term = new Array($(this).val()); 22075 22076 filtertable(table_id, search_field, search_term); 22077 }); 22078 22079 // Binds click event for discreet filters 22080 $('.ops_datagrid_dropdown_filtering_checkbox_option').click(function () { 22081 update_checkbox(); 22082 }); 22083 $('.ops_datagrid_dropdown_filtering_checkbox_all').click(function () { 22084 if ($(this).attr('checked')) { 22085 $(this).siblings('.ops_datagrid_dropdown_filtering_checkbox_option').attr('checked', 'true'); 22086 } else { 22087 $(this).siblings('.ops_datagrid_dropdown_filtering_checkbox_option').attr('checked', ''); 22088 } 22089 }); 22090 $('.ops_datagrid_dropdown_filtering_submit').click(function () { 22091 var table_id = $('.ops_datagrid').index($(header).closest('.ops_datagrid')); 22092 var discreet_field = $(header).text(); 22093 discreet_terms = new Array(); 22094 $(this).parent().find('.ops_datagrid_dropdown_filtering_checkbox_option:checked').each(function () { 22095 discreet_terms.push($(this).val()); 22096 }); 22097 22098 filtertable(table_id, discreet_field, discreet_terms); 22099 close_dropdown(); 22100 }); 22101 22102 // Binds click event for reset link 22103 $('.ops_datagrid_dropdown_reset').click(function () { 22104 var table_id = $('.ops_datagrid').index($(header).closest('.ops_datagrid')); 22105 filtertable(table_id); 22106 close_dropdown(); 22107 }); 22108 22109 } else { 22110 close_dropdown(); 22111 } 22112 }); 22113 22114 // When clicking the datagrid's "Export" button, ensure that the list of options shown 22115 // is sticky i.e. stays on the screen when the mouse moves outside the container. 22116 // The "hover_toggle" class is what causes it to maintain this state. 22117 $(obj).find('.ops_datagrid_export_button').click( function() { 22118 $(this).closest('.ops_datagrid_export').toggleClass('hover_toggle'); 22119 } ); 22120 22121 // On the click of a dropdown item, remove any toggled state of the dropdown. 22122 $(obj).find('.ops_datagrid_export_options a').click( function() { 22123 $(this).closest('.ops_datagrid_export').removeClass('hover_toggle'); 22124 } ); 22125 }); 22126 22127 // Fades then closes dropdown dependant on mouse position 22128 $(document).mousemove(function (e) { 22129 22130 var dropdown_width = $('.ops_datagrid_dropdown').width() + 10; // 10 is twice the padding 22131 var dropdown_height = $('.ops_datagrid_dropdown').height() + 10; 22132 var dis_x; 22133 var dis_y; 22134 22135 if (e.pageX < dropdown_position_x) { 22136 dis_x = -1 * (dropdown_position_x - e.pageX); 22137 } else if (e.pageX > (dropdown_position_x + dropdown_width)) { 22138 dis_x = dropdown_position_x + dropdown_width - e.pageX; 22139 } else { 22140 dis_x = 0; 22141 } 22142 22143 if (e.pageY < header_pos.top + 31) { 22144 dis_y = -1 * (header_pos.top + 31 - e.pageY); 22145 } else if (e.pageY > (header_pos.top + 31 + dropdown_height)) { 22146 dis_y = header_pos.top + 31 + dropdown_height - e.pageY; 22147 } else { 22148 dis_y = 0; 22149 } 22150 22151 var dis = Math.sqrt(dis_x * dis_x + dis_y * dis_y); 22152 22153 if (dis > 200) { 22154 close_dropdown(); 22155 } else { 22156 $('.ops_datagrid_dropdown').css({ 'opacity': 1 - (dis / 500) }); 22157 } 22158 22159 }); 22160 22161 function sort_table(table, tab_header, col_index, direction) { 22162 22163 var amount_num = 0; 22164 var amount_date_ddMMMyy = 0; 22165 var amount_date_ddMMMyyhhmm = 0; 22166 var amount_btec = 0; 22167 var btec_chars = /[DMPF]{1,3}/; 22168 22169 // Count different data types 22170 $(table).find('tbody > tr').each(function () { 22171 var td_content = $(this).find('td:eq(' + col_index + ')').text(); 22172 if (parseInt(td_content, '10')) { // If number 22173 amount_num++; 22174 if ((td_content.charAt(2) == ' ') && (td_content.charAt(6) == ' ') && (td_content.length == 9)) { // If ddMMMyy 22175 amount_date_ddMMMyy++; 22176 } else if ((td_content.charAt(2) == ' ') && (td_content.charAt(6) == ' ') && (td_content.charAt(9) == ' ') && (td_content.charAt(12) == ':') && (td_content.length == 15)) { // If ddMMMyyhhmm 22177 amount_date_ddMMMyyhhmm++; 22178 } 22179 } else if (td_content.match(btec_chars)) { // If btec 22180 amount_btec++; 22181 } 22182 }); 22183 22184 var amount_rows = $(table).find('tbody > tr').length; 22185 if (amount_date_ddMMMyy == amount_rows) { 22186 var datatype = 'ddMMMyy'; 22187 } else if (amount_date_ddMMMyyhhmm == amount_rows) { 22188 var datatype = 'ddMMMyyhhmm'; 22189 } else if (amount_num == amount_rows) { 22190 var datatype = 'number'; 22191 } else if (amount_btec == amount_rows) { 22192 var datatype = 'btec'; 22193 } 22194 22195 var rows = table.find('tbody > tr').get(); 22196 var direction; 22197 if (direction == 'desc') { 22198 direction = -1; 22199 $(tab_header).closest('.ops_datagrid').find('tbody tr').each(function () { 22200 $(this).find('td.ordered_column').removeClass('ordered_column'); 22201 $(this).find('td').eq(col_index).addClass('ordered_column'); 22202 }); 22203 } else if (direction == 'asc') { 22204 direction = 1; 22205 $(tab_header).closest('.ops_datagrid').find('tbody tr').each(function () { 22206 $(this).find('td.ordered_column').removeClass('ordered_column'); 22207 $(this).find('td').eq(col_index).addClass('ordered_column'); 22208 }); 22209 } 22210 rows.sort(function (a, b) { 22211 if (datatype == 'number') { 22212 var numberA = parseInt($(a).children('td').eq(col_index).text()); 22213 var numberB = parseInt($(b).children('td').eq(col_index).text()); 22214 if (numberA < numberB) return -direction; 22215 if (numberA > numberB) return direction; 22216 return 0; 22217 } else if (datatype == 'ddMMMyy') { 22218 var dateA = new Date(getDateFromFormat($(a).children('td').eq(col_index).text(), 'dd MMM yy')); 22219 var dateB = new Date(getDateFromFormat($(b).children('td').eq(col_index).text(), 'dd MMM yy')); 22220 if (dateA < dateB) return -direction; 22221 if (dateA > dateB) return direction; 22222 return 0; 22223 } else if (datatype == 'ddMMMyyhhmm') { 22224 var dateA = new Date(getDateFromFormat($(a).children('td').eq(col_index).text(), 'dd MMM yy kk:mm')); 22225 var dateB = new Date(getDateFromFormat($(b).children('td').eq(col_index).text(), 'dd MMM yy kk:mm')); 22226 if (dateA < dateB) return -direction; 22227 if (dateA > dateB) return direction; 22228 return 0; 22229 } else if (datatype == 'btec') { 22230 var grades = new Array('D', 'M', 'P', 'F');
22231 var gradeAArray = $(a).children('td').eq(col_index).text().split(''); 22232 var gradeBArray = $(b).children('td').eq(col_index).text().split(''); 22233 for (i = 0; i < gradeAArray.length; i++) { 22234 gradeA = jQuery.inArray(gradeAArray[i], grades); 22235 gradeB = jQuery.inArray(gradeBArray[i], grades); 22236 if (gradeA < gradeB) { return direction; break; } 22237 if (gradeA > gradeB) { return -direction; break; } 22238 } 22239 return 0; 22240 } else { 22241 var keyA = $(a).children('td').eq(col_index).text(); 22242 var keyB = $(b).children('td').eq(col_index).text(); 22243 if (keyA < keyB) return -direction; 22244 if (keyA > keyB) return direction; 22245 return 0; 22246 } 22247 }); 22248 $.each(rows, function (index, row) { 22249 table.children('tbody').append(row); 22250 }); 22251 22252 } 22253 22254 function filtertable(table_id, field, terms) { 22255 var table = $('.ops_datagrid').eq(table_id); 22256 $(table).find('tbody > tr').show(); 22257 $('.no_results').remove(); 22258 22259 if (!field) { 22260 return false; 22261 } 22262 22263 $(table).find('th').each(function (index) { 22264 if ($(this).text() == field) { 22265 column_index = index; 22266 } 22267 }); 22268 22269 $(table).find('tbody > tr').each(function () { 22270 var td_content = $(this).children('td').eq(column_index).text(); 22271 var keep_layer = 'false'; 22272 for (i = 0; i < terms.length; i++) { 22273 if (td_content.toUpperCase().indexOf(terms[i].toUpperCase()) > -1) { 22274 keep_layer = 'true'; 22275 return; 22276 } 22277 22278 } 22279 if (keep_layer == 'false') { 22280 $(this).hide(); 22281 toggleselect($(this), "unset"); 22282 } 22283 }); 22284 22285 if ($(table).find('tbody > tr:visible').length == 0) { 22286 $(table).find('tbody').append("<tr class='no_results'><td colspan='100'>There are no search results. Please remove a filter to try again.</td></tr>"); 22287 } 22288 22289 } 22290 22291 // Changes toggle state of given row 22292 function toggleselect(togglerow, state) { 22293 22294 if ($(togglerow).find('.ops_datagrid_rowselect').length == 0) { 22295 return false; 22296 } 22297 22298 if (state == "set") { 22299 $(togglerow).each(function () { 22300 $(this).addClass('checked'); 22301 }); 22302 $(togglerow).find('td > .ops_datagrid_rowselect').each(function () { 22303 $(this).attr('checked', 'true'); 22304 }); 22305 } else if (state == "unset") { 22306 $(togglerow).each(function () { 22307 $(this).removeClass('checked'); 22308 }); 22309 $(togglerow).find('td > .ops_datagrid_rowselect').each(function () { 22310 $(this).attr('checked', ''); 22311 }); 22312 } else if (state == "toggle") { 22313 if ($(togglerow).hasClass('checked')) { 22314 $(togglerow).each(function () { 22315 $(this).removeClass('checked'); 22316 }); 22317 $(togglerow).find('td > .ops_datagrid_rowselect').each(function () { 22318 $(this).attr('checked', ''); 22319 }); 22320 } else { 22321 $(togglerow).each(function () { 22322 $(this).addClass('checked'); 22323 }); 22324 $(togglerow).find('td > .ops_datagrid_rowselect').each(function () { 22325 $(this).attr('checked', 'true'); 22326 }); 22327 } 22328 } 22329 if ($(togglerow).parent().children('tr').length == $(togglerow).parent().children('.checked').length) { 22330 $(togglerow).closest('.ops_datagrid').find('.ops_datagrid_options_selections_icon_all').addClass('checked').attr('src', 'Static/Icons/C/checkbox_checked.png'); 22331 } else { 22332 $(togglerow).closest('.ops_datagrid').find('.ops_datagrid_options_selections_icon_all').removeClass('checked').attr('src', 'Static/Icons/C/checkbox_empty.png'); 22333 } 22334 } 22335 22336 function update_checkbox() { 22337 if ($('.ops_datagrid_dropdown_filtering_checkbox_option').length == $('.ops_datagrid_dropdown_filtering_checkbox_option:checked').length) { 22338 $('.ops_datagrid_dropdown_filtering_checkbox_all').attr('checked', 'true'); 22339 } else { 22340 $('.ops_datagrid_dropdown_filtering_checkbox_all').attr('checked', ''); 22341 } 22342 } 22343 22344 function close_dropdown() { 22345 $('.ops_datagrid_dropdown').animate({ opacity: 0 }, 200, function () { 22346 $('.ops_datagrid_dropdown').remove(); 22347 dropdown_open = -1; 22348 }); 22349 } 22350 } 22351 22352}); 22353 22354 22355})(jQuery); 22356 22357/** 22358 * ops_Form_Element_Multiselect Helper function. 22359 * Derived from jquery.multiselect.js to be updated for UX2. 22360 */ 22361 22362(function ($) { $.fn.extend({ 22363 multiselect: multiselectEnhacements, 22364 dynamicMultiselect: dynamicMultiselectEnhancements 22365}); })(jQuery); 22366 22367/** 22368 * @param object options Structure {strict: int $strict, freeze: int $freeze, limit: int $limit}. 22369 * Note that $strict and $freeze will only be 1 or 0 (as they denote a boolean value). 22370 * 22371 */ 22372function multiselectEnhacements(options) { 22373 22374 // Use simpler form for touch devices 22375 if ( isMobileDevice() ) { 22376 22377 if (options.limit > 0) { 22378 // Show the max limit. This isn't enforced by JS on touch devices, however the submission should be validated 22379 // server-side and shouldn't be an issue. 22380 $(this).after( 22381 "<br><br>" 22382 + "<span class='ops_form_multiselect_new_label'>" 22383 + "Please Select " + ((options.strict === 1) ? "Exactly" : "Up To") + ": " 22384 + "<span data-limit='" + (options.limit) + "' class='ops_form_multiselect_limit_label'>" 22385 + (options.limit) 22386 + "</span>"
22387 + "</span>" 22388 ); 22389 } 22390 return; 22391 } 22392 22393 var search_count = 0; 22394 22395 // Should only be applied to 1 element which is the root container for the multiselect (element 22396 // with an id attribute equal to the name of the multiselect). 22397 // The function should be invoked once after the multiselect has rendered (any callback events 22398 // will be binded as appropriate). 22399 this.each(function () { 22400 var original_multiselect = $(this); 22401 var original_name = $(this).attr('name'); 22402 var original_id = $(this).attr('id'); 22403 var original_class = $(this).attr('class'); 22404 22405 var disabled_class = '' ; 22406 22407 var uiElements = "<div class='ops_form_multiselect_new " + original_class + "' id='" + original_id +"'>"; 22408 22409 var limitCounter = ""; 22410 22411 if (options.limit != -1) { 22412 // Output the multi-select counter. 22413 limitCounter = "<br /><br />" 22414 +"<span class='ops_form_multiselect_new_label'>" 22415 +"Please Select " + ((options.strict === 1) ? "Exactly" : "Up To" ) +": " 22416 +"<span data-limit='"+(options.limit)+"' class='ops_form_multiselect_limit_label'>"+(options.limit)+"</span>" 22417 +"</span>"; 22418 } 22419 22420 uiElements += 22421 "<div class='ops_form_multiselect_new_selected'>" 22422 +"<label class='ops_form_multiselect_new_label'>Selected" 22423 +"<br />" 22424 +"<select multiple class='minimal_scrollbars " + disabled_class + "' size='" + options.num_rows + "'></select></label>" 22425 + limitCounter 22426 +"</div>"; 22427 22428 // If the multiselect is frozen, do not show the item transfer buttons. 22429 if ( options.frozen == 0 ) { 22430 uiElements += 22431 "<div class='ops_form_multiselect_new_buttons'>" + 22432 "<div class='ops_form_multiselect_new_buttons_add animated fast'></div>" + 22433 "<div class='ops_form_multiselect_new_buttons_remove animated fast'></div>" + 22434 "</div>"; 22435 } 22436 22437 uiElements += 22438 "<div class='ops_form_multiselect_new_notselected'>" 22439 +"<label class='ops_form_multiselect_new_label'>Not Selected" 22440 +"<br />" 22441 +"<select multiple class='minimal_scrollbars " + disabled_class + "' size='" + options.num_rows + "'></select></label>" 22442 +"<br/>" 22443 +"<div class='ops_form_multiselect_new_notselected_search'>" 22444 +"<label class='ops_form_multiselect_new_label'>Search" 22445 +"<br />" 22446 +"<input type='text' size='33'/></label>" 22447 +"</div>" 22448 +"</div>" 22449 +"<div class='ops_form_multiselect_new_notselected_holder'>" 22450 +"<select multiple class='minimal_scrollbars' size='" + options.num_rows + "'></select>" 22451 +"</div>"; 22452 22453 uiElements += "</div>"; 22454 22455 $(original_multiselect).after( uiElements ); 22456 22457 var new_multiselect = $(original_multiselect).next('.ops_form_multiselect_new '); 22458 var new_selected = $(new_multiselect).find('.ops_form_multiselect_new_selected select'); 22459 var new_notselected = $(new_multiselect).find('.ops_form_multiselect_new_notselected select'); 22460 var new_buttons = $(new_multiselect).find('.ops_form_multiselect_new_buttons'); 22461 var new_limit_counter = $(new_multiselect).find('.ops_form_multiselect_limit_label'); 22462 22463 $(original_multiselect).children('option').each(function () { 22464 if ($(this).is(':selected')) { 22465 $(new_selected).append("<option title='"+$(this).text()+"' value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22466 } else { 22467 $(new_notselected).append("<option title='"+$(this).text()+"' value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22468 } 22469 }); 22470 22471 $(original_multiselect).remove(); 22472 22473 /** Move items between selected and not when using the UI buttons **/ 22474 $(new_buttons).find('.ops_form_multiselect_new_buttons_add').bind('click', function () { 22475 update_multiselect(new_selected, new_notselected, 'add', new_limit_counter); 22476 }); 22477 $(new_buttons).find('.ops_form_multiselect_new_buttons_remove').bind('click', function () { 22478 update_multiselect(new_selected, new_notselected, 'remove', new_limit_counter); 22479 }); 22480 22481 /** Move items between selected and not when double clicking **/ 22482 $(new_notselected).on('dblclick', function () { 22483 update_multiselect(new_selected, new_notselected, 'add', new_limit_counter); 22484 }); 22485 $(new_selected).on('dblclick', function () { 22486 update_multiselect(new_selected, new_notselected, 'remove', new_limit_counter); 22487 }); 22488 22489 $("#"+original_id+"_label").remove(); 22490 22491 // Disable form submit on 'Enter' keypress 22492 $(new_multiselect).find('.ops_form_multiselect_new_notselected_search input').on('keyup keypress', function(e) { 22493 var keyCode = e.keyCode || e.which; 22494 if (keyCode === 13) { 22495 e.preventDefault(); 22496 return false; 22497 } 22498 }); 22499 22500 $(new_multiselect).find('.ops_form_multiselect_new_notselected_search input').keyup(function (e) { 22501 search_count++; 22502 var current_count = search_count; 22503 setTimeout(function () { search_notselected(current_count, new_multiselect); }, 500); 22504 }); 22505 22506 // Rebuild multiselect before submitting form 22507 $('form').submit(function (event) { 22508 //event.preventDefault(); 22509 rebuildMultiselect( new_multiselect, original_name, original_id ); 22510 }); 22511 22512 $( new_limit_counter ).text(options.limit - $(new_selected).children('option').length); 22513 }); 22514 22515 function update_multiselect(new_selected, new_notselected, direction, new_limit_counter) { 22516 var count = $(new_notselected).children('option:selected').length + $(new_selected).children('option').length; 22517 22518 if (direction == 'add') { 22519 // The sum of the selection + selected 22520 if (count <= options.limit || options.limit == -1) { // If the selection length made is less than the limit value 22521 $(new_selected).find('optgroup').each(function () { 22522 $(this).remove(); 22523 }); 22524 22525 $(new_notselected).children('option:selected').each(function () { 22526 $(new_selected).append("<option title='"+$(this).text()+"' value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22527 $(this).remove(); 22528 }); 22529 22530 if ($(new_notselected).find('option').length == 0) { 22531 $(new_notselected).append("<optgroup label='No results'></optgroup>"); 22532 } 22533 22534 if (options.l != -1){ 22535 $( new_limit_counter ).text(options.limit - $(new_selected).children('option').length); 22536 } 22537 } 22538 22539 } else if (direction == 'remove') { 22540 $(new_notselected).find('optgroup').each(function () { 22541 $(this).remove(); 22542 }); 22543 22544 $(new_selected).find('option:selected').each(function () { 22545 $(new_notselected).append("<option value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22546 $(this).remove(); 22547 }); 22548 22549 if ($(new_selected).find('option').length == 0) { 22550 $(new_selected).append("<optgroup label='None selected'></optgroup>"); 22551 } 22552 22553 if(options.l !== -1){ 22554 $( new_limit_counter ).text(options.limit - $(new_selected).children('option').length); 22555 } 22556 } 22557 } 22558 22559 function search_notselected(current_count, new_multiselect) { 22560 if (current_count == search_count) { 22561 search_count = 0; 22562 var input = $(new_multiselect).find('.ops_form_multiselect_new_notselected_search input'); 22563 var search_term = $(input).val(); 22564 var new_notselected = $(new_multiselect).find('.ops_form_multiselect_new_notselected select'); 22565 var new_notselected_holder = $(new_multiselect).find('.ops_form_multiselect_new_notselected_holder select'); 22566 $(new_notselected).find('optgroup').each(function () { 22567 $(this).remove(); 22568 }); 22569 $(new_notselected_holder).find('option').each(function () { 22570 $(new_notselected).append("<option title='"+$(this).text()+"' value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22571 $(this).remove(); 22572 }); 22573 $(input).closest('.ops_form_multiselect_new_notselected').find('option').each(function () { 22574 if ($(this).text().toUpperCase().indexOf(search_term.toUpperCase()) == -1) { 22575 $(new_notselected_holder).append("<option title='"+$(this).text()+"' value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22576 $(this).remove(); 22577 } 22578 }); 22579 if ($(input).closest('.ops_form_multiselect_new_notselected').find('option').length == 0) { 22580 $(input).closest('.ops_form_multiselect_new_notselected').find('select').append("<optgroup label='No results'></optgroup>"); 22581 } 22582 } 22583 } 22584 22585 function rebuildMultiselect( new_multiselect, original_name, original_id ) { 22586 var form = $(new_multiselect).closest('form'); 22587 $(form).append("<select multiple size='" + options.num_rows + "' class='minimal_scrollbars rebuilt_select' name='" + original_name + "' id='" + original_id + "_rebuilt'></select"); 22588 var select = $('.rebuilt_select'); 22589 $(select).removeClass('rebuilt_select').css({ 'display' : 'none' }); 22590 22591 $(new_multiselect).find('.ops_form_multiselect_new_selected select').each(function () { 22592 $(select).append($(this).html()); 22593 $(select).find('option').each(function () { 22594 $(this).attr('selected', 'selected'); 22595 }); 22596 }); 22597 $(new_multiselect).find('.ops_form_multiselect_new_notselected select').each(function () { 22598 $(select).append($(this).html()); 22599 //$(select).append("<option value='" + $(this).val() + "'>" + $(this).text() + "</option>"); 22600 }); 22601 $(new_multiselect).remove(); 22602 } 22603} 22604/* 22605 * Structure: { 22606 * 'itemMaxLength': int 22607 * 'uniqueItemNames': bool 22608 * 'newItemsFieldName': string 22609 * } 22610 */
22611function dynamicMultiselectEnhancements(options, $ms) { 22612 22613 var $addNewItemBtn = this.find('.ms_new_item_add_btn'); 22614 var $newItemName = this.find('.ms_new_item_name'); 22615 var $errorContainer = this.find('.ms_error'); 22616 // A hidden container which stores new items in input fields, allowing them to be submitted 22617 // seperately from the main multiselect data. 22618 var $newItemsContainer = this.find('.ms_hidden_new_items'); 22619 var ms = new Multiselect($ms); 22620 var idCounter = 1; 22621 22622 resetError(); 22623 22624 // Override form submit on 'Enter' key press 22625 $newItemName.on('keypress', function(e) { 22626 var keyCode = e.keyCode || e.which; 22627 if (keyCode === 13) { 22628 e.preventDefault(); 22629 tryToAddNewItem(); 22630 return false; 22631 } 22632 }); 22633 22634 $addNewItemBtn.click(tryToAddNewItem); 22635 22636 function tryToAddNewItem() { 22637 resetError(); 22638 if (validateNewItem()) { 22639 addNewItem(); 22640 } 22641 } 22642 22643 /** 22644 * Check the new item for errors 22645 * @returns bool If it validates correctly. 22646 */ 22647 function validateNewItem() { 22648 if ($newItemName.val().length > options.itemMaxLength) { 22649 showError('Item names must be less than or equal to '+options.itemMaxLength+' characters.'); 22650 return false; 22651 } 22652 22653 if ($newItemName.val().length < 1) { 22654 return false; 22655 } 22656 22657 if (options['uniqueItemNames'] && ms.hasItemOfName($newItemName.val())) { 22658 showError('An item with that name already exists.'); 22659 return false; 22660 } 22661 22662 return true; 22663 } 22664 22665 /** 22666 * Add the New Item to the multiselect, as a selected item. 22667 */ 22668 function addNewItem() { 22669 22670 var id = getNewID(); 22671 var newItemName = $newItemName.val(); 22672 22673 // Add to the hidden set of new items. 22674 // Its value will be encoded like: "$itemId $itemText". 22675 $newItemsContainer.append( 22676 '<input type="hidden" name="'+options['newItemsFieldName']+'[]" value="'+id+' '+newItemName+'"/>' 22677 ); 22678 22679 // Add to the multiselect 'Selected' set 22680 ms.addItems({ 22681 'value': id, 22682 'text': newItemName, 22683 'selected': options['newItemAutoSelect'], 22684 'append': false 22685 }); 22686 22687 // Empty the text in the button 22688 $newItemName.val(''); 22689 } 22690 22691 function getNewID() { 22692 var idNum = parseInt(options['numRepopulatedDynamicItems']) + idCounter++; 22693 22694 return options['dynamicItemPrefix']+idNum; 22695 } 22696 22697 function showError(msg) { 22698 $errorContainer.text(msg); 22699 22700 // Show the error box 22701 $errorContainer.removeAttr('hidden'); 22702 $errorContainer.addClass('alert'); 22703 } 22704 22705 function resetError() { 22706 $errorContainer.text(''); 22707 22708 // Hide the error box 22709 $errorContainer.attr('hidden', ''); 22710 $errorContainer.removeClass('alert'); 22711 } 22712} 22713 22714/** 22715 * Multiselect Helper constructor 22716 * @param jQuery A singleton JQ object addressing the ID of the element holding the multiselect. 22717 */ 22718var Multiselect = function(element) { 22719 this.isMobile = isMobileDevice() ; 22720 22721 this.element = element; 22722 22723 if (!this.isMobile) { 22724 this.selected = this.element.find('.ops_form_multiselect_new_selected select'); 22725 this.unselected = this.element.find('.ops_form_multiselect_new_notselected select'); 22726 this.limitCounter = this.element.find('.ops_form_multiselect_limit_label'); 22727 this.searchInput = this.element.find('.ops_form_multiselect_new_notselected_search input'); 22728 this.searchItemHolder = this.element.find('.ops_form_multiselect_new_notselected_holder select'); 22729 22730 // If the jQuery selector matched more than zero elements 22731 if (this.limitCounter.length > 0) { 22732 this.limit = this.limitCounter.data('limit'); 22733 } else { 22734 this.limitCounter = null; 22735 } 22736 } else { 22737 this.selected = this.element; 22738 this.limitCounter = null; 22739 } 22740}; 22741 22742Multiselect.prototype.resetSearch = function() { 22743 this.searchInput.val(''); 22744 this.searchInput.trigger('keyup'); 22745}; 22746 22747/** 22748 * Fetch all items held by this multiselect. 22749 * @param {string} filterItems 'selected' for only selected items, 'unselected' for vice versa. Ignore to get all items. 22750 * @return array Structure: [{"value": string, "text": string, "selected": bool}]. 22751 */ 22752Multiselect.prototype.getItems = function(filterItems) { 22753 var items = this.isMobile ? this._getItemsMobile() : this._getItemsDesktop(); 22754 if (filterItems) { 22755 items = items.filter(function(item) { 22756 return item.selected === (filterItems === 'selected'); 22757 }); 22758 } 22759 22760 return items; 22761}; 22762 22763Multiselect.prototype._getItemsMobile = function() { 22764 var items = []; 22765 this.selected.children('option').each(function(){ 22766 items.push({ 22767 value: $(this).attr('value'), 22768 text: $(this).html(), 22769 selected: this.selected 22770 }); 22771 }); 22772 return items; 22773}; 22774 22775Multiselect.prototype._getItemsDesktop = function() { 22776 var items = []; 22777 22778 // Get unselected items (if we're not on mobile) 22779 this.unselected.children('option').each(function () { 22780 items.push({ 22781 value: $(this).attr('value'), 22782 text: $(this).html(), 22783 selected: false 22784 }); 22785 }); 22786 22787 // Get selected items. 22788 this.selected.children('option').each(function(){ 22789 items.push({ 22790 value: $(this).attr('value'), 22791 text: $(this).html(), 22792 selected: true 22793 }); 22794 }); 22795 22796 return items; 22797}; 22798 22799/** 22800 * Delete all items or optionally a set of items existing in the multiselect.] 22801 * @param array [optional] Exclude to delete all items, otherwise provide an array storing a set of 22802 * item values which need to be deleted. Structure: [ string ]. 22803 * @return bool True if something was deleted, false otherwise. 22804 */ 22805Multiselect.prototype.removeItems = function(yourItems) { 22806 if (typeof items === 'undefined') { 22807 22808 var count = ( this.selected ? this.selected.length : 0 ) + ( this.unselected ? this.unselected.length : 0 ); 22809 22810 if ( typeof this.selected !== 'undefined' ) { 22811 this.selected.empty(); 22812 } 22813 22814 if ( typeof this.unselected !== 'undefined' ) { 22815 this.unselected.empty(); 22816 } 22817 22818 this.updateLimitCounter(); 22819 22820 return count > 0;
22820 // If the count was greater than 0 before deletion, something was deleted. 22821 } 22822 22823 var items = this.checkArray(yourItems); 22824 22825 var somethingWasRemoved = false; 22826 22827 this.element.children('option').each(function(){ 22828 // jQuery.inArray returns the index if in the array, -1 if not in the array. 22829 if ($.inArray($(this).val(), items) !== -1) { 22830 somethingWasRemoved = true; 22831 $(this).remove(); // Delete the option item. 22832 } 22833 }); 22834 22835 22836 22837 if (somethingWasRemoved) { 22838 this.updateLimitCounter(); 22839 } 22840 return somethingWasRemoved; 22841}; 22842 22843/** 22844 * Add items to the multiselect. 22845 * If there is a limit to the number of selected items and that limit has been met, then any items 22846 * with the 'selected' flag will by default be placed into the 'unselected' bin. 22847 * @param array Items to add. Must have the following structure: 22848 * [{"value": string, "text": string, "selected": bool}]. 22849 */ 22850Multiselect.prototype.addItems = function(yourItems){ 22851 var items = this.checkArray(yourItems); 22852 22853 var localLimitCount = this.limitCounter ? this.limitCounter.text() : null; 22854 22855 items.forEach(function(item){ 22856 22857 var itemElement = '<option title="'+item['text']+'" value="'+ item['value'] +'">'+ item['text'] +'</option>'; 22858 var shouldAppend = item.hasOwnProperty('append') ? item['append'] : true; 22859 22860 // Only set the item as 'selected' if it has the appropriate flag and if the limit is not 22861 // already full (at the max number of items). If mobile view, then always add to 'selected' as the 22862 // mobile view does not support 'unselected'. 22863 if (item['selected'] && (!this.limitCounter || localLimitCount > 0) || this.isMobile) { 22864 if (shouldAppend) { 22865 this.selected.append(itemElement); 22866 } else { 22867 this.selected.prepend(itemElement); 22868 } 22869 22870 // Make sure to update the local limit counter. 22871 if (this.localLimitCounter) localLimitCount--; 22872 22873 // Add to 'unselected': 22874 } else { 22875 if (shouldAppend) { 22876 if( typeof this.unselected !== 'undefined' ) { 22877 this.unselected.append(itemElement); 22878 } 22879 } else { 22880 if( typeof this.unselected !== 'undefined' ) { 22881 this.unselected.prepend(itemElement); 22882 } 22883 } 22884 } 22885 }, this); 22886 22887 this.updateLimitCounter(); 22888 22889 // Remove any instances of "None selected" if necessary 22890 if (this.getItems('selected').length > 0) { 22891 this.selected.children('optgroup[label="None selected"]').remove(); 22892 } 22893}; 22894 22895/** 22896 * Updates the Multiselect 'limit' counter used when you can only selected a certain number of 22897 * items. 22898 * @returns 22899 */ 22900Multiselect.prototype.updateLimitCounter = function(){ 22901 if (this.limitCounter) { 22902 this.limitCounter.text(this.limit - this.selected.children('option').length); 22903 } 22904}; 22905 22906/** 22907 * Checks for the presence of an item by name in either 'Selected' or 'Unselected' 22908 * @returns mixed Truthy if true, vice versa. 22909 */ 22910Multiselect.prototype.hasItemOfName = function(name){ 22911 var normalisedName = name.toUpperCase(); 22912 var itemExists = function() { 22913 if ($(this).attr('title')) { 22914 return $(this).attr('title').toUpperCase() === normalisedName; 22915 } 22916 return false; 22917 }; 22918 22919 return this.selected.children().filter(itemExists).length 22920 || this.unselected.children().filter(itemExists).length 22921 || this.searchItemHolder.children().filter(itemExists).length; 22922}; 22923 22924/** 22925 * Helper method to verify that a variable is storing an array, and if not, to add that data type 22926 * to a single-item array. 22927 * @param mixed maybeArray 22928 * @return array The existing argument if it was already an array, or a single-element array if the 22929 * the argument was originally a non-array type. 22930 */ 22931Multiselect.prototype.checkArray = function(maybeArray){ 22932 if (maybeArray.constructor !== Array) { 22933 return [ maybeArray ]; 22934 } else { 22935 return maybeArray; 22936 } 22937}; 22938 22939/* global MenuEssentialOptions */ 22940 22941window.MenuEssential = {}; 22942MenuEssential.slideOptions = { duration:400, easing:'easeOutQuart' } ; 22943 22944/** 22945 * Basic menu functionality, such as expanding/collapsing menu items, and ensuring pages open with a 22946 * reduced "Location" view just showing the applicable menu items for the current page. 22947 */ 22948MenuEssential.init = function() { 22949 22950 var $menu_options = MenuEssential.slideOptions; 22951 22952 $('#menu dl > dd > dl').hide() ; 22953 22954 // If the user has navigated down the hierarchy, show only where we are right now 22955 var openLocations = $('#menu dt.current') ;
22956 var currentLocation = $(openLocations).last() ; 22957 22958 // Hide all items except those that lead to our current location 22959 // and those that sit underneath 22960 $(openLocations).each( function() { 22961 $(this).siblings( 'dt' ).hide() ; 22962 $(this).filter( '.group' ).addClass( 'expanded' ) ; 22963 $(this).next('dd').find('> dl').show() ; 22964 }) ; 22965 22966 // If the last active group is the end of the menu hierarchy 22967 // we show its siblings, else hide them and show its descendents 22968 $(currentLocation).next( 'dd:not(:has(dl))' ).siblings( 'dt' ).show() ; 22969 22970 // Click a DT.group: Hide every DT except any belonging to all ancestor DLs. 22971 // Hide every DL except the sibling DD's contained DL. 22972 $('#menu dt.group').on('click', function(e) { 22973 if (!$(this).hasClass('expanded')) { 22974 // Show the extra subitems and hide siblings 22975 // $(this).siblings('dt').slideUp( $menu_options ); 22976 22977 $(this).siblings('dt').addClass('semitransparent').removeClass('expanded') ; 22978 $(this).siblings('dt').next('dd').find('dl').slideUp( $menu_options ) ; 22979 $(this).siblings('dt').next('dd').find('dt').removeClass('expanded').removeClass('semitransparent') ; 22980 22981 $(this).next('dd').find('> dl').slideDown( $menu_options ); 22982 $(this).addClass('expanded').removeClass('semitransparent'); 22983 } else { 22984 // Hide subitems and show siblings 22985 $(this).siblings('dt').removeClass('semitransparent').slideDown( $menu_options ); 22986 $(this).next('dd').find('dl').slideUp( $menu_options ); 22987 $(this).next('dd').find('dt').removeClass('expanded').removeClass('semitransparent').slideDown( $menu_options ); 22988 $(this).removeClass('expanded'); 22989 } 22990 }); 22991 22992 /********************************************************/ 22993 /** Menu functionality */ 22994 /********************************************************/ 22995 22996 22997 var menu_toggle = function(){ 22998 var c = $( '#menu' ).hasClass( 'expanded' ) ; 22999 if ( c ) { 23000 // If the menu is open, close and rotate the logo back 23001 $( '#menu' ).removeClass( 'expanded' ) ; 23002 $( '.menu_logo' ).not( '.spin' ).removeClass( 'rotate' ) ; 23003 23004 // Collapse the menu completely, except for 'current' items 23005 $('#menu dt').removeClass('semitransparent'); 23006 $('#menu dt:not(.current)').each( function(){ 23007 $(this).removeClass('expanded'); 23008 $(this).next('dd').find('dl').slideUp( $menu_options ) ; 23009 // Menu items collapsed 23010 23011 }) ; 23012 /* $( '#content' ).removeClass( 'nudgeright' ) ; */ 23013 } else { 23014 // If the menu is closed, expand and rotate logo 23015 $( '#menu' ).addClass( 'expanded' ) ; 23016 $( '.menu_logo' ).not( '.spin' ).addClass( 'rotate' ) ; 23017 23018 /* $( '#content' ).addClass( 'nudgeright' ) ; */ 23019 } 23020 } ; 23021 23022 $( '#menu' ).hoverIntent( 23023 function() { 23024 /* $( '#content' ).addClass( 'slideright' ) ; */ 23025 $( '.menu_logo' ).not( '.spin' ).addClass( 'rotate' ) ; 23026 $( '#menu' ).addClass( 'expanded' ) ; 23027 $( '#link_search' ).removeClass( 'active' ) ; 23028 $( '#search input' ).blur() ; 23029 $( '#search' ).removeClass( 'reveal' ) ; 23030 } , function() { 23031 /* $( '#content' ).removeClass( 'slideright' ) ; */ 23032 /* $( '.menu_logo' ).delay(1000).removeClass( 'rotate' ) ; */ 23033 /* $( '#menu' ).delay(1000).removeClass( 'expanded' ) ;*/ 23034 } 23035 ); 23036 23037 $( '#logo_menu' ).on( "click.menu", menu_toggle ) ; 23038 $( '#menu h2' ).on( "click.menu", menu_toggle ) ; 23039 23040 /* If menu is expanded, clicking on anything but the menu, its items 23041 * or the site logo will close it. Clicking on site log is already 23042 * managed 23043 */ 23044 $(document).click(function(e) { 23045 var target = e.target; 23046 if ( !$(target).is('#menu') 23047 && !$(target).is('#logo_menu') 23048 && !$(target).parents().is('#menu') 23049 && $( '#menu' ).hasClass( 'expanded' ) ) { 23050 menu_toggle() ; 23051 } 23052 }); 23053 23054 /* 23055 * If the menu is expanded and the mouse moves beyond the right-most edge of 23056 * the menu, we'll collapse it 23057 */ 23058 $( 'body' ).on( 'mousemove', '#content', function() { 23059 if ( $( '#menu' ).hasClass( 'expanded' ) 23060 && event.pageX > $('#menu').width() 23061 // Prevent menu closing while the menu-search filter button is engaged (collapsed) 23062 && !$('#menu_search > a').hasClass('collapsed')) { 23063 23064 menu_toggle() ; 23065 } 23066 }) ; 23067}; 23068 23069window.showUnloadTransition = true; 23070window.unloadTransition = function() { 23071 $( '.menu_logo' ).addClass( 'spin' ) ; 23072}; 23073 23074/** 23075 * Spin the logo when we're leaving this url or refreshing 23076 */ 23077$(window).on('beforeunload', function(){ 23078 if (window.showUnloadTransition) { 23079 window.unloadTransition(); 23080 } 23081}); 23082 23083/********************************************************/ 23084/** ops_page_search - jQuery live search functionality */ 23085/********************************************************/ 23086var liveSearchTimeout; 23087var search_box, searchSubmit,searchSubmit2,search_standardImage,search2_standardImage; 23088var search_searchingImage = '/Static/Images/ops_page/ajax-loader_search.gif'; 23089var search2_searchingImage = '/Static/Images/ops_page/ajax-loader_search_alt.gif'; 23090 23091$(function () { 23092 search_box = $("#search input[type=search]"); 23093 searchSubmit = $("#search_submit"); 23094 searchSubmit2 = $("#search_submit2"); 23095 search_standardImage = searchSubmit.attr('src'); 23096 search2_standardImage = searchSubmit2.attr('src'); 23097}); 23098 23099function ops_page_livesearch$1() { 23100 23101 search_box.on ( "focus keyup", { 23102 action: "livesearch" 23103 } , ops_page_call_liveSearch ) ; 23104 23105 search_box.on( { 23106 "blur": function( e ) { 23107 // If we just hangout an extra tick, we'll find out which element got focus really
23108 // https://stackoverflow.com/questions/11544554/get-the-clicked-object-that-triggered-jquery-blur-event 23109 setTimeout(function() { 23110 // Fade out if you have clicked off the search bar 23111 if ( !$(document.activeElement).is( 'a' ) ) { 23112 var fade = { opacity:0, transition:'opacity 0.5s' }; 23113 $("#ops_page_livesearch").css( fade ).slideUp(); 23114 23115 /** Reset the searching animation **/ 23116 ops_page_call_liveSearch_reset() ; 23117 } 23118 }, 1); 23119 } 23120 }) ; 23121} 23122function ops_page_call_liveSearch() { 23123 // Stop any previous run of the AJAX 23124 clearTimeout( liveSearchTimeout ) ; 23125 23126 // Assign the data from the search value 23127 search_box.data( 'q', search_box.val() ) ; 23128 23129 // Run the search 23130 //searchSubmit.attr( 'src', search_searchingImage ) ; 23131 liveSearchTimeout = setTimeout( ops_page_AJAXify_jsonLiveSearch, 100 ) ; 23132} 23133function ops_page_call_liveSearch_loading() { 23134 if ( searchSubmit.attr( 'src' ) === search_standardImage ) { 23135 searchSubmit.attr( 'src', search_searchingImage ).addClass( 'loading' ) ; 23136 } 23137 if ( searchSubmit2.attr( 'src' ) === search2_standardImage ) { 23138 searchSubmit2.attr( 'src', search2_searchingImage ).addClass( 'loading' ) ; 23139 } 23140} 23141function ops_page_call_liveSearch_reset() { 23142 if ( searchSubmit.attr( 'src' ) === search_searchingImage ) { 23143 searchSubmit.removeClass( 'loading' ).attr( 'src', search_standardImage ) ; 23144 } 23145 if ( searchSubmit2.attr( 'src' ) === search2_searchingImage ) { 23146 searchSubmit2.removeClass( 'loading' ).attr( 'src', search2_standardImage ) ; 23147 } 23148} 23149function ops_page_AJAXify_jsonLiveSearch() { 23150 23151 var fadeIn = { opacity:1, transition:'opacity 0.5s', display:'block'} ; 23152 var fadeOut = { opacity:0, transition:'opacity 0.5s'} ; 23153 var search = $("#ops_page_livesearch"); 23154 var queryData = search_box.data( 'q' ) ; 23155 23156 ops_page_call_liveSearch_loading() ; 23157 23158 if ( queryData.length >= 3 ) { 23159 23160 // Something searched - perform the search. 23161 $.getJSON("/Home/Search/Live?s=" + encodeURIComponent( queryData ) + "&filter=current,top20" , function(data) { 23162 23163 // Change the search icon 23164 var html = "<ul>"; 23165 if ( data.length == 0 ) { 23166 html += '<li><i><img class="ops_iconTag icon" src="/Static/Icons/ui/ux2/appbar-smiley-frown.png" ' + 23167 'alt="Sad face" title="No results" style="max-width:3rem;"/>No results</i></li>' ; 23168 } 23169 23170 $.each(data, function(i, item) { 23171 var markup = ''; 23172 23173 if ( item.menu ) { 23174 markup = '<div class="ops_page_livesearch_submenu navigation panel" style="display:none;"><ul>'; 23175 $.each(item.menu, function(j, subitem) { 23176 markup += '<li class="animated fast no-leadin"><a href="' + subitem.url + '"><img src="' + subitem.icon + '">' + subitem.name + '</a></li>'; 23177 }); 23178 markup += '</ul></div>'; 23179 } 23180 23181 html += 23182 '<li' + (item.menu ? ' class="animated fast no-leadin ops_page_livesearch_submenu"' : '') + '>' 23183 + ( markup.length > 0 ? '<span></span>' : '' ) 23184 + '<a href="' + item.url + '">' 23185 + '<img src="' + item.icon + '" alt="Icon"/>' 23186 + item.name 23187 + '</a>' 23188 + markup 23189 + '</li>'; 23190 }); 23191 html += "</ul>"; 23192 23193 // If after compiling this info the search has changed, cancel 23194 if ( search_box.data('q') !== queryData ) { 23195 return ; 23196 } 23197 23198 search.html('<!--<div id="ops_page_livesearch_title" class="headed_box green"><h2>Quick Search</h2></div>-->' + html); 23199 23200 search.slideDown().css( fadeIn ) ; 23201 23202 $("#ops_page_livesearch > ul > li").each( function() { 23203 $(this).find('span').eq(0).mouseenter( function() { 23204 var parentElement = $(this).closest('li') ; 23205 parentElement.parent().find( "> li" ).addClass( 'semitransparent' ) ; 23206 parentElement.removeClass( 'semitransparent' ) ; 23207 parentElement.find( '.ops_page_livesearch_submenu' ).eq(0).slideDown( 200 ); 23208 }); 23209 $(this).mouseleave( function() { 23210 $(this).parent().find( "> li" ).removeClass( 'semitransparent' ) ; 23211 $(this).find( '.ops_page_livesearch_submenu' ).eq(0).slideUp( 200 ); 23212 }); 23213 }); 23214 23215 /** Reset the searching animation **/ 23216 ops_page_call_liveSearch_reset() ; 23217 }); 23218 23219 } else if ( queryData.length == 0 ) { 23220 23221 // Nothing entered in the search box - show the recent searches. 23222 $.getJSON("/Home/Search/History", function(data) { 23223 if ( data.length > 0 ) { 23224 html = "<ul>"; 23225 23226 $.each(data, function (i, item) { 23227 markup = ''; 23228 if (item.menu) { 23229 markup = '<div class="ops_page_livesearch_submenu navigation panel" style="display:none;"><ul>'; 23230 $.each(item.menu, function (j, subitem) { 23231 markup += '<li class="animated fast no-leadin"><a href="' + subitem.url + '"><img src="' + subitem.icon + '">' + subitem.name + '</a></li>'; 23232 }); 23233 markup += '</ul></div>'; 23234 } 23235 23236 html += 23237 '<li' + (item.menu ? ' class="animated fast no-leadin ops_page_livesearch_submenu"' : '') + '>' 23238 + ( markup.length > 0 ? '<span></span>' : '' ) 23239 + '<a href="' + item.url + '">' 23240 + '<img src="' + item.icon + '" alt="Icon"/>' 23241 + item.name 23242 + '</a>' 23243 + markup 23244 + '</li>'; 23245 }); 23246 23247 html += "</ul>"; 23248 23249 // If after compiling this info the search has changed, cancel 23250 if ( search_box.data('q').length > 0 ) { 23251 return ; 23252 } 23253 23254 search.html('<div id="ops_page_livesearch_title" class="headed_box "><h2>Recently Viewed Students</h2></div>' + html); 23255 23256 $("#ops_page_livesearch").slideDown().css(fadeIn); 23257 23258 $("#ops_page_livesearch > ul > li").each(function () { 23259 $(this).find('span').eq(0).mouseenter(function () { 23260 var parentElement = $(this).closest('li'); 23261 parentElement.parent().find("> li").addClass('semitransparent'); 23262 parentElement.removeClass('semitransparent'); 23263 parentElement.find('.ops_page_livesearch_submenu').eq(0).slideDown(200); 23264 }); 23265 $(this).mouseleave(function () { 23266 $(this).parent().find("> li").removeClass('semitransparent'); 23267 $(this).find('.ops_page_livesearch_submenu').eq(0).slideUp(200); 23268 }); 23269 }); 23270 } 23271 23272 /** Reset the searching animation **/ 23273 ops_page_call_liveSearch_reset() ; 23274 }); 23275 23276 } else { 23277
23278 $("#ops_page_livesearch").slideUp().css( fadeOut ).html( "" ) ; 23279 23280 /** Reset the searching animation **/ 23281 ops_page_call_liveSearch_reset() ; 23282 } 23283} 23284 23285/** 23286 * If a Promise is resolving too soon, use this to force a wait on it before we advance. 23287 * Otherwise, if the promise takes as long as the supplied `ms`, then no further delay will be required. 23288 * @return {Promise<[any]>} 23289 */ 23290function forcePromiseMinDelay(prom, ms) { 23291 return Promise.all([prom, getDelay(ms)]).then(valArr => valArr[0]); 23292} 23293 23294function getDelay(ms){ 23295 return new Promise(resolve => { setTimeout(()=> resolve(ms), ms); } ); 23296} 23297 23298/** 23299 * @param {KeyboardEvent} keyEvent 23300 */ 23301function isPrintableKey(keyboardEvent) { 23302 // Test the `key` property is single unicode character: 23303 return /^.$/u.test(keyboardEvent.key); 23304} 23305 23306/** 23307 * Create a new Set featuring items in Set A which are not present in Set B. 23308 * @see {@link https://exploringjs.com/impatient-js/ch_sets.html#difference-a-b} 23309 * @param {Set} a 23310 * @param {Set} b 23311 */ 23312function setDifference(a, b) { 23313 return new Set([...a].filter(item => !b.has(item))); 23314} 23315function setUnion(a, b) { 23316 return new Set([...a, ...b]); 23317} 23318/** 23319 * Are the two sets equal? 23320 * @param {Set} a 23321 * @param {Set} b 23322 */ 23323function setEquality(a, b) { 23324 if (a.size !== b.size) { 23325 return false; 23326 } 23327 // Equal if they are the same size are no further differences. 23328 return setDifference(a, b).size === 0; 23329} 23330 23331/** 23332 * Encompasses functions and objects related to the user's browser and their computer. 23333 */ 23334 23335// Checks the user's browser for touchscreen support 23336function isTouchDevice() { 23337 return ( 23338 'ontouchstart' in window 23339 || ( navigator.MaxTouchPoints > 0 ) 23340 || ( navigator.msMaxTouchPoints > 0 ) 23341 ) ; 23342} 23343 23344function isMobileDevice$1(touchDevicesOnly = true) { 23345 /** 23346 * jQuery.browser.mobile (http://detectmobilebrowser.com/) deprecated; 23347 * Vanilla Javascript method used instead, moving the giant if to here 23348 **/ 23349 var touchCheck = !touchDevicesOnly || isTouchDevice(); 23350 var userAgentCheck = false; 23351 (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) userAgentCheck = true;})(navigator.userAgent||navigator.vendor||window.opera); 23352 return userAgentCheck && touchCheck; 23353} 23354 23355function getCurrentPosition() { 23356 if (navigator.geolocation) { 23357 return new Promise(function(resolve, reject){ 23358 // Timeout after 5 seconds. 23359 return navigator.geolocation.getCurrentPosition(resolve, reject, {timeout:5000}); 23360 }); 23361 } else { 23362 return new Promise(function(resolve, reject) { 23363 return reject(false); 23364 }); 23365 } 23366} 23367 23368// Register service worker
23369if ( 'serviceWorker' in navigator ) { 23370 23371 // Use the window load event to keep the page load performant 23372 window.addEventListener('load', function(){ 23373 navigator.serviceWorker 23374 .register( '/sw.js' ) 23375 .catch(function(err) { console.error('Failed to load service worker handler.', err); } ); 23376 }); 23377} 23378 23379 23380// Prevent animations kicking off immediately to initial positions 23381setTimeout(function(){ 23382 $('body').addClass( 'loaded' ) ; 23383 // document.body.className="loaded"; 23384},250); 23385 23386 23387// Remove any empty dashboard parts 23388$( function(){ 23389 $('.dashboard, .headed_box').each( function() { 23390 if ( $.trim( $(this).text() ) == "" && $(this).find( 'img' ).length === 0 ) { 23391 $(this).remove(); 23392 } 23393 //$( ".dashboard h2:only-child" ).parent().remove() ; 23394 }); 23395}); 23396 23397// Turn boxes to alert when content contains alerts 23398$( '.headed_box .alert' ).parent().closest( '.headed_box' ).delay( 200 ).addClass( 'alert' ) ; 23399 23400 23401/*********************************************************/ 23402/** Bring common functionality together onDocumentReady **/ 23403/*********************************************************/ 23404 23405// Load ops_page_tooltip functionality 23406$( function() { 23407 /** Lock submit buttons on click **/ 23408 $(':submit:not(.no-lock)').lockSubmit({ 23409 // submitText: "Please Wait...", 23410 onClickCSS: "locked" 23411 }); 23412 23413 /** Setup the live search functionality: **/ 23414 ops_page_livesearch(); 23415 23416 /** Indicate to DOM if using a mobile & touch-based device **/ 23417 23418 document.body.classList.toggle('is-mobile-device', isMobileDevice()); 23419 23420 // Highlight error on form fields. Click field to dismiss highlight. 23421 document.querySelectorAll('td.error :is(input, textarea, select, .ops_form_element_signature, .dropzone)').forEach(elem => { 23422 elem.classList.add('field-error'); 23423 elem.addEventListener('click', () => { 23424 elem.closest('td.error').querySelectorAll('.field-error').forEach(fieldErr => { 23425 fieldErr.classList.remove('field-error'); 23426 }); 23427 }); 23428 }); 23429}); 23430 23431// Smoothly scroll to an anchor on the same page. Automatically applies to any anchor tag. 23432$(function() { 23433 $('a[href*="#"]:not([href="#"], [href="#content"])').click(function() { 23434 if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { 23435 var target = $(this.hash); 23436 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 23437 if (target.length) { 23438 $('html, body').animate({ 23439 scrollTop: target.offset().top 23440 }, 1200, 'easeInOutCubic'); 23441 return false; 23442 } 23443 } 23444 }); 23445}); 23446 23447// Sliding reveal bars functionality 23448$( function() { 23449 $( ".reveal_bars > div" ).click( function(){ 23450 $(this).children().eq(0).slideToggle() ; 23451 }); 23452}) ; 23453 23454// Automatically cancel unfinished ajax requests 23455// when the user navigates elsewhere. 23456// http://stackoverflow.com/questions/1802936/stop-all-active-ajax-requests-in-jquery 23457(function($) { 23458 var xhrPool = []; 23459 23460 $(document).ajaxSend(function(e, jqXHR, options){ 23461 xhrPool.push(jqXHR); 23462 }); 23463 23464 $(document).ajaxComplete(function(e, jqXHR, options) { 23465 xhrPool = $.grep(xhrPool, function(x){return x!=jqXHR}); 23466 }); 23467 23468 var abort = function() { 23469 $.each(xhrPool, function(idx, jqXHR) { 23470 jqXHR.abort(); 23471 }); 23472 }; 23473 23474 var oldbeforeunload = window.onbeforeunload; 23475 window.onbeforeunload = function() { 23476 var r = oldbeforeunload ? oldbeforeunload() : undefined; 23477 if (r == undefined) { 23478 // only cancel requests if there is no prompt to stay on the page 23479 // if there is a prompt, it will likely give the requests enough time to finish 23480 abort(); 23481 } 23482 return r; 23483 } ; 23484})(jQuery) ; 23485 23486// Tooltips 23487function initializeTooltips() { 23488 // Select all elements with data-tippy-content attribute 23489 document.querySelectorAll('[data-tippy-content]').forEach(element => { 23490 // Check if the element already has a Tippy instance 23491 if (!Object.hasOwn(element, '_tippy')) { 23492 // Initialize tooltip if it doesn't have one 23493 tippy(element); 23494 } 23495 }); 23496} 23497 23498$(function () { 23499 initializeTooltips(); 23500 23501 //Fade-out information 23502 $('.ops_page_info').fadeTo( 3000 , 0 ).slideUp( 500 ); 23503 $('.message.autohide').fadeTo( 2200 , 0 ).slideUp( 500 ); 23504 23505 // Shows a confirm dialogue from '.ops_page_jsify_dialogue_confirm' link 23506 $('.ops_page_jsify_dialogue_confirm').click(function (event) { 23507 if ($(this).is(':not(option)')) { 23508 event.preventDefault(); 23509 createDialogue($(this).attr('href')); 23510 setDialogueConfirm($(this).attr('title'));
23511 } 23512 }); 23513 23514 // Moves dialogue box on scroll 23515 $(window).scroll(function () { 23516 positionModalBackground(); 23517 }); 23518 $(window).resize(function () { 23519 positionModal( $('div.ops_page_modal_instance').length -1);}); 23520 23521 // Replaces blank threadview with message 23522 $('.ops_threadView_thread').each(function () { 23523 var rows = $(this).find('tbody > tr'); 23524 if ($(rows).find('.ops_threadView_deleted_description').length == $(rows).length) { 23525 $(this).replaceWith( 23526 "<div class='ops_threadView_thread ops_threadView_thread_inactive'>This thread is inactive</div>" 23527 ); 23528 } 23529 }); 23530 23531 // Hovering on a form element help icon will highlight the whole element row 23532 $('.ops_form_table_cell_helpicon, .form .help').hover( function(){ 23533 $(this).closest('tr').addClass( 'ops_form_table_row_helpHighlight' ).addClass( 'help-highlight' ); 23534 }, function(){ 23535 $(this).closest('tr').removeClass( 'ops_form_table_row_helpHighlight' ).removeClass( 'help-highlight' ); 23536 }); 23537 23538 // Bind modal triggers 23539 bindModalTrigger($('body')); 23540 23541 $('.Datagrid_AddRow').on('click', function() { 23542 let dgCon = $(this).closest('div.datagrid-container').find('> .table-container > table:first-of-type tbody'); 23543 // find last row and clone 23544 let template = $(this).data('template'); 23545 let formName = $(this).data('id'); 23546 let dgLastRow = dgCon.find('tr:last-child').first(); 23547 23548 if (!template) { 23549 template = dgCon.find('tr:last-child').first().html(); 23550 $(this).data('template', template); 23551 } 23552 23553 let hasDate = $(template).find('.ops_form_element_date'); 23554 if (hasDate) { 23555 $('.ops_form_element_date').removeClass('hasDatepicker').datepicker('destroy'); 23556 } 23557 23558 let cell = 0; 23559 let lastRowId = parseInt(dgLastRow.attr('id')); 23560 let idRow = lastRowId+ 1; 23561 23562 let dgCCC = $(template); 23563 dgCCC.attr('id', idRow); 23564 dgCCC.attr('data-db-id', ''); 23565 dgCCC.append(dgCCC); 23566 23567 // set new IDs 23568 $(dgCCC).attr('id', idRow); 23569 $(dgCCC).children('td').attr('data-row', idRow); 23570 $(dgCCC).find('select option:selected').removeAttr('selected'); 23571 $(dgCCC).find('input[type="text"]:not(.ops_form_element_date),textarea').val(''); 23572 $(dgCCC).find('input[type="checkbox"]:not(.defaultChecked)').removeAttr('checked'); 23573 $(dgCCC).find('input,textarea,select').removeAttr('disabled'); 23574 $(dgCCC).find('input[type=hidden]').each(function(){ 23575 let name = $(this).attr("name"); 23576 name = name.replace(/(\d)_(\d)/, '$1_' + idRow); 23577 $(this).attr("name", name); 23578 $(this).attr("id", name + (name.match(/_hidden$/) ? '' : '_hidden')); 23579 $(this).val(""); 23580 }); 23581 $(dgCCC).find('input:not([type=hidden]),textarea,select').each(function () { 23582 let ele = $(this); 23583 let eleName; 23584 let field = ''; 23585 23586 let tagName = ele.prop("tagName"); 23587 let tagType = ele.prop("type"); 23588 23589 // TODO handle time fields 23590 switch (true) { 23591 case tagName === 'TEXTAREA': 23592 case tagName === 'SELECT': 23593 field = ele.prop('localName'); 23594 break; 23595 case tagType === 'hidden': 23596 case tagType === 'radio': 23597 field = tagType; 23598 break; 23599 default: 23600 break; 23601 } 23602 23603 23604 if (field === '') { 23605 eleName = formName + '_' + cell + '_' + idRow; 23606 } else { 23607 eleName = formName + '_' + cell + '_' + idRow + '_' + field; 23608 } 23609 23610 ele.prop('id', 'ops_Form__' + eleName); 23611 ele.prop('name', 'ops_Form__' + eleName); 23612 cell += 1; 23613 }); 23614 23615 dgCon.append(dgCCC); 23616 23617 // updates the row count so DataGrid will actually process it! 23618 let table = $(this).closest('form').find('table.datagrid'); 23619 let currentRowcount = table.find('>tbody >tr').length; 23620 let field = '#' + 'ops_Form__' + formName + '_sd'; 23621 let hidden = $(field).val().split(':'); 23622 hidden[0] = currentRowcount; 23623 $(field).val( hidden.join(':') ); 23624 23625 if (hasDate) { 23626 $('input.ops_form_element_date').datepicker('destroy'); 23627 initializeDatePicker(); 23628 } 23629 23630 let clickFn = 'AddRowClick' + formName; 23631 if (typeof window[clickFn] === 'function') { 23632 window[clickFn](); 23633 } 23634 }); 23635}) ; 23636 23637// Offline Warning Message 23638function checkConnection(){ 23639 //console.log( notifications ) ; 23640 23641 if( !notificationPanel ) { 23642 return ; 23643 } 23644 23645 if( !navigator ) { 23646 return ; 23647 } 23648 23649 var nameBroken = "connectionFailed" ; 23650 var nameLive = "connectionLive" ; 23651 23652 // Notify connection status 23653 if( navigator.onLine ) { 23654 // If the borked connection alert is present, delete it from the panel collection and notify the user 23655 // we are back up and running 23656 if ( notificationPanel.find( nameBroken ) ) { 23657 var message = "You are back online." ; 23658 notificationPanel.destroy( nameBroken ); 23659 notificationPanel.new( NOTIFICATION_DEFAULT, message, nameLive, 23660 "/Static/Icons/ui/ux2/appbar-connection-quality-veryhigh.png" ) ; 23661 23662 $( 'form input[type="submit"][data-temp-disabled="true"]' ) 23663 .removeAttr( 'disabled' ) 23664 .removeAttr( 'data-temp-disabled' ) 23665 .removeAttr( 'title' ) ; 23666 } 23667 } else { 23668 // The connection is broken or very slow/intermittent 23669 var message = "You are offline, or on a slow connection. You may not be seeing the most up" + 23670 "-to-date information, and some pages may be unavailable. Submitting form data is disabled " + 23671 "to prevent loss of your work." ; 23672 notificationPanel.destroy( nameLive ); 23673 notificationPanel.new( NOTIFICATION_ALERT, message, nameBroken, 23674 "/Static/Icons/ui/ux2/appbar-network-disconnect.png" ) ; 23675 23676 $( 'form input[type="submit"]:not([temp-disabled="true"])' ) 23677 .attr( 'data-temp-disabled', 'true' ) 23678 .attr( 'disabled', 'disabled' )
23679 .attr( 'title', 'Disabled when offline' ) ; 23680 } 23681} 23682 23683function initializeDatePicker() { 23684 // Attach datepicker jQuery UI features to all date elements, including dynamically created 23685 $('body').on('focus', ".ops_form_element_date", function () { 23686 $(this).datepicker({ 23687 dateFormat: 'dd-M-yy' 23688 , gotoCurrent: true 23689 , changeMonth: true 23690 , changeYear: true 23691 , firstDay: 1 23692 , yearRange: "-100:+10" 23693 }); 23694 }); 23695} 23696 23697$(function(){ 23698 if( typeof notificationPanel !== 'undefined' && notificationPanel 23699 && typeof navigator !== 'undefined' && navigator 23700 && typeof navigator.onLine !== 'undefined' ) { 23701 setInterval(checkConnection, 1500); 23702 } 23703 23704 initializeDatePicker(); 23705}) ; 23706 23707document.addEventListener('DOMContentLoaded', () => { 23708 document.body.addEventListener('change', (e) => { 23709 const target = e.target; 23710 if ( 23711 target.matches('input[type="checkbox"][name$="_tegIncluded"]') || 23712 target.matches('input[type="checkbox"][name$="_tegIncludedOne"]') 23713 ) { 23714 if (target.checked) { 23715 document.querySelectorAll('input[type="checkbox"][name$="_tegIncluded"], input[type="checkbox"][name$="_tegIncludedOne"]') 23716 .forEach(cb => { 23717 if (cb !== target) cb.checked = false; 23718 }); 23719 } 23720 } 23721 }); 23722}); 23723 23724/** 23725 * Add to this file to include any additional resources into compiled CSS + JS bundle. 23726 */ 23727 23728//export let DropzoneUtil = DropzoneUtil$3;
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.