!function(t,e,n){"function"==typeof define&&define.amd?define(["jquery"],function(o){return n(o,t,e),o.mobile}):n(t.jQuery,t,e)}(this,document,function(t,e,n){!function(t,e,n,o){function i(t){for(;t&&"undefined"!=typeof t.originalEvent;)t=t.originalEvent;return t}function c(e,n){var c,a,s,r,l,u,f,h,d,v=e.type;if(e=t.Event(e),e.type=n,c=e.originalEvent,a=t.event.props,v.search(/^(mouse|click)/)>-1&&(a=X),c)for(f=a.length,r;f;)r=a[--f],e[r]=c[r];if(v.search(/mouse(down|up)|click/)>-1&&!e.which&&(e.which=1),-1!==v.search(/^touch/)&&(s=i(c),v=s.touches,l=s.changedTouches,u=v&&v.length?v[0]:l&&l.length?l[0]:o))for(h=0,d=P.length;d>h;h++)r=P[h],e[r]=u[r];return e}function a(e){for(var n,o,i={};e;){n=t.data(e,E);for(o in n)n[o]&&(i[o]=i.hasVirtualBinding=!0);e=e.parentNode}return i}function s(e,n){for(var o;e;){if(o=t.data(e,E),o&&(!n||o[n]))return e;e=e.parentNode}return null}function r(){Q=!1}function l(){Q=!0}function u(){N=0,q.length=0,H=!1,l()}function f(){r()}function h(){d(),M=setTimeout(function(){M=0,u()},t.vmouse.resetTimerDuration)}function d(){M&&(clearTimeout(M),M=0)}function v(e,n,o){var i;return(o&&o[e]||!o&&s(n.target,e))&&(i=c(n,e),t(n.target).trigger(i)),i}function p(e){var n,o=t.data(e.target,j);H||N&&N===o||(n=v("v"+e.type,e),n&&(n.isDefaultPrevented()&&e.preventDefault(),n.isPropagationStopped()&&e.stopPropagation(),n.isImmediatePropagationStopped()&&e.stopImmediatePropagation()))}function m(e){var n,o,c,s=i(e).touches;s&&1===s.length&&(n=e.target,o=a(n),o.hasVirtualBinding&&(N=F++,t.data(n,j,N),d(),f(),I=!1,c=i(e).touches[0],C=c.pageX,R=c.pageY,v("vmouseover",e,o),v("vmousedown",e,o)))}function g(t){Q||(I||v("vmousecancel",t,a(t.target)),I=!0,h())}function k(e){if(!Q){var n=i(e).touches[0],o=I,c=t.vmouse.moveDistanceThreshold,s=a(e.target);I=I||Math.abs(n.pageX-C)>c||Math.abs(n.pageY-R)>c,I&&!o&&v("vmousecancel",e,s),v("vmousemove",e,s),h()}}function w(t){if(!Q){l();var e,n,o=a(t.target);v("vmouseup",t,o),I||(e=v("vclick",t,o),e&&e.isDefaultPrevented()&&(n=i(t).changedTouches[0],q.push({touchID:N,x:n.clientX,y:n.clientY}),H=!0)),v("vmouseout",t,o),I=!1,h()}}function y(e){var n,o=t.data(e,E);if(o)for(n in o)if(o[n])return!0;return!1}function b(){}function x(e){var n=e.substr(1);return{setup:function(){y(this)||t.data(this,E,{});var o=t.data(this,E);o[e]=!0,Y[e]=(Y[e]||0)+1,1===Y[e]&&B.bind(n,p),t(this).bind(n,b),A&&(Y.touchstart=(Y.touchstart||0)+1,1===Y.touchstart&&B.bind("touchstart",m).bind("touchend",w).bind("touchmove",k).bind("scroll",g))},teardown:function(){--Y[e],Y[e]||B.unbind(n,p),A&&(--Y.touchstart,Y.touchstart||B.unbind("touchstart",m).unbind("touchmove",k).unbind("touchend",w).unbind("scroll",g));var o=t(this),i=t.data(this,E);i&&(i[e]=!1),o.unbind(n,b),y(this)||o.removeData(E)}}}var T,D,E="virtualMouseBindings",j="virtualTouchID",O="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),P="clientX clientY pageX pageY screenX screenY".split(" "),S=t.event.mouseHooks?t.event.mouseHooks.props:[],X=t.event.props.concat(S),Y={},M=0,C=0,R=0,I=!1,q=[],H=!1,Q=!1,A="addEventListener"in n,B=t(n),F=1,N=0;for(t.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500},D=0;D<O.length;D++)t.event.special[O[D]]=x(O[D]);A&&n.addEventListener("click",function(e){var n,o,i,c,a,s,r=q.length,l=e.target;if(r)for(n=e.clientX,o=e.clientY,T=t.vmouse.clickDistanceThreshold,i=l;i;){for(c=0;r>c;c++)if(a=q[c],s=0,i===l&&Math.abs(a.x-n)<T&&Math.abs(a.y-o)<T||t.data(i,j)===a.touchID)return e.preventDefault(),void e.stopPropagation();i=i.parentNode}},!0)}(t,e,n)}),function(t){var e=t.event.dispatch||t.event.handle,n=t.event.special,o="D"+ +new Date,i="D"+(+new Date+1);n.scrollstart={setup:function(i){var c,a=t.extend({latency:n.scrollstop.latency},i),s=function(t){var n=this,o=arguments;c?clearTimeout(c):(t.type="scrollstart",e.apply(n,o)),c=setTimeout(function(){c=null},a.latency)};t(this).bind("scroll",s).data(o,s)},teardown:function(){t(this).unbind("scroll",t(this).data(o))}},n.scrollstop={latency:250,setup:function(o){var c,a=t.extend({latency:n.scrollstop.latency},o),s=function(t){var n=this,o=arguments;c&&clearTimeout(c),c=setTimeout(function(){c=null,t.type="scrollstop",e.apply(n,o)},a.latency)};t(this).bind("scroll",s).data(i,s)},teardown:function(){t(this).unbind("scroll",t(this).data(i))}}}(jQuery),function(t){t.fn.caret=function(t){var e=this[0],n=e&&"true"===e.contentEditable;if(0!=arguments.length){if(e){if(-1==t&&(t=this[n?"text":"val"]().length),window.getSelection)n?(e.focus(),window.getSelection().collapse(e.firstChild,t)):e.setSelectionRange(t,t);else if(document.body.createTextRange)if(n){var o=document.body.createTextRange();o.moveToElementText(e),o.moveStart("character",t),o.collapse(!0),o.select()}else{var o=e.createTextRange();o.move("character",t),o.select()}n||e.focus()}return this}if(e){if(window.getSelection){if(n){e.focus();var i=window.getSelection().getRangeAt(0),c=i.cloneRange();return c.selectNodeContents(e),c.setEnd(i.endContainer,i.endOffset),c.toString().length}return e.selectionStart}if(document.selection){if(e.focus(),n){var i=document.selection.createRange(),c=document.body.createTextRange();return c.moveToElementText(e),c.setEndPoint("EndToEnd",i),c.text.length}var t=0,o=e.createTextRange(),c=document.selection.createRange().duplicate(),a=c.getBookmark();for(o.moveToBookmark(a);0!==o.moveStart("character",-1);)t++;return t}if(e.selectionStart)return e.selectionStart}}}(jQuery),function(t){var e=t([]),n=2500,o=30,i=40,c=[],a={},s="input:not([type=submit]),select,textarea",r=function(e){var n,i;for(n=0,i=c.length;i>n;n++)if(Math.abs(e.pageX-c[n].x)<o&&Math.abs(e.pageY-c[n].y)<o){e.target=null,e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault();var a=t(e.target);a.is(s)&&(e.target=null)}},l=!1;"ontouchstart"in window&&(l=!0);var u,f=function(){c.splice(0,1)},h=function(e){a.hasMoved=!0,t(e).off("touchmove",t.event.special.fastclick.touchmove)};t.event.special.fastclick={touchstart:function(e){a.startX=e.originalEvent.touches[0].pageX,a.startY=e.originalEvent.touches[0].pageY,a.hasMoved=!1,t(this).on("touchmove",t.event.special.fastclick.touchmove),t.event.special.fastclick.isTouch=this,t(window).on("scrollstart",t.event.special.fastclick.scroll)},doclick:function(){var e=t(this);e.off("click",t.event.special.fastclick.handler),t.event.special.fastclick.isTouch||e.one("click",t.event.special.fastclick.handler)},touchcancel:function(){t.event.special.fastclick.isTouch=!1,t(window).off("scrollstart",t.event.special.fastclick.scroll)},isTouch:!1,touchmove:function(e){(Math.abs(e.originalEvent.touches[0].pageX-a.startX)>i||Math.abs(e.originalEvent.touches[0].pageY-a.startY)>i)&&h(t(this))},add:function(e){if(l){var o=t(this);o.data("objHandlers")[e.guid]=e;var i=e.handler;e.handler=function(e){if(o.off("touchmove",t.event.special.fastclick.touchmove),!a.hasMoved){f(),window.clearTimeout(u),c.push({x:a.startX,y:a.startY}),u=window.setTimeout(f,n);var s=(t([]),arguments);t.each(o.data("objHandlers"),function(){this.selector?t(this.selector,o).each(function(){(this==e.target||t(this).has(e.target).length>0)&&i.apply(this,s)}):(o[0]==e.target||o.has(e.target).length>0)&&i.apply(o,s)})}}}},scroll:function(){h(t.event.special.fastclick.isTouch)},setup:function(){var n=t(this);n.on("mousedown",t.event.special.fastclick.doclick),e=e.add(n),n.data("objHandlers")||(n.data("objHandlers",{}),n.on("touchstart",t.event.special.fastclick.touchstart),n.on("touchend",t.event.special.fastclick.handler),n.on("mouseup touchcancel",t.event.special.fastclick.touchcancel)),a.ghostbuster||(t(document).on("click vclick mousedown mouseup",r),a.ghostbuster=!0)},teardown:function(){var n=t(this);e=e.not(n),n.off("touchstart",t.event.special.fastclick.touchstart),n.off("touchmove",t.event.special.fastclick.touchmove),n.off("touchend",t.event.special.fastclick.handler),n.off("mouseup touchcancel",t.event.special.fastclick.touchcancel),n.off("click",t.event.special.fastclick.handler),n.off("mousedown",t.event.special.fastclick.doclick),t(window).off("scrollstart",t.event.special.fastclick.scroll),0==e.length&&(t(document).off("click vclick mousedown",r),a.ghostbuster=!1)},remove:function(e){if(l){var n=t(this);delete n.data("objHandlers")[e.guid]}},handler:function(e){var n=e.type;e.type="fastclick",t(window).off("scrollstart",t.event.special.fastclick.scroll),t.event.trigger.call(this,e,{},this,!0),t(document.activeElement).blur(),e.type=n}}}(jQuery),function(t){t.fn.fastfocus=function(e){var n,o="input:not(.need-click),select,textarea",i=function(e){return e.isDefaultPrevented()||t(e.target).is(".need-click")?!0:(setTimeout(function(){n&&!n.is(".no-fast-blur")&&n.is(document.activeElement)&&n.blur()}),!0)};t(this).each(function(){var c=t(this),a=function(e){var n=t(this);t(document).trigger("vclick"),n.focus(),e.preventDefault(),setTimeout(function(){n.trigger("fastfocus"),n=!1}),e.stopImmediatePropagation()},s=function(){if(n=t(this),n.prop("disabled")||n.prop("readonly"))return n=!1,!0;if(n.is("input")){var e=n[0].type;if(e.indexOf("date")>-1||e.indexOf("month")>-1||e.indexOf("color")>-1||e.indexOf("range")>-1||e.indexOf("time")>-1||e.indexOf("image")>-1||e.indexOf("button")>-1||e.indexOf("checkbox")>-1||e.indexOf("radio")>-1||e.indexOf("submit")>-1||e.indexOf("file")>-1)return n=!1,!0}n.one("touchend",a)},r=function(){t(document.activeElement).length>0&&n.off("touchend",a)},l=function(){n=!1},u=function(){c.off("vclick",i),n&&n.off("touchend",a)},f=function(){c.off("vclick",i),c.on("vclick",i)};void 0==e||e?(c.on("touchstart",o,s).on("touchcancel",o,r).on("blur",l),t(window).on("scrollstart",u).on("scroll",u),t(window).on("scrollstop",f),c.on("vclick",i)):(c.off("touchstart",o,s).off("touchcancel",o,r).off("blur",l),n&&n.off("touchend",a),c.off("vclick",i),t(window).off("scrollstart",u),t(window).off("scrollstop",f))})},t.fn.fastswitch=function(e){var n,o="label:not(.has-handler):not(.need-click)",i=navigator.userAgent.toLowerCase(),c=i.match(/android\s([0-9\.]*)/);c&&c[1]&&c[1].indexOf("4.3")>-1||t(this).each(function(){var i,c=t(this),a=function(e){if(!i)return!0;t(document.activeElement).blur(),e.preventDefault();var n=t(i).find("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea");0==e.originalEvent.type.indexOf("mouse")?i.trigger("vclickjq"):(n.is("input[type=checkbox]")||i.trigger("click"),n.trigger("click")),setTimeout(function(){i=!1})},s=function(){i=t(this),i.one("vmouseup",a)},r=function(t){t.preventDefault()},l=function(){i&&i.off("vmouseup",a)},u=function(){c.off("vmousedown",s),l(),i&&i.one("click",r)},f=function(){c.off("vmousedown",s),clearTimeout(n),n=setTimeout(function(){c.on("vmousedown",o,s),i&&i.off("click",r)},100)};void 0==e||e?(c.on("vmousedown",o,s).on("vmousecancel",o,l),t(window).on("scrollstart",u).on("scroll",u).on("scrollstop",f)):(c.off("vmousedown",o,s).off("vmousecancel",o,l),i&&i.off("vmouseup",a),t(window).off("scrollstart",u).off("scrollstop",f).off("scroll",u))})}}(jQuery),function(t){function e(e){return r?e.data("events"):t._data(e[0]).events}function n(t,n,o){var i=e(t),c=i[n];if(!r){var a=o?c.splice(c.delegateCount-1,1)[0]:c.pop();return void c.splice(o?0:c.delegateCount||0,0,a)}o?i.live.unshift(i.live.pop()):c.unshift(c.pop())}function o(e,o,i){var c=o.split(/\s+/);e.each(function(){for(var e=0;e<c.length;++e){var o=t.trim(c[e]).match(/[^\.]+/i)[0];n(t(this),o,i)}})}function i(e){t.fn[e+"First"]=function(){var n=t.makeArray(arguments),i=n.shift();return i&&(t.fn[e].apply(this,arguments),o(this,i)),this}}var c=t.fn.jquery.split("."),a=parseInt(c[0]),s=parseInt(c[1]),r=1>a||1==a&&7>s;i("bind"),i("one"),t.fn.delegateFirst=function(){var e=t.makeArray(arguments),n=e[1];return n&&(e.splice(0,2),t.fn.delegate.apply(this,arguments),o(this,n,!0)),this},t.fn.liveFirst=function(){var e=t.makeArray(arguments);return e.unshift(this.selector),t.fn.delegateFirst.apply(t(document),e),this},r||(t.fn.onFirst=function(e,n){var i=t(this),c="string"==typeof n;if(t.fn.on.apply(i,arguments),"object"==typeof e)for(type in e)e.hasOwnProperty(type)&&o(i,type,c);else"string"==typeof e&&o(i,e,c);return i})}(jQuery),function(t){var e=t.fn.on,n=t.fn.off,o=t.fn.trigger,i=t.fn.one,c="-webkit-user-select : none;-ms-user-select : none;user-select : none;-ms-user-select : none;-webkit-touch-callout : none;-ms-content-zooming : none;-webkit-user-drag : none;-webkit-tap-highlight-color: rgba(0,0,0,0);touch-action : manipulation;",a=c+"touch-action:pan-y;",s=c+"touch-action:pan-x;";t("head style[data-touch]").length<=0&&t("head").append('<style type="text/css" data-touch="true">.touch-element-cl{'+c+"} .touch-element-swipeh-cl{"+a+"} .touch-element-swipev-cl{"+s+"}</style>");var r=["vclick"];t.fn.on=function(){var n=arguments[0];return r.indexOf(n)>-1&&("vclick"!=n||t(this).is("input,select,textarea,label")||t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).addClass("touch-element-cl"),"vclick"==n&&(arguments[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).is("lablel"))&&"vclick"==n&&(arguments[0]="vclick"),t(this).is("label")&&t(this).addClass("touch-element-cl")),"vclickjq"==n&&(arguments[0]="vclick"),e.apply(this,arguments)},t.fn.one=function(){var e=arguments[0];return r.indexOf(e)>-1&&("vclick"!=e||t(this).is("input,select,textarea,label")||t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).addClass("touch-element-cl"),"vclick"==e&&(arguments[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).is("lablel"))&&"vclick"==e&&(arguments[0]="vclick"),t(this).is("label")&&t(this).addClass("touch-element-cl")),"vclickjq"==e&&(arguments[0]="vclick"),i.apply(this,arguments)},t.fn.off=function(){var e=arguments[0];return r.indexOf(e)>-1&&(t(this).removeClass("touch-element-cl touch-element-swipeh-cl touch-element-swipev-cl"),"vclick"==e&&(arguments[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window))&&"vclick"==e&&(arguments[0]="vclick")),"vclickjq"==e&&(arguments[0]="vclick"),n.apply(this,arguments)},t.fn.trigger=function(){var e=arguments[0];return r.indexOf(e)>-1&&("vclick"==e&&(arguments[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window))&&"vclick"==e&&(arguments[0]="vclick")),"vclickjq"==e&&(arguments[0]="vclick"),o.apply(this,arguments)}}(jQuery);