vendor: 5,031 bytes, lines 1-2
1/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window: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&&(
vendor: 6,317 bytes, line 2
2a=!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)}
vendor: 4,763 bytes, line 2
2,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)}
vendor: 6,770 bytes, line 2
2,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: 6,600 bytes, line 2
2return 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]||ce.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;
vendor: 13,727 bytes, line 2
2if("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])||(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: 6,944 bytes, line 2
2n.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;
vendor: 25,800 bytes, line 2
2left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",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;return 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));!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: 11,581 bytes, line 2
2if(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 M(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});
3 4/** 5 * @license RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 6 * Available via the MIT or new BSD license. 7 * see: http://github.com/requirejs/domReady for details 8 */ 9/*jslint */ 10/*global require: false, define: false, requirejs: false, 11 window: false, clearInterval: false, document: false, 12 self: false, setInterval: false */ 13 14 15define('domReady',[],function () { 16 'use strict'; 17 18 var isTop, testDiv, scrollIntervalId, 19 isBrowser = typeof window !== "undefined" && window.document, 20 isPageLoaded = !isBrowser, 21 doc = isBrowser ? document : null, 22 readyCalls = []; 23 24 function runCallbacks(callbacks) { 25 var i; 26 for (i = 0; i < callbacks.length; i += 1) { 27 callbacks[i](doc); 28 } 29 } 30 31 function callReady() { 32 var callbacks = readyCalls; 33 34 if (isPageLoaded) { 35 //Call the DOM ready callbacks 36 if (callbacks.length) { 37 readyCalls = []; 38 runCallbacks(callbacks); 39 } 40 } 41 } 42 43 /** 44 * Sets the page as loaded. 45 */ 46 function pageLoaded() { 47 if (!isPageLoaded) { 48 isPageLoaded = true; 49 if (scrollIntervalId) { 50 clearInterval(scrollIntervalId); 51 } 52 53 callReady(); 54 } 55 } 56 57 if (isBrowser) { 58 if (document.addEventListener) { 59 //Standards. Hooray! Assumption here that if standards based, 60 //it knows about DOMContentLoaded. 61 document.addEventListener("DOMContentLoaded", pageLoaded, false); 62 window.addEventListener("load", pageLoaded, false); 63 } else if (window.attachEvent) { 64 window.attachEvent("onload", pageLoaded); 65 66 testDiv = document.createElement('div'); 67 try { 68 isTop = window.frameElement === null; 69 } catch (e) {} 70 71 //DOMContentLoaded approximation that uses a doScroll, as found by 72 //Diego Perini: http://javascript.nwbox.com/IEContentLoaded/, 73 //but modified by other contributors, including jdalton 74 if (testDiv.doScroll && isTop && window.external) { 75 scrollIntervalId = setInterval(function () { 76 try { 77 testDiv.doScroll(); 78 pageLoaded(); 79 } catch (e) {} 80 }, 30); 81 } 82 } 83 84 //Check if document already complete, and if so, just trigger page load 85 //listeners. Latest webkit browsers also use "interactive", and 86 //will fire the onDOMContentLoaded before "interactive" but not after 87 //entering "interactive" or "complete". More details: 88 //http://dev.w3.org/html5/spec/the-end.html#the-end 89 //http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded 90 //Hmm, this is more complicated on further use, see "firing too early" 91 //bug: https://github.com/requirejs/domReady/issues/1 92 //so removing the || document.readyState === "interactive" test. 93 //There is still a window.onload binding that should get fired if 94 //DOMContentLoaded is missed. 95 if (document.readyState === "complete") { 96 pageLoaded(); 97 } 98 } 99 100 /** START OF PUBLIC API **/ 101 102 /** 103 * Registers a callback for DOM ready. If DOM is already ready, the 104 * callback is called immediately. 105 * @param {Function} callback 106 */ 107 function domReady(callback) { 108 if (isPageLoaded) { 109 callback(doc); 110 } else { 111 readyCalls.push(callback); 112 } 113 return domReady; 114 } 115 116 domReady.version = '2.0.1'; 117 118 /** 119 * Loader Plugin API method 120 */ 121 domReady.load = function (name, req, onLoad, config) { 122 if (config.isBuild) { 123 onLoad(null); 124 } else { 125 domReady(onLoad); 126 } 127 }; 128 129 /** END OF PUBLIC API **/ 130 131 return domReady; 132}); 133 134/* jshint camelcase: false */ 135 136 137// Asyncronous with module loading 138define('service', [],function() { 139 return { 140 addListToCart: { 141 // HYBRIS 142 //url: "/cart/addList", 143 url: "/mylists/addListToCart", 144 method: "post" 145 // ROCKFLICKER 146// url: "../../scripts/fpo-json/add-to-cart.json", 147// method: "get" 148 }, 149 addProductToCart: { 150 // ROCKFLICKER 151// url: "../../scripts/fpo-json/add-to-cart.json", 152// method: "get" 153 // HYBRIS 154 url: "/cart/add", 155 method: "post" 156 }, 157 addToCartOptions: { 158 url:"/cart/addToCartModal", 159 method:"post" 160 }, 161 addQuoteToCart: { 162 // HYBRIS 163 url: "/cart/addQuote", 164 method: "post" 165 }, 166 compareProducts: { 167 // HYBRIS 168 url: "/compareproducts/trackproduct", 169 method: "post" 170 // ROCKFLICKER 171// url: "../../scripts/fpo-json/compare-products.json", 172// method: "get" 173 }, 174 compareCheckProducts: { 175 // HYBRIS 176 url: "/compareproducts/comparepopup", 177 method: "get" 178 }, 179 searchListPagination: { 180 url: "/mylists/listdetail", 181 method: "post" 182 }, 183 listRename: { 184 // ROCKFLICKER 185// url: "../../scripts/fpo-json/inline-editable-field.json", 186// method: "get" 187 // HYBRIS 188 url: "/mylists/listdetail/renameList", 189 method: "post" 190 }, 191 addMultipleProductsToCart: { 192 // ROCKFLICKER 193// url: "../../scripts/fpo-json/add-to-cart.json", 194// method: "get" 195 // HYBRIS 196 url: "/cart/addList", 197 method: "post" 198 },
199 errorModal : { 200 // ROCKFLICKER.. 201// url: "../pages/p018-modal-error.html", 202 // HYBRIS 203 url: "/modalerror", 204 method: "get" 205 }, 206 postOfficeBox: { 207 // HYBRIS 208 url: "/cart/poNumbers", 209 // ROCKFLICKER 210// url: "../../scripts/fpo-json/po-numbers.json", 211 method: "get" 212 }, 213 switchAccount: { 214// // ROCKFLICKER 215// //url: "../../scripts/fpo-json/form-switch-account.json", 216// // HYBRIS 217 url: "/switchAccountModal", 218 method: "get" 219 }, 220 //typeAhead: { 221 // HYBRIS 222 //url: "/search/autocomplete?term=%QUERY", 223 // ROCKFLICKER 224// url: "../../scripts/fpo-json/form-header-search.json", 225 //method: "get" 226 //}, 227 accountNumberValidation: { 228 // HYBRIS 229 //url: "", 230 //method: "post" 231 // ROCKFLICKER 232 url: "../../scripts/fpo-json/account-number-validation.json", 233 method: "get" 234 }, 235 miniCart: { 236 url: "/cart/rollover/DefaultMiniCart", 237 method: "get" 238 }, 239 topNavigationCategories: { 240 url: "/category/headercategories", 241 method: "get" 242 }, 243 bottomNavigationCategories: { 244 url: "/category/bottomheadercategories", 245 method: "get" 246 }, 247 saveCreditCard: { 248 url: "/payment/saveCreditCard", 249 method: "post" 250 }, 251 saveEnrolledAutopayCard: { 252 url: "/autopay/updateExistingAutopayCreditCard", 253 method: "post" 254 }, 255 createRecurringOrder: { 256 url: "/recurringorder/save", 257 method: "post" 258 }, 259 productPricing: { 260 // HYBRIS 261 url: "/pricing", 262 method: "get" 263 }, 264 pricingAvailability: { 265 // HYBRIS 266 url: "/pricing/availability", 267 method: "get" 268 }, 269 priceLookup: { 270 // HYBRIS 271 url: "/p/priceLookup", 272 method: "get" 273 }, 274 checkAvailabilityPickup: { 275 // HYBRIS 276 url: "/checkAvailability", 277 method: "get" 278 }, 279 getAvailability: { 280 // HYBRIS 281 url: "/checkAvailability/search", 282 method: "post" 283 }, 284 addListToCartView: { 285 // HYBRIS 286 url: "/mylists/addListToCartView", 287 method: "post" 288 }, 289 proofOfDelivery: { 290 // HYBRIS 291 url: "/dashboard/invoicePOD", 292 method: "get" 293 }, 294 taxDocUpload: { 295 url: "/register/uploadfile", 296 method: "post" 297 }, 298 addProductToList: { 299 // HYBRIS 300 url: "/myLists/addToList/addProduct/save", 301 method: "post" 302 }, 303 addCartToList: { 304 // HYBRIS 305 url: "/myLists/addToList/requestCart", 306 method: "post" 307 }, 308 addOrderToList: { 309 // HYBRIS 310 url: "myLists/addToList/requestOrder", 311 method: "post" 312 }, 313 invoiceDataChart: { 314 // HYBRIS. 315 url: "/invoice/agingSummaryChartData", 316 method: "get" 317 }, 318 findABranchMobile: { 319 // HYBRIS. 320 url: "/store-finder?mobile=true", 321 method: "post" 322 }, 323 invoiceFile: { 324 // HYBRIS. 325 url: "/invoice/fileJson/", 326 method: "get" 327 }, 328 invoiceFileCSV: { 329 // HYBRIS. 330 url: "/invoice/exportCSV", 331 method: "post" 332 }, 333 paymentComplianceToken: { 334 url: "", 335 method: "get" 336 }, 337 resendVerificationCode: { 338 url: "/resendVerificationCode", 339 method: "post" 340 }, 341 passwordReset: { 342 url:"/passwordReset", 343 method:"post" 344 }, 345 orderQtyExceeded: { 346 url:"/qtyExceeded", 347 method:"post" 348 }, 349 getCoaProvider: { 350 url:"/coa/getCOA", 351 method:"post" 352 }, 353 getAddReference: { 354 url:"/payinvoices/addreferencetoinvoice", 355 method:"get" 356 }, 357 getRequisitionViewList: { 358 url:"/requisition/viewIcon", 359 method:"get" 360 }, 361 getBulkCOAPDF: { 362 url:"/coa/showPdf", 363 method: "get" 364 }, 365 getSearchResults: { 366 url: '', 367 method: 'get' 368 }, 369 updateDeliveryModes: { 370 url: "/availability/qtyUpdate", 371 method: "post" 372 }, 373 qtyUpdateCA: { 374 url: "/availability/qtyUpdateforCA", 375 method: "post" 376 }, 377 updateAvailabilityModes: { 378 url: "/availability/qtyAvailabilityUpdate", 379 method: "post" 380 }, 381 compareProductsClearAll: { 382 url: "/compareproducts/clear", 383 method: "post" 384 }, 385 orderConfirm:{ 386 url: '/autotune/process/realtime/order/autoTuneData', 387 method: "post" 388 }, 389 registerEmailVerification: { 390 url: "/loginVerificationReminderEmail", 391 method: "post" 392 }, 393 getAirgasAccountAddress: { 394 url: "/chooseAddress/getDeliveryAddressesSelectionPopup", 395 method: "post" 396 }, 397 viewAlternateProduct: { 398 url: "/viewAlternate/viewAlternatePopup", 399 method: "get" 400 }, 401 viewQuoteAlternatePopup: { 402 url: "/expressorderpad/viewAlternatePopup", 403 method: "post" 404 }, 405 updateQuoteAlternate: { 406 url: "/viewAlternate/quoteAlternate", 407 method: "post" 408 }, 409 getDeviceInfoData: { 410 url: "/ezgaz/getDeviceInfoData", 411 method: "get" 412 }, 413 getDeviceFavorite: { 414 url: "/ezgaz/getDeviceFavorite", 415 method: "put" 416 }, 417 emailSubmitButtonHandle:{ 418 url:"/managequote/getQuoteDetailsByEmail", 419 method: "post" 420 }, 421 getDeviceAlarmData: { 422 url: "/ezgaz/getDeviceAlarmData", 423 method: "get" 424 }, 425 getAlarmHistory: { 426 url: "/ezgaz/getAlarmHistory", 427 method: "get" 428 }, 429 getNotificationSubscriptions: { 430 url: "/ezgaz/getNotificationSubscriptions", 431 method: "get" 432 }, 433 emailPdpSubmitButton:{
434 url:"/p/sendProductDetailsByEmail", 435 method: "post" 436 }, 437 manageProfile:{ 438 url:"/manageProfile/userValidation", 439 method: "post" 440 }, 441 invoicehistory:{ 442 url:"/payinvoices/addToInvoiceHistory", 443 method: "post" 444 }, 445 deleteHeaderRequisitions: { 446 url:"/deleteRequisitionModal", 447 method: "post" 448 }, 449 deleteLineLevelRequisitions: { 450 url:"/requisitions/cancel-line-item", 451 method: "post" 452 }, 453 rejectHeaderRequisitions: { 454 url:"/requisitions/reject", 455 method: "post" 456 }, 457 rejectLineLevelRequisitions: { 458 url:"/requisitions/rejectItem", 459 method: "post" 460 }, 461 requisitionPOupdate : { 462 url:"/requisition/updatePoNumber", 463 method: "post" 464 }, 465 requisitionCancelRejection : { 466 url:"/requisitions/cancelRejection", 467 method: "post" 468 }, 469 requisitionSubmitOrder : { 470 url:"/requisition/submitRequisition", 471 method: "post" 472 }, 473 requisitionDetailsApprove : { 474 url:"/requisitions/approve", 475 method: "get" 476 }, 477 paymentOptions : { 478 url:"/paymentPreferences", 479 method: "post" 480 }, 481 removeAccount : { 482 url:"/associatedAccount/deleteAccountFromProfile", 483 method: "post" 484 }, 485 confirmRemoveAccount : { 486 url:"/associatedAccount/removeAccount", 487 method: "post" 488 }, 489 addAddress : { 490 url:"/cart/addAddress", 491 method: "get" 492 }, 493 addAccount : { 494 url:"/associatedAccount/addAccount", 495 method: "get" 496 }, 497 verifyAccount : { 498 url:"/associatedAccount/verifyAccount", 499 method: "post" 500 }, 501 editAddress : { 502 url:"/alternateAddresses/editAddress", 503 method: "get" 504 }, 505 removeAddress : { 506 url:"/alternateAddresses/removeAddress", 507 method: "get" 508 }, 509 addressRemoved : { 510 url:"/alternateAddresses/removeAddress", 511 method: "post" 512 }, 513 validateSoldToAccount : { 514 url: "/autopay/validateAccount", 515 method: "get" 516 }, 517 autopayAbandon : { 518 url: "/autopay/abandon", 519 method: "get" 520 }, 521 clearAutopayData : { 522 url: "/autopay/clearAutopayData", 523 method: "get" 524 }, 525 surcharge : { 526 url: "/payinvoices/fetchCreditCardSurcharge", 527 method: "post" 528 } 529 } 530}); 531/* jshint camelcase: false */ 532 533 534// Asyncronous with module loading 535define('notifications', [],function () { 536 return { 537 HANDLE_CART_SUBMIT: 'HANDLE_CART_SUBMIT', 538 CHECKOUT_ACTION: 'CHECKOUT_ACTION', 539 CHECKOUT_CLEAR_CART: 'CHECKOUT_CLEAR_CART', 540 CHECKOUT_REMOVE_PRODUCT: 'CHECKOUT_REMOVE_PRODUCT', 541 ADD_PAYMENT: 'ADD_PAYMENT', 542 ADD_TO_CART_REFRESH: 'ADD_TO_CART_REFRESH', 543 DISPLAY_ADD_TO_CART: 'DISPLAY_ADD_TO_CART', 544 CONTROLLER_REFRESH: 'CONTROLLER_REFRESH', 545 UPDATE_MINI_CART: 'UPDATE_MINI_CART', 546 EXECUTE_ADD_TO_CART: 'EXECUTE_ADD_TO_CART', 547 REMOVE_INVOICE: 'REMOVE_INVOICE', 548 EXECUTE_CREDIT_CARD_TOKEN_REQUEST: 'EXECUTE_CREDIT_CARD_TOKEN_REQUEST', 549 HANDLE_ENCRYPTED_CREDIT_CARD: 'HANDLE_ENCRYPTED_CREDIT_CARD', 550 ORA_CART_UPDATE: 'ORA_CART_UPDATE', 551 CART_ASYNC_UPDATE: 'CART_ASYNC_UPDATE', 552 HANDLE_CART_ASYNC_RESPONSE: 'HANDLE_CART_ASYNC_RESPONSE', 553 ADOBE_ADD_TO_CART_TRACK: 'ADOBE_ADD_TO_CART_TRACK', 554 ADOBE_ORA_ASYNC: 'ADOBE_ORA_ASYNC', 555 ADOBE_EXPRESS_ORDER_PAD_TRACK: 'ADOBE_EXPRESS_ORDER_PAD_TRACK', 556 ADOBE_MULTI_SELECTED_ADD_TO_CART: 'ADOBE_MULTI_SELECTED_ADD_TO_CART', 557 ADOBE_ADD_TO_LIST_TRACK: 'ADOBE_ADD_TO_LIST_TRACK', 558 ADOBE_FORM_ANALYTICS_CART_CLICK: 'ADOBE_FORM_ANALYTICS_CART_CLICK', 559 ADOBE_FORM_ANALYTICS_CART_QUICK_VIEW: 'ADOBE_FORM_ANALYTICS_CART_QUICK_VIEW', 560 EMARKET_SUPERUSER_LINK_TRACK: 'EMARKET_SUPERUSER_LINK_TRACK', 561 HANDLE_MODAL_ELEMENTS_TABFOCUS: 'HANDLE_MODAL_ELEMENTS_TABFOCUS', 562 HANDLE_MODAL_CLOSE_CLICK: 'HANDLE_MODAL_CLOSE_CLICK', 563 HANDLE_MODAL_PREVIOUS_ELEMENT: 'HANDLE_MODAL_PREVIOUS_ELEMENT', 564 SHOW_PRODUCT_UNAVAILABLE_MESSAGE: 'SHOW_PRODUCT_UNAVAILABLE_MESSAGE', 565 ADD_ELLIPSIS_LINE_LIMIT: 'ADD_ELLIPSIS_LINE_LIMIT', 566 HANDLE_GUEST_LOGIN_LINK: 'HANDLE_GUEST_LOGIN_LINK', 567 POPUP_DOM_REFRESH: 'POPUP_DOM_REFRESH', 568 ZIP_LINK_ACTIONS: 'ZIP_LINK_ACTIONS', 569 HANDLE_UPDATE_SELECTED_ITEMS: 'HANDLE_UPDATE_SELECTED_ITEMS', 570 ORA_QTY_ASYNC: 'ORA_QTY_ASYNC', 571 ADD_TO_CART_OPTIONS_SUBMIT: 'ADD_TO_CART_OPTIONS_SUBMIT', 572 FACET_REFRESH: 'FACET_REFRESH', 573 HANDLE_STORE_PICKUP_CLICK: 'HANDLE_STORE_PICKUP_CLICK', 574 ADOBE_SWITCH_TAB: 'ADOBE_SWITCH_TAB', 575 HANDLE_SELECT_ALL_CHECKBOX:'HANDLE_SELECT_ALL_CHECKBOX', 576 QTY_ASYNC_REFRESH: 'QTY_ASYNC_REFRESH', 577 HANDLE_MOUSE_LEAVE_ELEMENT: 'HANDLE_MOUSE_LEAVE_ELEMENT', 578 HANDLE_BIND_CHECKBOX_EVENTS: 'HANDLE_BIND_CHECKBOX_EVENTS', 579 REMOVE_MODEL_ELEMENTS_FOCUS: 'REMOVE_MODEL_ELEMENTS_FOCUS', 580 HANDLE_MULTIPLE_MODAL_ACTIONS: 'HANDLE_MULTIPLE_MODAL_ACTIONS', 581 SHOW_HIDE_PWD_REFRESH: 'SHOW_HIDE_PWD_REFRESH', 582 ADOBE_LINK_TRACK: 'ADOBE_LINK_TRACK', 583 EZ_GAZ_TRACK: 'EZ_GAZ_TRACK', 584 CLEAR_CART_MODAL_REFRESH:'CLEAR_CART_MODAL_REFRESH', 585 CART_REQUEST_QUOTE_REFRESH: 'CART_REQUEST_QUOTE_REFRESH', 586 EMAIL_PDP_TRACK: 'EMAIL_PDP_TRACK', 587 SUGGESTED_ACCESSORIES_TRACK:'SUGGESTED_ACCESSORIES_TRACK', 588 REFRESH_CUSTOM_TOOLTIP: 'REFRESH_CUSTOM_TOOLTIP', 589 REFRESH_TELL_US_MORE_MODAL: 'REFRESH_TELL_US_MORE_MODAL', 590 HANDLE_REQUISITION_ACTIONS: 'HANDLE_REQUISITION_ACTIONS', 591 REQUISITION_ACTION_TRACK: 'REQUISITION_ACTION_TRACK', 592 REQUISITION_CONFIRM_ORDER_TRACK: 'REQUISITION_CONFIRM_ORDER_TRACK', 593 MANAGE_ACCOUNTS_ADDRESSSES: 'MANAGE_ACCOUNTS_ADDRESSSES', 594 UPDATE_INVOICE_DETAILS: 'UPDATE_INVOICE_DETAILS', 595 HANDLE_PAY_INVOICES_ACTIONS: 'HANDLE_PAY_INVOICES_ACTIONS', 596 ADOBE_LINK_TRACK_CONTACT_MODAL: 'ADOBE_LINK_TRACK_CONTACT_MODAL', 597 AUTOPAY: 'AUTOPAY', 598 AUTOTUNE_FACET_CLICK: 'AUTOTUNE_FACET_CLICK', 599 CLEAR_AUTOPAY_DATA: 'CLEAR_AUTOPAY_DATA', 600 CHECKOUT_CART_ID_TRACK: 'CHECKOUT_CART_ID_TRACK', 601 HANDLE_CURRENT_CHANGE_PACKAGE_SIZE_QUANTITY: 'HANDLE_CURRENT_CHANGE_PACKAGE_SIZE_QUANTITY', 602 DASHBOARD_TRACKING: 'DASHBOARD_TRACKING', 603 HANDLE_LOGIN_BUTTON_EVENT_REFRESH:'HANDLE_LOGIN_BUTTON_EVENT_REFRESH' 604 } 605});
vendor: 15,187 bytes, lines 606-1181
606/* 607 * Copyright 2011 Twitter, Inc. 608 * Licensed under the Apache License, Version 2.0 (the "License"); 609 * you may not use this file except in compliance with the License. 610 * You may obtain a copy of the License at 611 * 612 * http://www.apache.org/licenses/LICENSE-2.0 613 * 614 * Unless required by applicable law or agreed to in writing, software 615 * distributed under the License is distributed on an "AS IS" BASIS, 616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 617 * See the License for the specific language governing permissions and 618 * limitations under the License. 619 */ 620 621 622 623var Hogan = {}; 624 625(function (Hogan, useArrayBuffer) { 626 Hogan.Template = function (renderFunc, text, compiler, options) { 627 this.r = renderFunc || this.r; 628 this.c = compiler; 629 this.options = options; 630 this.text = text || ''; 631 this.buf = (useArrayBuffer) ? [] : ''; 632 } 633 634 Hogan.Template.prototype = { 635 // render: replaced by generated code. 636 r: function (context, partials, indent) { return ''; }, 637 638 // variable escaping 639 v: hoganEscape, 640 641 // triple stache 642 t: coerceToString, 643 644 render: function render(context, partials, indent) { 645 return this.ri([context], partials || {}, indent); 646 }, 647 648 // render internal -- a hook for overrides that catches partials too 649 ri: function (context, partials, indent) { 650 return this.r(context, partials, indent); 651 }, 652 653 // tries to find a partial in the curent scope and render it 654 rp: function(name, context, partials, indent) { 655 var partial = partials[name]; 656 657 if (!partial) { 658 return ''; 659 } 660 661 if (this.c && typeof partial == 'string') { 662 partial = this.c.compile(partial, this.options); 663 } 664 665 return partial.ri(context, partials, indent); 666 }, 667 668 // render a section 669 rs: function(context, partials, section) { 670 var tail = context[context.length - 1]; 671 672 if (!isArray(tail)) { 673 section(context, partials, this); 674 return; 675 } 676 677 for (var i = 0; i < tail.length; i++) { 678 context.push(tail[i]); 679 section(context, partials, this); 680 context.pop(); 681 } 682 }, 683 684 // maybe start a section 685 s: function(val, ctx, partials, inverted, start, end, tags) { 686 var pass; 687 688 if (isArray(val) && val.length === 0) { 689 return false; 690 } 691 692 if (typeof val == 'function') { 693 val = this.ls(val, ctx, partials, inverted, start, end, tags); 694 } 695 696 pass = (val === '') || !!val; 697 698 if (!inverted && pass && ctx) { 699 ctx.push((typeof val == 'object') ? val : ctx[ctx.length - 1]); 700 } 701 702 return pass; 703 }, 704 705 // find values with dotted names 706 d: function(key, ctx, partials, returnFound) { 707 var names = key.split('.'), 708 val = this.f(names[0], ctx, partials, returnFound), 709 cx = null; 710 711 if (key === '.' && isArray(ctx[ctx.length - 2])) { 712 return ctx[ctx.length - 1]; 713 } 714 715 for (var i = 1; i < names.length; i++) { 716 if (val && typeof val == 'object' && names[i] in val) { 717 cx = val; 718 val = val[names[i]]; 719 } else { 720 val = ''; 721 } 722 } 723 724 if (returnFound && !val) { 725 return false; 726 } 727 728 if (!returnFound && typeof val == 'function') { 729 ctx.push(cx); 730 val = this.lv(val, ctx, partials); 731 ctx.pop(); 732 } 733 734 return val; 735 }, 736 737 // find values with normal names 738 f: function(key, ctx, partials, returnFound) { 739 var val = false, 740 v = null, 741 found = false; 742 743 for (var i = ctx.length - 1; i >= 0; i--) { 744 v = ctx[i]; 745 if (v && typeof v == 'object' && key in v) { 746 val = v[key]; 747 found = true; 748 break; 749 } 750 } 751 752 if (!found) { 753 return (returnFound) ? false : ""; 754 } 755 756 if (!returnFound && typeof val == 'function') { 757 val = this.lv(val, ctx, partials); 758 } 759 760 return val; 761 }, 762 763 // higher order templates 764 ho: function(val, cx, partials, text, tags) { 765 var compiler = this.c; 766 var options = this.options; 767 options.delimiters = tags; 768 var text = val.call(cx, text); 769 text = (text == null) ? String(text) : text.toString(); 770 this.b(compiler.compile(text, options).render(cx, partials)); 771 return false; 772 }, 773 774 // template result buffering 775 b: (useArrayBuffer) ? function(s) { this.buf.push(s); } : 776 function(s) { this.buf += s; }, 777 fl: (useArrayBuffer) ? function() { var r = this.buf.join(''); this.buf = []; return r; } : 778 function() { var r = this.buf; this.buf = ''; return r; }, 779 780 // lambda replace section 781 ls: function(val, ctx, partials, inverted, start, end, tags) { 782 var cx = ctx[ctx.length - 1], 783 t = null; 784 785 if (!inverted && this.c && val.length > 0) { 786 return this.ho(val, cx, partials, this.text.substring(start, end), tags); 787 } 788 789 t = val.call(cx); 790 791 if (typeof t == 'function') { 792 if (inverted) { 793 return true; 794 } else if (this.c) { 795 return this.ho(t, cx, partials, this.text.substring(start, end), tags); 796 } 797 } 798 799 return t; 800 }, 801 802 // lambda replace variable 803 lv: function(val, ctx, partials) { 804 var cx = ctx[ctx.length - 1]; 805 var result = val.call(cx); 806 807 if (typeof result == 'function') { 808 result = coerceToString(result.call(cx)); 809 if (this.c && ~result.indexOf("{\u007B")) { 810 return this.c.compile(result, this.options).render(cx, partials); 811 } 812 } 813 814 return coerceToString(result); 815 } 816 817 }; 818 819 var rAmp = /&/g, 820 rLt = /</g, 821 rGt = />/g, 822 rApos =/\'/g, 823 rQuot = /\"/g, 824 hChars =/[&<>\"\']/; 825 826 827 function coerceToString(val) { 828 return String((val === null || val === undefined) ? '' : val); 829 } 830 831 function hoganEscape(str) { 832 str = coerceToString(str); 833 return hChars.test(str) ? 834 str 835 .replace(rAmp,'&') 836 .replace(rLt,'<') 837 .replace(rGt,'>') 838 .replace(rApos,''') 839 .replace(rQuot, '"') : 840 str; 841 } 842 843 var isArray = Array.isArray || function(a) { 844 return Object.prototype.toString.call(a) === '[object Array]'; 845 }; 846 847})(typeof exports !== 'undefined' ? exports : Hogan); 848 849 850 851 852(function (Hogan) { 853 // Setup regex assignments 854 // remove whitespace according to Mustache spec 855 var rIsWhitespace = /\S/, 856 rQuot = /\"/g, 857 rNewline = /\n/g, 858 rCr = /\r/g, 859 rSlash = /\\/g, 860 tagTypes = { 861 '#': 1, '^': 2, '/': 3, '!': 4, '>': 5, 862 '<': 6, '=': 7, '_v': 8, '{': 9, '&': 10 863 }; 864 865 Hogan.scan = function scan(text, delimiters) { 866 var len = text.length, 867 IN_TEXT = 0, 868 IN_TAG_TYPE = 1, 869 IN_TAG = 2, 870 state = IN_TEXT, 871 tagType = null, 872 tag = null, 873 buf = '', 874 tokens = [], 875 seenTag = false, 876 i = 0, 877 lineStart = 0, 878 otag = '{{', 879 ctag = '}}'; 880 881 function addBuf() { 882 if (buf.length > 0) { 883 tokens.push(new String(buf)); 884 buf = ''; 885 } 886 } 887 888 function lineIsWhitespace() { 889 var isAllWhitespace = true; 890 for (var j = lineStart; j < tokens.length; j++) { 891 isAllWhitespace = 892 (tokens[j].tag && tagTypes[tokens[j].tag] < tagTypes['_v']) || 893 (!tokens[j].tag && tokens[j].match(rIsWhitespace) === null); 894 if (!isAllWhitespace) { 895 return false; 896 } 897 } 898 899 return isAllWhitespace; 900 } 901 902 function filterLine(haveSeenTag, noNewLine) { 903 addBuf(); 904 905 if (haveSeenTag && lineIsWhitespace()) { 906 for (var j = lineStart, next; j < tokens.length; j++) { 907 if (!tokens[j].tag) { 908 if ((next = tokens[j+1]) && next.tag == '>') { 909 // set indent to token value 910 next.indent = tokens[j].toString() 911 } 912 tokens.splice(j, 1); 913 } 914 } 915 } else if (!noNewLine) { 916 tokens.push({tag:'\n'}); 917 } 918 919 seenTag = false; 920 lineStart = tokens.length; 921 } 922 923 function changeDelimiters(text, index) { 924 var close = '=' + ctag, 925 closeIndex = text.indexOf(close, index), 926 delimiters = trim( 927 text.substring(text.indexOf('=', index) + 1, closeIndex) 928 ).split(' '); 929 930 otag = delimiters[0]; 931 ctag = delimiters[1]; 932 933 return closeIndex + close.length - 1; 934 } 935 936 if (delimiters) { 937 delimiters = delimiters.split(' '); 938 otag = delimiters[0]; 939 ctag = delimiters[1]; 940 } 941 942 for (i = 0; i < len; i++) { 943 if (state == IN_TEXT) { 944 if (tagChange(otag, text, i)) { 945 --i; 946 addBuf(); 947 state = IN_TAG_TYPE; 948 } else { 949 if (text.charAt(i) == '\n') { 950 filterLine(seenTag); 951 } else { 952 buf += text.charAt(i); 953 } 954 } 955 } else if (state == IN_TAG_TYPE) { 956 i += otag.length - 1; 957 tag = tagTypes[text.charAt(i + 1)]; 958 tagType = tag ? text.charAt(i + 1) : '_v'; 959 if (tagType == '=') { 960 i = changeDelimiters(text, i); 961 state = IN_TEXT; 962 } else { 963 if (tag) { 964 i++; 965 } 966 state = IN_TAG; 967 } 968 seenTag = i; 969 } else { 970 if (tagChange(ctag, text, i)) { 971 tokens.push({tag: tagType, n: trim(buf), otag: otag, ctag: ctag, 972 i: (tagType == '/') ? seenTag - ctag.length : i + otag.length}); 973 buf = ''; 974 i += ctag.length - 1; 975 state = IN_TEXT; 976 if (tagType == '{') { 977 if (ctag == '}}') { 978 i++; 979 } else { 980 cleanTripleStache(tokens[tokens.length - 1]); 981 } 982 } 983 } else { 984 buf += text.charAt(i); 985 } 986 } 987 } 988 989 filterLine(seenTag, true); 990 991 return tokens; 992 } 993 994 function cleanTripleStache(token) { 995 if (token.n.substr(token.n.length - 1) === '}') { 996 token.n = token.n.substring(0, token.n.length - 1); 997 } 998 } 999 1000 function trim(s) { 1001 if (s.trim) { 1002 return s.trim(); 1003 } 1004 1005 return s.replace(/^\s*|\s*$/g, ''); 1006 } 1007 1008 function tagChange(tag, text, index) { 1009 if (text.charAt(index) != tag.charAt(0)) { 1010 return false; 1011 } 1012 1013 for (var i = 1, l = tag.length; i < l; i++) { 1014 if (text.charAt(index + i) != tag.charAt(i)) { 1015 return false; 1016 } 1017 } 1018 1019 return true; 1020 } 1021 1022 function buildTree(tokens, kind, stack, customTags) { 1023 var instructions = [], 1024 opener = null, 1025 token = null; 1026 1027 while (tokens.length > 0) { 1028 token = tokens.shift(); 1029 if (token.tag == '#' || token.tag == '^' || isOpener(token, customTags)) { 1030 stack.push(token); 1031 token.nodes = buildTree(tokens, token.tag, stack, customTags); 1032 instructions.push(token); 1033 } else if (token.tag == '/') { 1034 if (stack.length === 0) { 1035 throw new Error('Closing tag without opener: /' + token.n); 1036 } 1037 opener = stack.pop(); 1038 if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { 1039 throw new Error('Nesting error: ' + opener.n + ' vs. ' + token.n); 1040 } 1041 opener.end = token.i; 1042 return instructions; 1043 } else { 1044 instructions.push(token); 1045 } 1046 } 1047 1048 if (stack.length > 0) { 1049 throw new Error('missing closing tag: ' + stack.pop().n); 1050 } 1051 1052 return instructions; 1053 } 1054 1055 function isOpener(token, tags) { 1056 for (var i = 0, l = tags.length; i < l; i++) { 1057 if (tags[i].o == token.n) { 1058 token.tag = '#'; 1059 return true; 1060 } 1061 } 1062 } 1063 1064 function isCloser(close, open, tags) { 1065 for (var i = 0, l = tags.length; i < l; i++) { 1066 if (tags[i].c == close && tags[i].o == open) { 1067 return true; 1068 } 1069 } 1070 } 1071 1072 Hogan.generate = function (tree, text, options) { 1073 var code = 'var _=this;_.b(i=i||"");' + walk(tree) + 'return _.fl();'; 1074 if (options.asString) { 1075 return 'function(c,p,i){' + code + ';}'; 1076 } 1077 1078 return new Hogan.Template(new Function('c', 'p', 'i', code), text, Hogan, options); 1079 } 1080 1081 function esc(s) { 1082 return s.replace(rSlash, '\\\\') 1083 .replace(rQuot, '\\\"') 1084 .replace(rNewline, '\\n') 1085 .replace(rCr, '\\r'); 1086 } 1087 1088 function chooseMethod(s) { 1089 return (~s.indexOf('.')) ? 'd' : 'f'; 1090 } 1091 1092 function walk(tree) { 1093 var code = ''; 1094 for (var i = 0, l = tree.length; i < l; i++) { 1095 var tag = tree[i].tag; 1096 if (tag == '#') { 1097 code += section(tree[i].nodes, tree[i].n, chooseMethod(tree[i].n), 1098 tree[i].i, tree[i].end, tree[i].otag + " " + tree[i].ctag); 1099 } else if (tag == '^') { 1100 code += invertedSection(tree[i].nodes, tree[i].n, 1101 chooseMethod(tree[i].n)); 1102 } else if (tag == '<' || tag == '>') { 1103 code += partial(tree[i]); 1104 } else if (tag == '{' || tag == '&') { 1105 code += tripleStache(tree[i].n, chooseMethod(tree[i].n)); 1106 } else if (tag == '\n') { 1107 code += text('"\\n"' + (tree.length-1 == i ? '' : ' + i')); 1108 } else if (tag == '_v') { 1109 code += variable(tree[i].n, chooseMethod(tree[i].n)); 1110 } else if (tag === undefined) { 1111 code += text('"' + esc(tree[i]) + '"'); 1112 } 1113 } 1114 return code; 1115 } 1116 1117 function section(nodes, id, method, start, end, tags) { 1118 return 'if(_.s(_.' + method + '("' + esc(id) + '",c,p,1),' + 1119 'c,p,0,' + start + ',' + end + ',"' + tags + '")){' + 1120 '_.rs(c,p,' + 1121 'function(c,p,_){' + 1122 walk(nodes) + 1123 '});c.pop();}'; 1124 } 1125 1126 function invertedSection(nodes, id, method) { 1127 return 'if(!_.s(_.' + method + '("' + esc(id) + '",c,p,1),c,p,1,0,0,"")){' + 1128 walk(nodes) + 1129 '};'; 1130 } 1131 1132 function partial(tok) { 1133 return '_.b(_.rp("' + esc(tok.n) + '",c,p,"' + (tok.indent || '') + '"));'; 1134 } 1135 1136 function tripleStache(id, method) { 1137 return '_.b(_.t(_.' + method + '("' + esc(id) + '",c,p,0)));'; 1138 } 1139 1140 function variable(id, method) { 1141 return '_.b(_.v(_.' + method + '("' + esc(id) + '",c,p,0)));'; 1142 } 1143 1144 function text(id) { 1145 return '_.b(' + id + ');'; 1146 } 1147 1148 Hogan.parse = function(tokens, text, options) { 1149 options = options || {}; 1150 return buildTree(tokens, '', [], options.sectionTags || []); 1151 }, 1152 1153 Hogan.cache = {}; 1154 1155 Hogan.compile = function(text, options) { 1156 // options 1157 // 1158 // asString: false (default) 1159 // 1160 // sectionTags: [{o: '_foo', c: 'foo'}] 1161 // An array of object with o and c fields that indicate names for custom 1162 // section tags. The example above allows parsing of {{_foo}}{{/foo}}. 1163 // 1164 // delimiters: A string that overrides the default delimiters. 1165 // Example: "<% %>" 1166 // 1167 options = options || {}; 1168 1169 var key = text + '||' + !!options.asString; 1170 1171 var t = this.cache[key]; 1172 1173 if (t) { 1174 return t; 1175 } 1176 1177 t = this.generate(this.parse(this.scan(text, options.delimiters), text, options), text, options); 1178 return this.cache[key] = t; 1179 }; 1180})(typeof exports !== 'undefined' ? exports : Hogan); 1181
1182 1183if (typeof define === 'function' && define.amd) { 1184 define('hogan',Hogan); 1185} 1186; 1187/*! Tiny Pub/Sub - v0.7.0 - 2013-01-29 1188* https://github.com/cowboy/jquery-tiny-pubsub 1189* Copyright (c) 2013 "Cowboy" Ben Alman; Licensed MIT */ 1190(function(n){var u=n({});n.subscribe=function(){u.on.apply(u,arguments)},n.unsubscribe=function(){u.off.apply(u,arguments)},n.publish=function(){u.trigger.apply(u,arguments)}})(jQuery); 1191define("pubSub", ["jquery"], function(){}); 1192 1193 define('app',['service', 'notifications', 'hogan', 'pubSub'], function(service, NOTIFICATIONS) { 1194 'use strict'; 1195 1196 var _modal = function(options) { 1197 var _contentType, 1198 fallbackMessage, 1199 errorMsg = '<div class="modal-container clearfix" style="width:100%;"><div class="content-1"><div class="modal-header error"><div class="modal-header-content"><p>Error</p></div></div><div class="modal-message"><p class="error-message-container col-md-5"> Something went wrong <br></p></div></div><div class="button-set "><a href="javascript:$.fancybox.close(true)" target="_top" title="OK" class="button small-orange"> OK</a></div></div>';; 1200 1201 // just assigning the force message is options to a var. forceMsg will generally come from the airjax ajax request 1202 if(options.forceMsg){ 1203 fallbackMessage = options.forceMsg; 1204 } 1205 else{ 1206 fallbackMessage = 'none'; 1207 } 1208 1209 _contentType = options.contentType || 'html'; 1210 // if there's an error. force this error content 1211 if (options.forceMsg === 'error') { 1212 options.afterLoad = function content() { 1213 this.content = $('<div> />').html(errorMsg); 1214 }; 1215 } 1216 else if (_contentType === 'json') { 1217 options.afterLoad = function content() { 1218 this.content = $.parseJSON(this.content).content; // This assumes a standard JSON structure for the ARG project 1219 this.content = $('<div> />').html(this.content).text(); 1220 }; 1221 } 1222 1223 this.open = function open() { 1224 // invoke plugin w/ options 1225 $.fancybox.open({src: options.content, type: options.type, 1226 opts : { 1227 afterShow : function() { 1228 Custom.init(); 1229 if($('.fancybox-content').is(':visible')) { 1230 $.publish(NOTIFICATIONS.HANDLE_MODAL_ELEMENTS_TABFOCUS); 1231 } 1232 $('select').selectBoxIt(); 1233 }, 1234 afterClose: function() { 1235 $.publish(NOTIFICATIONS.HANDLE_MODAL_CLOSE_CLICK); 1236 } 1237 } 1238 }); 1239 }; 1240 1241 return this; 1242 }; 1243 $(document).on("afterClose.fb", function(e, instance, current) { 1244 if ($('.ez-gaz-details').length === 0) { 1245 $.publish(NOTIFICATIONS.HANDLE_MODAL_CLOSE_CLICK); 1246 } 1247 }); 1248 /** 1249 * Luhn validation for credit card numbers; takes the form field value and returns true on valid number 1250 * @param value - string of CC number 1251 * @return {boolean} - valid or not valid 1252 */ 1253 var _validateLuhn = function validateLuhn(value) { 1254 // http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers#JavaScript 1255 var luhnArr = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9], 1256 counter = 0, 1257 incNum, 1258 odd = false, 1259 temp = String(value).replace(/[^\d]/g, ''); 1260 1261 if ( temp.length == 0) 1262 { 1263 return false; 1264 } 1265 1266 for (var i = temp.length-1; i >= 0; --i) 1267 { 1268 incNum = parseInt(temp.charAt(i), 10); 1269 counter += (odd = !odd)? incNum : luhnArr[incNum]; 1270 } 1271 1272 return (counter % 10 == 0); 1273 }; 1274 /** 1275 * Validate credit card number string against regex map for credit card types. 1276 * @param regex - regex pattern to test against 1277 * @param value - credit card number string 1278 * @return {*} 1279 */ 1280 var _validateCardType = function validateCardType(regex, value) { 1281 return regex.test(value); 1282 }; 1283 /** 1284 * Validate credit card expiration 1285 * @param value 1286 * @return {boolean} 1287 * @private 1288 */ 1289 var _validateCardExpiration = function _validateCardExpiration(value) { 1290 1291 function normalizeYear(year){ 1292 // Century fix 1293 var YEARS_AHEAD = 20; 1294 if (year<100){ 1295 var nowYear = new Date().getFullYear(); 1296 year += Math.floor(nowYear/100)*100; 1297 if (year > nowYear + YEARS_AHEAD){ 1298 year -= 100; 1299 } else if (year <= nowYear - 100 + YEARS_AHEAD) { 1300 year += 100; 1301 } 1302 } 1303 return year; 1304 } 1305 1306 var currMonth, 1307 exp, 1308 match, 1309 now; 1310 1311 match = value.match(/^\s*(0?[1-9]|1[0-2])\/(\d\d|\d{4})\s*$/); 1312 1313 // if expiration value is not the correct format fail 1314 if(!match) { 1315 return false;
1316 } 1317 1318 exp = new Date(normalizeYear(1*match[2]),1*match[1]-1,1).valueOf(); 1319 1320 now = new Date(); 1321 1322 currMonth = new Date(now.getFullYear(),now.getMonth(),1).valueOf(); 1323 1324 return (exp <= currMonth); 1325 }; 1326 1327 return { 1328 /** 1329 * Uniformed AJAX object for the app. 1330 * @param serviceName - definition defined in service module 1331 * @return {*} - object to define options for ajax 1332 */ 1333 airjax: function(serviceName, fromJsModal, fancyboxOptions, serviceDetails, modalDisplay) { 1334 var _cache = false, 1335 _contentType = fancyboxOptions !== undefined? fancyboxOptions.contentType === 'json'? 'json' : 'html' : 'application/x-www-form-urlencoded; charset=UTF-8', 1336 _dataType = fromJsModal !== undefined ? fancyboxOptions.contentType === 'json'? 'json' : 'html': 'json', 1337 _errorCallback, 1338 _requestParams = {}, 1339 _successCallback, 1340 _method = 'post', 1341 _url, 1342 _responseContent; 1343 1344 if (serviceName) { 1345 _url = service[serviceName].url; 1346 _method = service[serviceName].method; 1347 } else if(service) { 1348 _url = serviceDetails.url; 1349 _method = serviceDetails.method; 1350 }else { 1351 console.warn('AIRJAX ERROR: No Service Defined!'); 1352 } 1353 1354 _successCallback = function success(data, status, jqXHR) { 1355 if(fromJsModal) { 1356 if(data.content !== undefined) { 1357 _responseContent = data.content; 1358 _responseContent = $('<div> />').html(_responseContent).text(); 1359 } else { 1360 try { 1361 _responseContent = $.parseJSON(data).content; 1362 // This assumes a standard JSON structure for the ARG project 1363 _responseContent = $('<div> />').html(_responseContent).text(); 1364 } catch(e) { 1365 _responseContent = data; 1366 } 1367 } 1368 1369 // Use fancyboxoptions as required here so passing this as param from handlemodaldisplay 1370 $.fancybox.open({ 1371 src: _responseContent, 1372 type: 'html', 1373 opts: $.extend({ 1374 afterShow: function(){ 1375 Custom.init(); 1376 $("select").selectBoxIt(); 1377 $.proxy(this.handleZebraDisplay, this); 1378 modalDisplay(); 1379 $.publish(NOTIFICATIONS.CONTROLLER_REFRESH); 1380 $.publish(NOTIFICATIONS.HANDLE_STORE_PICKUP_CLICK); 1381 if($('.fancybox-content').is(':visible')) { 1382 $.publish(NOTIFICATIONS.HANDLE_MODAL_ELEMENTS_TABFOCUS); 1383 } 1384 if(location.pathname.includes('paypartialdetail') || location.pathname.includes('paypartialmobiledetail')){ 1385 $('select').selectBoxIt('refresh'); 1386 } 1387 $('.only-spin').hide(); 1388 if($('.requisitions-action-modal').length > 0){ 1389 $.publish(NOTIFICATIONS.HANDLE_REQUISITION_ACTIONS); 1390 } 1391 }, 1392 afterClose: function() { 1393 $.publish(NOTIFICATIONS.HANDLE_MODAL_CLOSE_CLICK); 1394 } 1395 }, fancyboxOptions) 1396 }); 1397 1398 } 1399 }; 1400 1401 _errorCallback = function error(jqXHR, status, errorThrown){ 1402 //console.log('airjax error', jqXHR, status, errorThrown); 1403 // return jqXHR, status, errorThrown 1404 // var errModal = new _modal({'forceMsg':'error'}); 1405 // close spinner when 302 1406 var errorMsg = '<div class="modal-container clearfix" style="width:100%;"><div class="content-1"><div class="modal-header error"><div class="modal-header-content"><p>Error</p></div></div><div class="modal-message"><p class="error-message-container col-md-5"> Something went wrong <br></p></div></div><div class="button-set "><a href="javascript:$.fancybox.close(true)" target="_top" title="OK" class="button small-orange">
1406 OK</a></div></div>';; 1407 if($('.spin-overlay').is(':visible')) { 1408 $('.spin-overlay').hide(); 1409 } else if($('.only-spin').is(':visible')) { 1410 $('.only-spin').hide(); 1411 } else if($('.arg-spinner').is(':visible')) { 1412 $('.arg-spinner').hide(); 1413 } 1414 //errModal.open(); 1415 $.fancybox.open({ 1416 src: errorMsg , 1417 type: 'html', 1418 opts: $.extend({ 1419 afterShow: function(){ 1420 Custom.init(); 1421 $("select").selectBoxIt(); 1422 $.proxy(this.handleZebraDisplay, this); 1423 modalDisplay(); 1424 if($('.fancybox-content').is(':visible')) { 1425 $.publish(NOTIFICATIONS.HANDLE_MODAL_ELEMENTS_TABFOCUS); 1426 } 1427 $('.only-spin').hide(); 1428 } 1429 }, fancyboxOptions) 1430 }); 1431 }; 1432 1433 this.url = function(url) { 1434 if(typeof url !== 'undefined') { 1435 _url = url; 1436 } 1437 return _url; 1438 }; 1439 1440 this.method = function(method) { 1441 if(typeof method !== 'undefined') { 1442 _method = method; 1443 } 1444 return _method; 1445 }; 1446 1447 this.dataType = function(dataType) { 1448 if(typeof dataType !== 'undefined') { 1449 _dataType = dataType; 1450 } 1451 return _dataType; 1452 }; 1453 1454 this.contentType = function(contentType) { 1455 if(typeof contentType !== 'undefined') { 1456 _contentType = contentType; 1457 } 1458 return _contentType; 1459 }; 1460 1461 this.cache = function(cache) { 1462 if(typeof cache !== 'undefined') { 1463 _cache = cache; 1464 } 1465 return _cache; 1466 }; 1467 1468 this.requestParams = function(requestParams) { 1469 if(typeof requestParams !== 'undefined') { 1470 if(requestParams instanceof jQuery && requestParams[0].nodeName.toUpperCase() === "FORM") { 1471 _requestParams = requestParams.serialize(); 1472 } else { 1473 _requestParams = requestParams; 1474 } 1475 } 1476 return _requestParams; 1477 }; 1478 1479 this.successCallback = function(successCallback) { 1480 if(typeof successCallback !== 'undefined') { 1481 _successCallback = function success(data, status, jqXHR) { 1482 //console.log('airjax success', data); 1483 successCallback(data); 1484 }; 1485 // successCallback(data, status, jqXHR); 1486 } 1487 return _successCallback; 1488 }; 1489 1490 this.errorCallback = function(errorCallback) { 1491 if(typeof errorCallback !== 'undefined') { 1492 _errorCallback = function error(jqXHR, status, errorThrown){ 1493 //console.log('airjax error', jqXHR); 1494 errorCallback(); 1495 }; 1496 } 1497 return _errorCallback; 1498 }; 1499 1500 this.executeRequest = function() { 1501 $.ajax({ 1502 url: _url, 1503 type: _method, 1504 dataType: _dataType, 1505 contentType: _contentType, 1506 cache: _cache, 1507 headers : { "cache-control": "no-cache" }, 1508 data: _requestParams, 1509 success: _successCallback, 1510 error: _errorCallback 1511 }); 1512 } 1513 1514 return this; 1515 }, 1516 1517 modal: _modal, 1518 1519 handleOffCanvas: function() { 1520 1521 // add an event to all elements with the [data-toggle=offcanvas] to open 1522 $('[data-toggle="offcanvas"]').on('click', toggleCanvas); 1523 1524 function toggleCanvas(e) { 1525 var current = $(e.currentTarget); 1526 1527 e.stopPropagation(); 1528 1529 if($('.container').hasClass('mobile-canvas-active')) { 1530 // close it 1531 closeCanvas() 1532 } else { 1533 // open it 1534 openCanvas() 1535 } 1536 } 1537 1538 function openCanvas() { 1539 $('.container').addClass('mobile-canvas-active').on('click', closeCanvas); 1540 $('.mobile-canvas').addClass('mobile-canvas-active'); 1541 $('body').addClass('mobile-canvas-active'); 1542 $('html').addClass('mobile-canvas-active'); 1543 } 1544 1545 function closeCanvas() { 1546 $('.container').removeClass('mobile-canvas-active').off(); 1547 $('.mobile-canvas').removeClass('mobile-canvas-active'); 1548 $('body').removeClass('mobile-canvas-active'); 1549 $('html').removeClass('mobile-canvas-active'); 1550 } 1551 1552 }, 1553
1554 win8IE10Fix: function() { 1555 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 1556 var msViewportStyle = document.createElement('style'); 1557 msViewportStyle.appendChild( 1558 document.createTextNode( 1559 '@-ms-viewport{width:auto!important}' 1560 ) 1561 ); 1562 document.getElementsByTagName('head')[0].appendChild(msViewportStyle); 1563 } 1564 }, 1565 1566 placeholder: function(){ 1567 function add() { 1568 if($(this).val() === ''){ 1569 $(this).val($(this).attr('placeholder')).addClass('placeholder'); 1570 } 1571 } 1572 function remove() { 1573 if($(this).val() === $(this).attr('placeholder')){ 1574 $(this).val('').removeClass('placeholder'); 1575 } 1576 } 1577 1578 if (!Modernizr.input.placeholder) { 1579 // provide placeholder text in IE 1580 if (!('placeholder' in $('<input>')[0])) { 1581 $('input[placeholder], textarea[placeholder]').blur(add).focus(remove).each(add); 1582 $('form').submit(function(){ 1583 $(this).find('input[placeholder], textarea[placeholder]').each(remove); 1584 }); 1585 } 1586 1587 }; 1588 1589 }, 1590 1591 handleZebraDisplay: function() { 1592 /* Alternating rows within a list */ 1593 $('[data-zebra]').each(function(){ 1594 var target = $(this).attr('data-zebra'), 1595 targetcount = target.split(',').length, 1596 n = 0, 1597 row = 0; 1598 1599 $(this).find(target).each(function(){ 1600 if (n % targetcount == 0) { 1601 row++; 1602 } 1603 (row%2) == 0 ? $(this).addClass('odd') : $(this).addClass('even'); 1604 n++; 1605 }); 1606 }); 1607 $.fancybox.defaults.autoFocus = false; 1608 if($('.fancybox-content').is(':visible')) { 1609 $.publish(NOTIFICATIONS.HANDLE_MODAL_ELEMENTS_TABFOCUS); 1610 } 1611 }, 1612 /** 1613 * DEPRECATED method to handle primary navigation 1614 */ 1615 handleNavigationPrimary: function() { 1616 // cache the trigger elements in the navigation 1617 var triggers = $('.navigation-primary .trigger'); 1618 1619 // attach a click event on to handle the display of the mega menu 1620 triggers.on("click", handleMenuDisplay); 1621 1622 // FMC-539 attach event click handler to the window to close open menus. Reused phase 1 handler and added mobile event. 1623 // whoa. :visible checks if height and width are 0px 1624 $(window).on('click touchend', function(e){ 1625 if ($('.mega-menu-container').is(':visible') && (!$(e.target).parents('.navigation-primary').length) ) { 1626 $('.mega-menu-container').removeClass('visible'); 1627 } 1628 }); 1629 1630 // on click of a trigger close all menus and open the menu that appears for the menu 1631 function handleMenuDisplay(e) { 1632 e.preventDefault(); 1633 e.stopPropagation(); 1634 1635 var arrow, 1636 arrowOffset, 1637 menuOffset, 1638 currentTarget, 1639 menu, 1640 menus, 1641 widthOfDropdown = 210, 1642 widthOfArrow = 20; //0 from css arrow 1643 1644 // cache the current anchor element that was clicked. 1645 currentTarget = $(e.currentTarget); 1646 1647 // offset the arrow - changing this to outerWidth to take in account border and padding 1648 arrowOffset = currentTarget.position().left + (currentTarget.outerWidth()/2) - (widthOfArrow/2); 1649 // for admin pages, the positions of the drop downs are different. let's give drop down a fixed width and center it within the target menu item 1650 menuOffset = currentTarget.position().left + ((currentTarget.outerWidth()/2) - (widthOfDropdown/2)); 1651
1652 // assume the sibling element next to the anchor element is the menu 1653 menu = currentTarget.next(); 1654 1655 // assume the arrow is the first child element in the menu container 1656 arrow = menu.children(".arrow"); 1657 1658 // position the arrow 1659 arrow.css("left", arrowOffset); 1660 1661 // position the menu if it's an admin page, and redo the css of the arrow (relative position left not needed anymore) 1662 if($('body').hasClass('admin')){ 1663 1664 // conditional for menu on the far right - this must be a hard coded style in the html. so we don't have the dropdown go off-canvas 1665 if ( currentTarget.hasClass('nav-link-right') ){ 1666 $('.mega-menu-container').css({'left':'auto','right':'0'}); 1667 arrow.css("left", arrowOffset - (widthOfDropdown/2)); 1668 } 1669 else{ 1670 arrow.css({"margin-left":"auto","margin-right":"auto","left":"auto"}); 1671 $('.mega-menu-container').css('left',menuOffset); 1672 } 1673 } 1674 else{ // if it's not an admin page - just do as we've always done 1675 arrow.css("left", arrowOffset); 1676 } 1677 1678 if(menu.is(":visible")){ 1679 // close the menu 1680 hideAllMenus(null, null); 1681 } else { 1682 // close all menus but open the current menu 1683 hideAllMenus(openMenu, menu); 1684 } 1685 1686 function openMenu(menu) { 1687 menu.addClass("visible"); 1688 // this adds subtle animation to admin drop down. we've set css transitions in the styles 1689 function onShow(){ 1690 setTimeout(function(){ arrow.css({"margin-top":"-10px"}); },0); 1691 } 1692 return onShow(); 1693 } 1694 1695 function hideAllMenus(callback, parameters) { 1696 menus = $(".mega-menu-container"); 1697 //reest the arrow for animation 1698 arrow.css({"margin-top":"-6px"}); 1699 1700 $.each(menus, function(index, value) { 1701 $(value).removeClass("visible"); 1702 }); 1703 1704 if(callback) { 1705 if(parameters) { 1706 callback(parameters); 1707 } else { 1708 callback(); 1709 } 1710 } 1711 } 1712 } 1713 }, 1714 1715 handleModalDisplay: function() { 1716 1717 var zebra = $.proxy(this.handleZebraDisplay, this), 1718 gaModalTrack = $.proxy(this.ga.eventModal, this),// set this guy up in here for analytics. fire inside fancyb with $gaHref arg. 1719 modalDisplay = $.proxy(this.handleModalDisplay, this), // Added this self func call to handle the js-modal clicks inside modal when modal is opened. 1720 airjaxService = $.proxy(this.airjax, this); 1721 1722 // find all elements with class 'js-modal' and attach click event handler 1723 $('.js-modal').on('click',function(e) { 1724 // prevent default event handling 1725 e.preventDefault(); 1726 e.stopPropagation(); 1727 e.stopImmediatePropagation(); 1728 $('.only-spin').show(); 1729 // declare variables 1730 var $elem, 1731 $gaHref, 1732 options, 1733 serviceDetails, 1734 $opts, 1735 errorMsg, 1736 fromJsModal = true, 1737 airjaxServiceObj; 1738 1739 // cache the current element 1740 $elem = $(e.currentTarget); 1741 $.publish(NOTIFICATIONS.HANDLE_MODAL_PREVIOUS_ELEMENT, $elem); 1742 if($elem.hasClass('change-Package') && location.pathname.includes('search') ){ 1743 $.publish(NOTIFICATIONS.HANDLE_CURRENT_CHANGE_PACKAGE_SIZE_QUANTITY, $elem); 1744 1745 } 1746 $gaHref = $elem.attr('href') || 'nohref'; 1747 //TODO - Update DOM Structure as per new fancybox content 1748 errorMsg = '<div class="modal-container clearfix" style="width:290px;"><div class="content-1"><div class="modal-header error"><div class="modal-header-content"><p>Error</p></div></div><div class="modal-message"><p class="error-message-container col-md-5"> Not found <br></p></div></div><div class="button-set "><a href="javascript:$.fancybox.close(true)" target="_top" title="OK" class="button small-orange">
1748 OK</a></div></div>'; 1749 serviceDetails = { 1750 'url': encodeURI($gaHref), 1751 'method': 'get' 1752 }; 1753 $opts = $elem.data('options') || {}; 1754 // merge options objects 1755 options = $.extend({ 1756 padding: 0, 1757 href: encodeURI($gaHref), 1758 maxWidth: 700, 1759 autoHeight: true, 1760 type: 'ajax', 1761 autoSize: false, 1762 fitToView: true, 1763 baseTpl: { 1764 error: errorMsg 1765 } 1766 }, $opts); 1767 airjaxServiceObj = airjaxService(false,fromJsModal, $opts, serviceDetails, modalDisplay); 1768 airjaxServiceObj.executeRequest(); 1769 }); 1770 }, 1771 /** 1772 * Black box method to validate credit cards. 1773 * @param regex 1774 * @param value 1775 * @param expiration - string expected "mo/year" i.e. "05/2014" 1776 * @return {boolean} 1777 */ 1778 validateCreditCard: function validateCreditCard(regex, value, expiration) { 1779 var isCardNumberValid, 1780 isCardValid, 1781 hasCardExpired; 1782 console.log(regex, value, expiration); 1783 if(typeof regex === 'undefined' || typeof value === 'undefined' || typeof expiration === 'undefined') { 1784 return false; 1785 } 1786 1787 // default to false 1788 isCardValid = false; 1789 1790 // validate card number against Luhn algorithm 1791 isCardNumberValid = _validateLuhn(value); 1792 1793 // validate card expiration 1794 hasCardExpired = _validateCardExpiration(expiration); 1795 1796 console.log(hasCardExpired); 1797 1798 // validate values 1799 // TODO ADD CHECK FOR CARD EXPIRATION 1800 if(isCardNumberValid && regex) { 1801 // test card number value against regex 1802 isCardValid = _validateCardType(regex, value); 1803 } 1804 1805 return isCardValid; 1806 }, 1807 /** 1808 * Google Analytics method hooks. 1809 */ 1810 ga: { 1811 eventModal: function eventModal(data){ // sending href data to GA on modal open 1812 var arg = data || 'nohref'; 1813 ga('send', 'event', 'category', 'modal', arg); 1814 } 1815 } 1816 }; 1817}); 1818 1819define('gaAmd',['require'],function (require) { 1820 var module; 1821 var trackingId = window.googleAnalyticsTrackingId || 'UA-404149-13', 1822 domainName = window.googleAnalyticsDomainName || 'auto', 1823 managerId = window.googleTagManagerId || 'GTM-PCW2W2'; 1824 1825 // Setup temporary Google Analytics objects. 1826 // window.GoogleAnalyticsObject = 'ga'; 1827 // window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); }; 1828 // window.ga.l = 1 * new Date(); 1829 1830 // Immediately add a pageview event to the queue. 1831 // window.ga('create', trackingId, domainName); 1832 // window.ga('send', 'pageview'); 1833 1834 // Create a function that wraps `window.ga`. 1835 // This allows dependant modules to use `window.ga` without knowingly 1836 // programming against a global object. 1837 // module = function () { window.ga.apply(this, arguments); }; 1838 1839 // Asynchronously load Google Analytics, letting it take over our `window.ga` 1840 // object after it loads. This allows us to add events to `window.ga` even 1841 // before the library has fully loaded. 1842 // require(['//www.google-analytics.com/analytics.js']); 1843 1844 //google tag manager code here 1845 // (function(w,d,s,l,i){ 1846 // w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}); 1847 // var f=d.getElementsByTagName(s)[0], 1848 // j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; 1849 // j.async=true;
1850 // j.src='//www.googletagmanager.com/gtm.js?id='+i+dl; 1851 // f.parentNode.insertBefore(j,f); 1852 //})(window,document,'script','dataLayer',managerId); 1853 1854 return module; 1855 1856}); 1857 1858 1859 1860 1861!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define('moment',t):e.moment=t()}(this,function(){"use strict";var H;function f(){return H.apply(null,arguments)}function a(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function o(e){return void 0===e}function u(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Pt(e,t,n,s,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){if(null==e._isValid){var t=m(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),n=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(n=n&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return n;e._isValid=n}return e._isValid}function I(e){var t=l(NaN);return null!=e?E(m(t),e):m(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=f.momentProperties=[],z=!1;function $(e,t){var n,s,i,r=Z.length;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=m(t)),o(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)o(i=t[s=Z[n]])||(e[s]=i);return e}function q(e){$(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,f.updateOffset(this),z=!1)}function h(e){return e instanceof q||null!=e&&null!=e._isAMomentObject}function B(e){!1===f.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=f.deprecationHandler&&f.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=f.deprecationHandler&&f.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function d(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}f.suppressDeprecationWarnings=!1,f.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}
1861|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=d(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={};function t(e,t){var n=e.toLowerCase();oe[n]=oe[n+"s"]=oe[t]=e}function _(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=_(n))&&(s[t]=e[n]);return s}var le={};function n(e,t){le[e]=t}function he(e){return e%4==0&&e%100!=0||e%400==0}function y(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function g(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?y(e):t}function de(t,n){return function(e){return null!=e?(fe(this,t,e),f.updateOffset(this,n),this):ce(this,t)}}function ce(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function fe(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&he(e.year())&&1===e.month()&&29===e.date()?(n=g(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),We(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var i=/\d/,w=/\d\d/,me=/\d{3}/,_e=/\d{4}/,ye=/[+-]?\d{6}/,p=/\d\d?/,ge=/\d\d\d\d?/,we=/\d\d\d\d\d\d?/,pe=/\d{1,3}/,ke=/\d{1,4}/,ve=/[+-]?\d{1,6}/,Me=/\d+/,De=/[+-]?\d+/,Se=/Z|[+-]\d\d:?\d\d/gi,Ye=/Z|[+-]\d\d(?::?\d\d)?/gi,k=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function v(e,n,s){be[e]=d(n)?n:function(e,t){return e&&s?s:n}}function Oe(e,t){return c(be,e)?be[e](t._strict,t._locale):new RegExp(M(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function M(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var be={},xe={};function D(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),u(n)&&(i=function(e,t){t[n]=g(e)}),s=e.length,t=0;t<s;t++)xe[e[t]]=i}function Te(e,i){D(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}var S,Y=0,O=1,b=2,x=3,T=4,N=5,Ne=6,Pe=7,Re=8;function We(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=(t%(n=12)+n)%n;return e+=(t-n)/12,1==n?he(e)?29:28:31-n%7%2}S=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),t("month","M"),n("month",8),v("M",p),v("MM",p,w),v("MMM",function(e,t){return t.monthsShortRegex(e)}),v("MMMM",function(e,t){return t.monthsRegex(e)}),D(["M","MM"],function(e,t){t[O]=g(e)-1}),D(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[O]=s:m(n).invalidMonth=e});var Ce="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ue="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),He=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Fe=k,Le=k;function Ve(e,t){var n;if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=g(t);else if(!u(t=e.localeData().monthsParse(t)))return;n=Math.min(e.date(),We(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n)}}function Ge(e){return null!=e?(Ve(this,e),f.updateOffset(this,!0),this):ce(this,"Month")}function Ee(){function e(e,t){return t.length-e.length}for(var t,n=[],s=[],i=[],r=0;r<12;r++)t=l([2e3,r]),n.push(this.monthsShort(t,"")),s.push(this.months(t,"")),i.push(this.months(t,"")),i.push(this.monthsShort(t,""));for(n.sort(e),s.sort(e),i.sort(e),r=0;r<12;r++)n[r]=M(n[r]),s[r]=M(s[r]);for(r=0;r<24;r++)i[r]=M(i[r]);this._monthsRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function Ae(e){return he(e)?366:365}s("Y",0,0,function(){var e=this.year();
vendor: 36,992 bytes, line 1861
1861return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),t("year","y"),n("year",1),v("Y",De),v("YY",p,w),v("YYYY",ke,_e),v("YYYYY",ve,ye),v("YYYYYY",ve,ye),D(["YYYYY","YYYYYY"],Y),D("YYYY",function(e,t){t[Y]=2===e.length?f.parseTwoDigitYear(e):g(e)}),D("YY",function(e,t){t[Y]=f.parseTwoDigitYear(e)}),D("Y",function(e,t){t[Y]=parseInt(e,10)}),f.parseTwoDigitYear=function(e){return g(e)+(68<g(e)?1900:2e3)};var Ie=de("FullYear",!0);function je(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function Ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ze(e,t,n){n=7+t-n;return n-(7+Ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+ze(e,s,i),n=t<=0?Ae(r=e-1)+t:t>Ae(e)?(r=e+1,t-Ae(e)):(r=e,t);return{year:r,dayOfYear:n}}function qe(e,t,n){var s,i,r=ze(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+P(i=e.year()-1,t,n):r>P(e.year(),t,n)?(s=r-P(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function P(e,t,n){var s=ze(e,t,n),t=ze(e+1,t,n);return(Ae(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),t("week","w"),t("isoWeek","W"),n("week",5),n("isoWeek",5),v("w",p),v("ww",p,w),v("W",p),v("WW",p,w),Te(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=g(e)});function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),t("day","d"),t("weekday","e"),t("isoWeekday","E"),n("day",11),n("weekday",11),n("isoWeekday",11),v("d",p),v("e",p),v("E",p),v("dd",function(e,t){return t.weekdaysMinRegex(e)}),v("ddd",function(e,t){return t.weekdaysShortRegex(e)}),v("dddd",function(e,t){return t.weekdaysRegex(e)}),Te(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:m(n).invalidWeekday=e}),Te(["d","e","E"],function(e,t,n,s){t[s]=g(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=k,et=k,tt=k;function nt(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=M(this.weekdaysMin(s,"")),n=M(this.weekdaysShort(s,"")),s=M(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function st(){return this.hours()%12||12}function it(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,st),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),it("a",!0),it("A",!1),t("hour","h"),n("hour",13),v("a",rt),v("A",rt),v("H",p),v("h",p),v("k",p),v("HH",p,w),v("hh",p,w),v("kk",p,w),v("hmm",ge),v("hmmss",we),v("Hmm",ge),v("Hmmss",we),D(["H","HH"],x),D(["k","kk"],function(e,t,n){e=g(e);t[x]=24===e?0:e}),D(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),D(["h","hh"],function(e,t,n){t[x]=g(e),m(n).bigHour=!0}),D("hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s)),m(n).bigHour=!0}),D("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i)),m(n).bigHour=!0}),D("Hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s))}),D("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i))});k=de("Hours",!0);var at,ot={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:Ue,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Xe,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},R={},ut={};function lt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=lt(e[r]).split("-")).length,n=(n=lt(e[r+1]))?n.split("-"):null;0<t;){if(s=dt(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return at}function dt(t){var e;if(void 0===R[t]&&"undefined"!=typeof module&&module&&module.exports&&null!=t.match("^[^/\\\\]*$"))try{e=at._abbr,require("./locale/"+t),ct(e)}catch(e){R[t]=null}return R[t]}function ct(e,t){return e&&((t=o(t)?mt(e):ft(e,t))?at=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),at._abbr}function ft(e,t){if(null===t)return delete R[e],null;var n,s=ot;if(t.abbr=e,null!=R[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=R[e]._config;else if(null!=t.parentLocale)if(null!=R[t.parentLocale])s=R[t.parentLocale]._config;else{if(null==(n=dt(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;s=n._config}return R[e]=new K(X(s,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),ct(e),R[e]}function mt(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return at;if(!a(e)){if(t=dt(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===m(e).overflow&&(t=t[O]<0||11<t[O]?O:t[b]<1||t[b]>We(t[Y],t[O])?b:t[x]<0||24<t[x]||24===t[x]&&(0!==t[T]||0!==t[N]||0!==t[Ne])?x:t[T]<0||59<t[T]?T:t[N]<0||59<t[N]?N:t[Ne]<0||999<t[Ne]?Ne:-1,m(e)._overflowDayOfYear&&(t<Y||b<t)&&(t=b),m(e)._overflowWeeks&&-1===t&&(t=Pe),m(e)._overflowWeekday&&-1===t&&(t=Re),m(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],vt=/^\/?Date\((-?\d+)/i,Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function St(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(m(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),Tt(e)}else e._isValid=!1}}else e._isValid=!1}function Yt(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Ue.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s,i,r=Mt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));r?(t=Yt(r[4],r[3],r[2],r[5],r[6],r[7]),n=r[1],s=t,i=e,n&&Qe.indexOf(n)!==new Date(s[0],s[1],s[2]).getDay()?(m(i).weekdayMismatch=!0,i._isValid=!1):(e._a=t,e._tzm=(n=r[8],s=r[9],i=r[10],n?Dt[n]:s?0:60*(((n=parseInt(i,10))-(s=n%100))/100)+s),e._d=Ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function xt(e){var t,n,s,i,r,a,o,u,l,h,d,c=[];if(!e._d){for(s=e,i=new Date(f.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[b]&&null==e._a[O]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[Y],qe(W(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(h=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,d=qe(W(),u,l),r=bt(i.gg,s._a[Y],d.year),a=bt(i.w,d.week),null!=i.d?((o=i.d)<0||6<o)&&(h=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(h=!0)):o=u),a<1||a>P(r,u,l)?m(s)._overflowWeeks=!0:null!=h?m(s)._overflowWeekday=!0:(d=$e(r,a,o,u,l),s._a[Y]=d.year,s._dayOfYear=d.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[Y],n[Y]),(e._dayOfYear>Ae(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),h=Ze(i,0,e._dayOfYear),e._a[O]=h.getUTCMonth(),e._a[b]=h.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[x]&&0===e._a[T]&&0===e._a[N]&&0===e._a[Ne]&&(e._nextDay=!0,e._a[x]=0),e._d=(e._useUTC?Ze:je).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[x]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(m(e).weekdayMismatch=!0)}}function Tt(e){if(e._f===f.ISO_8601)St(e);else if(e._f===f.RFC_2822)Ot(e);else{e._a=[],m(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],h=l.length,d=0;d<h;d++)n=l[d],(t=(a.match(Oe(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&m(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?m(e).empty=!1:m(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(xe,s)&&xe[s](i,r._a,r,s)):e._strict&&!t&&m(e).unusedTokens.push(n);m(e).charsLeftOver=o-u,0<a.length&&m(e).unusedInput.push(a),e._a[x]<=12&&!0===m(e).bigHour&&0<e._a[x]&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[x]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[x],e._meridiem),null!==(o=m(e).era)&&(e._a[Y]=e._locale.erasConvertYear(o,e._a[Y])),xt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||mt(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),h(i))return new q(_t(i));if(V(i))e._d=i;else if(a(r))!function(e){var t,n,s,i,r,a,o=!1,u=e._f.length;if(0===u)return m(e).invalidFormat=!0,e._d=new Date(NaN);for(i=0;i<u;i++)r=0,a=!1,t=$({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[i],Tt(t),A(t)&&(a=!0),r=(r+=m(t).charsLeftOver)+10*m(t).unusedTokens.length,m(t).score=r,o?r<s&&(s=r,n=t):(null==s||r<s||a)&&(s=r,n=t,a&&(o=!0));E(e,n||t)}(e);else if(r)Tt(e);else if(o(r=(i=e)._i))i._d=new Date(f.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=vt.exec(n._i))?n._d=new Date(+t[1]):(St(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid&&(delete n._isValid,n._strict?n._isValid=!1:f.createFromInputFallback(n))))):a(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),xt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),xt(t)):u(r)?i._d=new Date(r):f.createFromInputFallback(i);return A(e)||(e._d=null),e}function Pt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||a(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new q(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function W(e,t,n,s){return Pt(e,t,n,s,!1)}f.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),f.ISO_8601=function(){},f.RFC_2822=function(){};ge=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),we=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=W.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Rt(e,t){var n,s;if(!(t=1===t.length&&a(t[0])?t[0]:t).length)return W();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Wt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Wt.length;for(t in e)if(c(e,t)&&(-1===S.call(Wt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Wt[n]]){if(s)return!1;parseFloat(e[Wt[n]])!==g(e[Wt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=mt(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),v("Z",Ye),v("ZZ",Ye),D(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(Ye,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+g(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(h(e)||V(e)?e:W(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),f.updateOffset(t,!1),t):W(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}f.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e,i=null;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:u(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(i=It.exec(e))?(n="-"===i[1]?-1:1,s={y:0,d:g(i[b])*n,h:g(i[x])*n,m:g(i[T])*n,s:g(i[N])*n,ms:g(Ht(1e3*i[Ne]))*n}):(i=jt.exec(e))?(n="-"===i[1]?-1:1,s={y:Zt(i[2],n),M:Zt(i[3],n),w:Zt(i[4],n),d:Zt(i[5],n),h:Zt(i[6],n),m:Zt(i[7],n),s:Zt(i[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(W(s.from),W(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),i=new Ct(s),Ut(e)&&c(e,"_locale")&&(i._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(i._isValid=e._isValid),i}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function $t(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),qt(this,C(e,t),s),this}}function qt(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ve(e,ce(e,"Month")+t*n),r&&fe(e,"Date",ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s&&f.updateOffset(e,r||t))}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Ce=$t(1,"add"),Je=$t(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return h(e)||V(e)||Bt(e)||u(e)||function(t){var e=a(t),n=!1;e&&(n=0===t.filter(function(e){return!u(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){if(e.date()<t.date())return-Qt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months"),t=t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s);return-(n+t)||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=mt(e))&&(this._locale=e),this)}f.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",f.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Xe=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e=[],t=[],n=[],s=[],i=this.eras(),r=0,a=i.length;r<a;++r)t.push(M(i[r].name)),e.push(M(i[r].abbr)),n.push(M(i[r].narrow)),s.push(M(i[r].name)),s.push(M(i[r].abbr)),s.push(M(i[r].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?qe(this,s,i).year:(r=P(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=Ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),v("N",rn),v("NN",rn),v("NNN",rn),v("NNNN",function(e,t){return t.erasNameRegex(e)}),v("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),D(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?m(n).era=s:m(n).invalidEra=e}),v("y",Me),v("yy",Me),v("yyy",Me),v("yyyy",Me),v("yo",function(e,t){return t._eraYearOrdinalRegex||Me}),D(["y","yy","yyy","yyyy"],Y),D(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Y]=n._locale.eraYearOrdinalParse(e,i):t[Y]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),t("weekYear","gg"),t("isoWeekYear","GG"),n("weekYear",1),n("isoWeekYear",1),v("G",De),v("g",De),v("GG",p,w),v("gg",p,w),v("GGGG",ke,_e),v("gggg",ke,_e),v("GGGGG",ve,ye),v("ggggg",ve,ye),Te(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=g(e)}),Te(["gg","GG"],function(e,t,n,s){t[s]=f.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),t("quarter","Q"),n("quarter",7),v("Q",i),D("Q",function(e,t){t[O]=3*(g(e)-1)}),s("D",["DD",2],"Do","date"),t("date","D"),n("date",9),v("D",p),v("DD",p,w),v("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),D(["D","DD"],b),D("Do",function(e,t){t[b]=g(e.match(p)[0])});ke=de("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),t("dayOfYear","DDD"),n("dayOfYear",4),v("DDD",pe),v("DDDD",me),D(["DDD","DDDD"],function(e,t,n){n._dayOfYear=g(e)}),s("m",["mm",2],0,"minute"),t("minute","m"),n("minute",14),v("m",p),v("mm",p,w),D(["m","mm"],T);var ln,_e=de("Minutes",!1),ve=(s("s",["ss",2],0,"second"),t("second","s"),n("second",15),v("s",p),v("ss",p,w),D(["s","ss"],N),de("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),t("millisecond","ms"),n("millisecond",16),v("S",pe,i),v("SS",pe,w),v("SSS",pe,me),ln="SSSS";ln.length<=9;ln+="S")v(ln,Me);function hn(e,t){t[Ne]=g(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")D(ln,hn);ye=de("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");i=q.prototype;function dn(e){return e}i.add=Ce,i.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||W(),n=Gt(e,this).startOf("day"),n=f.calendarFormat(this,n)||"sameElse",t=t&&(d(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,W(e)))},i.clone=function(){return new q(this)},i.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=_(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:y(r)},i.endOf=function(e){var t,n;if(void 0===(e=_(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1;break}return this._d.setTime(t),f.updateOffset(this,!0),this},i.format=function(e){return e=e||(this.isUtc()?f.defaultFormatUtc:f.defaultFormat),e=re(this,e),this.localeData().postformat(e)},i.from=function(e,t){return this.isValid()&&(h(e)&&e.isValid()||W(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},i.fromNow=function(e){return this.from(W(),e)},i.to=function(e,t){return this.isValid()&&(h(e)&&e.isValid()||W(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},i.toNow=function(e){return this.to(W(),e)},i.get=function(e){return d(this[e=_(e)])?this[e]():this},i.invalidAt=function(){return m(this).overflow},i.isAfter=function(e,t){return e=h(e)?e:W(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},i.isBefore=function(e,t){return e=h(e)?e:W(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},i.isBetween=function(e,t,n,s){return e=h(e)?e:W(e),t=h(t)?t:W(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&(("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n)))},i.isSame=function(e,t){var e=h(e)?e:W(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=_(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},i.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},i.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},i.isValid=function(){return A(this)},i.lang=Xe,i.locale=Xt,i.localeData=Kt,i.max=we,i.min=ge,i.parsingFlags=function(){return E({},m(this))},i.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(d(this[e=_(e)]))return this[e](t);return this},i.startOf=function(e){var t,n;if(void 0===(e=_(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3);break}return this._d.setTime(t),f.updateOffset(this,!0),this},i.subtract=Je,i.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},i.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},i.toDate=function(){return new Date(this.valueOf())},i.toISOString=function(e){if(!this.isValid())return null;var t=(e=!0!==e)?this.clone().utc():this;return t.year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):d(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},i.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t="moment",n="";return this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",n="Z"),t="["+t+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+e+"-MM-DD[T]HH:mm:ss.SSS"+(n+'[")]'))},"undefined"!=typeof Symbol&&null!=Symbol.for&&(i[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},i.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},i.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},i.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},i.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},i.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-f(n[s].since).year())*e+n[s].offset;return this.year()},i.year=Ie,i.isLeapYear=function(){return he(this.year())},i.weekYear=function(e){return un.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},i.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},i.quarter=i.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},i.month=Ge,i.daysInMonth=function(){return We(this.year(),this.month())},i.week=i.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},i.isoWeek=i.isoWeeks=function(e){var t=qe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},i.weeksInYear=function(){var e=this.localeData()._week;return P(this.year(),e.dow,e.doy)},i.weeksInWeekYear=function(){var e=this.localeData()._week;return P(this.weekYear(),e.dow,e.doy)},i.isoWeeksInYear=function(){return P(this.year(),1,4)},i.isoWeeksInISOWeekYear=function(){return P(this.isoWeekYear(),1,4)},i.date=ke,i.day=i.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t,n,s=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(t=e,n=this.localeData(),e="string"!=typeof t?t:isNaN(t)?"number"==typeof(t=n.weekdaysParse(t))?t:null:parseInt(t,10),this.add(e-s,"d")):s},i.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},i.isoWeekday=function(e){return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN;var t,n},i.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},i.hour=i.hours=k,i.minute=i.minutes=_e,i.second=i.seconds=ve,i.millisecond=i.milliseconds=ye,i.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(Ye,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?qt(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,f.updateOffset(this,!0),this._changeInProgress=null)),this},i.utc=function(e){return this.utcOffset(0,e)},i.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Et(this),"m")),this},i.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Se,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},i.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?W(e).utcOffset():0,(this.utcOffset()-e)%60==0)},i.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},i.isLocal=function(){return!!this.isValid()&&!this._isUTC},i.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},i.isUtc=At,i.isUTC=At,i.zoneAbbr=function(){return this._isUTC?"UTC":""},i.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},i.dates=e("dates accessor is deprecated. Use date instead.",ke),i.months=e("months accessor is deprecated. Use month instead",Ge),i.years=e("years accessor is deprecated. Use year instead",Ie),i.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),i.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return $(t,this),(t=Nt(t))._a?(e=(t._isUTC?l:W)(t._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&g(e[a])!==g(t[a]))&&r++;return r+i}(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted});w=K.prototype;function cn(e,t,n,s){var i=mt(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?u(t)&&(n=t,t=void 0):(t=e,e=!1,u(n=t)&&(n=t,t=void 0)),t||"");var i,r=mt(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}w.calendar=function(e,t,n){return d(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},w.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},w.invalidDate=function(){return this._invalidDate},w.ordinal=function(e){return this._ordinal.replace("%d",e)},w.preparse=dn,w.postformat=dn,w.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return d(i)?i(e,t,n,s):i.replace(/%d/i,e)},w.pastFuture=function(e,t){return d(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},w.set=function(e){var t,n;for(n in e)c(e,n)&&(d(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},w.eras=function(e,t){for(var n,s=this._eras||mt("en")._eras,i=0,r=s.length;i<r;++i){switch(typeof s[i].since){case"string":n=f(s[i].since).startOf("day"),s[i].since=n.valueOf();break}switch(typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=f(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf();break}}return s},w.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s];break}else if(0<=[r,a,o].indexOf(e))return u[s]},w.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?f(e.since).year():f(e.since).year()+(t-e.offset)*n},w.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},w.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},w.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex}
vendor: 12,432 bytes, lines 1861-1863
1861,w.months=function(e,t){return e?(a(this._months)?this._months:this._months[(this._months.isFormat||He).test(t)?"format":"standalone"])[e.month()]:a(this._months)?this._months:this._months.standalone},w.monthsShort=function(e,t){return e?(a(this._monthsShort)?this._monthsShort:this._monthsShort[He.test(t)?"format":"standalone"])[e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},w.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=S.call(this._shortMonthsParse,e))?i:null:-1!==(i=S.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=S.call(this._shortMonthsParse,e))||-1!==(i=S.call(this._longMonthsParse,e))?i:null:-1!==(i=S.call(this._longMonthsParse,e))||-1!==(i=S.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},w.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ee.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},w.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||Ee.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Fe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},w.week=function(e){return qe(e,this._week.dow,this._week.doy).week},w.firstDayOfYear=function(){return this._week.doy},w.firstDayOfWeek=function(){return this._week.dow},w.weekdays=function(e,t){return t=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Be(t,this._week.dow):e?t[e.day()]:t},w.weekdaysMin=function(e){return!0===e?Be(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},w.weekdaysShort=function(e){return!0===e?Be(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},w.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=S.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=S.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._shortWeekdaysParse,e))||-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=S.call(this._shortWeekdaysParse,e))||-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._minWeekdaysParse,e))?i:null:-1!==(i=S.call(this._minWeekdaysParse,e))||-1!==(i=S.call(this._weekdaysParse,e))||-1!==(i=S.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},w.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=Ke),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},w.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=et),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},w.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||nt.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=tt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},w.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},w.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ct("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===g(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),f.lang=e("moment.lang is deprecated. Use moment.locale instead.",ct),f.langData=e("moment.langData is deprecated. Use moment.localeData instead.",mt);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}pe=kn("ms"),me=kn("s"),Ce=kn("m"),we=kn("h"),ge=kn("d"),Je=kn("w"),k=kn("M"),_e=kn("Q"),ve=kn("y");function vn(e){return function(){return this.isValid()?this._data[e]:NaN}}var ye=vn("milliseconds"),ke=vn("seconds"),Ie=vn("minutes"),w=vn("hours"),Mn=vn("days"),Dn=vn("months"),Sn=vn("years");var Yn=Math.round,On={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function bn(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),h=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||a<=1&&["m"]||a<n.m&&["mm",a]||o<=1&&["h"]||o<n.h&&["hh",o]||u<=1&&["d"]||u<n.d&&["dd",u];return(r=(r=null!=n.w?r||h<=1&&["w"]||h<n.w&&["ww",h]:r)||l<=1&&["M"]||l<n.M&&["MM",l]||i<=1&&["y"]||["yy",i])[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var xn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function Nn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,s,i,r,a,o=xn(this._milliseconds)/1e3,u=xn(this._days),l=xn(this._months),h=this.asSeconds();return h?(e=y(o/60),t=y(e/60),o%=60,e%=60,n=y(l/12),l%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",i=Tn(this._months)!==Tn(h)?"-":"",r=Tn(this._days)!==Tn(h)?"-":"",a=Tn(this._milliseconds)!==Tn(h)?"-":"",(h<0?"-":"")+"P"+(n?i+n+"Y":"")+(l?i+l+"M":"")+(u?r+u+"D":"")+(t||e||o?"T":"")+(t?a+t+"H":"")+(e?a+e+"M":"")+(o?a+s+"S":"")):"P0D"}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=_(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=pe,U.asSeconds=me,U.asMinutes=Ce,U.asHours=we,U.asDays=ge,U.asWeeks=Je,U.asMonths=k,U.asQuarters=_e,U.asYears=ve,U.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*g(this._months/12):NaN},U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=y(e/1e3),s.seconds=e%60,e=y(e/60),s.minutes=e%60,e=y(e/60),s.hours=e%24,t+=y(e/24),n+=e=y(wn(t)),t-=gn(pn(e)),e=y(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=_(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=ye,U.seconds=ke,U.minutes=Ie,U.hours=w,U.days=Mn,U.weeks=function(){return y(this.days()/7)},U.months=Dn,U.years=Sn,U.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,s=On;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},On,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),e=this.localeData(),t=bn(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)},U.toISOString=Nn,U.toString=Nn,U.toJSON=Nn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Nn),U.lang=Xe,s("X",0,0,"unix"),s("x",0,0,"valueOf"),v("x",De),v("X",/[+-]?\d+(\.\d{1,3})?/),D("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),D("x",function(e,t,n){n._d=new Date(g(e))}),f.version="2.29.4",H=W,f.fn=i,f.min=function(){return Rt("isBefore",[].slice.call(arguments,0))},f.max=function(){return Rt("isAfter",[].slice.call(arguments,0))},f.now=function(){return Date.now?Date.now():+new Date},f.utc=l,f.unix=function(e){return W(1e3*e)},f.months=function(e,t){return fn(e,t,"months")},f.isDate=V,f.locale=ct,f.invalid=I,f.duration=C,f.isMoment=h,f.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},f.parseZone=function(){return W.apply(null,arguments).parseZone()},f.localeData=mt,f.isDuration=Ut,f.monthsShort=function(e,t){return fn(e,t,"monthsShort")},f.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},f.defineLocale=ft,f.updateLocale=function(e,t){var n,s;return null!=t?(s=ot,null!=R[e]&&null!=R[e].parentLocale?R[e].set(X(R[e]._config,t)):(t=X(s=null!=(n=dt(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=R[e],R[e]=s),ct(e)):null!=R[e]&&(null!=R[e].parentLocale?(R[e]=R[e].parentLocale,e===ct()&&ct(e)):null!=R[e]&&delete R[e]),R[e]},f.locales=function(){return ee(R)},f.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},f.normalizeUnits=_,f.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},f.relativeTimeThreshold=function(e,t){return void 0!==On[e]&&(void 0===t?On[e]:(On[e]=t,"s"===e&&(On.ss=t-1),!0))},f.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},f.prototype=i,f.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},f}); 1862//# sourceMappingURL=moment.min.js.map; 1863/**
1864* @version: 3.1 1865* @author: Dan Grossman http://www.dangrossman.info/ 1866* @copyright: Copyright (c) 2012-2019 Dan Grossman. All rights reserved. 1867* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php 1868* @website: http://www.daterangepicker.com/ 1869*/ 1870// Following the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js 1871(function (root, factory) { 1872 if (typeof define === 'function' && define.amd) { 1873 // AMD. Make globaly available as well 1874 define('daterangepicker',['moment', 'jquery'], function (moment, jquery) { 1875 if (!jquery.fn) jquery.fn = {}; // webpack server rendering 1876 if (typeof moment !== 'function' && moment.hasOwnProperty('default')) moment = moment['default'] 1877 return factory(moment, jquery); 1878 }); 1879 } else if (typeof module === 'object' && module.exports) { 1880 // Node / Browserify 1881 //isomorphic issue 1882 var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; 1883 if (!jQuery) { 1884 jQuery = require('jquery'); 1885 if (!jQuery.fn) jQuery.fn = {}; 1886 } 1887 var moment = (typeof window != 'undefined' && typeof window.moment != 'undefined') ? window.moment : require('moment'); 1888 module.exports = factory(moment, jQuery); 1889 } else { 1890 // Browser globals 1891 root.daterangepicker = factory(root.moment, root.jQuery); 1892 } 1893}(typeof window !== 'undefined' ? window : this, function(moment, $) { 1894 var DateRangePicker = function(element, options, cb) { 1895 1896 //default settings for options 1897 this.parentEl = 'body'; 1898 this.element = $(element); 1899 this.startDate = moment().startOf('day'); 1900 this.endDate = moment().endOf('day'); 1901 this.minDate = false; 1902 this.maxDate = false; 1903 this.maxSpan = false; 1904 this.autoApply = false; 1905 this.singleDatePicker = false; 1906 this.showDropdowns = false; 1907 this.minYear = moment().subtract(100, 'year').format('YYYY'); 1908 this.maxYear = moment().add(100, 'year').format('YYYY'); 1909 this.showWeekNumbers = false; 1910 this.showISOWeekNumbers = false; 1911 this.showCustomRangeLabel = true; 1912 this.timePicker = false; 1913 this.timePicker24Hour = false;
vendor: 66,710 bytes, lines 1914-3536
1914 this.timePickerIncrement = 1; 1915 this.timePickerSeconds = false; 1916 this.linkedCalendars = true; 1917 this.autoUpdateInput = true; 1918 this.alwaysShowCalendars = false; 1919 this.ranges = {}; 1920 1921 this.opens = 'right'; 1922 if (this.element.hasClass('pull-right')) 1923 this.opens = 'left'; 1924 1925 this.drops = 'down'; 1926 if (this.element.hasClass('dropup')) 1927 this.drops = 'up'; 1928 1929 this.buttonClasses = 'btn btn-sm'; 1930 this.applyButtonClasses = 'btn-primary'; 1931 this.cancelButtonClasses = 'btn-default'; 1932 1933 this.locale = { 1934 direction: 'ltr', 1935 format: moment.localeData().longDateFormat('L'), 1936 separator: ' - ', 1937 applyLabel: 'Apply', 1938 cancelLabel: 'Cancel', 1939 weekLabel: 'W', 1940 customRangeLabel: 'Custom Range', 1941 daysOfWeek: moment.weekdaysMin(), 1942 monthNames: moment.monthsShort(), 1943 firstDay: moment.localeData().firstDayOfWeek() 1944 }; 1945 1946 this.callback = function() { }; 1947 1948 //some state information 1949 this.isShowing = false; 1950 this.leftCalendar = {}; 1951 this.rightCalendar = {}; 1952 1953 //custom options from user 1954 if (typeof options !== 'object' || options === null) 1955 options = {}; 1956 1957 //allow setting options with data attributes 1958 //data-api options will be overwritten with custom javascript options 1959 options = $.extend(this.element.data(), options); 1960 1961 //html template for the picker UI 1962 if (typeof options.template !== 'string' && !(options.template instanceof $)) 1963 options.template = 1964 '<div class="daterangepicker">' + 1965 '<div class="ranges"></div>' + 1966 '<div class="drp-calendar left">' + 1967 '<div class="calendar-table"></div>' + 1968 '<div class="calendar-time"></div>' + 1969 '</div>' + 1970 '<div class="drp-calendar right">' + 1971 '<div class="calendar-table"></div>' + 1972 '<div class="calendar-time"></div>' + 1973 '</div>' + 1974 '<div class="drp-buttons">' + 1975 '<span class="drp-selected"></span>' + 1976 '<button class="cancelBtn" type="button"></button>' + 1977 '<button class="applyBtn" disabled="disabled" type="button"></button> ' + 1978 '</div>' + 1979 '</div>'; 1980 1981 this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl); 1982 this.container = $(options.template).appendTo(this.parentEl); 1983 1984 // 1985 // handle all the possible options overriding defaults 1986 // 1987 1988 if (typeof options.locale === 'object') { 1989 1990 if (typeof options.locale.direction === 'string') 1991 this.locale.direction = options.locale.direction; 1992 1993 if (typeof options.locale.format === 'string') 1994 this.locale.format = options.locale.format; 1995 1996 if (typeof options.locale.separator === 'string') 1997 this.locale.separator = options.locale.separator; 1998 1999 if (typeof options.locale.daysOfWeek === 'object') 2000 this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); 2001 2002 if (typeof options.locale.monthNames === 'object') 2003 this.locale.monthNames = options.locale.monthNames.slice(); 2004 2005 if (typeof options.locale.firstDay === 'number') 2006 this.locale.firstDay = options.locale.firstDay; 2007 2008 if (typeof options.locale.applyLabel === 'string') 2009 this.locale.applyLabel = options.locale.applyLabel; 2010 2011 if (typeof options.locale.cancelLabel === 'string') 2012 this.locale.cancelLabel = options.locale.cancelLabel; 2013 2014 if (typeof options.locale.weekLabel === 'string') 2015 this.locale.weekLabel = options.locale.weekLabel; 2016 2017 if (typeof options.locale.customRangeLabel === 'string'){ 2018 //Support unicode chars in the custom range name. 2019 var elem = document.createElement('textarea'); 2020 elem.innerHTML = options.locale.customRangeLabel; 2021 var rangeHtml = elem.value; 2022 this.locale.customRangeLabel = rangeHtml; 2023 } 2024 } 2025 this.container.addClass(this.locale.direction); 2026 2027 if (typeof options.startDate === 'string') 2028 this.startDate = moment(options.startDate, this.locale.format); 2029 2030 if (typeof options.endDate === 'string') 2031 this.endDate = moment(options.endDate, this.locale.format); 2032 2033 if (typeof options.minDate === 'string') 2034 this.minDate = moment(options.minDate, this.locale.format); 2035 2036 if (typeof options.maxDate === 'string') 2037 this.maxDate = moment(options.maxDate, this.locale.format); 2038 2039 if (typeof options.startDate === 'object') 2040 this.startDate = moment(options.startDate); 2041 2042 if (typeof options.endDate === 'object') 2043 this.endDate = moment(options.endDate); 2044 2045 if (typeof options.minDate === 'object') 2046 this.minDate = moment(options.minDate); 2047 2048 if (typeof options.maxDate === 'object') 2049 this.maxDate = moment(options.maxDate); 2050 2051 // sanity check for bad options 2052 if (this.minDate && this.startDate.isBefore(this.minDate)) 2053 this.startDate = this.minDate.clone(); 2054 2055 // sanity check for bad options 2056 if (this.maxDate && this.endDate.isAfter(this.maxDate)) 2057 this.endDate = this.maxDate.clone(); 2058 2059 if (typeof options.applyButtonClasses === 'string') 2060 this.applyButtonClasses = options.applyButtonClasses; 2061 2062 if (typeof options.applyClass === 'string') //backwards compat 2063 this.applyButtonClasses = options.applyClass; 2064 2065 if (typeof options.cancelButtonClasses === 'string') 2066 this.cancelButtonClasses = options.cancelButtonClasses; 2067 2068 if (typeof options.cancelClass === 'string') //backwards compat 2069 this.cancelButtonClasses = options.cancelClass; 2070 2071 if (typeof options.maxSpan === 'object') 2072 this.maxSpan = options.maxSpan; 2073 2074 if (typeof options.dateLimit === 'object') //backwards compat 2075 this.maxSpan = options.dateLimit; 2076 2077 if (typeof options.opens === 'string') 2078 this.opens = options.opens; 2079 2080 if (typeof options.drops === 'string') 2081 this.drops = options.drops; 2082 2083 if (typeof options.showWeekNumbers === 'boolean') 2084 this.showWeekNumbers = options.showWeekNumbers; 2085 2086 if (typeof options.showISOWeekNumbers === 'boolean') 2087 this.showISOWeekNumbers = options.showISOWeekNumbers; 2088 2089 if (typeof options.buttonClasses === 'string') 2090 this.buttonClasses = options.buttonClasses; 2091 2092 if (typeof options.buttonClasses === 'object') 2093 this.buttonClasses = options.buttonClasses.join(' '); 2094 2095 if (typeof options.showDropdowns === 'boolean') 2096 this.showDropdowns = options.showDropdowns; 2097 2098 if (typeof options.minYear === 'number') 2099 this.minYear = options.minYear; 2100 2101 if (typeof options.maxYear === 'number') 2102 this.maxYear = options.maxYear; 2103 2104 if (typeof options.showCustomRangeLabel === 'boolean') 2105 this.showCustomRangeLabel = options.showCustomRangeLabel; 2106 2107 if (typeof options.singleDatePicker === 'boolean') { 2108 this.singleDatePicker = options.singleDatePicker; 2109 if (this.singleDatePicker) 2110 this.endDate = this.startDate.clone(); 2111 } 2112 2113 if (typeof options.timePicker === 'boolean') 2114 this.timePicker = options.timePicker; 2115 2116 if (typeof options.timePickerSeconds === 'boolean') 2117 this.timePickerSeconds = options.timePickerSeconds; 2118 2119 if (typeof options.timePickerIncrement === 'number') 2120 this.timePickerIncrement = options.timePickerIncrement; 2121 2122 if (typeof options.timePicker24Hour === 'boolean') 2123 this.timePicker24Hour = options.timePicker24Hour; 2124 2125 if (typeof options.autoApply === 'boolean') 2126 this.autoApply = options.autoApply; 2127 2128 if (typeof options.autoUpdateInput === 'boolean') 2129 this.autoUpdateInput = options.autoUpdateInput; 2130 2131 if (typeof options.linkedCalendars === 'boolean') 2132 this.linkedCalendars = options.linkedCalendars; 2133 2134 if (typeof options.isInvalidDate === 'function') 2135 this.isInvalidDate = options.isInvalidDate; 2136 2137 if (typeof options.isCustomDate === 'function') 2138 this.isCustomDate = options.isCustomDate; 2139 2140 if (typeof options.alwaysShowCalendars === 'boolean') 2141 this.alwaysShowCalendars = options.alwaysShowCalendars; 2142 2143 // update day names order to firstDay 2144 if (this.locale.firstDay != 0) { 2145 var iterator = this.locale.firstDay; 2146 while (iterator > 0) { 2147 this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); 2148 iterator--; 2149 } 2150 } 2151 2152 var start, end, range; 2153 2154 //if no start/end dates set, check if an input element contains initial values 2155 if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { 2156 if ($(this.element).is(':text')) { 2157 var val = $(this.element).val(), 2158 split = val.split(this.locale.separator); 2159 2160 start = end = null; 2161 2162 if (split.length == 2) { 2163 start = moment(split[0], this.locale.format); 2164 end = moment(split[1], this.locale.format); 2165 } else if (this.singleDatePicker && val !== "") { 2166 start = moment(val, this.locale.format); 2167 end = moment(val, this.locale.format); 2168 } 2169 if (start !== null && end !== null) { 2170 this.setStartDate(start); 2171 this.setEndDate(end); 2172 } 2173 } 2174 } 2175 2176 if (typeof options.ranges === 'object') { 2177 for (range in options.ranges) { 2178 2179 if (typeof options.ranges[range][0] === 'string') 2180 start = moment(options.ranges[range][0], this.locale.format); 2181 else 2182 start = moment(options.ranges[range][0]); 2183 2184 if (typeof options.ranges[range][1] === 'string') 2185 end = moment(options.ranges[range][1], this.locale.format); 2186 else 2187 end = moment(options.ranges[range][1]); 2188 2189 // If the start or end date exceed those allowed by the minDate or maxSpan 2190 // options, shorten the range to the allowable period. 2191 if (this.minDate && start.isBefore(this.minDate)) 2192 start = this.minDate.clone(); 2193 2194 var maxDate = this.maxDate; 2195 if (this.maxSpan && maxDate && start.clone().add(this.maxSpan).isAfter(maxDate)) 2196 maxDate = start.clone().add(this.maxSpan); 2197 if (maxDate && end.isAfter(maxDate)) 2198 end = maxDate.clone(); 2199 2200 // If the end of the range is before the minimum or the start of the range is 2201 // after the maximum, don't display this range option at all. 2202 if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day')) 2203 || (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day'))) 2204 continue; 2205 2206 //Support unicode chars in the range names. 2207 var elem = document.createElement('textarea'); 2208 elem.innerHTML = range; 2209 var rangeHtml = elem.value; 2210 2211 this.ranges[rangeHtml] = [start, end]; 2212 } 2213 2214 var list = '<ul>'; 2215 for (range in this.ranges) { 2216 list += '<li data-range-key="' + range + '">' + range + '</li>'; 2217 } 2218 if (this.showCustomRangeLabel) { 2219 list += '<li data-range-key="' + this.locale.customRangeLabel + '">' + this.locale.customRangeLabel + '</li>'; 2220 } 2221 list += '</ul>'; 2222 this.container.find('.ranges').prepend(list); 2223 } 2224 2225 if (typeof cb === 'function') { 2226 this.callback = cb; 2227 } 2228 2229 if (!this.timePicker) { 2230 this.startDate = this.startDate.startOf('day'); 2231 this.endDate = this.endDate.endOf('day'); 2232 this.container.find('.calendar-time').hide(); 2233 } 2234 2235 //can't be used together for now 2236 if (this.timePicker && this.autoApply) 2237 this.autoApply = false; 2238 2239 if (this.autoApply) { 2240 this.container.addClass('auto-apply'); 2241 } 2242 2243 if (typeof options.ranges === 'object') 2244 this.container.addClass('show-ranges'); 2245 2246 if (this.singleDatePicker) { 2247 this.container.addClass('single'); 2248 this.container.find('.drp-calendar.left').addClass('single'); 2249 this.container.find('.drp-calendar.left').show(); 2250 this.container.find('.drp-calendar.right').hide(); 2251 if (!this.timePicker && this.autoApply) { 2252 this.container.addClass('auto-apply'); 2253 } 2254 } 2255 2256 if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) { 2257 this.container.addClass('show-calendar'); 2258 } 2259 2260 this.container.addClass('opens' + this.opens); 2261 2262 //apply CSS classes and labels to buttons 2263 this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses); 2264 if (this.applyButtonClasses.length) 2265 this.container.find('.applyBtn').addClass(this.applyButtonClasses); 2266 if (this.cancelButtonClasses.length) 2267 this.container.find('.cancelBtn').addClass(this.cancelButtonClasses); 2268 this.container.find('.applyBtn').html(this.locale.applyLabel); 2269 this.container.find('.cancelBtn').html(this.locale.cancelLabel); 2270 2271 // 2272 // event listeners 2273 // 2274 2275 this.container.find('.drp-calendar') 2276 .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)) 2277 .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)) 2278 .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) 2279 .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)) 2280 .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)) 2281 .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)) 2282 .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this)); 2283 2284 this.container.find('.ranges') 2285 .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)); 2286 2287 this.container.find('.drp-buttons') 2288 .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) 2289 .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)); 2290 2291 if (this.element.is('input') || this.element.is('button')) { 2292 this.element.on({ 2293 'click.daterangepicker': $.proxy(this.show, this), 2294 'focus.daterangepicker': $.proxy(this.show, this), 2295 'keyup.daterangepicker': $.proxy(this.elementChanged, this), 2296 'keydown.daterangepicker': $.proxy(this.keydown, this) //IE 11 compatibility 2297 }); 2298 } else { 2299 this.element.on('click.daterangepicker', $.proxy(this.toggle, this)); 2300 this.element.on('keydown.daterangepicker', $.proxy(this.toggle, this)); 2301 } 2302 2303 // 2304 // if attached to a text input, set the initial value 2305 // 2306 2307 this.updateElement(); 2308 2309 }; 2310 2311 DateRangePicker.prototype = { 2312 2313 constructor: DateRangePicker, 2314 2315 setStartDate: function(startDate) { 2316 if (typeof startDate === 'string') 2317 this.startDate = moment(startDate, this.locale.format); 2318 2319 if (typeof startDate === 'object') 2320 this.startDate = moment(startDate); 2321 2322 if (!this.timePicker) 2323 this.startDate = this.startDate.startOf('day'); 2324 2325 if (this.timePicker && this.timePickerIncrement) 2326 this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); 2327 2328 if (this.minDate && this.startDate.isBefore(this.minDate)) { 2329 this.startDate = this.minDate.clone(); 2330 if (this.timePicker && this.timePickerIncrement) 2331 this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); 2332 } 2333 2334 if (this.maxDate && this.startDate.isAfter(this.maxDate)) { 2335 this.startDate = this.maxDate.clone(); 2336 if (this.timePicker && this.timePickerIncrement) 2337 this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); 2338 } 2339 2340 if (!this.isShowing) 2341 this.updateElement(); 2342 2343 this.updateMonthsInView(); 2344 }, 2345 2346 setEndDate: function(endDate) { 2347 if (typeof endDate === 'string') 2348 this.endDate = moment(endDate, this.locale.format); 2349 2350 if (typeof endDate === 'object') 2351 this.endDate = moment(endDate); 2352 2353 if (!this.timePicker) 2354 this.endDate = this.endDate.endOf('day'); 2355 2356 if (this.timePicker && this.timePickerIncrement) 2357 this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); 2358 2359 if (this.endDate.isBefore(this.startDate)) 2360 this.endDate = this.startDate.clone(); 2361 2362 if (this.maxDate && this.endDate.isAfter(this.maxDate)) 2363 this.endDate = this.maxDate.clone(); 2364 2365 if (this.maxSpan && this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)) 2366 this.endDate = this.startDate.clone().add(this.maxSpan); 2367 2368 this.previousRightTime = this.endDate.clone(); 2369 2370 this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); 2371 2372 if (!this.isShowing) 2373 this.updateElement(); 2374 2375 this.updateMonthsInView(); 2376 }, 2377 2378 isInvalidDate: function() { 2379 return false; 2380 }, 2381 2382 isCustomDate: function() { 2383 return false; 2384 }, 2385 2386 updateView: function() { 2387 if (this.timePicker) { 2388 this.renderTimePicker('left'); 2389 this.renderTimePicker('right'); 2390 if (!this.endDate) { 2391 this.container.find('.right .calendar-time select').prop('disabled', true).addClass('disabled'); 2392 } else { 2393 this.container.find('.right .calendar-time select').prop('disabled', false).removeClass('disabled'); 2394 } 2395 } 2396 if (this.endDate) 2397 this.container.find('.drp-selected').html(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); 2398 this.updateMonthsInView(); 2399 this.updateCalendars(); 2400 this.updateFormInputs(); 2401 }, 2402 2403 updateMonthsInView: function() { 2404 if (this.endDate) { 2405 2406 //if both dates are visible already, do nothing 2407 if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && 2408 (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) 2409 && 2410 (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) 2411 ) { 2412 return; 2413 } 2414 2415 this.leftCalendar.month = this.startDate.clone().date(2); 2416 if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) { 2417 this.rightCalendar.month = this.endDate.clone().date(2); 2418 } else { 2419 this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); 2420 } 2421 2422 } else { 2423 if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) { 2424 this.leftCalendar.month = this.startDate.clone().date(2); 2425 this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); 2426 } 2427 } 2428 if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) { 2429 this.rightCalendar.month = this.maxDate.clone().date(2); 2430 this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month'); 2431 } 2432 }, 2433 2434 updateCalendars: function() { 2435 2436 if (this.timePicker) { 2437 var hour, minute, second; 2438 if (this.endDate) { 2439 hour = parseInt(this.container.find('.left .hourselect').val(), 10); 2440 minute = parseInt(this.container.find('.left .minuteselect').val(), 10); 2441 if (isNaN(minute)) { 2442 minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10); 2443 } 2444 second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; 2445 if (!this.timePicker24Hour) { 2446 var ampm = this.container.find('.left .ampmselect').val(); 2447 if (ampm === 'PM' && hour < 12) 2448 hour += 12; 2449 if (ampm === 'AM' && hour === 12) 2450 hour = 0; 2451 } 2452 } else { 2453 hour = parseInt(this.container.find('.right .hourselect').val(), 10); 2454 minute = parseInt(this.container.find('.right .minuteselect').val(), 10); 2455 if (isNaN(minute)) { 2456 minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10); 2457 } 2458 second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; 2459 if (!this.timePicker24Hour) { 2460 var ampm = this.container.find('.right .ampmselect').val(); 2461 if (ampm === 'PM' && hour < 12) 2462 hour += 12; 2463 if (ampm === 'AM' && hour === 12) 2464 hour = 0; 2465 } 2466 } 2467 this.leftCalendar.month.hour(hour).minute(minute).second(second); 2468 this.rightCalendar.month.hour(hour).minute(minute).second(second); 2469 } 2470 2471 this.renderCalendar('left'); 2472 this.renderCalendar('right'); 2473 2474 //highlight any predefined range matching the current start and end dates 2475 this.container.find('.ranges li').removeClass('active'); 2476 if (this.endDate == null) return; 2477 2478 this.calculateChosenLabel(); 2479 }, 2480 2481 renderCalendar: function(side) { 2482 2483 // 2484 // Build the matrix of dates that will populate the calendar 2485 // 2486 2487 var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar; 2488 var month = calendar.month.month(); 2489 var year = calendar.month.year(); 2490 var hour = calendar.month.hour(); 2491 var minute = calendar.month.minute(); 2492 var second = calendar.month.second(); 2493 var daysInMonth = moment([year, month]).daysInMonth(); 2494 var firstDay = moment([year, month, 1]); 2495 var lastDay = moment([year, month, daysInMonth]); 2496 var lastMonth = moment(firstDay).subtract(1, 'month').month(); 2497 var lastYear = moment(firstDay).subtract(1, 'month').year(); 2498 var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); 2499 var dayOfWeek = firstDay.day(); 2500 2501 //initialize a 6 rows x 7 columns array for the calendar 2502 var calendar = []; 2503 calendar.firstDay = firstDay; 2504 calendar.lastDay = lastDay; 2505 2506 for (var i = 0; i < 6; i++) { 2507 calendar[i] = []; 2508 } 2509 2510 //populate the calendar with date objects 2511 var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; 2512 if (startDay > daysInLastMonth) 2513 startDay -= 7; 2514 2515 if (dayOfWeek == this.locale.firstDay) 2516 startDay = daysInLastMonth - 6; 2517 2518 var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); 2519 2520 var col, row; 2521 for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) { 2522 if (i > 0 && col % 7 === 0) { 2523 col = 0; 2524 row++; 2525 } 2526 calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second); 2527 curDate.hour(12); 2528 2529 if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') { 2530 calendar[row][col] = this.minDate.clone(); 2531 } 2532 2533 if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') { 2534 calendar[row][col] = this.maxDate.clone(); 2535 } 2536 2537 } 2538 2539 //make the calendar object available to hoverDate/clickDate 2540 if (side == 'left') { 2541 this.leftCalendar.calendar = calendar; 2542 } else { 2543 this.rightCalendar.calendar = calendar; 2544 } 2545 2546 // 2547 // Display the calendar 2548 // 2549 2550 var minDate = side == 'left' ? this.minDate : this.startDate; 2551 var maxDate = this.maxDate; 2552 var selected = side == 'left' ? this.startDate : this.endDate; 2553 var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'}; 2554 2555 var html = '<table class="table-condensed">'; 2556 html += '<thead>'; 2557 html += '<tr>'; 2558 2559 // add empty cell for week number 2560 if (this.showWeekNumbers || this.showISOWeekNumbers) 2561 html += '<th></th>'; 2562 2563 if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) { 2564 html += '<th class="prev available"><span></span></th>'; 2565 } else { 2566 html += '<th></th>'; 2567 } 2568 2569 var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); 2570 2571 if (this.showDropdowns) { 2572 var currentMonth = calendar[1][1].month(); 2573 var currentYear = calendar[1][1].year(); 2574 var maxYear = (maxDate && maxDate.year()) || (this.maxYear); 2575 var minYear = (minDate && minDate.year()) || (this.minYear); 2576 var inMinYear = currentYear == minYear; 2577 var inMaxYear = currentYear == maxYear; 2578 2579 var monthHtml = '<select class="monthselect">'; 2580 for (var m = 0; m < 12; m++) { 2581 if ((!inMinYear || (minDate && m >= minDate.month())) && (!inMaxYear || (maxDate && m <= maxDate.month()))) { 2582 monthHtml += "<option value='" + m + "'" + 2583 (m === currentMonth ? " selected='selected'" : "") + 2584 ">" + this.locale.monthNames[m] + "</option>"; 2585 } else { 2586 monthHtml += "<option value='" + m + "'" + 2587 (m === currentMonth ? " selected='selected'" : "") + 2588 " disabled='disabled'>" + this.locale.monthNames[m] + "</option>"; 2589 } 2590 } 2591 monthHtml += "</select>"; 2592 2593 var yearHtml = '<select class="yearselect">'; 2594 for (var y = minYear; y <= maxYear; y++) { 2595 yearHtml += '<option value="' + y + '"' + 2596 (y === currentYear ? ' selected="selected"' : '') + 2597 '>' + y + '</option>'; 2598 } 2599 yearHtml += '</select>'; 2600 2601 dateHtml = monthHtml + yearHtml; 2602 } 2603 2604 html += '<th colspan="5" class="month">' + dateHtml + '</th>'; 2605 if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) { 2606 html += '<th class="next available"><span></span></th>'; 2607 } else { 2608 html += '<th></th>'; 2609 } 2610 2611 html += '</tr>'; 2612 html += '<tr>'; 2613 2614 // add week number label 2615 if (this.showWeekNumbers || this.showISOWeekNumbers) 2616 html += '<th class="week">' + this.locale.weekLabel + '</th>'; 2617 2618 $.each(this.locale.daysOfWeek, function(index, dayOfWeek) { 2619 html += '<th>' + dayOfWeek + '</th>'; 2620 }); 2621 2622 html += '</tr>'; 2623 html += '</thead>'; 2624 html += '<tbody>'; 2625 2626 //adjust maxDate to reflect the maxSpan setting in order to 2627 //grey out end dates beyond the maxSpan 2628 if (this.endDate == null && this.maxSpan) { 2629 var maxLimit = this.startDate.clone().add(this.maxSpan).endOf('day'); 2630 if (!maxDate || maxLimit.isBefore(maxDate)) { 2631 maxDate = maxLimit; 2632 } 2633 } 2634 2635 for (var row = 0; row < 6; row++) { 2636 html += '<tr>'; 2637 2638 // add week number 2639 if (this.showWeekNumbers) 2640 html += '<td class="week">' + calendar[row][0].week() + '</td>'; 2641 else if (this.showISOWeekNumbers) 2642 html += '<td class="week">' + calendar[row][0].isoWeek() + '</td>'; 2643 2644 for (var col = 0; col < 7; col++) { 2645 2646 var classes = []; 2647 2648 //highlight today's date 2649 if (calendar[row][col].isSame(new Date(), "day")) 2650 classes.push('today'); 2651 2652 //highlight weekends 2653 if (calendar[row][col].isoWeekday() > 5) 2654 classes.push('weekend'); 2655 2656 //grey out the dates in other months displayed at beginning and end of this calendar 2657 if (calendar[row][col].month() != calendar[1][1].month()) 2658 classes.push('off', 'ends'); 2659 2660 //don't allow selection of dates before the minimum date 2661 if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day')) 2662 classes.push('off', 'disabled'); 2663 2664 //don't allow selection of dates after the maximum date 2665 if (maxDate && calendar[row][col].isAfter(maxDate, 'day')) 2666 classes.push('off', 'disabled'); 2667 2668 //don't allow selection of date if a custom function decides it's invalid 2669 if (this.isInvalidDate(calendar[row][col])) 2670 classes.push('off', 'disabled'); 2671 2672 //highlight the currently selected start date 2673 if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) 2674 classes.push('active', 'start-date'); 2675 2676 //highlight the currently selected end date 2677 if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) 2678 classes.push('active', 'end-date'); 2679 2680 //highlight dates in-between the selected dates 2681 if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate) 2682 classes.push('in-range'); 2683 2684 //apply custom classes for this date 2685 var isCustom = this.isCustomDate(calendar[row][col]); 2686 if (isCustom !== false) { 2687 if (typeof isCustom === 'string') 2688 classes.push(isCustom); 2689 else 2690 Array.prototype.push.apply(classes, isCustom); 2691 } 2692 2693 var cname = '', disabled = false; 2694 for (var i = 0; i < classes.length; i++) { 2695 cname += classes[i] + ' '; 2696 if (classes[i] == 'disabled') 2697 disabled = true; 2698 } 2699 if (!disabled) 2700 cname += 'available'; 2701 2702 html += '<td class="' + cname.replace(/^\s+|\s+$/g, '') + '" data-title="' + 'r' + row + 'c' + col + '">' + calendar[row][col].date() + '</td>'; 2703 2704 } 2705 html += '</tr>'; 2706 } 2707 2708 html += '</tbody>'; 2709 html += '</table>'; 2710 2711 this.container.find('.drp-calendar.' + side + ' .calendar-table').html(html); 2712 2713 }, 2714 2715 renderTimePicker: function(side) { 2716 2717 // Don't bother updating the time picker if it's currently disabled 2718 // because an end date hasn't been clicked yet 2719 if (side == 'right' && !this.endDate) return; 2720 2721 var html, selected, minDate, maxDate = this.maxDate; 2722 2723 if (this.maxSpan && (!this.maxDate || this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate))) 2724 maxDate = this.startDate.clone().add(this.maxSpan); 2725 2726 if (side == 'left') { 2727 selected = this.startDate.clone(); 2728 minDate = this.minDate; 2729 } else if (side == 'right') { 2730 selected = this.endDate.clone(); 2731 minDate = this.startDate; 2732 2733 //Preserve the time already selected 2734 var timeSelector = this.container.find('.drp-calendar.right .calendar-time'); 2735 if (timeSelector.html() != '') { 2736 2737 selected.hour(!isNaN(selected.hour()) ? selected.hour() : timeSelector.find('.hourselect option:selected').val()); 2738 selected.minute(!isNaN(selected.minute()) ? selected.minute() : timeSelector.find('.minuteselect option:selected').val()); 2739 selected.second(!isNaN(selected.second()) ? selected.second() : timeSelector.find('.secondselect option:selected').val()); 2740 2741 if (!this.timePicker24Hour) { 2742 var ampm = timeSelector.find('.ampmselect option:selected').val(); 2743 if (ampm === 'PM' && selected.hour() < 12) 2744 selected.hour(selected.hour() + 12); 2745 if (ampm === 'AM' && selected.hour() === 12) 2746 selected.hour(0); 2747 } 2748 2749 } 2750 2751 if (selected.isBefore(this.startDate)) 2752 selected = this.startDate.clone(); 2753 2754 if (maxDate && selected.isAfter(maxDate)) 2755 selected = maxDate.clone(); 2756 2757 } 2758 2759 // 2760 // hours 2761 // 2762 2763 html = '<select class="hourselect">'; 2764 2765 var start = this.timePicker24Hour ? 0 : 1; 2766 var end = this.timePicker24Hour ? 23 : 12; 2767 2768 for (var i = start; i <= end; i++) { 2769 var i_in_24 = i; 2770 if (!this.timePicker24Hour) 2771 i_in_24 = selected.hour() >= 12 ? (i == 12 ? 12 : i + 12) : (i == 12 ? 0 : i); 2772 2773 var time = selected.clone().hour(i_in_24); 2774 var disabled = false; 2775 if (minDate && time.minute(59).isBefore(minDate)) 2776 disabled = true; 2777 if (maxDate && time.minute(0).isAfter(maxDate)) 2778 disabled = true; 2779 2780 if (i_in_24 == selected.hour() && !disabled) { 2781 html += '<option value="' + i + '" selected="selected">' + i + '</option>'; 2782 } else if (disabled) { 2783 html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>'; 2784 } else { 2785 html += '<option value="' + i + '">' + i + '</option>'; 2786 } 2787 } 2788 2789 html += '</select> '; 2790 2791 // 2792 // minutes 2793 // 2794 2795 html += ': <select class="minuteselect">'; 2796 2797 for (var i = 0; i < 60; i += this.timePickerIncrement) { 2798 var padded = i < 10 ? '0' + i : i; 2799 var time = selected.clone().minute(i); 2800 2801 var disabled = false; 2802 if (minDate && time.second(59).isBefore(minDate)) 2803 disabled = true; 2804 if (maxDate && time.second(0).isAfter(maxDate)) 2805 disabled = true; 2806 2807 if (selected.minute() == i && !disabled) { 2808 html += '<option value="' + i + '" selected="selected">' + padded + '</option>'; 2809 } else if (disabled) { 2810 html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>'; 2811 } else { 2812 html += '<option value="' + i + '">' + padded + '</option>'; 2813 } 2814 } 2815 2816 html += '</select> '; 2817 2818 // 2819 // seconds 2820 // 2821 2822 if (this.timePickerSeconds) { 2823 html += ': <select class="secondselect">'; 2824 2825 for (var i = 0; i < 60; i++) { 2826 var padded = i < 10 ? '0' + i : i; 2827 var time = selected.clone().second(i); 2828 2829 var disabled = false; 2830 if (minDate && time.isBefore(minDate)) 2831 disabled = true; 2832 if (maxDate && time.isAfter(maxDate)) 2833 disabled = true; 2834 2835 if (selected.second() == i && !disabled) { 2836 html += '<option value="' + i + '" selected="selected">' + padded + '</option>'; 2837 } else if (disabled) { 2838 html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>'; 2839 } else { 2840 html += '<option value="' + i + '">' + padded + '</option>'; 2841 } 2842 } 2843 2844 html += '</select> '; 2845 } 2846 2847 // 2848 // AM/PM 2849 // 2850 2851 if (!this.timePicker24Hour) { 2852 html += '<select class="ampmselect">'; 2853 2854 var am_html = ''; 2855 var pm_html = ''; 2856 2857 if (minDate && selected.clone().hour(12).minute(0).second(0).isBefore(minDate)) 2858 am_html = ' disabled="disabled" class="disabled"'; 2859 2860 if (maxDate && selected.clone().hour(0).minute(0).second(0).isAfter(maxDate)) 2861 pm_html = ' disabled="disabled" class="disabled"'; 2862 2863 if (selected.hour() >= 12) { 2864 html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>'; 2865 } else { 2866 html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>'; 2867 } 2868 2869 html += '</select>'; 2870 } 2871 2872 this.container.find('.drp-calendar.' + side + ' .calendar-time').html(html); 2873 2874 }, 2875 2876 updateFormInputs: function() { 2877 2878 if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) { 2879 this.container.find('button.applyBtn').prop('disabled', false); 2880 } else { 2881 this.container.find('button.applyBtn').prop('disabled', true); 2882 } 2883 2884 }, 2885 2886 move: function() { 2887 var parentOffset = { top: 0, left: 0 }, 2888 containerTop, 2889 drops = this.drops; 2890 2891 var parentRightEdge = $(window).width(); 2892 if (!this.parentEl.is('body')) { 2893 parentOffset = { 2894 top: this.parentEl.offset().top - this.parentEl.scrollTop(), 2895 left: this.parentEl.offset().left - this.parentEl.scrollLeft() 2896 }; 2897 parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; 2898 } 2899 2900 switch (drops) { 2901 case 'auto': 2902 containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; 2903 if (containerTop + this.container.outerHeight() >= this.parentEl[0].scrollHeight) { 2904 containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; 2905 drops = 'up'; 2906 } 2907 break; 2908 case 'up': 2909 containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; 2910 break; 2911 default: 2912 containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; 2913 break; 2914 } 2915 2916 // Force the container to it's actual width 2917 this.container.css({ 2918 top: 0, 2919 left: 0, 2920 right: 'auto' 2921 }); 2922 var containerWidth = this.container.outerWidth(); 2923 2924 this.container.toggleClass('drop-up', drops == 'up'); 2925 2926 if (this.opens == 'left') { 2927 var containerRight = parentRightEdge - this.element.offset().left - this.element.outerWidth(); 2928 if (containerWidth + containerRight > $(window).width()) { 2929 this.container.css({ 2930 top: containerTop, 2931 right: 'auto', 2932 left: 9 2933 }); 2934 } else { 2935 this.container.css({ 2936 top: containerTop, 2937 right: containerRight, 2938 left: 'auto' 2939 }); 2940 } 2941 } else if (this.opens == 'center') { 2942 var containerLeft = this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2 2943 - containerWidth / 2; 2944 if (containerLeft < 0) { 2945 this.container.css({ 2946 top: containerTop, 2947 right: 'auto', 2948 left: 9 2949 }); 2950 } else if (containerLeft + containerWidth > $(window).width()) { 2951 this.container.css({ 2952 top: containerTop, 2953 left: 'auto', 2954 right: 0 2955 }); 2956 } else { 2957 this.container.css({ 2958 top: containerTop, 2959 left: containerLeft, 2960 right: 'auto' 2961 }); 2962 } 2963 } else { 2964 var containerLeft = this.element.offset().left - parentOffset.left; 2965 if (containerLeft + containerWidth > $(window).width()) { 2966 this.container.css({ 2967 top: containerTop, 2968 left: 'auto', 2969 right: 0 2970 }); 2971 } else { 2972 this.container.css({ 2973 top: containerTop, 2974 left: containerLeft, 2975 right: 'auto' 2976 }); 2977 } 2978 } 2979 }, 2980 2981 show: function(e) { 2982 if (this.isShowing) return; 2983 2984 // Create a click proxy that is private to this instance of datepicker, for unbinding 2985 this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this); 2986 2987 // Bind global datepicker mousedown for hiding and 2988 $(document) 2989 .on('mousedown.daterangepicker', this._outsideClickProxy) 2990 // also support mobile devices 2991 .on('touchend.daterangepicker', this._outsideClickProxy) 2992 // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them 2993 .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy) 2994 // and also close when focus changes to outside the picker (eg. tabbing between controls) 2995 .on('focusin.daterangepicker', this._outsideClickProxy); 2996 2997 // Reposition the picker if the window is resized while it's open 2998 $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this)); 2999 3000 this.oldStartDate = this.startDate.clone(); 3001 this.oldEndDate = this.endDate.clone(); 3002 this.previousRightTime = this.endDate.clone(); 3003 3004 this.updateView(); 3005 this.container.show(); 3006 this.move(); 3007 this.element.trigger('show.daterangepicker', this); 3008 this.isShowing = true; 3009 }, 3010 3011 hide: function(e) { 3012 if (!this.isShowing) return; 3013 3014 //incomplete date selection, revert to last values 3015 if (!this.endDate) { 3016 this.startDate = this.oldStartDate.clone(); 3017 this.endDate = this.oldEndDate.clone(); 3018 } 3019 3020 //if a new date range was selected, invoke the user callback function 3021 if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) 3022 this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel); 3023 3024 //if picker is attached to a text input, update it 3025 this.updateElement(); 3026 3027 $(document).off('.daterangepicker'); 3028 $(window).off('.daterangepicker'); 3029 this.container.hide(); 3030 this.element.trigger('hide.daterangepicker', this); 3031 this.isShowing = false; 3032 }, 3033 3034 toggle: function(e) { 3035 if (this.isShowing) { 3036 this.hide(); 3037 } else { 3038 this.show(); 3039 } 3040 }, 3041 3042 outsideClick: function(e) { 3043 var target = $(e.target); 3044 // if the page is clicked anywhere except within the daterangerpicker/button 3045 // itself then call this.hide() 3046 if ( 3047 // ie modal dialog fix 3048 e.type == "focusin" || 3049 target.closest(this.element).length || 3050 target.closest(this.container).length || 3051 target.closest('.calendar-table').length 3052 ) return; 3053 this.hide(); 3054 this.element.trigger('outsideClick.daterangepicker', this); 3055 }, 3056 3057 showCalendars: function() { 3058 this.container.addClass('show-calendar'); 3059 this.move(); 3060 this.element.trigger('showCalendar.daterangepicker', this); 3061 }, 3062 3063 hideCalendars: function() { 3064 this.container.removeClass('show-calendar'); 3065 this.element.trigger('hideCalendar.daterangepicker', this); 3066 }, 3067 3068 clickRange: function(e) { 3069 var label = e.target.getAttribute('data-range-key'); 3070 this.chosenLabel = label; 3071 if (label == this.locale.customRangeLabel) { 3072 this.showCalendars(); 3073 } else { 3074 var dates = this.ranges[label]; 3075 this.startDate = dates[0]; 3076 this.endDate = dates[1]; 3077 3078 if (!this.timePicker) { 3079 this.startDate.startOf('day'); 3080 this.endDate.endOf('day'); 3081 } 3082 3083 if (!this.alwaysShowCalendars) 3084 this.hideCalendars(); 3085 this.clickApply(); 3086 } 3087 }, 3088 3089 clickPrev: function(e) { 3090 var cal = $(e.target).parents('.drp-calendar'); 3091 if (cal.hasClass('left')) { 3092 this.leftCalendar.month.subtract(1, 'month'); 3093 if (this.linkedCalendars) 3094 this.rightCalendar.month.subtract(1, 'month'); 3095 } else { 3096 this.rightCalendar.month.subtract(1, 'month'); 3097 } 3098 this.updateCalendars(); 3099 }, 3100 3101 clickNext: function(e) { 3102 var cal = $(e.target).parents('.drp-calendar'); 3103 if (cal.hasClass('left')) { 3104 this.leftCalendar.month.add(1, 'month'); 3105 } else { 3106 this.rightCalendar.month.add(1, 'month'); 3107 if (this.linkedCalendars) 3108 this.leftCalendar.month.add(1, 'month'); 3109 } 3110 this.updateCalendars(); 3111 }, 3112 3113 hoverDate: function(e) { 3114 3115 //ignore dates that can't be selected 3116 if (!$(e.target).hasClass('available')) return; 3117 3118 var title = $(e.target).attr('data-title'); 3119 var row = title.substr(1, 1); 3120 var col = title.substr(3, 1); 3121 var cal = $(e.target).parents('.drp-calendar'); 3122 var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; 3123 3124 //highlight the dates between the start date and the date being hovered as a potential end date 3125 var leftCalendar = this.leftCalendar; 3126 var rightCalendar = this.rightCalendar; 3127 var startDate = this.startDate; 3128 if (!this.endDate) { 3129 this.container.find('.drp-calendar tbody td').each(function(index, el) { 3130 3131 //skip week numbers, only look at dates 3132 if ($(el).hasClass('week')) return; 3133 3134 var title = $(el).attr('data-title'); 3135 var row = title.substr(1, 1); 3136 var col = title.substr(3, 1); 3137 var cal = $(el).parents('.drp-calendar'); 3138 var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col]; 3139 3140 if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) { 3141 $(el).addClass('in-range'); 3142 } else { 3143 $(el).removeClass('in-range'); 3144 } 3145 3146 }); 3147 } 3148 3149 }, 3150 3151 clickDate: function(e) { 3152 3153 if (!$(e.target).hasClass('available')) return; 3154 3155 var title = $(e.target).attr('data-title'); 3156 var row = title.substr(1, 1); 3157 var col = title.substr(3, 1); 3158 var cal = $(e.target).parents('.drp-calendar'); 3159 var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; 3160 3161 // 3162 // this function needs to do a few things: 3163 // * alternate between selecting a start and end date for the range, 3164 // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date 3165 // * if autoapply is enabled, and an end date was chosen, apply the selection 3166 // * if single date picker mode, and time picker isn't enabled, apply the selection immediately 3167 // * if one of the inputs above the calendars was focused, cancel that manual input 3168 // 3169 3170 if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start 3171 if (this.timePicker) { 3172 var hour = parseInt(this.container.find('.left .hourselect').val(), 10); 3173 if (!this.timePicker24Hour) { 3174 var ampm = this.container.find('.left .ampmselect').val(); 3175 if (ampm === 'PM' && hour < 12) 3176 hour += 12; 3177 if (ampm === 'AM' && hour === 12) 3178 hour = 0; 3179 } 3180 var minute = parseInt(this.container.find('.left .minuteselect').val(), 10); 3181 if (isNaN(minute)) { 3182 minute = parseInt(this.container.find('.left .minuteselect option:last').val(), 10); 3183 } 3184 var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; 3185 date = date.clone().hour(hour).minute(minute).second(second); 3186 } 3187 this.endDate = null; 3188 this.setStartDate(date.clone()); 3189 } else if (!this.endDate && date.isBefore(this.startDate)) { 3190 //special case: clicking the same date for start/end, 3191 //but the time of the end date is before the start date 3192 this.setEndDate(this.startDate.clone()); 3193 } else { // picking end 3194 if (this.timePicker) { 3195 var hour = parseInt(this.container.find('.right .hourselect').val(), 10); 3196 if (!this.timePicker24Hour) { 3197 var ampm = this.container.find('.right .ampmselect').val(); 3198 if (ampm === 'PM' && hour < 12) 3199 hour += 12; 3200 if (ampm === 'AM' && hour === 12) 3201 hour = 0; 3202 } 3203 var minute = parseInt(this.container.find('.right .minuteselect').val(), 10); 3204 if (isNaN(minute)) { 3205 minute = parseInt(this.container.find('.right .minuteselect option:last').val(), 10); 3206 } 3207 var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; 3208 date = date.clone().hour(hour).minute(minute).second(second); 3209 } 3210 this.setEndDate(date.clone()); 3211 if (this.autoApply) { 3212 this.calculateChosenLabel(); 3213 this.clickApply(); 3214 } 3215 } 3216 3217 if (this.singleDatePicker) { 3218 this.setEndDate(this.startDate); 3219 if (!this.timePicker && this.autoApply) 3220 this.clickApply(); 3221 } 3222 3223 this.updateView(); 3224 3225 //This is to cancel the blur event handler if the mouse was in one of the inputs 3226 e.stopPropagation(); 3227 3228 }, 3229 3230 calculateChosenLabel: function () { 3231 var customRange = true; 3232 var i = 0; 3233 for (var range in this.ranges) { 3234 if (this.timePicker) { 3235 var format = this.timePickerSeconds ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm"; 3236 //ignore times when comparing dates if time picker seconds is not enabled 3237 if (this.startDate.format(format) == this.ranges[range][0].format(format) && this.endDate.format(format) == this.ranges[range][1].format(format)) { 3238 customRange = false; 3239 this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key'); 3240 break; 3241 } 3242 } else { 3243 //ignore times when comparing dates if time picker is not enabled 3244 if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { 3245 customRange = false; 3246 this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').attr('data-range-key'); 3247 break; 3248 } 3249 } 3250 i++; 3251 } 3252 if (customRange) { 3253 if (this.showCustomRangeLabel) { 3254 this.chosenLabel = this.container.find('.ranges li:last').addClass('active').attr('data-range-key'); 3255 } else { 3256 this.chosenLabel = null; 3257 } 3258 this.showCalendars(); 3259 } 3260 }, 3261 3262 clickApply: function(e) { 3263 this.hide(); 3264 this.element.trigger('apply.daterangepicker', this); 3265 }, 3266 3267 clickCancel: function(e) { 3268 this.startDate = this.oldStartDate; 3269 this.endDate = this.oldEndDate; 3270 this.hide(); 3271 this.element.trigger('cancel.daterangepicker', this); 3272 }, 3273 3274 monthOrYearChanged: function(e) { 3275 var isLeft = $(e.target).closest('.drp-calendar').hasClass('left'), 3276 leftOrRight = isLeft ? 'left' : 'right', 3277 cal = this.container.find('.drp-calendar.'+leftOrRight); 3278 3279 // Month must be Number for new moment versions 3280 var month = parseInt(cal.find('.monthselect').val(), 10); 3281 var year = cal.find('.yearselect').val(); 3282 3283 if (!isLeft) { 3284 if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) { 3285 month = this.startDate.month(); 3286 year = this.startDate.year(); 3287 } 3288 } 3289 3290 if (this.minDate) { 3291 if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) { 3292 month = this.minDate.month(); 3293 year = this.minDate.year(); 3294 } 3295 } 3296 3297 if (this.maxDate) { 3298 if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) { 3299 month = this.maxDate.month(); 3300 year = this.maxDate.year(); 3301 } 3302 } 3303 3304 if (isLeft) { 3305 this.leftCalendar.month.month(month).year(year); 3306 if (this.linkedCalendars) 3307 this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month'); 3308 } else { 3309 this.rightCalendar.month.month(month).year(year); 3310 if (this.linkedCalendars) 3311 this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month'); 3312 } 3313 this.updateCalendars(); 3314 }, 3315 3316 timeChanged: function(e) { 3317 3318 var cal = $(e.target).closest('.drp-calendar'), 3319 isLeft = cal.hasClass('left'); 3320 3321 var hour = parseInt(cal.find('.hourselect').val(), 10); 3322 var minute = parseInt(cal.find('.minuteselect').val(), 10); 3323 if (isNaN(minute)) { 3324 minute = parseInt(cal.find('.minuteselect option:last').val(), 10); 3325 } 3326 var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0; 3327 3328 if (!this.timePicker24Hour) { 3329 var ampm = cal.find('.ampmselect').val(); 3330 if (ampm === 'PM' && hour < 12) 3331 hour += 12; 3332 if (ampm === 'AM' && hour === 12) 3333 hour = 0; 3334 } 3335 3336 if (isLeft) { 3337 var start = this.startDate.clone(); 3338 start.hour(hour); 3339 start.minute(minute); 3340 start.second(second); 3341 this.setStartDate(start); 3342 if (this.singleDatePicker) { 3343 this.endDate = this.startDate.clone(); 3344 } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) { 3345 this.setEndDate(start.clone()); 3346 } 3347 } else if (this.endDate) { 3348 var end = this.endDate.clone(); 3349 end.hour(hour); 3350 end.minute(minute); 3351 end.second(second); 3352 this.setEndDate(end); 3353 } 3354 3355 //update the calendars so all clickable dates reflect the new time component 3356 this.updateCalendars(); 3357 3358 //update the form inputs above the calendars with the new time 3359 this.updateFormInputs(); 3360 3361 //re-render the time pickers because changing one selection can affect what's enabled in another 3362 this.renderTimePicker('left'); 3363 this.renderTimePicker('right'); 3364 3365 }, 3366 3367 elementChanged: function() { 3368 if (!this.element.is('input')) return; 3369 if (!this.element.val().length) return; 3370 3371 var dateString = this.element.val().split(this.locale.separator), 3372 start = null, 3373 end = null; 3374 3375 if (dateString.length === 2) { 3376 start = moment(dateString[0], this.locale.format); 3377 end = moment(dateString[1], this.locale.format); 3378 } 3379 3380 if (this.singleDatePicker || start === null || end === null) { 3381 start = moment(this.element.val(), this.locale.format); 3382 end = start; 3383 } 3384 3385 if (!start.isValid() || !end.isValid()) return; 3386 3387 this.setStartDate(start); 3388 this.setEndDate(end); 3389 this.updateView(); 3390 }, 3391 3392 keydown: function(e) { 3393 //hide on tab or enter 3394 if ((e.keyCode === 9) || (e.keyCode === 13)) { 3395 this.hide(); 3396 } 3397 3398 //hide on esc and prevent propagation 3399 if (e.keyCode === 27) { 3400 e.preventDefault(); 3401 e.stopPropagation(); 3402 3403 this.hide(); 3404 } 3405 }, 3406 3407 updateElement: function() { 3408 if (this.element.is('input') && this.autoUpdateInput) { 3409 var newValue = this.startDate.format(this.locale.format); 3410 if (!this.singleDatePicker) { 3411 newValue += this.locale.separator + this.endDate.format(this.locale.format); 3412 } 3413 if (newValue !== this.element.val()) { 3414 this.element.val(newValue).trigger('change'); 3415 } 3416 } 3417 }, 3418 3419 remove: function() { 3420 this.container.remove(); 3421 this.element.off('.daterangepicker'); 3422 this.element.removeData(); 3423 } 3424 3425 }; 3426 3427 $.fn.daterangepicker = function(options, callback) { 3428 var implementOptions = $.extend(true, {}, $.fn.daterangepicker.defaultOptions, options); 3429 this.each(function() { 3430 var el = $(this); 3431 if (el.data('daterangepicker')) 3432 el.data('daterangepicker').remove(); 3433 el.data('daterangepicker', new DateRangePicker(el, implementOptions, callback)); 3434 }); 3435 return this; 3436 }; 3437 3438 return DateRangePicker; 3439 3440})); 3441 3442/*! 3443 * Modernizr v2.6.3 3444 * www.modernizr.com 3445 * 3446 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton 3447 * Available under the BSD and MIT licenses: www.modernizr.com/license/ 3448 */ 3449 3450/* 3451 * Modernizr tests which native CSS3 and HTML5 features are available in 3452 * the current UA and makes the results available to you in two ways: 3453 * as properties on a global Modernizr object, and as classes on the 3454 * <html> element. This information allows you to progressively enhance 3455 * your pages with a granular level of control over the experience. 3456 * 3457 * Modernizr has an optional (not included) conditional resource loader 3458 * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). 3459 * To get a build that includes Modernizr.load(), as well as choosing 3460 * which tests to include, go to www.modernizr.com/download/ 3461 * 3462 * Authors Faruk Ates, Paul Irish, Alex Sexton 3463 * Contributors Ryan Seddon, Ben Alman 3464 */ 3465 3466window.Modernizr = (function( window, document, undefined ) { 3467 3468 var version = '2.6.3', 3469 3470 Modernizr = {}, 3471 3472 /*>>cssclasses*/ 3473 // option for enabling the HTML classes to be added 3474 enableClasses = true, 3475 /*>>cssclasses*/ 3476 3477 docElement = document.documentElement, 3478 3479 /** 3480 * Create our "modernizr" element that we do most feature tests on. 3481 */ 3482 mod = 'modernizr', 3483 modElem = document.createElement(mod), 3484 mStyle = modElem.style, 3485 3486 /** 3487 * Create the input element for various Web Forms feature tests. 3488 */ 3489 inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ , 3490 3491 /*>>smile*/ 3492 smile = ':)', 3493 /*>>smile*/ 3494 3495 toString = {}.toString, 3496 3497 // TODO :: make the prefixes more granular 3498 /*>>prefixes*/ 3499 // List of property values to set for css tests. See ticket #21 3500 prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), 3501 /*>>prefixes*/ 3502 3503 /*>>domprefixes*/ 3504 // Following spec is to expose vendor-specific style properties as: 3505 // elem.style.WebkitBorderRadius 3506 // and the following would be incorrect: 3507 // elem.style.webkitBorderRadius 3508 3509 // Webkit ghosts their properties in lowercase but Opera & Moz do not. 3510 // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+ 3511 // erik.eae.net/archives/2008/03/10/21.48.10/ 3512 3513 // More here: github.com/Modernizr/Modernizr/issues/issue/21 3514 omPrefixes = 'Webkit Moz O ms', 3515 3516 cssomPrefixes = omPrefixes.split(' '), 3517 3518 domPrefixes = omPrefixes.toLowerCase().split(' '), 3519 /*>>domprefixes*/ 3520 3521 /*>>ns*/ 3522 ns = {'svg': 'http://www.w3.org/2000/svg'}, 3523 /*>>ns*/ 3524 3525 tests = {}, 3526 inputs = {}, 3527 attrs = {}, 3528 3529 classes = [], 3530 3531 slice = classes.slice, 3532 3533 featureName, // used in testing loop 3534 3535 3536 /*>>
3536teststyles*/ 3537 // Inject element with style element and some CSS rules 3538 injectElementWithStyles = function( rule, callback, nodes, testnames ) { 3539 3540 var style, ret, node, docOverflow, 3541 div = document.createElement('div'), 3542 // After page load injecting a fake body doesn't work so check if body exists 3543 body = document.body, 3544 // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it. 3545 fakeBody = body || document.createElement('body'); 3546 3547 if ( parseInt(nodes, 10) ) { 3548 // In order not to give false positives we create a node for each test 3549 // This also allows the method to scale for unspecified uses 3550 while ( nodes-- ) { 3551 node = document.createElement('div'); 3552 node.id = testnames ? testnames[nodes] : mod + (nodes + 1); 3553 div.appendChild(node); 3554 } 3555 } 3556 3557 // <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed 3558 // when injected with innerHTML. To get around this you need to prepend the 'NoScope' element 3559 // with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements. 3560 // msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx 3561 // Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277 3562 style = ['­','<style id="s', mod, '">', rule, '</style>'].join(''); 3563 div.id = mod; 3564 // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody. 3565 // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270 3566 (body ? div : fakeBody).innerHTML += style; 3567 fakeBody.appendChild(div); 3568 if ( !body ) { 3569 //avoid crashing IE8, if background image is used 3570 fakeBody.style.background = ''; 3571 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 3572 fakeBody.style.overflow = 'hidden'; 3573 docOverflow = docElement.style.overflow; 3574 docElement.style.overflow = 'hidden'; 3575 docElement.appendChild(fakeBody); 3576 } 3577 3578 ret = callback(div, rule); 3579 // If this is done after page load we don't want to remove the body so check if body exists 3580 if ( !body ) { 3581 fakeBody.parentNode.removeChild(fakeBody); 3582 docElement.style.overflow = docOverflow; 3583 } else { 3584 div.parentNode.removeChild(div); 3585 } 3586 3587 return !!ret; 3588 3589 }, 3590 /*>>teststyles*/ 3591 3592 /*>>mq*/ 3593 // adapted from matchMedia polyfill 3594 // by Scott Jehl and Paul Irish 3595 // gist.github.com/786768 3596 testMediaQuery = function( mq ) { 3597 3598 var matchMedia = window.matchMedia || window.msMatchMedia; 3599 if ( matchMedia ) { 3600 return matchMedia(mq).matches; 3601 } 3602 3603 var bool; 3604 3605 injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { 3606 bool = (window.getComputedStyle ? 3607 getComputedStyle(node, null) : 3608 node.currentStyle)['position'] == 'absolute'; 3609 }); 3610 3611 return bool; 3612 3613 }, 3614 /*>>mq*/ 3615 3616 3617 /*>>hasevent*/ 3618 // 3619 // isEventSupported determines if a given element supports the given event 3620 // kangax.github.com/iseventsupported/ 3621 // 3622 // The following results are known incorrects: 3623 // Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative 3624 // Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333 3625 // ... 3626 isEventSupported = (function() { 3627 3628 var TAGNAMES = { 3629 'select': 'input', 'change': 'input', 3630 'submit': 'form', 'reset': 'form', 3631 'error': 'img', 'load': 'img', 'abort': 'img' 3632 }; 3633 3634 function isEventSupported( eventName, element ) { 3635 3636 element = element || document.createElement(TAGNAMES[eventName] || 'div'); 3637 eventName = 'on' + eventName; 3638 3639 // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those 3640 var isSupported = eventName in element; 3641 3642 if ( !isSupported ) { 3643 // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element 3644 if ( !element.setAttribute ) { 3645 element = document.createElement('div'); 3646 } 3647 if ( element.setAttribute && element.removeAttribute ) { 3648 element.setAttribute(eventName, ''); 3649 isSupported = is(element[eventName], 'function'); 3650 3651 // If property was created, "remove it" (by setting value to `undefined`) 3652 if ( !is(element[eventName], 'undefined') ) { 3653 element[eventName] = undefined; 3654 } 3655 element.removeAttribute(eventName); 3656 } 3657 } 3658 3659 element = null; 3660 return isSupported; 3661 } 3662 return isEventSupported; 3663 })(), 3664 /*>>hasevent*/ 3665 3666 // TODO :: Add flag for hasownprop ? didn't last time 3667 3668 // hasOwnProperty shim by kangax needed for Safari 2.0 support 3669 _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; 3670 3671 if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { 3672 hasOwnProp = function (object, property) { 3673 return _hasOwnProperty.call(object, property); 3674 }; 3675 } 3676 else { 3677 hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ 3678 return ((property in object) && is(object.constructor.prototype[property], 'undefined')); 3679 }; 3680 } 3681 3682 // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js 3683 // es5.github.com/#x15.3.4.5 3684 3685 if (!Function.prototype.bind) { 3686 Function.prototype.bind = function bind(that) { 3687 3688 var target = this; 3689 3690 if (typeof target != "function") { 3691 throw new TypeError(); 3692 } 3693 3694 var args = slice.call(arguments, 1), 3695 bound = function () { 3696 3697 if (this instanceof bound) { 3698 3699 var F = function(){}; 3700 F.prototype = target.prototype; 3701 var self = new F(); 3702 3703 var result = target.apply( 3704 self, 3705 args.concat(slice.call(arguments)) 3706 ); 3707 if (Object(result) === result) { 3708 return result; 3709 } 3710 return self; 3711 3712 } else { 3713 3714 return target.apply( 3715 that, 3716 args.concat(slice.call(arguments)) 3717 ); 3718 3719 } 3720 3721 }; 3722 3723 return bound; 3724 }; 3725 } 3726 3727 /** 3728 * setCss applies given styles to the Modernizr DOM node. 3729 */ 3730 function setCss( str ) { 3731 mStyle.cssText = str; 3732 } 3733 3734 /** 3735 * setCssAll extrapolates all vendor-specific css strings. 3736 */ 3737 function setCssAll( str1, str2 ) { 3738 return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); 3739 } 3740 3741 /** 3742 * is returns a boolean for if typeof obj is exactly type. 3743 */ 3744 function is( obj, type ) { 3745 return typeof obj === type; 3746 } 3747 3748 /** 3749 * contains returns a boolean for if substr is found within str. 3750 */ 3751 function contains( str, substr ) {
3752 return !!~('' + str).indexOf(substr); 3753 } 3754 3755 /*>>testprop*/ 3756 3757 // testProps is a generic CSS / DOM property test. 3758 3759 // In testing support for a given CSS property, it's legit to test: 3760 // `elem.style[styleName] !== undefined` 3761 // If the property is supported it will return an empty string, 3762 // if unsupported it will return undefined. 3763 3764 // We'll take advantage of this quick test and skip setting a style 3765 // on our modernizr element, but instead just testing undefined vs 3766 // empty string. 3767 3768 // Because the testing of the CSS property names (with "-", as 3769 // opposed to the camelCase DOM properties) is non-portable and 3770 // non-standard but works in WebKit and IE (but not Gecko or Opera), 3771 // we explicitly reject properties with dashes so that authors 3772 // developing in WebKit or IE first don't end up with 3773 // browser-specific content by accident. 3774 3775 function testProps( props, prefixed ) { 3776 for ( var i in props ) { 3777 var prop = props[i]; 3778 if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { 3779 return prefixed == 'pfx' ? prop : true; 3780 } 3781 } 3782 return false; 3783 } 3784 /*>>testprop*/ 3785 3786 // TODO :: add testDOMProps 3787 /** 3788 * testDOMProps is a generic DOM property test; if a browser supports 3789 * a certain property, it won't return undefined for it. 3790 */ 3791 function testDOMProps( props, obj, elem ) { 3792 for ( var i in props ) { 3793 var item = obj[props[i]]; 3794 if ( item !== undefined) { 3795 3796 // return the property name as a string 3797 if (elem === false) return props[i]; 3798 3799 // let's bind a function 3800 if (is(item, 'function')){ 3801 // default to autobind unless override 3802 return item.bind(elem || obj); 3803 } 3804 3805 // return the unbound function or obj or value 3806 return item; 3807 } 3808 } 3809 return false; 3810 } 3811 3812 /*>>testallprops*/ 3813 /** 3814 * testPropsAll tests a list of DOM properties we want to check against. 3815 * We specify literally ALL possible (known and/or likely) properties on 3816 * the element including the non-vendor prefixed one, for forward- 3817 * compatibility. 3818 */ 3819 function testPropsAll( prop, prefixed, elem ) { 3820 3821 var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), 3822 props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); 3823 3824 // did they call .prefixed('boxSizing') or are we just testing a prop? 3825 if(is(prefixed, "string") || is(prefixed, "undefined")) { 3826 return testProps(props, prefixed); 3827 3828 // otherwise, they called .prefixed('requestAnimationFrame', window[, elem]) 3829 } else { 3830 props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); 3831 return testDOMProps(props, prefixed, elem); 3832 } 3833 } 3834 /*>>testallprops*/ 3835 3836 3837 /** 3838 * Tests 3839 * ----- 3840 */ 3841 3842 // The *new* flexbox 3843 // dev.w3.org/csswg/css3-flexbox 3844 3845 tests['flexbox'] = function() { 3846 return testPropsAll('flexWrap'); 3847 }; 3848 3849 // The *old* flexbox 3850 // www.w3.org/TR/2009/WD-css3-flexbox-20090723/ 3851 3852 tests['flexboxlegacy'] = function() { 3853 return testPropsAll('boxDirection'); 3854 }; 3855 3856 // On the S60 and BB Storm, getContext exists, but always returns undefined 3857 // so we actually have to call getContext() to verify 3858 // github.com/Modernizr/Modernizr/issues/issue/97/ 3859 3860 tests['canvas'] = function() { 3861 var elem = document.createElement('canvas'); 3862 return !!(elem.getContext && elem.getContext('2d')); 3863 }; 3864 3865 tests['canvastext'] = function() { 3866 return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); 3867 }; 3868 3869 // webk.it/70117 is tracking a legit WebGL feature detect proposal 3870 3871 // We do a soft detect which may false positive in order to avoid 3872 // an expensive context creation: bugzil.la/732441 3873 3874 tests['webgl'] = function() { 3875 return !!window.WebGLRenderingContext; 3876 }; 3877 3878 /* 3879 * The Modernizr.touch test only indicates if the browser supports 3880 * touch events, which does not necessarily reflect a touchscreen 3881 * device, as evidenced by tablets running Windows 7 or, alas, 3882 * the Palm Pre / WebOS (touch) phones. 3883 * 3884 * Additionally, Chrome (desktop) used to lie about its support on this, 3885 * but that has since been rectified: crbug.com/36415 3886 * 3887 * We also test for Firefox 4 Multitouch Support. 3888 * 3889 * For more info, see: modernizr.github.com/Modernizr/touch.html 3890 */ 3891 3892 tests['touch'] = function() { 3893 var bool; 3894 3895 if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { 3896 bool = true; 3897 } else { 3898 injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { 3899 bool = node.offsetTop === 9; 3900 }); 3901 } 3902 3903 return bool; 3904 }; 3905 3906 3907 // geolocation is often considered a trivial feature detect... 3908 // Turns out, it's quite tricky to get right: 3909 // 3910 // Using !!navigator.geolocation does two things we don't want. It: 3911 // 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513 3912 // 2. Disables page caching in WebKit: webk.it/43956 3913 // 3914 // Meanwhile, in Firefox < 8, an about:config setting could expose 3915 // a false positive that would throw an exception: bugzil.la/688158 3916 3917 tests['geolocation'] = function() { 3918 return 'geolocation' in navigator; 3919 }; 3920 3921 3922 tests['postmessage'] = function() { 3923 return !!window.postMessage; 3924 }; 3925 3926 3927 // Chrome incognito mode used to throw an exception when using openDatabase 3928 // It doesn't anymore. 3929 tests['websqldatabase'] = function() {
3930 return !!window.openDatabase; 3931 }; 3932 3933 // Vendors had inconsistent prefixing with the experimental Indexed DB: 3934 // - Webkit's implementation is accessible through webkitIndexedDB 3935 // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB 3936 // For speed, we don't test the legacy (and beta-only) indexedDB 3937 tests['indexedDB'] = function() { 3938 return !!testPropsAll("indexedDB", window); 3939 }; 3940 3941 // documentMode logic from YUI to filter out IE8 Compat Mode 3942 // which false positives. 3943 tests['hashchange'] = function() { 3944 return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); 3945 }; 3946 3947 // Per 1.6: 3948 // This used to be Modernizr.historymanagement but the longer 3949 // name has been deprecated in favor of a shorter and property-matching one. 3950 // The old API is still available in 1.6, but as of 2.0 will throw a warning, 3951 // and in the first release thereafter disappear entirely. 3952 tests['history'] = function() { 3953 return !!(window.history && history.pushState); 3954 }; 3955 3956 tests['draganddrop'] = function() { 3957 var div = document.createElement('div'); 3958 return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); 3959 }; 3960 3961 // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10 3962 // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17. 3963 // FF10 still uses prefixes, so check for it until then. 3964 // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/ 3965 tests['websockets'] = function() { 3966 return 'WebSocket' in window || 'MozWebSocket' in window; 3967 }; 3968 3969 3970 // css-tricks.com/rgba-browser-support/ 3971 tests['rgba'] = function() { 3972 // Set an rgba() color and check the returned value 3973 3974 setCss('background-color:rgba(150,255,150,.5)'); 3975 3976 return contains(mStyle.backgroundColor, 'rgba'); 3977 }; 3978 3979 tests['hsla'] = function() { 3980 // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, 3981 // except IE9 who retains it as hsla 3982 3983 setCss('background-color:hsla(120,40%,100%,.5)'); 3984 3985 return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); 3986 }; 3987 3988 tests['multiplebgs'] = function() { 3989 // Setting multiple images AND a color on the background shorthand property 3990 // and then querying the style.background property value for the number of 3991 // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! 3992 3993 setCss('background:url(https://),url(https://),red url(https://)'); 3994 3995 // If the UA supports multiple backgrounds, there should be three occurrences 3996 // of the string "url(" in the return value for elemStyle.background 3997 3998 return (/(url\s*\(.*?){3}/).test(mStyle.background); 3999 }; 4000 4001 4002 4003 // this will false positive in Opera Mini 4004 // github.com/Modernizr/Modernizr/issues/396 4005 4006 tests['backgroundsize'] = function() { 4007 return testPropsAll('backgroundSize'); 4008 }; 4009 4010 tests['borderimage'] = function() { 4011 return testPropsAll('borderImage'); 4012 }; 4013 4014 4015 // Super comprehensive table about all the unique implementations of 4016 // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance 4017
4018 tests['borderradius'] = function() { 4019 return testPropsAll('borderRadius'); 4020 }; 4021 4022 // WebOS unfortunately false positives on this test. 4023 tests['boxshadow'] = function() { 4024 return testPropsAll('boxShadow'); 4025 }; 4026 4027 // FF3.0 will false positive on this test 4028 tests['textshadow'] = function() { 4029 return document.createElement('div').style.textShadow === ''; 4030 }; 4031 4032 4033 tests['opacity'] = function() { 4034 // Browsers that actually have CSS Opacity implemented have done so 4035 // according to spec, which means their return values are within the 4036 // range of [0.0,1.0] - including the leading zero. 4037 4038 setCssAll('opacity:.55'); 4039 4040 // The non-literal . in this regex is intentional: 4041 // German Chrome returns this value as 0,55 4042 // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 4043 return (/^0.55$/).test(mStyle.opacity); 4044 }; 4045 4046 4047 // Note, Android < 4 will pass this test, but can only animate 4048 // a single property at a time 4049 // daneden.me/2011/12/putting-up-with-androids-bullshit/ 4050 tests['cssanimations'] = function() { 4051 return testPropsAll('animationName'); 4052 }; 4053 4054 4055 tests['csscolumns'] = function() { 4056 return testPropsAll('columnCount'); 4057 }; 4058 4059 4060 tests['cssgradients'] = function() { 4061 /** 4062 * For CSS Gradients syntax, please see: 4063 * webkit.org/blog/175/introducing-css-gradients/ 4064 * developer.mozilla.org/en/CSS/-moz-linear-gradient 4065 * developer.mozilla.org/en/CSS/-moz-radial-gradient 4066 * dev.w3.org/csswg/css3-images/#gradients- 4067 */ 4068 4069 var str1 = 'background-image:', 4070 str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', 4071 str3 = 'linear-gradient(left top,#9f9, white);'; 4072 4073 setCss( 4074 // legacy webkit syntax (FIXME: remove when syntax not in use anymore) 4075 (str1 + '-webkit- '.split(' ').join(str2 + str1) + 4076 // standard syntax // trailing 'background-image:' 4077 prefixes.join(str3 + str1)).slice(0, -str1.length) 4078 ); 4079 4080 return contains(mStyle.backgroundImage, 'gradient'); 4081 }; 4082 4083 4084 tests['cssreflections'] = function() { 4085 return testPropsAll('boxReflect'); 4086 }; 4087 4088 4089 tests['csstransforms'] = function() { 4090 return !!testPropsAll('transform'); 4091 }; 4092 4093 4094 tests['csstransforms3d'] = function() { 4095 4096 var ret = !!testPropsAll('perspective'); 4097 4098 // Webkit's 3D transforms are passed off to the browser's own graphics renderer. 4099 // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in 4100 // some conditions. As a result, Webkit typically recognizes the syntax but 4101 // will sometimes throw a false positive, thus we must do a more thorough check: 4102 if ( ret && 'webkitPerspective' in docElement.style ) { 4103 4104 // Webkit allows this media query to succeed only if the feature is enabled. 4105 // `@media (transform-3d),(-webkit-transform-3d){ ... }` 4106 injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { 4107 ret = node.offsetLeft === 9 && node.offsetHeight === 3; 4108 }); 4109 } 4110 return ret; 4111 }; 4112 4113 4114 tests['csstransitions'] = function() { 4115 return testPropsAll('transition'); 4116 }; 4117 4118 4119 /*>>fontface*/ 4120 // @font-face detection routine by Diego Perini 4121 // javascript.nwbox.com/CSSSupport/ 4122 4123 // false positives: 4124 // WebOS github.com/Modernizr/Modernizr/issues/342 4125 // WP7 github.com/Modernizr/Modernizr/issues/538 4126 tests['fontface'] = function() { 4127 var bool; 4128 4129 injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { 4130 var style = document.getElementById('smodernizr'), 4131 sheet = style.sheet || style.styleSheet, 4132 cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; 4133 4134 bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; 4135 }); 4136 4137 return bool; 4138 }; 4139 /*>>fontface*/ 4140 4141 // CSS generated content detection 4142 tests['generatedcontent'] = function() { 4143 var bool; 4144 4145 injectElementWithStyles(['#',mod,'{font:0/0 a}
4145#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { 4146 bool = node.offsetHeight >= 3; 4147 }); 4148 4149 return bool; 4150 }; 4151 4152 4153 4154 // These tests evaluate support of the video/audio elements, as well as 4155 // testing what types of content they support. 4156 // 4157 // We're using the Boolean constructor here, so that we can extend the value 4158 // e.g. Modernizr.video // true 4159 // Modernizr.video.ogg // 'probably' 4160 // 4161 // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 4162 // thx to NielsLeenheer and zcorpan 4163 4164 // Note: in some older browsers, "no" was a return value instead of empty string. 4165 // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 4166 // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 4167 4168 tests['video'] = function() { 4169 var elem = document.createElement('video'), 4170 bool = false; 4171 4172 // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 4173 try { 4174 if ( bool = !!elem.canPlayType ) { 4175 bool = new Boolean(bool); 4176 bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); 4177
4178 // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 4179 bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); 4180 4181 bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); 4182 } 4183 4184 } catch(e) { } 4185 4186 return bool; 4187 }; 4188 4189 tests['audio'] = function() { 4190 var elem = document.createElement('audio'), 4191 bool = false; 4192 4193 try { 4194 if ( bool = !!elem.canPlayType ) { 4195 bool = new Boolean(bool); 4196 bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); 4197 bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); 4198 4199 // Mimetypes accepted: 4200 // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements 4201 // bit.ly/iphoneoscodecs 4202 bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); 4203 bool.m4a = ( elem.canPlayType('audio/x-m4a;') || 4204 elem.canPlayType('audio/aac;')) .replace(/^no$/,''); 4205 } 4206 } catch(e) { } 4207 4208 return bool; 4209 }; 4210 4211 4212 // In FF4, if disabled, window.localStorage should === null. 4213 4214 // Normally, we could not test that directly and need to do a 4215 // `('localStorage' in window) && ` test first because otherwise Firefox will 4216 // throw bugzil.la/365772 if cookies are disabled 4217 4218 // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem 4219 // will throw the exception: 4220 // QUOTA_EXCEEDED_ERRROR DOM Exception 22. 4221 // Peculiarly, getItem and removeItem calls do not throw. 4222 4223 // Because we are forced to try/catch this, we'll go aggressive. 4224 4225 // Just FWIW: IE8 Compat mode supports these features completely: 4226 // www.quirksmode.org/dom/html5.html 4227 // But IE8 doesn't support either with local files 4228 4229 tests['localstorage'] = function() { 4230 try { 4231 localStorage.setItem(mod, mod); 4232 localStorage.removeItem(mod); 4233 return true; 4234 } catch(e) { 4235 return false; 4236 } 4237 }; 4238 4239 tests['sessionstorage'] = function() { 4240 try { 4241 sessionStorage.setItem(mod, mod); 4242 sessionStorage.removeItem(mod); 4243 return true; 4244 } catch(e) { 4245 return false; 4246 } 4247 }; 4248 4249 4250 tests['webworkers'] = function() { 4251 return !!window.Worker; 4252 }; 4253 4254 4255 tests['applicationcache'] = function() { 4256 return !!window.applicationCache; 4257 }; 4258 4259 4260 // Thanks to Erik Dahlstrom 4261 tests['svg'] = function() { 4262 return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; 4263 }; 4264 4265 // specifically for SVG inline in HTML, not within XHTML 4266 // test page: paulirish.com/demo/inline-svg 4267 tests['inlinesvg'] = function() { 4268 var div = document.createElement('div'); 4269 div.innerHTML = '<svg/>'; 4270 return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; 4271 }; 4272 4273 // SVG SMIL animation 4274 tests['smil'] = function() { 4275 return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); 4276 }; 4277 4278 // This test is only for clip paths in SVG proper, not clip paths on HTML content 4279 // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg 4280 4281 // However read the comments to dig into applying SVG clippaths to HTML content here: 4282 // github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491 4283 tests['svgclippaths'] = function() { 4284 return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); 4285 }; 4286 4287 /*>>webforms*/ 4288 // input features and input types go directly onto the ret object, bypassing the tests loop. 4289 // Hold this guy to execute in a moment. 4290 function webforms() { 4291 /*>>input*/ 4292 // Run through HTML5's new input attributes to see if the UA understands any. 4293 // We're using f which is the <input> element created early on 4294 // Mike Taylr has created a comprehensive resource for testing these attributes 4295 // when applied to all input types: 4296 // miketaylr.com/code/input-type-attr.html 4297 // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary 4298 4299 // Only input placeholder is tested while textarea's placeholder is not. 4300 // Currently Safari 4 and Opera 11 have support only for the input placeholder 4301 // Both tests are available in feature-detects/forms-placeholder.js 4302 Modernizr['input'] = (function( props ) { 4303 for ( var i = 0, len = props.length; i < len; i++ ) { 4304 attrs[ props[i] ] = !!(props[i] in inputElem); 4305 } 4306 if (attrs.list){ 4307 // safari false positive's on datalist: webk.it/74252 4308 // see also github.com/Modernizr/Modernizr/issues/146 4309 attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); 4310 } 4311 return attrs; 4312 })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); 4313 /*>>input*/ 4314 4315 /*>>inputtypes*/ 4316 // Run through HTML5's new input types to see if the UA understands any. 4317 // This is put behind the tests runloop because it doesn't return a 4318 // true/false like all the other tests; instead, it returns an object 4319 // containing each input type with its corresponding true/false value 4320 4321 // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/ 4322 Modernizr['inputtypes'] = (function(props) { 4323 4324 for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { 4325 4326 inputElem.setAttribute('type', inputElemType = props[i]); 4327 bool = inputElem.type !== 'text'; 4328 4329 // We first check to see if the type we give it sticks.. 4330 // If the type does, we feed it a textual value, which shouldn't be val
4330id. 4331 // If the value doesn't stick, we know there's input sanitization which infers a custom UI 4332 if ( bool ) { 4333 4334 inputElem.value = smile; 4335 inputElem.style.cssText = 'position:absolute;visibility:hidden;'; 4336 4337 if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { 4338 4339 docElement.appendChild(inputElem); 4340 defaultView = document.defaultView; 4341 4342 // Safari 2-4 allows the smiley as a value, despite making a slider 4343 bool = defaultView.getComputedStyle && 4344 defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && 4345 // Mobile android web browser has false positive, so must 4346 // check the height to see if the widget is actually there. 4347 (inputElem.offsetHeight !== 0); 4348 4349 docElement.removeChild(inputElem); 4350 4351 } else if ( /^(search|tel)$/.test(inputElemType) ){ 4352 // Spec doesn't define any special parsing or detectable UI 4353 // behaviors so we pass these through as true 4354 4355 // Interestingly, opera fails the earlier test, so it doesn't 4356 // even make it here. 4357 4358 } else if ( /^(url|email)$/.test(inputElemType) ) { 4359 // Real url and email support comes with prebaked validation. 4360 bool = inputElem.checkValidity && inputElem.checkValidity() === false; 4361 4362 } else { 4363 // If the upgraded input compontent rejects the :) text, we got a winner 4364 bool = inputElem.value != smile; 4365 } 4366 } 4367 4368 inputs[ props[i] ] = !!bool; 4369 } 4370 return inputs; 4371 })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); 4372 /*>>inputtypes*/ 4373 } 4374 /*>>webforms*/ 4375 4376 4377 // End of test definitions 4378 // ----------------------- 4379 4380 4381 4382 // Run through all tests and detect their support in the current UA. 4383 // todo: hypothetically we could be doing an array of tests and use a basic loop here. 4384 for ( var feature in tests ) { 4385 if ( hasOwnProp(tests, feature) ) { 4386 // run the test, throw the return value into the Modernizr, 4387 // then based on that boolean, define an appropriate className 4388 // and push it into an array of classes we'll join later. 4389 featureName = feature.toLowerCase(); 4390 Modernizr[featureName] = tests[feature](); 4391 4392 classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); 4393 } 4394 } 4395 4396 /*>>webforms*/ 4397 // input tests need to run. 4398 Modernizr.input || webforms(); 4399 /*>>webforms*/ 4400 4401 4402 /** 4403 * addTest allows the user to define their own feature tests 4404 * the result will be added onto the Modernizr object, 4405 * as well as an appropriate className set on the html element 4406 * 4407 * @param feature - String naming the feature 4408 * @param test - Function returning true if feature is supported, false if not 4409 */ 4410 Modernizr.addTest = function ( feature, test ) { 4411 if ( typeof feature == 'object' ) { 4412 for ( var key in feature ) { 4413 if ( hasOwnProp( feature, key ) ) { 4414 Modernizr.addTest( key, feature[ key ] ); 4415 } 4416 } 4417 } else { 4418 4419 feature = feature.toLowerCase(); 4420 4421 if ( Modernizr[feature] !== undefined ) { 4422 // we're going to quit if you're trying to overwrite an existing test 4423 // if we were to allow it, we'd do this: 4424 // var re = new RegExp("\\b(no-)?" + feature + "\\b"); 4425 // docElement.className = docElement.className.replace( re, '' ); 4426 // but, no rly, stuff 'em. 4427 return Modernizr; 4428 } 4429 4430 test = typeof test == 'function' ? test() : test; 4431 4432 if (typeof enableClasses !== "undefined" && enableClasses) { 4433 docElement.className += ' ' + (test ? '' : 'no-') + feature; 4434 } 4435 Modernizr[feature] = test; 4436 4437 } 4438 4439 return Modernizr; // allow chaining. 4440 }; 4441 4442 4443 // Reset modElem.cssText to nothing to reduce memory footprint. 4444 setCss(''); 4445 modElem = inputElem = null; 4446 4447 /*>>shiv*/ 4448 /*! HTML5 Shiv v3.6.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ 4449 ;(function(window, document) { 4450 /*jshint evil:true */ 4451 /** Preset options */ 4452 var options = window.html5 || {}; 4453 4454 /** Used to skip problem elements */ 4455 var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; 4456 4457 /** Not all elements can be cloned in IE **/ 4458 var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; 4459 4460 /** Detect whether the browser supports default html5 styles */ 4461 var supportsHtml5Styles; 4462 4463 /** Name of the expando, to work with multiple documents or to re-shiv one document */ 4464 var expando = '_html5shiv'; 4465 4466 /** The id for the the documents expando */ 4467 var expanID = 0; 4468 4469 /** Cached data for each document */ 4470 var expandoData = {}; 4471 4472 /** Detect whether the browser supports unknown elements */ 4473 var supportsUnknownElements; 4474 4475 (function() { 4476 try { 4477 var a = document.createElement('a'); 4478 a.innerHTML = '<xyz></xyz>'; 4479 //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles 4480 supportsHtml5Styles = ('hidden' in a); 4481 4482 supportsUnknownElements = a.childNodes.length == 1 || (function() { 4483 // assign a false positive if unable to shiv 4484 (document.createElement)('a'); 4485 var frag = document.createDocumentFragment(); 4486 return ( 4487 typeof frag.cloneNode == 'undefined' || 4488 typeof frag.createDocumentFragment == 'undefined' || 4489 typeof frag.createElement == 'undefined' 4490 ); 4491 }()); 4492 } catch(e) { 4493 supportsHtml5Styles = true; 4494 supportsUnknownElements = true; 4495 } 4496 4497 }()); 4498 4499 /*--------------------------------------------------------------------------*/ 4500 4501 /** 4502 * Creates a style sheet with the given CSS text and adds it to the document. 4503 * @private 4504 * @param {Document} ownerDocument The document. 4505 * @param {String} cssText The CSS text. 4506 * @returns {StyleSheet} The style element. 4507 */ 4508 function addStyleSheet(ownerDocument, cssText) { 4509 var p = ownerDocument.createElement('p'), 4510 parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; 4511 4512 p.innerHTML = 'x<style>' + cssText + '</style>'; 4513 return parent.insertBefore(p.lastChild, parent.firstChild); 4514 } 4515 4516 /** 4517 * Returns the value of `html5.elements` as an array.
vendor: 5,012 bytes, lines 4518-4657
4518 * @private 4519 * @returns {Array} An array of shived element node names. 4520 */ 4521 function getElements() { 4522 var elements = html5.elements; 4523 return typeof elements == 'string' ? elements.split(' ') : elements; 4524 } 4525 4526 /** 4527 * Returns the data associated to the given document 4528 * @private 4529 * @param {Document} ownerDocument The document. 4530 * @returns {Object} An object of data. 4531 */ 4532 function getExpandoData(ownerDocument) { 4533 var data = expandoData[ownerDocument[expando]]; 4534 if (!data) { 4535 data = {}; 4536 expanID++; 4537 ownerDocument[expando] = expanID; 4538 expandoData[expanID] = data; 4539 } 4540 return data; 4541 } 4542 4543 /** 4544 * returns a shived element for the given nodeName and document 4545 * @memberOf html5 4546 * @param {String} nodeName name of the element 4547 * @param {Document} ownerDocument The context document. 4548 * @returns {Object} The shived element. 4549 */ 4550 function createElement(nodeName, ownerDocument, data){ 4551 if (!ownerDocument) { 4552 ownerDocument = document; 4553 } 4554 if(supportsUnknownElements){ 4555 return ownerDocument.createElement(nodeName); 4556 } 4557 if (!data) { 4558 data = getExpandoData(ownerDocument); 4559 } 4560 var node; 4561 4562 if (data.cache[nodeName]) { 4563 node = data.cache[nodeName].cloneNode(); 4564 } else if (saveClones.test(nodeName)) { 4565 node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); 4566 } else { 4567 node = data.createElem(nodeName); 4568 } 4569 4570 // Avoid adding some elements to fragments in IE < 9 because 4571 // * Attributes like `name` or `type` cannot be set/changed once an element 4572 // is inserted into a document/fragment 4573 // * Link elements with `src` attributes that are inaccessible, as with 4574 // a 403 response, will cause the tab/window to crash 4575 // * Script elements appended to fragments will execute when their `src` 4576 // or `text` property is set 4577 return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node; 4578 } 4579 4580 /** 4581 * returns a shived DocumentFragment for the given document 4582 * @memberOf html5 4583 * @param {Document} ownerDocument The context document. 4584 * @returns {Object} The shived DocumentFragment. 4585 */ 4586 function createDocumentFragment(ownerDocument, data){ 4587 if (!ownerDocument) { 4588 ownerDocument = document; 4589 } 4590 if(supportsUnknownElements){ 4591 return ownerDocument.createDocumentFragment(); 4592 } 4593 data = data || getExpandoData(ownerDocument); 4594 var clone = data.frag.cloneNode(), 4595 i = 0, 4596 elems = getElements(), 4597 l = elems.length; 4598 for(;i<l;i++){ 4599 clone.createElement(elems[i]); 4600 } 4601 return clone; 4602 } 4603 4604 /** 4605 * Shivs the `createElement` and `createDocumentFragment` methods of the document. 4606 * @private 4607 * @param {Document|DocumentFragment} ownerDocument The document. 4608 * @param {Object} data of the document. 4609 */ 4610 function shivMethods(ownerDocument, data) { 4611 if (!data.cache) { 4612 data.cache = {}; 4613 data.createElem = ownerDocument.createElement; 4614 data.createFrag = ownerDocument.createDocumentFragment; 4615 data.frag = data.createFrag(); 4616 } 4617 4618 4619 ownerDocument.createElement = function(nodeName) { 4620 //abort shiv 4621 if (!html5.shivMethods) { 4622 return data.createElem(nodeName); 4623 } 4624 return createElement(nodeName, ownerDocument, data); 4625 }; 4626 4627 ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + 4628 'var n=f.cloneNode(),c=n.createElement;' + 4629 'h.shivMethods&&(' + 4630 // unroll the `createElement` calls 4631 getElements().join().replace(/\w+/g, function(nodeName) { 4632 data.createElem(nodeName); 4633 data.frag.createElement(nodeName); 4634 return 'c("' + nodeName + '")'; 4635 }) + 4636 ');return n}' 4637 )(html5, data.frag); 4638 } 4639 4640 /*--------------------------------------------------------------------------*/ 4641 4642 /** 4643 * Shivs the given document. 4644 * @memberOf html5 4645 * @param {Document} ownerDocument The document to shiv. 4646 * @returns {Document} The shived document. 4647 */ 4648 function shivDocument(ownerDocument) { 4649 if (!ownerDocument) { 4650 ownerDocument = document; 4651 } 4652 var data = getExpandoData(ownerDocument); 4653 4654 if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { 4655 data.hasCSS = !!addStyleSheet(ownerDocument, 4656 // corrects block display not defined in IE6/7/8/9 4657 'article,aside,figcaption,figure,footer,header,hgroup,nav,section{dis
4657play:block}' + 4658 // adds styling not present in IE6/7/8/9 4659 'mark{background:#FF0;color:#000}' 4660 ); 4661 } 4662 if (!supportsUnknownElements) { 4663 shivMethods(ownerDocument, data); 4664 } 4665 return ownerDocument; 4666 } 4667 4668 /*--------------------------------------------------------------------------*/ 4669 4670 /** 4671 * The `html5` object is exposed so that more elements can be shived and 4672 * existing shiving can be detected on iframes. 4673 * @type Object 4674 * @example 4675 * 4676 * // options can be changed before the script is included 4677 * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; 4678 */ 4679 var html5 = { 4680 4681 /** 4682 * An array or space separated string of node names of the elements to shiv. 4683 * @memberOf html5 4684 * @type Array|String 4685 */ 4686 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video', 4687 4688 /** 4689 * A flag to indicate that the HTML5 style sheet should be inserted. 4690 * @memberOf html5 4691 * @type Boolean 4692 */ 4693 'shivCSS': (options.shivCSS !== false), 4694 4695 /** 4696 * Is equal to true if a browser supports creating unknown/HTML5 elements 4697 * @memberOf html5 4698 * @type boolean 4699 */ 4700 'supportsUnknownElements': supportsUnknownElements, 4701 4702 /** 4703 * A flag to indicate that the document's `createElement` and `createDocumentFragment` 4704 * methods should be overwritten. 4705 * @memberOf html5 4706 * @type Boolean 4707 */ 4708 'shivMethods': (options.shivMethods !== false), 4709 4710 /** 4711 * A string to describe the type of `html5` object ("default" or "default print"). 4712 * @memberOf html5
4713 * @type String 4714 */ 4715 'type': 'default', 4716 4717 // shivs the document according to the specified `html5` object options 4718 'shivDocument': shivDocument, 4719 4720 //creates a shived element 4721 createElement: createElement, 4722 4723 //creates a shived documentFragment 4724 createDocumentFragment: createDocumentFragment 4725 }; 4726 4727 /*--------------------------------------------------------------------------*/ 4728 4729 // expose html5 4730 window.html5 = html5; 4731 4732 // shiv the document 4733 shivDocument(document); 4734 4735 }(this, document)); 4736 /*>>shiv*/ 4737 4738 // Assign private properties to the return object with prefix 4739 Modernizr._version = version; 4740 4741 // expose these for the plugin API. Look in the source for how to join() them against your input 4742 /*>>prefixes*/ 4743 Modernizr._prefixes = prefixes; 4744 /*>>prefixes*/ 4745 /*>>domprefixes*/ 4746 Modernizr._domPrefixes = domPrefixes; 4747 Modernizr._cssomPrefixes = cssomPrefixes; 4748 /*>>domprefixes*/ 4749 4750 /*>>mq*/ 4751 // Modernizr.mq tests a given media query, live against the current state of the window 4752 // A few important notes: 4753 // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false 4754 // * A max-width or orientation query will be evaluated against the current state, which may change later. 4755 // * You must specify values. Eg. If you are testing support for the min-width media query use: 4756 // Modernizr.mq('(min-width:0)') 4757 // usage: 4758 // Modernizr.mq('only screen and (max-width:768)') 4759 Modernizr.mq = testMediaQuery; 4760 /*>>mq*/ 4761 4762 /*>>hasevent*/ 4763 // Modernizr.hasEvent() detects support for a given event, with an optional element to test on 4764 // Modernizr.hasEvent('gesturestart', elem) 4765 Modernizr.hasEvent = isEventSupported; 4766 /*>>hasevent*/ 4767 4768 /*>>testprop*/ 4769 // Modernizr.testProp() investigates whether a given style property is recognized 4770 // Note that the property names must be provided in the camelCase variant. 4771 // Modernizr.testProp('pointerEvents') 4772 Modernizr.testProp = function(prop){ 4773 return testProps([prop]); 4774 }; 4775 /*>>testprop*/ 4776 4777 /*>>testallprops*/ 4778 // Modernizr.testAllProps() investigates whether a given style property, 4779 // or any of its vendor-prefixed variants, is recognized 4780 // Note that the property names must be provided in the camelCase variant. 4781 // Modernizr.testAllProps('boxSizing') 4782 Modernizr.testAllProps = testPropsAll; 4783 /*>>testallprops*/ 4784 4785 4786 /*>>teststyles*/ 4787 // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards 4788 // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) 4789 Modernizr.testStyles = injectElementWithStyles; 4790 /*>>teststyles*/ 4791 4792 4793 /*>>prefixed*/ 4794 // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input 4795 // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' 4796 4797 // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. 4798 // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: 4799 // 4800 // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); 4801 4802 // If you're trying to ascertain which transition end event to bind to, you might do something like... 4803 // 4804 // var transEndEventNames = { 4805 // 'WebkitTransition' : 'webkitTransitionEnd', 4806 // 'MozTransition' : 'transitionend', 4807 // 'OTransition' : 'oTransitionEnd', 4808 // 'msTransition' : 'MSTransitionEnd', 4809 // 'transition' : 'transitionend' 4810 // }, 4811 // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; 4812 4813 Modernizr.prefixed = function(prop, obj, elem){ 4814 if(!obj) { 4815 return testPropsAll(prop, 'pfx'); 4816 } else { 4817 // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame' 4818 return testPropsAll(prop, obj, elem); 4819 } 4820 }; 4821 /*>>prefixed*/ 4822 4823 4824 /*>>cssclasses*/ 4825 // Remove "no-js" class from <html> element, if it exists: 4826 docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + 4827 4828 // Add the new classes to the <html> element. 4829 (enableClasses ? ' js ' + classes.join(' ') : ''); 4830 /*>>cssclasses*/ 4831 4832 return Modernizr; 4833 4834})(this, this.document); 4835 4836define("modernizr", function(){}); 4837 4838/* CUSTOM FORM ELEMENTS Created by Ryan Fait */ 4839 4840var checkboxHeight = "22"; 4841var radioHeight = "25"; 4842var selectWidth = "190"; 4843var Custom = { 4844 init: function () { 4845 var inputs = document.getElementsByTagName("input"), 4846 span = Array(), 4847 textnode, 4848 option, 4849 active; 4850 4851 //$('label span').remove(); 4852 4853 for (a = 0; a < inputs.length; a++) { 4854 /** 4855 * Remove elements that were rendered by Custom.init() 4856 */ 4857 $(inputs[a]).siblings('span.checkbox, span.radio').remove(); 4858 4859 if ((inputs[a].type == "checkbox" || inputs[a].type == "radio") && inputs[a].className == "styled") { 4860 span[a] = document.createElement("span"); 4861 span[a].className = inputs[a].type; 4862 var str = inputs[a].id; 4863 if (inputs[a].type == "radio") { 4864 //span[a].onclick = new Function("javascript:toggleRadio()"); 4865 } 4866 4867 if (inputs[a].checked == true) { 4868 if (inputs[a].type == "checkbox") { 4869 position = "0 -" + (checkboxHeight * 2) + "px"; 4870 span[a].style.backgroundPosition = position; 4871 $(span[a]).addClass("selected"); 4872 } else { 4873 // custom image for Airgas 4874 position = "0 -" + (radioHeight * 2) + "px"; 4875 span[a].style.backgroundPosition = position; 4876 } 4877 } 4878 4879 inputs[a].parentNode.insertBefore(span[a], inputs[a]); 4880 4881 inputs[a].onchange = Custom.clear; 4882 if (!inputs[a].getAttribute("disabled")) { 4883 span[a].onmousedown = Custom.pushed; 4884 span[a].onmouseup = Custom.check; 4885 } else { 4886 span[a].className = span[a].className += " disabled"; 4887 } 4888 } 4889 } 4890 4891 inputs = document.getElementsByTagName("select"); 4892 for (a = 0; a < inputs.length; a++) { 4893 if (inputs[a].className == "styled") {
4894 option = inputs[a].getElementsByTagName("option"); 4895 active = option[0].childNodes[0].nodeValue; 4896 textnode = document.createTextNode(active); 4897 for (b = 0; b < option.length; b++) { 4898 if (option[b].selected == true) { 4899 textnode = document.createTextNode(option[b].childNodes[0].nodeValue); 4900 } 4901 } 4902 span[a] = document.createElement("span"); 4903 span[a].className = "select"; 4904 span[a].id = "select" + inputs[a].name; 4905 span[a].appendChild(textnode); 4906 inputs[a].parentNode.insertBefore(span[a], inputs[a]); 4907 if (!inputs[a].getAttribute("disabled")) { 4908 inputs[a].onchange = Custom.choose; 4909 } else { 4910 inputs[a].previousSibling.className = inputs[a].previousSibling.className += " disabled"; 4911 } 4912 } 4913 } 4914 document.onmouseup = Custom.clear; 4915 }, 4916 pushed: function () { 4917 element = this.nextSibling; 4918 if (element.checked == true && element.type == "checkbox") { 4919 this.style.backgroundPosition = "0 -" + checkboxHeight * 3 + "px"; 4920 } else if (element.checked == true && element.type == "radio") { 4921 this.style.backgroundPosition = "0 -" + "0" + "px"; 4922 } else if (element.checked != true && element.type == "checkbox") { 4923 this.style.backgroundPosition = "0 -" + checkboxHeight + "px"; 4924 } else { 4925 this.style.backgroundPosition = "0 -" + "0" + "px"; 4926 } 4927 }, 4928 check: function () { 4929 element = this.nextSibling; 4930 if (element.checked == true && element.type == "checkbox") { 4931 this.style.backgroundPosition = "0 0"; 4932 element.checked = false; 4933 $(element).trigger('change'); 4934 $(this).removeClass("selected"); 4935 } else { 4936 if (element.type == "checkbox") { 4937 this.style.backgroundPosition = "0 -" + checkboxHeight * 2 + "px"; 4938 } else { 4939 this.style.backgroundPosition = "0 -" + radioHeight * 2 + "px"; 4940 group = this.nextSibling.name; 4941 inputs = document.getElementsByTagName("input"); 4942 for (a = 0; a < inputs.length; a++) { 4943 if (inputs[a].name == group && inputs[a] != this.nextSibling) { 4944 inputs[a].previousSibling.style.backgroundPosition = "0 0"; 4945 } 4946 } 4947 } 4948 element.checked = true; 4949 $(element).trigger('change'); 4950 $(this).addClass("selected"); 4951 } 4952 }, 4953 clear: function () { 4954 inputs = document.getElementsByTagName("input"); 4955 for (b = 0; b < inputs.length; b++) { 4956 if(inputs[b].type === 'checkbox') { 4957 if (inputs[b].type == "checkbox" && inputs[b].checked == true && inputs[b].className == "styled") { 4958 if(inputs[b].previousSibling.style !== undefined) { 4959 inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight * 2 + "px"; 4960 } 4961 } else if (inputs[b].type == "checkbox" && inputs[b].className == "styled") { 4962 if(inputs[b].previousSibling.style !== undefined) { 4963 inputs[b].previousSibling.style.backgroundPosition = "0 0"; 4964 } 4965 } else if (inputs[b].type == "checkbox" && inputs[b].checked == true) { 4966 if(inputs[b].previousSibling.style !== undefined) { 4967 inputs[b].previousSibling.style.backgroundPosition = "0 -" + checkboxHeight * 2 + "px"; 4968 } 4969 } else if (inputs[b].type == "checkbox") { 4970 if(inputs[b].previousSibling.style !== undefined) { 4971 inputs[b].previousSibling.style.backgroundPosition = "0 0"; 4972 } 4973 } 4974 } 4975 if(inputs[b].type === 'radio') { 4976 if (inputs[b].type == "radio" && inputs[b].checked == true && inputs[b].className == "styled") { 4977 if(inputs[b].previousSibling.style !== undefined) { 4978 inputs[b].previousSibling.style.backgroundPosition = "0 -" + radioHeight * 2 + "px"; 4979 } 4980 } else if (inputs[b].type == "radio" && inputs[b].className == "styled") { 4981 if(inputs[b].previousSibling.style !== undefined) { 4982 inputs[b].previousSibling.style.backgroundPosition = "0 0"; 4983 } 4984 } 4985 } 4986 } 4987 },
vendor: 9,192 bytes, lines 4988-5011
4988 choose: function () { 4989 option = this.getElementsByTagName("option"); 4990 for (d = 0; d < option.length; d++) { 4991 if (option[d].selected == true) { 4992 document.getElementById("select" + this.name).childNodes[0].nodeValue = option[d].childNodes[0].nodeValue; 4993 } 4994 } 4995 } 4996} 4997 4998// Customized initialization of the custom form elements around a jQuery document ready 4999$(document).ready(function() { 5000 Custom.init(); 5001}); 5002 5003/* END CUSTOM FORM ELEMENTS */; 5004define("customForm", ["jquery","domReady"], function(){}); 5005 5006/*! jQuery UI - v1.13.2 - 2023-12-04 5007* http://jqueryui.com 5008* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.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 5009* Copyright jQuery Foundation and other contributors; Licensed MIT */ 5010 5011!function(t){"use strict";t(jQuery)}(function(V){"use strict";V.ui=V.ui||{};V.ui.version="1.13.2";var n,i=0,a=Array.prototype.hasOwnProperty,r=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],l=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[l.toLowerCase()]=function(t){return!!V.data(t,l)},V[r]=V[r]||{},s=V[r][t],n=V[r][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}a[e]="function"==typeof s?function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:s}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:l}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n},V.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],a.call(s[n],e)&&void 0!==i&&(V.isPlainObject(i)?t[e]=V.isPlainObject(t[e])?V.widget.extend({},t[e],i):V.widget.extend({},i):t[e]=i);return t},V.widget.bridge=function(o,e){var a=e.prototype.widgetFullName||o;V.fn[o]=function(i){var t="string"==typeof i,s=r.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=V.data(this,a);return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for "+o+" widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V.data(this,a);t?(t.option(i||{}),t._init&&t._init()):V.data(this,a,new e(i,this))})),n}},V.Widget=function(){},V.Widget._childConstructors=[],V.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=V(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],a=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=a.classesElementLookup[t[s]]||V(),i=n.add?(function(){var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})}(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,i={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return i.element.toggleClass(this._classes(i),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+r.eventNamespace,s=s[2];s?a.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})}
vendor: 6,519 bytes, line 5011
5011,_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}});var s,x,k,o,l,h,c,u,C;V.widget;function D(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function I(t,e){return parseInt(V.css(t,e),10)||0}function T(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,C=V.fn.position,V.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=V("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?V.position.scrollbarWidth():0,height:e?V.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=V(t||window),i=T(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?V(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},V.fn.position=function(u){if(!u||!u.of)return C.apply(this,arguments);var d,p,f,g,m,t,_="string"==typeof(u=V.extend({},u)).of?V(document).find(u.of):V(u.of),v=V.position.getWithinInfo(u.within),b=V.position.getScrollInfo(v),y=(u.collision||"flip").split(" "),w={},e=9===(t=(e=_)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:T(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return _[0].preventDefault&&(u.at="left top"),p=e.width,f=e.height,m=V.extend({},g=e.offset),V.each(["my","at"],function(){var t,e,i=(u[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],u[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===y.length&&(y[1]=y[0]),"right"===u.at[0]?m.left+=p:"center"===u.at[0]&&(m.left+=p/2),"bottom"===u.at[1]?m.top+=f:"center"===u.at[1]&&(m.top+=f/2),d=D(w.at,p,f),m.left+=d[0],m.top+=d[1],this.each(function(){var i,t,a=V(this),r=a.outerWidth(),l=a.outerHeight(),e=I(this,"marginLeft"),s=I(this,"marginTop"),n=r+e+I(this,"marginRight")+b.width,o=l+s+I(this,"marginBottom")+b.height,h=V.extend({},m),c=D(w.my,a.outerWidth(),a.outerHeight());"right"===u.my[0]?h.left-=r:"center"===u.my[0]&&(h.left-=r/2),"bottom"===u.my[1]?h.top-=l:"center"===u.my[1]&&(h.top-=l/2),h.left+=c[0],h.top+=c[1],i={marginLeft:e,marginTop:s},V.each(["left","top"],function(t,e){V.ui.position[y[t]]&&V.ui.position[y[t]][e](h,{targetWidth:p,targetHeight:f,elemWidth:r,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+c[0],d[1]+c[1]],my:u.my,at:u.at,within:v,elem:a})}),u.using&&(t=function(t){var e=g.left-h.left,i=e+p-r,s=g.top-h.top,n=s+f-l,o={target:{element:_,left:g.left,top:g.top,width:p,height:f},element:{element:a,left:h.left,top:h.top,width:r,height:l},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};p<r&&k(e+i)<p&&(o.horizontal="center"),f<l&&k(s+n)<f&&(o.vertical="middle"),x(k(e),k(i))>x(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})},V.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,a=s-o,r=o+e.collisionWidth-n-s;e.collisionWidth>n?0<a&&r<=0?(i=t.left+a+e.collisionWidth-n-s,t.left+=a-i):t.left=!(0<r&&a<=0)&&r<a?s+n-e.collisionWidth:s:0<a?t.left+=a:0<r?t.left-=r:t.left=x(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,a=s-o,r=o+e.collisionHeight-n-s;e.collisionHeight>n?0<a&&r<=0?(i=t.top+a+e.collisionHeight-n-s,t.top+=a-i):t.top=!(0<r&&a<=0)&&r<a?s+n-e.collisionHeight:s:0<a?t.top+=a:0<r?t.top-=r:t.top=x(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,a=t.left-e.collisionPosition.marginLeft,r=a-o,l=a+e.collisionWidth-n-o,h="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,a=-2*e.offset[0];r<0?((s=t.left+h+i+a+e.collisionWidth-n-s)<0||s<k(r))&&(t.left+=h+i+a):0<l&&(0<(o=t.left-e.collisionPosition.marginLeft+h+i+a-o)||k(o)<l)&&(t.left+=h+i+a)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,a=t.top-e.collisionPosition.marginTop,r=a-o,l=a+e.collisionHeight-n-o,h="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,a=-2*e.offset[1];r<0?((s=t.top+h+i+a+e.collisionHeight-n-s)<0||s<k(r))&&(t.top+=h+i+a):0<l&&(0<(o=t.top-e.collisionPosition.marginTop+h+i+a-o)||k(o)<l)&&(t.top+=h+i+a)}},flipfit:{left:function(){V.ui.position.flip.left.apply(this,arguments),V.ui.position.fit.left.apply(this,arguments)},top:function(){V.ui.position.flip.top.apply(this,arguments),V.ui.position.fit.top.apply(this,arguments)}}};var t;V.ui.position,V.extend(V.expr.pseudos,{data:V.expr.createPseudo?V.expr.createPseudo(function(e){return function(t){return!!V.data(t,e)}}
vendor: 6,564 bytes, line 5011
5011):function(t,e,i){return!!V.data(t,i[3])}}),V.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}});V.ui.focusable=function(t,e){var i,s,n,o,a=t.nodeName.toLowerCase();return"area"===a?(s=(i=t.parentNode).name,!(!t.href||!s||"map"!==i.nodeName.toLowerCase())&&(0<(s=V("img[usemap='#"+s+"']")).length&&s.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(a)?(n=!t.disabled)&&(o=V(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===a&&t.href||e,n&&V(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(V(t)))},V.extend(V.expr.pseudos,{focusable:function(t){return V.ui.focusable(t,null!=V.attr(t,"tabindex"))}});var e,d;V.ui.focusable,V.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):V(this[0].form)},V.ui.formResetMixin={_formResetHandler:function(){var e=V(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");V.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(V.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}};V.expr.pseudos||(V.expr.pseudos=V.expr[":"]),V.uniqueSort||(V.uniqueSort=V.unique),V.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,d=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},V.escapeSelector=function(t){return(t+"").replace(e,d)}),V.fn.even&&V.fn.odd||V.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}});V.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},V.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+V.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},V.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=V(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:V(this[0].ownerDocument||document)},V.extend(V.expr.pseudos,{tabbable:function(t){var e=V.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&V.ui.focusable(t,i)}}),V.fn.extend({uniqueId:(p=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++p)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&V(this).removeAttr("id")})}}),V.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var p,f=!1;V(document).on("mouseup",function(){f=!1});V.widget("ui.mouse",{version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===V.data(t.target,e.widgetName+".preventClickEvent"))return V.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!f){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&V(t.target).closest(this.options.cancel).length;return i&&!s&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===V.data(t.target,this.widgetName+".preventClickEvent")&&V.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),f=!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(V.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&V.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,f=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}
vendor: 10,728 bytes, line 5011
5011),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n<o.length;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},V.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=!(i=i||e.body).nodeName?e.body:i},V.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&V(t).trigger("blur")};V.widget("ui.draggable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<V(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=V(this);return V("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=V.ui.safeActiveElement(this.document[0]);V(t.target).closest(e).length||V.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===V(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),V.ui.ddmanager&&!e.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),V.ui.ddmanager&&V.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new V.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,i=!1;return V.ui.ddmanager&&!this.options.dropBehaviour&&(i=V.ui.ddmanager.drop(this,t)),this.dropped&&(i=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!i||"valid"===this.options.revert&&i||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,i)?V(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),V.ui.ddmanager&&V.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),V.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new V.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!V(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,i="function"==typeof e.helper,t=i?V(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),i&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(i=(e=V(s.containment))[0])&&(t=/(scroll|auto)/.test(e.css("overflow")),this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=e)):this.containment=s.containment:this.containment=[0,0,V(n).width()-this.helperProportions.width-this.margins.left,(V(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[V(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,V(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,V(window).scrollLeft()+V(window).width()-this.helperProportions.width-this.margins.left,V(window).scrollTop()+(V(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,t=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:t?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:t?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s=this.options,n=this._isRootNode(this.scrollParent[0]),o=t.pageX,a=t.pageY;return n&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(i=this.relativeContainer?(i=this.relativeContainer.offset(),[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):this.containment,t.pageX-this.offset.click.left<i[0]&&(o=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(a=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(a=i[3]+this.offset.click.top)),s.grid&&(t=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||t-this.offset.click.top>=i[1]||t-this.offset.click.top>i[3]?t:t-this.offset.click.top>=i[1]?t-s.grid[1]:t+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis&&(a=this.originalPageY)),{top:a
vendor: 6,471 bytes, line 5011
5011-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity?o.scrollTop=n=o.scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(o.scrollTop=n=o.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity?o.scrollLeft=n=o.scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(o.scrollLeft=n=o.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-V(a).scrollTop()<s.scrollSensitivity?n=V(a).scrollTop(V(a).scrollTop()-s.scrollSpeed):V(window).height()-(t.pageY-V(a).scrollTop())<s.scrollSensitivity&&(n=V(a).scrollTop(V(a).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-V(a).scrollLeft()<s.scrollSensitivity?n=V(a).scrollLeft(V(a).scrollLeft()-s.scrollSpeed):V(window).width()-(t.pageX-V(a).scrollLeft())<s.scrollSensitivity&&(n=V(a).scrollLeft(V(a).scrollLeft()+s.scrollSpeed)))),!1!==n&&V.ui.ddmanager&&!s.dropBehaviour&&V.ui.ddmanager.prepareOffsets(i,t)}}),V.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[],V(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=V(this),e=t.offset();this!==i.element[0]&&i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,i){for(var s,n,o,a,r,l,h,c,u,d=i.options,p=d.snapTolerance,f=e.offset.left,g=f+i.helperProportions.width,m=e.offset.top,_=m+i.helperProportions.height,v=i.snapElements.length-1;0<=v;v--)l=(r=i.snapElements[v].left-i.margins.left)+i.snapElements[v].width,c=(h=i.snapElements[v].top-i.margins.top)+i.snapElements[v].height,g<r-p||l+p<f||_<h-p||c+p<m||!V.contains(i.snapElements[v].item.ownerDocument,i.snapElements[v].item)?(i.snapElements[v].snapping&&i.options.snap.release&&i.options.snap.release.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=!1):("inner"!==d.snapMode&&(s=Math.abs(h-_)<=p,n=Math.abs(c-m)<=p,o=Math.abs(r-g)<=p,a=Math.abs(l-f)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r-i.helperProportions.width}).left),a
vendor: 16,181 bytes, line 5011
5011&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left)),u=s||n||o||a,"outer"!==d.snapMode&&(s=Math.abs(h-m)<=p,n=Math.abs(c-_)<=p,o=Math.abs(r-f)<=p,a=Math.abs(l-g)<=p,s&&(e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top),n&&(e.position.top=i._convertPositionTo("relative",{top:c-i.helperProportions.height,left:0}).top),o&&(e.position.left=i._convertPositionTo("relative",{top:0,left:r}).left),a&&(e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left)),!i.snapElements[v].snapping&&(s||n||o||a||u)&&i.options.snap.snap&&i.options.snap.snap.call(i.element,t,V.extend(i._uiHash(),{snapItem:i.snapElements[v].item})),i.snapElements[v].snapping=s||n||o||a||u)}}),V.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,i=i.options,i=V.makeArray(V(i.stack)).sort(function(t,e){return(parseInt(V(t).css("zIndex"),10)||0)-(parseInt(V(e).css("zIndex"),10)||0)});i.length&&(s=parseInt(V(i[0]).css("zIndex"),10)||0,V(i).each(function(t){V(this).css("zIndex",s+t)}),this.css("zIndex",s+i.length))}}),V.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("zIndex")&&(i._zIndex=e.css("zIndex")),e.css("zIndex",i.zIndex)},stop:function(t,e,i){i=i.options;i._zIndex&&V(e.helper).css("zIndex",i._zIndex)}});V.ui.draggable;function g(t,e,i){return e<=t&&t<e+i}V.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t=t||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){V.ui.ddmanager.droppables[t]=V.ui.ddmanager.droppables[t]||[],V.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var t=V.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,e){var i;"accept"===t?this.accept="function"==typeof e?e:function(t){return t.is(e)}:"scope"===t&&(i=V.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(e)),this._super(t,e)},_activate:function(t){var e=V.ui.ddmanager.current;this._addActiveClass(),e&&this._trigger("activate",t,this.ui(e))},_deactivate:function(t){var e=V.ui.ddmanager.current;this._removeActiveClass(),e&&this._trigger("deactivate",t,this.ui(e))},_over:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(e)))},_out:function(t){var e=V.ui.ddmanager.current;e&&(e.currentItem||e.element)[0]!==this.element[0]&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(e)))},_drop:function(e,t){var i=t||V.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=V(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&V.ui.intersect(i,V.extend(t,{offset:t.element.offset()}),t.options.tolerance,e))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(i)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),V.ui.intersect=function(t,e,i,s){if(!e.offset)return!1;var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,a=n+t.helperProportions.width,r=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,c=l+e.proportions().width,u=h+e.proportions().height;switch(i){case"fit":return l<=n&&a<=c&&h<=o&&r<=u;case"intersect":return l<n+t.helperProportions.width/2&&a-t.helperProportions.width/2<c&&h<o+t.helperProportions.height/2&&r-t.helperProportions.height/2<u;case"pointer":return g(s.pageY,h,e.proportions().height)&&g(s.pageX,l,e.proportions().width);case"touch":return(h<=o&&o<=u||h<=r&&r<=u||o<h&&u<r)&&(l<=n&&n<=c||l<=a&&a<=c||n<l&&c<a);default:return!1}},!(V.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=V.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,a=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++)if(!(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element))){for(s=0;s<a.length;s++)if(a[s]===n[i].element[0]){n[i].proportions().height=0;continue t}n[i].visible="none"!==n[i].element.css("display"),n[i].visible&&("mousedown"===o&&n[i]._activate.call(n[i],e),n[i].offset=n[i].element.offset(),n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight}))}},drop:function(t,e){var i=!1;return V.each((V.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&V.ui.intersect(t,this,this.options.tolerance,e)&&(i=this._drop.call(this,e)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,e)))}),i},dragStart:function(t,e){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)})},drag:function(n,o){n.options.refreshPositions&&V.ui.ddmanager.prepareOffsets(n,o),V.each(V.ui.ddmanager.droppables[n.options.scope]||[],function(){var t,e,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(i=V.ui.intersect(n,this,this.options.tolerance,o))&&this.isover?"isout":i&&!this.isover?"isover":null)&&(this.options.greedy&&(e=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return V(this).droppable("instance").options.scope===e})).length&&((t=V(i[0]).droppable("instance")).greedyChild="isover"===s)),t&&"isover"===s&&(t.isover=!1,t.isout=!0,t._out.call(t,o)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,o),t&&"isout"===s&&(t.isout=!1,t.isover=!0,t._over.call(t,o)))})},dragStop:function(t,e){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||V.ui.ddmanager.prepareOffsets(t,e)}})!==V.uiBackCompat&&V.widget("ui.droppable",V.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});V.ui.droppable;V.widget("ui.resizable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,e){if("hidden"===V(t).css("overflow"))return!1;var i=e&&"left"===e?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,e=this.options,i=this;this._addClass("ui-resizable"),V.extend(this,{_aspectRatio:!!e.aspectRatio,aspectRatio:e.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:e.helper||e.ghost||e.animate?e.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(V("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e<i.length;e++)s="ui-resizable-"+(t=String.prototype.trim.call(i[e])),n=V("<div>"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=V(s.containment).scrollLeft()||0,i+=V(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),s<n.maxWidth&&(n.maxWidth=s),t<n.maxHeight&&(n.maxHeight=t)),this._vBoundaries=n},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left
vendor: 5,511 bytes, line 5011
5011=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||V("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,n={width:i.size.width-a,height:i.size.height-o},a=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,o&&a?{top:o,left:a}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=V(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,a=o instanceof V?o.get(0):/parent/.test(o)?e.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(a,"left")?a.scrollWidth:o,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,a={top:0,left:0}
vendor: 2,289 bytes, line 5011
5011,r=e.containerElement,t=!0;r[0]!==document&&/static/.test(r.css("position"))&&(a=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-a.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0),i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-a.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-a.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var t=V(this).resizable("instance").options;V(t.alsoResize).each(function(){var t=V(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left
vendor: 4,261 bytes, line 5011
5011:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,u=Math.round((s.height-n.height)/h)*h,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidth<d,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>d,s=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=l),s&&(p+=h),f&&(d-=l),g&&(p-=h),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-h<=0||d-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0<p-h?(e.size.height=p,e.position.top=o.top-u):(p=h-t.height,e.size.height=p,e.position.top=o.top+n.height-p),0<d-l?(e.size.width=d,e.position.left=o.left-c):(d=l-t.width,e.size.width=d,e.position.left=o.left+n.width-d))}});V.ui.resizable,V.widget("ui.selectable",V.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var i=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){i.elementPos=V(i.element[0]).offset(),i.selectees=V(i.options.filter,i.element[0]),i._addClass(i.selectees,"ui-selectee"),i.selectees.each(function(){var t=V(this),e=t.offset(),e={left:e.left-i.elementPos.left,top:e.top-i.elementPos.top};V.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=V("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],l=s.pageX,h=s.pageY;
vendor: 12,065 bytes, line 5011
5011return l<a&&(t=l,l=a,a=t),h<r&&(t=h,h=r,r=t),this.helper.css({left:a,top:r,width:l-a,height:h-r}),this.selectees.each(function(){var t=V.data(this,"selectable-item"),e=!1,i={};t&&t.element!==n.element[0]&&(i.left=t.left+n.elementPos.left,i.right=t.right+n.elementPos.left,i.top=t.top+n.elementPos.top,i.bottom=t.bottom+n.elementPos.top,"touch"===o.tolerance?e=!(i.left>l||i.right<a||i.top>h||i.bottom<r):"fit"===o.tolerance&&(e=i.left>a&&i.right<l&&i.top>r&&i.bottom<h),e?(t.selected&&(n._removeClass(t.$element,"ui-selected"),t.selected=!1),t.unselecting&&(n._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1),t.selecting||(n._addClass(t.$element,"ui-selecting"),t.selecting=!0,n._trigger("selecting",s,{selecting:t.element}))):(t.selecting&&((s.metaKey||s.ctrlKey)&&t.startselected?(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,n._addClass(t.$element,"ui-selected"),t.selected=!0):(n._removeClass(t.$element,"ui-selecting"),t.selecting=!1,t.startselected&&(n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0),n._trigger("unselecting",s,{unselecting:t.element}))),t.selected&&(s.metaKey||s.ctrlKey||t.startselected||(n._removeClass(t.$element,"ui-selected"),t.selected=!1,n._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,n._trigger("unselecting",s,{unselecting:t.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,V(".ui-unselecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-unselecting"),t.unselecting=!1,t.startselected=!1,i._trigger("unselected",e,{unselected:t.element})}),V(".ui-selecting",this.element[0]).each(function(){var t=V.data(this,"selectable-item");i._removeClass(t.$element,"ui-selecting")._addClass(t.$element,"ui-selected"),t.selecting=!1,t.selected=!0,t.startselected=!0,i._trigger("selected",e,{selected:t.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),V.widget("ui.sortable",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),V.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,n=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),V(t.target).parents().each(function(){if(V.data(this,n.widgetName+"-item")===n)return i=V(this),!1}),!!(i=V.data(t.target,n.widgetName+"-item")===n?V(t.target):i)&&(!(this.options.handle&&!e&&(V(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,n,o=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=V("parent"!==o.appendTo?o.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},V.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),V.extend(this.offset,{parent:this._getParentOffset()}),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(n=this.document.find("body"),this.storedCursor=n.css("cursor"),n.css("cursor",o.cursor),this.storedStylesheet=V("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,n,o=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),o.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(n=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===n?"next":"prev"]()[0]===s||V.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&V.contains(this.element[0],s))){if(this.direction=1===n?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),V.ui.ddmanager&&V.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,n,o;if(t)return V.ui.ddmanager&&!this.options.dropBehaviour&&V.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),o={},(n=this.options.axis)&&"x"!==n||(o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),n&&"y"!==n||(o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,V(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new V.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),V.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?V(this.domPosition.prev).after(this.currentItem):V(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},V(t).each(function(){var t=(V(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(V(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,c=this.offset.click.left,h="x"===this.options.axis||r<s+h&&s+h<l,c="y"===this.options.axis||o<e+c&&e+c<a;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?h&&c:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s
vendor: 4,080 bytes, line 5011
5011&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],a=[],r=this._connectWith();if(r&&t)for(e=r.length-1;0<=e;e--)for(i=(s=V(r[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&a.push(["function"==typeof n.options.items?n.options.items.call(n.element):V(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n]);function l(){o.push(this)}for(a.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):V(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=a.length-1;0<=e;e--)a[e][0].each(l);return V(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=V.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,n,o,a,r,l,h=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):V(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(e=u.length-1;0<=e;e--)for(i=(s=V(u[e],this.document[0])).length-1;0<=i;i--)(n=V.data(s[i],this.widgetFullName))&&n!==this&&!n.options.disabled&&(c.push(["function"==typeof n.options.items?n.options.items.call(n.element[0],t,{item:this.currentItem}):V(n.options.items,n.element),n]),this.containers.push(n));for(e=c.length-1;0<=e;e--)for(o=c[e][1],l=(a=c[e][i=0]).length;i<l;i++)(r=V(a[i])).data(this.widgetName+"-item",o),h.push({item:r,instance:o,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?V(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,n,o=(i=i||this).options;o.placeholder&&o.placeholder.constructor!==String||(s=o.placeholder,n=i.currentItem[0].nodeName.toLowerCase(),o.placeholder={element:function(){var t=V("<"+n+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("<tr>",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()
vendor: 26,657 bytes, line 5011
5011||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V("<td> </td>",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)<i&&(i=Math.abs(t[h]-a),s=this.items[e],this.direction=r?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[u]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[u].element,!0),this._trigger("change",t,this._uiHash()),this.containers[u]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[u],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?V(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&V.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=V(i.containment)[0],e=V(i.containment).offset(),i="hidden"!==V(t).css("overflow"),this.containment=[e.left+(parseInt(V(t).css("borderLeftWidth"),10)||0)+(parseInt(V(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(V(t).css("borderTopWidth"),10)||0)+(parseInt(V(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(V(t).css("borderLeftWidth"),10)||0)-(parseInt(V(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(V(t).css("borderTopWidth"),10)||0)-(parseInt(V(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&V.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===V.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||V([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}}),V.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(t){return t.find("> li > :first-child").add(t.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),a={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,a)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(a),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(i=i.children(".ui-accordion-header-icon"),this._removeClass(i,null,e.icons.activeHeader)._addClass(i,null,e.icons.header)),n||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,e.icons.header)._addClass(n,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!i.length||t.index()<i.index()),c=this.options.animate||{},u=h&&c.down||c,h=function(){a._toggleComplete(e)};return n=(n="string"==typeof u?u:n)||u.easing||c.easing,o=(o="number"==typeof u?u:o)||u.duration||c.duration,i.length?t.length?(s=t.show().outerHeight(),i.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:n,complete:h,step:function(t,e){e.now=Math.round(t),"height"!==e.prop?"content-box"===l&&(r+=e.now):"content"!==a.options.heightStyle&&(e.now=Math.round(s-i.outerHeight()-r),r=0)}})):i.animate(this.hideProps,o,n,h):t.animate(this.showProps,o,n,h)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),V.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(V.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],V.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]===i[0]&&(i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=V.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:V(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},i?0:this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
5011se")},_closeOnDocumentClick:function(t){return!V(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this._menuItems(this.active.children(".ui-menu")).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(t){return(t||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(t,e,i){var s;(s=this.active?"first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").last():this.active[t+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(e=V(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===V.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=V(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this._menuItems(this.activeMenu).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||V(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(String.prototype.trim.call(V(this).children(".ui-menu-item-wrapper").text()))})}});V.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value(
vendor: 13,511 bytes, line 5011
5011)},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(i))},100))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==V.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=V("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:V.map(t,function(t){return"string"==typeof t?{label:t,value:t}:V.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(V.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;V.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return V("<li>").append(V("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("<div>").text(e))},100))}});V.ui.autocomplete;var m=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};if(t)return"controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(a=a.concat(e.get()))):void(V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(m,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.13.2",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("<div></div>").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+V.escapeSelector(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(this)._form().length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V("<span>"),this.iconSpace=V("<span> </span>
5011"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var _;V.ui.checkboxradio;V.widget("ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===V.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,e){var i="iconPosition"!==t,s=i?this.options.iconPosition:e,t="top"===s||"bottom"===s;this.icon?i&&this._removeClass(this.icon,null,this.options.icon):(this.icon=V("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),i&&this._addClass(this.icon,null,e),this._attachIcon(s),t?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconS
vendor: 4,773 bytes, line 5011
5011pace||(this.iconSpace=V("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=(void 0===t.showLabel?this.options:t).showLabel,i=(void 0===t.icon?this.options:t).icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),(this.element[0].disabled=e)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==V.uiBackCompat&&(V.widget("ui.button",V.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){"text"!==t?("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",e)}}),V.fn.button=(_=V.fn.button,function(i){var t="string"==typeof i,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t=V(this).attr("type"),e=V.data(this,"ui-"+("checkbox"!==t&&"radio"!==t?"button":"checkboxradio"));return"instance"===i?(n=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?V.error("no such method '"+i+"' for button widget instance"):(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:V.error("cannot call methods on button prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=V.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=V(this).attr("type"),e="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",t=V.data(this,"ui-"+e);t?(t.option(i||{}),t._init&&t._init()):"button"!=e?V(this).checkboxradio(V.extend({icon:!1},i)):_.call(V(this),i)})),n}),V.fn.buttonset=function(){return V.ui.controlgroup||V.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});var v;V.ui.button;function b(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
vendor: 4,726 bytes, line 5011
5011ay","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=y(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function y(t){var e="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",e,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",e,w)}function w(){V.datepicker._isDisabledDatepicker((v.inline?v.dpDiv.parent():v.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function P(t,e){for(var i in V.extend(t,e),e)null==e[i]&&(t[i]=e[i]);return t}V.extend(V.ui,{datepicker:{version:"1.13.2"}}),V.extend(b.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return P(this._defaults,t||{}),this},_attachDatepicker:function(t,e){var i,s=t.nodeName.toLowerCase(),n="div"===s||"span"===s;t.id||(this.uuid+=1,t.id="dp"+this.uuid),(i=this._newInst(V(t),n)).settings=V.extend({},e||{}),"input"===s?this._connectDatepicker(t,i):n&&this._inlineDatepicker(t,i)},_newInst:function(t,e){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:e,dpDiv:e?y(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,e){var i=V(t);e.append=V([]),e.trigger=V([]),i.hasClass(this.markerClassName)||(this._attachments(i,e),i.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(e),V.data(t,"datepicker",e),e.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,e){var i,s=this._get(e,"appendText"),n=this._get(e,"isRTL");e.append&&e.append.remove(),s&&(e.append=V("<span>").addClass(this._appendClass).text(s),t[n?"before":"after"](e.append)),t.off("focus",this._showDatepicker),e.trigger&&e.trigger.remove(),"focus"!==(i=this._get(e,"showOn"))&&"both"!==i||t.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(s=this._get(e,"buttonText"),i=this._get(e,"buttonImage"),this._get(e,"buttonImageOnly")?e.trigger=V("<img>").addClass(this._triggerClass).attr({src:i,alt:s,title:s}):(e.trigger=V("<button type='button'>").addClass(this._triggerClass),i?e.trigger.html(V("<img>").attr({src:i,alt:s,title:s})):e.trigger.text(s)),t[n?"before":"after"](e.trigger),e.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===t[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==t[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){var e,i,s,n,o,a;this._get(t,"autoSize")&&!t.inline&&(o=new Date(2009,11,20),(a=this._get(t,"dateFormat")).match(/[DM]/)&&(e=function(t){for(n=s=i=0;n<t.length;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length))},_inlineDatepicker:function(t,e){var i=V(t);
vendor: 11,772 bytes, line 5011
5011i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),V.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a=this._dialogInst;return a||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(a=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",a)),P(a.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(a,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(o=document.documentElement.clientWidth,s=document.documentElement.clientHeight,e=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+e,s/2-150+n]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),a.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",a),this},_destroyDatepicker:function(t){var e,i=V(t),s=V.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),V.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),v===s&&(v=null,this._curInst=null))},_enableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i=V(e),s=V.data(e,"datepicker");i.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(t){try{return V.data(t,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,e,i){var s,n,o=this._getInst(t);if(2===arguments.length&&"string"==typeof e)return"defaults"===e?V.extend({},V.datepicker._defaults):o?"all"===e?V.extend({},o.settings):this._get(o,e):null;s=e||{},"string"==typeof e&&((s={})[e]=i),o&&(this._curInst===o&&this._hideDatepicker(),n=this._getDateDatepicker(t,!0),e=this._getMinMaxDate(o,"min"),i=this._getMinMaxDate(o,"max"),P(o.settings,s),null!==e&&void 0!==s.dateFormat&&void 0===s.minDate&&(o.settings.minDate=this._formatDate(o,e)),null!==i&&void 0!==s.dateFormat&&void 0===s.maxDate&&(o.settings.maxDate=this._formatDate(o,i)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(V(t),o),this._autoSize(o),this._setDate(o,n),this._updateAlternate(o),this._updateDatepicker(o))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){t=this._getInst(t);t&&this._updateDatepicker(t)},_setDateDatepicker:function(t,e){t=this._getInst(t);t&&(this._setDate(t,e),this._updateDatepicker(t),this._updateAlternate(t))},_getDateDatepicker:function(t,e){t=this._getInst(t);return t&&!t.inline&&this._setDateFromField(t,e),t?this._getDate(t):null},_doKeyDown:function(t){var e,i,s=V.datepicker._getInst(t.target),n=!0,o=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,V.datepicker._datepickerShowing)switch(t.keyCode){case 9:V.datepicker._hideDatepicker(),n=!1;break;case 13:return(i=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",s.dpDiv))[0]&&V.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),(e=V.datepicker._get(s,"onSelect"))?(i=V.datepicker._formatDate(s),e.apply(s.input?s.input[0]:null,[i,s])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&V.datepicker._clearDate(t.target),n=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&V.datepicker._gotoToday(t.target),n=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?1:-1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?-V.datepicker._get(s,"stepBigMonths"):-V.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,-7,"D"),n=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,o?-1:1,"D"),n=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&V.datepicker._adjustDate(t.target,t.ctrlKey?+V.datepicker._get(s,"stepBigMonths"):+V.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&V.datepicker._adjustDate(t.target,7,"D"),n=t.ctrlKey||t.metaKey;break;default:n=!1}else 36===t.keyCode&&t.ctrlKey?V.datepicker._showDatepicker(this):n=!1;n&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var e,i=V.datepicker._getInst(t.target);if(V.datepicker._get(i,"constrainInput"))return e=V.datepicker._possibleChars(V.datepicker._get(i,"dateFormat")),i=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||i<" "||!e||-1<e.indexOf(i)},_doKeyUp:function(t){t=V.datepicker._getInst(t.target);if(t.input.val()!==t.lastVal)try{V.datepicker.parseDate(V.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,V.datepicker._getFormatConfig(t))&&(V.datepicker._setDateFromField(t),V.datepicker._updateAlternate(t),V.datepicker._updateDatepicker(t))}catch(t){}return!0},_showDatepicker:function(t){var e,i,s,n;"input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=V("input",t.parentNode)[0]),V.datepicker._isDisabledDatepicker(t)||V.datepicker._lastInput===t||(n=V.datepicker._getInst(t),V.datepicker._curInst&&V.datepicker._curInst!==n&&(V.datepicker._curInst.dpDiv.stop(!0,!0),n&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(i=(s=V.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(P(n.settings,i),n.lastVal=null,V.datepicker._lastInput=t,V.datepicker._setDateFromField(n),V.datepicker._inDialog&&(t.value=""),V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(t),V.datepicker._pos[1]+=t.offsetHeight),e=!1,V(t).parents().each(function(){return!(e|="fixed"===V(this).css("position"))}),s={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(n),s=V.datepicker._checkOffset(n,s,e),n.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":e?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),n.inline||(i=V.datepicker._get(n,"showAnim"),s=V.datepicker._get(n,"duration"),n.dpDiv.css("z-index",function(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}(V(t))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[i]?n.dpDiv.show(i,V.datepicker._get(n,"showOptions"),s):n.dpDiv[i||"show"](i?s:null),V.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),V.datepicker._curInst=n)))},_updateDatepicker:function(t){this.maxRows=4,(v=t).dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var e,i=this._getNumberOfMonths(t),s=i[1],n=t.dpDiv.find("."+this._dayOverClass+" a"),o=V.datepicker._get(t,"onUpdateDatepicker");0<n.length&&w.apply(n.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<s&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==i[0]||1!==i[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(e=t.yearshtml,setTimeout(function(){e===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year").first().replaceWith(t.yearshtml),e=t.yearshtml=null},0)),o&&o.apply(t.input?t.input[0]:null,[t])},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(t,e,i){var s=t.dpDiv.outerWidth(),n=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,a=t.input?t.input.outerHeight():0,r=document.documentElement.clientWidth+(i?0:V(document).scrollLeft()),l=document.documentElement.clientHeight+(i?0:V(document).scrollTop());return e.left-=this._get(t,"isRTL")?s-o:0,e.left-=i&&e.left===t.input.offset().left?V(document).scrollLeft():0,e.top-=i&&e.top===t.input.offset().top+a?V(document).scrollTop():0,e.left-=Math.min(e.left,e.left+s>r&&s<r?Math.abs(e.left+s-r):0),e.top-=Math.min(e.top,e.top+n>l&&n<l?Math.abs(n+a):0),e},_findPos:function(t){for(var e=this._getInst(t),i=this._get(e,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||V.expr.pseudos.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return[(e=V(t).offset()).left,e.top]},_hideDatepicker:function(t){var e,i,s=this._curInst;!s||t&&s!==V.data(t,"datepicker")||this._datepickerShowing&&(e=this._get(s,"showAnim"),i=this._get(s,"duration"),t=function(){V.datepicker._tidyDialog(s)},V.effects&&(V.effects.effect[e]||V.effects[e])?s.dpDiv.hide(e,V.datepicker._get(s,"showOptions"),i,t):s.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?i:null,t),e||t(),this._datepickerShowing=!1,(t=this._get(s,"onClose"))&&t.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){var e;V.datepicker._curInst&&(e=V(t.target),t=V.datepicker._getInst(e[0]),(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)&&(!e.hasClass(V.datepicker.markerClassName)||V.datepicker._curInst===t)||V.datepicker._hideDatepicker())}
vendor: 14,467 bytes, line 5011
5011,_adjustDate:function(t,e,i){var s=V(t),t=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(t,e,i),this._updateDatepicker(t))},_gotoToday:function(t){var e=V(t),i=this._getInst(e[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(e)},_selectMonthYear:function(t,e,i){var s=V(t),t=this._getInst(s[0]);t["selected"+("M"===i?"Month":"Year")]=t["draw"+("M"===i?"Month":"Year")]=parseInt(e.options[e.selectedIndex].value,10),this._notifyChange(t),this._adjustDate(s)},_selectDay:function(t,e,i,s){var n=V(t);V(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(n[0])||((n=this._getInst(n[0])).selectedDay=n.currentDay=parseInt(V("a",s).attr("data-date")),n.selectedMonth=n.currentMonth=e,n.selectedYear=n.currentYear=i,this._selectDate(t,this._formatDate(n,n.currentDay,n.currentMonth,n.currentYear)))},_clearDate:function(t){t=V(t);this._selectDate(t,"")},_selectDate:function(t,e){var i=V(t),t=this._getInst(i[0]);e=null!=e?e:this._formatDate(t),t.input&&t.input.val(e),this._updateAlternate(t),(i=this._get(t,"onSelect"))?i.apply(t.input?t.input[0]:null,[e,t]):t.input&&t.input.trigger("change"),t.inline?this._updateDatepicker(t):(this._hideDatepicker(),this._lastInput=t.input[0],"object"!=typeof t.input[0]&&t.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var e,i,s=this._get(t,"altField");s&&(e=this._get(t,"altFormat")||this._get(t,"dateFormat"),i=this._getDate(t),t=this.formatDate(e,i,this._getFormatConfig(t)),V(document).find(s).val(t))},noWeekends:function(t){t=t.getDay();return[0<t&&t<6,""]},iso8601Week:function(t){var e=new Date(t.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(e,n,t){if(null==e||null==n)throw"Invalid arguments";if(""===(n="object"==typeof n?n.toString():n+""))return null;for(var i,s,o,a=0,r=(t?t.shortYearCutoff:null)||this._defaults.shortYearCutoff,r="string"!=typeof r?r:(new Date).getFullYear()%100+parseInt(r,10),l=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,h=(t?t.dayNames:null)||this._defaults.dayNames,c=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,u=(t?t.monthNames:null)||this._defaults.monthNames,d=-1,p=-1,f=-1,g=-1,m=!1,_=function(t){t=w+1<e.length&&e.charAt(w+1)===t;return t&&w++,t},v=function(t){var e=_(t),e="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,e=new RegExp("^\\d{"+("y"===t?e:1)+","+e+"}"),e=n.substring(a).match(e);if(!e)throw"Missing number at position "+a;return a+=e[0].length,parseInt(e[0],10)},b=function(t,e,i){var s=-1,e=V.map(_(t)?i:e,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(V.each(e,function(t,e){var i=e[1];if(n.substr(a,i.length).toLowerCase()===i.toLowerCase())return s=e[0],a+=i.length,!1}),-1!==s)return s+1;throw"Unknown name at position "+a},y=function(){if(n.charAt(a)!==e.charAt(w))throw"Unexpected literal at position "+a;a++},w=0;w<e.length;w++)if(m)"'"!==e.charAt(w)||_("'")?y():m=!1;else switch(e.charAt(w)){case"d":f=v("d");break;case"D":b("D",l,h);break;case"o":g=v("o");break;case"m":p=v("m");break;case"M":p=b("M",c,u);break;case"y":d=v("y");break;case"@":d=(o=new Date(v("@"))).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"!":d=(o=new Date((v("!")-this._ticksTo1970)/1e4)).getFullYear(),p=o.getMonth()+1,f=o.getDate();break;case"'":_("'")?y():m=!0;break;default:y()}if(a<n.length&&(s=n.substr(a),!/^\s+/.test(s)))throw"Extra/unparsed characters found in date: "+s;if(-1===d?d=(new Date).getFullYear():d<100&&(d+=(new Date).getFullYear()-(new Date).getFullYear()%100+(d<=r?0:-100)),-1<g)for(p=1,f=g;;){if(f<=(i=this._getDaysInMonth(d,p-1)))break;p++,f-=i}if((o=this._daylightSavingAdjust(new Date(d,p-1,f))).getFullYear()!==d||o.getMonth()+1!==p||o.getDate()!==f)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";function s(t,e,i){var s=""+e;if(c(t))for(;s.length<i;)s="0"+s;return s}function n(t,e,i,s){return(c(t)?s:i)[e]}var o,a=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,l=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,h=(i?i.monthNames:null)||this._defaults.monthNames,c=function(t){t=o+1<e.length&&e.charAt(o+1)===t;return t&&o++,t},u="",d=!1;if(t)for(o=0;o<e.length;o++)if(d)"'"!==e.charAt(o)||c("'")?u+=e.charAt(o):d=!1;else switch(e.charAt(o)){case"d":u+=s("d",t.getDate(),2);break;case"D":u+=n("D",t.getDay(),a,r);break;case"o":u+=s("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=s("m",t.getMonth()+1,2);break;case"M":u+=n("M",t.getMonth(),l,h);break;case"y":u+=c("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":u+=t.getTime();break;case"!":u+=1e4*t.getTime()+this._ticksTo1970;break;case"'":c("'")?u+="'":d=!0;break;default:u+=e.charAt(o)}return u},_possibleChars:function(e){for(var t="",i=!1,s=function(t){t=n+1<e.length&&e.charAt(n+1)===t;return t&&n++,t},n=0;n<e.length;n++)if(i)"'"!==e.charAt(n)||s("'")?t+=e.charAt(n):i=!1;else switch(e.charAt(n)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":s("'")?t+="'":i=!0;break;default:t+=e.charAt(n)}return t},_get:function(t,e){return(void 0!==t.settings[e]?t.settings:this._defaults)[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(t){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(r,t,e){var i,s,t=null==t||""===t?e:"string"==typeof t?function(t){try{return V.datepicker.parseDate(V.datepicker._get(r,"dateFormat"),t,V.datepicker._getFormatConfig(r))}catch(t){}for(var e=(t.toLowerCase().match(/^c/)?V.datepicker._getDate(r):null)||new Date,i=e.getFullYear(),s=e.getMonth(),n=e.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=o.exec(t);a;){switch(a[2]||"d"){case"d":case"D":n+=parseInt(a[1],10);break;case"w":case"W":n+=7*parseInt(a[1],10);break;case"m":case"M":s+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),n=Math.min(n,V.datepicker._getDaysInMonth(i,s))}a=o.exec(t)}return new Date(i,s,n)}(t):"number"==typeof t?isNaN(t)?e:(i=t,(s=new Date).setDate(s.getDate()+i),s):new Date(t.getTime());return(t=t&&"Invalid Date"===t.toString()?e:t)&&(t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)),this._daylightSavingAdjust(t)},_daylightSavingAdjust:function(t){return t?(t.setHours(12<t.getHours()?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,e=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=e.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=e.getMonth(),t.drawYear=t.selectedYear=t.currentYear=e.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(t){var e=this._get(t,"stepMonths"),i="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){V.datepicker._adjustDate(i,-e,"M")},next:function(){V.datepicker._adjustDate(i,+e,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(i)},selectDay:function(){return V.datepicker._selectDay(i,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(i,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(i,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,x,k,C,D,I,T,P,M,S,H,z,A=new Date,O=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth(),A.getDate())),N=this._get(t,"isRTL"),E=this._get(t,"showButtonPanel"),W=this._get(t,"hideIfNoPrevNext"),F=this._get(t,"navigationAsDateFormat"),L=this._getNumberOfMonths(t),R=this._get(t,"showCurrentAtPos"),A=this._get(t,"stepMonths"),Y=1!==L[0]||1!==L[1],B=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),j=this._getMinMaxDate(t,"min"),q=this._getMinMaxDate(t,"max"),K=t.drawMonth-R,U=t.drawYear;if(K<0&&(K+=12,U--),q)for(e=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth()-L[0]*L[1]+1,q.getDate())),e=j&&e<j?j:e;this._daylightSavingAdjust(new Date(U,K,1))>e;)--K<0&&(K=11,U--);for(t.drawMonth=K,t.drawYear=U,R=this._get(t,"prevText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K-A,1)),this._getFormatConfig(t)):R,i=this._canAdjustMonth(t,-1,U,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"e":"w")).text(R))[0].outerHTML,R=this._get(t,"nextText"),R=F?this.formatDate(R,this._daylightSavingAdjust(new Date(U,K+A,1)),this._getFormatConfig(t)):R,s=this._canAdjustMonth(t,1,U,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:R}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML:W?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:R}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(N?"w":"e")).text(R))[0].outerHTML,A=this._get(t,"currentText"),W=this._get(t,"gotoCurrent")&&t.currentDay?B:O,A=F?this.formatDate(A,W,this._getFormatConfig(t)):A,R="",t.inline||(R=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(t,"closeText"))[0].outerHTML),F="",E&&(F=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(N?R:"").append(this._isInRange(t,W)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(A):"").append(N?"":R)[0].outerHTML),n=parseInt(this._get(t,"firstDay"),10),n=isNaN(n)?0:n,o=this._get(t,"showWeek"),a=this._get(t,"dayNames"),r=this._get(t,"dayNamesMin"),l=this._get(t,"monthNames"),h=this._get(t,"monthNamesShort"),c=this._get(t,"beforeShowDay"),u=this._get(t,"showOtherMonths"),d=this._get(t,"selectOtherMonths"),p=this._getDefaultDate(t),f="",m=0;m<L[0];m++){for(_="",this.maxRows=4,v=0;v<L[1];v++){if(b=this._daylightSavingAdjust(new Date(U,K,t.selectedDay)),y=" ui-corner-all",w="",Y){if(w+="<div class='ui-datepicker-group",1<L[1])switch(v){case 0:w+=" ui-datepicker-group-first",y=" ui-corner-"+(N?"right":"left");break;case L[1]-1:w+=" ui-datepicker-group-last",y=" ui-corner-"+(N?"left":"right");break;default:w+=" ui-datepicker-group-middle",y=""}w+="'>"}for(w+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+y+"'>"+(/all|left/.test(y)&&0===m?N?s:i:"")+(/all|right/.test(y)&&0===m?N?i:s:"")+this._generateMonthYearHeader(t,K,U,j,q,0<m||0<v,l,h)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=o?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",g=0;g<7;g++)x+="<th scope='col'"+(5<=(g+n+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+a[k=(g+n)%7]+"'>"+r[k]+"</span></th>";for(w+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(U,K),U===t.selectedYear&&K===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,D)),C=(this._getFirstDayOfMonth(U,K)-n+7)%7,D=Math.ceil((C+D)/7),I=Y&&this.maxRows>D?this.maxRows:D,this.maxRows=I,T=this._daylightSavingAdjust(new Date(U,K,1-C)),P=0;P<I;P++){for(w+="<tr>",M=o?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(T)+"</td>":"",g=0;g<7;g++)S=c?c.apply(t.input?t.input[0]:null,[T]):[!0,""],z=(H=T.getMonth()!==K)&&!d||!S[0]||j&&T<j||q&&q<T,M+="<td class='"+(5<=(g+n+6)%7?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(T.getTime()===b.getTime()&&K===t.selectedMonth&&t._keyEvent||p.getTime()===T.getTime()&&p.getTime()===b.getTime()?" "+this._dayOverClass:"")+(z?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!u?"":" "+S[1]+(T.getTime()===B.getTime()?" "+this._currentClass:"")+(T.getTime()===O.getTime()?" ui-datepicker-today":""))+"'"+(H&&!u||!S[2]?"":" title='"+S[2].replace(/'/g,"'")+"'")+(z?"":" data-handler='selectDay' data-event='click' data-month='"+T.getMonth()+"' data-year='"+T.getFullYear()+"'")+">"+(H&&!u?" ":z?"<span class='ui-state-default'>"+T.getDate()+"</span>":"<a class='ui-state-default"+(T.getTime()===O.getTime()?" ui-state-highlight":"")+(T.getTime()===B.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#' aria-current='"+(T.getTime()===B.getTime()?"true":"false")+"' data-date='"+T.getDate()+"'>"+T.getDate()+"</a>")+"</td>",T.setDate(T.getDate()+1),T=this._daylightSavingAdjust(T);w+=M+"</tr>"}11<++K&&(K=0,U++),_+=w+="</tbody></table>"+(Y?"</div>"+(0<L[0]&&v===L[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}f+=_}return f+=F,t._keyEvent=!1,f}
vendor: 24,419 bytes, line 5011
5011,_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="<div class='ui-datepicker-title'>",y="";if(o||!f)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' aria-label='"+_+"' data-handler='selectMonth' data-event='change'>",c=0;c<12;c++)(!l||c>=s.getMonth())&&(!h||c<=n.getMonth())&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(m||(b+=y+(!o&&f&&g?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!g)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="<select class='ui-datepicker-year' aria-label='"+v+"' data-handler='selectYear' data-event='change'>";d<=p;d++)t.yearshtml+="<option value='"+d+"'"+(d===i?" selected='selected'":"")+">"+d+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),e=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=e.getDate(),t.drawMonth=t.selectedMonth=e.getMonth(),t.drawYear=t.selectedYear=e.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),e=i&&e<i?i:e;return t&&t<e?t:e},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){t=this._get(t,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),n=this._daylightSavingAdjust(new Date(i,s+(e<0?e:n[0]*n[1]),1));return e<0&&n.setDate(this._getDaysInMonth(n.getFullYear(),n.getMonth())),this._isInRange(t,n)},_isInRange:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=null,o=null,a=this._get(t,"yearRange");return a&&(t=a.split(":"),a=(new Date).getFullYear(),n=parseInt(t[0],10),o=parseInt(t[1],10),t[0].match(/[+\-].*/)&&(n+=a),t[1].match(/[+\-].*/)&&(o+=a)),(!i||e.getTime()>=i.getTime())&&(!s||e.getTime()<=s.getTime())&&(!n||e.getFullYear()>=n)&&(!o||e.getFullYear()<=o)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);e=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),e,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new b,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.2";V.datepicker;V.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V.ui.safeBlur(V.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(V.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=!(t=!(t=!(t=!(t=t||this.element.find("[autofocus]")).length?this.element.find(":tabbable"):t).length?this.uiDialogButtonPane.find(":tabbable"):t).length?this.uiDialogTitlebarClose.filter(":tabbable"):t).length?this.uiDialog:t).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=V.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=V("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);var e,i,s;t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=V("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("<button type='button'></button>").button({label:V("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=V("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=V("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("<button></button>",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i,s;this.options.modal&&(i=V.fn.jquery.substring(0,4),s=!0,this._delay(function(){s=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;s||((e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable(),"3.4."!==i&&"3.5."!==i||e._delay(e._restoreTabbableFocus)))}.bind(this)),this.overlay=V("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});V.ui.dialog,V.widget("ui.progressbar",{version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.13.2",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=V()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.trigger("focus"),t.preventDefault()}}),this.element.hide(),this.button=V("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=V("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=V("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=V("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),i._setSelection(),i._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){e=e.item.data("ui-selectmenu-item");null!=i.focusIndex&&e.index!==i.focusIndex&&(i._trigger("focus",t,{item:e}),i.isOpen||i._select(e,t)),i.focusIndex=e.index,i.button.attr("aria-activedescendant",i.menuItems.eq(e.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(V.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=V("<span>");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";V.each(t,function(t,e){var i;e.optgroup!==o&&(i=V("<li>",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=V("<li>"),s=V("<div>",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")}
vendor: 4,336 bytes, line 5011
5011,_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.trigger("focus"))},_documentClick:{mousedown:function(t){this.isOpen&&(V(t.target).closest(".ui-selectmenu-menu, #"+V.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case V.ui.keyCode.TAB:case V.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case V.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case V.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case V.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case V.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case V.ui.keyCode.LEFT:this._move("prev",t);break;case V.ui.keyCode.RIGHT:this._move("next",t);break;case V.ui.keyCode.HOME:case V.ui.keyCode.PAGE_UP:this._move("first",t);break;case V.ui.keyCode.END:case V.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){t=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(t,e){var i;"icons"===t&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)),this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t=!(t=!(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))||!t[0]?this.element.closest(".ui-front, dialog"):t).length?this.document[0].body:t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){e.hidden||s.push(i._parseOption(V(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),V.widget("ui.slider",V.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null}
vendor: 9,528 bytes, line 5011
5011,numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e=this.options,i=this.element.find(".ui-slider-handle"),s=[],n=e.values&&e.values.length||1;for(i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;t<n;t++)s.push("<span tabindex='0'></span>");this.handles=i.add(V(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){V(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:Array.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=V("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,s,n,o,e,a,r=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),a={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(a),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-r.values(t));(e<s||s===e&&(t===r._lastChangedValue||r.values(t)===l.min))&&(s=e,n=V(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,this._addClass(n,null,"ui-state-active"),n.trigger("focus"),e=n.offset(),a=!V(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=a?{left:0,top:0}:{left:t.pageX-e.left-n.width()/2,top:t.pageY-e.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},e=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,e),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,t="horizontal"===this.orientation?(e=this.elementSize.width,t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),t=t/e;return(t=1<t?1:t)<0&&(t=0),"vertical"===this.orientation&&(t=1-t),e=this._valueMax()-this._valueMin(),e=this._valueMin()+t*e,this._trimAlignValue(e)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n=this.value(),o=this.values();this._hasMultipleValues()&&(s=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(s,i):Math.max(s,i)),o[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,e){var i,s,n;if(1<arguments.length)return this.options.values[t]=this._trimAlignValue(e),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!Array.isArray(t))return this._hasMultipleValues()?this._values(t):this.value();for(i=this.options.values,s=t,n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(s[n]),this._change(null,n);this._refreshValue()},_setOption:function(t,e){var i,s=0;switch("range"===t&&!0===this.options.range&&("min"===e?(this.options.value=this._values(0),this.options.values=null):"max"===e&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,e),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(e),this.handles.css("horizontal"===e?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i;if(arguments.length)return t=this.options.values[t],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(e=this.options.values.slice(),i=0;i<e.length;i+=1)e[i]=this._trimAlignValue(e[i]);return e}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=0<this.options.step?this.options.step:1,i=(t-this._valueMin())%e,t=t-i;return 2*Math.abs(i)>=e&&(t+=0<i?e:-e),parseFloat(t.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;(t=Math.round((t-e)/i)*i+e)>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,l=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,h["horizontal"===r.orientation?"left":"bottom"]=i+"%",V(this).stop(1,1)[l?"animate":"css"](h,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](h,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=V(t.target).data("ui-slider-handle-index");switch(t.keyCode){case V.ui.keyCode.HOME:case V.ui.keyCode.END:case V.ui.keyCode.PAGE_UP:case V.ui.keyCode.PAGE_DOWN:case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(V(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case V.ui.keyCode.HOME:i=this._valueMin();break;case V.ui.keyCode.END:i=this._valueMax();break;case V.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;
vendor: 1,575 bytes, line 5011
5011case V.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case V.ui.keyCode.UP:case V.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case V.ui.keyCode.DOWN:case V.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=V(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(V(t.target),null,"ui-state-active"))}}});function M(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}V.widget("ui.spinner",{version:"1.13.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s}
vendor: 5,967 bytes, line 5011
5011,_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){var i=V.ui.safeActiveElement(this.document[0]);if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0<e?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var e;function i(){this.element[0]===V.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=e,this._delay(function(){this.previous=e}))}e=this.element[0]===V.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(V(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,V(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var e=this.options,i=V.ui.keyCode;switch(t.keyCode){case i.UP:return this._repeat(null,1,t),!0;case i.DOWN:return this._repeat(null,-1,t),!0;case i.PAGE_UP:return this._repeat(null,e.page,t),!0;case i.PAGE_DOWN:return this._repeat(null,-e.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var e=this.options.incremental;return e?"function"==typeof e?e(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var e=t.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_adjustValue:function(t){var e=this.options,i=null!==e.min?e.min:0,s=t-i;return t=i+Math.round(s/e.step)*e.step,t=parseFloat(t.toFixed(this._precision())),null!==e.max&&t>e.max?e.max:null!==e.min&&t<e.min?e.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(i=this.buttons.first().find(".ui-icon"),this._removeClass(i,null,this.options.icons.up),this._addClass(i,null,e.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:M(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:M(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:M(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:M(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:M(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());M(this._value).call(this,t)},widget:function(){return this.uiSpinner}}
vendor: 11,345 bytes, line 5011
5011),!1!==V.uiBackCompat&&V.widget("ui.spinner",V.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});var S;V.ui.spinner;V.widget("ui.tabs",{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(S=/#.*$/,function(t){var e=t.href.replace(S,""),i=location.href.replace(S,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=V.uniqueSort(t.disabled.concat(V.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=V(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,s=location.hash.substring(1);return null===i&&(s&&this.tabs.each(function(t,e){if(V(e).attr("aria-controls")===s)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):V()}},_tabKeydown:function(t){var e=V(V.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case V.ui.keyCode.RIGHT:case V.ui.keyCode.DOWN:i++;break;case V.ui.keyCode.UP:case V.ui.keyCode.LEFT:s=!1,i--;break;case V.ui.keyCode.END:i=this.anchors.length-1;break;case V.ui.keyCode.HOME:i=0;break;case V.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case V.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,s),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===V.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===V.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===V.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==V.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"!==t?(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)):this._activate(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=V.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!V.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=V()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=V()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){V(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n,o=V(e).uniqueId().attr("id"),a=V(e).closest("li"),r=a.attr("aria-controls");l._isLocal(e)?(n=(i=e.hash).substring(1),s=l.element.find(l._sanitizeSelector(i))):(n=a.attr("aria-controls")||V({}).uniqueId()[0].id,(s=l.element.find(i="#"+n)).length||(s=l._createPanel(n)).insertAfter(l.panels[t-1]||l.tablist),s.attr("aria-live","polite")),s.length&&(l.panels=l.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+V.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,
vendor: 11,731 bytes, line 5011
5011i){setTimeout(function(){a.html(t),o._trigger("load",s,r),n(i,e)},1)}).fail(function(t,e){setTimeout(function(){n(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});V.ui.tabs;V.widget("ui.tooltip",{version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){s._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=n),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,n.is(":hidden")||n.position(a)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(i=V("<div>").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),i.removeAttr("id").find("[id]").removeAttr("id"),i.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):n.position(V.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(r(a.of),clearInterval(o))},13)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("<div>").attr("role","tooltip"),i=V("<div>").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=!t.length?this.document[0].body:t},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});V.ui.tooltip;var H=V,z={},A=z.toString,O=/^([\-+])=\s*(\d+\.?\d*)/,N=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],E=H.Color=function(t,e,i,s){return new H.Color.fn.parse(t,e,i,s)},W={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},F={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},L=E.support={},R=H("<p>")[0],Y=H.each;function B(t){return null==t?t+"":"object"==typeof t?z[A.call(t)]||"object":typeof t}function j(t,e,i){var s=F[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function q(s){var n=E(),o=n._rgba=[];return s=s.toLowerCase(),Y(N,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[W[e].cache]=i[W[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&H.extend(o,st.transparent),n):st[s]}function K(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}R.style.cssText="background-color:rgba(1,1,1,.5)",L.rgba=-1<R.style.backgroundColor.indexOf("rgba"),Y(W,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),H.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){z["[object "+e+"]"]=e.toLowerCase()}),(E.fn=H.extend(E.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=H(n).css(t),t=void 0);var o=this,s=B(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse(q(n)||st._default):"array"===s?(Y(W.rgba.props,function(t,e){a[e.idx]=j(n[e.idx],e)}),this):"object"===s?(Y(W,n instanceof E?function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}:function(t,i){var s=i.cache;Y(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=j(n[t],e,!0)}),o[s]&&H.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from&&(o._rgba=i.from(o[s])))}),this):void 0},is:function(t){var n=E(t),o=!0,a=this;return Y(W,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],Y(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return Y(W,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var e=(h=E(t))._space(),i=W[e],t=0===this.alpha()?E("transparent"):this,r=t[i.cache]||i.to(t._rgba),l=r.slice(),h=h[i.cache];return Y(i.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=F[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=j((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=E(t)._rgba;return E(H.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=H.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=H.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),i=e.pop();return t&&e.push(~~(255*i)),"#"+H.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=E.fn,W.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,i=t[1]/255,s=t[2]/255,n=t[3],o=Math.max(e,i,s),a=Math.min(e,i,s),r=o-a,l=o+a,t=.5*l,i=a===o?0:e===o?60*(i-s)/r+360:i===o?60*(s-e)/r+120:60*(e-i)/r+240,l=0==r?0:t<=.5?r/l:r/(2-l);return[Math.round(i)%360,l,t,null==n?1:n]},W.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],t=t[3],i=s<=.5?s*(1+i):s+i-s*i,s=2*s-i;return[Math.round(255*K(s,i,e+1/3)),Math.round(255*K(s,i,e)),Math.round(255*K(s,i,e-1/3)),t]},Y(W,function(l,t){var e=t.props,o=t.cache,a=t.to,r=t.from;E.fn[l]=function(t){if(a&&!this[o]&&(this[o]=a(this._rgba)),void 0===t)return this[o].slice();var i=B(t),s="array"===i||"object"===i?t:arguments,n=this[o].slice();return Y(e,function(t,e){t=s["object"===i?t:e.idx];null==t&&(t=n[e.idx]),n[e.idx]=j(t,e)}),r?((t=E(r(n)))[o]=n,t):E(n)}
vendor: 20,491 bytes, lines 5011-5022
5011,Y(e,function(a,r){E.fn[a]||(E.fn[a]=function(t){var e,i=B(t),s="alpha"===a?this._hsla?"hsla":"rgba":l,n=this[s](),o=n[r.idx];return"undefined"===i?o:("function"===i&&(i=B(t=t.call(this,o))),null==t&&r.empty?this:("string"===i&&(e=O.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),n[r.idx]=t,this[s](n)))})})}),(E.hook=function(t){t=t.split(" ");Y(t,function(t,o){H.cssHooks[o]={set:function(t,e){var i,s,n="";if("transparent"!==e&&("string"!==B(e)||(i=q(e)))){if(e=E(i||e),!L.rgba&&1!==e._rgba[3]){for(s="backgroundColor"===o?t.parentNode:t;(""===n||"transparent"===n)&&s&&s.style;)try{n=H.css(s,"backgroundColor"),s=s.parentNode}catch(t){}e=e.blend(n&&"transparent"!==n?n:"_default")}e=e.toRgbaString()}try{t.style[o]=e}catch(t){}}},H.fx.step[o]=function(t){t.colorInit||(t.start=E(t.elem,o),t.end=E(t.end),t.colorInit=!0),H.cssHooks[o].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),H.cssHooks.borderColor={expand:function(i){var s={};return Y(["Top","Right","Bottom","Left"],function(t,e){s["border"+e+"Color"]=i}),s}};var U,X,$,G,Q,J,Z,tt,et,it,st=H.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},nt="ui-effects-",ot="ui-effects-style",at="ui-effects-animated";function rt(t){var e,i,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,n={};if(s&&s.length&&s[0]&&s[s[0]])for(i=s.length;i--;)"string"==typeof s[e=s[i]]&&(n[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=s[e]);else for(e in s)"string"==typeof s[e]&&(n[e]=s[e]);return n}function lt(t,e,i,s){return t={effect:t=V.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(s=e,i=null,e={}),"number"!=typeof e&&!V.fx.speeds[e]||(s=i,i=e,e={}),"function"==typeof i&&(s=i,i=null),e&&V.extend(t,e),i=i||e.duration,t.duration=V.fx.off?0:"number"==typeof i?i:i in V.fx.speeds?V.fx.speeds[i]:V.fx.speeds._default,t.complete=s||e.complete,t}function ht(t){return!t||"number"==typeof t||V.fx.speeds[t]||("string"==typeof t&&!V.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function ct(t,e){var i=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,i,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?i:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}V.effects={effect:{}},G=["add","remove","toggle"],Q={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},V.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){V.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(H.style(t.elem,e,t.end),t.setAttr=!0)}}),V.fn.addBack||(V.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),V.effects.animateClass=function(n,t,e,i){var o=V.speed(t,e,i);return this.queue(function(){var i=V(this),t=i.attr("class")||"",e=(e=o.children?i.find("*").addBack():i).map(function(){return{el:V(this),start:rt(this)}}),s=function(){V.each(G,function(t,e){n[e]&&i[e+"Class"](n[e])})};s(),e=e.map(function(){return this.end=rt(this.el[0]),this.diff=function(t,e){var i,s,n={};for(i in e)s=e[i],t[i]!==s&&(Q[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s));return n}(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:($=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):$.apply(this,arguments)}),removeClass:(X=V.fn.removeClass,function(t,e,i,s){return 1<arguments.length?V.effects.animateClass.call(this,{remove:t},e,i,s):X.apply(this,arguments)}),toggleClass:(U=V.fn.toggleClass,function(t,e,i,s,n){return"boolean"==typeof e||void 0===e?i?V.effects.animateClass.call(this,e?{add:t}:{remove:t},i,s,n):U.apply(this,arguments):V.effects.animateClass.call(this,{toggle:t},e,i,s)}),switchClass:function(t,e,i,s,n){return V.effects.animateClass.call(this,{add:e,remove:t},i,s,n)}}),V.expr&&V.expr.pseudos&&V.expr.pseudos.animated&&(V.expr.pseudos.animated=(J=V.expr.pseudos.animated,function(t){return!!V(t).data(at)||J(t)})),!1!==V.uiBackCompat&&V.extend(V.effects,{save:function(t,e){for(var i=0,s=e.length;i<s;i++)null!==e[i]&&t.data(nt+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;s<n;s++)null!==e[s]&&(i=t.data(nt+e[s]),t.css(e[s],i))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(i){if(i.parent().is(".ui-effects-wrapper"))return i.parent();var s={width:i.outerWidth(!0),height:i.outerHeight(!0),float:i.css("float")},t=V("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.13.2",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,e="vertical"!==i?(e||100)/100:1;return{height:t.height()*e,width:t.width()*s,outerHeight:t.outerHeight()*e,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1<e&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(ot,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(ot)||"",t.removeData(ot)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(t){var e,i=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(i)&&(i="absolute",e=V("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(nt+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=nt+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0<i[0]&&(o[e]=i[0]*n+i[1])}),o}}),V.fn.extend({effect:function(){function t(t){var e=V(this),i=V.effects.mode(e,r)||o;e.data(at,!0),l.push(i),o&&("show"===i||i===o&&"hide"===i)&&e.show(),o&&"none"===i||V.effects.saveStyle(e),"function"==typeof t&&t()}var s=lt.apply(this,arguments),n=V.effects.effect[s.effect],o=n.mode,e=s.queue,i=e||"fx",a=s.complete,r=s.mode,l=[];return V.fx.off||!n?r?this[r](s.duration,a):this.each(function(){a&&a.call(this)}):!1===e?this.each(t).each(h):this.queue(i,t).queue(i,h);function h(t){var e=V(this);function i(){"function"==typeof a&&a.call(e[0]),"function"==typeof t&&t()}s.mode=l.shift(),!1===V.uiBackCompat||o?"none"===s.mode?(e[r](),i()):n.call(e[0],s,function(){e.removeData(at),V.effects.cleanUp(e),"hide"===s.mode&&e.hide(),i()}):(e.is(":hidden")?"hide"===r:"show"===r)?(e[r](),i()):n.call(e[0],s,i)}},show:(et=V.fn.show,function(t){if(ht(t))return et.apply(this,arguments);t=lt.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(tt=V.fn.hide,function(t){if(ht(t))return tt.apply(this,arguments);t=lt.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(Z=V.fn.toggle,function(t){if(ht(t)||"boolean"==typeof t)return Z.apply(this,arguments);t=lt.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(t){var i=this.css(t),s=[];return V.each(["em","px","%","pt"],function(t,e){0<i.indexOf(e)&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):ct(this.css("clip"),this)},transfer:function(t,e){var i=V(this),s=V(t.to),n="fixed"===s.css("position"),o=V("body"),a=n?o.scrollTop():0,r=n?o.scrollLeft():0,o=s.offset(),o={top:o.top-a,left:o.left-r,height:s.innerHeight(),width:s.innerWidth()},s=i.offset(),l=V("<div class='ui-effects-transfer'></div>");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(o,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=ct(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},it={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){it[t]=function(t){return Math.pow(t,e+2)}}),V.extend(it,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(it,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});R=V.effects,V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,r="show"===o,l=t.direction||"up",h=t.distance,c=t.times||5,o=2*c+(r||a?1:0),u=t.duration/o,d=t.easing,p="up"===l||"down"===l?"top":"left",f="up"===l||"left"===l,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),l=n.css(p),h=h||n["top"==p?"outerHeight":"outerWidth"]()/3,r&&((s={opacity:1})[p]=l,n.css("opacity",0).css(p,f?2*-h:2*h).animate(s,u,d)),a&&(h/=Math.pow(2,c-1)),(s={})[p]=l;g<c;g++)(i={})[p]=(f?"-=":"+=")+h,n.animate(i,u,d).animate(s,u,d),h=a?2*h:h/2;a&&((i={opacity:0})[p]=(f?"-=":"+=")+h,n.animate(i,u,d)),n.queue(e),V.effects.unshift(n,t,1+o)}),V.effects.define("clip","hide",function(t,e){var i={},s=V(this),n=t.direction||"vertical",o="both"===n,a=o||"horizontal"===n,o=o||"vertical"===n,n=s.cssClip();i.clip={top:o?(n.bottom-n.top)/2:n.top,right:a?(n.right-n.left)/2:n.right,bottom:o?(n.bottom-n.top)/2:n.bottom,left:a?(n.right-n.left)/2:n.left},V.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=n),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("drop","hide",function(t,e){var i=V(this),s="show"===t.mode,n=t.direction||"left",o="up"===n||"down"===n?"top":"left",a="up"===n||"left"===n?"-=":"+=",r="+="==a?"-=":"+=",l={opacity:0};V.effects.createPlaceholder(i),n=t.distance||i["top"==o?"outerHeight":"outerWidth"](!0)/2,l[o]=a+n,s&&(i.css(l),l[o]=r+n,l.opacity=1),i.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("explode","hide",function(t,e){var i,s,n,o,a,r,l=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=l,c=V(this),u="show"===t.mode,d=c.show().css("visibility","hidden").offset(),p=Math.ceil(c.outerWidth()/h),f=Math.ceil(c.outerHeight()/l),g=[];function m(){g.push(this),g.length===l*h&&(c.css({visibility:"visible"}),V(g).remove(),e())}for(i=0;i<l;i++)for(o=d.top+i*f,r=i-(l-1)/2,s=0;s<h;s++)n=d.left+s*p,a=s-(h-1)/2,c.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),l=!!e.horizFirst?["right","bottom"]:["bottom","right"],h=e.duration/2,c=V.effects.createPlaceholder(i),u=i.cssClip(),d={clip:V.extend({},u)},p={clip:V.extend({},u)},f=[u[l[0]],u[l[1]]],s=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[l[0]]=a,p.clip[l[0]]=a,p.clip[l[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(V.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(V.effects.clipToBox(d),h,e.easing).animate(V.effects.clipToBox(p),h,e.easing),t()}).animate(d,h,e.easing).animate(p,h,e.easing).queue(t),V.effects.unshift(i,s,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(c=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*c.y+d.top,f.left=(p.outerWidth-f.outerWidth)*c.x+d.left,g.top=(p.outerHeight-g.outerHeight)*c.y+d.top,g.left=(p.outerWidth-g.outerWidth)*c.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),s=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(s.from.opacity=1,s.to.opacity=0),V.effects.effect.size.call(this,s,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l<o;l++)i.animate({opacity:r},a,t.easing),r=1-r;i.animate({opacity:r},a,t.easing),i.queue(e),V.effects.unshift(i,s,1+o)}),V.effects.define("shake",function(t,e){var i=1,s=V(this),n=t.direction||"left",o=t.distance||20,a=t.times||3,r=2*a+1,l=Math.round(t.duration/r),h="up"===n||"down"===n?"top":"left",c="up"===n||"left"===n,u={},d={},p={},n=s.queue().length;for(V.effects.createPlaceholder(s),u[h]=(c?"-=":"+=")+o,d[h]=(c?"+=":"-=")+2*o,p[h]=(c?"-=":"+=")+2*o,s.animate(u,l,t.easing);i<a;i++)s.animate(d,l,t.easing).animate(p,l,t.easing);s.animate(d,l,t.easing).animate(u,l/2,t.easing).queue(e),V.effects.unshift(s,n,1+r)}),V.effects.define("slide","show",function(t,e){var i,s,n=V(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},a=t.mode,r=t.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r,c=t.distance||n["top"==l?"outerHeight":"outerWidth"](!0),u={};V.effects.createPlaceholder(n),i=n.cssClip(),s=n.position()[l],u[l]=(h?-1:1)*c+s,u.clip=n.cssClip(),u.clip[o[r][1]]=u.clip[o[r][0]],"show"===a&&(n.cssClip(u.clip),n.css(l,u[l]),u.clip=i,u[l]=s),n.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),!1!==V.uiBackCompat&&V.effects.define("transfer",function(t,e){V(this).transfer(t,e)})}); 5012define("jqueryUi", ["jquery"], (function (global) { 5013 return function () { 5014 var ret, fn; 5015 return ret || global.jQuery.ui; 5016 }; 5017}(this))); 5018 5019/*! jquery.selectBoxIt - v3.7.0 - 2013-08-18 5020* http://www.selectboxit.com 5021* Copyright (c) 2013 Greg Franko; Licensed MIT*/ 5022!function(a){"use strict";a(window.jQuery,window,document)}(function(a,b,c,d){"use strict";a.widget("selectBox.selectBoxIt",{VERSION:"3.7.0",options:{showEffect:"none",showEffectOptions:{},showEffectSpeed:"medium",hideEffect:"none",hideEffectOptions:{},hideEffectSpeed:"medium",showFirstOption:!0,defaultText:"",defaultIcon:"",downArrowIcon:"",theme:"default",keydownOpen:!0,isMobile:function(){var a=navigator.userAgent||navigator.vendor||b.opera;return/iPhone|iPod|iPad|Silk|Android|BlackBerry|Opera Mini|IEMobile/.test(a)}
5022,"native":!1,aggressiveChange:!1,selectWhenHidden:!0,viewport:a(b),similarSearch:!1,copyAttributes:["title","rel"],copyClasses:"button",nativeMousedown:!1,customShowHideEvent:!1,autoWidth:!0,html:!0,populate:"",dynamicPositioning:!0,hideCurrent:!1},getThemes:function(){var b=this,c=a(b.element).attr("data-theme")||"c";return{bootstrap:{focus:"active",hover:"",enabled:"enabled",disabled:"disabled",arrow:"caret",button:"btn",list:"dropdown-menu",container:"bootstrap",open:"open"},jqueryui:{focus:"ui-state-focus",hover:"ui-state-hover",enabled:"ui-state-enabled",disabled:"ui-state-disabled",arrow:"ui-icon ui-icon-triangle-1-s",button:"ui-widget ui-state-default",list:"ui-widget ui-widget-content",container:"jqueryui",open:"selectboxit-open"},jquerymobile:{focus:"ui-btn-down-"+c,hover:"ui-btn-hover-"+c,enabled:"ui-enabled",disabled:"ui-disabled",arrow:"ui-icon ui-icon-arrow-d ui-icon-shadow",button:"ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-"+c,list:"ui-btn ui-btn-icon-right ui-btn-corner-all ui-shadow ui-btn-up-"+c,container:"jquerymobile",open:"selectboxit-open"},"default":{focus:"selectboxit-focus",hover:"selectboxit-hover",enabled:"selectboxit-enabled",disabled:"selectboxit-disabled",arrow:"selectboxit-default-arrow",button:"selectboxit-btn",list:"selectboxit-list",container:"selectboxit-container",open:"selectboxit-open"}}},isDeferred:function(b){return a.isPlainObject(b)&&b.promise&&b.done},_create:function(b){var d=this,e=d.options.populate;if(d.element.is("select"))return d.widgetProto=a.Widget.prototype,d.originalElem=d.element[0],d.selectBox=d.element,d.options.populate&&d.add&&!b&&d.add(e),d.selectItems=d.element.find("option"),d.firstSelectItem=d.selectItems.slice(0,1),d.documentHeight=a(c).height(),d.theme=d.getThemes()[d.options.theme]||d.getThemes()["default"],d.currentFocus=0,d.blur=!0,d.textArray=[],d.currentIndex=0,d.currentText="",d.flipped=!1,b||(d.selectBoxStyles=d.selectBox.attr("style")),d._createDropdownButton()._createUnorderedList()._copyAttributes()._replaceSelectBox()._addClasses(d.theme)._eventHandlers(),d.originalElem.disabled&&d.disable&&d.disable(),d._ariaAccessibility&&d._ariaAccessibility(),d.isMobile=d.options.isMobile(),d._mobile&&d._mobile(),d.options["native"]&&this._applyNativeSelect(),d.triggerEvent("create"),d},_createDropdownButton:function(){var b=this,c=b.originalElemId=b.originalElem.id||"",d=b.originalElemValue=b.originalElem.value||"",e=b.originalElemName=b.originalElem.name||"",f=b.options.copyClasses,g=b.selectBox.attr("class")||"";return b.dropdownText=a("<span/>",{id:c&&c+"SelectBoxItText","class":"selectboxit-text",unselectable:"on",text:b.firstSelectItem.text()}).attr("data-val",d),b.dropdownImageContainer=a("<span/>",{"class":"selectboxit-option-icon-container"}),b.dropdownImage=a("<i/>",{id:c&&c+"SelectBoxItDefaultIcon","class":"selectboxit-default-icon",unselectable:"on"}),b.dropdown=a("<span/>",{id:c&&c+"SelectBoxIt","class":"selectboxit "+("button"===f?g:"")+" "+(b.selectBox.prop("disabled")?b.theme.disabled:b.theme.enabled),name:e,tabindex:b.selectBox.attr("tabindex")||"0",unselectable:"on"}).append(b.dropdownImageContainer.append(b.dropdownImage)).append(b.dropdownText),b.dropdownContainer=a("<span/>",{id:c&&c+"SelectBoxItContainer","class":"selectboxit-container "+("container"===f?g:"")}).append(b.dropdown),b},_createUnorderedList:function(){var b,c,d,e,f,g,h,i,j,k,l,m=this,n="",o=m.originalElemId||"",p=a("<ul/>",{id:o&&o+"SelectBoxItOptions","class":"selectboxit-options",tabindex:-1});if(m.options.showFirstOption||(m.selectItems.first().attr("disabled","disabled"),m.selectItems=m.selectBox.find("option").slice(1)),m.selectItems.each(function(o){c="",d="",b=a(this).prop("disabled"),e=a(this).attr("data-icon")||"",f=a(this).attr("data-iconurl")||"",g=f?"selectboxit-option-icon-url":"",h=f?"style=\"background-image:url('"+f+"');\"":"",i=a(this).attr("data-selectedtext"),j=a(this).attr("data-text"),k=j?j:a(this).text(),l=a(this).parent(),l.is("optgroup")&&(c="selectboxit-optgroup-option",0===a(this).index()&&(d='<span class="selectboxit-optgroup-header '+l.first().attr("class")+'"data-disabled="true">'+l.first().attr("label")+"</span>")),n+=d+'<li id="'+o+'" data-val="'+this.value+'" data-disabled="'+b+'" class="'+c+" selectboxit-option "+(a(this).attr("class")||"")+'"><a class="selectboxit-option-anchor"><span class="selectboxit-option-icon-container"><i class="selectboxit-option-icon '+e+" "+(g||m.theme.container)+'"'+h+"></i></span>"+(m.options.html?k:m.htmlEscape(k))+"</a></li>",m.textArray[o]=b?"":k,this.selected&&(m._setText(m.dropdownText,i||k),m.currentFocus=o)}),m.options.defaultText||m.selectBox.attr("data-text")){var q=m.options.defaultText||m.selectBox.attr("data-text");m._setText(m.dropdownText,q),m.options.defaultText=q}return p.append(n),m.list=p,m.dropdownContainer.append(m.list),m.listItems=m.list.children("li"),m.listAnchors=m.list.find("a"),m.listItems.first().addClass("selectboxit-option-first"),m.listItems.last(
5022).addClass("selectboxit-option-last"),m.list.find("li[data-disabled='true']").not(".optgroupHeader").addClass(m.theme.disabled),m.dropdownImage.addClass(m.selectBox.attr("data-icon")||m.options.defaultIcon||m.listItems.eq(m.currentFocus).find("i").attr("class")),m.dropdownImage.attr("style",m.listItems.eq(m.currentFocus).find("i").attr("style")),m},_replaceSelectBox:function(){var b,c=this,e=c.originalElem.id||"",f=c.selectBox.attr("data-size"),g=c.listSize=f===d?"auto":"0"===f?"auto":+f;return c.selectBox.css("display","none").after(c.dropdownContainer),b=c.dropdown.height(),c.downArrow=a("<i/>",{id:e&&e+"SelectBoxItArrow","class":"selectboxit-arrow",unselectable:"on"}),c.downArrowContainer=a("<span/>",{id:e&&e+"SelectBoxItArrowContainer","class":"selectboxit-arrow-container",unselectable:"on"}).append(c.downArrow),c.dropdown.append(c.downArrowContainer),c.listItems.removeClass("selectboxit-selected").eq(c.currentFocus).addClass("selectboxit-selected"),c._realOuterWidth(c.dropdownImageContainer)||c.dropdownImageContainer.remove(),c.options.autoWidth&&(c.dropdown.is(":visible")?c.dropdown.css({width:"auto"}).css({width:c.list.outerWidth(!0)+c.downArrowContainer.outerWidth(!0)+c.dropdownImage.outerWidth(!0)}):c.dropdown.css({width:"auto"}).css({width:c._realOuterWidth(c.list)+c._realOuterWidth(c.downArrowContainer)+c._realOuterWidth(c.dropdownImage)}),c.list.css({"min-width":c.dropdown.width()})),c.dropdownContainer.addClass("selectboxit-rendering"),c.dropdownText.css({"max-width":c.dropdownContainer.outerWidth(!0)-(c.downArrowContainer.outerWidth(!0)+c.dropdownImage.outerWidth(!0))}),c.dropdownContainer.removeClass("selectboxit-rendering"),"number"===a.type(g)&&(c.maxHeight=c.listAnchors.outerHeight(!0)*g),c},_scrollToView:function(a){var b=this,c=b.listItems.eq(b.currentFocus),d=b.list.scrollTop(),e=c.height(),f=c.position().top,g=Math.abs(f),h=b.list.height();return"search"===a?e>h-f?b.list.scrollTop(d+(f-(h-e))):-1>f&&b.list.scrollTop(f-e):"up"===a?-1>f&&b.list.scrollTop(d-g):"down"===a&&e>h-f&&b.list.scrollTop(d+(g-h+e)),b},_callbackSupport:function(b){var c=this;return a.isFunction(b)&&b.call(c,c.dropdown),c},_setText:function(a,b){var c=this;return c.options.html?a.html(b):a.text(b),c},open:function(a){var b=this,c=b.options.showEffect,d=b.options.showEffectSpeed,e=b.options.showEffectOptions,f=b.options["native"],g=b.isMobile;return!b.listItems.length||b.dropdown.hasClass(b.theme.disabled)?b:(f||g||this.list.is(":visible")||(b.triggerEvent("open"),b._dynamicPositioning&&b.options.dynamicPositioning&&b._dynamicPositioning(),"none"===c?b.list.show():"show"===c||"slideDown"===c||"fadeIn"===c?b.list[c](d):b.list.show(c,e,d),b.list.promise().done(function(){b._scrollToView("search")})),b._callbackSupport(a),b)},close:function(a){var b=this,c=b.options.hideEffect,d=b.options.hideEffectSpeed,e=b.options.hideEffectOptions,f=b.options["native"],g=b.isMobile;return f||g||!b.list.is(":visible")||(b.triggerEvent("close"),"none"===c?b.list.hide():"hide"===c||"slideUp"===c||"fadeOut"===c?b.list[c](d):b.list.hide(c,e,d)),b._callbackSupport(a),b},toggle:function(){var a=this,b=a.list.is(":visible");b?a.close():b||a.open()},_keyMappings:{38:"up",40:"down",13:"enter",8:"backspace",9:"tab",32:"space",27:"esc"},_keydownMethods:function(){var a=this,b=a.list.is(":visible")||!a.options.keydownOpen;return{down:function(){a.moveDown&&b&&a.moveDown()},up:function(){a.moveUp&&b&&a.moveUp()},enter:function(){var b=a.listItems.eq(a.currentFocus);a._update(b),"true"!==b.attr("data-preventclose")&&a.close(),a.triggerEvent("enter")},tab:function(){a.triggerEvent("tab-blur"),a.close()},backspace:function(){a.triggerEvent("backspace")},esc:function(){a.close()}}},_eventHandlers:function(){var b,c,d=this,e=d.options.nativeMousedown,f=d.options.customShowHideEvent,g=d.focusClass,h=d.hoverClass,i=d.openClass;return this.dropdown.on({"click.selectBoxIt":function(){d.dropdown.trigger("focus",!0),d.originalElem.disabled||(d.triggerEvent("click"),e||f||d.toggle())},"mousedown.selectBoxIt":function(){a(this).data("mdown",!0),d.triggerEvent("mousedown"),e&&!f&&d.toggle()},"mouseup.selectBoxIt":function(){d.triggerEvent("mouseup")},"blur.selectBoxIt":function(){d.blur&&(d.triggerEvent("blur"),d.close(),a(this).removeClass(g))},"focus.selectBoxIt":function(b,c){var e=a(this).data("mdown");a(this).removeData("mdown"),e||c||setTimeout(function(){d.triggerEvent("tab-focus")}
5022,0),c||(a(this).hasClass(d.theme.disabled)||a(this).addClass(g),d.triggerEvent("focus"))},"keydown.selectBoxIt":function(a){var b=d._keyMappings[a.keyCode],c=d._keydownMethods()[b];c&&(c(),!d.options.keydownOpen||"up"!==b&&"down"!==b||d.open()),c&&"tab"!==b&&a.preventDefault()},"keypress.selectBoxIt":function(a){var b=a.charCode||a.keyCode,c=d._keyMappings[a.charCode||a.keyCode],e=String.fromCharCode(b);d.search&&(!c||c&&"space"===c)&&d.search(e,!0,!0),"space"===c&&a.preventDefault()},"mouseenter.selectBoxIt":function(){d.triggerEvent("mouseenter")},"mouseleave.selectBoxIt":function(){d.triggerEvent("mouseleave")}}),d.list.on({"mouseover.selectBoxIt":function(){d.blur=!1},"mouseout.selectBoxIt":function(){d.blur=!0},"focusin.selectBoxIt":function(){d.dropdown.trigger("focus",!0)}}),d.list.on({"mousedown.selectBoxIt":function(){d._update(a(this)),d.triggerEvent("option-click"),"false"===a(this).attr("data-disabled")&&"true"!==a(this).attr("data-preventclose")&&d.close(),setTimeout(function(){d.dropdown.trigger("focus",!0)},0)},"focusin.selectBoxIt":function(){d.listItems.not(a(this)).removeAttr("data-active"),a(this).attr("data-active","");var b=d.list.is(":hidden");(d.options.searchWhenHidden&&b||d.options.aggressiveChange||b&&d.options.selectWhenHidden)&&d._update(a(this)),a(this).addClass(g)},"mouseup.selectBoxIt":function(){e&&!f&&(d._update(a(this)),d.triggerEvent("option-mouseup"),"false"===a(this).attr("data-disabled")&&"true"!==a(this).attr("data-preventclose")&&d.close())},"mouseenter.selectBoxIt":function(){"false"===a(this).attr("data-disabled")&&(d.listItems.removeAttr("data-active"),a(this).addClass(g).attr("data-active",""),d.listItems.not(a(this)).removeClass(g),a(this).addClass(g),d.currentFocus=+a(this).attr("id"))}
5022,"mouseleave.selectBoxIt":function(){"false"===a(this).attr("data-disabled")&&(d.listItems.not(a(this)).removeClass(g).removeAttr("data-active"),a(this).addClass(g),d.currentFocus=+a(this).attr("id"))},"blur.selectBoxIt":function(){a(this).removeClass(g)}},".selectboxit-option"),d.list.on({"click.selectBoxIt":function(a){a.preventDefault()}},"a"),d.selectBox.on({"change.selectBoxIt, internal-change.selectBoxIt":function(a,e){var f,g;e||(f=d.list.find('li[data-val="'+d.originalElem.value+'"]'),f.length&&(d.listItems.eq(d.currentFocus).removeClass(d.focusClass),d.currentFocus=+f.attr("id"))),f=d.listItems.eq(d.currentFocus),g=f.attr("data-selectedtext"),b=f.attr("data-text"),c=b?b:f.find("a").text(),d._setText(d.dropdownText,g||c),d.dropdownText.attr("data-val",d.originalElem.value),f.find("i").attr("class")&&(d.dropdownImage.attr("class",f.find("i").attr("class")).addClass("selectboxit-default-icon"),d.dropdownImage.attr("style",f.find("i").attr("style"))),d.triggerEvent("changed")},"disable.selectBoxIt":function(){d.dropdown.addClass(d.theme.disabled)},"enable.selectBoxIt":function(){d.dropdown.removeClass(d.theme.disabled)},"open.selectBoxIt":function(){var a,b=d.list.find("li[data-val='"+d.dropdownText.attr("data-val")+"']");b.length||(b=d.listItems.not("[data-disabled=true]").first()),d.currentFocus=+b.attr("id"),a=d.listItems.eq(d.currentFocus),d.dropdown.addClass(i).removeClass(h).addClass(g),d.listItems.removeClass(d.selectedClass).removeAttr("data-active").not(a).removeClass(g),a.addClass(d.selectedClass).addClass(g),d.options.hideCurrent&&(d.listItems.show(),a.hide())},"close.selectBoxIt":function(){d.dropdown.removeClass(i)},"blur.selectBoxIt":function(){d.dropdown.removeClass(g)},"mouseenter.selectBoxIt":function(){a(this).hasClass(d.theme.disabled)||d.dropdown.addClass(h)}
5022,"mouseleave.selectBoxIt":function(){d.dropdown.removeClass(h)},destroy:function(a){a.preventDefault(),a.stopPropagation()}}),d},_update:function(a){var b,c,d,e=this,f=e.options.defaultText||e.selectBox.attr("data-text"),g=e.listItems.eq(e.currentFocus);"false"===a.attr("data-disabled")&&(b=e.listItems.eq(e.currentFocus).attr("data-selectedtext"),c=g.attr("data-text"),d=c?c:g.text(),(f&&e.options.html?e.dropdownText.html()===f:e.dropdownText.text()===f)&&e.selectBox.val()===a.attr("data-val")?e.triggerEvent("change"):(e.selectBox.val(a.attr("data-val")),e.currentFocus=+a.attr("id"),e.originalElem.value!==e.dropdownText.attr("data-val")&&e.triggerEvent("change")))},_addClasses:function(a){var b=this,c=(b.focusClass=a.focus,b.hoverClass=a.hover,a.button),d=a.list,e=a.arrow,f=a.container;return b.openClass=a.open,b.selectedClass="selectboxit-selected",b.downArrow.addClass(b.selectBox.attr("data-downarrow")||b.options.downArrowIcon||e),b.dropdownContainer.addClass(f),b.dropdown.addClass(c),b.list.addClass(d),b},refresh:function(a,b){var c=this;return c._destroySelectBoxIt()._create(!0),b||c.triggerEvent("refresh"),c._callbackSupport(a),c},htmlEscape:function(a){return String(a).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},triggerEvent:function(a){var b=this,c=b.options.showFirstOption?b.currentFocus:b.currentFocus-1>=0?b.currentFocus:0;return b.selectBox.trigger(a,{selectbox:b.selectBox,selectboxOption:b.selectItems.eq(c),dropdown:b.dropdown,dropdownOption:b.listItems.eq(b.currentFocus)}),b},_copyAttributes:function(){var a=this;return a._addSelectBoxAttributes&&a._addSelectBoxAttributes(),a},_realOuterWidth:function(a){if(a.is(":visible"))return a.outerWidth(!0);var b,c=a.clone();return c.css({visibility:"hidden",display:"block",position:"absolute"}).appendTo("body"),b=c.outerWidth(!0),c.remove(),b}});var e=a.selectBox.selectBoxIt.prototype;e.add=function(b,c){this._populate(b,function(b){var d,e,f=this,g=a.type(b),h=0,i=[],j=f._isJSON(b),k=j&&f._parseJSON(b);if(b&&("array"===g||j&&k.data&&"array"===a.type(k.data))||"object"===g&&b.data&&"array"===a.type(b.data)){for(f._isJSON(b)&&(b=k),b.data&&(b=b.data),e=b.length;e-1>=h;h+=1)d=b[h],a.isPlainObject(d)?i.push(a("<option/>",d)):"string"===a.type(d)&&i.push(a("<option/>",{text:d,value:d}));f.selectBox.append(i)}else b&&"string"===g&&!f._isJSON(b)?f.selectBox.append(b):b&&"object"===g?f.selectBox.append(a("<option/>",b)):b&&f._isJSON(b)&&a.isPlainObject(f._parseJSON(b))&&f.selectBox.append(a("<option/>",f._parseJSON(b)));return f.dropdown?f.refresh(function(){f._callbackSupport(c)},!0):f._callbackSupport(c),f})},e._parseJSON=function(b){return JSON&&JSON.parse&&JSON.parse(b)||a.parseJSON(b)},e._isJSON=function(a){var b,c=this;try{return b=c._parseJSON(a),!0}catch(d){return!1}},e._populate=function(b,c){var d=this;return b=a.isFunction(b)?b.call():b,d.isDeferred(b)?b.done(function(a){c.call(d,a)}):c.call(d,b),d},e._ariaAccessibility=function(){var b=this,c=a("label[for='"+b.originalElem.id+"']");return b.dropdownContainer.attr({role:"combobox","aria-autocomplete":"list","aria-haspopup":"true","aria-expanded":"false","aria-owns":b.list[0].id}),b.dropdownText.attr({"aria-live":"polite"}),b.dropdown.on({"disable.selectBoxIt":function(){b.dropdownContainer.attr("aria-disabled","true")},"enable.selectBoxIt":function(){b.dropdownContainer.attr("aria-disabled","false")}}),c.length&&b.dropdownContainer.attr("aria-labelledby",c[0].id),b.list.attr({role:"listbox","aria-hidden":"true"}),b.listItems.attr({role:"option"}),b.selectBox.on({"open.selectBoxIt":function(){b.list.attr("aria-hidden","false"),b.dropdownContainer.attr("aria-expanded","true")},"close.selectBoxIt":function(){b.list.attr("aria-hidden","true"),b.dropdownContainer.attr("aria-expanded","false")}}),b},e._addSelectBoxAttributes=function(){var b=this;return b._addAttributes(b.selectBox.prop("attributes"),b.dropdown),b.selectItems.each(function(c){b._addAttributes(a(this).prop("attributes"),b.listItems.eq(c))}),b},e._addAttributes=function(b,c){var d=this,e=d.options.copyAttributes;return b.length&&a.each(b,function(b,d){var f=d.name.toLowerCase(),g=d.value;"null"===g||-1===a.inArray(f,e)&&-1===f.indexOf("data")||c.attr(f,g)}),d},e.destroy=function(a){var b=this;return b._destroySelectBoxIt(),b.widgetProto.destroy.call(b),b._callbackSupport(a),b},e._destroySelectBoxIt=function(){var b=this;return b.dropdown.off(".selectBoxIt"),a.contains(b.dropdownContainer[0],b.originalElem)&&b.dropdownContainer.before(b.selectBox),b.dropdownContainer.remove(),b.selectBox.removeAttr("style").attr("style",b.selectBoxStyles),b.selectBox.show(),b.triggerEvent("destroy"),b},e.disable=function(a){var b=this;return b.options.disabled||(b.close(),b.selectBox.attr("disabled","disabled"),b.dropdown.removeAttr("tabindex").removeClass(b.theme.enabled).addClass(b.theme.disabled),b.setOption("disabled",!0),b.triggerEvent("disable")),b._callbackSupport(a),b},e.disableOption=function(b,c){var d,e,f,g=this,h=a.type(b);return"number"===h&&(g.close(),d=g.selectBox.find("option").eq(b),g.triggerEvent("disable-option"),d.attr("disabled","disabled"),g.listItems.eq(b).attr("data-disabled","true").addClass(g.theme.disabled),g.currentFocus===b&&(e=g.listItems.eq(g.currentFocus).nextAll("li").not("[data-disabled='true']").first().length,f=g.listItems.eq(g.currentFocus).prevAll("li").not("[data-disabled='true']").first().length,e?g.moveDown():f?g.moveUp():g.disable())),g._callbackSupport(c),g},e._isDisabled=function(){var a=this;return a.originalElem.disabled&&a.disable(),a},e._dynamicPositioning=function(){var b=this;if("number"===a.type(b.listSize))b.list.css("max-height",b.maxHeight||"none");else{var c=b.dropdown.offset().top,d=b.list.data("max-height")||b.list.outerHeight(),e=b.dropdown.outerHeight(),f=b.options.viewport,g=f.height(),h=a.isWindow(f.get(0))?f.scrollTop():f.offset().top,i=g+h>=c+e+d,j=!i;
5022if(b.list.data("max-height")||b.list.data("max-height",b.list.outerHeight()),j)if(b.dropdown.offset().top-h>=d)b.list.css("max-height",d),b.list.css("top",b.dropdown.position().top-b.list.outerHeight());else{var k=Math.abs(c+e+d-(g+h)),l=Math.abs(b.dropdown.offset().top-h-d);l>k?(b.list.css("max-height",d-k-e/2),b.list.css("top","auto")):(b.list.css("max-height",d-l-e/2),b.list.css("top",b.dropdown.position().top-b.list.outerHeight()))}else b.list.css("max-height",d),b.list.css("top","auto")}return b},e.enable=function(a){var b=this;return b.options.disabled&&(b.triggerEvent("enable"),b.selectBox.removeAttr("disabled"),b.dropdown.attr("tabindex",0).removeClass(b.theme.disabled).addClass(b.theme.enabled),b.setOption("disabled",!1),b._callbackSupport(a)),b},e.enableOption=function(b,c){var d,e=this,f=a.type(b);return"number"===f&&(d=e.selectBox.find("option").eq(b),e.triggerEvent("enable-option"),d.removeAttr("disabled"),e.listItems.eq(b).attr("data-disabled","false").removeClass(e.theme.disabled)),e._callbackSupport(c),e},e.moveDown=function(a){var b=this;b.currentFocus+=1;var c="true"===b.listItems.eq(b.currentFocus).attr("data-disabled")?!0:!1,d=b.listItems.eq(b.currentFocus).nextAll("li").not("[data-disabled='true']").first().length;if(b.currentFocus===b.listItems.length)b.currentFocus-=1;else{if(c&&d)return b.listItems.eq(b.currentFocus-1).blur(),b.moveDown(),void 0;c&&!d?b.currentFocus-=1:(b.listItems.eq(b.currentFocus-1).blur().end().eq(b.currentFocus).focusin(),b._scrollToView("down"),b.triggerEvent("moveDown"))}return b._callbackSupport(a),b},e.moveUp=function(a){var b=this;b.currentFocus-=1;var c="true"===b.listItems.eq(b.currentFocus).attr("data-disabled")?!0:!1,d=b.listItems.eq(b.currentFocus).prevAll("li").not("[data-disabled='true']").first().length;if(-1===b.currentFocus)b.currentFocus+=1;else{if(c&&d)return b.listItems.eq(b.currentFocus+1).blur(),b.moveUp(),void 0;c&&!d?b.currentFocus+=1:(b.listItems.eq(this.currentFocus+1).blur().end().eq(b.currentFocus).focusin(),b._scrollToView("up"),b.triggerEvent("moveUp"))}return b._callbackSupport(a),b},e._setCurrentSearchOption=function(a){var b=this;return(b.options.aggressiveChange||b.options.selectWhenHidden||b.listItems.eq(a).is(":visible"))&&b.listItems.eq(a).data("disabled")!==!0&&(b.listItems.eq(b.currentFocus).blur(),b.currentIndex=a,b.currentFocus=a,b.listItems.eq(b.currentFocus).focusin(),b._scrollToView("search"),b.triggerEvent("search")),b},e._searchAlgorithm=function(a,b){var c,d,e,f,g=this,h=!1,i=g.textArray,j=g.currentText;for(c=a,e=i.length;e>c;c+=1){for(f=i[c],d=0;e>d;d+=1)-1!==i[d].search(b)&&(h=!0,d=e);if(h||(g.currentText=g.currentText.charAt(g.currentText.length-1).replace(/[|()\[{.+*?$\\]/g,"\\$0"),j=g.currentText),b=new RegExp(j,"gi"),j.length<3){if(b=new RegExp(j.charAt(0),"gi"),-1!==f.charAt(0).search(b))return g._setCurrentSearchOption(c),(f.substring(0,j.length).toLowerCase()!==j.toLowerCase()||g.options.similarSearch)&&(g.currentIndex+=1),!1}else if(-1!==f.search(b))return g._setCurrentSearchOption(c),!1;if(f.toLowerCase()===g.currentText.toLowerCase())return g._setCurrentSearchOption(c),g.currentText="",!1}return!0},e.search=function(a,b,c){var d=this;c?d.currentText+=a.replace(/[|()\[{.+*?$\\]/g,"\\$0"):d.currentText=a.replace(/[|()\[{.+*?$\\]/g,"\\$0");var e=d._searchAlgorithm(d.currentIndex,new RegExp(d.currentText,"gi"));return e&&d._searchAlgorithm(0,d.currentText),d._callbackSupport(b),d},e._applyNativeSelect=function(){var a,b,c,d=this;d.dropdownContainer.append(d.selectBox),d.dropdown.attr("tabindex","-1"),d.selectBox.css({display:"block",visibility:"visible",width:d.dropdown.outerWidth(),height:d.dropdown.outerHeight(),opacity:"0",position:"absolute",top:"0",left:"0",cursor:"pointer","z-index":"999999",margin:d.dropdown.css("margin"),padding:"0","-webkit-appearance":"menulist-button"}).on({"changed.selectBoxIt":function(){a=d.selectBox.find("option").filter(":selected"),b=a.attr("data-text"),c=b?b:a.text(),d._setText(d.dropdownText,c),d.list.find('li[data-val="'+a.val()+'"]').find("i").attr("class")&&d.dropdownImage.attr("class",d.list.find('li[data-val="'+a.val()+'"]').find("i").attr("class")).addClass("selectboxit-default-icon"),d.triggerEvent("option-click")}})},e._mobile=function(){var a=this;return a.isMobile&&a._applyNativeSelect(),this},e.remove=function(b,c){var d,e,f=this,g=a.type(b),h=0,i="";if("array"===g){for(e=b.length;e-1>=h;h+=1)d=b[h],"number"===a.type(d)&&(i+=i.length?", option:eq("+d+")":"option:eq("+d+")");f.selectBox.find(i).remove()}else"number"===g?f.selectBox.find("option").eq(b).remove():f.selectBox.find("option").remove();return f.dropdown?f.refresh(function(){f._callbackSupport(c)},!0):f._callbackSupport(c),f},e.selectOption=function(b,c){var d=this,e=a.type(b);return"number"===e?d.selectBox.val(d.selectItems.eq(b).val()).change():"string"===e&&d.selectBox.val(b).change(),d._callbackSupport(c),d},e.setOption=function(b,c,d){var e=this;return"string"===a.type(b)&&(e.options[b]=c),e.refresh(function(){e._callbackSupport(d)},!0),e},e.setOptions=function(b,c){var d=this;return a.isPlainObject(b)&&(d.options=a.extend({},d.options,b)),d.refresh(function(){d._callbackSupport(c)},!0),d},e.wait=function(a,b){var c=this;return c.widgetProto._delay.call(c,b,a),c}}); 5023define("selectBoxIt", ["jqueryUi"], function(){}); 5024 5025/* jshint camelcase: false */ 5026 5027 5028// Asyncronous with module loading 5029require(['domReady', 'jquery'], function(domReady, $) { 5030 5031 /*jshint smarttabs: true, supernew: true */ 5032 /*global AG */ 5033 5034 /** 5035 * Highest level, global, generic functions which can be used anywhere. 5036 * This means that functionality here should be applicable to any application, 5037 * even by an outside company or website. 5038 * 5039 * @namespace 5040 * @require jQuery 5041 * 5042 */ 5043 window.AG = { 5044 // Use runtime to store information generated upon startup & execution 5045 runtime: { 5046 events: [], 5047 scriptQueue: [] 5048 }, 5049 5050 // Execution time of this script for performance tracking 5051 startTime: (new Date).getTime(), 5052 5053 /* Object to hold URL parsing results */ 5054 url: {} 5055 }; 5056 5057 5058 AG.config = { 5059 debug: false 5060 }; 5061 5062 5063 5064 /** 5065 * Load individual files into the current document after $.ready() has occurred. 5066 * Can be used with any file type jQuery's $.ajax() method allows 5067 * 5068 * @param {String} url URL (relative or absolute) of the file to load. 5069 * @param {String} [type="script"] Type of file to load. Ex: script, css 5070 * @param {String} [callback] Function to execute once file has been loaded. 5071 * 5072 * @public 5073 */ 5074 AG.include = function(url,type,callback) { 5075 AG.runtime.scriptQueue.push([url,type,callback]); 5076 }; 5077 5078 5079 (AG.loadFiles = function() { 5080 var scriptQueue = AG.runtime.scriptQueue, 5081 isAsync = true, 5082 fetchMethod = "GET"; 5083 5084 /* Set a recursive call to process the queue of files */ 5085 if (scriptQueue.length > 0) { 5086 setTimeout(AG.loadFiles,10); 5087 } else { 5088 /* 5089 * If there are no files to load, we slow down the recursion, but 5090 * always keep it going just in case more files are added later. 5091 */ 5092 setTimeout(AG.loadFiles,250); 5093 return; 5094 } 5095 5096 /* Init the next file */ 5097 var nextScript = scriptQueue.shift(), 5098 file = {}, 5099 callback = '', 5100 cacheCheck = false;
5101 5102 file.src = nextScript[0]; 5103 file.type = nextScript[1] || 'script'; 5104 callback = nextScript[2]; 5105 file.xmlcache = nextScript[3]; 5106 5107 /* If the request has a callback associated with it, we want to 5108 * force the request to complete before invoking the callback 5109 */ 5110 if (typeof callback === 'function') { 5111 isAsync = false; 5112 } 5113 5114 if (file.xmlcache === 'xml') { 5115 var milliseconds = new Date().getTime(); 5116 file.src = file.src+'?t='+milliseconds; 5117 fetchMethod = "POST"; 5118 cacheCheck = true; 5119 } 5120 5121 /* Load it */ 5122 $.ajax({ 5123 type: fetchMethod, 5124 url: file.src, 5125 dataType: file.type, 5126 cache: cacheCheck, 5127 async: isAsync, 5128 success: function(content){ 5129 if (typeof callback === 'function') { 5130 callback(content); 5131 } 5132 } 5133 }); 5134 return this; 5135 })(); // Execute immediately at runtime 5136 5137 5138 /* 5139 * Execute JS code that has been embedded inside our master <script> tag 5140 * http://ejohn.org/blog/degrading-script-tags/ 5141 */ 5142 $(document).ready(function(){ 5143 var scripts = document.getElementsByTagName("script"), 5144 action = '', 5145 i = 0; 5146 var len = scripts.length; 5147 5148 for (i=0;i<len;i++) { 5149 action = scripts[i].getAttribute('data-action'); 5150 if (action === 'jsCallback') { 5151 eval(scripts[i].innerHTML); 5152 } 5153 } 5154 }); 5155 5156 /* Let's keep track of how long it takes to initialize the whole script */ 5157 AG.endTime = (new Date).getTime(); 5158 AG.runtime.execTime = AG.endTime - AG.startTime; 5159 5160 /* Clean up the namespace */ 5161 delete AG.startTime; 5162 delete AG.endTime; 5163 5164 5165 5166 5167}); 5168 5169define("ag", ["jquery"], function(){}); 5170 5171/* jshint camelcase: false */ 5172 5173 5174// Asyncronous with module loading 5175require(['domReady', 'jquery', 'ag'], function( domReady, $) { 5176 5177 /*jshint smarttabs: true, supernew: true */ 5178 /*global AG, escape, unescape */ 5179 if(typeof(String.prototype.trim) != 'function') { 5180 String.prototype.trim = function() { 5181 return this.replace(/^\s+|\s+$/g, ''); 5182 } 5183 } 5184 5185 /** 5186 * @namespace 5187 * 5188 */ 5189 AG.utils = new function() { 5190 /** 5191 * Load individual JS or CSS files into the current document upon request. 5192 * @public 5193 * @function 5194 * @param {String} fileName The filename of the file being loaded. 5195 * @param {String} [basePath="AG.config.assetPath"] Full, base URL (relative or absolute) of the file to load. Defaults to 5196 * @param {String} [callback] Function to execute once file has been loaded. 5197 * 5198 */ 5199 this.loadModule = function(fileName,basePath,callback) { 5200 var fileType = '', 5201 tagName = '', 5202 mimeType = '', 5203 head = '', 5204 source = '', 5205 element = ''; 5206 5207 if (!AG.validate.isArray(AG.runtime.loadedModules)) { 5208 AG.runtime.loadedModules = []; 5209 } 5210 5211 if (typeof basePath !== 'string') { 5212 basePath = AG.config.assetPath; 5213 } 5214 5215 if (AG.runtime.loadedModules.contains(basePath + fileName)) { 5216 return; /* Let's not load a file twice */ 5217 } 5218 5219 fileType = fileName.substr(fileName.lastIndexOf('.') + 1); 5220 switch(fileType){ 5221 case 'js': 5222 tagName = 'script'; 5223 mimeType = 'text/javascript'; 5224 source = 'src'; 5225 break; 5226 case 'css': 5227 tagName = 'link'; 5228 mimeType = 'text/css'; 5229 source = 'href'; 5230 break; 5231 } 5232 /** http://paulirish.com/2011/surefire-dom-element-insertion/ */ 5233 var ref = document.getElementsByTagName('script')[0]; 5234 element = document.createElement(tagName); 5235 element.type = mimeType; 5236 element.async = true; 5237 element[source] = basePath + fileName; 5238 ref.parentNode.insertBefore(element, ref); 5239 AG.runtime.loadedModules.push(element[source]); 5240 5241 if (typeof callback === 'function') { 5242 callback(); 5243 } 5244 }; 5245 5246 5247 /** @public */ 5248 this.setCookie = function(name, value, expiredays, path, domain, secure) { 5249 var cookie_string = name + "=" + escape(value); 5250 if (path) { 5251 cookie_string += "; path=" + escape(path); 5252 } 5253 if (expiredays) { 5254 var expires = new Date(); 5255 expires.setDate(expires.getDate() + expiredays); 5256 cookie_string += "; expires=" + expires.toGMTString(); 5257 } 5258 if (domain) { 5259 cookie_string += "; domain=" + escape(domain); 5260 } 5261 if (secure) { 5262 cookie_string += "; secure"; 5263 } 5264 document.cookie = cookie_string; 5265 }; 5266 5267 /** @public */ 5268 this.getCookie = function(cookieName) { 5269 var cookie = document.cookie, 5270 c_start = 0, 5271 c_end = 0; 5272 5273 if (typeof cookie !== 'undefined') { 5274 c_start = cookie.indexOf(cookieName + '='); 5275 if (c_start !== -1) {
5276 c_start = c_start + cookieName.length + 1; 5277 c_end = cookie.indexOf(';', c_start); 5278 if (c_end === -1) { c_end = cookie.length; } 5279 return unescape(cookie.substring(c_start, c_end)); 5280 } 5281 } 5282 return ''; 5283 }; 5284 5285 /** @public */ 5286 this.deleteCookie = function(name,path,domain) { 5287 setCookie(name,null,-1,path,domain); 5288 }; 5289 5290 5291 5292 5293 /** 5294 * <p>Add a listener to a JS variable. When the variable has 5295 * been defined (anything but "null" -- even an empty string), execute 5296 * the "success" callback function. If variable is not defined after 5297 * the DOM is ready, the "failure" calback function will be executed. 5298 * 5299 * <p>Returns: Object, options + variable's value 5300 * 5301 * <p>Example: 5302 * <pre> 5303 * AG.utils.whenDefined({ 5304 * object: 'webAnalyticsPageTitle', 5305 * success: function(result){ 5306 * alert('Defined: ' + result.object); 5307 * }, 5308 * failure: function(result){ 5309 * alert(result.object + ' was not defined by the time the DOM was completely loaded.'); 5310 * }, 5311 * interval: 2500, 5312 * stopOnReady: false 5313 * }); 5314 * </pre> 5315 * 5316 * @public 5317 */ 5318 this.whenDefined = function(options) { 5319 /* Options: 5320 * object: string (name of object/variable) 5321 * success: function 5322 * failure: function 5323 * interval: int, ms 5324 * stopOnReady: boolean 5325 */ 5326 if (typeof options.interval !== 'number') { 5327 options.interval = 250; 5328 } 5329 if (typeof options.stopOnReady !== 'boolean') { 5330 options.stopOnReady = true; 5331 } 5332 5333 try { 5334 /* See if we can evaluate the string to a legit object */ 5335 var obj = eval(options.object); 5336 } catch(e) { 5337 /* Guess that didn't work, but that's ok. We leave this empty and 5338 * test 'obj' separately on purpose to ensure it correctly handles 5339 * nested vars within an object. 5340 */ 5341 } 5342 5343 /* Check the object. Has it been defined yet? */ 5344 if (typeof obj === 'undefined') { 5345 /* 5346 * To prevent an infinite loop, we have the option of breaking 5347 * the loop when the onLoad event has executed. 5348 * http://jsperf.com/order-of-if-statement 5349 */ 5350 if (options.stopOnReady && jQuery.isReady) { 5351 if (typeof options.failure === 'function') { 5352 options.failure(options); 5353 } 5354 return null; 5355 } 5356 5357 /* Otherwise, let's set a recursive call to continue polling */ 5358 setTimeout(function(){ 5359 AG.utils.whenDefined(options); 5360 }, options.interval); 5361 5362 return null; 5363 } 5364 5365 /* 5366 * The object has been defined! Let's execute the callback if it exists 5367 * and pass our object's value back to it for further use. 5368 */ 5369 if (typeof options.success === 'function') { 5370 options.object = obj; /* Converts "options.object" from a string to a real object for use in the callback */ 5371 options.success(options); 5372 } 5373 }; 5374 5375 /** 5376 * Apply context and parameters to a function. Adapted from 5377 * http://bit.ly/aJljaB 5378 * 5379 * @public 5380 */ 5381 this.applyFunction = function(functionName, context, params) { 5382 return function() { 5383 functionName.apply(context, params); 5384 }; 5385 }; 5386 5387 /** 5388 * Parses URL query string for easy access to all para 5389 * meters via "AG.url.parameterName" 5390 * Reference: <a href="http://blog.robobrien.com/creating-a-url-scope-in-javascript/">http://blog.robobrien.com/creating-a-url-scope-in-javascript/<a> 5391 * This function is private and executed automatically at runtime. 5392 * 5393 * @private 5394 */ 5395 var parseURL = function() { 5396 var url = {}; 5397 url._location = window.location; 5398 url._query = window.location.search.substr(1); //start after the first char (the "?") 5399 if (typeof url._query === 'string') { 5400 var arrParams = url._query.split("&"); 5401 var len = arrParams.length; 5402 for (var i=0; i<len; i++) { 5403 var param = arrParams[i].split("="); 5404 if (param[0]) { 5405 url[param[0]] = unescape(param[1]); 5406 } 5407 } 5408 } 5409 AG.url = url; 5410 }(); // END parseURL (self-executing at runtime) 5411 5412 /** 5413 * Detects the client's pixel ratio, then stores in a cookie. Used to determine 5414 * whether we should serve Standard or high-quality (Retina) images. 5415 * Reference: http://blog.robobrien.com/retina-images-ipad-and-iphone/ 5416 * 5417 * @private 5418 */ 5419 var getDevicePixelRatio = function() { 5420 var pr = 1; 5421 if (typeof window.devicePixelRatio !== 'undefined') { 5422 pr = window.devicePixelRatio; 5423 } 5424 setCookie('devicePixelRatio',pr); 5425 }; 5426 5427 /** 5428 * Parse existing cookies 5429 * TODO: Is this a good idea? Cookies can change dynamically after page load, so a single 5430 * execution on page load could eventually have outdated values 5431 * 5432 * @private 5433 */ 5434 var parseCookies = function(){ 5435 AG.cookies = []; /* Always defined, even if empty */ 5436 var c = document.cookie; 5437 if (c.length) { 5438 var cookieArray = c.split(';'); 5439 var i = 0; 5440 var l = cookieArray.length; 5441 var oneCookie, cookieName; 5442 5443 for (i=0; i < l; i++) { 5444 oneCookie = cookieArray[i].split('='); 5445 cookieName = oneCookie[0].replace(/^\s+|\s+$/, ''); 5446 AG.cookies[cookieName] = oneCookie[1]; 5447 } 5448 } 5449 }(); // Self-executing at runtime 5450 5451 /** 5452 * Add special classes to the <HTML>
5452 tag in order to deliver browser- and version-specific CSS. 5453 * 5454 * @private 5455 */ 5456 var addBrowserClasses = (function($){ 5457 return; 5458 var targetElement = jQuery('html'), 5459 browser = jQuery.uaMatch(navigator.userAgent).browser, 5460 version = parseFloat($.uaMatch(navigator.userAgent).version), 5461 versionStr = version.toString().replace('.','-'), /* CSS classes cannot contain dots */ 5462 mode = document.compatMode, 5463 modeClassName = ''; 5464 5465 /* 5466 * Sniff the rendering mode of the browser in order to add the ability to target 5467 * appropriate CSS. This is very helpful when handling different environments. 5468 * http://www.webmasterworld.com/forum21/6361.htm 5469 */ 5470 if (mode) { 5471 if (mode === 'BackCompat') { modeClassName = 'quirksMode'; } 5472 else if (mode === 'CSS1Compat') { modeClassName = 'standardsMode'; } 5473 else { modeClassName = 'standardsMode'; } // "Almost Standards Mode" 5474 5475 targetElement.addClass(modeClassName); 5476 } 5477 5478 switch (browser) { 5479 case 'msie': /* IE */ 5480 /* Always add these classes. 5481 * Useful for default values, future-proofing, and minor versions (3.5 vs. 3) 5482 * jQuery will not add duplicate classes, so we don't worry about duplicates. 5483 */ 5484 targetElement.addClass('ie ie'+versionStr); 5485 5486 /* Now, we add version-specific class names */ 5487 if (version <= 6) { targetElement.addClass('ie6 lte9 lte8 lte7 lte6'); } 5488 else if (version === 7) { targetElement.addClass('ie7 lte9 lte8 lte7'); } 5489 else if (version === 8) { targetElement.addClass('ie8 lte9 lte8'); } 5490 else if (version === 9) { targetElement.addClass('ie9 lte9'); } 5491 break; 5492 5493 case 'mozilla': /* FireFox */ 5494 targetElement.addClass('moz moz'+versionStr); 5495 break; 5496 5497 case 'webkit': /* Chrome & Safari */ 5498 targetElement.addClass('webkit webkit'+versionStr); 5499 break; 5500 } 5501 5502 })(jQuery); // Self-executing at runtime 5503 5504 /** 5505 * Get the selected value of a radio button set. 5506 * 5507 * @public 5508 */ 5509 this.getRadioValue = function(radioObj) { 5510 if (!radioObj) { return ''; } 5511 var radioLength = radioObj.length; 5512 if (radioLength === 'undefined') { 5513 if (radioObj.checked) { 5514 return radioObj.value; 5515 } 5516 else { 5517 return ""; 5518 } 5519 } 5520 5521 for(var i = 0; i < radioLength; i++) { 5522 if(radioObj[i].checked) { 5523 return radioObj[i].value; 5524 } 5525 } 5526 5527 return ''; 5528 }; 5529 5530 5531 /** 5532 * <p>Queue up event handlers. Using 3 flavors of unload 5533 * functionality (Event Listeners, window.onunload, & 5534 * window.onbeforeunload), which covers the widest variety of browser 5535 * capabilities. 5536 * 5537 * <p><a href="http://vidasp.net/jQuery-unload.html">http://vidasp.net/jQuery-unload.html</a> 5538 * 5539 * <p>Function parameters are passed as an array. Example: If the function is 5540 * this: function showAlert(msg1,msg2) { alert(msg1 + '-' + msg2); } 5541 * 5542 * <p>It's added as an unload task like this: var anyVar = 'OMG!'; 5543 * AG.utils.attachEvent(window,'unload',showAlert,[anyVar,"I can't believe it's not butter!"]); 5544 * 5545 * <p>You can attach an event to anything, where the 1st param is the acting object. 5546 * A link, for example: AG.utils.attachEvent(document.links[3],'click',getLinkInfo,[]); 5547 * 5548 * @public 5549 * 5550 * 5551 */ 5552 this.attachEvent = function(context,event,func,paramArray) { 5553 /* 5554 * If someone tries to pass an outdated event format (one with 'on' prefix), we'll 5555 * convert it to the standard format by stripping the prefix. 5556 */ 5557 var legacyFormat = new RegExp(/^[on]{2}/i); 5558 if (legacyFormat.test(event)) { 5559 event = event.substring(2,event.length); 5560 } 5561 5562 var eventQueue = event + 'arr'; 5563 var functionObj = ''; 5564 var standardEventName = event; /* blur, click, unload, etc. */ 5565 var legacyEventName = 'on' + event; /* onblur, onclick, onunload, etc. */ 5566 5567 AG.runtime.events.push([event,func,paramArray]); 5568 5569 if(AG.validate.isArray(paramArray)) { 5570 functionObj = AG.utils.applyFunction(func,this,paramArray); 5571 } else { 5572 functionObj = func; 5573 } 5574 5575 if (typeof context.addEventListener !== 'undefined') { /* W3C */ 5576 context.addEventListener(standardEventName,functionObj,false); 5577 } 5578 else if (typeof context.attachEvent !== 'undefined') { /* IE */ 5579 context.attachEvent(legacyEventName,functionObj); 5580 } 5581 else { /* Legacy, window properties */ 5582 /* Create our storage array */ 5583 if (!AG.validate.isArray(context[eventQueue])) { 5584 context[eventQueue] = []; 5585 5586 /* If an event already exists. Let's save it to the array, so we don't overwrite it */ 5587 if (context[legacyEventName]) { 5588 context[eventQueue].push(context[legacyEventName]); 5589 } 5590 } 5591 5592 /* Now we save the current function to the array */ 5593 context[eventQueue].push(functionObj); 5594 5595 /* Finally, set the event to call our array to execute all stored functions. 5596 * Using while() and .shift() within a self-executing function like this 5597 * allows 3 things to happen: 5598 * 5599 * 1) The first element in the array is executed 5600 * 2) The same element is deleted from the array to make way for the next element 5601 * 3) while() cycles through all array elements until complete 5602 * 5603 * Reference: http://bit.ly/aJljaB 5604 * 5605 */ 5606 context[legacyEventName] = function(){ 5607 while(context[eventQueue].length > 0) { 5608 try { 5609 (context[eventQueue].shift())(); 5610 } catch(e1) { 5611 /* Just in case someone throws us a bad function. We don't want to interrupt all others */ 5612 //alert('Error: ' + e1); 5613 } 5614 } 5615 }; 5616 } 5617 }; 5618 5619 /** 5620 * <p>Compare two multi-value, delimited lists and return true or false based on the matchType. 5621 * The function tests whether any/all of the 2nd list exist in the 1st list. 5622 * 5623 * <p>Example: 5624 * var1 = '1,2,3,6'; 5625 * var2 = '3,4,5'; 5626 * if (listContains(var1,var2,'any')) { alert('Yup! The number 3 exists in var1'); } 5627 * if (listContains(var1,var2,'all')) { alert('Nope! None of var2 exist in var1'); } 5628 * 5629 * @public 5630 */ 5631 this.listContains = function(str1, str2, matchType, delimiter) { 5632 if (typeof delimiter === 'undefined') { delimiter = ','; } 5633 var arr1 = str1.split(delimiter), 5634 arr2 = str2.split(delimiter), 5635 arr1Len = arr1.length, 5636 arr2Len = arr2.length, 5637 matchArr = [], 5638 i = 0, 5639 j = 0; 5640 5641 for (i = 0; i < arr2Len; i++) { 5642 for (j=0; j < arr1Len; j++) { 5643 /* Ignore JSlint error here. I want "==" rather than "===" for loose duck typing */ 5644 if (arr1[j].trim() == arr2[i].trim()) { 5645 matchArr.push(arr1[j]); 5646 } 5647 } 5648 } 5649 5650 switch (matchType) { 5651 case "all": 5652 if (matchArr.length === arr2.length) { return true; } 5653 break; 5654
5655 case "any": 5656 if (matchArr.length > 0) { return true; } 5657 break; 5658 5659 /* This really isn't necessary, as you can do "!listContains(any/all)", but for ease of use, we include it */ 5660 case "none": 5661 if (matchArr.length === 0) { return true; } 5662 break; 5663 } 5664 return false; 5665 }; 5666 5667 this.urldecode = function(str) { 5668 return decodeURIComponent((str+'').replace(/\+/g, '%20')); 5669 } 5670 }; // END AG.utils 5671 5672 5673 /* Kick off the deferred file loader 5674 * Do this after the 5675 5676 AG.utils.attachEvent(window,'load',function () { 5677 AG.utils.loadDeferredFiles(); 5678 });*/ 5679 5680}); 5681define("agUtils", ["ag"], function(){}); 5682 5683/* jshint camelcase: false */ 5684 5685 5686// Asyncronous with module loading 5687require(['domReady', 'jquery', 'ag'], function( domReady, $) { 5688 5689 /*jshint smarttabs: true, supernew: true */ 5690 /*global AG */ 5691 5692 /** 5693 * @namespace 5694 */ 5695 AG.validate = new function() { 5696 /** 5697 * Reference: http://documentcloud.github.com/underscore/underscore.js 5698 * 5699 * @public 5700 * @returns {Boolean} 5701 */ 5702 this.isArray = function(obj) { 5703 return !!(obj && obj.concat && obj.unshift && !obj.callee); 5704 }; 5705 5706 /** 5707 * Reference: http://documentcloud.github.com/underscore/underscore.js 5708 * 5709 * @public 5710 * @returns {Boolean} 5711 */ 5712 this.isDate = function(obj) { 5713 return !!(obj && obj.getTimezoneOffset && obj.setUTCFullYear && obj !== 'Invalid Date'); 5714 }; 5715 5716 /** 5717 * Reference: http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric/1830844#1830844 5718 * 5719 * @public 5720 * @returns {Boolean} 5721 */ 5722 this.isNumeric = function(str) { 5723 return !isNaN(parseFloat(str)) && isFinite(str); 5724 }; 5725 5726 /** 5727 * Reference: http://mattsnider.com/javascript/type-detection/ 5728 * 5729 * @public 5730 * @returns {Boolean} 5731 */ 5732 this.isBoolean = function(o) { 5733 return 'boolean' === typeof o; 5734 }; 5735 5736 /** 5737 * Test for variations of hex code formats. 5738 * Strict: #ffffff 5739 * Loose: fff, ffffff, #fff, #ffffff 5740 * 5741 * @public 5742 * @returns {Boolean} 5743 */ 5744 this.isHexCode = function(str, strict){ 5745 var regExpEasy = (/^(#)?([0-9a-fA-F]{3})([0-9a-fA-F]{3})?$/); /* This one takes 3 or 6 chars and an optional hash */ 5746 var regExpStrict = (/^(#)([0-9a-fA-F]{6})$/); /* This one must be 6 chars and include a hash */ 5747 if (!AG.validate.isBoolean(strict)) { 5748 strict = true; /* Default to strict */ 5749 } 5750 5751 if (strict) { 5752 return regExpStrict.test(str); 5753 } 5754 else { 5755 return regExpEasy.test(str); 5756 } 5757 }; 5758 5759 /** 5760 * Test email formatted string 5761 * @public 5762 * @returns {Boolean} 5763 */ 5764 this.isEmail = function(str) {
5765 return (/^[a-zA-Z][\w\.\-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.\-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]{0,4}[a-zA-Z]$/).test(str); 5766 }; 5767 5768 /** 5769 * Determine whether or not an object has content 5770 * 5771 * @public 5772 * @returns {Boolean} 5773 */ 5774 this.isEmpty = function(o) { 5775 for(var p in o) { 5776 if (o[p] !== o.constructor.prototype[p]) { 5777 return false; 5778 } 5779 } 5780 return true; 5781 }; // END isEmpty 5782 5783 /** 5784 * Test credit card formatted string 5785 * 5786 * @public 5787 * @returns {Boolean} 5788 */ 5789 this.isCreditCard = function(str) { 5790 var CC = str.trim(); // Make sure whitespace doesn't foil our evil plan 5791 5792 var sum = 0, 5793 mul = 1, 5794 tproduct = 0, 5795 len = CC.length, 5796 i = 0, 5797 digit = 0; 5798 5799 if (len < 14 || len > 16) { 5800 return false; 5801 } 5802 5803 for (i = 0; i < len; i++) { 5804 digit = CC.substring(len - i - 1, len - i); 5805 tproduct = parseInt(digit, 10) * mul; 5806 if (tproduct >= 10) { sum += (tproduct % 10) + 1; } 5807 else { sum += tproduct; } 5808 if (mul === 1) { 5809 mul++; 5810 } 5811 else { 5812 mul--; 5813 } 5814 } 5815 if ((sum % 10) === 0) { 5816 return true; 5817 } 5818 else { 5819 return false; 5820 } 5821 }; 5822 5823 }; // END AG.validate 5824}); 5825 5826define("agValidate", ["ag"], function(){}); 5827 5828/* jshint camelcase: false */ 5829 5830 5831// Asyncronous with module loading 5832require(['domReady', 'jquery'], function(domReady, $) { 5833 domReady(function() { 5834 /* */ 5835 (function ($, window, document, undefined) { 5836 /* */ 5837 'use strict'; 5838 /* 5839 APP stuff 5840 ========================================================================== */ 5841 var APP = { 5842 start: function (scope) { 5843 var self = this, 5844 scope = scope || document.body; 5845 // store the content elem 5846 self.$content = $(scope) 5847 self.$content 5848 // map each form to a validator 5849 .find('.js-form').map(self.validation) 5850 .end().end() 5851 // bind the character counter 5852 .find('.js-text-counter').each(self.characterCount) 5853 .end() 5854 return self 5855 }, // start 5856 /* 5857 Bind a the character counter 5858 ========================================================================== */ 5859 characterCount: function () { 5860 var $field = $(this) 5861 $field.charCounter({ 5862 maxChars: 1000, 5863 maxCharsWarning: 988, 5864 msgCharsLeft: $field.data('chars-left') 5865 }) 5866 // trigger it once to show 5867 .trigger('keyup') 5868 }, 5869 /* 5870 Map form Validation 5871 ------------------- 5872 5873 Forms can have custom validation events. To bind these events, 5874 add a `data-type` attribute to the form. Example: 5875 `data-type="__FORM_TYPE_HERE__"` 5876 5877 Custom events can be attached to the form by checking the form type: 5878 ` 5879 if ( form.dataset.type === '__FORM_TYPE_HERE__' ) { 5880 // start binding events here 5881 // ... 5882 } 5883 ` 5884 The following functions are available to bind for custom form events: 5885 5886 options.onLoad 5887 -------------- 5888 A function to call on page load. The validator object is 5889 in the scope. Example: 5890 ` 5891 options.onLoad = function( thisValidator ) { 5892 // function goes here 5893 // ... 5894 console.log( thisValidator ) 5895 } 5896 5897 options.onError 5898 --------------- 5899 A function to call on an error. The validator object is 5900 in the scope. Example: 5901 ` 5902 options.onError = function( thisValidator ) { 5903 // function goes here 5904 // ... 5905 console.log( thisValidator ) 5906 } 5907 5908 options.onFieldError 5909 -------------------- 5910 A function to call on a field error. The field itself 5911 and the validator object are in the scope. Example: 5912 ` 5913 options.onFieldError = function( $field, thisValidator ) { 5914 // function goes here 5915 // ... 5916 console.log( $field, thisValidator ) 5917 } 5918 5919 options.beforeSubmit 5920 -------------------- 5921 A function to call before a successful submit. The validator 5922 object is in the scope. Example: 5923 ` 5924 options.onLoad = function( thisValidator ) { 5925 // function goes here 5926 // ... 5927 console.log( thisValidator ) 5928 5929 return ( true | false ) 5930 } 5931 5932 This function can prevent form submission based on the 5933 `return` value. 5934 5935 options.bindEvent 5936 ----------------- 5937 A function that binds events to fields with `data-bind`. The 5938 field and the validator object are in scope. Example: 5939 ` 5940 options.bindEvent = function( $field, thisValidator ) { 5941 // function goes here 5942 // ... 5943 console.log( $field, $field.intent, thisValidator ) 5944 } 5945 5946 options.callback 5947 ---------------- 5948 A callback function called after a successful validation and 5949 the validator object is in scope. Example: 5950 ` 5951 options.callback = function( thisValidator ) { 5952 // function goes here 5953 // ... 5954 console.log( thisValidator ) 5955 } 5956 5957 options.customValidate 5958 ---------------------- 5959 A literal object that can be set up to validate a field with 5960 custom parameters. Example: 5961 ` 5962 options.customValidate = { 5963 5964 __FIELD_DATA_TYPE__: function( $field, thisValidator ) { 5965 5966 // function goes here 5967 // ... 5968 console.log( $field, thisValidator ) 5969 5970 return ( true | false ) 5971 } 5972 } 5973 5974 The `return` value determines whether or not the field is valid. 5975 5976 Scroll window position 5977 ---------------------- 5978 Function `scrollPageTo` can be utilized for callbacks, etc. The 5979 function accepts two optional parameters: `position` & `speed` 5980 Example: 5981 ` 5982 // scroll page to top at default speed 5983 scrollPageTo() 5984 5985 // scroll page to 400px from top at 1000ms speed 5986 scrollPageTo( 400, 1000 ) 5987 5988 // scroll page to a jQuery object at default speed 5989 scrollPageTo( $(__SOME_SELECTOR__) ) 5990 5991 ======================================================================== */ 5992 forms: { 5993 /* ***************** 5994 * Generic success method 5995 ***************** */ 5996 generic_success: function () { 5997 APP.$content.find('.js-box-content').addClass('hidden').end() 5998 .find('.js-box-success').removeClass('hidden'); 5999 scrollPageTo(0); 6000 }, /* form_post_purchase */ 6001 6002 compare_passwords: function (options) { 6003 /* 6004 options.onLoad = function (thisValidator) { 6005 var $field 6006 6007 // go through the fields collection 6008 for (var i = 0, len = thisValidator.collection.length; i < len; i++) { 6009 6010 $field = thisValidator.collection[i] 6011 6012 // store the password fields 6013 if ($field[0].name === 'pwd' || $field[0].name === 'newPassword') { 6014 thisValidator.$passwordNew = $field 6015 } else if ($field[0].name === 'checkPwd' || $field[0].name === 'checkNewPassword') { 6016 thisValidator.$passwordConfirm = $field 6017 } else if ($field[0].name === 'currentPassword') { 6018 thisValidator.$password = $field 6019 } 6020 } 6021 6022 // if thisValidator.[jQuery object] is NOT undefined proceed 6023 if (typeof thisValidator.$passwordNew !== 'undefined') { 6024 thisValidator.bindInlineValidation(thisValidator.$passwordNew, 'focu
6024sout.warningInline') 6025 } 6026 6027 if (typeof thisValidator.$passwordConfirm !== 'undefined') { 6028 thisValidator.bindInlineValidation(thisValidator.$passwordConfirm, 'focusout.warningInline') 6029 } 6030 6031 if (typeof thisValidator.$password !== 'undefined') { 6032 thisValidator.bindInlineValidation(thisValidator.$password, 'focusout.warningInline') 6033 } 6034 6035 } 6036 6037 6038 options.customValidate = { 6039 password_confirm: function ($field, thisValidator) { 6040 return $field.val() === thisValidator.$passwordNew.val() 6041 } 6042 } 6043 */ 6044 6045 } // compare_passwords 6046 6047 6048 }, 6049 /* forms */ 6050 validation: function (i) { 6051 var options = {}, 6052 form = this, 6053 validate = Validator 6054 // for IE 6055 form.dataobj = form.dataset || $(form).data() 6056 // bind validations based on form type 6057 if (!form.dataobj.type) { 6058 //console.warn('Form "data-type" has not been declared.') 6059 } else { 6060 try { 6061 APP.forms[form.dataobj.type](options) 6062 } catch (e) { 6063 //console.log('good') 6064 } 6065 } 6066 // let the validation begin 6067 validate(form, options) 6068 } // validation 6069 }, // APP 6070 /* ========================================================================== 6071 6072 Form validation 6073 =============== 6074 6075 • Forms should have the class `js-form` 6076 • Submit buttons do not need an additional class 6077 6078 • The validator accepts 2 arguments: `form` and `options` 6079 - form: the actual form element (not the jQuery object) 6080 - options: can contain options for specific forms 6081 6082 6083 Form errors 6084 ----------- 6085 6086 • General form error should have the class `js-form-warning hidden` 6087 • Fields with inline errors should have the following attribute: 6088 `data-warning="__WARNING_MESSAGE_HERE__"` 6089 6090 6091 Multiple errors 6092 --------------- 6093 6094 • Fields can have a multiple warnings based on `data-type`. Example: 6095 `data-type="__DATA_TYPE_HERE__"` 6096 `data-warning="__WARNING_MESSAGE_HERE__"` 6097 6098 • Check `self.validateField` for more info 6099 6100 6101 Form fields 6102 ----------- 6103 6104 • Required fields should have the attribute `data-required="true"` 6105 • Optional fields that require validation if filled in (eg email), 6106 should have the attribute `data-type="__DATA_TYPE_HERE__"` 6107 6108 • Check `self.validateField` for more info 6109 6110 6111 Bind events to fields 6112 --------------------- 6113 6114 • Bind events to fields with the attribute `data-bind` with the 6115 following format (without line breaks & spaces): 6116 ` 6117 data-bind='{ 6118 "type": "form_intent", // required 6119 "action": "__UNIQUE_ACTION_NAME_HERE__", 6120 "value": "__VALUE_HERE__" 6121 }' 6122 ` 6123 6124 • Check `options.bindEvent` for more info 6125 6126 6127 ========================================================================== */ 6128 Validator = function (form, options) { 6129 var self = {} 6130 /* 6131 Validate required fields 6132 ------------------------ 6133 • Validated using the attribute `data-required="true"` 6134 • Required fields can be: 6135 - textarea 6136 - input[type=text] 6137 - input[type=password] 6138 - input[type=checkbox] 6139 - select 6140 6141 6142 Validate optional fields 6143 ------------------------ 6144 • Validated using the attribute `data-type="__FIELD_TYPE_HERE__"` 6145 • Optional fields can be: 6146 - input[type=text] 6147 6148 • If field is empty, it passes through. Otherwise it will validate 6149 using the `data-type` as a reference. Example: 6150 ` 6151 data-type="email" // validated against email regEx 6152 6153 6154 Select drop-downs 6155 ----------------- 6156 • If a `select` element is required, the option(s) triggering 6157 an error would look something like this: 6158 ` 6159 <option value="-1">__DEFAULT_VALUE_HERE__</option> 6160 6161 6162 Multiple emails 6163 --------------- 6164 • Validate multiple emails with `data-type` attribute: 6165 ` 6166 data-type="emails" // emails separated by comma 6167 6168 ======================================================================== */ 6169 self.validateField = function ($field, validity, forceCheck) { 6170 var fieldType = $field[0].type || "", 6171 fieldRequired = $field.attr('data-required'), 6172 fieldValue = (fieldType === 'checkbox' || fieldType === 'radio') ? $field[0].checked : $field[0].value, 6173 fieldPlaceholder = $($field[0]).attr('placeholder'), 6174 fieldDataType = $field.data('type'), 6175 fieldDataWarning = $field.data('type-warning'), 6176 fieldCheck; 6177 6178 // if(fieldRequired === 'false'){ 6179 // return true; 6180 // } 6181 6182 // if the field has a value and there's a custom field validator 6183 if (fieldValue && self.options.customValidate && self.options.customValidate[fieldDataType]) { 6184 try { 6185 // check if the field matches custom validation 6186 fieldCheck = self.options.customValidate[fieldDataType]($field, self); 6187 if (!fieldCheck) { 6188 self.warningInlineShow($field, fieldDataWarning); 6189 return false;
6190 } 6191 } catch (e) { 6192 // console.log( e, fieldCheck ); 6193 } 6194 } 6195 /** Textareas **/ 6196 if (fieldType === 'textarea' && !fieldValue) { 6197 self.warningInlineShow($field); 6198 return false; 6199 } else if (AG.utils.listContains(fieldType,"text,email,number","any")) { /** Input fields **/ 6200 if (!fieldValue && !fieldDataType) { // if there's no value and no data-type 6201 self.warningInlineShow($field, null, true); 6202 return false; 6203 } else if (!fieldValue && fieldDataType) { // if there's no value but has a data-type 6204 self.warningInlineShow($field); 6205 return false; 6206 } else if (fieldValue && fieldDataType) { // if there's a value and a data-type 6207 if (fieldDataType === 'email') { 6208 // validate it against regex and less than 256 chars in length 6209 if (!AG.validate.isEmail(fieldValue)) { 6210 self.warningInlineShow($field, fieldDataWarning, forceCheck); 6211 return false; 6212 } 6213 } else if (fieldDataType === 'emails') { 6214 var emails = fieldValue.split(','); 6215 for (var i = 0, len = emails.length; i < len; i += 1) { 6216 email = $.trim(emails[i]); 6217 // validate it against regex 6218 if (AG.validate.isEmail(email)) { 6219 self.warningInlineShow($field, fieldDataWarning, forceCheck); 6220 return false; 6221 } 6222 } 6223 } else if (fieldDataType === 'number') { 6224 var validationRegex = /^[0-9]+$/; // The regex was wrong 6225 if (!validationRegex.test(fieldValue)) { 6226 self.warningInlineShow($field, fieldDataWarning, forceCheck); 6227 return false; 6228 } 6229 } else if (fieldDataType === 'zip') { 6230 var validationRegex = /^\s*\d{5}(\s*-?\s*\d{4})?\s*$/; 6231 if (!validationRegex.test(fieldValue)) { 6232 self.warningInlineShow($field, fieldDataWarning, forceCheck); 6233 return false; 6234 } 6235 } else { 6236 // console.log( fieldDataType ); 6237 } 6238 } else if (fieldValue == fieldPlaceholder) { // if there's a value that matches the placeholder text (IE8 polyfill) 6239 self.warningInlineShow($field, null, true); 6240 return false; 6241 } else { 6242 // console.log( 'some other text type', fieldDataType, $field ); 6243 } 6244 } // fieldType = text 6245 else if (fieldType === 'password') { /** Passwords **/ 6246 // if there's no value 6247 if (!fieldValue || (fieldValue == fieldPlaceholder)) { 6248 self.warningInlineShow($field); 6249 return false; 6250 } 6251 // if a new password is too short 6252 else if (fieldValue.length < 8 && fieldDataType === 'password_new') { 6253 self.warningInlineShow($field, fieldDataWarning.password_short, forceCheck); 6254 return false; 6255 } 6256 // if password length is fine 6257 else { 6258 // if it's a new password and doesn't match regex 6259 if (fieldDataType === 'password_new' && !regEx.password.test(fieldValue)) { 6260 self.warningInlineShow($field, fieldDataWarning.password_insecure, forceCheck); 6261 return false; 6262 } else { 6263 //////console.log( $field ); 6264 } 6265 } 6266 } // fieldType = password 6267 else if (fieldType === 'checkbox' && fieldDataType !== 'checkbox-group') { /** Checkbox **/ 6268 if (!fieldValue) { 6269 self.warningInlineShow($field); 6270 return false; 6271 } 6272 } // fieldType = checkbox 6273 else if (fieldDataType === 'checkbox-group') { 6274 // checkbox group - we are not using the standard method for showing/hiding warning messages (warningInlineShow). everything is contained within this conditional. 6275 var min = $($field[0]).attr('data-min') || 1, 6276 selected = 0, 6277 $checkboxContainer = $($field[0]).closest('.checkbox-wrap'), 6278 $checkboxes = $checkboxContainer.find('input'); 6279 6280 // loop and count selectecd checkboxes inside the checkbox-wrap parent element. these loops will happen on each field that runs through this validation function 6281 $checkboxes.each(function(i){ 6282 if ( $(this).is(':checked') ) { 6283 selected++; 6284 } 6285 }); 6286 // run this if selected checboxes is less than min (0) 6287 if (selected < min) { 6288 self.warningInlineShow($field); 6289 return false;
6290 } 6291 } // fieldType = checkbox group 6292 else if (fieldType === 'radio') { /** Radio Buttons **/ 6293 var radioGrp = document.getElementsByName($field.attr('name')); 6294 for (var i = 0; i < radioGrp.length; i++) { 6295 if (radioGrp[i].checked) { 6296 return true; /* Checked */ 6297 } 6298 } 6299 self.warningInlineShow($field); 6300 return false; 6301 } // fieldType = radio 6302 else if (fieldType === 'select-one') { /** Select drop-downs **/ 6303 if (fieldValue === "-1") { 6304 self.warningInlineShow($field); 6305 return false; 6306 } 6307 } else { 6308 // by now, either the field is valid 6309 // or a validation method hasn't been written 6310 //////console.log( 'this field seems valid' ); 6311 //////console.dir( $field ); 6312 $('.check-box-grp').each(function(){ 6313 var selected = 0, 6314 min = 1, 6315 $boxes = $(this).find('.input-checkbox'); 6316 6317 $boxes.each(function(){ 6318 if ($(this).find('input').is(':checked')) { 6319 selected++; 6320 } 6321 }); 6322 6323 if (selected < min) { 6324 $boxes.find('.checkbox').each(function(){ 6325 $(this).addClass('warning').on('click',function(){ 6326 $boxes.find('.checkbox').removeClass('warning') 6327 }); 6328 }); 6329 } 6330 }); 6331 } 6332 return validity; 6333 } // self.validateField 6334 /** Warning template **/ 6335 self.$warningTemplate = (function () { 6336 return $('<div class="form-error-box error js-error"><p class="desc js-msg"></p></div>') 6337 })() 6338 /** Show form warning and invoke onError **/ 6339 self.warn = function () { 6340 // Clear away any previous success messages 6341 APP.$content.find('.generic-success').hide(); 6342 // show the form warning 6343 //self.$formWarning.show() 6344 self.$formWarning.stop(true, true).slideDown(500).fadeIn({ 6345 duration: 500, 6346 queue: false 6347 }); 6348 // call the on error function 6349 if (self.options.onError) { 6350 self.options.onError(self) 6351 } 6352 // otherwise scroll to the form warning 6353 else { 6354 if (self.$formWarning.parents('.modal').length === 0) { // Don't scroll if in modal 6355 scrollPageTo(self.$formWarning) 6356 } 6357 } 6358 return self 6359 } 6360 /** Show warning on given field **/ 6361 self.warningShow = function ($field, dataWarning, forceWarning) { 6362 var message = dataWarning || $field.data('warning'), 6363 dataType = $field.data('type'), 6364 warning = self.$warningTemplate.clone(), 6365 radioLookupFirst; 6366 6367 // if there is already an error 6368 if ($field.parent().find('.js-error').length || $field.closest('.checkbox-wrap').find('.js-error').length || $field.closest('.input-select').find('.js-error').length ) { // also look for the location of error msg for checkboxes. Loop for radio button messages in the condiational below 6369 // if there's a need to force update a warning message only 6370 if (forceWarning) { 6371 $field.closest('.js-error').find('.js-msg').text(message); 6372 } 6373 return self; 6374 } 6375 6376 // check if there's a warning message to show 6377 if (!message && $($field).data('required')) { 6378 //console.error( 'Validation fail: `' + $field[0].type + '` for `' + $field[0].name + '` has no `data-warning`.' ); 6379 // bind listener to remove warning 6380 $field.addClass('warning').on('keydown.warning change.warning', warning.remover); 6381 return self; 6382 } 6383 6384 // call the on field warning function 6385 if (self.options.onFieldError) { 6386 self.options.onFieldError($field, self); 6387 } 6388 // bind the warning remover 6389 warning.remover = function () { 6390 self.warningRemove($field); 6391 } 6392 6393 if($field.is("select")) { 6394 warning 6395 // put the message in the warning 6396 .find('.js-msg').text(message) 6397 .end() 6398 // paint the warning before the field 6399 .insertAfter($field.closest('.input-select').find('label > span:eq(0)')) 6400 } else if ($field[0] && $field[0].type === 'checkbox'){ 6401 warning 6402 // put the message in the warning 6403 .find('.js-msg').text(message) 6404 .end() 6405 // warning is placed as first child inside checkbox wrap 6406 .insertBefore($field.closest('.checkbox-wrap').find('.input-checkbox').first() ) 6407 } else if ($field[0] && $field[0].type === 'radio'){ 6408 6409 var radioGrp = document.getElementsByName($field.attr('name')), 6410 $radioGrp = $(radioGrp); 6411 6412 if( !$radioGrp.first().closest('.input-radio').prev('.js-error').length ) { 6413 warning 6414 // put the message in the warning 6415 .find('.js-msg').text(message) 6416 .end() 6417 // warning is placed as first child inside checkbox wrap 6418 .insertBefore( $(radioGrp).first().closest('.input-radio') ); 6419 } 6420 6421 } else { 6422 warning 6423 // put the message in the warning 6424 .find('.js-msg').text(message) 6425 .end() 6426 // paint the warning before the field 6427 .insertBefore($field) 6428 } 6429 6430 // If the field is a 'select' form element, run a condition to search the parent container for 6431 // the class 'selectboxit-container' insert warning above the span with class 'selectboxit'. 6432 // Else do the insert before field. 6433 6434 /*if(condition for selectbox) { 6435 $field = selectboxit element 6436 }*/ 6437 6438 // check if there needs to be inline check & x marks 6439 if (dataType && dataWarning) { 6440 //////console.log( 'inserting here', dataType, dataWarning ); 6441 self.warningInlineShow($field, warning); 6442 } 6443 // if no inline warning icons needed 6444 else { 6445 // bind listener to remove warning 6446 //$field.addClass('warning').on('keydown.warning change.warning', warning.remover); 6447 } 6448 return self; 6449 } 6450 /** Remove the warning for a given field **/ 6451 self.warningRemove = function ($field) { 6452 6453 // GK: Remove warning class on the label for the field 6454 //$('label[for="' + $field.attr('id') + '"]').removeClass('warning'); 6455 $($field).closest('label').removeClass('warning'); // travel up and find the label tag for the specific field - remove the warning class 6456 6457 if($field[0].type === 'checkbox'){ 6458 $field 6459 // remove the warning class 6460 .removeClass('warning') 6461 // switch off the listner 6462 .off('.warning') 6463 // remove the error - for checkboxes go up to the wrapper, then find the error 6464 .closest('.checkbox-wrap').find('.js-error').remove(); 6465 // hide the general form warning 6466 //self.$formWarning.hide(); 6467 } else if($field[0].type === 'radio'){ 6468 $field 6469 // switch off the listner 6470 .off('.warning') 6471 // remove the error - for checkboxes go up to the wrapper, then find the error 6472 .closest('.input-radio').prev('.js-error').remove(); 6473 // hide the general form warning 6474 //self.$formWarning.hide(); 6475 } else if($field.is("select")){ 6476 $field 6477 .removeClass('warning') 6478 // switch off the listner 6479 .off('.warning') 6480 // remove the error - for checkboxes go up to the wrapper, then find the error 6481 .closest('.input-select').find('.js-error').remove(); 6482 // hide the general form warning 6483 //self.$formWarning.hide(); 6484 } else{ 6485 $field 6486 // remove the warning class 6487 .removeClass('warning') 6488 // switch off the listner 6489 .off('.warning') 6490 // remove the error 6491 .parent().find('.js-error').remove(); 6492 // hide the general form warning 6493 //self.$formWarning.hide(); 6494 } 6495 self.$formWarning.stop(true, true).fadeOut({ 6496 duration: 500, 6497 queue: false 6498 }).slideUp(500); 6499 6500 return self; 6501 } 6502 /** Show the inline warning for a given field **/ 6503 self.warningInlineShow = function ($field, warning, forceCheck) { 6504 // bind the inline warning remover 6505 $field.removerInline = function () { 6506 self.bindInlineValidation($field); 6507 } 6508 6509 if($field[0] && $field[0].type === 'radio'){ 6510 $field 6511 // add the warning state 6512 //.addClass('warning') removing add class warning method for radio buttons - conflicts with fancy form plugin 6513 // switch off other warning listeners 6514 .off('.warning .warningInline') 6515 // bind the inline validator listeners 6516 .on('validate.warningInline', $field.removerInline).trigger('validate'); 6517 } else{ 6518 $field.parents('label').addClass('warning'); 6519 $field 6520 // add the warning state 6521 .addClass('warning') 6522 // switch off other warning listeners 6523 .off('.warning .warningInline') 6524 // bind the inline validator listeners 6525 .on('validate.warningInline', $field.removerInline).trigger('validate'); 6526 } 6527 6528 // show the warning icon 6529 if ($field.next('.js-field-icon').length) { 6530 $field.next('.js-field-icon').removeClass('icon-valid').addClass('icon-warning'); 6531 } 6532 // add the warning icon if it's not there 6533 else {
6534 $field.after('<span class="js-field-icon icon-warning"></span>'); 6535 } 6536 self.warningShow($field, warning); 6537 return self; 6538 } 6539 /** Remove the inline warning for a given field **/ 6540 self.warningInlineRemove = function ($field) { 6541 // bind the warning remover 6542 $field.warningRemover = function () { 6543 self.warningRemove($field); 6544 } 6545 $field 6546 // bind the warning listeners 6547 .on('keydown.warning change.warning', $field.warningRemover) 6548 // change the status indicator 6549 .next('.js-field-icon').removeClass('icon-warning').addClass('icon-valid'); 6550 6551 self.warningRemove($field); 6552 return self; 6553 } 6554 /** Reset the form fields and errors **/ 6555 self.resetForm = function () { 6556 // remove all warnings and errors 6557 self.$form.find('.warning').removeClass('warning').end() 6558 .find('[type=text], [type=password], textarea').prop('value', function () { 6559 this.value = this.defaultValue 6560 }).end() 6561 .find('[type=checkbox], [type=radio]').prop('checked', function () { 6562 this.checked = this.defaultChecked 6563 }).end() 6564 .find('.form-error-box').remove(); 6565 //self.$formWarning.hide(); 6566 self.$formWarning.stop(true, true).fadeOut({ 6567 duration: 500, 6568 queue: false 6569 }).slideUp(500); 6570 return self; 6571 } 6572 /** Bind the validation to the submit buttons **/ 6573 self.bindValidation = function ($button, form) { 6574 var beginValidation = function (e) { 6575 var options = self.options, 6576 doSubmit = true, 6577 is_valid = true; 6578 e.preventDefault(); 6579 // recollect the fields 6580 self.collectCycle(self.$form[0]); 6581 // go through each field in the collection and validate 6582 for (var i = 0, len = self.collection.length; i < len; i += 1) { 6583 is_valid = self.validateField(self.collection[i], is_valid); 6584 } 6585 // if not valid in the end 6586 if (!is_valid) { 6587 // call the warning function 6588 self.warn(); 6589 } 6590 // if the form is valid 6591 else { 6592 // check if there's a call to make before submit 6593 if (options.beforeSubmit) { 6594 doSubmit = options.beforeSubmit(self); 6595 } 6596 // if it's no longer safe to submit 6597 if (!doSubmit) { 6598 // call the warning function 6599 self.warn(); 6600 } 6601 // otherwise start submission 6602 else { 6603 //console.log( 'ready to submit :)', self.$form ); 6604 // call the callback function 6605 if (options.callback) { 6606 options.callback(self); 6607 } 6608 /* Removed. Can't see how this logic is ever true, since 6609 * there's no data('post') defined in JS or on the form tag. 6610 6611 // do a post submit if needed 6612 if ( self.$form.data('post') === true ) { 6613 self.$form.submit(); 6614 } 6615 6616 */ 6617 self.$form.submit(); 6618 } 6619 } 6620 } // beginValidation 6621 $button 6622 // set validation binding to true 6623 .data('validatorBinding', true) 6624 // begin validation on click 6625 .on('click', beginValidation); 6626 return self; 6627 } // bindValidation 6628 /** Bind the inline validation for a given field **/ 6629 self.bindInlineValidation = function ($field, events) { 6630 var beginInlineValidation = function () { 6631 $field.is_valid = self.validateField($field, true, true); 6632 if ($field.is_valid) { 6633 self.warningInlineRemove($field); 6634 } else { 6635 self.warningInlineShow($field); 6636 } 6637 } 6638 // initially set field as valid 6639 $field.is_valid = true; 6640 // check which events to bind 6641 events = events || 'keyup.warningInline change.warningInline'; 6642 // bind the events 6643 $field.on(events, beginInlineValidation); 6644 return self; 6645 } // bindInlineValidation
6646 self.displayAlertsFromServerValidation = function () { 6647 var target = {}, 6648 origMsg = ''; 6649 6650 /* If we have a JSON string present from server-side validation errors, we have to parse it */ 6651 if (typeof (errorsStr) != 'undefined' && errorsStr != null && errorsStr.length > 0) { 6652 var errorsJSON = JSON.parse(errorsStr); 6653 6654 /* Parse Fields */ 6655 for (var errorField in errorsJSON) { 6656 target = $('[name="' + errorField + '"]'); 6657 /* Save the inline warning message for later client-side validation */ 6658 origMsg = target.data('warning'); 6659 /* Switch warning message to the message supplied in the JSON obj */ 6660 target.data('warning', AG.utils.urldecode(errorsJSON[errorField])); 6661 /* Trigger the field's validation routine */ 6662 self.warningInlineShow(target); 6663 /* Swap out the server-side message for the original client-side message */ 6664 target.data('warning', origMsg); 6665 } 6666 } 6667 6668 var hasContent = self.$formWarning.find('.information_message').length?true:false; 6669 if (hasContent) { 6670 self.$formWarning.stop(true, true).slideDown(500).fadeIn({ 6671 duration: 500, 6672 queue: false 6673 }); 6674 } 6675 6676 6677 } 6678 /** Cycle through the fields to find those with bindings **/ 6679 self.bindIntents = function (form) { 6680 var $field; 6681 // cycle through all the form fields 6682 for (var i = 0, len = form.length; i < len; i += 1) { 6683 $field = $(form[i]); 6684 $field.intent = $field.data('bind'); 6685 // bind events the fields with a bind request 6686 if (self.options.bindEvent && $field.intent) { 6687 self.options.bindEvent($field, self); 6688 } 6689 } 6690 return self; 6691 } 6692 /** Add a field to the collection **/ 6693 self.collectAdd = function ($field) { 6694 self.collection.push($field); 6695 return self; 6696 } 6697 /** Check if a field needs to be collected **/ 6698 self.collectCheck = function ($field) { 6699 var addField = false; 6700 // if the field is required, add to collection 6701 if ($field.data('required') === true) { 6702 addField = true; 6703 } 6704 // bind events to the submit button 6705 if ($($field[0]).is(':input')) { 6706 if ($field[0].type === 'submit' || $field[0].type === 'button') { 6707 // if the button doesn't have a binding, then bind validation 6708 if (!$field.data('validatorBinding')) { 6709 self.bindValidation($field, form); 6710 self.$buttons = self.$buttons.add($field); 6711 } 6712 } 6713 } 6714 // if the field needs to be added 6715 if (addField) { 6716 self.collectAdd($field); 6717 } 6718 return self; 6719 } 6720 /** Cycle through the fields in a form to add to collection **/ 6721 self.collectCycle = function (form) { 6722 var $field; 6723 // create an emtpy collection for this form 6724 self.collection = []; 6725 // create an empty jQuery collection for buttons 6726 self.$buttons = self.$buttons || $(); 6727 // cycle through all the form fields 6728 for (var i = 0, len = form.length; i < len; i += 1) { 6729 $field = $(form[i]); 6730 // check and collect the fields 6731 self.collectCheck($field); 6732 } 6733 6734 // Manually add checkbox-group 6735 //self.collectCheck($('[data-type="checkbox-group"]')); 6736 6737 return self; 6738 } 6739 /** Initialize the Validator **/ 6740 self.initialize = (function () { 6741 6742 // store the form 6743 self.$form = $(form); 6744 // store the general form warning 6745 self.$formWarning = self.$form.find('.js-form-warning'); 6746 // store the options 6747 self.options = options; 6748 // cycle through all the fields in this form to collect 6749 self.collectCycle(form); 6750 // do the bindings on the form fields 6751 self.bindIntents(form); 6752 // invoke anything that needs to be called on load 6753 if (self.options.onLoad) { 6754 self.options.onLoad(self); 6755 } 6756 return self; 6757 })() 6758 //console.log( 'Validator', self )
6759 self.displayAlertsFromServerValidation(); 6760 return self; 6761 }, // Validator 6762 /** Some regex **/ 6763 regEx = { 6764 password: /(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])((?=[^!@#\$%]*[!@#\$%])|(?=[^0-9]*[0-9]))/ 6765 }, 6766 /* 6767 * Scroll the page to a specific vertical position 6768 * =============================================== */ 6769 scrollPageTo = function (position, speed) { 6770 // set the defaults 6771 position = position || 0; 6772 speed = (speed === undefined || speed === null) ? 250 : speed; 6773 // if it's an object, get the top position 6774 if (position.length >= 1) { 6775 position = position.first().offset().top - 40; 6776 } 6777 // begin the scrolling 6778 $('body, html').animate({ 6779 scrollTop: position 6780 }, speed) 6781 }; 6782 6783 /* 6784 * Make publicly available 6785 * ================================================ */ 6786 window.APP = APP; 6787 /* 6788 * Start 'er up 6789 * ================================================ */ 6790 APP.start(); 6791 /* */ 6792 })(jQuery, window, document); 6793 /* */ 6794 }); 6795}); 6796 6797define("formValidation", ["agUtils","agValidate"], function(){}); 6798 6799// ================================================== 6800// fancyBox v3.5.7 6801// 6802// Licensed GPLv3 for open source use 6803// or fancyBox Commercial License for commercial use 6804// 6805// http://fancyapps.com/fancybox/ 6806// Copyright 2019 fancyApps 6807// 6808// ================================================== 6809(function (window, document, $, undefined) { 6810 "use strict"; 6811 6812 window.console = window.console || { 6813 info: function (stuff) {} 6814 }; 6815 6816 // If there's no jQuery, fancyBox can't work 6817 // ========================================= 6818 6819 if (!$) { 6820 return; 6821 } 6822 6823 // Check if fancyBox is already initialized 6824 // ======================================== 6825 6826 if ($.fn.fancybox) { 6827 console.info("fancyBox already initialized"); 6828 6829 return; 6830 } 6831 6832 // Private default settings 6833 // ======================== 6834 6835 var defaults = { 6836 // Close existing modals 6837 // Set this to false if you do not need to stack multiple instances 6838 closeExisting: false, 6839 6840 // Enable infinite gallery navigation 6841 loop: false, 6842 6843 // Horizontal space between slides 6844 gutter: 50, 6845 6846 // Enable keyboard navigation 6847 keyboard: true, 6848 6849 // Should allow caption to overlap the content 6850 preventCaptionOverlap: true, 6851 6852 // Should display navigation arrows at the screen edges 6853 arrows: true, 6854 6855 // Should display counter at the top left corner 6856 infobar: true, 6857 6858 // Should display close button (using `btnTpl.smallBtn` template) over the content 6859 // Can be true, false, "auto" 6860 // If "auto" - will be automatically enabled for "html", "inline" or "ajax" items 6861 smallBtn: "auto", 6862 6863 // Should display toolbar (buttons at the top) 6864 // Can be true, false, "auto" 6865 // If "auto" - will be automatically hidden if "smallBtn" is enabled 6866 toolbar: "auto", 6867 6868 // What buttons should appear in the top right corner. 6869 // Buttons will be created using templates from `btnTpl` option 6870 // and they will be placed into toolbar (class="fancybox-toolbar"` element) 6871 buttons: [ 6872 "zoom", 6873 //"share", 6874 "slideShow", 6875 //"fullScreen", 6876 //"download", 6877 "thumbs", 6878 "close" 6879 ], 6880 6881 // Detect "idle" time in seconds 6882 idleTime: 3, 6883 6884 // Disable right-click and use simple image protection for images 6885 protect: false, 6886 6887 // Shortcut to make content "modal" - disable keyboard navigtion, hide buttons, etc 6888 modal: false, 6889 6890 image: { 6891 // Wait for images to load before displaying 6892 // true - wait for image to load and then display; 6893 // false - display thumbnail and load the full-sized image over top, 6894 // requires predefined image dimensions (`data-width` and `data-height` attributes) 6895 preload: false 6896 }, 6897 6898 ajax: { 6899 // Object containing settings for ajax request 6900 settings: { 6901 // This helps to indicate that request comes from the modal 6902 // Feel free to change naming 6903 data: { 6904 fancybox: true 6905 } 6906 } 6907 }, 6908 6909 iframe: { 6910 // Iframe template 6911 tpl: '<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>', 6912 6913 // Preload iframe before displaying it 6914 // This allows to calculate iframe content width and height 6915 // (note: Due to "Same Origin Policy", you can't get cross domain data). 6916 preload: true, 6917 6918 // Custom CSS styling for iframe wrapping element 6919 // You can use this to set custom iframe dimensions 6920 css: {}, 6921 6922 // Iframe tag attributes 6923 attr: { 6924 scrolling: "auto" 6925 } 6926 }, 6927 6928 // For HTML5 video only 6929 video: { 6930 tpl: '<video class="fancybox-video" controls controlsList="nodownload" poster="{{poster}}">' + 6931 '<source src="{{src}}" type="{{format}}" />' + 6932 'Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!' + 6933 "</video>", 6934 format: "", // custom video format 6935 autoStart: true 6936 }, 6937 6938 // Default content type if cannot be detected automatically 6939 defaultType: "image", 6940 6941 // Open/close animation type 6942 // Possible values: 6943 // false - disable 6944 // "zoom" - zoom images from/to thumbnail 6945 // "fade" 6946 // "zoom-in-out" 6947 // 6948 animationEffect: "zoom", 6949 6950 // Duration in ms for open/close animation 6951 animationDuration: 366, 6952 6953 // Should image change opacity while zooming 6954 // If opacity is "auto", then opacity will be changed if image and thumbnail have different aspect ratios 6955 zoomOpacity: "auto", 6956 6957 // Transition effect between slides 6958 // 6959 // Possible values: 6960 // false - disable 6961 // "fade' 6962 // "slide' 6963 // "circular' 6964 // "tube' 6965 // "zoom-in-out' 6966 // "rotate' 6967 // 6968 transitionEffect: "fade", 6969 6970 // Duration in ms for transition animation 6971 transitionDuration: 366, 6972 6973 // Custom CSS class for slide element 6974 slideClass: "", 6975 6976 // Custom CSS class for layout 6977 baseClass: "", 6978 6979 // Base template for layout 6980 baseTpl: '<div class="fancybox-container" role="dialog" tabindex="-1">' + 6981 '<div class="fancybox-bg"></div>' + 6982 '<div class="fancybox-inner">' + 6983 '<div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div>' + 6984 '<div class="fancybox-toolbar">{{buttons}}</div>' + 6985 '<div class="fancybox-navigation">{{arrows}}</div>' + 6986 '<div class="fancybox-stage"></div>' + 6987 '<div class="fancybox-caption"><div class="fancybox-caption__body"></div></div>' + 6988 "</div>" + 6989 "</div>", 6990 6991 // Loading indicator template 6992 spinnerTpl: '<div class="fancybox-loading"></div>', 6993 6994 // Error message template 6995 errorTpl: '<div class="fancybox-error"><p>{{ERROR}}</p></div>', 6996 6997 btnTpl: { 6998 download: '<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;">' + 6999 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
vendor: 154,754 bytes, lines 6999-12435
6999<path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg>' + 7000 "</a>", 7001 7002 zoom: '<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}">' + 7003 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg>' + 7004 "</button>", 7005 7006 close: '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' + 7007 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg>' + 7008 "</button>", 7009 7010 // Arrows 7011 arrowLeft: '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 7012 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div>' + 7013 "</button>", 7014 7015 arrowRight: '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 7016 '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div>' + 7017 "</button>", 7018 7019 // This small close button will be appended to your html/inline/ajax content by default, 7020 // if "smallBtn" option is not set to false 7021 smallBtn: '<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}">' + 7022 '<svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg>' + 7023 "</button>" 7024 }, 7025 7026 // Container is injected into this element 7027 parentEl: "body", 7028 7029 // Hide browser vertical scrollbars; use at your own risk 7030 hideScrollbar: true, 7031 7032 // Focus handling 7033 // ============== 7034 7035 // Try to focus on the first focusable element after opening 7036 autoFocus: true, 7037 7038 // Put focus back to active element after closing 7039 backFocus: true, 7040 7041 // Do not let user to focus on element outside modal content 7042 trapFocus: true, 7043 7044 // Module specific options 7045 // ======================= 7046 7047 fullScreen: { 7048 autoStart: false 7049 }, 7050 7051 // Set `touch: false` to disable panning/swiping 7052 touch: { 7053 vertical: true, // Allow to drag content vertically 7054 momentum: true // Continue movement after releasing mouse/touch when panning 7055 }, 7056 7057 // Hash value when initializing manually, 7058 // set `false` to disable hash change 7059 hash: null, 7060 7061 // Customize or add new media types 7062 // Example: 7063 /* 7064 media : { 7065 youtube : { 7066 params : { 7067 autoplay : 0 7068 } 7069 } 7070 } 7071 */ 7072 media: {}, 7073 7074 slideShow: { 7075 autoStart: false, 7076 speed: 3000 7077 }, 7078 7079 thumbs: { 7080 autoStart: false, // Display thumbnails on opening 7081 hideOnClose: true, // Hide thumbnail grid when closing animation starts 7082 parentEl: ".fancybox-container", // Container is injected into this element 7083 axis: "y" // Vertical (y) or horizontal (x) scrolling 7084 }, 7085 7086 // Use mousewheel to navigate gallery 7087 // If 'auto' - enabled for images only 7088 wheel: "auto", 7089 7090 // Callbacks 7091 //========== 7092 7093 // See Documentation/API/Events for more information 7094 // Example: 7095 /* 7096 afterShow: function( instance, current ) { 7097 console.info( 'Clicked element:' ); 7098 console.info( current.opts.$orig ); 7099 } 7100 */ 7101 7102 onInit: $.noop, // When instance has been initialized 7103 7104 beforeLoad: $.noop, // Before the content of a slide is being loaded 7105 afterLoad: $.noop, // When the content of a slide is done loading 7106 7107 beforeShow: $.noop, // Before open animation starts 7108 afterShow: $.noop, // When content is done loading and animating 7109 7110 beforeClose: $.noop, // Before the instance attempts to close. Return false to cancel the close. 7111 afterClose: $.noop, // After instance has been closed 7112 7113 onActivate: $.noop, // When instance is brought to front 7114 onDeactivate: $.noop, // When other instance has been activated 7115 7116 // Interaction 7117 // =========== 7118 7119 // Use options below to customize taken action when user clicks or double clicks on the fancyBox area, 7120 // each option can be string or method that returns value. 7121 // 7122 // Possible values: 7123 // "close" - close instance 7124 // "next" - move to next gallery item 7125 // "nextOrClose" - move to next gallery item or close if gallery has only one item 7126 // "toggleControls" - show/hide controls 7127 // "zoom" - zoom image (if loaded) 7128 // false - do nothing 7129 7130 // Clicked on the content 7131 clickContent: function (current, event) { 7132 return current.type === "image" ? "zoom" : false; 7133 }, 7134 7135 // Clicked on the slide 7136 clickSlide: "close", 7137 7138 // Clicked on the background (backdrop) element; 7139 // if you have not changed the layout, then most likely you need to use `clickSlide` option 7140 clickOutside: "close", 7141 7142 // Same as previous two, but for double click 7143 dblclickContent: false, 7144 dblclickSlide: false, 7145 dblclickOutside: false, 7146 7147 // Custom options when mobile device is detected 7148 // ============================================= 7149 7150 mobile: { 7151 preventCaptionOverlap: false, 7152 idleTime: false, 7153 clickContent: function (current, event) { 7154 return current.type === "image" ? "toggleControls" : false; 7155 }, 7156 clickSlide: function (current, event) { 7157 return current.type === "image" ? "toggleControls" : "close"; 7158 }, 7159 dblclickContent: function (current, event) { 7160 return current.type === "image" ? "zoom" : false; 7161 }, 7162 dblclickSlide: function (current, event) { 7163 return current.type === "image" ? "zoom" : false; 7164 } 7165 }, 7166 7167 // Internationalization 7168 // ==================== 7169 7170 lang: "en", 7171 i18n: { 7172 en: { 7173 CLOSE: "Close", 7174 NEXT: "Next", 7175 PREV: "Previous", 7176 ERROR: "The requested content cannot be loaded. <br/> Please try again later.", 7177 PLAY_START: "Start slideshow", 7178 PLAY_STOP: "Pause slideshow", 7179 FULL_SCREEN: "Full screen", 7180 THUMBS: "Thumbnails", 7181 DOWNLOAD: "Download", 7182 SHARE: "Share", 7183 ZOOM: "Zoom" 7184 }, 7185 de: { 7186 CLOSE: "Schließen", 7187 NEXT: "Weiter", 7188 PREV: "Zurück", 7189 ERROR: "Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.", 7190 PLAY_START: "Diaschau starten", 7191 PLAY_STOP: "Diaschau beenden", 7192 FULL_SCREEN: "Vollbild", 7193 THUMBS: "Vorschaubilder", 7194 DOWNLOAD: "Herunterladen", 7195 SHARE: "Teilen", 7196 ZOOM: "Vergrößern" 7197 } 7198 } 7199 }; 7200 7201 // Few useful variables and methods 7202 // ================================ 7203 7204 var $W = $(window); 7205 var $D = $(document); 7206 7207 var called = 0; 7208 7209 // Check if an object is a jQuery object and not a native JavaScript object 7210 // ======================================================================== 7211 var isQuery = function (obj) { 7212 return obj && obj.hasOwnProperty && obj instanceof $; 7213 }; 7214 7215 // Handle multiple browsers for "requestAnimationFrame" and "cancelAnimationFrame" 7216 // =============================================================================== 7217 var requestAFrame = (function () { 7218 return ( 7219 window.requestAnimationFrame || 7220 window.webkitRequestAnimationFrame || 7221 window.mozRequestAnimationFrame || 7222 window.oRequestAnimationFrame || 7223 // if all else fails, use setTimeout 7224 function (callback) { 7225 return window.setTimeout(callback, 1000 / 60); 7226 } 7227 ); 7228 })(); 7229 7230 var cancelAFrame = (function () { 7231 return ( 7232 window.cancelAnimationFrame || 7233 window.webkitCancelAnimationFrame || 7234 window.mozCancelAnimationFrame || 7235 window.oCancelAnimationFrame || 7236 function (id) { 7237 window.clearTimeout(id); 7238 } 7239 ); 7240 })(); 7241 7242 // Detect the supported transition-end event property name 7243 // ======================================================= 7244 var transitionEnd = (function () { 7245 var el = document.createElement("fakeelement"), 7246 t; 7247 7248 var transitions = { 7249 transition: "transitionend", 7250 OTransition: "oTransitionEnd", 7251 MozTransition: "transitionend", 7252 WebkitTransition: "webkitTransitionEnd" 7253 }; 7254 7255 for (t in transitions) { 7256 if (el.style[t] !== undefined) { 7257 return transitions[t]; 7258 } 7259 } 7260 7261 return "transitionend"; 7262 })(); 7263 7264 // Force redraw on an element. 7265 // This helps in cases where the browser doesn't redraw an updated element properly 7266 // ================================================================================ 7267 var forceRedraw = function ($el) { 7268 return $el && $el.length && $el[0].offsetHeight; 7269 }; 7270 7271 // Exclude array (`buttons`) options from deep merging 7272 // =================================================== 7273 var mergeOpts = function (opts1, opts2) { 7274 var rez = $.extend(true, {}, opts1, opts2); 7275 7276 $.each(opts2, function (key, value) { 7277 if ($.isArray(value)) { 7278 rez[key] = value; 7279 } 7280 }); 7281 7282 return rez; 7283 }; 7284 7285 // How much of an element is visible in viewport 7286 // ============================================= 7287 7288 var inViewport = function (elem) { 7289 var elemCenter, rez; 7290 7291 if (!elem || elem.ownerDocument !== document) { 7292 return false; 7293 } 7294 7295 $(".fancybox-container").css("pointer-events", "none"); 7296 7297 elemCenter = { 7298 x: elem.getBoundingClientRect().left + elem.offsetWidth / 2, 7299 y: elem.getBoundingClientRect().top + elem.offsetHeight / 2 7300 }; 7301 7302 rez = document.elementFromPoint(elemCenter.x, elemCenter.y) === elem; 7303 7304 $(".fancybox-container").css("pointer-events", ""); 7305 7306 return rez; 7307 }; 7308 7309 // Class definition 7310 // ================ 7311 7312 var FancyBox = function (content, opts, index) { 7313 var self = this; 7314 7315 self.opts = mergeOpts({ 7316 index: index 7317 }, $.fancybox.defaults); 7318 7319 if ($.isPlainObject(opts)) { 7320 self.opts = mergeOpts(self.opts, opts); 7321 } 7322 7323 if ($.fancybox.isMobile) { 7324 self.opts = mergeOpts(self.opts, self.opts.mobile); 7325 } 7326 7327 self.id = self.opts.id || ++called; 7328 7329 self.currIndex = parseInt(self.opts.index, 10) || 0; 7330 self.prevIndex = null; 7331 7332 self.prevPos = null; 7333 self.currPos = 0; 7334 7335 self.firstRun = true; 7336 7337 // All group items 7338 self.group = []; 7339 7340 // Existing slides (for current, next and previous gallery items) 7341 self.slides = {}; 7342 7343 // Create group elements 7344 self.addContent(content); 7345 7346 if (!self.group.length) { 7347 return; 7348 } 7349 7350 self.init(); 7351 }; 7352 7353 $.extend(FancyBox.prototype, { 7354 // Create DOM structure 7355 // ==================== 7356 7357 init: function () { 7358 var self = this, 7359 firstItem = self.group[self.currIndex], 7360 firstItemOpts = firstItem.opts, 7361 $container, 7362 buttonStr; 7363 7364 if (firstItemOpts.closeExisting) { 7365 $.fancybox.close(true); 7366 } 7367 7368 // Hide scrollbars 7369 // =============== 7370 7371 $("body").addClass("fancybox-active"); 7372 7373 if ( 7374 !$.fancybox.getInstance() && 7375 firstItemOpts.hideScrollbar !== false && 7376 !$.fancybox.isMobile && 7377 document.body.scrollHeight > window.innerHeight 7378 ) { 7379 $("head").append( 7380 '<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:' + 7381 (window.innerWidth - document.documentElement.clientWidth) + 7382 "px;}</style>" 7383 ); 7384 7385 $("body").addClass("compensate-for-scrollbar"); 7386 } 7387 7388 // Build html markup and set references 7389 // ==================================== 7390 7391 // Build html code for buttons and insert into main template 7392 buttonStr = ""; 7393 7394 $.each(firstItemOpts.buttons, function (index, value) { 7395 buttonStr += firstItemOpts.btnTpl[value] || ""; 7396 }); 7397 7398 // Create markup from base template, it will be initially hidden to 7399 // avoid unnecessary work like painting while initializing is not complete 7400 $container = $( 7401 self.translate( 7402 self, 7403 firstItemOpts.baseTpl 7404 .replace("{{buttons}}", buttonStr) 7405 .replace("{{arrows}}", firstItemOpts.btnTpl.arrowLeft + firstItemOpts.btnTpl.arrowRight) 7406 ) 7407 ) 7408 .attr("id", "fancybox-container-" + self.id) 7409 .addClass(firstItemOpts.baseClass) 7410 .data("FancyBox", self) 7411 .appendTo(firstItemOpts.parentEl); 7412 7413 // Create object holding references to jQuery wrapped nodes 7414 self.$refs = { 7415 container: $container 7416 }; 7417 7418 ["bg", "inner", "infobar", "toolbar", "stage", "caption", "navigation"].forEach(function (item) { 7419 self.$refs[item] = $container.find(".fancybox-" + item); 7420 }); 7421 7422 self.trigger("onInit"); 7423 7424 // Enable events, deactive previous instances 7425 self.activate(); 7426 7427 // Build slides, load and reveal content 7428 self.jumpTo(self.currIndex); 7429 }, 7430 7431 // Simple i18n support - replaces object keys found in template 7432 // with corresponding values 7433 // ============================================================ 7434 7435 translate: function (obj, str) { 7436 var arr = obj.opts.i18n[obj.opts.lang] || obj.opts.i18n.en; 7437 7438 return str.replace(/\{\{(\w+)\}\}/g, function (match, n) { 7439 return arr[n] === undefined ? match : arr[n]; 7440 }); 7441 }, 7442 7443 // Populate current group with fresh content 7444 // Check if each object has valid type and content 7445 // =============================================== 7446 7447 addContent: function (content) { 7448 var self = this, 7449 items = $.makeArray(content), 7450 thumbs; 7451 7452 $.each(items, function (i, item) { 7453 var obj = {}, 7454 opts = {}, 7455 $item, 7456 type, 7457 found, 7458 src, 7459 srcParts; 7460 7461 // Step 1 - Make sure we have an object 7462 // ==================================== 7463 7464 if ($.isPlainObject(item)) { 7465 // We probably have manual usage here, something like 7466 // $.fancybox.open( [ { src : "image.jpg", type : "image" } ] ) 7467 7468 obj = item; 7469 opts = item.opts || item; 7470 } else if ($.type(item) === "object" && $(item).length) { 7471 // Here we probably have jQuery collection returned by some selector 7472 $item = $(item); 7473 7474 // Support attributes like `data-options='{"touch" : false}'` and `data-touch='false'` 7475 opts = $item.data() || {}; 7476 opts = $.extend(true, {}, opts, opts.options); 7477 7478 // Here we store clicked element 7479 opts.$orig = $item; 7480 7481 obj.src = self.opts.src || opts.src || $item.attr("href"); 7482 7483 // Assume that simple syntax is used, for example: 7484 // `$.fancybox.open( $("#test"), {} );` 7485 if (!obj.type && !obj.src) { 7486 obj.type = "inline"; 7487 obj.src = item; 7488 } 7489 } else { 7490 // Assume we have a simple html code, for example: 7491 // $.fancybox.open( '<div><h1>Hi!</h1></div>' ); 7492 obj = { 7493 type: "html", 7494 src: item + "" 7495 }; 7496 } 7497 7498 // Each gallery object has full collection of options 7499 obj.opts = $.extend(true, {}, self.opts, opts); 7500 7501 // Do not merge buttons array 7502 if ($.isArray(opts.buttons)) { 7503 obj.opts.buttons = opts.buttons; 7504 } 7505 7506 if ($.fancybox.isMobile && obj.opts.mobile) { 7507 obj.opts = mergeOpts(obj.opts, obj.opts.mobile); 7508 } 7509 7510 // Step 2 - Make sure we have content type, if not - try to guess 7511 // ============================================================== 7512 7513 type = obj.type || obj.opts.type; 7514 src = obj.src || ""; 7515 7516 if (!type && src) { 7517 if ((found = src.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))) { 7518 type = "video"; 7519 7520 if (!obj.opts.video.format) { 7521 obj.opts.video.format = "video/" + (found[1] === "ogv" ? "ogg" : found[1]); 7522 } 7523 } else if (src.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)) { 7524 type = "image"; 7525 } else if (src.match(/\.(pdf)((\?|#).*)?$/i)) { 7526 type = "iframe"; 7527 obj = $.extend(true, obj, { 7528 contentType: "pdf", 7529 opts: { 7530 iframe: { 7531 preload: false 7532 } 7533 } 7534 }); 7535 } else if (src.charAt(0) === "#") { 7536 type = "inline"; 7537 } 7538 } 7539 7540 if (type) { 7541 obj.type = type; 7542 } else { 7543 self.trigger("objectNeedsType", obj); 7544 } 7545 7546 if (!obj.contentType) { 7547 obj.contentType = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1 ? "html" : obj.type; 7548 } 7549 7550 // Step 3 - Some adjustments 7551 // ========================= 7552 7553 obj.index = self.group.length; 7554 7555 if (obj.opts.smallBtn == "auto") { 7556 obj.opts.smallBtn = $.inArray(obj.type, ["html", "inline", "ajax"]) > -1; 7557 } 7558 7559 if (obj.opts.toolbar === "auto") { 7560 obj.opts.toolbar = !obj.opts.smallBtn; 7561 } 7562 7563 // Find thumbnail image, check if exists and if is in the viewport 7564 obj.$thumb = obj.opts.$thumb || null; 7565 7566 if (obj.opts.$trigger && obj.index === self.opts.index) { 7567 obj.$thumb = obj.opts.$trigger.find("img:first"); 7568 7569 if (obj.$thumb.length) { 7570 obj.opts.$orig = obj.opts.$trigger; 7571 } 7572 } 7573 7574 if (!(obj.$thumb && obj.$thumb.length) && obj.opts.$orig) { 7575 obj.$thumb = obj.opts.$orig.find("img:first"); 7576 } 7577 7578 if (obj.$thumb && !obj.$thumb.length) { 7579 obj.$thumb = null; 7580 } 7581 7582 obj.thumb = obj.opts.thumb || (obj.$thumb ? obj.$thumb[0].src : null); 7583 7584 // "caption" is a "special" option, it can be used to customize caption per gallery item 7585 if ($.type(obj.opts.caption) === "function") { 7586 obj.opts.caption = obj.opts.caption.apply(item, [self, obj]); 7587 } 7588 7589 if ($.type(self.opts.caption) === "function") { 7590 obj.opts.caption = self.opts.caption.apply(item, [self, obj]); 7591 } 7592 7593 // Make sure we have caption as a string or jQuery object 7594 if (!(obj.opts.caption instanceof $)) { 7595 obj.opts.caption = obj.opts.caption === undefined ? "" : obj.opts.caption + ""; 7596 } 7597 7598 // Check if url contains "filter" used to filter the content 7599 // Example: "ajax.html #something" 7600 if (obj.type === "ajax") { 7601 srcParts = src.split(/\s+/, 2); 7602 7603 if (srcParts.length > 1) { 7604 obj.src = srcParts.shift(); 7605 7606 obj.opts.filter = srcParts.shift(); 7607 } 7608 } 7609 7610 // Hide all buttons and disable interactivity for modal items 7611 if (obj.opts.modal) { 7612 obj.opts = $.extend(true, obj.opts, { 7613 trapFocus: true, 7614 // Remove buttons 7615 infobar: 0, 7616 toolbar: 0, 7617 7618 smallBtn: 0, 7619 7620 // Disable keyboard navigation 7621 keyboard: 0, 7622 7623 // Disable some modules 7624 slideShow: 0, 7625 fullScreen: 0, 7626 thumbs: 0, 7627 touch: 0, 7628 7629 // Disable click event handlers 7630 clickContent: false, 7631 clickSlide: false, 7632 clickOutside: false, 7633 dblclickContent: false, 7634 dblclickSlide: false, 7635 dblclickOutside: false 7636 }); 7637 } 7638 7639 // Step 4 - Add processed object to group 7640 // ====================================== 7641 7642 self.group.push(obj); 7643 }); 7644 7645 // Update controls if gallery is already opened 7646 if (Object.keys(self.slides).length) { 7647 self.updateControls(); 7648 7649 // Update thumbnails, if needed 7650 thumbs = self.Thumbs; 7651 7652 if (thumbs && thumbs.isActive) { 7653 thumbs.create(); 7654 7655 thumbs.focus(); 7656 } 7657 } 7658 }, 7659 7660 // Attach an event handler functions for: 7661 // - navigation buttons 7662 // - browser scrolling, resizing; 7663 // - focusing 7664 // - keyboard 7665 // - detecting inactivity 7666 // ====================================== 7667 7668 addEvents: function () { 7669 var self = this; 7670 7671 self.removeEvents(); 7672 7673 // Make navigation elements clickable 7674 // ================================== 7675 7676 self.$refs.container 7677 .on("click.fb-close", "[data-fancybox-close]", function (e) { 7678 e.stopPropagation(); 7679 e.preventDefault(); 7680 7681 self.close(e); 7682 }) 7683 .on("touchstart.fb-prev click.fb-prev", "[data-fancybox-prev]", function (e) { 7684 e.stopPropagation(); 7685 e.preventDefault(); 7686 7687 self.previous(); 7688 }) 7689 .on("touchstart.fb-next click.fb-next", "[data-fancybox-next]", function (e) { 7690 e.stopPropagation(); 7691 e.preventDefault(); 7692 7693 self.next(); 7694 }) 7695 .on("click.fb", "[data-fancybox-zoom]", function (e) { 7696 // Click handler for zoom button 7697 self[self.isScaledDown() ? "scaleToActual" : "scaleToFit"](); 7698 }); 7699 7700 // Handle page scrolling and browser resizing 7701 // ========================================== 7702 7703 $W.on("orientationchange.fb resize.fb", function (e) { 7704 if (e && e.originalEvent && e.originalEvent.type === "resize") { 7705 if (self.requestId) { 7706 cancelAFrame(self.requestId); 7707 } 7708 7709 self.requestId = requestAFrame(function () { 7710 self.update(e); 7711 }); 7712 } else { 7713 if (self.current && self.current.type === "iframe") { 7714 self.$refs.stage.hide(); 7715 } 7716 7717 setTimeout( 7718 function () { 7719 self.$refs.stage.show(); 7720 7721 self.update(e); 7722 }, 7723 $.fancybox.isMobile ? 600 : 250 7724 ); 7725 } 7726 }); 7727 7728 $D.on("keydown.fb", function (e) { 7729 var instance = $.fancybox ? $.fancybox.getInstance() : null, 7730 current = instance.current, 7731 keycode = e.keyCode || e.which; 7732 7733 // Trap keyboard focus inside of the modal 7734 // ======================================= 7735 7736 if (keycode == 9) { 7737 if (current.opts.trapFocus) { 7738 self.focus(e); 7739 } 7740 7741 return; 7742 } 7743 7744 // Enable keyboard navigation 7745 // ========================== 7746 7747 if (!current.opts.keyboard || e.ctrlKey || e.altKey || e.shiftKey || $(e.target).is("input,textarea,video,audio,select")) { 7748 return; 7749 } 7750 7751 // Backspace and Esc keys 7752 if (keycode === 8 || keycode === 27) { 7753 e.preventDefault(); 7754 7755 self.close(e); 7756 7757 return; 7758 } 7759 7760 // Left arrow and Up arrow 7761 if (keycode === 37 || keycode === 38) { 7762 e.preventDefault(); 7763 7764 self.previous(); 7765 7766 return; 7767 } 7768 7769 // Righ arrow and Down arrow 7770 if (keycode === 39 || keycode === 40) { 7771 e.preventDefault(); 7772 7773 self.next(); 7774 7775 return; 7776 } 7777 7778 self.trigger("afterKeydown", e, keycode); 7779 }); 7780 7781 // Hide controls after some inactivity period 7782 if (self.group[self.currIndex].opts.idleTime) { 7783 self.idleSecondsCounter = 0; 7784 7785 $D.on( 7786 "mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle", 7787 function (e) { 7788 self.idleSecondsCounter = 0; 7789 7790 if (self.isIdle) { 7791 self.showControls(); 7792 } 7793 7794 self.isIdle = false; 7795 } 7796 ); 7797 7798 self.idleInterval = window.setInterval(function () { 7799 self.idleSecondsCounter++; 7800 7801 if (self.idleSecondsCounter >= self.group[self.currIndex].opts.idleTime && !self.isDragging) { 7802 self.isIdle = true; 7803 self.idleSecondsCounter = 0; 7804 7805 self.hideControls(); 7806 } 7807 }, 1000); 7808 } 7809 }, 7810 7811 // Remove events added by the core 7812 // =============================== 7813 7814 removeEvents: function () { 7815 var self = this; 7816 7817 $W.off("orientationchange.fb resize.fb"); 7818 $D.off("keydown.fb .fb-idle"); 7819 7820 this.$refs.container.off(".fb-close .fb-prev .fb-next"); 7821 7822 if (self.idleInterval) { 7823 window.clearInterval(self.idleInterval); 7824 7825 self.idleInterval = null; 7826 } 7827 }, 7828 7829 // Change to previous gallery item 7830 // =============================== 7831 7832 previous: function (duration) { 7833 return this.jumpTo(this.currPos - 1, duration); 7834 }, 7835 7836 // Change to next gallery item 7837 // =========================== 7838 7839 next: function (duration) { 7840 return this.jumpTo(this.currPos + 1, duration); 7841 }, 7842 7843 // Switch to selected gallery item 7844 // =============================== 7845 7846 jumpTo: function (pos, duration) { 7847 var self = this, 7848 groupLen = self.group.length, 7849 firstRun, 7850 isMoved, 7851 loop, 7852 current, 7853 previous, 7854 slidePos, 7855 stagePos, 7856 prop, 7857 diff; 7858 7859 if (self.isDragging || self.isClosing || (self.isAnimating && self.firstRun)) { 7860 return; 7861 } 7862 7863 // Should loop? 7864 pos = parseInt(pos, 10); 7865 loop = self.current ? self.current.opts.loop : self.opts.loop; 7866 7867 if (!loop && (pos < 0 || pos >= groupLen)) { 7868 return false; 7869 } 7870 7871 // Check if opening for the first time; this helps to speed things up 7872 firstRun = self.firstRun = !Object.keys(self.slides).length; 7873 7874 // Create slides 7875 previous = self.current; 7876 7877 self.prevIndex = self.currIndex; 7878 self.prevPos = self.currPos; 7879 7880 current = self.createSlide(pos); 7881 7882 if (groupLen > 1) { 7883 if (loop || current.index < groupLen - 1) { 7884 self.createSlide(pos + 1); 7885 } 7886 7887 if (loop || current.index > 0) { 7888 self.createSlide(pos - 1); 7889 } 7890 } 7891 7892 self.current = current; 7893 self.currIndex = current.index; 7894 self.currPos = current.pos; 7895 7896 self.trigger("beforeShow", firstRun); 7897 7898 self.updateControls(); 7899 7900 // Validate duration length 7901 current.forcedDuration = undefined; 7902 7903 if ($.isNumeric(duration)) { 7904 current.forcedDuration = duration; 7905 } else { 7906 duration = current.opts[firstRun ? "animationDuration" : "transitionDuration"]; 7907 } 7908 7909 duration = parseInt(duration, 10); 7910 7911 // Check if user has swiped the slides or if still animating 7912 isMoved = self.isMoved(current); 7913 7914 // Make sure current slide is visible 7915 current.$slide.addClass("fancybox-slide--current"); 7916 7917 // Fresh start - reveal container, current slide and start loading content 7918 if (firstRun) { 7919 if (current.opts.animationEffect && duration) { 7920 self.$refs.container.css("transition-duration", duration + "ms"); 7921 } 7922 7923 self.$refs.container.addClass("fancybox-is-open").trigger("focus"); 7924 7925 // Attempt to load content into slide 7926 // This will later call `afterLoad` -> `revealContent` 7927 self.loadSlide(current); 7928 7929 self.preload("image"); 7930 7931 return; 7932 } 7933 7934 // Get actual slide/stage positions (before cleaning up) 7935 slidePos = $.fancybox.getTranslate(previous.$slide); 7936 stagePos = $.fancybox.getTranslate(self.$refs.stage); 7937 7938 // Clean up all slides 7939 $.each(self.slides, function (index, slide) { 7940 $.fancybox.stop(slide.$slide, true); 7941 }); 7942 7943 if (previous.pos !== current.pos) { 7944 previous.isComplete = false; 7945 } 7946 7947 previous.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"); 7948 7949 // If slides are out of place, then animate them to correct position 7950 if (isMoved) { 7951 // Calculate horizontal swipe distance 7952 diff = slidePos.left - (previous.pos * slidePos.width + previous.pos * previous.opts.gutter); 7953 7954 $.each(self.slides, function (index, slide) { 7955 slide.$slide.removeClass("fancybox-animated").removeClass(function (index, className) { 7956 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 7957 }); 7958 7959 // Make sure that each slide is in equal distance 7960 // This is mostly needed for freshly added slides, because they are not yet positioned 7961 var leftPos = slide.pos * slidePos.width + slide.pos * slide.opts.gutter; 7962 7963 $.fancybox.setTranslate(slide.$slide, { 7964 top: 0, 7965 left: leftPos - stagePos.left + diff 7966 }); 7967 7968 if (slide.pos !== current.pos) { 7969 slide.$slide.addClass("fancybox-slide--" + (slide.pos > current.pos ? "next" : "previous")); 7970 } 7971 7972 // Redraw to make sure that transition will start 7973 forceRedraw(slide.$slide); 7974 7975 // Animate the slide 7976 $.fancybox.animate( 7977 slide.$slide, { 7978 top: 0, 7979 left: (slide.pos - current.pos) * slidePos.width + (slide.pos - current.pos) * slide.opts.gutter 7980 }, 7981 duration, 7982 function () { 7983 slide.$slide 7984 .css({ 7985 transform: "", 7986 opacity: "" 7987 }) 7988 .removeClass("fancybox-slide--next fancybox-slide--previous"); 7989 7990 if (slide.pos === self.currPos) { 7991 self.complete(); 7992 } 7993 } 7994 ); 7995 }); 7996 } else if (duration && current.opts.transitionEffect) { 7997 // Set transition effect for previously active slide 7998 prop = "fancybox-animated fancybox-fx-" + current.opts.transitionEffect; 7999 8000 previous.$slide.addClass("fancybox-slide--" + (previous.pos > current.pos ? "next" : "previous")); 8001 8002 $.fancybox.animate( 8003 previous.$slide, 8004 prop, 8005 duration, 8006 function () { 8007 previous.$slide.removeClass(prop).removeClass("fancybox-slide--next fancybox-slide--previous"); 8008 }, 8009 false 8010 ); 8011 } 8012 8013 if (current.isLoaded) { 8014 self.revealContent(current); 8015 } else { 8016 self.loadSlide(current); 8017 } 8018 8019 self.preload("image"); 8020 }, 8021 8022 // Create new "slide" element 8023 // These are gallery items that are actually added to DOM 8024 // ======================================================= 8025 8026 createSlide: function (pos) { 8027 var self = this, 8028 $slide, 8029 index; 8030 8031 index = pos % self.group.length; 8032 index = index < 0 ? self.group.length + index : index; 8033 8034 if (!self.slides[pos] && self.group[index]) { 8035 $slide = $('<div class="fancybox-slide"></div>').appendTo(self.$refs.stage); 8036 8037 self.slides[pos] = $.extend(true, {}, self.group[index], { 8038 pos: pos, 8039 $slide: $slide, 8040 isLoaded: false 8041 }); 8042 8043 self.updateSlide(self.slides[pos]); 8044 } 8045 8046 return self.slides[pos]; 8047 }, 8048 8049 // Scale image to the actual size of the image; 8050 // x and y values should be relative to the slide 8051 // ============================================== 8052 8053 scaleToActual: function (x, y, duration) { 8054 var self = this, 8055 current = self.current, 8056 $content = current.$content, 8057 canvasWidth = $.fancybox.getTranslate(current.$slide).width, 8058 canvasHeight = $.fancybox.getTranslate(current.$slide).height, 8059 newImgWidth = current.width, 8060 newImgHeight = current.height, 8061 imgPos, 8062 posX, 8063 posY, 8064 scaleX, 8065 scaleY; 8066 8067 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 8068 return; 8069 } 8070 8071 self.isAnimating = true; 8072 8073 $.fancybox.stop($content); 8074 8075 x = x === undefined ? canvasWidth * 0.5 : x; 8076 y = y === undefined ? canvasHeight * 0.5 : y; 8077 8078 imgPos = $.fancybox.getTranslate($content); 8079 8080 imgPos.top -= $.fancybox.getTranslate(current.$slide).top; 8081 imgPos.left -= $.fancybox.getTranslate(current.$slide).left; 8082 8083 scaleX = newImgWidth / imgPos.width; 8084 scaleY = newImgHeight / imgPos.height; 8085 8086 // Get center position for original image 8087 posX = canvasWidth * 0.5 - newImgWidth * 0.5; 8088 posY = canvasHeight * 0.5 - newImgHeight * 0.5; 8089 8090 // Make sure image does not move away from edges 8091 if (newImgWidth > canvasWidth) { 8092 posX = imgPos.left * scaleX - (x * scaleX - x); 8093 8094 if (posX > 0) { 8095 posX = 0; 8096 } 8097 8098 if (posX < canvasWidth - newImgWidth) { 8099 posX = canvasWidth - newImgWidth; 8100 } 8101 } 8102 8103 if (newImgHeight > canvasHeight) { 8104 posY = imgPos.top * scaleY - (y * scaleY - y); 8105 8106 if (posY > 0) { 8107 posY = 0; 8108 } 8109 8110 if (posY < canvasHeight - newImgHeight) { 8111 posY = canvasHeight - newImgHeight; 8112 } 8113 } 8114 8115 self.updateCursor(newImgWidth, newImgHeight); 8116 8117 $.fancybox.animate( 8118 $content, { 8119 top: posY, 8120 left: posX, 8121 scaleX: scaleX, 8122 scaleY: scaleY 8123 }, 8124 duration || 366, 8125 function () { 8126 self.isAnimating = false; 8127 } 8128 ); 8129 8130 // Stop slideshow 8131 if (self.SlideShow && self.SlideShow.isActive) { 8132 self.SlideShow.stop(); 8133 } 8134 }, 8135 8136 // Scale image to fit inside parent element 8137 // ======================================== 8138 8139 scaleToFit: function (duration) { 8140 var self = this, 8141 current = self.current, 8142 $content = current.$content, 8143 end; 8144 8145 if (self.isAnimating || self.isMoved() || !$content || !(current.type == "image" && current.isLoaded && !current.hasError)) { 8146 return; 8147 } 8148 8149 self.isAnimating = true; 8150 8151 $.fancybox.stop($content); 8152 8153 end = self.getFitPos(current); 8154 8155 self.updateCursor(end.width, end.height); 8156 8157 $.fancybox.animate( 8158 $content, { 8159 top: end.top, 8160 left: end.left, 8161 scaleX: end.width / $content.width(), 8162 scaleY: end.height / $content.height() 8163 }, 8164 duration || 366, 8165 function () { 8166 self.isAnimating = false; 8167 } 8168 ); 8169 }, 8170 8171 // Calculate image size to fit inside viewport 8172 // =========================================== 8173 8174 getFitPos: function (slide) { 8175 var self = this, 8176 $content = slide.$content, 8177 $slide = slide.$slide, 8178 width = slide.width || slide.opts.width, 8179 height = slide.height || slide.opts.height, 8180 maxWidth, 8181 maxHeight, 8182 minRatio, 8183 aspectRatio, 8184 rez = {}; 8185 8186 if (!slide.isLoaded || !$content || !$content.length) { 8187 return false; 8188 } 8189 8190 maxWidth = $.fancybox.getTranslate(self.$refs.stage).width; 8191 maxHeight = $.fancybox.getTranslate(self.$refs.stage).height; 8192 8193 maxWidth -= 8194 parseFloat($slide.css("paddingLeft")) + 8195 parseFloat($slide.css("paddingRight")) + 8196 parseFloat($content.css("marginLeft")) + 8197 parseFloat($content.css("marginRight")); 8198 8199 maxHeight -= 8200 parseFloat($slide.css("paddingTop")) + 8201 parseFloat($slide.css("paddingBottom")) + 8202 parseFloat($content.css("marginTop")) + 8203 parseFloat($content.css("marginBottom")); 8204 8205 if (!width || !height) { 8206 width = maxWidth; 8207 height = maxHeight; 8208 } 8209 8210 minRatio = Math.min(1, maxWidth / width, maxHeight / height); 8211 8212 width = minRatio * width; 8213 height = minRatio * height; 8214 8215 // Adjust width/height to precisely fit into container 8216 if (width > maxWidth - 0.5) { 8217 width = maxWidth; 8218 } 8219 8220 if (height > maxHeight - 0.5) { 8221 height = maxHeight; 8222 } 8223 8224 if (slide.type === "image") { 8225 rez.top = Math.floor((maxHeight - height) * 0.5) + parseFloat($slide.css("paddingTop")); 8226 rez.left = Math.floor((maxWidth - width) * 0.5) + parseFloat($slide.css("paddingLeft")); 8227 } else if (slide.contentType === "video") { 8228 // Force aspect ratio for the video 8229 // "I say the whole world must learn of our peaceful ways… by force!" 8230 aspectRatio = slide.opts.width && slide.opts.height ? width / height : slide.opts.ratio || 16 / 9; 8231 8232 if (height > width / aspectRatio) { 8233 height = width / aspectRatio; 8234 } else if (width > height * aspectRatio) { 8235 width = height * aspectRatio; 8236 } 8237 } 8238 8239 rez.width = width; 8240 rez.height = height; 8241 8242 return rez; 8243 }, 8244 8245 // Update content size and position for all slides 8246 // ============================================== 8247 8248 update: function (e) { 8249 var self = this; 8250 8251 $.each(self.slides, function (key, slide) { 8252 self.updateSlide(slide, e); 8253 }); 8254 }, 8255 8256 // Update slide content position and size 8257 // ====================================== 8258 8259 updateSlide: function (slide, e) { 8260 var self = this, 8261 $content = slide && slide.$content, 8262 width = slide.width || slide.opts.width, 8263 height = slide.height || slide.opts.height, 8264 $slide = slide.$slide; 8265 8266 // First, prevent caption overlap, if needed 8267 self.adjustCaption(slide); 8268 8269 // Then resize content to fit inside the slide 8270 if ($content && (width || height || slide.contentType === "video") && !slide.hasError) { 8271 $.fancybox.stop($content); 8272 8273 $.fancybox.setTranslate($content, self.getFitPos(slide)); 8274 8275 if (slide.pos === self.currPos) { 8276 self.isAnimating = false; 8277 8278 self.updateCursor(); 8279 } 8280 } 8281 8282 // Then some adjustments 8283 self.adjustLayout(slide); 8284 8285 if ($slide.length) { 8286 $slide.trigger("refresh"); 8287 8288 if (slide.pos === self.currPos) { 8289 self.$refs.toolbar 8290 .add(self.$refs.navigation.find(".fancybox-button--arrow_right")) 8291 .toggleClass("compensate-for-scrollbar", $slide.get(0).scrollHeight > $slide.get(0).clientHeight); 8292 } 8293 } 8294 8295 self.trigger("onUpdate", slide, e); 8296 }, 8297 8298 // Horizontally center slide 8299 // ========================= 8300 8301 centerSlide: function (duration) { 8302 var self = this, 8303 current = self.current, 8304 $slide = current.$slide; 8305 8306 if (self.isClosing || !current) { 8307 return; 8308 } 8309 8310 $slide.siblings().css({ 8311 transform: "", 8312 opacity: "" 8313 }); 8314 8315 $slide 8316 .parent() 8317 .children() 8318 .removeClass("fancybox-slide--previous fancybox-slide--next"); 8319 8320 $.fancybox.animate( 8321 $slide, { 8322 top: 0, 8323 left: 0, 8324 opacity: 1 8325 }, 8326 duration === undefined ? 0 : duration, 8327 function () { 8328 // Clean up 8329 $slide.css({ 8330 transform: "", 8331 opacity: "" 8332 }); 8333 8334 if (!current.isComplete) { 8335 self.complete(); 8336 } 8337 }, 8338 false 8339 ); 8340 }, 8341 8342 // Check if current slide is moved (swiped) 8343 // ======================================== 8344 8345 isMoved: function (slide) { 8346 var current = slide || this.current, 8347 slidePos, 8348 stagePos; 8349 8350 if (!current) { 8351 return false; 8352 } 8353 8354 stagePos = $.fancybox.getTranslate(this.$refs.stage); 8355 slidePos = $.fancybox.getTranslate(current.$slide); 8356 8357 return ( 8358 !current.$slide.hasClass("fancybox-animated") && 8359 (Math.abs(slidePos.top - stagePos.top) > 0.5 || Math.abs(slidePos.left - stagePos.left) > 0.5) 8360 ); 8361 }, 8362 8363 // Update cursor style depending if content can be zoomed 8364 // ====================================================== 8365 8366 updateCursor: function (nextWidth, nextHeight) { 8367 var self = this, 8368 current = self.current, 8369 $container = self.$refs.container, 8370 canPan, 8371 isZoomable; 8372 8373 if (!current || self.isClosing || !self.Guestures) { 8374 return; 8375 } 8376 8377 $container.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"); 8378 8379 canPan = self.canPan(nextWidth, nextHeight); 8380 8381 isZoomable = canPan ? true : self.isZoomable(); 8382 8383 $container.toggleClass("fancybox-is-zoomable", isZoomable); 8384 8385 $("[data-fancybox-zoom]").prop("disabled", !isZoomable); 8386 8387 if (canPan) { 8388 $container.addClass("fancybox-can-pan"); 8389 } else if ( 8390 isZoomable && 8391 (current.opts.clickContent === "zoom" || ($.isFunction(current.opts.clickContent) && current.opts.clickContent(current) == "zoom")) 8392 ) { 8393 $container.addClass("fancybox-can-zoomIn"); 8394 } else if (current.opts.touch && (current.opts.touch.vertical || self.group.length > 1) && current.contentType !== "video") { 8395 $container.addClass("fancybox-can-swipe"); 8396 } 8397 }, 8398 8399 // Check if current slide is zoomable 8400 // ================================== 8401 8402 isZoomable: function () { 8403 var self = this, 8404 current = self.current, 8405 fitPos; 8406 8407 // Assume that slide is zoomable if: 8408 // - image is still loading 8409 // - actual size of the image is smaller than available area 8410 if (current && !self.isClosing && current.type === "image" && !current.hasError) { 8411 if (!current.isLoaded) { 8412 return true; 8413 } 8414 8415 fitPos = self.getFitPos(current); 8416 8417 if (fitPos && (current.width > fitPos.width || current.height > fitPos.height)) { 8418 return true; 8419 } 8420 } 8421 8422 return false; 8423 }, 8424 8425 // Check if current image dimensions are smaller than actual 8426 // ========================================================= 8427 8428 isScaledDown: function (nextWidth, nextHeight) { 8429 var self = this, 8430 rez = false, 8431 current = self.current, 8432 $content = current.$content; 8433 8434 if (nextWidth !== undefined && nextHeight !== undefined) { 8435 rez = nextWidth < current.width && nextHeight < current.height; 8436 } else if ($content) { 8437 rez = $.fancybox.getTranslate($content); 8438 rez = rez.width < current.width && rez.height < current.height; 8439 } 8440 8441 return rez; 8442 }, 8443 8444 // Check if image dimensions exceed parent element 8445 // =============================================== 8446 8447 canPan: function (nextWidth, nextHeight) { 8448 var self = this, 8449 current = self.current, 8450 pos = null, 8451 rez = false; 8452 8453 if (current.type === "image" && (current.isComplete || (nextWidth && nextHeight)) && !current.hasError) { 8454 rez = self.getFitPos(current); 8455 8456 if (nextWidth !== undefined && nextHeight !== undefined) { 8457 pos = { 8458 width: nextWidth, 8459 height: nextHeight 8460 }; 8461 } else if (current.isComplete) { 8462 pos = $.fancybox.getTranslate(current.$content); 8463 } 8464 8465 if (pos && rez) { 8466 rez = Math.abs(pos.width - rez.width) > 1.5 || Math.abs(pos.height - rez.height) > 1.5; 8467 } 8468 } 8469 8470 return rez; 8471 }, 8472 8473 // Load content into the slide 8474 // =========================== 8475 8476 loadSlide: function (slide) { 8477 var self = this, 8478 type, 8479 $slide, 8480 ajaxLoad; 8481 8482 if (slide.isLoading || slide.isLoaded) { 8483 return; 8484 } 8485 8486 slide.isLoading = true; 8487 8488 if (self.trigger("beforeLoad", slide) === false) { 8489 slide.isLoading = false; 8490 8491 return false; 8492 } 8493 8494 type = slide.type; 8495 $slide = slide.$slide; 8496 8497 $slide 8498 .off("refresh") 8499 .trigger("onReset") 8500 .addClass(slide.opts.slideClass); 8501 8502 // Create content depending on the type 8503 switch (type) { 8504 case "image": 8505 self.setImage(slide); 8506 8507 break; 8508 8509 case "iframe": 8510 self.setIframe(slide); 8511 8512 break; 8513 8514 case "html": 8515 self.setContent(slide, slide.src || slide.content); 8516 8517 break; 8518 8519 case "video": 8520 self.setContent( 8521 slide, 8522 slide.opts.video.tpl 8523 .replace(/\{\{src\}\}/gi, slide.src) 8524 .replace("{{format}}", slide.opts.videoFormat || slide.opts.video.format || "") 8525 .replace("{{poster}}", slide.thumb || "") 8526 ); 8527 8528 break; 8529 8530 case "inline": 8531 if ($(slide.src).length) { 8532 self.setContent(slide, $(slide.src)); 8533 } else { 8534 self.setError(slide); 8535 } 8536 8537 break; 8538 8539 case "ajax": 8540 self.showLoading(slide); 8541 8542 ajaxLoad = $.ajax( 8543 $.extend({}, slide.opts.ajax.settings, { 8544 url: slide.src, 8545 success: function (data, textStatus) { 8546 if (textStatus === "success") { 8547 self.setContent(slide, data); 8548 } 8549 }, 8550 error: function (jqXHR, textStatus) { 8551 if (jqXHR && textStatus !== "abort") { 8552 self.setError(slide); 8553 } 8554 } 8555 }) 8556 ); 8557 8558 $slide.one("onReset", function () { 8559 ajaxLoad.abort(); 8560 }); 8561 8562 break; 8563 8564 default: 8565 self.setError(slide); 8566 8567 break; 8568 } 8569 8570 return true; 8571 }, 8572 8573 // Use thumbnail image, if possible 8574 // ================================ 8575 8576 setImage: function (slide) { 8577 var self = this, 8578 ghost; 8579 8580 // Check if need to show loading icon 8581 setTimeout(function () { 8582 var $img = slide.$image; 8583 8584 if (!self.isClosing && slide.isLoading && (!$img || !$img.length || !$img[0].complete) && !slide.hasError) { 8585 self.showLoading(slide); 8586 } 8587 }, 50); 8588 8589 //Check if image has srcset 8590 self.checkSrcset(slide); 8591 8592 // This will be wrapper containing both ghost and actual image 8593 slide.$content = $('<div class="fancybox-content"></div>') 8594 .addClass("fancybox-is-hidden") 8595 .appendTo(slide.$slide.addClass("fancybox-slide--image")); 8596 8597 // If we have a thumbnail, we can display it while actual image is loading 8598 // Users will not stare at black screen and actual image will appear gradually 8599 if (slide.opts.preload !== false && slide.opts.width && slide.opts.height && slide.thumb) { 8600 slide.width = slide.opts.width; 8601 slide.height = slide.opts.height; 8602 8603 ghost = document.createElement("img"); 8604 8605 ghost.onerror = function () { 8606 $(this).remove(); 8607 8608 slide.$ghost = null; 8609 }; 8610 8611 ghost.onload = function () { 8612 self.afterLoad(slide); 8613 }; 8614 8615 slide.$ghost = $(ghost) 8616 .addClass("fancybox-image") 8617 .appendTo(slide.$content) 8618 .attr("src", slide.thumb); 8619 } 8620 8621 // Start loading actual image 8622 self.setBigImage(slide); 8623 }, 8624 8625 // Check if image has srcset and get the source 8626 // ============================================ 8627 checkSrcset: function (slide) { 8628 var srcset = slide.opts.srcset || slide.opts.image.srcset, 8629 found, 8630 temp, 8631 pxRatio, 8632 windowWidth; 8633 8634 // If we have "srcset", then we need to find first matching "src" value. 8635 // This is necessary, because when you set an src attribute, the browser will preload the image 8636 // before any javascript or even CSS is applied. 8637 if (srcset) { 8638 pxRatio = window.devicePixelRatio || 1; 8639 windowWidth = window.innerWidth * pxRatio; 8640 8641 temp = srcset.split(",").map(function (el) { 8642 var ret = {}; 8643 8644 el.trim() 8645 .split(/\s+/) 8646 .forEach(function (el, i) { 8647 var value = parseInt(el.substring(0, el.length - 1), 10); 8648 8649 if (i === 0) { 8650 return (ret.url = el); 8651 } 8652 8653 if (value) { 8654 ret.value = value; 8655 ret.postfix = el[el.length - 1]; 8656 } 8657 }); 8658 8659 return ret; 8660 }); 8661 8662 // Sort by value 8663 temp.sort(function (a, b) { 8664 return a.value - b.value; 8665 }); 8666 8667 // Ok, now we have an array of all srcset values 8668 for (var j = 0; j < temp.length; j++) { 8669 var el = temp[j]; 8670 8671 if ((el.postfix === "w" && el.value >= windowWidth) || (el.postfix === "x" && el.value >= pxRatio)) { 8672 found = el; 8673 break; 8674 } 8675 } 8676 8677 // If not found, take the last one 8678 if (!found && temp.length) { 8679 found = temp[temp.length - 1]; 8680 } 8681 8682 if (found) { 8683 slide.src = found.url; 8684 8685 // If we have default width/height values, we can calculate height for matching source 8686 if (slide.width && slide.height && found.postfix == "w") { 8687 slide.height = (slide.width / slide.height) * found.value; 8688 slide.width = found.value; 8689 } 8690 8691 slide.opts.srcset = srcset; 8692 } 8693 } 8694 }, 8695 8696 // Create full-size image 8697 // ====================== 8698 8699 setBigImage: function (slide) { 8700 var self = this, 8701 img = document.createElement("img"), 8702 $img = $(img); 8703 8704 slide.$image = $img 8705 .one("error", function () { 8706 self.setError(slide); 8707 }) 8708 .one("load", function () { 8709 var sizes; 8710 8711 if (!slide.$ghost) { 8712 self.resolveImageSlideSize(slide, this.naturalWidth, this.naturalHeight); 8713 8714 self.afterLoad(slide); 8715 } 8716 8717 if (self.isClosing) { 8718 return; 8719 } 8720 8721 if (slide.opts.srcset) { 8722 sizes = slide.opts.sizes; 8723 8724 if (!sizes || sizes === "auto") { 8725 sizes = 8726 (slide.width / slide.height > 1 && $W.width() / $W.height() > 1 ? "100" : Math.round((slide.width / slide.height) * 100)) + 8727 "vw"; 8728 } 8729 8730 $img.attr("sizes", sizes).attr("srcset", slide.opts.srcset); 8731 } 8732 8733 // Hide temporary image after some delay 8734 if (slide.$ghost) { 8735 setTimeout(function () { 8736 if (slide.$ghost && !self.isClosing) { 8737 slide.$ghost.hide(); 8738 } 8739 }, Math.min(300, Math.max(1000, slide.height / 1600))); 8740 } 8741 8742 self.hideLoading(slide); 8743 }) 8744 .addClass("fancybox-image") 8745 .attr("src", slide.src) 8746 .appendTo(slide.$content); 8747 8748 if ((img.complete || img.readyState == "complete") && $img.naturalWidth && $img.naturalHeight) { 8749 $img.trigger("load"); 8750 } else if (img.error) { 8751 $img.trigger("error"); 8752 } 8753 }, 8754 8755 // Computes the slide size from image size and maxWidth/maxHeight 8756 // ============================================================== 8757 8758 resolveImageSlideSize: function (slide, imgWidth, imgHeight) { 8759 var maxWidth = parseInt(slide.opts.width, 10), 8760 maxHeight = parseInt(slide.opts.height, 10); 8761 8762 // Sets the default values from the image 8763 slide.width = imgWidth; 8764 slide.height = imgHeight; 8765 8766 if (maxWidth > 0) { 8767 slide.width = maxWidth; 8768 slide.height = Math.floor((maxWidth * imgHeight) / imgWidth); 8769 } 8770 8771 if (maxHeight > 0) { 8772 slide.width = Math.floor((maxHeight * imgWidth) / imgHeight); 8773 slide.height = maxHeight; 8774 } 8775 }, 8776 8777 // Create iframe wrapper, iframe and bindings 8778 // ========================================== 8779 8780 setIframe: function (slide) { 8781 var self = this, 8782 opts = slide.opts.iframe, 8783 $slide = slide.$slide, 8784 $iframe; 8785 8786 slide.$content = $('<div class="fancybox-content' + (opts.preload ? " fancybox-is-hidden" : "") + '"></div>') 8787 .css(opts.css) 8788 .appendTo($slide); 8789 8790 $slide.addClass("fancybox-slide--" + slide.contentType); 8791 8792 slide.$iframe = $iframe = $(opts.tpl.replace(/\{rnd\}/g, new Date().getTime())) 8793 .attr(opts.attr) 8794 .appendTo(slide.$content); 8795 8796 if (opts.preload) { 8797 self.showLoading(slide); 8798 8799 // Unfortunately, it is not always possible to determine if iframe is successfully loaded 8800 // (due to browser security policy) 8801 8802 $iframe.on("load.fb error.fb", function (e) { 8803 this.isReady = 1; 8804 8805 slide.$slide.trigger("refresh"); 8806 8807 self.afterLoad(slide); 8808 }); 8809 8810 // Recalculate iframe content size 8811 // =============================== 8812 8813 $slide.on("refresh.fb", function () { 8814 var $content = slide.$content, 8815 frameWidth = opts.css.width, 8816 frameHeight = opts.css.height, 8817 $contents, 8818 $body; 8819 8820 if ($iframe[0].isReady !== 1) { 8821 return; 8822 } 8823 8824 try { 8825 $contents = $iframe.contents(); 8826 $body = $contents.find("body"); 8827 } catch (ignore) {} 8828 8829 // Calculate content dimensions, if it is accessible 8830 if ($body && $body.length && $body.children().length) { 8831 // Avoid scrolling to top (if multiple instances) 8832 $slide.css("overflow", "visible"); 8833 8834 $content.css({ 8835 width: "100%", 8836 "max-width": "100%", 8837 height: "9999px" 8838 }); 8839 8840 if (frameWidth === undefined) { 8841 frameWidth = Math.ceil(Math.max($body[0].clientWidth, $body.outerWidth(true))); 8842 } 8843 8844 $content.css("width", frameWidth ? frameWidth : "").css("max-width", ""); 8845 8846 if (frameHeight === undefined) { 8847 frameHeight = Math.ceil(Math.max($body[0].clientHeight, $body.outerHeight(true))); 8848 } 8849 8850 $content.css("height", frameHeight ? frameHeight : ""); 8851 8852 $slide.css("overflow", "auto"); 8853 } 8854 8855 $content.removeClass("fancybox-is-hidden"); 8856 }); 8857 } else { 8858 self.afterLoad(slide); 8859 } 8860 8861 $iframe.attr("src", slide.src); 8862 8863 // Remove iframe if closing or changing gallery item 8864 $slide.one("onReset", function () { 8865 // This helps IE not to throw errors when closing 8866 try { 8867 $(this) 8868 .find("iframe") 8869 .hide() 8870 .unbind() 8871 .attr("src", "//about:blank"); 8872 } catch (ignore) {} 8873 8874 $(this) 8875 .off("refresh.fb") 8876 .empty(); 8877 8878 slide.isLoaded = false; 8879 slide.isRevealed = false; 8880 }); 8881 }, 8882 8883 // Wrap and append content to the slide 8884 // ====================================== 8885 8886 setContent: function (slide, content) { 8887 var self = this; 8888 8889 if (self.isClosing) { 8890 return; 8891 } 8892 8893 self.hideLoading(slide); 8894 8895 if (slide.$content) { 8896 $.fancybox.stop(slide.$content); 8897 } 8898 8899 slide.$slide.empty(); 8900 8901 // If content is a jQuery object, then it will be moved to the slide. 8902 // The placeholder is created so we will know where to put it back. 8903 if (isQuery(content) && content.parent().length) { 8904 // Make sure content is not already moved to fancyBox 8905 if (content.hasClass("fancybox-content") || content.parent().hasClass("fancybox-content")) { 8906 content.parents(".fancybox-slide").trigger("onReset"); 8907 } 8908 8909 // Create temporary element marking original place of the content 8910 slide.$placeholder = $("<div>") 8911 .hide() 8912 .insertAfter(content); 8913 8914 // Make sure content is visible 8915 content.css("display", "inline-block"); 8916 } else if (!slide.hasError) { 8917 // If content is just a plain text, try to convert it to html 8918 if ($.type(content) === "string") { 8919 content = $("<div>") 8920 .append($.trim(content)) 8921 .contents(); 8922 } 8923 8924 // If "filter" option is provided, then filter content 8925 if (slide.opts.filter) { 8926 content = $("<div>") 8927 .html(content) 8928 .find(slide.opts.filter); 8929 } 8930 } 8931 8932 slide.$slide.one("onReset", function () { 8933 // Pause all html5 video/audio 8934 $(this) 8935 .find("video,audio") 8936 .trigger("pause"); 8937 8938 // Put content back 8939 if (slide.$placeholder) { 8940 slide.$placeholder.after(content.removeClass("fancybox-content").hide()).remove(); 8941 8942 slide.$placeholder = null; 8943 } 8944 8945 // Remove custom close button 8946 if (slide.$smallBtn) { 8947 slide.$smallBtn.remove(); 8948 8949 slide.$smallBtn = null; 8950 } 8951 8952 // Remove content and mark slide as not loaded 8953 if (!slide.hasError) { 8954 $(this).empty(); 8955 8956 slide.isLoaded = false; 8957 slide.isRevealed = false; 8958 } 8959 }); 8960 8961 $(content).appendTo(slide.$slide); 8962 8963 if ($(content).is("video,audio")) { 8964 $(content).addClass("fancybox-video"); 8965 8966 $(content).wrap("<div></div>"); 8967 8968 slide.contentType = "video"; 8969 8970 slide.opts.width = slide.opts.width || $(content).attr("width"); 8971 slide.opts.height = slide.opts.height || $(content).attr("height"); 8972 } 8973 8974 slide.$content = slide.$slide 8975 .children() 8976 .filter("div,form,main,video,audio,article,.fancybox-content") 8977 .first(); 8978 8979 slide.$content.siblings().hide(); 8980 8981 // Re-check if there is a valid content 8982 // (in some cases, ajax response can contain various elements or plain text) 8983 if (!slide.$content.length) { 8984 slide.$content = slide.$slide 8985 .wrapInner("<div></div>") 8986 .children() 8987 .first(); 8988 } 8989 8990 slide.$content.addClass("fancybox-content"); 8991 8992 slide.$slide.addClass("fancybox-slide--" + slide.contentType); 8993 8994 self.afterLoad(slide); 8995 }, 8996 8997 // Display error message 8998 // ===================== 8999 9000 setError: function (slide) { 9001 slide.hasError = true; 9002 9003 slide.$slide 9004 .trigger("onReset") 9005 .removeClass("fancybox-slide--" + slide.contentType) 9006 .addClass("fancybox-slide--error"); 9007 9008 slide.contentType = "html"; 9009 9010 this.setContent(slide, this.translate(slide, slide.opts.errorTpl)); 9011 9012 if (slide.pos === this.currPos) { 9013 this.isAnimating = false; 9014 } 9015 }, 9016 9017 // Show loading icon inside the slide 9018 // ================================== 9019 9020 showLoading: function (slide) { 9021 var self = this; 9022 9023 slide = slide || self.current; 9024 9025 if (slide && !slide.$spinner) { 9026 slide.$spinner = $(self.translate(self, self.opts.spinnerTpl)) 9027 .appendTo(slide.$slide) 9028 .hide() 9029 .fadeIn("fast"); 9030 } 9031 }, 9032 9033 // Remove loading icon from the slide 9034 // ================================== 9035 9036 hideLoading: function (slide) { 9037 var self = this; 9038 9039 slide = slide || self.current; 9040 9041 if (slide && slide.$spinner) { 9042 slide.$spinner.stop().remove(); 9043 9044 delete slide.$spinner; 9045 } 9046 }, 9047 9048 // Adjustments after slide content has been loaded 9049 // =============================================== 9050 9051 afterLoad: function (slide) { 9052 var self = this; 9053 9054 if (self.isClosing) { 9055 return; 9056 } 9057 9058 slide.isLoading = false; 9059 slide.isLoaded = true; 9060 9061 self.trigger("afterLoad", slide); 9062 9063 self.hideLoading(slide); 9064 9065 // Add small close button 9066 if (slide.opts.smallBtn && (!slide.$smallBtn || !slide.$smallBtn.length)) { 9067 slide.$smallBtn = $(self.translate(slide, slide.opts.btnTpl.smallBtn)).appendTo(slide.$content); 9068 } 9069 9070 // Disable right click 9071 if (slide.opts.protect && slide.$content && !slide.hasError) { 9072 slide.$content.on("contextmenu.fb", function (e) { 9073 if (e.button == 2) { 9074 e.preventDefault(); 9075 } 9076 9077 return true; 9078 }); 9079 9080 // Add fake element on top of the image 9081 // This makes a bit harder for user to select image 9082 if (slide.type === "image") { 9083 $('<div class="fancybox-spaceball"></div>').appendTo(slide.$content); 9084 } 9085 } 9086 9087 self.adjustCaption(slide); 9088 9089 self.adjustLayout(slide); 9090 9091 if (slide.pos === self.currPos) { 9092 self.updateCursor(); 9093 } 9094 9095 self.revealContent(slide); 9096 }, 9097 9098 // Prevent caption overlap, 9099 // fix css inconsistency across browsers 9100 // ===================================== 9101 9102 adjustCaption: function (slide) { 9103 var self = this, 9104 current = slide || self.current, 9105 caption = current.opts.caption, 9106 preventOverlap = current.opts.preventCaptionOverlap, 9107 $caption = self.$refs.caption, 9108 $clone, 9109 captionH = false; 9110 9111 $caption.toggleClass("fancybox-caption--separate", preventOverlap); 9112 9113 if (preventOverlap && caption && caption.length) { 9114 if (current.pos !== self.currPos) { 9115 $clone = $caption.clone().appendTo($caption.parent()); 9116 9117 $clone 9118 .children() 9119 .eq(0) 9120 .empty() 9121 .html(caption); 9122 9123 captionH = $clone.outerHeight(true); 9124 9125 $clone.empty().remove(); 9126 } else if (self.$caption) { 9127 captionH = self.$caption.outerHeight(true); 9128 } 9129 9130 current.$slide.css("padding-bottom", captionH || ""); 9131 } 9132 }, 9133 9134 // Simple hack to fix inconsistency across browsers, described here (affects Edge, too): 9135 // https://bugzilla.mozilla.org/show_bug.cgi?id=748518 9136 // ==================================================================================== 9137 9138 adjustLayout: function (slide) { 9139 var self = this, 9140 current = slide || self.current, 9141 scrollHeight, 9142 marginBottom, 9143 inlinePadding, 9144 actualPadding; 9145 9146 if (current.isLoaded && current.opts.disableLayoutFix !== true) { 9147 current.$content.css("margin-bottom", ""); 9148 9149 // If we would always set margin-bottom for the content, 9150 // then it would potentially break vertical align 9151 if (current.$content.outerHeight() > current.$slide.height() + 0.5) { 9152 inlinePadding = current.$slide[0].style["padding-bottom"]; 9153 actualPadding = current.$slide.css("padding-bottom"); 9154 9155 if (parseFloat(actualPadding) > 0) { 9156 scrollHeight = current.$slide[0].scrollHeight; 9157 9158 current.$slide.css("padding-bottom", 0); 9159 9160 if (Math.abs(scrollHeight - current.$slide[0].scrollHeight) < 1) { 9161 marginBottom = actualPadding; 9162 } 9163 9164 current.$slide.css("padding-bottom", inlinePadding); 9165 } 9166 } 9167 9168 current.$content.css("margin-bottom", marginBottom); 9169 } 9170 }, 9171 9172 // Make content visible 9173 // This method is called right after content has been loaded or 9174 // user navigates gallery and transition should start 9175 // ============================================================ 9176 9177 revealContent: function (slide) { 9178 var self = this, 9179 $slide = slide.$slide, 9180 end = false, 9181 start = false, 9182 isMoved = self.isMoved(slide), 9183 isRevealed = slide.isRevealed, 9184 effect, 9185 effectClassName, 9186 duration, 9187 opacity; 9188 9189 slide.isRevealed = true; 9190 9191 effect = slide.opts[self.firstRun ? "animationEffect" : "transitionEffect"]; 9192 duration = slide.opts[self.firstRun ? "animationDuration" : "transitionDuration"]; 9193 9194 duration = parseInt(slide.forcedDuration === undefined ? duration : slide.forcedDuration, 10); 9195 9196 if (isMoved || slide.pos !== self.currPos || !duration) { 9197 effect = false; 9198 } 9199 9200 // Check if can zoom 9201 if (effect === "zoom") { 9202 if (slide.pos === self.currPos && duration && slide.type === "image" && !slide.hasError && (start = self.getThumbPos(slide))) { 9203 end = self.getFitPos(slide); 9204 } else { 9205 effect = "fade"; 9206 } 9207 } 9208 9209 // Zoom animation 9210 // ============== 9211 if (effect === "zoom") { 9212 self.isAnimating = true; 9213 9214 end.scaleX = end.width / start.width; 9215 end.scaleY = end.height / start.height; 9216 9217 // Check if we need to animate opacity 9218 opacity = slide.opts.zoomOpacity; 9219 9220 if (opacity == "auto") { 9221 opacity = Math.abs(slide.width / slide.height - start.width / start.height) > 0.1; 9222 } 9223 9224 if (opacity) { 9225 start.opacity = 0.1; 9226 end.opacity = 1; 9227 } 9228 9229 // Draw image at start position 9230 $.fancybox.setTranslate(slide.$content.removeClass("fancybox-is-hidden"), start); 9231 9232 forceRedraw(slide.$content); 9233 9234 // Start animation 9235 $.fancybox.animate(slide.$content, end, duration, function () { 9236 self.isAnimating = false; 9237 9238 self.complete(); 9239 }); 9240 9241 return; 9242 } 9243 9244 self.updateSlide(slide); 9245 9246 // Simply show content if no effect 9247 // ================================ 9248 if (!effect) { 9249 slide.$content.removeClass("fancybox-is-hidden"); 9250 9251 if (!isRevealed && isMoved && slide.type === "image" && !slide.hasError) { 9252 slide.$content.hide().fadeIn("fast"); 9253 } 9254 9255 if (slide.pos === self.currPos) { 9256 self.complete(); 9257 } 9258 9259 return; 9260 } 9261 9262 // Prepare for CSS transiton 9263 // ========================= 9264 $.fancybox.stop($slide); 9265 9266 //effectClassName = "fancybox-animated fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-fx-" + effect; 9267 effectClassName = "fancybox-slide--" + (slide.pos >= self.prevPos ? "next" : "previous") + " fancybox-animated fancybox-fx-" + effect; 9268 9269 $slide.addClass(effectClassName).removeClass("fancybox-slide--current"); //.addClass(effectClassName); 9270 9271 slide.$content.removeClass("fancybox-is-hidden"); 9272 9273 // Force reflow 9274 forceRedraw($slide); 9275 9276 if (slide.type !== "image") { 9277 slide.$content.hide().show(0); 9278 } 9279 9280 $.fancybox.animate( 9281 $slide, 9282 "fancybox-slide--current", 9283 duration, 9284 function () { 9285 $slide.removeClass(effectClassName).css({ 9286 transform: "", 9287 opacity: "" 9288 }); 9289 9290 if (slide.pos === self.currPos) { 9291 self.complete(); 9292 } 9293 }, 9294 true 9295 ); 9296 }, 9297 9298 // Check if we can and have to zoom from thumbnail 9299 //================================================ 9300 9301 getThumbPos: function (slide) { 9302 var rez = false, 9303 $thumb = slide.$thumb, 9304 thumbPos, 9305 btw, 9306 brw, 9307 bbw, 9308 blw; 9309 9310 if (!$thumb || !inViewport($thumb[0])) { 9311 return false; 9312 } 9313 9314 thumbPos = $.fancybox.getTranslate($thumb); 9315 9316 btw = parseFloat($thumb.css("border-top-width") || 0); 9317 brw = parseFloat($thumb.css("border-right-width") || 0); 9318 bbw = parseFloat($thumb.css("border-bottom-width") || 0); 9319 blw = parseFloat($thumb.css("border-left-width") || 0); 9320 9321 rez = { 9322 top: thumbPos.top + btw, 9323 left: thumbPos.left + blw, 9324 width: thumbPos.width - brw - blw, 9325 height: thumbPos.height - btw - bbw, 9326 scaleX: 1, 9327 scaleY: 1 9328 }; 9329 9330 return thumbPos.width > 0 && thumbPos.height > 0 ? rez : false; 9331 }, 9332 9333 // Final adjustments after current gallery item is moved to position 9334 // and it`s content is loaded 9335 // ================================================================== 9336 9337 complete: function () { 9338 var self = this, 9339 current = self.current, 9340 slides = {}, 9341 $el; 9342 9343 if (self.isMoved() || !current.isLoaded) { 9344 return; 9345 } 9346 9347 if (!current.isComplete) { 9348 current.isComplete = true; 9349 9350 current.$slide.siblings().trigger("onReset"); 9351 9352 self.preload("inline"); 9353 9354 // Trigger any CSS transiton inside the slide 9355 forceRedraw(current.$slide); 9356 9357 current.$slide.addClass("fancybox-slide--complete"); 9358 9359 // Remove unnecessary slides 9360 $.each(self.slides, function (key, slide) { 9361 if (slide.pos >= self.currPos - 1 && slide.pos <= self.currPos + 1) { 9362 slides[slide.pos] = slide; 9363 } else if (slide) { 9364 $.fancybox.stop(slide.$slide); 9365 9366 slide.$slide.off().remove(); 9367 } 9368 }); 9369 9370 self.slides = slides; 9371 } 9372 9373 self.isAnimating = false; 9374 9375 self.updateCursor(); 9376 9377 self.trigger("afterShow"); 9378 9379 // Autoplay first html5 video/audio 9380 if (!!current.opts.video.autoStart) { 9381 current.$slide 9382 .find("video,audio") 9383 .filter(":visible:first") 9384 .trigger("play") 9385 .one("ended", function () { 9386 if (Document.exitFullscreen) { 9387 Document.exitFullscreen(); 9388 } else if (this.webkitExitFullscreen) { 9389 this.webkitExitFullscreen(); 9390 } 9391 9392 self.next(); 9393 }); 9394 } 9395 9396 // Try to focus on the first focusable element 9397 if (current.opts.autoFocus && current.contentType === "html") { 9398 // Look for the first input with autofocus attribute 9399 $el = current.$content.find("input[autofocus]:enabled:visible:first"); 9400 9401 if ($el.length) { 9402 $el.trigger("focus"); 9403 } else { 9404 self.focus(null, true); 9405 } 9406 } 9407 9408 // Avoid jumping 9409 current.$slide.scrollTop(0).scrollLeft(0); 9410 }, 9411 9412 // Preload next and previous slides 9413 // ================================ 9414 9415 preload: function (type) { 9416 var self = this, 9417 prev, 9418 next; 9419 9420 if (self.group.length < 2) { 9421 return; 9422 } 9423 9424 next = self.slides[self.currPos + 1]; 9425 prev = self.slides[self.currPos - 1]; 9426 9427 if (prev && prev.type === type) { 9428 self.loadSlide(prev); 9429 } 9430 9431 if (next && next.type === type) { 9432 self.loadSlide(next); 9433 } 9434 }, 9435 9436 // Try to find and focus on the first focusable element 9437 // ==================================================== 9438 9439 focus: function (e, firstRun) { 9440 var self = this, 9441 focusableStr = [ 9442 "a[href]", 9443 "area[href]", 9444 'input:not([disabled]):not([type="hidden"]):not([aria-hidden])', 9445 "select:not([disabled]):not([aria-hidden])", 9446 "textarea:not([disabled]):not([aria-hidden])", 9447 "button:not([disabled]):not([aria-hidden])", 9448 "iframe", 9449 "object", 9450 "embed", 9451 "video", 9452 "audio", 9453 "[contenteditable]", 9454 '[tabindex]:not([tabindex^="-"])' 9455 ].join(","), 9456 focusableItems, 9457 focusedItemIndex; 9458 9459 if (self.isClosing) { 9460 return; 9461 } 9462 9463 if (e || !self.current || !self.current.isComplete) { 9464 // Focus on any element inside fancybox 9465 focusableItems = self.$refs.container.find("*:visible"); 9466 } else { 9467 // Focus inside current slide 9468 focusableItems = self.current.$slide.find("*:visible" + (firstRun ? ":not(.fancybox-close-small)" : "")); 9469 } 9470 9471 focusableItems = focusableItems.filter(focusableStr).filter(function () { 9472 return $(this).css("visibility") !== "hidden" && !$(this).hasClass("disabled"); 9473 }); 9474 9475 if (focusableItems.length) { 9476 focusedItemIndex = focusableItems.index(document.activeElement); 9477 9478 if (e && e.shiftKey) { 9479 // Back tab 9480 if (focusedItemIndex < 0 || focusedItemIndex == 0) { 9481 e.preventDefault(); 9482 9483 focusableItems.eq(focusableItems.length - 1).trigger("focus"); 9484 } 9485 } else { 9486 // Outside or Forward tab 9487 if (focusedItemIndex < 0 || focusedItemIndex == focusableItems.length - 1) { 9488 if (e) { 9489 e.preventDefault(); 9490 } 9491 9492 focusableItems.eq(0).trigger("focus"); 9493 } 9494 } 9495 } else { 9496 self.$refs.container.trigger("focus"); 9497 } 9498 }, 9499 9500 // Activates current instance - brings container to the front and enables keyboard, 9501 // notifies other instances about deactivating 9502 // ================================================================================= 9503 9504 activate: function () { 9505 var self = this; 9506 9507 // Deactivate all instances 9508 $(".fancybox-container").each(function () { 9509 var instance = $(this).data("FancyBox"); 9510 9511 // Skip self and closing instances 9512 if (instance && instance.id !== self.id && !instance.isClosing) { 9513 instance.trigger("onDeactivate"); 9514 9515 instance.removeEvents(); 9516 9517 instance.isVisible = false; 9518 } 9519 }); 9520 9521 self.isVisible = true; 9522 9523 if (self.current || self.isIdle) { 9524 self.update(); 9525 9526 self.updateControls(); 9527 } 9528 9529 self.trigger("onActivate"); 9530 9531 self.addEvents(); 9532 }, 9533 9534 // Start closing procedure 9535 // This will start "zoom-out" animation if needed and clean everything up afterwards 9536 // ================================================================================= 9537 9538 close: function (e, d) { 9539 var self = this, 9540 current = self.current, 9541 effect, 9542 duration, 9543 $content, 9544 domRect, 9545 opacity, 9546 start, 9547 end; 9548 9549 var done = function () { 9550 self.cleanUp(e); 9551 }; 9552 9553 if (self.isClosing) { 9554 return false; 9555 } 9556 9557 self.isClosing = true; 9558 9559 // If beforeClose callback prevents closing, make sure content is centered 9560 if (self.trigger("beforeClose", e) === false) { 9561 self.isClosing = false; 9562 9563 requestAFrame(function () { 9564 self.update(); 9565 }); 9566 9567 return false; 9568 } 9569 9570 // Remove all events 9571 // If there are multiple instances, they will be set again by "activate" method 9572 self.removeEvents(); 9573 9574 $content = current.$content; 9575 effect = current.opts.animationEffect; 9576 duration = $.isNumeric(d) ? d : effect ? current.opts.animationDuration : 0; 9577 9578 current.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"); 9579 9580 if (e !== true) { 9581 $.fancybox.stop(current.$slide); 9582 } else { 9583 effect = false; 9584 } 9585 9586 // Remove other slides 9587 current.$slide 9588 .siblings() 9589 .trigger("onReset") 9590 .remove(); 9591 9592 // Trigger animations 9593 if (duration) { 9594 self.$refs.container 9595 .removeClass("fancybox-is-open") 9596 .addClass("fancybox-is-closing") 9597 .css("transition-duration", duration + "ms"); 9598 } 9599 9600 // Clean up 9601 self.hideLoading(current); 9602 9603 self.hideControls(true); 9604 9605 self.updateCursor(); 9606 9607 // Check if possible to zoom-out 9608 if ( 9609 effect === "zoom" && 9610 !($content && duration && current.type === "image" && !self.isMoved() && !current.hasError && (end = self.getThumbPos(current))) 9611 ) { 9612 effect = "fade"; 9613 } 9614 9615 if (effect === "zoom") { 9616 $.fancybox.stop($content); 9617 9618 domRect = $.fancybox.getTranslate($content); 9619 9620 start = { 9621 top: domRect.top, 9622 left: domRect.left, 9623 scaleX: domRect.width / end.width, 9624 scaleY: domRect.height / end.height, 9625 width: end.width, 9626 height: end.height 9627 }; 9628 9629 // Check if we need to animate opacity 9630 opacity = current.opts.zoomOpacity; 9631 9632 if (opacity == "auto") { 9633 opacity = Math.abs(current.width / current.height - end.width / end.height) > 0.1; 9634 } 9635 9636 if (opacity) { 9637 end.opacity = 0; 9638 } 9639 9640 $.fancybox.setTranslate($content, start); 9641 9642 forceRedraw($content); 9643 9644 $.fancybox.animate($content, end, duration, done); 9645 9646 return true; 9647 } 9648 9649 if (effect && duration) { 9650 $.fancybox.animate( 9651 current.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"), 9652 "fancybox-animated fancybox-fx-" + effect, 9653 duration, 9654 done 9655 ); 9656 } else { 9657 // If skip animation 9658 if (e === true) { 9659 setTimeout(done, duration); 9660 } else { 9661 done(); 9662 } 9663 } 9664 9665 return true; 9666 }, 9667 9668 // Final adjustments after removing the instance 9669 // ============================================= 9670 9671 cleanUp: function (e) { 9672 var self = this, 9673 instance, 9674 $focus = self.current.opts.$orig, 9675 x, 9676 y; 9677 9678 self.current.$slide.trigger("onReset"); 9679 9680 self.$refs.container.empty().remove(); 9681 9682 self.trigger("afterClose", e); 9683 9684 // Place back focus 9685 if (!!self.current.opts.backFocus) { 9686 if (!$focus || !$focus.length || !$focus.is(":visible")) { 9687 $focus = self.$trigger; 9688 } 9689 9690 if ($focus && $focus.length) { 9691 x = window.scrollX; 9692 y = window.scrollY; 9693 9694 $focus.trigger("focus"); 9695 9696 $("html, body") 9697 .scrollTop(y) 9698 .scrollLeft(x); 9699 } 9700 } 9701 9702 self.current = null; 9703 9704 // Check if there are other instances 9705 instance = $.fancybox.getInstance(); 9706 9707 if (instance) { 9708 instance.activate(); 9709 } else { 9710 $("body").removeClass("fancybox-active compensate-for-scrollbar"); 9711 9712 $("#fancybox-style-noscroll").remove(); 9713 } 9714 }, 9715 9716 // Call callback and trigger an event 9717 // ================================== 9718 9719 trigger: function (name, slide) { 9720 var args = Array.prototype.slice.call(arguments, 1), 9721 self = this, 9722 obj = slide && slide.opts ? slide : self.current, 9723 rez; 9724 9725 if (obj) { 9726 args.unshift(obj); 9727 } else { 9728 obj = self; 9729 } 9730 9731 args.unshift(self); 9732 9733 if ($.isFunction(obj.opts[name])) { 9734 rez = obj.opts[name].apply(obj, args); 9735 } 9736 9737 if (rez === false) { 9738 return rez; 9739 } 9740 9741 if (name === "afterClose" || !self.$refs) { 9742 $D.trigger(name + ".fb", args); 9743 } else { 9744 self.$refs.container.trigger(name + ".fb", args); 9745 } 9746 }, 9747 9748 // Update infobar values, navigation button states and reveal caption 9749 // ================================================================== 9750 9751 updateControls: function () { 9752 var self = this, 9753 current = self.current, 9754 index = current.index, 9755 $container = self.$refs.container, 9756 $caption = self.$refs.caption, 9757 caption = current.opts.caption; 9758 9759 // Recalculate content dimensions 9760 current.$slide.trigger("refresh"); 9761 9762 // Set caption 9763 if (caption && caption.length) { 9764 self.$caption = $caption; 9765 9766 $caption 9767 .children() 9768 .eq(0) 9769 .html(caption); 9770 } else { 9771 self.$caption = null; 9772 } 9773 9774 if (!self.hasHiddenControls && !self.isIdle) { 9775 self.showControls(); 9776 } 9777 9778 // Update info and navigation elements 9779 $container.find("[data-fancybox-count]").html(self.group.length); 9780 $container.find("[data-fancybox-index]").html(index + 1); 9781 9782 $container.find("[data-fancybox-prev]").prop("disabled", !current.opts.loop && index <= 0); 9783 $container.find("[data-fancybox-next]").prop("disabled", !current.opts.loop && index >= self.group.length - 1); 9784 9785 if (current.type === "image") { 9786 // Re-enable buttons; update download button source 9787 $container 9788 .find("[data-fancybox-zoom]") 9789 .show() 9790 .end() 9791 .find("[data-fancybox-download]") 9792 .attr("href", current.opts.image.src || current.src) 9793 .show(); 9794 } else if (current.opts.toolbar) { 9795 $container.find("[data-fancybox-download],[data-fancybox-zoom]").hide(); 9796 } 9797 9798 // Make sure focus is not on disabled button/element 9799 if ($(document.activeElement).is(":hidden,[disabled]")) { 9800 self.$refs.container.trigger("focus"); 9801 } 9802 }, 9803 9804 // Hide toolbar and caption 9805 // ======================== 9806 9807 hideControls: function (andCaption) { 9808 var self = this, 9809 arr = ["infobar", "toolbar", "nav"]; 9810 9811 if (andCaption || !self.current.opts.preventCaptionOverlap) { 9812 arr.push("caption"); 9813 } 9814 9815 this.$refs.container.removeClass( 9816 arr 9817 .map(function (i) { 9818 return "fancybox-show-" + i; 9819 }) 9820 .join(" ") 9821 ); 9822 9823 this.hasHiddenControls = true; 9824 }, 9825 9826 showControls: function () { 9827 var self = this, 9828 opts = self.current ? self.current.opts : self.opts, 9829 $container = self.$refs.container; 9830 9831 self.hasHiddenControls = false; 9832 self.idleSecondsCounter = 0; 9833 9834 $container 9835 .toggleClass("fancybox-show-toolbar", !!(opts.toolbar && opts.buttons)) 9836 .toggleClass("fancybox-show-infobar", !!(opts.infobar && self.group.length > 1)) 9837 .toggleClass("fancybox-show-caption", !!self.$caption) 9838 .toggleClass("fancybox-show-nav", !!(opts.arrows && self.group.length > 1)) 9839 .toggleClass("fancybox-is-modal", !!opts.modal); 9840 }, 9841 9842 // Toggle toolbar and caption 9843 // ========================== 9844 9845 toggleControls: function () { 9846 if (this.hasHiddenControls) { 9847 this.showControls(); 9848 } else { 9849 this.hideControls(); 9850 } 9851 } 9852 }); 9853 9854 $.fancybox = { 9855 version: "3.5.7", 9856 defaults: defaults, 9857 9858 // Get current instance and execute a command. 9859 // 9860 // Examples of usage: 9861 // 9862 // $instance = $.fancybox.getInstance(); 9863 // $.fancybox.getInstance().jumpTo( 1 ); 9864 // $.fancybox.getInstance( 'jumpTo', 1 ); 9865 // $.fancybox.getInstance( function() { 9866 // console.info( this.currIndex ); 9867 // }); 9868 // ====================================================== 9869 9870 getInstance: function (command) { 9871 var instance = $('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"), 9872 args = Array.prototype.slice.call(arguments, 1); 9873 9874 if (instance instanceof FancyBox) { 9875 if ($.type(command) === "string") { 9876 instance[command].apply(instance, args); 9877 } else if ($.type(command) === "function") { 9878 command.apply(instance, args); 9879 } 9880 9881 return instance; 9882 } 9883 9884 return false; 9885 }, 9886 9887 // Create new instance 9888 // =================== 9889 9890 open: function (items, opts, index) { 9891 return new FancyBox(items, opts, index); 9892 }, 9893 9894 // Close current or all instances 9895 // ============================== 9896 9897 close: function (all) { 9898 var instance = this.getInstance(); 9899 9900 if (instance) { 9901 instance.close(); 9902 9903 // Try to find and close next instance 9904 if (all === true) { 9905 this.close(all); 9906 } 9907 } 9908 }, 9909 9910 // Close all instances and unbind all events 9911 // ========================================= 9912 9913 destroy: function () { 9914 this.close(true); 9915 9916 $D.add("body").off("click.fb-start", "**"); 9917 }, 9918 9919 // Try to detect mobile devices 9920 // ============================ 9921 9922 isMobile: /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), 9923 9924 // Detect if 'translate3d' support is available 9925 // ============================================ 9926 9927 use3d: (function () { 9928 var div = document.createElement("div"); 9929 9930 return ( 9931 window.getComputedStyle && 9932 window.getComputedStyle(div) && 9933 window.getComputedStyle(div).getPropertyValue("transform") && 9934 !(document.documentMode && document.documentMode < 11) 9935 ); 9936 })(), 9937 9938 // Helper function to get current visual state of an element 9939 // returns array[ top, left, horizontal-scale, vertical-scale, opacity ] 9940 // ===================================================================== 9941 9942 getTranslate: function ($el) { 9943 var domRect; 9944 9945 if (!$el || !$el.length) { 9946 return false; 9947 } 9948 9949 domRect = $el[0].getBoundingClientRect(); 9950 9951 return { 9952 top: domRect.top || 0, 9953 left: domRect.left || 0, 9954 width: domRect.width, 9955 height: domRect.height, 9956 opacity: parseFloat($el.css("opacity")) 9957 }; 9958 }, 9959 9960 // Shortcut for setting "translate3d" properties for element 9961 // Can set be used to set opacity, too 9962 // ======================================================== 9963 9964 setTranslate: function ($el, props) { 9965 var str = "", 9966 css = {}; 9967 9968 if (!$el || !props) { 9969 return; 9970 } 9971 9972 if (props.left !== undefined || props.top !== undefined) { 9973 str = 9974 (props.left === undefined ? $el.position().left : props.left) + 9975 "px, " + 9976 (props.top === undefined ? $el.position().top : props.top) + 9977 "px"; 9978 9979 if (this.use3d) { 9980 str = "translate3d(" + str + ", 0px)"; 9981 } else { 9982 str = "translate(" + str + ")"; 9983 } 9984 } 9985 9986 if (props.scaleX !== undefined && props.scaleY !== undefined) { 9987 str += " scale(" + props.scaleX + ", " + props.scaleY + ")"; 9988 } else if (props.scaleX !== undefined) { 9989 str += " scaleX(" + props.scaleX + ")"; 9990 } 9991 9992 if (str.length) { 9993 css.transform = str; 9994 } 9995 9996 if (props.opacity !== undefined) { 9997 css.opacity = props.opacity; 9998 } 9999 10000 if (props.width !== undefined) { 10001 css.width = props.width; 10002 } 10003 10004 if (props.height !== undefined) { 10005 css.height = props.height; 10006 } 10007 10008 return $el.css(css); 10009 }, 10010 10011 // Simple CSS transition handler 10012 // ============================= 10013 10014 animate: function ($el, to, duration, callback, leaveAnimationName) { 10015 var self = this, 10016 from; 10017 10018 if ($.isFunction(duration)) { 10019 callback = duration; 10020 duration = null; 10021 } 10022 10023 self.stop($el); 10024 10025 from = self.getTranslate($el); 10026 10027 $el.on(transitionEnd, function (e) { 10028 // Skip events from child elements and z-index change 10029 if (e && e.originalEvent && (!$el.is(e.originalEvent.target) || e.originalEvent.propertyName == "z-index")) { 10030 return; 10031 } 10032 10033 self.stop($el); 10034 10035 if ($.isNumeric(duration)) { 10036 $el.css("transition-duration", ""); 10037 } 10038 10039 if ($.isPlainObject(to)) { 10040 if (to.scaleX !== undefined && to.scaleY !== undefined) { 10041 self.setTranslate($el, { 10042 top: to.top, 10043 left: to.left, 10044 width: from.width * to.scaleX, 10045 height: from.height * to.scaleY, 10046 scaleX: 1, 10047 scaleY: 1 10048 }); 10049 } 10050 } else if (leaveAnimationName !== true) { 10051 $el.removeClass(to); 10052 } 10053 10054 if ($.isFunction(callback)) { 10055 callback(e); 10056 } 10057 }); 10058 10059 if ($.isNumeric(duration)) { 10060 $el.css("transition-duration", duration + "ms"); 10061 } 10062 10063 // Start animation by changing CSS properties or class name 10064 if ($.isPlainObject(to)) { 10065 if (to.scaleX !== undefined && to.scaleY !== undefined) { 10066 delete to.width; 10067 delete to.height; 10068 10069 if ($el.parent().hasClass("fancybox-slide--image")) { 10070 $el.parent().addClass("fancybox-is-scaling"); 10071 } 10072 } 10073 10074 $.fancybox.setTranslate($el, to); 10075 } else { 10076 $el.addClass(to); 10077 } 10078 10079 // Make sure that `transitionend` callback gets fired 10080 $el.data( 10081 "timer", 10082 setTimeout(function () { 10083 $el.trigger(transitionEnd); 10084 }, duration + 33) 10085 ); 10086 }, 10087 10088 stop: function ($el, callCallback) { 10089 if ($el && $el.length) { 10090 clearTimeout($el.data("timer")); 10091 10092 if (callCallback) { 10093 $el.trigger(transitionEnd); 10094 } 10095 10096 $el.off(transitionEnd).css("transition-duration", ""); 10097 10098 $el.parent().removeClass("fancybox-is-scaling"); 10099 } 10100 } 10101 }; 10102 10103 // Default click handler for "fancyboxed" links 10104 // ============================================ 10105 10106 function _run(e, opts) { 10107 var items = [], 10108 index = 0, 10109 $target, 10110 value, 10111 instance; 10112 10113 // Avoid opening multiple times 10114 if (e && e.isDefaultPrevented()) { 10115 return; 10116 } 10117 10118 e.preventDefault(); 10119 10120 opts = opts || {}; 10121 10122 if (e && e.data) { 10123 opts = mergeOpts(e.data.options, opts); 10124 } 10125 10126 $target = opts.$target || $(e.currentTarget).trigger("blur"); 10127 instance = $.fancybox.getInstance(); 10128 10129 if (instance && instance.$trigger && instance.$trigger.is($target)) { 10130 return; 10131 } 10132 10133 if (opts.selector) { 10134 items = $(opts.selector); 10135 } else { 10136 // Get all related items and find index for clicked one 10137 value = $target.attr("data-fancybox") || ""; 10138 10139 if (value) { 10140 items = e.data ? e.data.items : []; 10141 items = items.length ? items.filter('[data-fancybox="' + value + '"]') : $('[data-fancybox="' + value + '"]'); 10142 } else { 10143 items = [$target]; 10144 } 10145 } 10146 10147 index = $(items).index($target); 10148 10149 // Sometimes current item can not be found 10150 if (index < 0) { 10151 index = 0; 10152 } 10153 10154 instance = $.fancybox.open(items, opts, index); 10155 10156 // Save last active element 10157 instance.$trigger = $target; 10158 } 10159 10160 // Create a jQuery plugin 10161 // ====================== 10162 10163 $.fn.fancybox = function (options) { 10164 var selector; 10165 10166 options = options || {}; 10167 selector = options.selector || false; 10168 10169 if (selector) { 10170 // Use body element instead of document so it executes first 10171 $("body") 10172 .off("click.fb-start", selector) 10173 .on("click.fb-start", selector, { 10174 options: options 10175 }, _run); 10176 } else { 10177 this.off("click.fb-start").on( 10178 "click.fb-start", { 10179 items: this, 10180 options: options 10181 }, 10182 _run 10183 ); 10184 } 10185 10186 return this; 10187 }; 10188 10189 // Self initializing plugin for all elements having `data-fancybox` attribute 10190 // ========================================================================== 10191 10192 $D.on("click.fb-start", "[data-fancybox]", _run); 10193 10194 // Enable "trigger elements" 10195 // ========================= 10196 10197 $D.on("click.fb-start", "[data-fancybox-trigger]", function (e) { 10198 $('[data-fancybox="' + $(this).attr("data-fancybox-trigger") + '"]') 10199 .eq($(this).attr("data-fancybox-index") || 0) 10200 .trigger("click.fb-start", { 10201 $trigger: $(this) 10202 }); 10203 }); 10204 10205 // Track focus event for better accessibility styling 10206 // ================================================== 10207 (function () { 10208 var buttonStr = ".fancybox-button", 10209 focusStr = "fancybox-focus", 10210 $pressed = null; 10211 10212 $D.on("mousedown mouseup focus blur", buttonStr, function (e) { 10213 switch (e.type) { 10214 case "mousedown": 10215 $pressed = $(this); 10216 break; 10217 case "mouseup": 10218 $pressed = null; 10219 break; 10220 case "focusin": 10221 $(buttonStr).removeClass(focusStr); 10222 10223 if (!$(this).is($pressed) && !$(this).is("[disabled]")) { 10224 $(this).addClass(focusStr); 10225 } 10226 break; 10227 case "focusout": 10228 $(buttonStr).removeClass(focusStr); 10229 break; 10230 } 10231 }); 10232 })(); 10233})(window, document, jQuery); 10234// ========================================================================== 10235// 10236// Media 10237// Adds additional media type support 10238// 10239// ========================================================================== 10240(function ($) { 10241 "use strict"; 10242 10243 // Object containing properties for each media type 10244 var defaults = { 10245 youtube: { 10246 matcher: /(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i, 10247 params: { 10248 autoplay: 1, 10249 autohide: 1, 10250 fs: 1, 10251 rel: 0, 10252 hd: 1, 10253 wmode: "transparent", 10254 enablejsapi: 1, 10255 html5: 1 10256 }, 10257 paramPlace: 8, 10258 type: "iframe", 10259 url: "https://www.youtube-nocookie.com/embed/$4", 10260 thumb: "https://img.youtube.com/vi/$4/hqdefault.jpg" 10261 }, 10262 10263 vimeo: { 10264 matcher: /^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/, 10265 params: { 10266 autoplay: 1, 10267 hd: 1, 10268 show_title: 1, 10269 show_byline: 1, 10270 show_portrait: 0, 10271 fullscreen: 1 10272 }, 10273 paramPlace: 3, 10274 type: "iframe", 10275 url: "//player.vimeo.com/video/$2" 10276 }, 10277 10278 instagram: { 10279 matcher: /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 10280 type: "image", 10281 url: "//$1/p/$2/media/?size=l" 10282 }, 10283 10284 // Examples: 10285 // http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 10286 // https://www.google.com/maps/@37.7852006,-122.4146355,14.65z 10287 // https://www.google.com/maps/@52.2111123,2.9237542,6.61z?hl=en 10288 // https://www.google.com/maps/place/Googleplex/@37.4220041,-122.0833494,17z/data=!4m5!3m4!1s0x0:0x6c296c66619367e0!8m2!3d37.4219998!4d-122.0840572 10289 gmap_place: { 10290 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i, 10291 type: "iframe", 10292 url: function (rez) { 10293 return ( 10294 "//maps.google." + 10295 rez[2] + 10296 "/?ll=" + 10297 (rez[9] ? rez[9] + "&z=" + Math.floor(rez[10]) + (rez[12] ? rez[12].replace(/^\//, "&") : "") : rez[12] + "").replace(/\?/, "&") + 10298 "&output=" + 10299 (rez[12] && rez[12].indexOf("layer=c") > 0 ? "svembed" : "embed") 10300 ); 10301 } 10302 }, 10303 10304 // Examples: 10305 // https://www.google.com/maps/search/Empire+State+Building/ 10306 // https://www.google.com/maps/search/?api=1&query=centurylink+field 10307 // https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393 10308 gmap_search: { 10309 matcher: /(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i, 10310 type: "iframe", 10311 url: function (rez) { 10312 return "//maps.google." + rez[2] + "/maps?q=" + rez[5].replace("query=", "q=").replace("api=1", "") + "&output=embed"; 10313 } 10314 } 10315 }; 10316 10317 // Formats matching url to final form 10318 var format = function (url, rez, params) { 10319 if (!url) { 10320 return; 10321 } 10322 10323 params = params || ""; 10324 10325 if ($.type(params) === "object") { 10326 params = $.param(params, true); 10327 } 10328 10329 $.each(rez, function (key, value) { 10330 url = url.replace("$" + key, value || ""); 10331 }); 10332 10333 if (params.length) { 10334 url += (url.indexOf("?") > 0 ? "&" : "?") + params; 10335 } 10336 10337 return url; 10338 }; 10339 10340 $(document).on("objectNeedsType.fb", function (e, instance, item) { 10341 var url = item.src || "", 10342 type = false, 10343 media, 10344 thumb, 10345 rez, 10346 params, 10347 urlParams, 10348 paramObj, 10349 provider; 10350 10351 media = $.extend(true, {}, defaults, item.opts.media); 10352 10353 // Look for any matching media type 10354 $.each(media, function (providerName, providerOpts) { 10355 rez = url.match(providerOpts.matcher); 10356 10357 if (!rez) { 10358 return; 10359 } 10360 10361 type = providerOpts.type; 10362 provider = providerName; 10363 paramObj = {}; 10364 10365 if (providerOpts.paramPlace && rez[providerOpts.paramPlace]) { 10366 urlParams = rez[providerOpts.paramPlace]; 10367 10368 if (urlParams[0] == "?") { 10369 urlParams = urlParams.substring(1); 10370 } 10371 10372 urlParams = urlParams.split("&"); 10373 10374 for (var m = 0; m < urlParams.length; ++m) { 10375 var p = urlParams[m].split("=", 2); 10376 10377 if (p.length == 2) { 10378 paramObj[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 10379 } 10380 } 10381 } 10382 10383 params = $.extend(true, {}, providerOpts.params, item.opts[providerName], paramObj); 10384 10385 url = 10386 $.type(providerOpts.url) === "function" ? providerOpts.url.call(this, rez, params, item) : format(providerOpts.url, rez, params); 10387 10388 thumb = 10389 $.type(providerOpts.thumb) === "function" ? providerOpts.thumb.call(this, rez, params, item) : format(providerOpts.thumb, rez); 10390 10391 if (providerName === "youtube") { 10392 url = url.replace(/&t=((\d+)m)?(\d+)s/, function (match, p1, m, s) { 10393 return "&start=" + ((m ? parseInt(m, 10) * 60 : 0) + parseInt(s, 10)); 10394 }); 10395 } else if (providerName === "vimeo") { 10396 url = url.replace("&%23", "#"); 10397 } 10398 10399 return false; 10400 }); 10401 10402 // If it is found, then change content type and update the url 10403 10404 if (type) { 10405 if (!item.opts.thumb && !(item.opts.$thumb && item.opts.$thumb.length)) { 10406 item.opts.thumb = thumb; 10407 } 10408 10409 if (type === "iframe") { 10410 item.opts = $.extend(true, item.opts, { 10411 iframe: { 10412 preload: false, 10413 attr: { 10414 scrolling: "no" 10415 } 10416 } 10417 }); 10418 } 10419 10420 $.extend(item, { 10421 type: type, 10422 src: url, 10423 origSrc: item.src, 10424 contentSource: provider, 10425 contentType: type === "image" ? "image" : provider == "gmap_place" || provider == "gmap_search" ? "map" : "video" 10426 }); 10427 } else if (url) { 10428 item.type = item.opts.defaultType; 10429 } 10430 }); 10431 10432 // Load YouTube/Video API on request to detect when video finished playing 10433 var VideoAPILoader = { 10434 youtube: { 10435 src: "https://www.youtube.com/iframe_api", 10436 class: "YT", 10437 loading: false, 10438 loaded: false 10439 }, 10440 10441 vimeo: { 10442 src: "https://player.vimeo.com/api/player.js", 10443 class: "Vimeo", 10444 loading: false, 10445 loaded: false 10446 }, 10447 10448 load: function (vendor) { 10449 var _this = this, 10450 script; 10451 10452 if (this[vendor].loaded) { 10453 setTimeout(function () { 10454 _this.done(vendor); 10455 }); 10456 return; 10457 } 10458 10459 if (this[vendor].loading) { 10460 return; 10461 } 10462 10463 this[vendor].loading = true; 10464 10465 script = document.createElement("script"); 10466 script.type = "text/javascript"; 10467 script.src = this[vendor].src; 10468 10469 if (vendor === "youtube") { 10470 window.onYouTubeIframeAPIReady = function () { 10471 _this[vendor].loaded = true; 10472 _this.done(vendor); 10473 }; 10474 } else { 10475 script.onload = function () { 10476 _this[vendor].loaded = true; 10477 _this.done(vendor); 10478 }; 10479 } 10480 10481 document.body.appendChild(script); 10482 }, 10483 done: function (vendor) { 10484 var instance, $el, player; 10485 10486 if (vendor === "youtube") { 10487 delete window.onYouTubeIframeAPIReady; 10488 } 10489 10490 instance = $.fancybox.getInstance(); 10491 10492 if (instance) { 10493 $el = instance.current.$content.find("iframe"); 10494 10495 if (vendor === "youtube" && YT !== undefined && YT) { 10496 player = new YT.Player($el.attr("id"), { 10497 events: { 10498 onStateChange: function (e) { 10499 if (e.data == 0) { 10500 instance.next(); 10501 } 10502 } 10503 } 10504 }); 10505 } else if (vendor === "vimeo" && Vimeo !== undefined && Vimeo) { 10506 player = new Vimeo.Player($el); 10507 10508 player.on("ended", function () { 10509 instance.next(); 10510 }); 10511 } 10512 } 10513 } 10514 }; 10515 10516 $(document).on({ 10517 "afterShow.fb": function (e, instance, current) { 10518 if (instance.group.length > 1 && (current.contentSource === "youtube" || current.contentSource === "vimeo")) { 10519 VideoAPILoader.load(current.contentSource); 10520 } 10521 } 10522 }); 10523})(jQuery); 10524// ========================================================================== 10525// 10526// Guestures 10527// Adds touch guestures, handles click and tap events 10528// 10529// ========================================================================== 10530(function (window, document, $) { 10531 "use strict"; 10532 10533 var requestAFrame = (function () { 10534 return ( 10535 window.requestAnimationFrame || 10536 window.webkitRequestAnimationFrame || 10537 window.mozRequestAnimationFrame || 10538 window.oRequestAnimationFrame || 10539 // if all else fails, use setTimeout 10540 function (callback) { 10541 return window.setTimeout(callback, 1000 / 60); 10542 } 10543 ); 10544 })(); 10545 10546 var cancelAFrame = (function () { 10547 return ( 10548 window.cancelAnimationFrame || 10549 window.webkitCancelAnimationFrame || 10550 window.mozCancelAnimationFrame || 10551 window.oCancelAnimationFrame || 10552 function (id) { 10553 window.clearTimeout(id); 10554 } 10555 ); 10556 })(); 10557 10558 var getPointerXY = function (e) { 10559 var result = []; 10560 10561 e = e.originalEvent || e || window.e; 10562 e = e.touches && e.touches.length ? e.touches : e.changedTouches && e.changedTouches.length ? e.changedTouches : [e]; 10563 10564 for (var key in e) { 10565 if (e[key].pageX) { 10566 result.push({ 10567 x: e[key].pageX, 10568 y: e[key].pageY 10569 }); 10570 } else if (e[key].clientX) { 10571 result.push({ 10572 x: e[key].clientX, 10573 y: e[key].clientY 10574 }); 10575 } 10576 } 10577 10578 return result; 10579 }; 10580 10581 var distance = function (point2, point1, what) { 10582 if (!point1 || !point2) { 10583 return 0; 10584 } 10585 10586 if (what === "x") { 10587 return point2.x - point1.x; 10588 } else if (what === "y") { 10589 return point2.y - point1.y; 10590 } 10591 10592 return Math.sqrt(Math.pow(point2.x - point1.x, 2) + Math.pow(point2.y - point1.y, 2)); 10593 }; 10594 10595 var isClickable = function ($el) { 10596 if ( 10597 $el.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe') || 10598 $.isFunction($el.get(0).onclick) || 10599 $el.data("selectable") 10600 ) { 10601 return true; 10602 } 10603 10604 // Check for attributes like data-fancybox-next or data-fancybox-close 10605 for (var i = 0, atts = $el[0].attributes, n = atts.length; i < n; i++) { 10606 if (atts[i].nodeName.substr(0, 14) === "data-fancybox-") { 10607 return true; 10608 } 10609 } 10610 10611 return false; 10612 }; 10613 10614 var hasScrollbars = function (el) { 10615 var overflowY = window.getComputedStyle(el)["overflow-y"], 10616 overflowX = window.getComputedStyle(el)["overflow-x"], 10617 vertical = (overflowY === "scroll" || overflowY === "auto") && el.scrollHeight > el.clientHeight, 10618 horizontal = (overflowX === "scroll" || overflowX === "auto") && el.scrollWidth > el.clientWidth; 10619 10620 return vertical || horizontal; 10621 }; 10622 10623 var isScrollable = function ($el) { 10624 var rez = false; 10625 10626 while (true) { 10627 rez = hasScrollbars($el.get(0)); 10628 10629 if (rez) { 10630 break; 10631 } 10632 10633 $el = $el.parent(); 10634 10635 if (!$el.length || $el.hasClass("fancybox-stage") || $el.is("body")) { 10636 break; 10637 } 10638 } 10639 10640 return rez; 10641 }; 10642 10643 var Guestures = function (instance) { 10644 var self = this; 10645 10646 self.instance = instance; 10647 10648 self.$bg = instance.$refs.bg; 10649 self.$stage = instance.$refs.stage; 10650 self.$container = instance.$refs.container; 10651 10652 self.destroy(); 10653 10654 self.$container.on("touchstart.fb.touch mousedown.fb.touch", $.proxy(self, "ontouchstart")); 10655 }; 10656 10657 Guestures.prototype.destroy = function () { 10658 var self = this; 10659 10660 self.$container.off(".fb.touch"); 10661 10662 $(document).off(".fb.touch"); 10663 10664 if (self.requestId) { 10665 cancelAFrame(self.requestId); 10666 self.requestId = null; 10667 } 10668 10669 if (self.tapped) { 10670 clearTimeout(self.tapped); 10671 self.tapped = null; 10672 } 10673 }; 10674 10675 Guestures.prototype.ontouchstart = function (e) { 10676 var self = this, 10677 $target = $(e.target), 10678 instance = self.instance, 10679 current = instance.current, 10680 $slide = current.$slide, 10681 $content = current.$content, 10682 isTouchDevice = e.type == "touchstart"; 10683 10684 // Do not respond to both (touch and mouse) events 10685 if (isTouchDevice) { 10686 self.$container.off("mousedown.fb.touch"); 10687 } 10688 10689 // Ignore right click 10690 if (e.originalEvent && e.originalEvent.button == 2) { 10691 return; 10692 } 10693 10694 // Ignore taping on links, buttons, input elements 10695 if (!$slide.length || !$target.length || isClickable($target) || isClickable($target.parent())) { 10696 return; 10697 } 10698 // Ignore clicks on the scrollbar 10699 if (!$target.is("img") && e.originalEvent.clientX > $target[0].clientWidth + $target.offset().left) { 10700 return; 10701 } 10702 10703 // Ignore clicks while zooming or closing 10704 if (!current || instance.isAnimating || current.$slide.hasClass("fancybox-animated")) { 10705 e.stopPropagation(); 10706 e.preventDefault(); 10707 10708 return; 10709 } 10710 10711 self.realPoints = self.startPoints = getPointerXY(e); 10712 10713 if (!self.startPoints.length) { 10714 return; 10715 } 10716 10717 // Allow other scripts to catch touch event if "touch" is set to false 10718 if (current.touch) { 10719 e.stopPropagation(); 10720 } 10721 10722 self.startEvent = e; 10723 10724 self.canTap = true; 10725 self.$target = $target; 10726 self.$content = $content; 10727 self.opts = current.opts.touch; 10728 10729 self.isPanning = false; 10730 self.isSwiping = false; 10731 self.isZooming = false; 10732 self.isScrolling = false; 10733 self.canPan = instance.canPan(); 10734 10735 self.startTime = new Date().getTime(); 10736 self.distanceX = self.distanceY = self.distance = 0; 10737 10738 self.canvasWidth = Math.round($slide[0].clientWidth); 10739 self.canvasHeight = Math.round($slide[0].clientHeight); 10740 10741 self.contentLastPos = null; 10742 self.contentStartPos = $.fancybox.getTranslate(self.$content) || { 10743 top: 0, 10744 left: 0 10745 }; 10746 self.sliderStartPos = $.fancybox.getTranslate($slide); 10747 10748 // Since position will be absolute, but we need to make it relative to the stage 10749 self.stagePos = $.fancybox.getTranslate(instance.$refs.stage); 10750 10751 self.sliderStartPos.top -= self.stagePos.top; 10752 self.sliderStartPos.left -= self.stagePos.left; 10753 10754 self.contentStartPos.top -= self.stagePos.top; 10755 self.contentStartPos.left -= self.stagePos.left; 10756 10757 $(document) 10758 .off(".fb.touch") 10759 .on(isTouchDevice ? "touchend.fb.touch touchcancel.fb.touch" : "mouseup.fb.touch mouseleave.fb.touch", $.proxy(self, "ontouchend")) 10760 .on(isTouchDevice ? "touchmove.fb.touch" : "mousemove.fb.touch", $.proxy(self, "ontouchmove")); 10761 10762 if ($.fancybox.isMobile) { 10763 document.addEventListener("scroll", self.onscroll, true); 10764 } 10765 10766 // Skip if clicked outside the sliding area 10767 if (!(self.opts || self.canPan) || !($target.is(self.$stage) || self.$stage.find($target).length)) { 10768 if ($target.is(".fancybox-image")) { 10769 e.preventDefault(); 10770 } 10771 10772 if (!($.fancybox.isMobile && $target.parents(".fancybox-caption").length)) { 10773 return; 10774 } 10775 } 10776 10777 self.isScrollable = isScrollable($target) || isScrollable($target.parent()); 10778 10779 // Check if element is scrollable and try to prevent default behavior (scrolling) 10780 if (!($.fancybox.isMobile && self.isScrollable)) { 10781 e.preventDefault(); 10782 } 10783 10784 // One finger or mouse click - swipe or pan an image 10785 if (self.startPoints.length === 1 || current.hasError) { 10786 if (self.canPan) { 10787 $.fancybox.stop(self.$content); 10788 10789 self.isPanning = true; 10790 } else { 10791 self.isSwiping = true; 10792 } 10793 10794 self.$container.addClass("fancybox-is-grabbing"); 10795 } 10796 10797 // Two fingers - zoom image 10798 if (self.startPoints.length === 2 && current.type === "image" && (current.isLoaded || current.$ghost)) { 10799 self.canTap = false; 10800 self.isSwiping = false; 10801 self.isPanning = false; 10802 10803 self.isZooming = true; 10804 10805 $.fancybox.stop(self.$content); 10806 10807 self.centerPointStartX = (self.startPoints[0].x + self.startPoints[1].x) * 0.5 - $(window).scrollLeft(); 10808 self.centerPointStartY = (self.startPoints[0].y + self.startPoints[1].y) * 0.5 - $(window).scrollTop(); 10809 10810 self.percentageOfImageAtPinchPointX = (self.centerPointStartX - self.contentStartPos.left) / self.contentStartPos.width; 10811 self.percentageOfImageAtPinchPointY = (self.centerPointStartY - self.contentStartPos.top) / self.contentStartPos.height; 10812 10813 self.startDistanceBetweenFingers = distance(self.startPoints[0], self.startPoints[1]); 10814 } 10815 }; 10816 10817 Guestures.prototype.onscroll = function (e) { 10818 var self = this; 10819 10820 self.isScrolling = true; 10821 10822 document.removeEventListener("scroll", self.onscroll, true); 10823 }; 10824 10825 Guestures.prototype.ontouchmove = function (e) { 10826 var self = this; 10827 10828 // Make sure user has not released over iframe or disabled element 10829 if (e.originalEvent.buttons !== undefined && e.originalEvent.buttons === 0) { 10830 self.ontouchend(e); 10831 return; 10832 } 10833 10834 if (self.isScrolling) { 10835 self.canTap = false; 10836 return; 10837 } 10838 10839 self.newPoints = getPointerXY(e); 10840 10841 if (!(self.opts || self.canPan) || !self.newPoints.length || !self.newPoints.length) { 10842 return; 10843 } 10844 10845 if (!(self.isSwiping && self.isSwiping === true)) { 10846 e.preventDefault(); 10847 } 10848 10849 self.distanceX = distance(self.newPoints[0], self.startPoints[0], "x"); 10850 self.distanceY = distance(self.newPoints[0], self.startPoints[0], "y"); 10851 10852 self.distance = distance(self.newPoints[0], self.startPoints[0]); 10853 10854 // Skip false ontouchmove events (Chrome) 10855 if (self.distance > 0) { 10856 if (self.isSwiping) { 10857 self.onSwipe(e); 10858 } else if (self.isPanning) { 10859 self.onPan(); 10860 } else if (self.isZooming) { 10861 self.onZoom(); 10862 } 10863 } 10864 }; 10865 10866 Guestures.prototype.onSwipe = function (e) { 10867 var self = this, 10868 instance = self.instance, 10869 swiping = self.isSwiping, 10870 left = self.sliderStartPos.left || 0, 10871 angle; 10872 10873 // If direction is not yet determined 10874 if (swiping === true) { 10875 // We need at least 10px distance to correctly calculate an angle 10876 if (Math.abs(self.distance) > 10) { 10877 self.canTap = false; 10878 10879 if (instance.group.length < 2 && self.opts.vertical) { 10880 self.isSwiping = "y"; 10881 } else if (instance.isDragging || self.opts.vertical === false || (self.opts.vertical === "auto" && $(window).width() > 800)) { 10882 self.isSwiping = "x"; 10883 } else { 10884 angle = Math.abs((Math.atan2(self.distanceY, self.distanceX) * 180) / Math.PI); 10885 10886 self.isSwiping = angle > 45 && angle < 135 ? "y" : "x"; 10887 } 10888 10889 if (self.isSwiping === "y" && $.fancybox.isMobile && self.isScrollable) { 10890 self.isScrolling = true; 10891 10892 return; 10893 } 10894 10895 instance.isDragging = self.isSwiping; 10896 10897 // Reset points to avoid jumping, because we dropped first swipes to calculate the angle 10898 self.startPoints = self.newPoints; 10899 10900 $.each(instance.slides, function (index, slide) { 10901 var slidePos, stagePos; 10902 10903 $.fancybox.stop(slide.$slide); 10904 10905 slidePos = $.fancybox.getTranslate(slide.$slide); 10906 stagePos = $.fancybox.getTranslate(instance.$refs.stage); 10907 10908 slide.$slide 10909 .css({ 10910 transform: "", 10911 opacity: "", 10912 "transition-duration": "" 10913 }) 10914 .removeClass("fancybox-animated") 10915 .removeClass(function (index, className) { 10916 return (className.match(/(^|\s)fancybox-fx-\S+/g) || []).join(" "); 10917 }); 10918 10919 if (slide.pos === instance.current.pos) { 10920 self.sliderStartPos.top = slidePos.top - stagePos.top; 10921 self.sliderStartPos.left = slidePos.left - stagePos.left; 10922 } 10923 10924 $.fancybox.setTranslate(slide.$slide, { 10925 top: slidePos.top - stagePos.top, 10926 left: slidePos.left - stagePos.left 10927 }); 10928 }); 10929 10930 // Stop slideshow 10931 if (instance.SlideShow && instance.SlideShow.isActive) { 10932 instance.SlideShow.stop(); 10933 } 10934 } 10935 10936 return; 10937 } 10938 10939 // Sticky edges 10940 if (swiping == "x") { 10941 if ( 10942 self.distanceX > 0 && 10943 (self.instance.group.length < 2 || (self.instance.current.index === 0 && !self.instance.current.opts.loop)) 10944 ) { 10945 left = left + Math.pow(self.distanceX, 0.8); 10946 } else if ( 10947 self.distanceX < 0 && 10948 (self.instance.group.length < 2 || 10949 (self.instance.current.index === self.instance.group.length - 1 && !self.instance.current.opts.loop)) 10950 ) { 10951 left = left - Math.pow(-self.distanceX, 0.8); 10952 } else { 10953 left = left + self.distanceX; 10954 } 10955 } 10956 10957 self.sliderLastPos = { 10958 top: swiping == "x" ? 0 : self.sliderStartPos.top + self.distanceY, 10959 left: left 10960 }; 10961 10962 if (self.requestId) { 10963 cancelAFrame(self.requestId); 10964 10965 self.requestId = null; 10966 } 10967 10968 self.requestId = requestAFrame(function () { 10969 if (self.sliderLastPos) { 10970 $.each(self.instance.slides, function (index, slide) { 10971 var pos = slide.pos - self.instance.currPos; 10972 10973 $.fancybox.setTranslate(slide.$slide, { 10974 top: self.sliderLastPos.top, 10975 left: self.sliderLastPos.left + pos * self.canvasWidth + pos * slide.opts.gutter 10976 }); 10977 }); 10978 10979 self.$container.addClass("fancybox-is-sliding"); 10980 } 10981 }); 10982 }; 10983 10984 Guestures.prototype.onPan = function () { 10985 var self = this; 10986 10987 // Prevent accidental movement (sometimes, when tapping casually, finger can move a bit) 10988 if (distance(self.newPoints[0], self.realPoints[0]) < ($.fancybox.isMobile ? 10 : 5)) { 10989 self.startPoints = self.newPoints; 10990 return; 10991 } 10992 10993 self.canTap = false; 10994 10995 self.contentLastPos = self.limitMovement(); 10996 10997 if (self.requestId) { 10998 cancelAFrame(self.requestId); 10999 } 11000 11001 self.requestId = requestAFrame(function () { 11002 $.fancybox.setTranslate(self.$content, self.contentLastPos); 11003 }); 11004 }; 11005 11006 // Make panning sticky to the edges 11007 Guestures.prototype.limitMovement = function () { 11008 var self = this; 11009 11010 var canvasWidth = self.canvasWidth; 11011 var canvasHeight = self.canvasHeight; 11012 11013 var distanceX = self.distanceX; 11014 var distanceY = self.distanceY; 11015 11016 var contentStartPos = self.contentStartPos; 11017 11018 var currentOffsetX = contentStartPos.left; 11019 var currentOffsetY = contentStartPos.top; 11020 11021 var currentWidth = contentStartPos.width; 11022 var currentHeight = contentStartPos.height; 11023 11024 var minTranslateX, minTranslateY, maxTranslateX, maxTranslateY, newOffsetX, newOffsetY; 11025 11026 if (currentWidth > canvasWidth) { 11027 newOffsetX = currentOffsetX + distanceX; 11028 } else { 11029 newOffsetX = currentOffsetX; 11030 } 11031 11032 newOffsetY = currentOffsetY + distanceY; 11033 11034 // Slow down proportionally to traveled distance 11035 minTranslateX = Math.max(0, canvasWidth * 0.5 - currentWidth * 0.5); 11036 minTranslateY = Math.max(0, canvasHeight * 0.5 - currentHeight * 0.5); 11037 11038 maxTranslateX = Math.min(canvasWidth - currentWidth, canvasWidth * 0.5 - currentWidth * 0.5); 11039 maxTranslateY = Math.min(canvasHeight - currentHeight, canvasHeight * 0.5 - currentHeight * 0.5); 11040 11041 // -> 11042 if (distanceX > 0 && newOffsetX > minTranslateX) { 11043 newOffsetX = minTranslateX - 1 + Math.pow(-minTranslateX + currentOffsetX + distanceX, 0.8) || 0; 11044 } 11045 11046 // <- 11047 if (distanceX < 0 && newOffsetX < maxTranslateX) { 11048 newOffsetX = maxTranslateX + 1 - Math.pow(maxTranslateX - currentOffsetX - distanceX, 0.8) || 0; 11049 } 11050 11051 // \/ 11052 if (distanceY > 0 && newOffsetY > minTranslateY) { 11053 newOffsetY = minTranslateY - 1 + Math.pow(-minTranslateY + currentOffsetY + distanceY, 0.8) || 0; 11054 } 11055 11056 // /\ 11057 if (distanceY < 0 && newOffsetY < maxTranslateY) { 11058 newOffsetY = maxTranslateY + 1 - Math.pow(maxTranslateY - currentOffsetY - distanceY, 0.8) || 0; 11059 } 11060 11061 return { 11062 top: newOffsetY, 11063 left: newOffsetX 11064 }; 11065 }; 11066 11067 Guestures.prototype.limitPosition = function (newOffsetX, newOffsetY, newWidth, newHeight) { 11068 var self = this; 11069 11070 var canvasWidth = self.canvasWidth; 11071 var canvasHeight = self.canvasHeight; 11072 11073 if (newWidth > canvasWidth) { 11074 newOffsetX = newOffsetX > 0 ? 0 : newOffsetX; 11075 newOffsetX = newOffsetX < canvasWidth - newWidth ? canvasWidth - newWidth : newOffsetX; 11076 } else { 11077 // Center horizontally 11078 newOffsetX = Math.max(0, canvasWidth / 2 - newWidth / 2); 11079 } 11080 11081 if (newHeight > canvasHeight) { 11082 newOffsetY = newOffsetY > 0 ? 0 : newOffsetY; 11083 newOffsetY = newOffsetY < canvasHeight - newHeight ? canvasHeight - newHeight : newOffsetY; 11084 } else { 11085 // Center vertically 11086 newOffsetY = Math.max(0, canvasHeight / 2 - newHeight / 2); 11087 } 11088 11089 return { 11090 top: newOffsetY, 11091 left: newOffsetX 11092 }; 11093 }; 11094 11095 Guestures.prototype.onZoom = function () { 11096 var self = this; 11097 11098 // Calculate current distance between points to get pinch ratio and new width and height 11099 var contentStartPos = self.contentStartPos; 11100 11101 var currentWidth = contentStartPos.width; 11102 var currentHeight = contentStartPos.height; 11103 11104 var currentOffsetX = contentStartPos.left; 11105 var currentOffsetY = contentStartPos.top; 11106 11107 var endDistanceBetweenFingers = distance(self.newPoints[0], self.newPoints[1]); 11108 11109 var pinchRatio = endDistanceBetweenFingers / self.startDistanceBetweenFingers; 11110 11111 var newWidth = Math.floor(currentWidth * pinchRatio); 11112 var newHeight = Math.floor(currentHeight * pinchRatio); 11113 11114 // This is the translation due to pinch-zooming 11115 var translateFromZoomingX = (currentWidth - newWidth) * self.percentageOfImageAtPinchPointX; 11116 var translateFromZoomingY = (currentHeight - newHeight) * self.percentageOfImageAtPinchPointY; 11117 11118 // Point between the two touches 11119 var centerPointEndX = (self.newPoints[0].x + self.newPoints[1].x) / 2 - $(window).scrollLeft(); 11120 var centerPointEndY = (self.newPoints[0].y + self.newPoints[1].y) / 2 - $(window).scrollTop(); 11121 11122 // And this is the translation due to translation of the centerpoint 11123 // between the two fingers 11124 var translateFromTranslatingX = centerPointEndX - self.centerPointStartX; 11125 var translateFromTranslatingY = centerPointEndY - self.centerPointStartY; 11126 11127 // The new offset is the old/current one plus the total translation 11128 var newOffsetX = currentOffsetX + (translateFromZoomingX + translateFromTranslatingX); 11129 var newOffsetY = currentOffsetY + (translateFromZoomingY + translateFromTranslatingY); 11130 11131 var newPos = { 11132 top: newOffsetY, 11133 left: newOffsetX, 11134 scaleX: pinchRatio, 11135 scaleY: pinchRatio 11136 }; 11137 11138 self.canTap = false; 11139 11140 self.newWidth = newWidth; 11141 self.newHeight = newHeight; 11142 11143 self.contentLastPos = newPos; 11144 11145 if (self.requestId) { 11146 cancelAFrame(self.requestId); 11147 } 11148 11149 self.requestId = requestAFrame(function () { 11150 $.fancybox.setTranslate(self.$content, self.contentLastPos); 11151 }); 11152 }; 11153 11154 Guestures.prototype.ontouchend = function (e) { 11155 var self = this; 11156 11157 var swiping = self.isSwiping; 11158 var panning = self.isPanning; 11159 var zooming = self.isZooming; 11160 var scrolling = self.isScrolling; 11161 11162 self.endPoints = getPointerXY(e); 11163 self.dMs = Math.max(new Date().getTime() - self.startTime, 1); 11164 11165 self.$container.removeClass("fancybox-is-grabbing"); 11166 11167 $(document).off(".fb.touch"); 11168 11169 document.removeEventListener("scroll", self.onscroll, true); 11170 11171 if (self.requestId) { 11172 cancelAFrame(self.requestId); 11173 11174 self.requestId = null; 11175 } 11176 11177 self.isSwiping = false; 11178 self.isPanning = false; 11179 self.isZooming = false; 11180 self.isScrolling = false; 11181 11182 self.instance.isDragging = false; 11183 11184 if (self.canTap) { 11185 return self.onTap(e); 11186 } 11187 11188 self.speed = 100; 11189 11190 // Speed in px/ms 11191 self.velocityX = (self.distanceX / self.dMs) * 0.5; 11192 self.velocityY = (self.distanceY / self.dMs) * 0.5; 11193 11194 if (panning) { 11195 self.endPanning(); 11196 } else if (zooming) { 11197 self.endZooming(); 11198 } else { 11199 self.endSwiping(swiping, scrolling); 11200 } 11201 11202 return; 11203 }; 11204 11205 Guestures.prototype.endSwiping = function (swiping, scrolling) { 11206 var self = this, 11207 ret = false, 11208 len = self.instance.group.length, 11209 distanceX = Math.abs(self.distanceX), 11210 canAdvance = swiping == "x" && len > 1 && ((self.dMs > 130 && distanceX > 10) || distanceX > 50), 11211 speedX = 300; 11212 11213 self.sliderLastPos = null; 11214 11215 // Close if swiped vertically / navigate if horizontally 11216 if (swiping == "y" && !scrolling && Math.abs(self.distanceY) > 50) { 11217 // Continue vertical movement 11218 $.fancybox.animate( 11219 self.instance.current.$slide, { 11220 top: self.sliderStartPos.top + self.distanceY + self.velocityY * 150, 11221 opacity: 0 11222 }, 11223 200 11224 ); 11225 ret = self.instance.close(true, 250); 11226 } else if (canAdvance && self.distanceX > 0) { 11227 ret = self.instance.previous(speedX); 11228 } else if (canAdvance && self.distanceX < 0) { 11229 ret = self.instance.next(speedX); 11230 } 11231 11232 if (ret === false && (swiping == "x" || swiping == "y")) { 11233 self.instance.centerSlide(200); 11234 } 11235 11236 self.$container.removeClass("fancybox-is-sliding"); 11237 }; 11238 11239 // Limit panning from edges 11240 // ======================== 11241 Guestures.prototype.endPanning = function () { 11242 var self = this, 11243 newOffsetX, 11244 newOffsetY, 11245 newPos; 11246 11247 if (!self.contentLastPos) { 11248 return; 11249 } 11250 11251 if (self.opts.momentum === false || self.dMs > 350) { 11252 newOffsetX = self.contentLastPos.left; 11253 newOffsetY = self.contentLastPos.top; 11254 } else { 11255 // Continue movement 11256 newOffsetX = self.contentLastPos.left + self.velocityX * 500; 11257 newOffsetY = self.contentLastPos.top + self.velocityY * 500; 11258 } 11259 11260 newPos = self.limitPosition(newOffsetX, newOffsetY, self.contentStartPos.width, self.contentStartPos.height); 11261 11262 newPos.width = self.contentStartPos.width; 11263 newPos.height = self.contentStartPos.height; 11264 11265 $.fancybox.animate(self.$content, newPos, 366); 11266 }; 11267 11268 Guestures.prototype.endZooming = function () { 11269 var self = this; 11270 11271 var current = self.instance.current; 11272 11273 var newOffsetX, newOffsetY, newPos, reset; 11274 11275 var newWidth = self.newWidth; 11276 var newHeight = self.newHeight; 11277 11278 if (!self.contentLastPos) { 11279 return; 11280 } 11281 11282 newOffsetX = self.contentLastPos.left; 11283 newOffsetY = self.contentLastPos.top; 11284 11285 reset = { 11286 top: newOffsetY, 11287 left: newOffsetX, 11288 width: newWidth, 11289 height: newHeight, 11290 scaleX: 1, 11291 scaleY: 1 11292 }; 11293 11294 // Reset scalex/scaleY values; this helps for perfomance and does not break animation 11295 $.fancybox.setTranslate(self.$content, reset); 11296 11297 if (newWidth < self.canvasWidth && newHeight < self.canvasHeight) { 11298 self.instance.scaleToFit(150); 11299 } else if (newWidth > current.width || newHeight > current.height) { 11300 self.instance.scaleToActual(self.centerPointStartX, self.centerPointStartY, 150); 11301 } else { 11302 newPos = self.limitPosition(newOffsetX, newOffsetY, newWidth, newHeight); 11303 11304 $.fancybox.animate(self.$content, newPos, 150); 11305 } 11306 }; 11307 11308 Guestures.prototype.onTap = function (e) { 11309 var self = this; 11310 var $target = $(e.target); 11311 11312 var instance = self.instance; 11313 var current = instance.current; 11314 11315 var endPoints = (e && getPointerXY(e)) || self.startPoints; 11316 11317 var tapX = endPoints[0] ? endPoints[0].x - $(window).scrollLeft() - self.stagePos.left : 0; 11318 var tapY = endPoints[0] ? endPoints[0].y - $(window).scrollTop() - self.stagePos.top : 0; 11319 11320 var where; 11321 11322 var process = function (prefix) { 11323 var action = current.opts[prefix]; 11324 11325 if ($.isFunction(action)) { 11326 action = action.apply(instance, [current, e]); 11327 } 11328 11329 if (!action) { 11330 return; 11331 } 11332 11333 switch (action) { 11334 case "close": 11335 instance.close(self.startEvent); 11336 11337 break; 11338 11339 case "toggleControls": 11340 instance.toggleControls(); 11341 11342 break; 11343 11344 case "next": 11345 instance.next(); 11346 11347 break; 11348 11349 case "nextOrClose": 11350 if (instance.group.length > 1) { 11351 instance.next(); 11352 } else { 11353 instance.close(self.startEvent); 11354 } 11355 11356 break; 11357 11358 case "zoom": 11359 if (current.type == "image" && (current.isLoaded || current.$ghost)) { 11360 if (instance.canPan()) { 11361 instance.scaleToFit(); 11362 } else if (instance.isScaledDown()) { 11363 instance.scaleToActual(tapX, tapY); 11364 } else if (instance.group.length < 2) { 11365 instance.close(self.startEvent); 11366 } 11367 } 11368 11369 break; 11370 } 11371 }; 11372 11373 // Ignore right click 11374 if (e.originalEvent && e.originalEvent.button == 2) { 11375 return; 11376 } 11377 11378 // Skip if clicked on the scrollbar 11379 if (!$target.is("img") && tapX > $target[0].clientWidth + $target.offset().left) { 11380 return; 11381 } 11382 11383 // Check where is clicked 11384 if ($target.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container")) { 11385 where = "Outside"; 11386 } else if ($target.is(".fancybox-slide")) { 11387 where = "Slide"; 11388 } else if ( 11389 instance.current.$content && 11390 instance.current.$content 11391 .find($target) 11392 .addBack() 11393 .filter($target).length 11394 ) { 11395 where = "Content"; 11396 } else { 11397 return; 11398 } 11399 11400 // Check if this is a double tap 11401 if (self.tapped) { 11402 // Stop previously created single tap 11403 clearTimeout(self.tapped); 11404 self.tapped = null; 11405 11406 // Skip if distance between taps is too big 11407 if (Math.abs(tapX - self.tapX) > 50 || Math.abs(tapY - self.tapY) > 50) { 11408 return this; 11409 } 11410 11411 // OK, now we assume that this is a double-tap 11412 process("dblclick" + where); 11413 } else { 11414 // Single tap will be processed if user has not clicked second time within 300ms 11415 // or there is no need to wait for double-tap 11416 self.tapX = tapX; 11417 self.tapY = tapY; 11418 11419 if (current.opts["dblclick" + where] && current.opts["dblclick" + where] !== current.opts["click" + where]) { 11420 self.tapped = setTimeout(function () { 11421 self.tapped = null; 11422 11423 if (!instance.isAnimating) { 11424 process("click" + where); 11425 } 11426 }, 500); 11427 } else { 11428 process("click" + where); 11429 } 11430 } 11431 11432 return this; 11433 }; 11434 11435 $(document) 11436 .on("onActivate.fb", function (e, instance) { 11437 if (instance && !instance.Guestures) { 11438 instance.Guestures = new Guestures(instance); 11439 } 11440 }) 11441 .on("beforeClose.fb", function (e, instance) { 11442 if (instance && instance.Guestures) { 11443 instance.Guestures.destroy(); 11444 } 11445 }); 11446})(window, document, jQuery); 11447// ========================================================================== 11448// 11449// SlideShow 11450// Enables slideshow functionality 11451// 11452// Example of usage: 11453// $.fancybox.getInstance().SlideShow.start() 11454// 11455// ========================================================================== 11456(function (document, $) { 11457 "use strict"; 11458 11459 $.extend(true, $.fancybox.defaults, { 11460 btnTpl: { 11461 slideShow: '<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}">' + 11462 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg>' + 11463 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg>' + 11464 "</button>" 11465 }, 11466 slideShow: { 11467 autoStart: false, 11468 speed: 3000, 11469 progress: true 11470 } 11471 }); 11472 11473 var SlideShow = function (instance) { 11474 this.instance = instance; 11475 this.init(); 11476 }; 11477 11478 $.extend(SlideShow.prototype, { 11479 timer: null, 11480 isActive: false, 11481 $button: null, 11482 11483 init: function () { 11484 var self = this, 11485 instance = self.instance, 11486 opts = instance.group[instance.currIndex].opts.slideShow; 11487 11488 self.$button = instance.$refs.toolbar.find("[data-fancybox-play]").on("click", function () { 11489 self.toggle(); 11490 }); 11491 11492 if (instance.group.length < 2 || !opts) { 11493 self.$button.hide(); 11494 } else if (opts.progress) { 11495 self.$progress = $('<div class="fancybox-progress"></div>').appendTo(instance.$refs.inner); 11496 } 11497 }, 11498 11499 set: function (force) { 11500 var self = this, 11501 instance = self.instance, 11502 current = instance.current; 11503 11504 // Check if reached last element 11505 if (current && (force === true || current.opts.loop || instance.currIndex < instance.group.length - 1)) { 11506 if (self.isActive && current.contentType !== "video") { 11507 if (self.$progress) { 11508 $.fancybox.animate(self.$progress.show(), { 11509 scaleX: 1 11510 }, current.opts.slideShow.speed); 11511 } 11512 11513 self.timer = setTimeout(function () { 11514 if (!instance.current.opts.loop && instance.current.index == instance.group.length - 1) { 11515 instance.jumpTo(0); 11516 } else { 11517 instance.next(); 11518 } 11519 }, current.opts.slideShow.speed); 11520 } 11521 } else { 11522 self.stop(); 11523 instance.idleSecondsCounter = 0; 11524 instance.showControls(); 11525 } 11526 }, 11527 11528 clear: function () { 11529 var self = this; 11530 11531 clearTimeout(self.timer); 11532 11533 self.timer = null; 11534 11535 if (self.$progress) { 11536 self.$progress.removeAttr("style").hide(); 11537 } 11538 }, 11539 11540 start: function () { 11541 var self = this, 11542 current = self.instance.current; 11543 11544 if (current) { 11545 self.$button 11546 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_STOP) 11547 .removeClass("fancybox-button--play") 11548 .addClass("fancybox-button--pause"); 11549 11550 self.isActive = true; 11551 11552 if (current.isComplete) { 11553 self.set(true); 11554 } 11555 11556 self.instance.trigger("onSlideShowChange", true); 11557 } 11558 }, 11559 11560 stop: function () { 11561 var self = this, 11562 current = self.instance.current; 11563 11564 self.clear(); 11565 11566 self.$button 11567 .attr("title", (current.opts.i18n[current.opts.lang] || current.opts.i18n.en).PLAY_START) 11568 .removeClass("fancybox-button--pause") 11569 .addClass("fancybox-button--play"); 11570 11571 self.isActive = false; 11572 11573 self.instance.trigger("onSlideShowChange", false); 11574 11575 if (self.$progress) { 11576 self.$progress.removeAttr("style").hide(); 11577 } 11578 }, 11579 11580 toggle: function () { 11581 var self = this; 11582 11583 if (self.isActive) { 11584 self.stop(); 11585 } else { 11586 self.start(); 11587 } 11588 } 11589 }); 11590 11591 $(document).on({ 11592 "onInit.fb": function (e, instance) { 11593 if (instance && !instance.SlideShow) { 11594 instance.SlideShow = new SlideShow(instance); 11595 } 11596 }, 11597 11598 "beforeShow.fb": function (e, instance, current, firstRun) { 11599 var SlideShow = instance && instance.SlideShow; 11600 11601 if (firstRun) { 11602 if (SlideShow && current.opts.slideShow.autoStart) { 11603 SlideShow.start(); 11604 } 11605 } else if (SlideShow && SlideShow.isActive) { 11606 SlideShow.clear(); 11607 } 11608 }, 11609 11610 "afterShow.fb": function (e, instance, current) { 11611 var SlideShow = instance && instance.SlideShow; 11612 11613 if (SlideShow && SlideShow.isActive) { 11614 SlideShow.set(); 11615 } 11616 }, 11617 11618 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 11619 var SlideShow = instance && instance.SlideShow; 11620 11621 // "P" or Spacebar 11622 if (SlideShow && current.opts.slideShow && (keycode === 80 || keycode === 32) && !$(document.activeElement).is("button,a,input")) { 11623 keypress.preventDefault(); 11624 11625 SlideShow.toggle(); 11626 } 11627 }, 11628 11629 "beforeClose.fb onDeactivate.fb": function (e, instance) { 11630 var SlideShow = instance && instance.SlideShow; 11631 11632 if (SlideShow) { 11633 SlideShow.stop(); 11634 } 11635 } 11636 }); 11637 11638 // Page Visibility API to pause slideshow when window is not active 11639 $(document).on("visibilitychange", function () { 11640 var instance = $.fancybox.getInstance(), 11641 SlideShow = instance && instance.SlideShow; 11642 11643 if (SlideShow && SlideShow.isActive) { 11644 if (document.hidden) { 11645 SlideShow.clear(); 11646 } else { 11647 SlideShow.set(); 11648 } 11649 } 11650 }); 11651})(document, jQuery); 11652// ========================================================================== 11653// 11654// FullScreen 11655// Adds fullscreen functionality 11656// 11657// ========================================================================== 11658(function (document, $) { 11659 "use strict"; 11660 11661 // Collection of methods supported by user browser 11662 var fn = (function () { 11663 var fnMap = [ 11664 ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], 11665 // new WebKit 11666 [ 11667 "webkitRequestFullscreen", 11668 "webkitExitFullscreen", 11669 "webkitFullscreenElement", 11670 "webkitFullscreenEnabled", 11671 "webkitfullscreenchange", 11672 "webkitfullscreenerror" 11673 ], 11674 // old WebKit (Safari 5.1) 11675 [ 11676 "webkitRequestFullScreen", 11677 "webkitCancelFullScreen", 11678 "webkitCurrentFullScreenElement", 11679 "webkitCancelFullScreen", 11680 "webkitfullscreenchange", 11681 "webkitfullscreenerror" 11682 ], 11683 [ 11684 "mozRequestFullScreen", 11685 "mozCancelFullScreen", 11686 "mozFullScreenElement", 11687 "mozFullScreenEnabled", 11688 "mozfullscreenchange", 11689 "mozfullscreenerror" 11690 ], 11691 ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"] 11692 ]; 11693 11694 var ret = {}; 11695 11696 for (var i = 0; i < fnMap.length; i++) { 11697 var val = fnMap[i]; 11698 11699 if (val && val[1] in document) { 11700 for (var j = 0; j < val.length; j++) { 11701 ret[fnMap[0][j]] = val[j]; 11702 } 11703 11704 return ret; 11705 } 11706 } 11707 11708 return false; 11709 })(); 11710 11711 if (fn) { 11712 var FullScreen = { 11713 request: function (elem) { 11714 elem = elem || document.documentElement; 11715 11716 elem[fn.requestFullscreen](elem.ALLOW_KEYBOARD_INPUT); 11717 }, 11718 exit: function () { 11719 document[fn.exitFullscreen](); 11720 }, 11721 toggle: function (elem) { 11722 elem = elem || document.documentElement; 11723 11724 if (this.isFullscreen()) { 11725 this.exit(); 11726 } else { 11727 this.request(elem); 11728 } 11729 }, 11730 isFullscreen: function () { 11731 return Boolean(document[fn.fullscreenElement]); 11732 }, 11733 enabled: function () { 11734 return Boolean(document[fn.fullscreenEnabled]); 11735 } 11736 }; 11737 11738 $.extend(true, $.fancybox.defaults, { 11739 btnTpl: { 11740 fullScreen: '<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}">' + 11741 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg>' + 11742 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg>' + 11743 "</button>" 11744 }, 11745 fullScreen: { 11746 autoStart: false 11747 } 11748 }); 11749 11750 $(document).on(fn.fullscreenchange, function () { 11751 var isFullscreen = FullScreen.isFullscreen(), 11752 instance = $.fancybox.getInstance(); 11753 11754 if (instance) { 11755 // If image is zooming, then force to stop and reposition properly 11756 if (instance.current && instance.current.type === "image" && instance.isAnimating) { 11757 instance.isAnimating = false; 11758 11759 instance.update(true, true, 0); 11760 11761 if (!instance.isComplete) { 11762 instance.complete(); 11763 } 11764 } 11765 11766 instance.trigger("onFullscreenChange", isFullscreen); 11767 11768 instance.$refs.container.toggleClass("fancybox-is-fullscreen", isFullscreen); 11769 11770 instance.$refs.toolbar 11771 .find("[data-fancybox-fullscreen]") 11772 .toggleClass("fancybox-button--fsenter", !isFullscreen) 11773 .toggleClass("fancybox-button--fsexit", isFullscreen); 11774 } 11775 }); 11776 } 11777 11778 $(document).on({ 11779 "onInit.fb": function (e, instance) { 11780 var $container; 11781 11782 if (!fn) { 11783 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").remove(); 11784 11785 return; 11786 } 11787 11788 if (instance && instance.group[instance.currIndex].opts.fullScreen) { 11789 $container = instance.$refs.container; 11790 11791 $container.on("click.fb-fullscreen", "[data-fancybox-fullscreen]", function (e) { 11792 e.stopPropagation(); 11793 e.preventDefault(); 11794 11795 FullScreen.toggle(); 11796 }); 11797 11798 if (instance.opts.fullScreen && instance.opts.fullScreen.autoStart === true) { 11799 FullScreen.request(); 11800 } 11801 11802 // Expose API 11803 instance.FullScreen = FullScreen; 11804 } else if (instance) { 11805 instance.$refs.toolbar.find("[data-fancybox-fullscreen]").hide(); 11806 } 11807 }, 11808 11809 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 11810 // "F" 11811 if (instance && instance.FullScreen && keycode === 70) { 11812 keypress.preventDefault(); 11813 11814 instance.FullScreen.toggle(); 11815 } 11816 }, 11817 11818 "beforeClose.fb": function (e, instance) { 11819 if (instance && instance.FullScreen && instance.$refs.container.hasClass("fancybox-is-fullscreen")) { 11820 FullScreen.exit(); 11821 } 11822 } 11823 }); 11824})(document, jQuery); 11825// ========================================================================== 11826// 11827// Thumbs 11828// Displays thumbnails in a grid 11829// 11830// ========================================================================== 11831(function (document, $) { 11832 "use strict"; 11833 11834 var CLASS = "fancybox-thumbs", 11835 CLASS_ACTIVE = CLASS + "-active"; 11836 11837 // Make sure there are default values 11838 $.fancybox.defaults = $.extend( 11839 true, { 11840 btnTpl: { 11841 thumbs: '<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}">' + 11842 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg>' + 11843 "</button>" 11844 }, 11845 thumbs: { 11846 autoStart: false, // Display thumbnails on opening 11847 hideOnClose: true, // Hide thumbnail grid when closing animation starts 11848 parentEl: ".fancybox-container", // Container is injected into this element 11849 axis: "y" // Vertical (y) or horizontal (x) scrolling 11850 } 11851 }, 11852 $.fancybox.defaults 11853 ); 11854 11855 var FancyThumbs = function (instance) { 11856 this.init(instance); 11857 }; 11858 11859 $.extend(FancyThumbs.prototype, { 11860 $button: null, 11861 $grid: null, 11862 $list: null, 11863 isVisible: false, 11864 isActive: false, 11865 11866 init: function (instance) { 11867 var self = this, 11868 group = instance.group, 11869 enabled = 0; 11870 11871 self.instance = instance; 11872 self.opts = group[instance.currIndex].opts.thumbs; 11873 11874 instance.Thumbs = self; 11875 11876 self.$button = instance.$refs.toolbar.find("[data-fancybox-thumbs]"); 11877 11878 // Enable thumbs if at least two group items have thumbnails 11879 for (var i = 0, len = group.length; i < len; i++) { 11880 if (group[i].thumb) { 11881 enabled++; 11882 } 11883 11884 if (enabled > 1) { 11885 break; 11886 } 11887 } 11888 11889 if (enabled > 1 && !!self.opts) { 11890 self.$button.removeAttr("style").on("click", function () { 11891 self.toggle(); 11892 }); 11893 11894 self.isActive = true; 11895 } else { 11896 self.$button.hide(); 11897 } 11898 }, 11899 11900 create: function () { 11901 var self = this, 11902 instance = self.instance, 11903 parentEl = self.opts.parentEl, 11904 list = [], 11905 src; 11906 11907 if (!self.$grid) { 11908 // Create main element 11909 self.$grid = $('<div class="' + CLASS + " " + CLASS + "-" + self.opts.axis + '"></div>').appendTo( 11910 instance.$refs.container 11911 .find(parentEl) 11912 .addBack() 11913 .filter(parentEl) 11914 ); 11915 11916 // Add "click" event that performs gallery navigation 11917 self.$grid.on("click", "a", function () { 11918 instance.jumpTo($(this).attr("data-index")); 11919 }); 11920 } 11921 11922 // Build the list 11923 if (!self.$list) { 11924 self.$list = $('<div class="' + CLASS + '__list">').appendTo(self.$grid); 11925 } 11926 11927 $.each(instance.group, function (i, item) { 11928 src = item.thumb; 11929 11930 if (!src && item.type === "image") { 11931 src = item.src; 11932 } 11933 11934 list.push( 11935 '<a href="javascript:;" tabindex="0" data-index="' + 11936 i + 11937 '"' + 11938 (src && src.length ? ' style="background-image:url(' + src + ')"' : 'class="fancybox-thumbs-missing"') + 11939 "></a>" 11940 ); 11941 }); 11942 11943 self.$list[0].innerHTML = list.join(""); 11944 11945 if (self.opts.axis === "x") { 11946 // Set fixed width for list element to enable horizontal scrolling 11947 self.$list.width( 11948 parseInt(self.$grid.css("padding-right"), 10) + 11949 instance.group.length * 11950 self.$list 11951 .children() 11952 .eq(0) 11953 .outerWidth(true) 11954 ); 11955 } 11956 }, 11957 11958 focus: function (duration) { 11959 var self = this, 11960 $list = self.$list, 11961 $grid = self.$grid, 11962 thumb, 11963 thumbPos; 11964 11965 if (!self.instance.current) { 11966 return; 11967 } 11968 11969 thumb = $list 11970 .children() 11971 .removeClass(CLASS_ACTIVE) 11972 .filter('[data-index="' + self.instance.current.index + '"]') 11973 .addClass(CLASS_ACTIVE); 11974 11975 thumbPos = thumb.position(); 11976 11977 // Check if need to scroll to make current thumb visible 11978 if (self.opts.axis === "y" && (thumbPos.top < 0 || thumbPos.top > $list.height() - thumb.outerHeight())) { 11979 $list.stop().animate({ 11980 scrollTop: $list.scrollTop() + thumbPos.top 11981 }, 11982 duration 11983 ); 11984 } else if ( 11985 self.opts.axis === "x" && 11986 (thumbPos.left < $grid.scrollLeft() || thumbPos.left > $grid.scrollLeft() + ($grid.width() - thumb.outerWidth())) 11987 ) { 11988 $list 11989 .parent() 11990 .stop() 11991 .animate({ 11992 scrollLeft: thumbPos.left 11993 }, 11994 duration 11995 ); 11996 } 11997 }, 11998 11999 update: function () { 12000 var that = this; 12001 that.instance.$refs.container.toggleClass("fancybox-show-thumbs", this.isVisible); 12002 12003 if (that.isVisible) { 12004 if (!that.$grid) { 12005 that.create(); 12006 } 12007 12008 that.instance.trigger("onThumbsShow"); 12009 12010 that.focus(0); 12011 } else if (that.$grid) { 12012 that.instance.trigger("onThumbsHide"); 12013 } 12014 12015 // Update content position 12016 that.instance.update(); 12017 }, 12018 12019 hide: function () { 12020 this.isVisible = false; 12021 this.update(); 12022 }, 12023 12024 show: function () { 12025 this.isVisible = true; 12026 this.update(); 12027 }, 12028 12029 toggle: function () { 12030 this.isVisible = !this.isVisible; 12031 this.update(); 12032 } 12033 }); 12034 12035 $(document).on({ 12036 "onInit.fb": function (e, instance) { 12037 var Thumbs; 12038 12039 if (instance && !instance.Thumbs) { 12040 Thumbs = new FancyThumbs(instance); 12041 12042 if (Thumbs.isActive && Thumbs.opts.autoStart === true) { 12043 Thumbs.show(); 12044 } 12045 } 12046 }, 12047 12048 "beforeShow.fb": function (e, instance, item, firstRun) { 12049 var Thumbs = instance && instance.Thumbs; 12050 12051 if (Thumbs && Thumbs.isVisible) { 12052 Thumbs.focus(firstRun ? 0 : 250); 12053 } 12054 }, 12055 12056 "afterKeydown.fb": function (e, instance, current, keypress, keycode) { 12057 var Thumbs = instance && instance.Thumbs; 12058 12059 // "G" 12060 if (Thumbs && Thumbs.isActive && keycode === 71) { 12061 keypress.preventDefault(); 12062 12063 Thumbs.toggle(); 12064 } 12065 }, 12066 12067 "beforeClose.fb": function (e, instance) { 12068 var Thumbs = instance && instance.Thumbs; 12069 12070 if (Thumbs && Thumbs.isVisible && Thumbs.opts.hideOnClose !== false) { 12071 Thumbs.$grid.hide(); 12072 } 12073 } 12074 }); 12075})(document, jQuery); 12076//// ========================================================================== 12077// 12078// Share 12079// Displays simple form for sharing current url 12080// 12081// ========================================================================== 12082(function (document, $) { 12083 "use strict"; 12084 12085 $.extend(true, $.fancybox.defaults, { 12086 btnTpl: { 12087 share: '<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}">' + 12088 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg>' + 12089 "</button>" 12090 }, 12091 share: { 12092 url: function (instance, item) { 12093 return ( 12094 (!instance.currentHash && !(item.type === "inline" || item.type === "html") ? item.origSrc || item.src : false) || window.location 12095 ); 12096 }, 12097 tpl: '<div class="fancybox-share">' + 12098 "<h1>{{SHARE}}</h1>" + 12099 "<p>" + 12100 '<a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}">' + 12101 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg>' + 12102 "<span>Facebook</span>" + 12103 "</a>" + 12104 '<a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}">' + 12105 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg>' + 12106 "<span>Twitter</span>" + 12107 "</a>" + 12108 '<a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}">' + 12109 '<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg>' + 12110 "<span>Pinterest</span>" + 12111 "</a>" + 12112 "</p>" + 12113 '<p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p>' + 12114 "</div>" 12115 } 12116 }); 12117 12118 function escapeHtml(string) { 12119 var entityMap = { 12120 "&": "&", 12121 "<": "<", 12122 ">": ">", 12123 '"': """, 12124 "'": "'", 12125 "/": "/", 12126 "`": "`", 12127 "=": "=" 12128 }; 12129 12130 return String(string).replace(/[&<>"'`=\/]/g, function (s) { 12131 return entityMap[s]; 12132 }); 12133 } 12134 12135 $(document).on("click", "[data-fancybox-share]", function () { 12136 var instance = $.fancybox.getInstance(), 12137 current = instance.current || null, 12138 url, 12139 tpl; 12140 12141 if (!current) { 12142 return; 12143 } 12144 12145 if ($.type(current.opts.share.url) === "function") { 12146 url = current.opts.share.url.apply(current, [instance, current]); 12147 } 12148 12149 tpl = current.opts.share.tpl 12150 .replace(/\{\{media\}\}/g, current.type === "image" ? encodeURIComponent(current.src) : "") 12151 .replace(/\{\{url\}\}/g, encodeURIComponent(url)) 12152 .replace(/\{\{url_raw\}\}/g, escapeHtml(url)) 12153 .replace(/\{\{descr\}\}/g, instance.$caption ? encodeURIComponent(instance.$caption.text()) : ""); 12154 12155 $.fancybox.open({ 12156 src: instance.translate(instance, tpl), 12157 type: "html", 12158 opts: { 12159 touch: false, 12160 animationEffect: false, 12161 afterLoad: function (shareInstance, shareCurrent) { 12162 // Close self if parent instance is closing 12163 instance.$refs.container.one("beforeClose.fb", function () { 12164 shareInstance.close(null, 0); 12165 }); 12166 12167 // Opening links in a popup window 12168 shareCurrent.$content.find(".fancybox-share__button").click(function () { 12169 window.open(this.href, "Share", "width=550, height=450"); 12170 return false; 12171 }); 12172 }, 12173 mobile: { 12174 autoFocus: false 12175 } 12176 } 12177 }); 12178 }); 12179})(document, jQuery); 12180// ========================================================================== 12181// 12182// Hash 12183// Enables linking to each modal 12184// 12185// ========================================================================== 12186(function (window, document, $) { 12187 "use strict"; 12188 12189 // Simple $.escapeSelector polyfill (for jQuery prior v3) 12190 if (!$.escapeSelector) { 12191 $.escapeSelector = function (sel) { 12192 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 12193 var fcssescape = function (ch, asCodePoint) { 12194 if (asCodePoint) { 12195 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 12196 if (ch === "\0") { 12197 return "\uFFFD"; 12198 } 12199 12200 // Control characters and (dependent upon position) numbers get escaped as code points 12201 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; 12202 } 12203 12204 // Other potentially-special ASCII characters get backslash-escaped 12205 return "\\" + ch; 12206 }; 12207 12208 return (sel + "").replace(rcssescape, fcssescape); 12209 }; 12210 } 12211 12212 // Get info about gallery name and current index from url 12213 function parseUrl() { 12214 var hash = window.location.hash.substr(1), 12215 rez = hash.split("-"), 12216 index = rez.length > 1 && /^\+?\d+$/.test(rez[rez.length - 1]) ? parseInt(rez.pop(-1), 10) || 1 : 1, 12217 gallery = rez.join("-"); 12218 12219 return { 12220 hash: hash, 12221 /* Index is starting from 1 */ 12222 index: index < 1 ? 1 : index, 12223 gallery: gallery 12224 }; 12225 } 12226 12227 // Trigger click evnt on links to open new fancyBox instance 12228 function triggerFromUrl(url) { 12229 if (url.gallery !== "") { 12230 // If we can find element matching 'data-fancybox' atribute, 12231 // then triggering click event should start fancyBox 12232 $("[data-fancybox='" + $.escapeSelector(url.gallery) + "']") 12233 .eq(url.index - 1) 12234 .focus() 12235 .trigger("click.fb-start"); 12236 } 12237 } 12238 12239 // Get gallery name from current instance 12240 function getGalleryID(instance) { 12241 var opts, ret; 12242 12243 if (!instance) { 12244 return false; 12245 } 12246 12247 opts = instance.current ? instance.current.opts : instance.opts; 12248 ret = opts.hash || (opts.$orig ? opts.$orig.data("fancybox") || opts.$orig.data("fancybox-trigger") : ""); 12249 12250 return ret === "" ? false : ret; 12251 } 12252 12253 // Start when DOM becomes ready 12254 $(function () { 12255 // Check if user has disabled this module 12256 if ($.fancybox.defaults.hash === false) { 12257 return; 12258 } 12259 12260 // Update hash when opening/closing fancyBox 12261 $(document).on({ 12262 "onInit.fb": function (e, instance) { 12263 var url, gallery; 12264 12265 if (instance.group[instance.currIndex].opts.hash === false) { 12266 return; 12267 } 12268 12269 url = parseUrl(); 12270 gallery = getGalleryID(instance); 12271 12272 // Make sure gallery start index matches index from hash 12273 if (gallery && url.gallery && gallery == url.gallery) { 12274 instance.currIndex = url.index - 1; 12275 } 12276 }, 12277 12278 "beforeShow.fb": function (e, instance, current, firstRun) { 12279 var gallery; 12280 12281 if (!current || current.opts.hash === false) { 12282 return; 12283 } 12284 12285 // Check if need to update window hash 12286 gallery = getGalleryID(instance); 12287 12288 if (!gallery) { 12289 return; 12290 } 12291 12292 // Variable containing last hash value set by fancyBox 12293 // It will be used to determine if fancyBox needs to close after hash change is detected 12294 instance.currentHash = gallery + (instance.group.length > 1 ? "-" + (current.index + 1) : ""); 12295 12296 // If current hash is the same (this instance most likely is opened by hashchange), then do nothing 12297 if (window.location.hash === "#" + instance.currentHash) { 12298 return; 12299 } 12300 12301 if (firstRun && !instance.origHash) { 12302 instance.origHash = window.location.hash; 12303 } 12304 12305 if (instance.hashTimer) { 12306 clearTimeout(instance.hashTimer); 12307 } 12308 12309 // Update hash 12310 instance.hashTimer = setTimeout(function () { 12311 if ("replaceState" in window.history) { 12312 window.history[firstRun ? "pushState" : "replaceState"]({}, 12313 document.title, 12314 window.location.pathname + window.location.search + "#" + instance.currentHash 12315 ); 12316 12317 if (firstRun) { 12318 instance.hasCreatedHistory = true; 12319 } 12320 } else { 12321 window.location.hash = instance.currentHash; 12322 } 12323 12324 instance.hashTimer = null; 12325 }, 300); 12326 }, 12327 12328 "beforeClose.fb": function (e, instance, current) { 12329 if (!current || current.opts.hash === false) { 12330 return; 12331 } 12332 12333 clearTimeout(instance.hashTimer); 12334 12335 // Goto previous history entry 12336 if (instance.currentHash && instance.hasCreatedHistory) { 12337 window.history.back(); 12338 } else if (instance.currentHash) { 12339 if ("replaceState" in window.history) { 12340 window.history.replaceState({}, document.title, window.location.pathname + window.location.search + (instance.origHash || "")); 12341 } else { 12342 window.location.hash = instance.origHash; 12343 } 12344 } 12345 12346 instance.currentHash = null; 12347 } 12348 }); 12349 12350 // Check if need to start/close after url has changed 12351 $(window).on("hashchange.fb", function () { 12352 var url = parseUrl(), 12353 fb = null; 12354 12355 // Find last fancyBox instance that has "hash" 12356 $.each( 12357 $(".fancybox-container") 12358 .get() 12359 .reverse(), 12360 function (index, value) { 12361 var tmp = $(value).data("FancyBox"); 12362 12363 if (tmp && tmp.currentHash) { 12364 fb = tmp; 12365 return false; 12366 } 12367 } 12368 ); 12369 12370 if (fb) { 12371 // Now, compare hash values 12372 if (fb.currentHash !== url.gallery + "-" + url.index && !(url.index === 1 && fb.currentHash == url.gallery)) { 12373 fb.currentHash = null; 12374 12375 fb.close(); 12376 } 12377 } else if (url.gallery !== "") { 12378 triggerFromUrl(url); 12379 } 12380 }); 12381 12382 // Check current hash and trigger click event on matching element to start fancyBox, if needed 12383 setTimeout(function () { 12384 if (!$.fancybox.getInstance()) { 12385 triggerFromUrl(parseUrl()); 12386 } 12387 }, 50); 12388 }); 12389})(window, document, jQuery); 12390// ========================================================================== 12391// 12392// Wheel 12393// Basic mouse weheel support for gallery navigation 12394// 12395// ========================================================================== 12396(function (document, $) { 12397 "use strict"; 12398 12399 var prevTime = new Date().getTime(); 12400 12401 $(document).on({ 12402 "onInit.fb": function (e, instance, current) { 12403 instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function (e) { 12404 var current = instance.current, 12405 currTime = new Date().getTime(); 12406 12407 if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) { 12408 return; 12409 } 12410 12411 e.preventDefault(); 12412 e.stopPropagation(); 12413 12414 if (current.$slide.hasClass("fancybox-animated")) { 12415 return; 12416 } 12417 12418 e = e.originalEvent || e; 12419 12420 if (currTime - prevTime < 250) { 12421 return; 12422 } 12423 12424 prevTime = currTime; 12425 12426 instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"](); 12427 }); 12428 } 12429 }); 12430})(document, jQuery); 12431define("fancybox", ["jquery"], function(){}); 12432 12433/** 12434 * REQUIRE CONFIGURATION 12435 * All JavaScript resources are defined referenced in the paths object.
12436 * The shim object configures dependencies for each module. 12437 */ 12438 require.config({ 12439 baseUrl: '/_ui/desktop/common/js/scripts/global', 12440 paths: { 12441 main: '../../scripts/global/main', 12442 aight: '../../bower_components/aight/aight', 12443 aightD3: '../../bower_components/aight/aight.d3', 12444 d3: '../../bower_components/d3/d3', 12445 fancyTree: '../../bower_components/fancytree/src/jquery.fancytree', 12446 domReady: '../../bower_components/requirejs-domready/domReady', 12447 hogan: '../../bower_components/hogan/web/builds/2.0.0/hogan-2.0.0.amd', 12448 jquery: '../../bower_components/jquery/dist/jquery.min', 12449 jqueryUi: '../../bower_components/jquery-ui/jquery-ui.min', 12450 //bootstrapTransition: '../../bower_components/sass-bootstrap/js/transition', 12451 modernizr: '../../bower_components/modernizr/modernizr', 12452 //placeholder: '../../bower_components/jquery-placeholder/jquery.placeholder', 12453 12454 json3: '../../scripts/plugins/json3.min', 12455 12456 12457 typeAhead: '../../bower_components/typeahead.js/dist/typeahead', 12458 // global scripts 12459 app: '../../scripts/global/app', 12460 header: '../../scripts/components/header', 12461 qasMain: '/_ui/desktop/common/js/qas-ic', 12462 qasVerification: '/_ui/desktop/common/js/qas-ic.verification', 12463 qasLanguage: '/_ui/desktop/common/js/en-us', 12464 // plugins 12465 accordion: '../../scripts/plugins/accordion', 12466 ag: '../../scripts/plugins/ag', 12467 agUtils: '../../scripts/plugins/ag.utils', 12468 agValidate: '../../scripts/plugins/ag.validate', 12469 12470 cookie: '../../scripts/plugins/jquery.cookie-1.4.0', 12471 customForm: '../../scripts/plugins/jquery.customform', 12472 easyZoom: '../../scripts/plugins/easyzoom.min', 12473 fancybox: '../../scripts/plugins/jquery.fancybox', 12474 formValidation: '../../scripts/plugins/form-validation', 12475 pubSub: '../../scripts/plugins/ba-tiny-pubsub.min', 12476 selectBoxIt: '../../scripts/plugins/jquery.selectBoxIt.min', 12477 gaAmd: '../../scripts/plugins/gaamd', 12478 daterangepicker: '../../scripts/plugins/daterangepicker', 12479 dateTimeRangePicker: '../../scripts/plugins/datetimepicker.min', 12480 moment: '../../scripts/plugins/moment.min', 12481 chartJSDateAdapter: '../../scripts/plugins/chartjs-adapter-date-fns.bundle.min' 12482 //powerbi-client: '../../scripts/plugins/powerbi' 12483 }, 12484 shim: { 12485 'accordion': { 12486 deps: ['jquery'] 12487 }, 12488 'ag': { 12489 deps: ['jquery'] 12490 }, 12491 'agUtils': { 12492 deps: ['ag'] 12493 }, 12494 'agValidate': { 12495 deps: ['ag'] 12496 }, 12497 'aightD3': { 12498 deps: ['aight'] 12499 }, 12500 'fancyTree': { 12501 deps: ['jquery', 'jqueryUi'] 12502 }, 12503 12504 'cookie': { 12505 deps: ['jquery'] 12506 }, 12507 'customForm': { 12508 deps: ['jquery', 'domReady'] 12509 }, 12510 'd3': { 12511 exports: 'd3' 12512 }, 12513 12514 'easyZoom': { 12515 deps: ['jquery'] 12516 }, 12517 'hogan': { 12518 deps: ['jquery'] 12519 }, 12520 'fancybox': { 12521 deps: ['jquery'] 12522 }, 12523 'formValidation': { 12524 deps: ['agUtils','agValidate'] 12525 }, 12526 'jqueryUi': { 12527 deps: ['jquery'], 12528 exports: 'jQuery.ui' 12529 }, 12530 //'placeholder': { 12531 // deps: ['jquery'] 12532 //}, 12533 'pubSub': { 12534 deps: ['jquery'] 12535 }, 12536 'selectBoxIt': { 12537 deps: ['jqueryUi'] 12538 }, 12539 'typeAhead': { 12540 deps: ['hogan', 'jquery'] 12541 }, 12542 'qasVerification': { 12543 deps: ['qasMain'] 12544 }, 12545 'qasLanguage': { 12546 deps: ['qasMain'] 12547 }, 12548 'daterangepicker': { 12549 deps: ['jquery', 'moment'] 12550 }, 12551 'dateTimeRangePicker': { 12552 deps: ['jquery', 'moment'] 12553 }, 12554 }, 12555 map: { 12556 '*': { 12557 'd3': (function ieOnly(ie, nonIe) { 12558 if (typeof(navigator) === 'undefined') { 12559 return nonIe; 12560 } 12561 if (navigator.appName === 'Microsoft Internet Explorer') { 12562 return ie; 12563 } 12564 return nonIe; 12565 })('r2d3', 'd3') 12566 } 12567 } 12568}); 12569 12570/** 12571* The require module is invoked globally on every page. 12572*/ 12573require(['jquery', 12574 'domReady', 12575 'app', 12576 'gaAmd', 12577 'daterangepicker', 12578 'modernizr', 12579 'customForm', 12580 'selectBoxIt', 12581 'formValidation', 12582 'fancybox' 12583], function($, domReady, app) { 12584 12585/* Fix for IE10/Window Phone 8 viewport 12586* 12587* Internet Explorer 10 doesn't differentiate device width from viewport width, 12588* and thus doesn't properly apply the media queries in Bootstrap's CSS.
12589* app.win8IE10Fix() solves this issue (http://getbootstrap.com/getting-started/#browsers) 12590 */ 12591app.win8IE10Fix(); 12592 12593domReady(function() { 12594 12595 12596 /* Styling Select Box */ 12597 //Calls the selectBoxIt method on your HTML select box. 12598 $("select").selectBoxIt(); 12599 12600 //app.handleNavigationPrimary(); 12601 12602 app.placeholder(); 12603 12604 app.handleZebraDisplay(); 12605 12606 app.handleOffCanvas(); 12607 12608 app.handleModalDisplay(); 12609 12610 //app.setUpTypeAhead(); 12611 12612}); 12613}); 12614 12615define("main", function(){}); 12616 12617 12618//# sourceMappingURL=main.js.map
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.