!function(t,e,n){"function"==typeof define&&define.amd?define(["jquery"],(function(i){return n(i,t,e),i.mobile})):n(t.jQuery,t,e)}(this,document,(function(t,e,n,i){!function(t,e,n,i){var o,c,a="virtualMouseBindings",s="virtualTouchID",l="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),r="clientX clientY pageX pageY screenX screenY".split(" "),u=t.event.mouseHooks?t.event.mouseHooks.props:[],h=t.event.props.concat(u),f={},v=0,d=0,p=0,g=!1,m=[],k=!1,y=!1,b="addEventListener"in n,w=t(n),T=1,E=0;function x(t){for(;t&&void 0!==t.originalEvent;)t=t.originalEvent;return t}function D(e){for(var n,i,o={};e;){for(i in n=t.data(e,a))n[i]&&(o[i]=o.hasVirtualBinding=!0);e=e.parentNode}return o}function j(){y=!0}function S(){y=!1}function X(){Y(),v=setTimeout((function(){v=0,E=0,m.length=0,k=!1,j()}),t.vmouse.resetTimerDuration)}function Y(){v&&(clearTimeout(v),v=0)}function M(e,n,o){var c;return(o&&o[e]||!o&&function(e,n){for(var i;e;){if((i=t.data(e,a))&&(!n||i[n]))return e;e=e.parentNode}return null}(n.target,e))&&(c=function(e,n){var o,c,a,s,l,u,f,v,d,p=e.type;if((e=t.Event(e)).type=n,o=e.originalEvent,c=t.event.props,p.search(/^(mouse|click)/)>-1&&(c=h),o)for(f=c.length;f;)e[s=c[--f]]=o[s];if(p.search(/mouse(down|up)|click/)>-1&&!e.which&&(e.which=1),-1!==p.search(/^touch/)&&(p=(a=x(o)).touches,l=a.changedTouches,u=p&&p.length?p[0]:l&&l.length?l[0]:i))for(v=0,d=r.length;v<d;v++)e[s=r[v]]=u[s];return e}(n,e),t(n.target).trigger(c)),c}function P(e){var n,i=t.data(e.target,s);k||E&&E===i||(n=M("v"+e.type,e))&&(n.isDefaultPrevented()&&e.preventDefault(),n.isPropagationStopped()&&e.stopPropagation(),n.isImmediatePropagationStopped()&&e.stopImmediatePropagation())}function C(e){var n,i,o,c=x(e).touches;c&&1===c.length&&(i=D(n=e.target)).hasVirtualBinding&&(E=T++,t.data(n,s,E),Y(),S(),g=!1,o=x(e).touches[0],d=o.pageX,p=o.pageY,M("vmouseover",e,i),M("vmousedown",e,i))}function R(t){y||(g||M("vmousecancel",t,D(t.target)),g=!0,X())}function A(e){if(!y){var n=x(e).touches[0],i=g,o=t.vmouse.moveDistanceThreshold,c=D(e.target);(g=g||Math.abs(n.pageX-d)>o||Math.abs(n.pageY-p)>o)&&!i&&M("vmousecancel",e,c),M("vmousemove",e,c),X()}}function I(t){if(!y){j();var e,n,i=D(t.target);M("vmouseup",t,i),g||(e=M("vclick",t,i))&&e.isDefaultPrevented()&&(n=x(t).changedTouches[0],m.push({touchID:E,x:n.clientX,y:n.clientY}),k=!0),M("vmouseout",t,i),g=!1,X()}}function H(e){var n,i=t.data(e,a);if(i)for(n in i)if(i[n])return!0;return!1}function q(){}function O(e){var n=e.substr(1);return{setup:function(){H(this)||t.data(this,a,{}),t.data(this,a)[e]=!0,f[e]=(f[e]||0)+1,1===f[e]&&w.bind(n,P),t(this).bind(n,q),b&&(f.touchstart=(f.touchstart||0)+1,1===f.touchstart&&w.bind("touchstart",C).bind("touchend",I).bind("touchmove",A).bind("scroll",R))},teardown:function(){--f[e],f[e]||w.unbind(n,P),b&&(--f.touchstart,f.touchstart||w.unbind("touchstart",C).unbind("touchmove",A).unbind("touchend",I).unbind("scroll",R));var i=t(this),o=t.data(this,a);o&&(o[e]=!1),i.unbind(n,q),H(this)||i.removeData(a)}}}for(t.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500},c=0;c<l.length;c++)t.event.special[l[c]]=O(l[c]);b&&n.addEventListener("click",(function(e){var n,i,c,a,l,r=m.length,u=e.target;if(r)for(n=e.clientX,i=e.clientY,o=t.vmouse.clickDistanceThreshold,c=u;c;){for(a=0;a<r;a++)if(l=m[a],0,c===u&&Math.abs(l.x-n)<o&&Math.abs(l.y-i)<o||t.data(c,s)===l.touchID)return e.preventDefault(),void e.stopPropagation();c=c.parentNode}}),!0)}(t,0,n)})),function(t){var e=t.event.dispatch||t.event.handle,n=t.event.special,i="D"+ +new Date,o="D"+(+new Date+1);n.scrollstart={setup:function(o){var c,a=t.extend({latency:n.scrollstop.latency},o),s=function(t){var n=arguments;c?clearTimeout(c):(t.type="scrollstart",e.apply(this,n)),c=setTimeout((function(){c=null}),a.latency)};t(this).bind("scroll",s).data(i,s)},teardown:function(){t(this).unbind("scroll",t(this).data(i))}},n.scrollstop={latency:250,setup:function(i){var c,a=t.extend({latency:n.scrollstop.latency},i),s=function(t){var n=this,i=arguments;c&&clearTimeout(c),c=setTimeout((function(){c=null,t.type="scrollstop",e.apply(n,i)}),a.latency)};t(this).bind("scroll",s).data(o,s)},teardown:function(){t(this).unbind("scroll",t(this).data(o))}}}(jQuery),jQuery.fn.caret=function(t){var e=this[0],n=e&&"true"===e.contentEditable;if(0!=arguments.length)return e&&(-1==t&&(t=this[n?"text":"val"]().length),window.getSelection?n?(e.focus(),window.getSelection().collapse(e.firstChild,t)):e.setSelectionRange(t,t):document.body.createTextRange&&(n?((c=document.body.createTextRange()).moveToElementText(e),c.moveStart("character",t),c.collapse(!0),c.select()):((c=e.createTextRange()).move("character",t),c.select())),n||e.focus()),this;if(e){if(window.getSelection)return n?(e.focus(),(o=(i=window.getSelection().getRangeAt(0)).cloneRange()).selectNodeContents(e),o.setEnd(i.endContainer,i.endOffset),o.toString().length):e.selectionStart;if(document.selection){if(e.focus(),n){var i=document.selection.createRange();return(o=document.body.createTextRange()).moveToElementText(e),o.setEndPoint("EndToEnd",i),o.text.length}t=0;var o,c=e.createTextRange(),a=(o=document.selection.createRange().duplicate()).getBookmark();for(c.moveToBookmark(a);0!==c.moveStart("character",-1);)t++;return t}if(e.selectionStart)return e.selectionStart}},function(t){var e=t([]),n=[],i={},o=function(e){var i,o;for(i=0,o=n.length;i<o;i++){if(Math.abs(e.pageX-n[i].x)<30&&Math.abs(e.pageY-n[i].y)<30)e.target=null,e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault(),t(e.target).is("input:not([type=submit]),select,textarea")&&(e.target=null)}},c=!1;"ontouchstart"in window&&(c=!0);var a,s=function(){n.splice(0,1)},l=function(e){i.hasMoved=!0,t(e).off("touchmove",t.event.special.fastclick.touchmove)};t.event.special.fastclick={touchstart:function(e){i.startX=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]&&e.originalEvent.touches[0].pageX||0,i.startY=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]&&e.originalEvent.touches[0].pageY||0,i.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){var n=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]&&e.originalEvent.touches[0].pageX||0,o=e.originalEvent&&e.originalEvent.touches&&e.originalEvent.touches[0]&&e.originalEvent.touches[0].pageY||0;(Math.abs(n-i.startX)>40||Math.abs(o-i.startY)>40)&&l(t(this))},add:function(e){if(c){var o=t(this);o.data("objHandlers")[e.guid]=e;var l=e.handler;e.handler=function(e){if(o.off("touchmove",t.event.special.fastclick.touchmove),!i.hasMoved){s(),window.clearTimeout(a),n.push({x:i.startX,y:i.startY}),a=window.setTimeout(s,2500);t([]);var c=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)&&l.apply(this,c)})):(o[0]==e.target||o.has(e.target).length>0)&&l.apply(o,c)}))}}}},scroll:function(){l(t.event.special.fastclick.isTouch)},setup:function(n,c,a){var s=t(this);s.on("mousedown",t.event.special.fastclick.doclick),e=e.add(s),s.data("objHandlers")||(s.data("objHandlers",{}),s.on("touchstart",t.event.special.fastclick.touchstart),s.on("touchend",t.event.special.fastclick.handler),s.on("mouseup touchcancel",t.event.special.fastclick.touchcancel)),i.ghostbuster||(t(document).on("click vclick mousedown mouseup",o),i.ghostbuster=!0)},teardown:function(n){var c=t(this);e=e.not(c),c.off("touchstart",t.event.special.fastclick.touchstart),c.off("touchmove",t.event.special.fastclick.touchmove),c.off("touchend",t.event.special.fastclick.handler),c.off("mouseup touchcancel",t.event.special.fastclick.touchcancel),c.off("click",t.event.special.fastclick.handler),c.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",o),i.ghostbuster=!1)},remove:function(e){c&&delete t(this).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).is(e.target)||t(document.activeElement).blur(),e.type=n}}}(jQuery),function(t){var e=t.fn.jquery.split("."),n=parseInt(e[0]),i=parseInt(e[1]),o=n<1||1==n&&i<7;function c(e,n,i){var c=function(e){return o?e.data("events"):t._data(e[0]).events}(e),a=c[n];if(o)i?c.live.unshift(c.live.pop()):a.unshift(a.pop());else{var s=i?a.splice(a.delegateCount-1,1)[0]:a.pop();a.splice(i?0:a.delegateCount||0,0,s)}}function a(e,n,i){var o=n.split(/\s+/);e.each((function(){for(var e=0;e<o.length;++e){var n=t.trim(o[e]).match(/[^\.]+/i)[0];c(t(this),n,i)}}))}function s(e){t.fn[e+"First"]=function(){var n=t.makeArray(arguments).shift();return n&&(t.fn[e].apply(this,arguments),a(this,n)),this}}s("bind"),s("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),a(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},o||(t.fn.onFirst=function(e,n){var i=t(this),o="string"==typeof n;if(t.fn.on.apply(i,arguments),"object"==typeof e)for(type in e)e.hasOwnProperty(type)&&a(i,type,o);else"string"==typeof e&&a(i,e,o);return i})}(jQuery),function(t){var e=t.fn.on,n=t.fn.off,i=t.fn.trigger,o=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 l=["vclick"];t.fn.on=function(){var n=Array.prototype.slice.call(arguments),i=n[0];return l.indexOf(i)>-1&&("vclick"!=i||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"==i&&(n[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).is("lablel"))&&"vclick"==i&&(n[0]="vclick"),t(this).is("label")&&t(this).addClass("touch-element-cl")),"vclickjq"==i&&(n[0]="vclick"),e.apply(this,n)},t.fn.one=function(){var e=Array.prototype.slice.call(arguments),n=e[0];return l.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&&(e[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window)||t(this).is("lablel"))&&"vclick"==n&&(e[0]="vclick"),t(this).is("label")&&t(this).addClass("touch-element-cl")),"vclickjq"==n&&(e[0]="vclick"),o.apply(this,e)},t.fn.off=function(){var e=Array.prototype.slice.call(arguments),i=e[0];return l.indexOf(i)>-1&&(t(this).removeClass("touch-element-cl touch-element-swipeh-cl touch-element-swipev-cl"),"vclick"==i&&(e[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window))&&"vclick"==i&&(e[0]="vclick")),"vclickjq"==i&&(e[0]="vclick"),n.apply(this,e)},t.fn.trigger=function(){var e=Array.prototype.slice.call(arguments),n=e[0];return l.indexOf(n)>-1&&("vclick"==n&&(e[0]="fastclick"),(t(this).is(document)||t(this).is("body")||t(this).is(window))&&"vclick"==n&&(e[0]="vclick")),"vclickjq"==n&&(e[0]="vclick"),i.apply(this,e)}}(jQuery);