1try {
vendor: 22,881 bytes, lines 2-3
2/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 3!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.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:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.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||v(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&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+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]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(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},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},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(c(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:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=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))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(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&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(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&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(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 U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);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&&C){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=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,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(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===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]||I.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]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(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(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(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=I.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(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(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:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?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=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!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 q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(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]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[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?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(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 Z(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 ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(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=[J(K(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 ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(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&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.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(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.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 ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}
vendor: 1,967 bytes, line 3
3return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.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&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||
vendor: 9,546 bytes, line 3
3ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.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){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.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},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",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 ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(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,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.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=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(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},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(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[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(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(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.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&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.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=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.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=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.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 ne={};function re(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]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||
vendor: 8,814 bytes, line 3
3(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={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 Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(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"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.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<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(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)Le(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=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.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),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.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=ce.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=((ce.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<ce(i,this).index(l):ce.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(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,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&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.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},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);
vendor: 14,182 bytes, line 3
3n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(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=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(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=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.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 $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(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&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(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&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=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},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.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 Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.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),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{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=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[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+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!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,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.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=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.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=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.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):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.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=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;
vendor: 4,590 bytes, line 3
3return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),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:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.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=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(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),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.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&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._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--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.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=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.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)
vendor: 13,972 bytes, line 3
3);!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.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})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.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=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(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(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.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=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.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)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(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 v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(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=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.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||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.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]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(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)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.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 Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,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":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);
vendor: 9,033 bytes, line 3
3if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(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 v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!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(Yt[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&&ie.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()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.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 ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<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)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.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),v(t)&&(t=t.call(e,n,ce.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)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.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"===ce.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"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return
3M(this,function(e,t,n){var r;if(y(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)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(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?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.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.on("mouseenter",e).on("mouseleave",t||e)}}),ce.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){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce}); 4 5} catch (e) { 6console.error('Error in file:/media/vendor/jquery/js/jquery.min.js?3.7.1; Error:' + e.message); 7}; 8try { 9var $=jQuery.noConflict(); 10 11} catch (e) { 12console.error('Error in file:/media/legacy/js/jquery-noconflict.min.js?504da4; Error:' + e.message); 13}; 14try { 15window.addEventListener("DOMContentLoaded",(()=>{const d=document.body.classList;d.contains("com-sppagebuilder")||d.add("com-sppagebuilder")})); 16} catch (e) { 17console.error('Error in file:/components/com_sppagebuilder/assets/js/common.js; Error:' + e.message); 18}; 19try { 20if(HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules")){const t={prerender:[{eagerness:"moderate",where:{and:[{selector_matches:"[data-preload-collection]"}]}}]},e=document.createElement("script");e.type="speculationrules",e.textContent=JSON.stringify(t),document.head.appendChild(e)}function getCollectionHtmlFromResponse(t){return null==t||"boolean"==typeof t?"":"string"==typeof t?t:"object"==typeof t&&null!==t&&"string"==typeof t.data?t.data:""}function getParentItemFromPagination(t){const e=t?.dataset?.parentItem;if(!e)return null;try{return JSON.parse(e)}catch(t){return null}}function getCollectionLimit(t){const e=t&&t.settings?t.settings:{},n=Number(e.limit??20);return n>0?n:20}function getPaginationWindow(t,e,n){const a=Math.min(Math.max(1,n),e);let o=t-Math.floor((a-1)/2);o<1&&(o=1);let i=o+a-1;return i>e&&(i=e,o=Math.max(1,i-a+1)),{start:o,end:i}}function buildPaginationDescriptor(t,e,n,a,o,i){t=Math.min(Math.max(1,t),e);const s=[];if(i&&s.push({type:"prev"}),!a||e<=2){const{start:a,end:o}=getPaginationWindow(t,e,n);for(let t=a;t<=o;t++)s.push({type:"page",n:t});return i&&s.push({type:"next"}),s}s.push({type:"page",n:1});const r=e-1,c=Math.max(0,r-2+1),p=Math.min(Math.max(1,n),c);let d=Math.min(Math.max(t,2),r)-Math.floor((p-1)/2);d<2&&(d=2);let l=d+p-1;l>r&&(l=r,d=Math.max(2,l-p+1)),c>0&&d>2&&o&&s.push({type:"dots"});for(let t=d;t<=l;t++)s.push({type:"page",n:t});return c>0&&l<r&&o&&s.push({type:"dots"}),e>1&&s.push({type:"page",n:e}),i&&s.push({type:"next"}),s}function renderNumberedPaginationNav(t){if(!t||!t.dataset)return;const e=Math.max(1,parseInt(t.dataset.totalPages,10)||1);let n=parseInt(t.dataset.currentPage,10)||1;n=Math.min(Math.max(1,n),e);const a=t.dataset.visiblePages,o=void 0===a||""===a?NaN:parseInt(a,10),i=Number.isNaN(o)||o<1?e:o,s="1"===t.dataset.showArrows,r="1"===t.dataset.showFirstLast,c="1"===t.dataset.showDots,p=t.dataset.buttonType||"default",d=buildPaginationDescriptor(n,e,i,r,c,s),l=document.createDocumentFragment();for(const t of d)if("dots"!==t.type)if("prev"!==t.type)if("next"!==t.type){if("page"===t.type&&void 0!==t.n){const e=document.createElement("button");e.type="button",e.className=`sppb-btn btn-sm sppb-btn-${p} sppb-dynamic-content-pagination__num`,e.setAttribute("data-sppb-page-num",String(t.n)),e.textContent=String(t.n),t.n===n&&(e.classList.add("sppb-dynamic-content-pagination__num--active"),e.setAttribute("aria-current","page")),l.appendChild(e)}}else{const t=document.createElement("button");t.type="button",t.className=`sppb-btn btn-sm sppb-btn-${p} sppb-dynamic-content-pagination__arrow sppb-dynamic-content-pagination__arrow--next`,t.setAttribute("data-sppb-pagination-next",""),t.textContent="›",t.disabled=n>=e,t.setAttribute("aria-label","Next page"),l.appendChild(t)}else{const t=document.createElement("button");t.type="button",t.className=`sppb-btn btn-sm sppb-btn-${p} sppb-dynamic-content-pagination__arrow sppb-dynamic-content-pagination__arrow--prev`,t.setAttribute("data-sppb-pagination-prev",""),t.textContent="‹",t.disabled=n<=1,t.setAttribute("aria-label","Previous page"),l.appendChild(t)}else{const t=document.createElement("span");t.className="sppb-dynamic-content-pagination__ellipsis",t.textContent="…",t.setAttribute("aria-hidden","true"),l.appendChild(t)}t.innerHTML="",t.appendChild(l)}
20async function loadMoreData(t){const{addon:e,parentItem:n,currentPage:a}=t,o=Joomla.getOptions("sppb-root"),i=await fetch(`${o}index.php?option=com_sppagebuilder&task=dynamic_content.loadMoreCollectionData`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":Joomla.getOptions("csrf.token")},body:JSON.stringify({collection_id:Number(e?.settings?.source??0),filters:JSON.stringify(e?.settings?.filters??[]),limit:getCollectionLimit(e),sortingColumn:e?.settings?.sorting_field_id&&"default"!==e.settings.sorting_field_id?e.settings.sorting_field_id:null,direction:e?.settings?.direction??"ASC",page:a,addon:JSON.stringify(e),currentLink:window.location.search.replace("?",""),isSite:!window.location.pathname.includes("/edit")&&!window.location.pathname.includes("/edit/"),parent_item:JSON.stringify(n)})});return await i.json()}function loadDataByClickingLoadMoreButton(){document.querySelectorAll("[data-sppb-load-more-button]").forEach((t=>{let e=Number(t.dataset.currentPage)||1;const n=t.closest(".addon-root-dynamic-content-collection"),a=n.querySelector(".sppb-dynamic-content-collection"),o=t.closest(".sppb-dynamic-content-collection__pagination"),i=o.querySelector('[name="sppb-dynamic-addon-id"]')?.value,s=Joomla.getOptions("sppb-dc-addon-"+i),r=getParentItemFromPagination(o)||(t.dataset.parentItem?JSON.parse(t.dataset.parentItem):null);i&&s&&n&&a&&o&&t.addEventListener("click",(async function(n){n.preventDefault();const o=Number(t.dataset.totalPages);t.textContent="Loading...",e++;const i=getCollectionHtmlFromResponse(await loadMoreData({currentPage:e,addon:s,parentItem:r}));t.textContent=t.dataset.text,i&&a.insertAdjacentHTML("beforeend",i),t.dataset.currentPage=e,e>=o&&t.remove()}))}))}function loadDataByIntersectionObserver(){document.querySelectorAll(".sppb-dynamic-content-collection__pagination-sentinel").forEach((t=>{let e=Number(t.dataset.currentPage)||1;const n=t.closest(".addon-root-dynamic-content-collection").querySelector(".sppb-dynamic-content-collection"),a=t.closest(".sppb-dynamic-content-collection__pagination"),o=a.querySelector('[name="sppb-dynamic-addon-id"]')?.value,i=Number(t.dataset.totalPages),s=getParentItemFromPagination(a);new IntersectionObserver((async a=>{if(a[0].isIntersecting&&e<i){t.style.visibility="visible";const a=Joomla.getOptions("sppb-dc-addon-"+o);e++;const i=getCollectionHtmlFromResponse(await loadMoreData({currentPage:e,addon:a,parentItem:s}));i&&n.insertAdjacentHTML("beforeend",i),t.style.visibility="hidden",t.dataset.currentPage=e}}),{rootMargin:"50px"}).observe(t)}))}function loadDataByNumberedPagination(){document.querySelectorAll("[data-sppb-numbered-pagination]").forEach((t=>{const e=t.closest(".sppb-dynamic-content-collection__pagination"),n=t.closest(".addon-root-dynamic-content-collection"),a=n?.querySelector(".sppb-dynamic-content-collection"),o=e?.querySelector('[name="sppb-dynamic-addon-id"]')?.value,i=Joomla.getOptions("sppb-dc-addon-"+o),s=getParentItemFromPagination(e),r=Number(t.dataset.totalPages);o&&i&&n&&a&&e&&r&&(renderNumberedPaginationNav(t),t.addEventListener("click",(async e=>{const n=e.target&&e.target.closest?e.target.closest("button"):null;if(!n||!t.isConnected||t.classList.contains("sppb-dynamic-content-pagination--loading"))return;const o=Math.max(1,parseInt(t.dataset.totalPages,10)||1);let r=parseInt(t.dataset.currentPage,10)||1;r=Math.min(Math.max(1,r),o);let c=null;if(n.hasAttribute("data-sppb-page-num")?c=parseInt(n.getAttribute("data-sppb-page-num"),10):n.hasAttribute("data-sppb-pagination-prev")?c=Math.max(1,r-1):n.hasAttribute("data-sppb-pagination-next")&&(c=Math.min(o,r+1)),!(null==c||Number.isNaN(c)||c===r||c<1||c>o)){e.preventDefault(),t.classList.add("sppb-dynamic-content-pagination--loading"),t.querySelectorAll("button").forEach((t=>{t.disabled=!0}));try{const e=getCollectionHtmlFromResponse(await loadMoreData({addon:i,parentItem:s,currentPage:c}));e&&(a.innerHTML=e),t.dataset.currentPage=String(c)}catch(t){console.error(t)}finally{t.classList.remove("sppb-dynamic-content-pagination--loading"),renderNumberedPaginationNav(t)}}})))}))}window.addEventListener("DOMContentLoaded",(function(){loadDataByClickingLoadMoreButton(),loadD
20ataByIntersectionObserver(),loadDataByNumberedPagination()})); 21} catch (e) { 22console.error('Error in file:/components/com_sppagebuilder/assets/js/dynamic-content.js?db0eb064dd605d51126ac7a52bb9f826; Error:' + e.message); 23}; 24try { 25!function(t){var n=t(window),a=n.height();n.resize((function(){a=n.height()})),t.fn.parallax=function(o,r,i){var s,c,e=t(this);function l(){var i=n.scrollTop();e.each((function(){var n=t(this),l=n.offset().top;l+s(n)<i||l>i+a||!e.data("sppbparallax")||e.css("backgroundPosition",o+" "+Math.round((c-i)*r)+"px")}))}e.data("sppbparallax",!0),e.css("backgroundAttachment","fixed"),e.each((function(){c=e.offset().top})),s=i?function(t){return t.outerHeight(!0)}:function(t){return t.height()},(arguments.length<1||null===o)&&(o="50%"),(arguments.length<2||null===r)&&(r=.15),(arguments.length<3||null===i)&&(i=!0),n.bind("scroll",l).resize(l),l()},t.fn.parallaxDestroy=function(n,a){var o=t(this);o.data("sppbparallax")&&(n?o.css("backgroundPosition",n):o.css("backgroundPosition","0% 0%"),a?o.css("backgroundAttachment",a):o.css("backgroundAttachment","inherit"),o.data("sppbparallax",!1))}}(jQuery); 26} catch (e) { 27console.error('Error in file:/components/com_sppagebuilder/assets/js/jquery.parallax.js?db0eb064dd605d51126ac7a52bb9f826; Error:' + e.message); 28}; 29try { 30/** 31 * @package SP Page Builder 32 * @author JoomShaper http://www.joomshaper.com 33 * @copyright Copyright (c) 2010 - 2026 JoomShaper 34 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later 35 */ 36"use strict";function _typeof(t){return _typeof="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},_typeof(t)}window.onYouTubeIframeAPIReadyTemp=[],[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(t){t.hasOwnProperty("append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),i=document.createDocumentFragment();t.forEach((function(t){var e=t instanceof Node;i.appendChild(e?t:document.createTextNode(String(t)))})),this.appendChild(i)}})})),"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),s=1;s<arguments.length;s++){var o=arguments[s];if(null!=o)for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},writable:!0,configurable:!0}),function(t,i,e,s){var o="jsSlider";function n(i,e){this.element=i,this._name=o,this.item=null,this.delta=1,this.isAnimating=!1,this.isDragging=!1,this.timer=0,this._timeoutId1=0,this._timeoutId2=0,this._dotControllerTimeId=0,this._lastViewPort=0,this.video=this.videoUtils(),this.videoProps={},this.videoList={youtube:[],vimeo:[],html5:[]},this.player={},this.videoPlaying=!1,this.onMouseOver=!1,this.captionAnimationProperty={direction:"left",from:"100%",to:"0",type:"slide",duration:800,after:0,origin:"50% 50% 0",timing_function:"cubic-bezier(0, 0.46, 0, 0.63)"},this.videoAspectRatio=1.78,this.coordinate={x:0,y:0},this.prevCoordinate={x:0,y:0,diff:0,dragPointer:-1},this._defaults=t.fn.jsSlider.defaults,this.options=t.extend({},this._defaults,e),2!==this.options.nav_text.length&&(console.warn("navtext must be need two control element!"),this.options.nav_text=["<",">"]),this.init()}t.extend(n.prototype,{init:function(){this.buildCache(),this.createHtmlDom(),this.applyBasicStyle(),this.createVideoDom(),this.items>0&&this.bindEvents(),this.triggerOnStart(),this.options.autoplay&&this.startLoop()},triggerOnStart:function(){if(this.updateCaption(),this.options.indicator&&this.animateIndicator("start"),this.options.dot_indicator&&this.options.dots){var t=this.$dotContainer.find("li.active");this.animateDotIndicator(t,"start")}},destroy:function(){this.unbindEvents(),this.$element.removeData()},buildCache:function(){this.$element=t(this.element)},unbindEvents:function(){this.$element.off("."+this._name)},createHtmlDom:function(){if(this.createOuterStage(),0===this.$element.find(".sp-item.active").length&&this.$element.find(".sp-item:first-child").addClass("active"),this.item=this.$element.find(".sp-item.active"),this.options.nav&&this.createNavigationController(),this.options.dots&&this.createDotsController(),this.options.indicator&&this.createIndicator(),this.options.show_number&&this.createSliderNumber(),2===this.$element.find(".sp-item").length){var t=this.$element.find(".sp-item").
36clone();t.removeClass("active").addClass("sp-clone-item"),this.$outerStage.append(t)}},createOuterStage:function(){this.outerStage=e.createElement("div"),this.outerStage.setAttribute("class","sp-slider-outer-stage");var i=t(this.outerStage);this.$element.find(".sp-item").each((function(t,e){i.append(e)})),this.$element.append(i),this.$outerStage=i},createNavigationController:function(){var i=e.createElement("div");let s=t(".sppb-addon-sp-slider"),o=s?.data("aria-next")??"Next",n=s?.data("aria-prev")??"Previous";i.setAttribute("class","sp-nav-control"),this.$element.append(i),this.nextBtn=e.createElement("span"),this.nextBtn.setAttribute("class","next-control nav-control"),this.nextBtn.setAttribute("aria-label",o),this.prevBtn=e.createElement("span"),this.prevBtn.setAttribute("class","prev-control nav-control"),this.prevBtn.setAttribute("aria-label",n),i.append(this.nextBtn),i.append(this.prevBtn),this.nextBtn.innerHTML=this.options.nav_text[1],this.prevBtn.innerHTML=this.options.nav_text[0],this.$nextBtn=t(this.nextBtn),this.$prevBtn=t(this.prevBtn)},createDotsController:function(){if(void 0!==this.options.dots_class&&""===this.options.dots_class){var i=e.createElement("div");i.setAttribute("class","sp-dots"),this.$element.append(i);var s=this,o=e.createElement("ul");this.$element.find(".sp-item").each((function(i,n){var a=e.createElement("li");if(a.setAttribute("class","sp-dot-"+i),s.options.dot_indicator){var r=e.createElement("span");r.setAttribute("class","dot-indicator"),a.append(r)}t(n).hasClass("active")&&a.classList.add("active"),o.append(a)})),i.append(o),this.$element.append(i),this.$dotContainer=t(o)}else if(this.$dotContainer=this.$element.find(this.options.dots_class),this.$element.find(".sp-item.active")>0){var n=this.$element.find(".sp-item").index();this.$dotContainer.find("li")[n].addClass("active")}},createIndicator:function(){var i=this,s="circle"===this.options.indicator_type?"circles-indicator":"line-indicator",o=function(){var o=e.createElement("div");o.setAttribute("class","sp-indicator-container"),i.$element.append(o),i.indicator=e.createElement("div"),i.indicator.setAttribute("class","sp-indicator "+s),t(o).append(i.indicator),i.$indicator=t(i.indicator)};""===this.options.indicator_class?"circle"===this.options.indicator_type||o():this.$element.find(this.options.indicator_class).length>0?(this.$indicator=this.$element.find(this.options.indicator_class),this.$indicator.addClass(s)):o()},createSliderNumber:function(){var i=this,s=function(){var s=e.createElement("div");s.setAttribute("class","sp-slider_number"),i.$element.append(s),i.$slider_number=t(s)};""===this.options.slider_number_class?s():this.$element.find(this.options.slider_number_class).length>0?this.$slider_number=this.$element.find(this.options.slider_number_class):s(),this.$slider_number.append('<span class="sp-slider_current_number"> </span>')},updateSliderNumber:function(){if(!0===this.options.show_number){var t=this.$element.find(".sp-item").not(".sp-clone-item").length,i=this.item.index();this.item.hasClass("sp-clone-item")&&(i=i===this.items-1?1:0);var e=this.$slider_number.find(".sp-slider_current_number"),s=i+1>10?i+1:("0"+(i+1)).slice(-2),o=t>10?t:("0"+t).slice(-2);e.html(s+'<span class="sp-slider-current-number-slash">/</span><span class="sp-slider-current-number-right">'+o+"</span>")}},videoUtils:function(){var t={},i=this;return t.getVideoSrc=function(t){var i=t.match(/youtube|youtu\.be/),e=-1!==t.indexOf("vimeo"),s=!1,o=t.split(".").pop();return"mp4"!==o&&"webm"!==o&&"ogg"!==o||(s=!0),{isYouTube:i,isVimeo:e,html5:s,videoType:o}},t.getHtml5Type=function(t){return t.split(".").pop()},t.getYoutubeId=function(t){var i=t.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/);return!(!i||11!=i[7].length)&&i[7]},t.hasVideo=function(t){return void 0!==i.player["item_"+t]},t.getPlayerType=function(t){var e="youtube";return"vimeo"===i.player["item_"+t].type&&(e="vimeo"),"html5"===i.player["item_"+t].type&&(e="html5"),e},t.getPlayer=function(t,e){void 0===e&&(e="youtube");var s=i.player["item_"+t];return void 0!==s&&s.type===e?s.player:null},t.uuid=function(){return"xxx-4xxx-yxxx-xxxxx".replace(/[xy]/g,(function(t){var i=16*Math.random()|0;return("x"==t?i:3&i|8).toString(16)}))},t},createVideoDom:function(){var t=this;this.videoList.youtube.length>0&&(i.YT?this.createYoutubeDom(this.videoList.youtube):(i.onYouTubeIframeAPIReadyTemp.push(this.createYoutubeDom.bind(this,this.videoList.youtube)),i.onYouTubeIframeAPIReady=()=>i.onYouTubeIframeAPIReadyTemp.forEach((t=>t())))),this.videoList.vimeo.length>0&&this.createVimeoDom(this.videoList.vimeo),this.videoList.html5.length>0&&this.videoList.html5.map((function(i){t.createHtml5VideoDom(i)}))},createYoutubeDom:function(t){var i=this;t.map((function(t){i.createYoutubeVideoFrame(t)}))},createVimeoDom:function(t){var i=this;"undefined"==typeof Vimeo?setTimeout((function(){i.createVimeoDom(t)}),10):t.map((function(t){i.createVimeoVideoFrame(t)}))}
36,checkVideoBackground:function(t){var i=t.find("div[data-video_src]");if(i.length>0){var s=i.attr("data-video_src"),o=this.video.getVideoSrc(s);if(o.isYouTube){if(null===e.getElementById("sp-youtube-script")){var n=e.createElement("script");n.setAttribute("id","sp-youtube-script"),n.src="https://www.youtube.com/iframe_api";var a=e.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a)}this.videoList.youtube.push(t)}if(o.isVimeo){if(null===e.getElementById("sp-vimeo-script")){var r=e.createElement("script");r.setAttribute("id","sp-vimeo-script"),r.src="https://player.vimeo.com/api/player.js";var d=e.getElementsByTagName("script")[0];d.parentNode.insertBefore(r,d)}this.videoList.vimeo.push(t)}o.html5&&this.videoList.html5.push(t)}},applyBasicStyle:function(){this.outerWidth=this.$outerStage.outerWidth();var i=0,e=this.options.speed,s=this.options.animations,o=this;this.$element.find(".sp-item").each((function(){if(i++,o.checkVideoBackground(t(this)),t(this).css({"-webkit-transition-duration":e+"ms"}),"fade"===s&&(t(this).css({opacity:0}),t(this).hasClass("active")&&t(this).css({opacity:1})),"zoomOut"===s&&(t(this).hasClass("active")||t(this).css({"-webkit-transform":"scale3D(.8,.8,.8)"})),"clip"===s&&(t(this).hasClass("active")?t(this).css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, "+o.outerWidth+"px, auto, 0px)",zIndex:2,opacity:1}):t(this).css({"-webkit-transition-duration":o.options.speed+"ms","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, 0, auto, 0px)",opacity:0,zIndex:1})),"bubble"===s)if(t(this).hasClass("active"))t(this).css({"-webkit-transition-duration":"0s","-webkit-transform":"scale3D(1,1,1)","clip-path":"circle(100% at 50% 50%)",zIndex:2,visibility:"visible",opacity:1});else{var n=Math.floor(50*Math.random())+20,a=Math.floor(40*Math.random())+20;t(this).css({"-webkit-transition-duration":"0s","-webkit-transform":"scale3D(0,0,0)","clip-path":"circle("+o.options.bubble_size+" at "+n+"% "+a+"%)",opacity:0,visibility:"visible",zIndex:1})}})),"3D"!==s&&"3d"!==s||(this.$element.addClass("on-3d-active"),this.add3DHook()),"clip"===s&&this.$element.addClass("sp-clip-slider"),"bubble"===s&&this.$element.addClass("sp-bubble-slider"),"stack"===s&&this.$element.addClass("sp-stack-slider"),"slide"===s&&this.$element.addClass("sp-basic-slider"),"fade"===s&&this.$element.addClass("sp-fade-slider"),this.items=i,this.updateResponsiveView(),this.updateSliderNumber()},add3DHook:function(){var t=this.options.rotate,i=this.$element.find(".sp-item.active");i.css({zIndex:3,"-webkit-transition-duration":"0s","-webkit-transform":"translate3d(0, 0, -200px)"}),i.next(".sp-item").addClass("next-3d").css({zIndex:2,opacity:1,visibility:"visible","-webkit-transition-duration":"0s","-webkit-transform":"translate3d(100%, 0,-400px) rotate3d(0,-1,0,"+t+"deg)"}),this.$element.find(".sp-item:last-child").addClass("prev-3d").css({zIndex:2,opacity:1,visibility:"visible","-webkit-transition-duration":"0s","-webkit-transform":"translate3d(-100%, 0,-400px) rotate3d(0,-1,0,"+-t+"deg)"})},startLoop:function(){var t=this;this.timer=setInterval((function(){if(!1===t.isAnimating){if(!t.options.loop)if(!t.item.next(".sp-item").length||t.item.next(".sp-item").length&&t.item.next(".sp-item").hasClass("sp-clone-item"))return void t.stopLoop();t.Next()}}),this.options.interval)},stopLoop:function(t){void 0===t&&(t=null),clearInterval(this.timer),this.timer=0},Next:function(){this.isAnimating=!0,-1===this.delta&&(this.delta=1);var t="",i="";"3D"!==this.options.animations&&((t=this.$element.find(".sp-item.active")).addClass("prev-item"),i=t.next(".sp-item").length?t.next(".sp-item").addClass("active next-item"):this.$element.find(".sp-item:first-child").addClass("active next-item")),"3d"!==this.options.animations&&"3D"!==this.options.animations||(t=this.$element.find(".sp-item.active"),i=this.$element.find(".next-3d")),this.item=i,this.updateSliderNumber(),this.updateDotsController(),"3D"!==this.options.animations&&this.updateItemStyle(t,i),"3D"===this.options.animations&&this.update3DItemStyle(t,i)},Prev:function(){this.isAnimating=!0,1===this.delta&&(this.delta=-1);var t="",i="";"3D"!==this.options.animations&&((i=this.$element.find(".sp-item.active")).addClass("prev-item"),t=i.prev(".
36sp-item").length?i.prev(".sp-item").addClass("active next-item"):this.$element.find(".sp-item:last-child").addClass("active next-item")),"3d"!==this.options.animations&&"3D"!==this.options.animations||(i=this.$element.find(".sp-item.active"),t=this.$element.find(".prev-3d")),this.item=t,this.updateSliderNumber(),this.updateDotsController(),"3D"!==this.options.animations&&this.updateItemStyle(i,t),"3D"===this.options.animations&&this.update3DItemStyle(i,t)},slideFromPosition:function(t,i){var e=this;this.isAnimating=!0;var s="",o="";if("3D"!==this.options.animations&&(s=this.$element.find(".sp-item.active").addClass("prev-item"),o=this.$element.find(".sp-item:nth-child("+t+")").addClass("active next-item")),"3D"===this.options.animations){var n=function(){var n=300;if(1===i){s=e.$element.find(".sp-item.active"),o=e.$element.find(".next-3d");var a=s.index(),r=Math.abs(a-t);if(2===r)return e.Next(),{v:void 0};for(var d=function(t){setTimeout((function(){1!==t&&(s=e.$element.find(".sp-item.active"),o=e.$element.find(".next-3d")),e.update3DItemStyle(s,o,n)}),n*t)},l=1;l<r;l++)d(l)}if(-1===i){s=e.$element.find(".sp-item.active"),o=e.$element.find(".prev-3d");var c=s.index()+1,m=Math.abs(c-(t-1));if(2===m)return e.Prev(),{v:void 0};var p=function(t){setTimeout((function(){1!==t&&(s=e.$element.find(".sp-item.active"),o=e.$element.find(".prev-3d")),e.update3DItemStyle(s,o,n)}),n*t)};for(l=1;l<m;l++)p(l)}}();if("object"===_typeof(n))return n.v}this.item=o,this.updateSliderNumber(),this.delta=i,"3D"!==this.options.animations&&this.updateItemStyle(s,o)},updateDotsController:function(){var t=this;if(this.options.dots){var i=this.$dotContainer.find("li.active"),e="";i.removeClass("active"),1===this.delta&&(e=i.next("li").length?i.next("li").addClass("active"):this.$dotContainer.find("li:first-child").addClass("active")),-1===this.delta&&(e=i.prev("li").length?i.prev("li").addClass("active"):this.$dotContainer.find("li:last-child").addClass("active")),this.options.dot_indicator&&(this.animateDotIndicator(i,"stop"),this._dotControllerTimeId>0&&(clearTimeout(this._dotControllerTimeId),this._dotControllerTimeId=0),this._dotControllerTimeId=setTimeout((function(){t.animateDotIndicator(e,"start")}),this.options.speed)),e.css({"-webkit-transition":"all 0.5s linear 0s"})}},updateDotsFromPosition:function(t){var i=this,e=this.$dotContainer.find("li.active").removeClass("active"),s=this.$dotContainer.find("li:nth-child("+t+")").addClass("active");this.options.dot_indicator&&(this.animateDotIndicator(e,"stop"),this._dotControllerTimeId>0&&(clearTimeout(this._dotControllerTimeId),this._dotControllerTimeId=0),this._dotControllerTimeId=setTimeout((function(){i.animateDotIndicator(s,"start")}),this.options.speed)),s.css({"-webkit-transition":"all 0.5s linear 0s"})},animateDotIndicator:function(t,i){if(0!==t.find(".dot-indicator").length&&("stop"===i&&t.find(".dot-indicator").removeClass("active").css({"-webkit-transition-duration":"0s"}),"start"===i)){var e=Math.abs(this.options.interval-this.options.speed);t.find(".dot-indicator").addClass("active").css({"-webkit-transition-duration":e+"ms"})}},animateIndicator:function(t){if(this.options.indicator){var i=Math.abs(this.options.interval-this.options.speed);"line"===this.options.indicator_type&&("start"===t&&this.$indicator.css({"-webkit-transition-duration":i+"ms",width:"100%"}),"stop"===t&&this.$indicator.css({"-webkit-transition-duration":"0s",width:"0"})),"circle"===this.options.indicator_type&&"stop"===t&&this.$indicator.removeClass("start")}},update3DItemStyle:function(t,i,e){var s=this;void 0===e&&(e=null);var o=null===e?this.options.speed:e,n=this.options.rotate;if(this.animateIndicator("stop"),-1===this.delta){this.$element.find(".next-3d").removeClass("next-3d").css({opacity:0,visibility:"hidden"});(i.prev(".sp-item").length>0?i.prev(".sp-item"):this.$element.find(".sp-item:last-child")).addClass("prev-3d").css({opacity:1,zIndex:1,visibility:"visible","-webkit-transition-duration":"0s","-webkit-transform":"translate3d(-100%, 0,-400px) rotate3d(0,-1,0,"+-n+"deg)"}),i.addClass("active").removeClass("prev-3d").css({zIndex:3,opacity:1,visibility:"visible","-webkit-transition-duration":o+"ms","-webkit-transform":"translate3d(0, 0,-200px) rotate3d(0,
360,0,0deg)"}),t.addClass("next-3d").removeClass("active").css({zIndex:1,opacity:1,visibility:"visible","-webkit-transition-duration":o+"ms","-webkit-transform":"translate3d(100%, 0,-400px) rotate3d(0,-1,0,"+n+"deg)"})}if(1===this.delta){this.$element.find(".prev-3d").removeClass("prev-3d").css({opacity:0,visibility:"hidden"});(i.next(".sp-item").length>0?i.next(".sp-item"):this.$element.find(".sp-item:first-child")).addClass("next-3d").css({opacity:1,visibility:"visible","-webkit-transition-duration":"0s","-webkit-transform":"translate3d(100%, 0,-400px) rotate3d(0,-1,0,"+n+"deg)"}),i.addClass("active").removeClass("next-3d").css({zIndex:3,opacity:1,visibility:"visible","-webkit-transition-duration":o+"ms","-webkit-transform":"translate3d(0, 0,-200px) rotate3d(0,0,0,0deg)"}),t.addClass("prev-3d").removeClass("active").css({zIndex:1,opacity:1,visibility:"visible","-webkit-transition-duration":o+"ms","-webkit-transform":"translate3d(-100%, 0,-400px) rotate3d(0,-1,0,"+-n+"deg)"})}this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){s.isAnimating=!1,s.animateIndicator("start")}),o),this.options.autoplay&&0===this.timer&&this.startLoop(),this.updateCaption()},createIframeMask:function(i,s,o){void 0===o&&(o="youtube");var n=e.createElement("div",{css:{position:"absolute",display:"block",minWidth:"100%"}}),a="sp-video-content-"+s+"-"+this.video.uuid();if("vimeo"===o)n.className="sp-video-container sp-vimeo-video-container",n.id=a,i.append(n);else{n.className="sp-video-container";var r=e.createElement("div");r.id=a,i.append(t(n).append(r))}var d=e.createElement("div");d.className="sp-video-background-mask",i.append(d);var l=e.createElement("div");return l.className="sp-video-control",t(l).append('<span data-type="'+o+'" data-index="'+s+'" class="sp-volumn-control fa fa-volume-off"></span>'),t(d).append(l),a},createYoutubeVideoFrame:function(t){var e=t.find("div[data-video_src]"),s=t.index(),o={active:t.hasClass("active")},n=this.createIframeMask(e,s),a=this.video.getYoutubeId(e.attr("data-video_src"));this.videoProps[s];var r=t.hasClass("active")?1:0,d=new YT.Player(n,{width:"100%",height:"100%",videoId:a,playerVars:{enablejsapi:1,autoplay:r,controls:0,rel:0,modestbranding:0,loop:1,showinfo:0,origin:i.location.origin},events:{onReady:this.onPlayerReady.bind(this,o),onStateChange:this.onPlayerStateChange.bind(this),onError:this.onPlayerError.bind(this)}});return this.player["item_"+s]={player:d,type:"youtube"},this.resizeVideoIframeWithAspectRatio(e),d},onPlayerReady:function(t,i){i.target.mute(),this.videoReady=!0,this.options.autoplay&&this.timer>0&&this.stopLoop("onPlayerReady"),t.active&&(i.target.playVideo(),this.videoPlaying=!0)},onPlayerStateChange:function(t){t.data===YT.PlayerState.ENDED&&(this.options.autoplay&&!1===this.onMouseOver?this.Next():t.target.playVideo())},onPlayerError:function(t){console.warn("get video error",t),this.Next()},createVimeoVideoFrame:function(t){var i=t.find("div[data-video_src]"),e=t.index(),s=t.hasClass("active")?1:0,o=i.attr("data-video_src"),n=this.createIframeMask(i,e,"vimeo"),a=new Vimeo.Player(n,{url:o,title:0,byline:0,loop:s,sidedock:0,muted:1,transparent:1});this.player["item_"+e]={player:a,type:"vimeo"},a.on("bufferstart",function(){this.resizeVideoIframeWithAspectRatio(i)}.bind(this)),s&&(a.play(),a.on("ended",this.vimeoOnPlayEnd.bind(this,a)))},createHtml5VideoDom:function(i){var s=i.find("div[data-video_src]"),o=i.index(),n="sp-video-content-"+o+this.video.uuid(),a=i.hasClass("active"),r=s.attr("data-video_src"),d=e.createElement("div");d.className="sp-video-container sp-html5-video-container";var l=e.createElement("div");l.className="sp-video-background-mask";var c=navigator.userAgent.toLowerCase().includes("iphone"),m=e.createElement("div");m.className="sp-video-control",t(m).append('<span data-type="html5" data-index="'+o+'" class="sp-volumn-control fa fa-volume-off"></span>'),t(d).append(t(l).append(m));var p=e.createElement("video");p.id=n,p.muted=!0,p.playsinline="playsinline",c&&(p.setAttribute("autoplay","true"),p.setAttribute("muted",""),p.setAttribute("loop",""),p.setAttribute("playsinline",""));var h=e.createElement("source");h.src=r,h.type="video/"+this.video.getHtml5Type(r),p.append(h),s.append(t(d).append(p)),this.player["item_"+o]={player:p,type:"html5"},this.resizeVideoIframeWithAspectRatio(s),(a||c)&&(p.play(),this.videoPlaying=!0,p.onended=this.html5OnPlayEnd.bind(this,p))},html5OnPlayEnd:function(t,i){this.options.autoplay&&!1===this.onMouseOver?this.Next():(t.play(),t.onended=this.html5OnPlayEnd.bind(this,t))},playVideoAnimation:function(t){var i=this,e=!1,s=t.find("div[data-vi
36deo_src]");if(s.length>0){var o=t.index();if(this.video.hasVideo(o)){var n=this.video.getPlayerType(o);if("youtube"===n){var a=this.video.getPlayer(o,n);if("function"==typeof a.playVideo){var r=a.getPlayerState();this.resizeVideoIframeWithAspectRatio(s),5===r?(a.seekTo(0),a.playVideo()):a.playVideo(),e=!0}else e=!1}if("vimeo"===n){var d=this.video.getPlayer(o,n);this.resizeVideoIframeWithAspectRatio(s),"function"==typeof d.play?(d.play().then((function(){d.on("ended",i.vimeoOnPlayEnd.bind(i,d))})),d.on("play",(function(t){d.setCurrentTime(0)})),e=!0):e=!1}if("html5"===n){var l=this.video.getPlayer(o,n);l.paused&&l.readyState>0&&setTimeout((function(){l.currentTime=0,l.play(),l.onended=i.html5OnPlayEnd.bind(i,l)}),500),e=!0}}}this.videoPlaying=e},vimeoOnPlayEnd:function(t,i){this.options.autoplay&!1===this.onMouseOver?(this.Next(),t.off("ended")):(t.setCurrentTime(0),t.play(),t.on("ended",this.vimeoOnPlayEnd.bind(this,t)),t.off("ended"))},resizeVideoIframeWithAspectRatio:function(e){var s,o=this.video.getVideoSrc(e.attr("data-video_src")),n=t(i).width(),a=t(i).height(),r={width:this.$outerStage.innerWidth(),height:this.$outerStage.innerHeight()},d=16,l=9;(null!==o.isYouTube||o.isVimeo)&&(s=e.find(".sp-video-container")),o.html5&&(s=e.find(".sp-html5-video-container")),o.isVimeo&&(s.removeAttr("height"),s.removeAttr("width"));var c=d/l;c>r.width/r.height?a=(n=r.width)/c:n=(a=r.height)*c;var m=(r.height-a)/2,p=(r.width-n)/2;s&&s.css({width:n,height:a,top:m,left:p})},resetItemVideoFrame:function(t){var i=t.index();if(this.video.hasVideo(i)){var e=this.video.getPlayerType(i);if("youtube"===e){var s=this.video.getPlayer(i,e);"function"==typeof s.stopVideo&&s.stopVideo()}if("vimeo"===e){var o=this.video.getPlayer(i,e);"function"==typeof o.pause&&o.pause()}if("html5"===e){var n=this.video.getPlayer(i,e);n.paused||n.pause()}}},updateItemStyle:function(t,i){var e=this;if(this.animateIndicator("stop"),this.playVideoAnimation(i),"fade"===this.options.animations&&(t.removeClass("active"),i.css({opacity:1}),this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){t.css({opacity:0}),i.removeClass("next-item"),t.removeClass("prev-item"),e.animateIndicator("start")}),this.options.speed),this.isAnimating=!1),"slide"===this.options.animations){var s=-1===this.prevCoordinate.dragPointer?0:this.prevCoordinate.dragPointer,o=-1===this.delta?"-"+(100-s):100-s,n=-1===this.delta?100:-100;i.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+o+"%,0,0)"}),this._timeoutId1&&(clearTimeout(this._timeoutId1),this._timeoutId1=0),this._timeoutId1=setTimeout((function(){i.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"translate3D(0,0,0)"}),t.css({"-webkit-transition-duration":e.options.speed+1500+"ms","-webkit-transform":"translate3D("+n+"%,0,0)"})}),50),this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){var i;e.isAnimating=!1,t.removeClass("active"),e.$element.find(".next-item").removeClass("next-item"),e.$element.find(".prev-item").removeClass("prev-item"),t.css(((i={"-webkit-transition-duration":"1s","-webkit-transform":"translateX(100%)"})["-webkit-transform"]="translate3D(100%,0,0)",i)),e.animateIndicator("start")}),this.options.speed+100)}if("zoomOut"===this.options.animations||"zoomIn"===this.options.animations){var a=this.options.animations;"zoomIn"===a&&(this.delta=-1*this.delta),this._timeoutId1&&(clearTimeout(this._timeoutId1),this._timeoutId1=0),-1===this.delta&&(i.css({"-webkit-transition-duration":"0s","-webkit-transform":"scale3d(1.4,1.4,1.4)",opacity:0}
36),this._timeoutId1=setTimeout((function(){t.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(0.8,0.8,0.8) ",opacity:0,zIndex:2}),i.css({"-webkit-transition-duration":e.options.speed+"ms",opacity:1,"-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(1,1,1)",zIndex:1})}),100)),1===this.delta&&(i.css({"-webkit-transition-duration":"0s","-webkit-transform":"scale3d(0.8,0.8,0.8)"}),this._timeoutId1=setTimeout((function(){t.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(1.4,1.4,1.4) ",opacity:0,zIndex:1}),i.css({"-webkit-transition-duration":e.options.speed-100+"ms",opacity:1,"-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(1,1,1)",zIndex:2})}),100)),this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){t.removeClass("active"),i.removeClass("next-item"),t.removeClass("prev-item"),e.isAnimating=!1,e.animateIndicator("start")}),this.options.speed+100)}if("stack"===this.options.animations){this._timeoutId1&&(clearTimeout(this._timeoutId1),this._timeoutId1=0);var r=-1===this.prevCoordinate.dragPointer?0:this.prevCoordinate.dragPointer;if(1===this.delta){var d=100-r,l={tx:d+"%",ty:0,tz:0,sx:1,sy:1,sz:1},c={tx:0,ty:0,tz:0,sx:1,sy:1,sz:1};!0===this.options.vertical_mode&&(l=Object.assign({},l,{tx:0,ty:d+"%",sx:1.2,sy:1.2,sz:1.2}),c=Object.assign({},c,{tx:0,ty:"-"+d+"%",sx:1.2,sy:1.2,sz:1.2})),i.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+l.tx+","+l.ty+","+l.tz+") scale3D("+l.sx+","+l.sy+","+l.sz+")"}),this._timeoutId1=setTimeout((function(){i.css({"-webkit-transition-duration":e.options.speed+"ms",opacity:1,"-webkit-transform":"translate3D(0,0,0) scale3d(1,1,1)",zIndex:2}),t.css({"-webkit-transition-duration":e.options.speed+200+"ms","-webkit-transform":"perspective(1000px) translate3D("+c.tx+","+c.ty+","+c.tz+") scale3d("+c.sx+","+c.sy+","+c.sz+")",opacity:.5,zIndex:1})}),50)}if(-1===this.delta){var m=r-100,p={tx:m+"%",ty:0,tz:0,sx:1,sy:1,sz:1},h={tx:0,ty:0,tz:0,sx:1,sy:1,sz:1};this.options.vertical_mode&&(p=Object.assign({},p,{tx:0,ty:m+"%",sx:1,sy:1,sz:1}),h=Object.assign({},h,{tx:0,ty:-m+"%",sx:1.2,sy:1.2,sz:1.2})),i.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+p.tx+","+p.ty+","+p.tz+") scale3D("+p.sx+","+p.sy+","+p.sz+")"}),this._timeoutId1=setTimeout((function(){i.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"translate3D(0,0,0) ",opacity:1,zIndex:2}),t.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"translate3D("+h.tx+","+h.ty+","+h.tz+") scale3d("+h.sx+","+h.sy+","+h.sz+")",opacity:.5,zIndex:1})}),50)}this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){t.removeClass("active"),i.removeClass("next-item"),t.removeClass("prev-item"),e.isAnimating=!1,e.animateIndicator("start")}),this.options.speed+100)}if("clip"===this.options.animations){var u=-1===this.prevCoordinate.dragPointer?0:this.prevCoordinate.dragPointer,v=0,f=5;if(-1!==this.prevCoordinate.dragPointer){v=(v=.001*u)>1?1:Math.abs(v);var b=f-Math.abs(u*(f/800));f=b>f?f:b<0?0:b}this._timeoutId1&&(clearTimeout(this._timeoutId1),this._timeoutId1=0),1===this.delta&&(i.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+f+"%,0,0)",clip:"rect(auto, "+this.outerWidth+"px, auto, 0px)",zIndex:2,opacity:v}),this._timeoutId1=setTimeout((function(){t.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, 0px, auto, 0px)",opacity:1,zIndex:3}),i.css({"-webkit-transition-duration":e.options.speed+"ms",opacity:1,"-webkit-transform":"translate3D(0,0,0)"})}),100)),-1===this.delta&&(i.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(-"+f+"%,0,0)",clip:"rect(auto, "+this.outerWidth+"px, auto, 0px)",zIndex:2,opacity:v}),this._timeoutId1=setTimeout((function(){t.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, "+e.outerWidth+"px, auto, "+e.outerWidth+"px)",opacity:1,zIndex:3}),i.css({"-webkit-transition-duration":e.options.speed+"ms",opacity:1,"-webkit-transform":"translate3D(0,0,0)"})}),100)),t.removeClass("active"),this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){i.removeClass("next-item"),t.removeClass("prev-item"),e.isAnimating=!1,e.animateIndicator("start")}),this.options.speed)}if("bubble"===this.options.animations){t.css({zIndex:1}),1===this.delta&&i.css({"-webkit-transition-duration":".25s","-webkit-transform":"scale3D(1,1,1)","-webkit-transition-timing-function":"cubic-bezier(1, 0.26, 0.18, 1.22)",zIndex:2,opacity:1}),-1===this.delta&&i.css({"-webkit-transition-duration":".25s","-webkit-transform":"scale3D(1,1,1)","-webkit-transition-timing-function":"cubic-bezier(1, 0.26, 0.18, 1.22)",zIndex:2,opacity:1}),this._timeoutId1=setTimeout((function(){i.css({"-webkit-transition-duration":e.options.speed+"ms","-webkit-transform":"scale3D(1,1,1)","-webkit-transition-timing-function":"linear",opacity:1,"clip-path":"circle(100% at 50% 50%)"})}),500),this._timeoutId2&&(clearTimeout(this._timeoutId2),this._timeoutId2=0),this._timeoutId2=setTimeout((function(){var s=Math.floor(50*Math.random())+20,o=Math.floor(40*Math.random())+20;t.css({"-webkit-transition-duration":"0s","-webkit-transform":"scale3D(0,0,0)","clip-path":"circle("+e.options.bubble_size+" at "+s+"% "+o+"%)",opacity:1,visibility:"visible",zIndex:1}),t.removeClass("active"),i.removeClass("next-item"),t.removeClass("prev-item"),e.isAnimating=!1,e.animateIndicator("start")}),this.options.speed+500)}this.resetItemVideoFrame(t),this.options.autoplay&&0===this.timer&&!1===this.videoPlaying&&this.startLoop(),this.updateCaption()},hideOtherItemCaptions:function(){var i=this,e=function(e){var s=t(e).find('[data-layer="true"]');s.length>0&&s.each((function(e,s){var o=i.options.speed;t(s).css({transition:"opacity "+o+"ms linear",opacity:0}
36),setTimeout((function(){t(s).css({visibility:"hidden"})}),i.options.speed)}))};this.item.next(".sp-item").length>0&&this.item.nextAll(".sp-item").each((function(t,i){e(i)}));this.item.prev(".sp-item").length>0&&this.item.prevAll(".sp-item").each((function(t,i){e(i)}))},updateCaption:function(){var i=this.item.find('[data-layer="true"]');if(this.hideOtherItemCaptions(),i.length>0){var e=this,s=this.captionAnimation();i.each((function(i){t(this).css({visibility:"visible"});var o=t(this).attr("data-animation");if(void 0!==o){var n=Object.assign({},e.captionAnimationProperty);void 0!==o&&(o=JSON.parse(o)),(o=Object.assign(n,o)).after=parseInt(o.after),"width"===o.type&&s.width(t(this),o),"text-animate"===o.type&&s.text(t(this),o),"slide"===o.type&&s.slider(t(this),o),"zoom"===o.type&&s.zoom(t(this),o),"rotate"===o.type&&s.rotate(t(this),o),"flip"===o.type&&s.flip(t(this),o)}}))}},captionAnimation:function(){var i={text:function(i,e){var s="0px",o="0px";if("top"===e.direction&&(o="-500px"),"bottom"===e.direction&&(o="500px"),"left"===e.direction&&(s="-500px"),"right"===e.direction&&(s="500px"),i.css({visibility:"visibile",opacity:1}),i.hasClass("sp-letter-trimed"))self=this,i.find("span").each((function(){t(this).css({transform:"translateY("+o+") translateX("+s+")",display:"inline-block",opacity:0}
36)}));else{var n=i.text().trim().split("");i.empty(),t.each(n,(function(t,e){if(" "!==e){var n='<span class="sp-txt'+t+'" style="transform: translateY('+o+") translateX("+s+'); display:inline-block; opacity:0">'+e+"</span>";i.append(n)}else i.append(" ")})),i.addClass("sp-letter-trimed")}setTimeout((function(){var s=i.find("span");s.each((function(i,o){var n=this,a=(i+1)*(e.duration/s.length)+500;setTimeout((function(){t(n).css({opacity:1,"-webkit-transition-property":"opacity transform",transform:"translateY(0px) translateX(0)","-webkit-transition-duration":e.duration+"ms","-webkit-transition-timing-function":e.timing_function})}),a)}))}),e.after)},width:function(t,i){t.css({width:i.from,"-webkit-transition-duration":"0s",overflow:"hidden"}),setTimeout((function(){t.css({width:i.to,"-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"width transform"})}),i.after)},slider:function(t,i){"left"===i.direction&&(t.css({opacity:"0","-webkit-transform":"translateX(-"+i.from+")","-webkit-transition-duration":"0s"}),this.sliderVertical(t,i)),"right"===i.direction&&(t.css({opacity:"0","-webkit-transform":"translateX("+i.from+")","-webkit-transition-duration":"0s"}),this.sliderVertical(t,i)),"top"===i.direction&&(t.css({opacity:"0","-webkit-transform":"translateY("+i.from+")","-webkit-transition-duration":"0s"}),this.sliderHorizontal(t,i)),"bottom"===i.direction&&(t.css({opacity:"0","-webkit-transform":"translateY("+i.from+")","-webkit-transition-duration":"0s"}),this.sliderHorizontal(t,i))},sliderVertical:function(t,i){setTimeout((function(){t.css({opacity:"1","-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"opacity, transform, height, width","-webkit-transition-origin":"50% 50% 0","-webkit-transform":"translateX("+i.to+")"})}),i.after)},sliderHorizontal:function(t,i){setTimeout((function(){t.css({opacity:"1","-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"opacity, transform, height, width","-webkit-transition-origin":"50% 50% 0","-webkit-transform":"translateY("+i.to+")"})}),i.after)},zoom:function(t,i){"zoomIn"===i.direction&&(t.css({opacity:1,"-webkit-transform":"scale("+i.from+")","-webkit-transition-duration":"0s"}),this.zooming(t,i)),"zoomOut"===i.direction&&(t.css({opacity:1,"-webkit-transform":"scale("+i.from+")","-webkit-transition-duration":"0s"}),this.zooming(t,i))},zooming:function(t,i){setTimeout((function(){t.css({opacity:1,"-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"transform, scale","-webkit-transition-origin":"50% 50% 0","-webkit-transform":"scale("+i.to+")"})}),i.after)},rotate:function(t,i){t.css({"-webkit-transform":"rotate("+i.from+")","-webkit-transition-duration":"0s",opacity:0}
36),this.rotating(t,i)},rotating:function(t,i){setTimeout((function(){t.css({"-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"transform,rotate","-webkit-transition-origin":i.origin,"-webkit-transform":"rotate("+i.to+")",opacity:1})}),i.after)},flip:function(t,i){var e=0,s=0,o=180;"x"===i.direction&&(e=1),"y"===i.direction&&(s=1,o*=-1),"x"!==i.direction&&"y"!==i.direction&&(e=1),t.css({"-webkit-transform":"perspective(400px) rotate3d("+e+", "+s+", 0, "+o+"deg)","-webkit-transition-duration":"0s","backface-visibility":"hidden",opacity:1}),this.fliping(t,i)},fliping:function(t,i){setTimeout((function(){t.css({"-webkit-transition-duration":i.duration+"ms","-webkit-transition-timing-function":i.timing_function,"-webkit-transition-property":"transform,rotate,opacity","-webkit-transition-origin":i.origin,"-webkit-transform":"perspective(400px) rotate3d(0, 0, 0, 0deg)",opacity:1})}),i.after)}};return i},dragoverActionToNextItem:function(t){if("fade"===this.options.animations){if(this.item.next(".sp-item").length)this.item.next(".sp-item").addClass("next-item").css({opacity:t});else this.$element.find(".sp-item:first-child").addClass("next-item").css({opacity:t});this.item.addClass("prev-item").css({opacity:1-t})}if("slide"===this.options.animations||"stack"===this.options.animations){this.$element.find(".dragenable").css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(0,0,0)"}).removeClass("dragenable next-item");var i=t>100?100:t;this.item.addClass("prev-item");var e="";e=this.item.next(".sp-item").length?this.item.next(".sp-item"):this.$element.find(".sp-item:first-child");var s={"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(-"+i+"%,0,0)"},o={x:100-i+"%",y:0,z:0};this.options.vertical_mode&&(o=Object.assign({},o,{x:0,y:100-i+"%"}));var n={"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+o.x+","+o.y+","+o.z+")"};"stack"===this.options.animations&&(n.opacity=1,n.zIndex=3),"slide"===this.options.animations&&this.item.css(s),e.addClass("dragenable next-item").css(n)}if("zoomIn"===this.options.animations||"zoomOut"===this.options.animations){var a=this.options.animations,r=.1*t;"zoomOut"===a&&(r=(r+=1)>2?2:r),"zoomIn"===a&&(r=(r=1-r)<0?0:r),this.item.addClass("prev-item");(this.item.next(".sp-item").length?this.item.next(".sp-item"):this.$element.find(".sp-item:first-child")).addClass("dragenable next-item").css({"-webkit-transition-duration":"0s","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(1,1,1)",opacity:1,zIndex:1}),this.item.css({"-webkit-transition-duration":"0s","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d("+r+","+r+","+r+")",opacity:1-.1*t,zIndex:2})}if("clip"===this.options.animations){var d=.001*t;d=d>1?1:d;var l=t>this.outerWidth?this.outerWidth:t,c=15,m=c-Math.abs(l*(c/1e3));c=m>c?c:m<0?0:m,this.item.addClass("prev-item");var p="";p=this.item.next(".sp-item").length?this.item.next(".sp-item"):this.$element.find(".sp-item:first-child"),this.item.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, "+(this.outerWidth-l)+"px, auto, 0px)",opacity:1,zIndex:3}),p.addClass("next-item").css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+c+"%,0,0)",clip:"rect(auto, "+this.outerWidth+"px, auto, 0px)",zIndex:2,opacity:d})}},dragoverActionToPrevItem:function(t){if("fade"===this.options.animations){if(this.item.prev(".sp-item").length)this.item.prev(".sp-item").addClass("next-item").css({opacity:t});else this.$element.find(".sp-item:last-child").addClass("next-item").css({opacity:t});this.item.addClass("prev-item").css({opacity:1-t})}if("slide"===this.options.animations||"stack"===this.options.animations){this.$element.find(".dragenable").css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(0,0,0)"}).removeClass("dragenable next-item");var i=t>100?100:t,e="";this.item.addClass("prev-item"),e=this.item.prev(".sp-item").length?this.item.prev(".sp-item"):this.$element.find(".sp-item:last-child");var s={x:i-100+"%",y:0,z:0};this.options.vertical_mode&&(s=Object.assign({},s,{x:0,y:i-100+"%"}));var o={"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+s.x+","+s.y+","+s.z+")"},n={"-webkit-transition-duration":"0s","-webkit-transform":"translate3D("+i+"%,0,0)"};"stack"===this.options.animations&&(o.opacity=1,o.zIndex=3),"slide"===this.options.animations&&this.item.css(n),e.addClass("dragenable next-item").css(o)}if("zoomIn"===this.options.animations||"zoomOut"===this.options.animations){var a=this.options.animations,r=.25*t;"zoomOut"===a&&(r=(r+=1)>2?2:r),"zoomIn"===a&&(r=(r=1-r)<.2?.2:r),this.item.addClass("prev-item");(this.item.prev(".sp-item").length?this.item.prev(".sp-item"):this.$element.find(".sp-item:last-child")).addClass("dragenable next-item").css({"-webkit-transition-duration":"0s","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d(1,1,1)",opacity:1,zIndex:1}),this.item.css({"-webkit-transition-duration":"0s","-webkit-transform-origin":"50% 50% 50%","-webkit-transform":"scale3d("+r+","+r+","+r+")",opacity:1-.1*t,zIndex:2})}if("clip"===this.options.animations){var d=.001*t;d=d>1?1:Math.abs(d);var l=t>this.outerWidth?this.outerWidth:t;l=Math.abs(l);var c=5,m=c-Math.abs(l*(c/1e3));c=m>c?c:m<0?0:m,this.item.addClass("prev-item");var p="";p=this.item.prev(".sp-item").length?this.item.prev(".sp-item"):this.$element.find(".sp-item:last-child"),this.item.css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(0,0,0)",clip:"rect(auto, "+this.outerWidth+"px, auto, "+l+"px)",opacity:1,zIndex:3}),p.addClass("next-item").css({"-webkit-transition-duration":"0s","-webkit-transform":"translate3D(-"+c+"%,0,0)",clip:"rect(auto, "+this.outerWidth+"px, auto, 0px)",zIndex:2,opacity:d})}},resetCoordiante:function(){var t=this.prevCoordinate.diff;"fade"===this.options.animations&&(t>0&&(this.item.next(".sp-item").length?this.item.next(".sp-item").
36css({opacity:0}):this.$element.find(".sp-item:first-child").css({opacity:0})),t<0&&(this.item.prev(".sp-item").length?this.item.prev(".sp-item").css({opacity:0}):this.$element.find(".sp-item:last-child").css({opacity:0})),this.item.css({opacity:1})),this.$element.find(".dragenable").removeClass("dragenable"),this.prevCoordinate={x:0,y:0,diff:0,dragPointer:-1},this.coordinate={x:0,y:0},this.options.autoplay&&0===this.timer&&!1===this.videoPlaying&&this.startLoop()},backToStage:function(){var t=this,i=this.options.animations;if("zoomIn"!==i&&"zoomOut"!==i||this.item.css({"-webkit-transition-duration":this.options.speed+"ms","-webkit-transform":"scale3d(1,1,1)",opacity:1}),"slide"===i||"stack"===i){var e=this.$element.find(".next-item"),s=this.prevCoordinate.diff,o={x:"100%",y:0,z:0};this.options.vertical_mode&&(o=Object.assign({},o,{x:0,y:"100%"})),s>0&&e.css({"-webkit-transition-duration":this.options.speed+"ms","-webkit-transform":"translate3d("+o.x+","+o.y+","+o.z+")"}),s<0&&e.css({"-webkit-transition-duration":this.options.speed+"ms","-webkit-transform":"translate3d(-"+o.x+",-"+o.y+","+o.z+")"}),setTimeout((function(){e.removeClass("next-item"),t.item.removeClass("prev-item")}),this.options.speed),this.item.css({"-webkit-transition-duration":this.options.speed+"ms","-webkit-transform":"translate3d(0,0,0)"})}},bindEvents:function(){var s=this;s.options.nav&&(s.$nextBtn.on("click."+s._name,(function(t){!1===s.isAnimating&&(s.options.autoplay&&s.stopLoop("bindEvents"),s.Next(),s.checkCallBackMethod.call(s))})),s.$prevBtn.on("click."+s._name,(function(t){!1===s.isAnimating&&(s.Prev(),s.options.autoplay&&s.stopLoop("bindEvents"),s.checkCallBackMethod.call(s))}))),s.options.dots&&s.$dotContainer.find("li").each((function(i){t(this).on("click."+s._name,(function(e){if(t(this).hasClass("active")||!0===s.isAnimating)return!1;s.options.autoplay&&s.stopLoop("bindEvents");var o=t(this).parent().find("li.active"),n=s.$dotContainer.find("li").index(o)>i?-1:1;s.slideFromPosition(i+1,n),s.updateDotsFromPosition(i+1),s.checkCallBackMethod.call(s)}))})),t(e).on("click."+s._name,"#"+s.options.addon_id+" .sp-volumn-control",this.controlVideoVolumn.bind(this)),s.$outerStage.on("mouseenter."+s._name,t.proxy(s.onMouseEnter,s)),s.$outerStage.on("mouseleave."+s._name,t.proxy(s.onMouseLeave,s)),s.$outerStage.on("mousedown."+s._name,t.proxy(s.onDragStart,s)),s.$outerStage.on("mouseup."+s._name+" touchend."+s._name,t.proxy(s.onDragEnd,s)),s.$outerStage.on("touchstart."+s._name,t.proxy(s.onDragStart,s)),s.$outerStage.on("touchcancel."+s._name,t.proxy(s.onDragEnd,s));var o=this.videoPlaying;t(i).focus((function(){s.options.autoplay&&0===s.timer&&!1===o&&s.startLoop()})),t(i).blur((function(){s.options.autoplay&&s.stopLoop("window.blur"),s.destroy()})),t(i).on("resize."+s._name,t.proxy(s.windowResize,s))},windowResize:function(t){void 0!==t&&this.updateResponsiveView()},parseResponsiveViewPort:function(){if(void 0===this.options.responsive)return null;var t=this.options.responsive,e=i.innerWidth;if(!t.length)return null;if(e>t[0].viewport)return t[0];for(var s=0;s<t.length;s++){var o=t[s],n=t[s+1],a=n?n.viewport:-1/0;if(e<=o.viewport&&e>a)return o}return t[t.length-1]},updateResponsiveView:function(){var t=i.innerHeight,e=this.item.find("div[data-video_src]");if(e.length>0&&this.resizeVideoIframeWithAspectRatio(e),void 0!==this.options.responsive){var s=this.parseResponsiveViewPort();if("full"===s.height){if(this._lastViewPort===t)return;this._lastViewPort=t,this.$outerStage.css({height:t+"px"})}else{if(this._lastViewPort===s.height)return;this._lastViewPort=s.height,this.$outerStage.css({height:s.height})}}else this.$outerStage.css({height:t+"px"})},getPosition:function(t){var e={x:null,y:null};return(t=(t=t.originalEvent||t||i.event).touches&&t.touches.length?t.touches[0]:t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t).pageX?(e.x=t.pageX,e.y=t.pageY):(e.x=t.clientX,e.y=t.clientY),e},onMouseEnter:function(t){this.options.autoplay_stop_on_hover&&(this.onMouseOver=!0),this.options.autoplay&&this.timer>0&&this.options.autoplay_stop_on_hover&&this.stopLoop("onMouseEnter")},onMouseLeave:function(t){this.options.autoplay_stop_on_hover&&(this.onMouseOver=!1),this.options.autoplay&&0===this.timer&&this.options.autoplay_stop_on_hover&&this.startLoop()},onDragStart:function(i){var s=this;if(3===i.which||2===i.which||!0===s.isAnimating)return!1;var o=s.getPosition(i);s.coordinate.x=o.x,s.coordinate.y=o.y,t(e).one("mousemove."+s._name+" touchmove."+s._name,t.proxy((function(i){t(e).on("mousemove."+s._name+" touchmove."+s._name,t.proxy(s.onDragMove,s)),i.preventDefault()}),this)),s.isDragging=!0},onDragMove:function(t){var i=this;if(!1!==i.isDragging){i.options.autoplay&&i.stopLoop("onDragMove");var e=i.getPosition(t),s=i.coordinate,o=i.prevCoordinate,n=i.options.vertical_mode;if(o.x!==e.x&&!1===n||o.y!==e.y&&!0===n){var a=n?s.y-e.y:s.x-e.x,r=0;r="slide"===i.options.animations||"stack"===i.options.animations?(.099*Math.abs(a)
36).toFixed(0):"clip"===i.options.animations?a:(.005*Math.abs(a)).toFixed(2),i.prevCoordinate={x:e.x,y:e.y,diff:a,dragPointer:r},a>0&&i.dragoverActionToNextItem(r),a<0&&i.dragoverActionToPrevItem(r)}t.preventDefault()}},onDragEnd:function(t){var i=this;if(i.isDragging){var e=i.prevCoordinate.diff;Math.abs(e)>100?(e>0&&i.Next(),e<0&&i.Prev()):i.backToStage(),i.isDragging=!1}i.resetCoordiante()},controlVideoVolumn:function(i){var e=t(i.target),s=e.attr("data-type"),o=e.attr("data-index"),n=this.player["item_"+o].player;"html5"===s&&(n.muted=!n.muted,n.volume=n.muted?0:1),"youtube"===s&&(n.isMuted()?n.unMute():n.mute()),"vimeo"===s&&n.getVolume().then((function(t){n.setVolume(t>0?0:1)})),e.hasClass("sp-sound-enabled")?e.removeClass("sp-sound-enabled fa-volume-up").addClass("fa-volume-off"):e.addClass("sp-sound-enabled fa-volume-up").removeClass("fa-volume-off")},checkCallBackMethod:function(){this.callback()},callback:function(){var t=this.options.onChange;if("function"==typeof t){var i=this.$element.find(".sp-item").length,e={item:this.item,items:i,element:this.$element};t.call(this.element,e)}}}),t.fn.jsSlider=function(i){return this.each((function(){t.data(this,o)||t.data(this,o,new n(this,i))})),this},t.fn.jsSlider.defaults={animations:"3D",rotate:10,autoplay:!1,autoplay_stop_on_hover:!1,bubble_size:"40px",indicator:!0,indicator_type:"line",indicator_class:"",speed:800,interval:4500,onChange:null,vertical_mode:!1,dots:!0,dots_class:"",dot_indicator:!0,show_number:!1,slider_number_class:"",nav:!0,nav_text:["<",">"],loop:!0}}(jQuery,window,document),function(t){t(document).ready((function(){t(".sppb-addon-sp-slider").each((function(i){var e=t(this),s=e.data("id"),o=e.data("height-xl"),n=e.data("height-lg"),a=e.data("height-md"),r=e.data("height-sm"),d=e.data("height-xs"),l=e.data("slider-animation"),c=e.data("slide-vertically"),m=e.data("3d-rotate"),p=e.data("autoplay"),h=e.data("loop"),u=e.data("pause-hover"),v=e.data("interval"),f=e.data("timer"),b=e.data("speed"),y=e.data("dot-control"),g=e.data("arrow-control"),w=e.data("indecator"),x=e.data("arrow-content"),k=e.data("dot-style");k="with_text"===k?".sp-slider-custom-dot-indecators":"";var _=e.data("slide-count"),C="",I="";if("icon_only"===x?(C='<i class="fa fa-angle-left" title="Previous" aria-hidden="true"></i>',I='<i class="fa fa-angle-right" title="Next" aria-hidden="true"></i>'):"long_arrow"===x?(C='<i class="fa fa-long-arrow-left" title="Previous" aria-hidden="true"></i>',I='<i class="fa fa-long-arrow-right" title="Next" aria-hidden="true"></i>'):"icon_with_text"===x?(C='<i class="fa fa-long-arrow-left" title="Previous" aria-hidden="true"></i> Prev',I='Next <i class="fa fa-long-arrow-right" title="Next" aria-hidden="true"></i>'):(C="Prev",I="Next"),e.jsSlider({autoplay:p,autoplay_stop_on_hover:u,loop:h,animations:l,rotate:m,vertical_mode:c,interval:v,indicator:f,speed:b,dots_class:k,dots:y,dot_indicator:w,nav:g,nav_text:[C,I],show_number:_,addon_id:s,responsive:[{viewport:1399.98,height:o},{viewport:1199.98,height:n},{viewport:991.98,height:a},{viewport:767.98,height:r},{viewport:575.98,height:d}]}),t(".sp-slider-custom-dot-indecators").length>0){var $=t(".sp-slider-custom-dot-indecators ul li"),z=$.outerWidth(!0),D=$.length,T=z*D;t(".sp-slider-custom-dot-indecators ul").css("width",T+"px"),t(".sp-slider-custom-dot-indecators").outerWidth(!0)<T&&t(".sp-slider-custom-dot-indecators").css("overflowX","scroll"),t(window).on("resize",(function(){var i=z*D;t(".sp-slider-custom-dot-indecators").outerWidth(!0)<i&&t(".sp-slider-custom-dot-indecators").css("overflowX","scroll")}))}}));new MutationObserver((function(i){i.forEach((function(i){var e=i.addedNodes;null!==e&&t(e).each((function(){t(this).find(".sppb-addon-sp-slider").each((function(){var i=t(this),e=i.data("id"),s=i.data("height-xl"),o=i.data("height-lg"),n=i.data("height-md"),a=i.data("height-sm"),r=i.data("height-xs"),d=i.data("slider-animation"),l=i.data("slide-vertically"),c=i.data("3d-rotate"),m=i.data("autoplay"),p=i.data("loop"),h=i.data("pause-hover"),u=i.data("interval"),v=i.data("timer"),f=i.data("speed"),b=i.data("dot-control"),y=i.data("arrow-control"),g=i.data("indecator"),w=i.data("arrow-content"),x=i.data("dot-style");x="with_text"===x?".sp-slider-custom-dot-indecators":"";var k=i.data("slide-count"),_="",C="";if("icon_only"===w?(_='<i class="fa fa-angle-left" title="Previous" aria-hidden="true"></i>',C='<i class="fa fa-angle-right" title="Next" aria-hidden="true"></i>'):"long_arrow"===w?(_='<i class="fa fa-long-arrow-left" title="Previous" aria-hidden="true"></i>',C='<i class="fa fa-long-arrow-right" title="Next" aria-hidden="true"></i>'):"icon_with_text"===w?(_='<i class="fa fa-long-arrow-left" title="Previous" aria-hidden="true"></i> Prev',C='Next <i class="fa fa-long-arrow-right" title="Next" aria-hidden="true"></i>
vendor: 5,965 bytes, lines 36-183
36'):(_="Prev",C="Next"),i.jsSlider({autoplay:m,autoplay_stop_on_hover:h,loop:p,animations:d,vertical_mode:l,rotate:c,interval:u,indicator:v,speed:f,dots:b,dots_class:x,dot_indicator:g,nav:y,nav_text:[_,C],show_number:k,addon_id:e,responsive:[{viewport:1399.98,height:s},{viewport:1199.98,height:o},{viewport:991.98,height:n},{viewport:767.98,height:a},{viewport:575.98,height:r}]}),t(".sp-slider-custom-dot-indecators").length>0){var I=t(".sp-slider-custom-dot-indecators ul li"),$=I.outerWidth(!0),z=I.length,D=$*z;t(".sp-slider-custom-dot-indecators ul").css("width",D+"px"),t(".sp-slider-custom-dot-indecators").outerWidth(!0)<D&&t(".sp-slider-custom-dot-indecators").css("overflowX","scroll"),t(window).on("resize",(function(){var i=$*z;t(".sp-slider-custom-dot-indecators").outerWidth(!0)<i&&t(".sp-slider-custom-dot-indecators").css("overflowX","scroll")}))}}))}))}))})).observe(document.body,{childList:!0,subtree:!0})}))}(jQuery); 37} catch (e) { 38console.error('Error in file:/components/com_sppagebuilder/assets/js/js_slider.js; Error:' + e.message); 39}; 40try { 41/*! jQuery UI - v1.12.0 - 2016-07-08 42* http://jqueryui.com 43* 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-1-7.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 44* Copyright jQuery Foundation and other contributors; Licensed MIT */ 45 46(function( factory ) { 47 if ( typeof define === "function" && define.amd ) { 48 49 // AMD. Register as an anonymous module. 50 define([ "jquery" ], factory ); 51 } else { 52 53 // Browser globals 54 factory( jQuery ); 55 } 56}(function( $ ) { 57 58$.ui = $.ui || {}; 59 60var version = $.ui.version = "1.12.0"; 61 62 63/*! 64 * jQuery UI Widget 1.12.0 65 * http://jqueryui.com 66 * 67 * Copyright jQuery Foundation and other contributors 68 * Released under the MIT license. 69 * http://jquery.org/license 70 */ 71 72//>>label: Widget 73//>>group: Core 74//>>description: Provides a factory for creating stateful widgets with a common API. 75//>>docs: http://api.jqueryui.com/jQuery.widget/ 76//>>demos: http://jqueryui.com/widget/ 77 78 79 80var widgetUuid = 0; 81var widgetSlice = Array.prototype.slice; 82 83$.cleanData = ( function( orig ) { 84 return function( elems ) { 85 var events, elem, i; 86 for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { 87 try { 88 89 // Only trigger remove when necessary to save time 90 events = $._data( elem, "events" ); 91 if ( events && events.remove ) { 92 $( elem ).triggerHandler( "remove" ); 93 } 94 95 // Http://bugs.jquery.com/ticket/8235 96 } catch ( e ) {} 97 } 98 orig( elems ); 99 }; 100} )( $.cleanData ); 101 102$.widget = function( name, base, prototype ) { 103 var existingConstructor, constructor, basePrototype; 104 105 // ProxiedPrototype allows the provided prototype to remain unmodified 106 // so that it can be used as a mixin for multiple widgets (#8876) 107 var proxiedPrototype = {}; 108 109 var namespace = name.split( "." )[ 0 ]; 110 name = name.split( "." )[ 1 ]; 111 var fullName = namespace + "-" + name; 112 113 if ( !prototype ) { 114 prototype = base; 115 base = $.Widget; 116 } 117 118 if ( $.isArray( prototype ) ) { 119 prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); 120 } 121 122 // Create selector for plugin 123 $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { 124 return !!$.data( elem, fullName ); 125 }; 126 127 $[ namespace ] = $[ namespace ] || {}; 128 existingConstructor = $[ namespace ][ name ]; 129 constructor = $[ namespace ][ name ] = function( options, element ) { 130 131 // Allow instantiation without "new" keyword 132 if ( !this._createWidget ) { 133 return new constructor( options, element ); 134 } 135 136 // Allow instantiation without initializing for simple inheritance 137 // must use "new" keyword (the code above always passes args) 138 if ( arguments.length ) { 139 this._createWidget( options, element ); 140 } 141 }; 142 143 // Extend with the existing constructor to carry over any static properties 144 $.extend( constructor, existingConstructor, { 145 version: prototype.version, 146 147 // Copy the object used to create the prototype in case we need to 148 // redefine the widget later 149 _proto: $.extend( {}, prototype ), 150 151 // Track widgets that inherit from this widget in case this widget is 152 // redefined after a widget inherits from it 153 _childConstructors: [] 154 } ); 155 156 basePrototype = new base(); 157 158 // We need to make the options hash a property directly on the new instance 159 // otherwise we'll modify the options hash on the prototype that we're 160 // inheriting from 161 basePrototype.options = $.widget.extend( {}, basePrototype.options ); 162 $.each( prototype, function( prop, value ) { 163 if ( !$.isFunction( value ) ) { 164 proxiedPrototype[ prop ] = value; 165 return; 166 } 167 proxiedPrototype[ prop ] = ( function() { 168 function _super() { 169 return base.prototype[ prop ].apply( this, arguments ); 170 } 171 172 function _superApply( args ) { 173 return base.prototype[ prop ].apply( this, args ); 174 } 175 176 return function() { 177 var __super = this._super; 178 var __superApply = this._superApply; 179 var returnValue; 180 181 this._super = _super; 182 this._superApply = _superApply; 183
vendor: 5,050 bytes, lines 184-363
184 returnValue = value.apply( this, arguments ); 185 186 this._super = __super; 187 this._superApply = __superApply; 188 189 return returnValue; 190 }; 191 } )(); 192 } ); 193 constructor.prototype = $.widget.extend( basePrototype, { 194 195 // TODO: remove support for widgetEventPrefix 196 // always use the name + a colon as the prefix, e.g., draggable:start 197 // don't prefix for widgets that aren't DOM-based 198 widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name 199 }, proxiedPrototype, { 200 constructor: constructor, 201 namespace: namespace, 202 widgetName: name, 203 widgetFullName: fullName 204 } ); 205 206 // If this widget is being redefined then we need to find all widgets that 207 // are inheriting from it and redefine all of them so that they inherit from 208 // the new version of this widget. We're essentially trying to replace one 209 // level in the prototype chain. 210 if ( existingConstructor ) { 211 $.each( existingConstructor._childConstructors, function( i, child ) { 212 var childPrototype = child.prototype; 213 214 // Redefine the child widget using the same prototype that was 215 // originally used, but inherit from the new version of the base 216 $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, 217 child._proto ); 218 } ); 219 220 // Remove the list of existing child constructors from the old constructor 221 // so the old child constructors can be garbage collected 222 delete existingConstructor._childConstructors; 223 } else { 224 base._childConstructors.push( constructor ); 225 } 226 227 $.widget.bridge( name, constructor ); 228 229 return constructor; 230}; 231 232$.widget.extend = function( target ) { 233 var input = widgetSlice.call( arguments, 1 ); 234 var inputIndex = 0; 235 var inputLength = input.length; 236 var key; 237 var value; 238 239 for ( ; inputIndex < inputLength; inputIndex++ ) { 240 for ( key in input[ inputIndex ] ) { 241 value = input[ inputIndex ][ key ]; 242 if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { 243 244 // Clone objects 245 if ( $.isPlainObject( value ) ) { 246 target[ key ] = $.isPlainObject( target[ key ] ) ? 247 $.widget.extend( {}, target[ key ], value ) : 248 249 // Don't extend strings, arrays, etc. with objects 250 $.widget.extend( {}, value ); 251 252 // Copy everything else by reference 253 } else { 254 target[ key ] = value; 255 } 256 } 257 } 258 } 259 return target; 260}; 261 262$.widget.bridge = function( name, object ) { 263 var fullName = object.prototype.widgetFullName || name; 264 $.fn[ name ] = function( options ) { 265 var isMethodCall = typeof options === "string"; 266 var args = widgetSlice.call( arguments, 1 ); 267 var returnValue = this; 268 269 if ( isMethodCall ) { 270 this.each( function() { 271 var methodValue; 272 var instance = $.data( this, fullName ); 273 274 if ( options === "instance" ) { 275 returnValue = instance; 276 return false; 277 } 278 279 if ( !instance ) { 280 return $.error( "cannot call methods on " + name + 281 " prior to initialization; " + 282 "attempted to call method '" + options + "'" ); 283 } 284 285 if ( !$.isFunction( instance[ options ] ) || options.charAt( 0 ) === "_" ) { 286 return $.error( "no such method '" + options + "' for " + name + 287 " widget instance" ); 288 } 289 290 methodValue = instance[ options ].apply( instance, args ); 291 292 if ( methodValue !== instance && methodValue !== undefined ) { 293 returnValue = methodValue && methodValue.jquery ? 294 returnValue.pushStack( methodValue.get() ) : 295 methodValue; 296 return false; 297 } 298 } ); 299 } else { 300 301 // Allow multiple hashes to be passed on init 302 if ( args.length ) { 303 options = $.widget.extend.apply( null, [ options ].concat( args ) ); 304 } 305 306 this.each( function() { 307 var instance = $.data( this, fullName ); 308 if ( instance ) { 309 instance.option( options || {} ); 310 if ( instance._init ) { 311 instance._init(); 312 } 313 } else { 314 $.data( this, fullName, new object( options, this ) ); 315 } 316 } ); 317 } 318 319 return returnValue; 320 }; 321}; 322 323$.Widget = function( /* options, element */ ) {}; 324$.Widget._childConstructors = []; 325 326$.Widget.prototype = { 327 widgetName: "widget", 328 widgetEventPrefix: "", 329 defaultElement: "<div>", 330 331 options: { 332 classes: {}, 333 disabled: false, 334 335 // Callbacks 336 create: null 337 }, 338 339 _createWidget: function( options, element ) { 340 element = $( element || this.defaultElement || this )[ 0 ]; 341 this.element = $( element ); 342 this.uuid = widgetUuid++; 343 this.eventNamespace = "." + this.widgetName + this.uuid; 344 345 this.bindings = $(); 346 this.hoverable = $(); 347 this.focusable = $(); 348 this.classesElementLookup = {}; 349 350 if ( element !== this ) { 351 $.data( element, this.widgetFullName, this ); 352 this._on( true, this.element, { 353 remove: function( event ) { 354 if ( event.target === element ) { 355 this.destroy(); 356 } 357 } 358 } ); 359 this.document = $( element.style ? 360 361 // Element within the document 362 element.ownerDocument : 363
vendor: 10,819 bytes, lines 364-749
364 // Element is window or document 365 element.document || element ); 366 this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); 367 } 368 369 this.options = $.widget.extend( {}, 370 this.options, 371 this._getCreateOptions(), 372 options ); 373 374 this._create(); 375 376 if ( this.options.disabled ) { 377 this._setOptionDisabled( this.options.disabled ); 378 } 379 380 this._trigger( "create", null, this._getCreateEventData() ); 381 this._init(); 382 }, 383 384 _getCreateOptions: function() { 385 return {}; 386 }, 387 388 _getCreateEventData: $.noop, 389 390 _create: $.noop, 391 392 _init: $.noop, 393 394 destroy: function() { 395 var that = this; 396 397 this._destroy(); 398 $.each( this.classesElementLookup, function( key, value ) { 399 that._removeClass( value, key ); 400 } ); 401 402 // We can probably remove the unbind calls in 2.0 403 // all event bindings should go through this._on() 404 this.element 405 .off( this.eventNamespace ) 406 .removeData( this.widgetFullName ); 407 this.widget() 408 .off( this.eventNamespace ) 409 .removeAttr( "aria-disabled" ); 410 411 // Clean up events and states 412 this.bindings.off( this.eventNamespace ); 413 }, 414 415 _destroy: $.noop, 416 417 widget: function() { 418 return this.element; 419 }, 420 421 option: function( key, value ) { 422 var options = key; 423 var parts; 424 var curOption; 425 var i; 426 427 if ( arguments.length === 0 ) { 428 429 // Don't return a reference to the internal hash 430 return $.widget.extend( {}, this.options ); 431 } 432 433 if ( typeof key === "string" ) { 434 435 // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } 436 options = {}; 437 parts = key.split( "." ); 438 key = parts.shift(); 439 if ( parts.length ) { 440 curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); 441 for ( i = 0; i < parts.length - 1; i++ ) { 442 curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; 443 curOption = curOption[ parts[ i ] ]; 444 } 445 key = parts.pop(); 446 if ( arguments.length === 1 ) { 447 return curOption[ key ] === undefined ? null : curOption[ key ]; 448 } 449 curOption[ key ] = value; 450 } else { 451 if ( arguments.length === 1 ) { 452 return this.options[ key ] === undefined ? null : this.options[ key ]; 453 } 454 options[ key ] = value; 455 } 456 } 457 458 this._setOptions( options ); 459 460 return this; 461 }, 462 463 _setOptions: function( options ) { 464 var key; 465 466 for ( key in options ) { 467 this._setOption( key, options[ key ] ); 468 } 469 470 return this; 471 }, 472 473 _setOption: function( key, value ) { 474 if ( key === "classes" ) { 475 this._setOptionClasses( value ); 476 } 477 478 this.options[ key ] = value; 479 480 if ( key === "disabled" ) { 481 this._setOptionDisabled( value ); 482 } 483 484 return this; 485 }, 486 487 _setOptionClasses: function( value ) { 488 var classKey, elements, currentElements; 489 490 for ( classKey in value ) { 491 currentElements = this.classesElementLookup[ classKey ]; 492 if ( value[ classKey ] === this.options.classes[ classKey ] || 493 !currentElements || 494 !currentElements.length ) { 495 continue; 496 } 497 498 // We are doing this to create a new jQuery object because the _removeClass() call 499 // on the next line is going to destroy the reference to the current elements being 500 // tracked. We need to save a copy of this collection so that we can add the new classes 501 // below. 502 elements = $( currentElements.get() ); 503 this._removeClass( currentElements, classKey ); 504 505 // We don't use _addClass() here, because that uses this.options.classes 506 // for generating the string of classes. We want to use the value passed in from 507 // _setOption(), this is the new value of the classes option which was passed to 508 // _setOption(). We pass this value directly to _classes(). 509 elements.addClass( this._classes( { 510 element: elements, 511 keys: classKey, 512 classes: value, 513 add: true 514 } ) ); 515 } 516 }, 517 518 _setOptionDisabled: function( value ) { 519 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); 520 521 // If the widget is becoming disabled, then nothing is interactive 522 if ( value ) { 523 this._removeClass( this.hoverable, null, "ui-state-hover" ); 524 this._removeClass( this.focusable, null, "ui-state-focus" ); 525 } 526 }, 527 528 enable: function() { 529 return this._setOptions( { disabled: false } ); 530 }, 531 532 disable: function() { 533 return this._setOptions( { disabled: true } ); 534 }, 535 536 _classes: function( options ) { 537 var full = []; 538 var that = this; 539 540 options = $.extend( { 541 element: this.element, 542 classes: this.options.classes || {} 543 }, options ); 544 545 function processClassString( classes, checkOption ) { 546 var current, i; 547 for ( i = 0; i < classes.length; i++ ) { 548 current = that.classesElementLookup[ classes[ i ] ] || $(); 549 if ( options.add ) { 550 current = $( $.unique( current.get().concat( options.element.get() ) ) ); 551 } else { 552 current = $( current.not( options.element ).get() ); 553 } 554 that.classesElementLookup[ classes[ i ] ] = current; 555 full.push( classes[ i ] ); 556 if ( checkOption && options.classes[ classes[ i ] ] ) { 557 full.push( options.classes[ classes[ i ] ] ); 558 } 559 } 560 } 561 562 if ( options.keys ) { 563 processClassString( options.keys.match( /\S+/g ) || [], true ); 564 } 565 if ( options.extra ) { 566 processClassString( options.extra.match( /\S+/g ) || [] ); 567 } 568 569 return full.join( " " ); 570 }, 571 572 _removeClass: function( element, keys, extra ) { 573 return this._toggleClass( element, keys, extra, false ); 574 }, 575 576 _addClass: function( element, keys, extra ) { 577 return this._toggleClass( element, keys, extra, true ); 578 }, 579 580 _toggleClass: function( element, keys, extra, add ) { 581 add = ( typeof add === "boolean" ) ? add : extra; 582 var shift = ( typeof element === "string" || element === null ), 583 options = { 584 extra: shift ? keys : extra, 585 keys: shift ? element : keys, 586 element: shift ? this.element : element, 587 add: add 588 }; 589 options.element.toggleClass( this._classes( options ), add ); 590 return this; 591 }, 592 593 _on: function( suppressDisabledCheck, element, handlers ) { 594 var delegateElement; 595 var instance = this; 596 597 // No suppressDisabledCheck flag, shuffle arguments 598 if ( typeof suppressDisabledCheck !== "boolean" ) { 599 handlers = element; 600 element = suppressDisabledCheck; 601 suppressDisabledCheck = false; 602 } 603 604 // No element argument, shuffle and use this.element 605 if ( !handlers ) { 606 handlers = element; 607 element = this.element; 608 delegateElement = this.widget(); 609 } else { 610 element = delegateElement = $( element ); 611 this.bindings = this.bindings.add( element ); 612 } 613 614 $.each( handlers, function( event, handler ) { 615 function handlerProxy() { 616 617 // Allow widgets to customize the disabled handling 618 // - disabled as an array instead of boolean 619 // - disabled class as method for disabling individual parts 620 if ( !suppressDisabledCheck && 621 ( instance.options.disabled === true || 622 $( this ).hasClass( "ui-state-disabled" ) ) ) { 623 return; 624 } 625 return ( typeof handler === "string" ? instance[ handler ] : handler ) 626 .apply( instance, arguments ); 627 } 628 629 // Copy the guid so direct unbinding works 630 if ( typeof handler !== "string" ) { 631 handlerProxy.guid = handler.guid = 632 handler.guid || handlerProxy.guid || $.guid++; 633 } 634 635 var match = event.match( /^([\w:-]*)\s*(.*)$/ ); 636 var eventName = match[ 1 ] + instance.eventNamespace; 637 var selector = match[ 2 ]; 638 639 if ( selector ) { 640 delegateElement.on( eventName, selector, handlerProxy ); 641 } else { 642 element.on( eventName, handlerProxy ); 643 } 644 } ); 645 }, 646 647 _off: function( element, eventName ) { 648 eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + 649 this.eventNamespace; 650 element.off( eventName ).off( eventName ); 651 652 // Clear the stack to avoid memory leaks (#10056) 653 this.bindings = $( this.bindings.not( element ).get() ); 654 this.focusable = $( this.focusable.not( element ).get() ); 655 this.hoverable = $( this.hoverable.not( element ).get() ); 656 }, 657 658 _delay: function( handler, delay ) { 659 function handlerProxy() { 660 return ( typeof handler === "string" ? instance[ handler ] : handler ) 661 .apply( instance, arguments ); 662 } 663 var instance = this; 664 return setTimeout( handlerProxy, delay || 0 ); 665 }, 666 667 _hoverable: function( element ) { 668 this.hoverable = this.hoverable.add( element ); 669 this._on( element, { 670 mouseenter: function( event ) { 671 this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); 672 }, 673 mouseleave: function( event ) { 674 this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); 675 } 676 } ); 677 }, 678 679 _focusable: function( element ) { 680 this.focusable = this.focusable.add( element ); 681 this._on( element, { 682 focusin: function( event ) { 683 this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); 684 }, 685 focusout: function( event ) { 686 this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); 687 } 688 } ); 689 }, 690 691 _trigger: function( type, event, data ) { 692 var prop, orig; 693 var callback = this.options[ type ]; 694 695 data = data || {}; 696 event = $.Event( event ); 697 event.type = ( type === this.widgetEventPrefix ? 698 type : 699 this.widgetEventPrefix + type ).toLowerCase(); 700 701 // The original event may come from any element 702 // so we need to reset the target on the new event 703 event.target = this.element[ 0 ]; 704 705 // Copy original event properties over to the new event 706 orig = event.originalEvent; 707 if ( orig ) { 708 for ( prop in orig ) { 709 if ( !( prop in event ) ) { 710 event[ prop ] = orig[ prop ]; 711 } 712 } 713 } 714 715 this.element.trigger( event, data ); 716 return !( $.isFunction( callback ) && 717 callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || 718 event.isDefaultPrevented() ); 719 } 720}; 721 722$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { 723 $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { 724 if ( typeof options === "string" ) { 725 options = { effect: options }; 726 } 727 728 var hasOptions; 729 var effectName = !options ? 730 method : 731 options === true || typeof options === "number" ? 732 defaultEffect : 733 options.effect || defaultEffect; 734 735 options = options || {}; 736 if ( typeof options === "number" ) { 737 options = { duration: options }; 738 } 739 740 hasOptions = !$.isEmptyObject( options ); 741 options.complete = callback; 742 743 if ( options.delay ) { 744 element.delay( options.delay ); 745 } 746 747 if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { 748 element[ method ]( options ); 749 } else if ( effectName !== method && element[ effectName ] ) {
vendor: 5,394 bytes, lines 750-950
750 element[ effectName ]( options.duration, options.easing, callback ); 751 } else { 752 element.queue( function( next ) { 753 $( this )[ method ](); 754 if ( callback ) { 755 callback.call( element[ 0 ] ); 756 } 757 next(); 758 } ); 759 } 760 }; 761} ); 762 763var widget = $.widget; 764 765 766/*! 767 * jQuery UI Position 1.12.0 768 * http://jqueryui.com 769 * 770 * Copyright jQuery Foundation and other contributors 771 * Released under the MIT license. 772 * http://jquery.org/license 773 * 774 * http://api.jqueryui.com/position/ 775 */ 776 777//>>label: Position 778//>>group: Core 779//>>description: Positions elements relative to other elements. 780//>>docs: http://api.jqueryui.com/position/ 781//>>demos: http://jqueryui.com/position/ 782 783 784( function() { 785var cachedScrollbarWidth, supportsOffsetFractions, 786 max = Math.max, 787 abs = Math.abs, 788 round = Math.round, 789 rhorizontal = /left|center|right/, 790 rvertical = /top|center|bottom/, 791 roffset = /[\+\-]\d+(\.[\d]+)?%?/, 792 rposition = /^\w+/, 793 rpercent = /%$/, 794 _position = $.fn.position; 795 796// Support: IE <=9 only 797supportsOffsetFractions = function() { 798 var element = $( "<div>" ) 799 .css( "position", "absolute" ) 800 .appendTo( "body" ) 801 .offset( { 802 top: 1.5, 803 left: 1.5 804 } ), 805 support = element.offset().top === 1.5; 806 807 element.remove(); 808 809 supportsOffsetFractions = function() { 810 return support; 811 }; 812 813 return support; 814}; 815 816function getOffsets( offsets, width, height ) { 817 return [ 818 parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), 819 parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) 820 ]; 821} 822 823function parseCss( element, property ) { 824 return parseInt( $.css( element, property ), 10 ) || 0; 825} 826 827function getDimensions( elem ) { 828 var raw = elem[ 0 ]; 829 if ( raw.nodeType === 9 ) { 830 return { 831 width: elem.width(), 832 height: elem.height(), 833 offset: { top: 0, left: 0 } 834 }; 835 } 836 if ( $.isWindow( raw ) ) { 837 return { 838 width: elem.width(), 839 height: elem.height(), 840 offset: { top: elem.scrollTop(), left: elem.scrollLeft() } 841 }; 842 } 843 if ( raw.preventDefault ) { 844 return { 845 width: 0, 846 height: 0, 847 offset: { top: raw.pageY, left: raw.pageX } 848 }; 849 } 850 return { 851 width: elem.outerWidth(), 852 height: elem.outerHeight(), 853 offset: elem.offset() 854 }; 855} 856 857$.position = { 858 scrollbarWidth: function() { 859 if ( cachedScrollbarWidth !== undefined ) { 860 return cachedScrollbarWidth; 861 } 862 var w1, w2, 863 div = $( "<div " + 864 "style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'>" + 865 "<div style='height:100px;width:auto;'></div></div>" ), 866 innerDiv = div.children()[ 0 ]; 867 868 $( "body" ).append( div ); 869 w1 = innerDiv.offsetWidth; 870 div.css( "overflow", "scroll" ); 871 872 w2 = innerDiv.offsetWidth; 873 874 if ( w1 === w2 ) { 875 w2 = div[ 0 ].clientWidth; 876 } 877 878 div.remove(); 879 880 return ( cachedScrollbarWidth = w1 - w2 ); 881 }, 882 getScrollInfo: function( within ) { 883 var overflowX = within.isWindow || within.isDocument ? "" : 884 within.element.css( "overflow-x" ), 885 overflowY = within.isWindow || within.isDocument ? "" : 886 within.element.css( "overflow-y" ), 887 hasOverflowX = overflowX === "scroll" || 888 ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), 889 hasOverflowY = overflowY === "scroll" || 890 ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); 891 return { 892 width: hasOverflowY ? $.position.scrollbarWidth() : 0, 893 height: hasOverflowX ? $.position.scrollbarWidth() : 0 894 }; 895 }, 896 getWithinInfo: function( element ) { 897 var withinElement = $( element || window ), 898 isWindow = $.isWindow( withinElement[ 0 ] ), 899 isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, 900 hasOffset = !isWindow && !isDocument; 901 return { 902 element: withinElement, 903 isWindow: isWindow, 904 isDocument: isDocument, 905 offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, 906 scrollLeft: withinElement.scrollLeft(), 907 scrollTop: withinElement.scrollTop(), 908 width: withinElement.outerWidth(), 909 height: withinElement.outerHeight() 910 }; 911 } 912}; 913 914$.fn.position = function( options ) { 915 if ( !options || !options.of ) { 916 return _position.apply( this, arguments ); 917 } 918 919 // Make a copy, we don't want to modify arguments 920 options = $.extend( {}, options ); 921 922 var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, 923 target = $( options.of ), 924 within = $.position.getWithinInfo( options.within ), 925 scrollInfo = $.position.getScrollInfo( within ), 926 collision = ( options.collision || "flip" ).split( " " ), 927 offsets = {}; 928 929 dimensions = getDimensions( target ); 930 if ( target[ 0 ].preventDefault ) { 931 932 // Force left top to allow flipping 933 options.at = "left top"; 934 } 935 targetWidth = dimensions.width; 936 targetHeight = dimensions.height; 937 targetOffset = dimensions.offset; 938 939 // Clone to reuse original targetOffset later 940 basePosition = $.extend( {}, targetOffset ); 941 942 // Force my and at to have valid horizontal and vertical positions 943 // if a value is missing or invalid, it will be converted to center 944 $.each( [ "my", "at" ], function() { 945 var pos = ( options[ this ] || "" ).split( " " ), 946 horizontalOffset, 947 verticalOffset; 948 949 if ( pos.length === 1 ) { 950 pos = rhorizontal.test( pos[ 0 ] ) ?
vendor: 4,528 bytes, lines 951-1097
951 pos.concat( [ "center" ] ) : 952 rvertical.test( pos[ 0 ] ) ? 953 [ "center" ].concat( pos ) : 954 [ "center", "center" ]; 955 } 956 pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; 957 pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; 958 959 // Calculate offsets 960 horizontalOffset = roffset.exec( pos[ 0 ] ); 961 verticalOffset = roffset.exec( pos[ 1 ] ); 962 offsets[ this ] = [ 963 horizontalOffset ? horizontalOffset[ 0 ] : 0, 964 verticalOffset ? verticalOffset[ 0 ] : 0 965 ]; 966 967 // Reduce to just the positions without the offsets 968 options[ this ] = [ 969 rposition.exec( pos[ 0 ] )[ 0 ], 970 rposition.exec( pos[ 1 ] )[ 0 ] 971 ]; 972 } ); 973 974 // Normalize collision option 975 if ( collision.length === 1 ) { 976 collision[ 1 ] = collision[ 0 ]; 977 } 978 979 if ( options.at[ 0 ] === "right" ) { 980 basePosition.left += targetWidth; 981 } else if ( options.at[ 0 ] === "center" ) { 982 basePosition.left += targetWidth / 2; 983 } 984 985 if ( options.at[ 1 ] === "bottom" ) { 986 basePosition.top += targetHeight; 987 } else if ( options.at[ 1 ] === "center" ) { 988 basePosition.top += targetHeight / 2; 989 } 990 991 atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); 992 basePosition.left += atOffset[ 0 ]; 993 basePosition.top += atOffset[ 1 ]; 994 995 return this.each( function() { 996 var collisionPosition, using, 997 elem = $( this ), 998 elemWidth = elem.outerWidth(), 999 elemHeight = elem.outerHeight(), 1000 marginLeft = parseCss( this, "marginLeft" ), 1001 marginTop = parseCss( this, "marginTop" ), 1002 collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + 1003 scrollInfo.width, 1004 collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + 1005 scrollInfo.height, 1006 position = $.extend( {}, basePosition ), 1007 myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); 1008 1009 if ( options.my[ 0 ] === "right" ) { 1010 position.left -= elemWidth; 1011 } else if ( options.my[ 0 ] === "center" ) { 1012 position.left -= elemWidth / 2; 1013 } 1014 1015 if ( options.my[ 1 ] === "bottom" ) { 1016 position.top -= elemHeight; 1017 } else if ( options.my[ 1 ] === "center" ) { 1018 position.top -= elemHeight / 2; 1019 } 1020 1021 position.left += myOffset[ 0 ]; 1022 position.top += myOffset[ 1 ]; 1023 1024 // If the browser doesn't support fractions, then round for consistent results 1025 if ( !supportsOffsetFractions() ) { 1026 position.left = round( position.left ); 1027 position.top = round( position.top ); 1028 } 1029 1030 collisionPosition = { 1031 marginLeft: marginLeft, 1032 marginTop: marginTop 1033 }; 1034 1035 $.each( [ "left", "top" ], function( i, dir ) { 1036 if ( $.ui.position[ collision[ i ] ] ) { 1037 $.ui.position[ collision[ i ] ][ dir ]( position, { 1038 targetWidth: targetWidth, 1039 targetHeight: targetHeight, 1040 elemWidth: elemWidth, 1041 elemHeight: elemHeight, 1042 collisionPosition: collisionPosition, 1043 collisionWidth: collisionWidth, 1044 collisionHeight: collisionHeight, 1045 offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], 1046 my: options.my, 1047 at: options.at, 1048 within: within, 1049 elem: elem 1050 } ); 1051 } 1052 } ); 1053 1054 if ( options.using ) { 1055 1056 // Adds feedback as second argument to using callback, if present 1057 using = function( props ) { 1058 var left = targetOffset.left - position.left, 1059 right = left + targetWidth - elemWidth, 1060 top = targetOffset.top - position.top, 1061 bottom = top + targetHeight - elemHeight, 1062 feedback = { 1063 target: { 1064 element: target, 1065 left: targetOffset.left, 1066 top: targetOffset.top, 1067 width: targetWidth, 1068 height: targetHeight 1069 }, 1070 element: { 1071 element: elem, 1072 left: position.left, 1073 top: position.top, 1074 width: elemWidth, 1075 height: elemHeight 1076 }, 1077 horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", 1078 vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" 1079 }; 1080 if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { 1081 feedback.horizontal = "center"; 1082 } 1083 if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { 1084 feedback.vertical = "middle"; 1085 } 1086 if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { 1087 feedback.important = "horizontal"; 1088 } else { 1089 feedback.important = "vertical"; 1090 } 1091 options.using.call( this, props, feedback ); 1092 }; 1093 } 1094 1095 elem.offset( $.extend( position, { using: using } ) ); 1096 } ); 1097};
vendor: 6,169 bytes, lines 1098-1283
1098 1099$.ui.position = { 1100 fit: { 1101 left: function( position, data ) { 1102 var within = data.within, 1103 withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, 1104 outerWidth = within.width, 1105 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1106 overLeft = withinOffset - collisionPosLeft, 1107 overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, 1108 newOverRight; 1109 1110 // Element is wider than within 1111 if ( data.collisionWidth > outerWidth ) { 1112 1113 // Element is initially over the left side of within 1114 if ( overLeft > 0 && overRight <= 0 ) { 1115 newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - 1116 withinOffset; 1117 position.left += overLeft - newOverRight; 1118 1119 // Element is initially over right side of within 1120 } else if ( overRight > 0 && overLeft <= 0 ) { 1121 position.left = withinOffset; 1122 1123 // Element is initially over both left and right sides of within 1124 } else { 1125 if ( overLeft > overRight ) { 1126 position.left = withinOffset + outerWidth - data.collisionWidth; 1127 } else { 1128 position.left = withinOffset; 1129 } 1130 } 1131 1132 // Too far left -> align with left edge 1133 } else if ( overLeft > 0 ) { 1134 position.left += overLeft; 1135 1136 // Too far right -> align with right edge 1137 } else if ( overRight > 0 ) { 1138 position.left -= overRight; 1139 1140 // Adjust based on position and margin 1141 } else { 1142 position.left = max( position.left - collisionPosLeft, position.left ); 1143 } 1144 }, 1145 top: function( position, data ) { 1146 var within = data.within, 1147 withinOffset = within.isWindow ? within.scrollTop : within.offset.top, 1148 outerHeight = data.within.height, 1149 collisionPosTop = position.top - data.collisionPosition.marginTop, 1150 overTop = withinOffset - collisionPosTop, 1151 overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, 1152 newOverBottom; 1153 1154 // Element is taller than within 1155 if ( data.collisionHeight > outerHeight ) { 1156 1157 // Element is initially over the top of within 1158 if ( overTop > 0 && overBottom <= 0 ) { 1159 newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - 1160 withinOffset; 1161 position.top += overTop - newOverBottom; 1162 1163 // Element is initially over bottom of within 1164 } else if ( overBottom > 0 && overTop <= 0 ) { 1165 position.top = withinOffset; 1166 1167 // Element is initially over both top and bottom of within 1168 } else { 1169 if ( overTop > overBottom ) { 1170 position.top = withinOffset + outerHeight - data.collisionHeight; 1171 } else { 1172 position.top = withinOffset; 1173 } 1174 } 1175 1176 // Too far up -> align with top 1177 } else if ( overTop > 0 ) { 1178 position.top += overTop; 1179 1180 // Too far down -> align with bottom edge 1181 } else if ( overBottom > 0 ) { 1182 position.top -= overBottom; 1183 1184 // Adjust based on position and margin 1185 } else { 1186 position.top = max( position.top - collisionPosTop, position.top ); 1187 } 1188 } 1189 }, 1190 flip: { 1191 left: function( position, data ) { 1192 var within = data.within, 1193 withinOffset = within.offset.left + within.scrollLeft, 1194 outerWidth = within.width, 1195 offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, 1196 collisionPosLeft = position.left - data.collisionPosition.marginLeft, 1197 overLeft = collisionPosLeft - offsetLeft, 1198 overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, 1199 myOffset = data.my[ 0 ] === "left" ? 1200 -data.elemWidth : 1201 data.my[ 0 ] === "right" ? 1202 data.elemWidth : 1203 0, 1204 atOffset = data.at[ 0 ] === "left" ? 1205 data.targetWidth : 1206 data.at[ 0 ] === "right" ? 1207 -data.targetWidth : 1208 0, 1209 offset = -2 * data.offset[ 0 ], 1210 newOverRight, 1211 newOverLeft; 1212 1213 if ( overLeft < 0 ) { 1214 newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - 1215 outerWidth - withinOffset; 1216 if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { 1217 position.left += myOffset + atOffset + offset; 1218 } 1219 } else if ( overRight > 0 ) { 1220 newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + 1221 atOffset + offset - offsetLeft; 1222 if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { 1223 position.left += myOffset + atOffset + offset; 1224 } 1225 } 1226 }, 1227 top: function( position, data ) { 1228 var within = data.within, 1229 withinOffset = within.offset.top + within.scrollTop, 1230 outerHeight = within.height, 1231 offsetTop = within.isWindow ? within.scrollTop : within.offset.top, 1232 collisionPosTop = position.top - data.collisionPosition.marginTop, 1233 overTop = collisionPosTop - offsetTop, 1234 overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, 1235 top = data.my[ 1 ] === "top", 1236 myOffset = top ? 1237 -data.elemHeight : 1238 data.my[ 1 ] === "bottom" ? 1239 data.elemHeight : 1240 0, 1241 atOffset = data.at[ 1 ] === "top" ? 1242 data.targetHeight : 1243 data.at[ 1 ] === "bottom" ? 1244 -data.targetHeight : 1245 0, 1246 offset = -2 * data.offset[ 1 ], 1247 newOverTop, 1248 newOverBottom; 1249 if ( overTop < 0 ) { 1250 newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - 1251 outerHeight - withinOffset; 1252 if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { 1253 position.top += myOffset + atOffset + offset; 1254 } 1255 } else if ( overBottom > 0 ) { 1256 newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + 1257 offset - offsetTop; 1258 if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { 1259 position.top += myOffset + atOffset + offset; 1260 } 1261 } 1262 } 1263 }, 1264 flipfit: { 1265 left: function() { 1266 $.ui.position.flip.left.apply( this, arguments ); 1267 $.ui.position.fit.left.apply( this, arguments ); 1268 }, 1269 top: function() { 1270 $.ui.position.flip.top.apply( this, arguments ); 1271 $.ui.position.fit.top.apply( this, arguments ); 1272 } 1273 } 1274}; 1275 1276} )(); 1277 1278var position = $.ui.position; 1279 1280 1281/*! 1282 * jQuery UI :data 1.12.0 1283 * http://jqueryui.com
vendor: 5,137 bytes, lines 1284-1489
1284 * 1285 * Copyright jQuery Foundation and other contributors 1286 * Released under the MIT license. 1287 * http://jquery.org/license 1288 */ 1289 1290//>>label: :data Selector 1291//>>group: Core 1292//>>description: Selects elements which have data stored under the specified key. 1293//>>docs: http://api.jqueryui.com/data-selector/ 1294 1295 1296var data = $.extend( $.expr[ ":" ], { 1297 data: $.expr.createPseudo ? 1298 $.expr.createPseudo( function( dataName ) { 1299 return function( elem ) { 1300 return !!$.data( elem, dataName ); 1301 }; 1302 } ) : 1303 1304 // Support: jQuery <1.8 1305 function( elem, i, match ) { 1306 return !!$.data( elem, match[ 3 ] ); 1307 } 1308} ); 1309 1310/*! 1311 * jQuery UI Disable Selection 1.12.0 1312 * http://jqueryui.com 1313 * 1314 * Copyright jQuery Foundation and other contributors 1315 * Released under the MIT license. 1316 * http://jquery.org/license 1317 */ 1318 1319//>>label: disableSelection 1320//>>group: Core 1321//>>description: Disable selection of text content within the set of matched elements. 1322//>>docs: http://api.jqueryui.com/disableSelection/ 1323 1324// This file is deprecated 1325 1326 1327var disableSelection = $.fn.extend( { 1328 disableSelection: ( function() { 1329 var eventType = "onselectstart" in document.createElement( "div" ) ? 1330 "selectstart" : 1331 "mousedown"; 1332 1333 return function() { 1334 return this.on( eventType + ".ui-disableSelection", function( event ) { 1335 event.preventDefault(); 1336 } ); 1337 }; 1338 } )(), 1339 1340 enableSelection: function() { 1341 return this.off( ".ui-disableSelection" ); 1342 } 1343} ); 1344 1345 1346/*! 1347 * jQuery UI Effects 1.12.0 1348 * http://jqueryui.com 1349 * 1350 * Copyright jQuery Foundation and other contributors 1351 * Released under the MIT license. 1352 * http://jquery.org/license 1353 */ 1354 1355//>>label: Effects Core 1356//>>group: Effects 1357// jscs:disable maximumLineLength 1358//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects. 1359// jscs:enable maximumLineLength 1360//>>docs: http://api.jqueryui.com/category/effects-core/ 1361//>>demos: http://jqueryui.com/effect/ 1362 1363 1364 1365var dataSpace = "ui-effects-", 1366 dataSpaceStyle = "ui-effects-style", 1367 dataSpaceAnimated = "ui-effects-animated", 1368 1369 // Create a local jQuery because jQuery Color relies on it and the 1370 // global may not exist with AMD and a custom build (#10199) 1371 jQuery = $; 1372 1373$.effects = { 1374 effect: {} 1375}; 1376 1377/*! 1378 * jQuery Color Animations v2.1.2 1379 * https://github.com/jquery/jquery-color 1380 * 1381 * Copyright 2014 jQuery Foundation and other contributors 1382 * Released under the MIT license. 1383 * http://jquery.org/license 1384 * 1385 * Date: Wed Jan 16 08:47:09 2013 -0600 1386 */ 1387( function( jQuery, undefined ) { 1388 1389 var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " + 1390 "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", 1391 1392 // Plusequals test for += 100 -= 100 1393 rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, 1394 1395 // A set of RE's that can match strings and generate color tuples. 1396 stringParsers = [ { 1397 re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1398 parse: function( execResult ) { 1399 return [ 1400 execResult[ 1 ], 1401 execResult[ 2 ], 1402 execResult[ 3 ], 1403 execResult[ 4 ] 1404 ]; 1405 } 1406 }, { 1407 re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1408 parse: function( execResult ) { 1409 return [ 1410 execResult[ 1 ] * 2.55, 1411 execResult[ 2 ] * 2.55, 1412 execResult[ 3 ] * 2.55, 1413 execResult[ 4 ] 1414 ]; 1415 } 1416 }, { 1417 1418 // This regex ignores A-F because it's compared against an already lowercased string 1419 re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, 1420 parse: function( execResult ) { 1421 return [ 1422 parseInt( execResult[ 1 ], 16 ), 1423 parseInt( execResult[ 2 ], 16 ), 1424 parseInt( execResult[ 3 ], 16 ) 1425 ]; 1426 } 1427 }, { 1428 1429 // This regex ignores A-F because it's compared against an already lowercased string 1430 re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, 1431 parse: function( execResult ) { 1432 return [ 1433 parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), 1434 parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), 1435 parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) 1436 ]; 1437 } 1438 }, { 1439 re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, 1440 space: "hsla", 1441 parse: function( execResult ) { 1442 return [ 1443 execResult[ 1 ], 1444 execResult[ 2 ] / 100, 1445 execResult[ 3 ] / 100, 1446 execResult[ 4 ] 1447 ]; 1448 } 1449 } ], 1450 1451 // JQuery.Color( ) 1452 color = jQuery.Color = function( color, green, blue, alpha ) { 1453 return new jQuery.Color.fn.parse( color, green, blue, alpha ); 1454 }, 1455 spaces = { 1456 rgba: { 1457 props: { 1458 red: { 1459 idx: 0, 1460 type: "byte" 1461 }, 1462 green: { 1463 idx: 1, 1464 type: "byte" 1465 }, 1466 blue: { 1467 idx: 2, 1468 type: "byte" 1469 } 1470 } 1471 }, 1472 1473 hsla: { 1474 props: { 1475 hue: { 1476 idx: 0, 1477 type: "degrees" 1478 }, 1479 saturation: { 1480 idx: 1, 1481 type: "percent" 1482 }, 1483 lightness: { 1484 idx: 2, 1485 type: "percent" 1486 } 1487 } 1488 } 1489 },
vendor: 18,301 bytes, lines 1490-2212
1490 propTypes = { 1491 "byte": { 1492 floor: true, 1493 max: 255 1494 }, 1495 "percent": { 1496 max: 1 1497 }, 1498 "degrees": { 1499 mod: 360, 1500 floor: true 1501 } 1502 }, 1503 support = color.support = {}, 1504 1505 // Element for support tests 1506 supportElem = jQuery( "<p>" )[ 0 ], 1507 1508 // Colors = jQuery.Color.names 1509 colors, 1510 1511 // Local aliases of functions called often 1512 each = jQuery.each; 1513 1514// Determine rgba support immediately 1515supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; 1516support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; 1517 1518// Define cache name and alpha properties 1519// for rgba and hsla spaces 1520each( spaces, function( spaceName, space ) { 1521 space.cache = "_" + spaceName; 1522 space.props.alpha = { 1523 idx: 3, 1524 type: "percent", 1525 def: 1 1526 }; 1527} ); 1528 1529function clamp( value, prop, allowEmpty ) { 1530 var type = propTypes[ prop.type ] || {}; 1531 1532 if ( value == null ) { 1533 return ( allowEmpty || !prop.def ) ? null : prop.def; 1534 } 1535 1536 // ~~ is an short way of doing floor for positive numbers 1537 value = type.floor ? ~~value : parseFloat( value ); 1538 1539 // IE will pass in empty strings as value for alpha, 1540 // which will hit this case 1541 if ( isNaN( value ) ) { 1542 return prop.def; 1543 } 1544 1545 if ( type.mod ) { 1546 1547 // We add mod before modding to make sure that negatives values 1548 // get converted properly: -10 -> 350 1549 return ( value + type.mod ) % type.mod; 1550 } 1551 1552 // For now all property types without mod have min and max 1553 return 0 > value ? 0 : type.max < value ? type.max : value; 1554} 1555 1556function stringParse( string ) { 1557 var inst = color(), 1558 rgba = inst._rgba = []; 1559 1560 string = string.toLowerCase(); 1561 1562 each( stringParsers, function( i, parser ) { 1563 var parsed, 1564 match = parser.re.exec( string ), 1565 values = match && parser.parse( match ), 1566 spaceName = parser.space || "rgba"; 1567 1568 if ( values ) { 1569 parsed = inst[ spaceName ]( values ); 1570 1571 // If this was an rgba parse the assignment might happen twice 1572 // oh well.... 1573 inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; 1574 rgba = inst._rgba = parsed._rgba; 1575 1576 // Exit each( stringParsers ) here because we matched 1577 return false; 1578 } 1579 } ); 1580 1581 // Found a stringParser that handled it 1582 if ( rgba.length ) { 1583 1584 // If this came from a parsed string, force "transparent" when alpha is 0 1585 // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) 1586 if ( rgba.join() === "0,0,0,0" ) { 1587 jQuery.extend( rgba, colors.transparent ); 1588 } 1589 return inst; 1590 } 1591 1592 // Named colors 1593 return colors[ string ]; 1594} 1595 1596color.fn = jQuery.extend( color.prototype, { 1597 parse: function( red, green, blue, alpha ) { 1598 if ( red === undefined ) { 1599 this._rgba = [ null, null, null, null ]; 1600 return this; 1601 } 1602 if ( red.jquery || red.nodeType ) { 1603 red = jQuery( red ).css( green ); 1604 green = undefined; 1605 } 1606 1607 var inst = this, 1608 type = jQuery.type( red ), 1609 rgba = this._rgba = []; 1610 1611 // More than 1 argument specified - assume ( red, green, blue, alpha ) 1612 if ( green !== undefined ) { 1613 red = [ red, green, blue, alpha ]; 1614 type = "array"; 1615 } 1616 1617 if ( type === "string" ) { 1618 return this.parse( stringParse( red ) || colors._default ); 1619 } 1620 1621 if ( type === "array" ) { 1622 each( spaces.rgba.props, function( key, prop ) { 1623 rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); 1624 } ); 1625 return this; 1626 } 1627 1628 if ( type === "object" ) { 1629 if ( red instanceof color ) { 1630 each( spaces, function( spaceName, space ) { 1631 if ( red[ space.cache ] ) { 1632 inst[ space.cache ] = red[ space.cache ].slice(); 1633 } 1634 } ); 1635 } else { 1636 each( spaces, function( spaceName, space ) { 1637 var cache = space.cache; 1638 each( space.props, function( key, prop ) { 1639 1640 // If the cache doesn't exist, and we know how to convert 1641 if ( !inst[ cache ] && space.to ) { 1642 1643 // If the value was null, we don't need to copy it 1644 // if the key was alpha, we don't need to copy it either 1645 if ( key === "alpha" || red[ key ] == null ) { 1646 return; 1647 } 1648 inst[ cache ] = space.to( inst._rgba ); 1649 } 1650 1651 // This is the only case where we allow nulls for ALL properties. 1652 // call clamp with alwaysAllowEmpty 1653 inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); 1654 } ); 1655 1656 // Everything defined but alpha? 1657 if ( inst[ cache ] && 1658 jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { 1659 1660 // Use the default of 1 1661 inst[ cache ][ 3 ] = 1; 1662 if ( space.from ) { 1663 inst._rgba = space.from( inst[ cache ] ); 1664 } 1665 } 1666 } ); 1667 } 1668 return this; 1669 } 1670 }, 1671 is: function( compare ) { 1672 var is = color( compare ), 1673 same = true, 1674 inst = this; 1675 1676 each( spaces, function( _, space ) { 1677 var localCache, 1678 isCache = is[ space.cache ]; 1679 if ( isCache ) { 1680 localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; 1681 each( space.props, function( _, prop ) { 1682 if ( isCache[ prop.idx ] != null ) { 1683 same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); 1684 return same; 1685 } 1686 } ); 1687 } 1688 return same; 1689 } ); 1690 return same; 1691 }, 1692 _space: function() { 1693 var used = [], 1694 inst = this; 1695 each( spaces, function( spaceName, space ) { 1696 if ( inst[ space.cache ] ) { 1697 used.push( spaceName ); 1698 } 1699 } ); 1700 return used.pop(); 1701 }, 1702 transition: function( other, distance ) { 1703 var end = color( other ), 1704 spaceName = end._space(), 1705 space = spaces[ spaceName ], 1706 startColor = this.alpha() === 0 ? color( "transparent" ) : this, 1707 start = startColor[ space.cache ] || space.to( startColor._rgba ), 1708 result = start.slice(); 1709 1710 end = end[ space.cache ]; 1711 each( space.props, function( key, prop ) { 1712 var index = prop.idx, 1713 startValue = start[ index ], 1714 endValue = end[ index ], 1715 type = propTypes[ prop.type ] || {}; 1716 1717 // If null, don't override start value 1718 if ( endValue === null ) { 1719 return; 1720 } 1721 1722 // If null - use end 1723 if ( startValue === null ) { 1724 result[ index ] = endValue; 1725 } else { 1726 if ( type.mod ) { 1727 if ( endValue - startValue > type.mod / 2 ) { 1728 startValue += type.mod; 1729 } else if ( startValue - endValue > type.mod / 2 ) { 1730 startValue -= type.mod; 1731 } 1732 } 1733 result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); 1734 } 1735 } ); 1736 return this[ spaceName ]( result ); 1737 }, 1738 blend: function( opaque ) { 1739 1740 // If we are already opaque - return ourself 1741 if ( this._rgba[ 3 ] === 1 ) { 1742 return this; 1743 } 1744 1745 var rgb = this._rgba.slice(), 1746 a = rgb.pop(), 1747 blend = color( opaque )._rgba; 1748 1749 return color( jQuery.map( rgb, function( v, i ) { 1750 return ( 1 - a ) * blend[ i ] + a * v; 1751 } ) ); 1752 }, 1753 toRgbaString: function() { 1754 var prefix = "rgba(", 1755 rgba = jQuery.map( this._rgba, function( v, i ) { 1756 return v == null ? ( i > 2 ? 1 : 0 ) : v; 1757 } ); 1758 1759 if ( rgba[ 3 ] === 1 ) { 1760 rgba.pop(); 1761 prefix = "rgb("; 1762 } 1763 1764 return prefix + rgba.join() + ")"; 1765 }, 1766 toHslaString: function() { 1767 var prefix = "hsla(", 1768 hsla = jQuery.map( this.hsla(), function( v, i ) { 1769 if ( v == null ) { 1770 v = i > 2 ? 1 : 0; 1771 } 1772 1773 // Catch 1 and 2 1774 if ( i && i < 3 ) { 1775 v = Math.round( v * 100 ) + "%"; 1776 } 1777 return v; 1778 } ); 1779 1780 if ( hsla[ 3 ] === 1 ) { 1781 hsla.pop(); 1782 prefix = "hsl("; 1783 } 1784 return prefix + hsla.join() + ")"; 1785 }, 1786 toHexString: function( includeAlpha ) { 1787 var rgba = this._rgba.slice(), 1788 alpha = rgba.pop(); 1789 1790 if ( includeAlpha ) { 1791 rgba.push( ~~( alpha * 255 ) ); 1792 } 1793 1794 return "#" + jQuery.map( rgba, function( v ) { 1795 1796 // Default to 0 when nulls exist 1797 v = ( v || 0 ).toString( 16 ); 1798 return v.length === 1 ? "0" + v : v; 1799 } ).join( "" ); 1800 }, 1801 toString: function() { 1802 return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); 1803 } 1804} ); 1805color.fn.parse.prototype = color.fn; 1806 1807// Hsla conversions adapted from: 1808// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 1809 1810function hue2rgb( p, q, h ) { 1811 h = ( h + 1 ) % 1; 1812 if ( h * 6 < 1 ) { 1813 return p + ( q - p ) * h * 6; 1814 } 1815 if ( h * 2 < 1 ) { 1816 return q; 1817 } 1818 if ( h * 3 < 2 ) { 1819 return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6; 1820 } 1821 return p; 1822} 1823 1824spaces.hsla.to = function( rgba ) { 1825 if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { 1826 return [ null, null, null, rgba[ 3 ] ]; 1827 } 1828 var r = rgba[ 0 ] / 255, 1829 g = rgba[ 1 ] / 255, 1830 b = rgba[ 2 ] / 255, 1831 a = rgba[ 3 ], 1832 max = Math.max( r, g, b ), 1833 min = Math.min( r, g, b ), 1834 diff = max - min, 1835 add = max + min, 1836 l = add * 0.5, 1837 h, s; 1838 1839 if ( min === max ) { 1840 h = 0; 1841 } else if ( r === max ) { 1842 h = ( 60 * ( g - b ) / diff ) + 360; 1843 } else if ( g === max ) { 1844 h = ( 60 * ( b - r ) / diff ) + 120; 1845 } else { 1846 h = ( 60 * ( r - g ) / diff ) + 240; 1847 } 1848 1849 // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0% 1850 // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) 1851 if ( diff === 0 ) { 1852 s = 0; 1853 } else if ( l <= 0.5 ) { 1854 s = diff / add; 1855 } else { 1856 s = diff / ( 2 - add ); 1857 } 1858 return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ]; 1859}; 1860 1861spaces.hsla.from = function( hsla ) { 1862 if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { 1863 return [ null, null, null, hsla[ 3 ] ]; 1864 } 1865 var h = hsla[ 0 ] / 360, 1866 s = hsla[ 1 ], 1867 l = hsla[ 2 ], 1868 a = hsla[ 3 ], 1869 q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, 1870 p = 2 * l - q; 1871 1872 return [ 1873 Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), 1874 Math.round( hue2rgb( p, q, h ) * 255 ), 1875 Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), 1876 a 1877 ]; 1878}; 1879 1880each( spaces, function( spaceName, space ) { 1881 var props = space.props, 1882 cache = space.cache, 1883 to = space.to, 1884 from = space.from; 1885 1886 // Makes rgba() and hsla() 1887 color.fn[ spaceName ] = function( value ) { 1888 1889 // Generate a cache for this space if it doesn't exist 1890 if ( to && !this[ cache ] ) { 1891 this[ cache ] = to( this._rgba ); 1892 } 1893 if ( value === undefined ) { 1894 return this[ cache ].slice(); 1895 } 1896 1897 var ret, 1898 type = jQuery.type( value ), 1899 arr = ( type === "array" || type === "object" ) ? value : arguments, 1900 local = this[ cache ].slice(); 1901 1902 each( props, function( key, prop ) { 1903 var val = arr[ type === "object" ? key : prop.idx ]; 1904 if ( val == null ) { 1905 val = local[ prop.idx ]; 1906 } 1907 local[ prop.idx ] = clamp( val, prop ); 1908 } ); 1909 1910 if ( from ) { 1911 ret = color( from( local ) ); 1912 ret[ cache ] = local; 1913 return ret; 1914 } else { 1915 return color( local ); 1916 } 1917 }; 1918 1919 // Makes red() green() blue() alpha() hue() saturation() lightness() 1920 each( props, function( key, prop ) { 1921 1922 // Alpha is included in more than one space 1923 if ( color.fn[ key ] ) { 1924 return; 1925 } 1926 color.fn[ key ] = function( value ) { 1927 var vtype = jQuery.type( value ), 1928 fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), 1929 local = this[ fn ](), 1930 cur = local[ prop.idx ], 1931 match; 1932 1933 if ( vtype === "undefined" ) { 1934 return cur; 1935 } 1936 1937 if ( vtype === "function" ) { 1938 value = value.call( this, cur ); 1939 vtype = jQuery.type( value ); 1940 } 1941 if ( value == null && prop.empty ) { 1942 return this; 1943 } 1944 if ( vtype === "string" ) { 1945 match = rplusequals.exec( value ); 1946 if ( match ) { 1947 value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); 1948 } 1949 } 1950 local[ prop.idx ] = value; 1951 return this[ fn ]( local ); 1952 }; 1953 } ); 1954} ); 1955 1956// Add cssHook and .fx.step function for each named hook. 1957// accept a space separated string of properties 1958color.hook = function( hook ) { 1959 var hooks = hook.split( " " ); 1960 each( hooks, function( i, hook ) { 1961 jQuery.cssHooks[ hook ] = { 1962 set: function( elem, value ) { 1963 var parsed, curElem, 1964 backgroundColor = ""; 1965 1966 if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || 1967 ( parsed = stringParse( value ) ) ) ) { 1968 value = color( parsed || value ); 1969 if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { 1970 curElem = hook === "backgroundColor" ? elem.parentNode : elem; 1971 while ( 1972 ( backgroundColor === "" || backgroundColor === "transparent" ) && 1973 curElem && curElem.style 1974 ) { 1975 try { 1976 backgroundColor = jQuery.css( curElem, "backgroundColor" ); 1977 curElem = curElem.parentNode; 1978 } catch ( e ) { 1979 } 1980 } 1981 1982 value = value.blend( backgroundColor && backgroundColor !== "transparent" ? 1983 backgroundColor : 1984 "_default" ); 1985 } 1986 1987 value = value.toRgbaString(); 1988 } 1989 try { 1990 elem.style[ hook ] = value; 1991 } catch ( e ) { 1992 1993 // Wrapped to prevent IE from throwing errors on "invalid" values like 1994 // 'auto' or 'inherit' 1995 } 1996 } 1997 }; 1998 jQuery.fx.step[ hook ] = function( fx ) { 1999 if ( !fx.colorInit ) { 2000 fx.start = color( fx.elem, hook ); 2001 fx.end = color( fx.end ); 2002 fx.colorInit = true; 2003 } 2004 jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); 2005 }; 2006 } ); 2007 2008}; 2009 2010color.hook( stepHooks ); 2011 2012jQuery.cssHooks.borderColor = { 2013 expand: function( value ) { 2014 var expanded = {}; 2015 2016 each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { 2017 expanded[ "border" + part + "Color" ] = value; 2018 } ); 2019 return expanded; 2020 } 2021}; 2022 2023// Basic color names only. 2024// Usage of any of the other color names requires adding yourself or including 2025// jquery.color.svg-names.js. 2026colors = jQuery.Color.names = { 2027 2028 // 4.1. Basic color keywords 2029 aqua: "#00ffff", 2030 black: "#000000", 2031 blue: "#0000ff", 2032 fuchsia: "#ff00ff", 2033 gray: "#808080", 2034 green: "#008000", 2035 lime: "#00ff00", 2036 maroon: "#800000", 2037 navy: "#000080", 2038 olive: "#808000", 2039 purple: "#800080", 2040 red: "#ff0000", 2041 silver: "#c0c0c0", 2042 teal: "#008080", 2043 white: "#ffffff", 2044 yellow: "#ffff00", 2045 2046 // 4.2.3. "transparent" color keyword 2047 transparent: [ null, null, null, 0 ], 2048 2049 _default: "#ffffff" 2050}; 2051 2052} )( jQuery ); 2053 2054/******************************************************************************/ 2055/****************************** CLASS ANIMATIONS ******************************/ 2056/******************************************************************************/ 2057( function() { 2058 2059var classAnimationActions = [ "add", "remove", "toggle" ], 2060 shorthandStyles = { 2061 border: 1, 2062 borderBottom: 1, 2063 borderColor: 1, 2064 borderLeft: 1, 2065 borderRight: 1, 2066 borderTop: 1, 2067 borderWidth: 1, 2068 margin: 1, 2069 padding: 1 2070 }; 2071 2072$.each( 2073 [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], 2074 function( _, prop ) { 2075 $.fx.step[ prop ] = function( fx ) { 2076 if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { 2077 jQuery.style( fx.elem, prop, fx.end ); 2078 fx.setAttr = true; 2079 } 2080 }; 2081 } 2082); 2083 2084function getElementStyles( elem ) { 2085 var key, len, 2086 style = elem.ownerDocument.defaultView ? 2087 elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : 2088 elem.currentStyle, 2089 styles = {}; 2090 2091 if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { 2092 len = style.length; 2093 while ( len-- ) { 2094 key = style[ len ]; 2095 if ( typeof style[ key ] === "string" ) { 2096 styles[ $.camelCase( key ) ] = style[ key ]; 2097 } 2098 } 2099 2100 // Support: Opera, IE <9 2101 } else { 2102 for ( key in style ) { 2103 if ( typeof style[ key ] === "string" ) { 2104 styles[ key ] = style[ key ]; 2105 } 2106 } 2107 } 2108 2109 return styles; 2110} 2111 2112function styleDifference( oldStyle, newStyle ) { 2113 var diff = {}, 2114 name, value; 2115 2116 for ( name in newStyle ) { 2117 value = newStyle[ name ]; 2118 if ( oldStyle[ name ] !== value ) { 2119 if ( !shorthandStyles[ name ] ) { 2120 if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { 2121 diff[ name ] = value; 2122 } 2123 } 2124 } 2125 } 2126 2127 return diff; 2128} 2129 2130// Support: jQuery <1.8 2131if ( !$.fn.addBack ) { 2132 $.fn.addBack = function( selector ) { 2133 return this.add( selector == null ? 2134 this.prevObject : this.prevObject.filter( selector ) 2135 ); 2136 }; 2137} 2138 2139$.effects.animateClass = function( value, duration, easing, callback ) { 2140 var o = $.speed( duration, easing, callback ); 2141 2142 return this.queue( function() { 2143 var animated = $( this ), 2144 baseClass = animated.attr( "class" ) || "", 2145 applyClassChange, 2146 allAnimations = o.children ? animated.find( "*" ).addBack() : animated; 2147 2148 // Map the animated objects to store the original styles. 2149 allAnimations = allAnimations.map( function() { 2150 var el = $( this ); 2151 return { 2152 el: el, 2153 start: getElementStyles( this ) 2154 }; 2155 } ); 2156 2157 // Apply class change 2158 applyClassChange = function() { 2159 $.each( classAnimationActions, function( i, action ) { 2160 if ( value[ action ] ) { 2161 animated[ action + "Class" ]( value[ action ] ); 2162 } 2163 } ); 2164 }; 2165 applyClassChange(); 2166 2167 // Map all animated objects again - calculate new styles and diff 2168 allAnimations = allAnimations.map( function() { 2169 this.end = getElementStyles( this.el[ 0 ] ); 2170 this.diff = styleDifference( this.start, this.end ); 2171 return this; 2172 } ); 2173 2174 // Apply original class 2175 animated.attr( "class", baseClass ); 2176 2177 // Map all animated objects again - this time collecting a promise 2178 allAnimations = allAnimations.map( function() { 2179 var styleInfo = this, 2180 dfd = $.Deferred(), 2181 opts = $.extend( {}, o, { 2182 queue: false, 2183 complete: function() { 2184 dfd.resolve( styleInfo ); 2185 } 2186 } ); 2187 2188 this.el.animate( this.diff, opts ); 2189 return dfd.promise(); 2190 } ); 2191 2192 // Once all animations have completed: 2193 $.when.apply( $, allAnimations.get() ).done( function() { 2194 2195 // Set the final class 2196 applyClassChange(); 2197 2198 // For each animated element, 2199 // clear all css properties that were animated 2200 $.each( arguments, function() { 2201 var el = this.el; 2202 $.each( this.diff, function( key ) { 2203 el.css( key, "" ); 2204 } ); 2205 } ); 2206 2207 // This is guarnteed to be there if you use jQuery.speed() 2208 // it also handles dequeuing the next anim... 2209 o.complete.call( animated[ 0 ] ); 2210 } ); 2211 } ); 2212};
vendor: 5,123 bytes, lines 2213-2393
2213 2214$.fn.extend( { 2215 addClass: ( function( orig ) { 2216 return function( classNames, speed, easing, callback ) { 2217 return speed ? 2218 $.effects.animateClass.call( this, 2219 { add: classNames }, speed, easing, callback ) : 2220 orig.apply( this, arguments ); 2221 }; 2222 } )( $.fn.addClass ), 2223 2224 removeClass: ( function( orig ) { 2225 return function( classNames, speed, easing, callback ) { 2226 return arguments.length > 1 ? 2227 $.effects.animateClass.call( this, 2228 { remove: classNames }, speed, easing, callback ) : 2229 orig.apply( this, arguments ); 2230 }; 2231 } )( $.fn.removeClass ), 2232 2233 toggleClass: ( function( orig ) { 2234 return function( classNames, force, speed, easing, callback ) { 2235 if ( typeof force === "boolean" || force === undefined ) { 2236 if ( !speed ) { 2237 2238 // Without speed parameter 2239 return orig.apply( this, arguments ); 2240 } else { 2241 return $.effects.animateClass.call( this, 2242 ( force ? { add: classNames } : { remove: classNames } ), 2243 speed, easing, callback ); 2244 } 2245 } else { 2246 2247 // Without force parameter 2248 return $.effects.animateClass.call( this, 2249 { toggle: classNames }, force, speed, easing ); 2250 } 2251 }; 2252 } )( $.fn.toggleClass ), 2253 2254 switchClass: function( remove, add, speed, easing, callback ) { 2255 return $.effects.animateClass.call( this, { 2256 add: add, 2257 remove: remove 2258 }, speed, easing, callback ); 2259 } 2260} ); 2261 2262} )(); 2263 2264/******************************************************************************/ 2265/*********************************** EFFECTS **********************************/ 2266/******************************************************************************/ 2267 2268( function() { 2269 2270if ( $.expr && $.expr.filters && $.expr.filters.animated ) { 2271 $.expr.filters.animated = ( function( orig ) { 2272 return function( elem ) { 2273 return !!$( elem ).data( dataSpaceAnimated ) || orig( elem ); 2274 }; 2275 } )( $.expr.filters.animated ); 2276} 2277 2278if ( $.uiBackCompat !== false ) { 2279 $.extend( $.effects, { 2280 2281 // Saves a set of properties in a data storage 2282 save: function( element, set ) { 2283 var i = 0, length = set.length; 2284 for ( ; i < length; i++ ) { 2285 if ( set[ i ] !== null ) { 2286 element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); 2287 } 2288 } 2289 }, 2290 2291 // Restores a set of previously saved properties from a data storage 2292 restore: function( element, set ) { 2293 var val, i = 0, length = set.length; 2294 for ( ; i < length; i++ ) { 2295 if ( set[ i ] !== null ) { 2296 val = element.data( dataSpace + set[ i ] ); 2297 element.css( set[ i ], val ); 2298 } 2299 } 2300 }, 2301 2302 setMode: function( el, mode ) { 2303 if ( mode === "toggle" ) { 2304 mode = el.is( ":hidden" ) ? "show" : "hide"; 2305 } 2306 return mode; 2307 }, 2308 2309 // Wraps the element around a wrapper that copies position properties 2310 createWrapper: function( element ) { 2311 2312 // If the element is already wrapped, return it 2313 if ( element.parent().is( ".ui-effects-wrapper" ) ) { 2314 return element.parent(); 2315 } 2316 2317 // Wrap the element 2318 var props = { 2319 width: element.outerWidth( true ), 2320 height: element.outerHeight( true ), 2321 "float": element.css( "float" ) 2322 }, 2323 wrapper = $( "<div></div>" ) 2324 .addClass( "ui-effects-wrapper" ) 2325 .css( { 2326 fontSize: "100%", 2327 background: "transparent", 2328 border: "none", 2329 margin: 0, 2330 padding: 0 2331 } ), 2332 2333 // Store the size in case width/height are defined in % - Fixes #5245 2334 size = { 2335 width: element.width(), 2336 height: element.height() 2337 }, 2338 active = document.activeElement; 2339 2340 // Support: Firefox 2341 // Firefox incorrectly exposes anonymous content 2342 // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 2343 try { 2344 active.id; 2345 } catch ( e ) { 2346 active = document.body; 2347 } 2348 2349 element.wrap( wrapper ); 2350 2351 // Fixes #7595 - Elements lose focus when wrapped. 2352 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 2353 $( active ).trigger( "focus" ); 2354 } 2355 2356 // Hotfix for jQuery 1.4 since some change in wrap() seems to actually 2357 // lose the reference to the wrapped element 2358 wrapper = element.parent(); 2359 2360 // Transfer positioning properties to the wrapper 2361 if ( element.css( "position" ) === "static" ) { 2362 wrapper.css( { position: "relative" } ); 2363 element.css( { position: "relative" } ); 2364 } else { 2365 $.extend( props, { 2366 position: element.css( "position" ), 2367 zIndex: element.css( "z-index" ) 2368 } ); 2369 $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) { 2370 props[ pos ] = element.css( pos ); 2371 if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { 2372 props[ pos ] = "auto"; 2373 } 2374 } ); 2375 element.css( { 2376 position: "relative", 2377 top: 0, 2378 left: 0, 2379 right: "auto", 2380 bottom: "auto" 2381 } ); 2382 } 2383 element.css( size ); 2384 2385 return wrapper.css( props ).show(); 2386 }, 2387 2388 removeWrapper: function( element ) { 2389 var active = document.activeElement; 2390 2391 if ( element.parent().is( ".ui-effects-wrapper" ) ) { 2392 element.parent().replaceWith( element ); 2393
vendor: 16,572 bytes, lines 2394-3030
2394 // Fixes #7595 - Elements lose focus when wrapped. 2395 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 2396 $( active ).trigger( "focus" ); 2397 } 2398 } 2399 2400 return element; 2401 } 2402 } ); 2403} 2404 2405$.extend( $.effects, { 2406 version: "1.12.0", 2407 2408 define: function( name, mode, effect ) { 2409 if ( !effect ) { 2410 effect = mode; 2411 mode = "effect"; 2412 } 2413 2414 $.effects.effect[ name ] = effect; 2415 $.effects.effect[ name ].mode = mode; 2416 2417 return effect; 2418 }, 2419 2420 scaledDimensions: function( element, percent, direction ) { 2421 if ( percent === 0 ) { 2422 return { 2423 height: 0, 2424 width: 0, 2425 outerHeight: 0, 2426 outerWidth: 0 2427 }; 2428 } 2429 2430 var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1, 2431 y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1; 2432 2433 return { 2434 height: element.height() * y, 2435 width: element.width() * x, 2436 outerHeight: element.outerHeight() * y, 2437 outerWidth: element.outerWidth() * x 2438 }; 2439 2440 }, 2441 2442 clipToBox: function( animation ) { 2443 return { 2444 width: animation.clip.right - animation.clip.left, 2445 height: animation.clip.bottom - animation.clip.top, 2446 left: animation.clip.left, 2447 top: animation.clip.top 2448 }; 2449 }, 2450 2451 // Injects recently queued functions to be first in line (after "inprogress") 2452 unshift: function( element, queueLength, count ) { 2453 var queue = element.queue(); 2454 2455 if ( queueLength > 1 ) { 2456 queue.splice.apply( queue, 2457 [ 1, 0 ].concat( queue.splice( queueLength, count ) ) ); 2458 } 2459 element.dequeue(); 2460 }, 2461 2462 saveStyle: function( element ) { 2463 element.data( dataSpaceStyle, element[ 0 ].style.cssText ); 2464 }, 2465 2466 restoreStyle: function( element ) { 2467 element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || ""; 2468 element.removeData( dataSpaceStyle ); 2469 }, 2470 2471 mode: function( element, mode ) { 2472 var hidden = element.is( ":hidden" ); 2473 2474 if ( mode === "toggle" ) { 2475 mode = hidden ? "show" : "hide"; 2476 } 2477 if ( hidden ? mode === "hide" : mode === "show" ) { 2478 mode = "none"; 2479 } 2480 return mode; 2481 }, 2482 2483 // Translates a [top,left] array into a baseline value 2484 getBaseline: function( origin, original ) { 2485 var y, x; 2486 2487 switch ( origin[ 0 ] ) { 2488 case "top": 2489 y = 0; 2490 break; 2491 case "middle": 2492 y = 0.5; 2493 break; 2494 case "bottom": 2495 y = 1; 2496 break; 2497 default: 2498 y = origin[ 0 ] / original.height; 2499 } 2500 2501 switch ( origin[ 1 ] ) { 2502 case "left": 2503 x = 0; 2504 break; 2505 case "center": 2506 x = 0.5; 2507 break; 2508 case "right": 2509 x = 1; 2510 break; 2511 default: 2512 x = origin[ 1 ] / original.width; 2513 } 2514 2515 return { 2516 x: x, 2517 y: y 2518 }; 2519 }, 2520 2521 // Creates a placeholder element so that the original element can be made absolute 2522 createPlaceholder: function( element ) { 2523 var placeholder, 2524 cssPosition = element.css( "position" ), 2525 position = element.position(); 2526 2527 // Lock in margins first to account for form elements, which 2528 // will change margin if you explicitly set height 2529 // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380 2530 // Support: Safari 2531 element.css( { 2532 marginTop: element.css( "marginTop" ), 2533 marginBottom: element.css( "marginBottom" ), 2534 marginLeft: element.css( "marginLeft" ), 2535 marginRight: element.css( "marginRight" ) 2536 } ) 2537 .outerWidth( element.outerWidth() ) 2538 .outerHeight( element.outerHeight() ); 2539 2540 if ( /^(static|relative)/.test( cssPosition ) ) { 2541 cssPosition = "absolute"; 2542 2543 placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( { 2544 2545 // Convert inline to inline block to account for inline elements 2546 // that turn to inline block based on content (like img) 2547 display: /^(inline|ruby)/.test( element.css( "display" ) ) ? 2548 "inline-block" : 2549 "block", 2550 visibility: "hidden", 2551 2552 // Margins need to be set to account for margin collapse 2553 marginTop: element.css( "marginTop" ), 2554 marginBottom: element.css( "marginBottom" ), 2555 marginLeft: element.css( "marginLeft" ), 2556 marginRight: element.css( "marginRight" ), 2557 "float": element.css( "float" ) 2558 } ) 2559 .outerWidth( element.outerWidth() ) 2560 .outerHeight( element.outerHeight() ) 2561 .addClass( "ui-effects-placeholder" ); 2562 2563 element.data( dataSpace + "placeholder", placeholder ); 2564 } 2565 2566 element.css( { 2567 position: cssPosition, 2568 left: position.left, 2569 top: position.top 2570 } ); 2571 2572 return placeholder; 2573 }, 2574 2575 removePlaceholder: function( element ) { 2576 var dataKey = dataSpace + "placeholder", 2577 placeholder = element.data( dataKey ); 2578 2579 if ( placeholder ) { 2580 placeholder.remove(); 2581 element.removeData( dataKey ); 2582 } 2583 }, 2584 2585 // Removes a placeholder if it exists and restores 2586 // properties that were modified during placeholder creation 2587 cleanUp: function( element ) { 2588 $.effects.restoreStyle( element ); 2589 $.effects.removePlaceholder( element ); 2590 }, 2591 2592 setTransition: function( element, list, factor, value ) { 2593 value = value || {}; 2594 $.each( list, function( i, x ) { 2595 var unit = element.cssUnit( x ); 2596 if ( unit[ 0 ] > 0 ) { 2597 value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; 2598 } 2599 } ); 2600 return value; 2601 } 2602} ); 2603 2604// Return an effect options object for the given parameters: 2605function _normalizeArguments( effect, options, speed, callback ) { 2606 2607 // Allow passing all options as the first parameter 2608 if ( $.isPlainObject( effect ) ) { 2609 options = effect; 2610 effect = effect.effect; 2611 } 2612 2613 // Convert to an object 2614 effect = { effect: effect }; 2615 2616 // Catch (effect, null, ...) 2617 if ( options == null ) { 2618 options = {}; 2619 } 2620 2621 // Catch (effect, callback) 2622 if ( $.isFunction( options ) ) { 2623 callback = options; 2624 speed = null; 2625 options = {}; 2626 } 2627 2628 // Catch (effect, speed, ?) 2629 if ( typeof options === "number" || $.fx.speeds[ options ] ) { 2630 callback = speed; 2631 speed = options; 2632 options = {}; 2633 } 2634 2635 // Catch (effect, options, callback) 2636 if ( $.isFunction( speed ) ) { 2637 callback = speed; 2638 speed = null; 2639 } 2640 2641 // Add options to effect 2642 if ( options ) { 2643 $.extend( effect, options ); 2644 } 2645 2646 speed = speed || options.duration; 2647 effect.duration = $.fx.off ? 0 : 2648 typeof speed === "number" ? speed : 2649 speed in $.fx.speeds ? $.fx.speeds[ speed ] : 2650 $.fx.speeds._default; 2651 2652 effect.complete = callback || options.complete; 2653 2654 return effect; 2655} 2656 2657function standardAnimationOption( option ) { 2658 2659 // Valid standard speeds (nothing, number, named speed) 2660 if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { 2661 return true; 2662 } 2663 2664 // Invalid strings - treat as "normal" speed 2665 if ( typeof option === "string" && !$.effects.effect[ option ] ) { 2666 return true; 2667 } 2668 2669 // Complete callback 2670 if ( $.isFunction( option ) ) { 2671 return true; 2672 } 2673 2674 // Options hash (but not naming an effect) 2675 if ( typeof option === "object" && !option.effect ) { 2676 return true; 2677 } 2678 2679 // Didn't match any standard API 2680 return false; 2681} 2682 2683$.fn.extend( { 2684 effect: function( /* effect, options, speed, callback */ ) { 2685 var args = _normalizeArguments.apply( this, arguments ), 2686 effectMethod = $.effects.effect[ args.effect ], 2687 defaultMode = effectMethod.mode, 2688 queue = args.queue, 2689 queueName = queue || "fx", 2690 complete = args.complete, 2691 mode = args.mode, 2692 modes = [], 2693 prefilter = function( next ) { 2694 var el = $( this ), 2695 normalizedMode = $.effects.mode( el, mode ) || defaultMode; 2696 2697 // Sentinel for duck-punching the :animated psuedo-selector 2698 el.data( dataSpaceAnimated, true ); 2699 2700 // Save effect mode for later use, 2701 // we can't just call $.effects.mode again later, 2702 // as the .show() below destroys the initial state 2703 modes.push( normalizedMode ); 2704 2705 // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13 2706 if ( defaultMode && ( normalizedMode === "show" || 2707 ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) { 2708 el.show(); 2709 } 2710 2711 if ( !defaultMode || normalizedMode !== "none" ) { 2712 $.effects.saveStyle( el ); 2713 } 2714 2715 if ( $.isFunction( next ) ) { 2716 next(); 2717 } 2718 }; 2719 2720 if ( $.fx.off || !effectMethod ) { 2721 2722 // Delegate to the original method (e.g., .show()) if possible 2723 if ( mode ) { 2724 return this[ mode ]( args.duration, complete ); 2725 } else { 2726 return this.each( function() { 2727 if ( complete ) { 2728 complete.call( this ); 2729 } 2730 } ); 2731 } 2732 } 2733 2734 function run( next ) { 2735 var elem = $( this ); 2736 2737 function cleanup() { 2738 elem.removeData( dataSpaceAnimated ); 2739 2740 $.effects.cleanUp( elem ); 2741 2742 if ( args.mode === "hide" ) { 2743 elem.hide(); 2744 } 2745 2746 done(); 2747 } 2748 2749 function done() { 2750 if ( $.isFunction( complete ) ) { 2751 complete.call( elem[ 0 ] ); 2752 } 2753 2754 if ( $.isFunction( next ) ) { 2755 next(); 2756 } 2757 } 2758 2759 // Override mode option on a per element basis, 2760 // as toggle can be either show or hide depending on element state 2761 args.mode = modes.shift(); 2762 2763 if ( $.uiBackCompat !== false && !defaultMode ) { 2764 if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { 2765 2766 // Call the core method to track "olddisplay" properly 2767 elem[ mode ](); 2768 done(); 2769 } else { 2770 effectMethod.call( elem[ 0 ], args, done ); 2771 } 2772 } else { 2773 if ( args.mode === "none" ) { 2774 2775 // Call the core method to track "olddisplay" properly 2776 elem[ mode ](); 2777 done(); 2778 } else { 2779 effectMethod.call( elem[ 0 ], args, cleanup ); 2780 } 2781 } 2782 } 2783 2784 // Run prefilter on all elements first to ensure that 2785 // any showing or hiding happens before placeholder creation, 2786 // which ensures that any layout changes are correctly captured. 2787 return queue === false ? 2788 this.each( prefilter ).each( run ) : 2789 this.queue( queueName, prefilter ).queue( queueName, run ); 2790 }, 2791 2792 show: ( function( orig ) { 2793 return function( option ) { 2794 if ( standardAnimationOption( option ) ) { 2795 return orig.apply( this, arguments ); 2796 } else { 2797 var args = _normalizeArguments.apply( this, arguments ); 2798 args.mode = "show"; 2799 return this.effect.call( this, args ); 2800 } 2801 }; 2802 } )( $.fn.show ), 2803 2804 hide: ( function( orig ) { 2805 return function( option ) { 2806 if ( standardAnimationOption( option ) ) { 2807 return orig.apply( this, arguments ); 2808 } else { 2809 var args = _normalizeArguments.apply( this, arguments ); 2810 args.mode = "hide"; 2811 return this.effect.call( this, args ); 2812 } 2813 }; 2814 } )( $.fn.hide ), 2815 2816 toggle: ( function( orig ) { 2817 return function( option ) { 2818 if ( standardAnimationOption( option ) || typeof option === "boolean" ) { 2819 return orig.apply( this, arguments ); 2820 } else { 2821 var args = _normalizeArguments.apply( this, arguments ); 2822 args.mode = "toggle"; 2823 return this.effect.call( this, args ); 2824 } 2825 }; 2826 } )( $.fn.toggle ), 2827 2828 cssUnit: function( key ) { 2829 var style = this.css( key ), 2830 val = []; 2831 2832 $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { 2833 if ( style.indexOf( unit ) > 0 ) { 2834 val = [ parseFloat( style ), unit ]; 2835 } 2836 } ); 2837 return val; 2838 }, 2839 2840 cssClip: function( clipObj ) { 2841 if ( clipObj ) { 2842 return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + 2843 clipObj.bottom + "px " + clipObj.left + "px)" ); 2844 } 2845 return parseClip( this.css( "clip" ), this ); 2846 }, 2847 2848 transfer: function( options, done ) { 2849 var element = $( this ), 2850 target = $( options.to ), 2851 targetFixed = target.css( "position" ) === "fixed", 2852 body = $( "body" ), 2853 fixTop = targetFixed ? body.scrollTop() : 0, 2854 fixLeft = targetFixed ? body.scrollLeft() : 0, 2855 endPosition = target.offset(), 2856 animation = { 2857 top: endPosition.top - fixTop, 2858 left: endPosition.left - fixLeft, 2859 height: target.innerHeight(), 2860 width: target.innerWidth() 2861 }, 2862 startPosition = element.offset(), 2863 transfer = $( "<div class='ui-effects-transfer'></div>" ) 2864 .appendTo( "body" ) 2865 .addClass( options.className ) 2866 .css( { 2867 top: startPosition.top - fixTop, 2868 left: startPosition.left - fixLeft, 2869 height: element.innerHeight(), 2870 width: element.innerWidth(), 2871 position: targetFixed ? "fixed" : "absolute" 2872 } ) 2873 .animate( animation, options.duration, options.easing, function() { 2874 transfer.remove(); 2875 if ( $.isFunction( done ) ) { 2876 done(); 2877 } 2878 } ); 2879 } 2880} ); 2881 2882function parseClip( str, element ) { 2883 var outerWidth = element.outerWidth(), 2884 outerHeight = element.outerHeight(), 2885 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)\)$/, 2886 values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ]; 2887 2888 return { 2889 top: parseFloat( values[ 1 ] ) || 0, 2890 right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ), 2891 bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ), 2892 left: parseFloat( values[ 4 ] ) || 0 2893 }; 2894} 2895 2896$.fx.step.clip = function( fx ) { 2897 if ( !fx.clipInit ) { 2898 fx.start = $( fx.elem ).cssClip(); 2899 if ( typeof fx.end === "string" ) { 2900 fx.end = parseClip( fx.end, fx.elem ); 2901 } 2902 fx.clipInit = true; 2903 } 2904 2905 $( fx.elem ).cssClip( { 2906 top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top, 2907 right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right, 2908 bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom, 2909 left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left 2910 } ); 2911}; 2912 2913} )(); 2914 2915/******************************************************************************/ 2916/*********************************** EASING ***********************************/ 2917/******************************************************************************/ 2918 2919( function() { 2920 2921// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing) 2922 2923var baseEasings = {}; 2924 2925$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { 2926 baseEasings[ name ] = function( p ) { 2927 return Math.pow( p, i + 2 ); 2928 }; 2929} ); 2930 2931$.extend( baseEasings, { 2932 Sine: function( p ) { 2933 return 1 - Math.cos( p * Math.PI / 2 ); 2934 }, 2935 Circ: function( p ) { 2936 return 1 - Math.sqrt( 1 - p * p ); 2937 }, 2938 Elastic: function( p ) { 2939 return p === 0 || p === 1 ? p : 2940 -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); 2941 }, 2942 Back: function( p ) { 2943 return p * p * ( 3 * p - 2 ); 2944 }, 2945 Bounce: function( p ) { 2946 var pow2, 2947 bounce = 4; 2948 2949 while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} 2950 return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); 2951 } 2952} ); 2953 2954$.each( baseEasings, function( name, easeIn ) { 2955 $.easing[ "easeIn" + name ] = easeIn; 2956 $.easing[ "easeOut" + name ] = function( p ) { 2957 return 1 - easeIn( 1 - p ); 2958 }; 2959 $.easing[ "easeInOut" + name ] = function( p ) { 2960 return p < 0.5 ? 2961 easeIn( p * 2 ) / 2 : 2962 1 - easeIn( p * -2 + 2 ) / 2; 2963 }; 2964} ); 2965 2966} )(); 2967 2968var effect = $.effects; 2969 2970 2971/*! 2972 * jQuery UI Effects Blind 1.12.0 2973 * http://jqueryui.com 2974 * 2975 * Copyright jQuery Foundation and other contributors 2976 * Released under the MIT license. 2977 * http://jquery.org/license 2978 */ 2979 2980//>>label: Blind Effect 2981//>>group: Effects 2982//>>description: Blinds the element. 2983//>>docs: http://api.jqueryui.com/blind-effect/ 2984//>>demos: http://jqueryui.com/effect/ 2985 2986 2987 2988var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) { 2989 var map = { 2990 up: [ "bottom", "top" ], 2991 vertical: [ "bottom", "top" ], 2992 down: [ "top", "bottom" ], 2993 left: [ "right", "left" ], 2994 horizontal: [ "right", "left" ], 2995 right: [ "left", "right" ] 2996 }, 2997 element = $( this ), 2998 direction = options.direction || "up", 2999 start = element.cssClip(), 3000 animate = { clip: $.extend( {}, start ) }, 3001 placeholder = $.effects.createPlaceholder( element ); 3002 3003 animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ]; 3004 3005 if ( options.mode === "show" ) { 3006 element.cssClip( animate.clip ); 3007 if ( placeholder ) { 3008 placeholder.css( $.effects.clipToBox( animate ) ); 3009 } 3010 3011 animate.clip = start; 3012 } 3013 3014 if ( placeholder ) { 3015 placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing ); 3016 } 3017 3018 element.animate( animate, { 3019 queue: false, 3020 duration: options.duration, 3021 easing: options.easing, 3022 complete: done 3023 } ); 3024} ); 3025 3026 3027 3028/*! 3029 * jQuery UI Effects Bounce 1.12.0 3030 * http://jqueryui.com
vendor: 10,588 bytes, lines 3031-3437
3031 * 3032 * Copyright jQuery Foundation and other contributors 3033 * Released under the MIT license. 3034 * http://jquery.org/license 3035 */ 3036 3037//>>label: Bounce Effect 3038//>>group: Effects 3039//>>description: Bounces an element horizontally or vertically n times. 3040//>>docs: http://api.jqueryui.com/bounce-effect/ 3041//>>demos: http://jqueryui.com/effect/ 3042 3043 3044 3045var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) { 3046 var upAnim, downAnim, refValue, 3047 element = $( this ), 3048 3049 // Defaults: 3050 mode = options.mode, 3051 hide = mode === "hide", 3052 show = mode === "show", 3053 direction = options.direction || "up", 3054 distance = options.distance, 3055 times = options.times || 5, 3056 3057 // Number of internal animations 3058 anims = times * 2 + ( show || hide ? 1 : 0 ), 3059 speed = options.duration / anims, 3060 easing = options.easing, 3061 3062 // Utility: 3063 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3064 motion = ( direction === "up" || direction === "left" ), 3065 i = 0, 3066 3067 queuelen = element.queue().length; 3068 3069 $.effects.createPlaceholder( element ); 3070 3071 refValue = element.css( ref ); 3072 3073 // Default distance for the BIGGEST bounce is the outer Distance / 3 3074 if ( !distance ) { 3075 distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; 3076 } 3077 3078 if ( show ) { 3079 downAnim = { opacity: 1 }; 3080 downAnim[ ref ] = refValue; 3081 3082 // If we are showing, force opacity 0 and set the initial position 3083 // then do the "first" animation 3084 element 3085 .css( "opacity", 0 ) 3086 .css( ref, motion ? -distance * 2 : distance * 2 ) 3087 .animate( downAnim, speed, easing ); 3088 } 3089 3090 // Start at the smallest distance if we are hiding 3091 if ( hide ) { 3092 distance = distance / Math.pow( 2, times - 1 ); 3093 } 3094 3095 downAnim = {}; 3096 downAnim[ ref ] = refValue; 3097 3098 // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here 3099 for ( ; i < times; i++ ) { 3100 upAnim = {}; 3101 upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; 3102 3103 element 3104 .animate( upAnim, speed, easing ) 3105 .animate( downAnim, speed, easing ); 3106 3107 distance = hide ? distance * 2 : distance / 2; 3108 } 3109 3110 // Last Bounce when Hiding 3111 if ( hide ) { 3112 upAnim = { opacity: 0 }; 3113 upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; 3114 3115 element.animate( upAnim, speed, easing ); 3116 } 3117 3118 element.queue( done ); 3119 3120 $.effects.unshift( element, queuelen, anims + 1 ); 3121} ); 3122 3123 3124/*! 3125 * jQuery UI Effects Clip 1.12.0 3126 * http://jqueryui.com 3127 * 3128 * Copyright jQuery Foundation and other contributors 3129 * Released under the MIT license. 3130 * http://jquery.org/license 3131 */ 3132 3133//>>label: Clip Effect 3134//>>group: Effects 3135//>>description: Clips the element on and off like an old TV. 3136//>>docs: http://api.jqueryui.com/clip-effect/ 3137//>>demos: http://jqueryui.com/effect/ 3138 3139 3140 3141var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) { 3142 var start, 3143 animate = {}, 3144 element = $( this ), 3145 direction = options.direction || "vertical", 3146 both = direction === "both", 3147 horizontal = both || direction === "horizontal", 3148 vertical = both || direction === "vertical"; 3149 3150 start = element.cssClip(); 3151 animate.clip = { 3152 top: vertical ? ( start.bottom - start.top ) / 2 : start.top, 3153 right: horizontal ? ( start.right - start.left ) / 2 : start.right, 3154 bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom, 3155 left: horizontal ? ( start.right - start.left ) / 2 : start.left 3156 }; 3157 3158 $.effects.createPlaceholder( element ); 3159 3160 if ( options.mode === "show" ) { 3161 element.cssClip( animate.clip ); 3162 animate.clip = start; 3163 } 3164 3165 element.animate( animate, { 3166 queue: false, 3167 duration: options.duration, 3168 easing: options.easing, 3169 complete: done 3170 } ); 3171 3172} ); 3173 3174 3175/*! 3176 * jQuery UI Effects Drop 1.12.0 3177 * http://jqueryui.com 3178 * 3179 * Copyright jQuery Foundation and other contributors 3180 * Released under the MIT license. 3181 * http://jquery.org/license 3182 */ 3183 3184//>>label: Drop Effect 3185//>>group: Effects 3186//>>description: Moves an element in one direction and hides it at the same time. 3187//>>docs: http://api.jqueryui.com/drop-effect/ 3188//>>demos: http://jqueryui.com/effect/ 3189 3190 3191 3192var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) { 3193 3194 var distance, 3195 element = $( this ), 3196 mode = options.mode, 3197 show = mode === "show", 3198 direction = options.direction || "left", 3199 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3200 motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=", 3201 oppositeMotion = ( motion === "+=" ) ? "-=" : "+=", 3202 animation = { 3203 opacity: 0 3204 }; 3205 3206 $.effects.createPlaceholder( element ); 3207 3208 distance = options.distance || 3209 element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2; 3210 3211 animation[ ref ] = motion + distance; 3212 3213 if ( show ) { 3214 element.css( animation ); 3215 3216 animation[ ref ] = oppositeMotion + distance; 3217 animation.opacity = 1; 3218 } 3219 3220 // Animate 3221 element.animate( animation, { 3222 queue: false, 3223 duration: options.duration, 3224 easing: options.easing, 3225 complete: done 3226 } ); 3227} ); 3228 3229 3230/*! 3231 * jQuery UI Effects Explode 1.12.0 3232 * http://jqueryui.com 3233 * 3234 * Copyright jQuery Foundation and other contributors 3235 * Released under the MIT license. 3236 * http://jquery.org/license 3237 */ 3238 3239//>>label: Explode Effect 3240//>>group: Effects 3241// jscs:disable maximumLineLength 3242//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness. 3243// jscs:enable maximumLineLength 3244//>>docs: http://api.jqueryui.com/explode-effect/ 3245//>>demos: http://jqueryui.com/effect/ 3246 3247 3248 3249var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) { 3250 3251 var i, j, left, top, mx, my, 3252 rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3, 3253 cells = rows, 3254 element = $( this ), 3255 mode = options.mode, 3256 show = mode === "show", 3257 3258 // Show and then visibility:hidden the element before calculating offset 3259 offset = element.show().css( "visibility", "hidden" ).offset(), 3260 3261 // Width and height of a piece 3262 width = Math.ceil( element.outerWidth() / cells ), 3263 height = Math.ceil( element.outerHeight() / rows ), 3264 pieces = []; 3265 3266 // Children animate complete: 3267 function childComplete() { 3268 pieces.push( this ); 3269 if ( pieces.length === rows * cells ) { 3270 animComplete(); 3271 } 3272 } 3273 3274 // Clone the element for each row and cell. 3275 for ( i = 0; i < rows; i++ ) { // ===> 3276 top = offset.top + i * height; 3277 my = i - ( rows - 1 ) / 2; 3278 3279 for ( j = 0; j < cells; j++ ) { // ||| 3280 left = offset.left + j * width; 3281 mx = j - ( cells - 1 ) / 2; 3282 3283 // Create a clone of the now hidden main element that will be absolute positioned 3284 // within a wrapper div off the -left and -top equal to size of our pieces 3285 element 3286 .clone() 3287 .appendTo( "body" ) 3288 .wrap( "<div></div>" ) 3289 .css( { 3290 position: "absolute", 3291 visibility: "visible", 3292 left: -j * width, 3293 top: -i * height 3294 } ) 3295 3296 // Select the wrapper - make it overflow: hidden and absolute positioned based on 3297 // where the original was located +left and +top equal to the size of pieces 3298 .parent() 3299 .addClass( "ui-effects-explode" ) 3300 .css( { 3301 position: "absolute", 3302 overflow: "hidden", 3303 width: width, 3304 height: height, 3305 left: left + ( show ? mx * width : 0 ), 3306 top: top + ( show ? my * height : 0 ), 3307 opacity: show ? 0 : 1 3308 } ) 3309 .animate( { 3310 left: left + ( show ? 0 : mx * width ), 3311 top: top + ( show ? 0 : my * height ), 3312 opacity: show ? 1 : 0 3313 }, options.duration || 500, options.easing, childComplete ); 3314 } 3315 } 3316 3317 function animComplete() { 3318 element.css( { 3319 visibility: "visible" 3320 } ); 3321 $( pieces ).remove(); 3322 done(); 3323 } 3324} ); 3325 3326 3327/*! 3328 * jQuery UI Effects Fade 1.12.0 3329 * http://jqueryui.com 3330 * 3331 * Copyright jQuery Foundation and other contributors 3332 * Released under the MIT license. 3333 * http://jquery.org/license 3334 */ 3335 3336//>>label: Fade Effect 3337//>>group: Effects 3338//>>description: Fades the element. 3339//>>docs: http://api.jqueryui.com/fade-effect/ 3340//>>demos: http://jqueryui.com/effect/ 3341 3342 3343 3344var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) { 3345 var show = options.mode === "show"; 3346 3347 $( this ) 3348 .css( "opacity", show ? 0 : 1 ) 3349 .animate( { 3350 opacity: show ? 1 : 0 3351 }, { 3352 queue: false, 3353 duration: options.duration, 3354 easing: options.easing, 3355 complete: done 3356 } ); 3357} ); 3358 3359 3360/*! 3361 * jQuery UI Effects Fold 1.12.0 3362 * http://jqueryui.com 3363 * 3364 * Copyright jQuery Foundation and other contributors 3365 * Released under the MIT license. 3366 * http://jquery.org/license 3367 */ 3368 3369//>>label: Fold Effect 3370//>>group: Effects 3371//>>description: Folds an element first horizontally and then vertically. 3372//>>docs: http://api.jqueryui.com/fold-effect/ 3373//>>demos: http://jqueryui.com/effect/ 3374 3375 3376 3377var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) { 3378 3379 // Create element 3380 var element = $( this ), 3381 mode = options.mode, 3382 show = mode === "show", 3383 hide = mode === "hide", 3384 size = options.size || 15, 3385 percent = /([0-9]+)%/.exec( size ), 3386 horizFirst = !!options.horizFirst, 3387 ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ], 3388 duration = options.duration / 2, 3389 3390 placeholder = $.effects.createPlaceholder( element ), 3391 3392 start = element.cssClip(), 3393 animation1 = { clip: $.extend( {}, start ) }, 3394 animation2 = { clip: $.extend( {}, start ) }, 3395 3396 distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ], 3397 3398 queuelen = element.queue().length; 3399 3400 if ( percent ) { 3401 size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; 3402 } 3403 animation1.clip[ ref[ 0 ] ] = size; 3404 animation2.clip[ ref[ 0 ] ] = size; 3405 animation2.clip[ ref[ 1 ] ] = 0; 3406 3407 if ( show ) { 3408 element.cssClip( animation2.clip ); 3409 if ( placeholder ) { 3410 placeholder.css( $.effects.clipToBox( animation2 ) ); 3411 } 3412 3413 animation2.clip = start; 3414 } 3415 3416 // Animate 3417 element 3418 .queue( function( next ) { 3419 if ( placeholder ) { 3420 placeholder 3421 .animate( $.effects.clipToBox( animation1 ), duration, options.easing ) 3422 .animate( $.effects.clipToBox( animation2 ), duration, options.easing ); 3423 } 3424 3425 next(); 3426 } ) 3427 .animate( animation1, duration, options.easing ) 3428 .animate( animation2, duration, options.easing ) 3429 .queue( done ); 3430 3431 $.effects.unshift( element, queuelen, 4 ); 3432} ); 3433 3434 3435/*! 3436 * jQuery UI Effects Highlight 1.12.0 3437 * http://jqueryui.com
vendor: 6,249 bytes, lines 3438-3657
3438 * 3439 * Copyright jQuery Foundation and other contributors 3440 * Released under the MIT license. 3441 * http://jquery.org/license 3442 */ 3443 3444//>>label: Highlight Effect 3445//>>group: Effects 3446//>>description: Highlights the background of an element in a defined color for a custom duration. 3447//>>docs: http://api.jqueryui.com/highlight-effect/ 3448//>>demos: http://jqueryui.com/effect/ 3449 3450 3451 3452var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) { 3453 var element = $( this ), 3454 animation = { 3455 backgroundColor: element.css( "backgroundColor" ) 3456 }; 3457 3458 if ( options.mode === "hide" ) { 3459 animation.opacity = 0; 3460 } 3461 3462 $.effects.saveStyle( element ); 3463 3464 element 3465 .css( { 3466 backgroundImage: "none", 3467 backgroundColor: options.color || "#ffff99" 3468 } ) 3469 .animate( animation, { 3470 queue: false, 3471 duration: options.duration, 3472 easing: options.easing, 3473 complete: done 3474 } ); 3475} ); 3476 3477 3478/*! 3479 * jQuery UI Effects Size 1.12.0 3480 * http://jqueryui.com 3481 * 3482 * Copyright jQuery Foundation and other contributors 3483 * Released under the MIT license. 3484 * http://jquery.org/license 3485 */ 3486 3487//>>label: Size Effect 3488//>>group: Effects 3489//>>description: Resize an element to a specified width and height. 3490//>>docs: http://api.jqueryui.com/size-effect/ 3491//>>demos: http://jqueryui.com/effect/ 3492 3493 3494 3495var effectsEffectSize = $.effects.define( "size", function( options, done ) { 3496 3497 // Create element 3498 var baseline, factor, temp, 3499 element = $( this ), 3500 3501 // Copy for children 3502 cProps = [ "fontSize" ], 3503 vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], 3504 hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], 3505 3506 // Set options 3507 mode = options.mode, 3508 restore = mode !== "effect", 3509 scale = options.scale || "both", 3510 origin = options.origin || [ "middle", "center" ], 3511 position = element.css( "position" ), 3512 pos = element.position(), 3513 original = $.effects.scaledDimensions( element ), 3514 from = options.from || original, 3515 to = options.to || $.effects.scaledDimensions( element, 0 ); 3516 3517 $.effects.createPlaceholder( element ); 3518 3519 if ( mode === "show" ) { 3520 temp = from; 3521 from = to; 3522 to = temp; 3523 } 3524 3525 // Set scaling factor 3526 factor = { 3527 from: { 3528 y: from.height / original.height, 3529 x: from.width / original.width 3530 }, 3531 to: { 3532 y: to.height / original.height, 3533 x: to.width / original.width 3534 } 3535 }; 3536 3537 // Scale the css box 3538 if ( scale === "box" || scale === "both" ) { 3539 3540 // Vertical props scaling 3541 if ( factor.from.y !== factor.to.y ) { 3542 from = $.effects.setTransition( element, vProps, factor.from.y, from ); 3543 to = $.effects.setTransition( element, vProps, factor.to.y, to ); 3544 } 3545 3546 // Horizontal props scaling 3547 if ( factor.from.x !== factor.to.x ) { 3548 from = $.effects.setTransition( element, hProps, factor.from.x, from ); 3549 to = $.effects.setTransition( element, hProps, factor.to.x, to ); 3550 } 3551 } 3552 3553 // Scale the content 3554 if ( scale === "content" || scale === "both" ) { 3555 3556 // Vertical props scaling 3557 if ( factor.from.y !== factor.to.y ) { 3558 from = $.effects.setTransition( element, cProps, factor.from.y, from ); 3559 to = $.effects.setTransition( element, cProps, factor.to.y, to ); 3560 } 3561 } 3562 3563 // Adjust the position properties based on the provided origin points 3564 if ( origin ) { 3565 baseline = $.effects.getBaseline( origin, original ); 3566 from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top; 3567 from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left; 3568 to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top; 3569 to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left; 3570 } 3571 element.css( from ); 3572 3573 // Animate the children if desired 3574 if ( scale === "content" || scale === "both" ) { 3575 3576 vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps ); 3577 hProps = hProps.concat( [ "marginLeft", "marginRight" ] ); 3578 3579 // Only animate children with width attributes specified 3580 // TODO: is this right? should we include anything with css width specified as well 3581 element.find( "*[width]" ).each( function() { 3582 var child = $( this ), 3583 childOriginal = $.effects.scaledDimensions( child ), 3584 childFrom = { 3585 height: childOriginal.height * factor.from.y, 3586 width: childOriginal.width * factor.from.x, 3587 outerHeight: childOriginal.outerHeight * factor.from.y, 3588 outerWidth: childOriginal.outerWidth * factor.from.x 3589 }, 3590 childTo = { 3591 height: childOriginal.height * factor.to.y, 3592 width: childOriginal.width * factor.to.x, 3593 outerHeight: childOriginal.height * factor.to.y, 3594 outerWidth: childOriginal.width * factor.to.x 3595 }; 3596 3597 // Vertical props scaling 3598 if ( factor.from.y !== factor.to.y ) { 3599 childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom ); 3600 childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo ); 3601 } 3602 3603 // Horizontal props scaling 3604 if ( factor.from.x !== factor.to.x ) { 3605 childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom ); 3606 childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo ); 3607 } 3608 3609 if ( restore ) { 3610 $.effects.saveStyle( child ); 3611 } 3612 3613 // Animate children 3614 child.css( childFrom ); 3615 child.animate( childTo, options.duration, options.easing, function() { 3616 3617 // Restore children 3618 if ( restore ) { 3619 $.effects.restoreStyle( child ); 3620 } 3621 } ); 3622 } ); 3623 } 3624 3625 // Animate 3626 element.animate( to, { 3627 queue: false, 3628 duration: options.duration, 3629 easing: options.easing, 3630 complete: function() { 3631 3632 var offset = element.offset(); 3633 3634 if ( to.opacity === 0 ) { 3635 element.css( "opacity", from.opacity ); 3636 } 3637 3638 if ( !restore ) { 3639 element 3640 .css( "position", position === "static" ? "relative" : position ) 3641 .offset( offset ); 3642 3643 // Need to save style here so that automatic style restoration 3644 // doesn't restore to the original styles from before the animation. 3645 $.effects.saveStyle( element ); 3646 } 3647 3648 done(); 3649 } 3650 } ); 3651 3652} ); 3653 3654 3655/*! 3656 * jQuery UI Effects Scale 1.12.0 3657 * http://jqueryui.com
vendor: 4,797 bytes, lines 3658-3835
3658 * 3659 * Copyright jQuery Foundation and other contributors 3660 * Released under the MIT license. 3661 * http://jquery.org/license 3662 */ 3663 3664//>>label: Scale Effect 3665//>>group: Effects 3666//>>description: Grows or shrinks an element and its content. 3667//>>docs: http://api.jqueryui.com/scale-effect/ 3668//>>demos: http://jqueryui.com/effect/ 3669 3670 3671 3672var effectsEffectScale = $.effects.define( "scale", function( options, done ) { 3673 3674 // Create element 3675 var el = $( this ), 3676 mode = options.mode, 3677 percent = parseInt( options.percent, 10 ) || 3678 ( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ), 3679 3680 newOptions = $.extend( true, { 3681 from: $.effects.scaledDimensions( el ), 3682 to: $.effects.scaledDimensions( el, percent, options.direction || "both" ), 3683 origin: options.origin || [ "middle", "center" ] 3684 }, options ); 3685 3686 // Fade option to support puff 3687 if ( options.fade ) { 3688 newOptions.from.opacity = 1; 3689 newOptions.to.opacity = 0; 3690 } 3691 3692 $.effects.effect.size.call( this, newOptions, done ); 3693} ); 3694 3695 3696/*! 3697 * jQuery UI Effects Puff 1.12.0 3698 * http://jqueryui.com 3699 * 3700 * Copyright jQuery Foundation and other contributors 3701 * Released under the MIT license. 3702 * http://jquery.org/license 3703 */ 3704 3705//>>label: Puff Effect 3706//>>group: Effects 3707//>>description: Creates a puff effect by scaling the element up and hiding it at the same time. 3708//>>docs: http://api.jqueryui.com/puff-effect/ 3709//>>demos: http://jqueryui.com/effect/ 3710 3711 3712 3713var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) { 3714 var newOptions = $.extend( true, {}, options, { 3715 fade: true, 3716 percent: parseInt( options.percent, 10 ) || 150 3717 } ); 3718 3719 $.effects.effect.scale.call( this, newOptions, done ); 3720} ); 3721 3722 3723/*! 3724 * jQuery UI Effects Pulsate 1.12.0 3725 * http://jqueryui.com 3726 * 3727 * Copyright jQuery Foundation and other contributors 3728 * Released under the MIT license. 3729 * http://jquery.org/license 3730 */ 3731 3732//>>label: Pulsate Effect 3733//>>group: Effects 3734//>>description: Pulsates an element n times by changing the opacity to zero and back. 3735//>>docs: http://api.jqueryui.com/pulsate-effect/ 3736//>>demos: http://jqueryui.com/effect/ 3737 3738 3739 3740var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) { 3741 var element = $( this ), 3742 mode = options.mode, 3743 show = mode === "show", 3744 hide = mode === "hide", 3745 showhide = show || hide, 3746 3747 // Showing or hiding leaves off the "last" animation 3748 anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), 3749 duration = options.duration / anims, 3750 animateTo = 0, 3751 i = 1, 3752 queuelen = element.queue().length; 3753 3754 if ( show || !element.is( ":visible" ) ) { 3755 element.css( "opacity", 0 ).show(); 3756 animateTo = 1; 3757 } 3758 3759 // Anims - 1 opacity "toggles" 3760 for ( ; i < anims; i++ ) { 3761 element.animate( { opacity: animateTo }, duration, options.easing ); 3762 animateTo = 1 - animateTo; 3763 } 3764 3765 element.animate( { opacity: animateTo }, duration, options.easing ); 3766 3767 element.queue( done ); 3768 3769 $.effects.unshift( element, queuelen, anims + 1 ); 3770} ); 3771 3772 3773/*! 3774 * jQuery UI Effects Shake 1.12.0 3775 * http://jqueryui.com 3776 * 3777 * Copyright jQuery Foundation and other contributors 3778 * Released under the MIT license. 3779 * http://jquery.org/license 3780 */ 3781 3782//>>label: Shake Effect 3783//>>group: Effects 3784//>>description: Shakes an element horizontally or vertically n times. 3785//>>docs: http://api.jqueryui.com/shake-effect/ 3786//>>demos: http://jqueryui.com/effect/ 3787 3788 3789 3790var effectsEffectShake = $.effects.define( "shake", function( options, done ) { 3791 3792 var i = 1, 3793 element = $( this ), 3794 direction = options.direction || "left", 3795 distance = options.distance || 20, 3796 times = options.times || 3, 3797 anims = times * 2 + 1, 3798 speed = Math.round( options.duration / anims ), 3799 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3800 positiveMotion = ( direction === "up" || direction === "left" ), 3801 animation = {}, 3802 animation1 = {}, 3803 animation2 = {}, 3804 3805 queuelen = element.queue().length; 3806 3807 $.effects.createPlaceholder( element ); 3808 3809 // Animation 3810 animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; 3811 animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; 3812 animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; 3813 3814 // Animate 3815 element.animate( animation, speed, options.easing ); 3816 3817 // Shakes 3818 for ( ; i < times; i++ ) { 3819 element 3820 .animate( animation1, speed, options.easing ) 3821 .animate( animation2, speed, options.easing ); 3822 } 3823 3824 element 3825 .animate( animation1, speed, options.easing ) 3826 .animate( animation, speed / 2, options.easing ) 3827 .queue( done ); 3828 3829 $.effects.unshift( element, queuelen, anims + 1 ); 3830} ); 3831 3832 3833/*! 3834 * jQuery UI Effects Slide 1.12.0 3835 * http://jqueryui.com
vendor: 4,781 bytes, lines 3836-4007
3836 * 3837 * Copyright jQuery Foundation and other contributors 3838 * Released under the MIT license. 3839 * http://jquery.org/license 3840 */ 3841 3842//>>label: Slide Effect 3843//>>group: Effects 3844//>>description: Slides an element in and out of the viewport. 3845//>>docs: http://api.jqueryui.com/slide-effect/ 3846//>>demos: http://jqueryui.com/effect/ 3847 3848 3849 3850var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) { 3851 var startClip, startRef, 3852 element = $( this ), 3853 map = { 3854 up: [ "bottom", "top" ], 3855 down: [ "top", "bottom" ], 3856 left: [ "right", "left" ], 3857 right: [ "left", "right" ] 3858 }, 3859 mode = options.mode, 3860 direction = options.direction || "left", 3861 ref = ( direction === "up" || direction === "down" ) ? "top" : "left", 3862 positiveMotion = ( direction === "up" || direction === "left" ), 3863 distance = options.distance || 3864 element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ), 3865 animation = {}; 3866 3867 $.effects.createPlaceholder( element ); 3868 3869 startClip = element.cssClip(); 3870 startRef = element.position()[ ref ]; 3871 3872 // Define hide animation 3873 animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef; 3874 animation.clip = element.cssClip(); 3875 animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ]; 3876 3877 // Reverse the animation if we're showing 3878 if ( mode === "show" ) { 3879 element.cssClip( animation.clip ); 3880 element.css( ref, animation[ ref ] ); 3881 animation.clip = startClip; 3882 animation[ ref ] = startRef; 3883 } 3884 3885 // Actually animate 3886 element.animate( animation, { 3887 queue: false, 3888 duration: options.duration, 3889 easing: options.easing, 3890 complete: done 3891 } ); 3892} ); 3893 3894 3895/*! 3896 * jQuery UI Effects Transfer 1.12.0 3897 * http://jqueryui.com 3898 * 3899 * Copyright jQuery Foundation and other contributors 3900 * Released under the MIT license. 3901 * http://jquery.org/license 3902 */ 3903 3904//>>label: Transfer Effect 3905//>>group: Effects 3906//>>description: Displays a transfer effect from one element to another. 3907//>>docs: http://api.jqueryui.com/transfer-effect/ 3908//>>demos: http://jqueryui.com/effect/ 3909 3910 3911 3912var effect; 3913if ( $.uiBackCompat !== false ) { 3914 effect = $.effects.define( "transfer", function( options, done ) { 3915 $( this ).transfer( options, done ); 3916 } ); 3917} 3918var effectsEffectTransfer = effect; 3919 3920 3921/*! 3922 * jQuery UI Focusable 1.12.0 3923 * http://jqueryui.com 3924 * 3925 * Copyright jQuery Foundation and other contributors 3926 * Released under the MIT license. 3927 * http://jquery.org/license 3928 */ 3929 3930//>>label: :focusable Selector 3931//>>group: Core 3932//>>description: Selects elements which can be focused. 3933//>>docs: http://api.jqueryui.com/focusable-selector/ 3934 3935 3936 3937// Selectors 3938$.ui.focusable = function( element, hasTabindex ) { 3939 var map, mapName, img, focusableIfVisible, fieldset, 3940 nodeName = element.nodeName.toLowerCase(); 3941 3942 if ( "area" === nodeName ) { 3943 map = element.parentNode; 3944 mapName = map.name; 3945 if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { 3946 return false; 3947 } 3948 img = $( "img[usemap='#" + mapName + "']" ); 3949 return img.length > 0 && img.is( ":visible" ); 3950 } 3951 3952 if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { 3953 focusableIfVisible = !element.disabled; 3954 3955 if ( focusableIfVisible ) { 3956 3957 // Form controls within a disabled fieldset are disabled. 3958 // However, controls within the fieldset's legend do not get disabled. 3959 // Since controls generally aren't placed inside legends, we skip 3960 // this portion of the check. 3961 fieldset = $( element ).closest( "fieldset" )[ 0 ]; 3962 if ( fieldset ) { 3963 focusableIfVisible = !fieldset.disabled; 3964 } 3965 } 3966 } else if ( "a" === nodeName ) { 3967 focusableIfVisible = element.href || hasTabindex; 3968 } else { 3969 focusableIfVisible = hasTabindex; 3970 } 3971 3972 return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); 3973}; 3974 3975// Support: IE 8 only 3976// IE 8 doesn't resolve inherit to visible/hidden for computed values 3977function visible( element ) { 3978 var visibility = element.css( "visibility" ); 3979 while ( visibility === "inherit" ) { 3980 element = element.parent(); 3981 visibility = element.css( "visibility" ); 3982 } 3983 return visibility !== "hidden"; 3984} 3985 3986$.extend( $.expr[ ":" ], { 3987 focusable: function( element ) { 3988 return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); 3989 } 3990} ); 3991 3992var focusable = $.ui.focusable; 3993 3994 3995 3996 3997// Support: IE8 Only 3998// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop 3999// with a string, so we need to find the proper form. 4000var form = $.fn.form = function() { 4001 return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); 4002}; 4003 4004 4005/*! 4006 * jQuery UI Form Reset Mixin 1.12.0 4007 * http://jqueryui.com
vendor: 4,779 bytes, lines 4008-4195
4008 * 4009 * Copyright jQuery Foundation and other contributors 4010 * Released under the MIT license. 4011 * http://jquery.org/license 4012 */ 4013 4014//>>label: Form Reset Mixin 4015//>>group: Core 4016//>>description: Refresh input widgets when their form is reset 4017//>>docs: http://api.jqueryui.com/form-reset-mixin/ 4018 4019 4020 4021var formResetMixin = $.ui.formResetMixin = { 4022 _formResetHandler: function() { 4023 var form = $( this ); 4024 4025 // Wait for the form reset to actually happen before refreshing 4026 setTimeout( function() { 4027 var instances = form.data( "ui-form-reset-instances" ); 4028 $.each( instances, function() { 4029 this.refresh(); 4030 } ); 4031 } ); 4032 }, 4033 4034 _bindFormResetHandler: function() { 4035 this.form = this.element.form(); 4036 if ( !this.form.length ) { 4037 return; 4038 } 4039 4040 var instances = this.form.data( "ui-form-reset-instances" ) || []; 4041 if ( !instances.length ) { 4042 4043 // We don't use _on() here because we use a single event handler per form 4044 this.form.on( "reset.ui-form-reset", this._formResetHandler ); 4045 } 4046 instances.push( this ); 4047 this.form.data( "ui-form-reset-instances", instances ); 4048 }, 4049 4050 _unbindFormResetHandler: function() { 4051 if ( !this.form.length ) { 4052 return; 4053 } 4054 4055 var instances = this.form.data( "ui-form-reset-instances" ); 4056 instances.splice( $.inArray( this, instances ), 1 ); 4057 if ( instances.length ) { 4058 this.form.data( "ui-form-reset-instances", instances ); 4059 } else { 4060 this.form 4061 .removeData( "ui-form-reset-instances" ) 4062 .off( "reset.ui-form-reset" ); 4063 } 4064 } 4065}; 4066 4067 4068/*! 4069 * jQuery UI Support for jQuery core 1.7.x 1.12.0 4070 * http://jqueryui.com 4071 * 4072 * Copyright jQuery Foundation and other contributors 4073 * Released under the MIT license. 4074 * http://jquery.org/license 4075 * 4076 */ 4077 4078//>>label: jQuery 1.7 Support 4079//>>group: Core 4080//>>description: Support version 1.7.x of jQuery core 4081 4082 4083 4084// Support: jQuery 1.7 only 4085// Not a great way to check versions, but since we only support 1.7+ and only 4086// need to detect <1.8, this is a simple check that should suffice. Checking 4087// for "1.7." would be a bit safer, but the version string is 1.7, not 1.7.0 4088// and we'll never reach 1.70.0 (if we do, we certainly won't be supporting 4089// 1.7 anymore). See #11197 for why we're not using feature detection. 4090if ( $.fn.jquery.substring( 0, 3 ) === "1.7" ) { 4091 4092 // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight() 4093 // Unlike jQuery Core 1.8+, these only support numeric values to set the 4094 // dimensions in pixels 4095 $.each( [ "Width", "Height" ], function( i, name ) { 4096 var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], 4097 type = name.toLowerCase(), 4098 orig = { 4099 innerWidth: $.fn.innerWidth, 4100 innerHeight: $.fn.innerHeight, 4101 outerWidth: $.fn.outerWidth, 4102 outerHeight: $.fn.outerHeight 4103 }; 4104 4105 function reduce( elem, size, border, margin ) { 4106 $.each( side, function() { 4107 size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; 4108 if ( border ) { 4109 size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; 4110 } 4111 if ( margin ) { 4112 size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; 4113 } 4114 } ); 4115 return size; 4116 } 4117 4118 $.fn[ "inner" + name ] = function( size ) { 4119 if ( size === undefined ) { 4120 return orig[ "inner" + name ].call( this ); 4121 } 4122 4123 return this.each( function() { 4124 $( this ).css( type, reduce( this, size ) + "px" ); 4125 } ); 4126 }; 4127 4128 $.fn[ "outer" + name ] = function( size, margin ) { 4129 if ( typeof size !== "number" ) { 4130 return orig[ "outer" + name ].call( this, size ); 4131 } 4132 4133 return this.each( function() { 4134 $( this ).css( type, reduce( this, size, true, margin ) + "px" ); 4135 } ); 4136 }; 4137 } ); 4138 4139 $.fn.addBack = function( selector ) { 4140 return this.add( selector == null ? 4141 this.prevObject : this.prevObject.filter( selector ) 4142 ); 4143 }; 4144} 4145 4146; 4147/*! 4148 * jQuery UI Keycode 1.12.0 4149 * http://jqueryui.com 4150 * 4151 * Copyright jQuery Foundation and other contributors 4152 * Released under the MIT license. 4153 * http://jquery.org/license 4154 */ 4155 4156//>>label: Keycode 4157//>>group: Core 4158//>>description: Provide keycodes as keynames 4159//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ 4160 4161 4162var keycode = $.ui.keyCode = { 4163 BACKSPACE: 8, 4164 COMMA: 188, 4165 DELETE: 46, 4166 DOWN: 40, 4167 END: 35, 4168 ENTER: 13, 4169 ESCAPE: 27, 4170 HOME: 36, 4171 LEFT: 37, 4172 PAGE_DOWN: 34, 4173 PAGE_UP: 33, 4174 PERIOD: 190, 4175 RIGHT: 39, 4176 SPACE: 32, 4177 TAB: 9, 4178 UP: 38 4179}; 4180 4181 4182 4183 4184// Internal use only 4185var escapeSelector = $.ui.escapeSelector = ( function() { 4186 var selectorEscape = /([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g; 4187 return function( selector ) { 4188 return selector.replace( selectorEscape, "\\$1" ); 4189 }; 4190} )(); 4191 4192 4193/*! 4194 * jQuery UI Labels 1.12.0 4195 * http://jqueryui.com
vendor: 5,256 bytes, lines 4196-4399
4196 * 4197 * Copyright jQuery Foundation and other contributors 4198 * Released under the MIT license. 4199 * http://jquery.org/license 4200 */ 4201 4202//>>label: labels 4203//>>group: Core 4204//>>description: Find all the labels associated with a given input 4205//>>docs: http://api.jqueryui.com/labels/ 4206 4207 4208 4209var labels = $.fn.labels = function() { 4210 var ancestor, selector, id, labels, ancestors; 4211 4212 // Check control.labels first 4213 if ( this[ 0 ].labels && this[ 0 ].labels.length ) { 4214 return this.pushStack( this[ 0 ].labels ); 4215 } 4216 4217 // Support: IE <= 11, FF <= 37, Android <= 2.3 only 4218 // Above browsers do not support control.labels. Everything below is to support them 4219 // as well as document fragments. control.labels does not work on document fragments 4220 labels = this.eq( 0 ).parents( "label" ); 4221 4222 // Look for the label based on the id 4223 id = this.attr( "id" ); 4224 if ( id ) { 4225 4226 // We don't search against the document in case the element 4227 // is disconnected from the DOM 4228 ancestor = this.eq( 0 ).parents().last(); 4229 4230 // Get a full set of top level ancestors 4231 ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); 4232 4233 // Create a selector for the label based on the id 4234 selector = "label[for='" + $.ui.escapeSelector( id ) + "']"; 4235 4236 labels = labels.add( ancestors.find( selector ).addBack( selector ) ); 4237 4238 } 4239 4240 // Return whatever we have found for labels 4241 return this.pushStack( labels ); 4242}; 4243 4244 4245/*! 4246 * jQuery UI Scroll Parent 1.12.0 4247 * http://jqueryui.com 4248 * 4249 * Copyright jQuery Foundation and other contributors 4250 * Released under the MIT license. 4251 * http://jquery.org/license 4252 */ 4253 4254//>>label: scrollParent 4255//>>group: Core 4256//>>description: Get the closest ancestor element that is scrollable. 4257//>>docs: http://api.jqueryui.com/scrollParent/ 4258 4259 4260 4261var scrollParent = $.fn.scrollParent = function( includeHidden ) { 4262 var position = this.css( "position" ), 4263 excludeStaticParent = position === "absolute", 4264 overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, 4265 scrollParent = this.parents().filter( function() { 4266 var parent = $( this ); 4267 if ( excludeStaticParent && parent.css( "position" ) === "static" ) { 4268 return false; 4269 } 4270 return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + 4271 parent.css( "overflow-x" ) ); 4272 } ).eq( 0 ); 4273 4274 return position === "fixed" || !scrollParent.length ? 4275 $( this[ 0 ].ownerDocument || document ) : 4276 scrollParent; 4277}; 4278 4279 4280/*! 4281 * jQuery UI Tabbable 1.12.0 4282 * http://jqueryui.com 4283 * 4284 * Copyright jQuery Foundation and other contributors 4285 * Released under the MIT license. 4286 * http://jquery.org/license 4287 */ 4288 4289//>>label: :tabbable Selector 4290//>>group: Core 4291//>>description: Selects elements which can be tabbed to. 4292//>>docs: http://api.jqueryui.com/tabbable-selector/ 4293 4294 4295 4296var tabbable = $.extend( $.expr[ ":" ], { 4297 tabbable: function( element ) { 4298 var tabIndex = $.attr( element, "tabindex" ), 4299 hasTabindex = tabIndex != null; 4300 return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex ); 4301 } 4302} ); 4303 4304 4305/*! 4306 * jQuery UI Unique ID 1.12.0 4307 * http://jqueryui.com 4308 * 4309 * Copyright jQuery Foundation and other contributors 4310 * Released under the MIT license. 4311 * http://jquery.org/license 4312 */ 4313 4314//>>label: uniqueId 4315//>>group: Core 4316//>>description: Functions to generate and remove uniqueId's 4317//>>docs: http://api.jqueryui.com/uniqueId/ 4318 4319 4320 4321var uniqueId = $.fn.extend( { 4322 uniqueId: ( function() { 4323 var uuid = 0; 4324 4325 return function() { 4326 return this.each( function() { 4327 if ( !this.id ) { 4328 this.id = "ui-id-" + ( ++uuid ); 4329 } 4330 } ); 4331 }; 4332 } )(), 4333 4334 removeUniqueId: function() { 4335 return this.each( function() { 4336 if ( /^ui-id-\d+$/.test( this.id ) ) { 4337 $( this ).removeAttr( "id" ); 4338 } 4339 } ); 4340 } 4341} ); 4342 4343 4344/*! 4345 * jQuery UI Accordion 1.12.0 4346 * http://jqueryui.com 4347 * 4348 * Copyright jQuery Foundation and other contributors 4349 * Released under the MIT license. 4350 * http://jquery.org/license 4351 */ 4352 4353//>>label: Accordion 4354//>>group: Widgets 4355// jscs:disable maximumLineLength 4356//>>description: Displays collapsible content panels for presenting information in a limited amount of space. 4357// jscs:enable maximumLineLength 4358//>>docs: http://api.jqueryui.com/accordion/ 4359//>>demos: http://jqueryui.com/accordion/ 4360//>>css.structure: ../../themes/base/core.css 4361//>>css.structure: ../../themes/base/accordion.css 4362//>>css.theme: ../../themes/base/theme.css 4363 4364 4365 4366var widgetsAccordion = $.widget( "ui.accordion", { 4367 version: "1.12.0", 4368 options: { 4369 active: 0, 4370 animate: {}, 4371 classes: { 4372 "ui-accordion-header": "ui-corner-top", 4373 "ui-accordion-header-collapsed": "ui-corner-all", 4374 "ui-accordion-content": "ui-corner-bottom" 4375 }, 4376 collapsible: false, 4377 event: "click", 4378 header: "> li > :first-child, > :not(li):even", 4379 heightStyle: "auto", 4380 icons: { 4381 activeHeader: "ui-icon-triangle-1-s", 4382 header: "ui-icon-triangle-1-e" 4383 }, 4384 4385 // Callbacks 4386 activate: null, 4387 beforeActivate: null 4388 }, 4389 4390 hideProps: { 4391 borderTopWidth: "hide", 4392 borderBottomWidth: "hide", 4393 paddingTop: "hide", 4394 paddingBottom: "hide", 4395 height: "hide" 4396 }, 4397 4398 showProps: { 4399 borderTopWidth: "show",
vendor: 5,248 bytes, lines 4400-4602
4400 borderBottomWidth: "show", 4401 paddingTop: "show", 4402 paddingBottom: "show", 4403 height: "show" 4404 }, 4405 4406 _create: function() { 4407 var options = this.options; 4408 4409 this.prevShow = this.prevHide = $(); 4410 this._addClass( "ui-accordion", "ui-widget ui-helper-reset" ); 4411 this.element.attr( "role", "tablist" ); 4412 4413 // Don't allow collapsible: false and active: false / null 4414 if ( !options.collapsible && ( options.active === false || options.active == null ) ) { 4415 options.active = 0; 4416 } 4417 4418 this._processPanels(); 4419 4420 // handle negative values 4421 if ( options.active < 0 ) { 4422 options.active += this.headers.length; 4423 } 4424 this._refresh(); 4425 }, 4426 4427 _getCreateEventData: function() { 4428 return { 4429 header: this.active, 4430 panel: !this.active.length ? $() : this.active.next() 4431 }; 4432 }, 4433 4434 _createIcons: function() { 4435 var icon, children, 4436 icons = this.options.icons; 4437 4438 if ( icons ) { 4439 icon = $( "<span>" ); 4440 this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header ); 4441 icon.prependTo( this.headers ); 4442 children = this.active.children( ".ui-accordion-header-icon" ); 4443 this._removeClass( children, icons.header ) 4444 ._addClass( children, null, icons.activeHeader ) 4445 ._addClass( this.headers, "ui-accordion-icons" ); 4446 } 4447 }, 4448 4449 _destroyIcons: function() { 4450 this._removeClass( this.headers, "ui-accordion-icons" ); 4451 this.headers.children( ".ui-accordion-header-icon" ).remove(); 4452 }, 4453 4454 _destroy: function() { 4455 var contents; 4456 4457 // Clean up main element 4458 this.element.removeAttr( "role" ); 4459 4460 // Clean up headers 4461 this.headers 4462 .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) 4463 .removeUniqueId(); 4464 4465 this._destroyIcons(); 4466 4467 // Clean up content panels 4468 contents = this.headers.next() 4469 .css( "display", "" ) 4470 .removeAttr( "role aria-hidden aria-labelledby" ) 4471 .removeUniqueId(); 4472 4473 if ( this.options.heightStyle !== "content" ) { 4474 contents.css( "height", "" ); 4475 } 4476 }, 4477 4478 _setOption: function( key, value ) { 4479 if ( key === "active" ) { 4480 4481 // _activate() will handle invalid values and update this.options 4482 this._activate( value ); 4483 return; 4484 } 4485 4486 if ( key === "event" ) { 4487 if ( this.options.event ) { 4488 this._off( this.headers, this.options.event ); 4489 } 4490 this._setupEvents( value ); 4491 } 4492 4493 this._super( key, value ); 4494 4495 // Setting collapsible: false while collapsed; open first panel 4496 if ( key === "collapsible" && !value && this.options.active === false ) { 4497 this._activate( 0 ); 4498 } 4499 4500 if ( key === "icons" ) { 4501 this._destroyIcons(); 4502 if ( value ) { 4503 this._createIcons(); 4504 } 4505 } 4506 }, 4507 4508 _setOptionDisabled: function( value ) { 4509 this._super( value ); 4510 4511 this.element.attr( "aria-disabled", value ); 4512 4513 // Support: IE8 Only 4514 // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE 4515 // so we need to add the disabled class to the headers and panels 4516 this._toggleClass( null, "ui-state-disabled", !!value ); 4517 this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled", 4518 !!value ); 4519 }, 4520 4521 _keydown: function( event ) { 4522 if ( event.altKey || event.ctrlKey ) { 4523 return; 4524 } 4525 4526 var keyCode = $.ui.keyCode, 4527 length = this.headers.length, 4528 currentIndex = this.headers.index( event.target ), 4529 toFocus = false; 4530 4531 switch ( event.keyCode ) { 4532 case keyCode.RIGHT: 4533 case keyCode.DOWN: 4534 toFocus = this.headers[ ( currentIndex + 1 ) % length ]; 4535 break; 4536 case keyCode.LEFT: 4537 case keyCode.UP: 4538 toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; 4539 break; 4540 case keyCode.SPACE: 4541 case keyCode.ENTER: 4542 this._eventHandler( event ); 4543 break; 4544 case keyCode.HOME: 4545 toFocus = this.headers[ 0 ]; 4546 break; 4547 case keyCode.END: 4548 toFocus = this.headers[ length - 1 ]; 4549 break; 4550 } 4551 4552 if ( toFocus ) { 4553 $( event.target ).attr( "tabIndex", -1 ); 4554 $( toFocus ).attr( "tabIndex", 0 ); 4555 $( toFocus ).trigger( "focus" ); 4556 event.preventDefault(); 4557 } 4558 }, 4559 4560 _panelKeyDown: function( event ) { 4561 if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { 4562 $( event.currentTarget ).prev().trigger( "focus" ); 4563 } 4564 }, 4565 4566 refresh: function() { 4567 var options = this.options; 4568 this._processPanels(); 4569 4570 // Was collapsed or no panel 4571 if ( ( options.active === false && options.collapsible === true ) || 4572 !this.headers.length ) { 4573 options.active = false; 4574 this.active = $(); 4575 4576 // active false only when collapsible is true 4577 } else if ( options.active === false ) { 4578 this._activate( 0 ); 4579 4580 // was active, but active panel is gone 4581 } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 4582 4583 // all remaining panel are disabled 4584 if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) { 4585 options.active = false; 4586 this.active = $(); 4587 4588 // activate previous panel 4589 } else { 4590 this._activate( Math.max( 0, options.active - 1 ) ); 4591 } 4592 4593 // was active, active panel still exists 4594 } else { 4595 4596 // make sure active index is correct 4597 options.active = this.headers.index( this.active ); 4598 } 4599 4600 this._destroyIcons(); 4601 4602 this._refresh();
vendor: 6,800 bytes, lines 4603-4840
4603 }, 4604 4605 _processPanels: function() { 4606 var prevHeaders = this.headers, 4607 prevPanels = this.panels; 4608 4609 this.headers = this.element.find( this.options.header ); 4610 this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", 4611 "ui-state-default" ); 4612 4613 this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide(); 4614 this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); 4615 4616 // Avoid memory leaks (#10056) 4617 if ( prevPanels ) { 4618 this._off( prevHeaders.not( this.headers ) ); 4619 this._off( prevPanels.not( this.panels ) ); 4620 } 4621 }, 4622 4623 _refresh: function() { 4624 var maxHeight, 4625 options = this.options, 4626 heightStyle = options.heightStyle, 4627 parent = this.element.parent(); 4628 4629 this.active = this._findActive( options.active ); 4630 this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" ) 4631 ._removeClass( this.active, "ui-accordion-header-collapsed" ); 4632 this._addClass( this.active.next(), "ui-accordion-content-active" ); 4633 this.active.next().show(); 4634 4635 this.headers 4636 .attr( "role", "tab" ) 4637 .each( function() { 4638 var header = $( this ), 4639 headerId = header.uniqueId().attr( "id" ), 4640 panel = header.next(), 4641 panelId = panel.uniqueId().attr( "id" ); 4642 header.attr( "aria-controls", panelId ); 4643 panel.attr( "aria-labelledby", headerId ); 4644 } ) 4645 .next() 4646 .attr( "role", "tabpanel" ); 4647 4648 this.headers 4649 .not( this.active ) 4650 .attr( { 4651 "aria-selected": "false", 4652 "aria-expanded": "false", 4653 tabIndex: -1 4654 } ) 4655 .next() 4656 .attr( { 4657 "aria-hidden": "true" 4658 } ) 4659 .hide(); 4660 4661 // Make sure at least one header is in the tab order 4662 if ( !this.active.length ) { 4663 this.headers.eq( 0 ).attr( "tabIndex", 0 ); 4664 } else { 4665 this.active.attr( { 4666 "aria-selected": "true", 4667 "aria-expanded": "true", 4668 tabIndex: 0 4669 } ) 4670 .next() 4671 .attr( { 4672 "aria-hidden": "false" 4673 } ); 4674 } 4675 4676 this._createIcons(); 4677 4678 this._setupEvents( options.event ); 4679 4680 if ( heightStyle === "fill" ) { 4681 maxHeight = parent.height(); 4682 this.element.siblings( ":visible" ).each( function() { 4683 var elem = $( this ), 4684 position = elem.css( "position" ); 4685 4686 if ( position === "absolute" || position === "fixed" ) { 4687 return; 4688 } 4689 maxHeight -= elem.outerHeight( true ); 4690 } ); 4691 4692 this.headers.each( function() { 4693 maxHeight -= $( this ).outerHeight( true ); 4694 } ); 4695 4696 this.headers.next() 4697 .each( function() { 4698 $( this ).height( Math.max( 0, maxHeight - 4699 $( this ).innerHeight() + $( this ).height() ) ); 4700 } ) 4701 .css( "overflow", "auto" ); 4702 } else if ( heightStyle === "auto" ) { 4703 maxHeight = 0; 4704 this.headers.next() 4705 .each( function() { 4706 var isVisible = $( this ).is( ":visible" ); 4707 if ( !isVisible ) { 4708 $( this ).show(); 4709 } 4710 maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); 4711 if ( !isVisible ) { 4712 $( this ).hide(); 4713 } 4714 } ) 4715 .height( maxHeight ); 4716 } 4717 }, 4718 4719 _activate: function( index ) { 4720 var active = this._findActive( index )[ 0 ]; 4721 4722 // Trying to activate the already active panel 4723 if ( active === this.active[ 0 ] ) { 4724 return; 4725 } 4726 4727 // Trying to collapse, simulate a click on the currently active header 4728 active = active || this.active[ 0 ]; 4729 4730 this._eventHandler( { 4731 target: active, 4732 currentTarget: active, 4733 preventDefault: $.noop 4734 } ); 4735 }, 4736 4737 _findActive: function( selector ) { 4738 return typeof selector === "number" ? this.headers.eq( selector ) : $(); 4739 }, 4740 4741 _setupEvents: function( event ) { 4742 var events = { 4743 keydown: "_keydown" 4744 }; 4745 if ( event ) { 4746 $.each( event.split( " " ), function( index, eventName ) { 4747 events[ eventName ] = "_eventHandler"; 4748 } ); 4749 } 4750 4751 this._off( this.headers.add( this.headers.next() ) ); 4752 this._on( this.headers, events ); 4753 this._on( this.headers.next(), { keydown: "_panelKeyDown" } ); 4754 this._hoverable( this.headers ); 4755 this._focusable( this.headers ); 4756 }, 4757 4758 _eventHandler: function( event ) { 4759 var activeChildren, clickedChildren, 4760 options = this.options, 4761 active = this.active, 4762 clicked = $( event.currentTarget ), 4763 clickedIsActive = clicked[ 0 ] === active[ 0 ], 4764 collapsing = clickedIsActive && options.collapsible, 4765 toShow = collapsing ? $() : clicked.next(), 4766 toHide = active.next(), 4767 eventData = { 4768 oldHeader: active, 4769 oldPanel: toHide, 4770 newHeader: collapsing ? $() : clicked, 4771 newPanel: toShow 4772 }; 4773 4774 event.preventDefault(); 4775 4776 if ( 4777 4778 // click on active header, but not collapsible 4779 ( clickedIsActive && !options.collapsible ) || 4780 4781 // allow canceling activation 4782 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 4783 return; 4784 } 4785 4786 options.active = collapsing ? false : this.headers.index( clicked ); 4787 4788 // When the call to ._toggle() comes after the class changes 4789 // it causes a very odd bug in IE 8 (see #6720) 4790 this.active = clickedIsActive ? $() : clicked; 4791 this._toggle( eventData ); 4792 4793 // Switch classes 4794 // corner classes on the previously active header stay after the animation 4795 this._removeClass( active, "ui-accordion-header-active", "ui-state-active" ); 4796 if ( options.icons ) { 4797 activeChildren = active.children( ".ui-accordion-header-icon" ); 4798 this._removeClass( activeChildren, null, options.icons.activeHeader ) 4799 ._addClass( activeChildren, null, options.icons.header ); 4800 } 4801 4802 if ( !clickedIsActive ) { 4803 this._removeClass( clicked, "ui-accordion-header-collapsed" ) 4804 ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" ); 4805 if ( options.icons ) { 4806 clickedChildren = clicked.children( ".ui-accordion-header-icon" ); 4807 this._removeClass( clickedChildren, null, options.icons.header ) 4808 ._addClass( clickedChildren, null, options.icons.activeHeader ); 4809 } 4810 4811 this._addClass( clicked.next(), "ui-accordion-content-active" ); 4812 } 4813 }, 4814 4815 _toggle: function( data ) { 4816 var toShow = data.newPanel, 4817 toHide = this.prevShow.length ? this.prevShow : data.oldPanel; 4818 4819 // Handle activating a panel during the animation for another activation 4820 this.prevShow.add( this.prevHide ).stop( true, true ); 4821 this.prevShow = toShow; 4822 this.prevHide = toHide; 4823 4824 if ( this.options.animate ) { 4825 this._animate( toShow, toHide, data ); 4826 } else { 4827 toHide.hide(); 4828 toShow.show(); 4829 this._toggleComplete( data ); 4830 } 4831 4832 toHide.attr( { 4833 "aria-hidden": "true" 4834 } ); 4835 toHide.prev().attr( { 4836 "aria-selected": "false", 4837 "aria-expanded": "false" 4838 } ); 4839 4840 // if we're switching panels, remove the old header from the tab order
vendor: 7,571 bytes, lines 4841-5111
4841 // if we're opening from collapsed state, remove the previous header from the tab order 4842 // if we're collapsing, then keep the collapsing header in the tab order 4843 if ( toShow.length && toHide.length ) { 4844 toHide.prev().attr( { 4845 "tabIndex": -1, 4846 "aria-expanded": "false" 4847 } ); 4848 } else if ( toShow.length ) { 4849 this.headers.filter( function() { 4850 return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; 4851 } ) 4852 .attr( "tabIndex", -1 ); 4853 } 4854 4855 toShow 4856 .attr( "aria-hidden", "false" ) 4857 .prev() 4858 .attr( { 4859 "aria-selected": "true", 4860 "aria-expanded": "true", 4861 tabIndex: 0 4862 } ); 4863 }, 4864 4865 _animate: function( toShow, toHide, data ) { 4866 var total, easing, duration, 4867 that = this, 4868 adjust = 0, 4869 boxSizing = toShow.css( "box-sizing" ), 4870 down = toShow.length && 4871 ( !toHide.length || ( toShow.index() < toHide.index() ) ), 4872 animate = this.options.animate || {}, 4873 options = down && animate.down || animate, 4874 complete = function() { 4875 that._toggleComplete( data ); 4876 }; 4877 4878 if ( typeof options === "number" ) { 4879 duration = options; 4880 } 4881 if ( typeof options === "string" ) { 4882 easing = options; 4883 } 4884 4885 // fall back from options to animation in case of partial down settings 4886 easing = easing || options.easing || animate.easing; 4887 duration = duration || options.duration || animate.duration; 4888 4889 if ( !toHide.length ) { 4890 return toShow.animate( this.showProps, duration, easing, complete ); 4891 } 4892 if ( !toShow.length ) { 4893 return toHide.animate( this.hideProps, duration, easing, complete ); 4894 } 4895 4896 total = toShow.show().outerHeight(); 4897 toHide.animate( this.hideProps, { 4898 duration: duration, 4899 easing: easing, 4900 step: function( now, fx ) { 4901 fx.now = Math.round( now ); 4902 } 4903 } ); 4904 toShow 4905 .hide() 4906 .animate( this.showProps, { 4907 duration: duration, 4908 easing: easing, 4909 complete: complete, 4910 step: function( now, fx ) { 4911 fx.now = Math.round( now ); 4912 if ( fx.prop !== "height" ) { 4913 if ( boxSizing === "content-box" ) { 4914 adjust += fx.now; 4915 } 4916 } else if ( that.options.heightStyle !== "content" ) { 4917 fx.now = Math.round( total - toHide.outerHeight() - adjust ); 4918 adjust = 0; 4919 } 4920 } 4921 } ); 4922 }, 4923 4924 _toggleComplete: function( data ) { 4925 var toHide = data.oldPanel, 4926 prev = toHide.prev(); 4927 4928 this._removeClass( toHide, "ui-accordion-content-active" ); 4929 this._removeClass( prev, "ui-accordion-header-active" ) 4930 ._addClass( prev, "ui-accordion-header-collapsed" ); 4931 4932 // Work around for rendering bug in IE (#5421) 4933 if ( toHide.length ) { 4934 toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; 4935 } 4936 this._trigger( "activate", null, data ); 4937 } 4938} ); 4939 4940 4941 4942var safeActiveElement = $.ui.safeActiveElement = function( document ) { 4943 var activeElement; 4944 4945 // Support: IE 9 only 4946 // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> 4947 try { 4948 activeElement = document.activeElement; 4949 } catch ( error ) { 4950 activeElement = document.body; 4951 } 4952 4953 // Support: IE 9 - 11 only 4954 // IE may return null instead of an element 4955 // Interestingly, this only seems to occur when NOT in an iframe 4956 if ( !activeElement ) { 4957 activeElement = document.body; 4958 } 4959 4960 // Support: IE 11 only 4961 // IE11 returns a seemingly empty object in some cases when accessing 4962 // document.activeElement from an <iframe> 4963 if ( !activeElement.nodeName ) { 4964 activeElement = document.body; 4965 } 4966 4967 return activeElement; 4968}; 4969 4970 4971/*! 4972 * jQuery UI Menu 1.12.0 4973 * http://jqueryui.com 4974 * 4975 * Copyright jQuery Foundation and other contributors 4976 * Released under the MIT license. 4977 * http://jquery.org/license 4978 */ 4979 4980//>>label: Menu 4981//>>group: Widgets 4982//>>description: Creates nestable menus. 4983//>>docs: http://api.jqueryui.com/menu/ 4984//>>demos: http://jqueryui.com/menu/ 4985//>>css.structure: ../../themes/base/core.css 4986//>>css.structure: ../../themes/base/menu.css 4987//>>css.theme: ../../themes/base/theme.css 4988 4989 4990 4991var widgetsMenu = $.widget( "ui.menu", { 4992 version: "1.12.0", 4993 defaultElement: "<ul>", 4994 delay: 300, 4995 options: { 4996 icons: { 4997 submenu: "ui-icon-caret-1-e" 4998 }, 4999 items: "> *", 5000 menus: "ul", 5001 position: { 5002 my: "left top", 5003 at: "right top" 5004 }, 5005 role: "menu", 5006 5007 // Callbacks 5008 blur: null, 5009 focus: null, 5010 select: null 5011 }, 5012 5013 _create: function() { 5014 this.activeMenu = this.element; 5015 5016 // Flag used to prevent firing of the click handler 5017 // as the event bubbles up through nested menus 5018 this.mouseHandled = false; 5019 this.element 5020 .uniqueId() 5021 .attr( { 5022 role: this.options.role, 5023 tabIndex: 0 5024 } ); 5025 5026 this._addClass( "ui-menu", "ui-widget ui-widget-content" ); 5027 this._on( { 5028 5029 // Prevent focus from sticking to links inside menu after clicking 5030 // them (focus should always stay on UL during navigation). 5031 "mousedown .ui-menu-item": function( event ) { 5032 event.preventDefault(); 5033 }, 5034 "click .ui-menu-item": function( event ) { 5035 var target = $( event.target ); 5036 var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); 5037 if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { 5038 this.select( event ); 5039 5040 // Only set the mouseHandled flag if the event will bubble, see #9469. 5041 if ( !event.isPropagationStopped() ) { 5042 this.mouseHandled = true; 5043 } 5044 5045 // Open submenu on click 5046 if ( target.has( ".ui-menu" ).length ) { 5047 this.expand( event ); 5048 } else if ( !this.element.is( ":focus" ) && 5049 active.closest( ".ui-menu" ).length ) { 5050 5051 // Redirect focus to the menu 5052 this.element.trigger( "focus", [ true ] ); 5053 5054 // If the active item is on the top level, let it stay active. 5055 // Otherwise, blur the active item since it is no longer visible. 5056 if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { 5057 clearTimeout( this.timer ); 5058 } 5059 } 5060 } 5061 }, 5062 "mouseenter .ui-menu-item": function( event ) { 5063 5064 // Ignore mouse events while typeahead is active, see #10458. 5065 // Prevents focusing the wrong item when typeahead causes a scroll while the mouse 5066 // is over an item in the menu 5067 if ( this.previousFilter ) { 5068 return; 5069 } 5070 5071 var actualTarget = $( event.target ).closest( ".ui-menu-item" ), 5072 target = $( event.currentTarget ); 5073 5074 // Ignore bubbled events on parent items, see #11641 5075 if ( actualTarget[ 0 ] !== target[ 0 ] ) { 5076 return; 5077 } 5078 5079 // Remove ui-state-active class from siblings of the newly focused menu item 5080 // to avoid a jump caused by adjacent elements both having a class with a border 5081 this._removeClass( target.siblings().children( ".ui-state-active" ), 5082 null, "ui-state-active" ); 5083 this.focus( event, target ); 5084 }, 5085 mouseleave: "collapseAll", 5086 "mouseleave .ui-menu": "collapseAll", 5087 focus: function( event, keepActiveItem ) { 5088 5089 // If there's already an active item, keep it active 5090 // If not, activate the first item 5091 var item = this.active || this.element.find( this.options.items ).eq( 0 ); 5092 5093 if ( !keepActiveItem ) { 5094 this.focus( event, item ); 5095 } 5096 }, 5097 blur: function( event ) { 5098 this._delay( function() { 5099 var notContained = !$.contains( 5100 this.element[ 0 ], 5101 $.ui.safeActiveElement( this.document[ 0 ] ) 5102 ); 5103 if ( notContained ) { 5104 this.collapseAll( event ); 5105 } 5106 } ); 5107 }, 5108 keydown: "_keydown" 5109 } ); 5110 5111 this.refresh();
vendor: 4,279 bytes, lines 5112-5272
5112 5113 // Clicks outside of a menu collapse any open menus 5114 this._on( this.document, { 5115 click: function( event ) { 5116 if ( this._closeOnDocumentClick( event ) ) { 5117 this.collapseAll( event ); 5118 } 5119 5120 // Reset the mouseHandled flag 5121 this.mouseHandled = false; 5122 } 5123 } ); 5124 }, 5125 5126 _destroy: function() { 5127 var items = this.element.find( ".ui-menu-item" ) 5128 .removeAttr( "role aria-disabled" ), 5129 submenus = items.children( ".ui-menu-item-wrapper" ) 5130 .removeUniqueId() 5131 .removeAttr( "tabIndex role aria-haspopup" ); 5132 5133 // Destroy (sub)menus 5134 this.element 5135 .removeAttr( "aria-activedescendant" ) 5136 .find( ".ui-menu" ).addBack() 5137 .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " + 5138 "tabIndex" ) 5139 .removeUniqueId() 5140 .show(); 5141 5142 submenus.children().each( function() { 5143 var elem = $( this ); 5144 if ( elem.data( "ui-menu-submenu-caret" ) ) { 5145 elem.remove(); 5146 } 5147 } ); 5148 }, 5149 5150 _keydown: function( event ) { 5151 var match, prev, character, skip, 5152 preventDefault = true; 5153 5154 switch ( event.keyCode ) { 5155 case $.ui.keyCode.PAGE_UP: 5156 this.previousPage( event ); 5157 break; 5158 case $.ui.keyCode.PAGE_DOWN: 5159 this.nextPage( event ); 5160 break; 5161 case $.ui.keyCode.HOME: 5162 this._move( "first", "first", event ); 5163 break; 5164 case $.ui.keyCode.END: 5165 this._move( "last", "last", event ); 5166 break; 5167 case $.ui.keyCode.UP: 5168 this.previous( event ); 5169 break; 5170 case $.ui.keyCode.DOWN: 5171 this.next( event ); 5172 break; 5173 case $.ui.keyCode.LEFT: 5174 this.collapse( event ); 5175 break; 5176 case $.ui.keyCode.RIGHT: 5177 if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { 5178 this.expand( event ); 5179 } 5180 break; 5181 case $.ui.keyCode.ENTER: 5182 case $.ui.keyCode.SPACE: 5183 this._activate( event ); 5184 break; 5185 case $.ui.keyCode.ESCAPE: 5186 this.collapse( event ); 5187 break; 5188 default: 5189 preventDefault = false; 5190 prev = this.previousFilter || ""; 5191 character = String.fromCharCode( event.keyCode ); 5192 skip = false; 5193 5194 clearTimeout( this.filterTimer ); 5195 5196 if ( character === prev ) { 5197 skip = true; 5198 } else { 5199 character = prev + character; 5200 } 5201 5202 match = this._filterMenuItems( character ); 5203 match = skip && match.index( this.active.next() ) !== -1 ? 5204 this.active.nextAll( ".ui-menu-item" ) : 5205 match; 5206 5207 // If no matches on the current filter, reset to the last character pressed 5208 // to move down the menu to the first item that starts with that character 5209 if ( !match.length ) { 5210 character = String.fromCharCode( event.keyCode ); 5211 match = this._filterMenuItems( character ); 5212 } 5213 5214 if ( match.length ) { 5215 this.focus( event, match ); 5216 this.previousFilter = character; 5217 this.filterTimer = this._delay( function() { 5218 delete this.previousFilter; 5219 }, 1000 ); 5220 } else { 5221 delete this.previousFilter; 5222 } 5223 } 5224 5225 if ( preventDefault ) { 5226 event.preventDefault(); 5227 } 5228 }, 5229 5230 _activate: function( event ) { 5231 if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { 5232 if ( this.active.children( "[aria-haspopup='true']" ).length ) { 5233 this.expand( event ); 5234 } else { 5235 this.select( event ); 5236 } 5237 } 5238 }, 5239 5240 refresh: function() { 5241 var menus, items, newSubmenus, newItems, newWrappers, 5242 that = this, 5243 icon = this.options.icons.submenu, 5244 submenus = this.element.find( this.options.menus ); 5245 5246 this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length ); 5247 5248 // Initialize nested menus 5249 newSubmenus = submenus.filter( ":not(.ui-menu)" ) 5250 .hide() 5251 .attr( { 5252 role: this.options.role, 5253 "aria-hidden": "true", 5254 "aria-expanded": "false" 5255 } ) 5256 .each( function() { 5257 var menu = $( this ), 5258 item = menu.prev(), 5259 submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true ); 5260 5261 that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon ); 5262 item 5263 .attr( "aria-haspopup", "true" ) 5264 .prepend( submenuCaret ); 5265 menu.attr( "aria-labelledby", item.attr( "id" ) ); 5266 } ); 5267 5268 this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" ); 5269 5270 menus = submenus.add( this.element ); 5271 items = menus.find( this.options.items ); 5272
vendor: 4,715 bytes, lines 5273-5435
5273 // Initialize menu-items containing spaces and/or dashes only as dividers 5274 items.not( ".ui-menu-item" ).each( function() { 5275 var item = $( this ); 5276 if ( that._isDivider( item ) ) { 5277 that._addClass( item, "ui-menu-divider", "ui-widget-content" ); 5278 } 5279 } ); 5280 5281 // Don't refresh list items that are already adapted 5282 newItems = items.not( ".ui-menu-item, .ui-menu-divider" ); 5283 newWrappers = newItems.children() 5284 .not( ".ui-menu" ) 5285 .uniqueId() 5286 .attr( { 5287 tabIndex: -1, 5288 role: this._itemRole() 5289 } ); 5290 this._addClass( newItems, "ui-menu-item" ) 5291 ._addClass( newWrappers, "ui-menu-item-wrapper" ); 5292 5293 // Add aria-disabled attribute to any disabled menu item 5294 items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); 5295 5296 // If the active item has been removed, blur the menu 5297 if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { 5298 this.blur(); 5299 } 5300 }, 5301 5302 _itemRole: function() { 5303 return { 5304 menu: "menuitem", 5305 listbox: "option" 5306 }[ this.options.role ]; 5307 }, 5308 5309 _setOption: function( key, value ) { 5310 if ( key === "icons" ) { 5311 var icons = this.element.find( ".ui-menu-icon" ); 5312 this._removeClass( icons, null, this.options.icons.submenu ) 5313 ._addClass( icons, null, value.submenu ); 5314 } 5315 this._super( key, value ); 5316 }, 5317 5318 _setOptionDisabled: function( value ) { 5319 this._super( value ); 5320 5321 this.element.attr( "aria-disabled", String( value ) ); 5322 this._toggleClass( null, "ui-state-disabled", !!value ); 5323 }, 5324 5325 focus: function( event, item ) { 5326 var nested, focused, activeParent; 5327 this.blur( event, event && event.type === "focus" ); 5328 5329 this._scrollIntoView( item ); 5330 5331 this.active = item.first(); 5332 5333 focused = this.active.children( ".ui-menu-item-wrapper" ); 5334 this._addClass( focused, null, "ui-state-active" ); 5335 5336 // Only update aria-activedescendant if there's a role 5337 // otherwise we assume focus is managed elsewhere 5338 if ( this.options.role ) { 5339 this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); 5340 } 5341 5342 // Highlight active parent menu item, if any 5343 activeParent = this.active 5344 .parent() 5345 .closest( ".ui-menu-item" ) 5346 .children( ".ui-menu-item-wrapper" ); 5347 this._addClass( activeParent, null, "ui-state-active" ); 5348 5349 if ( event && event.type === "keydown" ) { 5350 this._close(); 5351 } else { 5352 this.timer = this._delay( function() { 5353 this._close(); 5354 }, this.delay ); 5355 } 5356 5357 nested = item.children( ".ui-menu" ); 5358 if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { 5359 this._startOpening( nested ); 5360 } 5361 this.activeMenu = item.parent(); 5362 5363 this._trigger( "focus", event, { item: item } ); 5364 }, 5365 5366 _scrollIntoView: function( item ) { 5367 var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; 5368 if ( this._hasScroll() ) { 5369 borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0; 5370 paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0; 5371 offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; 5372 scroll = this.activeMenu.scrollTop(); 5373 elementHeight = this.activeMenu.height(); 5374 itemHeight = item.outerHeight(); 5375 5376 if ( offset < 0 ) { 5377 this.activeMenu.scrollTop( scroll + offset ); 5378 } else if ( offset + itemHeight > elementHeight ) { 5379 this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); 5380 } 5381 } 5382 }, 5383 5384 blur: function( event, fromFocus ) { 5385 if ( !fromFocus ) { 5386 clearTimeout( this.timer ); 5387 } 5388 5389 if ( !this.active ) { 5390 return; 5391 } 5392 5393 this._removeClass( this.active.children( ".ui-menu-item-wrapper" ), 5394 null, "ui-state-active" ); 5395 5396 this._trigger( "blur", event, { item: this.active } ); 5397 this.active = null; 5398 }, 5399 5400 _startOpening: function( submenu ) { 5401 clearTimeout( this.timer ); 5402 5403 // Don't open if already open fixes a Firefox bug that caused a .5 pixel 5404 // shift in the submenu position when mousing over the caret icon 5405 if ( submenu.attr( "aria-hidden" ) !== "true" ) { 5406 return; 5407 } 5408 5409 this.timer = this._delay( function() { 5410 this._close(); 5411 this._open( submenu ); 5412 }, this.delay ); 5413 }, 5414 5415 _open: function( submenu ) { 5416 var position = $.extend( { 5417 of: this.active 5418 }, this.options.position ); 5419 5420 clearTimeout( this.timer ); 5421 this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) 5422 .hide() 5423 .attr( "aria-hidden", "true" ); 5424 5425 submenu 5426 .show() 5427 .removeAttr( "aria-hidden" ) 5428 .attr( "aria-expanded", "true" ) 5429 .position( position ); 5430 }, 5431 5432 collapseAll: function( event, all ) { 5433 clearTimeout( this.timer ); 5434 this.timer = this._delay( function() { 5435
vendor: 36,931 bytes, lines 5436-6755
5436 // If we were passed an event, look for the submenu that contains the event 5437 var currentMenu = all ? this.element : 5438 $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); 5439 5440 // If we found no valid submenu ancestor, use the main menu to close all 5441 // sub menus anyway 5442 if ( !currentMenu.length ) { 5443 currentMenu = this.element; 5444 } 5445 5446 this._close( currentMenu ); 5447 5448 this.blur( event ); 5449 5450 // Work around active item staying active after menu is blurred 5451 this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" ); 5452 5453 this.activeMenu = currentMenu; 5454 }, this.delay ); 5455 }, 5456 5457 // With no arguments, closes the currently active menu - if nothing is active 5458 // it closes all menus. If passed an argument, it will search for menus BELOW 5459 _close: function( startMenu ) { 5460 if ( !startMenu ) { 5461 startMenu = this.active ? this.active.parent() : this.element; 5462 } 5463 5464 startMenu.find( ".ui-menu" ) 5465 .hide() 5466 .attr( "aria-hidden", "true" ) 5467 .attr( "aria-expanded", "false" ); 5468 }, 5469 5470 _closeOnDocumentClick: function( event ) { 5471 return !$( event.target ).closest( ".ui-menu" ).length; 5472 }, 5473 5474 _isDivider: function( item ) { 5475 5476 // Match hyphen, em dash, en dash 5477 return !/[^\-\u2014\u2013\s]/.test( item.text() ); 5478 }, 5479 5480 collapse: function( event ) { 5481 var newItem = this.active && 5482 this.active.parent().closest( ".ui-menu-item", this.element ); 5483 if ( newItem && newItem.length ) { 5484 this._close(); 5485 this.focus( event, newItem ); 5486 } 5487 }, 5488 5489 expand: function( event ) { 5490 var newItem = this.active && 5491 this.active 5492 .children( ".ui-menu " ) 5493 .find( this.options.items ) 5494 .first(); 5495 5496 if ( newItem && newItem.length ) { 5497 this._open( newItem.parent() ); 5498 5499 // Delay so Firefox will not hide activedescendant change in expanding submenu from AT 5500 this._delay( function() { 5501 this.focus( event, newItem ); 5502 } ); 5503 } 5504 }, 5505 5506 next: function( event ) { 5507 this._move( "next", "first", event ); 5508 }, 5509 5510 previous: function( event ) { 5511 this._move( "prev", "last", event ); 5512 }, 5513 5514 isFirstItem: function() { 5515 return this.active && !this.active.prevAll( ".ui-menu-item" ).length; 5516 }, 5517 5518 isLastItem: function() { 5519 return this.active && !this.active.nextAll( ".ui-menu-item" ).length; 5520 }, 5521 5522 _move: function( direction, filter, event ) { 5523 var next; 5524 if ( this.active ) { 5525 if ( direction === "first" || direction === "last" ) { 5526 next = this.active 5527 [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) 5528 .eq( -1 ); 5529 } else { 5530 next = this.active 5531 [ direction + "All" ]( ".ui-menu-item" ) 5532 .eq( 0 ); 5533 } 5534 } 5535 if ( !next || !next.length || !this.active ) { 5536 next = this.activeMenu.find( this.options.items )[ filter ](); 5537 } 5538 5539 this.focus( event, next ); 5540 }, 5541 5542 nextPage: function( event ) { 5543 var item, base, height; 5544 5545 if ( !this.active ) { 5546 this.next( event ); 5547 return; 5548 } 5549 if ( this.isLastItem() ) { 5550 return; 5551 } 5552 if ( this._hasScroll() ) { 5553 base = this.active.offset().top; 5554 height = this.element.height(); 5555 this.active.nextAll( ".ui-menu-item" ).each( function() { 5556 item = $( this ); 5557 return item.offset().top - base - height < 0; 5558 } ); 5559 5560 this.focus( event, item ); 5561 } else { 5562 this.focus( event, this.activeMenu.find( this.options.items ) 5563 [ !this.active ? "first" : "last" ]() ); 5564 } 5565 }, 5566 5567 previousPage: function( event ) { 5568 var item, base, height; 5569 if ( !this.active ) { 5570 this.next( event ); 5571 return; 5572 } 5573 if ( this.isFirstItem() ) { 5574 return; 5575 } 5576 if ( this._hasScroll() ) { 5577 base = this.active.offset().top; 5578 height = this.element.height(); 5579 this.active.prevAll( ".ui-menu-item" ).each( function() { 5580 item = $( this ); 5581 return item.offset().top - base + height > 0; 5582 } ); 5583 5584 this.focus( event, item ); 5585 } else { 5586 this.focus( event, this.activeMenu.find( this.options.items ).first() ); 5587 } 5588 }, 5589 5590 _hasScroll: function() { 5591 return this.element.outerHeight() < this.element.prop( "scrollHeight" ); 5592 }, 5593 5594 select: function( event ) { 5595 5596 // TODO: It should never be possible to not have an active item at this 5597 // point, but the tests don't trigger mouseenter before click. 5598 this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); 5599 var ui = { item: this.active }; 5600 if ( !this.active.has( ".ui-menu" ).length ) { 5601 this.collapseAll( event, true ); 5602 } 5603 this._trigger( "select", event, ui ); 5604 }, 5605 5606 _filterMenuItems: function( character ) { 5607 var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), 5608 regex = new RegExp( "^" + escapedCharacter, "i" ); 5609 5610 return this.activeMenu 5611 .find( this.options.items ) 5612 5613 // Only match on items, not dividers or other content (#10571) 5614 .filter( ".ui-menu-item" ) 5615 .filter( function() { 5616 return regex.test( 5617 $.trim( $( this ).children( ".ui-menu-item-wrapper" ).text() ) ); 5618 } ); 5619 } 5620} ); 5621 5622 5623/*! 5624 * jQuery UI Autocomplete 1.12.0 5625 * http://jqueryui.com 5626 * 5627 * Copyright jQuery Foundation and other contributors 5628 * Released under the MIT license. 5629 * http://jquery.org/license 5630 */ 5631 5632//>>label: Autocomplete 5633//>>group: Widgets 5634//>>description: Lists suggested words as the user is typing. 5635//>>docs: http://api.jqueryui.com/autocomplete/ 5636//>>demos: http://jqueryui.com/autocomplete/ 5637//>>css.structure: ../../themes/base/core.css 5638//>>css.structure: ../../themes/base/autocomplete.css 5639//>>css.theme: ../../themes/base/theme.css 5640 5641 5642 5643$.widget( "ui.autocomplete", { 5644 version: "1.12.0", 5645 defaultElement: "<input>", 5646 options: { 5647 appendTo: null, 5648 autoFocus: false, 5649 delay: 300, 5650 minLength: 1, 5651 position: { 5652 my: "left top", 5653 at: "left bottom", 5654 collision: "none" 5655 }, 5656 source: null, 5657 5658 // Callbacks 5659 change: null, 5660 close: null, 5661 focus: null, 5662 open: null, 5663 response: null, 5664 search: null, 5665 select: null 5666 }, 5667 5668 requestIndex: 0, 5669 pending: 0, 5670 5671 _create: function() { 5672 5673 // Some browsers only repeat keydown events, not keypress events, 5674 // so we use the suppressKeyPress flag to determine if we've already 5675 // handled the keydown event. #7269 5676 // Unfortunately the code for & in keypress is the same as the up arrow, 5677 // so we use the suppressKeyPressRepeat flag to avoid handling keypress 5678 // events when we know the keydown event was used to modify the 5679 // search term. #7799 5680 var suppressKeyPress, suppressKeyPressRepeat, suppressInput, 5681 nodeName = this.element[ 0 ].nodeName.toLowerCase(), 5682 isTextarea = nodeName === "textarea", 5683 isInput = nodeName === "input"; 5684 5685 // Textareas are always multi-line 5686 // Inputs are always single-line, even if inside a contentEditable element 5687 // IE also treats inputs as contentEditable 5688 // All other element types are determined by whether or not they're contentEditable 5689 this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element ); 5690 5691 this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; 5692 this.isNewMenu = true; 5693 5694 this._addClass( "ui-autocomplete-input" ); 5695 this.element.attr( "autocomplete", "off" ); 5696 5697 this._on( this.element, { 5698 keydown: function( event ) { 5699 if ( this.element.prop( "readOnly" ) ) { 5700 suppressKeyPress = true; 5701 suppressInput = true; 5702 suppressKeyPressRepeat = true; 5703 return; 5704 } 5705 5706 suppressKeyPress = false; 5707 suppressInput = false; 5708 suppressKeyPressRepeat = false; 5709 var keyCode = $.ui.keyCode; 5710 switch ( event.keyCode ) { 5711 case keyCode.PAGE_UP: 5712 suppressKeyPress = true; 5713 this._move( "previousPage", event ); 5714 break; 5715 case keyCode.PAGE_DOWN: 5716 suppressKeyPress = true; 5717 this._move( "nextPage", event ); 5718 break; 5719 case keyCode.UP: 5720 suppressKeyPress = true; 5721 this._keyEvent( "previous", event ); 5722 break; 5723 case keyCode.DOWN: 5724 suppressKeyPress = true; 5725 this._keyEvent( "next", event ); 5726 break; 5727 case keyCode.ENTER: 5728 5729 // when menu is open and has focus 5730 if ( this.menu.active ) { 5731 5732 // #6055 - Opera still allows the keypress to occur 5733 // which causes forms to submit 5734 suppressKeyPress = true; 5735 event.preventDefault(); 5736 this.menu.select( event ); 5737 } 5738 break; 5739 case keyCode.TAB: 5740 if ( this.menu.active ) { 5741 this.menu.select( event ); 5742 } 5743 break; 5744 case keyCode.ESCAPE: 5745 if ( this.menu.element.is( ":visible" ) ) { 5746 if ( !this.isMultiLine ) { 5747 this._value( this.term ); 5748 } 5749 this.close( event ); 5750 5751 // Different browsers have different default behavior for escape 5752 // Single press can mean undo or clear 5753 // Double press in IE means clear the whole form 5754 event.preventDefault(); 5755 } 5756 break; 5757 default: 5758 suppressKeyPressRepeat = true; 5759 5760 // search timeout should be triggered before the input value is changed 5761 this._searchTimeout( event ); 5762 break; 5763 } 5764 }, 5765 keypress: function( event ) { 5766 if ( suppressKeyPress ) { 5767 suppressKeyPress = false; 5768 if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { 5769 event.preventDefault(); 5770 } 5771 return; 5772 } 5773 if ( suppressKeyPressRepeat ) { 5774 return; 5775 } 5776 5777 // Replicate some key handlers to allow them to repeat in Firefox and Opera 5778 var keyCode = $.ui.keyCode; 5779 switch ( event.keyCode ) { 5780 case keyCode.PAGE_UP: 5781 this._move( "previousPage", event ); 5782 break; 5783 case keyCode.PAGE_DOWN: 5784 this._move( "nextPage", event ); 5785 break; 5786 case keyCode.UP: 5787 this._keyEvent( "previous", event ); 5788 break; 5789 case keyCode.DOWN: 5790 this._keyEvent( "next", event ); 5791 break; 5792 } 5793 }, 5794 input: function( event ) { 5795 if ( suppressInput ) { 5796 suppressInput = false; 5797 event.preventDefault(); 5798 return; 5799 } 5800 this._searchTimeout( event ); 5801 }, 5802 focus: function() { 5803 this.selectedItem = null; 5804 this.previous = this._value(); 5805 }, 5806 blur: function( event ) { 5807 if ( this.cancelBlur ) { 5808 delete this.cancelBlur; 5809 return; 5810 } 5811 5812 clearTimeout( this.searching ); 5813 this.close( event ); 5814 this._change( event ); 5815 } 5816 } ); 5817 5818 this._initSource(); 5819 this.menu = $( "<ul>" ) 5820 .appendTo( this._appendTo() ) 5821 .menu( { 5822 5823 // disable ARIA support, the live region takes care of that 5824 role: null 5825 } ) 5826 .hide() 5827 .menu( "instance" ); 5828 5829 this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); 5830 this._on( this.menu.element, { 5831 mousedown: function( event ) { 5832 5833 // prevent moving focus out of the text field 5834 event.preventDefault(); 5835 5836 // IE doesn't prevent moving focus even with event.preventDefault() 5837 // so we set a flag to know when we should ignore the blur event 5838 this.cancelBlur = true; 5839 this._delay( function() { 5840 delete this.cancelBlur; 5841 5842 // Support: IE 8 only 5843 // Right clicking a menu item or selecting text from the menu items will 5844 // result in focus moving out of the input. However, we've already received 5845 // and ignored the blur event because of the cancelBlur flag set above. So 5846 // we restore focus to ensure that the menu closes properly based on the user's 5847 // next actions. 5848 if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { 5849 this.element.trigger( "focus" ); 5850 } 5851 } ); 5852 }, 5853 menufocus: function( event, ui ) { 5854 var label, item; 5855 5856 // support: Firefox 5857 // Prevent accidental activation of menu items in Firefox (#7024 #9118) 5858 if ( this.isNewMenu ) { 5859 this.isNewMenu = false; 5860 if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { 5861 this.menu.blur(); 5862 5863 this.document.one( "mousemove", function() { 5864 $( event.target ).trigger( event.originalEvent ); 5865 } ); 5866 5867 return; 5868 } 5869 } 5870 5871 item = ui.item.data( "ui-autocomplete-item" ); 5872 if ( false !== this._trigger( "focus", event, { item: item } ) ) { 5873 5874 // use value to match what will end up in the input, if it was a key event 5875 if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { 5876 this._value( item.value ); 5877 } 5878 } 5879 5880 // Announce the value in the liveRegion 5881 label = ui.item.attr( "aria-label" ) || item.value; 5882 if ( label && $.trim( label ).length ) { 5883 this.liveRegion.children().hide(); 5884 $( "<div>" ).text( label ).appendTo( this.liveRegion ); 5885 } 5886 }, 5887 menuselect: function( event, ui ) { 5888 var item = ui.item.data( "ui-autocomplete-item" ), 5889 previous = this.previous; 5890 5891 // Only trigger when focus was lost (click on menu) 5892 if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { 5893 this.element.trigger( "focus" ); 5894 this.previous = previous; 5895 5896 // #6109 - IE triggers two focus events and the second 5897 // is asynchronous, so we need to reset the previous 5898 // term synchronously and asynchronously :-( 5899 this._delay( function() { 5900 this.previous = previous; 5901 this.selectedItem = item; 5902 } ); 5903 } 5904 5905 if ( false !== this._trigger( "select", event, { item: item } ) ) { 5906 this._value( item.value ); 5907 } 5908 5909 // reset the term after the select event 5910 // this allows custom select handling to work properly 5911 this.term = this._value(); 5912 5913 this.close( event ); 5914 this.selectedItem = item; 5915 } 5916 } ); 5917 5918 this.liveRegion = $( "<div>", { 5919 role: "status", 5920 "aria-live": "assertive", 5921 "aria-relevant": "additions" 5922 } ) 5923 .appendTo( this.document[ 0 ].body ); 5924 5925 this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); 5926 5927 // Turning off autocomplete prevents the browser from remembering the 5928 // value when navigating through history, so we re-enable autocomplete 5929 // if the page is unloaded before the widget is destroyed. #7790 5930 this._on( this.window, { 5931 beforeunload: function() { 5932 this.element.removeAttr( "autocomplete" ); 5933 } 5934 } ); 5935 }, 5936 5937 _destroy: function() { 5938 clearTimeout( this.searching ); 5939 this.element.removeAttr( "autocomplete" ); 5940 this.menu.element.remove(); 5941 this.liveRegion.remove(); 5942 }, 5943 5944 _setOption: function( key, value ) { 5945 this._super( key, value ); 5946 if ( key === "source" ) { 5947 this._initSource(); 5948 } 5949 if ( key === "appendTo" ) { 5950 this.menu.element.appendTo( this._appendTo() ); 5951 } 5952 if ( key === "disabled" && value && this.xhr ) { 5953 this.xhr.abort(); 5954 } 5955 }, 5956 5957 _isEventTargetInWidget: function( event ) { 5958 var menuElement = this.menu.element[ 0 ]; 5959 5960 return event.target === this.element[ 0 ] || 5961 event.target === menuElement || 5962 $.contains( menuElement, event.target ); 5963 }, 5964 5965 _closeOnClickOutside: function( event ) { 5966 if ( !this._isEventTargetInWidget( event ) ) { 5967 this.close(); 5968 } 5969 }, 5970 5971 _appendTo: function() { 5972 var element = this.options.appendTo; 5973 5974 if ( element ) { 5975 element = element.jquery || element.nodeType ? 5976 $( element ) : 5977 this.document.find( element ).eq( 0 ); 5978 } 5979 5980 if ( !element || !element[ 0 ] ) { 5981 element = this.element.closest( ".ui-front, dialog" ); 5982 } 5983 5984 if ( !element.length ) { 5985 element = this.document[ 0 ].body; 5986 } 5987 5988 return element; 5989 }, 5990 5991 _initSource: function() { 5992 var array, url, 5993 that = this; 5994 if ( $.isArray( this.options.source ) ) { 5995 array = this.options.source; 5996 this.source = function( request, response ) { 5997 response( $.ui.autocomplete.filter( array, request.term ) ); 5998 }; 5999 } else if ( typeof this.options.source === "string" ) { 6000 url = this.options.source; 6001 this.source = function( request, response ) { 6002 if ( that.xhr ) { 6003 that.xhr.abort(); 6004 } 6005 that.xhr = $.ajax( { 6006 url: url, 6007 data: request, 6008 dataType: "json", 6009 success: function( data ) { 6010 response( data ); 6011 }, 6012 error: function() { 6013 response( [] ); 6014 } 6015 } ); 6016 }; 6017 } else { 6018 this.source = this.options.source; 6019 } 6020 }, 6021 6022 _searchTimeout: function( event ) { 6023 clearTimeout( this.searching ); 6024 this.searching = this._delay( function() { 6025 6026 // Search if the value has changed, or if the user retypes the same value (see #7434) 6027 var equalValues = this.term === this._value(), 6028 menuVisible = this.menu.element.is( ":visible" ), 6029 modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey; 6030 6031 if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) { 6032 this.selectedItem = null; 6033 this.search( null, event ); 6034 } 6035 }, this.options.delay ); 6036 }, 6037 6038 search: function( value, event ) { 6039 value = value != null ? value : this._value(); 6040 6041 // Always save the actual value, not the one passed as an argument 6042 this.term = this._value(); 6043 6044 if ( value.length < this.options.minLength ) { 6045 return this.close( event ); 6046 } 6047 6048 if ( this._trigger( "search", event ) === false ) { 6049 return; 6050 } 6051 6052 return this._search( value ); 6053 }, 6054 6055 _search: function( value ) { 6056 this.pending++; 6057 this._addClass( "ui-autocomplete-loading" ); 6058 this.cancelSearch = false; 6059 6060 this.source( { term: value }, this._response() ); 6061 }, 6062 6063 _response: function() { 6064 var index = ++this.requestIndex; 6065 6066 return $.proxy( function( content ) { 6067 if ( index === this.requestIndex ) { 6068 this.__response( content ); 6069 } 6070 6071 this.pending--; 6072 if ( !this.pending ) { 6073 this._removeClass( "ui-autocomplete-loading" ); 6074 } 6075 }, this ); 6076 }, 6077 6078 __response: function( content ) { 6079 if ( content ) { 6080 content = this._normalize( content ); 6081 } 6082 this._trigger( "response", null, { content: content } ); 6083 if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { 6084 this._suggest( content ); 6085 this._trigger( "open" ); 6086 } else { 6087 6088 // use ._close() instead of .close() so we don't cancel future searches 6089 this._close(); 6090 } 6091 }, 6092 6093 close: function( event ) { 6094 this.cancelSearch = true; 6095 this._close( event ); 6096 }, 6097 6098 _close: function( event ) { 6099 6100 // Remove the handler that closes the menu on outside clicks 6101 this._off( this.document, "mousedown" ); 6102 6103 if ( this.menu.element.is( ":visible" ) ) { 6104 this.menu.element.hide(); 6105 this.menu.blur(); 6106 this.isNewMenu = true; 6107 this._trigger( "close", event ); 6108 } 6109 }, 6110 6111 _change: function( event ) { 6112 if ( this.previous !== this._value() ) { 6113 this._trigger( "change", event, { item: this.selectedItem } ); 6114 } 6115 }, 6116 6117 _normalize: function( items ) { 6118 6119 // assume all items have the right format when the first item is complete 6120 if ( items.length && items[ 0 ].label && items[ 0 ].value ) { 6121 return items; 6122 } 6123 return $.map( items, function( item ) { 6124 if ( typeof item === "string" ) { 6125 return { 6126 label: item, 6127 value: item 6128 }; 6129 } 6130 return $.extend( {}, item, { 6131 label: item.label || item.value, 6132 value: item.value || item.label 6133 } ); 6134 } ); 6135 }, 6136 6137 _suggest: function( items ) { 6138 var ul = this.menu.element.empty(); 6139 this._renderMenu( ul, items ); 6140 this.isNewMenu = true; 6141 this.menu.refresh(); 6142 6143 // Size and position menu 6144 ul.show(); 6145 this._resizeMenu(); 6146 ul.position( $.extend( { 6147 of: this.element 6148 }, this.options.position ) ); 6149 6150 if ( this.options.autoFocus ) { 6151 this.menu.next(); 6152 } 6153 6154 // Listen for interactions outside of the widget (#6642) 6155 this._on( this.document, { 6156 mousedown: "_closeOnClickOutside" 6157 } ); 6158 }, 6159 6160 _resizeMenu: function() { 6161 var ul = this.menu.element; 6162 ul.outerWidth( Math.max( 6163 6164 // Firefox wraps long text (possibly a rounding bug) 6165 // so we add 1px to avoid the wrapping (#7513) 6166 ul.width( "" ).outerWidth() + 1, 6167 this.element.outerWidth() 6168 ) ); 6169 }, 6170 6171 _renderMenu: function( ul, items ) { 6172 var that = this; 6173 $.each( items, function( index, item ) { 6174 that._renderItemData( ul, item ); 6175 } ); 6176 }, 6177 6178 _renderItemData: function( ul, item ) { 6179 return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); 6180 }, 6181 6182 _renderItem: function( ul, item ) { 6183 return $( "<li>" ) 6184 .append( $( "<div>" ).text( item.label ) ) 6185 .appendTo( ul ); 6186 }, 6187 6188 _move: function( direction, event ) { 6189 if ( !this.menu.element.is( ":visible" ) ) { 6190 this.search( null, event ); 6191 return; 6192 } 6193 if ( this.menu.isFirstItem() && /^previous/.test( direction ) || 6194 this.menu.isLastItem() && /^next/.test( direction ) ) { 6195 6196 if ( !this.isMultiLine ) { 6197 this._value( this.term ); 6198 } 6199 6200 this.menu.blur(); 6201 return; 6202 } 6203 this.menu[ direction ]( event ); 6204 }, 6205 6206 widget: function() { 6207 return this.menu.element; 6208 }, 6209 6210 _value: function() { 6211 return this.valueMethod.apply( this.element, arguments ); 6212 }, 6213 6214 _keyEvent: function( keyEvent, event ) { 6215 if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { 6216 this._move( keyEvent, event ); 6217 6218 // Prevents moving cursor to beginning/end of the text field in some browsers 6219 event.preventDefault(); 6220 } 6221 }, 6222 6223 // Support: Chrome <=50 6224 // We should be able to just use this.element.prop( "isContentEditable" ) 6225 // but hidden elements always report false in Chrome. 6226 // https://code.google.com/p/chromium/issues/detail?id=313082 6227 _isContentEditable: function( element ) { 6228 if ( !element.length ) { 6229 return false; 6230 } 6231 6232 var editable = element.prop( "contentEditable" ); 6233 6234 if ( editable === "inherit" ) { 6235 return this._isContentEditable( element.parent() ); 6236 } 6237 6238 return editable === "true"; 6239 } 6240} ); 6241 6242$.extend( $.ui.autocomplete, { 6243 escapeRegex: function( value ) { 6244 return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); 6245 }, 6246 filter: function( array, term ) { 6247 var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" ); 6248 return $.grep( array, function( value ) { 6249 return matcher.test( value.label || value.value || value ); 6250 } ); 6251 } 6252} ); 6253 6254// Live region extension, adding a `messages` option 6255// NOTE: This is an experimental API. We are still investigating 6256// a full solution for string manipulation and internationalization. 6257$.widget( "ui.autocomplete", $.ui.autocomplete, { 6258 options: { 6259 messages: { 6260 noResults: "No search results.", 6261 results: function( amount ) { 6262 return amount + ( amount > 1 ? " results are" : " result is" ) + 6263 " available, use up and down arrow keys to navigate."; 6264 } 6265 } 6266 }, 6267 6268 __response: function( content ) { 6269 var message; 6270 this._superApply( arguments ); 6271 if ( this.options.disabled || this.cancelSearch ) { 6272 return; 6273 } 6274 if ( content && content.length ) { 6275 message = this.options.messages.results( content.length ); 6276 } else { 6277 message = this.options.messages.noResults; 6278 } 6279 this.liveRegion.children().hide(); 6280 $( "<div>" ).text( message ).appendTo( this.liveRegion ); 6281 } 6282} ); 6283 6284var widgetsAutocomplete = $.ui.autocomplete; 6285 6286 6287/*! 6288 * jQuery UI Controlgroup 1.12.0 6289 * http://jqueryui.com 6290 * 6291 * Copyright jQuery Foundation and other contributors 6292 * Released under the MIT license. 6293 * http://jquery.org/license 6294 */ 6295 6296//>>label: Controlgroup 6297//>>group: Widgets 6298//>>description: Visually groups form control widgets 6299//>>docs: http://api.jqueryui.com/controlgroup/ 6300//>>demos: http://jqueryui.com/controlgroup/ 6301//>>css.structure: ../../themes/base/core.css 6302//>>css.structure: ../../themes/base/controlgroup.css 6303//>>css.theme: ../../themes/base/theme.css 6304 6305 6306var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; 6307 6308var widgetsControlgroup = $.widget( "ui.controlgroup", { 6309 version: "1.12.0", 6310 defaultElement: "<div>", 6311 options: { 6312 direction: "horizontal", 6313 disabled: null, 6314 onlyVisible: true, 6315 items: { 6316 "button": "input[type=button], input[type=submit], input[type=reset], button, a", 6317 "controlgroupLabel": ".ui-controlgroup-label", 6318 "checkboxradio": "input[type='checkbox'], input[type='radio']", 6319 "selectmenu": "select", 6320 "spinner": ".ui-spinner-input" 6321 } 6322 }, 6323 6324 _create: function() { 6325 this._enhance(); 6326 }, 6327 6328 // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation 6329 _enhance: function() { 6330 this.element.attr( "role", "toolbar" ); 6331 this.refresh(); 6332 }, 6333 6334 _destroy: function() { 6335 this._callChildMethod( "destroy" ); 6336 this.childWidgets.removeData( "ui-controlgroup-data" ); 6337 this.element.removeAttr( "role" ); 6338 if ( this.options.items.controlgroupLabel ) { 6339 this.element 6340 .find( this.options.items.controlgroupLabel ) 6341 .find( ".ui-controlgroup-label-contents" ) 6342 .contents().unwrap(); 6343 } 6344 }, 6345 6346 _initWidgets: function() { 6347 var that = this, 6348 childWidgets = []; 6349 6350 // First we iterate over each of the items options 6351 $.each( this.options.items, function( widget, selector ) { 6352 var labels; 6353 var options = {}; 6354 6355 6356 // Make sure the widget has a selector set 6357 if ( !selector ) { 6358 return; 6359 } 6360 6361 if ( widget === "controlgroupLabel" ) { 6362 labels = that.element.find( selector ); 6363 labels.each( function() { 6364 var element = $( this ); 6365 6366 if ( element.children( ".ui-controlgroup-label-contents" ).length ) { 6367 return; 6368 } 6369 element.contents() 6370 .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" ); 6371 } ); 6372 that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); 6373 childWidgets = childWidgets.concat( labels.get() ); 6374 return; 6375 } 6376 6377 // Make sure the widget actually exists 6378 if ( !$.fn[ widget ] ) { 6379 return; 6380 } 6381 6382 // We assume everything is in the middle to start because we can't determine 6383 // first / last elements until all enhancments are done. 6384 if ( that[ "_" + widget + "Options" ] ) { 6385 options = that[ "_" + widget + "Options" ]( "middle" ); 6386 } 6387 6388 // Find instances of this widget inside controlgroup and init them 6389 that.element 6390 .find( selector ) 6391 .each( function() { 6392 var element = $( this ); 6393 var instance = element[ widget ]( "instance" ); 6394 6395 // We need to clone the default options for this type of widget to avoid 6396 // polluting the variable options which has a wider scope than a single widget. 6397 var instanceOptions = $.widget.extend( {}, options ); 6398 6399 // If the button is the child of a spinner ignore it 6400 // TODO: Find a more generic solution 6401 if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { 6402 return; 6403 } 6404 6405 // Create the widget if it doesn't exist 6406 if ( !instance ) { 6407 instance = element[ widget ]()[ widget ]( "instance" ); 6408 } 6409 if ( instance ) { 6410 instanceOptions.classes = 6411 that._resolveClassesValues( instanceOptions.classes, instance ); 6412 } 6413 element[ widget ]( instanceOptions ); 6414 6415 // Store an instance of the controlgroup to be able to reference 6416 // from the outermost element for changing options and refresh 6417 var widgetElement = element[ widget ]( "widget" ); 6418 $.data( widgetElement[ 0 ], "ui-controlgroup-data", 6419 instance ? instance : element[ widget ]( "instance" ) ); 6420 6421 childWidgets.push( widgetElement[ 0 ] ); 6422 } ); 6423 } ); 6424 6425 this.childWidgets = $( $.unique( childWidgets ) ); 6426 this._addClass( this.childWidgets, "ui-controlgroup-item" ); 6427 }, 6428 6429 _callChildMethod: function( method ) { 6430 this.childWidgets.each( function() { 6431 var element = $( this ), 6432 data = element.data( "ui-controlgroup-data" ); 6433 if ( data && data[ method ] ) { 6434 data[ method ](); 6435 } 6436 } ); 6437 }, 6438 6439 _updateCornerClass: function( element, position ) { 6440 var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; 6441 var add = this._buildSimpleOptions( position, "label" ).classes.label; 6442 6443 this._removeClass( element, null, remove ); 6444 this._addClass( element, null, add ); 6445 }, 6446 6447 _buildSimpleOptions: function( position, key ) { 6448 var direction = this.options.direction === "vertical"; 6449 var result = { 6450 classes: {} 6451 }; 6452 result.classes[ key ] = { 6453 "middle": "", 6454 "first": "ui-corner-" + ( direction ? "top" : "left" ), 6455 "last": "ui-corner-" + ( direction ? "bottom" : "right" ), 6456 "only": "ui-corner-all" 6457 }[ position ]; 6458 6459 return result; 6460 }, 6461 6462 _spinnerOptions: function( position ) { 6463 var options = this._buildSimpleOptions( position, "ui-spinner" ); 6464 6465 options.classes[ "ui-spinner-up" ] = ""; 6466 options.classes[ "ui-spinner-down" ] = ""; 6467 6468 return options; 6469 }, 6470 6471 _buttonOptions: function( position ) { 6472 return this._buildSimpleOptions( position, "ui-button" ); 6473 }, 6474 6475 _checkboxradioOptions: function( position ) { 6476 return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); 6477 }, 6478 6479 _selectmenuOptions: function( position ) { 6480 var direction = this.options.direction === "vertical"; 6481 return { 6482 width: direction ? "auto" : false, 6483 classes: { 6484 middle: { 6485 "ui-selectmenu-button-open": "", 6486 "ui-selectmenu-button-closed": "" 6487 }, 6488 first: { 6489 "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), 6490 "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) 6491 }, 6492 last: { 6493 "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", 6494 "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) 6495 }, 6496 only: { 6497 "ui-selectmenu-button-open": "ui-corner-top", 6498 "ui-selectmenu-button-closed": "ui-corner-all" 6499 } 6500 6501 }[ position ] 6502 }; 6503 }, 6504 6505 _resolveClassesValues: function( classes, instance ) { 6506 var result = {}; 6507 $.each( classes, function( key ) { 6508 var current = instance.options.classes[ key ] || ""; 6509 current = current.replace( controlgroupCornerRegex, "" ).trim(); 6510 result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); 6511 } ); 6512 return result; 6513 }, 6514 6515 _setOption: function( key, value ) { 6516 if ( key === "direction" ) { 6517 this._removeClass( "ui-controlgroup-" + this.options.direction ); 6518 } 6519 6520 this._super( key, value ); 6521 if ( key === "disabled" ) { 6522 this._callChildMethod( value ? "disable" : "enable" ); 6523 return; 6524 } 6525 6526 this.refresh(); 6527 }, 6528 6529 refresh: function() { 6530 var children, 6531 that = this; 6532 6533 this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); 6534 6535 if ( this.options.direction === "horizontal" ) { 6536 this._addClass( null, "ui-helper-clearfix" ); 6537 } 6538 this._initWidgets(); 6539 6540 children = this.childWidgets; 6541 6542 // We filter here because we need to track all childWidgets not just the visible ones 6543 if ( this.options.onlyVisible ) { 6544 children = children.filter( ":visible" ); 6545 } 6546 6547 if ( children.length ) { 6548 6549 // We do this last because we need to make sure all enhancment is done 6550 // before determining first and last 6551 $.each( [ "first", "last" ], function( index, value ) { 6552 var instance = children[ value ]().data( "ui-controlgroup-data" ); 6553 6554 if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { 6555 var options = that[ "_" + instance.widgetName + "Options" ]( 6556 children.length === 1 ? "only" : value 6557 ); 6558 options.classes = that._resolveClassesValues( options.classes, instance ); 6559 instance.element[ instance.widgetName ]( options ); 6560 } else { 6561 that._updateCornerClass( children[ value ](), value ); 6562 } 6563 } ); 6564 6565 // Finally call the refresh method on each of the child widgets. 6566 this._callChildMethod( "refresh" ); 6567 } 6568 } 6569} ); 6570 6571/*! 6572 * jQuery UI Checkboxradio 1.12.0 6573 * http://jqueryui.com 6574 * 6575 * Copyright jQuery Foundation and other contributors 6576 * Released under the MIT license. 6577 * http://jquery.org/license 6578 */ 6579 6580//>>label: Checkboxradio 6581//>>group: Widgets 6582//>>description: Enhances a form with multiple themeable checkboxes or radio buttons. 6583//>>docs: http://api.jqueryui.com/checkboxradio/ 6584//>>demos: http://jqueryui.com/checkboxradio/ 6585//>>css.structure: ../../themes/base/core.css 6586//>>css.structure: ../../themes/base/button.css 6587//>>css.structure: ../../themes/base/checkboxradio.css 6588//>>css.theme: ../../themes/base/theme.css 6589 6590 6591 6592$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { 6593 version: "1.12.0", 6594 options: { 6595 disabled: null, 6596 label: null, 6597 icon: true, 6598 classes: { 6599 "ui-checkboxradio-label": "ui-corner-all", 6600 "ui-checkboxradio-icon": "ui-corner-all" 6601 } 6602 }, 6603 6604 _getCreateOptions: function() { 6605 var disabled, labels; 6606 var that = this; 6607 var options = this._super() || {}; 6608 6609 // We read the type here, because it makes more sense to throw a element type error first, 6610 // rather then the error for lack of a label. Often if its the wrong type, it 6611 // won't have a label (e.g. calling on a div, btn, etc) 6612 this._readType(); 6613 6614 labels = this.element.labels(); 6615 6616 // If there are multiple labels, use the last one 6617 this.label = $( labels[ labels.length - 1 ] ); 6618 if ( !this.label.length ) { 6619 $.error( "No label found for checkboxradio widget" ); 6620 } 6621 6622 this.originalLabel = ""; 6623 6624 6625 // We need to get the label text but this may also need to make sure it does not contain the 6626 // input itself. 6627 this.label.contents().not( this.element ).each( function() { 6628 6629 // The label contents could be text, html, or a mix. We concat each element to get a 6630 // string representation of the label, without the input as part of it. 6631 that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML; 6632 } ); 6633 6634 // Set the label option if we found label text 6635 if ( this.originalLabel ) { 6636 options.label = this.originalLabel; 6637 } 6638 6639 disabled = this.element[ 0 ].disabled; 6640 if ( disabled != null ) { 6641 options.disabled = disabled; 6642 } 6643 return options; 6644 }, 6645 6646 _create: function() { 6647 var checked = this.element[ 0 ].checked; 6648 6649 this._bindFormResetHandler(); 6650 6651 if ( this.options.disabled == null ) { 6652 this.options.disabled = this.element[ 0 ].disabled; 6653 } 6654 6655 this._setOption( "disabled", this.options.disabled ); 6656 this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" ); 6657 this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" ); 6658 6659 if ( this.type === "radio" ) { 6660 this._addClass( this.label, "ui-checkboxradio-radio-label" ); 6661 } 6662 6663 if ( this.options.label && this.options.label !== this.originalLabel ) { 6664 this._updateLabel(); 6665 } else if ( this.originalLabel ) { 6666 this.options.label = this.originalLabel; 6667 } 6668 6669 this._enhance(); 6670 6671 if ( checked ) { 6672 this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); 6673 if ( this.icon ) { 6674 this._addClass( this.icon, null, "ui-state-hover" ); 6675 } 6676 } 6677 6678 this._on( { 6679 change: "_toggleClasses", 6680 focus: function() { 6681 this._addClass( this.label, null, "ui-state-focus ui-visual-focus" ); 6682 }, 6683 blur: function() { 6684 this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" ); 6685 } 6686 } ); 6687 }, 6688 6689 _readType: function() { 6690 var nodeName = this.element[ 0 ].nodeName.toLowerCase(); 6691 this.type = this.element[ 0 ].type; 6692 if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) { 6693 $.error( "Can't create checkboxradio on element.nodeName=" + nodeName + 6694 " and element.type=" + this.type ); 6695 } 6696 }, 6697 6698 // Support jQuery Mobile enhanced option 6699 _enhance: function() { 6700 this._updateIcon( this.element[ 0 ].checked ); 6701 }, 6702 6703 widget: function() { 6704 return this.label; 6705 }, 6706 6707 _getRadioGroup: function() { 6708 var group; 6709 var name = this.element[ 0 ].name; 6710 var nameSelector = "input[name='" + $.ui.escapeSelector( name ) + "']"; 6711 6712 if ( !name ) { 6713 return $( [] ); 6714 } 6715 6716 if ( this.form.length ) { 6717 group = $( this.form[ 0 ].elements ).filter( nameSelector ); 6718 } else { 6719 6720 // Not inside a form, check all inputs that also are not inside a form 6721 group = $( nameSelector ).filter( function() { 6722 return $( this ).form().length === 0; 6723 } ); 6724 } 6725 6726 return group.not( this.element ); 6727 }, 6728 6729 _toggleClasses: function() { 6730 var checked = this.element[ 0 ].checked; 6731 this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); 6732 6733 if ( this.options.icon && this.type === "checkbox" ) { 6734 this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked ) 6735 ._toggleClass( this.icon, null, "ui-icon-blank", !checked ); 6736 } 6737 6738 if ( this.type === "radio" ) { 6739 this._getRadioGroup() 6740 .each( function() { 6741 var instance = $( this ).checkboxradio( "instance" ); 6742 6743 if ( instance ) { 6744 instance._removeClass( instance.label, 6745 "ui-checkboxradio-checked", "ui-state-active" ); 6746 } 6747 } ); 6748 } 6749 }, 6750 6751 _destroy: function() { 6752 this._unbindFormResetHandler(); 6753 6754 if ( this.icon ) { 6755 this.icon.remove();
vendor: 4,505 bytes, lines 6756-6921
6756 this.iconSpace.remove(); 6757 } 6758 }, 6759 6760 _setOption: function( key, value ) { 6761 6762 // We don't allow the value to be set to nothing 6763 if ( key === "label" && !value ) { 6764 return; 6765 } 6766 6767 this._super( key, value ); 6768 6769 if ( key === "disabled" ) { 6770 this._toggleClass( this.label, null, "ui-state-disabled", value ); 6771 this.element[ 0 ].disabled = value; 6772 6773 // Don't refresh when setting disabled 6774 return; 6775 } 6776 this.refresh(); 6777 }, 6778 6779 _updateIcon: function( checked ) { 6780 var toAdd = "ui-icon ui-icon-background "; 6781 6782 if ( this.options.icon ) { 6783 if ( !this.icon ) { 6784 this.icon = $( "<span>" ); 6785 this.iconSpace = $( "<span> </span>" ); 6786 this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" ); 6787 } 6788 6789 if ( this.type === "checkbox" ) { 6790 toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank"; 6791 this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" ); 6792 } else { 6793 toAdd += "ui-icon-blank"; 6794 } 6795 this._addClass( this.icon, "ui-checkboxradio-icon", toAdd ); 6796 if ( !checked ) { 6797 this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" ); 6798 } 6799 this.icon.prependTo( this.label ).after( this.iconSpace ); 6800 } else if ( this.icon !== undefined ) { 6801 this.icon.remove(); 6802 this.iconSpace.remove(); 6803 delete this.icon; 6804 } 6805 }, 6806 6807 _updateLabel: function() { 6808 6809 // Remove the contents of the label ( minus the icon, icon space, and input ) 6810 this.label.contents().not( this.element.add( this.icon ).add( this.iconSpace ) ).remove(); 6811 this.label.append( this.options.label ); 6812 }, 6813 6814 refresh: function() { 6815 var checked = this.element[ 0 ].checked, 6816 isDisabled = this.element[ 0 ].disabled; 6817 6818 this._updateIcon( checked ); 6819 this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); 6820 if ( this.options.label !== null ) { 6821 this._updateLabel(); 6822 } 6823 6824 if ( isDisabled !== this.options.disabled ) { 6825 this._setOptions( { "disabled": isDisabled } ); 6826 } 6827 } 6828 6829} ] ); 6830 6831var widgetsCheckboxradio = $.ui.checkboxradio; 6832 6833 6834/*! 6835 * jQuery UI Button 1.12.0 6836 * http://jqueryui.com 6837 * 6838 * Copyright jQuery Foundation and other contributors 6839 * Released under the MIT license. 6840 * http://jquery.org/license 6841 */ 6842 6843//>>label: Button 6844//>>group: Widgets 6845//>>description: Enhances a form with themeable buttons. 6846//>>docs: http://api.jqueryui.com/button/ 6847//>>demos: http://jqueryui.com/button/ 6848//>>css.structure: ../../themes/base/core.css 6849//>>css.structure: ../../themes/base/button.css 6850//>>css.theme: ../../themes/base/theme.css 6851 6852 6853 6854$.widget( "ui.button", { 6855 version: "1.12.0", 6856 defaultElement: "<button>", 6857 options: { 6858 classes: { 6859 "ui-button": "ui-corner-all" 6860 }, 6861 disabled: null, 6862 icon: null, 6863 iconPosition: "beginning", 6864 label: null, 6865 showLabel: true 6866 }, 6867 6868 _getCreateOptions: function() { 6869 var disabled, 6870 6871 // This is to support cases like in jQuery Mobile where the base widget does have 6872 // an implementation of _getCreateOptions 6873 options = this._super() || {}; 6874 6875 this.isInput = this.element.is( "input" ); 6876 6877 disabled = this.element[ 0 ].disabled; 6878 if ( disabled != null ) { 6879 options.disabled = disabled; 6880 } 6881 6882 this.originalLabel = this.isInput ? this.element.val() : this.element.html(); 6883 if ( this.originalLabel ) { 6884 options.label = this.originalLabel; 6885 } 6886 6887 return options; 6888 }, 6889 6890 _create: function() { 6891 if ( !this.option.showLabel & !this.options.icon ) { 6892 this.options.showLabel = true; 6893 } 6894 6895 // We have to check the option again here even though we did in _getCreateOptions, 6896 // because null may have been passed on init which would override what was set in 6897 // _getCreateOptions 6898 if ( this.options.disabled == null ) { 6899 this.options.disabled = this.element[ 0 ].disabled || false; 6900 } 6901 6902 this.hasTitle = !!this.element.attr( "title" ); 6903 6904 // Check to see if the label needs to be set or if its already correct 6905 if ( this.options.label && this.options.label !== this.originalLabel ) { 6906 if ( this.isInput ) { 6907 this.element.val( this.options.label ); 6908 } else { 6909 this.element.html( this.options.label ); 6910 } 6911 } 6912 this._addClass( "ui-button", "ui-widget" ); 6913 this._setOption( "disabled", this.options.disabled ); 6914 this._enhance(); 6915 6916 if ( this.element.is( "a" ) ) { 6917 this._on( { 6918 "keyup": function( event ) { 6919 if ( event.keyCode === $.ui.keyCode.SPACE ) { 6920 event.preventDefault(); 6921
vendor: 7,743 bytes, lines 6922-7204
6922 // Support: PhantomJS <= 1.9, IE 8 Only 6923 // If a native click is available use it so we actually cause navigation 6924 // otherwise just trigger a click event 6925 if ( this.element[ 0 ].click ) { 6926 this.element[ 0 ].click(); 6927 } else { 6928 this.element.trigger( "click" ); 6929 } 6930 } 6931 } 6932 } ); 6933 } 6934 }, 6935 6936 _enhance: function() { 6937 if ( !this.element.is( "button" ) ) { 6938 this.element.attr( "role", "button" ); 6939 } 6940 6941 if ( this.options.icon ) { 6942 this._updateIcon( "icon", this.options.icon ); 6943 this._updateTooltip(); 6944 } 6945 }, 6946 6947 _updateTooltip: function() { 6948 this.title = this.element.attr( "title" ); 6949 6950 if ( !this.options.showLabel && !this.title ) { 6951 this.element.attr( "title", this.options.label ); 6952 } 6953 }, 6954 6955 _updateIcon: function( option, value ) { 6956 var icon = option !== "iconPosition", 6957 position = icon ? this.options.iconPosition : value, 6958 displayBlock = position === "top" || position === "bottom"; 6959 6960 // Create icon 6961 if ( !this.icon ) { 6962 this.icon = $( "<span>" ); 6963 6964 this._addClass( this.icon, "ui-button-icon", "ui-icon" ); 6965 6966 if ( !this.options.showLabel ) { 6967 this._addClass( "ui-button-icon-only" ); 6968 } 6969 } else if ( icon ) { 6970 6971 // If we are updating the icon remove the old icon class 6972 this._removeClass( this.icon, null, this.options.icon ); 6973 } 6974 6975 // If we are updating the icon add the new icon class 6976 if ( icon ) { 6977 this._addClass( this.icon, null, value ); 6978 } 6979 6980 this._attachIcon( position ); 6981 6982 // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove 6983 // the iconSpace if there is one. 6984 if ( displayBlock ) { 6985 this._addClass( this.icon, null, "ui-widget-icon-block" ); 6986 if ( this.iconSpace ) { 6987 this.iconSpace.remove(); 6988 } 6989 } else { 6990 6991 // Position is beginning or end so remove the ui-widget-icon-block class and add the 6992 // space if it does not exist 6993 if ( !this.iconSpace ) { 6994 this.iconSpace = $( "<span> </span>" ); 6995 this._addClass( this.iconSpace, "ui-button-icon-space" ); 6996 } 6997 this._removeClass( this.icon, null, "ui-wiget-icon-block" ); 6998 this._attachIconSpace( position ); 6999 } 7000 }, 7001 7002 _destroy: function() { 7003 this.element.removeAttr( "role" ); 7004 7005 if ( this.icon ) { 7006 this.icon.remove(); 7007 } 7008 if ( this.iconSpace ) { 7009 this.iconSpace.remove(); 7010 } 7011 if ( !this.hasTitle ) { 7012 this.element.removeAttr( "title" ); 7013 } 7014 }, 7015 7016 _attachIconSpace: function( iconPosition ) { 7017 this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace ); 7018 }, 7019 7020 _attachIcon: function( iconPosition ) { 7021 this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon ); 7022 }, 7023 7024 _setOptions: function( options ) { 7025 var newShowLabel = options.showLabel === undefined ? 7026 this.options.showLabel : 7027 options.showLabel, 7028 newIcon = options.icon === undefined ? this.options.icon : options.icon; 7029 7030 if ( !newShowLabel && !newIcon ) { 7031 options.showLabel = true; 7032 } 7033 this._super( options ); 7034 }, 7035 7036 _setOption: function( key, value ) { 7037 if ( key === "icon" ) { 7038 if ( value ) { 7039 this._updateIcon( key, value ); 7040 } else if ( this.icon ) { 7041 this.icon.remove(); 7042 if ( this.iconSpace ) { 7043 this.iconSpace.remove(); 7044 } 7045 } 7046 } 7047 7048 if ( key === "iconPosition" ) { 7049 this._updateIcon( key, value ); 7050 } 7051 7052 // Make sure we can't end up with a button that has neither text nor icon 7053 if ( key === "showLabel" ) { 7054 this._toggleClass( "ui-button-icon-only", null, !value ); 7055 this._updateTooltip(); 7056 } 7057 7058 if ( key === "label" ) { 7059 if ( this.isInput ) { 7060 this.element.val( value ); 7061 } else { 7062 7063 // If there is an icon, append it, else nothing then append the value 7064 // this avoids removal of the icon when setting label text 7065 this.element.html( value ); 7066 if ( this.icon ) { 7067 this._attachIcon( this.options.iconPosition ); 7068 this._attachIconSpace( this.options.iconPosition ); 7069 } 7070 } 7071 } 7072 7073 this._super( key, value ); 7074 7075 if ( key === "disabled" ) { 7076 this._toggleClass( null, "ui-state-disabled", value ); 7077 this.element[ 0 ].disabled = value; 7078 if ( value ) { 7079 this.element.blur(); 7080 } 7081 } 7082 }, 7083 7084 refresh: function() { 7085 7086 // Make sure to only check disabled if its an element that supports this otherwise 7087 // check for the disabled class to determine state 7088 var isDisabled = this.element.is( "input, button" ) ? 7089 this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" ); 7090 7091 if ( isDisabled !== this.options.disabled ) { 7092 this._setOptions( { disabled: isDisabled } ); 7093 } 7094 7095 this._updateTooltip(); 7096 } 7097} ); 7098 7099// DEPRECATED 7100if ( $.uiBackCompat !== false ) { 7101 7102 // Text and Icons options 7103 $.widget( "ui.button", $.ui.button, { 7104 options: { 7105 text: true, 7106 icons: { 7107 primary: null, 7108 secondary: null 7109 } 7110 }, 7111 7112 _create: function() { 7113 if ( this.options.showLabel && !this.options.text ) { 7114 this.options.showLabel = this.options.text; 7115 } 7116 if ( !this.options.showLabel && this.options.text ) { 7117 this.options.text = this.options.showLabel; 7118 } 7119 if ( !this.options.icon && ( this.options.icons.primary || 7120 this.options.icons.secondary ) ) { 7121 if ( this.options.icons.primary ) { 7122 this.options.icon = this.options.icons.primary; 7123 } else { 7124 this.options.icon = this.options.icons.secondary; 7125 this.options.iconPosition = "end"; 7126 } 7127 } else if ( this.options.icon ) { 7128 this.options.icons.primary = this.options.icon; 7129 } 7130 this._super(); 7131 }, 7132 7133 _setOption: function( key, value ) { 7134 if ( key === "text" ) { 7135 this._super( "showLabel", value ); 7136 return; 7137 } 7138 if ( key === "showLabel" ) { 7139 this.options.text = value; 7140 } 7141 if ( key === "icon" ) { 7142 this.options.icons.primary = value; 7143 } 7144 if ( key === "icons" ) { 7145 if ( value.primary ) { 7146 this._super( "icon", value.primary ); 7147 this._super( "iconPosition", "beginning" ); 7148 } else if ( value.secondary ) { 7149 this._super( "icon", value.secondary ); 7150 this._super( "iconPosition", "end" ); 7151 } 7152 } 7153 this._superApply( arguments ); 7154 } 7155 } ); 7156 7157 $.fn.button = ( function( orig ) { 7158 return function() { 7159 if ( !this.length || ( this.length && this[ 0 ].tagName !== "INPUT" ) || 7160 ( this.length && this[ 0 ].tagName === "INPUT" && ( 7161 this.attr( "type" ) !== "checkbox" && this.attr( "type" ) !== "radio" 7162 ) ) ) { 7163 return orig.apply( this, arguments ); 7164 } 7165 if ( !$.ui.checkboxradio ) { 7166 $.error( "Checkboxradio widget missing" ); 7167 } 7168 if ( arguments.length === 0 ) { 7169 return this.checkboxradio( { 7170 "icon": false 7171 } ); 7172 } 7173 return this.checkboxradio.apply( this, arguments ); 7174 }; 7175 } )( $.fn.button ); 7176 7177 $.fn.buttonset = function() { 7178 if ( !$.ui.controlgroup ) { 7179 $.error( "Controlgroup widget missing" ); 7180 } 7181 if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) { 7182 return this.controlgroup.apply( this, 7183 [ arguments[ 0 ], "items.button", arguments[ 2 ] ] ); 7184 } 7185 if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) { 7186 return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] ); 7187 } 7188 if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) { 7189 arguments[ 0 ].items = { 7190 button: arguments[ 0 ].items 7191 }; 7192 } 7193 return this.controlgroup.apply( this, arguments ); 7194 }; 7195} 7196 7197var widgetsButton = $.ui.button; 7198 7199 7200// jscs:disable maximumLineLength 7201/* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */ 7202/*! 7203 * jQuery UI Datepicker 1.12.0 7204 * http://jqueryui.com
vendor: 4,553 bytes, lines 7205-7291
7205 * 7206 * Copyright jQuery Foundation and other contributors 7207 * Released under the MIT license. 7208 * http://jquery.org/license 7209 */ 7210 7211//>>label: Datepicker 7212//>>group: Widgets 7213//>>description: Displays a calendar from an input or inline for selecting dates. 7214//>>docs: http://api.jqueryui.com/datepicker/ 7215//>>demos: http://jqueryui.com/datepicker/ 7216//>>css.structure: ../../themes/base/core.css 7217//>>css.structure: ../../themes/base/datepicker.css 7218//>>css.theme: ../../themes/base/theme.css 7219 7220 7221 7222$.extend( $.ui, { datepicker: { version: "1.12.0" } } ); 7223 7224var datepicker_instActive; 7225 7226function datepicker_getZindex( elem ) { 7227 var position, value; 7228 while ( elem.length && elem[ 0 ] !== document ) { 7229 7230 // Ignore z-index if position is set to a value where z-index is ignored by the browser 7231 // This makes behavior of this function consistent across browsers 7232 // WebKit always returns auto if the element is positioned 7233 position = elem.css( "position" ); 7234 if ( position === "absolute" || position === "relative" || position === "fixed" ) { 7235 7236 // IE returns 0 when zIndex is not specified 7237 // other browsers return a string 7238 // we ignore the case of nested elements with an explicit value of 0 7239 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> 7240 value = parseInt( elem.css( "zIndex" ), 10 ); 7241 if ( !isNaN( value ) && value !== 0 ) { 7242 return value; 7243 } 7244 } 7245 elem = elem.parent(); 7246 } 7247 7248 return 0; 7249} 7250/* Date picker manager. 7251 Use the singleton instance of this class, $.datepicker, to interact with the date picker. 7252 Settings for (groups of) date pickers are maintained in an instance object, 7253 allowing multiple different settings on the same page. */ 7254 7255function Datepicker() { 7256 this._curInst = null; // The current instance in use 7257 this._keyEvent = false; // If the last event was a key event 7258 this._disabledInputs = []; // List of date picker inputs that have been disabled 7259 this._datepickerShowing = false; // True if the popup picker is showing , false if not 7260 this._inDialog = false; // True if showing within a "dialog", false if not 7261 this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division 7262 this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class 7263 this._appendClass = "ui-datepicker-append"; // The name of the append marker class 7264 this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class 7265 this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class 7266 this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class 7267 this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class 7268 this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class 7269 this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class 7270 this.regional = []; // Available regional settings, indexed by language code 7271 this.regional[ "" ] = { // Default regional settings 7272 closeText: "Done", // Display text for close link 7273 prevText: "Prev", // Display text for previous month link 7274 nextText: "Next", // Display text for next month link 7275 currentText: "Today", // Display text for current month link 7276 monthNames: [ "January","February","March","April","May","June", 7277 "July","August","September","October","November","December" ], // Names of months for drop-down and formatting 7278 monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting 7279 dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting 7280 dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting 7281 dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ], // Column headings for days starting at Sunday 7282 weekHeader: "Wk", // Column header for week of the year 7283 dateFormat: "mm/dd/yy", // See format options on parseDate 7284 firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... 7285 isRTL: false, // True if right-to-left language, false if left-to-right 7286 showMonthAfterYear: false, // True if the year select precedes month, false for month then year 7287 yearSuffix: "" // Additional text to append to the year in the month headers 7288 }; 7289 this._defaults = { // Global defaults for all the date picker instances 7290 showOn: "focus", // "focus" for popup on focus, 7291 // "button" for trigger button, or "both" for either
vendor: 6,761 bytes, lines 7292-7424
7292 showAnim: "fadeIn", // Name of jQuery animation for popup 7293 showOptions: {}, // Options for enhanced animations 7294 defaultDate: null, // Used when field is blank: actual date, 7295 // +/-number for offset from today, null for today 7296 appendText: "", // Display text following the input box, e.g. showing the format 7297 buttonText: "...", // Text for trigger button 7298 buttonImage: "", // URL for trigger button image 7299 buttonImageOnly: false, // True if the image appears alone, false if it appears on a button 7300 hideIfNoPrevNext: false, // True to hide next/previous month links 7301 // if not applicable, false to just disable them 7302 navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links 7303 gotoCurrent: false, // True if today link goes back to current selection instead 7304 changeMonth: false, // True if month can be selected directly, false if only prev/next 7305 changeYear: false, // True if year can be selected directly, false if only prev/next 7306 yearRange: "c-10:c+10", // Range of years to display in drop-down, 7307 // either relative to today's year (-nn:+nn), relative to currently displayed year 7308 // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) 7309 showOtherMonths: false, // True to show dates in other months, false to leave blank 7310 selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable 7311 showWeek: false, // True to show week of the year, false to not show it 7312 calculateWeek: this.iso8601Week, // How to calculate the week of the year, 7313 // takes a Date and returns the number of the week for it 7314 shortYearCutoff: "+10", // Short year values < this are in the current century, 7315 // > this are in the previous century, 7316 // string value starting with "+" for current year + value 7317 minDate: null, // The earliest selectable date, or null for no limit 7318 maxDate: null, // The latest selectable date, or null for no limit 7319 duration: "fast", // Duration of display/closure 7320 beforeShowDay: null, // Function that takes a date and returns an array with 7321 // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "", 7322 // [2] = cell title (optional), e.g. $.datepicker.noWeekends 7323 beforeShow: null, // Function that takes an input field and 7324 // returns a set of custom settings for the date picker 7325 onSelect: null, // Define a callback function when a date is selected 7326 onChangeMonthYear: null, // Define a callback function when the month or year is changed 7327 onClose: null, // Define a callback function when the datepicker is closed 7328 numberOfMonths: 1, // Number of months to show at a time 7329 showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) 7330 stepMonths: 1, // Number of months to step back/forward 7331 stepBigMonths: 12, // Number of months to step back/forward for the big links 7332 altField: "", // Selector for an alternate field to store selected dates into 7333 altFormat: "", // The date format to use for the alternate field 7334 constrainInput: true, // The input is constrained by the current date format 7335 showButtonPanel: false, // True to show button panel, false to not show it 7336 autoSize: false, // True to size the input for the date format, false to leave as is 7337 disabled: false // The initial disabled state 7338 }; 7339 $.extend( this._defaults, this.regional[ "" ] ); 7340 this.regional.en = $.extend( true, {}, this.regional[ "" ] ); 7341 this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en ); 7342 this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ); 7343} 7344 7345$.extend( Datepicker.prototype, { 7346 /* Class name added to elements to indicate already configured with a date picker. */ 7347 markerClassName: "hasDatepicker", 7348 7349 //Keep track of the maximum number of rows displayed (see #7043) 7350 maxRows: 4, 7351 7352 // TODO rename to "widget" when switching to widget factory 7353 _widgetDatepicker: function() { 7354 return this.dpDiv; 7355 }, 7356 7357 /* Override the default settings for all instances of the date picker. 7358 * @param settings object - the new settings to use as defaults (anonymous object) 7359 * @return the manager object 7360 */ 7361 setDefaults: function( settings ) { 7362 datepicker_extendRemove( this._defaults, settings || {} ); 7363 return this; 7364 }, 7365 7366 /* Attach the date picker to a jQuery selection. 7367 * @param target element - the target input field or division or span 7368 * @param settings object - the new settings to use for this date picker instance (anonymous) 7369 */ 7370 _attachDatepicker: function( target, settings ) { 7371 var nodeName, inline, inst; 7372 nodeName = target.nodeName.toLowerCase(); 7373 inline = ( nodeName === "div" || nodeName === "span" ); 7374 if ( !target.id ) { 7375 this.uuid += 1; 7376 target.id = "dp" + this.uuid; 7377 } 7378 inst = this._newInst( $( target ), inline ); 7379 inst.settings = $.extend( {}, settings || {} ); 7380 if ( nodeName === "input" ) { 7381 this._connectDatepicker( target, inst ); 7382 } else if ( inline ) { 7383 this._inlineDatepicker( target, inst ); 7384 } 7385 }, 7386 7387 /* Create a new instance object. */ 7388 _newInst: function( target, inline ) { 7389 var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars 7390 return { id: id, input: target, // associated target 7391 selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection 7392 drawMonth: 0, drawYear: 0, // month being drawn 7393 inline: inline, // is datepicker inline or not 7394 dpDiv: ( !inline ? this.dpDiv : // presentation div 7395 datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) }; 7396 }, 7397 7398 /* Attach the date picker to an input field. */ 7399 _connectDatepicker: function( target, inst ) { 7400 var input = $( target ); 7401 inst.append = $( [] ); 7402 inst.trigger = $( [] ); 7403 if ( input.hasClass( this.markerClassName ) ) { 7404 return; 7405 } 7406 this._attachments( input, inst ); 7407 input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ). 7408 on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp ); 7409 this._autoSize( inst ); 7410 $.data( target, "datepicker", inst ); 7411 7412 //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) 7413 if ( inst.settings.disabled ) { 7414 this._disableDatepicker( target ); 7415 } 7416 }, 7417 7418 /* Make attachments based on settings. */ 7419 _attachments: function( input, inst ) { 7420 var showOn, buttonText, buttonImage, 7421 appendText = this._get( inst, "appendText" ), 7422 isRTL = this._get( inst, "isRTL" ); 7423 7424 if ( inst.append ) {
vendor: 6,192 bytes, lines 7425-7582
7425 inst.append.remove(); 7426 } 7427 if ( appendText ) { 7428 inst.append = $( "<span class='" + this._appendClass + "'>" + appendText + "</span>" ); 7429 input[ isRTL ? "before" : "after" ]( inst.append ); 7430 } 7431 7432 input.off( "focus", this._showDatepicker ); 7433 7434 if ( inst.trigger ) { 7435 inst.trigger.remove(); 7436 } 7437 7438 showOn = this._get( inst, "showOn" ); 7439 if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field 7440 input.on( "focus", this._showDatepicker ); 7441 } 7442 if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked 7443 buttonText = this._get( inst, "buttonText" ); 7444 buttonImage = this._get( inst, "buttonImage" ); 7445 inst.trigger = $( this._get( inst, "buttonImageOnly" ) ? 7446 $( "<img/>" ).addClass( this._triggerClass ). 7447 attr( { src: buttonImage, alt: buttonText, title: buttonText } ) : 7448 $( "<button type='button'></button>" ).addClass( this._triggerClass ). 7449 html( !buttonImage ? buttonText : $( "<img/>" ).attr( 7450 { src:buttonImage, alt:buttonText, title:buttonText } ) ) ); 7451 input[ isRTL ? "before" : "after" ]( inst.trigger ); 7452 inst.trigger.on( "click", function() { 7453 if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) { 7454 $.datepicker._hideDatepicker(); 7455 } else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) { 7456 $.datepicker._hideDatepicker(); 7457 $.datepicker._showDatepicker( input[ 0 ] ); 7458 } else { 7459 $.datepicker._showDatepicker( input[ 0 ] ); 7460 } 7461 return false; 7462 } ); 7463 } 7464 }, 7465 7466 /* Apply the maximum length for the date format. */ 7467 _autoSize: function( inst ) { 7468 if ( this._get( inst, "autoSize" ) && !inst.inline ) { 7469 var findMax, max, maxI, i, 7470 date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits 7471 dateFormat = this._get( inst, "dateFormat" ); 7472 7473 if ( dateFormat.match( /[DM]/ ) ) { 7474 findMax = function( names ) { 7475 max = 0; 7476 maxI = 0; 7477 for ( i = 0; i < names.length; i++ ) { 7478 if ( names[ i ].length > max ) { 7479 max = names[ i ].length; 7480 maxI = i; 7481 } 7482 } 7483 return maxI; 7484 }; 7485 date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ? 7486 "monthNames" : "monthNamesShort" ) ) ) ); 7487 date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ? 7488 "dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() ); 7489 } 7490 inst.input.attr( "size", this._formatDate( inst, date ).length ); 7491 } 7492 }, 7493 7494 /* Attach an inline date picker to a div. */ 7495 _inlineDatepicker: function( target, inst ) { 7496 var divSpan = $( target ); 7497 if ( divSpan.hasClass( this.markerClassName ) ) { 7498 return; 7499 } 7500 divSpan.addClass( this.markerClassName ).append( inst.dpDiv ); 7501 $.data( target, "datepicker", inst ); 7502 this._setDate( inst, this._getDefaultDate( inst ), true ); 7503 this._updateDatepicker( inst ); 7504 this._updateAlternate( inst ); 7505 7506 //If disabled option is true, disable the datepicker before showing it (see ticket #5665) 7507 if ( inst.settings.disabled ) { 7508 this._disableDatepicker( target ); 7509 } 7510 7511 // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements 7512 // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height 7513 inst.dpDiv.css( "display", "block" ); 7514 }, 7515 7516 /* Pop-up the date picker in a "dialog" box. 7517 * @param input element - ignored 7518 * @param date string or Date - the initial date to display 7519 * @param onSelect function - the function to call when a date is selected 7520 * @param settings object - update the dialog date picker instance's settings (anonymous object) 7521 * @param pos int[2] - coordinates for the dialog's position within the screen or 7522 * event - with x/y coordinates or 7523 * leave empty for default (screen centre) 7524 * @return the manager object 7525 */ 7526 _dialogDatepicker: function( input, date, onSelect, settings, pos ) { 7527 var id, browserWidth, browserHeight, scrollX, scrollY, 7528 inst = this._dialogInst; // internal instance 7529 7530 if ( !inst ) { 7531 this.uuid += 1; 7532 id = "dp" + this.uuid; 7533 this._dialogInput = $( "<input type='text' id='" + id + 7534 "' style='position: absolute; top: -100px; width: 0px;'/>" ); 7535 this._dialogInput.on( "keydown", this._doKeyDown ); 7536 $( "body" ).append( this._dialogInput ); 7537 inst = this._dialogInst = this._newInst( this._dialogInput, false ); 7538 inst.settings = {}; 7539 $.data( this._dialogInput[ 0 ], "datepicker", inst ); 7540 } 7541 datepicker_extendRemove( inst.settings, settings || {} ); 7542 date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date ); 7543 this._dialogInput.val( date ); 7544 7545 this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null ); 7546 if ( !this._pos ) { 7547 browserWidth = document.documentElement.clientWidth; 7548 browserHeight = document.documentElement.clientHeight; 7549 scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; 7550 scrollY = document.documentElement.scrollTop || document.body.scrollTop; 7551 this._pos = // should use actual width/height below 7552 [ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ]; 7553 } 7554 7555 // Move input on screen for focus, but hidden behind dialog 7556 this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" ); 7557 inst.settings.onSelect = onSelect; 7558 this._inDialog = true; 7559 this.dpDiv.addClass( this._dialogClass ); 7560 this._showDatepicker( this._dialogInput[ 0 ] ); 7561 if ( $.blockUI ) { 7562 $.blockUI( this.dpDiv ); 7563 } 7564 $.data( this._dialogInput[ 0 ], "datepicker", inst ); 7565 return this; 7566 }, 7567 7568 /* Detach a datepicker from its control. 7569 * @param target element - the target input field or division or span 7570 */ 7571 _destroyDatepicker: function( target ) { 7572 var nodeName, 7573 $target = $( target ), 7574 inst = $.data( target, "datepicker" ); 7575 7576 if ( !$target.hasClass( this.markerClassName ) ) { 7577 return; 7578 } 7579 7580 nodeName = target.nodeName.toLowerCase(); 7581 $.removeData( target, "datepicker" ); 7582 if ( nodeName === "input" ) {
vendor: 12,111 bytes, lines 7583-7923
7583 inst.append.remove(); 7584 inst.trigger.remove(); 7585 $target.removeClass( this.markerClassName ). 7586 off( "focus", this._showDatepicker ). 7587 off( "keydown", this._doKeyDown ). 7588 off( "keypress", this._doKeyPress ). 7589 off( "keyup", this._doKeyUp ); 7590 } else if ( nodeName === "div" || nodeName === "span" ) { 7591 $target.removeClass( this.markerClassName ).empty(); 7592 } 7593 7594 if ( datepicker_instActive === inst ) { 7595 datepicker_instActive = null; 7596 } 7597 }, 7598 7599 /* Enable the date picker to a jQuery selection. 7600 * @param target element - the target input field or division or span 7601 */ 7602 _enableDatepicker: function( target ) { 7603 var nodeName, inline, 7604 $target = $( target ), 7605 inst = $.data( target, "datepicker" ); 7606 7607 if ( !$target.hasClass( this.markerClassName ) ) { 7608 return; 7609 } 7610 7611 nodeName = target.nodeName.toLowerCase(); 7612 if ( nodeName === "input" ) { 7613 target.disabled = false; 7614 inst.trigger.filter( "button" ). 7615 each( function() { this.disabled = false; } ).end(). 7616 filter( "img" ).css( { opacity: "1.0", cursor: "" } ); 7617 } else if ( nodeName === "div" || nodeName === "span" ) { 7618 inline = $target.children( "." + this._inlineClass ); 7619 inline.children().removeClass( "ui-state-disabled" ); 7620 inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). 7621 prop( "disabled", false ); 7622 } 7623 this._disabledInputs = $.map( this._disabledInputs, 7624 function( value ) { return ( value === target ? null : value ); } ); // delete entry 7625 }, 7626 7627 /* Disable the date picker to a jQuery selection. 7628 * @param target element - the target input field or division or span 7629 */ 7630 _disableDatepicker: function( target ) { 7631 var nodeName, inline, 7632 $target = $( target ), 7633 inst = $.data( target, "datepicker" ); 7634 7635 if ( !$target.hasClass( this.markerClassName ) ) { 7636 return; 7637 } 7638 7639 nodeName = target.nodeName.toLowerCase(); 7640 if ( nodeName === "input" ) { 7641 target.disabled = true; 7642 inst.trigger.filter( "button" ). 7643 each( function() { this.disabled = true; } ).end(). 7644 filter( "img" ).css( { opacity: "0.5", cursor: "default" } ); 7645 } else if ( nodeName === "div" || nodeName === "span" ) { 7646 inline = $target.children( "." + this._inlineClass ); 7647 inline.children().addClass( "ui-state-disabled" ); 7648 inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). 7649 prop( "disabled", true ); 7650 } 7651 this._disabledInputs = $.map( this._disabledInputs, 7652 function( value ) { return ( value === target ? null : value ); } ); // delete entry 7653 this._disabledInputs[ this._disabledInputs.length ] = target; 7654 }, 7655 7656 /* Is the first field in a jQuery collection disabled as a datepicker? 7657 * @param target element - the target input field or division or span 7658 * @return boolean - true if disabled, false if enabled 7659 */ 7660 _isDisabledDatepicker: function( target ) { 7661 if ( !target ) { 7662 return false; 7663 } 7664 for ( var i = 0; i < this._disabledInputs.length; i++ ) { 7665 if ( this._disabledInputs[ i ] === target ) { 7666 return true; 7667 } 7668 } 7669 return false; 7670 }, 7671 7672 /* Retrieve the instance data for the target control. 7673 * @param target element - the target input field or division or span 7674 * @return object - the associated instance data 7675 * @throws error if a jQuery problem getting data 7676 */ 7677 _getInst: function( target ) { 7678 try { 7679 return $.data( target, "datepicker" ); 7680 } 7681 catch ( err ) { 7682 throw "Missing instance data for this datepicker"; 7683 } 7684 }, 7685 7686 /* Update or retrieve the settings for a date picker attached to an input field or division. 7687 * @param target element - the target input field or division or span 7688 * @param name object - the new settings to update or 7689 * string - the name of the setting to change or retrieve, 7690 * when retrieving also "all" for all instance settings or 7691 * "defaults" for all global defaults 7692 * @param value any - the new value for the setting 7693 * (omit if above is an object or to retrieve a value) 7694 */ 7695 _optionDatepicker: function( target, name, value ) { 7696 var settings, date, minDate, maxDate, 7697 inst = this._getInst( target ); 7698 7699 if ( arguments.length === 2 && typeof name === "string" ) { 7700 return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) : 7701 ( inst ? ( name === "all" ? $.extend( {}, inst.settings ) : 7702 this._get( inst, name ) ) : null ) ); 7703 } 7704 7705 settings = name || {}; 7706 if ( typeof name === "string" ) { 7707 settings = {}; 7708 settings[ name ] = value; 7709 } 7710 7711 if ( inst ) { 7712 if ( this._curInst === inst ) { 7713 this._hideDatepicker(); 7714 } 7715 7716 date = this._getDateDatepicker( target, true ); 7717 minDate = this._getMinMaxDate( inst, "min" ); 7718 maxDate = this._getMinMaxDate( inst, "max" ); 7719 datepicker_extendRemove( inst.settings, settings ); 7720 7721 // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided 7722 if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) { 7723 inst.settings.minDate = this._formatDate( inst, minDate ); 7724 } 7725 if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) { 7726 inst.settings.maxDate = this._formatDate( inst, maxDate ); 7727 } 7728 if ( "disabled" in settings ) { 7729 if ( settings.disabled ) { 7730 this._disableDatepicker( target ); 7731 } else { 7732 this._enableDatepicker( target ); 7733 } 7734 } 7735 this._attachments( $( target ), inst ); 7736 this._autoSize( inst ); 7737 this._setDate( inst, date ); 7738 this._updateAlternate( inst ); 7739 this._updateDatepicker( inst ); 7740 } 7741 }, 7742 7743 // Change method deprecated 7744 _changeDatepicker: function( target, name, value ) { 7745 this._optionDatepicker( target, name, value ); 7746 }, 7747 7748 /* Redraw the date picker attached to an input field or division. 7749 * @param target element - the target input field or division or span 7750 */ 7751 _refreshDatepicker: function( target ) { 7752 var inst = this._getInst( target ); 7753 if ( inst ) { 7754 this._updateDatepicker( inst ); 7755 } 7756 }, 7757 7758 /* Set the dates for a jQuery selection. 7759 * @param target element - the target input field or division or span 7760 * @param date Date - the new date 7761 */ 7762 _setDateDatepicker: function( target, date ) { 7763 var inst = this._getInst( target ); 7764 if ( inst ) { 7765 this._setDate( inst, date ); 7766 this._updateDatepicker( inst ); 7767 this._updateAlternate( inst ); 7768 } 7769 }, 7770 7771 /* Get the date(s) for the first entry in a jQuery selection. 7772 * @param target element - the target input field or division or span 7773 * @param noDefault boolean - true if no default date is to be used 7774 * @return Date - the current date 7775 */ 7776 _getDateDatepicker: function( target, noDefault ) { 7777 var inst = this._getInst( target ); 7778 if ( inst && !inst.inline ) { 7779 this._setDateFromField( inst, noDefault ); 7780 } 7781 return ( inst ? this._getDate( inst ) : null ); 7782 }, 7783 7784 /* Handle keystrokes. */ 7785 _doKeyDown: function( event ) { 7786 var onSelect, dateStr, sel, 7787 inst = $.datepicker._getInst( event.target ), 7788 handled = true, 7789 isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" ); 7790 7791 inst._keyEvent = true; 7792 if ( $.datepicker._datepickerShowing ) { 7793 switch ( event.keyCode ) { 7794 case 9: $.datepicker._hideDatepicker(); 7795 handled = false; 7796 break; // hide on tab out 7797 case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." + 7798 $.datepicker._currentClass + ")", inst.dpDiv ); 7799 if ( sel[ 0 ] ) { 7800 $.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] ); 7801 } 7802 7803 onSelect = $.datepicker._get( inst, "onSelect" ); 7804 if ( onSelect ) { 7805 dateStr = $.datepicker._formatDate( inst ); 7806 7807 // Trigger custom callback 7808 onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); 7809 } else { 7810 $.datepicker._hideDatepicker(); 7811 } 7812 7813 return false; // don't submit the form 7814 case 27: $.datepicker._hideDatepicker(); 7815 break; // hide on escape 7816 case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 7817 -$.datepicker._get( inst, "stepBigMonths" ) : 7818 -$.datepicker._get( inst, "stepMonths" ) ), "M" ); 7819 break; // previous month/year on page up/+ ctrl 7820 case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 7821 +$.datepicker._get( inst, "stepBigMonths" ) : 7822 +$.datepicker._get( inst, "stepMonths" ) ), "M" ); 7823 break; // next month/year on page down/+ ctrl 7824 case 35: if ( event.ctrlKey || event.metaKey ) { 7825 $.datepicker._clearDate( event.target ); 7826 } 7827 handled = event.ctrlKey || event.metaKey; 7828 break; // clear on ctrl or command +end 7829 case 36: if ( event.ctrlKey || event.metaKey ) { 7830 $.datepicker._gotoToday( event.target ); 7831 } 7832 handled = event.ctrlKey || event.metaKey; 7833 break; // current on ctrl or command +home 7834 case 37: if ( event.ctrlKey || event.metaKey ) { 7835 $.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" ); 7836 } 7837 handled = event.ctrlKey || event.metaKey; 7838 7839 // -1 day on ctrl or command +left 7840 if ( event.originalEvent.altKey ) { 7841 $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 7842 -$.datepicker._get( inst, "stepBigMonths" ) : 7843 -$.datepicker._get( inst, "stepMonths" ) ), "M" ); 7844 } 7845 7846 // next month/year on alt +left on Mac 7847 break; 7848 case 38: if ( event.ctrlKey || event.metaKey ) { 7849 $.datepicker._adjustDate( event.target, -7, "D" ); 7850 } 7851 handled = event.ctrlKey || event.metaKey; 7852 break; // -1 week on ctrl or command +up 7853 case 39: if ( event.ctrlKey || event.metaKey ) { 7854 $.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" ); 7855 } 7856 handled = event.ctrlKey || event.metaKey; 7857 7858 // +1 day on ctrl or command +right 7859 if ( event.originalEvent.altKey ) { 7860 $.datepicker._adjustDate( event.target, ( event.ctrlKey ? 7861 +$.datepicker._get( inst, "stepBigMonths" ) : 7862 +$.datepicker._get( inst, "stepMonths" ) ), "M" ); 7863 } 7864 7865 // next month/year on alt +right 7866 break; 7867 case 40: if ( event.ctrlKey || event.metaKey ) { 7868 $.datepicker._adjustDate( event.target, +7, "D" ); 7869 } 7870 handled = event.ctrlKey || event.metaKey; 7871 break; // +1 week on ctrl or command +down 7872 default: handled = false; 7873 } 7874 } else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home 7875 $.datepicker._showDatepicker( this ); 7876 } else { 7877 handled = false; 7878 } 7879 7880 if ( handled ) { 7881 event.preventDefault(); 7882 event.stopPropagation(); 7883 } 7884 }, 7885 7886 /* Filter entered characters - based on date format. */ 7887 _doKeyPress: function( event ) { 7888 var chars, chr, 7889 inst = $.datepicker._getInst( event.target ); 7890 7891 if ( $.datepicker._get( inst, "constrainInput" ) ) { 7892 chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) ); 7893 chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode ); 7894 return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 ); 7895 } 7896 }, 7897 7898 /* Synchronise manual entry and field/alternate field. */ 7899 _doKeyUp: function( event ) { 7900 var date, 7901 inst = $.datepicker._getInst( event.target ); 7902 7903 if ( inst.input.val() !== inst.lastVal ) { 7904 try { 7905 date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), 7906 ( inst.input ? inst.input.val() : null ), 7907 $.datepicker._getFormatConfig( inst ) ); 7908 7909 if ( date ) { // only if valid 7910 $.datepicker._setDateFromField( inst ); 7911 $.datepicker._updateAlternate( inst ); 7912 $.datepicker._updateDatepicker( inst ); 7913 } 7914 } 7915 catch ( err ) { 7916 } 7917 } 7918 return true; 7919 }, 7920 7921 /* Pop-up the date picker for a given input field. 7922 * If false returned from beforeShow event handler do not show. 7923 * @param input element - the input field attached to the date picker or
vendor: 1,885 bytes, lines 7924-7981
7924 * event - if triggered by focus 7925 */ 7926 _showDatepicker: function( input ) { 7927 input = input.target || input; 7928 if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger 7929 input = $( "input", input.parentNode )[ 0 ]; 7930 } 7931 7932 if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here 7933 return; 7934 } 7935 7936 var inst, beforeShow, beforeShowSettings, isFixed, 7937 offset, showAnim, duration; 7938 7939 inst = $.datepicker._getInst( input ); 7940 if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) { 7941 $.datepicker._curInst.dpDiv.stop( true, true ); 7942 if ( inst && $.datepicker._datepickerShowing ) { 7943 $.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] ); 7944 } 7945 } 7946 7947 beforeShow = $.datepicker._get( inst, "beforeShow" ); 7948 beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {}; 7949 if ( beforeShowSettings === false ) { 7950 return; 7951 } 7952 datepicker_extendRemove( inst.settings, beforeShowSettings ); 7953 7954 inst.lastVal = null; 7955 $.datepicker._lastInput = input; 7956 $.datepicker._setDateFromField( inst ); 7957 7958 if ( $.datepicker._inDialog ) { // hide cursor 7959 input.value = ""; 7960 } 7961 if ( !$.datepicker._pos ) { // position below input 7962 $.datepicker._pos = $.datepicker._findPos( input ); 7963 $.datepicker._pos[ 1 ] += input.offsetHeight; // add the height 7964 } 7965 7966 isFixed = false; 7967 $( input ).parents().each( function() { 7968 isFixed |= $( this ).css( "position" ) === "fixed"; 7969 return !isFixed; 7970 } ); 7971 7972 offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] }; 7973 $.datepicker._pos = null; 7974 7975 //to avoid flashes on Firefox 7976 inst.dpDiv.empty(); 7977 7978 // determine sizing offscreen 7979 inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } ); 7980 $.datepicker._updateDatepicker( inst ); 7981
vendor: 12,839 bytes, lines 7982-8335
7982 // fix width for dynamic number of date pickers 7983 // and adjust position before showing 7984 offset = $.datepicker._checkOffset( inst, offset, isFixed ); 7985 inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ? 7986 "static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none", 7987 left: offset.left + "px", top: offset.top + "px" } ); 7988 7989 if ( !inst.inline ) { 7990 showAnim = $.datepicker._get( inst, "showAnim" ); 7991 duration = $.datepicker._get( inst, "duration" ); 7992 inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); 7993 $.datepicker._datepickerShowing = true; 7994 7995 if ( $.effects && $.effects.effect[ showAnim ] ) { 7996 inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration ); 7997 } else { 7998 inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null ); 7999 } 8000 8001 if ( $.datepicker._shouldFocusInput( inst ) ) { 8002 inst.input.trigger( "focus" ); 8003 } 8004 8005 $.datepicker._curInst = inst; 8006 } 8007 }, 8008 8009 /* Generate the date picker content. */ 8010 _updateDatepicker: function( inst ) { 8011 this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) 8012 datepicker_instActive = inst; // for delegate hover events 8013 inst.dpDiv.empty().append( this._generateHTML( inst ) ); 8014 this._attachHandlers( inst ); 8015 8016 var origyearshtml, 8017 numMonths = this._getNumberOfMonths( inst ), 8018 cols = numMonths[ 1 ], 8019 width = 17, 8020 activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ); 8021 8022 if ( activeCell.length > 0 ) { 8023 datepicker_handleMouseover.apply( activeCell.get( 0 ) ); 8024 } 8025 8026 inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" ); 8027 if ( cols > 1 ) { 8028 inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" ); 8029 } 8030 inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) + 8031 "Class" ]( "ui-datepicker-multi" ); 8032 inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) + 8033 "Class" ]( "ui-datepicker-rtl" ); 8034 8035 if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { 8036 inst.input.trigger( "focus" ); 8037 } 8038 8039 // Deffered render of the years select (to avoid flashes on Firefox) 8040 if ( inst.yearshtml ) { 8041 origyearshtml = inst.yearshtml; 8042 setTimeout( function() { 8043 8044 //assure that inst.yearshtml didn't change. 8045 if ( origyearshtml === inst.yearshtml && inst.yearshtml ) { 8046 inst.dpDiv.find( "select.ui-datepicker-year:first" ).replaceWith( inst.yearshtml ); 8047 } 8048 origyearshtml = inst.yearshtml = null; 8049 }, 0 ); 8050 } 8051 }, 8052 8053 // #6694 - don't focus the input if it's already focused 8054 // this breaks the change event in IE 8055 // Support: IE and jQuery <1.9 8056 _shouldFocusInput: function( inst ) { 8057 return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); 8058 }, 8059 8060 /* Check positioning to remain on screen. */ 8061 _checkOffset: function( inst, offset, isFixed ) { 8062 var dpWidth = inst.dpDiv.outerWidth(), 8063 dpHeight = inst.dpDiv.outerHeight(), 8064 inputWidth = inst.input ? inst.input.outerWidth() : 0, 8065 inputHeight = inst.input ? inst.input.outerHeight() : 0, 8066 viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ), 8067 viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() ); 8068 8069 offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 ); 8070 offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0; 8071 offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0; 8072 8073 // Now check if datepicker is showing outside window viewport - move to a better place if so. 8074 offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ? 8075 Math.abs( offset.left + dpWidth - viewWidth ) : 0 ); 8076 offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ? 8077 Math.abs( dpHeight + inputHeight ) : 0 ); 8078 8079 return offset; 8080 }, 8081 8082 /* Find an object's position on the screen. */ 8083 _findPos: function( obj ) { 8084 var position, 8085 inst = this._getInst( obj ), 8086 isRTL = this._get( inst, "isRTL" ); 8087 8088 while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden( obj ) ) ) { 8089 obj = obj[ isRTL ? "previousSibling" : "nextSibling" ]; 8090 } 8091 8092 position = $( obj ).offset(); 8093 return [ position.left, position.top ]; 8094 }, 8095 8096 /* Hide the date picker from view. 8097 * @param input element - the input field attached to the date picker 8098 */ 8099 _hideDatepicker: function( input ) { 8100 var showAnim, duration, postProcess, onClose, 8101 inst = this._curInst; 8102 8103 if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) { 8104 return; 8105 } 8106 8107 if ( this._datepickerShowing ) { 8108 showAnim = this._get( inst, "showAnim" ); 8109 duration = this._get( inst, "duration" ); 8110 postProcess = function() { 8111 $.datepicker._tidyDialog( inst ); 8112 }; 8113 8114 // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed 8115 if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { 8116 inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess ); 8117 } else { 8118 inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" : 8119 ( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess ); 8120 } 8121 8122 if ( !showAnim ) { 8123 postProcess(); 8124 } 8125 this._datepickerShowing = false; 8126 8127 onClose = this._get( inst, "onClose" ); 8128 if ( onClose ) { 8129 onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] ); 8130 } 8131 8132 this._lastInput = null; 8133 if ( this._inDialog ) { 8134 this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } ); 8135 if ( $.blockUI ) { 8136 $.unblockUI(); 8137 $( "body" ).append( this.dpDiv ); 8138 } 8139 } 8140 this._inDialog = false; 8141 } 8142 }, 8143 8144 /* Tidy up after a dialog display. */ 8145 _tidyDialog: function( inst ) { 8146 inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" ); 8147 }, 8148 8149 /* Close date picker if clicked elsewhere. */ 8150 _checkExternalClick: function( event ) { 8151 if ( !$.datepicker._curInst ) { 8152 return; 8153 } 8154 8155 var $target = $( event.target ), 8156 inst = $.datepicker._getInst( $target[ 0 ] ); 8157 8158 if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId && 8159 $target.parents( "#" + $.datepicker._mainDivId ).length === 0 && 8160 !$target.hasClass( $.datepicker.markerClassName ) && 8161 !$target.closest( "." + $.datepicker._triggerClass ).length && 8162 $.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) || 8163 ( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) { 8164 $.datepicker._hideDatepicker(); 8165 } 8166 }, 8167 8168 /* Adjust one of the date sub-fields. */ 8169 _adjustDate: function( id, offset, period ) { 8170 var target = $( id ), 8171 inst = this._getInst( target[ 0 ] ); 8172 8173 if ( this._isDisabledDatepicker( target[ 0 ] ) ) { 8174 return; 8175 } 8176 this._adjustInstDate( inst, offset + 8177 ( period === "M" ? this._get( inst, "showCurrentAtPos" ) : 0 ), // undo positioning 8178 period ); 8179 this._updateDatepicker( inst ); 8180 }, 8181 8182 /* Action for current link. */ 8183 _gotoToday: function( id ) { 8184 var date, 8185 target = $( id ), 8186 inst = this._getInst( target[ 0 ] ); 8187 8188 if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) { 8189 inst.selectedDay = inst.currentDay; 8190 inst.drawMonth = inst.selectedMonth = inst.currentMonth; 8191 inst.drawYear = inst.selectedYear = inst.currentYear; 8192 } else { 8193 date = new Date(); 8194 inst.selectedDay = date.getDate(); 8195 inst.drawMonth = inst.selectedMonth = date.getMonth(); 8196 inst.drawYear = inst.selectedYear = date.getFullYear(); 8197 } 8198 this._notifyChange( inst ); 8199 this._adjustDate( target ); 8200 }, 8201 8202 /* Action for selecting a new month/year. */ 8203 _selectMonthYear: function( id, select, period ) { 8204 var target = $( id ), 8205 inst = this._getInst( target[ 0 ] ); 8206 8207 inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] = 8208 inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] = 8209 parseInt( select.options[ select.selectedIndex ].value, 10 ); 8210 8211 this._notifyChange( inst ); 8212 this._adjustDate( target ); 8213 }, 8214 8215 /* Action for selecting a day. */ 8216 _selectDay: function( id, month, year, td ) { 8217 var inst, 8218 target = $( id ); 8219 8220 if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) { 8221 return; 8222 } 8223 8224 inst = this._getInst( target[ 0 ] ); 8225 inst.selectedDay = inst.currentDay = $( "a", td ).html(); 8226 inst.selectedMonth = inst.currentMonth = month; 8227 inst.selectedYear = inst.currentYear = year; 8228 this._selectDate( id, this._formatDate( inst, 8229 inst.currentDay, inst.currentMonth, inst.currentYear ) ); 8230 }, 8231 8232 /* Erase the input field and hide the date picker. */ 8233 _clearDate: function( id ) { 8234 var target = $( id ); 8235 this._selectDate( target, "" ); 8236 }, 8237 8238 /* Update the input field with the selected date. */ 8239 _selectDate: function( id, dateStr ) { 8240 var onSelect, 8241 target = $( id ), 8242 inst = this._getInst( target[ 0 ] ); 8243 8244 dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) ); 8245 if ( inst.input ) { 8246 inst.input.val( dateStr ); 8247 } 8248 this._updateAlternate( inst ); 8249 8250 onSelect = this._get( inst, "onSelect" ); 8251 if ( onSelect ) { 8252 onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback 8253 } else if ( inst.input ) { 8254 inst.input.trigger( "change" ); // fire the change event 8255 8256 } 8257 8258 if ( inst.inline ) { 8259 this._updateDatepicker( inst ); 8260 } else { 8261 this._hideDatepicker(); 8262 this._lastInput = inst.input[ 0 ]; 8263 if ( typeof( inst.input[ 0 ] ) !== "object" ) { 8264 inst.input.trigger( "focus" ); // restore focus 8265 } 8266 this._lastInput = null; 8267 } 8268 }, 8269 8270 /* Update any alternate field to synchronise with the main field. */ 8271 _updateAlternate: function( inst ) { 8272 var altFormat, date, dateStr, 8273 altField = this._get( inst, "altField" ); 8274 8275 if ( altField ) { // update alternate field too 8276 altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" ); 8277 date = this._getDate( inst ); 8278 dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); 8279 $( altField ).val( dateStr ); 8280 } 8281 }, 8282 8283 /* Set as beforeShowDay function to prevent selection of weekends. 8284 * @param date Date - the date to customise 8285 * @return [boolean, string] - is this date selectable?, what is its CSS class? 8286 */ 8287 noWeekends: function( date ) { 8288 var day = date.getDay(); 8289 return [ ( day > 0 && day < 6 ), "" ]; 8290 }, 8291 8292 /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. 8293 * @param date Date - the date to get the week for 8294 * @return number - the number of the week within the year that contains this date 8295 */ 8296 iso8601Week: function( date ) { 8297 var time, 8298 checkDate = new Date( date.getTime() ); 8299 8300 // Find Thursday of this week starting on Monday 8301 checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) ); 8302 8303 time = checkDate.getTime(); 8304 checkDate.setMonth( 0 ); // Compare with Jan 1 8305 checkDate.setDate( 1 ); 8306 return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1; 8307 }, 8308 8309 /* Parse a string value into a date object. 8310 * See formatDate below for the possible formats. 8311 * 8312 * @param format string - the expected format of the date 8313 * @param value string - the date in the above format 8314 * @param settings Object - attributes include: 8315 * shortYearCutoff number - the cutoff year for determining the century (optional) 8316 * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) 8317 * dayNames string[7] - names of the days from Sunday (optional) 8318 * monthNamesShort string[12] - abbreviated names of the months (optional) 8319 * monthNames string[12] - names of the months (optional) 8320 * @return Date - the extracted date value or null if value is blank 8321 */ 8322 parseDate: function( format, value, settings ) { 8323 if ( format == null || value == null ) { 8324 throw "Invalid arguments"; 8325 } 8326 8327 value = ( typeof value === "object" ? value.toString() : value + "" ); 8328 if ( value === "" ) { 8329 return null; 8330 } 8331 8332 var iFormat, dim, extra, 8333 iValue = 0, 8334 shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff, 8335 shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp
vendor: 15,177 bytes, lines 8335-8811
8335: 8336 new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ), 8337 dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, 8338 dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, 8339 monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, 8340 monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, 8341 year = -1, 8342 month = -1, 8343 day = -1, 8344 doy = -1, 8345 literal = false, 8346 date, 8347 8348 // Check whether a format character is doubled 8349 lookAhead = function( match ) { 8350 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 8351 if ( matches ) { 8352 iFormat++; 8353 } 8354 return matches; 8355 }, 8356 8357 // Extract a number from the string value 8358 getNumber = function( match ) { 8359 var isDoubled = lookAhead( match ), 8360 size = ( match === "@" ? 14 : ( match === "!" ? 20 : 8361 ( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ), 8362 minSize = ( match === "y" ? size : 1 ), 8363 digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ), 8364 num = value.substring( iValue ).match( digits ); 8365 if ( !num ) { 8366 throw "Missing number at position " + iValue; 8367 } 8368 iValue += num[ 0 ].length; 8369 return parseInt( num[ 0 ], 10 ); 8370 }, 8371 8372 // Extract a name from the string value and convert to an index 8373 getName = function( match, shortNames, longNames ) { 8374 var index = -1, 8375 names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) { 8376 return [ [ k, v ] ]; 8377 } ).sort( function( a, b ) { 8378 return -( a[ 1 ].length - b[ 1 ].length ); 8379 } ); 8380 8381 $.each( names, function( i, pair ) { 8382 var name = pair[ 1 ]; 8383 if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) { 8384 index = pair[ 0 ]; 8385 iValue += name.length; 8386 return false; 8387 } 8388 } ); 8389 if ( index !== -1 ) { 8390 return index + 1; 8391 } else { 8392 throw "Unknown name at position " + iValue; 8393 } 8394 }, 8395 8396 // Confirm that a literal character matches the string value 8397 checkLiteral = function() { 8398 if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) { 8399 throw "Unexpected literal at position " + iValue; 8400 } 8401 iValue++; 8402 }; 8403 8404 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 8405 if ( literal ) { 8406 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 8407 literal = false; 8408 } else { 8409 checkLiteral(); 8410 } 8411 } else { 8412 switch ( format.charAt( iFormat ) ) { 8413 case "d": 8414 day = getNumber( "d" ); 8415 break; 8416 case "D": 8417 getName( "D", dayNamesShort, dayNames ); 8418 break; 8419 case "o": 8420 doy = getNumber( "o" ); 8421 break; 8422 case "m": 8423 month = getNumber( "m" ); 8424 break; 8425 case "M": 8426 month = getName( "M", monthNamesShort, monthNames ); 8427 break; 8428 case "y": 8429 year = getNumber( "y" ); 8430 break; 8431 case "@": 8432 date = new Date( getNumber( "@" ) ); 8433 year = date.getFullYear(); 8434 month = date.getMonth() + 1; 8435 day = date.getDate(); 8436 break; 8437 case "!": 8438 date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 ); 8439 year = date.getFullYear(); 8440 month = date.getMonth() + 1; 8441 day = date.getDate(); 8442 break; 8443 case "'": 8444 if ( lookAhead( "'" ) ) { 8445 checkLiteral(); 8446 } else { 8447 literal = true; 8448 } 8449 break; 8450 default: 8451 checkLiteral(); 8452 } 8453 } 8454 } 8455 8456 if ( iValue < value.length ) { 8457 extra = value.substr( iValue ); 8458 if ( !/^\s+/.test( extra ) ) { 8459 throw "Extra/unparsed characters found in date: " + extra; 8460 } 8461 } 8462 8463 if ( year === -1 ) { 8464 year = new Date().getFullYear(); 8465 } else if ( year < 100 ) { 8466 year += new Date().getFullYear() - new Date().getFullYear() % 100 + 8467 ( year <= shortYearCutoff ? 0 : -100 ); 8468 } 8469 8470 if ( doy > -1 ) { 8471 month = 1; 8472 day = doy; 8473 do { 8474 dim = this._getDaysInMonth( year, month - 1 ); 8475 if ( day <= dim ) { 8476 break; 8477 } 8478 month++; 8479 day -= dim; 8480 } while ( true ); 8481 } 8482 8483 date = this._daylightSavingAdjust( new Date( year, month - 1, day ) ); 8484 if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) { 8485 throw "Invalid date"; // E.g. 31/02/00 8486 } 8487 return date; 8488 }, 8489 8490 /* Standard date formats. */ 8491 ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) 8492 COOKIE: "D, dd M yy", 8493 ISO_8601: "yy-mm-dd", 8494 RFC_822: "D, d M y", 8495 RFC_850: "DD, dd-M-y", 8496 RFC_1036: "D, d M y", 8497 RFC_1123: "D, d M yy", 8498 RFC_2822: "D, d M yy", 8499 RSS: "D, d M y", // RFC 822 8500 TICKS: "!", 8501 TIMESTAMP: "@", 8502 W3C: "yy-mm-dd", // ISO 8601 8503 8504 _ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) + 8505 Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ), 8506 8507 /* Format a date object into a string value. 8508 * The format can be combinations of the following: 8509 * d - day of month (no leading zero) 8510 * dd - day of month (two digit) 8511 * o - day of year (no leading zeros) 8512 * oo - day of year (three digit) 8513 * D - day name short 8514 * DD - day name long 8515 * m - month of year (no leading zero) 8516 * mm - month of year (two digit) 8517 * M - month name short 8518 * MM - month name long 8519 * y - year (two digit) 8520 * yy - year (four digit) 8521 * @ - Unix timestamp (ms since 01/01/1970) 8522 * ! - Windows ticks (100ns since 01/01/0001) 8523 * "..." - literal text 8524 * '' - single quote 8525 * 8526 * @param format string - the desired format of the date 8527 * @param date Date - the date value to format 8528 * @param settings Object - attributes include: 8529 * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) 8530 * dayNames string[7] - names of the days from Sunday (optional) 8531 * monthNamesShort string[12] - abbreviated names of the months (optional) 8532 * monthNames string[12] - names of the months (optional) 8533 * @return string - the date in the above format 8534 */ 8535 formatDate: function( format, date, settings ) { 8536 if ( !date ) { 8537 return ""; 8538 } 8539 8540 var iFormat, 8541 dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, 8542 dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, 8543 monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, 8544 monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, 8545 8546 // Check whether a format character is doubled 8547 lookAhead = function( match ) { 8548 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 8549 if ( matches ) { 8550 iFormat++; 8551 } 8552 return matches; 8553 }, 8554 8555 // Format a number, with leading zero if necessary 8556 formatNumber = function( match, value, len ) { 8557 var num = "" + value; 8558 if ( lookAhead( match ) ) { 8559 while ( num.length < len ) { 8560 num = "0" + num; 8561 } 8562 } 8563 return num; 8564 }, 8565 8566 // Format a name, short or long as requested 8567 formatName = function( match, value, shortNames, longNames ) { 8568 return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] ); 8569 }, 8570 output = "", 8571 literal = false; 8572 8573 if ( date ) { 8574 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 8575 if ( literal ) { 8576 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 8577 literal = false; 8578 } else { 8579 output += format.charAt( iFormat ); 8580 } 8581 } else { 8582 switch ( format.charAt( iFormat ) ) { 8583 case "d": 8584 output += formatNumber( "d", date.getDate(), 2 ); 8585 break; 8586 case "D": 8587 output += formatName( "D", date.getDay(), dayNamesShort, dayNames ); 8588 break; 8589 case "o": 8590 output += formatNumber( "o", 8591 Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 ); 8592 break; 8593 case "m": 8594 output += formatNumber( "m", date.getMonth() + 1, 2 ); 8595 break; 8596 case "M": 8597 output += formatName( "M", date.getMonth(), monthNamesShort, monthNames ); 8598 break; 8599 case "y": 8600 output += ( lookAhead( "y" ) ? date.getFullYear() : 8601 ( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 ); 8602 break; 8603 case "@": 8604 output += date.getTime(); 8605 break; 8606 case "!": 8607 output += date.getTime() * 10000 + this._ticksTo1970; 8608 break; 8609 case "'": 8610 if ( lookAhead( "'" ) ) { 8611 output += "'"; 8612 } else { 8613 literal = true; 8614 } 8615 break; 8616 default: 8617 output += format.charAt( iFormat ); 8618 } 8619 } 8620 } 8621 } 8622 return output; 8623 }, 8624 8625 /* Extract all possible characters from the date format. */ 8626 _possibleChars: function( format ) { 8627 var iFormat, 8628 chars = "", 8629 literal = false, 8630 8631 // Check whether a format character is doubled 8632 lookAhead = function( match ) { 8633 var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); 8634 if ( matches ) { 8635 iFormat++; 8636 } 8637 return matches; 8638 }; 8639 8640 for ( iFormat = 0; iFormat < format.length; iFormat++ ) { 8641 if ( literal ) { 8642 if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { 8643 literal = false; 8644 } else { 8645 chars += format.charAt( iFormat ); 8646 } 8647 } else { 8648 switch ( format.charAt( iFormat ) ) { 8649 case "d": case "m": case "y": case "@": 8650 chars += "0123456789"; 8651 break; 8652 case "D": case "M": 8653 return null; // Accept anything 8654 case "'": 8655 if ( lookAhead( "'" ) ) { 8656 chars += "'"; 8657 } else { 8658 literal = true; 8659 } 8660 break; 8661 default: 8662 chars += format.charAt( iFormat ); 8663 } 8664 } 8665 } 8666 return chars; 8667 }, 8668 8669 /* Get a setting value, defaulting if necessary. */ 8670 _get: function( inst, name ) { 8671 return inst.settings[ name ] !== undefined ? 8672 inst.settings[ name ] : this._defaults[ name ]; 8673 }, 8674 8675 /* Parse existing date and initialise date picker. */ 8676 _setDateFromField: function( inst, noDefault ) { 8677 if ( inst.input.val() === inst.lastVal ) { 8678 return; 8679 } 8680 8681 var dateFormat = this._get( inst, "dateFormat" ), 8682 dates = inst.lastVal = inst.input ? inst.input.val() : null, 8683 defaultDate = this._getDefaultDate( inst ), 8684 date = defaultDate, 8685 settings = this._getFormatConfig( inst ); 8686 8687 try { 8688 date = this.parseDate( dateFormat, dates, settings ) || defaultDate; 8689 } catch ( event ) { 8690 dates = ( noDefault ? "" : dates ); 8691 } 8692 inst.selectedDay = date.getDate(); 8693 inst.drawMonth = inst.selectedMonth = date.getMonth(); 8694 inst.drawYear = inst.selectedYear = date.getFullYear(); 8695 inst.currentDay = ( dates ? date.getDate() : 0 ); 8696 inst.currentMonth = ( dates ? date.getMonth() : 0 ); 8697 inst.currentYear = ( dates ? date.getFullYear() : 0 ); 8698 this._adjustInstDate( inst ); 8699 }, 8700 8701 /* Retrieve the default date shown on opening. */ 8702 _getDefaultDate: function( inst ) { 8703 return this._restrictMinMax( inst, 8704 this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) ); 8705 }, 8706 8707 /* A date may be specified as an exact value or a relative one. */ 8708 _determineDate: function( inst, date, defaultDate ) { 8709 var offsetNumeric = function( offset ) { 8710 var date = new Date(); 8711 date.setDate( date.getDate() + offset ); 8712 return date; 8713 }, 8714 offsetString = function( offset ) { 8715 try { 8716 return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), 8717 offset, $.datepicker._getFormatConfig( inst ) ); 8718 } 8719 catch ( e ) { 8720 8721 // Ignore 8722 } 8723 8724 var date = ( offset.toLowerCase().match( /^c/ ) ? 8725 $.datepicker._getDate( inst ) : null ) || new Date(), 8726 year = date.getFullYear(), 8727 month = date.getMonth(), 8728 day = date.getDate(), 8729 pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, 8730 matches = pattern.exec( offset ); 8731 8732 while ( matches ) { 8733 switch ( matches[ 2 ] || "d" ) { 8734 case "d" : case "D" : 8735 day += parseInt( matches[ 1 ], 10 ); break; 8736 case "w" : case "W" : 8737 day += parseInt( matches[ 1 ], 10 ) * 7; break; 8738 case "m" : case "M" : 8739 month += parseInt( matches[ 1 ], 10 ); 8740 day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); 8741 break; 8742 case "y": case "Y" : 8743 year += parseInt( matches[ 1 ], 10 ); 8744 day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); 8745 break; 8746 } 8747 matches = pattern.exec( offset ); 8748 } 8749 return new Date( year, month, day ); 8750 }, 8751 newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) : 8752 ( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) ); 8753 8754 newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate ); 8755 if ( newDate ) { 8756 newDate.setHours( 0 ); 8757 newDate.setMinutes( 0 ); 8758 newDate.setSeconds( 0 ); 8759 newDate.setMilliseconds( 0 ); 8760 } 8761 return this._daylightSavingAdjust( newDate ); 8762 }, 8763 8764 /* Handle switch to/from daylight saving. 8765 * Hours may be non-zero on daylight saving cut-over: 8766 * > 12 when midnight changeover, but then cannot generate 8767 * midnight datetime, so jump to 1AM, otherwise reset. 8768 * @param date (Date) the date to check 8769 * @return (Date) the corrected date 8770 */ 8771 _daylightSavingAdjust: function( date ) { 8772 if ( !date ) { 8773 return null; 8774 } 8775 date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 ); 8776 return date; 8777 }, 8778 8779 /* Set the date(s) directly. */ 8780 _setDate: function( inst, date, noChange ) { 8781 var clear = !date, 8782 origMonth = inst.selectedMonth, 8783 origYear = inst.selectedYear, 8784 newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) ); 8785 8786 inst.selectedDay = inst.currentDay = newDate.getDate(); 8787 inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); 8788 inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); 8789 if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) { 8790 this._notifyChange( inst ); 8791 } 8792 this._adjustInstDate( inst ); 8793 if ( inst.input ) { 8794 inst.input.val( clear ? "" : this._formatDate( inst ) ); 8795 } 8796 }, 8797 8798 /* Retrieve the date(s) directly. */ 8799 _getDate: function( inst ) { 8800 var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null : 8801 this._daylightSavingAdjust( new Date( 8802 inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); 8803 return startDate; 8804 }, 8805 8806 /* Attach the onxxx handlers. These are declared statically so 8807 * they work with static code transformers like Caja. 8808 */ 8809 _attachHandlers: function( inst ) { 8810 var stepMonths = this._get( inst, "stepMonths" ), 8811 id = "#" + inst.id.replace( /\\\\/g, "\\" );
vendor: 42,089 bytes, lines 8812-9997
8812 inst.dpDiv.find( "[data-handler]" ).map( function() { 8813 var handler = { 8814 prev: function() { 8815 $.datepicker._adjustDate( id, -stepMonths, "M" ); 8816 }, 8817 next: function() { 8818 $.datepicker._adjustDate( id, +stepMonths, "M" ); 8819 }, 8820 hide: function() { 8821 $.datepicker._hideDatepicker(); 8822 }, 8823 today: function() { 8824 $.datepicker._gotoToday( id ); 8825 }, 8826 selectDay: function() { 8827 $.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this ); 8828 return false; 8829 }, 8830 selectMonth: function() { 8831 $.datepicker._selectMonthYear( id, this, "M" ); 8832 return false; 8833 }, 8834 selectYear: function() { 8835 $.datepicker._selectMonthYear( id, this, "Y" ); 8836 return false; 8837 } 8838 }; 8839 $( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] ); 8840 } ); 8841 }, 8842 8843 /* Generate the HTML for the current state of the date picker. */ 8844 _generateHTML: function( inst ) { 8845 var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, 8846 controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, 8847 monthNames, monthNamesShort, beforeShowDay, showOtherMonths, 8848 selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, 8849 cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, 8850 printDate, dRow, tbody, daySettings, otherMonth, unselectable, 8851 tempDate = new Date(), 8852 today = this._daylightSavingAdjust( 8853 new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time 8854 isRTL = this._get( inst, "isRTL" ), 8855 showButtonPanel = this._get( inst, "showButtonPanel" ), 8856 hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ), 8857 navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ), 8858 numMonths = this._getNumberOfMonths( inst ), 8859 showCurrentAtPos = this._get( inst, "showCurrentAtPos" ), 8860 stepMonths = this._get( inst, "stepMonths" ), 8861 isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ), 8862 currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) : 8863 new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ), 8864 minDate = this._getMinMaxDate( inst, "min" ), 8865 maxDate = this._getMinMaxDate( inst, "max" ), 8866 drawMonth = inst.drawMonth - showCurrentAtPos, 8867 drawYear = inst.drawYear; 8868 8869 if ( drawMonth < 0 ) { 8870 drawMonth += 12; 8871 drawYear--; 8872 } 8873 if ( maxDate ) { 8874 maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(), 8875 maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) ); 8876 maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw ); 8877 while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) { 8878 drawMonth--; 8879 if ( drawMonth < 0 ) { 8880 drawMonth = 11; 8881 drawYear--; 8882 } 8883 } 8884 } 8885 inst.drawMonth = drawMonth; 8886 inst.drawYear = drawYear; 8887 8888 prevText = this._get( inst, "prevText" ); 8889 prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText, 8890 this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ), 8891 this._getFormatConfig( inst ) ) ); 8892 8893 prev = ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ? 8894 "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + 8895 " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" : 8896 ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) + "'>" + prevText + "</span></a>" ) ); 8897 8898 nextText = this._get( inst, "nextText" ); 8899 nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText, 8900 this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ), 8901 this._getFormatConfig( inst ) ) ); 8902 8903 next = ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ? 8904 "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + 8905 " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" : 8906 ( hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) + "'>" + nextText + "</span></a>" ) ); 8907 8908 currentText = this._get( inst, "currentText" ); 8909 gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today ); 8910 currentText = ( !navigationAsDateFormat ? currentText : 8911 this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) ); 8912 8913 controls = ( !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + 8914 this._get( inst, "closeText" ) + "</button>" : "" ); 8915 8916 buttonPanel = ( showButtonPanel ) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + ( isRTL ? controls : "" ) + 8917 ( this._isInRange( inst, gotoDate ) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + 8918 ">" + currentText + "</button>" : "" ) + ( isRTL ? "" : controls ) + "</div>" : ""; 8919 8920 firstDay = parseInt( this._get( inst, "firstDay" ), 10 ); 8921 firstDay = ( isNaN( firstDay ) ? 0 : firstDay ); 8922 8923 showWeek = this._get( inst, "showWeek" ); 8924 dayNames = this._get( inst, "dayNames" ); 8925 dayNamesMin = this._get( inst, "dayNamesMin" ); 8926 monthNames = this._get( inst, "monthNames" ); 8927 monthNamesShort = this._get( inst, "monthNamesShort" ); 8928 beforeShowDay = this._get( inst, "beforeShowDay" ); 8929 showOtherMonths = this._get( inst, "showOtherMonths" ); 8930 selectOtherMonths = this._get( inst, "selectOtherMonths" ); 8931 defaultDate = this._getDefaultDate( inst ); 8932 html = ""; 8933 8934 for ( row = 0; row < numMonths[ 0 ]; row++ ) { 8935 group = ""; 8936 this.maxRows = 4; 8937 for ( col = 0; col < numMonths[ 1 ]; col++ ) { 8938 selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) ); 8939 cornerClass = " ui-corner-all"; 8940 calender = ""; 8941 if ( isMultiMonth ) { 8942 calender += "<div class='ui-datepicker-group"; 8943 if ( numMonths[ 1 ] > 1 ) { 8944 switch ( col ) { 8945 case 0: calender += " ui-datepicker-group-first"; 8946 cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break; 8947 case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last"; 8948 cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break; 8949 default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break; 8950 } 8951 } 8952 calender += "'>"; 8953 } 8954 calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + 8955 ( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) + 8956 ( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) + 8957 this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate, 8958 row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers 8959 "</div><table class='ui-datepicker-calendar'><thead>" + 8960 "<tr>"; 8961 thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" ); 8962 for ( dow = 0; dow < 7; dow++ ) { // days of the week 8963 day = ( dow + firstDay ) % 7; 8964 thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" + 8965 "<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>"; 8966 } 8967 calender += thead + "</tr></thead><tbody>"; 8968 daysInMonth = this._getDaysInMonth( drawYear, drawMonth ); 8969 if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) { 8970 inst.selectedDay = Math.min( inst.selectedDay, daysInMonth ); 8971 } 8972 leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7; 8973 curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate 8974 numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043) 8975 this.maxRows = numRows; 8976 printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) ); 8977 for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows 8978 calender += "<tr>"; 8979 tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" + 8980 this._get( inst, "calculateWeek" )( printDate ) + "</td>" ); 8981 for ( dow = 0; dow < 7; dow++ ) { // create date picker days 8982 daySettings = ( beforeShowDay ? 8983 beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] ); 8984 otherMonth = ( printDate.getMonth() !== drawMonth ); 8985 unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] || 8986 ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate ); 8987 tbody += "<td class='" + 8988 ( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends 8989 ( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months 8990 ( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key 8991 ( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ? 8992 8993 // or defaultDate is current printedDate and defaultDate is selectedDate 8994 " " + this._dayOverClass : "" ) + // highlight selected day 8995 ( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) + // highlight unselectable days 8996 ( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates 8997 ( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day 8998 ( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different) 8999 ( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "'" ) + "'" : "" ) + // cell title 9000 ( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions 9001 ( otherMonth && !showOtherMonths ? " " : // display for other months 9002 ( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + 9003 ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) + 9004 ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day 9005 ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months 9006 "' href='#'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date 9007 printDate.setDate( printDate.getDate() + 1 ); 9008 printDate = this._daylightSavingAdjust( printDate ); 9009 } 9010 calender += tbody + "</tr>"; 9011 } 9012 drawMonth++; 9013 if ( drawMonth > 11 ) { 9014 drawMonth = 0; 9015 drawYear++; 9016 } 9017 calender += "</tbody></table>" + ( isMultiMonth ? "</div>" + 9018 ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" ); 9019 group += calender; 9020 } 9021 html += group; 9022 } 9023 html += buttonPanel; 9024 inst._keyEvent = false; 9025 return html; 9026 }, 9027 9028 /* Generate the month and year header. */ 9029 _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate, 9030 secondary, monthNames, monthNamesShort ) { 9031 9032 var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, 9033 changeMonth = this._get( inst, "changeMonth" ), 9034 changeYear = this._get( inst, "changeYear" ), 9035 showMonthAfterYear = this._get( inst, "showMonthAfterYear" ), 9036 html = "<div class='ui-datepicker-title'>", 9037 monthHtml = ""; 9038 9039 // Month selection 9040 if ( secondary || !changeMonth ) { 9041 monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>"; 9042 } else { 9043 inMinYear = ( minDate && minDate.getFullYear() === drawYear ); 9044 inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear ); 9045 monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>"; 9046 for ( month = 0; month < 12; month++ ) { 9047 if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) { 9048 monthHtml += "<option value='" + month + "'" + 9049 ( month === drawMonth ? " selected='selected'" : "" ) + 9050 ">" + monthNamesShort[ month ] + "</option>"; 9051 } 9052 } 9053 monthHtml += "</select>"; 9054 } 9055 9056 if ( !showMonthAfterYear ) { 9057 html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? " " : "" ); 9058 } 9059 9060 // Year selection 9061 if ( !inst.yearshtml ) { 9062 inst.yearshtml = ""; 9063 if ( secondary || !changeYear ) { 9064 html += "<span class='ui-datepicker-year'>" + drawYear + "</span>"; 9065 } else { 9066 9067 // determine range of years to display 9068 years = this._get( inst, "yearRange" ).split( ":" ); 9069 thisYear = new Date().getFullYear(); 9070 determineYear = function( value ) { 9071 var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) : 9072 ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) : 9073 parseInt( value, 10 ) ) ); 9074 return ( isNaN( year ) ? thisYear : year ); 9075 }; 9076 year = determineYear( years[ 0 ] ); 9077 endYear = Math.max( year, determineYear( years[ 1 ] || "" ) ); 9078 year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year ); 9079 endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear ); 9080 inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; 9081 for ( ; year <= endYear; year++ ) { 9082 inst.yearshtml += "<option value='" + year + "'" + 9083 ( year === drawYear ? " selected='selected'" : "" ) + 9084 ">" + year + "</option>"; 9085 } 9086 inst.yearshtml += "</select>"; 9087 9088 html += inst.yearshtml; 9089 inst.yearshtml = null; 9090 } 9091 } 9092 9093 html += this._get( inst, "yearSuffix" ); 9094 if ( showMonthAfterYear ) { 9095 html += ( secondary || !( changeMonth && changeYear ) ? " " : "" ) + monthHtml; 9096 } 9097 html += "</div>"; // Close datepicker_header 9098 return html; 9099 }, 9100 9101 /* Adjust one of the date sub-fields. */ 9102 _adjustInstDate: function( inst, offset, period ) { 9103 var year = inst.selectedYear + ( period === "Y" ? offset : 0 ), 9104 month = inst.selectedMonth + ( period === "M" ? offset : 0 ), 9105 day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ), 9106 date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) ); 9107 9108 inst.selectedDay = date.getDate(); 9109 inst.drawMonth = inst.selectedMonth = date.getMonth(); 9110 inst.drawYear = inst.selectedYear = date.getFullYear(); 9111 if ( period === "M" || period === "Y" ) { 9112 this._notifyChange( inst ); 9113 } 9114 }, 9115 9116 /* Ensure a date is within any min/max bounds. */ 9117 _restrictMinMax: function( inst, date ) { 9118 var minDate = this._getMinMaxDate( inst, "min" ), 9119 maxDate = this._getMinMaxDate( inst, "max" ), 9120 newDate = ( minDate && date < minDate ? minDate : date ); 9121 return ( maxDate && newDate > maxDate ? maxDate : newDate ); 9122 }, 9123 9124 /* Notify change of month/year. */ 9125 _notifyChange: function( inst ) { 9126 var onChange = this._get( inst, "onChangeMonthYear" ); 9127 if ( onChange ) { 9128 onChange.apply( ( inst.input ? inst.input[ 0 ] : null ), 9129 [ inst.selectedYear, inst.selectedMonth + 1, inst ] ); 9130 } 9131 }, 9132 9133 /* Determine the number of months to show. */ 9134 _getNumberOfMonths: function( inst ) { 9135 var numMonths = this._get( inst, "numberOfMonths" ); 9136 return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) ); 9137 }, 9138 9139 /* Determine the current maximum date - ensure no time components are set. */ 9140 _getMinMaxDate: function( inst, minMax ) { 9141 return this._determineDate( inst, this._get( inst, minMax + "Date" ), null ); 9142 }, 9143 9144 /* Find the number of days in a given month. */ 9145 _getDaysInMonth: function( year, month ) { 9146 return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate(); 9147 }, 9148 9149 /* Find the day of the week of the first of a month. */ 9150 _getFirstDayOfMonth: function( year, month ) { 9151 return new Date( year, month, 1 ).getDay(); 9152 }, 9153 9154 /* Determines if we should allow a "next/prev" month display change. */ 9155 _canAdjustMonth: function( inst, offset, curYear, curMonth ) { 9156 var numMonths = this._getNumberOfMonths( inst ), 9157 date = this._daylightSavingAdjust( new Date( curYear, 9158 curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) ); 9159 9160 if ( offset < 0 ) { 9161 date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) ); 9162 } 9163 return this._isInRange( inst, date ); 9164 }, 9165 9166 /* Is the given date in the accepted range? */ 9167 _isInRange: function( inst, date ) { 9168 var yearSplit, currentYear, 9169 minDate = this._getMinMaxDate( inst, "min" ), 9170 maxDate = this._getMinMaxDate( inst, "max" ), 9171 minYear = null, 9172 maxYear = null, 9173 years = this._get( inst, "yearRange" ); 9174 if ( years ) { 9175 yearSplit = years.split( ":" ); 9176 currentYear = new Date().getFullYear(); 9177 minYear = parseInt( yearSplit[ 0 ], 10 ); 9178 maxYear = parseInt( yearSplit[ 1 ], 10 ); 9179 if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) { 9180 minYear += currentYear; 9181 } 9182 if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) { 9183 maxYear += currentYear; 9184 } 9185 } 9186 9187 return ( ( !minDate || date.getTime() >= minDate.getTime() ) && 9188 ( !maxDate || date.getTime() <= maxDate.getTime() ) && 9189 ( !minYear || date.getFullYear() >= minYear ) && 9190 ( !maxYear || date.getFullYear() <= maxYear ) ); 9191 }, 9192 9193 /* Provide the configuration settings for formatting/parsing. */ 9194 _getFormatConfig: function( inst ) { 9195 var shortYearCutoff = this._get( inst, "shortYearCutoff" ); 9196 shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff : 9197 new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) ); 9198 return { shortYearCutoff: shortYearCutoff, 9199 dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ), 9200 monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) }; 9201 }, 9202 9203 /* Format the given date for display. */ 9204 _formatDate: function( inst, day, month, year ) { 9205 if ( !day ) { 9206 inst.currentDay = inst.selectedDay; 9207 inst.currentMonth = inst.selectedMonth; 9208 inst.currentYear = inst.selectedYear; 9209 } 9210 var date = ( day ? ( typeof day === "object" ? day : 9211 this._daylightSavingAdjust( new Date( year, month, day ) ) ) : 9212 this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); 9213 return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) ); 9214 } 9215} ); 9216 9217/* 9218 * Bind hover events for datepicker elements. 9219 * Done via delegate so the binding only occurs once in the lifetime of the parent div. 9220 * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. 9221 */ 9222function datepicker_bindHover( dpDiv ) { 9223 var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; 9224 return dpDiv.on( "mouseout", selector, function() { 9225 $( this ).removeClass( "ui-state-hover" ); 9226 if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { 9227 $( this ).removeClass( "ui-datepicker-prev-hover" ); 9228 } 9229 if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { 9230 $( this ).removeClass( "ui-datepicker-next-hover" ); 9231 } 9232 } ) 9233 .on( "mouseover", selector, datepicker_handleMouseover ); 9234} 9235 9236function datepicker_handleMouseover() { 9237 if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) { 9238 $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" ); 9239 $( this ).addClass( "ui-state-hover" ); 9240 if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { 9241 $( this ).addClass( "ui-datepicker-prev-hover" ); 9242 } 9243 if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { 9244 $( this ).addClass( "ui-datepicker-next-hover" ); 9245 } 9246 } 9247} 9248 9249/* jQuery extend now ignores nulls! */ 9250function datepicker_extendRemove( target, props ) { 9251 $.extend( target, props ); 9252 for ( var name in props ) { 9253 if ( props[ name ] == null ) { 9254 target[ name ] = props[ name ]; 9255 } 9256 } 9257 return target; 9258} 9259 9260/* Invoke the datepicker functionality. 9261 @param options string - a command, optionally followed by additional parameters or 9262 Object - settings for attaching new datepicker functionality 9263 @return jQuery object */ 9264$.fn.datepicker = function( options ) { 9265 9266 /* Verify an empty collection wasn't passed - Fixes #6976 */ 9267 if ( !this.length ) { 9268 return this; 9269 } 9270 9271 /* Initialise the date picker. */ 9272 if ( !$.datepicker.initialized ) { 9273 $( document ).on( "mousedown", $.datepicker._checkExternalClick ); 9274 $.datepicker.initialized = true; 9275 } 9276 9277 /* Append datepicker main container to body if not exist. */ 9278 if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) { 9279 $( "body" ).append( $.datepicker.dpDiv ); 9280 } 9281 9282 var otherArgs = Array.prototype.slice.call( arguments, 1 ); 9283 if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) { 9284 return $.datepicker[ "_" + options + "Datepicker" ]. 9285 apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); 9286 } 9287 if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) { 9288 return $.datepicker[ "_" + options + "Datepicker" ]. 9289 apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); 9290 } 9291 return this.each( function() { 9292 typeof options === "string" ? 9293 $.datepicker[ "_" + options + "Datepicker" ]. 9294 apply( $.datepicker, [ this ].concat( otherArgs ) ) : 9295 $.datepicker._attachDatepicker( this, options ); 9296 } ); 9297}; 9298 9299$.datepicker = new Datepicker(); // singleton instance 9300$.datepicker.initialized = false; 9301$.datepicker.uuid = new Date().getTime(); 9302$.datepicker.version = "1.12.0"; 9303 9304var widgetsDatepicker = $.datepicker; 9305 9306 9307 9308 9309// This file is deprecated 9310var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); 9311 9312/*! 9313 * jQuery UI Mouse 1.12.0 9314 * http://jqueryui.com 9315 * 9316 * Copyright jQuery Foundation and other contributors 9317 * Released under the MIT license. 9318 * http://jquery.org/license 9319 */ 9320 9321//>>label: Mouse 9322//>>group: Widgets 9323//>>description: Abstracts mouse-based interactions to assist in creating certain widgets. 9324//>>docs: http://api.jqueryui.com/mouse/ 9325 9326 9327 9328var mouseHandled = false; 9329$( document ).on( "mouseup", function() { 9330 mouseHandled = false; 9331} ); 9332 9333var widgetsMouse = $.widget( "ui.mouse", { 9334 version: "1.12.0", 9335 options: { 9336 cancel: "input, textarea, button, select, option", 9337 distance: 1, 9338 delay: 0 9339 }, 9340 _mouseInit: function() { 9341 var that = this; 9342 9343 this.element 9344 .on( "mousedown." + this.widgetName, function( event ) { 9345 return that._mouseDown( event ); 9346 } ) 9347 .on( "click." + this.widgetName, function( event ) { 9348 if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { 9349 $.removeData( event.target, that.widgetName + ".preventClickEvent" ); 9350 event.stopImmediatePropagation(); 9351 return false; 9352 } 9353 } ); 9354 9355 this.started = false; 9356 }, 9357 9358 // TODO: make sure destroying one instance of mouse doesn't mess with 9359 // other instances of mouse 9360 _mouseDestroy: function() { 9361 this.element.off( "." + this.widgetName ); 9362 if ( this._mouseMoveDelegate ) { 9363 this.document 9364 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9365 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9366 } 9367 }, 9368 9369 _mouseDown: function( event ) { 9370 9371 // don't let more than one widget handle mouseStart 9372 if ( mouseHandled ) { 9373 return; 9374 } 9375 9376 this._mouseMoved = false; 9377 9378 // We may have missed mouseup (out of window) 9379 ( this._mouseStarted && this._mouseUp( event ) ); 9380 9381 this._mouseDownEvent = event; 9382 9383 var that = this, 9384 btnIsLeft = ( event.which === 1 ), 9385 9386 // event.target.nodeName works around a bug in IE 8 with 9387 // disabled inputs (#7620) 9388 elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? 9389 $( event.target ).closest( this.options.cancel ).length : false ); 9390 if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { 9391 return true; 9392 } 9393 9394 this.mouseDelayMet = !this.options.delay; 9395 if ( !this.mouseDelayMet ) { 9396 this._mouseDelayTimer = setTimeout( function() { 9397 that.mouseDelayMet = true; 9398 }, this.options.delay ); 9399 } 9400 9401 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 9402 this._mouseStarted = ( this._mouseStart( event ) !== false ); 9403 if ( !this._mouseStarted ) { 9404 event.preventDefault(); 9405 return true; 9406 } 9407 } 9408 9409 // Click event may never have fired (Gecko & Opera) 9410 if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { 9411 $.removeData( event.target, this.widgetName + ".preventClickEvent" ); 9412 } 9413 9414 // These delegates are required to keep context 9415 this._mouseMoveDelegate = function( event ) { 9416 return that._mouseMove( event ); 9417 }; 9418 this._mouseUpDelegate = function( event ) { 9419 return that._mouseUp( event ); 9420 }; 9421 9422 this.document 9423 .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9424 .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9425 9426 event.preventDefault(); 9427 9428 mouseHandled = true; 9429 return true; 9430 }, 9431 9432 _mouseMove: function( event ) { 9433 9434 // Only check for mouseups outside the document if you've moved inside the document 9435 // at least once. This prevents the firing of mouseup in the case of IE<9, which will 9436 // fire a mousemove event if content is placed under the cursor. See #7778 9437 // Support: IE <9 9438 if ( this._mouseMoved ) { 9439 9440 // IE mouseup check - mouseup happened when mouse was out of window 9441 if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && 9442 !event.button ) { 9443 return this._mouseUp( event ); 9444 9445 // Iframe mouseup check - mouseup occurred in another document 9446 } else if ( !event.which ) { 9447 9448 // Support: Safari <=8 - 9 9449 // Safari sets which to 0 if you press any of the following keys 9450 // during a drag (#14461) 9451 if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || 9452 event.originalEvent.metaKey || event.originalEvent.shiftKey ) { 9453 this.ignoreMissingWhich = true; 9454 } else if ( !this.ignoreMissingWhich ) { 9455 return this._mouseUp( event ); 9456 } 9457 } 9458 } 9459 9460 if ( event.which || event.button ) { 9461 this._mouseMoved = true; 9462 } 9463 9464 if ( this._mouseStarted ) { 9465 this._mouseDrag( event ); 9466 return event.preventDefault(); 9467 } 9468 9469 if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { 9470 this._mouseStarted = 9471 ( this._mouseStart( this._mouseDownEvent, event ) !== false ); 9472 ( this._mouseStarted ? this._mouseDrag( event ) : this._mouseUp( event ) ); 9473 } 9474 9475 return !this._mouseStarted; 9476 }, 9477 9478 _mouseUp: function( event ) { 9479 this.document 9480 .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) 9481 .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); 9482 9483 if ( this._mouseStarted ) { 9484 this._mouseStarted = false; 9485 9486 if ( event.target === this._mouseDownEvent.target ) { 9487 $.data( event.target, this.widgetName + ".preventClickEvent", true ); 9488 } 9489 9490 this._mouseStop( event ); 9491 } 9492 9493 if ( this._mouseDelayTimer ) { 9494 clearTimeout( this._mouseDelayTimer ); 9495 delete this._mouseDelayTimer; 9496 } 9497 9498 this.ignoreMissingWhich = false; 9499 mouseHandled = false; 9500 event.preventDefault(); 9501 }, 9502 9503 _mouseDistanceMet: function( event ) { 9504 return ( Math.max( 9505 Math.abs( this._mouseDownEvent.pageX - event.pageX ), 9506 Math.abs( this._mouseDownEvent.pageY - event.pageY ) 9507 ) >= this.options.distance 9508 ); 9509 }, 9510 9511 _mouseDelayMet: function( /* event */ ) { 9512 return this.mouseDelayMet; 9513 }, 9514 9515 // These are placeholder methods, to be overriden by extending plugin 9516 _mouseStart: function( /* event */ ) {}, 9517 _mouseDrag: function( /* event */ ) {}, 9518 _mouseStop: function( /* event */ ) {}, 9519 _mouseCapture: function( /* event */ ) { return true; } 9520} ); 9521 9522 9523 9524 9525// $.ui.plugin is deprecated. Use $.widget() extensions instead. 9526var plugin = $.ui.plugin = { 9527 add: function( module, option, set ) { 9528 var i, 9529 proto = $.ui[ module ].prototype; 9530 for ( i in set ) { 9531 proto.plugins[ i ] = proto.plugins[ i ] || []; 9532 proto.plugins[ i ].push( [ option, set[ i ] ] ); 9533 } 9534 }, 9535 call: function( instance, name, args, allowDisconnected ) { 9536 var i, 9537 set = instance.plugins[ name ]; 9538 9539 if ( !set ) { 9540 return; 9541 } 9542 9543 if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || 9544 instance.element[ 0 ].parentNode.nodeType === 11 ) ) { 9545 return; 9546 } 9547 9548 for ( i = 0; i < set.length; i++ ) { 9549 if ( instance.options[ set[ i ][ 0 ] ] ) { 9550 set[ i ][ 1 ].apply( instance.element, args ); 9551 } 9552 } 9553 } 9554}; 9555 9556 9557 9558var safeBlur = $.ui.safeBlur = function( element ) { 9559 9560 // Support: IE9 - 10 only 9561 // If the <body> is blurred, IE will switch windows, see #9420 9562 if ( element && element.nodeName.toLowerCase() !== "body" ) { 9563 $( element ).trigger( "blur" ); 9564 } 9565}; 9566 9567 9568/*! 9569 * jQuery UI Draggable 1.12.0 9570 * http://jqueryui.com 9571 * 9572 * Copyright jQuery Foundation and other contributors 9573 * Released under the MIT license. 9574 * http://jquery.org/license 9575 */ 9576 9577//>>label: Draggable 9578//>>group: Interactions 9579//>>description: Enables dragging functionality for any element. 9580//>>docs: http://api.jqueryui.com/draggable/ 9581//>>demos: http://jqueryui.com/draggable/ 9582//>>css.structure: ../../themes/base/draggable.css 9583 9584 9585 9586$.widget( "ui.draggable", $.ui.mouse, { 9587 version: "1.12.0", 9588 widgetEventPrefix: "drag", 9589 options: { 9590 addClasses: true, 9591 appendTo: "parent", 9592 axis: false, 9593 connectToSortable: false, 9594 containment: false, 9595 cursor: "auto", 9596 cursorAt: false, 9597 grid: false, 9598 handle: false, 9599 helper: "original", 9600 iframeFix: false, 9601 opacity: false, 9602 refreshPositions: false, 9603 revert: false, 9604 revertDuration: 500, 9605 scope: "default", 9606 scroll: true, 9607 scrollSensitivity: 20, 9608 scrollSpeed: 20, 9609 snap: false, 9610 snapMode: "both", 9611 snapTolerance: 20, 9612 stack: false, 9613 zIndex: false, 9614 9615 // Callbacks 9616 drag: null, 9617 start: null, 9618 stop: null 9619 }, 9620 _create: function() { 9621 9622 if ( this.options.helper === "original" ) { 9623 this._setPositionRelative(); 9624 } 9625 if ( this.options.addClasses ) { 9626 this._addClass( "ui-draggable" ); 9627 } 9628 this._setHandleClassName(); 9629 9630 this._mouseInit(); 9631 }, 9632 9633 _setOption: function( key, value ) { 9634 this._super( key, value ); 9635 if ( key === "handle" ) { 9636 this._removeHandleClassName(); 9637 this._setHandleClassName(); 9638 } 9639 }, 9640 9641 _destroy: function() { 9642 if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { 9643 this.destroyOnClear = true; 9644 return; 9645 } 9646 this._removeHandleClassName(); 9647 this._mouseDestroy(); 9648 }, 9649 9650 _mouseCapture: function( event ) { 9651 var o = this.options; 9652 9653 this._blurActiveElement( event ); 9654 9655 // Among others, prevent a drag on a resizable-handle 9656 if ( this.helper || o.disabled || 9657 $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { 9658 return false; 9659 } 9660 9661 //Quit if we're not on a valid handle 9662 this.handle = this._getHandle( event ); 9663 if ( !this.handle ) { 9664 return false; 9665 } 9666 9667 this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); 9668 9669 return true; 9670 9671 }, 9672 9673 _blockFrames: function( selector ) { 9674 this.iframeBlocks = this.document.find( selector ).map( function() { 9675 var iframe = $( this ); 9676 9677 return $( "<div>" ) 9678 .css( "position", "absolute" ) 9679 .appendTo( iframe.parent() ) 9680 .outerWidth( iframe.outerWidth() ) 9681 .outerHeight( iframe.outerHeight() ) 9682 .offset( iframe.offset() )[ 0 ]; 9683 } ); 9684 }, 9685 9686 _unblockFrames: function() { 9687 if ( this.iframeBlocks ) { 9688 this.iframeBlocks.remove(); 9689 delete this.iframeBlocks; 9690 } 9691 }, 9692 9693 _blurActiveElement: function( event ) { 9694 var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), 9695 target = $( event.target ); 9696 9697 // Only blur if the event occurred on an element that is: 9698 // 1) within the draggable handle 9699 // 2) but not within the currently focused element 9700 // See #10527, #12472 9701 if ( this._getHandle( event ) && target.closest( activeElement ).length ) { 9702 return; 9703 } 9704 9705 // Blur any element that currently has focus, see #4261 9706 $.ui.safeBlur( activeElement ); 9707 }, 9708 9709 _mouseStart: function( event ) { 9710 9711 var o = this.options; 9712 9713 //Create and append the visible helper 9714 this.helper = this._createHelper( event ); 9715 9716 this._addClass( this.helper, "ui-draggable-dragging" ); 9717 9718 //Cache the helper size 9719 this._cacheHelperProportions(); 9720 9721 //If ddmanager is used for droppables, set the global draggable 9722 if ( $.ui.ddmanager ) { 9723 $.ui.ddmanager.current = this; 9724 } 9725 9726 /* 9727 * - Position generation - 9728 * This block generates everything position related - it's the core of draggables. 9729 */ 9730 9731 //Cache the margins of the original element 9732 this._cacheMargins(); 9733 9734 //Store the helper's css position 9735 this.cssPosition = this.helper.css( "position" ); 9736 this.scrollParent = this.helper.scrollParent( true ); 9737 this.offsetParent = this.helper.offsetParent(); 9738 this.hasFixedAncestor = this.helper.parents().filter( function() { 9739 return $( this ).css( "position" ) === "fixed"; 9740 } ).length > 0; 9741 9742 //The element's absolute position on the page minus margins 9743 this.positionAbs = this.element.offset(); 9744 this._refreshOffsets( event ); 9745 9746 //Generate the original position 9747 this.originalPosition = this.position = this._generatePosition( event, false ); 9748 this.originalPageX = event.pageX; 9749 this.originalPageY = event.pageY; 9750 9751 //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 9752 ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); 9753 9754 //Set a containment if given in the options 9755 this._setContainment(); 9756 9757 //Trigger event + callbacks 9758 if ( this._trigger( "start", event ) === false ) { 9759 this._clear(); 9760 return false; 9761 } 9762 9763 //Recache the helper size 9764 this._cacheHelperProportions(); 9765 9766 //Prepare the droppable offsets 9767 if ( $.ui.ddmanager && !o.dropBehaviour ) { 9768 $.ui.ddmanager.prepareOffsets( this, event ); 9769 } 9770 9771 // Execute the drag once - this causes the helper not to be visible before getting its 9772 // correct position 9773 this._mouseDrag( event, true ); 9774 9775 // If the ddmanager is used for droppables, inform the manager that dragging has started 9776 // (see #5003) 9777 if ( $.ui.ddmanager ) { 9778 $.ui.ddmanager.dragStart( this, event ); 9779 } 9780 9781 return true; 9782 }, 9783 9784 _refreshOffsets: function( event ) { 9785 this.offset = { 9786 top: this.positionAbs.top - this.margins.top, 9787 left: this.positionAbs.left - this.margins.left, 9788 scroll: false, 9789 parent: this._getParentOffset(), 9790 relative: this._getRelativeOffset() 9791 }; 9792 9793 this.offset.click = { 9794 left: event.pageX - this.offset.left, 9795 top: event.pageY - this.offset.top 9796 }; 9797 }, 9798 9799 _mouseDrag: function( event, noPropagation ) { 9800 9801 // reset any necessary cached properties (see #5009) 9802 if ( this.hasFixedAncestor ) { 9803 this.offset.parent = this._getParentOffset(); 9804 } 9805 9806 //Compute the helpers position 9807 this.position = this._generatePosition( event, true ); 9808 this.positionAbs = this._convertPositionTo( "absolute" ); 9809 9810 //Call plugins and callbacks and use the resulting position if something is returned 9811 if ( !noPropagation ) { 9812 var ui = this._uiHash(); 9813 if ( this._trigger( "drag", event, ui ) === false ) { 9814 this._mouseUp( new $.Event( "mouseup", event ) ); 9815 return false; 9816 } 9817 this.position = ui.position; 9818 } 9819 9820 this.helper[ 0 ].style.left = this.position.left + "px"; 9821 this.helper[ 0 ].style.top = this.position.top + "px"; 9822 9823 if ( $.ui.ddmanager ) { 9824 $.ui.ddmanager.drag( this, event ); 9825 } 9826 9827 return false; 9828 }, 9829 9830 _mouseStop: function( event ) { 9831 9832 //If we are using droppables, inform the manager about the drop 9833 var that = this, 9834 dropped = false; 9835 if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 9836 dropped = $.ui.ddmanager.drop( this, event ); 9837 } 9838 9839 //if a drop comes from outside (a sortable) 9840 if ( this.dropped ) { 9841 dropped = this.dropped; 9842 this.dropped = false; 9843 } 9844 9845 if ( ( this.options.revert === "invalid" && !dropped ) || 9846 ( this.options.revert === "valid" && dropped ) || 9847 this.options.revert === true || ( $.isFunction( this.options.revert ) && 9848 this.options.revert.call( this.element, dropped ) ) 9849 ) { 9850 $( this.helper ).animate( 9851 this.originalPosition, 9852 parseInt( this.options.revertDuration, 10 ), 9853 function() { 9854 if ( that._trigger( "stop", event ) !== false ) { 9855 that._clear(); 9856 } 9857 } 9858 ); 9859 } else { 9860 if ( this._trigger( "stop", event ) !== false ) { 9861 this._clear(); 9862 } 9863 } 9864 9865 return false; 9866 }, 9867 9868 _mouseUp: function( event ) { 9869 this._unblockFrames(); 9870 9871 // If the ddmanager is used for droppables, inform the manager that dragging has stopped 9872 // (see #5003) 9873 if ( $.ui.ddmanager ) { 9874 $.ui.ddmanager.dragStop( this, event ); 9875 } 9876 9877 // Only need to focus if the event occurred on the draggable itself, see #10527 9878 if ( this.handleElement.is( event.target ) ) { 9879 9880 // The interaction is over; whether or not the click resulted in a drag, 9881 // focus the element 9882 this.element.trigger( "focus" ); 9883 } 9884 9885 return $.ui.mouse.prototype._mouseUp.call( this, event ); 9886 }, 9887 9888 cancel: function() { 9889 9890 if ( this.helper.is( ".ui-draggable-dragging" ) ) { 9891 this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); 9892 } else { 9893 this._clear(); 9894 } 9895 9896 return this; 9897 9898 }, 9899 9900 _getHandle: function( event ) { 9901 return this.options.handle ? 9902 !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : 9903 true; 9904 }, 9905 9906 _setHandleClassName: function() { 9907 this.handleElement = this.options.handle ? 9908 this.element.find( this.options.handle ) : this.element; 9909 this._addClass( this.handleElement, "ui-draggable-handle" ); 9910 }, 9911 9912 _removeHandleClassName: function() { 9913 this._removeClass( this.handleElement, "ui-draggable-handle" ); 9914 }, 9915 9916 _createHelper: function( event ) { 9917 9918 var o = this.options, 9919 helperIsFunction = $.isFunction( o.helper ), 9920 helper = helperIsFunction ? 9921 $( o.helper.apply( this.element[ 0 ], [ event ] ) ) : 9922 ( o.helper === "clone" ? 9923 this.element.clone().removeAttr( "id" ) : 9924 this.element ); 9925 9926 if ( !helper.parents( "body" ).length ) { 9927 helper.appendTo( ( o.appendTo === "parent" ? 9928 this.element[ 0 ].parentNode : 9929 o.appendTo ) ); 9930 } 9931 9932 // Http://bugs.jqueryui.com/ticket/9446 9933 // a helper function can return the original element 9934 // which wouldn't have been set to relative in _create 9935 if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) { 9936 this._setPositionRelative(); 9937 } 9938 9939 if ( helper[ 0 ] !== this.element[ 0 ] && 9940 !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { 9941 helper.css( "position", "absolute" ); 9942 } 9943 9944 return helper; 9945 9946 }, 9947 9948 _setPositionRelative: function() { 9949 if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) { 9950 this.element[ 0 ].style.position = "relative"; 9951 } 9952 }, 9953 9954 _adjustOffsetFromHelper: function( obj ) { 9955 if ( typeof obj === "string" ) { 9956 obj = obj.split( " " ); 9957 } 9958 if ( $.isArray( obj ) ) { 9959 obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 9960 } 9961 if ( "left" in obj ) { 9962 this.offset.click.left = obj.left + this.margins.left; 9963 } 9964 if ( "right" in obj ) { 9965 this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 9966 } 9967 if ( "top" in obj ) { 9968 this.offset.click.top = obj.top + this.margins.top; 9969 } 9970 if ( "bottom" in obj ) { 9971 this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 9972 } 9973 }, 9974 9975 _isRootNode: function( element ) { 9976 return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ]; 9977 }, 9978 9979 _getParentOffset: function() { 9980 9981 //Get the offsetParent and cache its position 9982 var po = this.offsetParent.offset(), 9983 document = this.document[ 0 ]; 9984 9985 // This is a special case where we need to modify a offset calculated on start, since the 9986 // following happened: 9987 // 1. The position of the helper is absolute, so it's position is calculated based on the 9988 // next positioned parent 9989 // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 9990 // the document, which means that the scroll is included in the initial calculation of the 9991 // offset of the parent, and never recalculated upon drag 9992 if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && 9993 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 9994 po.left += this.scrollParent.scrollLeft(); 9995 po.top += this.scrollParent.scrollTop(); 9996 } 9997
vendor: 13,156 bytes, lines 9998-10426
9998 if ( this._isRootNode( this.offsetParent[ 0 ] ) ) { 9999 po = { top: 0, left: 0 }; 10000 } 10001 10002 return { 10003 top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 10004 left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 10005 }; 10006 10007 }, 10008 10009 _getRelativeOffset: function() { 10010 if ( this.cssPosition !== "relative" ) { 10011 return { top: 0, left: 0 }; 10012 } 10013 10014 var p = this.element.position(), 10015 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); 10016 10017 return { 10018 top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 10019 ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), 10020 left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 10021 ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) 10022 }; 10023 10024 }, 10025 10026 _cacheMargins: function() { 10027 this.margins = { 10028 left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), 10029 top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), 10030 right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), 10031 bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) 10032 }; 10033 }, 10034 10035 _cacheHelperProportions: function() { 10036 this.helperProportions = { 10037 width: this.helper.outerWidth(), 10038 height: this.helper.outerHeight() 10039 }; 10040 }, 10041 10042 _setContainment: function() { 10043 10044 var isUserScrollable, c, ce, 10045 o = this.options, 10046 document = this.document[ 0 ]; 10047 10048 this.relativeContainer = null; 10049 10050 if ( !o.containment ) { 10051 this.containment = null; 10052 return; 10053 } 10054 10055 if ( o.containment === "window" ) { 10056 this.containment = [ 10057 $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, 10058 $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, 10059 $( window ).scrollLeft() + $( window ).width() - 10060 this.helperProportions.width - this.margins.left, 10061 $( window ).scrollTop() + 10062 ( $( window ).height() || document.body.parentNode.scrollHeight ) - 10063 this.helperProportions.height - this.margins.top 10064 ]; 10065 return; 10066 } 10067 10068 if ( o.containment === "document" ) { 10069 this.containment = [ 10070 0, 10071 0, 10072 $( document ).width() - this.helperProportions.width - this.margins.left, 10073 ( $( document ).height() || document.body.parentNode.scrollHeight ) - 10074 this.helperProportions.height - this.margins.top 10075 ]; 10076 return; 10077 } 10078 10079 if ( o.containment.constructor === Array ) { 10080 this.containment = o.containment; 10081 return; 10082 } 10083 10084 if ( o.containment === "parent" ) { 10085 o.containment = this.helper[ 0 ].parentNode; 10086 } 10087 10088 c = $( o.containment ); 10089 ce = c[ 0 ]; 10090 10091 if ( !ce ) { 10092 return; 10093 } 10094 10095 isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) ); 10096 10097 this.containment = [ 10098 ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + 10099 ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), 10100 ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + 10101 ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), 10102 ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 10103 ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - 10104 ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - 10105 this.helperProportions.width - 10106 this.margins.left - 10107 this.margins.right, 10108 ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - 10109 ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - 10110 ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - 10111 this.helperProportions.height - 10112 this.margins.top - 10113 this.margins.bottom 10114 ]; 10115 this.relativeContainer = c; 10116 }, 10117 10118 _convertPositionTo: function( d, pos ) { 10119 10120 if ( !pos ) { 10121 pos = this.position; 10122 } 10123 10124 var mod = d === "absolute" ? 1 : -1, 10125 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); 10126 10127 return { 10128 top: ( 10129 10130 // The absolute mouse position 10131 pos.top + 10132 10133 // Only for relative positioned nodes: Relative offset from element to offset parent 10134 this.offset.relative.top * mod + 10135 10136 // The offsetParent's offset without borders (offset + border) 10137 this.offset.parent.top * mod - 10138 ( ( this.cssPosition === "fixed" ? 10139 -this.offset.scroll.top : 10140 ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) 10141 ), 10142 left: ( 10143 10144 // The absolute mouse position 10145 pos.left + 10146 10147 // Only for relative positioned nodes: Relative offset from element to offset parent 10148 this.offset.relative.left * mod + 10149 10150 // The offsetParent's offset without borders (offset + border) 10151 this.offset.parent.left * mod - 10152 ( ( this.cssPosition === "fixed" ? 10153 -this.offset.scroll.left : 10154 ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) 10155 ) 10156 }; 10157 10158 }, 10159 10160 _generatePosition: function( event, constrainPosition ) { 10161 10162 var containment, co, top, left, 10163 o = this.options, 10164 scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ), 10165 pageX = event.pageX, 10166 pageY = event.pageY; 10167 10168 // Cache the scroll 10169 if ( !scrollIsRootNode || !this.offset.scroll ) { 10170 this.offset.scroll = { 10171 top: this.scrollParent.scrollTop(), 10172 left: this.scrollParent.scrollLeft() 10173 }; 10174 } 10175 10176 /* 10177 * - Position constraining - 10178 * Constrain the position to a mix of grid, containment. 10179 */ 10180 10181 // If we are not dragging yet, we won't check for options 10182 if ( constrainPosition ) { 10183 if ( this.containment ) { 10184 if ( this.relativeContainer ) { 10185 co = this.relativeContainer.offset(); 10186 containment = [ 10187 this.containment[ 0 ] + co.left, 10188 this.containment[ 1 ] + co.top, 10189 this.containment[ 2 ] + co.left, 10190 this.containment[ 3 ] + co.top 10191 ]; 10192 } else { 10193 containment = this.containment; 10194 } 10195 10196 if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { 10197 pageX = containment[ 0 ] + this.offset.click.left; 10198 } 10199 if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { 10200 pageY = containment[ 1 ] + this.offset.click.top; 10201 } 10202 if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { 10203 pageX = containment[ 2 ] + this.offset.click.left; 10204 } 10205 if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { 10206 pageY = containment[ 3 ] + this.offset.click.top; 10207 } 10208 } 10209 10210 if ( o.grid ) { 10211 10212 //Check for grid elements set to 0 to prevent divide by 0 error causing invalid 10213 // argument errors in IE (see ticket #6950) 10214 top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - 10215 this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; 10216 pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || 10217 top - this.offset.click.top > containment[ 3 ] ) ? 10218 top : 10219 ( ( top - this.offset.click.top >= containment[ 1 ] ) ? 10220 top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; 10221 10222 left = o.grid[ 0 ] ? this.originalPageX + 10223 Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : 10224 this.originalPageX; 10225 pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || 10226 left - this.offset.click.left > containment[ 2 ] ) ? 10227 left : 10228 ( ( left - this.offset.click.left >= containment[ 0 ] ) ? 10229 left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; 10230 } 10231 10232 if ( o.axis === "y" ) { 10233 pageX = this.originalPageX; 10234 } 10235 10236 if ( o.axis === "x" ) { 10237 pageY = this.originalPageY; 10238 } 10239 } 10240 10241 return { 10242 top: ( 10243 10244 // The absolute mouse position 10245 pageY - 10246 10247 // Click offset (relative to the element) 10248 this.offset.click.top - 10249 10250 // Only for relative positioned nodes: Relative offset from element to offset parent 10251 this.offset.relative.top - 10252 10253 // The offsetParent's offset without borders (offset + border) 10254 this.offset.parent.top + 10255 ( this.cssPosition === "fixed" ? 10256 -this.offset.scroll.top : 10257 ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) 10258 ), 10259 left: ( 10260 10261 // The absolute mouse position 10262 pageX - 10263 10264 // Click offset (relative to the element) 10265 this.offset.click.left - 10266 10267 // Only for relative positioned nodes: Relative offset from element to offset parent 10268 this.offset.relative.left - 10269 10270 // The offsetParent's offset without borders (offset + border) 10271 this.offset.parent.left + 10272 ( this.cssPosition === "fixed" ? 10273 -this.offset.scroll.left : 10274 ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) 10275 ) 10276 }; 10277 10278 }, 10279 10280 _clear: function() { 10281 this._removeClass( this.helper, "ui-draggable-dragging" ); 10282 if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { 10283 this.helper.remove(); 10284 } 10285 this.helper = null; 10286 this.cancelHelperRemoval = false; 10287 if ( this.destroyOnClear ) { 10288 this.destroy(); 10289 } 10290 }, 10291 10292 // From now on bulk stuff - mainly helpers 10293 10294 _trigger: function( type, event, ui ) { 10295 ui = ui || this._uiHash(); 10296 $.ui.plugin.call( this, type, [ event, ui, this ], true ); 10297 10298 // Absolute position and offset (see #6884 ) have to be recalculated after plugins 10299 if ( /^(drag|start|stop)/.test( type ) ) { 10300 this.positionAbs = this._convertPositionTo( "absolute" ); 10301 ui.offset = this.positionAbs; 10302 } 10303 return $.Widget.prototype._trigger.call( this, type, event, ui ); 10304 }, 10305 10306 plugins: {}, 10307 10308 _uiHash: function() { 10309 return { 10310 helper: this.helper, 10311 position: this.position, 10312 originalPosition: this.originalPosition, 10313 offset: this.positionAbs 10314 }; 10315 } 10316 10317} ); 10318 10319$.ui.plugin.add( "draggable", "connectToSortable", { 10320 start: function( event, ui, draggable ) { 10321 var uiSortable = $.extend( {}, ui, { 10322 item: draggable.element 10323 } ); 10324 10325 draggable.sortables = []; 10326 $( draggable.options.connectToSortable ).each( function() { 10327 var sortable = $( this ).sortable( "instance" ); 10328 10329 if ( sortable && !sortable.options.disabled ) { 10330 draggable.sortables.push( sortable ); 10331 10332 // RefreshPositions is called at drag start to refresh the containerCache 10333 // which is used in drag. This ensures it's initialized and synchronized 10334 // with any changes that might have happened on the page since initialization. 10335 sortable.refreshPositions(); 10336 sortable._trigger( "activate", event, uiSortable ); 10337 } 10338 } ); 10339 }, 10340 stop: function( event, ui, draggable ) { 10341 var uiSortable = $.extend( {}, ui, { 10342 item: draggable.element 10343 } ); 10344 10345 draggable.cancelHelperRemoval = false; 10346 10347 $.each( draggable.sortables, function() { 10348 var sortable = this; 10349 10350 if ( sortable.isOver ) { 10351 sortable.isOver = 0; 10352 10353 // Allow this sortable to handle removing the helper 10354 draggable.cancelHelperRemoval = true; 10355 sortable.cancelHelperRemoval = false; 10356 10357 // Use _storedCSS To restore properties in the sortable, 10358 // as this also handles revert (#9675) since the draggable 10359 // may have modified them in unexpected ways (#8809) 10360 sortable._storedCSS = { 10361 position: sortable.placeholder.css( "position" ), 10362 top: sortable.placeholder.css( "top" ), 10363 left: sortable.placeholder.css( "left" ) 10364 }; 10365 10366 sortable._mouseStop( event ); 10367 10368 // Once drag has ended, the sortable should return to using 10369 // its original helper, not the shared helper from draggable 10370 sortable.options.helper = sortable.options._helper; 10371 } else { 10372 10373 // Prevent this Sortable from removing the helper. 10374 // However, don't set the draggable to remove the helper 10375 // either as another connected Sortable may yet handle the removal. 10376 sortable.cancelHelperRemoval = true; 10377 10378 sortable._trigger( "deactivate", event, uiSortable ); 10379 } 10380 } ); 10381 }, 10382 drag: function( event, ui, draggable ) { 10383 $.each( draggable.sortables, function() { 10384 var innermostIntersecting = false, 10385 sortable = this; 10386 10387 // Copy over variables that sortable's _intersectsWith uses 10388 sortable.positionAbs = draggable.positionAbs; 10389 sortable.helperProportions = draggable.helperProportions; 10390 sortable.offset.click = draggable.offset.click; 10391 10392 if ( sortable._intersectsWith( sortable.containerCache ) ) { 10393 innermostIntersecting = true; 10394 10395 $.each( draggable.sortables, function() { 10396 10397 // Copy over variables that sortable's _intersectsWith uses 10398 this.positionAbs = draggable.positionAbs; 10399 this.helperProportions = draggable.helperProportions; 10400 this.offset.click = draggable.offset.click; 10401 10402 if ( this !== sortable && 10403 this._intersectsWith( this.containerCache ) && 10404 $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) { 10405 innermostIntersecting = false; 10406 } 10407 10408 return innermostIntersecting; 10409 } ); 10410 } 10411 10412 if ( innermostIntersecting ) { 10413 10414 // If it intersects, we use a little isOver variable and set it once, 10415 // so that the move-in stuff gets fired only once. 10416 if ( !sortable.isOver ) { 10417 sortable.isOver = 1; 10418 10419 // Store draggable's parent in case we need to reappend to it later. 10420 draggable._parent = ui.helper.parent(); 10421 10422 sortable.currentItem = ui.helper 10423 .appendTo( sortable.element ) 10424 .data( "ui-sortable-item", true ); 10425 10426 // Store helper option to later restore it
vendor: 11,429 bytes, lines 10427-10801
10427 sortable.options._helper = sortable.options.helper; 10428 10429 sortable.options.helper = function() { 10430 return ui.helper[ 0 ]; 10431 }; 10432 10433 // Fire the start events of the sortable with our passed browser event, 10434 // and our own helper (so it doesn't create a new one) 10435 event.target = sortable.currentItem[ 0 ]; 10436 sortable._mouseCapture( event, true ); 10437 sortable._mouseStart( event, true, true ); 10438 10439 // Because the browser event is way off the new appended portlet, 10440 // modify necessary variables to reflect the changes 10441 sortable.offset.click.top = draggable.offset.click.top; 10442 sortable.offset.click.left = draggable.offset.click.left; 10443 sortable.offset.parent.left -= draggable.offset.parent.left - 10444 sortable.offset.parent.left; 10445 sortable.offset.parent.top -= draggable.offset.parent.top - 10446 sortable.offset.parent.top; 10447 10448 draggable._trigger( "toSortable", event ); 10449 10450 // Inform draggable that the helper is in a valid drop zone, 10451 // used solely in the revert option to handle "valid/invalid". 10452 draggable.dropped = sortable.element; 10453 10454 // Need to refreshPositions of all sortables in the case that 10455 // adding to one sortable changes the location of the other sortables (#9675) 10456 $.each( draggable.sortables, function() { 10457 this.refreshPositions(); 10458 } ); 10459 10460 // Hack so receive/update callbacks work (mostly) 10461 draggable.currentItem = draggable.element; 10462 sortable.fromOutside = draggable; 10463 } 10464 10465 if ( sortable.currentItem ) { 10466 sortable._mouseDrag( event ); 10467 10468 // Copy the sortable's position because the draggable's can potentially reflect 10469 // a relative position, while sortable is always absolute, which the dragged 10470 // element has now become. (#8809) 10471 ui.position = sortable.position; 10472 } 10473 } else { 10474 10475 // If it doesn't intersect with the sortable, and it intersected before, 10476 // we fake the drag stop of the sortable, but make sure it doesn't remove 10477 // the helper by using cancelHelperRemoval. 10478 if ( sortable.isOver ) { 10479 10480 sortable.isOver = 0; 10481 sortable.cancelHelperRemoval = true; 10482 10483 // Calling sortable's mouseStop would trigger a revert, 10484 // so revert must be temporarily false until after mouseStop is called. 10485 sortable.options._revert = sortable.options.revert; 10486 sortable.options.revert = false; 10487 10488 sortable._trigger( "out", event, sortable._uiHash( sortable ) ); 10489 sortable._mouseStop( event, true ); 10490 10491 // Restore sortable behaviors that were modfied 10492 // when the draggable entered the sortable area (#9481) 10493 sortable.options.revert = sortable.options._revert; 10494 sortable.options.helper = sortable.options._helper; 10495 10496 if ( sortable.placeholder ) { 10497 sortable.placeholder.remove(); 10498 } 10499 10500 // Restore and recalculate the draggable's offset considering the sortable 10501 // may have modified them in unexpected ways. (#8809, #10669) 10502 ui.helper.appendTo( draggable._parent ); 10503 draggable._refreshOffsets( event ); 10504 ui.position = draggable._generatePosition( event, true ); 10505 10506 draggable._trigger( "fromSortable", event ); 10507 10508 // Inform draggable that the helper is no longer in a valid drop zone 10509 draggable.dropped = false; 10510 10511 // Need to refreshPositions of all sortables just in case removing 10512 // from one sortable changes the location of other sortables (#9675) 10513 $.each( draggable.sortables, function() { 10514 this.refreshPositions(); 10515 } ); 10516 } 10517 } 10518 } ); 10519 } 10520} ); 10521 10522$.ui.plugin.add( "draggable", "cursor", { 10523 start: function( event, ui, instance ) { 10524 var t = $( "body" ), 10525 o = instance.options; 10526 10527 if ( t.css( "cursor" ) ) { 10528 o._cursor = t.css( "cursor" ); 10529 } 10530 t.css( "cursor", o.cursor ); 10531 }, 10532 stop: function( event, ui, instance ) { 10533 var o = instance.options; 10534 if ( o._cursor ) { 10535 $( "body" ).css( "cursor", o._cursor ); 10536 } 10537 } 10538} ); 10539 10540$.ui.plugin.add( "draggable", "opacity", { 10541 start: function( event, ui, instance ) { 10542 var t = $( ui.helper ), 10543 o = instance.options; 10544 if ( t.css( "opacity" ) ) { 10545 o._opacity = t.css( "opacity" ); 10546 } 10547 t.css( "opacity", o.opacity ); 10548 }, 10549 stop: function( event, ui, instance ) { 10550 var o = instance.options; 10551 if ( o._opacity ) { 10552 $( ui.helper ).css( "opacity", o._opacity ); 10553 } 10554 } 10555} ); 10556 10557$.ui.plugin.add( "draggable", "scroll", { 10558 start: function( event, ui, i ) { 10559 if ( !i.scrollParentNotHidden ) { 10560 i.scrollParentNotHidden = i.helper.scrollParent( false ); 10561 } 10562 10563 if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && 10564 i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { 10565 i.overflowOffset = i.scrollParentNotHidden.offset(); 10566 } 10567 }, 10568 drag: function( event, ui, i ) { 10569 10570 var o = i.options, 10571 scrolled = false, 10572 scrollParent = i.scrollParentNotHidden[ 0 ], 10573 document = i.document[ 0 ]; 10574 10575 if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { 10576 if ( !o.axis || o.axis !== "x" ) { 10577 if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < 10578 o.scrollSensitivity ) { 10579 scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; 10580 } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { 10581 scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed; 10582 } 10583 } 10584 10585 if ( !o.axis || o.axis !== "y" ) { 10586 if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < 10587 o.scrollSensitivity ) { 10588 scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; 10589 } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { 10590 scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed; 10591 } 10592 } 10593 10594 } else { 10595 10596 if ( !o.axis || o.axis !== "x" ) { 10597 if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { 10598 scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); 10599 } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < 10600 o.scrollSensitivity ) { 10601 scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); 10602 } 10603 } 10604 10605 if ( !o.axis || o.axis !== "y" ) { 10606 if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { 10607 scrolled = $( document ).scrollLeft( 10608 $( document ).scrollLeft() - o.scrollSpeed 10609 ); 10610 } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < 10611 o.scrollSensitivity ) { 10612 scrolled = $( document ).scrollLeft( 10613 $( document ).scrollLeft() + o.scrollSpeed 10614 ); 10615 } 10616 } 10617 10618 } 10619 10620 if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { 10621 $.ui.ddmanager.prepareOffsets( i, event ); 10622 } 10623 10624 } 10625} ); 10626 10627$.ui.plugin.add( "draggable", "snap", { 10628 start: function( event, ui, i ) { 10629 10630 var o = i.options; 10631 10632 i.snapElements = []; 10633 10634 $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) 10635 .each( function() { 10636 var $t = $( this ), 10637 $o = $t.offset(); 10638 if ( this !== i.element[ 0 ] ) { 10639 i.snapElements.push( { 10640 item: this, 10641 width: $t.outerWidth(), height: $t.outerHeight(), 10642 top: $o.top, left: $o.left 10643 } ); 10644 } 10645 } ); 10646 10647 }, 10648 drag: function( event, ui, inst ) { 10649 10650 var ts, bs, ls, rs, l, r, t, b, i, first, 10651 o = inst.options, 10652 d = o.snapTolerance, 10653 x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, 10654 y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; 10655 10656 for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { 10657 10658 l = inst.snapElements[ i ].left - inst.margins.left; 10659 r = l + inst.snapElements[ i ].width; 10660 t = inst.snapElements[ i ].top - inst.margins.top; 10661 b = t + inst.snapElements[ i ].height; 10662 10663 if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || 10664 !$.contains( inst.snapElements[ i ].item.ownerDocument, 10665 inst.snapElements[ i ].item ) ) { 10666 if ( inst.snapElements[ i ].snapping ) { 10667 ( inst.options.snap.release && 10668 inst.options.snap.release.call( 10669 inst.element, 10670 event, 10671 $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) 10672 ) ); 10673 } 10674 inst.snapElements[ i ].snapping = false; 10675 continue; 10676 } 10677 10678 if ( o.snapMode !== "inner" ) { 10679 ts = Math.abs( t - y2 ) <= d; 10680 bs = Math.abs( b - y1 ) <= d; 10681 ls = Math.abs( l - x2 ) <= d; 10682 rs = Math.abs( r - x1 ) <= d; 10683 if ( ts ) { 10684 ui.position.top = inst._convertPositionTo( "relative", { 10685 top: t - inst.helperProportions.height, 10686 left: 0 10687 } ).top; 10688 } 10689 if ( bs ) { 10690 ui.position.top = inst._convertPositionTo( "relative", { 10691 top: b, 10692 left: 0 10693 } ).top; 10694 } 10695 if ( ls ) { 10696 ui.position.left = inst._convertPositionTo( "relative", { 10697 top: 0, 10698 left: l - inst.helperProportions.width 10699 } ).left; 10700 } 10701 if ( rs ) { 10702 ui.position.left = inst._convertPositionTo( "relative", { 10703 top: 0, 10704 left: r 10705 } ).left; 10706 } 10707 } 10708 10709 first = ( ts || bs || ls || rs ); 10710 10711 if ( o.snapMode !== "outer" ) { 10712 ts = Math.abs( t - y1 ) <= d; 10713 bs = Math.abs( b - y2 ) <= d; 10714 ls = Math.abs( l - x1 ) <= d; 10715 rs = Math.abs( r - x2 ) <= d; 10716 if ( ts ) { 10717 ui.position.top = inst._convertPositionTo( "relative", { 10718 top: t, 10719 left: 0 10720 } ).top; 10721 } 10722 if ( bs ) { 10723 ui.position.top = inst._convertPositionTo( "relative", { 10724 top: b - inst.helperProportions.height, 10725 left: 0 10726 } ).top; 10727 } 10728 if ( ls ) { 10729 ui.position.left = inst._convertPositionTo( "relative", { 10730 top: 0, 10731 left: l 10732 } ).left; 10733 } 10734 if ( rs ) { 10735 ui.position.left = inst._convertPositionTo( "relative", { 10736 top: 0, 10737 left: r - inst.helperProportions.width 10738 } ).left; 10739 } 10740 } 10741 10742 if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { 10743 ( inst.options.snap.snap && 10744 inst.options.snap.snap.call( 10745 inst.element, 10746 event, 10747 $.extend( inst._uiHash(), { 10748 snapItem: inst.snapElements[ i ].item 10749 } ) ) ); 10750 } 10751 inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); 10752 10753 } 10754 10755 } 10756} ); 10757 10758$.ui.plugin.add( "draggable", "stack", { 10759 start: function( event, ui, instance ) { 10760 var min, 10761 o = instance.options, 10762 group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { 10763 return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - 10764 ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); 10765 } ); 10766 10767 if ( !group.length ) { return; } 10768 10769 min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; 10770 $( group ).each( function( i ) { 10771 $( this ).css( "zIndex", min + i ); 10772 } ); 10773 this.css( "zIndex", ( min + group.length ) ); 10774 } 10775} ); 10776 10777$.ui.plugin.add( "draggable", "zIndex", { 10778 start: function( event, ui, instance ) { 10779 var t = $( ui.helper ), 10780 o = instance.options; 10781 10782 if ( t.css( "zIndex" ) ) { 10783 o._zIndex = t.css( "zIndex" ); 10784 } 10785 t.css( "zIndex", o.zIndex ); 10786 }, 10787 stop: function( event, ui, instance ) { 10788 var o = instance.options; 10789 10790 if ( o._zIndex ) { 10791 $( ui.helper ).css( "zIndex", o._zIndex ); 10792 } 10793 } 10794} ); 10795 10796var widgetsDraggable = $.ui.draggable; 10797 10798 10799/*! 10800 * jQuery UI Resizable 1.12.0 10801 * http://jqueryui.com
vendor: 6,932 bytes, lines 10802-11080
10802 * 10803 * Copyright jQuery Foundation and other contributors 10804 * Released under the MIT license. 10805 * http://jquery.org/license 10806 */ 10807 10808//>>label: Resizable 10809//>>group: Interactions 10810//>>description: Enables resize functionality for any element. 10811//>>docs: http://api.jqueryui.com/resizable/ 10812//>>demos: http://jqueryui.com/resizable/ 10813//>>css.structure: ../../themes/base/core.css 10814//>>css.structure: ../../themes/base/resizable.css 10815//>>css.theme: ../../themes/base/theme.css 10816 10817 10818 10819$.widget( "ui.resizable", $.ui.mouse, { 10820 version: "1.12.0", 10821 widgetEventPrefix: "resize", 10822 options: { 10823 alsoResize: false, 10824 animate: false, 10825 animateDuration: "slow", 10826 animateEasing: "swing", 10827 aspectRatio: false, 10828 autoHide: false, 10829 classes: { 10830 "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" 10831 }, 10832 containment: false, 10833 ghost: false, 10834 grid: false, 10835 handles: "e,s,se", 10836 helper: false, 10837 maxHeight: null, 10838 maxWidth: null, 10839 minHeight: 10, 10840 minWidth: 10, 10841 10842 // See #7960 10843 zIndex: 90, 10844 10845 // Callbacks 10846 resize: null, 10847 start: null, 10848 stop: null 10849 }, 10850 10851 _num: function( value ) { 10852 return parseFloat( value ) || 0; 10853 }, 10854 10855 _isNumber: function( value ) { 10856 return !isNaN( parseFloat( value ) ); 10857 }, 10858 10859 _hasScroll: function( el, a ) { 10860 10861 if ( $( el ).css( "overflow" ) === "hidden" ) { 10862 return false; 10863 } 10864 10865 var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", 10866 has = false; 10867 10868 if ( el[ scroll ] > 0 ) { 10869 return true; 10870 } 10871 10872 // TODO: determine which cases actually cause this to happen 10873 // if the element doesn't have the scroll set, see if it's possible to 10874 // set the scroll 10875 el[ scroll ] = 1; 10876 has = ( el[ scroll ] > 0 ); 10877 el[ scroll ] = 0; 10878 return has; 10879 }, 10880 10881 _create: function() { 10882 10883 var margins, 10884 o = this.options, 10885 that = this; 10886 this._addClass( "ui-resizable" ); 10887 10888 $.extend( this, { 10889 _aspectRatio: !!( o.aspectRatio ), 10890 aspectRatio: o.aspectRatio, 10891 originalElement: this.element, 10892 _proportionallyResizeElements: [], 10893 _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null 10894 } ); 10895 10896 // Wrap the element if it cannot hold child nodes 10897 if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) { 10898 10899 this.element.wrap( 10900 $( "<div class='ui-wrapper' style='overflow: hidden;'></div>" ).css( { 10901 position: this.element.css( "position" ), 10902 width: this.element.outerWidth(), 10903 height: this.element.outerHeight(), 10904 top: this.element.css( "top" ), 10905 left: this.element.css( "left" ) 10906 } ) 10907 ); 10908 10909 this.element = this.element.parent().data( 10910 "ui-resizable", this.element.resizable( "instance" ) 10911 ); 10912 10913 this.elementIsWrapper = true; 10914 10915 margins = { 10916 marginTop: this.originalElement.css( "marginTop" ), 10917 marginRight: this.originalElement.css( "marginRight" ), 10918 marginBottom: this.originalElement.css( "marginBottom" ), 10919 marginLeft: this.originalElement.css( "marginLeft" ) 10920 }; 10921 10922 this.element.css( margins ); 10923 this.originalElement.css( "margin", 0 ); 10924 10925 // support: Safari 10926 // Prevent Safari textarea resize 10927 this.originalResizeStyle = this.originalElement.css( "resize" ); 10928 this.originalElement.css( "resize", "none" ); 10929 10930 this._proportionallyResizeElements.push( this.originalElement.css( { 10931 position: "static", 10932 zoom: 1, 10933 display: "block" 10934 } ) ); 10935 10936 // Support: IE9 10937 // avoid IE jump (hard set the margin) 10938 this.originalElement.css( margins ); 10939 10940 this._proportionallyResize(); 10941 } 10942 10943 this._setupHandles(); 10944 10945 if ( o.autoHide ) { 10946 $( this.element ) 10947 .on( "mouseenter", function() { 10948 if ( o.disabled ) { 10949 return; 10950 } 10951 that._removeClass( "ui-resizable-autohide" ); 10952 that._handles.show(); 10953 } ) 10954 .on( "mouseleave", function() { 10955 if ( o.disabled ) { 10956 return; 10957 } 10958 if ( !that.resizing ) { 10959 that._addClass( "ui-resizable-autohide" ); 10960 that._handles.hide(); 10961 } 10962 } ); 10963 } 10964 10965 this._mouseInit(); 10966 }, 10967 10968 _destroy: function() { 10969 10970 this._mouseDestroy(); 10971 10972 var wrapper, 10973 _destroy = function( exp ) { 10974 $( exp ) 10975 .removeData( "resizable" ) 10976 .removeData( "ui-resizable" ) 10977 .off( ".resizable" ) 10978 .find( ".ui-resizable-handle" ) 10979 .remove(); 10980 }; 10981 10982 // TODO: Unwrap at same DOM position 10983 if ( this.elementIsWrapper ) { 10984 _destroy( this.element ); 10985 wrapper = this.element; 10986 this.originalElement.css( { 10987 position: wrapper.css( "position" ), 10988 width: wrapper.outerWidth(), 10989 height: wrapper.outerHeight(), 10990 top: wrapper.css( "top" ), 10991 left: wrapper.css( "left" ) 10992 } ).insertAfter( wrapper ); 10993 wrapper.remove(); 10994 } 10995 10996 this.originalElement.css( "resize", this.originalResizeStyle ); 10997 _destroy( this.originalElement ); 10998 10999 return this; 11000 }, 11001 11002 _setOption: function( key, value ) { 11003 this._super( key, value ); 11004 11005 switch ( key ) { 11006 case "handles": 11007 this._removeHandles(); 11008 this._setupHandles(); 11009 break; 11010 default: 11011 break; 11012 } 11013 }, 11014 11015 _setupHandles: function() { 11016 var o = this.options, handle, i, n, hname, axis, that = this; 11017 this.handles = o.handles || 11018 ( !$( ".ui-resizable-handle", this.element ).length ? 11019 "e,s,se" : { 11020 n: ".ui-resizable-n", 11021 e: ".ui-resizable-e", 11022 s: ".ui-resizable-s", 11023 w: ".ui-resizable-w", 11024 se: ".ui-resizable-se", 11025 sw: ".ui-resizable-sw", 11026 ne: ".ui-resizable-ne", 11027 nw: ".ui-resizable-nw" 11028 } ); 11029 11030 this._handles = $(); 11031 if ( this.handles.constructor === String ) { 11032 11033 if ( this.handles === "all" ) { 11034 this.handles = "n,e,s,w,se,sw,ne,nw"; 11035 } 11036 11037 n = this.handles.split( "," ); 11038 this.handles = {}; 11039 11040 for ( i = 0; i < n.length; i++ ) { 11041 11042 handle = $.trim( n[ i ] ); 11043 hname = "ui-resizable-" + handle; 11044 axis = $( "<div>" ); 11045 this._addClass( axis, "ui-resizable-handle " + hname ); 11046 11047 axis.css( { zIndex: o.zIndex } ); 11048 11049 this.handles[ handle ] = ".ui-resizable-" + handle; 11050 this.element.append( axis ); 11051 } 11052 11053 } 11054 11055 this._renderAxis = function( target ) { 11056 11057 var i, axis, padPos, padWrapper; 11058 11059 target = target || this.element; 11060 11061 for ( i in this.handles ) { 11062 11063 if ( this.handles[ i ].constructor === String ) { 11064 this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show(); 11065 } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) { 11066 this.handles[ i ] = $( this.handles[ i ] ); 11067 this._on( this.handles[ i ], { "mousedown": that._mouseDown } ); 11068 } 11069 11070 if ( this.elementIsWrapper && 11071 this.originalElement[ 0 ] 11072 .nodeName 11073 .match( /^(textarea|input|select|button)$/i ) ) { 11074 axis = $( this.handles[ i ], this.element ); 11075 11076 padWrapper = /sw|ne|nw|se|n|s/.test( i ) ? 11077 axis.outerHeight() : 11078 axis.outerWidth(); 11079 11080 padPos = [ "padding",
vendor: 4,678 bytes, lines 11081-11261
11081 /ne|nw|n/.test( i ) ? "Top" : 11082 /se|sw|s/.test( i ) ? "Bottom" : 11083 /^e$/.test( i ) ? "Right" : "Left" ].join( "" ); 11084 11085 target.css( padPos, padWrapper ); 11086 11087 this._proportionallyResize(); 11088 } 11089 11090 this._handles = this._handles.add( this.handles[ i ] ); 11091 } 11092 }; 11093 11094 // TODO: make renderAxis a prototype function 11095 this._renderAxis( this.element ); 11096 11097 this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) ); 11098 this._handles.disableSelection(); 11099 11100 this._handles.on( "mouseover", function() { 11101 if ( !that.resizing ) { 11102 if ( this.className ) { 11103 axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i ); 11104 } 11105 that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se"; 11106 } 11107 } ); 11108 11109 if ( o.autoHide ) { 11110 this._handles.hide(); 11111 this._addClass( "ui-resizable-autohide" ); 11112 } 11113 }, 11114 11115 _removeHandles: function() { 11116 this._handles.remove(); 11117 }, 11118 11119 _mouseCapture: function( event ) { 11120 var i, handle, 11121 capture = false; 11122 11123 for ( i in this.handles ) { 11124 handle = $( this.handles[ i ] )[ 0 ]; 11125 if ( handle === event.target || $.contains( handle, event.target ) ) { 11126 capture = true; 11127 } 11128 } 11129 11130 return !this.options.disabled && capture; 11131 }, 11132 11133 _mouseStart: function( event ) { 11134 11135 var curleft, curtop, cursor, 11136 o = this.options, 11137 el = this.element; 11138 11139 this.resizing = true; 11140 11141 this._renderProxy(); 11142 11143 curleft = this._num( this.helper.css( "left" ) ); 11144 curtop = this._num( this.helper.css( "top" ) ); 11145 11146 if ( o.containment ) { 11147 curleft += $( o.containment ).scrollLeft() || 0; 11148 curtop += $( o.containment ).scrollTop() || 0; 11149 } 11150 11151 this.offset = this.helper.offset(); 11152 this.position = { left: curleft, top: curtop }; 11153 11154 this.size = this._helper ? { 11155 width: this.helper.width(), 11156 height: this.helper.height() 11157 } : { 11158 width: el.width(), 11159 height: el.height() 11160 }; 11161 11162 this.originalSize = this._helper ? { 11163 width: el.outerWidth(), 11164 height: el.outerHeight() 11165 } : { 11166 width: el.width(), 11167 height: el.height() 11168 }; 11169 11170 this.sizeDiff = { 11171 width: el.outerWidth() - el.width(), 11172 height: el.outerHeight() - el.height() 11173 }; 11174 11175 this.originalPosition = { left: curleft, top: curtop }; 11176 this.originalMousePosition = { left: event.pageX, top: event.pageY }; 11177 11178 this.aspectRatio = ( typeof o.aspectRatio === "number" ) ? 11179 o.aspectRatio : 11180 ( ( this.originalSize.width / this.originalSize.height ) || 1 ); 11181 11182 cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" ); 11183 $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor ); 11184 11185 this._addClass( "ui-resizable-resizing" ); 11186 this._propagate( "start", event ); 11187 return true; 11188 }, 11189 11190 _mouseDrag: function( event ) { 11191 11192 var data, props, 11193 smp = this.originalMousePosition, 11194 a = this.axis, 11195 dx = ( event.pageX - smp.left ) || 0, 11196 dy = ( event.pageY - smp.top ) || 0, 11197 trigger = this._change[ a ]; 11198 11199 this._updatePrevProperties(); 11200 11201 if ( !trigger ) { 11202 return false; 11203 } 11204 11205 data = trigger.apply( this, [ event, dx, dy ] ); 11206 11207 this._updateVirtualBoundaries( event.shiftKey ); 11208 if ( this._aspectRatio || event.shiftKey ) { 11209 data = this._updateRatio( data, event ); 11210 } 11211 11212 data = this._respectSize( data, event ); 11213 11214 this._updateCache( data ); 11215 11216 this._propagate( "resize", event ); 11217 11218 props = this._applyChanges(); 11219 11220 if ( !this._helper && this._proportionallyResizeElements.length ) { 11221 this._proportionallyResize(); 11222 } 11223 11224 if ( !$.isEmptyObject( props ) ) { 11225 this._updatePrevProperties(); 11226 this._trigger( "resize", event, this.ui() ); 11227 this._applyChanges(); 11228 } 11229 11230 return false; 11231 }, 11232 11233 _mouseStop: function( event ) { 11234 11235 this.resizing = false; 11236 var pr, ista, soffseth, soffsetw, s, left, top, 11237 o = this.options, that = this; 11238 11239 if ( this._helper ) { 11240 11241 pr = this._proportionallyResizeElements; 11242 ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ); 11243 soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height; 11244 soffsetw = ista ? 0 : that.sizeDiff.width; 11245 11246 s = { 11247 width: ( that.helper.width() - soffsetw ), 11248 height: ( that.helper.height() - soffseth ) 11249 }; 11250 left = ( parseFloat( that.element.css( "left" ) ) + 11251 ( that.position.left - that.originalPosition.left ) ) || null; 11252 top = ( parseFloat( that.element.css( "top" ) ) + 11253 ( that.position.top - that.originalPosition.top ) ) || null; 11254 11255 if ( !o.animate ) { 11256 this.element.css( $.extend( s, { top: top, left: left } ) ); 11257 } 11258 11259 that.helper.height( that.size.height ); 11260 that.helper.width( that.size.width ); 11261
vendor: 6,168 bytes, lines 11262-11502
11262 if ( this._helper && !o.animate ) { 11263 this._proportionallyResize(); 11264 } 11265 } 11266 11267 $( "body" ).css( "cursor", "auto" ); 11268 11269 this._removeClass( "ui-resizable-resizing" ); 11270 11271 this._propagate( "stop", event ); 11272 11273 if ( this._helper ) { 11274 this.helper.remove(); 11275 } 11276 11277 return false; 11278 11279 }, 11280 11281 _updatePrevProperties: function() { 11282 this.prevPosition = { 11283 top: this.position.top, 11284 left: this.position.left 11285 }; 11286 this.prevSize = { 11287 width: this.size.width, 11288 height: this.size.height 11289 }; 11290 }, 11291 11292 _applyChanges: function() { 11293 var props = {}; 11294 11295 if ( this.position.top !== this.prevPosition.top ) { 11296 props.top = this.position.top + "px"; 11297 } 11298 if ( this.position.left !== this.prevPosition.left ) { 11299 props.left = this.position.left + "px"; 11300 } 11301 if ( this.size.width !== this.prevSize.width ) { 11302 props.width = this.size.width + "px"; 11303 } 11304 if ( this.size.height !== this.prevSize.height ) { 11305 props.height = this.size.height + "px"; 11306 } 11307 11308 this.helper.css( props ); 11309 11310 return props; 11311 }, 11312 11313 _updateVirtualBoundaries: function( forceAspectRatio ) { 11314 var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, 11315 o = this.options; 11316 11317 b = { 11318 minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0, 11319 maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity, 11320 minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0, 11321 maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity 11322 }; 11323 11324 if ( this._aspectRatio || forceAspectRatio ) { 11325 pMinWidth = b.minHeight * this.aspectRatio; 11326 pMinHeight = b.minWidth / this.aspectRatio; 11327 pMaxWidth = b.maxHeight * this.aspectRatio; 11328 pMaxHeight = b.maxWidth / this.aspectRatio; 11329 11330 if ( pMinWidth > b.minWidth ) { 11331 b.minWidth = pMinWidth; 11332 } 11333 if ( pMinHeight > b.minHeight ) { 11334 b.minHeight = pMinHeight; 11335 } 11336 if ( pMaxWidth < b.maxWidth ) { 11337 b.maxWidth = pMaxWidth; 11338 } 11339 if ( pMaxHeight < b.maxHeight ) { 11340 b.maxHeight = pMaxHeight; 11341 } 11342 } 11343 this._vBoundaries = b; 11344 }, 11345 11346 _updateCache: function( data ) { 11347 this.offset = this.helper.offset(); 11348 if ( this._isNumber( data.left ) ) { 11349 this.position.left = data.left; 11350 } 11351 if ( this._isNumber( data.top ) ) { 11352 this.position.top = data.top; 11353 } 11354 if ( this._isNumber( data.height ) ) { 11355 this.size.height = data.height; 11356 } 11357 if ( this._isNumber( data.width ) ) { 11358 this.size.width = data.width; 11359 } 11360 }, 11361 11362 _updateRatio: function( data ) { 11363 11364 var cpos = this.position, 11365 csize = this.size, 11366 a = this.axis; 11367 11368 if ( this._isNumber( data.height ) ) { 11369 data.width = ( data.height * this.aspectRatio ); 11370 } else if ( this._isNumber( data.width ) ) { 11371 data.height = ( data.width / this.aspectRatio ); 11372 } 11373 11374 if ( a === "sw" ) { 11375 data.left = cpos.left + ( csize.width - data.width ); 11376 data.top = null; 11377 } 11378 if ( a === "nw" ) { 11379 data.top = cpos.top + ( csize.height - data.height ); 11380 data.left = cpos.left + ( csize.width - data.width ); 11381 } 11382 11383 return data; 11384 }, 11385 11386 _respectSize: function( data ) { 11387 11388 var o = this._vBoundaries, 11389 a = this.axis, 11390 ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ), 11391 ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ), 11392 isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ), 11393 isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ), 11394 dw = this.originalPosition.left + this.originalSize.width, 11395 dh = this.originalPosition.top + this.originalSize.height, 11396 cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a ); 11397 if ( isminw ) { 11398 data.width = o.minWidth; 11399 } 11400 if ( isminh ) { 11401 data.height = o.minHeight; 11402 } 11403 if ( ismaxw ) { 11404 data.width = o.maxWidth; 11405 } 11406 if ( ismaxh ) { 11407 data.height = o.maxHeight; 11408 } 11409 11410 if ( isminw && cw ) { 11411 data.left = dw - o.minWidth; 11412 } 11413 if ( ismaxw && cw ) { 11414 data.left = dw - o.maxWidth; 11415 } 11416 if ( isminh && ch ) { 11417 data.top = dh - o.minHeight; 11418 } 11419 if ( ismaxh && ch ) { 11420 data.top = dh - o.maxHeight; 11421 } 11422 11423 // Fixing jump error on top/left - bug #2330 11424 if ( !data.width && !data.height && !data.left && data.top ) { 11425 data.top = null; 11426 } else if ( !data.width && !data.height && !data.top && data.left ) { 11427 data.left = null; 11428 } 11429 11430 return data; 11431 }, 11432 11433 _getPaddingPlusBorderDimensions: function( element ) { 11434 var i = 0, 11435 widths = [], 11436 borders = [ 11437 element.css( "borderTopWidth" ), 11438 element.css( "borderRightWidth" ), 11439 element.css( "borderBottomWidth" ), 11440 element.css( "borderLeftWidth" ) 11441 ], 11442 paddings = [ 11443 element.css( "paddingTop" ), 11444 element.css( "paddingRight" ), 11445 element.css( "paddingBottom" ), 11446 element.css( "paddingLeft" ) 11447 ]; 11448 11449 for ( ; i < 4; i++ ) { 11450 widths[ i ] = ( parseFloat( borders[ i ] ) || 0 ); 11451 widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 ); 11452 } 11453 11454 return { 11455 height: widths[ 0 ] + widths[ 2 ], 11456 width: widths[ 1 ] + widths[ 3 ] 11457 }; 11458 }, 11459 11460 _proportionallyResize: function() { 11461 11462 if ( !this._proportionallyResizeElements.length ) { 11463 return; 11464 } 11465 11466 var prel, 11467 i = 0, 11468 element = this.helper || this.element; 11469 11470 for ( ; i < this._proportionallyResizeElements.length; i++ ) { 11471 11472 prel = this._proportionallyResizeElements[ i ]; 11473 11474 // TODO: Seems like a bug to cache this.outerDimensions 11475 // considering that we are in a loop. 11476 if ( !this.outerDimensions ) { 11477 this.outerDimensions = this._getPaddingPlusBorderDimensions( prel ); 11478 } 11479 11480 prel.css( { 11481 height: ( element.height() - this.outerDimensions.height ) || 0, 11482 width: ( element.width() - this.outerDimensions.width ) || 0 11483 } ); 11484 11485 } 11486 11487 }, 11488 11489 _renderProxy: function() { 11490 11491 var el = this.element, o = this.options; 11492 this.elementOffset = el.offset(); 11493 11494 if ( this._helper ) { 11495 11496 this.helper = this.helper || $( "<div style='overflow:hidden;'></div>" ); 11497 11498 this._addClass( this.helper, this._helper ); 11499 this.helper.css( { 11500 width: this.element.outerWidth(), 11501 height: this.element.outerHeight(), 11502 position: "absolute",
vendor: 1,421 bytes, lines 11503-11550
11503 left: this.elementOffset.left + "px", 11504 top: this.elementOffset.top + "px", 11505 zIndex: ++o.zIndex //TODO: Don't modify option 11506 } ); 11507 11508 this.helper 11509 .appendTo( "body" ) 11510 .disableSelection(); 11511 11512 } else { 11513 this.helper = this.element; 11514 } 11515 11516 }, 11517 11518 _change: { 11519 e: function( event, dx ) { 11520 return { width: this.originalSize.width + dx }; 11521 }, 11522 w: function( event, dx ) { 11523 var cs = this.originalSize, sp = this.originalPosition; 11524 return { left: sp.left + dx, width: cs.width - dx }; 11525 }, 11526 n: function( event, dx, dy ) { 11527 var cs = this.originalSize, sp = this.originalPosition; 11528 return { top: sp.top + dy, height: cs.height - dy }; 11529 }, 11530 s: function( event, dx, dy ) { 11531 return { height: this.originalSize.height + dy }; 11532 }, 11533 se: function( event, dx, dy ) { 11534 return $.extend( this._change.s.apply( this, arguments ), 11535 this._change.e.apply( this, [ event, dx, dy ] ) ); 11536 }, 11537 sw: function( event, dx, dy ) { 11538 return $.extend( this._change.s.apply( this, arguments ), 11539 this._change.w.apply( this, [ event, dx, dy ] ) ); 11540 }, 11541 ne: function( event, dx, dy ) { 11542 return $.extend( this._change.n.apply( this, arguments ), 11543 this._change.e.apply( this, [ event, dx, dy ] ) ); 11544 }, 11545 nw: function( event, dx, dy ) { 11546 return $.extend( this._change.n.apply( this, arguments ), 11547 this._change.w.apply( this, [ event, dx, dy ] ) ); 11548 } 11549 }, 11550
vendor: 9,740 bytes, lines 11551-11916
11551 _propagate: function( n, event ) { 11552 $.ui.plugin.call( this, n, [ event, this.ui() ] ); 11553 ( n !== "resize" && this._trigger( n, event, this.ui() ) ); 11554 }, 11555 11556 plugins: {}, 11557 11558 ui: function() { 11559 return { 11560 originalElement: this.originalElement, 11561 element: this.element, 11562 helper: this.helper, 11563 position: this.position, 11564 size: this.size, 11565 originalSize: this.originalSize, 11566 originalPosition: this.originalPosition 11567 }; 11568 } 11569 11570} ); 11571 11572/* 11573 * Resizable Extensions 11574 */ 11575 11576$.ui.plugin.add( "resizable", "animate", { 11577 11578 stop: function( event ) { 11579 var that = $( this ).resizable( "instance" ), 11580 o = that.options, 11581 pr = that._proportionallyResizeElements, 11582 ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ), 11583 soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height, 11584 soffsetw = ista ? 0 : that.sizeDiff.width, 11585 style = { 11586 width: ( that.size.width - soffsetw ), 11587 height: ( that.size.height - soffseth ) 11588 }, 11589 left = ( parseFloat( that.element.css( "left" ) ) + 11590 ( that.position.left - that.originalPosition.left ) ) || null, 11591 top = ( parseFloat( that.element.css( "top" ) ) + 11592 ( that.position.top - that.originalPosition.top ) ) || null; 11593 11594 that.element.animate( 11595 $.extend( style, top && left ? { top: top, left: left } : {} ), { 11596 duration: o.animateDuration, 11597 easing: o.animateEasing, 11598 step: function() { 11599 11600 var data = { 11601 width: parseFloat( that.element.css( "width" ) ), 11602 height: parseFloat( that.element.css( "height" ) ), 11603 top: parseFloat( that.element.css( "top" ) ), 11604 left: parseFloat( that.element.css( "left" ) ) 11605 }; 11606 11607 if ( pr && pr.length ) { 11608 $( pr[ 0 ] ).css( { width: data.width, height: data.height } ); 11609 } 11610 11611 // Propagating resize, and updating values for each animation step 11612 that._updateCache( data ); 11613 that._propagate( "resize", event ); 11614 11615 } 11616 } 11617 ); 11618 } 11619 11620} ); 11621 11622$.ui.plugin.add( "resizable", "containment", { 11623 11624 start: function() { 11625 var element, p, co, ch, cw, width, height, 11626 that = $( this ).resizable( "instance" ), 11627 o = that.options, 11628 el = that.element, 11629 oc = o.containment, 11630 ce = ( oc instanceof $ ) ? 11631 oc.get( 0 ) : 11632 ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc; 11633 11634 if ( !ce ) { 11635 return; 11636 } 11637 11638 that.containerElement = $( ce ); 11639 11640 if ( /document/.test( oc ) || oc === document ) { 11641 that.containerOffset = { 11642 left: 0, 11643 top: 0 11644 }; 11645 that.containerPosition = { 11646 left: 0, 11647 top: 0 11648 }; 11649 11650 that.parentData = { 11651 element: $( document ), 11652 left: 0, 11653 top: 0, 11654 width: $( document ).width(), 11655 height: $( document ).height() || document.body.parentNode.scrollHeight 11656 }; 11657 } else { 11658 element = $( ce ); 11659 p = []; 11660 $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) { 11661 p[ i ] = that._num( element.css( "padding" + name ) ); 11662 } ); 11663 11664 that.containerOffset = element.offset(); 11665 that.containerPosition = element.position(); 11666 that.containerSize = { 11667 height: ( element.innerHeight() - p[ 3 ] ), 11668 width: ( element.innerWidth() - p[ 1 ] ) 11669 }; 11670 11671 co = that.containerOffset; 11672 ch = that.containerSize.height; 11673 cw = that.containerSize.width; 11674 width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw ); 11675 height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ; 11676 11677 that.parentData = { 11678 element: ce, 11679 left: co.left, 11680 top: co.top, 11681 width: width, 11682 height: height 11683 }; 11684 } 11685 }, 11686 11687 resize: function( event ) { 11688 var woset, hoset, isParent, isOffsetRelative, 11689 that = $( this ).resizable( "instance" ), 11690 o = that.options, 11691 co = that.containerOffset, 11692 cp = that.position, 11693 pRatio = that._aspectRatio || event.shiftKey, 11694 cop = { 11695 top: 0, 11696 left: 0 11697 }, 11698 ce = that.containerElement, 11699 continueResize = true; 11700 11701 if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { 11702 cop = co; 11703 } 11704 11705 if ( cp.left < ( that._helper ? co.left : 0 ) ) { 11706 that.size.width = that.size.width + 11707 ( that._helper ? 11708 ( that.position.left - co.left ) : 11709 ( that.position.left - cop.left ) ); 11710 11711 if ( pRatio ) { 11712 that.size.height = that.size.width / that.aspectRatio; 11713 continueResize = false; 11714 } 11715 that.position.left = o.helper ? co.left : 0; 11716 } 11717 11718 if ( cp.top < ( that._helper ? co.top : 0 ) ) { 11719 that.size.height = that.size.height + 11720 ( that._helper ? 11721 ( that.position.top - co.top ) : 11722 that.position.top ); 11723 11724 if ( pRatio ) { 11725 that.size.width = that.size.height * that.aspectRatio; 11726 continueResize = false; 11727 } 11728 that.position.top = that._helper ? co.top : 0; 11729 } 11730 11731 isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 ); 11732 isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) ); 11733 11734 if ( isParent && isOffsetRelative ) { 11735 that.offset.left = that.parentData.left + that.position.left; 11736 that.offset.top = that.parentData.top + that.position.top; 11737 } else { 11738 that.offset.left = that.element.offset().left; 11739 that.offset.top = that.element.offset().top; 11740 } 11741 11742 woset = Math.abs( that.sizeDiff.width + 11743 ( that._helper ? 11744 that.offset.left - cop.left : 11745 ( that.offset.left - co.left ) ) ); 11746 11747 hoset = Math.abs( that.sizeDiff.height + 11748 ( that._helper ? 11749 that.offset.top - cop.top : 11750 ( that.offset.top - co.top ) ) ); 11751 11752 if ( woset + that.size.width >= that.parentData.width ) { 11753 that.size.width = that.parentData.width - woset; 11754 if ( pRatio ) { 11755 that.size.height = that.size.width / that.aspectRatio; 11756 continueResize = false; 11757 } 11758 } 11759 11760 if ( hoset + that.size.height >= that.parentData.height ) { 11761 that.size.height = that.parentData.height - hoset; 11762 if ( pRatio ) { 11763 that.size.width = that.size.height * that.aspectRatio; 11764 continueResize = false; 11765 } 11766 } 11767 11768 if ( !continueResize ) { 11769 that.position.left = that.prevPosition.left; 11770 that.position.top = that.prevPosition.top; 11771 that.size.width = that.prevSize.width; 11772 that.size.height = that.prevSize.height; 11773 } 11774 }, 11775 11776 stop: function() { 11777 var that = $( this ).resizable( "instance" ), 11778 o = that.options, 11779 co = that.containerOffset, 11780 cop = that.containerPosition, 11781 ce = that.containerElement, 11782 helper = $( that.helper ), 11783 ho = helper.offset(), 11784 w = helper.outerWidth() - that.sizeDiff.width, 11785 h = helper.outerHeight() - that.sizeDiff.height; 11786 11787 if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) { 11788 $( this ).css( { 11789 left: ho.left - cop.left - co.left, 11790 width: w, 11791 height: h 11792 } ); 11793 } 11794 11795 if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) { 11796 $( this ).css( { 11797 left: ho.left - cop.left - co.left, 11798 width: w, 11799 height: h 11800 } ); 11801 } 11802 } 11803} ); 11804 11805$.ui.plugin.add( "resizable", "alsoResize", { 11806 11807 start: function() { 11808 var that = $( this ).resizable( "instance" ), 11809 o = that.options; 11810 11811 $( o.alsoResize ).each( function() { 11812 var el = $( this ); 11813 el.data( "ui-resizable-alsoresize", { 11814 width: parseFloat( el.width() ), height: parseFloat( el.height() ), 11815 left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) ) 11816 } ); 11817 } ); 11818 }, 11819 11820 resize: function( event, ui ) { 11821 var that = $( this ).resizable( "instance" ), 11822 o = that.options, 11823 os = that.originalSize, 11824 op = that.originalPosition, 11825 delta = { 11826 height: ( that.size.height - os.height ) || 0, 11827 width: ( that.size.width - os.width ) || 0, 11828 top: ( that.position.top - op.top ) || 0, 11829 left: ( that.position.left - op.left ) || 0 11830 }; 11831 11832 $( o.alsoResize ).each( function() { 11833 var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {}, 11834 css = el.parents( ui.originalElement[ 0 ] ).length ? 11835 [ "width", "height" ] : 11836 [ "width", "height", "top", "left" ]; 11837 11838 $.each( css, function( i, prop ) { 11839 var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 ); 11840 if ( sum && sum >= 0 ) { 11841 style[ prop ] = sum || null; 11842 } 11843 } ); 11844 11845 el.css( style ); 11846 } ); 11847 }, 11848 11849 stop: function() { 11850 $( this ).removeData( "ui-resizable-alsoresize" ); 11851 } 11852} ); 11853 11854$.ui.plugin.add( "resizable", "ghost", { 11855 11856 start: function() { 11857 11858 var that = $( this ).resizable( "instance" ), cs = that.size; 11859 11860 that.ghost = that.originalElement.clone(); 11861 that.ghost.css( { 11862 opacity: 0.25, 11863 display: "block", 11864 position: "relative", 11865 height: cs.height, 11866 width: cs.width, 11867 margin: 0, 11868 left: 0, 11869 top: 0 11870 } ); 11871 11872 that._addClass( that.ghost, "ui-resizable-ghost" ); 11873 11874 // DEPRECATED 11875 // TODO: remove after 1.12 11876 if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) { 11877 11878 // Ghost option 11879 that.ghost.addClass( this.options.ghost ); 11880 } 11881 11882 that.ghost.appendTo( that.helper ); 11883 11884 }, 11885 11886 resize: function() { 11887 var that = $( this ).resizable( "instance" ); 11888 if ( that.ghost ) { 11889 that.ghost.css( { 11890 position: "relative", 11891 height: that.size.height, 11892 width: that.size.width 11893 } ); 11894 } 11895 }, 11896 11897 stop: function() { 11898 var that = $( this ).resizable( "instance" ); 11899 if ( that.ghost && that.helper ) { 11900 that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) ); 11901 } 11902 } 11903 11904} ); 11905 11906$.ui.plugin.add( "resizable", "grid", { 11907 11908 resize: function() { 11909 var outerDimensions, 11910 that = $( this ).resizable( "instance" ), 11911 o = that.options, 11912 cs = that.size, 11913 os = that.originalSize, 11914 op = that.originalPosition, 11915 a = that.axis, 11916 grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
vendor: 4,400 bytes, lines 11917-12097
11917 gridX = ( grid[ 0 ] || 1 ), 11918 gridY = ( grid[ 1 ] || 1 ), 11919 ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX, 11920 oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY, 11921 newWidth = os.width + ox, 11922 newHeight = os.height + oy, 11923 isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ), 11924 isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ), 11925 isMinWidth = o.minWidth && ( o.minWidth > newWidth ), 11926 isMinHeight = o.minHeight && ( o.minHeight > newHeight ); 11927 11928 o.grid = grid; 11929 11930 if ( isMinWidth ) { 11931 newWidth += gridX; 11932 } 11933 if ( isMinHeight ) { 11934 newHeight += gridY; 11935 } 11936 if ( isMaxWidth ) { 11937 newWidth -= gridX; 11938 } 11939 if ( isMaxHeight ) { 11940 newHeight -= gridY; 11941 } 11942 11943 if ( /^(se|s|e)$/.test( a ) ) { 11944 that.size.width = newWidth; 11945 that.size.height = newHeight; 11946 } else if ( /^(ne)$/.test( a ) ) { 11947 that.size.width = newWidth; 11948 that.size.height = newHeight; 11949 that.position.top = op.top - oy; 11950 } else if ( /^(sw)$/.test( a ) ) { 11951 that.size.width = newWidth; 11952 that.size.height = newHeight; 11953 that.position.left = op.left - ox; 11954 } else { 11955 if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) { 11956 outerDimensions = that._getPaddingPlusBorderDimensions( this ); 11957 } 11958 11959 if ( newHeight - gridY > 0 ) { 11960 that.size.height = newHeight; 11961 that.position.top = op.top - oy; 11962 } else { 11963 newHeight = gridY - outerDimensions.height; 11964 that.size.height = newHeight; 11965 that.position.top = op.top + os.height - newHeight; 11966 } 11967 if ( newWidth - gridX > 0 ) { 11968 that.size.width = newWidth; 11969 that.position.left = op.left - ox; 11970 } else { 11971 newWidth = gridX - outerDimensions.width; 11972 that.size.width = newWidth; 11973 that.position.left = op.left + os.width - newWidth; 11974 } 11975 } 11976 } 11977 11978} ); 11979 11980var widgetsResizable = $.ui.resizable; 11981 11982 11983/*! 11984 * jQuery UI Dialog 1.12.0 11985 * http://jqueryui.com 11986 * 11987 * Copyright jQuery Foundation and other contributors 11988 * Released under the MIT license. 11989 * http://jquery.org/license 11990 */ 11991 11992//>>label: Dialog 11993//>>group: Widgets 11994//>>description: Displays customizable dialog windows. 11995//>>docs: http://api.jqueryui.com/dialog/ 11996//>>demos: http://jqueryui.com/dialog/ 11997//>>css.structure: ../../themes/base/core.css 11998//>>css.structure: ../../themes/base/dialog.css 11999//>>css.theme: ../../themes/base/theme.css 12000 12001 12002 12003$.widget( "ui.dialog", { 12004 version: "1.12.0", 12005 options: { 12006 appendTo: "body", 12007 autoOpen: true, 12008 buttons: [], 12009 classes: { 12010 "ui-dialog": "ui-corner-all", 12011 "ui-dialog-titlebar": "ui-corner-all" 12012 }, 12013 closeOnEscape: true, 12014 closeText: "Close", 12015 draggable: true, 12016 hide: null, 12017 height: "auto", 12018 maxHeight: null, 12019 maxWidth: null, 12020 minHeight: 150, 12021 minWidth: 150, 12022 modal: false, 12023 position: { 12024 my: "center", 12025 at: "center", 12026 of: window, 12027 collision: "fit", 12028 12029 // Ensure the titlebar is always visible 12030 using: function( pos ) { 12031 var topOffset = $( this ).css( pos ).offset().top; 12032 if ( topOffset < 0 ) { 12033 $( this ).css( "top", pos.top - topOffset ); 12034 } 12035 } 12036 }, 12037 resizable: true, 12038 show: null, 12039 title: null, 12040 width: 300, 12041 12042 // Callbacks 12043 beforeClose: null, 12044 close: null, 12045 drag: null, 12046 dragStart: null, 12047 dragStop: null, 12048 focus: null, 12049 open: null, 12050 resize: null, 12051 resizeStart: null, 12052 resizeStop: null 12053 }, 12054 12055 sizeRelatedOptions: { 12056 buttons: true, 12057 height: true, 12058 maxHeight: true, 12059 maxWidth: true, 12060 minHeight: true, 12061 minWidth: true, 12062 width: true 12063 }, 12064 12065 resizableRelatedOptions: { 12066 maxHeight: true, 12067 maxWidth: true, 12068 minHeight: true, 12069 minWidth: true 12070 }, 12071 12072 _create: function() { 12073 this.originalCss = { 12074 display: this.element[ 0 ].style.display, 12075 width: this.element[ 0 ].style.width, 12076 minHeight: this.element[ 0 ].style.minHeight, 12077 maxHeight: this.element[ 0 ].style.maxHeight, 12078 height: this.element[ 0 ].style.height 12079 }; 12080 this.originalPosition = { 12081 parent: this.element.parent(), 12082 index: this.element.parent().children().index( this.element ) 12083 }; 12084 this.originalTitle = this.element.attr( "title" ); 12085 if ( this.options.title == null && this.originalTitle != null ) { 12086 this.options.title = this.originalTitle; 12087 } 12088 12089 // Dialogs can't be disabled 12090 if ( this.options.disabled ) { 12091 this.options.disabled = false; 12092 } 12093 12094 this._createWrapper(); 12095 12096 this.element 12097 .show()
vendor: 34,007 bytes, lines 12098-13371
12098 .removeAttr( "title" ) 12099 .appendTo( this.uiDialog ); 12100 12101 this._addClass( "ui-dialog-content", "ui-widget-content" ); 12102 12103 this._createTitlebar(); 12104 this._createButtonPane(); 12105 12106 if ( this.options.draggable && $.fn.draggable ) { 12107 this._makeDraggable(); 12108 } 12109 if ( this.options.resizable && $.fn.resizable ) { 12110 this._makeResizable(); 12111 } 12112 12113 this._isOpen = false; 12114 12115 this._trackFocus(); 12116 }, 12117 12118 _init: function() { 12119 if ( this.options.autoOpen ) { 12120 this.open(); 12121 } 12122 }, 12123 12124 _appendTo: function() { 12125 var element = this.options.appendTo; 12126 if ( element && ( element.jquery || element.nodeType ) ) { 12127 return $( element ); 12128 } 12129 return this.document.find( element || "body" ).eq( 0 ); 12130 }, 12131 12132 _destroy: function() { 12133 var next, 12134 originalPosition = this.originalPosition; 12135 12136 this._untrackInstance(); 12137 this._destroyOverlay(); 12138 12139 this.element 12140 .removeUniqueId() 12141 .css( this.originalCss ) 12142 12143 // Without detaching first, the following becomes really slow 12144 .detach(); 12145 12146 this.uiDialog.remove(); 12147 12148 if ( this.originalTitle ) { 12149 this.element.attr( "title", this.originalTitle ); 12150 } 12151 12152 next = originalPosition.parent.children().eq( originalPosition.index ); 12153 12154 // Don't try to place the dialog next to itself (#8613) 12155 if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { 12156 next.before( this.element ); 12157 } else { 12158 originalPosition.parent.append( this.element ); 12159 } 12160 }, 12161 12162 widget: function() { 12163 return this.uiDialog; 12164 }, 12165 12166 disable: $.noop, 12167 enable: $.noop, 12168 12169 close: function( event ) { 12170 var that = this; 12171 12172 if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) { 12173 return; 12174 } 12175 12176 this._isOpen = false; 12177 this._focusedElement = null; 12178 this._destroyOverlay(); 12179 this._untrackInstance(); 12180 12181 if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) { 12182 12183 // Hiding a focused element doesn't trigger blur in WebKit 12184 // so in case we have nothing to focus on, explicitly blur the active element 12185 // https://bugs.webkit.org/show_bug.cgi?id=47182 12186 $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); 12187 } 12188 12189 this._hide( this.uiDialog, this.options.hide, function() { 12190 that._trigger( "close", event ); 12191 } ); 12192 }, 12193 12194 isOpen: function() { 12195 return this._isOpen; 12196 }, 12197 12198 moveToTop: function() { 12199 this._moveToTop(); 12200 }, 12201 12202 _moveToTop: function( event, silent ) { 12203 var moved = false, 12204 zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() { 12205 return +$( this ).css( "z-index" ); 12206 } ).get(), 12207 zIndexMax = Math.max.apply( null, zIndices ); 12208 12209 if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) { 12210 this.uiDialog.css( "z-index", zIndexMax + 1 ); 12211 moved = true; 12212 } 12213 12214 if ( moved && !silent ) { 12215 this._trigger( "focus", event ); 12216 } 12217 return moved; 12218 }, 12219 12220 open: function() { 12221 var that = this; 12222 if ( this._isOpen ) { 12223 if ( this._moveToTop() ) { 12224 this._focusTabbable(); 12225 } 12226 return; 12227 } 12228 12229 this._isOpen = true; 12230 this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); 12231 12232 this._size(); 12233 this._position(); 12234 this._createOverlay(); 12235 this._moveToTop( null, true ); 12236 12237 // Ensure the overlay is moved to the top with the dialog, but only when 12238 // opening. The overlay shouldn't move after the dialog is open so that 12239 // modeless dialogs opened after the modal dialog stack properly. 12240 if ( this.overlay ) { 12241 this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 ); 12242 } 12243 12244 this._show( this.uiDialog, this.options.show, function() { 12245 that._focusTabbable(); 12246 that._trigger( "focus" ); 12247 } ); 12248 12249 // Track the dialog immediately upon openening in case a focus event 12250 // somehow occurs outside of the dialog before an element inside the 12251 // dialog is focused (#10152) 12252 this._makeFocusTarget(); 12253 12254 this._trigger( "open" ); 12255 }, 12256 12257 _focusTabbable: function() { 12258 12259 // Set focus to the first match: 12260 // 1. An element that was focused previously 12261 // 2. First element inside the dialog matching [autofocus] 12262 // 3. Tabbable element inside the content element 12263 // 4. Tabbable element inside the buttonpane 12264 // 5. The close button 12265 // 6. The dialog itself 12266 var hasFocus = this._focusedElement; 12267 if ( !hasFocus ) { 12268 hasFocus = this.element.find( "[autofocus]" ); 12269 } 12270 if ( !hasFocus.length ) { 12271 hasFocus = this.element.find( ":tabbable" ); 12272 } 12273 if ( !hasFocus.length ) { 12274 hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); 12275 } 12276 if ( !hasFocus.length ) { 12277 hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" ); 12278 } 12279 if ( !hasFocus.length ) { 12280 hasFocus = this.uiDialog; 12281 } 12282 hasFocus.eq( 0 ).trigger( "focus" ); 12283 }, 12284 12285 _keepFocus: function( event ) { 12286 function checkFocus() { 12287 var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), 12288 isActive = this.uiDialog[ 0 ] === activeElement || 12289 $.contains( this.uiDialog[ 0 ], activeElement ); 12290 if ( !isActive ) { 12291 this._focusTabbable(); 12292 } 12293 } 12294 event.preventDefault(); 12295 checkFocus.call( this ); 12296 12297 // support: IE 12298 // IE <= 8 doesn't prevent moving focus even with event.preventDefault() 12299 // so we check again later 12300 this._delay( checkFocus ); 12301 }, 12302 12303 _createWrapper: function() { 12304 this.uiDialog = $( "<div>" ) 12305 .hide() 12306 .attr( { 12307 12308 // Setting tabIndex makes the div focusable 12309 tabIndex: -1, 12310 role: "dialog" 12311 } ) 12312 .appendTo( this._appendTo() ); 12313 12314 this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" ); 12315 this._on( this.uiDialog, { 12316 keydown: function( event ) { 12317 if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && 12318 event.keyCode === $.ui.keyCode.ESCAPE ) { 12319 event.preventDefault(); 12320 this.close( event ); 12321 return; 12322 } 12323 12324 // Prevent tabbing out of dialogs 12325 if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) { 12326 return; 12327 } 12328 var tabbables = this.uiDialog.find( ":tabbable" ), 12329 first = tabbables.filter( ":first" ), 12330 last = tabbables.filter( ":last" ); 12331 12332 if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) && 12333 !event.shiftKey ) { 12334 this._delay( function() { 12335 first.trigger( "focus" ); 12336 } ); 12337 event.preventDefault(); 12338 } else if ( ( event.target === first[ 0 ] || 12339 event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) { 12340 this._delay( function() { 12341 last.trigger( "focus" ); 12342 } ); 12343 event.preventDefault(); 12344 } 12345 }, 12346 mousedown: function( event ) { 12347 if ( this._moveToTop( event ) ) { 12348 this._focusTabbable(); 12349 } 12350 } 12351 } ); 12352 12353 // We assume that any existing aria-describedby attribute means 12354 // that the dialog content is marked up properly 12355 // otherwise we brute force the content as the description 12356 if ( !this.element.find( "[aria-describedby]" ).length ) { 12357 this.uiDialog.attr( { 12358 "aria-describedby": this.element.uniqueId().attr( "id" ) 12359 } ); 12360 } 12361 }, 12362 12363 _createTitlebar: function() { 12364 var uiDialogTitle; 12365 12366 this.uiDialogTitlebar = $( "<div>" ); 12367 this._addClass( this.uiDialogTitlebar, 12368 "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" ); 12369 this._on( this.uiDialogTitlebar, { 12370 mousedown: function( event ) { 12371 12372 // Don't prevent click on close button (#8838) 12373 // Focusing a dialog that is partially scrolled out of view 12374 // causes the browser to scroll it into view, preventing the click event 12375 if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) { 12376 12377 // Dialog isn't getting focus when dragging (#8063) 12378 this.uiDialog.trigger( "focus" ); 12379 } 12380 } 12381 } ); 12382 12383 // Support: IE 12384 // Use type="button" to prevent enter keypresses in textboxes from closing the 12385 // dialog in IE (#9312) 12386 this.uiDialogTitlebarClose = $( "<button type='button'></button>" ) 12387 .button( { 12388 label: $( "<a>" ).text( this.options.closeText ).html(), 12389 icon: "ui-icon-closethick", 12390 showLabel: false 12391 } ) 12392 .appendTo( this.uiDialogTitlebar ); 12393 12394 this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" ); 12395 this._on( this.uiDialogTitlebarClose, { 12396 click: function( event ) { 12397 event.preventDefault(); 12398 this.close( event ); 12399 } 12400 } ); 12401 12402 uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar ); 12403 this._addClass( uiDialogTitle, "ui-dialog-title" ); 12404 this._title( uiDialogTitle ); 12405 12406 this.uiDialogTitlebar.prependTo( this.uiDialog ); 12407 12408 this.uiDialog.attr( { 12409 "aria-labelledby": uiDialogTitle.attr( "id" ) 12410 } ); 12411 }, 12412 12413 _title: function( title ) { 12414 if ( this.options.title ) { 12415 title.text( this.options.title ); 12416 } else { 12417 title.html( " " ); 12418 } 12419 }, 12420 12421 _createButtonPane: function() { 12422 this.uiDialogButtonPane = $( "<div>" ); 12423 this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane", 12424 "ui-widget-content ui-helper-clearfix" ); 12425 12426 this.uiButtonSet = $( "<div>" ) 12427 .appendTo( this.uiDialogButtonPane ); 12428 this._addClass( this.uiButtonSet, "ui-dialog-buttonset" ); 12429 12430 this._createButtons(); 12431 }, 12432 12433 _createButtons: function() { 12434 var that = this, 12435 buttons = this.options.buttons; 12436 12437 // If we already have a button pane, remove it 12438 this.uiDialogButtonPane.remove(); 12439 this.uiButtonSet.empty(); 12440 12441 if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) { 12442 this._removeClass( this.uiDialog, "ui-dialog-buttons" ); 12443 return; 12444 } 12445 12446 $.each( buttons, function( name, props ) { 12447 var click, buttonOptions; 12448 props = $.isFunction( props ) ? 12449 { click: props, text: name } : 12450 props; 12451 12452 // Default to a non-submitting button 12453 props = $.extend( { type: "button" }, props ); 12454 12455 // Change the context for the click callback to be the main element 12456 click = props.click; 12457 buttonOptions = { 12458 icon: props.icon, 12459 iconPosition: props.iconPosition, 12460 showLabel: props.showLabel 12461 }; 12462 12463 delete props.click; 12464 delete props.icon; 12465 delete props.iconPosition; 12466 delete props.showLabel; 12467 12468 $( "<button></button>", props ) 12469 .button( buttonOptions ) 12470 .appendTo( that.uiButtonSet ) 12471 .on( "click", function() { 12472 click.apply( that.element[ 0 ], arguments ); 12473 } ); 12474 } ); 12475 this._addClass( this.uiDialog, "ui-dialog-buttons" ); 12476 this.uiDialogButtonPane.appendTo( this.uiDialog ); 12477 }, 12478 12479 _makeDraggable: function() { 12480 var that = this, 12481 options = this.options; 12482 12483 function filteredUi( ui ) { 12484 return { 12485 position: ui.position, 12486 offset: ui.offset 12487 }; 12488 } 12489 12490 this.uiDialog.draggable( { 12491 cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", 12492 handle: ".ui-dialog-titlebar", 12493 containment: "document", 12494 start: function( event, ui ) { 12495 that._addClass( $( this ), "ui-dialog-dragging" ); 12496 that._blockFrames(); 12497 that._trigger( "dragStart", event, filteredUi( ui ) ); 12498 }, 12499 drag: function( event, ui ) { 12500 that._trigger( "drag", event, filteredUi( ui ) ); 12501 }, 12502 stop: function( event, ui ) { 12503 var left = ui.offset.left - that.document.scrollLeft(), 12504 top = ui.offset.top - that.document.scrollTop(); 12505 12506 options.position = { 12507 my: "left top", 12508 at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + 12509 "top" + ( top >= 0 ? "+" : "" ) + top, 12510 of: that.window 12511 }; 12512 that._removeClass( $( this ), "ui-dialog-dragging" ); 12513 that._unblockFrames(); 12514 that._trigger( "dragStop", event, filteredUi( ui ) ); 12515 } 12516 } ); 12517 }, 12518 12519 _makeResizable: function() { 12520 var that = this, 12521 options = this.options, 12522 handles = options.resizable, 12523 12524 // .ui-resizable has position: relative defined in the stylesheet 12525 // but dialogs have to use absolute or fixed positioning 12526 position = this.uiDialog.css( "position" ), 12527 resizeHandles = typeof handles === "string" ? 12528 handles : 12529 "n,e,s,w,se,sw,ne,nw"; 12530 12531 function filteredUi( ui ) { 12532 return { 12533 originalPosition: ui.originalPosition, 12534 originalSize: ui.originalSize, 12535 position: ui.position, 12536 size: ui.size 12537 }; 12538 } 12539 12540 this.uiDialog.resizable( { 12541 cancel: ".ui-dialog-content", 12542 containment: "document", 12543 alsoResize: this.element, 12544 maxWidth: options.maxWidth, 12545 maxHeight: options.maxHeight, 12546 minWidth: options.minWidth, 12547 minHeight: this._minHeight(), 12548 handles: resizeHandles, 12549 start: function( event, ui ) { 12550 that._addClass( $( this ), "ui-dialog-resizing" ); 12551 that._blockFrames(); 12552 that._trigger( "resizeStart", event, filteredUi( ui ) ); 12553 }, 12554 resize: function( event, ui ) { 12555 that._trigger( "resize", event, filteredUi( ui ) ); 12556 }, 12557 stop: function( event, ui ) { 12558 var offset = that.uiDialog.offset(), 12559 left = offset.left - that.document.scrollLeft(), 12560 top = offset.top - that.document.scrollTop(); 12561 12562 options.height = that.uiDialog.height(); 12563 options.width = that.uiDialog.width(); 12564 options.position = { 12565 my: "left top", 12566 at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + 12567 "top" + ( top >= 0 ? "+" : "" ) + top, 12568 of: that.window 12569 }; 12570 that._removeClass( $( this ), "ui-dialog-resizing" ); 12571 that._unblockFrames(); 12572 that._trigger( "resizeStop", event, filteredUi( ui ) ); 12573 } 12574 } ) 12575 .css( "position", position ); 12576 }, 12577 12578 _trackFocus: function() { 12579 this._on( this.widget(), { 12580 focusin: function( event ) { 12581 this._makeFocusTarget(); 12582 this._focusedElement = $( event.target ); 12583 } 12584 } ); 12585 }, 12586 12587 _makeFocusTarget: function() { 12588 this._untrackInstance(); 12589 this._trackingInstances().unshift( this ); 12590 }, 12591 12592 _untrackInstance: function() { 12593 var instances = this._trackingInstances(), 12594 exists = $.inArray( this, instances ); 12595 if ( exists !== -1 ) { 12596 instances.splice( exists, 1 ); 12597 } 12598 }, 12599 12600 _trackingInstances: function() { 12601 var instances = this.document.data( "ui-dialog-instances" ); 12602 if ( !instances ) { 12603 instances = []; 12604 this.document.data( "ui-dialog-instances", instances ); 12605 } 12606 return instances; 12607 }, 12608 12609 _minHeight: function() { 12610 var options = this.options; 12611 12612 return options.height === "auto" ? 12613 options.minHeight : 12614 Math.min( options.minHeight, options.height ); 12615 }, 12616 12617 _position: function() { 12618 12619 // Need to show the dialog to get the actual offset in the position plugin 12620 var isVisible = this.uiDialog.is( ":visible" ); 12621 if ( !isVisible ) { 12622 this.uiDialog.show(); 12623 } 12624 this.uiDialog.position( this.options.position ); 12625 if ( !isVisible ) { 12626 this.uiDialog.hide(); 12627 } 12628 }, 12629 12630 _setOptions: function( options ) { 12631 var that = this, 12632 resize = false, 12633 resizableOptions = {}; 12634 12635 $.each( options, function( key, value ) { 12636 that._setOption( key, value ); 12637 12638 if ( key in that.sizeRelatedOptions ) { 12639 resize = true; 12640 } 12641 if ( key in that.resizableRelatedOptions ) { 12642 resizableOptions[ key ] = value; 12643 } 12644 } ); 12645 12646 if ( resize ) { 12647 this._size(); 12648 this._position(); 12649 } 12650 if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { 12651 this.uiDialog.resizable( "option", resizableOptions ); 12652 } 12653 }, 12654 12655 _setOption: function( key, value ) { 12656 var isDraggable, isResizable, 12657 uiDialog = this.uiDialog; 12658 12659 if ( key === "disabled" ) { 12660 return; 12661 } 12662 12663 this._super( key, value ); 12664 12665 if ( key === "appendTo" ) { 12666 this.uiDialog.appendTo( this._appendTo() ); 12667 } 12668 12669 if ( key === "buttons" ) { 12670 this._createButtons(); 12671 } 12672 12673 if ( key === "closeText" ) { 12674 this.uiDialogTitlebarClose.button( { 12675 12676 // Ensure that we always pass a string 12677 label: $( "<a>" ).text( "" + this.options.closeText ).html() 12678 } ); 12679 } 12680 12681 if ( key === "draggable" ) { 12682 isDraggable = uiDialog.is( ":data(ui-draggable)" ); 12683 if ( isDraggable && !value ) { 12684 uiDialog.draggable( "destroy" ); 12685 } 12686 12687 if ( !isDraggable && value ) { 12688 this._makeDraggable(); 12689 } 12690 } 12691 12692 if ( key === "position" ) { 12693 this._position(); 12694 } 12695 12696 if ( key === "resizable" ) { 12697 12698 // currently resizable, becoming non-resizable 12699 isResizable = uiDialog.is( ":data(ui-resizable)" ); 12700 if ( isResizable && !value ) { 12701 uiDialog.resizable( "destroy" ); 12702 } 12703 12704 // Currently resizable, changing handles 12705 if ( isResizable && typeof value === "string" ) { 12706 uiDialog.resizable( "option", "handles", value ); 12707 } 12708 12709 // Currently non-resizable, becoming resizable 12710 if ( !isResizable && value !== false ) { 12711 this._makeResizable(); 12712 } 12713 } 12714 12715 if ( key === "title" ) { 12716 this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) ); 12717 } 12718 }, 12719 12720 _size: function() { 12721 12722 // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content 12723 // divs will both have width and height set, so we need to reset them 12724 var nonContentHeight, minContentHeight, maxContentHeight, 12725 options = this.options; 12726 12727 // Reset content sizing 12728 this.element.show().css( { 12729 width: "auto", 12730 minHeight: 0, 12731 maxHeight: "none", 12732 height: 0 12733 } ); 12734 12735 if ( options.minWidth > options.width ) { 12736 options.width = options.minWidth; 12737 } 12738 12739 // Reset wrapper sizing 12740 // determine the height of all the non-content elements 12741 nonContentHeight = this.uiDialog.css( { 12742 height: "auto", 12743 width: options.width 12744 } ) 12745 .outerHeight(); 12746 minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); 12747 maxContentHeight = typeof options.maxHeight === "number" ? 12748 Math.max( 0, options.maxHeight - nonContentHeight ) : 12749 "none"; 12750 12751 if ( options.height === "auto" ) { 12752 this.element.css( { 12753 minHeight: minContentHeight, 12754 maxHeight: maxContentHeight, 12755 height: "auto" 12756 } ); 12757 } else { 12758 this.element.height( Math.max( 0, options.height - nonContentHeight ) ); 12759 } 12760 12761 if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { 12762 this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); 12763 } 12764 }, 12765 12766 _blockFrames: function() { 12767 this.iframeBlocks = this.document.find( "iframe" ).map( function() { 12768 var iframe = $( this ); 12769 12770 return $( "<div>" ) 12771 .css( { 12772 position: "absolute", 12773 width: iframe.outerWidth(), 12774 height: iframe.outerHeight() 12775 } ) 12776 .appendTo( iframe.parent() ) 12777 .offset( iframe.offset() )[ 0 ]; 12778 } ); 12779 }, 12780 12781 _unblockFrames: function() { 12782 if ( this.iframeBlocks ) { 12783 this.iframeBlocks.remove(); 12784 delete this.iframeBlocks; 12785 } 12786 }, 12787 12788 _allowInteraction: function( event ) { 12789 if ( $( event.target ).closest( ".ui-dialog" ).length ) { 12790 return true; 12791 } 12792 12793 // TODO: Remove hack when datepicker implements 12794 // the .ui-front logic (#8989) 12795 return !!$( event.target ).closest( ".ui-datepicker" ).length; 12796 }, 12797 12798 _createOverlay: function() { 12799 if ( !this.options.modal ) { 12800 return; 12801 } 12802 12803 // We use a delay in case the overlay is created from an 12804 // event that we're going to be cancelling (#2804) 12805 var isOpening = true; 12806 this._delay( function() { 12807 isOpening = false; 12808 } ); 12809 12810 if ( !this.document.data( "ui-dialog-overlays" ) ) { 12811 12812 // Prevent use of anchors and inputs 12813 // Using _on() for an event handler shared across many instances is 12814 // safe because the dialogs stack and must be closed in reverse order 12815 this._on( this.document, { 12816 focusin: function( event ) { 12817 if ( isOpening ) { 12818 return; 12819 } 12820 12821 if ( !this._allowInteraction( event ) ) { 12822 event.preventDefault(); 12823 this._trackingInstances()[ 0 ]._focusTabbable(); 12824 } 12825 } 12826 } ); 12827 } 12828 12829 this.overlay = $( "<div>" ) 12830 .appendTo( this._appendTo() ); 12831 12832 this._addClass( this.overlay, null, "ui-widget-overlay ui-front" ); 12833 this._on( this.overlay, { 12834 mousedown: "_keepFocus" 12835 } ); 12836 this.document.data( "ui-dialog-overlays", 12837 ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 ); 12838 }, 12839 12840 _destroyOverlay: function() { 12841 if ( !this.options.modal ) { 12842 return; 12843 } 12844 12845 if ( this.overlay ) { 12846 var overlays = this.document.data( "ui-dialog-overlays" ) - 1; 12847 12848 if ( !overlays ) { 12849 this._off( this.document, "focusin" ); 12850 this.document.removeData( "ui-dialog-overlays" ); 12851 } else { 12852 this.document.data( "ui-dialog-overlays", overlays ); 12853 } 12854 12855 this.overlay.remove(); 12856 this.overlay = null; 12857 } 12858 } 12859} ); 12860 12861// DEPRECATED 12862// TODO: switch return back to widget declaration at top of file when this is removed 12863if ( $.uiBackCompat !== false ) { 12864 12865 // Backcompat for dialogClass option 12866 $.widget( "ui.dialog", $.ui.dialog, { 12867 options: { 12868 dialogClass: "" 12869 }, 12870 _createWrapper: function() { 12871 this._super(); 12872 this.uiDialog.addClass( this.options.dialogClass ); 12873 }, 12874 _setOption: function( key, value ) { 12875 if ( key === "dialogClass" ) { 12876 this.uiDialog 12877 .removeClass( this.options.dialogClass ) 12878 .addClass( value ); 12879 } 12880 this._superApply( arguments ); 12881 } 12882 } ); 12883} 12884 12885var widgetsDialog = $.ui.dialog; 12886 12887 12888/*! 12889 * jQuery UI Droppable 1.12.0 12890 * http://jqueryui.com 12891 * 12892 * Copyright jQuery Foundation and other contributors 12893 * Released under the MIT license. 12894 * http://jquery.org/license 12895 */ 12896 12897//>>label: Droppable 12898//>>group: Interactions 12899//>>description: Enables drop targets for draggable elements. 12900//>>docs: http://api.jqueryui.com/droppable/ 12901//>>demos: http://jqueryui.com/droppable/ 12902 12903 12904 12905$.widget( "ui.droppable", { 12906 version: "1.12.0", 12907 widgetEventPrefix: "drop", 12908 options: { 12909 accept: "*", 12910 addClasses: true, 12911 greedy: false, 12912 scope: "default", 12913 tolerance: "intersect", 12914 12915 // Callbacks 12916 activate: null, 12917 deactivate: null, 12918 drop: null, 12919 out: null, 12920 over: null 12921 }, 12922 _create: function() { 12923 12924 var proportions, 12925 o = this.options, 12926 accept = o.accept; 12927 12928 this.isover = false; 12929 this.isout = true; 12930 12931 this.accept = $.isFunction( accept ) ? accept : function( d ) { 12932 return d.is( accept ); 12933 }; 12934 12935 this.proportions = function( /* valueToWrite */ ) { 12936 if ( arguments.length ) { 12937 12938 // Store the droppable's proportions 12939 proportions = arguments[ 0 ]; 12940 } else { 12941 12942 // Retrieve or derive the droppable's proportions 12943 return proportions ? 12944 proportions : 12945 proportions = { 12946 width: this.element[ 0 ].offsetWidth, 12947 height: this.element[ 0 ].offsetHeight 12948 }; 12949 } 12950 }; 12951 12952 this._addToManager( o.scope ); 12953 12954 o.addClasses && this._addClass( "ui-droppable" ); 12955 12956 }, 12957 12958 _addToManager: function( scope ) { 12959 12960 // Add the reference and positions to the manager 12961 $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || []; 12962 $.ui.ddmanager.droppables[ scope ].push( this ); 12963 }, 12964 12965 _splice: function( drop ) { 12966 var i = 0; 12967 for ( ; i < drop.length; i++ ) { 12968 if ( drop[ i ] === this ) { 12969 drop.splice( i, 1 ); 12970 } 12971 } 12972 }, 12973 12974 _destroy: function() { 12975 var drop = $.ui.ddmanager.droppables[ this.options.scope ]; 12976 12977 this._splice( drop ); 12978 }, 12979 12980 _setOption: function( key, value ) { 12981 12982 if ( key === "accept" ) { 12983 this.accept = $.isFunction( value ) ? value : function( d ) { 12984 return d.is( value ); 12985 }; 12986 } else if ( key === "scope" ) { 12987 var drop = $.ui.ddmanager.droppables[ this.options.scope ]; 12988 12989 this._splice( drop ); 12990 this._addToManager( value ); 12991 } 12992 12993 this._super( key, value ); 12994 }, 12995 12996 _activate: function( event ) { 12997 var draggable = $.ui.ddmanager.current; 12998 12999 this._addActiveClass(); 13000 if ( draggable ) { 13001 this._trigger( "activate", event, this.ui( draggable ) ); 13002 } 13003 }, 13004 13005 _deactivate: function( event ) { 13006 var draggable = $.ui.ddmanager.current; 13007 13008 this._removeActiveClass(); 13009 if ( draggable ) { 13010 this._trigger( "deactivate", event, this.ui( draggable ) ); 13011 } 13012 }, 13013 13014 _over: function( event ) { 13015 13016 var draggable = $.ui.ddmanager.current; 13017 13018 // Bail if draggable and droppable are same element 13019 if ( !draggable || ( draggable.currentItem || 13020 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13021 return; 13022 } 13023 13024 if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || 13025 draggable.element ) ) ) { 13026 this._addHoverClass(); 13027 this._trigger( "over", event, this.ui( draggable ) ); 13028 } 13029 13030 }, 13031 13032 _out: function( event ) { 13033 13034 var draggable = $.ui.ddmanager.current; 13035 13036 // Bail if draggable and droppable are same element 13037 if ( !draggable || ( draggable.currentItem || 13038 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13039 return; 13040 } 13041 13042 if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || 13043 draggable.element ) ) ) { 13044 this._removeHoverClass(); 13045 this._trigger( "out", event, this.ui( draggable ) ); 13046 } 13047 13048 }, 13049 13050 _drop: function( event, custom ) { 13051 13052 var draggable = custom || $.ui.ddmanager.current, 13053 childrenIntersection = false; 13054 13055 // Bail if draggable and droppable are same element 13056 if ( !draggable || ( draggable.currentItem || 13057 draggable.element )[ 0 ] === this.element[ 0 ] ) { 13058 return false; 13059 } 13060 13061 this.element 13062 .find( ":data(ui-droppable)" ) 13063 .not( ".ui-draggable-dragging" ) 13064 .each( function() { 13065 var inst = $( this ).droppable( "instance" ); 13066 if ( 13067 inst.options.greedy && 13068 !inst.options.disabled && 13069 inst.options.scope === draggable.options.scope && 13070 inst.accept.call( 13071 inst.element[ 0 ], ( draggable.currentItem || draggable.element ) 13072 ) && 13073 intersect( 13074 draggable, 13075 $.extend( inst, { offset: inst.element.offset() } ), 13076 inst.options.tolerance, event 13077 ) 13078 ) { 13079 childrenIntersection = true; 13080 return false; } 13081 } ); 13082 if ( childrenIntersection ) { 13083 return false; 13084 } 13085 13086 if ( this.accept.call( this.element[ 0 ], 13087 ( draggable.currentItem || draggable.element ) ) ) { 13088 this._removeActiveClass(); 13089 this._removeHoverClass(); 13090 13091 this._trigger( "drop", event, this.ui( draggable ) ); 13092 return this.element; 13093 } 13094 13095 return false; 13096 13097 }, 13098 13099 ui: function( c ) { 13100 return { 13101 draggable: ( c.currentItem || c.element ), 13102 helper: c.helper, 13103 position: c.position, 13104 offset: c.positionAbs 13105 }; 13106 }, 13107 13108 // Extension points just to make backcompat sane and avoid duplicating logic 13109 // TODO: Remove in 1.13 along with call to it below 13110 _addHoverClass: function() { 13111 this._addClass( "ui-droppable-hover" ); 13112 }, 13113 13114 _removeHoverClass: function() { 13115 this._removeClass( "ui-droppable-hover" ); 13116 }, 13117 13118 _addActiveClass: function() { 13119 this._addClass( "ui-droppable-active" ); 13120 }, 13121 13122 _removeActiveClass: function() { 13123 this._removeClass( "ui-droppable-active" ); 13124 } 13125} ); 13126 13127var intersect = $.ui.intersect = ( function() { 13128 function isOverAxis( x, reference, size ) { 13129 return ( x >= reference ) && ( x < ( reference + size ) ); 13130 } 13131 13132 return function( draggable, droppable, toleranceMode, event ) { 13133 13134 if ( !droppable.offset ) { 13135 return false; 13136 } 13137 13138 var x1 = ( draggable.positionAbs || 13139 draggable.position.absolute ).left + draggable.margins.left, 13140 y1 = ( draggable.positionAbs || 13141 draggable.position.absolute ).top + draggable.margins.top, 13142 x2 = x1 + draggable.helperProportions.width, 13143 y2 = y1 + draggable.helperProportions.height, 13144 l = droppable.offset.left, 13145 t = droppable.offset.top, 13146 r = l + droppable.proportions().width, 13147 b = t + droppable.proportions().height; 13148 13149 switch ( toleranceMode ) { 13150 case "fit": 13151 return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b ); 13152 case "intersect": 13153 return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half 13154 x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half 13155 t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half 13156 y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half 13157 case "pointer": 13158 return isOverAxis( event.pageY, t, droppable.proportions().height ) && 13159 isOverAxis( event.pageX, l, droppable.proportions().width ); 13160 case "touch": 13161 return ( 13162 ( y1 >= t && y1 <= b ) || // Top edge touching 13163 ( y2 >= t && y2 <= b ) || // Bottom edge touching 13164 ( y1 < t && y2 > b ) // Surrounded vertically 13165 ) && ( 13166 ( x1 >= l && x1 <= r ) || // Left edge touching 13167 ( x2 >= l && x2 <= r ) || // Right edge touching 13168 ( x1 < l && x2 > r ) // Surrounded horizontally 13169 ); 13170 default: 13171 return false; 13172 } 13173 }; 13174} )(); 13175 13176/* 13177 This manager tracks offsets of draggables and droppables 13178*/ 13179$.ui.ddmanager = { 13180 current: null, 13181 droppables: { "default": [] }, 13182 prepareOffsets: function( t, event ) { 13183 13184 var i, j, 13185 m = $.ui.ddmanager.droppables[ t.options.scope ] || [], 13186 type = event ? event.type : null, // workaround for #2317 13187 list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack(); 13188 13189 droppablesLoop: for ( i = 0; i < m.length; i++ ) { 13190 13191 // No disabled and non-accepted 13192 if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], 13193 ( t.currentItem || t.element ) ) ) ) { 13194 continue; 13195 } 13196 13197 // Filter out elements in the current dragged item 13198 for ( j = 0; j < list.length; j++ ) { 13199 if ( list[ j ] === m[ i ].element[ 0 ] ) { 13200 m[ i ].proportions().height = 0; 13201 continue droppablesLoop; 13202 } 13203 } 13204 13205 m[ i ].visible = m[ i ].element.css( "display" ) !== "none"; 13206 if ( !m[ i ].visible ) { 13207 continue; 13208 } 13209 13210 // Activate the droppable if used directly from draggables 13211 if ( type === "mousedown" ) { 13212 m[ i ]._activate.call( m[ i ], event ); 13213 } 13214 13215 m[ i ].offset = m[ i ].element.offset(); 13216 m[ i ].proportions( { 13217 width: m[ i ].element[ 0 ].offsetWidth, 13218 height: m[ i ].element[ 0 ].offsetHeight 13219 } ); 13220 13221 } 13222 13223 }, 13224 drop: function( draggable, event ) { 13225 13226 var dropped = false; 13227 13228 // Create a copy of the droppables in case the list changes during the drop (#9116) 13229 $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() { 13230 13231 if ( !this.options ) { 13232 return; 13233 } 13234 if ( !this.options.disabled && this.visible && 13235 intersect( draggable, this, this.options.tolerance, event ) ) { 13236 dropped = this._drop.call( this, event ) || dropped; 13237 } 13238 13239 if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], 13240 ( draggable.currentItem || draggable.element ) ) ) { 13241 this.isout = true; 13242 this.isover = false; 13243 this._deactivate.call( this, event ); 13244 } 13245 13246 } ); 13247 return dropped; 13248 13249 }, 13250 dragStart: function( draggable, event ) { 13251 13252 // Listen for scrolling so that if the dragging causes scrolling the position of the 13253 // droppables can be recalculated (see #5003) 13254 draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() { 13255 if ( !draggable.options.refreshPositions ) { 13256 $.ui.ddmanager.prepareOffsets( draggable, event ); 13257 } 13258 } ); 13259 }, 13260 drag: function( draggable, event ) { 13261 13262 // If you have a highly dynamic page, you might try this option. It renders positions 13263 // every time you move the mouse. 13264 if ( draggable.options.refreshPositions ) { 13265 $.ui.ddmanager.prepareOffsets( draggable, event ); 13266 } 13267 13268 // Run through all droppables and check their positions based on specific tolerance options 13269 $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { 13270 13271 if ( this.options.disabled || this.greedyChild || !this.visible ) { 13272 return; 13273 } 13274 13275 var parentInstance, scope, parent, 13276 intersects = intersect( draggable, this, this.options.tolerance, event ), 13277 c = !intersects && this.isover ? 13278 "isout" : 13279 ( intersects && !this.isover ? "isover" : null ); 13280 if ( !c ) { 13281 return; 13282 } 13283 13284 if ( this.options.greedy ) { 13285 13286 // find droppable parents with same scope 13287 scope = this.options.scope; 13288 parent = this.element.parents( ":data(ui-droppable)" ).filter( function() { 13289 return $( this ).droppable( "instance" ).options.scope === scope; 13290 } ); 13291 13292 if ( parent.length ) { 13293 parentInstance = $( parent[ 0 ] ).droppable( "instance" ); 13294 parentInstance.greedyChild = ( c === "isover" ); 13295 } 13296 } 13297 13298 // We just moved into a greedy child 13299 if ( parentInstance && c === "isover" ) { 13300 parentInstance.isover = false; 13301 parentInstance.isout = true; 13302 parentInstance._out.call( parentInstance, event ); 13303 } 13304 13305 this[ c ] = true; 13306 this[ c === "isout" ? "isover" : "isout" ] = false; 13307 this[ c === "isover" ? "_over" : "_out" ].call( this, event ); 13308 13309 // We just moved out of a greedy child 13310 if ( parentInstance && c === "isout" ) { 13311 parentInstance.isout = false; 13312 parentInstance.isover = true; 13313 parentInstance._over.call( parentInstance, event ); 13314 } 13315 } ); 13316 13317 }, 13318 dragStop: function( draggable, event ) { 13319 draggable.element.parentsUntil( "body" ).off( "scroll.droppable" ); 13320 13321 // Call prepareOffsets one final time since IE does not fire return scroll events when 13322 // overflow was caused by drag (see #5003) 13323 if ( !draggable.options.refreshPositions ) { 13324 $.ui.ddmanager.prepareOffsets( draggable, event ); 13325 } 13326 } 13327}; 13328 13329// DEPRECATED 13330// TODO: switch return back to widget declaration at top of file when this is removed 13331if ( $.uiBackCompat !== false ) { 13332 13333 // Backcompat for activeClass and hoverClass options 13334 $.widget( "ui.droppable", $.ui.droppable, { 13335 options: { 13336 hoverClass: false, 13337 activeClass: false 13338 }, 13339 _addActiveClass: function() { 13340 this._super(); 13341 if ( this.options.activeClass ) { 13342 this.element.addClass( this.options.activeClass ); 13343 } 13344 }, 13345 _removeActiveClass: function() { 13346 this._super(); 13347 if ( this.options.activeClass ) { 13348 this.element.removeClass( this.options.activeClass ); 13349 } 13350 }, 13351 _addHoverClass: function() { 13352 this._super(); 13353 if ( this.options.hoverClass ) { 13354 this.element.addClass( this.options.hoverClass ); 13355 } 13356 }, 13357 _removeHoverClass: function() { 13358 this._super(); 13359 if ( this.options.hoverClass ) { 13360 this.element.removeClass( this.options.hoverClass ); 13361 } 13362 } 13363 } ); 13364} 13365 13366var widgetsDroppable = $.ui.droppable; 13367 13368 13369/*! 13370 * jQuery UI Progressbar 1.12.0 13371 * http://jqueryui.com
vendor: 12,231 bytes, lines 13372-13830
13372 * 13373 * Copyright jQuery Foundation and other contributors 13374 * Released under the MIT license. 13375 * http://jquery.org/license 13376 */ 13377 13378//>>label: Progressbar 13379//>>group: Widgets 13380// jscs:disable maximumLineLength 13381//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators. 13382// jscs:enable maximumLineLength 13383//>>docs: http://api.jqueryui.com/progressbar/ 13384//>>demos: http://jqueryui.com/progressbar/ 13385//>>css.structure: ../../themes/base/core.css 13386//>>css.structure: ../../themes/base/progressbar.css 13387//>>css.theme: ../../themes/base/theme.css 13388 13389 13390 13391var widgetsProgressbar = $.widget( "ui.progressbar", { 13392 version: "1.12.0", 13393 options: { 13394 classes: { 13395 "ui-progressbar": "ui-corner-all", 13396 "ui-progressbar-value": "ui-corner-left", 13397 "ui-progressbar-complete": "ui-corner-right" 13398 }, 13399 max: 100, 13400 value: 0, 13401 13402 change: null, 13403 complete: null 13404 }, 13405 13406 min: 0, 13407 13408 _create: function() { 13409 13410 // Constrain initial value 13411 this.oldValue = this.options.value = this._constrainedValue(); 13412 13413 this.element.attr( { 13414 13415 // Only set static values; aria-valuenow and aria-valuemax are 13416 // set inside _refreshValue() 13417 role: "progressbar", 13418 "aria-valuemin": this.min 13419 } ); 13420 this._addClass( "ui-progressbar", "ui-widget ui-widget-content" ); 13421 13422 this.valueDiv = $( "<div>" ).appendTo( this.element ); 13423 this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" ); 13424 this._refreshValue(); 13425 }, 13426 13427 _destroy: function() { 13428 this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" ); 13429 13430 this.valueDiv.remove(); 13431 }, 13432 13433 value: function( newValue ) { 13434 if ( newValue === undefined ) { 13435 return this.options.value; 13436 } 13437 13438 this.options.value = this._constrainedValue( newValue ); 13439 this._refreshValue(); 13440 }, 13441 13442 _constrainedValue: function( newValue ) { 13443 if ( newValue === undefined ) { 13444 newValue = this.options.value; 13445 } 13446 13447 this.indeterminate = newValue === false; 13448 13449 // Sanitize value 13450 if ( typeof newValue !== "number" ) { 13451 newValue = 0; 13452 } 13453 13454 return this.indeterminate ? false : 13455 Math.min( this.options.max, Math.max( this.min, newValue ) ); 13456 }, 13457 13458 _setOptions: function( options ) { 13459 13460 // Ensure "value" option is set after other values (like max) 13461 var value = options.value; 13462 delete options.value; 13463 13464 this._super( options ); 13465 13466 this.options.value = this._constrainedValue( value ); 13467 this._refreshValue(); 13468 }, 13469 13470 _setOption: function( key, value ) { 13471 if ( key === "max" ) { 13472 13473 // Don't allow a max less than min 13474 value = Math.max( this.min, value ); 13475 } 13476 this._super( key, value ); 13477 }, 13478 13479 _setOptionDisabled: function( value ) { 13480 this._super( value ); 13481 13482 this.element.attr( "aria-disabled", value ); 13483 this._toggleClass( null, "ui-state-disabled", !!value ); 13484 }, 13485 13486 _percentage: function() { 13487 return this.indeterminate ? 13488 100 : 13489 100 * ( this.options.value - this.min ) / ( this.options.max - this.min ); 13490 }, 13491 13492 _refreshValue: function() { 13493 var value = this.options.value, 13494 percentage = this._percentage(); 13495 13496 this.valueDiv 13497 .toggle( this.indeterminate || value > this.min ) 13498 .width( percentage.toFixed( 0 ) + "%" ); 13499 13500 this 13501 ._toggleClass( this.valueDiv, "ui-progressbar-complete", null, 13502 value === this.options.max ) 13503 ._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate ); 13504 13505 if ( this.indeterminate ) { 13506 this.element.removeAttr( "aria-valuenow" ); 13507 if ( !this.overlayDiv ) { 13508 this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv ); 13509 this._addClass( this.overlayDiv, "ui-progressbar-overlay" ); 13510 } 13511 } else { 13512 this.element.attr( { 13513 "aria-valuemax": this.options.max, 13514 "aria-valuenow": value 13515 } ); 13516 if ( this.overlayDiv ) { 13517 this.overlayDiv.remove(); 13518 this.overlayDiv = null; 13519 } 13520 } 13521 13522 if ( this.oldValue !== value ) { 13523 this.oldValue = value; 13524 this._trigger( "change" ); 13525 } 13526 if ( value === this.options.max ) { 13527 this._trigger( "complete" ); 13528 } 13529 } 13530} ); 13531 13532 13533/*! 13534 * jQuery UI Selectable 1.12.0 13535 * http://jqueryui.com 13536 * 13537 * Copyright jQuery Foundation and other contributors 13538 * Released under the MIT license. 13539 * http://jquery.org/license 13540 */ 13541 13542//>>label: Selectable 13543//>>group: Interactions 13544//>>description: Allows groups of elements to be selected with the mouse. 13545//>>docs: http://api.jqueryui.com/selectable/ 13546//>>demos: http://jqueryui.com/selectable/ 13547//>>css.structure: ../../themes/base/selectable.css 13548 13549 13550 13551var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, { 13552 version: "1.12.0", 13553 options: { 13554 appendTo: "body", 13555 autoRefresh: true, 13556 distance: 0, 13557 filter: "*", 13558 tolerance: "touch", 13559 13560 // Callbacks 13561 selected: null, 13562 selecting: null, 13563 start: null, 13564 stop: null, 13565 unselected: null, 13566 unselecting: null 13567 }, 13568 _create: function() { 13569 var that = this; 13570 13571 this._addClass( "ui-selectable" ); 13572 13573 this.dragged = false; 13574 13575 // Cache selectee children based on filter 13576 this.refresh = function() { 13577 that.elementPos = $( that.element[ 0 ] ).offset(); 13578 that.selectees = $( that.options.filter, that.element[ 0 ] ); 13579 that._addClass( that.selectees, "ui-selectee" ); 13580 that.selectees.each( function() { 13581 var $this = $( this ), 13582 selecteeOffset = $this.offset(), 13583 pos = { 13584 left: selecteeOffset.left - that.elementPos.left, 13585 top: selecteeOffset.top - that.elementPos.top 13586 }; 13587 $.data( this, "selectable-item", { 13588 element: this, 13589 $element: $this, 13590 left: pos.left, 13591 top: pos.top, 13592 right: pos.left + $this.outerWidth(), 13593 bottom: pos.top + $this.outerHeight(), 13594 startselected: false, 13595 selected: $this.hasClass( "ui-selected" ), 13596 selecting: $this.hasClass( "ui-selecting" ), 13597 unselecting: $this.hasClass( "ui-unselecting" ) 13598 } ); 13599 } ); 13600 }; 13601 this.refresh(); 13602 13603 this._mouseInit(); 13604 13605 this.helper = $( "<div>" ); 13606 this._addClass( this.helper, "ui-selectable-helper" ); 13607 }, 13608 13609 _destroy: function() { 13610 this.selectees.removeData( "selectable-item" ); 13611 this._mouseDestroy(); 13612 }, 13613 13614 _mouseStart: function( event ) { 13615 var that = this, 13616 options = this.options; 13617 13618 this.opos = [ event.pageX, event.pageY ]; 13619 this.elementPos = $( this.element[ 0 ] ).offset(); 13620 13621 if ( this.options.disabled ) { 13622 return; 13623 } 13624 13625 this.selectees = $( options.filter, this.element[ 0 ] ); 13626 13627 this._trigger( "start", event ); 13628 13629 $( options.appendTo ).append( this.helper ); 13630 13631 // position helper (lasso) 13632 this.helper.css( { 13633 "left": event.pageX, 13634 "top": event.pageY, 13635 "width": 0, 13636 "height": 0 13637 } ); 13638 13639 if ( options.autoRefresh ) { 13640 this.refresh(); 13641 } 13642 13643 this.selectees.filter( ".ui-selected" ).each( function() { 13644 var selectee = $.data( this, "selectable-item" ); 13645 selectee.startselected = true; 13646 if ( !event.metaKey && !event.ctrlKey ) { 13647 that._removeClass( selectee.$element, "ui-selected" ); 13648 selectee.selected = false; 13649 that._addClass( selectee.$element, "ui-unselecting" ); 13650 selectee.unselecting = true; 13651 13652 // selectable UNSELECTING callback 13653 that._trigger( "unselecting", event, { 13654 unselecting: selectee.element 13655 } ); 13656 } 13657 } ); 13658 13659 $( event.target ).parents().addBack().each( function() { 13660 var doSelect, 13661 selectee = $.data( this, "selectable-item" ); 13662 if ( selectee ) { 13663 doSelect = ( !event.metaKey && !event.ctrlKey ) || 13664 !selectee.$element.hasClass( "ui-selected" ); 13665 that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" ) 13666 ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" ); 13667 selectee.unselecting = !doSelect; 13668 selectee.selecting = doSelect; 13669 selectee.selected = doSelect; 13670 13671 // selectable (UN)SELECTING callback 13672 if ( doSelect ) { 13673 that._trigger( "selecting", event, { 13674 selecting: selectee.element 13675 } ); 13676 } else { 13677 that._trigger( "unselecting", event, { 13678 unselecting: selectee.element 13679 } ); 13680 } 13681 return false; 13682 } 13683 } ); 13684 13685 }, 13686 13687 _mouseDrag: function( event ) { 13688 13689 this.dragged = true; 13690 13691 if ( this.options.disabled ) { 13692 return; 13693 } 13694 13695 var tmp, 13696 that = this, 13697 options = this.options, 13698 x1 = this.opos[ 0 ], 13699 y1 = this.opos[ 1 ], 13700 x2 = event.pageX, 13701 y2 = event.pageY; 13702 13703 if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; } 13704 if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; } 13705 this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } ); 13706 13707 this.selectees.each( function() { 13708 var selectee = $.data( this, "selectable-item" ), 13709 hit = false, 13710 offset = {}; 13711 13712 //prevent helper from being selected if appendTo: selectable 13713 if ( !selectee || selectee.element === that.element[ 0 ] ) { 13714 return; 13715 } 13716 13717 offset.left = selectee.left + that.elementPos.left; 13718 offset.right = selectee.right + that.elementPos.left; 13719 offset.top = selectee.top + that.elementPos.top; 13720 offset.bottom = selectee.bottom + that.elementPos.top; 13721 13722 if ( options.tolerance === "touch" ) { 13723 hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 || 13724 offset.bottom < y1 ) ); 13725 } else if ( options.tolerance === "fit" ) { 13726 hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 && 13727 offset.bottom < y2 ); 13728 } 13729 13730 if ( hit ) { 13731 13732 // SELECT 13733 if ( selectee.selected ) { 13734 that._removeClass( selectee.$element, "ui-selected" ); 13735 selectee.selected = false; 13736 } 13737 if ( selectee.unselecting ) { 13738 that._removeClass( selectee.$element, "ui-unselecting" ); 13739 selectee.unselecting = false; 13740 } 13741 if ( !selectee.selecting ) { 13742 that._addClass( selectee.$element, "ui-selecting" ); 13743 selectee.selecting = true; 13744 13745 // selectable SELECTING callback 13746 that._trigger( "selecting", event, { 13747 selecting: selectee.element 13748 } ); 13749 } 13750 } else { 13751 13752 // UNSELECT 13753 if ( selectee.selecting ) { 13754 if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) { 13755 that._removeClass( selectee.$element, "ui-selecting" ); 13756 selectee.selecting = false; 13757 that._addClass( selectee.$element, "ui-selected" ); 13758 selectee.selected = true; 13759 } else { 13760 that._removeClass( selectee.$element, "ui-selecting" ); 13761 selectee.selecting = false; 13762 if ( selectee.startselected ) { 13763 that._addClass( selectee.$element, "ui-unselecting" ); 13764 selectee.unselecting = true; 13765 } 13766 13767 // selectable UNSELECTING callback 13768 that._trigger( "unselecting", event, { 13769 unselecting: selectee.element 13770 } ); 13771 } 13772 } 13773 if ( selectee.selected ) { 13774 if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) { 13775 that._removeClass( selectee.$element, "ui-selected" ); 13776 selectee.selected = false; 13777 13778 that._addClass( selectee.$element, "ui-unselecting" ); 13779 selectee.unselecting = true; 13780 13781 // selectable UNSELECTING callback 13782 that._trigger( "unselecting", event, { 13783 unselecting: selectee.element 13784 } ); 13785 } 13786 } 13787 } 13788 } ); 13789 13790 return false; 13791 }, 13792 13793 _mouseStop: function( event ) { 13794 var that = this; 13795 13796 this.dragged = false; 13797 13798 $( ".ui-unselecting", this.element[ 0 ] ).each( function() { 13799 var selectee = $.data( this, "selectable-item" ); 13800 that._removeClass( selectee.$element, "ui-unselecting" ); 13801 selectee.unselecting = false; 13802 selectee.startselected = false; 13803 that._trigger( "unselected", event, { 13804 unselected: selectee.element 13805 } ); 13806 } ); 13807 $( ".ui-selecting", this.element[ 0 ] ).each( function() { 13808 var selectee = $.data( this, "selectable-item" ); 13809 that._removeClass( selectee.$element, "ui-selecting" ) 13810 ._addClass( selectee.$element, "ui-selected" ); 13811 selectee.selecting = false; 13812 selectee.selected = true; 13813 selectee.startselected = true; 13814 that._trigger( "selected", event, { 13815 selected: selectee.element 13816 } ); 13817 } ); 13818 this._trigger( "stop", event ); 13819 13820 this.helper.remove(); 13821 13822 return false; 13823 } 13824 13825} ); 13826 13827 13828/*! 13829 * jQuery UI Selectmenu 1.12.0 13830 * http://jqueryui.com
vendor: 5,543 bytes, lines 13831-14037
13831 * 13832 * Copyright jQuery Foundation and other contributors 13833 * Released under the MIT license. 13834 * http://jquery.org/license 13835 */ 13836 13837//>>label: Selectmenu 13838//>>group: Widgets 13839// jscs:disable maximumLineLength 13840//>>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. 13841// jscs:enable maximumLineLength 13842//>>docs: http://api.jqueryui.com/selectmenu/ 13843//>>demos: http://jqueryui.com/selectmenu/ 13844//>>css.structure: ../../themes/base/core.css 13845//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css 13846//>>css.theme: ../../themes/base/theme.css 13847 13848 13849 13850var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { 13851 version: "1.12.0", 13852 defaultElement: "<select>", 13853 options: { 13854 appendTo: null, 13855 classes: { 13856 "ui-selectmenu-button-open": "ui-corner-top", 13857 "ui-selectmenu-button-closed": "ui-corner-all" 13858 }, 13859 disabled: null, 13860 icons: { 13861 button: "ui-icon-triangle-1-s" 13862 }, 13863 position: { 13864 my: "left top", 13865 at: "left bottom", 13866 collision: "none" 13867 }, 13868 width: false, 13869 13870 // Callbacks 13871 change: null, 13872 close: null, 13873 focus: null, 13874 open: null, 13875 select: null 13876 }, 13877 13878 _create: function() { 13879 var selectmenuId = this.element.uniqueId().attr( "id" ); 13880 this.ids = { 13881 element: selectmenuId, 13882 button: selectmenuId + "-button", 13883 menu: selectmenuId + "-menu" 13884 }; 13885 13886 this._drawButton(); 13887 this._drawMenu(); 13888 this._bindFormResetHandler(); 13889 13890 this._rendered = false; 13891 this.menuItems = $(); 13892 }, 13893 13894 _drawButton: function() { 13895 var icon, 13896 that = this, 13897 item = this._parseOption( 13898 this.element.find( "option:selected" ), 13899 this.element[ 0 ].selectedIndex 13900 ); 13901 13902 // Associate existing label with the new button 13903 this.labels = this.element.labels().attr( "for", this.ids.button ); 13904 this._on( this.labels, { 13905 click: function( event ) { 13906 this.button.focus(); 13907 event.preventDefault(); 13908 } 13909 } ); 13910 13911 // Hide original select element 13912 this.element.hide(); 13913 13914 // Create button 13915 this.button = $( "<span>", { 13916 tabindex: this.options.disabled ? -1 : 0, 13917 id: this.ids.button, 13918 role: "combobox", 13919 "aria-expanded": "false", 13920 "aria-autocomplete": "list", 13921 "aria-owns": this.ids.menu, 13922 "aria-haspopup": "true", 13923 title: this.element.attr( "title" ) 13924 } ) 13925 .insertAfter( this.element ); 13926 13927 this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed", 13928 "ui-button ui-widget" ); 13929 13930 icon = $( "<span>" ).appendTo( this.button ); 13931 this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button ); 13932 this.buttonItem = this._renderButtonItem( item ) 13933 .appendTo( this.button ); 13934 13935 if ( this.options.width !== false ) { 13936 this._resizeButton(); 13937 } 13938 13939 this._on( this.button, this._buttonEvents ); 13940 this.button.one( "focusin", function() { 13941 13942 // Delay rendering the menu items until the button receives focus. 13943 // The menu may have already been rendered via a programmatic open. 13944 if ( !that._rendered ) { 13945 that._refreshMenu(); 13946 } 13947 } ); 13948 }, 13949 13950 _drawMenu: function() { 13951 var that = this; 13952 13953 // Create menu 13954 this.menu = $( "<ul>", { 13955 "aria-hidden": "true", 13956 "aria-labelledby": this.ids.button, 13957 id: this.ids.menu 13958 } ); 13959 13960 // Wrap menu 13961 this.menuWrap = $( "<div>" ).append( this.menu ); 13962 this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" ); 13963 this.menuWrap.appendTo( this._appendTo() ); 13964 13965 // Initialize menu widget 13966 this.menuInstance = this.menu 13967 .menu( { 13968 classes: { 13969 "ui-menu": "ui-corner-bottom" 13970 }, 13971 role: "listbox", 13972 select: function( event, ui ) { 13973 event.preventDefault(); 13974 13975 // Support: IE8 13976 // If the item was selected via a click, the text selection 13977 // will be destroyed in IE 13978 that._setSelection(); 13979 13980 that._select( ui.item.data( "ui-selectmenu-item" ), event ); 13981 }, 13982 focus: function( event, ui ) { 13983 var item = ui.item.data( "ui-selectmenu-item" ); 13984 13985 // Prevent inital focus from firing and check if its a newly focused item 13986 if ( that.focusIndex != null && item.index !== that.focusIndex ) { 13987 that._trigger( "focus", event, { item: item } ); 13988 if ( !that.isOpen ) { 13989 that._select( item, event ); 13990 } 13991 } 13992 that.focusIndex = item.index; 13993 13994 that.button.attr( "aria-activedescendant", 13995 that.menuItems.eq( item.index ).attr( "id" ) ); 13996 } 13997 } ) 13998 .menu( "instance" ); 13999 14000 // Don't close the menu on mouseleave 14001 this.menuInstance._off( this.menu, "mouseleave" ); 14002 14003 // Cancel the menu's collapseAll on document click 14004 this.menuInstance._closeOnDocumentClick = function() { 14005 return false; 14006 }; 14007 14008 // Selects often contain empty items, but never contain dividers 14009 this.menuInstance._isDivider = function() { 14010 return false; 14011 }; 14012 }, 14013 14014 refresh: function() { 14015 this._refreshMenu(); 14016 this.buttonItem.replaceWith( 14017 this.buttonItem = this._renderButtonItem( 14018 14019 // Fall back to an empty object in case there are no options 14020 this._getSelectedItem().data( "ui-selectmenu-item" ) || {} 14021 ) 14022 ); 14023 if ( this.options.width === null ) { 14024 this._resizeButton(); 14025 } 14026 }, 14027 14028 _refreshMenu: function() { 14029 var item, 14030 options = this.element.find( "option" ); 14031 14032 this.menu.empty(); 14033 14034 this._parseOptions( options ); 14035 this._renderMenu( this.menu, this.items ); 14036 14037 this.menuInstance.refresh();
vendor: 9,769 bytes, lines 14038-14445
14038 this.menuItems = this.menu.find( "li" ) 14039 .not( ".ui-selectmenu-optgroup" ) 14040 .find( ".ui-menu-item-wrapper" ); 14041 14042 this._rendered = true; 14043 14044 if ( !options.length ) { 14045 return; 14046 } 14047 14048 item = this._getSelectedItem(); 14049 14050 // Update the menu to have the correct item focused 14051 this.menuInstance.focus( null, item ); 14052 this._setAria( item.data( "ui-selectmenu-item" ) ); 14053 14054 // Set disabled state 14055 this._setOption( "disabled", this.element.prop( "disabled" ) ); 14056 }, 14057 14058 open: function( event ) { 14059 if ( this.options.disabled ) { 14060 return; 14061 } 14062 14063 // If this is the first time the menu is being opened, render the items 14064 if ( !this._rendered ) { 14065 this._refreshMenu(); 14066 } else { 14067 14068 // Menu clears focus on close, reset focus to selected item 14069 this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" ); 14070 this.menuInstance.focus( null, this._getSelectedItem() ); 14071 } 14072 14073 // If there are no options, don't open the menu 14074 if ( !this.menuItems.length ) { 14075 return; 14076 } 14077 14078 this.isOpen = true; 14079 this._toggleAttr(); 14080 this._resizeMenu(); 14081 this._position(); 14082 14083 this._on( this.document, this._documentClick ); 14084 14085 this._trigger( "open", event ); 14086 }, 14087 14088 _position: function() { 14089 this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) ); 14090 }, 14091 14092 close: function( event ) { 14093 if ( !this.isOpen ) { 14094 return; 14095 } 14096 14097 this.isOpen = false; 14098 this._toggleAttr(); 14099 14100 this.range = null; 14101 this._off( this.document ); 14102 14103 this._trigger( "close", event ); 14104 }, 14105 14106 widget: function() { 14107 return this.button; 14108 }, 14109 14110 menuWidget: function() { 14111 return this.menu; 14112 }, 14113 14114 _renderButtonItem: function( item ) { 14115 var buttonItem = $( "<span>" ); 14116 14117 this._setText( buttonItem, item.label ); 14118 this._addClass( buttonItem, "ui-selectmenu-text" ); 14119 14120 return buttonItem; 14121 }, 14122 14123 _renderMenu: function( ul, items ) { 14124 var that = this, 14125 currentOptgroup = ""; 14126 14127 $.each( items, function( index, item ) { 14128 var li; 14129 14130 if ( item.optgroup !== currentOptgroup ) { 14131 li = $( "<li>", { 14132 text: item.optgroup 14133 } ); 14134 that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" + 14135 ( item.element.parent( "optgroup" ).prop( "disabled" ) ? 14136 " ui-state-disabled" : 14137 "" ) ); 14138 14139 li.appendTo( ul ); 14140 14141 currentOptgroup = item.optgroup; 14142 } 14143 14144 that._renderItemData( ul, item ); 14145 } ); 14146 }, 14147 14148 _renderItemData: function( ul, item ) { 14149 return this._renderItem( ul, item ).data( "ui-selectmenu-item", item ); 14150 }, 14151 14152 _renderItem: function( ul, item ) { 14153 var li = $( "<li>" ), 14154 wrapper = $( "<div>", { 14155 title: item.element.attr( "title" ) 14156 } ); 14157 14158 if ( item.disabled ) { 14159 this._addClass( li, null, "ui-state-disabled" ); 14160 } 14161 this._setText( wrapper, item.label ); 14162 14163 return li.append( wrapper ).appendTo( ul ); 14164 }, 14165 14166 _setText: function( element, value ) { 14167 if ( value ) { 14168 element.text( value ); 14169 } else { 14170 element.html( " " ); 14171 } 14172 }, 14173 14174 _move: function( direction, event ) { 14175 var item, next, 14176 filter = ".ui-menu-item"; 14177 14178 if ( this.isOpen ) { 14179 item = this.menuItems.eq( this.focusIndex ).parent( "li" ); 14180 } else { 14181 item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); 14182 filter += ":not(.ui-state-disabled)"; 14183 } 14184 14185 if ( direction === "first" || direction === "last" ) { 14186 next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 ); 14187 } else { 14188 next = item[ direction + "All" ]( filter ).eq( 0 ); 14189 } 14190 14191 if ( next.length ) { 14192 this.menuInstance.focus( event, next ); 14193 } 14194 }, 14195 14196 _getSelectedItem: function() { 14197 return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); 14198 }, 14199 14200 _toggle: function( event ) { 14201 this[ this.isOpen ? "close" : "open" ]( event ); 14202 }, 14203 14204 _setSelection: function() { 14205 var selection; 14206 14207 if ( !this.range ) { 14208 return; 14209 } 14210 14211 if ( window.getSelection ) { 14212 selection = window.getSelection(); 14213 selection.removeAllRanges(); 14214 selection.addRange( this.range ); 14215 14216 // Support: IE8 14217 } else { 14218 this.range.select(); 14219 } 14220 14221 // Support: IE 14222 // Setting the text selection kills the button focus in IE, but 14223 // restoring the focus doesn't kill the selection. 14224 this.button.focus(); 14225 }, 14226 14227 _documentClick: { 14228 mousedown: function( event ) { 14229 if ( !this.isOpen ) { 14230 return; 14231 } 14232 14233 if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + 14234 $.ui.escapeSelector( this.ids.button ) ).length ) { 14235 this.close( event ); 14236 } 14237 } 14238 }, 14239 14240 _buttonEvents: { 14241 14242 // Prevent text selection from being reset when interacting with the selectmenu (#10144) 14243 mousedown: function() { 14244 var selection; 14245 14246 if ( window.getSelection ) { 14247 selection = window.getSelection(); 14248 if ( selection.rangeCount ) { 14249 this.range = selection.getRangeAt( 0 ); 14250 } 14251 14252 // Support: IE8 14253 } else { 14254 this.range = document.selection.createRange(); 14255 } 14256 }, 14257 14258 click: function( event ) { 14259 this._setSelection(); 14260 this._toggle( event ); 14261 }, 14262 14263 keydown: function( event ) { 14264 var preventDefault = true; 14265 switch ( event.keyCode ) { 14266 case $.ui.keyCode.TAB: 14267 case $.ui.keyCode.ESCAPE: 14268 this.close( event ); 14269 preventDefault = false; 14270 break; 14271 case $.ui.keyCode.ENTER: 14272 if ( this.isOpen ) { 14273 this._selectFocusedItem( event ); 14274 } 14275 break; 14276 case $.ui.keyCode.UP: 14277 if ( event.altKey ) { 14278 this._toggle( event ); 14279 } else { 14280 this._move( "prev", event ); 14281 } 14282 break; 14283 case $.ui.keyCode.DOWN: 14284 if ( event.altKey ) { 14285 this._toggle( event ); 14286 } else { 14287 this._move( "next", event ); 14288 } 14289 break; 14290 case $.ui.keyCode.SPACE: 14291 if ( this.isOpen ) { 14292 this._selectFocusedItem( event ); 14293 } else { 14294 this._toggle( event ); 14295 } 14296 break; 14297 case $.ui.keyCode.LEFT: 14298 this._move( "prev", event ); 14299 break; 14300 case $.ui.keyCode.RIGHT: 14301 this._move( "next", event ); 14302 break; 14303 case $.ui.keyCode.HOME: 14304 case $.ui.keyCode.PAGE_UP: 14305 this._move( "first", event ); 14306 break; 14307 case $.ui.keyCode.END: 14308 case $.ui.keyCode.PAGE_DOWN: 14309 this._move( "last", event ); 14310 break; 14311 default: 14312 this.menu.trigger( event ); 14313 preventDefault = false; 14314 } 14315 14316 if ( preventDefault ) { 14317 event.preventDefault(); 14318 } 14319 } 14320 }, 14321 14322 _selectFocusedItem: function( event ) { 14323 var item = this.menuItems.eq( this.focusIndex ).parent( "li" ); 14324 if ( !item.hasClass( "ui-state-disabled" ) ) { 14325 this._select( item.data( "ui-selectmenu-item" ), event ); 14326 } 14327 }, 14328 14329 _select: function( item, event ) { 14330 var oldIndex = this.element[ 0 ].selectedIndex; 14331 14332 // Change native select element 14333 this.element[ 0 ].selectedIndex = item.index; 14334 this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) ); 14335 this._setAria( item ); 14336 this._trigger( "select", event, { item: item } ); 14337 14338 if ( item.index !== oldIndex ) { 14339 this._trigger( "change", event, { item: item } ); 14340 } 14341 14342 this.close( event ); 14343 }, 14344 14345 _setAria: function( item ) { 14346 var id = this.menuItems.eq( item.index ).attr( "id" ); 14347 14348 this.button.attr( { 14349 "aria-labelledby": id, 14350 "aria-activedescendant": id 14351 } ); 14352 this.menu.attr( "aria-activedescendant", id ); 14353 }, 14354 14355 _setOption: function( key, value ) { 14356 if ( key === "icons" ) { 14357 var icon = this.button.find( "span.ui-icon" ); 14358 this._removeClass( icon, null, this.options.icons.button ) 14359 ._addClass( icon, null, value.button ); 14360 } 14361 14362 this._super( key, value ); 14363 14364 if ( key === "appendTo" ) { 14365 this.menuWrap.appendTo( this._appendTo() ); 14366 } 14367 14368 if ( key === "width" ) { 14369 this._resizeButton(); 14370 } 14371 }, 14372 14373 _setOptionDisabled: function( value ) { 14374 this._super( value ); 14375 14376 this.menuInstance.option( "disabled", value ); 14377 this.button.attr( "aria-disabled", value ); 14378 this._toggleClass( this.button, null, "ui-state-disabled", value ); 14379 14380 this.element.prop( "disabled", value ); 14381 if ( value ) { 14382 this.button.attr( "tabindex", -1 ); 14383 this.close(); 14384 } else { 14385 this.button.attr( "tabindex", 0 ); 14386 } 14387 }, 14388 14389 _appendTo: function() { 14390 var element = this.options.appendTo; 14391 14392 if ( element ) { 14393 element = element.jquery || element.nodeType ? 14394 $( element ) : 14395 this.document.find( element ).eq( 0 ); 14396 } 14397 14398 if ( !element || !element[ 0 ] ) { 14399 element = this.element.closest( ".ui-front, dialog" ); 14400 } 14401 14402 if ( !element.length ) { 14403 element = this.document[ 0 ].body; 14404 } 14405 14406 return element; 14407 }, 14408 14409 _toggleAttr: function() { 14410 this.button.attr( "aria-expanded", this.isOpen ); 14411 14412 // We can't use two _toggleClass() calls here, because we need to make sure 14413 // we always remove classes first and add them second, otherwise if both classes have the 14414 // same theme class, it will be removed after we add it. 14415 this._removeClass( this.button, "ui-selectmenu-button-" + 14416 ( this.isOpen ? "closed" : "open" ) ) 14417 ._addClass( this.button, "ui-selectmenu-button-" + 14418 ( this.isOpen ? "open" : "closed" ) ) 14419 ._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen ); 14420 14421 this.menu.attr( "aria-hidden", !this.isOpen ); 14422 }, 14423 14424 _resizeButton: function() { 14425 var width = this.options.width; 14426 14427 // For `width: false`, just remove inline style and stop 14428 if ( width === false ) { 14429 this.button.css( "width", "" ); 14430 return; 14431 } 14432 14433 // For `width: null`, match the width of the original element 14434 if ( width === null ) { 14435 width = this.element.show().outerWidth(); 14436 this.element.hide(); 14437 } 14438 14439 this.button.outerWidth( width ); 14440 }, 14441 14442 _resizeMenu: function() { 14443 this.menu.outerWidth( Math.max( 14444 this.button.outerWidth(), 14445
vendor: 5,356 bytes, lines 14446-14657
14446 // Support: IE10 14447 // IE10 wraps long text (possibly a rounding bug) 14448 // so we add 1px to avoid the wrapping 14449 this.menu.width( "" ).outerWidth() + 1 14450 ) ); 14451 }, 14452 14453 _getCreateOptions: function() { 14454 var options = this._super(); 14455 14456 options.disabled = this.element.prop( "disabled" ); 14457 14458 return options; 14459 }, 14460 14461 _parseOptions: function( options ) { 14462 var that = this, 14463 data = []; 14464 options.each( function( index, item ) { 14465 data.push( that._parseOption( $( item ), index ) ); 14466 } ); 14467 this.items = data; 14468 }, 14469 14470 _parseOption: function( option, index ) { 14471 var optgroup = option.parent( "optgroup" ); 14472 14473 return { 14474 element: option, 14475 index: index, 14476 value: option.val(), 14477 label: option.text(), 14478 optgroup: optgroup.attr( "label" ) || "", 14479 disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" ) 14480 }; 14481 }, 14482 14483 _destroy: function() { 14484 this._unbindFormResetHandler(); 14485 this.menuWrap.remove(); 14486 this.button.remove(); 14487 this.element.show(); 14488 this.element.removeUniqueId(); 14489 this.labels.attr( "for", this.ids.element ); 14490 } 14491} ] ); 14492 14493 14494/*! 14495 * jQuery UI Slider 1.12.0 14496 * http://jqueryui.com 14497 * 14498 * Copyright jQuery Foundation and other contributors 14499 * Released under the MIT license. 14500 * http://jquery.org/license 14501 */ 14502 14503//>>label: Slider 14504//>>group: Widgets 14505//>>description: Displays a flexible slider with ranges and accessibility via keyboard. 14506//>>docs: http://api.jqueryui.com/slider/ 14507//>>demos: http://jqueryui.com/slider/ 14508//>>css.structure: ../../themes/base/core.css 14509//>>css.structure: ../../themes/base/slider.css 14510//>>css.theme: ../../themes/base/theme.css 14511 14512 14513 14514var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, { 14515 version: "1.12.0", 14516 widgetEventPrefix: "slide", 14517 14518 options: { 14519 animate: false, 14520 classes: { 14521 "ui-slider": "ui-corner-all", 14522 "ui-slider-handle": "ui-corner-all", 14523 14524 // Note: ui-widget-header isn't the most fittingly semantic framework class for this 14525 // element, but worked best visually with a variety of themes 14526 "ui-slider-range": "ui-corner-all ui-widget-header" 14527 }, 14528 distance: 0, 14529 max: 100, 14530 min: 0, 14531 orientation: "horizontal", 14532 range: false, 14533 step: 1, 14534 value: 0, 14535 values: null, 14536 14537 // Callbacks 14538 change: null, 14539 slide: null, 14540 start: null, 14541 stop: null 14542 }, 14543 14544 // Number of pages in a slider 14545 // (how many times can you page up/down to go through the whole range) 14546 numPages: 5, 14547 14548 _create: function() { 14549 this._keySliding = false; 14550 this._mouseSliding = false; 14551 this._animateOff = true; 14552 this._handleIndex = null; 14553 this._detectOrientation(); 14554 this._mouseInit(); 14555 this._calculateNewMax(); 14556 14557 this._addClass( "ui-slider ui-slider-" + this.orientation, 14558 "ui-widget ui-widget-content" ); 14559 14560 this._refresh(); 14561 14562 this._animateOff = false; 14563 }, 14564 14565 _refresh: function() { 14566 this._createRange(); 14567 this._createHandles(); 14568 this._setupEvents(); 14569 this._refreshValue(); 14570 }, 14571 14572 _createHandles: function() { 14573 var i, handleCount, 14574 options = this.options, 14575 existingHandles = this.element.find( ".ui-slider-handle" ), 14576 handle = "<span tabindex='0'></span>", 14577 handles = []; 14578 14579 handleCount = ( options.values && options.values.length ) || 1; 14580 14581 if ( existingHandles.length > handleCount ) { 14582 existingHandles.slice( handleCount ).remove(); 14583 existingHandles = existingHandles.slice( 0, handleCount ); 14584 } 14585 14586 for ( i = existingHandles.length; i < handleCount; i++ ) { 14587 handles.push( handle ); 14588 } 14589 14590 this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); 14591 14592 this._addClass( this.handles, "ui-slider-handle", "ui-state-default" ); 14593 14594 this.handle = this.handles.eq( 0 ); 14595 14596 this.handles.each( function( i ) { 14597 $( this ).data( "ui-slider-handle-index", i ); 14598 } ); 14599 }, 14600 14601 _createRange: function() { 14602 var options = this.options; 14603 14604 if ( options.range ) { 14605 if ( options.range === true ) { 14606 if ( !options.values ) { 14607 options.values = [ this._valueMin(), this._valueMin() ]; 14608 } else if ( options.values.length && options.values.length !== 2 ) { 14609 options.values = [ options.values[ 0 ], options.values[ 0 ] ]; 14610 } else if ( $.isArray( options.values ) ) { 14611 options.values = options.values.slice( 0 ); 14612 } 14613 } 14614 14615 if ( !this.range || !this.range.length ) { 14616 this.range = $( "<div>" ) 14617 .appendTo( this.element ); 14618 14619 this._addClass( this.range, "ui-slider-range" ); 14620 } else { 14621 this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" ); 14622 14623 // Handle range switching from true to min/max 14624 this.range.css( { 14625 "left": "", 14626 "bottom": "" 14627 } ); 14628 } 14629 if ( options.range === "min" || options.range === "max" ) { 14630 this._addClass( this.range, "ui-slider-range-" + options.range ); 14631 } 14632 } else { 14633 if ( this.range ) { 14634 this.range.remove(); 14635 } 14636 this.range = null; 14637 } 14638 }, 14639 14640 _setupEvents: function() { 14641 this._off( this.handles ); 14642 this._on( this.handles, this._handleEvents ); 14643 this._hoverable( this.handles ); 14644 this._focusable( this.handles ); 14645 }, 14646 14647 _destroy: function() { 14648 this.handles.remove(); 14649 if ( this.range ) { 14650 this.range.remove(); 14651 } 14652 14653 this._mouseDestroy(); 14654 }, 14655 14656 _mouseCapture: function( event ) { 14657 var position, normValue, distance, closestHandle, index, allowed, offset, mou
vendor: 15,762 bytes, lines 14657-15230
14657seOverHandle, 14658 that = this, 14659 o = this.options; 14660 14661 if ( o.disabled ) { 14662 return false; 14663 } 14664 14665 this.elementSize = { 14666 width: this.element.outerWidth(), 14667 height: this.element.outerHeight() 14668 }; 14669 this.elementOffset = this.element.offset(); 14670 14671 position = { x: event.pageX, y: event.pageY }; 14672 normValue = this._normValueFromMouse( position ); 14673 distance = this._valueMax() - this._valueMin() + 1; 14674 this.handles.each( function( i ) { 14675 var thisDistance = Math.abs( normValue - that.values( i ) ); 14676 if ( ( distance > thisDistance ) || 14677 ( distance === thisDistance && 14678 ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) { 14679 distance = thisDistance; 14680 closestHandle = $( this ); 14681 index = i; 14682 } 14683 } ); 14684 14685 allowed = this._start( event, index ); 14686 if ( allowed === false ) { 14687 return false; 14688 } 14689 this._mouseSliding = true; 14690 14691 this._handleIndex = index; 14692 14693 this._addClass( closestHandle, null, "ui-state-active" ); 14694 closestHandle.trigger( "focus" ); 14695 14696 offset = closestHandle.offset(); 14697 mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); 14698 this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { 14699 left: event.pageX - offset.left - ( closestHandle.width() / 2 ), 14700 top: event.pageY - offset.top - 14701 ( closestHandle.height() / 2 ) - 14702 ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) - 14703 ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) + 14704 ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 ) 14705 }; 14706 14707 if ( !this.handles.hasClass( "ui-state-hover" ) ) { 14708 this._slide( event, index, normValue ); 14709 } 14710 this._animateOff = true; 14711 return true; 14712 }, 14713 14714 _mouseStart: function() { 14715 return true; 14716 }, 14717 14718 _mouseDrag: function( event ) { 14719 var position = { x: event.pageX, y: event.pageY }, 14720 normValue = this._normValueFromMouse( position ); 14721 14722 this._slide( event, this._handleIndex, normValue ); 14723 14724 return false; 14725 }, 14726 14727 _mouseStop: function( event ) { 14728 this._removeClass( this.handles, null, "ui-state-active" ); 14729 this._mouseSliding = false; 14730 14731 this._stop( event, this._handleIndex ); 14732 this._change( event, this._handleIndex ); 14733 14734 this._handleIndex = null; 14735 this._clickOffset = null; 14736 this._animateOff = false; 14737 14738 return false; 14739 }, 14740 14741 _detectOrientation: function() { 14742 this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; 14743 }, 14744 14745 _normValueFromMouse: function( position ) { 14746 var pixelTotal, 14747 pixelMouse, 14748 percentMouse, 14749 valueTotal, 14750 valueMouse; 14751 14752 if ( this.orientation === "horizontal" ) { 14753 pixelTotal = this.elementSize.width; 14754 pixelMouse = position.x - this.elementOffset.left - 14755 ( this._clickOffset ? this._clickOffset.left : 0 ); 14756 } else { 14757 pixelTotal = this.elementSize.height; 14758 pixelMouse = position.y - this.elementOffset.top - 14759 ( this._clickOffset ? this._clickOffset.top : 0 ); 14760 } 14761 14762 percentMouse = ( pixelMouse / pixelTotal ); 14763 if ( percentMouse > 1 ) { 14764 percentMouse = 1; 14765 } 14766 if ( percentMouse < 0 ) { 14767 percentMouse = 0; 14768 } 14769 if ( this.orientation === "vertical" ) { 14770 percentMouse = 1 - percentMouse; 14771 } 14772 14773 valueTotal = this._valueMax() - this._valueMin(); 14774 valueMouse = this._valueMin() + percentMouse * valueTotal; 14775 14776 return this._trimAlignValue( valueMouse ); 14777 }, 14778 14779 _uiHash: function( index, value, values ) { 14780 var uiHash = { 14781 handle: this.handles[ index ], 14782 handleIndex: index, 14783 value: value !== undefined ? value : this.value() 14784 }; 14785 14786 if ( this._hasMultipleValues() ) { 14787 uiHash.value = value !== undefined ? value : this.values( index ); 14788 uiHash.values = values || this.values(); 14789 } 14790 14791 return uiHash; 14792 }, 14793 14794 _hasMultipleValues: function() { 14795 return this.options.values && this.options.values.length; 14796 }, 14797 14798 _start: function( event, index ) { 14799 return this._trigger( "start", event, this._uiHash( index ) ); 14800 }, 14801 14802 _slide: function( event, index, newVal ) { 14803 var allowed, otherVal, 14804 currentValue = this.value(), 14805 newValues = this.values(); 14806 14807 if ( this._hasMultipleValues() ) { 14808 otherVal = this.values( index ? 0 : 1 ); 14809 currentValue = this.values( index ); 14810 14811 if ( this.options.values.length === 2 && this.options.range === true ) { 14812 newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal ); 14813 } 14814 14815 newValues[ index ] = newVal; 14816 } 14817 14818 if ( newVal === currentValue ) { 14819 return; 14820 } 14821 14822 allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) ); 14823 14824 // A slide can be canceled by returning false from the slide callback 14825 if ( allowed === false ) { 14826 return; 14827 } 14828 14829 if ( this._hasMultipleValues() ) { 14830 this.values( index, newVal ); 14831 } else { 14832 this.value( newVal ); 14833 } 14834 }, 14835 14836 _stop: function( event, index ) { 14837 this._trigger( "stop", event, this._uiHash( index ) ); 14838 }, 14839 14840 _change: function( event, index ) { 14841 if ( !this._keySliding && !this._mouseSliding ) { 14842 14843 //store the last changed value index for reference when handles overlap 14844 this._lastChangedValue = index; 14845 this._trigger( "change", event, this._uiHash( index ) ); 14846 } 14847 }, 14848 14849 value: function( newValue ) { 14850 if ( arguments.length ) { 14851 this.options.value = this._trimAlignValue( newValue ); 14852 this._refreshValue(); 14853 this._change( null, 0 ); 14854 return; 14855 } 14856 14857 return this._value(); 14858 }, 14859 14860 values: function( index, newValue ) { 14861 var vals, 14862 newValues, 14863 i; 14864 14865 if ( arguments.length > 1 ) { 14866 this.options.values[ index ] = this._trimAlignValue( newValue ); 14867 this._refreshValue(); 14868 this._change( null, index ); 14869 return; 14870 } 14871 14872 if ( arguments.length ) { 14873 if ( $.isArray( arguments[ 0 ] ) ) { 14874 vals = this.options.values; 14875 newValues = arguments[ 0 ]; 14876 for ( i = 0; i < vals.length; i += 1 ) { 14877 vals[ i ] = this._trimAlignValue( newValues[ i ] ); 14878 this._change( null, i ); 14879 } 14880 this._refreshValue(); 14881 } else { 14882 if ( this._hasMultipleValues() ) { 14883 return this._values( index ); 14884 } else { 14885 return this.value(); 14886 } 14887 } 14888 } else { 14889 return this._values(); 14890 } 14891 }, 14892 14893 _setOption: function( key, value ) { 14894 var i, 14895 valsLength = 0; 14896 14897 if ( key === "range" && this.options.range === true ) { 14898 if ( value === "min" ) { 14899 this.options.value = this._values( 0 ); 14900 this.options.values = null; 14901 } else if ( value === "max" ) { 14902 this.options.value = this._values( this.options.values.length - 1 ); 14903 this.options.values = null; 14904 } 14905 } 14906 14907 if ( $.isArray( this.options.values ) ) { 14908 valsLength = this.options.values.length; 14909 } 14910 14911 this._super( key, value ); 14912 14913 switch ( key ) { 14914 case "orientation": 14915 this._detectOrientation(); 14916 this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) 14917 ._addClass( "ui-slider-" + this.orientation ); 14918 this._refreshValue(); 14919 if ( this.options.range ) { 14920 this._refreshRange( value ); 14921 } 14922 14923 // Reset positioning from previous orientation 14924 this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); 14925 break; 14926 case "value": 14927 this._animateOff = true; 14928 this._refreshValue(); 14929 this._change( null, 0 ); 14930 this._animateOff = false; 14931 break; 14932 case "values": 14933 this._animateOff = true; 14934 this._refreshValue(); 14935 14936 // Start from the last handle to prevent unreachable handles (#9046) 14937 for ( i = valsLength - 1; i >= 0; i-- ) { 14938 this._change( null, i ); 14939 } 14940 this._animateOff = false; 14941 break; 14942 case "step": 14943 case "min": 14944 case "max": 14945 this._animateOff = true; 14946 this._calculateNewMax(); 14947 this._refreshValue(); 14948 this._animateOff = false; 14949 break; 14950 case "range": 14951 this._animateOff = true; 14952 this._refresh(); 14953 this._animateOff = false; 14954 break; 14955 } 14956 }, 14957 14958 _setOptionDisabled: function( value ) { 14959 this._super( value ); 14960 14961 this._toggleClass( null, "ui-state-disabled", !!value ); 14962 }, 14963 14964 //internal value getter 14965 // _value() returns value trimmed by min and max, aligned by step 14966 _value: function() { 14967 var val = this.options.value; 14968 val = this._trimAlignValue( val ); 14969 14970 return val; 14971 }, 14972 14973 //internal values getter 14974 // _values() returns array of values trimmed by min and max, aligned by step 14975 // _values( index ) returns single value trimmed by min and max, aligned by step 14976 _values: function( index ) { 14977 var val, 14978 vals, 14979 i; 14980 14981 if ( arguments.length ) { 14982 val = this.options.values[ index ]; 14983 val = this._trimAlignValue( val ); 14984 14985 return val; 14986 } else if ( this._hasMultipleValues() ) { 14987 14988 // .slice() creates a copy of the array 14989 // this copy gets trimmed by min and max and then returned 14990 vals = this.options.values.slice(); 14991 for ( i = 0; i < vals.length; i += 1 ) { 14992 vals[ i ] = this._trimAlignValue( vals[ i ] ); 14993 } 14994 14995 return vals; 14996 } else { 14997 return []; 14998 } 14999 }, 15000 15001 // Returns the step-aligned value that val is closest to, between (inclusive) min and max 15002 _trimAlignValue: function( val ) { 15003 if ( val <= this._valueMin() ) { 15004 return this._valueMin(); 15005 } 15006 if ( val >= this._valueMax() ) { 15007 return this._valueMax(); 15008 } 15009 var step = ( this.options.step > 0 ) ? this.options.step : 1, 15010 valModStep = ( val - this._valueMin() ) % step, 15011 alignValue = val - valModStep; 15012 15013 if ( Math.abs( valModStep ) * 2 >= step ) { 15014 alignValue += ( valModStep > 0 ) ? step : ( -step ); 15015 } 15016 15017 // Since JavaScript has problems with large floats, round 15018 // the final value to 5 digits after the decimal point (see #4124) 15019 return parseFloat( alignValue.toFixed( 5 ) ); 15020 }, 15021 15022 _calculateNewMax: function() { 15023 var max = this.options.max, 15024 min = this._valueMin(), 15025 step = this.options.step, 15026 aboveMin = Math.round( ( max - min ) / step ) * step; 15027 max = aboveMin + min; 15028 if ( max > this.options.max ) { 15029 15030 //If max is not divisible by step, rounding off may increase its value 15031 max -= step; 15032 } 15033 this.max = parseFloat( max.toFixed( this._precision() ) ); 15034 }, 15035 15036 _precision: function() { 15037 var precision = this._precisionOf( this.options.step ); 15038 if ( this.options.min !== null ) { 15039 precision = Math.max( precision, this._precisionOf( this.options.min ) ); 15040 } 15041 return precision; 15042 }, 15043 15044 _precisionOf: function( num ) { 15045 var str = num.toString(), 15046 decimal = str.indexOf( "." ); 15047 return decimal === -1 ? 0 : str.length - decimal - 1; 15048 }, 15049 15050 _valueMin: function() { 15051 return this.options.min; 15052 }, 15053 15054 _valueMax: function() { 15055 return this.max; 15056 }, 15057 15058 _refreshRange: function( orientation ) { 15059 if ( orientation === "vertical" ) { 15060 this.range.css( { "width": "", "left": "" } ); 15061 } 15062 if ( orientation === "horizontal" ) { 15063 this.range.css( { "height": "", "bottom": "" } ); 15064 } 15065 }, 15066 15067 _refreshValue: function() { 15068 var lastValPercent, valPercent, value, valueMin, valueMax, 15069 oRange = this.options.range, 15070 o = this.options, 15071 that = this, 15072 animate = ( !this._animateOff ) ? o.animate : false, 15073 _set = {}; 15074 15075 if ( this._hasMultipleValues() ) { 15076 this.handles.each( function( i ) { 15077 valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - 15078 that._valueMin() ) * 100; 15079 _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 15080 $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 15081 if ( that.options.range === true ) { 15082 if ( that.orientation === "horizontal" ) { 15083 if ( i === 0 ) { 15084 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15085 left: valPercent + "%" 15086 }, o.animate ); 15087 } 15088 if ( i === 1 ) { 15089 that.range[ animate ? "animate" : "css" ]( { 15090 width: ( valPercent - lastValPercent ) + "%" 15091 }, { 15092 queue: false, 15093 duration: o.animate 15094 } ); 15095 } 15096 } else { 15097 if ( i === 0 ) { 15098 that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15099 bottom: ( valPercent ) + "%" 15100 }, o.animate ); 15101 } 15102 if ( i === 1 ) { 15103 that.range[ animate ? "animate" : "css" ]( { 15104 height: ( valPercent - lastValPercent ) + "%" 15105 }, { 15106 queue: false, 15107 duration: o.animate 15108 } ); 15109 } 15110 } 15111 } 15112 lastValPercent = valPercent; 15113 } ); 15114 } else { 15115 value = this.value(); 15116 valueMin = this._valueMin(); 15117 valueMax = this._valueMax(); 15118 valPercent = ( valueMax !== valueMin ) ? 15119 ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 15120 0; 15121 _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; 15122 this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); 15123 15124 if ( oRange === "min" && this.orientation === "horizontal" ) { 15125 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15126 width: valPercent + "%" 15127 }, o.animate ); 15128 } 15129 if ( oRange === "max" && this.orientation === "horizontal" ) { 15130 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15131 width: ( 100 - valPercent ) + "%" 15132 }, o.animate ); 15133 } 15134 if ( oRange === "min" && this.orientation === "vertical" ) { 15135 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15136 height: valPercent + "%" 15137 }, o.animate ); 15138 } 15139 if ( oRange === "max" && this.orientation === "vertical" ) { 15140 this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { 15141 height: ( 100 - valPercent ) + "%" 15142 }, o.animate ); 15143 } 15144 } 15145 }, 15146 15147 _handleEvents: { 15148 keydown: function( event ) { 15149 var allowed, curVal, newVal, step, 15150 index = $( event.target ).data( "ui-slider-handle-index" ); 15151 15152 switch ( event.keyCode ) { 15153 case $.ui.keyCode.HOME: 15154 case $.ui.keyCode.END: 15155 case $.ui.keyCode.PAGE_UP: 15156 case $.ui.keyCode.PAGE_DOWN: 15157 case $.ui.keyCode.UP: 15158 case $.ui.keyCode.RIGHT: 15159 case $.ui.keyCode.DOWN: 15160 case $.ui.keyCode.LEFT: 15161 event.preventDefault(); 15162 if ( !this._keySliding ) { 15163 this._keySliding = true; 15164 this._addClass( $( event.target ), null, "ui-state-active" ); 15165 allowed = this._start( event, index ); 15166 if ( allowed === false ) { 15167 return; 15168 } 15169 } 15170 break; 15171 } 15172 15173 step = this.options.step; 15174 if ( this._hasMultipleValues() ) { 15175 curVal = newVal = this.values( index ); 15176 } else { 15177 curVal = newVal = this.value(); 15178 } 15179 15180 switch ( event.keyCode ) { 15181 case $.ui.keyCode.HOME: 15182 newVal = this._valueMin(); 15183 break; 15184 case $.ui.keyCode.END: 15185 newVal = this._valueMax(); 15186 break; 15187 case $.ui.keyCode.PAGE_UP: 15188 newVal = this._trimAlignValue( 15189 curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) 15190 ); 15191 break; 15192 case $.ui.keyCode.PAGE_DOWN: 15193 newVal = this._trimAlignValue( 15194 curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); 15195 break; 15196 case $.ui.keyCode.UP: 15197 case $.ui.keyCode.RIGHT: 15198 if ( curVal === this._valueMax() ) { 15199 return; 15200 } 15201 newVal = this._trimAlignValue( curVal + step ); 15202 break; 15203 case $.ui.keyCode.DOWN: 15204 case $.ui.keyCode.LEFT: 15205 if ( curVal === this._valueMin() ) { 15206 return; 15207 } 15208 newVal = this._trimAlignValue( curVal - step ); 15209 break; 15210 } 15211 15212 this._slide( event, index, newVal ); 15213 }, 15214 keyup: function( event ) { 15215 var index = $( event.target ).data( "ui-slider-handle-index" ); 15216 15217 if ( this._keySliding ) { 15218 this._keySliding = false; 15219 this._stop( event, index ); 15220 this._change( event, index ); 15221 this._removeClass( $( event.target ), null, "ui-state-active" ); 15222 } 15223 } 15224 } 15225} ); 15226 15227 15228/*! 15229 * jQuery UI Sortable 1.12.0 15230 * http://jqueryui.com
vendor: 6,330 bytes, lines 15231-15478
15231 * 15232 * Copyright jQuery Foundation and other contributors 15233 * Released under the MIT license. 15234 * http://jquery.org/license 15235 */ 15236 15237//>>label: Sortable 15238//>>group: Interactions 15239//>>description: Enables items in a list to be sorted using the mouse. 15240//>>docs: http://api.jqueryui.com/sortable/ 15241//>>demos: http://jqueryui.com/sortable/ 15242//>>css.structure: ../../themes/base/sortable.css 15243 15244 15245 15246var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, { 15247 version: "1.12.0", 15248 widgetEventPrefix: "sort", 15249 ready: false, 15250 options: { 15251 appendTo: "parent", 15252 axis: false, 15253 connectWith: false, 15254 containment: false, 15255 cursor: "auto", 15256 cursorAt: false, 15257 dropOnEmpty: true, 15258 forcePlaceholderSize: false, 15259 forceHelperSize: false, 15260 grid: false, 15261 handle: false, 15262 helper: "original", 15263 items: "> *", 15264 opacity: false, 15265 placeholder: false, 15266 revert: false, 15267 scroll: true, 15268 scrollSensitivity: 20, 15269 scrollSpeed: 20, 15270 scope: "default", 15271 tolerance: "intersect", 15272 zIndex: 1000, 15273 15274 // Callbacks 15275 activate: null, 15276 beforeStop: null, 15277 change: null, 15278 deactivate: null, 15279 out: null, 15280 over: null, 15281 receive: null, 15282 remove: null, 15283 sort: null, 15284 start: null, 15285 stop: null, 15286 update: null 15287 }, 15288 15289 _isOverAxis: function( x, reference, size ) { 15290 return ( x >= reference ) && ( x < ( reference + size ) ); 15291 }, 15292 15293 _isFloating: function( item ) { 15294 return ( /left|right/ ).test( item.css( "float" ) ) || 15295 ( /inline|table-cell/ ).test( item.css( "display" ) ); 15296 }, 15297 15298 _create: function() { 15299 this.containerCache = {}; 15300 this._addClass( "ui-sortable" ); 15301 15302 //Get the items 15303 this.refresh(); 15304 15305 //Let's determine the parent's offset 15306 this.offset = this.element.offset(); 15307 15308 //Initialize mouse events for interaction 15309 this._mouseInit(); 15310 15311 this._setHandleClassName(); 15312 15313 //We're ready to go 15314 this.ready = true; 15315 15316 }, 15317 15318 _setOption: function( key, value ) { 15319 this._super( key, value ); 15320 15321 if ( key === "handle" ) { 15322 this._setHandleClassName(); 15323 } 15324 }, 15325 15326 _setHandleClassName: function() { 15327 var that = this; 15328 this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); 15329 $.each( this.items, function() { 15330 that._addClass( 15331 this.instance.options.handle ? 15332 this.item.find( this.instance.options.handle ) : 15333 this.item, 15334 "ui-sortable-handle" 15335 ); 15336 } ); 15337 }, 15338 15339 _destroy: function() { 15340 this._mouseDestroy(); 15341 15342 for ( var i = this.items.length - 1; i >= 0; i-- ) { 15343 this.items[ i ].item.removeData( this.widgetName + "-item" ); 15344 } 15345 15346 return this; 15347 }, 15348 15349 _mouseCapture: function( event, overrideHandle ) { 15350 var currentItem = null, 15351 validHandle = false, 15352 that = this; 15353 15354 if ( this.reverting ) { 15355 return false; 15356 } 15357 15358 if ( this.options.disabled || this.options.type === "static" ) { 15359 return false; 15360 } 15361 15362 //We have to refresh the items data once first 15363 this._refreshItems( event ); 15364 15365 //Find out if the clicked node (or one of its parents) is a actual item in this.items 15366 $( event.target ).parents().each( function() { 15367 if ( $.data( this, that.widgetName + "-item" ) === that ) { 15368 currentItem = $( this ); 15369 return false; 15370 } 15371 } ); 15372 if ( $.data( event.target, that.widgetName + "-item" ) === that ) { 15373 currentItem = $( event.target ); 15374 } 15375 15376 if ( !currentItem ) { 15377 return false; 15378 } 15379 if ( this.options.handle && !overrideHandle ) { 15380 $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { 15381 if ( this === event.target ) { 15382 validHandle = true; 15383 } 15384 } ); 15385 if ( !validHandle ) { 15386 return false; 15387 } 15388 } 15389 15390 this.currentItem = currentItem; 15391 this._removeCurrentsFromItems(); 15392 return true; 15393 15394 }, 15395 15396 _mouseStart: function( event, overrideHandle, noActivation ) { 15397 15398 var i, body, 15399 o = this.options; 15400 15401 this.currentContainer = this; 15402 15403 //We only need to call refreshPositions, because the refreshItems call has been moved to 15404 // mouseCapture 15405 this.refreshPositions(); 15406 15407 //Create and append the visible helper 15408 this.helper = this._createHelper( event ); 15409 15410 //Cache the helper size 15411 this._cacheHelperProportions(); 15412 15413 /* 15414 * - Position generation - 15415 * This block generates everything position related - it's the core of draggables. 15416 */ 15417 15418 //Cache the margins of the original element 15419 this._cacheMargins(); 15420 15421 //Get the next scrolling parent 15422 this.scrollParent = this.helper.scrollParent(); 15423 15424 //The element's absolute position on the page minus margins 15425 this.offset = this.currentItem.offset(); 15426 this.offset = { 15427 top: this.offset.top - this.margins.top, 15428 left: this.offset.left - this.margins.left 15429 }; 15430 15431 $.extend( this.offset, { 15432 click: { //Where the click happened, relative to the element 15433 left: event.pageX - this.offset.left, 15434 top: event.pageY - this.offset.top 15435 }, 15436 parent: this._getParentOffset(), 15437 15438 // This is a relative to absolute position minus the actual position calculation - 15439 // only used for relative positioned helper 15440 relative: this._getRelativeOffset() 15441 } ); 15442 15443 // Only after we got the offset, we can change the helper's position to absolute 15444 // TODO: Still need to figure out a way to make relative sorting possible 15445 this.helper.css( "position", "absolute" ); 15446 this.cssPosition = this.helper.css( "position" ); 15447 15448 //Generate the original position 15449 this.originalPosition = this._generatePosition( event ); 15450 this.originalPageX = event.pageX; 15451 this.originalPageY = event.pageY; 15452 15453 //Adjust the mouse offset relative to the helper if "cursorAt" is supplied 15454 ( o.cursorAt && this._adjustOffsetFromHelper( o.cursorAt ) ); 15455 15456 //Cache the former DOM position 15457 this.domPosition = { 15458 prev: this.currentItem.prev()[ 0 ], 15459 parent: this.currentItem.parent()[ 0 ] 15460 }; 15461 15462 // If the helper is not the original, hide the original so it's not playing any role during 15463 // the drag, won't cause anything bad this way 15464 if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { 15465 this.currentItem.hide(); 15466 } 15467 15468 //Create the placeholder 15469 this._createPlaceholder(); 15470 15471 //Set a containment if given in the options 15472 if ( o.containment ) { 15473 this._setContainment(); 15474 } 15475 15476 if ( o.cursor && o.cursor !== "auto" ) { // cursor option 15477 body = this.document.find( "body" ); 15478
vendor: 9,591 bytes, lines 15479-15811
15479 // Support: IE 15480 this.storedCursor = body.css( "cursor" ); 15481 body.css( "cursor", o.cursor ); 15482 15483 this.storedStylesheet = 15484 $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); 15485 } 15486 15487 if ( o.opacity ) { // opacity option 15488 if ( this.helper.css( "opacity" ) ) { 15489 this._storedOpacity = this.helper.css( "opacity" ); 15490 } 15491 this.helper.css( "opacity", o.opacity ); 15492 } 15493 15494 if ( o.zIndex ) { // zIndex option 15495 if ( this.helper.css( "zIndex" ) ) { 15496 this._storedZIndex = this.helper.css( "zIndex" ); 15497 } 15498 this.helper.css( "zIndex", o.zIndex ); 15499 } 15500 15501 //Prepare scrolling 15502 if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 15503 this.scrollParent[ 0 ].tagName !== "HTML" ) { 15504 this.overflowOffset = this.scrollParent.offset(); 15505 } 15506 15507 //Call callbacks 15508 this._trigger( "start", event, this._uiHash() ); 15509 15510 //Recache the helper size 15511 if ( !this._preserveHelperProportions ) { 15512 this._cacheHelperProportions(); 15513 } 15514 15515 //Post "activate" events to possible containers 15516 if ( !noActivation ) { 15517 for ( i = this.containers.length - 1; i >= 0; i-- ) { 15518 this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); 15519 } 15520 } 15521 15522 //Prepare possible droppables 15523 if ( $.ui.ddmanager ) { 15524 $.ui.ddmanager.current = this; 15525 } 15526 15527 if ( $.ui.ddmanager && !o.dropBehaviour ) { 15528 $.ui.ddmanager.prepareOffsets( this, event ); 15529 } 15530 15531 this.dragging = true; 15532 15533 this._addClass( this.helper, "ui-sortable-helper" ); 15534 15535 // Execute the drag once - this causes the helper not to be visiblebefore getting its 15536 // correct position 15537 this._mouseDrag( event ); 15538 return true; 15539 15540 }, 15541 15542 _mouseDrag: function( event ) { 15543 var i, item, itemElement, intersection, 15544 o = this.options, 15545 scrolled = false; 15546 15547 //Compute the helpers position 15548 this.position = this._generatePosition( event ); 15549 this.positionAbs = this._convertPositionTo( "absolute" ); 15550 15551 if ( !this.lastPositionAbs ) { 15552 this.lastPositionAbs = this.positionAbs; 15553 } 15554 15555 //Do scrolling 15556 if ( this.options.scroll ) { 15557 if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && 15558 this.scrollParent[ 0 ].tagName !== "HTML" ) { 15559 15560 if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - 15561 event.pageY < o.scrollSensitivity ) { 15562 this.scrollParent[ 0 ].scrollTop = 15563 scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; 15564 } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { 15565 this.scrollParent[ 0 ].scrollTop = 15566 scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; 15567 } 15568 15569 if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - 15570 event.pageX < o.scrollSensitivity ) { 15571 this.scrollParent[ 0 ].scrollLeft = scrolled = 15572 this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; 15573 } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { 15574 this.scrollParent[ 0 ].scrollLeft = scrolled = 15575 this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; 15576 } 15577 15578 } else { 15579 15580 if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { 15581 scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); 15582 } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < 15583 o.scrollSensitivity ) { 15584 scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); 15585 } 15586 15587 if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { 15588 scrolled = this.document.scrollLeft( 15589 this.document.scrollLeft() - o.scrollSpeed 15590 ); 15591 } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < 15592 o.scrollSensitivity ) { 15593 scrolled = this.document.scrollLeft( 15594 this.document.scrollLeft() + o.scrollSpeed 15595 ); 15596 } 15597 15598 } 15599 15600 if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { 15601 $.ui.ddmanager.prepareOffsets( this, event ); 15602 } 15603 } 15604 15605 //Regenerate the absolute position used for position checks 15606 this.positionAbs = this._convertPositionTo( "absolute" ); 15607 15608 //Set the helper position 15609 if ( !this.options.axis || this.options.axis !== "y" ) { 15610 this.helper[ 0 ].style.left = this.position.left + "px"; 15611 } 15612 if ( !this.options.axis || this.options.axis !== "x" ) { 15613 this.helper[ 0 ].style.top = this.position.top + "px"; 15614 } 15615 15616 //Rearrange 15617 for ( i = this.items.length - 1; i >= 0; i-- ) { 15618 15619 //Cache variables and intersection, continue if no intersection 15620 item = this.items[ i ]; 15621 itemElement = item.item[ 0 ]; 15622 intersection = this._intersectsWithPointer( item ); 15623 if ( !intersection ) { 15624 continue; 15625 } 15626 15627 // Only put the placeholder inside the current Container, skip all 15628 // items from other containers. This works because when moving 15629 // an item from one container to another the 15630 // currentContainer is switched before the placeholder is moved. 15631 // 15632 // Without this, moving items in "sub-sortables" can cause 15633 // the placeholder to jitter between the outer and inner container. 15634 if ( item.instance !== this.currentContainer ) { 15635 continue; 15636 } 15637 15638 // Cannot intersect with itself 15639 // no useless actions that have been done before 15640 // no action if the item moved is the parent of the item checked 15641 if ( itemElement !== this.currentItem[ 0 ] && 15642 this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement && 15643 !$.contains( this.placeholder[ 0 ], itemElement ) && 15644 ( this.options.type === "semi-dynamic" ? 15645 !$.contains( this.element[ 0 ], itemElement ) : 15646 true 15647 ) 15648 ) { 15649 15650 this.direction = intersection === 1 ? "down" : "up"; 15651 15652 if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) { 15653 this._rearrange( event, item ); 15654 } else { 15655 break; 15656 } 15657 15658 this._trigger( "change", event, this._uiHash() ); 15659 break; 15660 } 15661 } 15662 15663 //Post events to containers 15664 this._contactContainers( event ); 15665 15666 //Interconnect with droppables 15667 if ( $.ui.ddmanager ) { 15668 $.ui.ddmanager.drag( this, event ); 15669 } 15670 15671 //Call callbacks 15672 this._trigger( "sort", event, this._uiHash() ); 15673 15674 this.lastPositionAbs = this.positionAbs; 15675 return false; 15676 15677 }, 15678 15679 _mouseStop: function( event, noPropagation ) { 15680 15681 if ( !event ) { 15682 return; 15683 } 15684 15685 //If we are using droppables, inform the manager about the drop 15686 if ( $.ui.ddmanager && !this.options.dropBehaviour ) { 15687 $.ui.ddmanager.drop( this, event ); 15688 } 15689 15690 if ( this.options.revert ) { 15691 var that = this, 15692 cur = this.placeholder.offset(), 15693 axis = this.options.axis, 15694 animation = {}; 15695 15696 if ( !axis || axis === "x" ) { 15697 animation.left = cur.left - this.offset.parent.left - this.margins.left + 15698 ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 15699 0 : 15700 this.offsetParent[ 0 ].scrollLeft 15701 ); 15702 } 15703 if ( !axis || axis === "y" ) { 15704 animation.top = cur.top - this.offset.parent.top - this.margins.top + 15705 ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 15706 0 : 15707 this.offsetParent[ 0 ].scrollTop 15708 ); 15709 } 15710 this.reverting = true; 15711 $( this.helper ).animate( 15712 animation, 15713 parseInt( this.options.revert, 10 ) || 500, 15714 function() { 15715 that._clear( event ); 15716 } 15717 ); 15718 } else { 15719 this._clear( event, noPropagation ); 15720 } 15721 15722 return false; 15723 15724 }, 15725 15726 cancel: function() { 15727 15728 if ( this.dragging ) { 15729 15730 this._mouseUp( { target: null } ); 15731 15732 if ( this.options.helper === "original" ) { 15733 this.currentItem.css( this._storedCSS ); 15734 this._removeClass( this.currentItem, "ui-sortable-helper" ); 15735 } else { 15736 this.currentItem.show(); 15737 } 15738 15739 //Post deactivating events to containers 15740 for ( var i = this.containers.length - 1; i >= 0; i-- ) { 15741 this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); 15742 if ( this.containers[ i ].containerCache.over ) { 15743 this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); 15744 this.containers[ i ].containerCache.over = 0; 15745 } 15746 } 15747 15748 } 15749 15750 if ( this.placeholder ) { 15751 15752 //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 15753 // it unbinds ALL events from the original node! 15754 if ( this.placeholder[ 0 ].parentNode ) { 15755 this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 15756 } 15757 if ( this.options.helper !== "original" && this.helper && 15758 this.helper[ 0 ].parentNode ) { 15759 this.helper.remove(); 15760 } 15761 15762 $.extend( this, { 15763 helper: null, 15764 dragging: false, 15765 reverting: false, 15766 _noFinalSort: null 15767 } ); 15768 15769 if ( this.domPosition.prev ) { 15770 $( this.domPosition.prev ).after( this.currentItem ); 15771 } else { 15772 $( this.domPosition.parent ).prepend( this.currentItem ); 15773 } 15774 } 15775 15776 return this; 15777 15778 }, 15779 15780 serialize: function( o ) { 15781 15782 var items = this._getItemsAsjQuery( o && o.connected ), 15783 str = []; 15784 o = o || {}; 15785 15786 $( items ).each( function() { 15787 var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) 15788 .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); 15789 if ( res ) { 15790 str.push( 15791 ( o.key || res[ 1 ] + "[]" ) + 15792 "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); 15793 } 15794 } ); 15795 15796 if ( !str.length && o.key ) { 15797 str.push( o.key + "=" ); 15798 } 15799 15800 return str.join( "&" ); 15801 15802 }, 15803 15804 toArray: function( o ) { 15805 15806 var items = this._getItemsAsjQuery( o && o.connected ), 15807 ret = []; 15808 15809 o = o || {}; 15810 15811 items.each( function() {
vendor: 19,871 bytes, lines 15812-16418
15812 ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); 15813 } ); 15814 return ret; 15815 15816 }, 15817 15818 /* Be careful with the following core functions */ 15819 _intersectsWith: function( item ) { 15820 15821 var x1 = this.positionAbs.left, 15822 x2 = x1 + this.helperProportions.width, 15823 y1 = this.positionAbs.top, 15824 y2 = y1 + this.helperProportions.height, 15825 l = item.left, 15826 r = l + item.width, 15827 t = item.top, 15828 b = t + item.height, 15829 dyClick = this.offset.click.top, 15830 dxClick = this.offset.click.left, 15831 isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && 15832 ( y1 + dyClick ) < b ), 15833 isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && 15834 ( x1 + dxClick ) < r ), 15835 isOverElement = isOverElementHeight && isOverElementWidth; 15836 15837 if ( this.options.tolerance === "pointer" || 15838 this.options.forcePointerForContainers || 15839 ( this.options.tolerance !== "pointer" && 15840 this.helperProportions[ this.floating ? "width" : "height" ] > 15841 item[ this.floating ? "width" : "height" ] ) 15842 ) { 15843 return isOverElement; 15844 } else { 15845 15846 return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half 15847 x2 - ( this.helperProportions.width / 2 ) < r && // Left Half 15848 t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half 15849 y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half 15850 15851 } 15852 }, 15853 15854 _intersectsWithPointer: function( item ) { 15855 var verticalDirection, horizontalDirection, 15856 isOverElementHeight = ( this.options.axis === "x" ) || 15857 this._isOverAxis( 15858 this.positionAbs.top + this.offset.click.top, item.top, item.height ), 15859 isOverElementWidth = ( this.options.axis === "y" ) || 15860 this._isOverAxis( 15861 this.positionAbs.left + this.offset.click.left, item.left, item.width ), 15862 isOverElement = isOverElementHeight && isOverElementWidth; 15863 15864 if ( !isOverElement ) { 15865 return false; 15866 } 15867 15868 verticalDirection = this._getDragVerticalDirection(); 15869 horizontalDirection = this._getDragHorizontalDirection(); 15870 15871 return this.floating ? 15872 ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) 15873 : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); 15874 15875 }, 15876 15877 _intersectsWithSides: function( item ) { 15878 15879 var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + 15880 this.offset.click.top, item.top + ( item.height / 2 ), item.height ), 15881 isOverRightHalf = this._isOverAxis( this.positionAbs.left + 15882 this.offset.click.left, item.left + ( item.width / 2 ), item.width ), 15883 verticalDirection = this._getDragVerticalDirection(), 15884 horizontalDirection = this._getDragHorizontalDirection(); 15885 15886 if ( this.floating && horizontalDirection ) { 15887 return ( ( horizontalDirection === "right" && isOverRightHalf ) || 15888 ( horizontalDirection === "left" && !isOverRightHalf ) ); 15889 } else { 15890 return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || 15891 ( verticalDirection === "up" && !isOverBottomHalf ) ); 15892 } 15893 15894 }, 15895 15896 _getDragVerticalDirection: function() { 15897 var delta = this.positionAbs.top - this.lastPositionAbs.top; 15898 return delta !== 0 && ( delta > 0 ? "down" : "up" ); 15899 }, 15900 15901 _getDragHorizontalDirection: function() { 15902 var delta = this.positionAbs.left - this.lastPositionAbs.left; 15903 return delta !== 0 && ( delta > 0 ? "right" : "left" ); 15904 }, 15905 15906 refresh: function( event ) { 15907 this._refreshItems( event ); 15908 this._setHandleClassName(); 15909 this.refreshPositions(); 15910 return this; 15911 }, 15912 15913 _connectWith: function() { 15914 var options = this.options; 15915 return options.connectWith.constructor === String ? 15916 [ options.connectWith ] : 15917 options.connectWith; 15918 }, 15919 15920 _getItemsAsjQuery: function( connected ) { 15921 15922 var i, j, cur, inst, 15923 items = [], 15924 queries = [], 15925 connectWith = this._connectWith(); 15926 15927 if ( connectWith && connected ) { 15928 for ( i = connectWith.length - 1; i >= 0; i-- ) { 15929 cur = $( connectWith[ i ], this.document[ 0 ] ); 15930 for ( j = cur.length - 1; j >= 0; j-- ) { 15931 inst = $.data( cur[ j ], this.widgetFullName ); 15932 if ( inst && inst !== this && !inst.options.disabled ) { 15933 queries.push( [ $.isFunction( inst.options.items ) ? 15934 inst.options.items.call( inst.element ) : 15935 $( inst.options.items, inst.element ) 15936 .not( ".ui-sortable-helper" ) 15937 .not( ".ui-sortable-placeholder" ), inst ] ); 15938 } 15939 } 15940 } 15941 } 15942 15943 queries.push( [ $.isFunction( this.options.items ) ? 15944 this.options.items 15945 .call( this.element, null, { options: this.options, item: this.currentItem } ) : 15946 $( this.options.items, this.element ) 15947 .not( ".ui-sortable-helper" ) 15948 .not( ".ui-sortable-placeholder" ), this ] ); 15949 15950 function addItems() { 15951 items.push( this ); 15952 } 15953 for ( i = queries.length - 1; i >= 0; i-- ) { 15954 queries[ i ][ 0 ].each( addItems ); 15955 } 15956 15957 return $( items ); 15958 15959 }, 15960 15961 _removeCurrentsFromItems: function() { 15962 15963 var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); 15964 15965 this.items = $.grep( this.items, function( item ) { 15966 for ( var j = 0; j < list.length; j++ ) { 15967 if ( list[ j ] === item.item[ 0 ] ) { 15968 return false; 15969 } 15970 } 15971 return true; 15972 } ); 15973 15974 }, 15975 15976 _refreshItems: function( event ) { 15977 15978 this.items = []; 15979 this.containers = [ this ]; 15980 15981 var i, j, cur, inst, targetData, _queries, item, queriesLength, 15982 items = this.items, 15983 queries = [ [ $.isFunction( this.options.items ) ? 15984 this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : 15985 $( this.options.items, this.element ), this ] ], 15986 connectWith = this._connectWith(); 15987 15988 //Shouldn't be run the first time through due to massive slow-down 15989 if ( connectWith && this.ready ) { 15990 for ( i = connectWith.length - 1; i >= 0; i-- ) { 15991 cur = $( connectWith[ i ], this.document[ 0 ] ); 15992 for ( j = cur.length - 1; j >= 0; j-- ) { 15993 inst = $.data( cur[ j ], this.widgetFullName ); 15994 if ( inst && inst !== this && !inst.options.disabled ) { 15995 queries.push( [ $.isFunction( inst.options.items ) ? 15996 inst.options.items 15997 .call( inst.element[ 0 ], event, { item: this.currentItem } ) : 15998 $( inst.options.items, inst.element ), inst ] ); 15999 this.containers.push( inst ); 16000 } 16001 } 16002 } 16003 } 16004 16005 for ( i = queries.length - 1; i >= 0; i-- ) { 16006 targetData = queries[ i ][ 1 ]; 16007 _queries = queries[ i ][ 0 ]; 16008 16009 for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { 16010 item = $( _queries[ j ] ); 16011 16012 // Data for target checking (mouse manager) 16013 item.data( this.widgetName + "-item", targetData ); 16014 16015 items.push( { 16016 item: item, 16017 instance: targetData, 16018 width: 0, height: 0, 16019 left: 0, top: 0 16020 } ); 16021 } 16022 } 16023 16024 }, 16025 16026 refreshPositions: function( fast ) { 16027 16028 // Determine whether items are being displayed horizontally 16029 this.floating = this.items.length ? 16030 this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : 16031 false; 16032 16033 //This has to be redone because due to the item being moved out/into the offsetParent, 16034 // the offsetParent's position will change 16035 if ( this.offsetParent && this.helper ) { 16036 this.offset.parent = this._getParentOffset(); 16037 } 16038 16039 var i, item, t, p; 16040 16041 for ( i = this.items.length - 1; i >= 0; i-- ) { 16042 item = this.items[ i ]; 16043 16044 //We ignore calculating positions of all connected containers when we're not over them 16045 if ( item.instance !== this.currentContainer && this.currentContainer && 16046 item.item[ 0 ] !== this.currentItem[ 0 ] ) { 16047 continue; 16048 } 16049 16050 t = this.options.toleranceElement ? 16051 $( this.options.toleranceElement, item.item ) : 16052 item.item; 16053 16054 if ( !fast ) { 16055 item.width = t.outerWidth(); 16056 item.height = t.outerHeight(); 16057 } 16058 16059 p = t.offset(); 16060 item.left = p.left; 16061 item.top = p.top; 16062 } 16063 16064 if ( this.options.custom && this.options.custom.refreshContainers ) { 16065 this.options.custom.refreshContainers.call( this ); 16066 } else { 16067 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16068 p = this.containers[ i ].element.offset(); 16069 this.containers[ i ].containerCache.left = p.left; 16070 this.containers[ i ].containerCache.top = p.top; 16071 this.containers[ i ].containerCache.width = 16072 this.containers[ i ].element.outerWidth(); 16073 this.containers[ i ].containerCache.height = 16074 this.containers[ i ].element.outerHeight(); 16075 } 16076 } 16077 16078 return this; 16079 }, 16080 16081 _createPlaceholder: function( that ) { 16082 that = that || this; 16083 var className, 16084 o = that.options; 16085 16086 if ( !o.placeholder || o.placeholder.constructor === String ) { 16087 className = o.placeholder; 16088 o.placeholder = { 16089 element: function() { 16090 16091 var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(), 16092 element = $( "<" + nodeName + ">", that.document[ 0 ] ); 16093 16094 that._addClass( element, "ui-sortable-placeholder", 16095 className || that.currentItem[ 0 ].className ) 16096 ._removeClass( element, "ui-sortable-helper" ); 16097 16098 if ( nodeName === "tbody" ) { 16099 that._createTrPlaceholder( 16100 that.currentItem.find( "tr" ).eq( 0 ), 16101 $( "<tr>", that.document[ 0 ] ).appendTo( element ) 16102 ); 16103 } else if ( nodeName === "tr" ) { 16104 that._createTrPlaceholder( that.currentItem, element ); 16105 } else if ( nodeName === "img" ) { 16106 element.attr( "src", that.currentItem.attr( "src" ) ); 16107 } 16108 16109 if ( !className ) { 16110 element.css( "visibility", "hidden" ); 16111 } 16112 16113 return element; 16114 }, 16115 update: function( container, p ) { 16116 16117 // 1. If a className is set as 'placeholder option, we don't force sizes - 16118 // the class is responsible for that 16119 // 2. The option 'forcePlaceholderSize can be enabled to force it even if a 16120 // class name is specified 16121 if ( className && !o.forcePlaceholderSize ) { 16122 return; 16123 } 16124 16125 //If the element doesn't have a actual height by itself (without styles coming 16126 // from a stylesheet), it receives the inline height from the dragged item 16127 if ( !p.height() ) { 16128 p.height( 16129 that.currentItem.innerHeight() - 16130 parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - 16131 parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); 16132 } 16133 if ( !p.width() ) { 16134 p.width( 16135 that.currentItem.innerWidth() - 16136 parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - 16137 parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); 16138 } 16139 } 16140 }; 16141 } 16142 16143 //Create the placeholder 16144 that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); 16145 16146 //Append it after the actual current item 16147 that.currentItem.after( that.placeholder ); 16148 16149 //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) 16150 o.placeholder.update( that, that.placeholder ); 16151 16152 }, 16153 16154 _createTrPlaceholder: function( sourceTr, targetTr ) { 16155 var that = this; 16156 16157 sourceTr.children().each( function() { 16158 $( "<td> </td>", that.document[ 0 ] ) 16159 .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) 16160 .appendTo( targetTr ); 16161 } ); 16162 }, 16163 16164 _contactContainers: function( event ) { 16165 var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, 16166 floating, axis, 16167 innermostContainer = null, 16168 innermostIndex = null; 16169 16170 // Get innermost container that intersects with item 16171 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16172 16173 // Never consider a container that's located within the item itself 16174 if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { 16175 continue; 16176 } 16177 16178 if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { 16179 16180 // If we've already found a container and it's more "inner" than this, then continue 16181 if ( innermostContainer && 16182 $.contains( 16183 this.containers[ i ].element[ 0 ], 16184 innermostContainer.element[ 0 ] ) ) { 16185 continue; 16186 } 16187 16188 innermostContainer = this.containers[ i ]; 16189 innermostIndex = i; 16190 16191 } else { 16192 16193 // container doesn't intersect. trigger "out" event if necessary 16194 if ( this.containers[ i ].containerCache.over ) { 16195 this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); 16196 this.containers[ i ].containerCache.over = 0; 16197 } 16198 } 16199 16200 } 16201 16202 // If no intersecting containers found, return 16203 if ( !innermostContainer ) { 16204 return; 16205 } 16206 16207 // Move the item into the container if it's not there already 16208 if ( this.containers.length === 1 ) { 16209 if ( !this.containers[ innermostIndex ].containerCache.over ) { 16210 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 16211 this.containers[ innermostIndex ].containerCache.over = 1; 16212 } 16213 } else { 16214 16215 // When entering a new container, we will find the item with the least distance and 16216 // append our item near it 16217 dist = 10000; 16218 itemWithLeastDistance = null; 16219 floating = innermostContainer.floating || this._isFloating( this.currentItem ); 16220 posProperty = floating ? "left" : "top"; 16221 sizeProperty = floating ? "width" : "height"; 16222 axis = floating ? "pageX" : "pageY"; 16223 16224 for ( j = this.items.length - 1; j >= 0; j-- ) { 16225 if ( !$.contains( 16226 this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) 16227 ) { 16228 continue; 16229 } 16230 if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { 16231 continue; 16232 } 16233 16234 cur = this.items[ j ].item.offset()[ posProperty ]; 16235 nearBottom = false; 16236 if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { 16237 nearBottom = true; 16238 } 16239 16240 if ( Math.abs( event[ axis ] - cur ) < dist ) { 16241 dist = Math.abs( event[ axis ] - cur ); 16242 itemWithLeastDistance = this.items[ j ]; 16243 this.direction = nearBottom ? "up" : "down"; 16244 } 16245 } 16246 16247 //Check if dropOnEmpty is enabled 16248 if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { 16249 return; 16250 } 16251 16252 if ( this.currentContainer === this.containers[ innermostIndex ] ) { 16253 if ( !this.currentContainer.containerCache.over ) { 16254 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); 16255 this.currentContainer.containerCache.over = 1; 16256 } 16257 return; 16258 } 16259 16260 itemWithLeastDistance ? 16261 this._rearrange( event, itemWithLeastDistance, null, true ) : 16262 this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); 16263 this._trigger( "change", event, this._uiHash() ); 16264 this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); 16265 this.currentContainer = this.containers[ innermostIndex ]; 16266 16267 //Update the placeholder 16268 this.options.placeholder.update( this.currentContainer, this.placeholder ); 16269 16270 this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); 16271 this.containers[ innermostIndex ].containerCache.over = 1; 16272 } 16273 16274 }, 16275 16276 _createHelper: function( event ) { 16277 16278 var o = this.options, 16279 helper = $.isFunction( o.helper ) ? 16280 $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : 16281 ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); 16282 16283 //Add the helper to the DOM if that didn't happen already 16284 if ( !helper.parents( "body" ).length ) { 16285 $( o.appendTo !== "parent" ? 16286 o.appendTo : 16287 this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] ); 16288 } 16289 16290 if ( helper[ 0 ] === this.currentItem[ 0 ] ) { 16291 this._storedCSS = { 16292 width: this.currentItem[ 0 ].style.width, 16293 height: this.currentItem[ 0 ].style.height, 16294 position: this.currentItem.css( "position" ), 16295 top: this.currentItem.css( "top" ), 16296 left: this.currentItem.css( "left" ) 16297 }; 16298 } 16299 16300 if ( !helper[ 0 ].style.width || o.forceHelperSize ) { 16301 helper.width( this.currentItem.width() ); 16302 } 16303 if ( !helper[ 0 ].style.height || o.forceHelperSize ) { 16304 helper.height( this.currentItem.height() ); 16305 } 16306 16307 return helper; 16308 16309 }, 16310 16311 _adjustOffsetFromHelper: function( obj ) { 16312 if ( typeof obj === "string" ) { 16313 obj = obj.split( " " ); 16314 } 16315 if ( $.isArray( obj ) ) { 16316 obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; 16317 } 16318 if ( "left" in obj ) { 16319 this.offset.click.left = obj.left + this.margins.left; 16320 } 16321 if ( "right" in obj ) { 16322 this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; 16323 } 16324 if ( "top" in obj ) { 16325 this.offset.click.top = obj.top + this.margins.top; 16326 } 16327 if ( "bottom" in obj ) { 16328 this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; 16329 } 16330 }, 16331 16332 _getParentOffset: function() { 16333 16334 //Get the offsetParent and cache its position 16335 this.offsetParent = this.helper.offsetParent(); 16336 var po = this.offsetParent.offset(); 16337 16338 // This is a special case where we need to modify a offset calculated on start, since the 16339 // following happened: 16340 // 1. The position of the helper is absolute, so it's position is calculated based on the 16341 // next positioned parent 16342 // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't 16343 // the document, which means that the scroll is included in the initial calculation of the 16344 // offset of the parent, and never recalculated upon drag 16345 if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && 16346 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { 16347 po.left += this.scrollParent.scrollLeft(); 16348 po.top += this.scrollParent.scrollTop(); 16349 } 16350 16351 // This needs to be actually done for all browsers, since pageX/pageY includes this 16352 // information with an ugly IE fix 16353 if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || 16354 ( this.offsetParent[ 0 ].tagName && 16355 this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { 16356 po = { top: 0, left: 0 }; 16357 } 16358 16359 return { 16360 top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), 16361 left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) 16362 }; 16363 16364 }, 16365 16366 _getRelativeOffset: function() { 16367 16368 if ( this.cssPosition === "relative" ) { 16369 var p = this.currentItem.position(); 16370 return { 16371 top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + 16372 this.scrollParent.scrollTop(), 16373 left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + 16374 this.scrollParent.scrollLeft() 16375 }; 16376 } else { 16377 return { top: 0, left: 0 }; 16378 } 16379 16380 }, 16381 16382 _cacheMargins: function() { 16383 this.margins = { 16384 left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), 16385 top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) 16386 }; 16387 }, 16388 16389 _cacheHelperProportions: function() { 16390 this.helperProportions = { 16391 width: this.helper.outerWidth(), 16392 height: this.helper.outerHeight() 16393 }; 16394 }, 16395 16396 _setContainment: function() { 16397 16398 var ce, co, over, 16399 o = this.options; 16400 if ( o.containment === "parent" ) { 16401 o.containment = this.helper[ 0 ].parentNode; 16402 } 16403 if ( o.containment === "document" || o.containment === "window" ) { 16404 this.containment = [ 16405 0 - this.offset.relative.left - this.offset.parent.left, 16406 0 - this.offset.relative.top - this.offset.parent.top, 16407 o.containment === "document" ? 16408 this.document.width() : 16409 this.window.width() - this.helperProportions.width - this.margins.left, 16410 ( o.containment === "document" ? 16411 ( this.document.height() || document.body.parentNode.scrollHeight ) : 16412 this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight 16413 ) - this.helperProportions.height - this.margins.top 16414 ]; 16415 } 16416 16417 if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { 16418 ce = $( o.containment )[ 0 ];
vendor: 2,296 bytes, lines 16419-16480
16419 co = $( o.containment ).offset(); 16420 over = ( $( ce ).css( "overflow" ) !== "hidden" ); 16421 16422 this.containment = [ 16423 co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + 16424 ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, 16425 co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + 16426 ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, 16427 co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - 16428 ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - 16429 ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - 16430 this.helperProportions.width - this.margins.left, 16431 co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - 16432 ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - 16433 ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - 16434 16435 this.helperProportions.height - this.margins.top 16436 ]; 16437 } 16438 16439 }, 16440 16441 _convertPositionTo: function( d, pos ) { 16442 16443 if ( !pos ) { 16444 pos = this.position; 16445 } 16446 var mod = d === "absolute" ? 1 : -1, 16447 scroll = this.cssPosition === "absolute" && 16448 !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16449 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 16450 this.offsetParent : 16451 this.scrollParent, 16452 scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 16453 16454 return { 16455 top: ( 16456 16457 // The absolute mouse position 16458 pos.top + 16459 16460 // Only for relative positioned nodes: Relative offset from element to offset parent 16461 this.offset.relative.top * mod + 16462 16463 // The offsetParent's offset without borders (offset + border) 16464 this.offset.parent.top * mod - 16465 ( ( this.cssPosition === "fixed" ? 16466 -this.scrollParent.scrollTop() : 16467 ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) 16468 ), 16469 left: ( 16470 16471 // The absolute mouse position 16472 pos.left + 16473 16474 // Only for relative positioned nodes: Relative offset from element to offset parent 16475 this.offset.relative.left * mod + 16476 16477 // The offsetParent's offset without borders (offset + border) 16478 this.offset.parent.left * mod - 16479 ( ( this.cssPosition === "fixed" ? 16480 -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
vendor: 9,150 bytes, lines 16481-16765
16481 scroll.scrollLeft() ) * mod ) 16482 ) 16483 }; 16484 16485 }, 16486 16487 _generatePosition: function( event ) { 16488 16489 var top, left, 16490 o = this.options, 16491 pageX = event.pageX, 16492 pageY = event.pageY, 16493 scroll = this.cssPosition === "absolute" && 16494 !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16495 $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? 16496 this.offsetParent : 16497 this.scrollParent, 16498 scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); 16499 16500 // This is another very weird special case that only happens for relative elements: 16501 // 1. If the css position is relative 16502 // 2. and the scroll parent is the document or similar to the offset parent 16503 // we have to refresh the relative offset during the scroll so there are no jumps 16504 if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && 16505 this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { 16506 this.offset.relative = this._getRelativeOffset(); 16507 } 16508 16509 /* 16510 * - Position constraining - 16511 * Constrain the position to a mix of grid, containment. 16512 */ 16513 16514 if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options 16515 16516 if ( this.containment ) { 16517 if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { 16518 pageX = this.containment[ 0 ] + this.offset.click.left; 16519 } 16520 if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { 16521 pageY = this.containment[ 1 ] + this.offset.click.top; 16522 } 16523 if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { 16524 pageX = this.containment[ 2 ] + this.offset.click.left; 16525 } 16526 if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { 16527 pageY = this.containment[ 3 ] + this.offset.click.top; 16528 } 16529 } 16530 16531 if ( o.grid ) { 16532 top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / 16533 o.grid[ 1 ] ) * o.grid[ 1 ]; 16534 pageY = this.containment ? 16535 ( ( top - this.offset.click.top >= this.containment[ 1 ] && 16536 top - this.offset.click.top <= this.containment[ 3 ] ) ? 16537 top : 16538 ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? 16539 top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : 16540 top; 16541 16542 left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / 16543 o.grid[ 0 ] ) * o.grid[ 0 ]; 16544 pageX = this.containment ? 16545 ( ( left - this.offset.click.left >= this.containment[ 0 ] && 16546 left - this.offset.click.left <= this.containment[ 2 ] ) ? 16547 left : 16548 ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? 16549 left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : 16550 left; 16551 } 16552 16553 } 16554 16555 return { 16556 top: ( 16557 16558 // The absolute mouse position 16559 pageY - 16560 16561 // Click offset (relative to the element) 16562 this.offset.click.top - 16563 16564 // Only for relative positioned nodes: Relative offset from element to offset parent 16565 this.offset.relative.top - 16566 16567 // The offsetParent's offset without borders (offset + border) 16568 this.offset.parent.top + 16569 ( ( this.cssPosition === "fixed" ? 16570 -this.scrollParent.scrollTop() : 16571 ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) 16572 ), 16573 left: ( 16574 16575 // The absolute mouse position 16576 pageX - 16577 16578 // Click offset (relative to the element) 16579 this.offset.click.left - 16580 16581 // Only for relative positioned nodes: Relative offset from element to offset parent 16582 this.offset.relative.left - 16583 16584 // The offsetParent's offset without borders (offset + border) 16585 this.offset.parent.left + 16586 ( ( this.cssPosition === "fixed" ? 16587 -this.scrollParent.scrollLeft() : 16588 scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) 16589 ) 16590 }; 16591 16592 }, 16593 16594 _rearrange: function( event, i, a, hardRefresh ) { 16595 16596 a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) : 16597 i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], 16598 ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); 16599 16600 //Various things done here to improve the performance: 16601 // 1. we create a setTimeout, that calls refreshPositions 16602 // 2. on the instance, we have a counter variable, that get's higher after every append 16603 // 3. on the local scope, we copy the counter variable, and check in the timeout, 16604 // if it's still the same 16605 // 4. this lets only the last addition to the timeout stack through 16606 this.counter = this.counter ? ++this.counter : 1; 16607 var counter = this.counter; 16608 16609 this._delay( function() { 16610 if ( counter === this.counter ) { 16611 16612 //Precompute after each DOM insertion, NOT on mousemove 16613 this.refreshPositions( !hardRefresh ); 16614 } 16615 } ); 16616 16617 }, 16618 16619 _clear: function( event, noPropagation ) { 16620 16621 this.reverting = false; 16622 16623 // We delay all events that have to be triggered to after the point where the placeholder 16624 // has been removed and everything else normalized again 16625 var i, 16626 delayedTriggers = []; 16627 16628 // We first have to update the dom position of the actual currentItem 16629 // Note: don't do it if the current item is already removed (by a user), or it gets 16630 // reappended (see #4088) 16631 if ( !this._noFinalSort && this.currentItem.parent().length ) { 16632 this.placeholder.before( this.currentItem ); 16633 } 16634 this._noFinalSort = null; 16635 16636 if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { 16637 for ( i in this._storedCSS ) { 16638 if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { 16639 this._storedCSS[ i ] = ""; 16640 } 16641 } 16642 this.currentItem.css( this._storedCSS ); 16643 this._removeClass( this.currentItem, "ui-sortable-helper" ); 16644 } else { 16645 this.currentItem.show(); 16646 } 16647 16648 if ( this.fromOutside && !noPropagation ) { 16649 delayedTriggers.push( function( event ) { 16650 this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); 16651 } ); 16652 } 16653 if ( ( this.fromOutside || 16654 this.domPosition.prev !== 16655 this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || 16656 this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { 16657 16658 // Trigger update callback if the DOM position has changed 16659 delayedTriggers.push( function( event ) { 16660 this._trigger( "update", event, this._uiHash() ); 16661 } ); 16662 } 16663 16664 // Check if the items Container has Changed and trigger appropriate 16665 // events. 16666 if ( this !== this.currentContainer ) { 16667 if ( !noPropagation ) { 16668 delayedTriggers.push( function( event ) { 16669 this._trigger( "remove", event, this._uiHash() ); 16670 } ); 16671 delayedTriggers.push( ( function( c ) { 16672 return function( event ) { 16673 c._trigger( "receive", event, this._uiHash( this ) ); 16674 }; 16675 } ).call( this, this.currentContainer ) ); 16676 delayedTriggers.push( ( function( c ) { 16677 return function( event ) { 16678 c._trigger( "update", event, this._uiHash( this ) ); 16679 }; 16680 } ).call( this, this.currentContainer ) ); 16681 } 16682 } 16683 16684 //Post events to containers 16685 function delayEvent( type, instance, container ) { 16686 return function( event ) { 16687 container._trigger( type, event, instance._uiHash( instance ) ); 16688 }; 16689 } 16690 for ( i = this.containers.length - 1; i >= 0; i-- ) { 16691 if ( !noPropagation ) { 16692 delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); 16693 } 16694 if ( this.containers[ i ].containerCache.over ) { 16695 delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); 16696 this.containers[ i ].containerCache.over = 0; 16697 } 16698 } 16699 16700 //Do what was originally in plugins 16701 if ( this.storedCursor ) { 16702 this.document.find( "body" ).css( "cursor", this.storedCursor ); 16703 this.storedStylesheet.remove(); 16704 } 16705 if ( this._storedOpacity ) { 16706 this.helper.css( "opacity", this._storedOpacity ); 16707 } 16708 if ( this._storedZIndex ) { 16709 this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); 16710 } 16711 16712 this.dragging = false; 16713 16714 if ( !noPropagation ) { 16715 this._trigger( "beforeStop", event, this._uiHash() ); 16716 } 16717 16718 //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, 16719 // it unbinds ALL events from the original node! 16720 this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); 16721 16722 if ( !this.cancelHelperRemoval ) { 16723 if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { 16724 this.helper.remove(); 16725 } 16726 this.helper = null; 16727 } 16728 16729 if ( !noPropagation ) { 16730 for ( i = 0; i < delayedTriggers.length; i++ ) { 16731 16732 // Trigger all delayed events 16733 delayedTriggers[ i ].call( this, event ); 16734 } 16735 this._trigger( "stop", event, this._uiHash() ); 16736 } 16737 16738 this.fromOutside = false; 16739 return !this.cancelHelperRemoval; 16740 16741 }, 16742 16743 _trigger: function() { 16744 if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { 16745 this.cancel(); 16746 } 16747 }, 16748 16749 _uiHash: function( _inst ) { 16750 var inst = _inst || this; 16751 return { 16752 helper: inst.helper, 16753 placeholder: inst.placeholder || $( [] ), 16754 position: inst.position, 16755 originalPosition: inst.originalPosition, 16756 offset: inst.positionAbs, 16757 item: inst.currentItem, 16758 sender: _inst ? _inst.element : null 16759 }; 16760 } 16761 16762} ); 16763 16764 16765/*!
vendor: 4,521 bytes, lines 16766-16933
16766 * jQuery UI Spinner 1.12.0 16767 * http://jqueryui.com 16768 * 16769 * Copyright jQuery Foundation and other contributors 16770 * Released under the MIT license. 16771 * http://jquery.org/license 16772 */ 16773 16774//>>label: Spinner 16775//>>group: Widgets 16776//>>description: Displays buttons to easily input numbers via the keyboard or mouse. 16777//>>docs: http://api.jqueryui.com/spinner/ 16778//>>demos: http://jqueryui.com/spinner/ 16779//>>css.structure: ../../themes/base/core.css 16780//>>css.structure: ../../themes/base/spinner.css 16781//>>css.theme: ../../themes/base/theme.css 16782 16783 16784 16785function spinnerModifer( fn ) { 16786 return function() { 16787 var previous = this.element.val(); 16788 fn.apply( this, arguments ); 16789 this._refresh(); 16790 if ( previous !== this.element.val() ) { 16791 this._trigger( "change" ); 16792 } 16793 }; 16794} 16795 16796$.widget( "ui.spinner", { 16797 version: "1.12.0", 16798 defaultElement: "<input>", 16799 widgetEventPrefix: "spin", 16800 options: { 16801 classes: { 16802 "ui-spinner": "ui-corner-all", 16803 "ui-spinner-down": "ui-corner-br", 16804 "ui-spinner-up": "ui-corner-tr" 16805 }, 16806 culture: null, 16807 icons: { 16808 down: "ui-icon-triangle-1-s", 16809 up: "ui-icon-triangle-1-n" 16810 }, 16811 incremental: true, 16812 max: null, 16813 min: null, 16814 numberFormat: null, 16815 page: 10, 16816 step: 1, 16817 16818 change: null, 16819 spin: null, 16820 start: null, 16821 stop: null 16822 }, 16823 16824 _create: function() { 16825 16826 // handle string values that need to be parsed 16827 this._setOption( "max", this.options.max ); 16828 this._setOption( "min", this.options.min ); 16829 this._setOption( "step", this.options.step ); 16830 16831 // Only format if there is a value, prevents the field from being marked 16832 // as invalid in Firefox, see #9573. 16833 if ( this.value() !== "" ) { 16834 16835 // Format the value, but don't constrain. 16836 this._value( this.element.val(), true ); 16837 } 16838 16839 16840 this._draw(); 16841 this._on( this._events ); 16842 this._refresh(); 16843 16844 // Turning off autocomplete prevents the browser from remembering the 16845 // value when navigating through history, so we re-enable autocomplete 16846 // if the page is unloaded before the widget is destroyed. #7790 16847 this._on( this.window, { 16848 beforeunload: function() { 16849 this.element.removeAttr( "autocomplete" ); 16850 } 16851 } ); 16852 }, 16853 16854 _getCreateOptions: function() { 16855 var options = this._super(); 16856 var element = this.element; 16857 16858 $.each( [ "min", "max", "step" ], function( i, option ) { 16859 var value = element.attr( option ); 16860 if ( value != null && value.length ) { 16861 options[ option ] = value; 16862 } 16863 } ); 16864 16865 return options; 16866 }, 16867 16868 _events: { 16869 keydown: function( event ) { 16870 if ( this._start( event ) && this._keydown( event ) ) { 16871 event.preventDefault(); 16872 } 16873 }, 16874 keyup: "_stop", 16875 focus: function() { 16876 this.previous = this.element.val(); 16877 }, 16878 blur: function( event ) { 16879 if ( this.cancelBlur ) { 16880 delete this.cancelBlur; 16881 return; 16882 } 16883 16884 this._stop(); 16885 this._refresh(); 16886 if ( this.previous !== this.element.val() ) { 16887 this._trigger( "change", event ); 16888 } 16889 }, 16890 mousewheel: function( event, delta ) { 16891 if ( !delta ) { 16892 return; 16893 } 16894 if ( !this.spinning && !this._start( event ) ) { 16895 return false; 16896 } 16897 16898 this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event ); 16899 clearTimeout( this.mousewheelTimer ); 16900 this.mousewheelTimer = this._delay( function() { 16901 if ( this.spinning ) { 16902 this._stop( event ); 16903 } 16904 }, 100 ); 16905 event.preventDefault(); 16906 }, 16907 "mousedown .ui-spinner-button": function( event ) { 16908 var previous; 16909 16910 // We never want the buttons to have focus; whenever the user is 16911 // interacting with the spinner, the focus should be on the input. 16912 // If the input is focused then this.previous is properly set from 16913 // when the input first received focus. If the input is not focused 16914 // then we need to set this.previous based on the value before spinning. 16915 previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ? 16916 this.previous : this.element.val(); 16917 function checkFocus() { 16918 var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ); 16919 if ( !isActive ) { 16920 this.element.trigger( "focus" ); 16921 this.previous = previous; 16922 16923 // support: IE 16924 // IE sets focus asynchronously, so we need to check if focus 16925 // moved off of the input because the user clicked on the button. 16926 this._delay( function() { 16927 this.previous = previous; 16928 } ); 16929 } 16930 } 16931 16932 // Ensure focus is on (or stays on) the text field 16933 event.preventDefault();
vendor: 5,988 bytes, lines 16934-17164
16934 checkFocus.call( this ); 16935 16936 // Support: IE 16937 // IE doesn't prevent moving focus even with event.preventDefault() 16938 // so we set a flag to know when we should ignore the blur event 16939 // and check (again) if focus moved off of the input. 16940 this.cancelBlur = true; 16941 this._delay( function() { 16942 delete this.cancelBlur; 16943 checkFocus.call( this ); 16944 } ); 16945 16946 if ( this._start( event ) === false ) { 16947 return; 16948 } 16949 16950 this._repeat( null, $( event.currentTarget ) 16951 .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); 16952 }, 16953 "mouseup .ui-spinner-button": "_stop", 16954 "mouseenter .ui-spinner-button": function( event ) { 16955 16956 // button will add ui-state-active if mouse was down while mouseleave and kept down 16957 if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { 16958 return; 16959 } 16960 16961 if ( this._start( event ) === false ) { 16962 return false; 16963 } 16964 this._repeat( null, $( event.currentTarget ) 16965 .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); 16966 }, 16967 16968 // TODO: do we really want to consider this a stop? 16969 // shouldn't we just stop the repeater and wait until mouseup before 16970 // we trigger the stop event? 16971 "mouseleave .ui-spinner-button": "_stop" 16972 }, 16973 16974 // Support mobile enhanced option and make backcompat more sane 16975 _enhance: function() { 16976 this.uiSpinner = this.element 16977 .attr( "autocomplete", "off" ) 16978 .wrap( "<span>" ) 16979 .parent() 16980 16981 // Add buttons 16982 .append( 16983 "<a></a><a></a>" 16984 ); 16985 }, 16986 16987 _draw: function() { 16988 this._enhance(); 16989 16990 this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" ); 16991 this._addClass( "ui-spinner-input" ); 16992 16993 this.element.attr( "role", "spinbutton" ); 16994 16995 // Button bindings 16996 this.buttons = this.uiSpinner.children( "a" ) 16997 .attr( "tabIndex", -1 ) 16998 .attr( "aria-hidden", true ) 16999 .button( { 17000 classes: { 17001 "ui-button": "" 17002 } 17003 } ); 17004 17005 // TODO: Right now button does not support classes this is already updated in button PR 17006 this._removeClass( this.buttons, "ui-corner-all" ); 17007 17008 this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" ); 17009 this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" ); 17010 this.buttons.first().button( { 17011 "icon": this.options.icons.up, 17012 "showLabel": false 17013 } ); 17014 this.buttons.last().button( { 17015 "icon": this.options.icons.down, 17016 "showLabel": false 17017 } ); 17018 17019 // IE 6 doesn't understand height: 50% for the buttons 17020 // unless the wrapper has an explicit height 17021 if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) && 17022 this.uiSpinner.height() > 0 ) { 17023 this.uiSpinner.height( this.uiSpinner.height() ); 17024 } 17025 }, 17026 17027 _keydown: function( event ) { 17028 var options = this.options, 17029 keyCode = $.ui.keyCode; 17030 17031 switch ( event.keyCode ) { 17032 case keyCode.UP: 17033 this._repeat( null, 1, event ); 17034 return true; 17035 case keyCode.DOWN: 17036 this._repeat( null, -1, event ); 17037 return true; 17038 case keyCode.PAGE_UP: 17039 this._repeat( null, options.page, event ); 17040 return true; 17041 case keyCode.PAGE_DOWN: 17042 this._repeat( null, -options.page, event ); 17043 return true; 17044 } 17045 17046 return false; 17047 }, 17048 17049 _start: function( event ) { 17050 if ( !this.spinning && this._trigger( "start", event ) === false ) { 17051 return false; 17052 } 17053 17054 if ( !this.counter ) { 17055 this.counter = 1; 17056 } 17057 this.spinning = true; 17058 return true; 17059 }, 17060 17061 _repeat: function( i, steps, event ) { 17062 i = i || 500; 17063 17064 clearTimeout( this.timer ); 17065 this.timer = this._delay( function() { 17066 this._repeat( 40, steps, event ); 17067 }, i ); 17068 17069 this._spin( steps * this.options.step, event ); 17070 }, 17071 17072 _spin: function( step, event ) { 17073 var value = this.value() || 0; 17074 17075 if ( !this.counter ) { 17076 this.counter = 1; 17077 } 17078 17079 value = this._adjustValue( value + step * this._increment( this.counter ) ); 17080 17081 if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) { 17082 this._value( value ); 17083 this.counter++; 17084 } 17085 }, 17086 17087 _increment: function( i ) { 17088 var incremental = this.options.incremental; 17089 17090 if ( incremental ) { 17091 return $.isFunction( incremental ) ? 17092 incremental( i ) : 17093 Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); 17094 } 17095 17096 return 1; 17097 }, 17098 17099 _precision: function() { 17100 var precision = this._precisionOf( this.options.step ); 17101 if ( this.options.min !== null ) { 17102 precision = Math.max( precision, this._precisionOf( this.options.min ) ); 17103 } 17104 return precision; 17105 }, 17106 17107 _precisionOf: function( num ) { 17108 var str = num.toString(), 17109 decimal = str.indexOf( "." ); 17110 return decimal === -1 ? 0 : str.length - decimal - 1; 17111 }, 17112 17113 _adjustValue: function( value ) { 17114 var base, aboveMin, 17115 options = this.options; 17116 17117 // Make sure we're at a valid step 17118 // - find out where we are relative to the base (min or 0) 17119 base = options.min !== null ? options.min : 0; 17120 aboveMin = value - base; 17121 17122 // - round to the nearest step 17123 aboveMin = Math.round( aboveMin / options.step ) * options.step; 17124 17125 // - rounding is based on 0, so adjust back to our base 17126 value = base + aboveMin; 17127 17128 // Fix precision from bad JS floating point math 17129 value = parseFloat( value.toFixed( this._precision() ) ); 17130 17131 // Clamp the value 17132 if ( options.max !== null && value > options.max ) { 17133 return options.max; 17134 } 17135 if ( options.min !== null && value < options.min ) { 17136 return options.min; 17137 17138 } 17139 17140 return value; 17141 }, 17142 17143 _stop: function( event ) { 17144 if ( !this.spinning ) { 17145 return; 17146 } 17147 17148 clearTimeout( this.timer ); 17149 clearTimeout( this.mousewheelTimer ); 17150 this.counter = 0; 17151 this.spinning = false; 17152 this._trigger( "stop", event ); 17153 }, 17154 17155 _setOption: function( key, value ) { 17156 var prevValue, first, last; 17157 17158 if ( key === "culture" || key === "numberFormat" ) { 17159 prevValue = this._parse( this.element.val() ); 17160 this.options[ key ] = value; 17161 this.element.val( this._format( prevValue ) ); 17162 return; 17163 } 17164
vendor: 12,920 bytes, lines 17165-17661
17165 if ( key === "max" || key === "min" || key === "step" ) { 17166 if ( typeof value === "string" ) { 17167 value = this._parse( value ); 17168 } 17169 } 17170 if ( key === "icons" ) { 17171 first = this.buttons.first().find( ".ui-icon" ); 17172 this._removeClass( first, null, this.options.icons.up ); 17173 this._addClass( first, null, value.up ); 17174 last = this.buttons.last().find( ".ui-icon" ); 17175 this._removeClass( last, null, this.options.icons.down ); 17176 this._addClass( last, null, value.down ); 17177 } 17178 17179 this._super( key, value ); 17180 }, 17181 17182 _setOptionDisabled: function( value ) { 17183 this._super( value ); 17184 17185 this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value ); 17186 this.element.prop( "disabled", !!value ); 17187 this.buttons.button( value ? "disable" : "enable" ); 17188 }, 17189 17190 _setOptions: spinnerModifer( function( options ) { 17191 this._super( options ); 17192 } ), 17193 17194 _parse: function( val ) { 17195 if ( typeof val === "string" && val !== "" ) { 17196 val = window.Globalize && this.options.numberFormat ? 17197 Globalize.parseFloat( val, 10, this.options.culture ) : +val; 17198 } 17199 return val === "" || isNaN( val ) ? null : val; 17200 }, 17201 17202 _format: function( value ) { 17203 if ( value === "" ) { 17204 return ""; 17205 } 17206 return window.Globalize && this.options.numberFormat ? 17207 Globalize.format( value, this.options.numberFormat, this.options.culture ) : 17208 value; 17209 }, 17210 17211 _refresh: function() { 17212 this.element.attr( { 17213 "aria-valuemin": this.options.min, 17214 "aria-valuemax": this.options.max, 17215 17216 // TODO: what should we do with values that can't be parsed? 17217 "aria-valuenow": this._parse( this.element.val() ) 17218 } ); 17219 }, 17220 17221 isValid: function() { 17222 var value = this.value(); 17223 17224 // Null is invalid 17225 if ( value === null ) { 17226 return false; 17227 } 17228 17229 // If value gets adjusted, it's invalid 17230 return value === this._adjustValue( value ); 17231 }, 17232 17233 // Update the value without triggering change 17234 _value: function( value, allowAny ) { 17235 var parsed; 17236 if ( value !== "" ) { 17237 parsed = this._parse( value ); 17238 if ( parsed !== null ) { 17239 if ( !allowAny ) { 17240 parsed = this._adjustValue( parsed ); 17241 } 17242 value = this._format( parsed ); 17243 } 17244 } 17245 this.element.val( value ); 17246 this._refresh(); 17247 }, 17248 17249 _destroy: function() { 17250 this.element 17251 .prop( "disabled", false ) 17252 .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" ); 17253 17254 this.uiSpinner.replaceWith( this.element ); 17255 }, 17256 17257 stepUp: spinnerModifer( function( steps ) { 17258 this._stepUp( steps ); 17259 } ), 17260 _stepUp: function( steps ) { 17261 if ( this._start() ) { 17262 this._spin( ( steps || 1 ) * this.options.step ); 17263 this._stop(); 17264 } 17265 }, 17266 17267 stepDown: spinnerModifer( function( steps ) { 17268 this._stepDown( steps ); 17269 } ), 17270 _stepDown: function( steps ) { 17271 if ( this._start() ) { 17272 this._spin( ( steps || 1 ) * -this.options.step ); 17273 this._stop(); 17274 } 17275 }, 17276 17277 pageUp: spinnerModifer( function( pages ) { 17278 this._stepUp( ( pages || 1 ) * this.options.page ); 17279 } ), 17280 17281 pageDown: spinnerModifer( function( pages ) { 17282 this._stepDown( ( pages || 1 ) * this.options.page ); 17283 } ), 17284 17285 value: function( newVal ) { 17286 if ( !arguments.length ) { 17287 return this._parse( this.element.val() ); 17288 } 17289 spinnerModifer( this._value ).call( this, newVal ); 17290 }, 17291 17292 widget: function() { 17293 return this.uiSpinner; 17294 } 17295} ); 17296 17297// DEPRECATED 17298// TODO: switch return back to widget declaration at top of file when this is removed 17299if ( $.uiBackCompat !== false ) { 17300 17301 // Backcompat for spinner html extension points 17302 $.widget( "ui.spinner", $.ui.spinner, { 17303 _enhance: function() { 17304 this.uiSpinner = this.element 17305 .attr( "autocomplete", "off" ) 17306 .wrap( this._uiSpinnerHtml() ) 17307 .parent() 17308 17309 // Add buttons 17310 .append( this._buttonHtml() ); 17311 }, 17312 _uiSpinnerHtml: function() { 17313 return "<span>"; 17314 }, 17315 17316 _buttonHtml: function() { 17317 return "<a></a><a></a>"; 17318 } 17319 } ); 17320} 17321 17322var widgetsSpinner = $.ui.spinner; 17323 17324 17325/*! 17326 * jQuery UI Tabs 1.12.0 17327 * http://jqueryui.com 17328 * 17329 * Copyright jQuery Foundation and other contributors 17330 * Released under the MIT license. 17331 * http://jquery.org/license 17332 */ 17333 17334//>>label: Tabs 17335//>>group: Widgets 17336//>>description: Transforms a set of container elements into a tab structure. 17337//>>docs: http://api.jqueryui.com/tabs/ 17338//>>demos: http://jqueryui.com/tabs/ 17339//>>css.structure: ../../themes/base/core.css 17340//>>css.structure: ../../themes/base/tabs.css 17341//>>css.theme: ../../themes/base/theme.css 17342 17343 17344 17345$.widget( "ui.tabs", { 17346 version: "1.12.0", 17347 delay: 300, 17348 options: { 17349 active: null, 17350 classes: { 17351 "ui-tabs": "ui-corner-all", 17352 "ui-tabs-nav": "ui-corner-all", 17353 "ui-tabs-panel": "ui-corner-bottom", 17354 "ui-tabs-tab": "ui-corner-top" 17355 }, 17356 collapsible: false, 17357 event: "click", 17358 heightStyle: "content", 17359 hide: null, 17360 show: null, 17361 17362 // Callbacks 17363 activate: null, 17364 beforeActivate: null, 17365 beforeLoad: null, 17366 load: null 17367 }, 17368 17369 _isLocal: ( function() { 17370 var rhash = /#.*$/; 17371 17372 return function( anchor ) { 17373 var anchorUrl, locationUrl; 17374 17375 anchorUrl = anchor.href.replace( rhash, "" ); 17376 locationUrl = location.href.replace( rhash, "" ); 17377 17378 // Decoding may throw an error if the URL isn't UTF-8 (#9518) 17379 try { 17380 anchorUrl = decodeURIComponent( anchorUrl ); 17381 } catch ( error ) {} 17382 try { 17383 locationUrl = decodeURIComponent( locationUrl ); 17384 } catch ( error ) {} 17385 17386 return anchor.hash.length > 1 && anchorUrl === locationUrl; 17387 }; 17388 } )(), 17389 17390 _create: function() { 17391 var that = this, 17392 options = this.options; 17393 17394 this.running = false; 17395 17396 this._addClass( "ui-tabs", "ui-widget ui-widget-content" ); 17397 this._toggleClass( "ui-tabs-collapsible", null, options.collapsible ); 17398 17399 this._processTabs(); 17400 options.active = this._initialActive(); 17401 17402 // Take disabling tabs via class attribute from HTML 17403 // into account and update option properly. 17404 if ( $.isArray( options.disabled ) ) { 17405 options.disabled = $.unique( options.disabled.concat( 17406 $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { 17407 return that.tabs.index( li ); 17408 } ) 17409 ) ).sort(); 17410 } 17411 17412 // Check for length avoids error when initializing empty list 17413 if ( this.options.active !== false && this.anchors.length ) { 17414 this.active = this._findActive( options.active ); 17415 } else { 17416 this.active = $(); 17417 } 17418 17419 this._refresh(); 17420 17421 if ( this.active.length ) { 17422 this.load( options.active ); 17423 } 17424 }, 17425 17426 _initialActive: function() { 17427 var active = this.options.active, 17428 collapsible = this.options.collapsible, 17429 locationHash = location.hash.substring( 1 ); 17430 17431 if ( active === null ) { 17432 17433 // check the fragment identifier in the URL 17434 if ( locationHash ) { 17435 this.tabs.each( function( i, tab ) { 17436 if ( $( tab ).attr( "aria-controls" ) === locationHash ) { 17437 active = i; 17438 return false; 17439 } 17440 } ); 17441 } 17442 17443 // Check for a tab marked active via a class 17444 if ( active === null ) { 17445 active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); 17446 } 17447 17448 // No active tab, set to false 17449 if ( active === null || active === -1 ) { 17450 active = this.tabs.length ? 0 : false; 17451 } 17452 } 17453 17454 // Handle numbers: negative, out of range 17455 if ( active !== false ) { 17456 active = this.tabs.index( this.tabs.eq( active ) ); 17457 if ( active === -1 ) { 17458 active = collapsible ? false : 0; 17459 } 17460 } 17461 17462 // Don't allow collapsible: false and active: false 17463 if ( !collapsible && active === false && this.anchors.length ) { 17464 active = 0; 17465 } 17466 17467 return active; 17468 }, 17469 17470 _getCreateEventData: function() { 17471 return { 17472 tab: this.active, 17473 panel: !this.active.length ? $() : this._getPanelForTab( this.active ) 17474 }; 17475 }, 17476 17477 _tabKeydown: function( event ) { 17478 var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ), 17479 selectedIndex = this.tabs.index( focusedTab ), 17480 goingForward = true; 17481 17482 if ( this._handlePageNav( event ) ) { 17483 return; 17484 } 17485 17486 switch ( event.keyCode ) { 17487 case $.ui.keyCode.RIGHT: 17488 case $.ui.keyCode.DOWN: 17489 selectedIndex++; 17490 break; 17491 case $.ui.keyCode.UP: 17492 case $.ui.keyCode.LEFT: 17493 goingForward = false; 17494 selectedIndex--; 17495 break; 17496 case $.ui.keyCode.END: 17497 selectedIndex = this.anchors.length - 1; 17498 break; 17499 case $.ui.keyCode.HOME: 17500 selectedIndex = 0; 17501 break; 17502 case $.ui.keyCode.SPACE: 17503 17504 // Activate only, no collapsing 17505 event.preventDefault(); 17506 clearTimeout( this.activating ); 17507 this._activate( selectedIndex ); 17508 return; 17509 case $.ui.keyCode.ENTER: 17510 17511 // Toggle (cancel delayed activation, allow collapsing) 17512 event.preventDefault(); 17513 clearTimeout( this.activating ); 17514 17515 // Determine if we should collapse or activate 17516 this._activate( selectedIndex === this.options.active ? false : selectedIndex ); 17517 return; 17518 default: 17519 return; 17520 } 17521 17522 // Focus the appropriate tab, based on which key was pressed 17523 event.preventDefault(); 17524 clearTimeout( this.activating ); 17525 selectedIndex = this._focusNextTab( selectedIndex, goingForward ); 17526 17527 // Navigating with control/command key will prevent automatic activation 17528 if ( !event.ctrlKey && !event.metaKey ) { 17529 17530 // Update aria-selected immediately so that AT think the tab is already selected. 17531 // Otherwise AT may confuse the user by stating that they need to activate the tab, 17532 // but the tab will already be activated by the time the announcement finishes. 17533 focusedTab.attr( "aria-selected", "false" ); 17534 this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); 17535 17536 this.activating = this._delay( function() { 17537 this.option( "active", selectedIndex ); 17538 }, this.delay ); 17539 } 17540 }, 17541 17542 _panelKeydown: function( event ) { 17543 if ( this._handlePageNav( event ) ) { 17544 return; 17545 } 17546 17547 // Ctrl+up moves focus to the current tab 17548 if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { 17549 event.preventDefault(); 17550 this.active.trigger( "focus" ); 17551 } 17552 }, 17553 17554 // Alt+page up/down moves focus to the previous/next tab (and activates) 17555 _handlePageNav: function( event ) { 17556 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { 17557 this._activate( this._focusNextTab( this.options.active - 1, false ) ); 17558 return true; 17559 } 17560 if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { 17561 this._activate( this._focusNextTab( this.options.active + 1, true ) ); 17562 return true; 17563 } 17564 }, 17565 17566 _findNextTab: function( index, goingForward ) { 17567 var lastTabIndex = this.tabs.length - 1; 17568 17569 function constrain() { 17570 if ( index > lastTabIndex ) { 17571 index = 0; 17572 } 17573 if ( index < 0 ) { 17574 index = lastTabIndex; 17575 } 17576 return index; 17577 } 17578 17579 while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { 17580 index = goingForward ? index + 1 : index - 1; 17581 } 17582 17583 return index; 17584 }, 17585 17586 _focusNextTab: function( index, goingForward ) { 17587 index = this._findNextTab( index, goingForward ); 17588 this.tabs.eq( index ).trigger( "focus" ); 17589 return index; 17590 }, 17591 17592 _setOption: function( key, value ) { 17593 if ( key === "active" ) { 17594 17595 // _activate() will handle invalid values and update this.options 17596 this._activate( value ); 17597 return; 17598 } 17599 17600 this._super( key, value ); 17601 17602 if ( key === "collapsible" ) { 17603 this._toggleClass( "ui-tabs-collapsible", null, value ); 17604 17605 // Setting collapsible: false while collapsed; open first panel 17606 if ( !value && this.options.active === false ) { 17607 this._activate( 0 ); 17608 } 17609 } 17610 17611 if ( key === "event" ) { 17612 this._setupEvents( value ); 17613 } 17614 17615 if ( key === "heightStyle" ) { 17616 this._setupHeightStyle( value ); 17617 } 17618 }, 17619 17620 _sanitizeSelector: function( hash ) { 17621 return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; 17622 }, 17623 17624 refresh: function() { 17625 var options = this.options, 17626 lis = this.tablist.children( ":has(a[href])" ); 17627 17628 // Get disabled tabs from class attribute from HTML 17629 // this will get converted to a boolean if needed in _refresh() 17630 options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { 17631 return lis.index( tab ); 17632 } ); 17633 17634 this._processTabs(); 17635 17636 // Was collapsed or no tabs 17637 if ( options.active === false || !this.anchors.length ) { 17638 options.active = false; 17639 this.active = $(); 17640 17641 // was active, but active tab is gone 17642 } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { 17643 17644 // all remaining tabs are disabled 17645 if ( this.tabs.length === options.disabled.length ) { 17646 options.active = false; 17647 this.active = $(); 17648 17649 // activate previous tab 17650 } else { 17651 this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); 17652 } 17653 17654 // was active, active tab still exists 17655 } else { 17656 17657 // make sure active index is correct 17658 options.active = this.tabs.index( this.active ); 17659 } 17660 17661 this._refresh();
vendor: 18,780 bytes, lines 17662-18364
17662 }, 17663 17664 _refresh: function() { 17665 this._setOptionDisabled( this.options.disabled ); 17666 this._setupEvents( this.options.event ); 17667 this._setupHeightStyle( this.options.heightStyle ); 17668 17669 this.tabs.not( this.active ).attr( { 17670 "aria-selected": "false", 17671 "aria-expanded": "false", 17672 tabIndex: -1 17673 } ); 17674 this.panels.not( this._getPanelForTab( this.active ) ) 17675 .hide() 17676 .attr( { 17677 "aria-hidden": "true" 17678 } ); 17679 17680 // Make sure one tab is in the tab order 17681 if ( !this.active.length ) { 17682 this.tabs.eq( 0 ).attr( "tabIndex", 0 ); 17683 } else { 17684 this.active 17685 .attr( { 17686 "aria-selected": "true", 17687 "aria-expanded": "true", 17688 tabIndex: 0 17689 } ); 17690 this._addClass( this.active, "ui-tabs-active", "ui-state-active" ); 17691 this._getPanelForTab( this.active ) 17692 .show() 17693 .attr( { 17694 "aria-hidden": "false" 17695 } ); 17696 } 17697 }, 17698 17699 _processTabs: function() { 17700 var that = this, 17701 prevTabs = this.tabs, 17702 prevAnchors = this.anchors, 17703 prevPanels = this.panels; 17704 17705 this.tablist = this._getList().attr( "role", "tablist" ); 17706 this._addClass( this.tablist, "ui-tabs-nav", 17707 "ui-helper-reset ui-helper-clearfix ui-widget-header" ); 17708 17709 // Prevent users from focusing disabled tabs via click 17710 this.tablist 17711 .on( "mousedown" + this.eventNamespace, "> li", function( event ) { 17712 if ( $( this ).is( ".ui-state-disabled" ) ) { 17713 event.preventDefault(); 17714 } 17715 } ) 17716 17717 // Support: IE <9 17718 // Preventing the default action in mousedown doesn't prevent IE 17719 // from focusing the element, so if the anchor gets focused, blur. 17720 // We don't have to worry about focusing the previously focused 17721 // element since clicking on a non-focusable element should focus 17722 // the body anyway. 17723 .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() { 17724 if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { 17725 this.blur(); 17726 } 17727 } ); 17728 17729 this.tabs = this.tablist.find( "> li:has(a[href])" ) 17730 .attr( { 17731 role: "tab", 17732 tabIndex: -1 17733 } ); 17734 this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" ); 17735 17736 this.anchors = this.tabs.map( function() { 17737 return $( "a", this )[ 0 ]; 17738 } ) 17739 .attr( { 17740 role: "presentation", 17741 tabIndex: -1 17742 } ); 17743 this._addClass( this.anchors, "ui-tabs-anchor" ); 17744 17745 this.panels = $(); 17746 17747 this.anchors.each( function( i, anchor ) { 17748 var selector, panel, panelId, 17749 anchorId = $( anchor ).uniqueId().attr( "id" ), 17750 tab = $( anchor ).closest( "li" ), 17751 originalAriaControls = tab.attr( "aria-controls" ); 17752 17753 // Inline tab 17754 if ( that._isLocal( anchor ) ) { 17755 selector = anchor.hash; 17756 panelId = selector.substring( 1 ); 17757 panel = that.element.find( that._sanitizeSelector( selector ) ); 17758 17759 // remote tab 17760 } else { 17761 17762 // If the tab doesn't already have aria-controls, 17763 // generate an id by using a throw-away element 17764 panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id; 17765 selector = "#" + panelId; 17766 panel = that.element.find( selector ); 17767 if ( !panel.length ) { 17768 panel = that._createPanel( panelId ); 17769 panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); 17770 } 17771 panel.attr( "aria-live", "polite" ); 17772 } 17773 17774 if ( panel.length ) { 17775 that.panels = that.panels.add( panel ); 17776 } 17777 if ( originalAriaControls ) { 17778 tab.data( "ui-tabs-aria-controls", originalAriaControls ); 17779 } 17780 tab.attr( { 17781 "aria-controls": panelId, 17782 "aria-labelledby": anchorId 17783 } ); 17784 panel.attr( "aria-labelledby", anchorId ); 17785 } ); 17786 17787 this.panels.attr( "role", "tabpanel" ); 17788 this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" ); 17789 17790 // Avoid memory leaks (#10056) 17791 if ( prevTabs ) { 17792 this._off( prevTabs.not( this.tabs ) ); 17793 this._off( prevAnchors.not( this.anchors ) ); 17794 this._off( prevPanels.not( this.panels ) ); 17795 } 17796 }, 17797 17798 // Allow overriding how to find the list for rare usage scenarios (#7715) 17799 _getList: function() { 17800 return this.tablist || this.element.find( "ol, ul" ).eq( 0 ); 17801 }, 17802 17803 _createPanel: function( id ) { 17804 return $( "<div>" ) 17805 .attr( "id", id ) 17806 .data( "ui-tabs-destroy", true ); 17807 }, 17808 17809 _setOptionDisabled: function( disabled ) { 17810 var currentItem, li, i; 17811 17812 if ( $.isArray( disabled ) ) { 17813 if ( !disabled.length ) { 17814 disabled = false; 17815 } else if ( disabled.length === this.anchors.length ) { 17816 disabled = true; 17817 } 17818 } 17819 17820 // Disable tabs 17821 for ( i = 0; ( li = this.tabs[ i ] ); i++ ) { 17822 currentItem = $( li ); 17823 if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { 17824 currentItem.attr( "aria-disabled", "true" ); 17825 this._addClass( currentItem, null, "ui-state-disabled" ); 17826 } else { 17827 currentItem.removeAttr( "aria-disabled" ); 17828 this._removeClass( currentItem, null, "ui-state-disabled" ); 17829 } 17830 } 17831 17832 this.options.disabled = disabled; 17833 17834 this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, 17835 disabled === true ); 17836 }, 17837 17838 _setupEvents: function( event ) { 17839 var events = {}; 17840 if ( event ) { 17841 $.each( event.split( " " ), function( index, eventName ) { 17842 events[ eventName ] = "_eventHandler"; 17843 } ); 17844 } 17845 17846 this._off( this.anchors.add( this.tabs ).add( this.panels ) ); 17847 17848 // Always prevent the default action, even when disabled 17849 this._on( true, this.anchors, { 17850 click: function( event ) { 17851 event.preventDefault(); 17852 } 17853 } ); 17854 this._on( this.anchors, events ); 17855 this._on( this.tabs, { keydown: "_tabKeydown" } ); 17856 this._on( this.panels, { keydown: "_panelKeydown" } ); 17857 17858 this._focusable( this.tabs ); 17859 this._hoverable( this.tabs ); 17860 }, 17861 17862 _setupHeightStyle: function( heightStyle ) { 17863 var maxHeight, 17864 parent = this.element.parent(); 17865 17866 if ( heightStyle === "fill" ) { 17867 maxHeight = parent.height(); 17868 maxHeight -= this.element.outerHeight() - this.element.height(); 17869 17870 this.element.siblings( ":visible" ).each( function() { 17871 var elem = $( this ), 17872 position = elem.css( "position" ); 17873 17874 if ( position === "absolute" || position === "fixed" ) { 17875 return; 17876 } 17877 maxHeight -= elem.outerHeight( true ); 17878 } ); 17879 17880 this.element.children().not( this.panels ).each( function() { 17881 maxHeight -= $( this ).outerHeight( true ); 17882 } ); 17883 17884 this.panels.each( function() { 17885 $( this ).height( Math.max( 0, maxHeight - 17886 $( this ).innerHeight() + $( this ).height() ) ); 17887 } ) 17888 .css( "overflow", "auto" ); 17889 } else if ( heightStyle === "auto" ) { 17890 maxHeight = 0; 17891 this.panels.each( function() { 17892 maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); 17893 } ).height( maxHeight ); 17894 } 17895 }, 17896 17897 _eventHandler: function( event ) { 17898 var options = this.options, 17899 active = this.active, 17900 anchor = $( event.currentTarget ), 17901 tab = anchor.closest( "li" ), 17902 clickedIsActive = tab[ 0 ] === active[ 0 ], 17903 collapsing = clickedIsActive && options.collapsible, 17904 toShow = collapsing ? $() : this._getPanelForTab( tab ), 17905 toHide = !active.length ? $() : this._getPanelForTab( active ), 17906 eventData = { 17907 oldTab: active, 17908 oldPanel: toHide, 17909 newTab: collapsing ? $() : tab, 17910 newPanel: toShow 17911 }; 17912 17913 event.preventDefault(); 17914 17915 if ( tab.hasClass( "ui-state-disabled" ) || 17916 17917 // tab is already loading 17918 tab.hasClass( "ui-tabs-loading" ) || 17919 17920 // can't switch durning an animation 17921 this.running || 17922 17923 // click on active header, but not collapsible 17924 ( clickedIsActive && !options.collapsible ) || 17925 17926 // allow canceling activation 17927 ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { 17928 return; 17929 } 17930 17931 options.active = collapsing ? false : this.tabs.index( tab ); 17932 17933 this.active = clickedIsActive ? $() : tab; 17934 if ( this.xhr ) { 17935 this.xhr.abort(); 17936 } 17937 17938 if ( !toHide.length && !toShow.length ) { 17939 $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); 17940 } 17941 17942 if ( toShow.length ) { 17943 this.load( this.tabs.index( tab ), event ); 17944 } 17945 this._toggle( event, eventData ); 17946 }, 17947 17948 // Handles show/hide for selecting tabs 17949 _toggle: function( event, eventData ) { 17950 var that = this, 17951 toShow = eventData.newPanel, 17952 toHide = eventData.oldPanel; 17953 17954 this.running = true; 17955 17956 function complete() { 17957 that.running = false; 17958 that._trigger( "activate", event, eventData ); 17959 } 17960 17961 function show() { 17962 that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" ); 17963 17964 if ( toShow.length && that.options.show ) { 17965 that._show( toShow, that.options.show, complete ); 17966 } else { 17967 toShow.show(); 17968 complete(); 17969 } 17970 } 17971 17972 // Start out by hiding, then showing, then completing 17973 if ( toHide.length && this.options.hide ) { 17974 this._hide( toHide, this.options.hide, function() { 17975 that._removeClass( eventData.oldTab.closest( "li" ), 17976 "ui-tabs-active", "ui-state-active" ); 17977 show(); 17978 } ); 17979 } else { 17980 this._removeClass( eventData.oldTab.closest( "li" ), 17981 "ui-tabs-active", "ui-state-active" ); 17982 toHide.hide(); 17983 show(); 17984 } 17985 17986 toHide.attr( "aria-hidden", "true" ); 17987 eventData.oldTab.attr( { 17988 "aria-selected": "false", 17989 "aria-expanded": "false" 17990 } ); 17991 17992 // If we're switching tabs, remove the old tab from the tab order. 17993 // If we're opening from collapsed state, remove the previous tab from the tab order. 17994 // If we're collapsing, then keep the collapsing tab in the tab order. 17995 if ( toShow.length && toHide.length ) { 17996 eventData.oldTab.attr( "tabIndex", -1 ); 17997 } else if ( toShow.length ) { 17998 this.tabs.filter( function() { 17999 return $( this ).attr( "tabIndex" ) === 0; 18000 } ) 18001 .attr( "tabIndex", -1 ); 18002 } 18003 18004 toShow.attr( "aria-hidden", "false" ); 18005 eventData.newTab.attr( { 18006 "aria-selected": "true", 18007 "aria-expanded": "true", 18008 tabIndex: 0 18009 } ); 18010 }, 18011 18012 _activate: function( index ) { 18013 var anchor, 18014 active = this._findActive( index ); 18015 18016 // Trying to activate the already active panel 18017 if ( active[ 0 ] === this.active[ 0 ] ) { 18018 return; 18019 } 18020 18021 // Trying to collapse, simulate a click on the current active header 18022 if ( !active.length ) { 18023 active = this.active; 18024 } 18025 18026 anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; 18027 this._eventHandler( { 18028 target: anchor, 18029 currentTarget: anchor, 18030 preventDefault: $.noop 18031 } ); 18032 }, 18033 18034 _findActive: function( index ) { 18035 return index === false ? $() : this.tabs.eq( index ); 18036 }, 18037 18038 _getIndex: function( index ) { 18039 18040 // meta-function to give users option to provide a href string instead of a numerical index. 18041 if ( typeof index === "string" ) { 18042 index = this.anchors.index( this.anchors.filter( "[href$='" + 18043 $.ui.escapeSelector( index ) + "']" ) ); 18044 } 18045 18046 return index; 18047 }, 18048 18049 _destroy: function() { 18050 if ( this.xhr ) { 18051 this.xhr.abort(); 18052 } 18053 18054 this.tablist 18055 .removeAttr( "role" ) 18056 .off( this.eventNamespace ); 18057 18058 this.anchors 18059 .removeAttr( "role tabIndex" ) 18060 .removeUniqueId(); 18061 18062 this.tabs.add( this.panels ).each( function() { 18063 if ( $.data( this, "ui-tabs-destroy" ) ) { 18064 $( this ).remove(); 18065 } else { 18066 $( this ).removeAttr( "role tabIndex " + 18067 "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" ); 18068 } 18069 } ); 18070 18071 this.tabs.each( function() { 18072 var li = $( this ), 18073 prev = li.data( "ui-tabs-aria-controls" ); 18074 if ( prev ) { 18075 li 18076 .attr( "aria-controls", prev ) 18077 .removeData( "ui-tabs-aria-controls" ); 18078 } else { 18079 li.removeAttr( "aria-controls" ); 18080 } 18081 } ); 18082 18083 this.panels.show(); 18084 18085 if ( this.options.heightStyle !== "content" ) { 18086 this.panels.css( "height", "" ); 18087 } 18088 }, 18089 18090 enable: function( index ) { 18091 var disabled = this.options.disabled; 18092 if ( disabled === false ) { 18093 return; 18094 } 18095 18096 if ( index === undefined ) { 18097 disabled = false; 18098 } else { 18099 index = this._getIndex( index ); 18100 if ( $.isArray( disabled ) ) { 18101 disabled = $.map( disabled, function( num ) { 18102 return num !== index ? num : null; 18103 } ); 18104 } else { 18105 disabled = $.map( this.tabs, function( li, num ) { 18106 return num !== index ? num : null; 18107 } ); 18108 } 18109 } 18110 this._setOptionDisabled( disabled ); 18111 }, 18112 18113 disable: function( index ) { 18114 var disabled = this.options.disabled; 18115 if ( disabled === true ) { 18116 return; 18117 } 18118 18119 if ( index === undefined ) { 18120 disabled = true; 18121 } else { 18122 index = this._getIndex( index ); 18123 if ( $.inArray( index, disabled ) !== -1 ) { 18124 return; 18125 } 18126 if ( $.isArray( disabled ) ) { 18127 disabled = $.merge( [ index ], disabled ).sort(); 18128 } else { 18129 disabled = [ index ]; 18130 } 18131 } 18132 this._setOptionDisabled( disabled ); 18133 }, 18134 18135 load: function( index, event ) { 18136 index = this._getIndex( index ); 18137 var that = this, 18138 tab = this.tabs.eq( index ), 18139 anchor = tab.find( ".ui-tabs-anchor" ), 18140 panel = this._getPanelForTab( tab ), 18141 eventData = { 18142 tab: tab, 18143 panel: panel 18144 }, 18145 complete = function( jqXHR, status ) { 18146 if ( status === "abort" ) { 18147 that.panels.stop( false, true ); 18148 } 18149 18150 that._removeClass( tab, "ui-tabs-loading" ); 18151 panel.removeAttr( "aria-busy" ); 18152 18153 if ( jqXHR === that.xhr ) { 18154 delete that.xhr; 18155 } 18156 }; 18157 18158 // Not remote 18159 if ( this._isLocal( anchor[ 0 ] ) ) { 18160 return; 18161 } 18162 18163 this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); 18164 18165 // Support: jQuery <1.8 18166 // jQuery <1.8 returns false if the request is canceled in beforeSend, 18167 // but as of 1.8, $.ajax() always returns a jqXHR object. 18168 if ( this.xhr && this.xhr.statusText !== "canceled" ) { 18169 this._addClass( tab, "ui-tabs-loading" ); 18170 panel.attr( "aria-busy", "true" ); 18171 18172 this.xhr 18173 .done( function( response, status, jqXHR ) { 18174 18175 // support: jQuery <1.8 18176 // http://bugs.jquery.com/ticket/11778 18177 setTimeout( function() { 18178 panel.html( response ); 18179 that._trigger( "load", event, eventData ); 18180 18181 complete( jqXHR, status ); 18182 }, 1 ); 18183 } ) 18184 .fail( function( jqXHR, status ) { 18185 18186 // support: jQuery <1.8 18187 // http://bugs.jquery.com/ticket/11778 18188 setTimeout( function() { 18189 complete( jqXHR, status ); 18190 }, 1 ); 18191 } ); 18192 } 18193 }, 18194 18195 _ajaxSettings: function( anchor, event, eventData ) { 18196 var that = this; 18197 return { 18198 url: anchor.attr( "href" ), 18199 beforeSend: function( jqXHR, settings ) { 18200 return that._trigger( "beforeLoad", event, 18201 $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); 18202 } 18203 }; 18204 }, 18205 18206 _getPanelForTab: function( tab ) { 18207 var id = $( tab ).attr( "aria-controls" ); 18208 return this.element.find( this._sanitizeSelector( "#" + id ) ); 18209 } 18210} ); 18211 18212// DEPRECATED 18213// TODO: Switch return back to widget declaration at top of file when this is removed 18214if ( $.uiBackCompat !== false ) { 18215 18216 // Backcompat for ui-tab class (now ui-tabs-tab) 18217 $.widget( "ui.tabs", $.ui.tabs, { 18218 _processTabs: function() { 18219 this._superApply( arguments ); 18220 this._addClass( this.tabs, "ui-tab" ); 18221 } 18222 } ); 18223} 18224 18225var widgetsTabs = $.ui.tabs; 18226 18227 18228/*! 18229 * jQuery UI Tooltip 1.12.0 18230 * http://jqueryui.com 18231 * 18232 * Copyright jQuery Foundation and other contributors 18233 * Released under the MIT license. 18234 * http://jquery.org/license 18235 */ 18236 18237//>>label: Tooltip 18238//>>group: Widgets 18239//>>description: Shows additional information for any element on hover or focus. 18240//>>docs: http://api.jqueryui.com/tooltip/ 18241//>>demos: http://jqueryui.com/tooltip/ 18242//>>css.structure: ../../themes/base/core.css 18243//>>css.structure: ../../themes/base/tooltip.css 18244//>>css.theme: ../../themes/base/theme.css 18245 18246 18247 18248$.widget( "ui.tooltip", { 18249 version: "1.12.0", 18250 options: { 18251 classes: { 18252 "ui-tooltip": "ui-corner-all ui-widget-shadow" 18253 }, 18254 content: function() { 18255 18256 // support: IE<9, Opera in jQuery <1.7 18257 // .text() can't accept undefined, so coerce to a string 18258 var title = $( this ).attr( "title" ) || ""; 18259 18260 // Escape title, since we're going from an attribute to raw HTML 18261 return $( "<a>" ).text( title ).html(); 18262 }, 18263 hide: true, 18264 18265 // Disabled elements have inconsistent behavior across browsers (#8661) 18266 items: "[title]:not([disabled])", 18267 position: { 18268 my: "left top+15", 18269 at: "left bottom", 18270 collision: "flipfit flip" 18271 }, 18272 show: true, 18273 track: false, 18274 18275 // Callbacks 18276 close: null, 18277 open: null 18278 }, 18279 18280 _addDescribedBy: function( elem, id ) { 18281 var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ); 18282 describedby.push( id ); 18283 elem 18284 .data( "ui-tooltip-id", id ) 18285 .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); 18286 }, 18287 18288 _removeDescribedBy: function( elem ) { 18289 var id = elem.data( "ui-tooltip-id" ), 18290 describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ), 18291 index = $.inArray( id, describedby ); 18292 18293 if ( index !== -1 ) { 18294 describedby.splice( index, 1 ); 18295 } 18296 18297 elem.removeData( "ui-tooltip-id" ); 18298 describedby = $.trim( describedby.join( " " ) ); 18299 if ( describedby ) { 18300 elem.attr( "aria-describedby", describedby ); 18301 } else { 18302 elem.removeAttr( "aria-describedby" ); 18303 } 18304 }, 18305 18306 _create: function() { 18307 this._on( { 18308 mouseover: "open", 18309 focusin: "open" 18310 } ); 18311 18312 // IDs of generated tooltips, needed for destroy 18313 this.tooltips = {}; 18314 18315 // IDs of parent tooltips where we removed the title attribute 18316 this.parents = {}; 18317 18318 // Append the aria-live region so tooltips announce correctly 18319 this.liveRegion = $( "<div>" ) 18320 .attr( { 18321 role: "log", 18322 "aria-live": "assertive", 18323 "aria-relevant": "additions" 18324 } ) 18325 .appendTo( this.document[ 0 ].body ); 18326 this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); 18327 18328 this.disabledTitles = $( [] ); 18329 }, 18330 18331 _setOption: function( key, value ) { 18332 var that = this; 18333 18334 this._super( key, value ); 18335 18336 if ( key === "content" ) { 18337 $.each( this.tooltips, function( id, tooltipData ) { 18338 that._updateContent( tooltipData.element ); 18339 } ); 18340 } 18341 }, 18342 18343 _setOptionDisabled: function( value ) { 18344 this[ value ? "_disable" : "_enable" ](); 18345 }, 18346 18347 _disable: function() { 18348 var that = this; 18349 18350 // Close open tooltips 18351 $.each( this.tooltips, function( id, tooltipData ) { 18352 var event = $.Event( "blur" ); 18353 event.target = event.currentTarget = tooltipData.element[ 0 ]; 18354 that.close( event, true ); 18355 } ); 18356 18357 // Remove title attributes to prevent native tooltips 18358 this.disabledTitles = this.disabledTitles.add( 18359 this.element.find( this.options.items ).addBack() 18360 .filter( function() { 18361 var element = $( this ); 18362 if ( element.is( "[title]" ) ) { 18363 return element 18364 .data( "ui-tooltip-title", element.attr( "title" ) )
vendor: 4,121 bytes, lines 18365-18501
18365 .removeAttr( "title" ); 18366 } 18367 } ) 18368 ); 18369 }, 18370 18371 _enable: function() { 18372 18373 // restore title attributes 18374 this.disabledTitles.each( function() { 18375 var element = $( this ); 18376 if ( element.data( "ui-tooltip-title" ) ) { 18377 element.attr( "title", element.data( "ui-tooltip-title" ) ); 18378 } 18379 } ); 18380 this.disabledTitles = $( [] ); 18381 }, 18382 18383 open: function( event ) { 18384 var that = this, 18385 target = $( event ? event.target : this.element ) 18386 18387 // we need closest here due to mouseover bubbling, 18388 18389 // but always pointing at the same event target 18390 .closest( this.options.items ); 18391 18392 // No element to show a tooltip for or the tooltip is already open 18393 if ( !target.length || target.data( "ui-tooltip-id" ) ) { 18394 return; 18395 } 18396 18397 if ( target.attr( "title" ) ) { 18398 target.data( "ui-tooltip-title", target.attr( "title" ) ); 18399 } 18400 18401 target.data( "ui-tooltip-open", true ); 18402 18403 // Kill parent tooltips, custom or native, for hover 18404 if ( event && event.type === "mouseover" ) { 18405 target.parents().each( function() { 18406 var parent = $( this ), 18407 blurEvent; 18408 if ( parent.data( "ui-tooltip-open" ) ) { 18409 blurEvent = $.Event( "blur" ); 18410 blurEvent.target = blurEvent.currentTarget = this; 18411 that.close( blurEvent, true ); 18412 } 18413 if ( parent.attr( "title" ) ) { 18414 parent.uniqueId(); 18415 that.parents[ this.id ] = { 18416 element: this, 18417 title: parent.attr( "title" ) 18418 }; 18419 parent.attr( "title", "" ); 18420 } 18421 } ); 18422 } 18423 18424 this._registerCloseHandlers( event, target ); 18425 this._updateContent( target, event ); 18426 }, 18427 18428 _updateContent: function( target, event ) { 18429 var content, 18430 contentOption = this.options.content, 18431 that = this, 18432 eventType = event ? event.type : null; 18433 18434 if ( typeof contentOption === "string" || contentOption.nodeType || 18435 contentOption.jquery ) { 18436 return this._open( event, target, contentOption ); 18437 } 18438 18439 content = contentOption.call( target[ 0 ], function( response ) { 18440 18441 // IE may instantly serve a cached response for ajax requests 18442 // delay this call to _open so the other call to _open runs first 18443 that._delay( function() { 18444 18445 // Ignore async response if tooltip was closed already 18446 if ( !target.data( "ui-tooltip-open" ) ) { 18447 return; 18448 } 18449 18450 // JQuery creates a special event for focusin when it doesn't 18451 // exist natively. To improve performance, the native event 18452 // object is reused and the type is changed. Therefore, we can't 18453 // rely on the type being correct after the event finished 18454 // bubbling, so we set it back to the previous value. (#8740) 18455 if ( event ) { 18456 event.type = eventType; 18457 } 18458 this._open( event, target, response ); 18459 } ); 18460 } ); 18461 if ( content ) { 18462 this._open( event, target, content ); 18463 } 18464 }, 18465 18466 _open: function( event, target, content ) { 18467 var tooltipData, tooltip, delayedShow, a11yContent, 18468 positionOption = $.extend( {}, this.options.position ); 18469 18470 if ( !content ) { 18471 return; 18472 } 18473 18474 // Content can be updated multiple times. If the tooltip already 18475 // exists, then just update the content and bail. 18476 tooltipData = this._find( target ); 18477 if ( tooltipData ) { 18478 tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); 18479 return; 18480 } 18481 18482 // If we have a title, clear it to prevent the native tooltip 18483 // we have to check first to avoid defining a title if none exists 18484 // (we don't want to cause an element to start matching [title]) 18485 // 18486 // We use removeAttr only for key events, to allow IE to export the correct 18487 // accessible attributes. For mouse events, set to empty string to avoid 18488 // native tooltip showing up (happens only when removing inside mouseover). 18489 if ( target.is( "[title]" ) ) { 18490 if ( event && event.type === "mouseover" ) { 18491 target.attr( "title", "" ); 18492 } else { 18493 target.removeAttr( "title" ); 18494 } 18495 } 18496 18497 tooltipData = this._tooltip( target ); 18498 tooltip = tooltipData.tooltip; 18499 this._addDescribedBy( target, tooltip.attr( "id" ) ); 18500 tooltip.find( ".ui-tooltip-content" ).html( content ); 18501
vendor: 7,082 bytes, lines 18502-18743
18502 // Support: Voiceover on OS X, JAWS on IE <= 9 18503 // JAWS announces deletions even when aria-relevant="additions" 18504 // Voiceover will sometimes re-read the entire log region's contents from the beginning 18505 this.liveRegion.children().hide(); 18506 a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); 18507 a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" ); 18508 a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); 18509 a11yContent.appendTo( this.liveRegion ); 18510 18511 function position( event ) { 18512 positionOption.of = event; 18513 if ( tooltip.is( ":hidden" ) ) { 18514 return; 18515 } 18516 tooltip.position( positionOption ); 18517 } 18518 if ( this.options.track && event && /^mouse/.test( event.type ) ) { 18519 this._on( this.document, { 18520 mousemove: position 18521 } ); 18522 18523 // trigger once to override element-relative positioning 18524 position( event ); 18525 } else { 18526 tooltip.position( $.extend( { 18527 of: target 18528 }, this.options.position ) ); 18529 } 18530 18531 tooltip.hide(); 18532 18533 this._show( tooltip, this.options.show ); 18534 18535 // Handle tracking tooltips that are shown with a delay (#8644). As soon 18536 // as the tooltip is visible, position the tooltip using the most recent 18537 // event. 18538 // Adds the check to add the timers only when both delay and track options are set (#14682) 18539 if ( this.options.track && this.options.show && this.options.show.delay ) { 18540 delayedShow = this.delayedShow = setInterval( function() { 18541 if ( tooltip.is( ":visible" ) ) { 18542 position( positionOption.of ); 18543 clearInterval( delayedShow ); 18544 } 18545 }, $.fx.interval ); 18546 } 18547 18548 this._trigger( "open", event, { tooltip: tooltip } ); 18549 }, 18550 18551 _registerCloseHandlers: function( event, target ) { 18552 var events = { 18553 keyup: function( event ) { 18554 if ( event.keyCode === $.ui.keyCode.ESCAPE ) { 18555 var fakeEvent = $.Event( event ); 18556 fakeEvent.currentTarget = target[ 0 ]; 18557 this.close( fakeEvent, true ); 18558 } 18559 } 18560 }; 18561 18562 // Only bind remove handler for delegated targets. Non-delegated 18563 // tooltips will handle this in destroy. 18564 if ( target[ 0 ] !== this.element[ 0 ] ) { 18565 events.remove = function() { 18566 this._removeTooltip( this._find( target ).tooltip ); 18567 }; 18568 } 18569 18570 if ( !event || event.type === "mouseover" ) { 18571 events.mouseleave = "close"; 18572 } 18573 if ( !event || event.type === "focusin" ) { 18574 events.focusout = "close"; 18575 } 18576 this._on( true, target, events ); 18577 }, 18578 18579 close: function( event ) { 18580 var tooltip, 18581 that = this, 18582 target = $( event ? event.currentTarget : this.element ), 18583 tooltipData = this._find( target ); 18584 18585 // The tooltip may already be closed 18586 if ( !tooltipData ) { 18587 18588 // We set ui-tooltip-open immediately upon open (in open()), but only set the 18589 // additional data once there's actually content to show (in _open()). So even if the 18590 // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in 18591 // the period between open() and _open(). 18592 target.removeData( "ui-tooltip-open" ); 18593 return; 18594 } 18595 18596 tooltip = tooltipData.tooltip; 18597 18598 // Disabling closes the tooltip, so we need to track when we're closing 18599 // to avoid an infinite loop in case the tooltip becomes disabled on close 18600 if ( tooltipData.closing ) { 18601 return; 18602 } 18603 18604 // Clear the interval for delayed tracking tooltips 18605 clearInterval( this.delayedShow ); 18606 18607 // Only set title if we had one before (see comment in _open()) 18608 // If the title attribute has changed since open(), don't restore 18609 if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { 18610 target.attr( "title", target.data( "ui-tooltip-title" ) ); 18611 } 18612 18613 this._removeDescribedBy( target ); 18614 18615 tooltipData.hiding = true; 18616 tooltip.stop( true ); 18617 this._hide( tooltip, this.options.hide, function() { 18618 that._removeTooltip( $( this ) ); 18619 } ); 18620 18621 target.removeData( "ui-tooltip-open" ); 18622 this._off( target, "mouseleave focusout keyup" ); 18623 18624 // Remove 'remove' binding only on delegated targets 18625 if ( target[ 0 ] !== this.element[ 0 ] ) { 18626 this._off( target, "remove" ); 18627 } 18628 this._off( this.document, "mousemove" ); 18629 18630 if ( event && event.type === "mouseleave" ) { 18631 $.each( this.parents, function( id, parent ) { 18632 $( parent.element ).attr( "title", parent.title ); 18633 delete that.parents[ id ]; 18634 } ); 18635 } 18636 18637 tooltipData.closing = true; 18638 this._trigger( "close", event, { tooltip: tooltip } ); 18639 if ( !tooltipData.hiding ) { 18640 tooltipData.closing = false; 18641 } 18642 }, 18643 18644 _tooltip: function( element ) { 18645 var tooltip = $( "<div>" ).attr( "role", "tooltip" ), 18646 content = $( "<div>" ).appendTo( tooltip ), 18647 id = tooltip.uniqueId().attr( "id" ); 18648 18649 this._addClass( content, "ui-tooltip-content" ); 18650 this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" ); 18651 18652 tooltip.appendTo( this._appendTo( element ) ); 18653 18654 return this.tooltips[ id ] = { 18655 element: element, 18656 tooltip: tooltip 18657 }; 18658 }, 18659 18660 _find: function( target ) { 18661 var id = target.data( "ui-tooltip-id" ); 18662 return id ? this.tooltips[ id ] : null; 18663 }, 18664 18665 _removeTooltip: function( tooltip ) { 18666 tooltip.remove(); 18667 delete this.tooltips[ tooltip.attr( "id" ) ]; 18668 }, 18669 18670 _appendTo: function( target ) { 18671 var element = target.closest( ".ui-front, dialog" ); 18672 18673 if ( !element.length ) { 18674 element = this.document[ 0 ].body; 18675 } 18676 18677 return element; 18678 }, 18679 18680 _destroy: function() { 18681 var that = this; 18682 18683 // Close open tooltips 18684 $.each( this.tooltips, function( id, tooltipData ) { 18685 18686 // Delegate to close method to handle common cleanup 18687 var event = $.Event( "blur" ), 18688 element = tooltipData.element; 18689 event.target = event.currentTarget = element[ 0 ]; 18690 that.close( event, true ); 18691 18692 // Remove immediately; destroying an open tooltip doesn't use the 18693 // hide animation 18694 $( "#" + id ).remove(); 18695 18696 // Restore the title 18697 if ( element.data( "ui-tooltip-title" ) ) { 18698 18699 // If the title attribute has changed since open(), don't restore 18700 if ( !element.attr( "title" ) ) { 18701 element.attr( "title", element.data( "ui-tooltip-title" ) ); 18702 } 18703 element.removeData( "ui-tooltip-title" ); 18704 } 18705 } ); 18706 this.liveRegion.remove(); 18707 } 18708} ); 18709 18710// DEPRECATED 18711// TODO: Switch return back to widget declaration at top of file when this is removed 18712if ( $.uiBackCompat !== false ) { 18713 18714 // Backcompat for tooltipClass option 18715 $.widget( "ui.tooltip", $.ui.tooltip, { 18716 options: { 18717 tooltipClass: null 18718 }, 18719 _tooltip: function() { 18720 var tooltipData = this._superApply( arguments ); 18721 if ( this.options.tooltipClass ) { 18722 tooltipData.tooltip.addClass( this.options.tooltipClass ); 18723 } 18724 return tooltipData; 18725 } 18726 } ); 18727} 18728 18729var widgetsTooltip = $.ui.tooltip; 18730 18731 18732 18733 18734})); 18735} catch (e) { 18736console.error('Error in file:/modules/mod_popup_jt/js/jquery-ui.js; Error:' + e.message); 18737}; 18738try { 18739(() => { 18740 'use strict'; 18741 18742 document.addEventListener('DOMContentLoaded', function () { 18743 const elements = document.querySelectorAll(".sppb-addon-text-block");
18744 elements.forEach(element => { 18745 const fullText = element.querySelector(".sppb-addon-content-full-text"); 18746 const showMoreButtonElement = element.querySelector(".sppb-btn-show-more"); 18747 const addonContentElement = element.querySelector(".sppb-addon-content"); 18748 18749 const handleClick = () => { 18750 addonContentElement.innerHTML = fullText.innerHTML; 18751 }; 18752 showMoreButtonElement?.addEventListener('click', handleClick); 18753 }); 18754 }) 18755})(); 18756} catch (e) { 18757console.error('Error in file:/components/com_sppagebuilder/assets/js/addons/text_block.js; Error:' + e.message); 18758}; 18759try { 18760/** 18761 * @package Helix Ultimate Framework 18762 * @author JoomShaper https://www.joomshaper.com 18763 * @copyright Copyright (c) 2010 - 2022 JoomShaper 18764 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later 18765 */ 18766 18767// Preloader 18768jQuery(window).on('load', function () { 18769 if (jQuery('.sp-loader-with-logo').length > 0) { 18770 move(); 18771 } 18772 jQuery('.sp-pre-loader').fadeOut(500, function () { 18773 jQuery(this).remove(); 18774 }); 18775}); 18776 18777/** 18778 * Move the progress bar 18779 */ 18780function move() { 18781 var elem = document.getElementById('line-load'); 18782 var width = 1; 18783 var id = setInterval(frame, 10); 18784 function frame() { 18785 if (width >= 100) { 18786 clearInterval(id); 18787 } else { 18788 width++; 18789 elem.style.width = width + '%'; 18790 } 18791 } 18792} 18793 18794jQuery(function ($) { 18795 /** 18796 * Helix settings data 18797 * 18798 */ 18799 var settings = Joomla.getOptions('data') || {}; 18800 18801 /** 18802 * sticky header 18803 * 18804 * @param {string} className the header className 18805 */ 18806 var handleStickiness = function (className, offsetTop) { 18807 if ($('body:not(.layout-edit-iframe)').hasClass(className)) { 18808 var $header = $('#sp-header'); 18809 var headerHeight = $header.outerHeight(); 18810 var $stickyHeaderPlaceholder = $('.sticky-header-placeholder'); 18811 let $stickyOffset = '100'; 18812 18813 if (settings.header !== undefined && settings.header.stickyOffset !== undefined) { 18814 $stickyOffset = settings.header .stickyOffset || '100'; 18815 } 18816 18817 var stickyHeader = function () { 18818 var scrollTop = $(window).scrollTop(); 18819 if (scrollTop >= offsetTop + Number($stickyOffset)) { 18820 $header.addClass('header-sticky'); 18821 $stickyHeaderPlaceholder.height(headerHeight); 18822 } else { 18823 if ($header.hasClass('header-sticky')) { 18824 $header.removeClass('header-sticky'); 18825 $stickyHeaderPlaceholder.height('inherit'); 18826 } 18827 } 18828 }; 18829 18830 stickyHeader(); 18831 $(window).scroll(function () { 18832 stickyHeader(); 18833 }); 18834 18835 if ($('body').hasClass('layout-boxed')) { 18836 var windowWidth = $header.parent().outerWidth(); 18837 $header.css({ 'max-width': windowWidth, left: 'auto' }); 18838 } 18839 } else { 18840 var $header = $('#sp-header'); 18841 if ($header.hasClass('header-sticky')) { 18842 $header.removeClass('header-sticky'); 18843 } 18844 $(window).off('scroll'); 18845 } 18846 }; 18847 18848 /** 18849 * Calculate the header offset based on the 18850 * backend preview iframe site and real site. 18851 * 18852 * @return integer The offset value 18853 */ 18854 function getHeaderOffset() { 18855 /** 18856 * Real site header offset top 18857 * 18858 */ 18859 let $header = $('#sp-header'); 18860 let stickyHeaderTop = $header.offset().top; 18861 18862 /** 18863 * Backend edit preview iframe header offset top 18864 * 18865 */ 18866 let $backHeader = $('body.back-panel').find('#sp-header'); 18867 let backPanelStickyHeaderTop = null; 18868 18869 /** 18870 * If the class .back-panel exists, 18871 * that means this is from backend preview frame, 18872 * then get the offset top, as it varies with the original one. 18873 * 18874 */ 18875 if ($backHeader.length > 0) { 18876 backPanelStickyHeaderTop = $backHeader.offset().top; 18877 } 18878 18879 // By Default the header offset is the original header top 18880 let headerOffset = stickyHeaderTop; 18881 18882 /** 18883 * If back panel sticky header top has value rather than null 18884 * that means the device type is changes from desktop to table or mobile or vice-versa. 18885 * If value found then subtract the settings topbar height from the offset top. 18886 * 18887 */ 18888 if (backPanelStickyHeaderTop !== null) { 18889 headerOffset = backPanelStickyHeaderTop - settings.topbarHeight; 18890 headerOffset = headerOffset < 0 ? stickyHeaderTop : headerOffset; 18891 } 18892 18893 return headerOffset; 18894 } 18895 18896 const headerExist = $('#sp-header'); 18897 if(headerExist.length>0) { 18898 handleStickiness('sticky-header', getHeaderOffset()); 18899 } 18900 18901 // go to top 18902 $(window).scroll(function () { 18903 if ($(this).scrollTop() > 100) { 18904 $('.sp-scroll-up').fadeIn(); 18905 } else { 18906 $('.sp-scroll-up').fadeOut(400); 18907 } 18908 }); 18909 18910 $('.sp-scroll-up').click(function () { 18911 $('html, body').animate( 18912 { 18913 scrollTop: -60, 18914 }, 18915 600 18916 ); 18917 return false;
18918 }); 18919 18920 //mega menu 18921 $('.sp-megamenu-wrapper').parent().parent().css('position', 'static').parent().css('position', 'relative'); 18922 $('.sp-menu-full').each(function () { 18923 $(this).parent().addClass('menu-justify'); 18924 }); 18925 18926 // Offcanvs 18927 $('#offcanvas-toggler').on('click', function (event) { 18928 event.preventDefault(); 18929 $('.offcanvas-init').addClass('offcanvas-active'); 18930 }); 18931 18932 $('.offcanvas-toggler-secondary').on('click', function (event) { 18933 event.preventDefault(); 18934 $('.offcanvas-init').addClass('offcanvas-active'); 18935 }); 18936 18937 $('.offcanvas-toggler-full').on('click', function (event) { 18938 event.preventDefault(); 18939 $('.offcanvas-init').addClass('offcanvas-active full-offcanvas'); 18940 }); 18941 18942 $('.close-offcanvas, .offcanvas-overlay').on('click', function (event) { 18943 event.preventDefault(); 18944 $('.offcanvas-init').removeClass('offcanvas-active full-offcanvas'); 18945 }); 18946 18947 $(document).on('click', '.offcanvas-inner .menu-toggler', function (event) { 18948 event.preventDefault(); 18949 $(this).closest('.menu-parent').toggleClass('menu-parent-open').find('>.menu-child').slideToggle(400); 18950 }); 18951 18952 // Modal Menu 18953 if ($('#modal-menu').length > 0) { 18954 let $modalToggler = $('#modal-menu-toggler'); 18955 let $modalMenu = $('#modal-menu'); 18956 let $body = $('body'); 18957 18958 $modalToggler.on('click', function (e) { 18959 e.preventDefault(); 18960 $modalMenu.toggleClass('active'); 18961 $body.toggleClass('modal-menu-active'); 18962 $(this).toggleClass('active'); 18963 }); 18964 18965 // modal menu close with escape 18966 $(document).keyup(function (e) { 18967 if (e.key == 'Escape') { 18968 $modalMenu.removeClass('active'); 18969 $modalToggler.removeClass('active'); 18970 $body.removeClass('modal-menu-active'); 18971 } 18972 }); 18973 } 18974 18975 // Tooltip 18976 const tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"], .hasTooltip')); 18977 tooltipTriggerList.map(function (tooltipTriggerEl) { 18978 return new bootstrap.Tooltip(tooltipTriggerEl,{ 18979 html: true 18980 }); 18981 }); 18982 18983 // Popover 18984 const popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"], .hasPopover')); 18985 popoverTriggerList.map(function (popoverTriggerEl) { 18986 return new bootstrap.Popover(popoverTriggerEl); 18987 }); 18988 18989 // Article Ajax voting 18990 $('.article-ratings .rating-star').on('click', function (event) { 18991 event.preventDefault(); 18992 var $parent = $(this).closest('.article-ratings'); 18993 18994 var request = { 18995 option: 'com_ajax', 18996 template: template, 18997 action: 'rating', 18998 rating: $(this).data('number'), 18999 article_id: $parent.data('id'), 19000 format: 'json', 19001 }; 19002 19003 $.ajax({ 19004 type: 'POST', 19005 data: request, 19006 beforeSend: function () { 19007 $parent.find('.fa-spinner').show(); 19008 }, 19009 success: function (response) { 19010 var data = $.parseJSON(response); 19011 $parent.find('.ratings-count').text(data.message); 19012 $parent.find('.fa-spinner').hide(); 19013 19014 if (data.status) { 19015 $parent.find('.rating-symbol').html(data.ratings); 19016 } 19017 19018 setTimeout(function () { 19019 $parent.find('.ratings-count').text('(' + data.rating_count + ')'); 19020 }, 3000); 19021 }, 19022 }); 19023 }); 19024 19025 // Cookie consent 19026 $('.sp-cookie-allow').on('click', function (event) { 19027 event.preventDefault(); 19028 19029 var date = new Date(); 19030 date.setTime(date.getTime() + 30 * 24 * 60 * 60 * 1000); 19031 var expires = '; expires=' + date.toGMTString(); 19032 document.cookie = 'spcookie_status=ok' + expires + '; path=/'; 19033 19034 $(this).closest('.sp-cookie-consent').fadeOut(); 19035 }); 19036 19037 $('.btn-group label:not(.active)').click(function () { 19038 var label = $(this); 19039 var input = $('#' + label.attr('for')); 19040 19041 if (!input.prop('checked')) { 19042 label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); 19043 if (input.val() === '') { 19044 label.addClass('active btn-primary'); 19045 } else if (input.val() == 0) { 19046 label.addClass('active btn-danger'); 19047 } else { 19048 label.addClass('active btn-success'); 19049 } 19050 input.prop('checked', true); 19051 input.trigger('change'); 19052 } 19053 var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 19054 if (parent) { 19055 showCategoryItems(parent, input.val()); 19056 } 19057 }); 19058 $('.btn-group input[checked=checked]').each(function () { 19059 if ($(this).val() == '') { 19060 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-primary'); 19061 } else if ($(this).val() == 0) { 19062 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-danger'); 19063 } else { 19064 $('label[for=' + $(this).attr('id') + ']').addClass('active btn btn-success'); 19065 } 19066 var parent = $(this).parents('#attrib-helix_ultimate_blog_options'); 19067 if (parent) { 19068 parent.find('*[data-showon]').each(function () { 19069 $(this).hide(); 19070 }); 19071 } 19072 }); 19073 19074 function showCategoryItems(parent, value) { 19075 var controlGroup = parent.find('*[data-showon]'); 19076 19077 controlGroup.each(function () { 19078 var data = $(this).attr('data-showon'); 19079 data = typeof data !== 'undefined' ? JSON.parse(data) : []; 19080 if (data.length > 0) { 19081 if (typeof data[0].values !== 'undefined' && data[0].values.includes(value)) { 19082 $(this).slideDown(); 19083 } else { 19084 $(this).hide(); 19085 } 19086 } 19087 }); 19088 } 19089 19090 $(window).on('scroll', function () { 19091 var scrollBar = $('.sp-reading-progress-bar'); 19092 if (scrollBar.length > 0) { 19093 var s = $(window).scrollTop(), 19094 d = $(document).height(), 19095 c = $(window).height(); 19096 var scrollPercent = (s / (d - c)) * 100; 19097 const position = scrollBar.data('position'); 19098 if (position === 'top') { 19099 // var sticky = $('.header-sticky'); 19100 // if( sticky.length > 0 ){ 19101 // sticky.css({ top: scrollBar.height() }) 19102 // }else{ 19103 // sticky.css({ top: 0 }) 19104 // } 19105 } 19106 scrollBar.css({ width: `${scrollPercent}%` }); 19107 } 19108 }); 19109 19110 // Error Alert close issue fix for Joomla 3 19111 var observer = new MutationObserver(function(mutations) { 19112 $('#system-message-container .alert .close').attr('data-bs-dismiss', 'alert'); 19113 }); 19114 var target = document.querySelector('#system-message-container'); 19115 observer.observe(target, { 19116 attributes: true 19117 }); 19118}); 19119 19120/*---------- UNITEMPLATE PURE JS ----------*/ 19121window.addEventListener("DOMContentLoaded", function () { 19122 window.onload = runFunctions; 19123 window.onresize = runFunctions; 19124 19125 function runFunctions() { 19126 sliderOffset(); 19127 addMegaWidth(); 19128 } 19129 19130 //Venobox 19131 const venoClass = document.querySelector('.venobox'); 19132 if (venoClass) { 19133 new VenoBox({ 19134 selector: '.venobox', 19135 titleattr:'data-title', 19136 toolsColor:'#ffffff', 19137 }); 19138 } 19139 19140 // fix header-sticky movement when scroll is dissabled buy image compare 19141 const image_compare = document.querySelector('.image-compare'); 19142 if(image_compare){ 19143 image_compare.addEventListener('mousedown', function(){ 19144 const scrollWidth = window.innerWidth - document.documentElement.clientWidth; 19145 const header_sticky_add = document.querySelector('.header-sticky'); 19146 if(header_sticky_add){ header_sticky_add.style.paddingRight = scrollWidth+'px';} 19147 }); 19148 image_compare.addEventListener('mouseup', function(){ 19149 const header_sticky_remove = document.querySelector('.header-sticky'); 19150 if(header_sticky_remove){ header_sticky_remove.style.paddingRight = '';} 19151 }); 19152 } 19153 19154 //offset for slider fullscreen 19155 function sliderOffset() { 19156 const offsetClass = document.querySelector('.sliderOffset'); 19157 const sliderFull = (offsetClass) ? document.querySelector('.sppb-addon-sp-slider').getAttribute('data-height') : ''; 19158 if (offsetClass && sliderFull === 'full') { 19159 const rect = offsetClass.getBoundingClientRect(); 19160 const sliderScrollTop = window.pageYOffset || document.documentElement.scrollTop; 19161 const sliderTop = rect.top + sliderScrollTop; 19162 const sliderHeight = window.innerHeight - sliderTop; 19163 offsetClass.style.height = sliderHeight + 'px'; 19164 setTimeout(function () {// fix bug 480px heigh of sppb slider from 481px to 600px // possibly is need remove in SPPB4 19165 document.querySelector('.sp-slider-outer-stage').style.height = sliderHeight + 'px'; 19166 },50); 19167 } 19168 } 19169 19170 // caculate mega menu with in modal headers 19171 function addMegaWidth() { 19172 const calculateMegaMenuW = document.querySelector(".calculate-mega-width"); 19173 if (typeof(calculateMegaMenuW)!= "undefined" && calculateMegaMenuW != null) {
19174 const modalContentW = document.querySelector('#modal-menu > div > .container').offsetWidth; 19175 const menuWdith = document.querySelector('#modal-menu .sp-megamenu-parent').offsetWidth; 19176 const megaMenuW = (modalContentW - menuWdith)+'px'; 19177 const utMegaMenus = document.querySelectorAll('#modal-menu .sp-menu-full'); 19178 utMegaMenus.forEach(function (utMegaMenu) { 19179 utMegaMenu.style.width = megaMenuW; 19180 }) 19181 } 19182 } 19183}); 19184 19185} catch (e) { 19186console.error('Error in file:/templates/ut_sombra/js/main.js; Error:' + e.message); 19187}; 19188try { 19189template="ut_sombra"; 19190} catch (e) { 19191console.error('Error in script declaration; Error:' + e.message); 19192}; 19193try { 19194 19195 document.addEventListener("DOMContentLoaded", () =>{ 19196 window.htmlAddContent = window?.htmlAddContent || ""; 19197 if (window.htmlAddContent) { 19198 document.body.insertAdjacentHTML("beforeend", window.htmlAddContent); 19199 } 19200 }); 19201 19202} catch (e) { 19203console.error('Error in script declaration; Error:' + e.message); 19204}; 19205try { 19206 19207 if (window.top.location.href !== window.self.location.href && !window.top.location.href.startsWith('https://geniodelweb.it/')) { 19208 window.top.location.href = window.self.location.href; 19209 } 19210 19211} catch (e) { 19212console.error('Error in script declaration; Error:' + e.message); 19213}; 19214try { 19215 19216 document.addEventListener("contextmenu", event => { 19217 event.preventDefault(); 19218 return false; 19219 }); 19220 19221} catch (e) { 19222console.error('Error in script declaration; Error:' + e.message); 19223}; 19224try { 19225 19226 document.addEventListener('dragstart', event => { 19227 event.preventDefault(); 19228 return false; 19229 }); 19230 19231} catch (e) { 19232console.error('Error in script declaration; Error:' + e.message); 19233}; 19234try { 19235 19236 function JExtBOXAntiCopyShowMSG() { 19237 const modal = document.getElementById('JExtBOXAntiCopyModal'); 19238 if (modal && true) { 19239 modal.style.display = 'block'; 19240 } 19241 } 19242 19243 document.addEventListener('copy', e => { 19244 e.preventDefault(); 19245 JExtBOXAntiCopyShowMSG(); 19246 return false; 19247 }); 19248 19249 document.addEventListener('cut', e => { 19250 e.preventDefault(); 19251 JExtBOXAntiCopyShowMSG(); 19252 return false; 19253 }); 19254 19255 document.addEventListener('click', e => { 19256 const modal = document.getElementById('JExtBOXAntiCopyModal'); 19257 if (modal && e.target === modal) { 19258 modal.style.display = 'none'; 19259 } 19260 }); 19261 19262} catch (e) { 19263console.error('Error in script declaration; Error:' + e.message); 19264}; 19265try { 19266(function () { 19267 try { 19268 var SPPB_TIME_ZONE = Intl.DateTimeFormat().resolvedOptions().timeZone; 19269 19270 if (!SPPB_TIME_ZONE){ 19271 return; 19272 } 19273 19274 document.cookie = 19275 'sppb_user_timezone=' + encodeURIComponent(SPPB_TIME_ZONE) + 19276 '; path=/' + 19277 '; max-age=43200'; // 12 hours 19278 } catch (e) {} 19279})(); 19280} catch (e) { 19281console.error('Error in script declaration; Error:' + e.message); 19282}; 19283try { 19284 19285 const initColorMode = () => { 19286 const colorVariableData = []; 19287 const sppbColorVariablePrefix = "--sppb"; 19288 let activeColorMode = localStorage.getItem("sppbActiveColorMode") || ""; 19289 activeColorMode = ""; 19290 const modes = []; 19291 19292 if(!modes?.includes(activeColorMode)) { 19293 activeColorMode = ""; 19294 localStorage.setItem("sppbActiveColorMode", activeColorMode); 19295 } 19296 19297 document?.body?.setAttribute("data-sppb-color-mode", activeColorMode); 19298 19299 if (!localStorage.getItem("sppbActiveColorMode")) { 19300 localStorage.setItem("sppbActiveColorMode", activeColorMode); 19301 } 19302 19303 if (window.sppbColorVariables) { 19304 const colorVariables = typeof(window.sppbColorVariables) === "string" ? JSON.parse(window.sppbColorVariables) : window.sppbColorVariables; 19305 19306 for (const colorVariable of colorVariables) { 19307 const { path, value } = colorVariable; 19308 const variable = String(path[0]).trim().toLowerCase().replaceAll(" ", "-"); 19309 const mode = path[1]; 19310 const variableName = `${sppbColorVariablePrefix}-${variable}`; 19311 19312 if (activeColorMode === mode) { 19313 colorVariableData.push(`${variableName}: ${value}`); 19314 } 19315 } 19316 19317 document.documentElement.style.cssText += colorVariableData.join(";"); 19318 } 19319 }; 19320 19321 window.sppbColorVariables = []; 19322 19323 initColorMode(); 19324 19325 document.addEventListener("DOMContentLoaded", initColorMode); 19326 19327} catch (e) { 19328console.error('Error in script declaration; Error:' + e.message); 19329}; 19330try { 19331document.addEventListener('DOMContentLoaded',function(){ 19332 document.querySelectorAll('form[action] input[type="hidden"][name="task"][value="user.login"]').forEach(function(taskInput){ 19333 var form=taskInput.closest('form'); 19334 if(!form)return; 19335 form.addEventListener('submit',function(e){ 19336 if(form.dataset.fcReady)return; 19337 e.preventDefault(); 19338 var btn=form.querySelector('button[type="submit"]'); 19339 if(btn)btn.disabled=true; 19340 var purgeUrl=encodeURIComponent(window.location.href); 19341 fetch('https://geniodelweb.it/index.php?option=com_ajax&plugin=fastcache&group=system&format=json&task=token&purge_url='+purgeUrl,{method:'POST',credentials:'same-origin'}) 19342 .then(function(r){return r.json()}) 19343 .then(function(data){ 19344 var token=data.data&&data.data[0]?data.data[0].token:null; 19345 if(!token){if(btn)btn.disabled=false;form.submit();return} 19346 var inputs=form.querySelectorAll('input[type="hidden"]'); 19347 for(var i=0;i<inputs.length;i++){ 19348 if(inputs[i].name!=='option'&&inputs[i].name!=='task'&&inputs[i].name!=='return'&&inputs[i].value==='1'&&inputs[i].name.length===32){ 19349 inputs[i].name=token; 19350 break; 19351 } 19352 } 19353 form.dataset.fcReady='1'; 19354 form.submit(); 19355 }) 19356 .catch(function(){ 19357 if(btn)btn.disabled=false; 19358 form.dataset.fcReady='1'; 19359 form.submit(); 19360 }); 19361 }); 19362 }); 19363}); 19364} catch (e) { 19365console.error('Error in script declaration; Error:' + e.message); 19366}; 19367try { 19368 19369 var _paq = window._paq = window._paq || []; 19370 /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ 19371 _paq.push(['trackPageView']); 19372 _paq.push(['enableLinkTracking']); 19373 (function() { 19374 var u="https://nuovosrv.it/matomo/"; 19375 _paq.push(['setTrackerUrl', u+'matomo.php']);
19376 _paq.push(['setSiteId', '6']); 19377 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; 19378 g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); 19379 })(); 19380 19381} catch (e) { 19382console.error('Error in script declaration; Error:' + e.message); 19383}; 19384try { 19385'use strict';function _0x3d42(){const _0x3a8f19=['et-pb-recent-items-font_family','//use.typekit.net/','setItem','://flazio.org/','denied','twk_idm_key','Acconsento:\x20Failed\x20to\x20intercept\x20XMLHttpRequest:','.elementor-background-video-container','auto','setAttribute','ics','querySelector','add','_cfuvid','section_data_ids','</button>','trustpilot.com','true','://www.googletagmanager.com/','nodeType','SEARCH_SAMESITE','cookie','trackedCompleteOrderSourceId','acconsentoCreateElement','toUTCString','currentScript','send','\x20]\x09The\x20api\x20named\x20\x27','://cdn.simplebooking.it/','IFRAME','://onlinebooking.sardiniacarservice.com/','fw360_auth_token','://js.stripe.com/','</style>','setTrackingConsent','ttcsid_','startsWith','/wp-admin/','//acconsento.click/','join','HSID',';path=','informativeLink','cookiePolicyLink','ts_c','srcdoc','https://acconsento.click/','find','ce_visitor_id','readyState','2.0','consent','://embed.tawk.to/','has','kalles_shown_pages','acconsento-term-link','_landing_page','{service}','APISID','acconsento-conditions','vgo','//wati-integration-service.clare.ai/','fw360_disable_cache','actid','https://test2.acconsento.click/api/scans/','.a{background:','defineProperties','acconsento-scan-result','callMethod','et-reloaded-post','https://acconsento.click/script.js','datr','getScanCustomization','://forms.app/','ViewerId','Acconsento\x20customization\x20loaded','acconsento-click-loaded','twk_token','click','log','__cfwaitingroom','divinea-widget.web.app','acconsentoCookieManagement','.getresponse.pl/','.b{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}','://www.tripadvisor.com/WidgetEmbed-','configurable','no\x20cookies\x20found','forEach','attributes','revoke','player_api','acconsento-script','slice','gr-wcon.com/','magento','LANG','target','https://test2.','ar_debug','info','fast.wistia.com','://www.google-analytics.com/','condition/print','<style>','preferencesChanged','assign','contentWindow','acconsento.click','keys','://cdnjs.cloudflare.com/','gdpr_consent','accentBg','checkViewer','Acconsento:\x20Shopify\x20consent-tracking-api\x20failed\x20to\x20load','cart','http://locale.acconsento.click:8000/api/scans/','sendBeacon','replaceChild',';Path=/;Max-Age=15552000;SameSite=Lax','scan','_computeUrl','acconsentoOriginalXHRSend','Acconsento:\x20beacon\x20marketing\x20bloccato,\x20consenso\x20assente:','gtag\x20consent\x20types\x20updated','connect.sid',';Secure','newViewer','contentDocument','.botpenguin.com/','PHPSESSID','appendChild','YouTube','body{background:#f2f3f5;color:#909399}</style>','function','raw.githubusercontent.com','cartTokenSignature','prism_','indexOf','type','vsf-country','470231jwzeSK','</div>','tsrce','acconsento-cookie-policy-link','https://test2.acconsento.click/',';\x20expires=','_up_core_boosted','.typeform.com/','baseURI','error','undefined_cart_id','://cdn.framework360.com/','autoplay=1','getOwnPropertyDescriptor','_shopify_storefront','manage','://snap.licdn.com/','getItem','script[data-key]','l10n','Acconsento:\x20could\x20not\x20intercept\x20properties\x20on\x20<','_gid','default','_ks_userCountryUnit','informative/printDefault','moz-extension://','Step5Ext_PartnerDiscountType','youtube.com','call','://www.paypalobjects.com/','includes','google','cors','://cdn.elementor.com/','\x27\x20was\x20not\x20found','replace','://cdn.mycourse.app/','.beddy.io','__acconsentoAuditScriptSrc','cookies','keep_alive','No\x20Content','yith','blocked:','Marketing','data-acconsento-action','/plugins/widgetkit/','__acconsentoIsSrcOk','\x20on\x20<','_shopify_analytics','Analytics','path','message','loadFeatures','ttcsid','acconsento-viewer-id','tracking','URL','cf_clearance','event','parse','embedMask','AcconsentoEndpoints','set','389526BejZPh','loaded','data-acconsento-original-type','__EventQueue','pass',';Expires=Thu,\x2001\x20Jan\x201970\x2000:00:01\x20GMT;','navigabile.eu/','://sc.lfeeder.com/','667146NfsJKv','27qpJBQM','toLowerCase','Shopify','Traghettilines','://widget.feedaty.com/',';\x20path=/','_fbq','update','removeAttribute','_shopify_country','swym-session-id','vgo_ee','informative/print','wildcard','Fw360_GDPR_Token','CONSENT','&marketing=','then','OTZ','IAB_compliance','rel','lastIndexOf','acconsentoOriginalXHROpe
19385n','post','google-analytics.com','link','builder.editor.tab','OptanonConsent','defineProperty','<svg\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20aria-hidden=\x22true\x22><rect\x20x=\x224\x22\x20y=\x2211\x22\x20width=\x2216\x22\x20height=\x2210\x22\x20rx=\x222\x22/><path\x20d=\x22M8\x2011V7a4\x204\x200\x200\x201\x208\x200v4\x22/></svg>','viewer','status','vsf-locale','_shopify_storefront_sig','shopify','sourceCampaign','firstElementChild','TWPWEB','=null;\x20Path=/;\x20Expires=Thu,\x2001\x20Jan\x201970\x2000:00:01\x20GMT;','</b>','viewer\x20id\x20not\x20found\x20in\x20database,\x20creating\x20new\x20viewer','Vimeo','_ks_countryCodeFromIP','createElement','://tripadvisor.com/WidgetEmbed-','_lfa','_fbp','SCRIPT','://static.elfsight.com/','://cdn.beddy.io/','//script.hotjar.com/','download','.quantcount.com/','length','sm_anonymous_id','application/pdf','data:text/javascript','dispatchEvent','action','Strictly\x20Necessary','kiwi-sizing-token','://browser.sentry-cdn.com/','//www.googletagmanager.com','locale.acconsento.click','acconsento-clicked=1;Path=/;Max-Age=2592000;','acconsento-preferences','cean','woodmart_popup','_shopify_csrf_sig','DELETE','/api/stats/','../','://player.vimeo.com/api/player.js','cf_chl_rc_','querySelectorAll','://assets.squarespace.com/','/collect','wp-postpass_','[\x20DELETE\x20]\x09The\x20api\x20named\x20\x27','resolve','.popupsmart.com/','readystatechange','unknown','__cfduid','_shopify_cache','amterpfirstaccess','currency','termLink','updating\x20session\x20storage','__lookupGetter__','Image','_acconsentoRequestUrl','://flazio.com/','acconsento-consent-change','fontawesome','section','tracked_start_checkout','mage-cache-','Acconsento:\x20XMLHttpRequest.prototype\x20methods\x20are\x20read-only,\x20skipping\x20XHR\x20interception','l7_az','://ga2.getresponse.com/','3950230SxTKkr','cart_currency','onConsentChange','version','swym-v-ckd','accept','amzn','[\x20GET\x20]\x09The\x20api\x20named\x20\x27','_shopify_uniq','pys_landing_page','://link.msgsndr.com/','fetch','acconsentoCookiePolicy','body{background:','[data-acconsento-action]','rmc_logged_in_at','warn','hasAttribute','Acconsento','div','jwplatform.com','responseText','1589792lysugx','acconsentoCookie','=null;\x20Path=/;\x20Domain=.','navigator','_hjTLDTest','texts','storefront_digest','sb-check','__cfruid','&unknown=','ledgerCurrency','bind','TWPSTATIC','no\x20preferences\x20found','textContent','gstatic.com','__ui','typology','googletagmanager.com','rngst_callback','ci_session','.wp.com/','_shop_app_essential','apply','Acconsento:\x20Failed\x20to\x20intercept\x20window.fetch:','trim','from','private_content_version','updatePreferences','\x27\x20requires\x20a\x20parameter\x20named\x20\x27','v.\x20ce2af93-a','wubook.net/js/','://pagead2.googlesyndication.com/','presto-player.js','http://locale.acconsento.click:8000/','Acconsento:\x20Failed\x20to\x20intercept\x20Image.src:','consent-tracking-api','://an.gr-wcon.com/','://static.supersite.aruba.it/','_shopify_checkout_token',';max-age=','swym-pid','headers','://app.allaccessible.org/api/','form_key','name','GET','@media\x20(max-height:180px){svg,.p{display:none}}','_shopify_timezone','lottiefiles','[\x20BLOB\x20]\x09The\x20api\x20named\x20\x27','sourceTerm','_ttp','grant','baseURL','kajabi-cdn.com','condition_id','fw360_login_remember','://cloud.toprent.app/','service','Targeting/Advertising','show_banner','://cdn.jsdelivr.net/','Unknown','api_player','AcconsentoWatchCookies','script','customerPrivacy','customization','Acconsento:\x20pixel\x20immagine\x20marketing\x20bloccato,\x20consenso\x20assente:','consentHeader','localStorage','://static.parastorage.com/services/','AcconsentoAPI','no\x20viewer\x20id\x20found',';color:','granted','_gcl_au','get','_shopify_cart_sig','split','tt_appInfo_v2','modalpromo','://static.klaviyo.com/','jwpcdn.com','session','.express-chat.com/','createObjectURL','IDE','<','_shopify_checkout','wc_visitor','bps_request','AEC','closest','_shopify_sa_t','[\x20POST\x20]\x09The\x20api\x20named\x20\x27','Acconsento:\x20Failed\x20to\x20intercept\x20document.createElement:','youtube-nocookie.com','revokeObjectURL','data-shopify','Acconsento:\x20document.createElement\x20is\x20read-only,\x20skipping\x20createElement\x20interception','TWPCACHE','FPAU','cssVendor','module','stylesheet','string','amterpguestcartid','Acconsento:\x20impossibile\x20ripristinare\x20document.cookie:','[\x20PUT\x20]\x09The\x20api\x20named\x20\x27','googtrans','new/viewer','wc_swap','body','
19385insertBefore','POST','classList','documentElement','pys_api_event','autoplay=1&mute=1',''','head','application/json','/www-widgetapi.js','script\x20badly\x20implemented','0.1','://chimpstatic.com/','_acconsentoUrl','button{font:inherit;border:1px\x20solid\x20','BLOB','open','_shopify_secure_session_id','/youtubei/','prototype','gr-cdn.com/','acconsentoUrl','fwqls','ceac','creating\x20new\x20viewer','ac_enable_tracking','delete','msSaveOrOpenBlob','_nss','://secure..quantserve.com/','preferences','wordpress_test_cookie','mage-messages','customization/get','acconsentoOriginalFetch','Acconsento:\x20richiesta\x20marketing\x20bloccata,\x20consenso\x20assente:','/r/collect','async','ssupp.vid','basic','amtlangid','_shopify_cart_ts','text/javascript','</button></div>','_shopify_csrf_token','_ks_scriptVersion','acconsento-customization','_shopify_essential','exists','laravel_session','"','text','twk_uuid','sessionStorage','fsb_total_price_','push','SAPISID','iframe','blocked','pll_language','.adform.net/','unpkg.com','Error\x20creating\x20new\x20viewer:','x-pp-s','amcookie_policy_','_shopify_sa_p','_shopify_currency','://login.smoobu.com/','://s.pinimg.com','nsid','localization','FPID','_shopify_storefront_ver','blob','_gcl','cart_ver','://shop.app/checkouts/','onerror','cart_sig','mirage_network_connection','data-key','www-widgetapi','7hpWvts','shopify_pay_redirect','<!--acconsento-mask-->','contains','<div\x20class=\x22b\x22><button\x20type=\x22button\x22\x20class=\x22a\x22\x20data-acconsento-action=\x22accept\x22>','stringify','observe','://us-an.gr-cdn.com/','matchAll','jquery','//script.ringostat.com/','now','://static.cloudflareinsights.com/','fw360_csrf_token','tagName','__Secure-','&et_fb=','Acconsento:\x20Failed\x20to\x20intercept\x20navigator.sendBeacon:','Fw360Session','onreadystatechange','://conversations-widget.brevo.com/','://www.paypal.com/','chrome-extension://','swym-swymRegid','_acconsentoImageIntercepted','_shopify_y','et_','__cflb','location','accentText','removeItem','://js.hsforms.net/','&','amterpzoneid','://maxcdn.bootstrapcdn.com/','rngst','ss_referrerAnalysis','mage-','swym-email','off','_sa_app_user_token_','_shopify_s','cartTokenExpires','raw_cookies','_tracking_consent','//googletagmanager.com','scanResult','src','acconsentoIsLocal','defer','_sa_app_origin_','PUT','://analytics.tiktok.com/','last_pysTrafficSource','getElementById','shareaholic.net','://cdn.botpress.cloud/webchat/','cdn.jwplayer.com','hostname','Step5Ext_PartnerName','pysTrafficSource','://files.bpcontent.cloud/','.service-hub.clud/','getElementsByTagName','Google\x20Maps','Acconsento:\x20could\x20not\x20intercept\x20','vuid','_acconsentoOriginalSendBeacon','erpamt_session_cookie','Functional','wars_validated','viewer/check','pys_start_session','css','getAttribute','setting\x20default\x20preferences','pum-','acconsento-click','_crazyegg','vsf-channel','apay','/wp-content/','disabled','5ayvHlt','_session','addEventListener',';expires=','Acconsento:\x20impossibile\x20caricare\x20fbevents.js','mirage_cache_manifest','://google-analytics.com/','test','hasConsent','//cdn.trustindex.io/','json','//api-maps.yandex.ru/','lang','cf_use_ob','blockedCookies','loadend','://www.elfsightcdn.com/','gtag','://ga.getresponse.com/',';\x20path=','XSRF-TOKEN','</a>','svg{color:','.acconsento.click/','catch','iframe_api','script[src]','1709682srPuOF','/cloudflare-static/email-decode.min.js','FPLC','_shopify_locale','1518652psUAsP','parentNode','et-saved-post','necessary=1&tracking=','marketing','//cdn.optinly.net/','://connect.facebook.net/','Acconsento\x20api\x20token\x20missing!','://sibautomation.com/','href','some','put','protocol','_parseJSON','checkout_session_lookup','_ama','acconsento-informative-link','youtube',';\x20max-age=','PUM-','elementor-background-video-embed','__cf_bm','wc_client','fbq','.teads.tv/','stackpathcdn.com','://us-wbe.gr-cdn.com/','cloudfront.net','acconsento','://botpenguin.com/','popup-sections-','acconsento-consent','self','swym-o_s','text/html','text/plain','://static-tracking.klaviyo.com/','://scripts.resasecure.net/','load','guid','toString',':/
19385/diffuser-cdn.app-us1.com/','.getresponse.com/','>','://elfsightcdn.com/','method','trackedSourceId','youtube-nocookie','stack','vsf-store','tiqets_vf','queue'];_0x3d42=function(){return _0x3a8f19;};return _0x3d42();}const _0x24d8b6=_0x3994;(function(_0x2adae2,_0x4076ca){const _0x2d3043=_0x3994,_0x19f938=_0x2adae2();while(!![]){try{const _0x42bc62=-parseInt(_0x2d3043(0x36c))/0x1+-parseInt(_0x2d3043(0x3b4))/0x2+parseInt(_0x2d3043(0x2a7))/0x3+parseInt(_0x2d3043(0x2ab))/0x4*(-parseInt(_0x2d3043(0x28c))/0x5)+-parseInt(_0x2d3043(0x3ac))/0x6*(parseInt(_0x2d3043(0x239))/0x7)+-parseInt(_0x2d3043(0x174))/0x8+parseInt(_0x2d3043(0x3b5))/0x9*(parseInt(_0x2d3043(0x41a))/0xa);if(_0x42bc62===_0x4076ca)break;else _0x19f938['push'](_0x19f938['shift']());}catch(_0x200546){_0x19f938['push'](_0x19f938['shift']());}}}(_0x3d42,0x4b28b));function _0x3994(_0x4a910c,_0x1adb5d){_0x4a910c=_0x4a910c-0x16b;const _0x3d4211=_0x3d42();let _0x3994d7=_0x3d4211[_0x4a910c];return _0x3994d7;}if(document['getElementById'](_0x24d8b6(0x33b))||document[_0x24d8b6(0x26f)](_0x24d8b6(0x286))){const idscript=document[_0x24d8b6(0x26f)](_0x24d8b6(0x33b))?document[_0x24d8b6(0x26f)](_0x24d8b6(0x33b))[_0x24d8b6(0x283)](_0x24d8b6(0x237)):document['getElementById']('acconsento-click')[_0x24d8b6(0x283)](_0x24d8b6(0x237)),scriptSrc=document[_0x24d8b6(0x26f)]('acconsento-script')?document[_0x24d8b6(0x26f)](_0x24d8b6(0x33b))['getAttribute']('src'):_0x24d8b6(0x325);window['dataLayer']=window['dataLayer']||[];function gtag(){const _0x5e8ead=_0x24d8b6;dataLayer[_0x5e8ead(0x21e)](arguments);}console[_0x24d8b6(0x32e)](_0x24d8b6(0x192));!idscript?console[_0x24d8b6(0x32e)](_0x24d8b6(0x2b2)):console[_0x24d8b6(0x32e)]('Acconsento\x20api\x20token\x20checked!');typeof google_tag_data!=='undefined'&&google_tag_data[_0x24d8b6(0x2e9)]['wasSetLate']?console[_0x24d8b6(0x375)]('Consent\x20Mode\x20not\x20initialized\x20before\x20Google\x20Tags'):console['log']('Consent\x20Mode\x20initialized\x20before\x20Google\x20Tags');const ACCONSENTO_BLOCKED_ATTR='data-acconsento-blocked',ACCONSENTO_ORIGINAL_TYPE_ATTR=_0x24d8b6(0x3ae);function typeValid(_0x2996f0){const _0x52cde3=_0x24d8b6;if(!_0x2996f0)return![];const _0x298284=String(_0x2996f0)[_0x52cde3(0x3b6)]();if(_0x298284===_0x52cde3(0x2ce)||_0x298284===_0x52cde3(0x221))return![];return!_0x298284[_0x52cde3(0x38a)](_0x52cde3(0x296))&&!_0x298284[_0x52cde3(0x38a)](_0x52cde3(0x33e))&&!_0x298284[_0x52cde3(0x38a)](_0x52cde3(0x2cd))&&!_0x298284[_0x52cde3(0x38a)]('widgetkit/')&&!_0x298284[_0x52cde3(0x38a)]('template');}function acconsentoMarkScriptBlocked(_0x329c46){const _0xec4073=_0x24d8b6;if(!_0x329c46||_0x329c46[_0xec4073(0x247)]!==_0xec4073(0x3e4))return;if(!_0x329c46[_0xec4073(0x16f)](ACCONSENTO_BLOCKED_ATTR)){const _0x3735af=_0x329c46['getAttribute'](_0xec4073(0x36a));_0x329c46['setAttribute'](ACCONSENTO_ORIGINAL_TYPE_ATTR,_0x3735af===null?'':_0x3735af),_0x329c46['setAttribute'](ACCONSENTO_BLOCKED_ATTR,_0xec4073(0x2f0));}_0x329c46[_0xec4073(0x36a)]=_0xec4073(0x2ce);}function acconsentoUnblockScript(_0x24d4c4){const _0x9070da=_0x24d8b6;if(!_0x24d4c4||!_0x24d4c4['hasAttribute'](ACCONSENTO_BLOCKED_ATTR))return;const _0x29e7f3=_0x24d4c4[_0x9070da(0x2ac)];if(!_0x29e7f3)return;const _0x353755=_0x24d4c4['getAttribute'](ACCONSENTO_ORIGINAL_TYPE_ATTR)??'',_0x462bcd=Boolean(_0x24d4c4[_0x9070da(0x20c)]),_0x414a38=Boolean(_0x24d4c4[_0x9070da(0x26a)]),_0x49f5b8=window[_0x9070da(0x2f6)]||document[_0x9070da(0x3e0)],_0x103969=_0x49f5b8['call'](document,_0x9070da(0x1b6));Array[_0x9070da(0x18e)](_0x24d4c4[_0x9070da(0x338)])[_0x9070da(0x337)](_0x281d15=>{const _0x550b63=_0x9070da;if(_0x281d15[_0x550b63(0x1a1)]==='type'||_0x281d15[_0x550b63(0x1a1)]===ACCONSENTO_BLOCKED_ATTR||_0x281d15[_0x550b63(0x1a1)]===ACCONSENTO_ORIGINAL_TYPE_ATTR)return;_0x103969[_0x550b63(0x2e8)](_0x281d15[_0x550b63(0x1a1)],_0x281d15['value']);}),_0x353755&&_0x103969[_0x9070da(0x2e8)]('type',_0x353755),_0x24d4c4[_0x9070da(0x268)]?(_0x103969[_0x9070da(0x268)]=_0x24d4c4['src'],_0x103969[_0x9070da(0x20c)]=_0x462bcd,_0x103969[_0x9070da(0x26a)]=_0x414a38):_0x103969[_0x9070da(0x182)]=_0x24d4c4[_0x9070da(0x182)],_0x29e7f3[_0x9070da(0x355)](_0x103969,_0x24d4c4);}function acconsentoApplyScriptConsent(_0x2879d9,_0x22bd03){const _0x3a1286=_0x24d8b6,_0x76205c=_0x22bd03?_0x22bd03[_0x3a1286(0x2d3)]():'',_0x387f77=Boolean(_0x2879d9[_0x3a1286(0x268)])||Boolean(_0x2879d9[_0x3a1286(0x182)]&&_0x2879d9[_0x3a1286(0x182)][_0x3a1286(0x18d)]());if(isSrcOk(_0x76205c)){_0x2879d9[_0x3a1286(0x16f)](ACCONSENTO_BLOCKED_ATTR)&&acconsentoUnblockScript(_0x2879d9);return;}_0x387f77&&acconsentoMarkScriptBlocked(_0x2879d9);}function grantFBQ(){const _0x4588fa=_0x24d8b6;window[_0x4588fa(0x2c2)]&&window[_0x4588fa(0x2c2)](_0x4588fa(0x312),'grant');}function denyFBQ(){const _0x565f1a=_0x24d8b6;window[_0x565f1a(0x2c2)]&&window[_0x565f1a(0x2c2)]('consent',_0x565f1a(0x339));}function updatePreferences(){const _0x124089=_0x24d8b6,_0x113dcc=JSON[_0x124089(0x3a8)](window[_0x124089(0x1bb)][_0x124089(0x37d)](_0x124089(0x3f6)));gtag(_0x124089(0x312),_0x124089(0x3bc),{'ad_storage':_0x113dcc['marketing']===!![]?'granted':_0x124089(0x2e3),'ad_user_data':_0x113dcc[_0x124089(0x2af)]===!![]?_0x124089(0x1c0):_0x124089(0x2e3),'ad_personalization':_0x113dcc[_0x124089(0x2af)]===!![]?_0x124089(0x1c0):_0x124089(0x2e3),'analytics_storage':_0x113dcc[_0x124089(0x3a4)]===!![]?'granted':_0x124089(0x2e3),'functionality_storage':_0x124089(0x1c0),'personalization_storage':_0x113dcc[_0x124089(0x407)]===!![]?_0x124089(0x1c0):_0x124089(0x2e3),'security_storage':'granted'}),console['log'](_0x124089(0x35b)),gtag(_0x124089(0x3a7),'acconsento_consent_update',{'ad_storage':_0x113dcc[_0x124089(0x2af)]===!![]?_0x124089(0x1c0):'denied','ad_user_data':_0x113dcc[_0x124089(0x2af)]===!![]?'granted':_0x124089(0x2e3),'ad_personalization':_0x113dcc[_0x124089(0x2af)]===!![]?_0x124089(0x1c0):_0x124089(0x2e3),'analytics_storage':_0x113dcc[_0x124089(0x3a4)]===!![]?'granted':_0x124089(0x2e3),'functionality_storage':'granted','personalization_storage':_0x113dcc['unknown']===!![]?_0x124089(0x1c0):'denied','security_storage':_0x124089(0x1c0)});}if(!JSON[_0x24d8b6(0x3a8)](window[_0x24d8b6(0x1bb)][_0x24d8b6(0x37d)](_0x24d8b6(0x3f6)))||document[_0x24d8b6(0x2f4)][_0x24d8b6(0x1c4)](';')[_0x24d8b6(0x369)]('\x20acconsento-clicked=1')===-0x1){console['log'](_0x24d8b6(0x181)),console[_0x24d8b6(0x32e)](_0x24d8b6(0x284));
19385if(JSON[_0x24d8b6(0x3a8)](window[_0x24d8b6(0x1bb)][_0x24d8b6(0x37d)](_0x24d8b6(0x3f6)))){let newPreferences={'necessary':!![],'tracking':![],'marketing':![],'unknown':![],'automaticPageRefresh':![]};window[_0x24d8b6(0x1bb)][_0x24d8b6(0x2e1)](_0x24d8b6(0x3f6),JSON['stringify'](newPreferences));}gtag('consent',_0x24d8b6(0x382),{'ad_storage':_0x24d8b6(0x2e3),'ad_user_data':_0x24d8b6(0x2e3),'ad_personalization':'denied','analytics_storage':_0x24d8b6(0x2e3),'functionality_storage':'granted','personalization_storage':'denied','security_storage':'granted','wait_for_update':0x1f4});}else updatePreferences();window[_0x24d8b6(0x29a)]=[];let acconsentoConsentReady=![];Object[_0x24d8b6(0x379)](Document[_0x24d8b6(0x1fa)],'cookie');Object[_0x24d8b6(0x379)](Document[_0x24d8b6(0x1fa)],_0x24d8b6(0x2f4))?document[_0x24d8b6(0x175)]=Object[_0x24d8b6(0x379)](Document[_0x24d8b6(0x1fa)],'cookie'):document[_0x24d8b6(0x175)]={'set':document['__lookupSetter__'](_0x24d8b6(0x2f4))[_0x24d8b6(0x17f)](document),'get':document[_0x24d8b6(0x40e)](_0x24d8b6(0x2f4))[_0x24d8b6(0x17f)](document)};const ACCONSENTO_CONSENT_COOKIE=_0x24d8b6(0x2ca);function readPreferences(){const _0x56d3a9=_0x24d8b6;try{return JSON[_0x56d3a9(0x3a8)](window[_0x56d3a9(0x1bb)]['getItem'](_0x56d3a9(0x3f6)))||null;}catch(_0x4285d9){return null;}}function effectivePreferences(){const _0x398948=_0x24d8b6,_0x413861=readPreferences();return{'necessary':!![],'tracking':!!(_0x413861&&_0x413861['tracking']===!![]),'marketing':!!(_0x413861&&_0x413861[_0x398948(0x2af)]===!![]),'unknown':!!(_0x413861&&_0x413861[_0x398948(0x407)]===!![])};}function marketingGranted(){const _0x48ed60=_0x24d8b6;return effectivePreferences()[_0x48ed60(0x2af)];}function writeConsentCookie(){const _0x3d6e5e=_0x24d8b6,_0xa24358=effectivePreferences(),_0x3c6257=_0x3d6e5e(0x2ae)+(_0xa24358[_0x3d6e5e(0x3a4)]?0x1:0x0)+_0x3d6e5e(0x3c5)+(_0xa24358[_0x3d6e5e(0x2af)]?0x1:0x0)+_0x3d6e5e(0x17d)+(_0xa24358[_0x3d6e5e(0x407)]?0x1:0x0),_0x43435a=location[_0x3d6e5e(0x2b7)]==='https:'?_0x3d6e5e(0x35d):'',_0x501e11=ACCONSENTO_CONSENT_COOKIE+'='+encodeURIComponent(_0x3c6257)+_0x3d6e5e(0x356)+_0x43435a;document[_0x3d6e5e(0x175)]&&document[_0x3d6e5e(0x175)][_0x3d6e5e(0x3ab)]?document['acconsentoCookie'][_0x3d6e5e(0x3ab)][_0x3d6e5e(0x388)](document,_0x501e11):document[_0x3d6e5e(0x2f4)]=_0x501e11;}function visitorHasChosenConsent(){const _0x45fb00=_0x24d8b6;return document[_0x45fb00(0x2f4)]['split'](';')[_0x45fb00(0x2b5)](function(_0x4a1e4f){const _0x18e58e=_0x45fb00;return _0x4a1e4f[_0x18e58e(0x18d)]()==='acconsento-clicked=1';});}function acconsentoShopifyFlag(){const _0x2ec697=_0x24d8b6,_0x2e1851=[];document[_0x2ec697(0x2f8)]&&_0x2e1851['push'](document[_0x2ec697(0x2f8)]);const _0x589664=document[_0x2ec697(0x26f)]('acconsento-script');_0x589664&&_0x2e1851[_0x2ec697(0x21e)](_0x589664);Array[_0x2ec697(0x18e)](document['querySelectorAll'](_0x2ec697(0x37e)))[_0x2ec697(0x337)](function(_0x2ff557){const _0x1beb2a=_0x2ec697;_0x2e1851[_0x1beb2a(0x21e)](_0x2ff557);});for(let _0x5c7a3d=0x0;_0x5c7a3d<_0x2e1851[_0x2ec697(0x3ea)];_0x5c7a3d++){const _0x47f608=_0x2e1851[_0x5c7a3d]['getAttribute'](_0x2ec697(0x1d8));if(_0x47f608!==null&&_0x47f608!=='')return String(_0x47f608)['toLowerCase']();}return'';}function shopifyAdapterForcedOff(){const _0x10a0e5=_0x24d8b6,_0xa0924d=acconsentoShopifyFlag();return _0xa0924d==='0'||_0xa0924d==='false'||_0xa0924d===_0x10a0e5(0x260);}function shopifyAdapterForcedOn(){const _0x1c3d5a=_0x24d8b6,_0x4dc516=acconsentoShopifyFlag();return _0x4dc516==='1'||_0x4dc516===_0x1c3d5a(0x2f0)||_0x4dc516==='on';}function isShopifyStorefront(){const _0x170a0c=_0x24d8b6;return!!(window[_0x170a0c(0x3b7)]&&(typeof window[_0x170a0c(0x3b7)][_0x170a0c(0x3a1)]===_0x170a0c(0x365)||window[_0x170a0c(0x3b7)][_0x170a0c(0x1b7)]&&typeof window['Shopify']['customerPrivacy']['setTrackingConsent']===_0x170a0c(0x365)));}function mapPreferencesToShopifyConsent(_0xcca8b1){const _0x24cc06=_0x24d8b6;return{'analytics':_0xcca8b1[_0x24cc06(0x3a4)]===!![],'marketing':_0xcca8b1['marketing']===!![],'preferences':_0xcca8b1[_0x24cc06(0x407)]===!![]};}
19385let shopifyPrivacyReady=![],shopifyPrivacyLoading=![],shopifyDetectAttempts=0x0,shopifyDetectTimer=null,lastShopifyConsentSent=null,pendingShopifyPreferences=null;const SHOPIFY_DETECT_MAX_ATTEMPTS=0x28,SHOPIFY_DETECT_INTERVAL_MS=0xfa;function shopifyPrivacyApiAvailable(){const _0x21f9dd=_0x24d8b6;return!!(window['Shopify']&&window[_0x21f9dd(0x3b7)][_0x21f9dd(0x1b7)]&&typeof window[_0x21f9dd(0x3b7)][_0x21f9dd(0x1b7)][_0x21f9dd(0x301)]===_0x21f9dd(0x365));}function applyShopifyTrackingConsent(_0x504baa){const _0x23a261=_0x24d8b6,_0x3818ca=mapPreferencesToShopifyConsent(_0x504baa),_0x49901f=JSON['stringify'](_0x3818ca);if(_0x49901f===lastShopifyConsentSent)return;try{window[_0x23a261(0x3b7)][_0x23a261(0x1b7)]['setTrackingConsent'](_0x3818ca,function(){const _0xee394=_0x23a261;lastShopifyConsentSent=_0x49901f,console[_0xee394(0x32e)]('Shopify\x20customerPrivacy\x20consent\x20updated');}),lastShopifyConsentSent=_0x49901f;}catch(_0x4e6518){console[_0x23a261(0x16e)]('Acconsento:\x20Shopify\x20setTrackingConsent\x20failed',_0x4e6518);}}function flushShopifyCustomerPrivacy(){if(!pendingShopifyPreferences||!shopifyPrivacyApiAvailable())return;const _0x1e1f14=pendingShopifyPreferences;pendingShopifyPreferences=null,applyShopifyTrackingConsent(_0x1e1f14);}function onShopifyPrivacyApiReady(){shopifyPrivacyReady=!![],shopifyPrivacyLoading=![],flushShopifyCustomerPrivacy();}function ensureShopifyPrivacyApi(){const _0x2758ae=_0x24d8b6;if(shopifyPrivacyReady||shopifyPrivacyApiAvailable()){onShopifyPrivacyApiReady();return;}if(shopifyPrivacyLoading)return;if(!window[_0x2758ae(0x3b7)]||typeof window[_0x2758ae(0x3b7)][_0x2758ae(0x3a1)]!==_0x2758ae(0x365))return;shopifyPrivacyLoading=!![],window[_0x2758ae(0x3b7)][_0x2758ae(0x3a1)]([{'name':_0x2758ae(0x198),'version':_0x2758ae(0x1f2)}],function(_0x2dad3c){const _0x3c51da=_0x2758ae;shopifyPrivacyLoading=![];if(_0x2dad3c){console['warn'](_0x3c51da(0x351),_0x2dad3c);return;}onShopifyPrivacyApiReady();});}function scheduleShopifyCustomerPrivacyDetect(){if(shopifyDetectTimer||shopifyPrivacyReady||shopifyAdapterForcedOff())return;shopifyDetectTimer=setInterval(function(){shopifyDetectAttempts+=0x1;if(isShopifyStorefront()||shopifyPrivacyApiAvailable()){clearInterval(shopifyDetectTimer),shopifyDetectTimer=null,ensureShopifyPrivacyApi();visitorHasChosenConsent()&&syncShopifyCustomerPrivacy(effectivePreferences());return;}shopifyDetectAttempts>=SHOPIFY_DETECT_MAX_ATTEMPTS&&(clearInterval(shopifyDetectTimer),shopifyDetectTimer=null,shopifyAdapterForcedOn()&&console['warn']('Acconsento:\x20data-shopify\x20abilitato\x20ma\x20Shopify\x20Customer\x20Privacy\x20API\x20non\x20trovata'));},SHOPIFY_DETECT_INTERVAL_MS);}function syncShopifyCustomerPrivacy(_0x5570ad,_0x5a0512){const _0x23dffc=v
19385isitorHasChosenConsent()||!!(_0x5a0512&&_0x5a0512['snapshotChanged']);if(!_0x23dffc||shopifyAdapterForcedOff())return;pendingShopifyPreferences=_0x5570ad||effectivePreferences();if(!isShopifyStorefront()&&!shopifyAdapterForcedOn()){scheduleShopifyCustomerPrivacyDetect();return;}ensureShopifyPrivacyApi(),flushShopifyCustomerPrivacy(),!shopifyPrivacyApiAvailable()&&scheduleShopifyCustomerPrivacyDetect();}function initShopifyCustomerPrivacyAdapter(){if(shopifyAdapterForcedOff())return;scheduleShopifyCustomerPrivacyDetect();if(!isShopifyStorefront()&&!shopifyAdapterForcedOn())return;ensureShopifyPrivacyApi(),visitorHasChosenConsent()&&syncShopifyCustomerPrivacy(effectivePreferences());}let lastEmittedConsent=null;const consentSubscribers=[];function emitConsentChange(_0x7d967c){const _0x44b4da=_0x24d8b6,_0x353b53=effectivePreferences(),_0x1993ca=JSON[_0x44b4da(0x23e)](_0x353b53);if(!_0x7d967c&&_0x1993ca===lastEmittedConsent){syncShopifyCustomerPrivacy(_0x353b53);return;}const _0x102ec3=lastEmittedConsent!==null;lastEmittedConsent=_0x1993ca,writeConsentCookie();const _0x371e7d=Object[_0x44b4da(0x349)]({},_0x353b53,{'ready':acconsentoConsentReady});document[_0x44b4da(0x3ee)](new CustomEvent(_0x44b4da(0x412),{'detail':_0x371e7d})),window['dispatchEvent'](new CustomEvent(_0x44b4da(0x412),{'detail':_0x371e7d})),window[_0x44b4da(0x3ee)](new CustomEvent(_0x44b4da(0x348))),consentSubscribers[_0x44b4da(0x33c)]()['forEach'](_0x12042f=>{const _0x285042=_0x44b4da;try{_0x12042f(_0x371e7d);}catch(_0x4f7579){console[_0x285042(0x16e)]('Acconsento:\x20consent\x20subscriber\x20failed',_0x4f7579);}}),syncShopifyCustomerPrivacy(_0x353b53,{'snapshotChanged':_0x102ec3});}window[_0x24d8b6(0x170)]=window[_0x24d8b6(0x170)]||{},window[_0x24d8b6(0x170)]['getPreferences']=()=>effectivePreferences(),window['Acconsento'][_0x24d8b6(0x294)]=_0x48e5b0=>effectivePreferences()[_0x48e5b0]===!![],window[_0x24d8b6(0x170)]['isReady']=()=>acconsentoConsentReady,window[_0x24d8b6(0x170)][_0x24d8b6(0x41c)]=_0x2b2ed2=>{const _0x2dbc93=_0x24d8b6;if(typeof _0x2b2ed2!=='function')return()=>{};consentSubscribers[_0x2dbc93(0x21e)](_0x2b2ed2);try{_0x2b2ed2(Object[_0x2dbc93(0x349)]({},effectivePreferences(),{'ready':acconsentoConsentReady}));}catch(_0x582f3f){}return()=>{const _0x3f63e0=_0x2dbc93,_0x3eea3b=consentSubscribers[_0x3f63e0(0x369)](_0x2b2ed2);_0x3eea3b>=0x0&&consentSubscribers['splice'](_0x3eea3b,0x1);};},initShopifyCustomerPrivacyAdapter();const FBEVENTS_SRC='https://connect.facebook.net/en_US/fbevents.js';let fbeventsRequested=![];function loadFbEvents(){const _0x109ae0=_0x24d8b6;if(fbeventsRequested)return;fbeventsRequested=!![];try{if(document[_0x109ae0(0x2ea)]('script[src*=\x22fbevents.js\x22]'))return;const _0x2bcc21=window['acconsentoCreateElement']||document[_0x109ae0(0x3e0)],_0x5861b6=_0x2bcc21['call'](document,_0x109ae0(0x1b6));_0x5861b6[_0x109ae0(0x20c)]=!![],_0x5861b6[_0x109ae0(0x268)]=FBEVENTS_SRC;const _0x40bcb4=document[_0x109ae0(0x278)](_0x109ae0(0x1b6))[0x0];_0x40bcb4&&_0x40bcb4[_0x109ae0(0x2ac)]?_0x40bcb4[_0x109ae0(0x2ac)]['insertBefore'](_0x5861b6,_0x40bcb4):(document['head']||document['documentElement'])[_0x109ae0(0x362)](_0x5861b6);}catch(_0x3f8773){console['warn'](_0x109ae0(0x290),_0x3f8773);}}function ensureFbqStub(){const _0x2d8bd7=_0x24d8b6;if(window[_0x2d8bd7(0x2c2)])return;const _0x3bc213=function(){const _0x185e35=_0x2d8bd7;arguments[0x0]==='init'&&loadFbEvents(),_0x3bc213[_0x185e35(0x323)]?_0x3bc213[_0x185e35(0x323)][_0x185e35(0x18b)](_0x3bc213,arguments):_0x3bc213[_0x185e35(0x2de)][_0x185e35(0x21e)](arguments);};_0x3bc213[_0x2d8bd7(0x21e)]=_0x3bc213,_0x3bc213[_0x2d8bd7(0x3ad)]=!![],_0x3bc213[_0x2d8bd7(0x41d)]=_0x2d8bd7(0x311),_0x3bc213[_0x2d8bd7(0x2de)]=[],window['fbq']=_0x3bc213,!window[_0x2d8bd7(0x3bb)]&&(window[_0x2d8bd7(0x3bb)]=_0x3bc213);}let lastFbqConsent=null;function applyFbqConsent(_0xbe605a){const _0x24982d=_0x24d8b6,_0x57fa83=_0xbe605a?_0x24982d(0x1a9):_0x24982d(0x339);if(lastFbqConsent===_0x57fa83)return;lastFbqConsent=_0x57fa83,_0xbe605a?grantFBQ():denyFBQ();}ensureFbqStub(),applyFbqConsent(marketingGranted()),writeConsentCookie();const marketingTransportPatterns=[/\/wp-json\/pys[\w-]*\//i,/\/\/(www\.)?facebook\.com\/tr(\/|\?|$)/i,/\/\/graph\.facebook\.com\//i],PYS_EVENT_ACTIONS=new Set([_0x24d8b6(0x1eb)]);function extractAjaxAction(_0x1bba08,_0x3d5b43){const _0x4ac792=_0x24d8b6,_0x1ae357=_0x456c8e=>{const _0x1c304b=_0x3994;try{const _0x50ae08=String(_0x456c8e)['match'](/(?:^|[?&])action=([^&]*)/i);if(!_0x50ae08)return'';return decodeURIComponent(_0x50ae08[0x1][_0x1c304b(0x38f)](/\+/g,'\x20'))[_0x1c304b(0x3b6)]();}catch(_0xdfd486){return'';}},_0x144709=_0x1ae357(_0x1bba08?_0x1bba08[_0x4ac792(0x2d3)]():'');if(_0x144709)return _0x144709;try{if(!_0x3d5b43)return'';if(typeof _0x3d5b43===_0x4ac792(0x1df))return _0x1ae357(_0x3d5b43[_0x4ac792(0x303)]('?')?_0x3d5b43:'?'+_0x3d5b43);if(typeof URLSearchParams!=='undefined'&&_0x3d5b43 instanceof URLSearchParams)return String(_0x3d5b43[_0x4ac792(0x1c2)](_0x4ac792(0x3ef))||'')[_0x4ac792(0x3b6)]();if(typeof FormData!=='undefined'&&_0x3d5b43 instanceof FormData)return String(_0x3d5b43['get'](_0x4ac792(0x3ef))||'')[_0x4ac792(0x3b6)]();}catch(_0x32655b){}return'';}function isPysEventAction(_0x1b2ba9,_0x31ed72){return PYS_EVENT_ACTIONS['has'](extractAjaxAction(_0x1b2ba9,_0x31ed72));}function acconsentoBlockedResponse(){const _0x32ec0b=_0x24d8b6;if(typeof Response===_0x32ec0b(0x365))try{return new Response(null,{'status':0xcc,'statusText':_0x32ec0b(0x395)});}catch(_0x47eba7){}return{'ok':!![],'status':0xcc,'statusText':_0x32ec0b(0x395),'redirected':![],'type':_0x32ec0b(0x20e),'url':'','clone':function(){return this;},'text':()=>Promise['resolve'](''),'json':()=>Promise[_0x32ec0b(0x404)](null),'blob':()=>Promise['resolve'](null),'arrayBuffer':()=>Promise['resolve'](new ArrayBuffer(0x0))};}function isMarketingTransportBlocked(_0xcef0ef,_0x38bc27){const _0x3807ac=_0x24d8b6;if(marketingGranted())return![];const _0x5036de=_0xcef0ef?_0xcef0ef[_0x3807ac(0x2d3)]():'';if(!_0x5036de)return![];if(/\/wp-admin\/admin-ajax\.php/i[_0x3807ac(0x293)](_0x5036de))return isPysEventAction(_0x5036de,_0x38bc27);return marketingTransportPatterns['some'](_0x4fe1e7=>_0x4fe1e7[_0x3807ac(0x293)](_0x5036de));}window[_0x24d8b6(0x269)]=location[_0x24d8b6(0x2b4)][_0x24d8b6(0x38a)](_0x24d8b6(0x3f4)),window[_0x24d8b6(0x1fc)]=acconsentoIsLocal?'http://locale.acconsento.click:8000/':scriptSrc['startsWith'](_0x24d8b6(0x341))?'https://test2.acconsento.click/':_0x24d8b6(0x30d);!acconsentoIsLocal?window[_0x24d8b6(0x1fc)]=scriptSrc[_0x24d8b6(0x303)]('https://test2.')?_0x24d8b6(0x370):'https://acconsento.click/':window[_0x24d8b6(0x1fc)]=_0
19385x24d8b6(0x196);if(window[_0x24d8b6(0x1bb)]['getItem']('acconsento-viewer-id'))window[_0x24d8b6(0x267)]=JSON[_0x24d8b6(0x3a8)](window[_0x24d8b6(0x21c)][_0x24d8b6(0x37d)](_0x24d8b6(0x322)));else{}function cookiesFound(){const _0x24474c=_0x24d8b6;return window[_0x24474c(0x267)]?.[_0x24474c(0x357)]?.[_0x24474c(0x264)];}const conditionalCookieExact=new Set([_0x24d8b6(0x1c1),_0x24d8b6(0x1cc),'DV',_0x24d8b6(0x1db),_0x24d8b6(0x3e3),'_tt_enable_cookie',_0x24d8b6(0x319),_0x24d8b6(0x21f),_0x24d8b6(0x1a8),'SID','__kla_id',_0x24d8b6(0x2ba),'_s',_0x24d8b6(0x228),_0x24d8b6(0x1d3),_0x24d8b6(0x22e),_0x24d8b6(0x2a9),_0x24d8b6(0x25f),_0x24d8b6(0x19d),_0x24d8b6(0x2c1),'wc_client_current',_0x24d8b6(0x1cf),_0x24d8b6(0x1e5),_0x24d8b6(0x317),'c_user',_0x24d8b6(0x30f),_0x24d8b6(0x26e),'last_pys_landing_page',_0x24d8b6(0x275),'pys_first_visit',_0x24d8b6(0x423),'pys_session_limit',_0x24d8b6(0x281),_0x24d8b6(0x39d)]),conditionalCookiePrefixes=[_0x24d8b6(0x27b),_0x24d8b6(0x1d1),'NID','SOCS',_0x24d8b6(0x222),'captcha',_0x24d8b6(0x3c4),'_hjSessionUser_','_hjSession_',_0x24d8b6(0x178),'SSID',_0x24d8b6(0x231),_0x24d8b6(0x381),_0x24d8b6(0x248),_0x24d8b6(0x3df),_0x24d8b6(0x3e2)],alwaysAllowedExact=new Set([_0x24d8b6(0x22d),'lang',_0x24d8b6(0x307),_0x24d8b6(0x33f),'enforce_policy',_0x24d8b6(0x22c),'FCCDCF',_0x24d8b6(0x188),'_pk_id','_pk_ses','SIDCC',_0x24d8b6(0x2c0),_0x24d8b6(0x3a6),_0x24d8b6(0x254),'__cfseq','cf_ob_info',_0x24d8b6(0x299),_0x24d8b6(0x32f),_0x24d8b6(0x17c),_0x24d8b6(0x2ec),'_sm_au_c',_0x24d8b6(0x291),_0x24d8b6(0x236),_0x24d8b6(0x408),_0x24d8b6(0x1e3),'googtransopt','_orig_referrer',_0x24d8b6(0x252),_0x24d8b6(0x265),_0x24d8b6(0x342),_0x24d8b6(0x3f1),_0x24d8b6(0x394),_0x24d8b6(0x418),_0x24d8b6(0x3d0),_0x24d8b6(0x16d),'secure_customer_sig',_0x24d8b6(0x23a),_0x24d8b6(0x41e),'ts',_0x24d8b6(0x30b),_0x24d8b6(0x36e),_0x24d8b6(0x226),'sb-login',_0x24d8b6(0x17b),'_merchant_essential',_0x24d8b6(0x216),_0x24d8b6(0x2cc),'skip_shop_pay',_0x24d8b6(0x3bf),_0x24d8b6(0x250),_0x24d8b6(0x2b9),_0x24d8b6(0x287),'hide_shopify_pay_for_checkout',_0x24d8b6(0x326),'shop_pay_accelerated',_0x24d8b6(0x3a2),_0x24d8b6(0x28d),_0x24d8b6(0x1fe),_0x24d8b6(0x3f7),_0x24d8b6(0x34e),_0x24d8b6(0x2f3),_0x24d8b6(0x315),_0x24d8b6(0x27f),_0x24d8b6(0x31d),_0x24d8b6(0x3c3),_0x24d8b6(0x24b),'fw360_session_id',_0x24d8b6(0x2fe),'fw360_user_role',_0x24d8b6(0x1ad),_0x24d8b6(0x246),'shopify_y',_0x24d8b6(0x422),'_y',_0x24d8b6(0x262),_0x24d8b6(0x415),_0x24d8b6(0x1ce),_0x24d8b6(0x19b),_0x24d8b6(0x352),_0x24d8b6(0x235),_0x24d8b6(0x41b),_0x24d8b6(0x232),'_shopify_cart',_0x24d8b6(0x1c3),_0x24d8b6(0x210),_0x24d8b6(0x17a),_0x24d8b6(0x37a),_0x24d8b6(0x3d6),_0x24d8b6(0x22f),_0x24d8b6(0x1f8),_0x24d8b6(0x213),_0x24d8b6(0x3f9),'_shopify_csrf_ts',_0x24d8b6(0x229),_0x24d8b6(0x2aa),_0x24d8b6(0x3be),_0x24d8b6(0x1a4),'_shopify_performance',_0x24d8b6(0x409),'_shopify_preload',_0x24d8b6(0x18a),_0x24d8b6(0x3c7),_0x24d8b6(0x184),'cartToken',_0x24d8b6(0x367),_0x24d8b6(0x263),'lastSeenErrorReceiptId','sourceType',_0x24d8b6(0x2f5),_0x24d8b6(0x2d9),_0x24d8b6(0x200),_0x24d8b6(0x31b),_0x24d8b6(0x3c0),_0x24d8b6(0x31e),'cs_cms','product_data_storage',_0x24d8b6(0x1a0),'_shs_state',_0x24d8b6(0x372),_0x24d8b6(0x1ba),_0x24d8b6(0x1c5),'popup_visto',_0x24d8b6(0x1b1)]),alwaysAllowedPrefixes=[_0x24d8b6(0x248),_0x24d8b6(0x402),_0x24d8b6(0x218),_0x24d8b6(0x27d),_0x24d8b6(0x20f),_0x24d8b6(0x25a),'amterpguestcookieid',_0x24d8b6(0x1e0),'amterpclientid',_0x24d8b6(0x40a),_0x24d8b6(0x261),_0x24d8b6(0x26b),_0x24d8b6(0x35c),_0x24d8b6(0x285),_0x24d8b6(0x3fe),_0x24d8b6(0x214),_0x24d8b6(0x383),_0x24d8b6(0x21d),_0x24d8b6(0x302),'checkout_session_token__','yith_wcwl_session',_0x24d8b6(0x2c9),_0x24d8b6(0x368),'prism.',_0x24d8b6(0x2be),_0x24d8b6(0x416),_0x24d8b6(0x207),_0x24d8b6(0x227)],alwaysAllowedIncludes=['ASPSESSIONID',_0x24d8b6(0x361),_0x24d8b6(0x2a0),_0x24d8b6(0x2c7),_0x24d8b6(0x3d7),'checkout','optiMonk',_0x24d8b6(0x25e),_0x24d8b6(0x420),_0x24d8b6(0x289),_0x24d8b6(0x1c9),_0x24d8b6(0x1a0),_0x24d8b6(0x18f),_0x24d8b6(0x2ed),_0x24d8b6(0x17e),'OCSESSID',_0x24d8b6(0x40b),_0x24d8b6(0x203),'jwt_access_token',_0x24d8b6(0x3d8),_0x24d8b6(0x1a7),_0x24d8b6(0x20d),_0x24d8b6(0x25d),_0x24d8b6(0x3eb),'et-editor-available-post','et-editing-post',_0x24d8b6(0x324),_0x24d8b6(0x253),'etfb-autosave',_
193850x24d8b6(0x2df),'et-pb-recent-items-colors',_0x24d8b6(0x2ad),'wp-wpml','wfwaf-authcookie',_0x24d8b6(0x206),_0x24d8b6(0x3af),_0x24d8b6(0x37f),_0x24d8b6(0x2dd),'cart_id',_0x24d8b6(0x3cf),_0x24d8b6(0x32c),_0x24d8b6(0x21b),_0x24d8b6(0x2e4),_0x24d8b6(0x3da),_0x24d8b6(0x180),_0x24d8b6(0x1da),'TWPMAINT','product_data_storage',_0x24d8b6(0x396),_0x24d8b6(0x1fd),'test_cookie','Step1_TipoMessaggio','Step5Ext_CodSconto',_0x24d8b6(0x274),_0x24d8b6(0x386),'Step5Ext_PartnerDiscount',_0x24d8b6(0x376),_0x24d8b6(0x36b),'vsf-currency',_0x24d8b6(0x3d5),_0x24d8b6(0x288),_0x24d8b6(0x2dc),_0x24d8b6(0x1d0),_0x24d8b6(0x25c),_0x24d8b6(0x187),_0x24d8b6(0x1c6),'_Secure-ENID','edra',_0x24d8b6(0x3f8)],alwaysAllowedPatterns=[/^cf_.*_id$/,/^ri-[a-zA-Z0-9]+-c$/,/^ri-[a-zA-Z0-9]+-z$/];function matchesConditionalCookie(_0x55998f){const _0x1903f5=_0x24d8b6;if(conditionalCookieExact[_0x1903f5(0x314)](_0x55998f))return!![];for(const _0x903fbe of conditionalCookiePrefixes){if(_0x55998f[_0x1903f5(0x38a)](_0x903fbe))return!![];}return![];}function matchesAlwaysAllowedCookie(_0x13804d){const _0x41a284=_0x24d8b6;if(alwaysAllowedExact[_0x41a284(0x314)](_0x13804d))return!![];for(const _0x27685a of alwaysAllowedPrefixes){if(_0x13804d['startsWith'](_0x27685a))return!![];}for(const _0x213d2a of alwaysAllowedIncludes){if(_0x13804d[_0x41a284(0x38a)](_0x213d2a))return!![];}for(const _0x2ce83b of alwaysAllowedPatterns){if(_0x2ce83b[_0x41a284(0x293)](_0x13804d))return!![];}return![];}function isCookieOk(_0x53f63b){const _0x2a96df=_0x24d8b6;typeof _0x53f63b===_0x2a96df(0x1df)&&(_0x53f63b=_0x53f63b[_0x2a96df(0x18d)]());const _0x408b2f=window['localStorage'][_0x2a96df(0x37d)](_0x2a96df(0x3f6)),_0x5d547a=_0x408b2f?JSON[_0x2a96df(0x3a8)](_0x408b2f):null;if(cookiesFound()&&_0x5d547a&&(_0x5d547a[_0x2a96df(0x3a4)]||_0x5d547a[_0x2a96df(0x2af)])&&matchesConditionalCookie(_0x53f63b))return!![];const _0x4ab987=location[_0x2a96df(0x2b4)][_0x2a96df(0x38f)](location[_0x2a96df(0x2b7)],'')[_0x2a96df(0x303)]('//'+location[_0x2a96df(0x273)]+_0x2a96df(0x304)),_0x262407=window[_0x2a96df(0x2cb)]!==window['top'];if(_0x4ab987||_0x262407)return!![];if(matchesAlwaysAllowedCookie(_0x53f63b))return!![];if(cookiesFound()){const _0x59fc34=window[_0x2a96df(0x267)]['scan']['raw_cookies'];let _0x1cb1d9=_0x59fc34[_0x2a96df(0x30e)](_0x1f78de=>!_0x1f78de[_0x2a96df(0x3c2)]&&_0x1f78de[_0x2a96df(0x1a1)]===_0x53f63b);!_0x1cb1d9&&(_0x1cb1d9=_0x59fc34[_0x2a96df(0x30e)](_0x2daab7=>_0x2daab7[_0x2a96df(0x3c2)]&&_0x53f63b[_0x2a96df(0x303)](_0x2daab7[_0x2a96df(0x1a1)])));!_0x1cb1d9&&(_0x1cb1d9=_0x59fc34['find'](_0x41c310=>!_0x41c310[_0x2a96df(0x3c2)]&&(_0x41c310[_0x2a96df(0x1a1)]['includes'](_0x53f63b)||_0x53f63b[_0x2a96df(0x38a)](_0x41c310['name']))));const _0x55ee81=_0x1cb1d9?_0x1cb1d9[_0x2a96df(0x185)]:_0x2a96df(0x1b3);if(_0x5d547a){if(_0x55ee81===_0x2a96df(0x27e)||_0x55ee81===_0x2a96df(0x3f0))return!![];if(_0x55ee81===_0x2a96df(0x398)||_0x55ee81===_0x2a96df(0x1b0))return _0x5d547a[_0x2a96df(0x2af)];if(_0x55ee81===_0x2a96df(0x39e)||_0x55ee81==='Performance')return _0x5d547a[_0x2a96df(0x3a4)];return _0x5d547a[_0x2a96df(0x407)];}}else console[_0x2a96df(0x32e)](_0x2a96df(0x336));return _0x53f63b[_0x2a96df(0x38a)](_0x2a96df(0x2c7));}const alwaysAllowedSrcPrefixes=['./',_0x24d8b6(0x3fc),'/',_0x24d8b6(0x24f),_0x24d8b6(0x385),_0x24d8b6(0x3ed)],alwaysAllowedSrcIncludes=['owl.carousel.min.js',_0x24d8b6(0x2c6),_0x24d8b6(0x1a5),'res/',_0x24d8b6(0x242),_0x24d8b6(0x305),_0x24d8b6(0x2a3),_0x24d8b6(0x266),_0x24d8b6(0x3f3),_0x24d8b6(0x2a5),_0x24d8b6(0x1f0),_0x24d8b6(0x2a5),_0x24d8b6(0x238),_0x24d8b6(0x33a),_0x24d8b6(0x1b4),_0x24d8b6(0x1b2),_0x24d8b6(0x224),_0x24d8b6(0x270),_0x24d8b6(0x2c4),_0x24d8b6(0x366),_0x24d8b6(0x28a),_0x24d8b6(0x39a),'shareaholic.com',_0x24d8b6(0x313),_0x24d8b6(0x2a8),_0x24d8b6(0x1ab),_0x24d8b6(0x344),_0x24d8b6(0x413),'oceanwp',_0x24d8b6(0x3fd),'//widgets.regiondo.net/',_0x24d8b6(0x29d),_0x24d8b6(0x38b),_0x24d8b6(0x183),_0x24d8b6(0x3e6),'://static.parastorage.com/unpkg/',_0x24d8b6(0x1bc),_0x24d8b6(0x345),_0x24d8b6(0x292),_0x24d8b6(0x3f2),_0x24d8b6(0x1c7),_0x24d8b6(0x2cf),'.activehosted.com/f/embed.php?',_0x24d8b6(0x2d0),_0x24d8b6(0x390),'://static.hotjar.com/',_0x24d8b6(0x25b),_0x24d8b6(0x34d),_0x24d8b6(0x328),'://cdn.shopify.com/','://coupon-x.premio.io/assets/js/',_0x24d8b6(0x389),_0x24d8b6(0x24e),'://cdn.boostcommerce.i
19385o/theme/',_0x24d8b6(0x233),'://platform.smooos.com/static/frontend-apps-dist/embedded-form/public.js',_0x24d8b6(0x2e0),_0x24d8b6(0x295),_0x24d8b6(0x31c),_0x24d8b6(0x2b0),_0x24d8b6(0x3e7),'//static.addtoany.com/',_0x24d8b6(0x243),'//wurfl.io/wurfl.js',_0x24d8b6(0x2c5),_0x24d8b6(0x240),_0x24d8b6(0x199),_0x24d8b6(0x29e),_0x24d8b6(0x1f3),_0x24d8b6(0x419),_0x24d8b6(0x297),'://core-renderer-tiles.maps.yandex.net/','://yastatic.net/s3/front-maps-static/',_0x24d8b6(0x3e5),'://elfsightcdn.com/',_0x24d8b6(0x189),'://cdn.buttonizer.io/',_0x24d8b6(0x24d),'://conversations-widget.sendinblue.com/',_0x24d8b6(0x2b3),_0x24d8b6(0x411),_0x24d8b6(0x2e2),_0x24d8b6(0x2ff),_0x24d8b6(0x2f1),_0x24d8b6(0x194),'://securepubads.g.doubleclick.net/',_0x24d8b6(0x2b1),'://cdn.acsbapp.com/',_0x24d8b6(0x400),_0x24d8b6(0x33d),_0x24d8b6(0x1fb),_0x24d8b6(0x2d5),_0x24d8b6(0x332),_0x24d8b6(0x3b3),_0x24d8b6(0x2fb),_0x24d8b6(0x271),_0x24d8b6(0x276),_0x24d8b6(0x22a),'://cdn.transifex.com/',_0x24d8b6(0x3b9),'//js-eu1.hsforms.net/',_0x24d8b6(0x2ef),_0x24d8b6(0x258),_0x24d8b6(0x19f),'//assets.calendly.com/assets/','.krossbooking.com/widget/',_0x24d8b6(0x391),_0x24d8b6(0x19a),'s.ksrndkehqnwntyxlhgto.com',_0x24d8b6(0x1ae),_0x24d8b6(0x424),_0x24d8b6(0x3b2),_0x24d8b6(0x2d4),_0x24d8b6(0x1ca),_0x24d8b6(0x2c8),_0x24d8b6(0x360),_0x24d8b6(0x373),'://script.crazyegg.com/',_0x24d8b6(0x38d),_0x24d8b6(0x37c),'.ubembed.com/',_0x24d8b6(0x277),_0x24d8b6(0x405),_0x24d8b6(0x26d),_0x24d8b6(0x22b),_0x24d8b6(0x3e9),_0x24d8b6(0x223),_0x24d8b6(0x2c3),'://ct.pinterest.com/',_0x24d8b6(0x204),'://cdn.ar.service-hub.cloud/','.clarity.ms/',_0x24d8b6(0x377),'://checkout.pci.shopifyinc.com/','.genetrix.it/',_0x24d8b6(0x2d7),_0x24d8b6(0x29c),_0x24d8b6(0x34b),_0x24d8b6(0x2da),_0x24d8b6(0x387),_0x24d8b6(0x2a5),'www-widgetapi','player_api','api_player',_0x24d8b6(0x195),'presto-embed.js',_0x24d8b6(0x272),_0x24d8b6(0x1c8),_0x24d8b6(0x172),_0x24d8b6(0x330),'://cdn.commoninja.com/','://cdn.partoo.co/',_0x24d8b6(0x305),_0x24d8b6(0x2a3),'//googletagmanager.com',_0x24d8b6(0x3f3),_0x24d8b6(0x1f0),_0x24d8b6(0x334),_0x24d8b6(0x3e1),_0x24d8b6(0x245),'//cdn.bogos.io/','://onlinebooking.mooovex.com/',_0x24d8b6(0x2fd),_0x24d8b6(0x193)];function matchesAlwaysAllowedSrc(_0x2cc3f6){const _0x3c6208=_0x24d8b6;if(!_0x2cc3f6||_0x2cc3f6==='')return!![];const _0x3ebd4d=_0x2cc3f6[_0x3c6208(0x2d3)]();for(const _0x117b01 of alwaysAllowedSrcPrefixes){if(_0x3ebd4d[_0x3c6208(0x303)](_0x117b01))return!![];}for(const _0x558b1b of alwaysAllowedSrcIncludes){if(_0x3ebd4d[_0x3c6208(0x38a)](_0x558b1b))return!![];}return _0x3ebd4d[_0x3c6208(0x38a)](location[_0x3c6208(0x273)]);}function addYouTubeAutoplayParams(_0x10eb43){const _0x422894=_0x24d8b6;if(!_0x10eb43||typeof _0x10eb43!==_0x422894(0x1df))return _0x10eb43;if(!_0x10eb43[_0x422894(0x38a)](_0x422894(0x387))&&!_0x10eb43[_0x422894(0x38a)]('youtube-nocookie.com'))return _0x10eb43;if(_0x10eb43['includes'](_0x422894(0x2a5))||_0x10eb43['includes'](_0x422894(0x238))||_0x10eb43[_0x422894(0x38a)](_0x422894(0x33a))||_0x10eb43['includes'](_0x422894(0x1b4)))return _0x10eb43;const _0x282400=_0x10eb43['includes']('autoplay='),_0x58ec0a=_0x10eb43[_0x422894(0x38a)]('mute=');if(_0x282400&&_0x58ec0a)return _0x10eb43;let _0x417988=_0x10eb43;const _0x2d03ab=_0x10eb43[_0x422894(0x38a)]('?'),_0x15b944=_0x2d03ab?'&':'?';if(!_0x282400&&!_0x58ec0a)_0x417988=_0x10eb43+_0x15b944+_0x422894(0x1ec);else{if(!_0x282400)_0x417988=_0x10eb43+_0x15b944+_0x422894(0x378);
19385else!_0x58ec0a&&(_0x417988=_0x10eb43+_0x15b944+'mute=1');}return _0x417988;}function isSrcOk(_0x1ae8b6){const _0x5c5f68=_0x24d8b6,_0x586d6c=_0x1ae8b6?_0x1ae8b6[_0x5c5f68(0x2d3)]():'';if(acconsentoIsExemptContext())return!![];if(matchesAlwaysAllowedSrc(_0x1ae8b6))return!![];if(cookiesFound()){const _0x32fdbb=window[_0x5c5f68(0x267)][_0x5c5f68(0x357)][_0x5c5f68(0x264)][_0x5c5f68(0x30e)](_0x5366de=>_0x5366de?.['src']?.[_0x5c5f68(0x38a)](_0x586d6c));return _0x32fdbb?isCookieOk(_0x32fdbb[_0x5c5f68(0x1a1)]['toString']()):!![];}return _0x586d6c[_0x5c5f68(0x38a)]('youtube-nocookie');}window[_0x24d8b6(0x39b)]=isSrcOk,window[_0x24d8b6(0x392)]=function(){const _0x1dfab8=_0x24d8b6;Array[_0x1dfab8(0x18e)](document[_0x1dfab8(0x3ff)](_0x1dfab8(0x2a6)))[_0x1dfab8(0x337)](_0x1424e8=>{const _0x55337e=_0x1dfab8,_0x33a1be=_0x1424e8['getAttribute']('src');if(_0x33a1be==null||String(_0x33a1be)[_0x55337e(0x18d)]()==='')return;const _0x30f805=new URL(_0x33a1be,document[_0x55337e(0x374)])['href'];isSrcOk(_0x30f805)?console['log'](_0x55337e(0x3b0)):console[_0x55337e(0x32e)](_0x55337e(0x397),_0x30f805);});};if(!window[_0x24d8b6(0x209)])try{const fetchDescriptor=Object['getOwnPropertyDescriptor'](window,_0x24d8b6(0x425));fetchDescriptor&&fetchDescriptor['configurable']?(window[_0x24d8b6(0x209)]=window['fetch'],window[_0x24d8b6(0x425)]=function(..._0x54e00e){const _0x2a0f7b=_0x24d8b6;let _0x3509c5=_0x54e00e[0x0],_0x36fa57=_0x3509c5?_0x3509c5[_0x2a0f7b(0x2d3)]():'';if(_0x36fa57[_0x2a0f7b(0x38a)](_0x2a0f7b(0x3cd))||_0x36fa57[_0x2a0f7b(0x38a)]('googletagmanager.com')||_0x36fa57[_0x2a0f7b(0x38a)](_0x2a0f7b(0x401))||_0x36fa57[_0x2a0f7b(0x38a)](_0x2a0f7b(0x20b)))return window['acconsentoOriginalFetch'][_0x2a0f7b(0x18b)](this,_0x54e00e);_0x36fa57['includes']('youtube-nocookie.com')&&(_0x36fa57[_0x2a0f7b(0x38a)](_0x2a0f7b(0x1f9))||_0x36fa57['includes']('/api/stats/'))&&(_0x36fa57=_0x36fa57['replace'](_0x2a0f7b(0x1d6),'youtube.com'),_0x54e00e[0x0]=_0x36fa57);if(_0x36fa57['includes'](_0x2a0f7b(0x387))||_0x36fa57[_0x2a0f7b(0x38a)](_0x2a0f7b(0x1d6)))return window['acconsentoOriginalFetch'][_0x2a0f7b(0x18b)](this,_0x54e00e);if(isMarketingTransportBlocked(_0x36fa57,_0x54e00e[0x1]&&_0x54e00e[0x1]['body']))return console[_0x2a0f7b(0x343)]('Acconsento:\x20richiesta\x20marketing\x20bloccata,\x20consenso\x20assente:',_0x36fa57),Promise[_0x2a0f7b(0x404)](acconsentoBlockedResponse());return window[_0x2a0f7b(0x209)]['apply'](this,_0x54e00e);}):(window['acconsentoOriginalFetch']=window[_0x24d8b6(0x425)],console['warn']('Acconsento:\x20window.fetch\x20is\x20read-only,\x20skipping\x20fetch\x20interception'));}catch(_0x345ab9){window['acconsentoOriginalFetch']=window[_0x24d8b6(0x425)],console[_0x24d8b6(0x16e)](_0x24d8b6(0x18c),_0x345ab9['message']);}if(!window[_0x24d8b6(0x3cb)])try{const openDescriptor=Object[_0x24d8b6(0x379)](XMLHttpRequest[_0x24d8b6(0x1fa)],'open'),sendDescriptor=Object['getOwnPropertyDescriptor'](XMLHttpRequest[_0x24d8b6(0x1fa)],_0x24d8b6(0x2f9));openDescriptor&&openDescriptor[_0x24d8b6(0x335)]&&sendDescriptor&&sendDescriptor['configurable']?(window['acconsentoOriginalXHROpen']=XMLHttpRequest[_0x24d8b6(0x1fa)][_0x24d8b6(0x1f7)],window[_0x24d8b6(0x359)]=XMLHttpRequest[_0x24d8b6(0x1fa)][_0x24d8b6(0x2f9)],XMLHttpRequest[_0x24d8b6(0x1fa)]['open']=function(_0x20c9b4,_0x3c25ba,..._0x436795){const _0x116fd1=_0x24d8b6;let _0x7565f1=_0x3c25ba?_0x3c25ba[_0x116fd1(0x2d3)]():'';return(_0x7565f1[_0x116fd1(0x38a)](_0x116fd1(0x3cd))||_0x7565f1[_0x116fd1(0x38a)](_0x116fd1(0x186))||_0x7565f1[_0x116fd1(0x38a)](_0x116fd1(0x401))||_0x7565f1['includes'](_0x116fd1(0x20b)))&&(this[_0x116fd1(0x1f4)]=_0x7565f1),_0x7565f1[_0x116fd1(0x38a)](_0x116fd1(0x1d6))&&(_0x7565f1[_0x116fd1(0x38a)]('/youtubei/')||_0x7565f1[_0x116fd1(0x38a)](_0x116fd1(0x3fb)))&&(_0x7565f1=_0x7565f1[_0x116fd1(0x38f)]('youtube-nocookie.com',_0x116fd1(0x387)),_0x3c25ba=_0x7565f1),this['_acconsentoRequestUrl']=_0x7565f1,window['acconsentoOriginalXHROpen'][_0x116fd1(0x18b)](this,[_0x20c9b4,_0x3c25ba,..._0x436795]);},XMLHttpRequest['prototype']['send']=function(..._0x4c7266){const _0xde5c9d=_0x24d8b6;if(isMarketingTransportBlocked(this['_acconsentoRequestUrl'],_0x4c7266[0x0])){console[_0xde5c9d(0x343)](_0xde5c9d(0x20a),this[_0xde5c9d(0x410)]);const _0x6542d3=this;setTimeout(()=>{const _0x2f4376=_0xde5c9d;try{Object[_0x2f4376(0x3d1)](_0x6542d3,_0x2f4376(0x310),{'value':0x4,'configurable':!![]}),Object[_0x2f4376(0x3d1)](_0x6542d3,_0x2f4376(0x3d4),{'value':0xcc,'configurable':!![]}),Object[_0x2f4376(0x3d1)](_0x6542d3,_0x2f4376(0x173),{'value':'','configurable':!![]}),typeof _0x6542d3[_0x2f4376(0x24c)]===_0x2f4376(0x365)&&_0x6542d3[_0x2f4376(0x24c)](),_0x6542d3[_0x2f4376(0x3ee)](new CustomEvent(_0x2f4376(0x406))),_0x6542d3[_0x2f4376(0x3ee)](new CustomEvent(_0x2f4376(0x2d1))),_0x6542d3['dispatchEvent'](new CustomEvent(_0x2f4376(0x29b)));}catch(_0x1b90a0){}},0x0);return;}return window[_0xde5c9d(0x359)][_0xde5c9d(0x18b)](this,_0x4c7266);}
19385):(window['acconsentoOriginalXHROpen']=XMLHttpRequest[_0x24d8b6(0x1fa)][_0x24d8b6(0x1f7)],window['acconsentoOriginalXHRSend']=XMLHttpRequest[_0x24d8b6(0x1fa)][_0x24d8b6(0x2f9)],console[_0x24d8b6(0x16e)](_0x24d8b6(0x417)));}catch(_0x5228f3){window['acconsentoOriginalXHROpen']=XMLHttpRequest['prototype'][_0x24d8b6(0x1f7)],window[_0x24d8b6(0x359)]=XMLHttpRequest[_0x24d8b6(0x1fa)]['send'],console['warn'](_0x24d8b6(0x2e5),_0x5228f3[_0x24d8b6(0x3a0)]);}if(navigator['sendBeacon']&&!window[_0x24d8b6(0x27c)])try{window['_acconsentoOriginalSendBeacon']=navigator[_0x24d8b6(0x354)],navigator[_0x24d8b6(0x354)]=function(_0x324113,_0xcd0be4){const _0x7e74b=_0x24d8b6,_0x191aac=_0x324113?_0x324113[_0x7e74b(0x2d3)]():'';if(_0x191aac[_0x7e74b(0x38a)](_0x7e74b(0x3cd))||_0x191aac[_0x7e74b(0x38a)](_0x7e74b(0x186))||_0x191aac[_0x7e74b(0x38a)](_0x7e74b(0x401))||_0x191aac[_0x7e74b(0x38a)](_0x7e74b(0x20b)))return window[_0x7e74b(0x27c)][_0x7e74b(0x388)](navigator,_0x324113,_0xcd0be4);if(isMarketingTransportBlocked(_0x191aac,_0xcd0be4))return console['info'](_0x7e74b(0x35a),_0x191aac),!![];return window[_0x7e74b(0x27c)][_0x7e74b(0x388)](navigator,_0x324113,_0xcd0be4);};}catch(_0x3e9d72){console['warn'](_0x24d8b6(0x24a),_0x3e9d72['message']);}if(!window[_0x24d8b6(0x251)])try{const originalImage=window[_0x24d8b6(0x40f)];window[_0x24d8b6(0x40f)]=function(..._0x2582f8){const _0x19abd1=_0x24d8b6,_0x6bac9=new originalImage(..._0x2582f8),_0x172dee=Object[_0x19abd1(0x379)](HTMLImageElement[_0x19abd1(0x1fa)],_0x19abd1(0x268));return _0x172dee&&_0x172dee[_0x19abd1(0x3ab)]&&Object['defineProperty'](_0x6bac9,_
193850x19abd1(0x268),{'set':function(_0x3a12a0){const _0x44cf72=_0x19abd1,_0x322940=_0x3a12a0?_0x3a12a0[_0x44cf72(0x2d3)]():'';if(_0x322940[_0x44cf72(0x38a)](_0x44cf72(0x3cd))||_0x322940[_0x44cf72(0x38a)]('googletagmanager.com')||_0x322940[_0x44cf72(0x38a)]('/collect')||_0x322940[_0x44cf72(0x38a)](_0x44cf72(0x20b))){_0x172dee[_0x44cf72(0x3ab)][_0x44cf72(0x388)](this,_0x3a12a0);return;}if(isMarketingTransportBlocked(_0x322940,null)){console[_0x44cf72(0x343)](_0x44cf72(0x1b9),_0x322940);return;}_0x172dee[_0x44cf72(0x3ab)][_0x44cf72(0x388)](this,_0x3a12a0);},'get':function(){const _0x42ab4e=_0x19abd1;return this[_0x42ab4e(0x283)](_0x42ab4e(0x268));},'configurable':!![]}),_0x6bac9;},window[_0x24d8b6(0x251)]=!![];}catch(_0xb1c117){console[_0x24d8b6(0x16e)](_0x24d8b6(0x197),_0xb1c117[_0x24d8b6(0x3a0)]);}function acconsentoSafeDefineProperty(_0x3578e8,_0x3ddc5b,_0x6c3329){const _0x55199d=_0x24d8b6;try{const _0xd49c7c=Object['getOwnPropertyDescriptor'](_0x3578e8,_0x3ddc5b);if(_0xd49c7c!==undefined&&_0xd49c7c[_0x55199d(0x335)]===![])return![];return Object[_0x55199d(0x3d1)](_0x3578e8,_0x3ddc5b,_0x6c3329),!![];}catch(_0x3a4d2f){return console[_0x55199d(0x16e)](_0x55199d(0x27a)+String(_0x3ddc5b)+_0x55199d(0x39c)+(_0x3578e8[_0x55199d(0x247)]?_0x3578e8[_0x55199d(0x247)][_0x55199d(0x3b6)]():'?')+'>',_0x3a4d2f['message']),![];}}function acconsentoSafeDefineProperties(_0x283b41,_0x2caca3){const _0x16cb4f=_0x24d8b6;try{for(const _0x4ced08 of Object[_0x16cb4f(0x34c)](_0x2caca3)){const _0x538270=Object[_0x16cb4f(0x379)](_0x283b41,_0x4ced08);if(_0x538270!==undefined&&_0x538270['configurable']===![])return![];}return Object[_0x16cb4f(0x321)](_0x283b41,_0x2caca3),!![];}catch(_0x194db8){return console[_0x16cb4f(0x16e)](_0x16cb4f(0x380)+(_0x283b41['tagName']?_0x283b41[_0x16cb4f(0x247)][_0x16cb4f(0x3b6)]():'?')+'>',_0x194db8['message']),![];}}function acconsentoIsExemptContext(){const _0x37131e=_0x24d8b6,_0x179b37=location[_0x37131e(0x2b4)][_0x37131e(0x38f)](location[_0x37131e(0x2b7)],'')['startsWith']('//'+location[_0x37131e(0x273)]+'/wp-admin/'),_0x581bb0=window[_0x37131e(0x2cb)]!==window['top'],_0x3af393=location[_0x37131e(0x2b4)][_0x37131e(0x38a)]('/?et_fb=')||location[_0x37131e(0x2b4)][_0x37131e(0x38a)](_0x37131e(0x249));return _0x179b37||_0x581bb0||_0x3af393;}let acconsentoEmbedsFailOpen=![];function acconsentoEmbedsGranted(){return acconsentoEmbedsFailOpen||marketingGranted()||acconsentoIsExemptContext();}function acconsentoFailOpenEmbeds(){acconsentoEmbedsFailOpen=!![],acconsentoSyncEmbeds(document,!![]),acconsentoWatchStaleMasks(document);}function acconsentoReadEmbedMask(){const _0x26da7b=_0x24d8b6;try{const _0x3a784e=JSON[_0x26da7b(0x3a8)](window['sessionStorage'][_0x26da7b(0x37d)](_0x26da7b(0x215)));return _0x3a784e&&_0x3a784e[_0x26da7b(0x3a9)]||null;}catch(_0x19c1f0){return null;}}let acconsentoEmbedMask=acconsentoReadEmbedMask();const acconsentoWiredEmbeds=new WeakSet();
19385function acconsentoMaskFor(_0xabfe3b,_0x17300a){const _0xb58c61=_0x24d8b6;acconsentoWireEmbedMask(_0xabfe3b);const _0x235e8e=document[_0xb58c61(0x1ea)][_0xb58c61(0x298)],_0x48a44b=acconsentoMaskPolicyUrl(acconsentoMaskLang(acconsentoEmbedMask&&acconsentoEmbedMask['lang'],_0x235e8e));return acconsentoEmbedMaskHtml(_0x17300a,acconsentoEmbedMask,_0x235e8e,_0x48a44b);}function acconsentoMaskPolicyUrl(_0x3d4522){const _0x3edb81=_0x24d8b6;try{const _0x58b927=JSON[_0x3edb81(0x3a8)](window[_0x3edb81(0x21c)]['getItem'](_0x3edb81(0x322)));if(_0x58b927&&/^https?:\/\//i[_0x3edb81(0x293)](_0x58b927[_0x3edb81(0x30a)]||''))return _0x58b927['cookiePolicyLink'];const _0x37c2cf=window[_0x3edb81(0x21c)]['getItem'](_0x3edb81(0x36f))||'',_0xed1bc4=_0x37c2cf[_0x3edb81(0x3ca)]('/');return _0xed1bc4>0x0?_0x37c2cf[_0x3edb81(0x33c)](0x0,_0xed1bc4)+'/'+_0x3d4522+_0x37c2cf[_0x3edb81(0x33c)](_0xed1bc4):null;}catch(_0x59fd1a){return null;}}function acconsentoWireEmbedMask(_0x2c92b1){const _0x4b47c0=_0x24d8b6;if(acconsentoWiredEmbeds[_0x4b47c0(0x314)](_0x2c92b1))return;acconsentoWiredEmbeds[_0x4b47c0(0x2eb)](_0x2c92b1),_0x2c92b1[_0x4b47c0(0x28e)](_0x4b47c0(0x2d1),()=>{const _0x22bd88=_0x4b47c0;if(!_0x2c92b1[_0x22bd88(0x16f)](ACCONSENTO_BLOCKED_ATTR))return;let _0x2170cd=null;try{_0x2170cd=_0x2c92b1[_0x22bd88(0x35f)];}catch(_0xc07f11){return;}if(!_0x2170cd)return;_0x2170cd['addEventListener'](_0x22bd88(0x32d),_0x5ec576=>{const _0x319000=_0x22bd88,_0x3b20cd=_0x5ec576[_0x319000(0x340)]&&_0x5ec576[_0x319000(0x340)]['closest']?_0x5ec576[_0x319000(0x340)][_0x319000(0x1d2)]('[data-acconsento-action]'):null;if(!_0x3b20cd)return;_0x3b20cd[_0x319000(0x283)](_0x319000(0x399))===_0x319000(0x41f)?(_0x2170cd[_0x319000(0x3ff)](_0x319000(0x16c))['forEach'](_0x1e3b6d=>{const _0x2dabda=_0x319000;_0x1e3b6d[_0x2dabda(0x28b)]=!![];}),acconsentoAcceptMarketingFromEmbed()):acconsentoOpenPreferencesFromEmbedMask();});});}function acconsentoOpenPreferencesFromEmbedMask(){const _0x279c91=_0x24d8b6;let _0x4b95af=![];try{const _0x1e04c2=JSON[_0x279c91(0x3a8)](window['sessionStorage'][_0x279c91(0x37d)]('acconsento-customization'));_0x4b95af=Boolean(_0x1e04c2&&typeof _0x1e04c2['js']===_0x279c91(0x1df)&&_0x1e04c2['js'][_0x279c91(0x38a)](_0x279c91(0x3c8)));}catch(_0x2e5764){}_0x4b95af?window['dispatchEvent'](new CustomEvent(_0x279c91(0x426))):window[_0x279c91(0x3ee)](new CustomEvent(_0x279c91(0x331)));}async function acconsentoAcceptMarketingFromEmbed(){const _0xcdf5c9=_0x24d8b6;let _0x2e3397={};try{_0x2e3397=JSON[_0xcdf5c9(0x3a8)](window[_0xcdf5c9(0x1bb)]['getItem']('acconsento-preferences'))||{};}catch(_0x1a443d){_0x2e3397={};}_0x2e3397[_0xcdf5c9(0x2af)]=!![],window['localStorage'][_0xcdf5c9(0x2e1)](_0xcdf5c9(0x3f6),JSON[_0xcdf5c9(0x23e)](_0x2e3397));try{await Promise['race']([window[_0xcdf5c9(0x1bd)][_0xcdf5c9(0x3cc)](_0xcdf5c9(0x190),{'preferences':_0x2e3397,'viewer_id':window[_0xcdf5c9(0x1bb)]['getItem'](_0xcdf5c9(0x3a3))}),new Promise(_0x4efdbd=>setTimeout(_0x4efdbd,0xbb8))]);}catch(_0x49f715){console[_0xcdf5c9(0x16e)]('Acconsento:\x20consenso\x20dalla\x20maschera\x20non\x20registrato:',_0x49f715&&_0x49f715['message']);}document[_0xcdf5c9(0x175)][_0xcdf5c9(0x3ab)]['call'](document,_0xcdf5c9(0x3f5)),window[_0xcdf5c9(0x255)]['reload']();}const acconsentoStaleMaskWatched=new WeakSet();function acconsentoReloadStaleMask(_0x4eeaab){const _0x481cf4=_0x24d8b6,_0x1badab=_0x4eeaab['getAttribute']('src')||'';if(_0x4eeaab[_0x481cf4(0x16f)](_0x481cf4(0x30c))||!isBlockableEmbed(_0x1badab))return;let _0x8aa014=null;try{_0x8aa014=_0x4eeaab[_0x481cf4(0x34a)]&&_0x4eeaab[_0x481cf4(0x34a)][_0x481cf4(0x255)][_0x481cf4(0x2b4)];}catch(_0x24f25b){return;}_0x8aa014==='about:srcdoc'&&_0x4eeaab['setAttribute']('src',addYouTubeAutoplayParams(_0x1badab));}function acconsentoWatchStaleMasks(_0x1371d3){const _0x4868e3=_0x24d8b6;if(!_0x1371d3||_0x1371d3[_0x4868e3(0x2f2)]!==0x1&&_0x1371d3[_0x4868e3(0x2f2)]!==0x9)return;const _0x1631c4=_0x1371d3[_0x4868e3(0x247)]===_0x4868e3(0x2fc)?[_0x1371d3]:Array[_0x4868e3(0x18e)](_0x1371d3['getElementsByTagName'](_0x4868e3(0x220)));_0x1631c4[_0x4868e3(0x337)](_0x9b89da=>{const _0x5e685f=_0x4868e3;acconsentoReloadStaleMask(_0x9b89da),!acconsentoStaleMaskWatched['has'](_0x9b89da)&&(acconsentoStaleMaskWatched['add'](_0x9b89da),_0x9b89da['addEventListener'](_0x5e685f(0x2d1),()=>acconsentoReloadStaleMask(_0x9b89da)));});}const ACCONSENTO_EMBED_PATTERNS=[{'re':/^(https?:)?\/\/(www\.)?google\.[a-z.]+\/maps/i,'service':'Google\x20Maps'},{'re':/^(https?:)?\/\/maps\.google\.[a-z.]+\//i,'service':_0x24d8b6(0x279)},{'re':/^(https?:)?\/\/maps\.googleapis\.com\/maps\/embed/i,'service':_0x24d8b6(0x279)},{'re':/^(https?:)?\/\/((www|m)\.)?youtube(-nocookie)?\.com\/embed([/?#]|$)/i,'service':_0x24d8b6(0x363)},{'re':/^(https?:)?\/\/(player\.)?vimeo\.com\/(video|event|showcase)\//i,'service':_0x24d8b6(0x3de)},{'re':/^(https?:)?\/\/([a-z0-9-]+\.)*traghettilines\.it\//i,'service':_0x24d8b6(0x3b8)},{'re':/^(https?:)?\/\/([a-z0-9-]+\.)*traghettiper\.it\//i,'service':'Traghettiper'}],ACCONSENTO_MASK_SIGNATURE=_0x24d8b6(0x23b),ACCONSENTO_MASK_LANGS=['it','en','es','de','fr','nl','ru','pt','ro','jp','tr','zh','sl','ar'],ACCONSENTO_MASK_LOCK=_0x24d8b6(0x3d2),ACCONSENTO_MASK_BASE_CSS='html,body{margin:0;height:100%}
19385body{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:12px;box-sizing:border-box;font:14px/1.45\x20system-ui,-apple-system,\x22Segoe\x20UI\x22,Roboto,sans-serif;text-align:center}svg{width:28px;height:28px;flex:none}';function acconsentoEmbedService(_0x3fc6b3){const _0x34310f=_0x24d8b6;if(typeof _0x3fc6b3!==_0x34310f(0x1df))return null;const _0x1ee45c=_0x3fc6b3[_0x34310f(0x18d)](),_0x367cbd=ACCONSENTO_EMBED_PATTERNS['find'](_0x161574=>_0x161574['re'][_0x34310f(0x293)](_0x1ee45c));return _0x367cbd?_0x367cbd[_0x34310f(0x1af)]:null;}function isBlockableEmbed(_0x1093c5){return acconsentoEmbedService(_0x1093c5)!==null;}function acconsentoMaskLang(_0x390aed,_0x91676f){const _0x27896e=_0x24d8b6;if(_0x390aed&&_0x390aed!==_0x27896e(0x2e7)&&ACCONSENTO_MASK_LANGS[_0x27896e(0x38a)](_0x390aed))return _0x390aed;const _0x3295e6=String(_0x91676f||'')['substring'](0x0,0x2)['toLowerCase']();return ACCONSENTO_MASK_LANGS[_0x27896e(0x38a)](_0x3295e6)?_0x3295e6:'en';}function acconsentoEscapeHtml(_0xbb5034){const _0xa1a85e=_0x24d8b6;return String(_0xbb5034)[_0xa1a85e(0x38f)](/[&<>"']/g,_0x224d92=>({'&':_0xa1a85e(0x259),'<':_0xa1a85e(0x1cd),'>':_0xa1a85e(0x2d6),'\x22':_0xa1a85e(0x219),'\x27':_0xa1a85e(0x1ed)}[_0x224d92]));}function acconsentoEmbedMaskHtml(_0xc286e5,_0x5de4f8,_0x33fc28,_0x277dc8){const _0x535205=_0x24d8b6;if(!_0x5de4f8)return ACCONSENTO_MASK_SIGNATURE+_0x535205(0x347)+ACCONSENTO_MASK_BASE_CSS+_0x535205(0x364)+ACCONSENTO_MASK_LOCK;const _0x3dcaac=acconsentoEscapeHtml,_0x26ec71=_0x5de4f8[_0x535205(0x179)]||{},_0x3e9202=_0x26ec71[acconsentoMaskLang(_0x5de4f8[_0x535205(0x298)],_0x33fc28)]||_0x26ec71['en']||{},_0x3ff5d5=_0x5de4f8['colors']||{},_0x172432=/^https?:\/\//i[_0x535205(0x293)](_0x277dc8||'')?'<a\x20class=\x22p\x22\x20href=\x22'+_0x3dcaac(_0x277dc8)+'\x22\x20target=\x22_blank\x22\x20rel=\x22noopener\x22>'+_0x3dcaac(_0x3e9202['policy']||'')+_0x535205(0x2a1):'';return ACCONSENTO_MASK_SIGNATURE+_0x535205(0x347)+ACCONSENTO_MASK_BASE_CSS+_0x535205(0x16b)+_0x3dcaac(_0x3ff5d5['bg'])+_0x535205(0x1bf)+_0x3dcaac(_0x3ff5d5[_0x535205(0x21a)])+'}'+_0x535205(0x2a2)+_0x3dcaac(_0x3ff5d5[_0x535205(0x34f)])+'}'+_0x535205(0x333)+_0x535205(0x1f5)+_0x3dcaac(_0x3ff5d5[_0x535205(0x34f)])+';border-radius:6px;padding:8px\x2016px;cursor:pointer}'+'button:disabled{opacity:.6;cursor:default}'+_0x535205(0x320)+_0x3dcaac(_0x3ff5d5[_0x535205(0x34f)])+_0x535205(0x1bf)+_0x3dcaac(_0x3ff5d5[_0x535205(0x256)])+'}'+'.m{background:transparent;color:'+_0x3dcaac(_0x3ff5d5[_0x535205(0x34f)])+'}'+'.p{font-size:12px;color:inherit;opacity:.8}'+_0x535205(0x1a3)+_0x535205(0x300)+ACCONSENTO_MASK_LOCK+'<div>'+_0x3dcaac(_0x3e9202[_0x535205(0x21a)]||'')[_0x535205(0x38f)](_0x535205(0x318),'<b>'+_0x3dcaac(_0xc286e5)+_0x535205(0x3dc))+_0x535205(0x36d)+_0x535205(0x23d)+_0x3dcaac(_0x3e9202['accept']||'')+_0x535205(0x2ee)+'<button\x20type=\x22button\x22\x20class=\x22m\x22\x20data-acconsento-action=\x22manage\x22>'+_0x3dcaac(_0x3e9202[_0x535205(0x37b)]||'')+_0x535205(0x212)+_0x172432;}function acconsentoShouldBlockEmbed(_0x40c9ec,_0x1a4a91,_0x17ad64){const _0x39a17b=_0x24d8b6;if(_0x17ad64||!isBlockableEmbed(_0x1a4a91))return![];const _0x41a255=_0x40c9ec[_0x39a17b(0x283)](_0x39a17b(0x30c));if(_0x41a255&&!_0x40c9ec[_0x39a17b(0x16f)](ACCONSENTO_BLOCKED_ATTR)&&!_0x41a255[_0x39a17b(0x303)](ACCONSENTO_MASK_SIGNATURE))return![];return!(_0x40c9ec[_0x39a17b(0x1e9)][_0x39a17b(0x23c)](_0x39a17b(0x2bf))||_0x40c9ec[_0x39a17b(0x1d2)](_0x39a17b(0x2e6)));}function acconsentoBlockEmbed(_0x585305,_0xfcf883=acconsentoEmbedMaskHtml('',null)){const _0x3ce8e2=_0x24d8b6;!_0x585305[_0x3ce8e2(0x16f)](ACCONSENTO_BLOCKED_ATTR)&&_0x585305[_0x3ce8e2(0x2e8)](ACCONSENTO_BLOCKED_ATTR,_0x3ce8e2(0x2f0)),_0x585305[_0x3ce8e2(0x283)](_0x3ce8e2(0x30c))!==_0xfcf883&&_0x585305[_0x3ce8e2(0x2e8)]('srcdoc',_0xfcf883);}function acconsentoUnblockEmbed(_0x3bbb26){const _0x42e89d=_0x24d8b6;if(!_0x3bbb26[_0x42e89d(0x16f)](ACCONSENTO_BLOCKED_ATTR))return;_0x3bbb26['removeAttribute'](ACCONSENTO_BLOCKED_ATTR),_0x3bbb26[_0x42e89d(0x3bd)](_0x42e89d(0x30c));}function acconsentoSyncEmbed(_0x458230,_0x4be162,_0x3a5730){const _0x79fce4=_0x24d8b6,_0x5c0b15=_0x458230[_0x79fce4(0x283)](_0x79fce4(0x268))||'';if(acconsentoShouldBlockEmbed(_0x458230,_0x5c0b15,_0x4be162)){const _0x12028e=acconsentoEmbedService(_0x5c0b15);acconsentoBlockEmbed(_0x458230,_0x3a5730?_0x3a5730(_0x458230,_0x12028e):acconsentoEmbedMaskHtml(_0x12028e,null));}else acconsentoUnblockEmbed(_0x458230);}function acconsentoSyncEmbeds(_0x312b67,_0x12d6c7,_0x3368e2){const _0x18e2bb=_0x24d8b6;if(!_0x312b67||_0x312b67[_0x18e2bb(0x2f2)]!==0x1&&_0x312b67[_0x18e2bb(0x2f2)]!==0x9)return;if(_0x312b67[_0x18e2bb(0x247)]===_0x18e2bb(0x2fc)){acconsentoSyncEmbed(_0x312b67,_0x12d6c7,_0x3368e2);return;}Array[_0x18e2bb(0x18e)](_0x312b67['getElementsByTagName'](_0x18e2bb(0x220)))['forEach'](_0x535670=>acconsentoSyncEmbed(_0x535670,_0x12d6c7,_0x3368e2));}if(!window[_0x24d8b6(0x2f6)])try{const createElementDescriptor=Object[_0x24d8b6(0x379)](document,_0x24d8b6(0x3e0));createElementDescriptor&&createElementDescriptor[_0x24d8b6(0x335)]?(window[_0x24d8b6(0x2f6)]=document[_0x24d8b6(0x3e0)],document[_0x24d8b6(0x3e0)]=function(..._0x5bc428){const _0x50f817=_0x24d8b6,_0x3e1112=acconsentoCreateElement[_0x50f817(0x17f)](document)(..._0x5bc428),_0x497e3c=_0x3e1112[_0x50f817(0x2e8)]['bind'](_0
19385x3e1112);if(_0x5bc428[0x0]['toLowerCase']()==='script'){const _0x47dc16={'configurable':!![],'enumerable':!![],'get'(){const _0xb82aa9=_0x50f817;return _0x3e1112[_0xb82aa9(0x283)](_0xb82aa9(0x268));},'set'(_0x53b8b0){const _0x195718=_0x50f817;let _0x315d4f=_0x53b8b0?_0x53b8b0[_0x195718(0x2d3)]():'';if(typeof _0x315d4f===_0x195718(0x1df)&&_0x315d4f['includes'](_0x195718(0x387))&&!_0x315d4f[_0x195718(0x38a)](_0x195718(0x2da))){if(_0x315d4f['includes']('iframe_api')||_0x315d4f['includes'](_0x195718(0x238))||_0x315d4f[_0x195718(0x38a)](_0x195718(0x33a))||_0x315d4f[_0x195718(0x38a)](_0x195718(0x1b4))){}else cookiesFound()&&!JSON['parse'](window['localStorage'][_0x195718(0x37d)](_0x195718(0x3f6)))[_0x195718(0x2af)]&&(_0x315d4f=_0x315d4f[_0x195718(0x38f)](_0x195718(0x2bc),_0x195718(0x2da)));}!isSrcOk(_0x315d4f)&&(!typeValid(_0x3e1112[_0x195718(0x283)](_0x195718(0x36a)))&&acconsentoMarkScriptBlocked(_0x3e1112)),_0x497e3c('src',_0x315d4f);}};acconsentoSafeDefineProperty(_0x3e1112,_0x50f817(0x268),_0x47dc16);const _0x4cdab0=[_0x50f817(0x1dd),'speculationrules',_0x50f817(0x1ef)],_0x4a010c=!_0
19385x4cdab0[_0x50f817(0x38a)](_0x3e1112[_0x50f817(0x283)](_0x50f817(0x36a)));_0x4a010c&&acconsentoSafeDefineProperty(_0x3e1112,_0x50f817(0x36a),{'configurable':!![],'enumerable':!![],'set'(_0x4c33a3){const _0x451208=_0x50f817;isSrcOk(_0x3e1112[_0x451208(0x268)]?_0x3e1112[_0x451208(0x268)][_0x451208(0x2d3)]():'')&&_0x497e3c(_0x451208(0x36a),_0x4c33a3);}});}return _0x5bc428[0x0][_0x50f817(0x3b6)]()===_0x50f817(0x220)&&acconsentoSafeDefineProperties(_0x3e1112,{'src':{'configurable':!![],'enumerable':!![],'get'(){const _0x52be1e=_0x50f817;return _0x3e1112[_0x52be1e(0x283)]('src');},'set'(_0x255d59){const _0x1a2d61=_0x50f817;try{let _0x4f37b6=_0x255d59?.[_0x1a2d61(0x2d3)]?.()||'';if(typeof _0x4f37b6===_0x1a2d61(0x1df)&&_0x4f37b6[_0x1a2d61(0x38a)](_0x1a2d61(0x387))&&!_0x4f37b6[_0x1a2d61(0x38a)]('youtube-nocookie')){if(_0x4f37b6[_0x1a2d61(0x38a)]('iframe_api')||_0x4f37b6[_0x1a2d61(0x38a)](_0x1a2d61(0x238))||_0x4f37b6[_0x1a2d61(0x38a)]('player_api')||_0x4f37b6[_0x1a2d61(0x38a)](_0x1a2d61(0x1b4))){}else cookiesFound()&&!JSON['parse'](window[_0x1a2d61(0x1bb)]['getItem'](_0x1a2d61(0x3f6)))['marketing']&&(_0x4f37b6=_0x4f37b6[_0x1a2d61(0x38f)](_0x1a2d61(0x2bc),_0x1a2d61(0x2da)));}_0x3e1112[_0x1a2d61(0x1e9)][_0x1a2d61(0x23c)](_0x1a2d61(0x2bf))&&(_0x4f37b6=_0x4f37b6['replace']('youtube-nocookie',_0x1a2d61(0x2bc))),_0x4f37b6=addYouTubeAutoplayParams(_0x4f37b6),!isSrcOk(_0x4f37b6)&&_0x497e3c(_0x1a2d61(0x36a),_0x1a2d61(0x221)),_0x497e3c('src',_0x4f37b6);}catch(_0x57172c){console[_0x1a2d61(0x375)]('Errore\x20durante\x20il\x20set\x20di\x20scriptElt.src:',{'value':_0x255d59,'typeof':typeof _0x255d59,'error':_0x57172c,'stack':_0x57172c[_0x1a2d61(0x2db)]});}}}}),_0x3e1112;}):(window[_0x24d8b6(0x2f6)]=document[_0x24d8b6(0x3e0)],console[_0x24d8b6(0x16e)](_0x24d8b6(0x1d9)));}catch(_0x2ca659){window['acconsentoCreateElement']=document[_0x24d8b6(0x3e0)],console[_0x24d8b6(0x16e)](_0x24d8b6(0x1d5),_0x2ca659[_0x24d8b6(0x3a0)]);}function blockScripts(){const _0x51907d=_0x24d8b6;Array[_0x51907d(0x18e)](document[_0x51907d(0x278)](_0x51907d(0x1b6)))[_0x51907d(0x337)](_0xf7f1e8=>{const _0x3132d3=_0x51907d;let _0x535050;_0xf7f1e8?.[_0x3132d3(0x268)]?_0x535050=_0xf7f1e8[_0x3132d3(0x268)]['toString']():_0x535050='',_0x535050[_0x3132d3(0x38a)](_0x3132d3(0x387))&&!isSrcOk(_0x535050)&&!_0x535050[_0x3132d3(0x38a)](_0x3132d3(0x2a5))&&cookiesFound()&&!JSON[_0x3132d3(0x3a8)](window[_0x3132d3(0x1bb)][_0x3132d3(0x37d)](_0x3132d3(0x3f6)))[_0x3132d3(0x2af)]&&(_0xf7f1e8['src']=_0xf7f1e8['src'][_0x3132d3(0x38f)](_0x3132d3(0x2bc),_0x3132d3(0x2da))),acconsentoApplyScriptConsent(_0xf7f1e8,_0x535050);}),Array[_0x51907d(0x18e)](document[_0x51907d(0x278)](_0x51907d(0x220)))[_0x51907d(0x337)](_0x50de18=>{const _0x555d22=_0x51907d;let _0x248cb8;_0x50de18?.['src']?_0x248cb8=_0x50de18[_0x555d22(0x268)][_0x555d22(0x2d3)]():_0x248cb8='';if(_0x50de18[_0x555d22(0x1e9)][_0x555d22(0x23c)]('elementor-background-video-embed')){const _0x3766da=_0x50de18[_0x555d22(0x268)]['replace'](_0x555d22(0x2da),_0x555d22(0x2bc));_0x3766da!==_0x50de18[_0x555d22(0x268)]&&(_0x50de18['src']=_0x3766da);}if(_0x248cb8[_0x555d22(0x38a)]('youtube.com')||_0x248cb8['includes'](_0x555d22(0x1d6))){const _0xff48a8=addYouTubeAutoplayParams(_0x50de18[_0x555d22(0x268)]);_0xff48a8!==_0x50de18[_0x555d22(0x268)]&&(_0x50de18[_0x555d22(0x268)]=_0xff48a8);}});}function getRetentionPeriod(_0x53682c){const _0x25b6ee=_0x24d8b6;if(!cookiesFound())return 0x0;const _0x101a53=window['scanResult'][_0x25b6ee(0x357)]['raw_cookies'],_0x452a95=_0x101a53[_0x25b6ee(0x30e)](_0x2ad2a2=>!_0x2ad2a2[_0x25b6ee(0x3c2)]&&_0x2ad2a2[_0x25b6ee(0x1a1)]===_0x53682c);if(_0x452a95)return _0x452a95['retention_period']??0x0;const _0x16b629=_0x101a53['find'](_0x581a71=>_0x581a71[_0x25b6ee(0x3c2)]&&_0x53682c['startsWith'](_0x581a71['name'][_0x25b6ee(0x38f)](/[*_]+$/,'')));return _0x16b629?_0x16b629['retention_period']??0x0:0x0;}document[_0x24d8b6(0x1b5)]=()=>{const _0x5d5274=_0x24d8b6,_0x110c55=acconsentoEmbedsGranted();!_0x110c55&&acconsentoSyncEmbeds(document,![],acconsentoMaskFor);blockScripts();_0x110c55&&(acconsentoSyncEmbeds(document,!![]),acconsentoWatchStaleMasks(document));const _0x5d3e3b=document[_0x5d5274(0x2f4)][_0x5d5274(0x1c4)](';');_0x5d3e3b[_0x5d5274(0x337)](_0x2b3aa2=>{const _0x2ac135=_0x5d5274;_0x2b3aa2[_0x2ac135(0x2d3)]()&&checkCookie(_0x2b3aa2);}
19385),applyFbqConsent(marketingGranted()),readPreferences()&&updatePreferences(),blockedCookies[_0x5d5274(0x337)](_0x4b9434=>{const _0x4b0811=_0x5d5274;if(isCookieOk(_0x4b9434[_0x4b0811(0x2d3)]()[_0x4b0811(0x1c4)]('=')[0x0])){let _0x4a2352=_0x4b9434[_0x4b0811(0x2d3)]();const _0x10f157=_0x4a2352[_0x4b0811(0x3b6)]();!_0x10f157[_0x4b0811(0x38a)](_0x4b0811(0x29f))&&!_0x10f157['includes'](_0x4b0811(0x308))&&(_0x4a2352+=_0x4b0811(0x3ba));if(!_0x10f157[_0x4b0811(0x38a)](';\x20expires=')&&!_0x10f157[_0x4b0811(0x38a)](_0x4b0811(0x28f))&&!_0x10f157[_0x4b0811(0x38a)](';\x20max-age=')&&!_0x10f157[_0x4b0811(0x38a)](_0x4b0811(0x19c))){const _0x122eda=_0x4a2352['split']('=')[0x0][_0x4b0811(0x18d)](),_0xacad46=getRetentionPeriod(_0x122eda);if(_0xacad46>0x0){const _0x1509e1=new Date(Date[_0x4b0811(0x244)]()+_0xacad46*0x3c*0x3e8);_0x4a2352+=_0x4b0811(0x371)+_0x1509e1[_0x4b0811(0x2f7)]();}}document['acconsentoCookie'][_0x4b0811(0x3ab)][_0x4b0811(0x388)](document,_0x4a2352);}}),emitConsentChange(![]);};function proxyCookies(){const _0x2ee142=_0x24d8b6;let _0x3c2d15;try{_0x3c2d15=Object[_0x2ee142(0x379)](document,_0x2ee142(0x2f4));}catch(_0x1fcb0b){console[_0x2ee142(0x16e)]('Failed\x20to\x20get\x20cookie\x20descriptor:',_0x1fcb0b);return;}if(_0x3c2d15&&_0x3c2d15['configurable']===![]){console[_0x2ee142(0x16e)]('document.cookie\x20is\x20not\x20configurable;\x20skipping\x20proxy.');return;}try{Object['defineProperty'](document,_0x2ee142(0x2f4),{'configurable':!![],'get':function(){const _0x5015a1=_0x2ee142;return document[_0x5015a1(0x175)]['get'][_0x5015a1(0x388)](document);},'set':function(_0x2089bf){const _0xd2ace=_0x2ee142;isCookieOk(_0x2089bf[_0xd2ace(0x1c4)]('=')[0x0])?document[_0xd2ace(0x175)][_0xd2ace(0x3ab)][_0xd2ace(0x388)](document,_0x2089bf):blockedCookies[_0xd2ace(0x21e)](_0x2089bf);}});}catch(_0x5873c8){console[_0x2ee142(0x16e)]('Failed\x20to\x20redefine\x20document.cookie:',_0x5873c8);}}!acconsentoUrl[_0x24d8b6(0x38a)](location['hostname'])&&(document[_0x24d8b6(0x1b5)](),addEventListener('load',()=>{const _0xfad825=_0x24d8b6;document[_0xfad825(0x1b5)]();}),proxyCookies());const cookieObserver=new MutationObserver(_0x2b321f=>{const _0x1d32d5=_0x24d8b6;_0x2b321f[_0x1d32d5(0x337)](({type:_0x372c87,target:_0x25ff6d,attributeName:_0x31632c,addedNodes:_0x298717})=>{const _0x546c35=_0x1d32d5;if(_0x372c87===_0x546c35(0x338)){(_0x31632c===_0x546c35(0x268)||_0x31632c===_0x546c35(0x30c)||_0x31632c===ACCONSENTO_BLOCKED_ATTR)&&_0x25ff6d[_0x546c35(0x247)]===_0x546c35(0x2fc)&&acconsentoSyncEmbed(_0x25ff6d,acconsentoEmbedsGranted(),acconsentoMaskFor);return;}_0x298717['forEach'](_0x1a1bdd=>{const _0x4bc9c4=_0x546c35;if(_0x1a1bdd[_0x4bc9c4(0x2f2)]===0x1&&_0x1a1bdd[_0x4bc9c4(0x247)]==='SCRIPT'){const _0x2e649e=_0x1a1bdd['src']||'';!isSrcOk(_0x2e649e)&&acconsentoApplyScriptConsent(_0x1a1bdd,_0x2e649e);}_0x1a1bdd[_0x4bc9c4(0x2f2)]===0x1&&(_0x1a1bdd[_0x4bc9c4(0x247)]==='IFRAME'||_0x1a1bdd[_0x4bc9c4(0x278)](_0x4bc9c4(0x220))[_0x4bc9c4(0x3ea)])&&(acconsentoSyncEmbeds(_0x1a1bdd,acconsentoEmbedsGranted(),acconsentoMaskFor),acconsentoWatchStaleMasks(_0x1a1bdd));});});});cookieObserver[_0x24d8b6(0x23f)](document['documentElement'],{'childList':!![],'subtree':!![],'attributes':!![]});function checkCookie(_0x4b00d0){const _0x4fa6d2=_0x24d8b6,_0x401eaf=location[_0x4fa6d2(0x273)]['split']('.'),_0x5cf505=_0x401eaf[_0x4fa6d2(0x3ea)],_0x5cc331=_0x4b00d0[_0x4fa6d2(0x1c4)]('=')[0x0][_0x4fa6d2(0x18d)]();if(!isCookieOk(_0x5cc331)){for(let _0x1a0d2a=0x0;_0x1a0d2a<_0x5cf505-0x1;_0x1a0d2a++){document[_0x4fa6d2(0x175)][_0x4fa6d2(0x3ab)]['call'](document,_0x5cc331+_0x4fa6d2(0x176)+_0x401eaf[_0x4fa6d2(0x33c)](_0x1a0d2a)[_0x4fa6d2(0x306)]('.')+_0x4fa6d2(0x3b1)),document[_0x4fa6d2(0x175)][_0x4fa6d2(0x3ab)][_0x4fa6d2(0x388)](document,_0x5cc331+'=null;\x20Path=/;\x20Domain='+_0x401eaf['slice'](_0x1a0d2a)[_0x4fa6d2(0x306)]('.')+_0x4fa6d2(0x3b1));}document[_0x4fa6d2(0x175)][_0x4fa6d2(0x3ab)][_0x4fa6d2(0x388)](document,_0x5cc331+_0x4fa6d2(0x3db)),!blockedCookies[_0x4fa6d2(0x38a)](_0x4b00d0)&&blockedCookies[_0x4fa6d2(0x21e)](_0x4b00d0);}}window[_0x24d8b6(0x3aa)]={'get':{'newViewer':{'path':_0x24d8b6(0x1e4)},'getScanCustomization':{'path':_0x24d8b6(0x208)},'treatments':{'path':'treatments'},'checkViewer':{'path':_0x24d8b6(0x280)}},'post':{'updatePreferences':{'path':_0x24d8b6(0x205)},'informative':{'path':_0x24d8b6(0x3c1)},'defaultInformative':{'path':_0x24d8b6(0x384)},'condition':{'path':_0x24d8b6(0x346)},'cookies':{'path':'cookies/print'}},'put':{},'patch':{},'delete':{},'blob':{}};function loadScript(){const _0xefe619=_0x24d8b6,_0x555564=()=>window[_0xefe619(0x1bb)]['getItem'](_0xefe619(0x3a3))||'',_0x5bc5b5=_0x555564();window[_0xefe619(0x1bd)]={'key':idscript,'baseURL':acconsentoIsLocal?_0xefe619(0x353):scriptSrc['startsWith'](_0xefe619(0x341))?_0xefe619(0x31f):'https://acconsento.click/api/scans/','headers':{'Authorization':'Bearer\x20'+idscript,'Origin':location[_0xefe619(0x273)],'ViewerId':''},'_computeUrl':(_0x142637,_0x343747,_0xeb921d,_0x5cba18)=>{const _0x24cf36=_0xefe619,_0x1bf277=new RegExp(/:[\w-]+/,'g');let _0x47ff1e=_0x142637[_0x24cf36(0x39f)];const _0x268be2={..._0x343747};for(const _0xa7cb31 of _0x47ff1e[_0x24cf36(0x241)](_0x1bf277)){const _0x2597b9=_0xa7cb31[0x0]['replace'](':','');if(!_0x343747[_0x2597b9])throw Error('[\x20'+_0xeb921d+_0x24cf36(0x2fa)+_0x5cba18+_0x24cf36(0x191)+_0x2597b9+'\x27');
19385_0x47ff1e=_0x47ff1e[_0x24cf36(0x38f)](_0xa7cb31,_0x343747[_0x2597b9]),delete _0x268be2[_0x2597b9];}return''+window[_0x24cf36(0x1bd)][_0x24cf36(0x1aa)]+_0x47ff1e+(Object['keys'](_0x268be2)[_0x24cf36(0x3ea)]>0x0&&_0x142637?.[_0x24cf36(0x2d8)]===_0x24cf36(0x1c2)?'?':'');},'_parseJSON':_0x29fe0b=>{const _0x24f906=_0xefe619;let _0x268124;try{_0x268124=_0x29fe0b[_0x24f906(0x296)]();}catch(_0x379785){_0x268124=_0x29fe0b[_0x24f906(0x21a)]();}return _0x268124;},'download':(_0xb770af,_0x1c20ea,_0x4c229a=_0xefe619(0x3ec))=>{const _0x53daf5=_0xefe619;window[_0x53daf5(0x1bd)][_0x53daf5(0x19e)]['ViewerId']=_0x555564();const _0x171eaf=new Blob([_0xb770af],{'type':_0x4c229a});if(window[_0x53daf5(0x177)]?.['msSaveOrOpenBlob']){window[_0x53daf5(0x177)][_0x53daf5(0x202)](_0x171eaf);return;}const _0x1bb611=window[_0x53daf5(0x3a5)][_0x53daf5(0x1cb)](_0x171eaf),_0x486cbd=acconsentoCreateElement[_0x53daf5(0x17f)](document)('a');_0x486cbd[_0x53daf5(0x2b4)]=_0x1bb611,_0x486cbd[_0x53daf5(0x3e8)]=_0x1c20ea,_0x486cbd[_0x53daf5(0x32d)](),setTimeout(function(){const _0x2b871f=_0x53daf5;window[_0x2b871f(0x3a5)][_0x2b871f(0x1d7)](_0x1bb611);},0x64);},'get':(_0x546ad7,_0x1a5c3c)=>{const _0x861e91=_0xefe619;window[_0x861e91(0x1bd)][_0x861e91(0x19e)][_0x861e91(0x329)]=_0x555564();if(window[_0x861e91(0x3aa)][_0x861e91(0x1c2)][_0x546ad7]){const _0xe6d322=window[_0x861e91(0x3aa)][_0x861e91(0x1c2)][_0x546ad7];return fetch(window[_0x861e91(0x1bd)][_0x861e91(0x358)](_0xe6d322,_0x1a5c3c,_0x861e91(0x1a2),_0x546ad7),{'method':_0x861e91(0x1a2),'headers':{...window[_0x861e91(0x1bd)][_0x861e91(0x19e)]},'mode':_0x861e91(0x38c)})['then'](_0x452dbc=>{const _0x3c3649=_0x861e91;if(_0x452dbc[_0x3c3649(0x3d4)]===0xc8)return window[_0x3c3649(0x1bd)][_0x3c3649(0x2b8)](_0x452dbc);return null;});}else throw Error(_0x861e91(0x421)+_0x546ad7+_0x861e91(0x38e));},'blob':(_0x4d68d8,_0x301586)=>{const _0x2f86d3=_0xefe619;window[_0x2f86d3(0x1bd)][_0x2f86d3(0x19e)][_0x2f86d3(0x329)]=_0x555564();if(window[_0x2f86d3(0x3aa)][_0x2f86d3(0x230)][_0x4d68d8]){const _0x35b1a6=window['AcconsentoEndpoints'][_0x2f86d3(0x230)][_0x4d68d8],_0x127320={'method':_0x35b1a6[_0x2f86d3(0x2d8)],'headers':{...window['AcconsentoAPI']['headers']},'mode':_0x2f86d3(0x38c)};return _0x35b1a6[_0x2f86d3(0x2d8)]!==_0x2f86d3(0x1c2)&&(_0x127320[_0x2f86d3(0x1e6)]=JSON[_0x2f86d3(0x23e)](_0x301586)),fetch(window[_0x2f86d3(0x1bd)][_0x2f86d3(0x358)](_0x35b1a6,_0x301586,_0x2f86d3(0x1f6),_0x4d68d8),_0x127320)[_0x2f86d3(0x3c6)](_0x111674=>_0x111674[_0x2f86d3(0x230)]());}else throw Error(_0x2f86d3(0x1a6)+_0x4d68d8+_0x2f86d3(0x38e));},'post':(_0x2cad0c,_0x582e21)=>{const _0x442515=_0xefe619;window[_0x442515(0x1bd)][_0x442515(0x19e)][_0x442515(0x329)]=_0x555564();if(window[_0x442515(0x3aa)][_0x442515(0x3cc)][_0x2cad0c]){const _0x3b1269=window['AcconsentoEndpoints'][_0x442515(0x3cc)][_0x2cad0c];return fetch(window[_0x442515(0x1bd)][_0x442515(0x358)](_0x3b1269,_0x582e21,_0x442515(0x1e8),_0x2cad0c),{'method':_0x442515(0x1e8),'headers':{...window[_0x442515(0x1bd)]['headers']},'mode':_0x442515(0x38c),'body':JSON[_0x442515(0x23e)](_0x582e21)})[_0x442515(0x3c6)](_0xf02f02=>window[_0x442515(0x1bd)]['_parseJSON'](_0xf02f02));}else throw Error(_0x442515(0x1d4)+_0x2cad0c+'\x27\x20was\x20not\x20found');},'put':(_0x247814,_0x482548)=>{const _0x2df8d8=_0xefe619;window[_0x2df8d8(0x1bd)]['headers'][_0x2df8d8(0x329)]=_0x555564();if(window[_0x2df8d8(0x3aa)][_0x2df8d8(0x2b6)][_0x247814]){const _0x306006=window['AcconsentoEndpoints']['put'][_0x247814],_0xcd1411=new FormData();return _0xcd1411['append']('section',_0x482548[_0x2df8d8(0x414)]),fetch(window[_0x2df8d8(0x1bd)][_0x2df8d8(0x358)](_0x306006,_0x482548,_0x2df8d8(0x26c),_0x247814),{'method':_0x2df8d8(0x26c),'headers':{...window[_0x2df8d8(0x1bd)][_0x2df8d8(0x19e)]},'mode':_0x2df8d8(0x38c),'body':_0xcd1411})[_0x2df8d8(0x3c6)](_0x416cb0=>window['AcconsentoAPI'][_0x2df8d8(0x2b8)](_0x416cb0));}else throw Error(_0x2df8d8(0x1e2)+_0x247814+_0x2df8d8(0x38e));},'delete':(_0x2b3365,_0x412e13)=>{const _0x39939d=_0xefe619;window['AcconsentoAPI'][_0x39939d(0x19e)][_0x39939d(0x329)]=_0x555564();if(window[_0x39939d(0x3aa)][_0x39939d(0x201)][_0x2b3365]){const _0x489d8c=window[_0x39939d(0x3aa)]['delete'][_0x2b3365];return fetch(window[_0x39939d(0x1bd)][_0x39939d(0x358)](_0x489d8c,_0x412e13,_0x39939d(0x3fa),_0x2b3365),{'method':_0x39939d(0x3fa),'headers':{...window[_0x39939d(0x1bd)][_0x39939d(0x19e)]},'mode':_0x39939d(0x38c),'body':JSON[_0x39939d(0x23e)](_0x412e13)}
19385)['then'](_0x2b6bc7=>window[_0x39939d(0x1bd)][_0x39939d(0x2b8)](_0x2b6bc7));}else throw Error(_0x39939d(0x403)+_0x2b3365+'\x27\x20was\x20not\x20found');}};function _0x470940(){const _0xaa2e5a=_0xefe619;console['log'](_0xaa2e5a(0x1ff)),window[_0xaa2e5a(0x1bd)][_0xaa2e5a(0x1c2)](_0xaa2e5a(0x35e))[_0xaa2e5a(0x3c6)](_0x12f9e0=>{const _0x150475=_0xaa2e5a;typeof _0x12f9e0[_0x150475(0x3d3)][_0x150475(0x343)]===_0x150475(0x1df)&&(_0x12f9e0['viewer']['info']=JSON['parse'](_0x12f9e0[_0x150475(0x3d3)]['info'])),window[_0x150475(0x1bb)]['setItem']('acconsento-viewer-id',_0x12f9e0[_0x150475(0x3d3)][_0x150475(0x2d2)]),console[_0x150475(0x32e)]('setting\x20default\x20variables'),window[_0x150475(0x1bb)][_0x150475(0x2e1)](_0x150475(0x3f6),JSON['stringify'](_0x12f9e0[_0x150475(0x3d3)][_0x150475(0x343)]['preferences'])),window[_0x150475(0x21c)]['setItem']('acconsento-conditions',_0x12f9e0[_0x150475(0x1ac)]),window[_0x150475(0x21c)]['setItem'](_0x150475(0x2bb),_0x12f9e0[_0x150475(0x309)]),window[_0x150475(0x21c)][_0x150475(0x2e1)](_0x150475(0x36f),_0x12f9e0['cookiePolicyLink']),window[_0x150475(0x21c)][_0x150475(0x2e1)](_0x150475(0x316),_0x12f9e0['termLink']),window[_0x150475(0x267)]=typeof _0x12f9e0[_0x150475(0x393)]==='string'?JSON[_0x150475(0x3a8)](_0x12f9e0[_0x150475(0x393)]):_0x12f9e0['cookies'],window[_0x150475(0x21c)][_0x150475(0x2e1)](_0x150475(0x322),typeof _0x12f9e0[_0x150475(0x393)]===_0x150475(0x1df)?_0x12f9e0[_0x150475(0x393)]:JSON[_0x150475(0x23e)](_0x12f9e0['cookies'])),window[_0x150475(0x21c)][_0x150475(0x2e1)]('acconsento-customization',JSON[_0x150475(0x23e)](_0x12f9e0[_0x150475(0x1b8)])),acconsentoEmbedMask=_0x12f9e0[_0x150475(0x1b8)][_0x150475(0x3a9)]||null,document[_0x150475(0x1b5)](),loadCustomization()[_0x150475(0x3c6)](()=>console[_0x150475(0x32e)]('Acconsento\x20customization\x20loaded'));})[_0xaa2e5a(0x2a4)](_0x316c13=>{const _0x22bab2=_0xaa2e5a;console[_0x22bab2(0x375)](_0x22bab2(0x225),_0x316c13),acconsentoFailOpenEmbeds(),cookieObserver['disconnect']();try{Object[_0x22bab2(0x3d1)](document,'cookie',document[_0x22bab2(0x175)]);}catch(_0x1e31a1){console[_0x22bab2(0x16e)]('Acconsento:\x20impossibile\x20ripristinare\x20document.cookie:',_0x1e31a1['message']);}document[_0x22bab2(0x3e0)]=acconsentoCreateElement,blockedCookies[_0x22bab2(0x337)](_0x56625e=>{const _0x391f6f=_0x22bab2;let _0x2a35e2=_0x56625e['toString']();const _0x1e6866=_0x2a35e2[_0x391f6f(0x3b6)]();!_0x1e6866[_0x391f6f(0x38a)](_0x391f6f(0x29f))&&!_0x1e6866['includes'](_0x391f6f(0x308))&&(_0x2a35e2+=_0
19385x391f6f(0x3ba));if(!_0x1e6866['includes'](_0x391f6f(0x371))&&!_0x1e6866['includes'](_0x391f6f(0x28f))&&!_0x1e6866[_0x391f6f(0x38a)](_0x391f6f(0x2bd))&&!_0x1e6866['includes'](_0x391f6f(0x19c))){const _0xdf943e=_0x2a35e2[_0x391f6f(0x1c4)]('=')[0x0][_0x391f6f(0x18d)](),_0x5572a5=getRetentionPeriod(_0xdf943e);if(_0x5572a5>0x0){const _0x5a01a5=new Date(Date[_0x391f6f(0x244)]()+_0x5572a5*0x3c*0x3e8);_0x2a35e2+=_0x391f6f(0x371)+_0x5a01a5['toUTCString']();}}document[_0x391f6f(0x175)][_0x391f6f(0x3ab)][_0x391f6f(0x388)](document,_0x2a35e2);});});}!_0x5bc5b5?(console[_0xefe619(0x32e)](_0xefe619(0x1be)),_0x470940()):window[_0xefe619(0x1bd)][_0xefe619(0x1c2)](_0xefe619(0x350))['then'](_0x132d4a=>{const _0x55777e=_0xefe619;_0x132d4a?.[_0x55777e(0x217)]===!![]?loadCustomization()[_0x55777e(0x3c6)](()=>{const _0x37d13d=_0x55777e;console[_0x37d13d(0x32e)](_0x37d13d(0x32a));}):(console[_0x55777e(0x32e)](_0x55777e(0x3dd)),window[_0x55777e(0x1bb)][_0x55777e(0x257)](_0x55777e(0x3a3)),_0x470940());})[_0xefe619(0x2a4)](()=>{const _0x3faa50=_0xefe619;console['log']('error\x20checking\x20viewer,\x20creating\x20new\x20viewer\x20as\x20fallback'),window['localStorage'][_0x3faa50(0x257)](_0x3faa50(0x3a3)),_0x470940();});}async function loadCustomization(){const _0x2a5028=_0x24d8b6;let _0x15da4f=JSON[_0x2a5028(0x3a8)](window[_0x2a5028(0x21c)]['getItem'](_0x2a5028(0x215)));if(!_0x15da4f||!_0x15da4f[_0x2a5028(0x3a9)])console[_0x2a5028(0x32e)](_0x2a5028(0x40d)),window['AcconsentoAPI']['get'](_0x2a5028(0x327))[_0x2a5028(0x3c6)](_0x1dc09=>{const _0x17a5ed=_0x2a5028;window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x215),JSON[_0x17a5ed(0x23e)](_0x1dc09[_0x17a5ed(0x1b8)])),acconsentoEmbedMask=_0x1dc09[_0x17a5ed(0x1b8)][_0x17a5ed(0x3a9)]||null,window[_0x17a5ed(0x267)]=typeof _0x1dc09[_0x17a5ed(0x393)]==='string'?JSON[_0x17a5ed(0x3a8)](_0x1dc09['cookies']):_0x1dc09['cookies'],window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x322),typeof _0x1dc09[_0x17a5ed(0x393)]===_0x17a5ed(0x1df)?_0x1dc09['cookies']:JSON[_0x17a5ed(0x23e)](_0x1dc09[_0x17a5ed(0x393)])),window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x2bb),_0x1dc09[_0x17a5ed(0x309)]),window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x36f),_0x1dc09[_0x17a5ed(0x30a)]),window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x31a),_0x1dc09['condition_id']),window[_0x17a5ed(0x21c)][_0x17a5ed(0x2e1)](_0x17a5ed(0x316),_0x1dc09[_0x17a5ed(0x40c)]),document['AcconsentoWatchCookies'](),_0x15da4f=JSON[_0x17a5ed(0x3a8)](window['sessionStorage'][_0x17a5ed(0x37d)](_0x17a5ed(0x215)));const _0x4b9b2c=acconsentoCreateElement[_0x17a5ed(0x17f)](document)(_0x17a5ed(0x1b6));_0x4b9b2c[_0x17a5ed(0x268)]=acconsentoUrl+_0x15da4f['js'],_0x4b9b2c[_0x17a5ed(0x36a)]='text/javascript',_0x4b9b2c[_0x17a5ed(0x234)]=acconsentoFailOpenEmbeds,document[_0x17a5ed(0x278)](_0x17a5ed(0x1ee))[0x0][_0x17a5ed(0x362)](_0x4b9b2c);const _0x5db836=acconsentoCreateElement[_0x17a5ed(0x17f)](document)(_0x17a5ed(0x1b6));_0x5db836['src']=acconsentoUrl+_0x15da4f['jsVendor'],_0x5db836[_0x17a5ed(0x36a)]=_0x17a5ed(0x211),_0x5db836[_0x17a5ed(0x234)]=acconsentoFailOpenEmbeds,document[_0x17a5ed(0x278)]('head')[0x0][_0x17a5ed(0x362)](_0x5db836);const _0x347831=acconsentoCreateElement[_0x17a5ed(0x17f)](document)('link');_0x347831[_0x17a5ed(0x3c9)]=_0x17a5ed(0x1de),_0x347831[_0x17a5ed(0x2b4)]=acconsentoUrl+_0x15da4f[_0x17a5ed(0x1dc)],document[_0x17a5ed(0x1ee)][_0x17a5ed(0x1e7)](_0x347831,document[_0x17a5ed(0x1ee)]['firstElementChild']);const _0x261271=acconsentoCreateElement[_0x17a5ed(0x17f)](document)(_0x17a5ed(0x3ce));_0x261271[_0x17a5ed(0x3c9)]=_0x17a5ed(0x1de),_0x261271['href']=acconsentoUrl+_0x15da4f[_0x17a5ed(0x282)],document[_0x17a5ed(0x1ee)][_0x17a5ed(0x1e7)](_0x261271,document[_0x17a5ed(0x1ee)][_0x17a5ed(0x3d9)]),acconsentoConsentReady=!![],document[_0x17a5ed(0x3ee)](new CustomEvent(_0x17a5ed(0x32b)));})[_0x2a5028(0x2a4)](_0x2b7c37=>{const _0x246452=_0x2a5028;console[_0x246452(0x375)]('Error\x20loading\x20customization:',_0x2b7c37),acconsentoFailOpenEmbeds(),cookieObserver['disconnect']();try{Object[_0x246452(0x3d1)](document,_0x246452(0x2f4),document[_0x246452(0x175)]);}catch(_0x596226){console[_0x246452(0x16e)](_0x246452(0x1e1),_0x596226[_0x246452(0x3a0)]);}document['createElement']=acconsentoCreateElement,blockedCookies[_0x246452(0x337)](_0x4f690e=>{const _0x548902=_0x246452;let _0x4d198b=_0x4f690e[_0x548902(0x2d3)]();const _0x3f2e35=_0x4d198b[_0x548902(0x3b6)]();!_0x3f2e35['includes'](';\x20path=')&&!_0x3f2e35[_0x548902(0x38a)](_0x548902(0x308))&&(_0x4d198b+=_0x548902(0x3ba));if(!_0x3f2e35[_0x548902(0x38a)](';\x20expires=')&&!_0x3f2e35[_0x548902(0x38a)](_0x548902(0x28f))&&!_0x3f2e35[_0x548902(0x38a)](_0x548902(0x2bd))&&!_0x3f2e35[_0x548902(0x38a)](_0x548902(0x19c))){const _0x434bef=_0x4d198b[_0x548902(0x1c4)]('=')[0x0]['trim'](),_0x15d5c5=getRetentionPeriod(_0x434bef);
19385if(_0x15d5c5>0x0){const _0x521aae=new Date(Date[_0x548902(0x244)]()+_0x15d5c5*0x3c*0x3e8);_0x4d198b+=_0x548902(0x371)+_0x521aae[_0x548902(0x2f7)]();}}document['acconsentoCookie'][_0x548902(0x3ab)][_0x548902(0x388)](document,_0x4d198b);});});else{const _0x161cde=acconsentoCreateElement[_0x2a5028(0x17f)](document)(_0x2a5028(0x1b6));_0x161cde[_0x2a5028(0x268)]=acconsentoUrl+_0x15da4f['js'],_0x161cde[_0x2a5028(0x36a)]='text/javascript',_0x161cde[_0x2a5028(0x234)]=acconsentoFailOpenEmbeds,document[_0x2a5028(0x278)](_0x2a5028(0x1ee))[0x0][_0x2a5028(0x362)](_0x161cde);const _0x2784ae=acconsentoCreateElement[_0x2a5028(0x17f)](document)(_0x2a5028(0x1b6));_0x2784ae[_0x2a5028(0x268)]=acconsentoUrl+_0x15da4f['jsVendor'],_0x2784ae[_0x2a5028(0x36a)]=_0x2a5028(0x211),_0x2784ae['onerror']=acconsentoFailOpenEmbeds,document[_0x2a5028(0x278)](_0x2a5028(0x1ee))[0x0][_0x2a5028(0x362)](_0x2784ae);const _0x3b56f6=acconsentoCreateElement[_0x2a5028(0x17f)](document)('link');_0x3b56f6[_0x2a5028(0x3c9)]='stylesheet',_0x3b56f6[_0x2a5028(0x2b4)]=acconsentoUrl+_0x15da4f[_0x2a5028(0x1dc)],document[_0x2a5028(0x1ee)][_0x2a5028(0x1e7)](_0x3b56f6,document[_0x2a5028(0x1ee)]['firstElementChild']);const _0x27b3cf=acconsentoCreateElement[_0x2a5028(0x17f)](document)(_0x2a5028(0x3ce));_0x27b3cf['rel']=_0x2a5028(0x1de),_0x27b3cf[_0x2a5028(0x2b4)]=acconsentoUrl+_0x15da4f[_0x2a5028(0x282)],document[_0x2a5028(0x1ee)][_0x2a5028(0x1e7)](_0x27b3cf,document[_0x2a5028(0x1ee)][_0x2a5028(0x3d9)]),acconsentoConsentReady=!![],document[_0x2a5028(0x3ee)](new CustomEvent(_0x2a5028(0x32b)));}}function displayWidget(){const _0x1afca9=_0x24d8b6,_0x4f11b8=acconsentoCreateElement[_0x1afca9(0x17f)](document)(_0x1afca9(0x171));_0x4f11b8['id']=_0x1afca9(0x286),document[_0x1afca9(0x1e6)][_0x1afca9(0x362)](_0x4f11b8),loadScript();}document[_0x24d8b6(0x1e6)]?displayWidget():addEventListener(_0x24d8b6(0x2d1),()=>{displayWidget();});}else console[_0x24d8b6(0x32e)](_0x24d8b6(0x1f1)); 19386} catch (e) { 19387console.error('Error in file:https://acconsento.click/script.js; Error:' + e.message); 19388};
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.