mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
17 lines
76 KiB
JavaScript
17 lines
76 KiB
JavaScript
/*!
|
|
* Copyright 2014 Drifty Co.
|
|
* http://drifty.com/
|
|
*
|
|
* Ionic, v1.0.0-beta.3
|
|
* A powerful HTML5 mobile app framework.
|
|
* http://ionicframework.com/
|
|
*
|
|
* By @maxlynch, @benjsperry, @adamdbradley <3
|
|
*
|
|
* Licensed under the MIT license. Please see LICENSE for more information.
|
|
*
|
|
*/
|
|
|
|
!function(){function t(t,e,i){e!==!1?z.addEventListener(t,j[t],i):z.removeEventListener(t,j[t])}function e(t){var e=S(t.target),n=b(e);if(r(n)||U)return!1;var o=E(t);i("click",n,o.x,o.y),f(n)}function i(t,e,i,n){var r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,0,0,i,n,!1,!1,!1,!1,0,null),r.isIonicTap=!0,e.dispatchEvent(r)}function n(t){return("submit"!=t.target.type||0!==t.detail)&&(ionic.scroll.isScrolling&&ionic.tap.containsOrIsTextInput(t.target)||!t.isIonicTap&&!r(t.target))?(t.stopPropagation(),ionic.tap.isLabelWithTextInput(t.target)||t.preventDefault(),!1):void 0}function r(t){if(!t||t.disabled||/file|range/i.test(t.type)||/object|video/i.test(t.tagName))return!0;if(1===t.nodeType)for(var e=t;e;){if("true"==(e.dataset?e.dataset.tapDisabled:e.getAttribute("data-tap-disabled")))return!0;e=e.parentElement}return!1}function o(e){if(!e.isIonicTap&&!_(e)){if(F)return e.stopPropagation(),ionic.tap.isTextInput(e.target)||e.preventDefault(),!1;U=!1,q=E(e),t("mousemove"),ionic.activator.start(e)}}function s(i){return F?(i.stopPropagation(),i.preventDefault(),!1):void(_(i)||(T(i)||e(i),t("mousemove",!1),ionic.activator.end(),U=!1))}function a(e){return T(e)?(t("mousemove",!1),ionic.activator.end(),U=!0,!1):void 0}function l(e){if(!_(e)&&(U=!1,d(),q=E(e),t("touchmove"),ionic.activator.start(e),ionic.Platform.isIOS()&&ionic.tap.isLabelWithTextInput(e.target))){var i=b(S(e.target));i!==H&&e.preventDefault()}}function c(t){_(t)||(d(),T(t)||e(t),h())}function u(e){return T(e)?(U=!0,t("touchmove",!1),ionic.activator.end(),!1):void 0}function h(){t("touchmove",!1),ionic.activator.end(),U=!1}function d(){F=!0,clearTimeout(W),W=setTimeout(function(){F=!1},2e3)}function _(t){return t.isTapHandled?!0:(t.isTapHandled=!0,ionic.scroll.isScrolling&&ionic.tap.containsOrIsTextInput(t.target)?(t.preventDefault(),!0):void 0)}function f(t){B=null;var e=!1;"SELECT"==t.tagName?(i("mousedown",t,0,0),t.focus&&t.focus(),e=!0):v()===t?e=!0:/input|textarea/i.test(t.tagName)?(e=!0,t.focus&&t.focus(),t.value=t.value,F&&(B=t)):p(),e&&(v(t),ionic.trigger("ionic.focusin",{target:t},!0))}function p(){var t=v();t&&/input|textarea|select/i.test(t.tagName)&&t.blur(),v(null)}function g(t){F&&ionic.tap.isTextInput(v())&&ionic.tap.isTextInput(B)&&B!==t.target&&(B.focus(),B=null),ionic.scroll.isScrolling=!1}function m(){v(null)}function v(t){return arguments.length&&(H=t),H||document.activeElement}function T(t){if(!t||!q||0===q.x&&0===q.y)return!1;var e=E(t);return Math.abs(q.x-e.x)>Z||Math.abs(q.y-e.y)>Z}function E(t){var e={x:0,y:0};if(t){var i=t.touches&&t.touches.length?t.touches:[t],n=t.changedTouches&&t.changedTouches[0]||i[0];n&&(e.x=n.clientX||n.pageX||0,e.y=n.clientY||n.pageY||0)}return e}function S(t,e){for(var i=t,n=0;6>n&&i;n++){if("LABEL"===i.tagName)return i;i=t.parentElement}return e!==!1?t:void 0}function b(t){if(t&&"LABEL"===t.tagName){if(t.control)return t.control;if(t.querySelector){var e=t.querySelector("input,textarea,select");if(e)return e}}return t}function y(){X()&&window.addEventListener("native.showkeyboard",w),document.body.addEventListener("ionic.focusin",D),document.body.addEventListener("focusin",D),document.body.addEventListener("focusout",M),document.body.addEventListener("orientationchange",I),document.removeEventListener("touchstart",y)}function w(t){ionic.keyboard.height=t.keyboardHeight}function D(t){t.target&&ionic.tap.isTextInput(t.target)&&P(t.target)&&(document.addEventListener("keydown",O,!1),document.body.scrollTop=0,document.body.querySelector(".scroll-content").scrollTop=0,K=t.target,x(t))}function x(t){clearTimeout(J),clearTimeout(Q),J=setTimeout(function(){var e=C(),i=K.getBoundingClientRect();L(t.target,i.top,i.bottom,$,e)},32)}function L(t,e,i,n,r){var o={target:t,elementTop:Math.round(e),elementBottom:Math.round(i),keyboardHeight:r};return o.contentHeight=R()?n-r:n,o.keyboardTopOffset=o.elementTop-o.contentHeight,o.isElementUnderKeyboard=o.elementBottom>o.contentHeight,ionic.keyboard.isOpen=!0,K=t,ionic.trigger("scrollChildIntoView",o,!0),ionic.requestAnimationFrame(function(){document.body.classList.add(te)}),document.addEventListener("touchmove",A,!1),o}function M(){clearTimeout(J),clearTimeout(Q),Q=setTimeout(G,350)}function G(){ionic.keyboard.isOpen=!1,ionic.trigger("resetScrollView",{target:K},!0),ionic.requestAnimationFrame(function(){document.body.classList.remove(te)}),document.removeEventListener("touchmove",A),document.removeEventListener("keydown",O)}function N(){window.innerHeight>$&&($=window.innerHeight)}function O(t){ionic.scroll.isScrolling&&A(t)}function A(t){t.preventDefault()}function I(){$=window.innerHeight,setTimeout(function(){$=window.innerHeight},999)}function C(){if(ionic.keyboard.height)return ionic.keyboard.height;if(ionic.Platform.isIOS())return ionic.Platform.isWebView()?260:216;if(ionic.Platform.isAndroid()){if(ionic.Platform.isWebView())return 220;if(ionic.Platform.version()<=4.3)return 230}return 275}function P(t){for(;t;){if(t.classList.contains(ee))return!0;t=t.parentElement}return!1}function R(){return ionic.Platform.isIOS()||ionic.Platform.isAndroid()&&!ionic.Platform.isWebView()}function X(){return!!(window.cordova&&cordova.plugins&&cordova.plugins.Keyboard)}function V(){var t;for(t=0;t<document.head.children.length;t++)if("viewport"==document.head.children[t].name){ie=document.head.children[t];break}if(ie){var e,i=ie.content.toLowerCase().replace(/\s+/g,"").split(",");for(t=0;t<i.length;t++)e=i[t].split("="),2==e.length&&(ne[e[0]]=e[1]);k()}}function k(){var t=!1;ionic.Platform.isWebView()?"device-height"!=ne.height&&(ne.height="device-height",t=!0):ne.height&&(delete ne.height,t=!0),t&&Y()}function Y(t){if(ie){ionic.Utils.extend(ne,t);var e,i=[];for(e in ne)ne[e]&&i.push(e+"="+ne[e]);ie.content=i.join(",")}}window.ionic={controllers:{},views:{},version:"1.0.0-beta.3"},function(t){function e(t){return t*t*t}function i(t){return 3*t*t*(1-t)}function n(t){return 3*t*(1-t)*(1-t)}function r(t){return(1-t)*(1-t)*(1-t)}var o=function(t,e){return t||(t=0),e||(e=0),{x:t,y:e}};t.Animator={getQuadraticBezier:function(t,s,a,l,c){var u=new o;return u.x=s.x*e(t)+a.x*i(t)+l.x*n(t)+c.x*r(t),u.y=s.y*e(t)+a.y*i(t)+l.y*n(t)+c.y*r(t),u},getCubicBezier:function(t,e,i,n,r){epsilon=1e3/60/r/4;var o=function(e){var n=1-e;return 3*n*n*e*t+3*n*e*e*i+e*e*e},s=function(t){var i=1-t;return 3*i*i*t*e+3*i*t*t*n+t*t*t},a=function(e){var n=1-e;return 3*(2*(e-1)*e+n*n)*t+3*(-e*e*e+2*n*e)*i};return function(t){var e,i,n,r,l,c,u=t;for(n=u,c=0;8>c;c++){if(r=o(n)-u,Math.abs(r)<epsilon)return s(n);if(l=a(n),Math.abs(l)<1e-6)break;n-=r/l}if(e=0,i=1,n=u,e>n)return s(e);if(n>i)return s(i);for(;i>e;){if(r=o(n),Math.abs(r-u)<epsilon)return s(n);u>r?e=n:i=n,n=.5*(i-e)+e}return s(n)}},animate:function(t){return{leave:function(){var e=function(){t.classList.remove("leave"),t.classList.remove("leave-active"),t.removeEventListener("webkitTransitionEnd",e),t.removeEventListener("transitionEnd",e)};return t.addEventListener("webkitTransitionEnd",e),t.addEventListener("transitionEnd",e),t.classList.add("leave"),t.classList.add("leave-active"),this},enter:function(){var e=function(){t.classList.remove("enter"),t.classList.remove("enter-active"),t.removeEventListener("webkitTransitionEnd",e),t.removeEventListener("transitionEnd",e)};return t.addEventListener("webkitTransitionEnd",e),t.addEventListener("transitionEnd",e),t.classList.add("enter"),t.classList.add("enter-active"),this}}}}}(ionic),function(t,e,i){function n(){o=!0;for(var t=0;t<r.length;t++)i.requestAnimationFrame(r[t]);r=[],e.removeEventListener("DOMContentLoaded",n)}var r=[],o=!1;e.addEventListener("DOMContentLoaded",n),t._rAF=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(e){t.setTimeout(e,16)}}(),i.DomUtil={requestAnimationFrame:function(e){t._rAF(e)},animationFrameThrottle:function(t){var e,n,r;return function(){e=arguments,r=this,n||(n=!0,i.requestAnimationFrame(function(){t.apply(r,e),n=!1}))}},getPositionInParent:function(t){return{left:t.offsetLeft,top:t.offsetTop}},ready:function(t){o||"complete"===e.readyState?i.requestAnimationFrame(t):r.push(t)},getTextBounds:function(i){if(e.createRange){var n=e.createRange();if(n.selectNodeContents(i),n.getBoundingClientRect){var r=n.getBoundingClientRect();if(r){var o=t.scrollX,s=t.scrollY;return{top:r.top+s,left:r.left+o,right:r.left+o+r.width,bottom:r.top+s+r.height,width:r.width,height:r.height}}}}return null},getChildIndex:function(t,e){if(e)for(var i,n=t.parentNode.children,r=0,o=0,s=n.length;s>r;r++)if(i=n[r],i.nodeName&&i.nodeName.toLowerCase()==e){if(i==t)return o;o++}return Array.prototype.slice.call(t.parentNode.children).indexOf(t)},swapNodes:function(t,e){e.parentNode.insertBefore(t,e)},centerElementByMargin:function(t){t.style.marginLeft=-t.offsetWidth/2+"px",t.style.marginTop=-t.offsetHeight/2+"px"},centerElementByMarginTwice:function(t){i.requestAnimationFrame(function(){i.DomUtil.centerElementByMargin(t),i.requestAnimationFrame(function(){i.DomUtil.centerElementByMargin(t)})})},getParentWithClass:function(t,e,i){for(i=i||10;t.parentNode&&i--;){if(t.parentNode.classList&&t.parentNode.classList.contains(e))return t.parentNode;t=t.parentNode}return null},getParentOrSelfWithClass:function(t,e,i){for(i=i||10;t&&i--;){if(t.classList&&t.classList.contains(e))return t;t=t.parentNode}return null},rectContains:function(t,e,i,n,r,o){return i>t||t>r?!1:n>e||e>o?!1:!0}},i.requestAnimationFrame=i.DomUtil.requestAnimationFrame,i.animationFrameThrottle=i.DomUtil.animationFrameThrottle}(window,document,ionic),function(t){window.CustomEvent||!function(){var t;t=function(t,e){var i;e=e||{bubbles:!1,cancelable:!1,detail:void 0};try{i=document.createEvent("CustomEvent"),i.initCustomEvent(t,e.bubbles,e.cancelable,e.detail)}catch(n){i=document.createEvent("Event");for(var r in e)i[r]=e[r];i.initEvent(t,e.bubbles,e.cancelable)}return i},t.prototype=window.Event.prototype,window.CustomEvent=t}(),t.EventController={VIRTUALIZED_EVENTS:["tap","swipe","swiperight","swipeleft","drag","hold","release"],trigger:function(t,e,i,n){var r=new CustomEvent(t,{detail:e,bubbles:!!i,cancelable:!!n});e&&e.target&&e.target.dispatchEvent&&e.target.dispatchEvent(r)||window.dispatchEvent(r)},on:function(e,i,n){for(var r=n||window,o=0,s=this.VIRTUALIZED_EVENTS.length;s>o;o++)if(e==this.VIRTUALIZED_EVENTS[o]){var a=new t.Gesture(n);return a.on(e,i),a}r.addEventListener(e,i)},off:function(t,e,i){i.removeEventListener(t,e)},onGesture:function(e,i,n){var r=new t.Gesture(n);return r.on(e,i),r},offGesture:function(t,e,i){t.off(e,i)},handlePopState:function(){}},t.on=function(){t.EventController.on.apply(t.EventController,arguments)},t.off=function(){t.EventController.off.apply(t.EventController,arguments)},t.trigger=t.EventController.trigger,t.onGesture=function(){return t.EventController.onGesture.apply(t.EventController.onGesture,arguments)},t.offGesture=function(){return t.EventController.offGesture.apply(t.EventController.offGesture,arguments)}}(window.ionic),function(t){function e(){if(!t.Gestures.READY){t.Gestures.event.determineEventTypes();for(var e in t.Gestures.gestures)t.Gestures.gestures.hasOwnProperty(e)&&t.Gestures.detection.register(t.Gestures.gestures[e]);t.Gestures.event.onTouch(t.Gestures.DOCUMENT,t.Gestures.EVENT_MOVE,t.Gestures.detection.detect),t.Gestures.event.onTouch(t.Gestures.DOCUMENT,t.Gestures.EVENT_END,t.Gestures.detection.detect),t.Gestures.READY=!0}}t.Gesture=function(e,i){return new t.Gestures.Instance(e,i||{})},t.Gestures={},t.Gestures.defaults={stop_browser_behavior:"disable-user-behavior"},t.Gestures.HAS_POINTEREVENTS=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,t.Gestures.HAS_TOUCHEVENTS="ontouchstart"in window,t.Gestures.MOBILE_REGEX=/mobile|tablet|ip(ad|hone|od)|android|silk/i,t.Gestures.NO_MOUSEEVENTS=t.Gestures.HAS_TOUCHEVENTS&&window.navigator.userAgent.match(t.Gestures.MOBILE_REGEX),t.Gestures.EVENT_TYPES={},t.Gestures.DIRECTION_DOWN="down",t.Gestures.DIRECTION_LEFT="left",t.Gestures.DIRECTION_UP="up",t.Gestures.DIRECTION_RIGHT="right",t.Gestures.POINTER_MOUSE="mouse",t.Gestures.POINTER_TOUCH="touch",t.Gestures.POINTER_PEN="pen",t.Gestures.EVENT_START="start",t.Gestures.EVENT_MOVE="move",t.Gestures.EVENT_END="end",t.Gestures.DOCUMENT=window.document,t.Gestures.plugins={},t.Gestures.READY=!1,t.Gestures.Instance=function(i,n){var r=this;if(null!==i)return e(),this.element=i,this.enabled=!0,this.options=t.Gestures.utils.extend(t.Gestures.utils.extend({},t.Gestures.defaults),n||{}),this.options.stop_browser_behavior&&t.Gestures.utils.stopDefaultBrowserBehavior(this.element,this.options.stop_browser_behavior),t.Gestures.event.onTouch(i,t.Gestures.EVENT_START,function(e){r.enabled&&t.Gestures.detection.startDetect(r,e)}),this},t.Gestures.Instance.prototype={on:function(t,e){for(var i=t.split(" "),n=0;n<i.length;n++)this.element.addEventListener(i[n],e,!1);return this},off:function(t,e){for(var i=t.split(" "),n=0;n<i.length;n++)this.element.removeEventListener(i[n],e,!1);return this},trigger:function(e,i){var n=t.Gestures.DOCUMENT.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=i;var r=this.element;return t.Gestures.utils.hasParent(i.target,r)&&(r=i.target),r.dispatchEvent(n),this},enable:function(t){return this.enabled=t,this}};var i=null,n=!1,r=!1;t.Gestures.event={bindDom:function(t,e,i){for(var n=e.split(" "),r=0;r<n.length;r++)t.addEventListener(n[r],i,!1)},onTouch:function(e,o,s){var a=this;this.bindDom(e,t.Gestures.EVENT_TYPES[o],function(l){var c=l.type.toLowerCase();if(!c.match(/mouse/)||!r){c.match(/touch/)||c.match(/pointerdown/)||c.match(/mouse/)&&1===l.which?n=!0:c.match(/mouse/)&&1!==l.which&&(n=!1),c.match(/touch|pointer/)&&(r=!0);var u=0;n&&(t.Gestures.HAS_POINTEREVENTS&&o!=t.Gestures.EVENT_END?u=t.Gestures.PointerEvent.updatePointer(o,l):c.match(/touch/)?u=l.touches.length:r||(u=c.match(/up/)?0:1),u>0&&o==t.Gestures.EVENT_END?o=t.Gestures.EVENT_MOVE:u||(o=t.Gestures.EVENT_END),(u||null===i)&&(i=l),s.call(t.Gestures.detection,a.collectEventData(e,o,a.getTouchList(i,o),l)),t.Gestures.HAS_POINTEREVENTS&&o==t.Gestures.EVENT_END&&(u=t.Gestures.PointerEvent.updatePointer(o,l))),u||(i=null,n=!1,r=!1,t.Gestures.PointerEvent.reset())}})},determineEventTypes:function(){var e;e=t.Gestures.HAS_POINTEREVENTS?t.Gestures.PointerEvent.getEvents():t.Gestures.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_START]=e[0],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_MOVE]=e[1],t.Gestures.EVENT_TYPES[t.Gestures.EVENT_END]=e[2]},getTouchList:function(e){return t.Gestures.HAS_POINTEREVENTS?t.Gestures.PointerEvent.getTouchList():e.touches?e.touches:(e.indentifier=1,[e])},collectEventData:function(e,i,n,r){var o=t.Gestures.POINTER_TOUCH;return(r.type.match(/mouse/)||t.Gestures.PointerEvent.matchType(t.Gestures.POINTER_MOUSE,r))&&(o=t.Gestures.POINTER_MOUSE),{center:t.Gestures.utils.getCenter(n),timeStamp:(new Date).getTime(),target:r.target,touches:n,eventType:i,pointerType:o,srcEvent:r,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return t.Gestures.detection.stopDetect()}}}},t.Gestures.PointerEvent={pointers:{},getTouchList:function(){var t=this,e=[];return Object.keys(t.pointers).sort().forEach(function(i){e.push(t.pointers[i])}),e},updatePointer:function(e,i){return e==t.Gestures.EVENT_END?this.pointers={}:(i.identifier=i.pointerId,this.pointers[i.pointerId]=i),Object.keys(this.pointers).length},matchType:function(e,i){if(!i.pointerType)return!1;var n={};return n[t.Gestures.POINTER_MOUSE]=i.pointerType==i.MSPOINTER_TYPE_MOUSE||i.pointerType==t.Gestures.POINTER_MOUSE,n[t.Gestures.POINTER_TOUCH]=i.pointerType==i.MSPOINTER_TYPE_TOUCH||i.pointerType==t.Gestures.POINTER_TOUCH,n[t.Gestures.POINTER_PEN]=i.pointerType==i.MSPOINTER_TYPE_PEN||i.pointerType==t.Gestures.POINTER_PEN,n[e]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},t.Gestures.utils={extend:function(t,e,i){for(var n in e)void 0!==t[n]&&i||(t[n]=e[n]);return t},hasParent:function(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1},getCenter:function(t){for(var e=[],i=[],n=0,r=t.length;r>n;n++)e.push(t[n].pageX),i.push(t[n].pageY);return{pageX:(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,pageY:(Math.min.apply(Math,i)+Math.max.apply(Math,i))/2}},getVelocity:function(t,e,i){return{x:Math.abs(e/t)||0,y:Math.abs(i/t)||0}},getAngle:function(t,e){var i=e.pageY-t.pageY,n=e.pageX-t.pageX;return 180*Math.atan2(i,n)/Math.PI},getDirection:function(e,i){var n=Math.abs(e.pageX-i.pageX),r=Math.abs(e.pageY-i.pageY);return n>=r?e.pageX-i.pageX>0?t.Gestures.DIRECTION_LEFT:t.Gestures.DIRECTION_RIGHT:e.pageY-i.pageY>0?t.Gestures.DIRECTION_UP:t.Gestures.DIRECTION_DOWN},getDistance:function(t,e){var i=e.pageX-t.pageX,n=e.pageY-t.pageY;return Math.sqrt(i*i+n*n)},getScale:function(t,e){return t.length>=2&&e.length>=2?this.getDistance(e[0],e[1])/this.getDistance(t[0],t[1]):1},getRotation:function(t,e){return t.length>=2&&e.length>=2?this.getAngle(e[1],e[0])-this.getAngle(t[1],t[0]):0},isVertical:function(e){return e==t.Gestures.DIRECTION_UP||e==t.Gestures.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(t,e){t&&t.classList&&(t.classList.add(e),t.onselectstart=function(){return!1})}},t.Gestures.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(e,i){this.current||(this.stopped=!1,this.current={inst:e,startEvent:t.Gestures.utils.extend({},i),lastEvent:!1,name:""},this.detect(i))},detect:function(e){if(this.current&&!this.stopped){e=this.extendEventData(e);for(var i=this.current.inst.options,n=0,r=this.gestures.length;r>n;n++){var o=this.gestures[n];if(!this.stopped&&i[o.name]!==!1&&o.handler.call(o,e,this.current.inst)===!1){this.stopDetect();break}}return this.current&&(this.current.lastEvent=e),e.eventType==t.Gestures.EVENT_END&&!e.touches.length-1&&this.stopDetect(),e}},stopDetect:function(){this.previous=t.Gestures.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(e){var i=this.current.startEvent;if(i&&(e.touches.length!=i.touches.length||e.touches===i.touches)){i.touches=[];for(var n=0,r=e.touches.length;r>n;n++)i.touches.push(t.Gestures.utils.extend({},e.touches[n]))}var o=e.timeStamp-i.timeStamp,s=e.center.pageX-i.center.pageX,a=e.center.pageY-i.center.pageY,l=t.Gestures.utils.getVelocity(o,s,a);return t.Gestures.utils.extend(e,{deltaTime:o,deltaX:s,deltaY:a,velocityX:l.x,velocityY:l.y,distance:t.Gestures.utils.getDistance(i.center,e.center),angle:t.Gestures.utils.getAngle(i.center,e.center),direction:t.Gestures.utils.getDirection(i.center,e.center),scale:t.Gestures.utils.getScale(i.touches,e.touches),rotation:t.Gestures.utils.getRotation(i.touches,e.touches),startEvent:i}),e},register:function(e){var i=e.defaults||{};return void 0===i[e.name]&&(i[e.name]=!0),t.Gestures.utils.extend(t.Gestures.defaults,i,!0),e.index=e.index||1e3,this.gestures.push(e),this.gestures.sort(function(t,e){return t.index<e.index?-1:t.index>e.index?1:0}),this.gestures}},t.Gestures.gestures=t.Gestures.gestures||{},t.Gestures.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(e,i){switch(e.eventType){case t.Gestures.EVENT_START:clearTimeout(this.timer),t.Gestures.detection.current.name=this.name,this.timer=setTimeout(function(){"hold"==t.Gestures.detection.current.name&&i.trigger("hold",e)},i.options.hold_timeout);break;case t.Gestures.EVENT_MOVE:e.distance>i.options.hold_threshold&&clearTimeout(this.timer);break;case t.Gestures.EVENT_END:clearTimeout(this.timer)}}},t.Gestures.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(e,i){if(e.eventType==t.Gestures.EVENT_END&&"touchcancel"!=e.srcEvent.type){var n=t.Gestures.detection.previous,r=!1;if(e.deltaTime>i.options.tap_max_touchtime||e.distance>i.options.tap_max_distance)return;n&&"tap"==n.name&&e.timeStamp-n.lastEvent.timeStamp<i.options.doubletap_interval&&e.distance<i.options.doubletap_distance&&(i.trigger("doubletap",e),r=!0),(!r||i.options.tap_always)&&(t.Gestures.detection.current.name="tap",i.trigger(t.Gestures.detection.current.name,e))}}},t.Gestures.gestures.Swipe={name:"swipe",index:40,defaults:{swipe_max_touches:1,swipe_velocity:.7},handler:function(e,i){if(e.eventType==t.Gestures.EVENT_END){if(i.options.swipe_max_touches>0&&e.touches.length>i.options.swipe_max_touches)return;(e.velocityX>i.options.swipe_velocity||e.velocityY>i.options.swipe_velocity)&&(i.trigger(this.name,e),i.trigger(this.name+e.direction,e))}}},t.Gestures.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!0,drag_block_vertical:!0,drag_lock_to_axis:!1,drag_lock_min_distance:25},triggered:!1,handler:function(e,i){if(t.Gestures.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",e),void(this.triggered=!1);if(!(i.options.drag_max_touches>0&&e.touches.length>i.options.drag_max_touches))switch(e.eventType){case t.Gestures.EVENT_START:this.triggered=!1;break;case t.Gestures.EVENT_MOVE:if(e.distance<i.options.drag_min_distance&&t.Gestures.detection.current.name!=this.name)return;if(t.Gestures.detection.current.name!=this.name&&(t.Gestures.detection.current.name=this.name,i.options.correct_for_drag_min_distance)){var n=Math.abs(i.options.drag_min_distance/e.distance);t.Gestures.detection.current.startEvent.center.pageX+=e.deltaX*n,t.Gestures.detection.current.startEvent.center.pageY+=e.deltaY*n,e=t.Gestures.detection.extendEventData(e)}(t.Gestures.detection.current.lastEvent.drag_locked_to_axis||i.options.drag_lock_to_axis&&i.options.drag_lock_min_distance<=e.distance)&&(e.drag_locked_to_axis=!0);var r=t.Gestures.detection.current.lastEvent.direction;e.drag_locked_to_axis&&r!==e.direction&&(e.direction=t.Gestures.utils.isVertical(r)?e.deltaY<0?t.Gestures.DIRECTION_UP:t.Gestures.DIRECTION_DOWN:e.deltaX<0?t.Gestures.DIRECTION_LEFT:t.Gestures.DIRECTION_RIGHT),this.triggered||(i.trigger(this.name+"start",e),this.triggered=!0),i.trigger(this.name,e),i.trigger(this.name+e.direction,e),(i.options.drag_block_vertical&&t.Gestures.utils.isVertical(e.direction)||i.options.drag_block_horizontal&&!t.Gestures.utils.isVertical(e.direction))&&e.preventDefault();break;case t.Gestures.EVENT_END:this.triggered&&i.trigger(this.name+"end",e),this.triggered=!1}}},t.Gestures.gestures.Transform={name:"transform",index:45,defaults:{transform_min_scale:.01,transform_min_rotation:1,transform_always_block:!1},triggered:!1,handler:function(e,i){if(t.Gestures.detection.current.name!=this.name&&this.triggered)return i.trigger(this.name+"end",e),void(this.triggered=!1);if(!(e.touches.length<2))switch(i.options.transform_always_block&&e.preventDefault(),e.eventType){case t.Gestures.EVENT_START:this.triggered=!1;break;case t.Gestures.EVENT_MOVE:var n=Math.abs(1-e.scale),r=Math.abs(e.rotation);if(n<i.options.transform_min_scale&&r<i.options.transform_min_rotation)return;t.Gestures.detection.current.name=this.name,this.triggered||(i.trigger(this.name+"start",e),this.triggered=!0),i.trigger(this.name,e),r>i.options.transform_min_rotation&&i.trigger("rotate",e),n>i.options.transform_min_scale&&(i.trigger("pinch",e),i.trigger("pinch"+(e.scale<1?"in":"out"),e));break;case t.Gestures.EVENT_END:this.triggered&&i.trigger(this.name+"end",e),this.triggered=!1}}},t.Gestures.gestures.Touch={name:"touch",index:-1/0,defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(e,i){return i.options.prevent_mouseevents&&e.pointerType==t.Gestures.POINTER_MOUSE?void e.stopDetect():(i.options.prevent_default&&e.preventDefault(),void(e.eventType==t.Gestures.EVENT_START&&i.trigger(this.name,e)))}},t.Gestures.gestures.Release={name:"release",index:1/0,handler:function(e,i){e.eventType==t.Gestures.EVENT_END&&i.trigger(this.name,e)}}}(window.ionic),function(t,e,i){function n(){i.Platform.isWebView()?e.addEventListener("deviceready",r,!1):r(),t.removeEventListener("load",n,!1)}function r(){i.Platform.isReady=!0,i.Platform.detect();for(var t=0;t<a.length;t++)a[t]();a=[],i.trigger("platformready",{target:e}),i.requestAnimationFrame(function(){e.body.classList.add("platform-ready")})}i.Platform={isReady:!1,isFullScreen:!1,platforms:null,grade:null,ua:navigator.userAgent,ready:function(t){this.isReady?t():a.push(t)},detect:function(){i.Platform._checkPlatforms(),i.requestAnimationFrame(function(){for(var t=0;t<i.Platform.platforms.length;t++)e.body.classList.add("platform-"+i.Platform.platforms[t]);e.body.classList.add("grade-"+i.Platform.grade)})},device:function(){return t.device?t.device:(this.isWebView(),{})},_checkPlatforms:function(){this.platforms=[],this.grade="a",this.isWebView()&&(this.platforms.push("webview"),this.platforms.push("cordova")),this.isIPad()&&this.platforms.push("ipad");var t=this.platform();if(t){this.platforms.push(t);var e=this.version();if(e){var i=e.toString();i.indexOf(".")>0?i=i.replace(".","_"):i+="_0",this.platforms.push(t+i.split("_")[0]),this.platforms.push(t+i),this.isAndroid()&&4.4>e&&(this.grade=4>e?"c":"b")}}},isWebView:function(){return!(!t.cordova&&!t.PhoneGap&&!t.phonegap)},isIPad:function(){return this.ua.toLowerCase().indexOf("ipad")>=0},isIOS:function(){return this.is("ios")},isAndroid:function(){return this.is("android")},platform:function(){return null===o&&this.setPlatform(this.device().platform),o},setPlatform:function(t){o="undefined"!=typeof t&&null!==t&&t.length?t.toLowerCase():this.ua.indexOf("Android")>0?"android":this.ua.indexOf("iPhone")>-1||this.ua.indexOf("iPad")>-1||this.ua.indexOf("iPod")>-1?"ios":""},version:function(){return null===s&&this.setVersion(this.device().version),s},setVersion:function(t){if("undefined"!=typeof t&&null!==t&&(t=t.split("."),t=parseFloat(t[0]+"."+(t.length>1?t[1]:0)),!isNaN(t)))return void(s=t);s=0;var e=this.platform(),i={android:/Android (\d+).(\d+)?/,ios:/OS (\d+)_(\d+)?/};i[e]&&(t=this.ua.match(i[e]),t.length>2&&(s=parseFloat(t[1]+"."+t[2])))},is:function(t){if(t=t.toLowerCase(),this.platforms)for(var e=0;e<this.platforms.length;e++)if(this.platforms[e]===t)return!0;var i=this.platform();return i?i===t.toLowerCase():this.ua.toLowerCase().indexOf(t)>=0},exitApp:function(){this.ready(function(){navigator.app&&navigator.app.exitApp&&navigator.app.exitApp()})},showStatusBar:function(n){this._showStatusBar=n,this.ready(function(){i.requestAnimationFrame(function(){i.Platform._showStatusBar?(t.StatusBar&&t.StatusBar.show(),e.body.classList.remove("status-bar-hide")):(t.StatusBar&&t.StatusBar.hide(),e.body.classList.add("status-bar-hide"))})})},fullScreen:function(t,n){this.isFullScreen=t!==!1,i.DomUtil.ready(function(){i.requestAnimationFrame(function(){i.Platform.isFullScreen?e.body.classList.add("fullscreen"):e.body.classList.remove("fullscreen")}),i.Platform.showStatusBar(n===!0)})}};var o=null,s=null,a=[];t.addEventListener("load",n,!1)}(this,document,ionic),function(t,e){"use strict";e.CSS={},function(){var i,n=["webkitTransform","transform","-webkit-transform","webkit-transform","-moz-transform","moz-transform","MozTransform","mozTransform"];for(i=0;i<n.length;i++)if(void 0!==t.documentElement.style[n[i]]){e.CSS.TRANSFORM=n[i];break}for(n=["webkitTransition","mozTransition","transition"],i=0;i<n.length;i++)if(void 0!==t.documentElement.style[n[i]]){e.CSS.TRANSITION=n[i];break}}(),"classList"in t.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function t(t){return function(){var i,n=e.className.split(/\s+/);for(i=0;i<arguments.length;i++)t(n,n.indexOf(arguments[i]),arguments[i]);e.className=n.join(" ")}}var e=this;return{add:t(function(t,e,i){~e||t.push(i)}),remove:t(function(t,e){~e&&t.splice(e,1)}),toggle:t(function(t,e,i){~e?t.splice(e,1):t.push(i)}),contains:function(t){return!!~e.className.split(/\s+/).indexOf(t)},item:function(t){return e.className.split(/\s+/)[t]||null}}}})}(document,ionic);var z,H,F,W,U,q,B,Z=6,j={click:n,mousedown:o,mouseup:s,mousemove:a,touchstart:l,touchend:c,touchcancel:h,touchmove:u,focusin:g,focusout:m};ionic.tap={register:function(e){return z=e,t("click",!0,!0),t("mouseup"),t("mousedown"),t("touchstart"),t("touchend"),t("touchcancel"),t("focusin"),t("focusout"),function(){for(var e in j)t(e,!1);z=null,H=null,F=!1,U=!1,q=null}},ignoreScrollStart:function(t){return t.defaultPrevented||t.target.isContentEditable||"range"===t.target.type||"true"==(t.target.dataset?t.target.dataset.preventScroll:t.target.getAttribute("data-prevent-default"))||!!/object|embed/i.test(t.target.tagName)},isTextInput:function(t){return!!t&&("TEXTAREA"==t.tagName||"true"===t.contentEditable||"INPUT"==t.tagName&&!/radio|checkbox|range|file|submit|reset/i.test(t.type))},isLabelWithTextInput:function(t){var e=S(t,!1);return!!e&&ionic.tap.isTextInput(b(e))},containsOrIsTextInput:function(t){return ionic.tap.isTextInput(t)||ionic.tap.isLabelWithTextInput(t)},cloneFocusedInput:function(t){ionic.tap.hasCheckedClone||(ionic.tap.hasCheckedClone=!0,ionic.requestAnimationFrame(function(){var e=t.querySelector(":focus");if(ionic.tap.isTextInput(e)){var i=e.parentElement.querySelector(".cloned-text-input");i||(i=document.createElement(e.tagName),i.type=e.type,i.value=e.value,i.className="cloned-text-input",i.readOnly=!0,e.parentElement.insertBefore(i,e),e.style.top=e.offsetTop,e.classList.add("previous-input-focus"))}}))},hasCheckedClone:!1,removeClonedInputs:function(t){ionic.tap.hasCheckedClone=!1,ionic.requestAnimationFrame(function(){var e,i=t.querySelectorAll(".cloned-text-input"),n=t.querySelectorAll(".previous-input-focus");for(e=0;e<i.length;e++)i[e].parentElement.removeChild(i[e]);for(e=0;e<n.length;e++)n[e].classList.remove("previous-input-focus"),n[e].style.top="",n[e].focus()})}},ionic.DomUtil.ready(function(){ionic.tap.register(document)}),function(t,e){"use strict";function i(){s={},e.requestAnimationFrame(o)}function n(){for(var t in s)s[t]&&(s[t].classList.add(c),a[t]=s[t]);s={}}function o(){for(var t in a)a[t]&&(a[t].classList.remove(c),delete a[t])}var s={},a={},l=0,c="activated";e.activator={start:function(t){var i=this;e.requestAnimationFrame(function(){if(!r(t.target)){for(var o,a=t.target,c=0;4>c&&(a&&1===a.nodeType);c++){if(o&&a.classList.contains("item")){o=a;break}if(("A"==a.tagName||"BUTTON"==a.tagName||a.hasAttribute("ng-click"))&&(o=a),a.classList.contains("button")){o=a;break}a=a.parentElement}o&&(s[l]=o,"touchstart"===t.type?i._activateTimeout=setTimeout(n,80):e.requestAnimationFrame(n),l=l>19?0:l+1)}})},end:function(){clearTimeout(this._activateTimeout),setTimeout(i,200)}}}(document,ionic),function(t){var e=["0","0","0"];t.Utils={arrayMove:function(t,e,i){if(i>=t.length)for(var n=i-t.length;n--+1;)t.push(void 0);return t.splice(i,0,t.splice(e,1)[0]),t},proxy:function(t,e){var i=Array.prototype.slice.call(arguments,2);return function(){return t.apply(e,i.concat(Array.prototype.slice.call(arguments)))}},debounce:function(t,e,i){var n,r,o,s,a;return function(){o=this,r=arguments,s=new Date;var l=function(){var c=new Date-s;e>c?n=setTimeout(l,e-c):(n=null,i||(a=t.apply(o,r)))},c=i&&!n;return n||(n=setTimeout(l,e)),c&&(a=t.apply(o,r)),a}},throttle:function(t,e,i){var n,r,o,s=null,a=0;i||(i={});var l=function(){a=i.leading===!1?0:Date.now(),s=null,o=t.apply(n,r)};return function(){var c=Date.now();a||i.leading!==!1||(a=c);var u=e-(c-a);return n=this,r=arguments,0>=u?(clearTimeout(s),s=null,a=c,o=t.apply(n,r)):s||i.trailing===!1||(s=setTimeout(l,u)),o}},inherit:function(e,i){var n,r=this;n=e&&e.hasOwnProperty("constructor")?e.constructor:function(){return r.apply(this,arguments)
|
|
},t.extend(n,r,i);var o=function(){this.constructor=n};return o.prototype=r.prototype,n.prototype=new o,e&&t.extend(n.prototype,e),n.__super__=r.prototype,n},extend:function(t){for(var e=Array.prototype.slice.call(arguments,1),i=0;i<e.length;i++){var n=e[i];if(n)for(var r in n)t[r]=n[r]}return t},nextUid:function(){for(var t,i=e.length;i;){if(i--,t=e[i].charCodeAt(0),57==t)return e[i]="A",e.join("");if(90!=t)return e[i]=String.fromCharCode(t+1),e.join("");e[i]="0"}return e.unshift("0"),e.join("")}},t.inherit=t.Utils.inherit,t.extend=t.Utils.extend,t.throttle=t.Utils.throttle,t.proxy=t.Utils.proxy,t.debounce=t.Utils.debounce}(window.ionic);var K,Q,J,$=window.innerHeight,te="keyboard-open",ee="scroll";ionic.keyboard={isOpen:!1,height:null},ionic.Platform.ready(function(){N(),setTimeout(N,999),document.addEventListener("touchstart",y,!1)});var ie,ne={};ionic.DomUtil.ready(function(){V()}),function(t){"use strict";t.views.View=function(){this.initialize.apply(this,arguments)},t.views.View.inherit=t.inherit,t.extend(t.views.View.prototype,{initialize:function(){}})}(window.ionic);var re={effect:{}};!function(t){var e=Date.now||function(){return+new Date},i=60,n=1e3,r={},o=1;re.effect.Animate={requestAnimationFrame:function(){var e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame,i=!!e;if(e&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(e.toString())&&(i=!1),i)return function(t,i){e(t,i)};var n=60,r={},o=0,s=1,a=null,l=+new Date;return function(t){var e=s++;return r[e]=t,o++,null===a&&(a=setInterval(function(){var t=+new Date,e=r;r={},o=0;for(var i in e)e.hasOwnProperty(i)&&(e[i](t),l=t);t-l>2500&&(clearInterval(a),a=null)},1e3/n)),e}}(),stop:function(t){var e=null!=r[t];return e&&(r[t]=null),e},isRunning:function(t){return null!=r[t]},start:function(t,s,a,l,c,u){var h=e(),d=h,_=0,f=0,p=o++;if(u||(u=document.body),p%20===0){var g={};for(var m in r)g[m]=!0;r=g}var v=function(o){var g=o!==!0,m=e();if(!r[p]||s&&!s(p))return r[p]=null,void(a&&a(i-f/((m-h)/n),p,!1));if(g)for(var T=Math.round((m-d)/(n/i))-1,E=0;E<Math.min(T,4);E++)v(!0),f++;l&&(_=(m-h)/l,_>1&&(_=1));var S=c?c(_):_;t(S,m,g)!==!1&&1!==_||!g?g&&(d=m,re.effect.Animate.requestAnimationFrame(v,u)):(r[p]=null,a&&a(i-f/((m-h)/n),p,1===_||null==l))};return r[p]=!0,re.effect.Animate.requestAnimationFrame(v,u),p}}}(this);!function(t){var e=function(){},i=function(t){return Math.pow(t-1,3)+1},n=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)};t.views.Scroll=t.views.View.inherit({initialize:function(i){var n=this;this.__container=i.el,this.__content=i.el.firstElementChild,setTimeout(function(){n.__container&&n.__content&&(n.__container.scrollTop=0,n.__content.scrollTop=0)}),this.options={scrollingX:!1,scrollbarX:!0,scrollingY:!0,scrollbarY:!0,startX:0,startY:0,wheelDampen:6,minScrollbarSizeX:5,minScrollbarSizeY:5,scrollbarsFade:!0,scrollbarFadeDelay:300,scrollbarResizeFadeDelay:1e3,animating:!0,animationDuration:250,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,scrollingComplete:e,penetrationDeceleration:.03,penetrationAcceleration:.08,scrollEventInterval:10,getContentWidth:function(){return Math.max(n.__content.scrollWidth,n.__content.offsetWidth)},getContentHeight:function(){return Math.max(n.__content.scrollHeight,n.__content.offsetHeight)}};for(var r in i)this.options[r]=i[r];this.hintResize=t.debounce(function(){n.resize()},1e3,!0),this.onScroll=function(){t.scroll.isScrolling?(clearTimeout(n.scrollTimer),n.scrollTimer=setTimeout(n.setScrollStop,80)):setTimeout(n.setScrollStart,50)},this.setScrollStart=function(){t.scroll.isScrolling=Math.abs(t.scroll.lastTop-n.__scrollTop)>1,clearTimeout(n.scrollTimer),n.scrollTimer=setTimeout(n.setScrollStop,80)},this.setScrollStop=function(){t.scroll.isScrolling=!1,t.scroll.lastTop=n.__scrollTop},this.triggerScrollEvent=t.throttle(function(){t.trigger("scroll",{scrollTop:n.__scrollTop,scrollLeft:n.__scrollLeft,target:n.__container})},this.options.scrollEventInterval),this.triggerScrollEndEvent=function(){t.trigger("scrollend",{scrollTop:n.__scrollTop,scrollLeft:n.__scrollLeft,target:n.__container})},this.__scrollLeft=this.options.startX,this.__scrollTop=this.options.startY,this.__callback=this.getRenderFn(),this.__initEventHandlers(),this.__createScrollbars()},run:function(){this.resize(),this.__fadeScrollbars("out",this.options.scrollbarResizeFadeDelay)},__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,__transformProperty:null,__perspectiveProperty:null,__indicatorX:null,__indicatorY:null,__scrollbarFadeTimeout:null,__didWaitForSize:null,__sizerTimeout:null,__initEventHandlers:function(){var e=this,i=this.__container;if(i.addEventListener("scrollChildIntoView",function(n){e.isScrolledIntoView||(i.style.height=i.clientHeight-n.detail.keyboardHeight+"px",i.style.overflow="visible",e.isScrolledIntoView=!0,e.resize()),n.detail.isElementUnderKeyboard&&(t.scroll.isScrolling=!0,setTimeout(function(){var r=.5*i.clientHeight,o=n.detail.keyboardTopOffset+r;t.tap.cloneFocusedInput(i,e),e.scrollBy(0,o,!0),e.onScroll()},t.Platform.isIOS()?80:350)),n.stopPropagation()}),i.addEventListener("resetScrollView",function(){e.isScrolledIntoView=!1,i.style.height="",i.style.overflow="",e.resize(),t.scroll.isScrolling=!1}),e.touchStart=function(i){if(e.startCoordinates=E(i),!t.tap.ignoreScrollStart(i)){if(t.tap.containsOrIsTextInput(i.target))return void(e.__hasStarted=!1);e.__isSelectable=!0,e.__enableScrollY=!0,e.__hasStarted=!0,e.doTouchStart(i.touches,i.timeStamp),i.preventDefault()}},e.touchMove=function(n){if(!n.defaultPrevented){if(!e.__hasStarted&&t.tap.containsOrIsTextInput(n.target))return e.__hasStarted=!0,e.doTouchStart(n.touches,n.timeStamp),void n.preventDefault();if(e.startCoordinates){var r=E(n);e.__isSelectable&&t.tap.isTextInput(n.target)&&Math.abs(e.startCoordinates.x-r.x)>20&&(e.__enableScrollY=!1,e.__isSelectable=!0),e.__enableScrollY&&Math.abs(e.startCoordinates.y-r.y)>10&&(e.__isSelectable=!1,t.tap.cloneFocusedInput(i,e))}e.doTouchMove(n.touches,n.timeStamp,n.scale)}},e.touchEnd=function(n){e.doTouchEnd(n.timeStamp),e.__hasStarted=!1,e.__isSelectable=!0,e.__enableScrollY=!0,e.__isDragging||e.__isDecelerating||e.__isAnimating||t.tap.removeClonedInputs(i,e)},e.options.orgScrollingComplete=e.options.scrollingComplete,e.options.scrollingComplete=function(){t.tap.removeClonedInputs(i,e),e.options.orgScrollingComplete()},"ontouchstart"in window)i.addEventListener("touchstart",e.touchStart,!1),document.addEventListener("touchmove",e.touchMove,!1),document.addEventListener("touchend",e.touchEnd,!1),document.addEventListener("touchcancel",e.touchEnd,!1);else{var n=!1;i.addEventListener("mousedown",function(i){t.tap.ignoreScrollStart(i)||"SELECT"===i.target.tagName||(e.doTouchStart([{pageX:i.pageX,pageY:i.pageY}],i.timeStamp),i.preventDefault(),n=!0)},!1),document.addEventListener("mousemove",function(t){n&&!t.defaultPrevented&&(e.doTouchMove([{pageX:t.pageX,pageY:t.pageY}],t.timeStamp),n=!0)},!1),document.addEventListener("mouseup",function(t){n&&(e.doTouchEnd(t.timeStamp),n=!1)},!1);var r=t.debounce(function(){e.__fadeScrollbars("in")},500,!0),o=t.debounce(function(){e.__fadeScrollbars("out")},100,!1);document.addEventListener("mousewheel",function(t){r(),e.scrollBy(t.wheelDeltaX/e.options.wheelDampen,-t.wheelDeltaY/e.options.wheelDampen),o()})}},__createScrollbar:function(t){var e=document.createElement("div"),i=document.createElement("div");return i.className="scroll-bar-indicator",e.className="h"==t?"scroll-bar scroll-bar-h":"scroll-bar scroll-bar-v",e.appendChild(i),e},__createScrollbars:function(){var t,e;this.options.scrollingX&&(t={el:this.__createScrollbar("h"),sizeRatio:1},t.indicator=t.el.children[0],this.options.scrollbarX&&this.__container.appendChild(t.el),this.__indicatorX=t),this.options.scrollingY&&(e={el:this.__createScrollbar("v"),sizeRatio:1},e.indicator=e.el.children[0],this.options.scrollbarY&&this.__container.appendChild(e.el),this.__indicatorY=e)},__resizeScrollbars:function(){var t=this;if(t.__indicatorX){var e=Math.max(Math.round(t.__clientWidth*t.__clientWidth/t.__contentWidth),20);e>t.__contentWidth&&(e=0),t.__indicatorX.size=e,t.__indicatorX.minScale=this.options.minScrollbarSizeX/e,t.__indicatorX.indicator.style.width=e+"px",t.__indicatorX.maxPos=t.__clientWidth-e,t.__indicatorX.sizeRatio=t.__maxScrollLeft?t.__indicatorX.maxPos/t.__maxScrollLeft:1}if(t.__indicatorY){var i=Math.max(Math.round(t.__clientHeight*t.__clientHeight/t.__contentHeight),20);i>t.__contentHeight&&(i=0),t.__indicatorY.size=i,t.__indicatorY.minScale=this.options.minScrollbarSizeY/i,t.__indicatorY.maxPos=t.__clientHeight-i,t.__indicatorY.indicator.style.height=i+"px",t.__indicatorY.sizeRatio=t.__maxScrollTop?t.__indicatorY.maxPos/t.__maxScrollTop:1}},__repositionScrollbars:function(){var t,e,i,n,r,o=this,s=0,a=0;o.__indicatorX&&(o.__indicatorY&&(s=10),n=Math.round(o.__indicatorX.sizeRatio*o.__scrollLeft)||0,e=o.__scrollLeft-(o.__maxScrollLeft-s),o.__scrollLeft<0?(widthScale=Math.max(o.__indicatorX.minScale,(o.__indicatorX.size-Math.abs(o.__scrollLeft))/o.__indicatorX.size),n=0,o.__indicatorX.indicator.style[o.__transformOriginProperty]="left center"):e>0?(widthScale=Math.max(o.__indicatorX.minScale,(o.__indicatorX.size-e)/o.__indicatorX.size),n=o.__indicatorX.maxPos-s,o.__indicatorX.indicator.style[o.__transformOriginProperty]="right center"):(n=Math.min(o.__maxScrollLeft,Math.max(0,n)),widthScale=1),o.__indicatorX.indicator.style[o.__transformProperty]="translate3d("+n+"px, 0, 0) scaleX("+widthScale+")"),o.__indicatorY&&(r=Math.round(o.__indicatorY.sizeRatio*o.__scrollTop)||0,o.__indicatorX&&(a=10),i=o.__scrollTop-(o.__maxScrollTop-a),o.__scrollTop<0?(t=Math.max(o.__indicatorY.minScale,(o.__indicatorY.size-Math.abs(o.__scrollTop))/o.__indicatorY.size),r=0,o.__indicatorY.indicator.style[o.__transformOriginProperty]="center top"):i>0?(t=Math.max(o.__indicatorY.minScale,(o.__indicatorY.size-i)/o.__indicatorY.size),r=o.__indicatorY.maxPos-a,o.__indicatorY.indicator.style[o.__transformOriginProperty]="center bottom"):(r=Math.min(o.__maxScrollTop,Math.max(0,r)),t=1),o.__indicatorY.indicator.style[o.__transformProperty]="translate3d(0,"+r+"px, 0) scaleY("+t+")")},__fadeScrollbars:function(t,e){var i=this;if(this.options.scrollbarsFade){var n="scroll-bar-fade-out";i.options.scrollbarsFade===!0&&(clearTimeout(i.__scrollbarFadeTimeout),"in"==t?(i.__indicatorX&&i.__indicatorX.indicator.classList.remove(n),i.__indicatorY&&i.__indicatorY.indicator.classList.remove(n)):i.__scrollbarFadeTimeout=setTimeout(function(){i.__indicatorX&&i.__indicatorX.indicator.classList.add(n),i.__indicatorY&&i.__indicatorY.indicator.classList.add(n)},e||i.options.scrollbarFadeDelay))}},__scrollingComplete:function(){var t=this;t.options.scrollingComplete(),t.__fadeScrollbars("out")},resize:function(){this.setDimensions(this.__container.clientWidth,this.__container.clientHeight,this.options.getContentWidth(),this.options.getContentHeight())},getRenderFn:function(){var t,e=this,i=this.__content,n=document.documentElement.style;"MozAppearance"in n?t="gecko":"WebkitAppearance"in n?t="webkit":"string"==typeof navigator.cpuClass&&(t="trident");var r,o={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[t],s=document.createElement("div"),a=o+"Perspective",l=o+"Transform",c=o+"TransformOrigin";return e.__perspectiveProperty=l,e.__transformProperty=l,e.__transformOriginProperty=c,s.style[a]!==r?function(t,n,r,o){i.style[l]="translate3d("+-t+"px,"+-n+"px,0) scale("+r+")",e.__repositionScrollbars(),o||e.triggerScrollEvent()}:s.style[l]!==r?function(t,n,r,o){i.style[l]="translate("+-t+"px,"+-n+"px) scale("+r+")",e.__repositionScrollbars(),o||e.triggerScrollEvent()}:function(t,n,r,o){i.style.marginLeft=t?-t/r+"px":"",i.style.marginTop=n?-n/r+"px":"",i.style.zoom=r||"",e.__repositionScrollbars(),o||e.triggerScrollEvent()}},setDimensions:function(t,e,i,n){var r=this;t===+t&&(r.__clientWidth=t),e===+e&&(r.__clientHeight=e),i===+i&&(r.__contentWidth=i),n===+n&&(r.__contentHeight=n),r.__computeScrollMax(),r.__resizeScrollbars(),r.scrollTo(r.__scrollLeft,r.__scrollTop,!0,null,!0)},setPosition:function(t,e){var i=this;i.__clientLeft=t||0,i.__clientTop=e||0},setSnapSize:function(t,e){var i=this;i.__snapWidth=t,i.__snapHeight=e},activatePullToRefresh:function(t,e,i,n){var r=this;r.__refreshHeight=t,r.__refreshActivate=e,r.__refreshDeactivate=i,r.__refreshStart=n},triggerPullToRefresh:function(){this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0),this.__refreshStart&&this.__refreshStart()},finishPullToRefresh:function(){var t=this;t.__refreshActive=!1,t.__refreshDeactivate&&t.__refreshDeactivate(),t.scrollTo(t.__scrollLeft,t.__scrollTop,!0)},getValues:function(){var t=this;return{left:t.__scrollLeft,top:t.__scrollTop,zoom:t.__zoomLevel}},getScrollMax:function(){var t=this;return{left:t.__maxScrollLeft,top:t.__maxScrollTop}},zoomTo:function(t,e,i,n){var r=this;if(!r.options.zooming)throw new Error("Zooming is not enabled!");r.__isDecelerating&&(re.effect.Animate.stop(r.__isDecelerating),r.__isDecelerating=!1);var o=r.__zoomLevel;null==i&&(i=r.__clientWidth/2),null==n&&(n=r.__clientHeight/2),t=Math.max(Math.min(t,r.options.maxZoom),r.options.minZoom),r.__computeScrollMax(t);var s=(i+r.__scrollLeft)*t/o-i,a=(n+r.__scrollTop)*t/o-n;s>r.__maxScrollLeft?s=r.__maxScrollLeft:0>s&&(s=0),a>r.__maxScrollTop?a=r.__maxScrollTop:0>a&&(a=0),r.__publish(s,a,t,e)},zoomBy:function(t,e,i,n){var r=this;r.zoomTo(r.__zoomLevel*t,e,i,n)},scrollTo:function(t,e,i,n,r){var o=this;if(o.__isDecelerating&&(re.effect.Animate.stop(o.__isDecelerating),o.__isDecelerating=!1),null!=n&&n!==o.__zoomLevel){if(!o.options.zooming)throw new Error("Zooming is not enabled!");t*=n,e*=n,o.__computeScrollMax(n)}else n=o.__zoomLevel;o.options.scrollingX?o.options.paging?t=Math.round(t/o.__clientWidth)*o.__clientWidth:o.options.snapping&&(t=Math.round(t/o.__snapWidth)*o.__snapWidth):t=o.__scrollLeft,o.options.scrollingY?o.options.paging?e=Math.round(e/o.__clientHeight)*o.__clientHeight:o.options.snapping&&(e=Math.round(e/o.__snapHeight)*o.__snapHeight):e=o.__scrollTop,t=Math.max(Math.min(o.__maxScrollLeft,t),0),e=Math.max(Math.min(o.__maxScrollTop,e),0),t===o.__scrollLeft&&e===o.__scrollTop&&(i=!1),o.__publish(t,e,n,i,r)},scrollBy:function(t,e,i){var n=this,r=n.__isAnimating?n.__scheduledLeft:n.__scrollLeft,o=n.__isAnimating?n.__scheduledTop:n.__scrollTop;n.scrollTo(r+(t||0),o+(e||0),i)},doMouseZoom:function(t,e,i,n){var r=this,o=t>0?.97:1.03;return r.zoomTo(r.__zoomLevel*o,!1,i-r.__clientLeft,n-r.__clientTop)},doTouchStart:function(t,e){if(this.hintResize(),null==t.length)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);var i=this;i.__interruptedAnimation=!0,i.__isDecelerating&&(re.effect.Animate.stop(i.__isDecelerating),i.__isDecelerating=!1,i.__interruptedAnimation=!0),i.__isAnimating&&(re.effect.Animate.stop(i.__isAnimating),i.__isAnimating=!1,i.__interruptedAnimation=!0);var n,r,o=1===t.length;o?(n=t[0].pageX,r=t[0].pageY):(n=Math.abs(t[0].pageX+t[1].pageX)/2,r=Math.abs(t[0].pageY+t[1].pageY)/2),i.__initialTouchLeft=n,i.__initialTouchTop=r,i.__zoomLevelStart=i.__zoomLevel,i.__lastTouchLeft=n,i.__lastTouchTop=r,i.__lastTouchMove=e,i.__lastScale=1,i.__enableScrollX=!o&&i.options.scrollingX,i.__enableScrollY=!o&&i.options.scrollingY,i.__isTracking=!0,i.__didDecelerationComplete=!1,i.__isDragging=!o,i.__isSingleTouch=o,i.__positions=[]},doTouchMove:function(t,e,i){if(null==t.length)throw new Error("Invalid touch list: "+t);if(e instanceof Date&&(e=e.valueOf()),"number"!=typeof e)throw new Error("Invalid timestamp value: "+e);var n=this;if(n.__isTracking){var r,o;2===t.length?(r=Math.abs(t[0].pageX+t[1].pageX)/2,o=Math.abs(t[0].pageY+t[1].pageY)/2):(r=t[0].pageX,o=t[0].pageY);var s=n.__positions;if(n.__isDragging){var a=r-n.__lastTouchLeft,l=o-n.__lastTouchTop,c=n.__scrollLeft,u=n.__scrollTop,h=n.__zoomLevel;if(null!=i&&n.options.zooming){var d=h;if(h=h/n.__lastScale*i,h=Math.max(Math.min(h,n.options.maxZoom),n.options.minZoom),d!==h){var _=r-n.__clientLeft,f=o-n.__clientTop;c=(_+c)*h/d-_,u=(f+u)*h/d-f,n.__computeScrollMax(h)}}if(n.__enableScrollX){c-=a*this.options.speedMultiplier;var p=n.__maxScrollLeft;(c>p||0>c)&&(n.options.bouncing?c+=a/2*this.options.speedMultiplier:c=c>p?p:0)}if(n.__enableScrollY){u-=l*this.options.speedMultiplier;var g=n.__maxScrollTop;(u>g||0>u)&&(n.options.bouncing||n.__refreshHeight&&0>u?(u+=l/2*this.options.speedMultiplier,n.__enableScrollX||null==n.__refreshHeight||(!n.__refreshActive&&u<=-n.__refreshHeight?(n.__refreshActive=!0,n.__refreshActivate&&n.__refreshActivate()):n.__refreshActive&&u>-n.__refreshHeight&&(n.__refreshActive=!1,n.__refreshDeactivate&&n.__refreshDeactivate()))):u=u>g?g:0)}s.length>60&&s.splice(0,30),s.push(c,u,e),n.__publish(c,u,h)}else{var m=n.options.locking?3:0,v=5,T=Math.abs(r-n.__initialTouchLeft),E=Math.abs(o-n.__initialTouchTop);n.__enableScrollX=n.options.scrollingX&&T>=m,n.__enableScrollY=n.options.scrollingY&&E>=m,s.push(n.__scrollLeft,n.__scrollTop,e),n.__isDragging=(n.__enableScrollX||n.__enableScrollY)&&(T>=v||E>=v),n.__isDragging&&(n.__interruptedAnimation=!1,n.__fadeScrollbars("in"))}n.__lastTouchLeft=r,n.__lastTouchTop=o,n.__lastTouchMove=e,n.__lastScale=i}},doTouchEnd:function(t){if(t instanceof Date&&(t=t.valueOf()),"number"!=typeof t)throw new Error("Invalid timestamp value: "+t);var e=this;if(e.__isTracking){if(e.__isTracking=!1,e.__isDragging)if(e.__isDragging=!1,e.__isSingleTouch&&e.options.animating&&t-e.__lastTouchMove<=100){for(var i=e.__positions,n=i.length-1,r=n,o=n;o>0&&i[o]>e.__lastTouchMove-100;o-=3)r=o;if(r!==n){var s=i[n]-i[r],a=e.__scrollLeft-i[r-2],l=e.__scrollTop-i[r-1];e.__decelerationVelocityX=a/s*(1e3/60),e.__decelerationVelocityY=l/s*(1e3/60);var c=e.options.paging||e.options.snapping?4:1;(Math.abs(e.__decelerationVelocityX)>c||Math.abs(e.__decelerationVelocityY)>c)&&(e.__refreshActive||e.__startDeceleration(t))}else e.__scrollingComplete()}else t-e.__lastTouchMove>100&&e.__scrollingComplete();e.__isDecelerating||(e.__refreshActive&&e.__refreshStart?(e.__publish(e.__scrollLeft,-e.__refreshHeight,e.__zoomLevel,!0),e.__refreshStart&&e.__refreshStart()):((e.__interruptedAnimation||e.__isDragging)&&e.__scrollingComplete(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0,e.__zoomLevel),e.__refreshActive&&(e.__refreshActive=!1,e.__refreshDeactivate&&e.__refreshDeactivate()))),e.__positions.length=0}},__publish:function(t,e,r,o,s){var a=this,l=a.__isAnimating;if(l&&(re.effect.Animate.stop(l),a.__isAnimating=!1),o&&a.options.animating){a.__scheduledLeft=t,a.__scheduledTop=e,a.__scheduledZoom=r;var c=a.__scrollLeft,u=a.__scrollTop,h=a.__zoomLevel,d=t-c,_=e-u,f=r-h,p=function(t,e,i){i&&(a.__scrollLeft=c+d*t,a.__scrollTop=u+_*t,a.__zoomLevel=h+f*t,a.__callback&&a.__callback(a.__scrollLeft,a.__scrollTop,a.__zoomLevel,s))},g=function(t){return a.__isAnimating===t},m=function(t,e,i){e===a.__isAnimating&&(a.__isAnimating=!1),(a.__didDecelerationComplete||i)&&a.__scrollingComplete(),a.options.zooming&&a.__computeScrollMax()};a.__isAnimating=re.effect.Animate.start(p,g,m,a.options.animationDuration,l?i:n)}else a.__scheduledLeft=a.__scrollLeft=t,a.__scheduledTop=a.__scrollTop=e,a.__scheduledZoom=a.__zoomLevel=r,a.__callback&&a.__callback(t,e,r,s),a.options.zooming&&a.__computeScrollMax()},__computeScrollMax:function(t){var e=this;null==t&&(t=e.__zoomLevel),e.__maxScrollLeft=Math.max(e.__contentWidth*t-e.__clientWidth,0),e.__maxScrollTop=Math.max(e.__contentHeight*t-e.__clientHeight,0),e.__didWaitForSize||0!=e.__maxScrollLeft||0!=e.__maxScrollTop||(e.__didWaitForSize=!0,e.__waitForSize())},__waitForSize:function(){var t=this;clearTimeout(t.__sizerTimeout);var e=function(){t.resize(),t.options.scrollingX&&0==t.__maxScrollLeft||t.options.scrollingY&&0==t.__maxScrollTop};e(),t.__sizerTimeout=setTimeout(e,1e3)},__startDeceleration:function(){var t=this;if(t.options.paging){var e=Math.max(Math.min(t.__scrollLeft,t.__maxScrollLeft),0),i=Math.max(Math.min(t.__scrollTop,t.__maxScrollTop),0),n=t.__clientWidth,r=t.__clientHeight;t.__minDecelerationScrollLeft=Math.floor(e/n)*n,t.__minDecelerationScrollTop=Math.floor(i/r)*r,t.__maxDecelerationScrollLeft=Math.ceil(e/n)*n,t.__maxDecelerationScrollTop=Math.ceil(i/r)*r}else t.__minDecelerationScrollLeft=0,t.__minDecelerationScrollTop=0,t.__maxDecelerationScrollLeft=t.__maxScrollLeft,t.__maxDecelerationScrollTop=t.__maxScrollTop;var o=function(e,i,n){t.__stepThroughDeceleration(n)};t.__minVelocityToKeepDecelerating=t.options.snapping?4:.1;var s=function(){var e=Math.abs(t.__decelerationVelocityX)>=t.__minVelocityToKeepDecelerating||Math.abs(t.__decelerationVelocityY)>=t.__minVelocityToKeepDecelerating;return e||(t.__didDecelerationComplete=!0),e},a=function(){t.__isDecelerating=!1,t.__didDecelerationComplete&&t.__scrollingComplete(),t.options.paging&&t.scrollTo(t.__scrollLeft,t.__scrollTop,t.options.snapping)};t.__isDecelerating=re.effect.Animate.start(o,s,a)},__stepThroughDeceleration:function(t){var e=this,i=e.__scrollLeft+e.__decelerationVelocityX,n=e.__scrollTop+e.__decelerationVelocityY;if(!e.options.bouncing){var r=Math.max(Math.min(e.__maxDecelerationScrollLeft,i),e.__minDecelerationScrollLeft);r!==i&&(i=r,e.__decelerationVelocityX=0);var o=Math.max(Math.min(e.__maxDecelerationScrollTop,n),e.__minDecelerationScrollTop);o!==n&&(n=o,e.__decelerationVelocityY=0)}if(t?e.__publish(i,n,e.__zoomLevel):(e.__scrollLeft=i,e.__scrollTop=n),!e.options.paging){var s=.95;e.__decelerationVelocityX*=s,e.__decelerationVelocityY*=s}if(e.options.bouncing){var a=0,l=0,c=e.options.penetrationDeceleration,u=e.options.penetrationAcceleration;if(i<e.__minDecelerationScrollLeft?a=e.__minDecelerationScrollLeft-i:i>e.__maxDecelerationScrollLeft&&(a=e.__maxDecelerationScrollLeft-i),n<e.__minDecelerationScrollTop?l=e.__minDecelerationScrollTop-n:n>e.__maxDecelerationScrollTop&&(l=e.__maxDecelerationScrollTop-n),0!==a){var h=a*e.__decelerationVelocityX<=e.__minDecelerationScrollLeft;h&&(e.__decelerationVelocityX+=a*c);var d=Math.abs(e.__decelerationVelocityX)<=e.__minVelocityToKeepDecelerating;(!h||d)&&(e.__decelerationVelocityX=a*u)}if(0!==l){var _=l*e.__decelerationVelocityY<=e.__minDecelerationScrollTop;_&&(e.__decelerationVelocityY+=l*c);var f=Math.abs(e.__decelerationVelocityY)<=e.__minVelocityToKeepDecelerating;(!_||f)&&(e.__decelerationVelocityY=l*u)}}}}),t.scroll={isScrolling:!1,lastTop:0}}(ionic),function(t){"use strict";t.views.ActionSheet=t.views.View.inherit({initialize:function(t){this.el=t.el},show:function(){this.el.offsetWidth,this.el.classList.add("active")},hide:function(){this.el.offsetWidth,this.el.classList.remove("active")}})}(ionic),function(t){"use strict";t.views.HeaderBar=t.views.View.inherit({initialize:function(e){this.el=e.el,t.extend(this,{alignTitle:"center"},e),this.align()},align:function(e){e||(e=this.alignTitle);var i=this.el.querySelector(".title");if(i){var n=this;t.requestAnimationFrame(function(){var r,o,s,a=n.el.childNodes,l=0,c=0,u=!1;for(r=0;r<a.length;r++)o=a[r],o.tagName&&"h1"==o.tagName.toLowerCase()?u=!0:(s=null,3==o.nodeType?s=t.DomUtil.getTextBounds(o).width:1==o.nodeType&&(s=o.offsetWidth),s&&(u?c+=s:l+=s));var h=Math.max(l,c)+10;"center"==e?(h>10&&(i.style.left=h+"px",i.style.right=h+"px"),i.offsetWidth<i.scrollWidth&&c>0&&(i.style.right=c+5+"px")):"left"==e?(i.classList.add("title-left"),l>0&&(i.style.left=l+15+"px")):"right"==e&&(i.classList.add("title-right"),c>0&&(i.style.right=c+15+"px"))})}}})}(ionic),function(t){"use strict";var e="item",i="item-content",n="item-sliding",r="item-options",o="item-placeholder",s="item-reordering",a="item-reorder",l=function(){};l.prototype={start:function(){},drag:function(){},end:function(){},isSameItem:function(){return!1}};var c=function(t){this.dragThresholdX=t.dragThresholdX||10,this.el=t.el,this.canSwipe=t.canSwipe};c.prototype=new l,c.prototype.start=function(o){var s,a,l,c;this.canSwipe()&&(s=o.target.classList.contains(i)?o.target:o.target.classList.contains(e)?o.target.querySelector("."+i):t.DomUtil.getParentWithClass(o.target,i),s&&(s.classList.remove(n),l=parseFloat(s.style[t.CSS.TRANSFORM].replace("translate3d(","").split(",")[0])||0,a=s.parentNode.querySelector("."+r),a&&(a.classList.remove("invisible"),c=a.offsetWidth,this._currentDrag={buttons:a,buttonsWidth:c,content:s,startOffsetX:l})))},c.prototype.isSameItem=function(t){return t._lastDrag&&this._currentDrag?this._currentDrag.content==t._lastDrag.content:!1},c.prototype.clean=function(){var e=this._lastDrag;e&&t.requestAnimationFrame(function(){e.content.style[t.CSS.TRANSITION]="",e.content.style[t.CSS.TRANSFORM]="",setTimeout(function(){e.buttons&&e.buttons.classList.add("invisible")},250)})},c.prototype.drag=t.animationFrameThrottle(function(e){var i;if(this._currentDrag&&(!this._isDragging&&(Math.abs(e.gesture.deltaX)>this.dragThresholdX||Math.abs(this._currentDrag.startOffsetX)>0)&&(this._isDragging=!0),this._isDragging)){i=this._currentDrag.buttonsWidth;var n=Math.min(0,this._currentDrag.startOffsetX+e.gesture.deltaX);-i>n&&(n=Math.min(-i,-i+.4*(e.gesture.deltaX+i))),this._currentDrag.content.style[t.CSS.TRANSFORM]="translate3d("+n+"px, 0, 0)",this._currentDrag.content.style[t.CSS.TRANSITION]="none"}}),c.prototype.end=function(e,i){var n=this;if(!this._currentDrag)return void(i&&i());var r=-this._currentDrag.buttonsWidth;e.gesture.deltaX>-(this._currentDrag.buttonsWidth/2)&&("left"==e.gesture.direction&&Math.abs(e.gesture.velocityX)<.3?r=0:"right"==e.gesture.direction&&(r=0)),t.requestAnimationFrame(function(){if(0===r){n._currentDrag.content.style[t.CSS.TRANSFORM]="";var e=n._currentDrag.buttons;setTimeout(function(){e&&e.classList.add("invisible")},250)}else n._currentDrag.content.style[t.CSS.TRANSFORM]="translate3d("+r+"px, 0, 0)";n._currentDrag.content.style[t.CSS.TRANSITION]="",n._lastDrag=n._currentDrag,n._currentDrag=null,i&&i()})};var u=function(t){this.dragThresholdY=t.dragThresholdY||0,this.onReorder=t.onReorder,this.listEl=t.listEl,this.el=t.el,this.scrollEl=t.scrollEl,this.scrollView=t.scrollView};u.prototype=new l,u.prototype._moveElement=function(e){var i=e.gesture.center.pageY-this._currentDrag.elementHeight+this.scrollView.getValues().top-this.listEl.offsetTop;this.el.style[t.CSS.TRANSFORM]="translate3d(0, "+i+"px, 0)"},u.prototype.start=function(e){var i=t.DomUtil.getChildIndex(this.el,this.el.nodeName.toLowerCase()),n=this.el.scrollHeight,r=this.el.cloneNode(!0);r.classList.add(o),this.el.parentNode.insertBefore(r,this.el),this.el.classList.add(s),this._currentDrag={elementHeight:n,startIndex:i,placeholder:r,scrollHeight:scroll,list:r.parentNode},this._moveElement(e)},u.prototype.drag=t.animationFrameThrottle(function(t){if(this._currentDrag){var e=0,i=t.gesture.center.pageY;if(this.scrollView){var n=this.scrollEl;e=this.scrollView.getValues().top;var r=n.offsetTop,o=r-i+this._currentDrag.elementHeight/2,s=i+this._currentDrag.elementHeight/2-r-n.offsetHeight;t.gesture.deltaY<0&&o>0&&e>0&&this.scrollView.scrollBy(null,-o),t.gesture.deltaY>0&&s>0&&e<this.scrollView.getScrollMax().top&&this.scrollView.scrollBy(null,s)}!this._isDragging&&Math.abs(t.gesture.deltaY)>this.dragThresholdY&&(this._isDragging=!0),this._isDragging&&(this._moveElement(t),this._currentDrag.currentY=e+i-this._currentDrag.placeholder.parentNode.offsetTop,this._reorderItems())}}),u.prototype._reorderItems=function(){var e=this,i=(this._currentDrag.placeholder,Array.prototype.slice.call(this._currentDrag.placeholder.parentNode.children).filter(function(t){return t!==e.el})),n=i.indexOf(this._currentDrag.placeholder),r=i[Math.max(0,n-1)],o=i[Math.min(i.length,n+1)],s=this._currentDrag.currentY;return r&&s<r.offsetTop+r.offsetHeight/2?(t.DomUtil.swapNodes(this._currentDrag.placeholder,r),n-1):o&&s>o.offsetTop+o.offsetHeight/2?(t.DomUtil.swapNodes(o,this._currentDrag.placeholder),n+1):void 0},u.prototype.end=function(e,i){if(!this._currentDrag)return void(i&&i());var n=this._currentDrag.placeholder,r=t.DomUtil.getChildIndex(n,n.nodeName.toLowerCase());this.el.classList.remove(s),this.el.style[t.CSS.TRANSFORM]="",n.parentNode.insertBefore(this.el,n),n.parentNode.removeChild(n),this.onReorder&&this.onReorder(this.el,this._currentDrag.startIndex,r),this._currentDrag=null,i&&i()},t.views.ListView=t.views.View.inherit({initialize:function(e){var i=this;e=t.extend({onReorder:function(){},virtualRemoveThreshold:-200,virtualAddThreshold:200,canSwipe:function(){return!0}},e),t.extend(this,e),!this.itemHeight&&this.listEl&&(this.itemHeight=this.listEl.children[0]&&parseInt(this.listEl.children[0].style.height,10)),this.onRefresh=e.onRefresh||function(){},this.onRefreshOpening=e.onRefreshOpening||function(){},this.onRefreshHolding=e.onRefreshHolding||function(){},window.ionic.onGesture("release",function(t){i._handleEndDrag(t)},this.el),window.ionic.onGesture("drag",function(t){i._handleDrag(t)},this.el),this._initDrag()},stopRefreshing:function(){var t=this.el.querySelector(".list-refresher");t.style.height="0px"},didScroll:function(t){if(this.isVirtual){var e=this.itemHeight,i=(this.listEl.children.length,t.target.scrollHeight),n=this.el.parentNode.offsetHeight,r=(t.scrollTop,Math.max(0,t.scrollTop+this.virtualRemoveThreshold)),o=Math.min(i,Math.abs(t.scrollTop)+n+this.virtualAddThreshold),s=Math.floor((o-r)/e),a=parseInt(Math.abs(r/e),10),l=parseInt(Math.abs(o/e),10);this._virtualItemsToRemove=Array.prototype.slice.call(this.listEl.children,0,a);{Array.prototype.slice.call(this.listEl.children,a,a+s)}this.renderViewport&&this.renderViewport(r,o,a,l)}},didStopScrolling:function(){if(this.isVirtual)for(var t=0;t<this._virtualItemsToRemove.length;t++){{this._virtualItemsToRemove[t]}this.didHideItem&&this.didHideItem(t)}},clearDragEffects:function(){this._lastDragOp&&(this._lastDragOp.clean&&this._lastDragOp.clean(),this._lastDragOp=null)},_initDrag:function(){this._lastDragOp=this._dragOp,this._dragOp=null},_getItem:function(t){for(;t;){if(t.classList.contains(e))return t;t=t.parentNode}return null},_startDrag:function(e){var i=this;this._isDragging=!1;var n=this._lastDragOp;if(!t.DomUtil.getParentOrSelfWithClass(e.target,a)||"up"!=e.gesture.direction&&"down"!=e.gesture.direction){if(!this._didDragUpOrDown&&("left"==e.gesture.direction||"right"==e.gesture.direction)&&Math.abs(e.gesture.deltaX)>5){var r=this._getItem(e.target);r&&r.querySelector(".item-options")&&(this._dragOp=new c({el:this.el,canSwipe:this.canSwipe}),this._dragOp.start(e),e.preventDefault())}}else{var r=this._getItem(e.target);r&&(this._dragOp=new u({listEl:this.el,el:r,scrollEl:this.scrollEl,scrollView:this.scrollView,onReorder:function(t,e,n){i.onReorder&&i.onReorder(t,e,n)}}),this._dragOp.start(e),e.preventDefault())}n&&this._dragOp&&!this._dragOp.isSameItem(n)&&e.defaultPrevented&&n.clean&&n.clean()},_handleEndDrag:function(t){var e=this;this._didDragUpOrDown=!1,this._dragOp&&this._dragOp.end(t,function(){e._initDrag()})},_handleDrag:function(t){Math.abs(t.gesture.deltaY)>5&&(this._didDragUpOrDown=!0),this.isDragging||this._dragOp||this._startDrag(t),this._dragOp&&(t.gesture.srcEvent.preventDefault(),this._dragOp.drag(t))}})}(ionic),function(t){"use strict";t.views.Modal=t.views.View.inherit({initialize:function(e){e=t.extend({focusFirstInput:!1,unfocusOnHide:!0,focusFirstDelay:600},e),t.extend(this,e),this.el=e.el
|
|
},show:function(){var t=this;t.focusFirstInput&&window.setTimeout(function(){var e=t.el.querySelector("input, textarea");e&&e.focus&&e.focus()},t.focusFirstDelay)},hide:function(){if(this.unfocusOnHide){var t=this.el.querySelectorAll("input, textarea");window.setTimeout(function(){for(var e=0;e<t.length;e++)t[e].blur&&t[e].blur()})}}})}(ionic),function(t){"use strict";t.views.SideMenu=t.views.View.inherit({initialize:function(t){this.el=t.el,this.isEnabled="undefined"==typeof t.isEnabled?!0:t.isEnabled,this.setWidth(t.width)},getFullWidth:function(){return this.width},setWidth:function(t){this.width=t,this.el.style.width=t+"px"},setIsEnabled:function(t){this.isEnabled=t},bringUp:function(){"0"!==this.el.style.zIndex&&(this.el.style.zIndex="0")},pushDown:function(){"-1"!==this.el.style.zIndex&&(this.el.style.zIndex="-1")}}),t.views.SideMenuContent=t.views.View.inherit({initialize:function(e){t.extend(this,{animationClass:"menu-animated",onDrag:function(){},onEndDrag:function(){}},e),t.onGesture("drag",t.proxy(this._onDrag,this),this.el),t.onGesture("release",t.proxy(this._onEndDrag,this),this.el)},_onDrag:function(t){this.onDrag&&this.onDrag(t)},_onEndDrag:function(t){this.onEndDrag&&this.onEndDrag(t)},disableAnimation:function(){this.el.classList.remove(this.animationClass)},enableAnimation:function(){this.el.classList.add(this.animationClass)},getTranslateX:function(){return parseFloat(this.el.style[t.CSS.TRANSFORM].replace("translate3d(","").split(",")[0])},setTranslateX:t.animationFrameThrottle(function(e){this.el.style[t.CSS.TRANSFORM]="translate3d("+e+"px, 0, 0)"})})}(ionic),function(t){"use strict";t.views.Slider=t.views.View.inherit({initialize:function(t){function e(){g=E.children,T=g.length,g.length<2&&(t.continuous=!1),f.transitions&&t.continuous&&g.length<3&&(E.appendChild(g[0].cloneNode(!0)),E.appendChild(E.children[1].cloneNode(!0)),g=E.children),m=new Array(g.length),v=p.getBoundingClientRect().width||p.offsetWidth,E.style.width=g.length*v+"px";for(var e=g.length;e--;){var i=g[e];i.style.width=v+"px",i.setAttribute("data-index",e),f.transitions&&(i.style.left=e*-v+"px",s(e,S>e?-v:e>S?v:0,0))}t.continuous&&f.transitions&&(s(r(S-1),-v,0),s(r(S+1),v,0)),f.transitions||(E.style.left=S*-v+"px"),p.style.visibility="visible",t.slidesChanged&&t.slidesChanged()}function i(){t.continuous?o(S-1):S&&o(S-1)}function n(){t.continuous?o(S+1):S<g.length-1&&o(S+1)}function r(t){return(g.length+t%g.length)%g.length}function o(e,i){if(S!=e){if(f.transitions){var n=Math.abs(S-e)/(S-e);if(t.continuous){var o=n;n=-m[r(e)]/v,n!==o&&(e=-n*g.length+e)}for(var a=Math.abs(S-e)-1;a--;)s(r((e>S?e:S)-a-1),v*n,0);e=r(e),s(S,v*n,i||b),s(e,0,i||b),t.continuous&&s(r(e-n),-(v*n),0)}else e=r(e),l(S*-v,e*-v,i||b);S=e,_(t.callback&&t.callback(S,g[S]))}}function s(t,e,i){a(t,e,i),m[t]=e}function a(t,e,i){var n=g[t],r=n&&n.style;r&&(r.webkitTransitionDuration=r.MozTransitionDuration=r.msTransitionDuration=r.OTransitionDuration=r.transitionDuration=i+"ms",r.webkitTransform="translate("+e+"px,0)translateZ(0)",r.msTransform=r.MozTransform=r.OTransform="translateX("+e+"px)")}function l(e,i,n){if(!n)return void(E.style.left=i+"px");var r=+new Date,o=setInterval(function(){var s=+new Date-r;return s>n?(E.style.left=i+"px",D&&c(),t.transitionEnd&&t.transitionEnd.call(event,S,g[S]),void clearInterval(o)):void(E.style.left=(i-e)*(Math.floor(s/n*100)/100)+e+"px")},4)}function c(){y=setTimeout(n,D)}function u(){D=t.auto||0,clearTimeout(y)}var h=this,d=function(){},_=function(t){setTimeout(t||d,0)},f={addEventListener:!!window.addEventListener,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,transitions:function(t){var e=["transitionProperty","WebkitTransition","MozTransition","OTransition","msTransition"];for(var i in e)if(void 0!==t.style[e[i]])return!0;return!1}(document.createElement("swipe"))},p=t.el;if(p){var g,m,v,T,E=p.children[0];t=t||{};var S=parseInt(t.startSlide,10)||0,b=t.speed||300;t.continuous=void 0!==t.continuous?t.continuous:!0;var y,w,D=t.auto||0,x={},L={},M={handleEvent:function(i){switch(("mousedown"==i.type||"mouseup"==i.type||"mousemove"==i.type)&&(i.touches=[{pageX:i.pageX,pageY:i.pageY}]),i.type){case"mousedown":this.start(i);break;case"touchstart":this.start(i);break;case"touchmove":this.touchmove(i);break;case"mousemove":this.touchmove(i);break;case"touchend":_(this.end(i));break;case"mouseup":_(this.end(i));break;case"webkitTransitionEnd":case"msTransitionEnd":case"oTransitionEnd":case"otransitionend":case"transitionend":_(this.transitionEnd(i));break;case"resize":_(e)}t.stopPropagation&&i.stopPropagation()},start:function(t){var e=t.touches[0];x={x:e.pageX,y:e.pageY,time:+new Date},w=void 0,L={},f.touch?(E.addEventListener("touchmove",this,!1),E.addEventListener("touchend",this,!1)):(E.addEventListener("mousemove",this,!1),E.addEventListener("mouseup",this,!1),document.addEventListener("mouseup",this,!1))},touchmove:function(e){if(!(e.touches.length>1||e.scale&&1!==e.scale||h.slideIsDisabled)){t.disableScroll&&e.preventDefault();var i=e.touches[0];L={x:i.pageX-x.x,y:i.pageY-x.y},"undefined"==typeof w&&(w=!!(w||Math.abs(L.x)<Math.abs(L.y))),w||(e.preventDefault(),u(),t.continuous?(a(r(S-1),L.x+m[r(S-1)],0),a(S,L.x+m[S],0),a(r(S+1),L.x+m[r(S+1)],0)):(L.x=L.x/(!S&&L.x>0||S==g.length-1&&L.x<0?Math.abs(L.x)/v+1:1),a(S-1,L.x+m[S-1],0),a(S,L.x+m[S],0),a(S+1,L.x+m[S+1],0)))}},end:function(){var e=+new Date-x.time,i=Number(e)<250&&Math.abs(L.x)>20||Math.abs(L.x)>v/2,n=!S&&L.x>0||S==g.length-1&&L.x<0;t.continuous&&(n=!1);var o=L.x<0;w||(i&&!n?(o?(t.continuous?(s(r(S-1),-v,0),s(r(S+2),v,0)):s(S-1,-v,0),s(S,m[S]-v,b),s(r(S+1),m[r(S+1)]-v,b),S=r(S+1)):(t.continuous?(s(r(S+1),v,0),s(r(S-2),-v,0)):s(S+1,v,0),s(S,m[S]+v,b),s(r(S-1),m[r(S-1)]+v,b),S=r(S-1)),t.callback&&t.callback(S,g[S])):t.continuous?(s(r(S-1),-v,b),s(S,0,b),s(r(S+1),v,b)):(s(S-1,-v,b),s(S,0,b),s(S+1,v,b))),f.touch?(E.removeEventListener("touchmove",M,!1),E.removeEventListener("touchend",M,!1)):(E.removeEventListener("mousemove",M,!1),E.removeEventListener("mouseup",M,!1),document.removeEventListener("mouseup",M,!1))},transitionEnd:function(e){parseInt(e.target.getAttribute("data-index"),10)==S&&(D&&c(),t.transitionEnd&&t.transitionEnd.call(e,S,g[S]))}};this.update=function(){setTimeout(e)},this.setup=function(){e()},this.enableSlide=function(t){return arguments.length&&(this.slideIsDisabled=!t),!this.slideIsDisabled},this.slide=function(t,e){u(),o(t,e)},this.prev=this.previous=function(){u(),i()},this.next=function(){u(),n()},this.stop=function(){u()},this.currentIndex=function(){return S},this.slidesCount=function(){return T},this.kill=function(){u(),E.style.width="",E.style.left="";for(var t=g.length;t--;){var e=g[t];e.style.width="",e.style.left="",f.transitions&&a(t,0,0)}f.addEventListener?(E.removeEventListener("touchstart",M,!1),E.removeEventListener("webkitTransitionEnd",M,!1),E.removeEventListener("msTransitionEnd",M,!1),E.removeEventListener("oTransitionEnd",M,!1),E.removeEventListener("otransitionend",M,!1),E.removeEventListener("transitionend",M,!1),window.removeEventListener("resize",M,!1)):window.onresize=null},this.load=function(){e(),D&&c(),f.addEventListener?(f.touch?E.addEventListener("touchstart",M,!1):E.addEventListener("mousedown",M,!1),f.transitions&&(E.addEventListener("webkitTransitionEnd",M,!1),E.addEventListener("msTransitionEnd",M,!1),E.addEventListener("oTransitionEnd",M,!1),E.addEventListener("otransitionend",M,!1),E.addEventListener("transitionend",M,!1)),window.addEventListener("resize",M,!1)):window.onresize=function(){e()}}}}})}(ionic),function(t){"use strict";t.views.Toggle=t.views.View.inherit({initialize:function(e){var i=this;this.el=e.el,this.checkbox=e.checkbox,this.track=e.track,this.handle=e.handle,this.openPercent=-1,this.onChange=e.onChange||function(){},this.triggerThreshold=e.triggerThreshold||20,this.dragStartHandler=function(t){i.dragStart(t)},this.dragHandler=function(t){i.drag(t)},this.holdHandler=function(t){i.hold(t)},this.releaseHandler=function(t){i.release(t)},this.dragStartGesture=t.onGesture("dragstart",this.dragStartHandler,this.el),this.dragGesture=t.onGesture("drag",this.dragHandler,this.el),this.dragHoldGesture=t.onGesture("hold",this.holdHandler,this.el),this.dragReleaseGesture=t.onGesture("release",this.releaseHandler,this.el)},destroy:function(){t.offGesture(this.dragStartGesture,"dragstart",this.dragStartGesture),t.offGesture(this.dragGesture,"drag",this.dragGesture),t.offGesture(this.dragHoldGesture,"hold",this.holdHandler),t.offGesture(this.dragReleaseGesture,"release",this.releaseHandler)},tap:function(){"disabled"!==this.el.getAttribute("disabled")&&this.val(!this.checkbox.checked)},dragStart:function(t){this.checkbox.disabled||(this._dragInfo={width:this.el.offsetWidth,left:this.el.offsetLeft,right:this.el.offsetLeft+this.el.offsetWidth,triggerX:this.el.offsetWidth/2,initialState:this.checkbox.checked},t.gesture.srcEvent.preventDefault(),this.hold(t))},drag:function(e){var i=this;this._dragInfo&&(e.gesture.srcEvent.preventDefault(),t.requestAnimationFrame(function(){var t=(i.track.offsetLeft+i.handle.offsetWidth/2,i.track.offsetLeft+i.track.offsetWidth-i.handle.offsetWidth/2,e.gesture.deltaX,e.gesture.touches[0].pageX-i._dragInfo.left),n=i._dragInfo.width-i.triggerThreshold;i._dragInfo.initialState?t<i.triggerThreshold?i.setOpenPercent(0):t>i._dragInfo.triggerX&&i.setOpenPercent(100):t<i._dragInfo.triggerX?i.setOpenPercent(0):t>n&&i.setOpenPercent(100)}))},endDrag:function(){this._dragInfo=null},hold:function(){this.el.classList.add("dragging")},release:function(t){this.el.classList.remove("dragging"),this.endDrag(t)},setOpenPercent:function(e){if(this.openPercent<0||e<this.openPercent-3||e>this.openPercent+3)if(this.openPercent=e,0===e)this.val(!1);else if(100===e)this.val(!0);else{var i=Math.round(e/100*this.track.offsetWidth-this.handle.offsetWidth);i=1>i?0:i,this.handle.style[t.CSS.TRANSFORM]="translate3d("+i+"px,0,0)"}},val:function(e){return(e===!0||e===!1)&&(""!==this.handle.style[t.CSS.TRANSFORM]&&(this.handle.style[t.CSS.TRANSFORM]=""),this.checkbox.checked=e,this.openPercent=e?100:0,this.onChange&&this.onChange()),this.checkbox.checked}})}(ionic),function(t){"use strict";t.controllers.ViewController=function(){this.initialize.apply(this,arguments)},t.controllers.ViewController.inherit=t.inherit,t.extend(t.controllers.ViewController.prototype,{initialize:function(){},destroy:function(){}})}(window.ionic),function(t){"use strict";t.controllers.SideMenuController=t.controllers.ViewController.inherit({initialize:function(t){var e=this;this.left=t.left,this.right=t.right,this.content=t.content,this.dragThresholdX=t.dragThresholdX||10,this._rightShowing=!1,this._leftShowing=!1,this._isDragging=!1,this.content&&(this.content.onDrag=function(t){e._handleDrag(t)},this.content.onEndDrag=function(t){e._endDrag(t)})},setContent:function(t){var e=this;this.content=t,this.content.onDrag=function(t){e._handleDrag(t)},this.content.endDrag=function(t){e._endDrag(t)}},isOpenLeft:function(){return this.getOpenAmount()>0},isOpenRight:function(){return this.getOpenAmount()<0},toggleLeft:function(t){var e=this.getOpenAmount();0===arguments.length&&(t=0>=e),this.content.enableAnimation(),this.openPercentage(t?100:0)},toggleRight:function(t){var e=this.getOpenAmount();0===arguments.length&&(t=e>=0),this.content.enableAnimation(),this.openPercentage(t?-100:0)},close:function(){this.openPercentage(0)},getOpenAmount:function(){return this.content&&this.content.getTranslateX()||0},getOpenRatio:function(){var t=this.getOpenAmount();return t>=0?t/this.left.width:t/this.right.width},isOpen:function(){return 0!==this.getOpenAmount()},getOpenPercentage:function(){return 100*this.getOpenRatio()},openPercentage:function(t){var e=t/100;if(this.left&&t>=0)this.openAmount(this.left.width*e);else if(this.right&&0>t){{this.right.width}this.openAmount(this.right.width*e)}},openAmount:function(t){var e=this.left&&this.left.width||0,i=this.right&&this.right.width||0;return(this.left&&this.left.isEnabled||!(t>0))&&(this.right&&this.right.isEnabled||!(0>t))?this._leftShowing&&t>e?void this.content.setTranslateX(e):this._rightShowing&&-i>t?void this.content.setTranslateX(-i):(this.content.setTranslateX(t),void(t>=0?(this._leftShowing=!0,this._rightShowing=!1,t>0&&(this.right&&this.right.pushDown&&this.right.pushDown(),this.left&&this.left.bringUp&&this.left.bringUp())):(this._rightShowing=!0,this._leftShowing=!1,this.right&&this.right.bringUp&&this.right.bringUp(),this.left&&this.left.pushDown&&this.left.pushDown()))):void this.content.setTranslateX(0)},snapToRest:function(t){this.content.enableAnimation(),this._isDragging=!1;var e=this.getOpenRatio();if(0===e)return void this.openPercentage(0);var i=.3,n=t.gesture.velocityX,r=t.gesture.direction;this.openPercentage(e>0&&.5>e&&"right"==r&&i>n?0:e>.5&&"left"==r&&i>n?100:0>e&&e>-.5&&"left"==r&&i>n?0:.5>e&&"right"==r&&i>n?-100:"right"==r&&e>=0&&(e>=.5||n>i)?100:"left"==r&&0>=e&&(-.5>=e||n>i)?-100:0)},_endDrag:function(t){this._isDragging&&this.snapToRest(t),this._startX=null,this._lastX=null,this._offsetX=null},_handleDrag:function(t){this._startX?this._lastX=t.gesture.touches[0].pageX:(this._startX=t.gesture.touches[0].pageX,this._lastX=this._startX),!this._isDragging&&Math.abs(this._lastX-this._startX)>this.dragThresholdX&&(this._startX=this._lastX,this._isDragging=!0,this.content.disableAnimation(),this._offsetX=this.getOpenAmount()),this._isDragging&&this.openAmount(this._offsetX+(this._lastX-this._startX))}})}(ionic)}(); |