ionic-angular.min.js
88.1 KB
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-beta.12
* 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 e(e){if(e.$root!==e){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}}function t(e){if(e.$root!==e&&e.$$disconnected){var t=e.$parent;e.$$disconnected=!1,e.$$prevSibling=t.$$childTail,t.$$childHead?(t.$$childTail.$$nextSibling=e,t.$$childTail=e):t.$$childHead=t.$$childTail=e}}function n(e){return["$log",function(t){function n(e){this.handle=e}var i=this,o=this._instances=[];this._registerInstance=function(e,t){return e.$$delegateHandle=t,o.push(e),function(){var t=o.indexOf(e);-1!==t&&o.splice(t,1)}},this.$getByHandle=function(e){return e?new n(e):i},e.forEach(function(e){n.prototype[e]=function(){var n,i,r=this.handle,a=arguments,s=0;return o.forEach(function(t){t.$$delegateHandle===r&&(s++,i=t[e].apply(t,a),1===s&&(n=i))}),s?n:t.warn('Delegate for handle "'+this.handle+'" could not find a corresponding element with delegate-handle="'+this.handle+'"! '+e+"() was not called!\nPossible cause: If you are calling "+e+'() immediately, and your element with delegate-handle="'+this.handle+'" is a child of your controller, then your element may not be compiled yet. Put a $timeout around your call to '+e+"() and try again.")},i[e]=function(){var t,n,i=arguments;return o.forEach(function(o,r){n=o[e].apply(o,i),0===r&&(t=n)}),t}})}]}function i(e,t){return[function(){return{priority:"99",link:function(n,i,o){o.$observe(e,function(e){e||i[0].removeAttribute(t)})}}}]}function o(e){return["$ionicGesture","$parse",function(t,n){var i=e.substr(2).toLowerCase();return function(o,r,a){var s=n(a[e]),c=function(e){o.$apply(function(){s(o,{$event:e})})},l=t.on(i,c,r);o.$on("$destroy",function(){t.off(l,i,c)})}}]}function r(){return["$ionicScrollDelegate",function(e){return{restrict:"E",link:function(t,n,i){function o(t){for(var i=3,o=t.target;i--&&o;){if(o.classList.contains("button")||o.tagName.match(/input|textarea|select/i)||o.isContentEditable)return;o=o.parentNode}var r=t.gesture&&t.gesture.touches[0]||t.detail.touches[0],a=n[0].getBoundingClientRect();ionic.DomUtil.rectContains(r.pageX,r.pageY,a.left,a.top-20,a.left+a.width,a.top+a.height)&&e.scrollTop(!0)}"true"!=i.noTapScroll&&(ionic.on("tap",o,n[0]),t.$on("$destroy",function(){ionic.off("tap",o,n[0])}))}}}]}function a(e){return[function(){return{restrict:"E",compile:function(t){function n(t,n,i){var o=(new ionic.views.HeaderBar({el:n[0],alignTitle:i.alignTitle||"center"}),n[0]);e?(t.$watch(function(){return o.className},function(e){var n=-1===e.indexOf("ng-hide"),i=-1!==e.indexOf("bar-subheader");t.$hasHeader=n&&!i,t.$hasSubheader=n&&i}),t.$on("$destroy",function(){delete t.$hasHeader,delete t.$hasSubheader})):(t.$watch(function(){return o.className},function(e){var n=-1===e.indexOf("ng-hide"),i=-1!==e.indexOf("bar-subfooter");t.$hasFooter=n&&!i,t.$hasSubfooter=n&&i}),t.$on("$destroy",function(){delete t.$hasFooter,delete t.$hasSubfooter}),t.$watch("$hasTabs",function(e){n.toggleClass("has-tabs",!!e)}))}t.addClass(e?"bar bar-header":"bar bar-footer");var i=t[0].parentNode;return i.querySelector(".tabs-top")&&t.addClass("has-tabs-top"),{pre:n}}}}]}function s(e){return e.clientHeight}function c(e){e.stopPropagation()}var l={method:function(e,t,n){var i=!1;return function(){return i||(i=!0,t(e)),n.apply(this,arguments)}},field:function(e,t,n,i,o){var r=!1,a=function(){return r||(r=!0,t(e)),o},s=function(n){return r||(r=!0,t(e)),o=n,n};Object.defineProperty(n,i,{get:a,set:s,enumerable:!0})}},u=angular.module("ionic",["ngAnimate","ngSanitize","ui.router"]),d=angular.extend,f=angular.forEach,h=angular.isDefined,p=angular.isString,g=angular.element;u.factory("$ionicActionSheet",["$rootScope","$compile","$animate","$timeout","$ionicTemplateLoader","$ionicPlatform","$ionicBody",function(e,t,n,i,o,r,a){function s(o){var s=e.$new(!0);angular.extend(s,{cancel:angular.noop,destructiveButtonClicked:angular.noop,buttonClicked:angular.noop,$deregisterBackButton:angular.noop,buttons:[],cancelOnStateChange:!0},o||{});var c=s.element=t('<ion-action-sheet buttons="buttons"></ion-action-sheet>')(s),l=g(c[0].querySelector(".action-sheet-wrapper")),u=s.cancelOnStateChange?e.$on("$stateChangeSuccess",function(){s.cancel()}):angular.noop;return s.removeSheet=function(e){s.removed||(s.removed=!0,l.removeClass("action-sheet-up"),a.removeClass("action-sheet-open"),s.$deregisterBackButton(),u(),n.removeClass(c,"active",function(){s.$destroy(),c.remove(),s.cancel.$scope=null,(e||angular.noop)()}))},s.showSheet=function(e){s.removed||(a.append(c).addClass("action-sheet-open"),n.addClass(c,"active",function(){s.removed||(e||angular.noop)()}),i(function(){s.removed||l.addClass("action-sheet-up")},20,!1))},s.$deregisterBackButton=r.registerBackButtonAction(function(){i(s.cancel)},C),s.cancel=function(){s.removeSheet(o.cancel)},s.buttonClicked=function(e){o.buttonClicked(e,o.buttons[e])===!0&&s.removeSheet()},s.destructiveButtonClicked=function(){o.destructiveButtonClicked()===!0&&s.removeSheet()},s.showSheet(),s.cancel.$scope=s,s.cancel}return{show:s}}]),g.prototype.addClass=function(e){var t,n,i,o,r,a;if(e&&"ng-scope"!=e&&"ng-isolate-scope"!=e)for(t=0;t<this.length;t++)if(o=this[t],o.setAttribute)if(e.indexOf(" ")<0&&o.classList.add)o.classList.add(e);else{for(a=(" "+(o.getAttribute("class")||"")+" ").replace(/[\n\t]/g," "),r=e.split(" "),n=0;n<r.length;n++)i=r[n].trim(),-1===a.indexOf(" "+i+" ")&&(a+=i+" ");o.setAttribute("class",a.trim())}return this},g.prototype.removeClass=function(e){var t,n,i,o,r;if(e)for(t=0;t<this.length;t++)if(r=this[t],r.getAttribute)if(e.indexOf(" ")<0&&r.classList.remove)r.classList.remove(e);else for(i=e.split(" "),n=0;n<i.length;n++)o=i[n],r.setAttribute("class",(" "+(r.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+o.trim()+" "," ").trim());return this},u.factory("$ionicBackdrop",["$document","$timeout",function(e,t){function n(){1===++a&&(r.addClass("visible"),ionic.requestAnimationFrame(function(){a&&r.addClass("active")}))}function i(){0===--a&&(r.removeClass("active"),t(function(){!a&&r.removeClass("visible")},400,!1))}function o(){return r}var r=g('<div class="backdrop">'),a=0;return e[0].body.appendChild(r[0]),{retain:n,release:i,getElement:o,_element:r}}]),u.factory("$ionicBind",["$parse","$interpolate",function(e,t){var n=/^\s*([@=&])(\??)\s*(\w*)\s*$/;return function(i,o,r){f(r||{},function(r,a){var s,c,l=r.match(n)||[],u=l[3]||a,d=l[1];switch(d){case"@":if(!o[u])return;o.$observe(u,function(e){i[a]=e}),o[u]&&(i[a]=t(o[u])(i));break;case"=":if(!o[u])return;c=i.$watch(o[u],function(e){i[a]=e}),i.$on("$destroy",c);break;case"&":if(o[u]&&o[u].match(RegExp(a+"(.*?)")))throw new Error('& expression binding "'+a+'" looks like it will recursively call "'+o[u]+'" and cause a stack overflow! Please choose a different scopeName.');s=e(o[u]),i[a]=function(e){return s(i,e)}}})}}]),u.factory("$ionicBody",["$document",function(e){return{addClass:function(){for(var t=0;t<arguments.length;t++)e[0].body.classList.add(arguments[t]);return this},removeClass:function(){for(var t=0;t<arguments.length;t++)e[0].body.classList.remove(arguments[t]);return this},enableClass:function(e){var t=Array.prototype.slice.call(arguments).slice(1);return e?this.addClass.apply(this,t):this.removeClass.apply(this,t),this},append:function(t){return e[0].body.appendChild(t.length?t[0]:t),this},get:function(){return e[0].body}}}]),u.factory("$ionicClickBlock",["$document","$ionicBody","$timeout",function(e,t,n){var i=e[0].createElement("div");return i.className="click-block",{show:function(){i.parentElement?i.classList.remove("hide"):t.append(i),n(function(){i.classList.add("hide")},500)},hide:function(){i.classList.add("hide")}}}]),u.factory("$collectionDataSource",["$cacheFactory","$parse","$rootScope",function(n,i,o){function r(e){e.css(ionic.CSS.TRANSFORM,"translate3d(-2000px,-2000px,0)")}function a(e){this.scope=e.scope,this.transcludeFn=e.transcludeFn,this.transcludeParent=e.transcludeParent,this.element=e.element,this.keyExpr=e.keyExpr,this.listExpr=e.listExpr,this.trackByExpr=e.trackByExpr,this.heightGetter=e.heightGetter,this.widthGetter=e.widthGetter,this.dimensions=[],this.data=[],this.attachedItems={},this.BACKUP_ITEMS_LENGTH=20,this.backupItemsArray=[]}return a.prototype={setup:function(){if(!this.isSetup){this.isSetup=!0;for(var e=0;e<this.BACKUP_ITEMS_LENGTH;e++)this.detachItem(this.createItem())}},destroy:function(){this.dimensions.length=0,this.data=null,this.backupItemsArray.length=0,this.attachedItems={}},calculateDataDimensions:function(){var e={};this.dimensions=this.data.map(function(t,n){return e[this.keyExpr]=t,e.$index=n,{width:this.widthGetter(this.scope,e),height:this.heightGetter(this.scope,e)}},this),this.dimensions=this.beforeSiblings.concat(this.dimensions).concat(this.afterSiblings),this.dataStartIndex=this.beforeSiblings.length},createItem:function(){var e={};return e.scope=this.scope.$new(),this.transcludeFn(e.scope,function(t){t.css("position","absolute"),e.element=t}),this.transcludeParent.append(e.element),e},getItem:function(e){return(item=this.attachedItems[e])||((item=this.backupItemsArray.pop())?t(item.scope):item=this.createItem()),item},attachItemAtIndex:function(e){if(e<this.dataStartIndex)return this.beforeSiblings[e];if(e-=this.dataStartIndex,e>this.data.length-1)return this.afterSiblings[e-this.dataStartIndex];var t=this.getItem(e),n=this.data[e];return(t.index!==e||t.scope[this.keyExpr]!==n)&&(t.index=t.scope.$index=e,t.scope[this.keyExpr]=n,t.scope.$first=0===e,t.scope.$last=e===this.getLength()-1,t.scope.$middle=!(t.scope.$first||t.scope.$last),t.scope.$odd=!(t.scope.$even=0===(1&e)),o.$$phase||t.scope.$digest()),this.attachedItems[e]=t,t},destroyItem:function(e){e.element.remove(),e.scope.$destroy(),e.scope=null,e.element=null},detachItem:function(t){delete this.attachedItems[t.index],t.isOutside?r(t.element):this.backupItemsArray.length>=this.BACKUP_ITEMS_LENGTH?this.destroyItem(t):(this.backupItemsArray.push(t),r(t.element),e(t.scope))},getLength:function(){return this.dimensions&&this.dimensions.length||0},setData:function(e,t,n){this.data=e||[],this.beforeSiblings=t||[],this.afterSiblings=n||[],this.calculateDataDimensions(),this.afterSiblings.forEach(function(e){e.element.css({position:"absolute",top:"0",left:"0"}),r(e.element)})}},a}]),u.factory("$collectionRepeatManager",["$rootScope","$timeout",function(){function e(e){function t(){return n.viewportSize}var n=this;this.dataSource=e.dataSource,this.element=e.element,this.scrollView=e.scrollView,this.isVertical=!!this.scrollView.options.scrollingY,this.renderedItems={},this.dimensions=[],this.setCurrentIndex(0),this.scrollView.__$callback=this.scrollView.__callback,this.scrollView.__callback=angular.bind(this,this.renderScroll),this.isVertical?(this.scrollView.options.getContentHeight=t,this.scrollValue=function(){return this.scrollView.__scrollTop},this.scrollMaxValue=function(){return this.scrollView.__maxScrollTop},this.scrollSize=function(){return this.scrollView.__clientHeight},this.secondaryScrollSize=function(){return this.scrollView.__clientWidth},this.transformString=function(e,t){return"translate3d("+t+"px,"+e+"px,0)"},this.primaryDimension=function(e){return e.height},this.secondaryDimension=function(e){return e.width}):(this.scrollView.options.getContentWidth=t,this.scrollValue=function(){return this.scrollView.__scrollLeft},this.scrollMaxValue=function(){return this.scrollView.__maxScrollLeft},this.scrollSize=function(){return this.scrollView.__clientWidth},this.secondaryScrollSize=function(){return this.scrollView.__clientHeight},this.transformString=function(e,t){return"translate3d("+e+"px,"+t+"px,0)"},this.primaryDimension=function(e){return e.width},this.secondaryDimension=function(e){return e.height})}return e.prototype={destroy:function(){this.renderedItems={},this.render=angular.noop,this.calculateDimensions=angular.noop,this.dimensions=[]},calculateDimensions:function(){function e(e){var r={primarySize:this.primaryDimension(e),secondarySize:Math.min(this.secondaryDimension(e),o)};return t&&(i+=t.secondarySize,t.primaryPos===n&&i+r.secondarySize>o&&(i=0,n+=t.primarySize)),r.primaryPos=n,r.secondaryPos=i,t=r,r}var t,n=0,i=0,o=this.secondaryScrollSize();this.dataSource.beforeSiblings&&this.dataSource.beforeSiblings.forEach(e,this);var r=n+(t?t.primarySize:0);n=i=0,t=null;var a=this.dataSource.dimensions.map(e,this),s=n+(t?t.primarySize:0);return{beforeSize:r,totalSize:s,dimensions:a}},resize:function(){var e=this.calculateDimensions();this.dimensions=e.dimensions,this.viewportSize=e.totalSize,this.beforeSize=e.beforeSize,this.setCurrentIndex(0),this.render(!0),this.dataSource.setup()},setCurrentIndex:function(e){var t=(this.dimensions[e]||{}).primaryPos||0;this.currentIndex=e,this.hasPrevIndex=e>0,this.hasPrevIndex&&(this.previousPos=Math.max(t-this.dimensions[e-1].primarySize,this.dimensions[e-1].primaryPos)),this.hasNextIndex=e+1<this.dataSource.getLength(),this.hasNextIndex&&(this.nextPos=Math.min(t+this.dimensions[e+1].primarySize,this.dimensions[e+1].primaryPos))},renderScroll:ionic.animationFrameThrottle(function(e,t,n,i){return this.renderIfNeeded(this.isVertical?t:e),this.scrollView.__$callback(e,t,n,i)}),renderIfNeeded:function(e){(this.hasNextIndex&&e>=this.nextPos||this.hasPrevIndex&&e<this.previousPos)&&this.render()},getIndexForScrollValue:function(e,t){var n;if(t<=this.dimensions[e].primaryPos)for(;(n=this.dimensions[e-1])&&n.primaryPos>t;)e--;else for(;(n=this.dimensions[e+1])&&n.primaryPos<t;)e++;return e},render:function(e){function t(e,t){e<i.dataSource.dataStartIndex||i.renderItem(e,t.primaryPos-i.beforeSize,t.secondaryPos)}var n,i=this,o=this.currentIndex>=this.dataSource.getLength();if(o||e){for(n in this.renderedItems)this.removeItem(n);if(o)return}for(var r,a=this.scrollValue(),s=this.scrollSize(),c=s+a,l=this.getIndexForScrollValue(this.currentIndex,a),u=Math.max(l-1,0);u>0&&(r=this.dimensions[u])&&r.primaryPos===this.dimensions[l-1].primaryPos;)u--;for(n=u;(r=this.dimensions[n])&&r.primaryPos-r.primarySize<c;)t(n,r),n++;i.dimensions[n]&&(t(n,i.dimensions[n]),n++),i.dimensions[n]&&t(n,i.dimensions[n]);var d=n;for(var f in this.renderedItems)(u>f||f>d)&&this.removeItem(f);this.setCurrentIndex(l)},renderItem:function(e,t,n){var i=this.dataSource.attachItemAtIndex(e);i&&i.element?((i.primaryPos!==t||i.secondaryPos!==n)&&(i.element.css(ionic.CSS.TRANSFORM,this.transformString(t,n)),i.primaryPos=t,i.secondaryPos=n),this.renderedItems[e]=i):delete this.renderedItems[e]},removeItem:function(e){var t=this.renderedItems[e];t&&(t.primaryPos=t.secondaryPos=null,this.dataSource.detachItem(t),delete this.renderedItems[e])}},e}]),u.factory("$ionicGesture",[function(){return{on:function(e,t,n,i){return window.ionic.onGesture(e,t,n[0],i)},off:function(e,t,n){return window.ionic.offGesture(e,t,n)}}}]),u.provider("$ionicConfig",function(){var e={prefetchTemplates:!0};this.prefetchTemplates=function(t){return arguments.length&&(e.prefetchTemplates=t),e.prefetchTemplates},this.$get=function(){return e}});var v='<div class="loading-container"><div class="loading"></div></div>',m="$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().",$="$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().",w="$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: 'my content' }).";u.constant("$ionicLoadingConfig",{template:'<i class="ion-loading-d"></i>'}).factory("$ionicLoading",["$ionicLoadingConfig","$ionicBody","$ionicTemplateLoader","$ionicBackdrop","$timeout","$q","$log","$compile","$ionicPlatform",function(e,t,n,i,o,r,a,s,c){function u(){return p||(p=n.compile({template:v,appendTo:t.get()}).then(function(e){var a=e;return e.show=function(e){var c=e.templateUrl?n.load(e.templateUrl):r.when(e.template||e.content||"");this.isShown||(this.hasBackdrop=!e.noBackdrop&&e.showBackdrop!==!1,this.hasBackdrop&&(i.retain(),i.getElement().addClass("backdrop-loading"))),e.duration&&(o.cancel(this.durationTimeout),this.durationTimeout=o(angular.bind(this,this.hide),+e.duration)),c.then(function(e){if(e){var n=a.element.children();n.html(e),s(n.contents())(a.scope)}a.isShown&&(a.element.addClass("visible"),ionic.requestAnimationFrame(function(){a.isShown&&(a.element.addClass("active"),t.addClass("loading-active"))}))}),this.isShown=!0},e.hide=function(){this.isShown&&(this.hasBackdrop&&(i.release(),i.getElement().removeClass("backdrop-loading")),a.element.removeClass("active"),t.removeClass("loading-active"),setTimeout(function(){!a.isShown&&a.element.removeClass("visible")},200)),o.cancel(this.durationTimeout),this.isShown=!1},e})),p}function f(t){t=d(e||{},t||{});var n=t.delay||t.showDelay||0;return b&&o.cancel(b),b=o(angular.noop,n),b.then(u).then(function(e){return g(),g=c.registerBackButtonAction(angular.noop,T),e.show(t)}),{hide:l.method(m,a.error,h),show:l.method($,a.error,function(){f(t)}),setContent:l.method(w,a.error,function(e){u().then(function(t){t.show({template:e})})})}}function h(){g(),o.cancel(b),u().then(function(e){e.hide()})}var p,g=angular.noop,b=r.when();return{show:f,hide:h,_getLoader:u}}]),u.factory("$ionicModal",["$rootScope","$ionicBody","$compile","$timeout","$ionicPlatform","$ionicTemplateLoader","$q","$log",function(e,t,n,i,o,r,a,s){var c=ionic.views.Modal.inherit({initialize:function(e){ionic.views.Modal.prototype.initialize.call(this,e),this.animation=e.animation||"slide-in-up"},show:function(e){var n=this;if(n.scope.$$destroyed)return void s.error("Cannot call "+n.viewType+".show() after remove(). Please create a new "+n.viewType+" instance.");var r=g(n.modalEl);return n.el.classList.remove("hide"),i(function(){t.addClass(n.viewType+"-open")},400),n.el.parentElement||(r.addClass(n.animation),t.append(n.el)),e&&n.positionView&&n.positionView(e,r),r.addClass("ng-enter active").removeClass("ng-leave ng-leave-active"),n._isShown=!0,n._deregisterBackButton=o.registerBackButtonAction(n.hardwareBackButtonClose?angular.bind(n,n.hide):angular.noop,S),n._isOpenPromise=a.defer(),ionic.views.Modal.prototype.show.call(n),i(function(){r.addClass("ng-enter-active"),ionic.trigger("resize"),n.scope.$parent&&n.scope.$parent.$broadcast(n.viewType+".shown",n),n.el.classList.add("active")},20),i(function(){n.$el.on("click",function(e){n.backdropClickToClose&&e.target===n.el&&n.hide()})},400)},hide:function(){var e=this,n=g(e.modalEl);return e.el.classList.remove("active"),n.addClass("ng-leave"),i(function(){n.addClass("ng-leave-active").removeClass("ng-enter ng-enter-active active")},20),e.$el.off("click"),e._isShown=!1,e.scope.$parent&&e.scope.$parent.$broadcast(e.viewType+".hidden",e),e._deregisterBackButton&&e._deregisterBackButton(),ionic.views.Modal.prototype.hide.call(e),i(function(){t.removeClass(e.viewType+"-open"),e.el.classList.add("hide")},e.hideDelay||320)},remove:function(){var e=this;return e.scope.$parent&&e.scope.$parent.$broadcast(e.viewType+".removed",e),e.hide().then(function(){e.scope.$destroy(),e.$el.remove()})},isShown:function(){return!!this._isShown}}),l=function(t,i){var o=i.scope&&i.scope.$new()||e.$new(!0);i.viewType=i.viewType||"modal",d(o,{$hasHeader:!1,$hasSubheader:!1,$hasFooter:!1,$hasSubfooter:!1,$hasTabs:!1,$hasTabsTop:!1});var r=n("<ion-"+i.viewType+">"+t+"</ion-"+i.viewType+">")(o);i.$el=r,i.el=r[0],i.modalEl=i.el.querySelector("."+i.viewType);var a=new c(i);return a.scope=o,i.scope||(o[i.viewType]=a),a};return{fromTemplate:function(e,t){var n=l(e,t||{});return n},fromTemplateUrl:function(e,t,n){var i;return angular.isFunction(t)&&(i=t,t=n),r.load(e).then(function(e){var n=l(e,t||{});return i&&i(n),n})}}}]),u.service("$ionicNavBarDelegate",n(["back","align","showBackButton","showBar","setTitle","changeTitle","getTitle","getPreviousTitle"]));var b=100,y=150,S=200,C=300,k=400,T=500;u.constant("$ionicPlatformDefaults",{ios:{$ionicNavBarConfig:{transition:"nav-title-slide-ios",alignTitle:"center",backButtonIcon:"ion-ios7-arrow-back"},$ionicNavViewConfig:{transition:"slide-ios"},$ionicTabsConfig:{type:"",position:""}},android:{$ionicNavBarConfig:{transition:"nav-title-slide-full",alignTitle:"center",backButtonIcon:"ion-ios7-arrow-back"},$ionicNavViewConfig:{transition:"slide-full"},$ionicTabsConfig:{type:"tabs-striped",position:""}}}),u.config(["$ionicPlatformDefaults","$injector",function(e,t){var n=ionic.Platform.platform(),i=function(e){f(e,function(e,n){d(t.get(n),e)})};switch(n){case"ios":i(e.ios);break;case"android":i(e.android)}}]),u.provider("$ionicPlatform",function(){return{$get:["$q","$rootScope",function(e){var t={onHardwareBackButton:function(e){ionic.Platform.ready(function(){document.addEventListener("backbutton",e,!1)})},offHardwareBackButton:function(e){ionic.Platform.ready(function(){document.removeEventListener("backbutton",e)})},$backButtonActions:{},registerBackButtonAction:function(e,n,i){t._hasBackButtonHandler||(t.$backButtonActions={},t.onHardwareBackButton(t.hardwareBackButtonClick),t._hasBackButtonHandler=!0);var o={id:i?i:ionic.Utils.nextUid(),priority:n?n:0,fn:e};return t.$backButtonActions[o.id]=o,function(){delete t.$backButtonActions[o.id]}},hardwareBackButtonClick:function(e){var n,i;for(i in t.$backButtonActions)(!n||t.$backButtonActions[i].priority>=n.priority)&&(n=t.$backButtonActions[i]);return n?(n.fn(e),n):void 0},is:function(e){return ionic.Platform.is(e)},ready:function(t){var n=e.defer();return ionic.Platform.ready(function(){n.resolve(),t&&t()}),n.promise}};return t}]}}),u.factory("$ionicPopover",["$ionicModal","$ionicPosition","$document","$window",function(e,t,n,i){function o(e,o){var a=angular.element(e.target||e),s=t.offset(a),c=o.prop("offsetWidth"),l=o.prop("offsetHeight"),u=n[0].body.clientWidth,d=i.innerHeight,f={left:s.left+s.width/2-c/2},h=g(o[0].querySelector(".popover-arrow"));f.left<r?f.left=r:f.left+c+r>u&&(f.left=u-c-r),s.top+s.height+l>d?(f.top=s.top-l,o.removeClass("popover-top").addClass("popover-bottom")):(f.top=s.top+s.height,o.removeClass("popover-bottom").addClass("popover-top")),h.css({left:s.left+s.width/2-h.prop("offsetWidth")/2-f.left+"px"}),o.css({top:f.top+"px",left:f.left+"px",marginLeft:"0",opacity:"1"})}var r=6,a={viewType:"popover",hideDelay:1,animation:"none",positionView:o};return{fromTemplate:function(t,n){return e.fromTemplate(t,ionic.Utils.extend(n||{},a))},fromTemplateUrl:function(t,n){return e.fromTemplateUrl(t,n,ionic.Utils.extend(n||{},a))}}}]);var x='<div class="popup-container"><div class="popup"><div class="popup-head"><h3 class="popup-title" ng-bind-html="title"></h3><h5 class="popup-sub-title" ng-bind-html="subTitle" ng-if="subTitle"></h5></div><div class="popup-body"></div><div class="popup-buttons"><button ng-repeat="button in buttons" ng-click="$buttonTapped(button, $event)" class="button" ng-class="button.type || \'button-default\'" ng-bind-html="button.text"></button></div></div></div>';u.factory("$ionicPopup",["$ionicTemplateLoader","$ionicBackdrop","$q","$timeout","$rootScope","$ionicBody","$compile","$ionicPlatform",function(e,t,n,i,o,r,a,s){function c(t){t=d({scope:null,title:"",buttons:[]},t||{});var o=e.compile({template:x,scope:t.scope&&t.scope.$new(),appendTo:r.get()}),s=t.templateUrl?e.load(t.templateUrl):n.when(t.template||t.content||"");return n.all([o,s]).then(function(e){var o=e[0],r=e[1],s=n.defer();o.responseDeferred=s;var c=g(o.element[0].querySelector(".popup-body"));return r?(c.html(r),a(c.contents())(o.scope)):c.remove(),d(o.scope,{title:t.title,buttons:t.buttons,subTitle:t.subTitle,$buttonTapped:function(e,t){var n=(e.onTap||angular.noop)(t);t=t.originalEvent||t,t.defaultPrevented||s.resolve(n)}}),o.show=function(){o.isShown||(o.isShown=!0,ionic.requestAnimationFrame(function(){o.isShown&&(o.element.removeClass("popup-hidden"),o.element.addClass("popup-showing active"),f(o.element))}))},o.hide=function(e){return e=e||angular.noop,o.isShown?(o.isShown=!1,o.element.removeClass("active"),o.element.addClass("popup-hidden"),void i(e,250)):e()},o.remove=function(){o.removed||(o.hide(function(){o.element.remove(),o.scope.$destroy()}),o.removed=!0)},o})}function l(){$[0]&&$[0].responseDeferred.resolve()}function u(e){function n(e){o.then(function(t){t.removed||t.responseDeferred.resolve(e)})}var o=w._createPopup(e),a=$[0];a&&a.hide();var c=i(angular.noop,a?m.stackPushDelay:0).then(function(){return o}).then(function(e){return a||(r.addClass("popup-open"),t.retain(),w._backButtonActionDone=s.registerBackButtonAction(l,k)),$.unshift(e),e.show(),e.responseDeferred.notify({close:c.close}),e.responseDeferred.promise.then(function(n){var i=$.indexOf(e);-1!==i&&$.splice(i,1),e.remove();var o=$[0];return o?o.show():(r.removeClass("popup-open"),t.release(),(w._backButtonActionDone||angular.noop)()),n})});return c.close=n,c}function f(e){var t=e[0].querySelector("[autofocus]");t&&t.focus()}function h(e){return u(d({buttons:[{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function p(e){return u(d({buttons:[{text:e.cancelText||"Cancel",type:e.cancelType||"button-default",onTap:function(){return!1}},{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function v(e){var t=o.$new(!0);t.data={};var n="";return e.template&&/<[a-z][\s\S]*>/i.test(e.template)===!1&&(n="<span>"+e.template+"</span>",delete e.template),u(d({template:n+'<input ng-model="data.response" type="'+(e.inputType||"text")+'" placeholder="'+(e.inputPlaceholder||"")+'">',scope:t,buttons:[{text:e.cancelText||"Cancel",type:e.cancelType||"button-default",onTap:function(){}},{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return t.data.response||""}}]},e||{}))}var m={stackPushDelay:75},$=[],w={show:u,alert:h,confirm:p,prompt:v,_createPopup:c,_popupStack:$};return w}]),u.factory("$ionicPosition",["$document","$window",function(e,t){function n(e,n){return e.currentStyle?e.currentStyle[n]:t.getComputedStyle?t.getComputedStyle(e)[n]:e.style[n]}function i(e){return"static"===(n(e,"position")||"static")}var o=function(t){for(var n=e[0],o=t.offsetParent||n;o&&o!==n&&i(o);)o=o.offsetParent;return o||n};return{position:function(t){var n=this.offset(t),i={top:0,left:0},r=o(t[0]);r!=e[0]&&(i=this.offset(angular.element(r)),i.top+=r.clientTop-r.scrollTop,i.left+=r.clientLeft-r.scrollLeft);var a=t[0].getBoundingClientRect();return{width:a.width||t.prop("offsetWidth"),height:a.height||t.prop("offsetHeight"),top:n.top-i.top,left:n.left-i.left}},offset:function(n){var i=n[0].getBoundingClientRect();return{width:i.width||n.prop("offsetWidth"),height:i.height||n.prop("offsetHeight"),top:i.top+(t.pageYOffset||e[0].documentElement.scrollTop),left:i.left+(t.pageXOffset||e[0].documentElement.scrollLeft)}}}}]),u.service("$ionicScrollDelegate",n(["resize","scrollTop","scrollBottom","scrollTo","scrollBy","zoomTo","zoomBy","getScrollPosition","anchorScroll","getScrollView","rememberScrollPosition","forgetScrollPosition","scrollToRememberedPosition"])),u.service("$ionicSideMenuDelegate",n(["toggleLeft","toggleRight","getOpenRatio","isOpen","isOpenLeft","isOpenRight","canDragContent","edgeDragThreshold"])),u.service("$ionicSlideBoxDelegate",n(["update","slide","enableSlide","previous","next","stop","start","currentIndex","slidesCount"])),u.service("$ionicTabsDelegate",n(["select","selectedIndex"])),function(){var e=[];u.factory("$ionicTemplateCache",["$http","$templateCache","$timeout","$ionicConfig",function(t,n,i,o){function r(e){return a.length>500?!1:"undefined"==typeof e?c():(p(e)&&(e=[e]),f(e,function(e){a.push(e)}),void(s&&c()))}var a=e,s=!1,c=function(){if(o.prefetchTemplates!==!1&&(r._runCount++,s=!0,0!==a.length)){for(var e=0;5>e&&(template=a.pop());)p(template)&&t.get(template,{cache:n}),e++;a.length&&i(function(){c()},1e3)}};return r._runCount=0,r}]).config(["$stateProvider","$ionicConfigProvider",function(t,n){var i=t.state;t.state=function(o,r){if(n.prefetchTemplates()!==!1){var a=r.prefetchTemplate!==!1;if(a&&p(r.templateUrl)&&e.push(r.templateUrl),angular.isObject(r.views))for(var s in r.views)a=r.views[s].prefetchTemplate!==!1,a&&p(r.views[s].templateUrl)&&e.push(r.views[s].templateUrl)}return i.call(t,o,r)}}]).run(["$ionicTemplateCache",function(e){e()}])}(),u.factory("$ionicTemplateLoader",["$compile","$controller","$http","$q","$rootScope","$templateCache",function(e,t,n,i,o,r){function a(e){return n.get(e,{cache:r}).then(function(e){return e.data&&e.data.trim()})}function s(n){n=d({template:"",templateUrl:"",scope:null,controller:null,locals:{},appendTo:null},n||{});var r=n.templateUrl?this.load(n.templateUrl):i.when(n.template);return r.then(function(i){var r,a=n.scope||o.$new(),s=g("<div>").html(i).contents();return n.controller&&(r=t(n.controller,d(n.locals,{$scope:a})),s.children().data("$ngControllerController",r)),n.appendTo&&g(n.appendTo).append(s),e(s)(a),{element:s,scope:a}})}return{load:a,compile:s}}]),u.run(["$rootScope","$state","$location","$document","$animate","$ionicPlatform","$ionicViewService",function(e,t,n,i,o,r,a){function s(t){return e.$viewHistory.backView?e.$viewHistory.backView.go():ionic.Platform.exitApp(),t.preventDefault(),!1}e.$viewHistory={histories:{root:{historyId:"root",parentHistoryId:null,stack:[],cursor:-1}},views:{},backView:null,forwardView:null,currentView:null,disabledRegistrableTagNames:[]},a.disableRegisterByTagName&&(a.disableRegisterByTagName("ion-tabs"),a.disableRegisterByTagName("ion-side-menus")),e.$on("viewState.changeHistory",function(i,o){if(o){var r=o.historyId?e.$viewHistory.histories[o.historyId]:null;if(r&&r.cursor>-1&&r.cursor<r.stack.length){var a=r.stack[r.cursor];return a.go(o)}!o.url&&o.uiSref&&(o.url=t.href(o.uiSref)),o.url&&(0===o.url.indexOf("#")&&(o.url=o.url.replace("#","")),o.url!==n.url()&&n.url(o.url))}}),e.$on("viewState.viewEnter",function(e,t){t&&t.title&&(i[0].title=t.title)}),r.registerBackButtonAction(s,b)}]).factory("$ionicViewService",["$rootScope","$state","$location","$window","$injector","$animate","$ionicNavViewConfig","$ionicClickBlock",function(e,t,n,i,o,r,a,s){function c(){return ionic.Utils.nextUid()}var l=function(){};return l.prototype.initialize=function(e){if(e){for(var t in e)this[t]=e[t];return this}return null},l.prototype.go=function(){return this.stateName?t.go(this.stateName,this.stateParams):this.url&&this.url!==n.url()?e.$viewHistory.backView===this?i.history.go(-1):e.$viewHistory.forwardView===this?i.history.go(1):void n.url(this.url):null},l.prototype.destroy=function(){this.scope&&(this.scope.$destroy&&this.scope.$destroy(),this.scope=null)},{register:function(t,i){var o=e.$viewHistory,r=this.getCurrentStateId(),a=this._getHistory(t),s=o.currentView,l=o.backView,u=o.forwardView,d=this.nextViewOptions(),f={viewId:null,navAction:null,navDirection:null,historyId:a.historyId};if(i&&!this.isTagNameRegistrable(i))return f.navAction="disabledByTagName",f;if(s&&s.stateId===r&&s.historyId===a.historyId)return f.navAction="noChange",f;if(o.forcedNav)ionic.Utils.extend(f,o.forcedNav),e.$viewHistory.forcedNav=null;else if(l&&l.stateId===r)f.viewId=l.viewId,f.navAction="moveBack",f.viewId=l.viewId,l.historyId===s.historyId&&(f.navDirection="back");else if(u&&u.stateId===r){f.viewId=u.viewId,f.navAction="moveForward",u.historyId===s.historyId&&(f.navDirection="forward");var h=this._getParentHistoryObj(t);u.historyId&&h.scope&&(h.scope.$historyId=u.historyId,f.historyId=u.historyId)}else if(s&&s.historyId!==a.historyId&&a.cursor>-1&&a.stack.length>0&&a.cursor<a.stack.length&&a.stack[a.cursor].stateId===r)f.viewId=a.stack[a.cursor].viewId,f.navAction="moveBack";else{if(f.viewId=c(r),s){if(s.forwardViewId=f.viewId,a.historyId===s.historyId&&(f.navDirection="forward"),f.navAction="newView",u&&s.stateId!==u.stateId){var p=this._getHistoryById(u.historyId);if(p)for(var g=p.stack.length-1;g>=u.index;g--)p.stack[g].destroy(),p.stack.splice(g)
}}else f.navAction="initialView";o.views[f.viewId]=this.createView({viewId:f.viewId,index:a.stack.length,historyId:a.historyId,backViewId:s&&s.viewId?s.viewId:null,forwardViewId:null,stateId:r,stateName:this.getCurrentStateName(),stateParams:this.getCurrentStateParams(),url:n.url()}),"moveBack"==f.navAction&&e.$emit("$viewHistory.viewBack",s.viewId,f.viewId),a.stack.push(o.views[f.viewId])}return d&&(d.disableAnimate&&(f.navDirection=null),d.disableBack&&(o.views[f.viewId].backViewId=null),this.nextViewOptions(null)),this.setNavViews(f.viewId),a.cursor=o.currentView.index,f},setNavViews:function(t){var n=e.$viewHistory;n.currentView=this._getViewById(t),n.backView=this._getBackView(n.currentView),n.forwardView=this._getForwardView(n.currentView),e.$broadcast("$viewHistory.historyChange",{showBack:n.backView&&n.backView.historyId===n.currentView.historyId})},registerHistory:function(e){e.$historyId=ionic.Utils.nextUid()},createView:function(e){var t=new l;return t.initialize(e)},getCurrentView:function(){return e.$viewHistory.currentView},getBackView:function(){return e.$viewHistory.backView},getForwardView:function(){return e.$viewHistory.forwardView},getNavDirection:function(){return e.$viewHistory.navDirection},getCurrentStateName:function(){return t&&t.current?t.current.name:null},isCurrentStateNavView:function(e){return t&&t.current&&t.current.views&&t.current.views[e]?!0:!1},getCurrentStateParams:function(){var e;if(t&&t.params)for(var n in t.params)t.params.hasOwnProperty(n)&&(e=e||{},e[n]=t.params[n]);return e},getCurrentStateId:function(){var e;if(t&&t.current&&t.current.name){if(e=t.current.name,t.params)for(var n in t.params)t.params.hasOwnProperty(n)&&t.params[n]&&(e+="_"+n+"="+t.params[n]);return e}return ionic.Utils.nextUid()},goToHistoryRoot:function(t){if(t){var n=e.$viewHistory.histories[t];if(n&&n.stack.length){if(e.$viewHistory.currentView&&e.$viewHistory.currentView.viewId===n.stack[0].viewId)return;e.$viewHistory.forcedNav={viewId:n.stack[0].viewId,navAction:"moveBack",navDirection:"back"},n.stack[0].go()}}},_getViewById:function(t){return t?e.$viewHistory.views[t]:null},_getBackView:function(e){return e?this._getViewById(e.backViewId):null},_getForwardView:function(e){return e?this._getViewById(e.forwardViewId):null},_getHistoryById:function(t){return t?e.$viewHistory.histories[t]:null},_getHistory:function(t){var n=this._getParentHistoryObj(t);return e.$viewHistory.histories[n.historyId]||(e.$viewHistory.histories[n.historyId]={historyId:n.historyId,parentHistoryId:this._getParentHistoryObj(n.scope.$parent).historyId,stack:[],cursor:-1}),e.$viewHistory.histories[n.historyId]},_getParentHistoryObj:function(t){for(var n=t;n;){if(n.hasOwnProperty("$historyId"))return{historyId:n.$historyId,scope:n};n=n.$parent}return{historyId:"root",scope:e}},nextViewOptions:function(e){return arguments.length?void(this._nextOpts=e):this._nextOpts},getRenderer:function(e,t,n){function i(e){for(var t="";!t&&e;)t=e.getAttribute("animation"),e=e.parentElement;return t?t:a.transition}function o(){d&&e[0].classList.add(d),"back"===c.navDirection?e[0].classList.add("reverse"):e[0].classList.remove("reverse")}var c,l,u=this,d=i(e[0]);return function(t){return{enter:function(n){return l&&t?(o(),n.addClass("ng-enter"),s.show(),void r.enter(n,e,null,function(){s.hide(),d&&e[0].classList.remove(d)})):(l||s.hide(),void e.append(n))},leave:function(){var n=e.contents();return l&&t?(o(),void r.leave(n,function(){n.remove()})):void n.remove()},register:function(e){return c=u.register(n,e),l=null!==d&&null!==c.navDirection,c}}}},disableRegisterByTagName:function(t){e.$viewHistory.disabledRegistrableTagNames.push(t.toUpperCase())},isTagNameRegistrable:function(t){var n,i,o=e.$viewHistory.disabledRegistrableTagNames;for(n=0;n<t.length;n++)if(1===t[n].nodeType)for(i=0;i<o.length;i++)if(t[n].tagName===o[i])return!1;return!0},clearHistory:function(){var t=e.$viewHistory.histories,n=e.$viewHistory.currentView;if(t)for(var i in t)t[i].stack&&(t[i].stack=[],t[i].cursor=-1),n&&n.historyId===i?(n.backViewId=null,n.forwardViewId=null,t[i].stack.push(n)):t[i].destroy&&t[i].destroy();for(var o in e.$viewHistory.views)o!==n.viewId&&delete e.$viewHistory.views[o];n&&this.setNavViews(n.viewId)}}}]),u.config(["$provide",function(e){function t(e,t){return e.__hash=e.hash,e.hash=function(n){return angular.isDefined(n)&&t(function(){var e=document.querySelector(".scroll-content");e&&(e.scrollTop=0)},0,!1),e.__hash(n)},e}e.decorator("$location",["$delegate","$timeout",t])}]),u.service("$ionicListDelegate",n(["showReorder","showDelete","canSwipeItems","closeOptionButtons"])).controller("$ionicList",["$scope","$attrs","$parse","$ionicListDelegate",function(e,t,n,i){var o=!0,r=!1,a=!1,s=i._registerInstance(this,t.delegateHandle);e.$on("$destroy",s),this.showReorder=function(e){return arguments.length&&(r=!!e),r},this.showDelete=function(e){return arguments.length&&(a=!!e),a},this.canSwipeItems=function(e){return arguments.length&&(o=!!e),o},this.closeOptionButtons=function(){this.listView&&this.listView.clearDragEffects()}}]),u.controller("$ionicNavBar",["$scope","$element","$attrs","$ionicViewService","$animate","$compile","$ionicNavBarDelegate",function(e,t,n,i,o,r,a){t.parent().data("$ionNavBarController",this);var s=a._registerInstance(this,n.delegateHandle);e.$on("$destroy",s),e.$on("$viewHistory.historyChange",function(e,t){backIsShown=!!t.showBack});var c=this;this.leftButtonsElement=g(t[0].querySelector(".buttons.left-buttons")),this.rightButtonsElement=g(t[0].querySelector(".buttons.right-buttons")),this.back=function(){var e=i.getBackView();return e&&e.go(),!1},this.align=function(e){this._headerBarView.align(e)},this.showBackButton=function(t){return arguments.length&&(e.backButtonShown=!!t),!(!e.hasBackButton||!e.backButtonShown)},this.showBar=function(t){return arguments.length&&(e.isInvisible=!t,e.$parent.$hasHeader=!!t),!e.isInvisible},this.setTitle=function(t){e.title!==t&&(e.oldTitle=e.title,e.title=t||"")},this.changeTitle=function(n,i){return e.title===n?("undefined"!=typeof backIsShown&&!backIsShown&&e.backButtonShown&&g(t[0].querySelector(".back-button")).addClass("ng-hide"),!1):(this.setTitle(n),e.isReverse="back"==i,e.shouldAnimate=!!i,e.shouldAnimate?this._animateTitles():this._headerBarView.align(),!0)},this.getTitle=function(){return e.title||""},this.getPreviousTitle=function(){return e.oldTitle||""},this._animateTitles=function(){var n,i,a;a=t[0].querySelectorAll(".title"),a.length&&(n=r('<h1 class="title" ng-bind-html="oldTitle"></h1>')(e),g(a[0]).replaceWith(n)),i=r('<h1 class="title invisible" ng-bind-html="title"></h1>')(e),ionic.requestAnimationFrame(function(){n&&o.leave(g(n));var r=n&&g(n)||null;o.enter(i,t,r,function(){c._headerBarView.align()}),f(a,function(e){e&&e.parentNode&&g(e).remove()}),e.$digest(),ionic.requestAnimationFrame(function(){i[0].classList.remove("invisible")})})}}]),u.factory("$$scrollValueCache",function(){return{}}).controller("$ionicScroll",["$scope","scrollViewOptions","$timeout","$window","$$scrollValueCache","$location","$rootScope","$document","$ionicScrollDelegate",function(e,t,n,i,o,r,a,s,c){var l=this;this.__timeout=n,this._scrollViewOptions=t;var u=this.element=t.el,d=this.$element=g(u),f=this.scrollView=new ionic.views.Scroll(t);(d.parent().length?d.parent():d).data("$$ionicScrollController",this);var h=c._registerInstance(this,t.delegateHandle);angular.isDefined(t.bouncing)||ionic.Platform.ready(function(){f.options.bouncing=!0,ionic.Platform.isAndroid()&&(f.options.bouncing=!1,f.options.deceleration=.95)});var p=angular.bind(f,f.resize);ionic.on("resize",p,i);var v=angular.noop,m=angular.noop,$=function(t){var n=(t.originalEvent||t).detail||{};e.$onScroll&&e.$onScroll({event:t,scrollTop:n.scrollTop||0,scrollLeft:n.scrollLeft||0})};d.on("scroll",$),e.$on("$destroy",function(){h(),f.__cleanup(),ionic.off("resize",p,i),i.removeEventListener("resize",p),m(),v(),l._rememberScrollId&&(o[l._rememberScrollId]=f.getValues()),t=null,l._scrollViewOptions=null,l.element=null,d.off("scroll",$),d=null,l.$element=null,l.scrollView=null,f=null}),m=e.$on("$viewContentLoaded",function(t,i){if(!t.defaultPrevented){t.preventDefault();var o=i&&i.viewId||e.$historyId;o&&n(function(){l.rememberScrollPosition(o),l.scrollToRememberedPosition(),v=a.$on("$viewHistory.viewBack",function(e,t){o===t&&l.forgetScrollPosition()})},0,!1)}}),n(function(){f.run()}),this._rememberScrollId=null,this.getScrollView=function(){return this.scrollView},this.getScrollPosition=function(){return this.scrollView.getValues()},this.resize=function(){return n(p).then(function(){d.triggerHandler("scroll.resize")})},this.scrollTop=function(e){this.resize().then(function(){f.scrollTo(0,0,!!e)})},this.scrollBottom=function(e){this.resize().then(function(){var t=f.getScrollMax();f.scrollTo(t.left,t.top,!!e)})},this.scrollTo=function(e,t,n){this.resize().then(function(){f.scrollTo(e,t,!!n)})},this.zoomTo=function(e,t,n,i){this.resize().then(function(){f.zoomTo(e,!!t,n,i)})},this.zoomBy=function(e,t,n,i){this.resize().then(function(){f.zoomBy(e,!!t,n,i)})},this.scrollBy=function(e,t,n){this.resize().then(function(){f.scrollBy(e,t,!!n)})},this.anchorScroll=function(e){this.resize().then(function(){var t=r.hash(),n=t&&s[0].getElementById(t);if(!t||!n)return void f.scrollTo(0,0,!!e);var i=n,o=0,a=0,c=0;do null!==i&&(o+=i.offsetLeft),null!==i&&(a+=i.offsetTop),i=i.offsetParent,c++;while(i.attributes!=l.element.attributes&&i.offsetParent);f.scrollTo(o,a,!!e)})},this.rememberScrollPosition=function(e){if(!e)throw new Error("Must supply an id to remember the scroll by!");this._rememberScrollId=e},this.forgetScrollPosition=function(){delete o[this._rememberScrollId],this._rememberScrollId=null},this.scrollToRememberedPosition=function(e){var t=o[this._rememberScrollId];t&&this.resize().then(function(){f.scrollTo(+t.left,+t.top,e)})},this._setRefresher=function(e,t){var i=this.refresher=t,o=l.refresher.clientHeight||0;f.activatePullToRefresh(o,function(){i.classList.add("active"),e.$onPulling()},function(){n(function(){i.classList.remove("active"),i.classList.remove("refreshing"),i.classList.add("invisible")},300)},function(){i.classList.add("refreshing"),e.$onRefresh()},function(){i.classList.remove("invisible")},function(){i.classList.add("invisible")})}}]),u.controller("$ionicSideMenus",["$scope","$attrs","$ionicSideMenuDelegate","$ionicPlatform","$ionicBody",function(e,t,n,i,o){var r,a,s,c,l,u,d,f=this;f.$scope=e,f.initialize=function(e){f.left=e.left,f.right=e.right,f.setContent(e.content),f.dragThresholdX=e.dragThresholdX||10},f.setContent=function(e){e&&(f.content=e,f.content.onDrag=function(e){f._handleDrag(e)},f.content.endDrag=function(e){f._endDrag(e)})},f.isOpenLeft=function(){return f.getOpenAmount()>0},f.isOpenRight=function(){return f.getOpenAmount()<0},f.toggleLeft=function(e){var t=f.getOpenAmount();0===arguments.length&&(e=0>=t),f.content.enableAnimation(),f.openPercentage(e?100:0)},f.toggleRight=function(e){var t=f.getOpenAmount();0===arguments.length&&(e=t>=0),f.content.enableAnimation(),f.openPercentage(e?-100:0)},f.close=function(){f.openPercentage(0)},f.getOpenAmount=function(){return f.content&&f.content.getTranslateX()||0},f.getOpenRatio=function(){var e=f.getOpenAmount();return e>=0?e/f.left.width:e/f.right.width},f.isOpen=function(){return 0!==f.getOpenAmount()},f.getOpenPercentage=function(){return 100*f.getOpenRatio()},f.openPercentage=function(e){var t=e/100;if(f.left&&e>=0)f.openAmount(f.left.width*t);else if(f.right&&0>e){{f.right.width}f.openAmount(f.right.width*t)}o.enableClass(0!==e,"menu-open")},f.openAmount=function(e){var t=f.left&&f.left.width||0,n=f.right&&f.right.width||0;return(f.left&&f.left.isEnabled||!(e>0))&&(f.right&&f.right.isEnabled||!(0>e))?a&&e>t?void f.content.setTranslateX(t):r&&-n>e?void f.content.setTranslateX(-n):(f.content.setTranslateX(e),void(e>=0?(a=!0,r=!1,e>0&&(f.right&&f.right.pushDown&&f.right.pushDown(),f.left&&f.left.bringUp&&f.left.bringUp())):(r=!0,a=!1,f.right&&f.right.bringUp&&f.right.bringUp(),f.left&&f.left.pushDown&&f.left.pushDown()))):void f.content.setTranslateX(0)},f.snapToRest=function(e){f.content.enableAnimation(),s=!1;var t=f.getOpenRatio();if(0===t)return void f.openPercentage(0);var n=.3,i=e.gesture.velocityX,o=e.gesture.direction;f.openPercentage(t>0&&.5>t&&"right"==o&&n>i?0:t>.5&&"left"==o&&n>i?100:0>t&&t>-.5&&"left"==o&&n>i?0:.5>t&&"right"==o&&n>i?-100:"right"==o&&t>=0&&(t>=.5||i>n)?100:"left"==o&&0>=t&&(-.5>=t||i>n)?-100:0)},f.isAsideExposed=function(){return!!d},f.exposeAside=function(e){d=e,f.content.setMarginLeft(d?f.left.width:0),f.$scope.$emit("$ionicExposeAside",d)},f.activeAsideResizing=function(e){o.enableClass(e,"aside-resizing")},f._endDrag=function(e){d||(s&&f.snapToRest(e),c=null,l=null,u=null)},f._handleDrag=function(e){d||(c?l=e.gesture.touches[0].pageX:(c=e.gesture.touches[0].pageX,l=c),!s&&Math.abs(l-c)>f.dragThresholdX&&(c=l,s=!0,f.content.disableAnimation(),u=f.getOpenAmount()),s&&f.openAmount(u+(l-c)))},f.canDragContent=function(t){return arguments.length&&(e.dragContent=!!t),e.dragContent},f.edgeThreshold=25,f.edgeThresholdEnabled=!1,f.edgeDragThreshold=function(e){return arguments.length&&(angular.isNumber(e)&&e>0?(f.edgeThreshold=e,f.edgeThresholdEnabled=!0):f.edgeThresholdEnabled=!!e),f.edgeThresholdEnabled},f.isDraggableTarget=function(t){var n=f.edgeThresholdEnabled&&!f.isOpen(),i=t.gesture.startEvent&&t.gesture.startEvent.center&&t.gesture.startEvent.center.pageX,o=!n||i<=f.edgeThreshold||i>=f.content.offsetWidth-f.edgeThreshold;return(e.dragContent||f.isOpen())&&o&&!t.gesture.srcEvent.defaultPrevented&&!t.target.tagName.match(/input|textarea|select|object|embed/i)&&!t.target.isContentEditable&&!(t.target.dataset?t.target.dataset.preventScroll:"true"==t.target.getAttribute("data-prevent-scroll"))},e.sideMenuContentTranslateX=0;var h=angular.noop,p=angular.bind(f,f.close);e.$watch(function(){return 0!==f.getOpenAmount()},function(e){h(),e&&(h=i.registerBackButtonAction(p,y))});var g=n._registerInstance(f,t.delegateHandle);e.$on("$destroy",function(){g(),h()}),f.initialize({left:{width:275},right:{width:275}})}]),u.controller("$ionicTab",["$scope","$ionicViewService","$attrs","$location","$state",function(e,t,n,i,o){this.$scope=e,this.hrefMatchesState=function(){return n.href&&0===i.path().indexOf(n.href.replace(/^#/,"").replace(/\/$/,""))},this.srefMatchesState=function(){return n.uiSref&&o.includes(n.uiSref.split("(")[0])},this.navNameMatchesState=function(){return this.navViewName&&t.isCurrentStateNavView(this.navViewName)},this.tabMatchesState=function(){return this.hrefMatchesState()||this.srefMatchesState()||this.navNameMatchesState()}}]),u.controller("$ionicTabs",["$scope","$ionicViewService","$element",function(e,t){var n=null,i=this;i.tabs=[],i.selectedIndex=function(){return i.tabs.indexOf(n)},i.selectedTab=function(){return n},i.add=function(e){t.registerHistory(e),i.tabs.push(e),1===i.tabs.length&&i.select(e)},i.remove=function(e){var t=i.tabs.indexOf(e);if(-1!==t){if(e.$tabSelected)if(i.deselect(e),1===i.tabs.length);else{var n=t===i.tabs.length-1?t-1:t+1;i.select(i.tabs[n])}i.tabs.splice(t,1)}},i.deselect=function(e){e.$tabSelected&&(n=null,e.$tabSelected=!1,(e.onDeselect||angular.noop)())},i.select=function(o,r){var a;if(angular.isNumber(o)?(a=o,o=i.tabs[a]):a=i.tabs.indexOf(o),1===arguments.length&&(r=!(!o.navViewName&&!o.uiSref)),n&&n.$historyId==o.$historyId)r&&t.goToHistoryRoot(o.$historyId);else if(f(i.tabs,function(e){i.deselect(e)}),n=o,o.$tabSelected=!0,(o.onSelect||angular.noop)(),r){var s={type:"tab",tabIndex:a,historyId:o.$historyId,navViewName:o.navViewName,hasNavView:!!o.navViewName,title:o.title,url:o.href,uiSref:o.uiSref};e.$emit("viewState.changeHistory",s)}}}]),u.directive("ionActionSheet",["$document",function(e){return{restrict:"E",scope:!0,replace:!0,link:function(t,n){var i=function(e){27==e.which&&(t.cancel(),t.$apply())},o=function(e){e.target==n[0]&&(t.cancel(),t.$apply())};t.$on("$destroy",function(){n.remove(),e.unbind("keyup",i)}),e.bind("keyup",i),n.bind("click",o)},template:'<div class="action-sheet-backdrop"><div class="action-sheet-wrapper"><div class="action-sheet"><div class="action-sheet-group"><div class="action-sheet-title" ng-if="titleText" ng-bind-html="titleText"></div><button class="button" ng-click="buttonClicked($index)" ng-repeat="button in buttons" ng-bind-html="button.text"></button></div><div class="action-sheet-group" ng-if="destructiveText"><button class="button destructive" ng-click="destructiveButtonClicked()" ng-bind-html="destructiveText"></button></div><div class="action-sheet-group" ng-if="cancelText"><button class="button" ng-click="cancel()" ng-bind-html="cancelText"></button></div></div></div></div>'}}]),u.directive("ionCheckbox",function(){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<label class="item item-checkbox"><div class="checkbox checkbox-input-hidden disable-pointer-events"><input type="checkbox"><i class="checkbox-icon"></i></div><div class="item-content disable-pointer-events" ng-transclude></div></label>',compile:function(e,t){var n=e.find("input");f({name:t.name,"ng-value":t.ngValue,"ng-model":t.ngModel,"ng-checked":t.ngChecked,"ng-disabled":t.ngDisabled,"ng-true-value":t.ngTrueValue,"ng-false-value":t.ngFalseValue,"ng-change":t.ngChange},function(e,t){h(e)&&n.attr(t,e)})}}});var I="Cannot create a collection-repeat within a scrollView that is scrollable on both x and y axis. Choose either x direction or y direction.",B="collection-repeat expected attribute collection-item-height to be a an expression that returns a number (in pixels) or percentage.",_="collection-repeat expected attribute collection-item-width to be a an expression that returns a number (in pixels) or percentage.",V="collection-repeat expected expression in form of '_item_ in _collection_[ track by _id_]' but got '%'";u.directive("collectionRepeat",["$collectionRepeatManager","$collectionDataSource","$parse",function(e,t,n){return{priority:1e3,transclude:"element",terminal:!0,$$tlb:!0,require:"^$ionicScroll",controller:[function(){}],link:function(i,o,r,a,s){function c(e){var t=[],n=[],i=!0;f(x.children,function(e){if(ionic.DomUtil.elementIsDescendant(o[0],e,x))i=!1;else{if(e.hasAttribute("collection-repeat-ignore"))return;var r=e.offsetWidth,a=e.offsetHeight;if(r&&a){var s=g(e);(i?t:n).push({width:e.offsetWidth,height:e.offsetHeight,element:s,scope:s.isolateScope()||s.scope(),isOutside:!0})}}}),d.resize(),k.setData(e,t,n),T.resize()}function l(){c(i.$eval(S))}var u=g('<div style="position:relative;">');o.parent()[0].insertBefore(u[0],o[0]),u.append(o);var d=a.scrollView;if(d.options.scrollingX&&d.options.scrollingY)throw new Error(I);var h=!!d.options.scrollingY;if(h&&!r.collectionItemHeight)throw new Error(B);if(!h&&!r.collectionItemWidth)throw new Error(_);var v=n(r.collectionItemHeight||'"100%"'),m=n(r.collectionItemWidth||'"100%"'),$=function(e,t){var n=v(e,t);return p(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*d.__clientHeight):n},w=function(e,t){var n=m(e,t);return p(n)&&n.indexOf("%")>-1?Math.floor(parseInt(n,10)/100*d.__clientWidth):n},b=r.collectionRepeat.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!b)throw new Error(V.replace("%",r.collectionRepeat));var y=b[1],S=b[2],C=b[3],k=new t({scope:i,transcludeFn:s,transcludeParent:o.parent(),keyExpr:y,listExpr:S,trackByExpr:C,heightGetter:$,widthGetter:w}),T=new e({dataSource:k,element:a.$element,scrollView:a.scrollView});i.$watchCollection(S,function(e){if(e&&!angular.isArray(e))throw new Error("collection-repeat expects an array to repeat over, but instead got '"+typeof e+"'.");c(e)});var x=a.scrollView.__content;a.$element.on("scroll.resize",l),ionic.on("resize",l,window),i.$on("$destroy",function(){T.destroy(),k.destroy(),ionic.off("resize",l,window)})}}}]).directive({ngSrc:i("ngSrc","src"),ngSrcset:i("ngSrcset","srcset"),ngHref:i("ngHref","href")}),u.directive("ionContent",["$timeout","$controller","$ionicBind",function(e,t,n){return{restrict:"E",require:"^?ionNavView",scope:!0,priority:800,compile:function(e,i){function o(e,o,a){var s=e.$parent;if(e.$watch(function(){return(s.$hasHeader?" has-header":"")+(s.$hasSubheader?" has-subheader":"")+(s.$hasFooter?" has-footer":"")+(s.$hasSubfooter?" has-subfooter":"")+(s.$hasTabs?" has-tabs":"")+(s.$hasTabsTop?" has-tabs-top":"")},function(e,t){o.removeClass(t),o.addClass(e)}),e.$hasHeader=e.$hasSubheader=e.$hasFooter=e.$hasSubfooter=e.$hasTabs=e.$hasTabsTop=!1,n(e,a,{$onScroll:"&onScroll",$onScrollComplete:"&onScrollComplete",hasBouncing:"@",padding:"@",direction:"@",scrollbarX:"@",scrollbarY:"@",startX:"@",startY:"@",scrollEventInterval:"@"}),e.direction=e.direction||"y",angular.isDefined(a.padding)&&e.$watch(a.padding,function(e){(r||o).toggleClass("padding",!!e)}),"false"===a.scroll);else if("true"===i.overflowScroll)o.addClass("overflow-scroll");else{var c={el:o[0],delegateHandle:i.delegateHandle,locking:"true"===(i.locking||"true"),bouncing:e.$eval(e.hasBouncing),startX:e.$eval(e.startX)||0,startY:e.$eval(e.startY)||0,scrollbarX:e.$eval(e.scrollbarX)!==!1,scrollbarY:e.$eval(e.scrollbarY)!==!1,scrollingX:e.direction.indexOf("x")>=0,scrollingY:e.direction.indexOf("y")>=0,scrollEventInterval:parseInt(e.scrollEventInterval,10)||10,scrollingComplete:function(){e.$onScrollComplete({scrollTop:this.__scrollTop,scrollLeft:this.__scrollLeft})}};t("$ionicScroll",{$scope:e,scrollViewOptions:c}),e.$on("$destroy",function(){c.scrollingComplete=angular.noop,delete c.el,r=null,o=null,i.$$element=null})}}var r;return e.addClass("scroll-content ionic-scroll"),"false"!=i.scroll?(r=g('<div class="scroll"></div>'),r.append(e.contents()),e.append(r)):e.addClass("scroll-content-false"),{pre:o}}}}]),u.directive("exposeAsideWhen",["$window",function(e){return{restrict:"A",require:"^ionSideMenus",link:function(t,n,i,o){function r(){var t="large"==i.exposeAsideWhen?"(min-width:768px)":i.exposeAsideWhen;o.exposeAside(e.matchMedia(t).matches),o.activeAsideResizing(!1)}function a(){o.activeAsideResizing(!0),s()}var s=ionic.debounce(function(){t.$apply(function(){r()})},300,!1);r(),ionic.on("resize",a,e),t.$on("$destroy",function(){ionic.off("resize",a,e)})}}}]);var E="onHold onTap onTouch onRelease onDrag onDragUp onDragRight onDragDown onDragLeft onSwipe onSwipeUp onSwipeRight onSwipeDown onSwipeLeft".split(" ");E.forEach(function(e){u.directive(e,o(e))}),u.directive("ionNavBar",r()).directive("ionHeaderBar",r()).directive("ionHeaderBar",a(!0)).directive("ionFooterBar",a(!1)),u.directive("ionInfiniteScroll",["$timeout",function(e){function t(e,t,n){return n?t*(1-parseFloat(e,10)/100):t-parseFloat(e,10)}return{restrict:"E",require:["^$ionicScroll","ionInfiniteScroll"],template:'<i class="icon {{icon()}} icon-refreshing"></i>',scope:!0,controller:["$scope","$attrs",function(e,n){this.isLoading=!1,this.scrollView=null,this.getMaxScroll=function(){var e=(n.distance||"2.5%").trim(),i=-1!==e.indexOf("%"),o=this.scrollView.getScrollMax();return{left:this.scrollView.options.scrollingX?t(e,o.left,i):-1,top:this.scrollView.options.scrollingY?t(e,o.top,i):-1}}}],link:function(t,n,i,o){function r(){if(!s.isLoading){var e=c.getValues(),t=s.getMaxScroll();(-1!==t.left&&e.left>=t.left||-1!==t.top&&e.top>=t.top)&&l()}}var a=o[0],s=o[1],c=s.scrollView=a.scrollView;t.icon=function(){return angular.isDefined(i.icon)?i.icon:"ion-loading-d"};var l=function(){n[0].classList.add("active"),s.isLoading=!0,t.$parent&&t.$parent.$apply(i.onInfinite||"")},u=function(){n[0].classList.remove("active"),e(function(){c.resize(),d()},0,!1),s.isLoading=!1};t.$on("scroll.infiniteScrollComplete",function(){u()}),t.$on("$destroy",function(){a.$element.off("scroll",d)});var d=ionic.animationFrameThrottle(r);setTimeout(d),a.$element.on("scroll",d)}}}]);var A='<a class="item-content" ng-href="{{$href()}}" target="{{$target()}}"></a>',D='<div class="item-content"></div>';u.directive("ionItem",["$animate","$compile",function(){return{restrict:"E",controller:["$scope","$element",function(e,t){this.$scope=e,this.$element=t}],scope:!0,compile:function(e,t){var n=angular.isDefined(t.href)||angular.isDefined(t.ngHref)||angular.isDefined(t.uiSref),i=n||/ion-(delete|option|reorder)-button/i.test(e.html());if(i){var o=g(n?A:D);o.append(e.contents()),e.append(o),e.addClass("item item-complex")}else e.addClass("item");return function(e,t,n){e.$href=function(){return n.href||n.ngHref},e.$target=function(){return n.target||"_self"}}}}}]);var P='<div class="item-left-edit item-delete enable-pointer-events"></div>';u.directive("ionDeleteButton",["$animate",function(){return{restrict:"E",require:["^ionItem","^?ionList"],priority:Number.MAX_VALUE,compile:function(e,t){return t.$set("class",(t["class"]||"")+" button icon button-icon",!0),function(e,t,n,i){var o=i[0],r=i[1],a=g(P);a.append(t),o.$element.append(a).addClass("item-left-editable"),r&&r.showDelete()&&a.addClass("visible active")}}}}]),u.directive("itemFloatingLabel",function(){return{restrict:"C",link:function(e,t){var n=t[0],i=n.querySelector("input, textarea"),o=n.querySelector(".input-label");if(i&&o){var r=function(){i.value?o.classList.add("has-input"):o.classList.remove("has-input")};i.addEventListener("input",r);var a=angular.element(i).controller("ngModel");a&&(a.$render=function(){i.value=a.$viewValue||"",r()}),e.$on("$destroy",function(){i.removeEventListener("input",r)})}}}});var H='<div class="item-options invisible"></div>';u.directive("ionOptionButton",["$compile",function(){function e(e){e.stopPropagation()}return{restrict:"E",require:"^ionItem",priority:Number.MAX_VALUE,compile:function(t,n){return n.$set("class",(n["class"]||"")+" button",!0),function(t,n,i,o){o.optionsContainer||(o.optionsContainer=g(H),o.$element.append(o.optionsContainer)),o.optionsContainer.append(n),n.on("click",e)}}}}]);var L='<div data-prevent-scroll="true" class="item-right-edit item-reorder enable-pointer-events"></div>';u.directive("ionReorderButton",["$animate","$parse",function(e,t){return{restrict:"E",require:["^ionItem","^?ionList"],priority:Number.MAX_VALUE,compile:function(e,n){return n.$set("class",(n["class"]||"")+" button icon button-icon",!0),e[0].setAttribute("data-prevent-scroll",!0),function(e,n,i,o){var r=o[0],a=o[1],s=t(i.onReorder);e.$onReorder=function(t,n){s(e,{$fromIndex:t,$toIndex:n})},i.ngClick||i.onClick||i.onclick||(n[0].onclick=function(e){return e.stopPropagation(),!1});var c=g(L);c.append(n),r.$element.append(c).addClass("item-right-editable"),a&&a.showReorder()&&c.addClass("visible active")}}}}]),u.directive("keyboardAttach",function(){return function(e,t){function n(e){if(!ionic.Platform.isAndroid()||ionic.Platform.isFullScreen){var n=e.keyboardHeight||e.detail.keyboardHeight;t.css("bottom",n+"px"),o=t.controller("$ionicScroll"),o&&(o.scrollView.__container.style.bottom=n+s(t[0])+"px")}}function i(){(!ionic.Platform.isAndroid()||ionic.Platform.isFullScreen)&&(t.css("bottom",""),o&&(o.scrollView.__container.style.bottom=""))}ionic.on("native.keyboardshow",n,window),ionic.on("native.keyboardhide",i,window),ionic.on("native.showkeyboard",n,window),ionic.on("native.hidekeyboard",i,window);var o;e.$on("$destroy",function(){ionic.off("native.keyboardshow",n,window),ionic.off("native.keyboardhide",i,window),ionic.off("native.showkeyboard",n,window),ionic.off("native.hidekeyboard",i,window)})}}),u.directive("ionList",["$animate","$timeout",function(e,t){return{restrict:"E",require:["ionList","^?$ionicScroll"],controller:"$ionicList",compile:function(e,n){var i=g('<div class="list">').append(e.contents()).addClass(n.type);return e.append(i),function(e,i,o,r){function a(){function o(e,t){t()&&e.addClass("visible")||e.removeClass("active"),ionic.requestAnimationFrame(function(){t()&&e.addClass("active")||e.removeClass("invisible")})}s.listView=new ionic.views.ListView({el:i[0],listEl:i.children()[0],scrollEl:c&&c.element,scrollView:c&&c.scrollView,onReorder:function(e,n,i){var o=g(e).scope();o&&o.$onReorder&&t(function(){o.$onReorder(n,i)})},canSwipe:function(){return s.canSwipeItems()}});h(n.canSwipe)&&e.$watch("!!("+n.canSwipe+")",function(e){s.canSwipeItems(e)}),h(n.showDelete)&&e.$watch("!!("+n.showDelete+")",function(e){s.showDelete(e)}),h(n.showReorder)&&e.$watch("!!("+n.showReorder+")",function(e){s.showReorder(e)}),e.$watch(function(){return s.showDelete()},function(e,t){if(e||t){e&&s.closeOptionButtons(),s.canSwipeItems(!e),i.children().toggleClass("list-left-editing",e),i.toggleClass("disable-pointer-events",e);var n=g(i[0].getElementsByClassName("item-delete"));o(n,s.showDelete)}}),e.$watch(function(){return s.showReorder()},function(e,t){if(e||t){e&&s.closeOptionButtons(),s.canSwipeItems(!e),i.children().toggleClass("list-right-editing",e),i.toggleClass("disable-pointer-events",e);var n=g(i[0].getElementsByClassName("item-reorder"));o(n,s.showReorder)}})}var s=r[0],c=r[1];t(a)}}}}]),u.directive("menuClose",["$ionicViewService",function(){return{restrict:"AC",require:"^ionSideMenus",link:function(e,t,n,i){t.bind("click",function(){i.close()})}}}]),u.directive("menuToggle",["$ionicViewService",function(){return{restrict:"AC",require:"^ionSideMenus",link:function(e,t,n,i){var o=n.menuToggle||"left";t.bind("click",function(){"left"===o?i.toggleLeft():"right"===o&&i.toggleRight()})}}}]),u.directive("ionModal",[function(){return{restrict:"E",transclude:!0,replace:!0,controller:[function(){}],template:'<div class="modal-backdrop"><div class="modal-wrapper" ng-transclude></div></div>'}}]),u.directive("ionModalView",function(){return{restrict:"E",compile:function(e){e.addClass("modal")}}}),u.directive("ionNavBackButton",["$animate","$rootScope","$sanitize","$ionicNavBarConfig","$ionicNgClick",function(e,t,n,i,o){var r=!1;return t.$on("$viewHistory.historyChange",function(e,t){r=!!t.showBack}),{restrict:"E",require:"^ionNavBar",compile:function(t){t.addClass("button back-button ng-hide");var a=!!(t.html()||"").match(/class=.*?ion-/);return function(t,s,c,l){a||-1!==s[0].className.indexOf("ion-")||s.addClass(i.backButtonIcon),h(c.ngClick)||o(t,s,l.back),t.$watch(function(){return h(c.fromTitle)&&(s[0].innerHTML='<span class="back-button-title">'+n(t.oldTitle)+"</span>"),!(!r||!t.backButtonShown)},ionic.animationFrameThrottle(function(t){t?e.removeClass(s,"ng-hide"):e.addClass(s,"ng-hide")}))}}}}]),u.constant("$ionicNavBarConfig",{transition:"nav-title-slide-ios7",alignTitle:"center",backButtonIcon:"ion-ios7-arrow-back"}),u.directive("ionNavBar",["$ionicViewService","$rootScope","$animate","$compile","$ionicNavBarConfig",function(e,t,n,i,o){return{restrict:"E",controller:"$ionicNavBar",scope:!0,compile:function(e,t){function n(e,t,n,i){i._headerBarView=new ionic.views.HeaderBar({el:t[0],alignTitle:n.alignTitle||o.alignTitle||"center"}),e.backButtonShown=!1,e.shouldAnimate=!0,e.isReverse=!1,e.isInvisible=!0,e.$on("$destroy",function(){e.$parent.$hasHeader=!1}),e.$watch(function(){return(e.isReverse?" reverse":"")+(e.isInvisible?" invisible":"")+(e.shouldAnimate?"":" no-animation")},function(e,n){t.removeClass(n),t.addClass(e)})}return e.addClass("bar bar-header nav-bar").append('<div class="buttons left-buttons"> </div><h1 ng-bind-html="title" class="title"></h1><div class="buttons right-buttons"> </div>'),e.addClass(h(t.animation)?t.animation:o.transition),{pre:n}}}}]),u.directive("ionNavButtons",["$compile","$animate",function(e,t){return{require:"^ionNavBar",restrict:"E",compile:function(n){var i=n.contents().remove();return function(n,o,r,a){var s="right"===r.side?a.rightButtonsElement:a.leftButtonsElement,c=g("<span>").append(i);o.append(c),e(c)(n),ionic.requestAnimationFrame(function(){n.$$destroyed||t.enter(c,s)}),n.$on("$destroy",function(){t.leave(c)}),o.css("display","none")}}}}]),u.directive("navClear",["$ionicViewService","$state","$location","$window","$rootScope",function(e,t,n,i,o){return o.$on("$stateChangeError",function(){e.nextViewOptions(null)}),{priority:100,restrict:"AC",compile:function(){function t(t,n){function o(){r=t.$on("$stateChangeStart",function(){e.nextViewOptions({disableAnimate:!0,disableBack:!0}),r()
}),i.setTimeout(r,300)}var r;n.on("click",o)}return{pre:t}}}}]),u.constant("$ionicNavViewConfig",{transition:"slide-left-right-ios7"}),u.directive("ionNavView",["$ionicViewService","$state","$compile","$controller","$animate",function(e,t,n,i,o){var r=!1,a={restrict:"E",terminal:!0,priority:2e3,transclude:!0,controller:function(){},compile:function(s,c,l){return function(s,c,u){function d(r){o.enabled()===!1&&(r=!1);var a=t.$current&&t.$current.locals[p];if(a!==h){var l=e.getRenderer(c,u,s);if(f&&(f.$destroy(),f=null),!a)return h=null,w.state=null,c.append(m);var d=g("<div></div>").html(a.$template).contents(),$=l().register(d);l(r).leave(),h=a,w.state=a.$$state,l(r).enter(d);var b=n(d);if(f=s.$new(),f.$navDirection=$.navDirection,a.$$controller){a.$scope=f;var y=i(a.$$controller,a);c.children().data("$ngControllerController",y)}b(f);var S=e._getViewById($.viewId)||{};f.$broadcast("$viewContentLoaded",S),v&&f.$eval(v),d=null}}var f,h,p=u[a.name]||u.name||"",v=u.onload||"",m=l(s);c.append(m);var $=c.parent().inheritedData("$uiView");p.indexOf("@")<0&&(p=p+"@"+($&&$.state?$.state.name:""));var w={name:p,state:null};c.data("$uiView",w);var b=function(){if(!r){r=!0;try{d(!0)}catch(e){throw r=!1,e}r=!1}};s.$on("$stateChangeSuccess",b),d(!1)}}};return a}]),u.config(["$provide",function(e){e.decorator("ngClickDirective",["$delegate",function(e){return e.shift(),e}])}]).factory("$ionicNgClick",["$parse",function(e){return function(t,n,i){var o=angular.isFunction(i)?i:e(i);n.on("click",function(e){t.$apply(function(){o(t,{$event:e})})}),n.onclick=function(){}}}]).directive("ngClick",["$ionicNgClick",function(e){return function(t,n,i){e(t,n,i.ngClick)}}]).directive("ionStopEvent",function(){return{restrict:"A",link:function(e,t,n){t.bind(n.ionStopEvent,c)}}}),u.directive("ionPane",function(){return{restrict:"E",link:function(e,t){t.addClass("pane")}}}),u.directive("ionPopover",[function(){return{restrict:"E",transclude:!0,replace:!0,controller:[function(){}],template:'<div class="popover-backdrop"><div class="popover-wrapper" ng-transclude></div></div>'}}]),u.directive("ionPopoverView",function(){return{restrict:"E",compile:function(e){e.append(angular.element('<div class="popover-arrow"></div>')),e.addClass("popover")}}}),u.directive("ionRadio",function(){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<label class="item item-radio"><input type="radio" name="radio-group"><div class="item-content disable-pointer-events" ng-transclude></div><i class="radio-icon disable-pointer-events icon ion-checkmark"></i></label>',compile:function(e,t){t.icon&&e.children().eq(2).removeClass("ion-checkmark").addClass(t.icon);var n=e.find("input");return f({name:t.name,value:t.value,disabled:t.disabled,"ng-value":t.ngValue,"ng-model":t.ngModel,"ng-disabled":t.ngDisabled,"ng-change":t.ngChange},function(e,t){h(e)&&n.attr(t,e)}),function(e,t,n){e.getValue=function(){return e.ngValue||n.value}}}}}),u.directive("ionRefresher",["$ionicBind",function(e){return{restrict:"E",replace:!0,require:"^$ionicScroll",template:'<div class="scroll-refresher" collection-repeat-ignore><div class="ionic-refresher-content" ng-class="{\'ionic-refresher-with-text\': pullingText || refreshingText}"><div class="icon-pulling"><i class="icon {{pullingIcon}}"></i></div><div class="text-pulling" ng-bind-html="pullingText"></div><i class="icon {{refreshingIcon}} icon-refreshing"></i><div class="text-refreshing" ng-bind-html="refreshingText"></div></div></div>',compile:function(t,n){return angular.isUndefined(n.pullingIcon)&&n.$set("pullingIcon","ion-arrow-down-c"),angular.isUndefined(n.refreshingIcon)&&n.$set("refreshingIcon","ion-loading-d"),function(t,n,i,o){e(t,i,{pullingIcon:"@",pullingText:"@",refreshingIcon:"@",refreshingText:"@",$onRefresh:"&onRefresh",$onPulling:"&onPulling"}),o._setRefresher(t,n[0]),t.$on("scroll.refreshComplete",function(){t.$evalAsync(function(){o.scrollView.finishPullToRefresh()})})}}}}]),u.directive("ionScroll",["$timeout","$controller","$ionicBind",function(e,t,n){return{restrict:"E",scope:!0,controller:function(){},compile:function(e){function i(e,i,r){var a,s;n(e,r,{direction:"@",paging:"@",$onScroll:"&onScroll",scroll:"@",scrollbarX:"@",scrollbarY:"@",zooming:"@",minZoom:"@",maxZoom:"@"}),e.direction=e.direction||"y",angular.isDefined(r.padding)&&e.$watch(r.padding,function(e){o.toggleClass("padding",!!e)}),e.$eval(e.paging)===!0&&o.addClass("scroll-paging"),e.direction||(e.direction="y");var c=e.$eval(e.paging)===!0,l={el:i[0],delegateHandle:r.delegateHandle,locking:"true"===(r.locking||"true"),bouncing:e.$eval(r.hasBouncing),paging:c,scrollbarX:e.$eval(e.scrollbarX)!==!1,scrollbarY:e.$eval(e.scrollbarY)!==!1,scrollingX:e.direction.indexOf("x")>=0,scrollingY:e.direction.indexOf("y")>=0,zooming:e.$eval(e.zooming)===!0,maxZoom:e.$eval(e.maxZoom)||3,minZoom:e.$eval(e.minZoom)||.5};c&&(l.speedMultiplier=.8,l.bouncing=!1),s=t("$ionicScroll",{$scope:e,scrollViewOptions:l}),a=e.$parent.scrollView=s.scrollView}e.addClass("scroll-view ionic-scroll");var o=g('<div class="scroll"></div>');return o.append(e.contents()),e.append(o),{pre:i}}}}]),u.directive("ionSideMenu",function(){return{restrict:"E",require:"^ionSideMenus",scope:!0,compile:function(e,t){return angular.isUndefined(t.isEnabled)&&t.$set("isEnabled","true"),angular.isUndefined(t.width)&&t.$set("width","275"),e.addClass("menu menu-"+t.side),function(e,t,n,i){e.side=n.side||"left";var o=i[e.side]=new ionic.views.SideMenu({width:275,el:t[0],isEnabled:!0});e.$watch(n.width,function(e){var t=+e;t&&t==e&&o.setWidth(+e)}),e.$watch(n.isEnabled,function(e){o.setIsEnabled(!!e)})}}}}),u.directive("ionSideMenuContent",["$timeout","$ionicGesture","$window",function(e,t,n){return{restrict:"EA",require:"^ionSideMenus",scope:!0,compile:function(i,o){function r(r,a,s,c){function l(e){0!==c.getOpenAmount()?(c.close(),e.gesture.srcEvent.preventDefault(),g=null,v=null):g||(g=ionic.tap.pointerCoord(e.gesture.srcEvent))}function u(e){c.isDraggableTarget(e)&&"x"==p(e)&&(c._handleDrag(e),e.gesture.srcEvent.preventDefault())}function d(e){"x"==p(e)&&e.gesture.srcEvent.preventDefault()}function f(e){c._endDrag(e),g=null,v=null}function p(e){if(v)return v;if(e&&e.gesture){if(g){var t=ionic.tap.pointerCoord(e.gesture.srcEvent),n=Math.abs(t.x-g.x),i=Math.abs(t.y-g.y),o=i>n?"y":"x";return Math.max(n,i)>30&&(v=o),o}g=ionic.tap.pointerCoord(e.gesture.srcEvent)}return"x"}var g=null,v=null;a.addClass("menu-content pane"),h(o.dragContent)?r.$watch(o.dragContent,function(e){c.canDragContent(e)}):c.canDragContent(!0),h(o.edgeDragThreshold)&&r.$watch(o.edgeDragThreshold,function(e){c.edgeDragThreshold(e)});var m={element:i[0],onDrag:function(){},endDrag:function(){},getTranslateX:function(){return r.sideMenuContentTranslateX||0},setTranslateX:ionic.animationFrameThrottle(function(t){var n=m.offsetX+t;a[0].style[ionic.CSS.TRANSFORM]="translate3d("+n+"px,0,0)",e(function(){r.sideMenuContentTranslateX=t})}),setMarginLeft:ionic.animationFrameThrottle(function(e){e?(a[0].style[ionic.CSS.TRANSFORM]="translate3d("+e+"px,0,0)",a[0].style.width=n.innerWidth-e+"px",m.offsetX=e):(a[0].style[ionic.CSS.TRANSFORM]="translate3d(0,0,0)",a[0].style.width="",m.offsetX=0)}),enableAnimation:function(){r.animationEnabled=!0,a[0].classList.add("menu-animated")},disableAnimation:function(){r.animationEnabled=!1,a[0].classList.remove("menu-animated")},offsetX:0};c.setContent(m);var $={stop_browser_behavior:!1},w=t.on("tap",l,a,$),b=t.on("dragright",u,a,$),y=t.on("dragleft",u,a,$),S=t.on("dragup",d,a,$),C=t.on("dragdown",d,a,$),k=t.on("release",f,a,$);r.$on("$destroy",function(){t.off(y,"dragleft",u),t.off(b,"dragright",u),t.off(S,"dragup",d),t.off(C,"dragdown",d),t.off(k,"release",f),t.off(w,"tap",l)})}return{pre:r}}}}]),u.directive("ionSideMenus",["$ionicBody",function(e){return{restrict:"ECA",controller:"$ionicSideMenus",compile:function(t,n){function i(t){t.$on("$ionicExposeAside",function(n,i){t.$exposeAside||(t.$exposeAside={}),t.$exposeAside.active=i,e.enableClass(i,"aside-open")}),t.$on("$destroy",function(){e.removeClass("menu-open","aside-open")})}return n.$set("class",(n["class"]||"")+" view"),{pre:i}}}}]),u.directive("ionSlideBox",["$timeout","$compile","$ionicSlideBoxDelegate",function(e,t,n){return{restrict:"E",replace:!0,transclude:!0,scope:{autoPlay:"=",doesContinue:"@",slideInterval:"@",showPager:"@",pagerClick:"&",disableScroll:"@",onSlideChanged:"&",activeSlide:"=?"},controller:["$scope","$element","$attrs",function(t,i,o){var r=t.$eval(t.doesContinue)===!0,a=h(o.autoPlay)?!!t.autoPlay:!1,s=a?t.$eval(t.slideInterval)||4e3:0,c=new ionic.views.Slider({el:i[0],auto:s,continuous:r,startSlide:t.activeSlide,slidesChanged:function(){t.currentSlide=c.currentIndex(),e(function(){})},callback:function(n){t.currentSlide=n,t.onSlideChanged({index:t.currentSlide,$index:t.currentSlide}),t.$parent.$broadcast("slideBox.slideChanged",n),t.activeSlide=n,e(function(){})}});c.enableSlide(t.$eval(o.disableScroll)!==!0),t.$watch("activeSlide",function(e){angular.isDefined(e)&&c.slide(e)}),t.$on("slideBox.nextSlide",function(){c.next()}),t.$on("slideBox.prevSlide",function(){c.prev()}),t.$on("slideBox.setSlide",function(e,t){c.slide(t)}),this.__slider=c;var l=n._registerInstance(c,o.delegateHandle);t.$on("$destroy",l),this.slidesCount=function(){return c.slidesCount()},this.onPagerClick=function(e){t.pagerClick({index:e})},e(function(){c.load()})}],template:'<div class="slider"><div class="slider-slides" ng-transclude></div></div>',link:function(e,n){if(e.$eval(e.showPager)!==!1){var i=e.$new(),o=g("<ion-pager></ion-pager>");n.append(o),t(o)(i)}}}}]).directive("ionSlide",function(){return{restrict:"E",require:"^ionSlideBox",compile:function(e){return e.addClass("slider-slide"),function(){}}}}).directive("ionPager",function(){return{restrict:"E",replace:!0,require:"^ionSlideBox",template:'<div class="slider-pager"><span class="slider-pager-page" ng-repeat="slide in numSlides() track by $index" ng-class="{active: $index == currentSlide}" ng-click="pagerClick($index)"><i class="icon ion-record"></i></span></div>',link:function(e,t,n,i){var o=function(e){for(var n=t[0].children,i=n.length,o=0;i>o;o++)o==e?n[o].classList.add("active"):n[o].classList.remove("active")};e.pagerClick=function(e){i.onPagerClick(e)},e.numSlides=function(){return new Array(i.slidesCount())},e.$watch("currentSlide",function(e){o(e)})}}}),u.constant("$ionicTabConfig",{type:""}),u.directive("ionTab",["$rootScope","$animate","$ionicBind","$compile",function(e,t,n,i){function o(e,t){return angular.isDefined(t)?" "+e+'="'+t+'"':""}return{restrict:"E",require:["^ionTabs","ionTab"],replace:!0,controller:"$ionicTab",scope:!0,compile:function(e,r){var a="<ion-tab-nav"+o("ng-click",r.ngClick)+o("title",r.title)+o("icon",r.icon)+o("icon-on",r.iconOn)+o("icon-off",r.iconOff)+o("badge",r.badge)+o("badge-style",r.badgeStyle)+o("hidden",r.hidden)+o("class",r["class"])+"></ion-tab-nav>",s=g('<div class="pane">').append(e.contents().remove());return function(e,o,r,c){function l(){h.tabMatchesState()&&f.select(e,!1)}var u,d,f=c[0],h=c[1],p=s[0].querySelector("ion-nav-view")||s[0].querySelector("data-ion-nav-view"),v=p&&p.getAttribute("name");n(e,r,{animate:"=",onSelect:"&",onDeselect:"&",title:"@",uiSref:"@",href:"@"}),f.add(e),e.$on("$destroy",function(){f.remove(e),m.isolateScope().$destroy(),m.remove()}),o[0].removeAttribute("title"),v&&(h.navViewName=e.navViewName=v),e.$on("$stateChangeSuccess",l),l();var m=g(a);m.data("$ionTabsController",f),m.data("$ionTabController",h),f.$tabsElement.append(i(m)(e)),e.$watch("$tabSelected",function(n){u&&u.$destroy(),u=null,d&&t.leave(d),d=null,n&&(u=e.$new(),d=s.clone(),t.enter(d,f.$element),i(d)(u))})}}}}]),u.directive("ionTabNav",[function(){return{restrict:"E",replace:!0,require:["^ionTabs","^ionTab"],template:'<a ng-class="{\'tab-item-active\': isTabActive(), \'has-badge\':badge, \'tab-hidden\':isHidden()}" class="tab-item"><span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span><i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i><i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i><span class="tab-title" ng-bind-html="title"></span></a>',scope:{title:"@",icon:"@",iconOn:"@",iconOff:"@",badge:"=",hidden:"@",badgeStyle:"@","class":"@"},compile:function(){return function(e,t,n,i){var o=i[0],r=i[1];t[0].removeAttribute("title"),e.selectTab=function(e){e.preventDefault(),o.select(r.$scope,!0)},n.ngClick||t.on("click",function(t){e.$apply(function(){e.selectTab(t)})}),e.isHidden=function(){return"true"===n.hidden||n.hidden===!0?!0:!1},e.getIconOn=function(){return e.iconOn||e.icon},e.getIconOff=function(){return e.iconOff||e.icon},e.isTabActive=function(){return o.selectedTab()===r.$scope}}}}}]),u.constant("$ionicTabsConfig",{position:"",type:""}),u.directive("ionTabs",["$ionicViewService","$ionicTabsDelegate","$ionicTabsConfig",function(e,t,n){return{restrict:"E",scope:!0,controller:"$ionicTabs",compile:function(e){function i(e,n,i,o){var r=t._registerInstance(o,i.delegateHandle);e.$on("$destroy",r),o.$scope=e,o.$element=n,o.$tabsElement=g(n[0].querySelector(".tabs"));var a=n[0];e.$watch(function(){return a.className},function(t){var n=-1!==t.indexOf("tabs-top"),i=-1!==t.indexOf("tabs-item-hide");e.$hasTabs=!n&&!i,e.$hasTabsTop=n&&!i}),e.$on("$destroy",function(){delete e.$hasTabs,delete e.$hasTabsTop})}e.addClass("view");var o=g('<div class="tabs"></div>');return o.append(e.contents()),e.append(o),e.addClass(n.position),e.addClass(n.type),{pre:i}}}}]),u.directive("ionToggle",["$ionicGesture","$timeout",function(){return{restrict:"E",replace:!0,require:"?ngModel",transclude:!0,template:'<div class="item item-toggle"><div ng-transclude></div><label class="toggle"><input type="checkbox"><div class="track"><div class="handle"></div></div></label></div>',compile:function(e,t){var n=e.find("input");return f({name:t.name,"ng-value":t.ngValue,"ng-model":t.ngModel,"ng-checked":t.ngChecked,"ng-disabled":t.ngDisabled,"ng-true-value":t.ngTrueValue,"ng-false-value":t.ngFalseValue,"ng-change":t.ngChange},function(e,t){h(e)&&n.attr(t,e)}),t.toggleClass&&e[0].getElementsByTagName("label")[0].classList.add(t.toggleClass),function(e,t){var n,i,o,r;n=t[0].getElementsByTagName("label")[0],i=n.children[0],o=n.children[1],r=o.children[0];var a=g(i).controller("ngModel");e.toggle=new ionic.views.Toggle({el:n,track:o,checkbox:i,handle:r,onChange:function(){a.$setViewValue(i.checked?!0:!1),e.$apply()}}),e.$on("$destroy",function(){e.toggle.destroy()})}}}}]),u.directive("ionView",["$ionicViewService","$rootScope","$animate",function(){return{restrict:"EA",priority:1e3,require:["^?ionNavBar","^?ionModal"],compile:function(e){return e.addClass("pane"),e[0].removeAttribute("title"),function(e,t,n,i){var o=i[0],r=i[1];if(o&&!r){if(angular.isDefined(n.title)){var a=n.title;o.changeTitle(a,e.$navDirection),n.$observe("title",function(e){o.setTitle(e)})}var s=angular.isDefined(n.hideBackButton)?n.hideBackButton:"false";e.$watch(s,function(e){o.showBackButton(!e)});var c=angular.isDefined(n.hideNavBar)?n.hideNavBar:"false";e.$watch(c,function(e){o.showBar(!e)})}}}}}]),!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.collide=e()}}(function(){return function e(t,n,i){function o(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(r)return r(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,i)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)o(i[a]);return o}({1:[function(e,t){(function(e){(function(){var n,i,o;"undefined"!=typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"undefined"!=typeof e&&null!==e&&e.hrtime?(t.exports=function(){return(n()-o)/1e6},i=e.hrtime,n=function(){var e;return e=i(),1e9*e[0]+e[1]},o=n()):Date.now?(t.exports=function(){return Date.now()-o},o=Date.now()):(t.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(this)}).call(this,e("qhDIRT"))},{qhDIRT:13}],2:[function(e,t){for(var n=e("performance-now"),i="undefined"==typeof window?{}:window,o=["moz","webkit"],r="AnimationFrame",a=i["request"+r],s=i["cancel"+r]||i["cancelRequest"+r],c=0;c<o.length&&!a;c++)a=i[o[c]+"Request"+r],s=i[o[c]+"Cancel"+r]||i[o[c]+"CancelRequest"+r];if(!a||!s){var l=0,u=0,d=[],f=1e3/60;a=function(e){if(0===d.length){var t=n(),i=Math.max(0,f-(t-l));l=i+t,setTimeout(function(){var e=d.slice(0);d.length=0;for(var t=0;t<e.length;t++)e[t].cancelled||e[t].callback(l)},i)}return d.push({handle:++u,callback:e,cancelled:!1}),u},s=function(e){for(var t=0;t<d.length;t++)d[t].handle===e&&(d[t].cancelled=!0)}}t.exports=function(){return a.apply(i,arguments)},t.exports.cancel=function(){s.apply(i,arguments)}},{"performance-now":3}],3:[function(e,t){t.exports=e(1)},{qhDIRT:13}],4:[function(e,t){function n(e,t,n){return Math.max(e,Math.min(t,n))}function i(e){if(!(this instanceof i))return new i(e);e=e||{},this._={id:c(),percent:0,duration:500,isReverse:!1};var t=this._.emitter=new l;this._.onDestroy=function(){t.emit("destroy")},this._.onStop=function(e){t.emit("stop",e),e&&t.emit("complete")},this._.onStart=function(){t.emit("start")},this._.onStep=function(e){t.emit("step",e)},e.duration&&this.duration(e.duration),e.percent&&this.percent(e.percent),e.easing&&this.easing(e.easing),e.reverse&&this.reverse(e.reverse)}function o(e){if("object"==typeof e){var t="string"==typeof e.type&&e.type.toLowerCase().trim();if(!a[t])throw new Error('Invalid easing dynamics object type "'+e.type+'". Available dynamics types: '+Object.keys(a).join(", ")+".");return a[t](e)}if("string"==typeof e){if(e=e.toLowerCase().trim(),0===e.indexOf("cubic-bezier(")){var n=e.replace("cubic-bezier(","").replace(")","").split(",").map(function(e){return e.trim()});return s["cubic-bezier"](n[0],n[1],n[2],n[3])}var i=s[e];if(!i)throw new Error('Invalid easing function "'+e+'". Available easing functions: '+Object.keys(s).join(", ")+".");return s[e]()}return"function"==typeof e?e:void 0}var r=e("./core/timeline"),a=e("./core/dynamics"),s=e("./core/easing-functions"),c=e("./util/uid"),l=e("./util/simple-emitter");t.exports=i,i.prototype={reverse:function(e){return arguments.length?(this._.isReverse=!!e,this):this._.isReverse},easing:function(e){var t=typeof e;return arguments.length?(("function"===t||"string"===t||"object"===t)&&(this._.easing=o(e)),this):this._.easing},percent:function(e){return arguments.length?("number"==typeof e&&(this._.percent=n(0,e,1)),this.isRunning()||this._.onStep(this._getValueForPercent(this._.percent)),this):this._.percent},duration:function(e){return arguments.length?("number"==typeof e&&e>0&&(this._.duration=e),this):this._.duration},isRunning:function(){return!!this._.isRunning},promise:function(){var e=this;return{then:function(t){e.once("stop",t)}}},on:function(e,t){return this._.emitter.on(e,t),this},once:function(e,t){return this._.emitter.once(e,t),this},off:function(e,t){return this._.emitter.off(e,t),this},destroy:function(){return this.stop(),this._.onDestroy(),this.off(),this},stop:function(){return this._.isRunning?(this._.isRunning=!1,r.animationStopped(this),this._.onStop(this._isComplete()),this):void 0},restart:function(e){return this._.isRunning?void 0:(this._.percent=this._getStartPercent(),this.start(!!e))},start:function(e){return this._.isRunning?void 0:(e?this._.onStep(this._getValueForPercent(this._.percent)):this._.isStarting=!0,this._.isRunning=!0,r.animationStarted(this),this._.onStart(),this)},_isComplete:function(){return!this._.isRunning&&this._.percent===this._getEndPercent()},_getEndPercent:function(){return this._.isReverse?0:1},_getStartPercent:function(){return this._.isReverse?1:0},_getValueForPercent:function(e){return this._.easing?this._.easing(e,this._.duration):e},_tick:function(e){var t=this._;t.isStarting?t.isStarting=!1:t.percent=t.isReverse?Math.max(0,t.percent-e/t.duration):Math.min(1,t.percent+e/t.duration),t.onStep(this._getValueForPercent(t.percent)),t.percent===this._getEndPercent()&&this.stop()}}},{"./core/dynamics":6,"./core/easing-functions":7,"./core/timeline":8,"./util/simple-emitter":11,"./util/uid":12}],5:[function(e,t){function n(e){return 1/(200*e)}function i(e,t,i,r){var a=3*e,s=3*(i-e)-a,c=1-a-s,l=3*t,u=3*(r-t)-l,d=1-l-u,f=function(e){return((c*e+s)*e+a)*e},h=function(e){return((d*e+u)*e+l)*e},p=function(e){return(3*c*e+2*s)*e+a},g=function(e,t){var n,i,o,r,a,s;for(o=e,s=0;8>s;s++){if(r=f(o)-e,Math.abs(r)<t)return o;if(a=p(o),Math.abs(a)<1e-6)break;o-=r/a}if(n=0,i=1,o=e,n>o)return n;if(o>i)return i;for(;i>n;){if(r=f(o),Math.abs(r-e)<t)return o;e>r?n=o:i=o,o=.5*(i-n)+n}return o},v=function(e,t){return h(g(e,t))};return function(e,t){return v(e,n(+t||o))}}t.exports={linear:i(0,0,1,1),ease:i(.25,.1,.25,1),easeIn:i(.42,0,1,1),easeOut:i(0,0,.58,1),easeInOut:i(.42,0,.58,1),cubicBezier:function(e,t,n,o){return i(e,t,n,o)}};var o=400},{}],6:[function(e,t){function n(e){return e=o({},r,e||{}),function(t){var n,i,o,r,a,s,c,l,u,d,f,h,p,g=e;return c=Math.max(1,e.frequency),l=Math.pow(20,e.friction/100),d=e.anticipationSize/100,s=Math.max(0,d),u=t/(1-d)-d/(1-d),d>t?(n=function(e){var t,n,i,o,r;return t=.8,o=d/(1-d),r=0,i=(o-t*r)/(o-r),n=(t-i)/o,n*e*g.anticipationStrength/100+i},p=d/(1-d)-d/(1-d),h=0/(1-d)-d/(1-d),a=Math.acos(1/n(p)),o=(Math.acos(1/n(h))-a)/(c*-d)):(n=function(e){return Math.pow(l/10,-e)*(1-e)},a=0,o=1),i=n(u),r=c*(t-d)*o+a,f=1-i*Math.cos(r)}}function i(e){function t(){var t,n,i,o,r;for(i=Math.min(e.bounce/100,80),r=e.gravity/100,n=Math.sqrt(2/r),o={a:-n,b:n,H:1},e.initialForce&&(o.a=0,o.b=2*o.b);o.H>.001;)t=o.b-o.a,o={a:o.b,b:o.b+t*i,H:o.H*i*i};return o.b}function n(){var n,i,o,r,a,c;for(n=t(),a=e.gravity/100*n*n,o=Math.min(e.bounce/100,80),i=Math.sqrt(2/a),s=[],r={a:-i,b:i,H:1},e.initialForce&&(r.a=0,r.b=2*r.b),s.push(r),c=[];r.b<1&&r.H>.001;)n=r.b-r.a,r={a:r.b,b:r.b+n*o,H:r.H*o*o},c.push(s.push(r));return c}function i(t,n,i,o){var r,a,s;return r=n-t,s=2/r*o-1-2*t/r,a=s*s*i-i+1,e.initialForce&&(a=1-a),a}function r(t){var n,o,r,a,c;for(n=e.bounce/100,r=e.gravity,a=0,o=s[a];!(t>=o.a&&t<=o.b)&&(a+=1,o=s[a]););return c=o?i(o.a,o.b,o.H,t):e.initialForce?0:1}e=o({},a,e||{});var s=[];return n(),r}var o=e("../util/extend");t.exports={spring:n,gravity:i};var r={frequency:15,friction:200,anticipationStrength:0,anticipationSize:0},a={bounce:40,gravity:1e3,initialForce:!1}},{"../util/extend":10}],7:[function(e,t){var n=(e("./dynamics"),e("./bezier"));t.exports={linear:function(){return function(e,t){return n.linear(e,t)}},ease:function(){return function(e,t){return n.ease(e,t)}},"ease-in":function(){return function(e,t){return n.easeIn(e,t)}},"ease-out":function(){return function(e,t){return n.easeOut(e,t)}},"ease-in-out":function(){return function(e,t){return n.easeInOut(e,t)}},"cubic-bezier":function(e,t,i,o){var r=n.cubicBezier(e,t,i,o);return function(e,t){return r(e,t)}}}},{"./bezier":5,"./dynamics":6}],8:[function(e,t){var n=e("raf"),i=e("performance-now"),o=t.exports={_running:{},animationStarted:function(e){o._running[e._.id]=e,o.isTicking||o.tick()},animationStopped:function(e){delete o._running[e._.id],o.maybeStopTicking()},tick:function(){function e(){o._rafId=n(e);var r=i(),a=r-t;for(var s in o._running)o._running[s]._tick(a);t=r}var t=i();o.isTicking=!0,o._rafId=n(e)},maybeStopTicking:function(){o.isTicking&&!Object.keys(o._running).length&&(n.cancel(o._rafId),o.isTicking=!1)}}},{"performance-now":1,raf:2}],9:[function(e,t){t.exports={animator:e("./animator")}},{"./animator":4}],10:[function(e,t){t.exports=function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++){var i=t[n];if(i)for(var o in i)e[o]=i[o]}return e}},{}],11:[function(e,t){function n(){}t.exports=n,n.prototype={listeners:[],on:function(e,t){"function"==typeof t&&(this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t))},once:function(e,t){function n(){i.off(e,t),i.off(e,n)}var i=this;this.on(e,t),this.on(e,n)},emit:function(e,t){var n=this.listeners[e]||[],i=0,o=n.length;if(2===arguments.length)for(i;o>i;i++)n[i]&&n[i](t);else for(i;o>i;i++)n[i]&&n[i]()},off:function(e,t){if(e){var n=this.listeners[e];if(n)if(t){var i=n.indexOf(t);n.splice(i,1)}else n.length=0}else for(var o in this.listeners)this.off(o)}}},{}],12:[function(e,t){var n=[];t.exports=function(){for(var e,t=n.length;t;){if(t--,e=n[t].charCodeAt(0),57==e)return n[t]="A",n.join("");if(90!=e)return n[t]=String.fromCharCode(e+1),n.join("");n[t]="0"}return n.unshift("0"),n.join("")}},{}],13:[function(e,t){function n(){}var i=t.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=n,i.addListener=n,i.once=n,i.off=n,i.removeListener=n,i.removeAllListeners=n,i.emit=n,i.binding=function(){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(){throw new Error("process.chdir is not supported")}},{}]},{},[9])(9)})}();