ionic-cordova-gulp-seed
Version:
Ionic & Cordova & Gulp seed with organized code, tests, bower support and some other stuff. Originated from ionic-angular-cordova-seed.
16 lines (15 loc) • 99.9 kB
JavaScript
/*!
* Copyright 2014 Drifty Co.
* http://drifty.com/
*
* Ionic, v1.0.0-beta.14
* 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,t){return[function(){return{priority:"99",link:function(n,i,o){o.$observe(e,function(e){e||i[0].removeAttribute(t)})}}}]}function t(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 n(){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 i(e){return["$document","$timeout",function(t,n){return{restrict:"E",controller:"$ionicHeaderBar",compile:function(i){function o(t,n,i,o){e?(t.$watch(function(){return n[0].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}),o.align(),t.$on("$ionicHeader.align",function(){ionic.requestAnimationFrame(o.align)})):(t.$watch(function(){return n[0].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)}))}return i.addClass(e?"bar bar-header":"bar bar-footer"),n(function(){e&&t[0].getElementsByClassName("tabs-top").length&&i.addClass("has-tabs-top")}),{pre:o}}}}]}function o(e){return e.clientHeight}function r(e){e.stopPropagation()}var a={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})}},s=angular.module("ionic",["ngAnimate","ngSanitize","ui.router"]),c=angular.extend,l=angular.forEach,u=angular.isDefined,d=(angular.isNumber,angular.isString),f=angular.element;s.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 ng-class="cssClass" buttons="buttons"></ion-action-sheet>')(s),l=f(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"),i(function(){a.removeClass("action-sheet-open")},400),s.$deregisterBackButton(),u(),n.removeClass(c,"active").then(function(){s.$destroy(),c.remove(),s.cancel.$scope=l=null,(e||angular.noop)()}))},s.showSheet=function(e){s.removed||(a.append(c).addClass("action-sheet-open"),n.addClass(c,"active").then(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)},b),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}}]),f.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},f.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},s.factory("$$ionicAttachDrag",[function(){function e(e,t,n){function i(e){h||s.onDragStart()!==!1&&(h={startX:e.gesture.center.pageX,startY:e.gesture.center.pageY,distance:s.getDistance()})}function o(e){if(h){var t=h.startX-e.gesture.center.pageX,n=h.startY-e.gesture.center.pageY,i="up"===e.gesture.direction||"down"===e.gesture.direction;if(i&&Math.abs(n)>2*Math.abs(t))return void r(e);Math.abs(t)>2*Math.abs(n)&&(f=!0);var o=a(e.gesture.center.pageX);s.onDrag(o)}}function r(e){if(h){var t=a(e.gesture.center.pageX);n.onDragEnd(t,e.gesture.velocityX),h=null}}function a(e){var t=h.startX-e,n=t/h.distance;return n}var s=c({},{getDistance:function(){return s.element.prop("offsetWidth")},onDragStart:angular.noop,onDrag:angular.noop,onDragEnd:angular.noop},n),l=ionic.onGesture("dragstart",i,t[0]),u=ionic.onGesture("drag",o,t[0]),d=ionic.onGesture("dragend",r,t[0]);e.$on("$destroy",function(){ionic.offGesture(l,"dragstart",i),ionic.offGesture(u,"drag",o),ionic.offGesture(d,"dragend",r)});var f=!1;t.on("touchmove pointermove mousemove",function(e){f&&e.preventDefault()}),t.on("touchend mouseup mouseleave",function(){f=!1});var h}return e}]),s.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=f('<div class="backdrop">'),a=0;return e[0].body.appendChild(r[0]),{retain:n,release:i,getElement:o,_element:r}}]),s.factory("$ionicBind",["$parse","$interpolate",function(e,t){var n=/^\s*([@=&])(\??)\s*(\w*)\s*$/;return function(i,o,r){l(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)}}})}}]),s.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}}}]),s.factory("$ionicClickBlock",["$document","$ionicBody","$timeout",function(e,t,n){function i(){s&&(r?r.classList.remove(c):(r=e[0].createElement("div"),r.className="click-block",t.append(r)),s=!1)}function o(){r&&r.classList.add(c)}var r,a,s,c="click-block-hide";return{show:function(e){s=!0,n.cancel(a),a=n(this.hide,e||310),ionic.requestAnimationFrame(i)},hide:function(){s=!1,n.cancel(a),ionic.requestAnimationFrame(o)}}}]),s.factory("$collectionDataSource",["$cacheFactory","$parse","$rootScope",function(e,t,n){function i(e){e.css(ionic.CSS.TRANSFORM,"translate3d(-2000px,-2000px,0)")}function o(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 o.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){var t;return(t=this.attachedItems[e])||((t=this.backupItemsArray.pop())?ionic.Utils.reconnectScope(t.scope):t=this.createItem()),t},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),i=this.data[e];return(t.index!==e||t.scope[this.keyExpr]!==i)&&(t.index=t.scope.$index=e,t.scope[this.keyExpr]=i,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)),n.$$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(e){delete this.attachedItems[e.index],e.isOutside?i(e.element):this.backupItemsArray.length>=this.BACKUP_ITEMS_LENGTH?this.destroyItem(e):(this.backupItemsArray.push(e),i(e.element),ionic.Utils.disconnectScope(e.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"}),i(e.element)})}},o}]),s.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}]),s.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)}}}]),s.factory("$ionicHistory",["$rootScope","$state","$location","$window","$timeout","$ionicViewSwitcher","$ionicNavViewDelegate",function(e,t,n,i,o,r,a){function s(e){return e?L.views[e]:null}function l(e){return e?s(e.backViewId):null}function u(e){return e?s(e.forwardViewId):null}function d(e){return e?L.histories[e]:null}function f(e){var t=h(e);return L.histories[t.historyId]||(L.histories[t.historyId]={historyId:t.historyId,parentHistoryId:h(t.scope.$parent).historyId,stack:[],cursor:-1}),d(t.historyId)}function h(t){for(var n=t;n;){if(n.hasOwnProperty("$historyId"))return{historyId:n.$historyId,scope:n};n=n.$parent}return{historyId:"root",scope:e}}function p(e){L.currentView=s(e),L.backView=l(L.currentView),L.forwardView=u(L.currentView)}function v(){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()}function g(){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}function m(e){return e&&e.length&&/ion-side-menus|ion-tabs/i.test(e[0].tagName)}var $,w,b,y,S="initialView",k="newView",T="moveBack",C="moveForward",I="back",B="forward",x="enter",V="exit",E="swap",A="none",D=0,L={histories:{root:{historyId:"root",parentHistoryId:null,stack:[],cursor:-1}},views:{},backView:null,forwardView:null,currentView:null},P=function(){};return P.prototype.initialize=function(e){if(e){for(var t in e)this[t]=e[t];return this}return null},P.prototype.go=function(){return this.stateName?t.go(this.stateName,this.stateParams):this.url&&this.url!==n.url()?L.backView===this?i.history.go(-1):L.forwardView===this?i.history.go(1):void n.url(this.url):null},P.prototype.destroy=function(){this.scope&&(this.scope.$destroy&&this.scope.$destroy(),this.scope=null)},{register:function(e,t){var i,a,c,u=v(),m=f(e),P=L.currentView,H=L.backView,N=L.forwardView,_=null,O=null,M=A,R=m.historyId,U=n.url();if($!==u&&($=u,D++),y)_=y.viewId,O=y.action,M=y.direction,y=null;else if(H&&H.stateId===u)_=H.viewId,R=H.historyId,O=T,H.historyId===P.historyId?M=I:P&&(M=V,i=d(H.historyId),i&&i.parentHistoryId===P.historyId?M=x:(i=d(P.historyId),i&&i.parentHistoryId===m.parentHistoryId&&(M=E)));else if(N&&N.stateId===u)_=N.viewId,R=N.historyId,O=C,N.historyId===P.historyId?M=B:P&&(M=V,P.historyId===m.parentHistoryId?M=x:(i=d(P.historyId),i&&i.parentHistoryId===m.parentHistoryId&&(M=E))),i=h(e),N.historyId&&i.scope&&(i.scope.$historyId=N.historyId,R=N.historyId);else if(P&&P.historyId!==R&&m.cursor>-1&&m.stack.length>0&&m.cursor<m.stack.length&&m.stack[m.cursor].stateId===u){var z=m.stack[m.cursor];_=z.viewId,R=z.historyId,O=T,M=E,i=d(P.historyId),i&&i.parentHistoryId===R?M=V:(i=d(R),i&&i.parentHistoryId===P.historyId&&(M=x)),i=s(z.backViewId),i&&z.historyId!==i.historyId&&(m.stack[m.cursor].backViewId=P.viewId)}else{if(c=r.createViewEle(t),this.isAbstractEle(c,t))return{action:"abstractView",direction:A,ele:c};if(_=ionic.Utils.nextUid(),P){if(P.forwardViewId=_,O=k,N&&P.stateId!==N.stateId&&P.historyId===N.historyId&&(i=d(N.historyId))){for(a=i.stack.length-1;a>=N.index;a--)i.stack[a].destroy(),i.stack.splice(a);R=N.historyId}m.historyId===P.historyId?M=B:P.historyId!==m.historyId&&(M=x,i=d(P.historyId),i&&i.parentHistoryId===m.parentHistoryId?M=E:(i=d(i.parentHistoryId),i&&i.historyId===m.historyId&&(M=V)))}else O=S;2>D&&(M=A),L.views[_]=this.createView({viewId:_,index:m.stack.length,historyId:m.historyId,backViewId:P&&P.viewId?P.viewId:null,forwardViewId:null,stateId:u,stateName:this.currentStateName(),stateParams:g(),url:U}),m.stack.push(L.views[_])}if(o.cancel(b),w){if(w.disableAnimate&&(M=A),w.disableBack&&(L.views[_].backViewId=null),w.historyRoot){for(a=0;a<m.stack.length;a++)m.stack[a].viewId===_?(m.stack[a].index=0,m.stack[a].backViewId=m.stack[a].forwardViewId=null):delete L.views[m.stack[a].viewId];m.stack=[L.views[_]]}w=null}if(p(_),L.backView&&R==L.backView.historyId&&u==L.backView.stateId&&U==L.backView.url)for(a=0;a<m.stack.length;a++)if(m.stack[a].viewId==_){O="dupNav",M=A,m.stack[a-1].forwardViewId=L.forwardView=null,L.currentView.index=L.backView.index,L.currentView.backViewId=L.backView.backViewId,L.backView=l(L.backView),m.stack.splice(a,1);break}return m.cursor=L.currentView.index,{viewId:_,action:O,direction:M,historyId:R,enableBack:!(!L.backView||L.backView.historyId!==L.currentView.historyId),isHistoryRoot:0===L.currentView.index,ele:c}},registerHistory:function(e){e.$historyId=ionic.Utils.nextUid()},createView:function(e){var t=new P;return t.initialize(e)},getViewById:s,viewHistory:function(){return L},currentView:function(e){return arguments.length&&(L.currentView=e),L.currentView},currentHistoryId:function(){return L.currentView?L.currentView.historyId:null},currentTitle:function(e){return L.currentView?(arguments.length&&(L.currentView.title=e),L.currentView.title):void 0},backView:function(e){return arguments.length&&(L.backView=e),L.backView},backTitle:function(){return L.backView?L.backView.title:void 0},forwardView:function(e){return arguments.length&&(L.forwardView=e),L.forwardView},currentStateName:function(){return t&&t.current?t.current.name:null},isCurrentStateNavView:function(e){return!!(t&&t.current&&t.current.views&&t.current.views[e])},goToHistoryRoot:function(e){if(e){var t=d(e);if(t&&t.stack.length){if(L.currentView&&L.currentView.viewId===t.stack[0].viewId)return;y={viewId:t.stack[0].viewId,action:T,direction:I},t.stack[0].go()}}},goBack:function(){L.backView&&L.backView.go()},clearHistory:function(){var e=L.histories,t=L.currentView;if(e)for(var n in e)e[n].stack&&(e[n].stack=[],e[n].cursor=-1),t&&t.historyId===n?(t.backViewId=t.forwardViewId=null,e[n].stack.push(t)):e[n].destroy&&e[n].destroy();for(var i in L.views)i!==t.viewId&&delete L.views[i];t&&p(t.viewId)},clearCache:function(){a._instances.forEach(function(e){e.clearCache()})},nextViewOptions:function(e){return arguments.length&&(o.cancel(b),null===e?w=e:(w=w||{},c(w,e),w.expire&&(b=o(function(){w=null},w.expire)))),w},isAbstractEle:function(e,t){return t&&t.$$state&&t.$$state.self.abstract?!0:!(!e||!m(e)&&!m(e.children()))},isActiveScope:function(e){if(!e)return!1;for(var t,n=e,i=this.currentHistoryId();n;){if(n.$$disconnected)return!1;if(!t&&n.hasOwnProperty("$historyId")&&(t=!0),i){if(n.hasOwnProperty("$historyId")&&i==n.$historyId)return!0;if(n.hasOwnProperty("$activeHistoryId")&&i==n.$activeHistoryId){if(n.hasOwnProperty("$historyId"))return!0;if(!t)return!0}}t&&n.hasOwnProperty("$activeHistoryId")&&(t=!1),n=n.$parent}return i?"root"==i:!0}}}]).run(["$rootScope","$state","$location","$document","$ionicPlatform","$ionicHistory",function(e,t,n,i,o,r){function a(e){var t=r.backView();return t?t.go():ionic.Platform.exitApp(),e.preventDefault(),!1}e.$on("$ionicView.beforeEnter",function(){ionic.keyboard&&ionic.keyboard.hide&&ionic.keyboard.hide()}),e.$on("$ionicHistory.change",function(e,i){if(i){var o=r.viewHistory(),a=i.historyId?o.histories[i.historyId]:null;if(a&&a.cursor>-1&&a.cursor<a.stack.length){var s=a.stack[a.cursor];return s.go(i)}!i.url&&i.uiSref&&(i.url=t.href(i.uiSref)),i.url&&(0===i.url.indexOf("#")&&(i.url=i.url.replace("#","")),i.url!==n.url()&&n.url(i.url))}}),e.$ionicGoBack=function(){r.goBack()},e.$on("$ionicView.afterEnter",function(e,t){t&&t.title&&(i[0].title=t.title)}),o.registerBackButtonAction(a,m)}]),s.provider("$ionicConfig",function(){function e(e,i){a.platform[e]=i,o.platform[e]={},t(a,a.platform[e]),n(a.platform[e],o.platform[e],"")}function t(e,n){for(var i in e)i!=r&&e.hasOwnProperty(i)&&(angular.isObject(e[i])?(u(n[i])||(n[i]={}),t(e[i],n[i])):u(n[i])||(n[i]=null))}function n(e,t,o){l(e,function(s,c){angular.isObject(e[c])?(t[c]={},n(e[c],t[c],o+"."+c)):t[c]=function(n){if(arguments.length)return e[c]=n,t;if(e[c]==r){var s=i(a.platform,ionic.Platform.platform()+o+"."+c);return s||s===!1?s:i(a.platform,"default"+o+"."+c)}return e[c]}})}function i(e,t){t=t.split(".");for(var n=0;n<t.length;n++){if(!e||!u(e[t[n]]))return null;e=e[t[n]]}return e}var o=this;o.platform={};var r="platform",a={views:{maxCache:r,forwardCache:r,transition:r},navBar:{alignTitle:r,positionPrimaryButtons:r,positionSecondaryButtons:r,transition:r},backButton:{icon:r,text:r,previousTitleText:r},form:{checkbox:r},tabs:{style:r,position:r},templates:{maxPrefetch:r},platform:{}};n(a,o,""),e("default",{views:{maxCache:10,forwardCache:!1,transition:"ios"},navBar:{alignTitle:"center",positionPrimaryButtons:"left",positionSecondaryButtons:"right",transition:"view"},backButton:{icon:"ion-ios7-arrow-back",text:"Back",previousTitleText:!0},form:{checkbox:"circle"},tabs:{style:"standard",position:"bottom"},templates:{maxPrefetch:30}}),e("ios",{}),e("android",{views:{transition:"android"},navBar:{alignTitle:"left",positionPrimaryButtons:"right",positionSecondaryButtons:"right"},backButton:{icon:"ion-arrow-left-c",text:!1,previousTitleText:!1},form:{checkbox:"square"},tabs:{style:"striped",position:"top"}}),o.transitions={views:{},navBar:{}},o.transitions.views.ios=function(e,t,n,i){function o(e,t,n){var o={};o[ionic.CSS.TRANSITION_DURATION]=i?"":0,o.opacity=t,o[ionic.CSS.TRANSFORM]="translate3d("+n+"%,0,0)",ionic.DomUtil.cachedStyles(e,o)}return i=i&&("forward"==n||"back"==n),{run:function(i){"forward"==n?(o(e,1,99*(1-i)),o(t,1-.1*i,-33*i)):"back"==n?(o(e,1-.1*(1-i),-33*(1-i)),o(t,1,100*i)):(o(e,1,0),o(t,0,0))},shouldAnimate:i}},o.transitions.navBar.ios=function(e,t,n,i){function o(e,t,n,o){var r={};r[ionic.CSS.TRANSITION_DURATION]=i?"":0,r.opacity=1===t?"":t,e.setCss("buttons-left",r),e.setCss("buttons-right",r),e.setCss("back-button",r),r[ionic.CSS.TRANSFORM]="translate3d("+o+"px,0,0)",e.setCss("back-text",r),r[ionic.CSS.TRANSFORM]="translate3d("+n+"px,0,0)",e.setCss("title",r)}function r(e,t,n){if(e){var i=(e.titleTextX()+e.titleWidth())*(1-n),r=t&&(t.titleTextX()-e.backButtonTextLeft())*(1-n)||0;o(e,n,i,r)}}function a(e,t,n){if(e){var i=(-(e.titleTextX()-t.backButtonTextLeft())-e.titleLeftRight())*n;o(e,1-n,i,0)}}return i=i&&("forward"==n||"back"==n),{run:function(i){var o=e.controller(),s=t&&t.controller();"back"==n?(a(o,s,1-i),r(s,o,1-i)):(r(o,s,i),a(s,o,i))},shouldAnimate:i}},o.transitions.views.android=function(e,t,n,i){function o(e,t){var n={};n[ionic.CSS.TRANSITION_DURATION]=i?"":0,n[ionic.CSS.TRANSFORM]="translate3d("+t+"%,0,0)",ionic.DomUtil.cachedStyles(e,n)}return i=i&&("forward"==n||"back"==n),{run:function(i){"forward"==n?(o(e,99*(1-i)),o(t,-100*i)):"back"==n?(o(e,-100*(1-i)),o(t,100*i)):(o(e,0),o(t,0))},shouldAnimate:i}},o.transitions.navBar.android=function(e,t,n,i){function o(e,t){if(e){var n={};n.opacity=1===t?"":t,e.setCss("buttons-left",n),e.setCss("buttons-right",n),e.setCss("back-button",n),e.setCss("back-text",n),e.setCss("title",n)}}return i=i&&("forward"==n||"back"==n),{run:function(n){o(e.controller(),n),o(t&&t.controller(),1-n)},shouldAnimate:!0}},o.transitions.views.none=function(e,t){return{run:function(n){o.transitions.views.android(e,t,!1,!1).run(n)}}},o.transitions.navBar.none=function(e,t){return{run:function(n){o.transitions.navBar.ios(e,t,!1,!1).run(n),o.transitions.navBar.android(e,t,!1,!1).run(n)}}},o.setPlatformConfig=e,o.$get=function(){return o}});var h='<div class="loading-container"><div class="loading"></div></div>',p="$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().",v="$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().",g="$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: 'my content' }).";s.constant("$ionicLoadingConfig",{template:'<i class="icon ion-loading-d"></i>'}).factory("$ionicLoading",["$ionicLoadingConfig","$ionicBody","$ionicTemplateLoader","$ionicBackdrop","$timeout","$q","$log","$compile","$ionicPlatform","$rootScope",function(e,t,n,i,o,r,s,l,u,d){function f(){return w||(w=n.compile({template:h,appendTo:t.get()}).then(function(e){var a=e;return e.show=function(e){var s=e.templateUrl?n.load(e.templateUrl):r.when(e.template||e.content||"");a.scope=e.scope||a.scope,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)),b(),b=u.registerBackButtonAction(angular.noop,S),s.then(function(e){if(e){var n=a.element.children();n.html(e),l(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(){b(),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})),w}function m(t){t=c({},e||{},t||{});var n=t.delay||t.showDelay||0;return k&&o.cancel(k),k=o(angular.noop,n),k.then(f).then(function(e){return t.hideOnStateChange&&(y=d.$on("$stateChangeSuccess",$)),e.show(t)}),{hide:a.method(p,s.error,$),show:a.method(v,s.error,function(){m(t)}),setContent:a.method(g,s.error,function(e){f().then(function(t){t.show({template:e})})})}}function $(){y(),o.cancel(k),f().then(function(e){e.hide()})}var w,b=angular.noop,y=angular.noop,k=r.when();return{show:m,hide:$,_getLoader:f}}]),s.factory("$ionicModal",["$rootScope","$ionicBody","$compile","$timeout","$ionicPlatform","$ionicTemplateLoader","$q","$log",function(e,t,n,i,o,r,a,s){var l=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=f(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),ionic.on("resize",function(){ionic.off("resize",null,window),n.positionView(e,r)},window)),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,w),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"),n.scope.$broadcast("$ionicHeader.align")},20),i(function(){n.$el.on("click",function(e){n.backdropClickToClose&&e.target===n.el&&n.hide()})},400)},hide:function(){var e=this,n=f(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),e.positionView&&ionic.off("resize",null,window),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}}),u=function(t,i){var o=i.scope&&i.scope.$new()||e.$new(!0);i.viewType=i.viewType||"modal",c(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 l(i);return a.scope=o,i.scope||(o[i.viewType]=a),a};return{fromTemplate:function(e,t){var n=u(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=u(e,t||{});return i&&i(n),n})}}}]),s.service("$ionicNavBarDelegate",ionic.DelegateService(["align","showBackButton","showBar","title","changeTitle","setTitle","getTitle","back","getPreviousTitle"])),s.service("$ionicNavViewDelegate",ionic.DelegateService(["clearCache"]));var m=100,$=150,w=200,b=300,y=400,S=500;s.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)},on:function(e,t){return ionic.Platform.ready(function(){document.addEventListener(e,t,!1)}),function(){ionic.Platform.ready(function(){document.removeEventListener(e,t)})}},ready:function(t){var n=e.defer();return ionic.Platform.ready(function(){n.resolve(),t&&t()}),n.promise}};return t}]}}),s.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,h={left:s.left+s.width/2-c/2},p=f(o[0].querySelector(".popover-arrow"));h.left<r?h.left=r:h.left+c+r>u&&(h.left=u-c-r),s.top+s.height+l>d?(h.top=s.top-l,o.addClass("popover-bottom")):(h.top=s.top+s.height,o.removeClass("popover-bottom")),p.css({left:s.left+s.width/2-p.prop("offsetWidth")/2-h.left+"px"}),o.css({top:h.top+"px",left:h.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(a,n||{}))},fromTemplateUrl:function(t,n){return e.fromTemplateUrl(t,ionic.Utils.extend(a,n||{}))}}}]);var k='<div class="popup-container" ng-class="cssClass"><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" ng-show="buttons.length"><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>';s.factory("$ionicPopup",["$ionicTemplateLoader","$ionicBackdrop","$q","$timeout","$rootScope","$ionicBody","$compile","$ionicPlatform",function(e,t,n,i,o,r,a,s){function l(t){t=c({scope:null,title:"",buttons:[]},t||{});var o=e.compile({template:k,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 l=f(o.element[0].querySelector(".popup-body"));return r?(l.html(r),a(l.contents())(o.scope)):l.remove(),c(o.scope,{title:t.title,buttons:t.buttons,subTitle:t.subTitle,cssClass:t.cssClass,$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"),h(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 u(){$[0]&&$[0].responseDeferred.resolve()}function d(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(u,y)),$.unshift(e),e.show(),e.responseDeferred.notify({close:c.close}),e.responseDeferred.promise.then(function(n){var o=$.indexOf(e);-1!==o&&$.splice(o,1),e.remove();var a=$[0];return a?a.show():(i(function(){r.removeClass("popup-open")},400),i(function(){t.release()},m.stackPushDelay||0),(w._backButtonActionDone||angular.noop)()),n})});return c.close=n,c}function h(e){var t=e[0].querySelector("[autofocus]");t&&t.focus()}function p(e){return d(c({buttons:[{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function v(e){return d(c({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 g(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),d(c({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:d,alert:p,confirm:v,prompt:g,_createPopup:l,_popupStack:$};return w}]),s.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)}}}}]),s.service("$ionicScrollDelegate",ionic.DelegateService(["resize","scrollTop","scrollBottom","scrollTo","scrollBy","zoomTo","zoomBy","getScrollPosition","anchorScroll","getScrollView"])),s.service("$ionicSideMenuDelegate",ionic.DelegateService(["toggleLeft","toggleRight","getOpenRatio","isOpen","isOpenLeft","isOpenRight","canDragContent","edgeDragThreshold"])),s.service("$ionicSlideBoxDelegate",ionic.DelegateService(["update","slide","select","enableSlide","previous","next","stop","autoPlay","start","currentIndex","selected","slidesCount","count","loop"])),s.service("$ionicTabsDelegate",ionic.DelegateService(["select","selectedIndex"])),function(){var e=[];s.factory("$ionicTemplateCache",["$http","$templateCache","$timeout",function(t,n,i){function o(e){return"undefined"==typeof e?r():(d(e)&&(e=[e]),l(e,function(e){s.push(e)}),void(a&&r()))}function r(){if(o._runCount++,a=!0,0!==s.length){for(var e=0;4>e&&(template=s.pop());)d(template)&&t.get(template,{cache:n}),e++;s.length&&i(r,1e3)}}var a,s=e;return o._runCount=0,o}]).config(["$stateProvider","$ionicConfigProvider",function(t,n){var i=t.state;t.state=function(o,r){if("object"==typeof r){var a=r.prefetchTemplate!==!1&&e.length<n.templates.maxPrefetch();if(a&&d(r.templateUrl)&&e.push(r.templateUrl),angular.isObject(r.views))for(var s in r.views)a=r.views[s].prefetchTemplate!==!1&&e.length<n.templates.maxPrefetch(),a&&d(r.views[s].templateUrl)&&e.push(r.views[s].templateUrl)}return i.call(t,o,r)}}]).run(["$ionicTemplateCache",function(e){e()}])}(),s.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=c({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=f("<div>").html(i).contents();return n.controller&&(r=t(n.controller,c(n.locals,{$scope:a})),s.children().data("$ngControllerController",r)),n.appendTo&&f(n.appendTo).append(s),e(s)(a),{element:s,scope:a}})}return{load:a,compile:s}}]),s.factory("$ionicViewService",["$ionicHistory","$log",function(e,t){function n(e,n){t.warn("$ionicViewService"+e+" is deprecated, please use $ionicHistory"+n+" instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/")}n("","");var i={getCurrentView:"currentView",getBackView:"backView",getForwardView:"forwardView",getCurrentStateName:"currentStateName",nextViewOptions:"nextViewOptions",clearHistory:"clearHistory"};return l(i,function(t,o){i[o]=function(){return n("."+o,"."+t),e[t].apply(this,arguments)}}),i}]),s.factory("$ionicViewSwitcher",["$timeout","$document","$q","$ionicClickBlock","$ionicConfig","$ionicNavBarDelegate",function(e,t,n,i,o,r){function a(e,t){return s(e).abstract?s(e).name:t?t.stateId||t.viewId:ionic.Utils.nextUid()}function s(e){return e&&e.$$state&&e.$$state.self||{}}function u(e,t,n,i){var r=s(e),a=v||E(t,"view-transition")||r.viewTransition||o.views.transition()||"ios",l=o.navBar.transition();return n=g||E(t,"view-direction")||r.viewDirection||n||"none",c(d(i),{transition:a,navBarTransition:"view"===l?a:l,direction:n,shouldAnimate:"none"!==a&&"none"!==n})}function d(e){return e=e||{},{viewId:e.viewId,historyId:e.historyId,stateId:e.stateId,stateName:e.stateName,stateParams:e.stateParams}}function h(e,t){return arguments.length>1?void E(e,T,t):E(e,T)}function p(e){if(e&&e.length){var t=e.scope();t&&(t.$emit("$ionicView.unloaded",e.data(k)),t.$destroy()),e.remove()}}var v,g,m="webkitTransitionEnd transitionend",$="$noCache",w="$destroyEle",b="$eleId",y="$accessed",S="$fallbackTimer",k="$viewData",T="nav-view",C="active",I="cached",B="stage",x=0;ionic.transition=ionic.transition||{},ionic.transition.isActive=!1;var V,E=ionic.DomUtil.cachedAttr,A=[],D={create:function(t,l,f,T){var V,L,P,H=++x,N={init:function(e,t){D.isTransitioning(!0),N.loadViewElements(e),N.render(e,function(){t&&t()})},loadViewElements:function(e){for(var n,i=t.getViewElements(),o=a(l,f),r=t.activeEleId(),s=0,c=i.length;c>s&&(n=i.eq(s),n.data(b)===o?n.data($)?(n.data(b,o+ionic.Utils.nextUid()),n.data(w,!0)):V=n:n.data(b)===r&&(L=n),!V||!L);s++);P=!!V,P||(V=e.ele||D.createViewEle(l),V.data(b,o)),t.activeEleId(o),e.ele=null},render:function(e,n){if(L&&ionic.Utils.disconnectScope(L.scope()),P)ionic.Utils.reconnectScope(V.scope());else{h(V,B);var i=u(l,V,e.direction,f),r=o.transitions.views[i.transition]||o.transitions.views.none;r(V,null,i.direction,!0).run(0),V.data(k,{viewId:i.viewId,historyId:i.historyId,stateName:i.stateName,stateParams:i.stateParams}),(s(l).cache===!1||"false"===s(l).cache||"false"==V.attr("cache-view")||0===o.views.maxCache())&&V.data($,!0);var a=t.appendViewElement(V,l);delete i.direction,delete i.transition,a.$emit("$ionicView.loaded",i)}V.data(y,Date.now()),n&&n()},transition:function(a,s){function p(){h(V,_.shouldAnimate?"entering":C),h(L,_.shouldAnimate?"leaving":I),_.run(1),r._instances.forEach(function(e){e.triggerTransitionStart(H)}),_.shouldAnimate||$()}function $(){$.x||($.x=!0,V.off(m,$),e.cancel(V.data(S)),L&&e.cancel(L.data(S)),N.emit("after",b,y),w.resolve(t),H===x&&(n.all(A).then(D.transitionEnd),N.cleanup(b)),r._instances.forEach(function(e){e.triggerTransitionEnd()}),v=g=f=T=V=L=null)}var w=n.defer();A.push(w.promise);var b=u(l,V,a,f),y=c(c({},b),d(T));b.transitionId=y.transitionId=H,b.fromCache=!!P,b.enableBack=!!s,E(V.parent(),"nav-view-transition",b.transition),E(V.parent(),"nav-view-direction",b.direction),e.cancel(V.data(S)),N.emit("before",b,y);var k=o.transitions.views[b.transition]||o.transitions.views.none,_=k(V,L,b.direction,b.shouldAnimate);_.shouldAnimate&&(V.on(m,$),V.data(S,e($,1e3)),i.show()),h(V,B),_.run(0),e(p,16)},emit:function(e,t,n){var i=V.scope();i&&(i.$emit("$ionicView."+e+"Enter",t),"after"==e&&i.$emit("$ionicView.enter",t)),L&&(i=L.scope(),i&&(i.$emit("$ionicView."+e+"Leave",n),"after"==e&&i.$emit("$ionicView.leave",n)))},cleanup:function(e){L&&"back"==e.direction&&!o.views.forwardCache()&&p(L);var n,i,r,a=t.getViewElements(),s=a.length,c=s-1>o.views.maxCache(),l=Date.now();for(n=0;s>n;n++)i=a.eq(n),c&&i.data(y)<l?(l=i.data(y),r=a.eq(n)):i.data(w)&&h(i)!=C&&p(i);p(r),V.data($)&&V.data(w,!0)},enteringEle:function(){return V},leavingEle:function(){return L}};return N},transitionEnd:function(e){l(e,function(e){e.transitionEnd()}),D.isTransitioning(!1),i.hide(),A=[]},nextTransition:function(e){v=e},nextDirection:function(e){g=e},isTransitioning:function(t){return arguments.length&&(ionic.transition.isActive=!!t,e.cancel(V),t&&(V=e(function(){D.isTransitioning(!1)},999))),ionic.transition.isActive},createViewEle:function(e){var n=t[0].createElement("div");return e&&e.$template&&(n.innerHTML=e.$template,1===n.children.length)?(n.children[0].classList.add("pane"),f(n.children[0])):(n.className="pane",f(n))},viewEleIsActive:function(e,t){h(e,t?C:I)},getTransitionData:u,navViewAttr:h,destroyViewEle:p};return D}]),s.config(["$provide",function(e){e.decorator("$compile",["$delegate",function(e){return e.$$addScopeInfo=function(e,t,n,i){var o=n?i?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(o,t)},e}])}]),s.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])}]),s.controller("$ionicHeaderBar",["$scope","$element","$attrs","$q","$ionicConfig","$ionicHistory",function(e,t,n,i,o,r){function a(e){return T[e]||(T[e]=t[0].querySelector("."+e)),T[e]}var s="title",c="back-text",l="back-button",u="default-title",d="previous-title",f="hide",h=this,p="",v="",g=0,m=0,$="",w=!1,b=!0,y=!0,S=!1,k=0;h.beforeEnter=function(t){e.$broadcast("$ionicView.beforeEnter",t)},h.title=function(e){return arguments.length&&e!==p&&(a(s).innerHTML=e,p=e,k=0),p},h.enableBack=function(e,t){return arguments.length&&(w=e,t||h.updateBackButton()),w},h.showBack=function(e,t){return arguments.length&&(b=e,t||h.updateBackButton()),b},h.showNavBack=function(e){y=e,h.updateBackButton()},h.updateBackButton=function(){if((b&&y&&w)!==S){S=b&&y&&w;var e=a(l);e&&e.classList[S?"remove":"add"](f)}},h.titleTextWidth=function(){if(!k){var e=ionic.DomUtil.getTextBounds(a(s));k=Math.min(e&&e.width||30)}return k},h.titleWidth=function(){var e=h.titleTextWidth(),t=a(s).offsetWidth;return e>t&&(e=t+(g-m-5)),e},h.titleTextX=function(){return t[0].offsetWidth/2-h.titleWidth()/2},h.titleLeftRight=function(){return g-m},h.backButtonTextLeft=function(){for(var e=0,t=a(c);t;)e+=t.offsetLeft,t=t.parentElement;return e},h.resetBackButton=function(){if(o.backButton.previousTitleText()){var e=a(d);if(e){e.classList.remove(f);var t=r.backTitle();t!==v&&(v=e.innerHTML=t)}var n=a(u);n&&n.classList.remove(f)}},h.align=function(e){var i=a(s);e=e||n.alignTitle||o.navBar.alignTitle();var r=h.calcWidths(e,!1);if(b&&v&&o.backButton.previousTitleText()){var c=h.calcWidths(e,!0),l=t[0].offsetWidth-c.titleLeft-c.titleRight;h.titleTextWidth()<=l&&(r=c)}return h.updatePositions(i,r.titleLeft,r.titleRight,r.buttonsLeft,r.buttonsRight,r.css,r.showPrevTitle)},h.calcWidths=function(e,n){var i,o,r,h,p,v,g,m,$,w=a(s),y=a(l),S=t[0].childNodes,k=0,T=0,C=0,I=0,B="",x=0;for(i=0;i<S.length;i++){if(p=S[i],g=0,1==p.nodeType){if(p===w){$=!0;continue}if(p.classList.contains(f))continue;if(b&&p===y){for(o=0;o<p.childNodes.length;o++)if(h=p.childNodes[o],1==h.nodeType)if(h.classList.contains(c))for(r=0;r<h.children.length;r++)if(v=h.children[r],n){if(v.classList.contains(u))continue;x+=v.offsetWidth}else{if(v.classList.contains(d))continue;x+=v.offsetWidth}else x+=h.offsetWidth;else 3==h.nodeType&&h.nodeValue.trim()&&(m=ionic.DomUtil.getTextBounds(h),x+=m&&m.width||0);g=x||p.offsetWidth}else g=p.offsetWidth}else 3==p.nodeType&&p.nodeValue.trim()&&(m=ionic.DomUtil.getTextBounds(p),g=m&&m.width||0);$?T+=g:k+=g}if("left"==e)B="title-left",k&&(C=k+15),T&&(I=T+15);else if("right"==e)B="title-right",k&&(C=k+15),T&&(I=T+15);else{var V=Math.max(k,T)+10;V>10&&(C=I=V)}return{backButtonWidth:x,buttonsLeft:k,buttonsRight:T,titleLeft:C,titleRight:I,showPrevTitle:n,css:B}},h.updatePositions=function(e,n,r,s,c,l,p){var v=i.defer();if(e&&(n!==g&&(e.style.left=n?n+"px":"",g=n),r!==m&&(e.style.right=r?r+"px":"",m=r),l!==$&&(l&&e.classList.add(l),$&&e.classList.remove($),$=l)),o.backButton.previousTitleText()){var w=a(d),b=a(u);w&&w.classList[p?"remove":"add"](f),b&&b.classList[p?"add":"remove"](f)}return ionic.requestAnimationFrame(function(){if(e&&e.offsetWidth+10<e.scrollWidth){var n=c+5,i=t[0].offsetWidth-g-h.titleTextWidth()-20;r=n>i?n:i,r!==m&&(e.style.right=r+"px",m=r)}v.resolve()}),v.promise},h.setCss=function(e,t){ionic.DomUtil.cachedStyles(a(e),t)};var T={};e.$on("$destroy",function(){for(var e in T)T[e]=null})}]),s.service("$ionicListDelegate",ionic.DelegateService(["showReorder","showDelete","canSwipeItems","closeOptionButtons"])).controller("$ionicList",["$scope","$attrs","$ionicListDelegate","$ionicHistory",function(e,t,n,i){var o=this,r=!0,a=!1,s=!1,c=n._registerInstance(o,t.delegateHandle,function(){return i.isActiveScope(e)});e.$on("$destroy",c),o.showReorder=function(e){return arguments.length&&(a=!!e),a},o.showDelete=function(e){return arguments.length&&(s=!!e),s},o.canSwipeItems=function(e){return arguments.length&&(r=!!e),r},o.closeOptionButtons=function(){o.listView&&o.listView.clearDragEffects()}}]),s.controller("$ionicNavBar",["$scope","$element","$attrs","$compile","$timeout","$ionicNavBarDelegate","$ionicConfig","$ionicHistory",function(e,t,n,i,o,r,a,s){function c(e,t){var n=console.warn||console.log;n&&n("navBarController."+e+" is deprecated, please use "+t+" instead")}functio