From cf52047259118e8cf9a90ddd936f895143f5f224 Mon Sep 17 00:00:00 2001 From: Mark Harding Date: Mon, 10 Aug 2015 12:36:51 +0100 Subject: [PATCH] build --- www/js/main-built.js | 4 +- www/js/templates-compiled.js | 126 ++++++++++++++++++----------------- 2 files changed, 66 insertions(+), 64 deletions(-) diff --git a/www/js/main-built.js b/www/js/main-built.js index 93bce5dd..9892d9fe 100644 --- a/www/js/main-built.js +++ b/www/js/main-built.js @@ -6,9 +6,9 @@ Ri({ctrl:this,$element:o,set:function(e,t){e[t]=!0},unset:function(e,t){delete e }),this)},e.Gestures.Instance.prototype={on:function(e,t){for(var n=e.split(" "),i=0;i0&&r==e.Gestures.EVENT_END?r=e.Gestures.EVENT_MOVE:u||(r=e.Gestures.EVENT_END),(u||null===n)&&(n=c),a.call(e.Gestures.detection,s.collectEventData(t,r,s.getTouchList(n,r),c)),e.Gestures.HAS_POINTEREVENTS&&r==e.Gestures.EVENT_END&&(u=e.Gestures.PointerEvent.updatePointer(r,c))),u||(n=null,i=!1,o=!1,e.Gestures.PointerEvent.reset())}})},determineEventTypes:function(){var t;t=e.Gestures.HAS_POINTEREVENTS?e.Gestures.PointerEvent.getEvents():e.Gestures.NO_MOUSEEVENTS?["touchstart","touchmove","touchend touchcancel"]:["touchstart mousedown","touchmove mousemove","touchend touchcancel mouseup"],e.Gestures.EVENT_TYPES[e.Gestures.EVENT_START]=t[0],e.Gestures.EVENT_TYPES[e.Gestures.EVENT_MOVE]=t[1],e.Gestures.EVENT_TYPES[e.Gestures.EVENT_END]=t[2]},getTouchList:function(t){return e.Gestures.HAS_POINTEREVENTS?e.Gestures.PointerEvent.getTouchList():t.touches?t.touches:(t.identifier=1,[t])},collectEventData:function(t,n,i,o){var r=e.Gestures.POINTER_TOUCH;return(o.type.match(/mouse/)||e.Gestures.PointerEvent.matchType(e.Gestures.POINTER_MOUSE,o))&&(r=e.Gestures.POINTER_MOUSE),{center:e.Gestures.utils.getCenter(i),timeStamp:(new Date).getTime(),target:o.target,touches:i,eventType:n,pointerType:r,srcEvent:o,preventDefault:function(){this.srcEvent.preventManipulation&&this.srcEvent.preventManipulation(),this.srcEvent.preventDefault},stopPropagation:function(){this.srcEvent.stopPropagation()},stopDetect:function(){return e.Gestures.detection.stopDetect()}}}},e.Gestures.PointerEvent={pointers:{},getTouchList:function(){var e=this,t=[];return Object.keys(e.pointers).sort().forEach(function(n){t.push(e.pointers[n])}),t},updatePointer:function(t,n){return t==e.Gestures.EVENT_END?this.pointers={}:(n.identifier=n.pointerId,this.pointers[n.pointerId]=n),Object.keys(this.pointers).length},matchType:function(t,n){if(!n.pointerType)return!1;var i={};return i[e.Gestures.POINTER_MOUSE]=n.pointerType==n.MSPOINTER_TYPE_MOUSE||n.pointerType==e.Gestures.POINTER_MOUSE,i[e.Gestures.POINTER_TOUCH]=n.pointerType==n.MSPOINTER_TYPE_TOUCH||n.pointerType==e.Gestures.POINTER_TOUCH,i[e.Gestures.POINTER_PEN]=n.pointerType==n.MSPOINTER_TYPE_PEN||n.pointerType==e.Gestures.POINTER_PEN,i[t]},getEvents:function(){return["pointerdown MSPointerDown","pointermove MSPointerMove","pointerup pointercancel MSPointerUp MSPointerCancel"]},reset:function(){this.pointers={}}},e.Gestures.utils={extend:function(e,t,n){for(var i in t)void 0!==e[i]&&n||(e[i]=t[i]);return e},hasParent:function(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1},getCenter:function(e){for(var t=[],n=[],i=0,o=e.length;o>i;i++)t.push(e[i].pageX),n.push(e[i].pageY);return{pageX:(Math.min.apply(Math,t)+Math.max.apply(Math,t))/2,pageY:(Math.min.apply(Math,n)+Math.max.apply(Math,n))/2}},getVelocity:function(e,t,n){return{x:Math.abs(t/e)||0,y:Math.abs(n/e)||0}},getAngle:function(e,t){var n=t.pageY-e.pageY,i=t.pageX-e.pageX;return 180*Math.atan2(n,i)/Math.PI},getDirection:function(t,n){var i=Math.abs(t.pageX-n.pageX),o=Math.abs(t.pageY-n.pageY);return i>=o?t.pageX-n.pageX>0?e.Gestures.DIRECTION_LEFT:e.Gestures.DIRECTION_RIGHT:t.pageY-n.pageY>0?e.Gestures.DIRECTION_UP:e.Gestures.DIRECTION_DOWN},getDistance:function(e,t){var n=t.pageX-e.pageX,i=t.pageY-e.pageY;return Math.sqrt(n*n+i*i)},getScale:function(e,t){return e.length>=2&&t.length>=2?this.getDistance(t[0],t[1])/this.getDistance(e[0],e[1]):1},getRotation:function(e,t){return e.length>=2&&t.length>=2?this.getAngle(t[1],t[0])-this.getAngle(e[1],e[0]):0},isVertical:function(t){return t==e.Gestures.DIRECTION_UP||t==e.Gestures.DIRECTION_DOWN},stopDefaultBrowserBehavior:function(e,t){e&&e.classList&&(e.classList.add(t),e.onselectstart=function(){return!1})}},e.Gestures.detection={gestures:[],current:null,previous:null,stopped:!1,startDetect:function(t,n){this.current||(this.stopped=!1,this.current={inst:t,startEvent:e.Gestures.utils.extend({},n),lastEvent:!1,name:""},this.detect(n))},detect:function(t){if(!this.current||this.stopped)return null;t=this.extendEventData(t);for(var n=this.current.inst.options,i=0,o=this.gestures.length;o>i;i++){var r=this.gestures[i];if(!this.stopped&&n[r.name]!==!1&&r.handler.call(r,t,this.current.inst)===!1){this.stopDetect();break}}return this.current&&(this.current.lastEvent=t),t.eventType==e.Gestures.EVENT_END&&!t.touches.length-1&&this.stopDetect(),t},stopDetect:function(){this.previous=e.Gestures.utils.extend({},this.current),this.current=null,this.stopped=!0},extendEventData:function(t){var n=this.current.startEvent;if(n&&(t.touches.length!=n.touches.length||t.touches===n.touches)){n.touches=[];for(var i=0,o=t.touches.length;o>i;i++)n.touches.push(e.Gestures.utils.extend({},t.touches[i]))}var r=t.timeStamp-n.timeStamp,a=t.center.pageX-n.center.pageX,s=t.center.pageY-n.center.pageY,c=e.Gestures.utils.getVelocity(r,a,s);return e.Gestures.utils.extend(t,{deltaTime:r,deltaX:a,deltaY:s,velocityX:c.x,velocityY:c.y,distance:e.Gestures.utils.getDistance(n.center,t.center),angle:e.Gestures.utils.getAngle(n.center,t.center),direction:e.Gestures.utils.getDirection(n.center,t.center),scale:e.Gestures.utils.getScale(n.touches,t.touches),rotation:e.Gestures.utils.getRotation(n.touches,t.touches),startEvent:n}),t},register:function(t){var n=t.defaults||{};return void 0===n[t.name]&&(n[t.name]=!0),e.Gestures.utils.extend(e.Gestures.defaults,n,!0),t.index=t.index||1e3,this.gestures.push(t),this.gestures.sort(function(e,t){return e.indext.index?1:0}),this.gestures}},e.Gestures.gestures=e.Gestures.gestures||{},e.Gestures.gestures.Hold={name:"hold",index:10,defaults:{hold_timeout:500,hold_threshold:1},timer:null,handler:function(t,n){switch(t.eventType){case e.Gestures.EVENT_START:clearTimeout(this.timer),e.Gestures.detection.current.name=this.name,this.timer=setTimeout(function(){"hold"==e.Gestures.detection.current.name&&(e.tap.cancelClick(),n.trigger("hold",t))},n.options.hold_timeout);break;case e.Gestures.EVENT_MOVE:t.distance>n.options.hold_threshold&&clearTimeout(this.timer);break;case e.Gestures.EVENT_END:clearTimeout(this.timer)}}},e.Gestures.gestures.Tap={name:"tap",index:100,defaults:{tap_max_touchtime:250,tap_max_distance:10,tap_always:!0,doubletap_distance:20,doubletap_interval:300},handler:function(t,n){if(t.eventType==e.Gestures.EVENT_END&&"touchcancel"!=t.srcEvent.type){var i=e.Gestures.detection.previous,o=!1;if(t.deltaTime>n.options.tap_max_touchtime||t.distance>n.options.tap_max_distance)return;i&&"tap"==i.name&&t.timeStamp-i.lastEvent.timeStamp0&&t.touches.length>n.options.swipe_max_touches)return;(t.velocityX>n.options.swipe_velocity||t.velocityY>n.options.swipe_velocity)&&(n.trigger(this.name,t),n.trigger(this.name+t.direction,t))}}},e.Gestures.gestures.Drag={name:"drag",index:50,defaults:{drag_min_distance:10,correct_for_drag_min_distance:!0,drag_max_touches:1,drag_block_horizontal:!0,drag_block_vertical:!0,drag_lock_to_axis:!1,drag_lock_min_distance:25,prevent_default_directions:[]},triggered:!1,handler:function(t,n){if("touchstart"==t.srcEvent.type||"touchend"==t.srcEvent.type?this.preventedFirstMove=!1:this.preventedFirstMove||"touchmove"!=t.srcEvent.type||((0===n.options.prevent_default_directions.length||-1!=n.options.prevent_default_directions.indexOf(t.direction))&&t.srcEvent.preventDefault(),this.preventedFirstMove=!0),e.Gestures.detection.current.name!=this.name&&this.triggered)return n.trigger(this.name+"end",t),void(this.triggered=!1);if(!(n.options.drag_max_touches>0&&t.touches.length>n.options.drag_max_touches))switch(t.eventType){case e.Gestures.EVENT_START:this.triggered=!1;break;case e.Gestures.EVENT_MOVE:if(t.distancen.options.transform_min_rotation&&n.trigger("rotate",t),i>n.options.transform_min_scale&&(n.trigger("pinch",t),n.trigger("pinch"+(t.scale<1?"in":"out"),t));break;case e.Gestures.EVENT_END:this.triggered&&n.trigger(this.name+"end",t),this.triggered=!1}}},e.Gestures.gestures.Touch={name:"touch",index:-(1/0),defaults:{prevent_default:!1,prevent_mouseevents:!1},handler:function(t,n){return n.options.prevent_mouseevents&&t.pointerType==e.Gestures.POINTER_MOUSE?void t.stopDetect():(n.options.prevent_default&&t.preventDefault(),void(t.eventType==e.Gestures.EVENT_START&&n.trigger(this.name,t)))}},e.Gestures.gestures.Release={name:"release",index:1/0,handler:function(t,n){t.eventType==e.Gestures.EVENT_END&&n.trigger(this.name,t)}}}(window.ionic),function(e,t,n){function i(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))}function o(){d.isWebView()?t.addEventListener("deviceready",r,!1):r(),a&&e.removeEventListener("load",o,!1)}function r(){d.isReady=!0,d.detect();for(var e=0;e0?o=o.replace(".","_"):o+="_0",d.platforms.push(n+o.split("_")[0]),d.platforms.push(n+o),d.isAndroid()&&4.4>i?t=4>i?"c":"b":d.isWindowsPhone()&&(t="b")}}d.setGrade(t)},isWebView:function(){return!!(e.cordova||e.PhoneGap||e.phonegap||e.forge)},isIPad:function(){return/iPad/i.test(d.navigator.platform)?!0:/iPad/i.test(d.ua)},isIOS:function(){return d.is(s)},isAndroid:function(){return d.is(c)},isWindowsPhone:function(){return d.is(l)},platform:function(){return null===f&&d.setPlatform(d.device().platform),f},setPlatform:function(e){f="undefined"!=typeof e&&null!==e&&e.length?e.toLowerCase():i("ionicplatform")?i("ionicplatform"):d.ua.indexOf("Android")>0?c:/iPhone|iPad|iPod/.test(d.ua)?s:d.ua.indexOf("Windows Phone")>-1?l:d.navigator.platform&&navigator.platform.toLowerCase().split(" ")[0]||""},version:function(){return null===p&&d.setVersion(d.device().version),p},setVersion:function(e){if("undefined"!=typeof e&&null!==e&&(e=e.split("."),e=parseFloat(e[0]+"."+(e.length>1?e[1]:0)),!isNaN(e)))return void(p=e);p=0;var t=d.platform(),n={android:/Android (\d+).(\d+)?/,ios:/OS (\d+)_(\d+)?/,windowsphone:/Windows Phone (\d+).(\d+)?/};n[t]&&(e=d.ua.match(n[t]),e&&e.length>2&&(p=parseFloat(e[1]+"."+e[2])))},is:function(e){if(e=e.toLowerCase(),d.platforms)for(var t=0;t=0},exitApp:function(){d.ready(function(){navigator.app&&navigator.app.exitApp&&navigator.app.exitApp()})},showStatusBar:function(n){d._showStatusBar=n,d.ready(function(){u(function(){d._showStatusBar?(e.StatusBar&&e.StatusBar.show(),t.body.classList.remove("status-bar-hide")):(e.StatusBar&&e.StatusBar.hide(),t.body.classList.add("status-bar-hide"))})})},fullScreen:function(e,i){d.isFullScreen=e!==!1,n.DomUtil.ready(function(){u(function(){d.isFullScreen?t.body.classList.add("fullscreen"):t.body.classList.remove("fullscreen")}),d.showStatusBar(i===!0)})}},f=null,p=null,h=[];"complete"===t.readyState?o():(a=!0,e.addEventListener("load",o,!1))}(this,document,ionic),function(e,t){"use strict";t.CSS={},function(){var n,i=["webkitTransform","transform","-webkit-transform","webkit-transform","-moz-transform","moz-transform","MozTransform","mozTransform","msTransform"];for(n=0;n-1;t.CSS.TRANSITION_DURATION=(o?"-webkit-":"")+"transition-duration",t.CSS.TRANSITIONEND=(o?"webkitTransitionEnd ":"")+"transitionend"}(),"classList"in e.documentElement||!Object.defineProperty||"undefined"==typeof HTMLElement||Object.defineProperty(HTMLElement.prototype,"classList",{get:function(){function e(e){return function(){var n,i=t.className.split(/\s+/);for(n=0;n0&&30>n||t.requestAnimationFrame(function(){if(!(t.scroll&&t.scroll.isScrolling||t.tap.requiresNativeClick(e.target))){for(var n,o=e.target,a=0;6>a&&o&&1===o.nodeType;a++){if(n&&o.classList&&o.classList.contains("item")){n=o;break}if("A"==o.tagName||"BUTTON"==o.tagName||o.hasAttribute("ng-click")){n=o;break}if(o.classList.contains("button")){n=o;break}if("ION-CONTENT"==o.tagName||o.classList&&o.classList.contains("pane")||"BODY"==o.tagName)break;o=o.parentElement}n&&(r[s]=n,t.requestAnimationFrame(i),s=s>29?0:s+1)}})},end:function(){setTimeout(n,200)}}}(document,ionic),function(e){var t=0;e.Utils={arrayMove:function(e,t,n){if(n>=e.length)for(var i=n-e.length;i--+1;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e},proxy:function(e,t){var n=Array.prototype.slice.call(arguments,2);return function(){return e.apply(t,n.concat(Array.prototype.slice.call(arguments)))}},debounce:function(e,t,n){var i,o,r,a,s;return function(){r=this,o=arguments,a=new Date;var c=function(){var l=new Date-a;t>l?i=setTimeout(c,t-l):(i=null,n||(s=e.apply(r,o)))},l=n&&!i;return i||(i=setTimeout(c,t)),l&&(s=e.apply(r,o)),s}},throttle:function(e,t,n){var i,o,r,a=null,s=0;n||(n={});var c=function(){s=n.leading===!1?0:Date.now(),a=null,r=e.apply(i,o)};return function(){var l=Date.now();s||n.leading!==!1||(s=l);var u=t-(l-s);return i=this,o=arguments,0>=u?(clearTimeout(a),a=null,s=l,r=e.apply(i,o)):a||n.trailing===!1||(a=setTimeout(c,u)),r}},inherit:function(t,n){var i,o=this;i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return o.apply(this,arguments)},e.extend(i,o,n);var r=function(){this.constructor=i};return r.prototype=o.prototype,i.prototype=new r,t&&e.extend(i.prototype,t),i.__super__=o.prototype,i},extend:function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;nwindow.innerHeight?90:0}},ionic.Platform.ready(function(){R(),window.addEventListener("orientationchange",function(){setTimeout(B,1e3)},!1)}),function(e){"use strict";e.views.View=function(){this.initialize.apply(this,arguments)},e.views.View.inherit=e.inherit,e.extend(e.views.View.prototype,{initialize:function(){}})}(window.ionic);var pt={effect:{}};!function(e){var t=Date.now||function(){return+new Date},n=60,i=1e3,o={},r=1;pt.effect.Animate={requestAnimationFrame:function(){var t=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame,n=!!t;if(t&&!/requestAnimationFrame\(\)\s*\{\s*\[native code\]\s*\}/i.test(t.toString())&&(n=!1),n)return function(e,n){t(e,n)};var i=60,o={},r=0,a=1,s=null,c=+new Date;return function(e){var t=a++;return o[t]=e,r++,null===s&&(s=setInterval(function(){var e=+new Date,t=o;o={},r=0;for(var n in t)t.hasOwnProperty(n)&&(t[n](e),c=e);e-c>2500&&(clearInterval(s),s=null)},1e3/i)),t}}(),stop:function(e){var t=null!=o[e];return t&&(o[e]=null),t},isRunning:function(e){return null!=o[e]},start:function(e,a,s,c,l,u){var d=t(),f=d,p=0,h=0,m=r++;if(u||(u=document.body),m%20===0){var g={};for(var v in o)g[v]=!0;o=g}var b=function(r){var g=r!==!0,v=t();if(!o[m]||a&&!a(m))return o[m]=null,void(s&&s(n-h/((v-d)/i),m,!1));if(g)for(var $=Math.round((v-f)/(i/n))-1,w=0;w1&&(p=1));var y=l?l(p):p;e(y,v,g)!==!1&&1!==p||!g?g&&(f=v,pt.effect.Animate.requestAnimationFrame(b,u)):(o[m]=null,s&&s(n-h/((v-d)/i),m,1===p||null==c))};return o[m]=!0,pt.effect.Animate.requestAnimationFrame(b,u),m}}}(this),function(e){var t=function(){},n=function(e){return Math.pow(e-1,3)+1},i=function(e){return(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2)};e.views.Scroll=e.views.View.inherit({initialize:function(n){var i=this;i.__container=n.el,i.__content=n.el.firstElementChild,setTimeout(function(){i.__container&&i.__content&&(i.__container.scrollTop=0,i.__content.scrollTop=0)}),i.options={scrollingX:!1,scrollbarX:!0,scrollingY:!0,scrollbarY:!0,startX:0,startY:0,wheelDampen:6,minScrollbarSizeX:5,minScrollbarSizeY:5,scrollbarsFade:!0,scrollbarFadeDelay:300,scrollbarResizeFadeDelay:1e3,animating:!0,animationDuration:250,decelVelocityThreshold:4,decelVelocityThresholdPaging:4,bouncing:!0,locking:!0,paging:!1,snapping:!1,zooming:!1,minZoom:.5,maxZoom:3,speedMultiplier:1,deceleration:.97,preventDefault:!1,scrollingComplete:t,penetrationDeceleration:.03,penetrationAcceleration:.08,scrollEventInterval:10,freeze:!1,getContentWidth:function(){return Math.max(i.__content.scrollWidth,i.__content.offsetWidth)},getContentHeight:function(){return Math.max(i.__content.scrollHeight,i.__content.offsetHeight+2*i.__content.offsetTop)}};for(var o in n)i.options[o]=n[o];i.hintResize=e.debounce(function(){i.resize()},1e3,!0),i.onScroll=function(){e.scroll.isScrolling?(clearTimeout(i.scrollTimer),i.scrollTimer=setTimeout(i.setScrollStop,80)):setTimeout(i.setScrollStart,50)},i.freeze=function(e){return arguments.length&&(i.options.freeze=e),i.options.freeze},i.setScrollStart=function(){e.scroll.isScrolling=Math.abs(e.scroll.lastTop-i.__scrollTop)>1,clearTimeout(i.scrollTimer),i.scrollTimer=setTimeout(i.setScrollStop,80)},i.setScrollStop=function(){e.scroll.isScrolling=!1,e.scroll.lastTop=i.__scrollTop},i.triggerScrollEvent=e.throttle(function(){i.onScroll(),e.trigger("scroll",{scrollTop:i.__scrollTop,scrollLeft:i.__scrollLeft,target:i.__container})},i.options.scrollEventInterval),i.triggerScrollEndEvent=function(){e.trigger("scrollend",{scrollTop:i.__scrollTop,scrollLeft:i.__scrollLeft,target:i.__container})},i.__scrollLeft=i.options.startX,i.__scrollTop=i.options.startY,i.__callback=i.getRenderFn(),i.__initEventHandlers(),i.__createScrollbars()},run:function(){this.resize(),this.__fadeScrollbars("out",this.options.scrollbarResizeFadeDelay)},__isSingleTouch:!1,__isTracking:!1,__didDecelerationComplete:!1,__isGesturing:!1,__isDragging:!1,__isDecelerating:!1,__isAnimating:!1,__clientLeft:0,__clientTop:0,__clientWidth:0,__clientHeight:0,__contentWidth:0,__contentHeight:0,__snapWidth:100,__snapHeight:100,__refreshHeight:null,__refreshActive:!1,__refreshActivate:null,__refreshDeactivate:null,__refreshStart:null,__zoomLevel:1,__scrollLeft:0,__scrollTop:0,__maxScrollLeft:0,__maxScrollTop:0,__scheduledLeft:0,__scheduledTop:0,__scheduledZoom:0,__lastTouchLeft:null,__lastTouchTop:null,__lastTouchMove:null,__positions:null,__minDecelerationScrollLeft:null,__minDecelerationScrollTop:null,__maxDecelerationScrollLeft:null,__maxDecelerationScrollTop:null,__decelerationVelocityX:null,__decelerationVelocityY:null,__transformProperty:null,__perspectiveProperty:null,__indicatorX:null,__indicatorY:null,__scrollbarFadeTimeout:null,__didWaitForSize:null,__sizerTimeout:null,__initEventHandlers:function(){function t(e){return e.touches&&e.touches.length?e.touches:[{pageX:e.pageX,pageY:e.pageY}]}var n,i=this,o=i.__container;if(i.scrollChildIntoView=function(t){var r=o.getBoundingClientRect().bottom;n=o.offsetHeight;var a=i.isShrunkForKeyboard,s=o.parentNode.classList.contains("modal"),c=s&&window.innerWidth>=680;if(!a){if(e.Platform.isIOS()||e.Platform.isFullScreen||c){var l=t.detail.viewportHeight-r,u=Math.max(0,t.detail.keyboardHeight-l);e.requestAnimationFrame(function(){n-=u,o.style.height=n+"px",o.style.overflow="visible",i.resize()})}i.isShrunkForKeyboard=!0}t.detail.isElementUnderKeyboard&&e.requestAnimationFrame(function(){o.scrollTop=0,i.isShrunkForKeyboard&&!a&&(r=o.getBoundingClientRect().bottom);var s=.5*n,c=(t.detail.elementBottom+t.detail.elementTop)/2,l=c-r,u=l+s;u>0&&(e.Platform.isIOS()&&e.tap.cloneFocusedInput(o,i),i.scrollBy(0,u,!0),i.onScroll())}),t.stopPropagation()},i.resetScrollView=function(){i.isShrunkForKeyboard&&(i.isShrunkForKeyboard=!1,o.style.height="",o.style.overflow=""),i.resize()},o.addEventListener("scrollChildIntoView",i.scrollChildIntoView),document.addEventListener("resetScrollView",i.resetScrollView),i.touchStart=function(n){if(i.startCoordinates=e.tap.pointerCoord(n),!e.tap.ignoreScrollStart(n)){if(i.__isDown=!0,e.tap.containsOrIsTextInput(n.target)||"SELECT"===n.target.tagName)return void(i.__hasStarted=!1);i.__isSelectable=!0,i.__enableScrollY=!0,i.__hasStarted=!0,i.doTouchStart(t(n),n.timeStamp),n.preventDefault()}},i.touchMove=function(n){if(!(i.options.freeze||!i.__isDown||!i.__isDown&&n.defaultPrevented||"TEXTAREA"===n.target.tagName&&n.target.parentElement.querySelector(":focus"))){if(!i.__hasStarted&&(e.tap.containsOrIsTextInput(n.target)||"SELECT"===n.target.tagName))return i.__hasStarted=!0,i.doTouchStart(t(n),n.timeStamp),void n.preventDefault();if(i.startCoordinates){var r=e.tap.pointerCoord(n);i.__isSelectable&&e.tap.isTextInput(n.target)&&Math.abs(i.startCoordinates.x-r.x)>20&&(i.__enableScrollY=!1,i.__isSelectable=!0),i.__enableScrollY&&Math.abs(i.startCoordinates.y-r.y)>10&&(i.__isSelectable=!1,e.tap.cloneFocusedInput(o,i))}i.doTouchMove(t(n),n.timeStamp,n.scale),i.__isDown=!0}},i.touchMoveBubble=function(e){i.__isDown&&i.options.preventDefault&&e.preventDefault()},i.touchEnd=function(t){i.__isDown&&(i.doTouchEnd(t,t.timeStamp),i.__isDown=!1,i.__hasStarted=!1,i.__isSelectable=!0,i.__enableScrollY=!0,i.__isDragging||i.__isDecelerating||i.__isAnimating||e.tap.removeClonedInputs(o,i))},i.mouseWheel=e.animationFrameThrottle(function(t){var n=e.DomUtil.getParentOrSelfWithClass(t.target,"ionic-scroll");i.options.freeze||n!==i.__container||(i.hintResize(),i.scrollBy((t.wheelDeltaX||t.deltaX||0)/i.options.wheelDampen,(-t.wheelDeltaY||t.deltaY||0)/i.options.wheelDampen),i.__fadeScrollbars("in"),clearTimeout(i.__wheelHideBarTimeout),i.__wheelHideBarTimeout=setTimeout(function(){i.__fadeScrollbars("out") },100))}),"ontouchstart"in window)o.addEventListener("touchstart",i.touchStart,!1),i.options.preventDefault&&o.addEventListener("touchmove",i.touchMoveBubble,!1),document.addEventListener("touchmove",i.touchMove,!1),document.addEventListener("touchend",i.touchEnd,!1),document.addEventListener("touchcancel",i.touchEnd,!1);else if(window.navigator.pointerEnabled)o.addEventListener("pointerdown",i.touchStart,!1),i.options.preventDefault&&o.addEventListener("pointermove",i.touchMoveBubble,!1),document.addEventListener("pointermove",i.touchMove,!1),document.addEventListener("pointerup",i.touchEnd,!1),document.addEventListener("pointercancel",i.touchEnd,!1),document.addEventListener("wheel",i.mouseWheel,!1);else if(window.navigator.msPointerEnabled)o.addEventListener("MSPointerDown",i.touchStart,!1),i.options.preventDefault&&o.addEventListener("MSPointerMove",i.touchMoveBubble,!1),document.addEventListener("MSPointerMove",i.touchMove,!1),document.addEventListener("MSPointerUp",i.touchEnd,!1),document.addEventListener("MSPointerCancel",i.touchEnd,!1),document.addEventListener("wheel",i.mouseWheel,!1);else{var r=!1;i.mouseDown=function(n){e.tap.ignoreScrollStart(n)||"SELECT"===n.target.tagName||(i.doTouchStart(t(n),n.timeStamp),e.tap.isTextInput(n.target)||n.preventDefault(),r=!0)},i.mouseMove=function(e){i.options.freeze||!r||!r&&e.defaultPrevented||(i.doTouchMove(t(e),e.timeStamp),r=!0)},i.mouseMoveBubble=function(e){r&&i.options.preventDefault&&e.preventDefault()},i.mouseUp=function(e){r&&(i.doTouchEnd(e,e.timeStamp),r=!1)},o.addEventListener("mousedown",i.mouseDown,!1),i.options.preventDefault&&o.addEventListener("mousemove",i.mouseMoveBubble,!1),document.addEventListener("mousemove",i.mouseMove,!1),document.addEventListener("mouseup",i.mouseUp,!1),document.addEventListener("mousewheel",i.mouseWheel,!1),document.addEventListener("wheel",i.mouseWheel,!1)}},__cleanup:function(){var n=this,i=n.__container;i.removeEventListener("touchstart",n.touchStart),i.removeEventListener("touchmove",n.touchMoveBubble),document.removeEventListener("touchmove",n.touchMove),document.removeEventListener("touchend",n.touchEnd),document.removeEventListener("touchcancel",n.touchEnd),i.removeEventListener("pointerdown",n.touchStart),i.removeEventListener("pointermove",n.touchMoveBubble),document.removeEventListener("pointermove",n.touchMove),document.removeEventListener("pointerup",n.touchEnd),document.removeEventListener("pointercancel",n.touchEnd),i.removeEventListener("MSPointerDown",n.touchStart),i.removeEventListener("MSPointerMove",n.touchMoveBubble),document.removeEventListener("MSPointerMove",n.touchMove),document.removeEventListener("MSPointerUp",n.touchEnd),document.removeEventListener("MSPointerCancel",n.touchEnd),i.removeEventListener("mousedown",n.mouseDown),i.removeEventListener("mousemove",n.mouseMoveBubble),document.removeEventListener("mousemove",n.mouseMove),document.removeEventListener("mouseup",n.mouseUp),document.removeEventListener("mousewheel",n.mouseWheel),document.removeEventListener("wheel",n.mouseWheel),i.removeEventListener("scrollChildIntoView",n.scrollChildIntoView),document.removeEventListener("resetScrollView",n.resetScrollView),e.tap.removeClonedInputs(i,n),delete n.__container,delete n.__content,delete n.__indicatorX,delete n.__indicatorY,delete n.options.el,n.__callback=n.scrollChildIntoView=n.resetScrollView=t,n.mouseMove=n.mouseDown=n.mouseUp=n.mouseWheel=n.touchStart=n.touchMove=n.touchEnd=n.touchCancel=t,n.resize=n.scrollTo=n.zoomTo=n.__scrollingComplete=t,i=null},__createScrollbar:function(e){var t=document.createElement("div"),n=document.createElement("div");return n.className="scroll-bar-indicator scroll-bar-fade-out",t.className="h"==e?"scroll-bar scroll-bar-h":"scroll-bar scroll-bar-v",t.appendChild(n),t},__createScrollbars:function(){var e,t,n=this;n.options.scrollingX&&(e={el:n.__createScrollbar("h"),sizeRatio:1},e.indicator=e.el.children[0],n.options.scrollbarX&&n.__container.appendChild(e.el),n.__indicatorX=e),n.options.scrollingY&&(t={el:n.__createScrollbar("v"),sizeRatio:1},t.indicator=t.el.children[0],n.options.scrollbarY&&n.__container.appendChild(t.el),n.__indicatorY=t)},__resizeScrollbars:function(){var t=this;if(t.__indicatorX){var n=Math.max(Math.round(t.__clientWidth*t.__clientWidth/t.__contentWidth),20);n>t.__contentWidth&&(n=0),n!==t.__indicatorX.size&&e.requestAnimationFrame(function(){t.__indicatorX.indicator.style.width=n+"px"}),t.__indicatorX.size=n,t.__indicatorX.minScale=t.options.minScrollbarSizeX/n,t.__indicatorX.maxPos=t.__clientWidth-n,t.__indicatorX.sizeRatio=t.__maxScrollLeft?t.__indicatorX.maxPos/t.__maxScrollLeft:1}if(t.__indicatorY){var i=Math.max(Math.round(t.__clientHeight*t.__clientHeight/t.__contentHeight),20);i>t.__contentHeight&&(i=0),i!==t.__indicatorY.size&&e.requestAnimationFrame(function(){t.__indicatorY&&(t.__indicatorY.indicator.style.height=i+"px")}),t.__indicatorY.size=i,t.__indicatorY.minScale=t.options.minScrollbarSizeY/i,t.__indicatorY.maxPos=t.__clientHeight-i,t.__indicatorY.sizeRatio=t.__maxScrollTop?t.__indicatorY.maxPos/t.__maxScrollTop:1}},__repositionScrollbars:function(){var e,t,n,i,o,r,a=this,s=0,c=0;if(a.__indicatorX){a.__indicatorY&&(s=10),o=Math.round(a.__indicatorX.sizeRatio*a.__scrollLeft)||0,n=a.__scrollLeft-(a.__maxScrollLeft-s),a.__scrollLeft<0?(t=Math.max(a.__indicatorX.minScale,(a.__indicatorX.size-Math.abs(a.__scrollLeft))/a.__indicatorX.size),o=0,a.__indicatorX.indicator.style[a.__transformOriginProperty]="left center"):n>0?(t=Math.max(a.__indicatorX.minScale,(a.__indicatorX.size-n)/a.__indicatorX.size),o=a.__indicatorX.maxPos-s,a.__indicatorX.indicator.style[a.__transformOriginProperty]="right center"):(o=Math.min(a.__maxScrollLeft,Math.max(0,o)),t=1);var l="translate3d("+o+"px, 0, 0) scaleX("+t+")";a.__indicatorX.transformProp!==l&&(a.__indicatorX.indicator.style[a.__transformProperty]=l,a.__indicatorX.transformProp=l)}if(a.__indicatorY){r=Math.round(a.__indicatorY.sizeRatio*a.__scrollTop)||0,a.__indicatorX&&(c=10),i=a.__scrollTop-(a.__maxScrollTop-c),a.__scrollTop<0?(e=Math.max(a.__indicatorY.minScale,(a.__indicatorY.size-Math.abs(a.__scrollTop))/a.__indicatorY.size),r=0,"center top"!==a.__indicatorY.originProp&&(a.__indicatorY.indicator.style[a.__transformOriginProperty]="center top",a.__indicatorY.originProp="center top")):i>0?(e=Math.max(a.__indicatorY.minScale,(a.__indicatorY.size-i)/a.__indicatorY.size),r=a.__indicatorY.maxPos-c,"center bottom"!==a.__indicatorY.originProp&&(a.__indicatorY.indicator.style[a.__transformOriginProperty]="center bottom",a.__indicatorY.originProp="center bottom")):(r=Math.min(a.__maxScrollTop,Math.max(0,r)),e=1);var u="translate3d(0,"+r+"px, 0) scaleY("+e+")";a.__indicatorY.transformProp!==u&&(a.__indicatorY.indicator.style[a.__transformProperty]=u,a.__indicatorY.transformProp=u)}},__fadeScrollbars:function(e,t){var n=this;if(n.options.scrollbarsFade){var i="scroll-bar-fade-out";n.options.scrollbarsFade===!0&&(clearTimeout(n.__scrollbarFadeTimeout),"in"==e?(n.__indicatorX&&n.__indicatorX.indicator.classList.remove(i),n.__indicatorY&&n.__indicatorY.indicator.classList.remove(i)):n.__scrollbarFadeTimeout=setTimeout(function(){n.__indicatorX&&n.__indicatorX.indicator.classList.add(i),n.__indicatorY&&n.__indicatorY.indicator.classList.add(i)},t||n.options.scrollbarFadeDelay))}},__scrollingComplete:function(){this.options.scrollingComplete(),e.tap.removeClonedInputs(this.__container,this),this.__fadeScrollbars("out")},resize:function(e){var t=this;t.__container&&t.options&&t.setDimensions(t.__container.clientWidth,t.__container.clientHeight,t.options.getContentWidth(),t.options.getContentHeight(),e)},getRenderFn:function(){var e,t=this,n=t.__content,i=document.documentElement.style;"MozAppearance"in i?e="gecko":"WebkitAppearance"in i?e="webkit":"string"==typeof navigator.cpuClass&&(e="trident");var o,r={trident:"ms",gecko:"Moz",webkit:"Webkit",presto:"O"}[e],a=document.createElement("div"),s=r+"Perspective",c=r+"Transform",l=r+"TransformOrigin";return t.__perspectiveProperty=c,t.__transformProperty=c,t.__transformOriginProperty=l,a.style[s]!==o?function(e,i,o,r){var a="translate3d("+-e+"px,"+-i+"px,0) scale("+o+")";a!==t.contentTransform&&(n.style[c]=a,t.contentTransform=a),t.__repositionScrollbars(),r||t.triggerScrollEvent()}:a.style[c]!==o?function(e,i,o,r){n.style[c]="translate("+-e+"px,"+-i+"px) scale("+o+")",t.__repositionScrollbars(),r||t.triggerScrollEvent()}:function(e,i,o,r){n.style.marginLeft=e?-e/o+"px":"",n.style.marginTop=i?-i/o+"px":"",n.style.zoom=o||"",t.__repositionScrollbars(),r||t.triggerScrollEvent()}},setDimensions:function(e,t,n,i,o){var r=this;(e||t||n||i)&&(e===+e&&(r.__clientWidth=e),t===+t&&(r.__clientHeight=t),n===+n&&(r.__contentWidth=n),i===+i&&(r.__contentHeight=i),r.__computeScrollMax(),r.__resizeScrollbars(),o||r.scrollTo(r.__scrollLeft,r.__scrollTop,!0,null,!0))},setPosition:function(e,t){this.__clientLeft=e||0,this.__clientTop=t||0},setSnapSize:function(e,t){this.__snapWidth=e,this.__snapHeight=t},activatePullToRefresh:function(t,n){var i=this;i.__refreshHeight=t,i.__refreshActivate=function(){e.requestAnimationFrame(n.activate)},i.__refreshDeactivate=function(){e.requestAnimationFrame(n.deactivate)},i.__refreshStart=function(){e.requestAnimationFrame(n.start)},i.__refreshShow=function(){e.requestAnimationFrame(n.show)},i.__refreshHide=function(){e.requestAnimationFrame(n.hide)},i.__refreshTail=function(){e.requestAnimationFrame(n.tail)},i.__refreshTailTime=100,i.__minSpinTime=600},triggerPullToRefresh:function(){this.__publish(this.__scrollLeft,-this.__refreshHeight,this.__zoomLevel,!0);var e=new Date;this.refreshStartTime=e.getTime(),this.__refreshStart&&this.__refreshStart()},finishPullToRefresh:function(){var e=this,t=new Date,n=0;e.refreshStartTime+e.__minSpinTime>t.getTime()&&(n=e.refreshStartTime+e.__minSpinTime-t.getTime()),setTimeout(function(){e.__refreshTail&&e.__refreshTail(),setTimeout(function(){e.__refreshActive=!1,e.__refreshDeactivate&&e.__refreshDeactivate(),e.__refreshHide&&e.__refreshHide(),e.scrollTo(e.__scrollLeft,e.__scrollTop,!0)},e.__refreshTailTime)},n)},getValues:function(){return{left:this.__scrollLeft,top:this.__scrollTop,zoom:this.__zoomLevel}},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},zoomTo:function(e,t,n,i){var o=this;if(!o.options.zooming)throw new Error("Zooming is not enabled!");o.__isDecelerating&&(pt.effect.Animate.stop(o.__isDecelerating),o.__isDecelerating=!1);var r=o.__zoomLevel;null==n&&(n=o.__clientWidth/2),null==i&&(i=o.__clientHeight/2),e=Math.max(Math.min(e,o.options.maxZoom),o.options.minZoom),o.__computeScrollMax(e);var a=(n+o.__scrollLeft)*e/r-n,s=(i+o.__scrollTop)*e/r-i;a>o.__maxScrollLeft?a=o.__maxScrollLeft:0>a&&(a=0),s>o.__maxScrollTop?s=o.__maxScrollTop:0>s&&(s=0),o.__publish(a,s,e,t)},zoomBy:function(e,t,n,i){this.zoomTo(this.__zoomLevel*e,t,n,i)},scrollTo:function(e,t,n,i,o){var r=this;if(r.__isDecelerating&&(pt.effect.Animate.stop(r.__isDecelerating),r.__isDecelerating=!1),null!=i&&i!==r.__zoomLevel){if(!r.options.zooming)throw new Error("Zooming is not enabled!");e*=i,t*=i,r.__computeScrollMax(i)}else i=r.__zoomLevel;r.options.scrollingX?r.options.paging?e=Math.round(e/r.__clientWidth)*r.__clientWidth:r.options.snapping&&(e=Math.round(e/r.__snapWidth)*r.__snapWidth):e=r.__scrollLeft,r.options.scrollingY?r.options.paging?t=Math.round(t/r.__clientHeight)*r.__clientHeight:r.options.snapping&&(t=Math.round(t/r.__snapHeight)*r.__snapHeight):t=r.__scrollTop,e=Math.max(Math.min(r.__maxScrollLeft,e),0),t=Math.max(Math.min(r.__maxScrollTop,t),0),e===r.__scrollLeft&&t===r.__scrollTop&&(n=!1),r.__publish(e,t,i,n,o)},scrollBy:function(e,t,n){var i=this,o=i.__isAnimating?i.__scheduledLeft:i.__scrollLeft,r=i.__isAnimating?i.__scheduledTop:i.__scrollTop;i.scrollTo(o+(e||0),r+(t||0),n)},doMouseZoom:function(e,t,n,i){var o=e>0?.97:1.03;return this.zoomTo(this.__zoomLevel*o,!1,n-this.__clientLeft,i-this.__clientTop)},doTouchStart:function(e,t){var n=this;n.__decStopped=!(!n.__isDecelerating&&!n.__isAnimating),n.hintResize(),t instanceof Date&&(t=t.valueOf()),"number"!=typeof t&&(t=Date.now()),n.__interruptedAnimation=!0,n.__isDecelerating&&(pt.effect.Animate.stop(n.__isDecelerating),n.__isDecelerating=!1,n.__interruptedAnimation=!0),n.__isAnimating&&(pt.effect.Animate.stop(n.__isAnimating),n.__isAnimating=!1,n.__interruptedAnimation=!0);var i,o,r=1===e.length;r?(i=e[0].pageX,o=e[0].pageY):(i=Math.abs(e[0].pageX+e[1].pageX)/2,o=Math.abs(e[0].pageY+e[1].pageY)/2),n.__initialTouchLeft=i,n.__initialTouchTop=o,n.__initialTouches=e,n.__zoomLevelStart=n.__zoomLevel,n.__lastTouchLeft=i,n.__lastTouchTop=o,n.__lastTouchMove=t,n.__lastScale=1,n.__enableScrollX=!r&&n.options.scrollingX,n.__enableScrollY=!r&&n.options.scrollingY,n.__isTracking=!0,n.__didDecelerationComplete=!1,n.__isDragging=!r,n.__isSingleTouch=r,n.__positions=[]},doTouchMove:function(e,t,n){t instanceof Date&&(t=t.valueOf()),"number"!=typeof t&&(t=Date.now());var i=this;if(i.__isTracking){var o,r;2===e.length?(o=Math.abs(e[0].pageX+e[1].pageX)/2,r=Math.abs(e[0].pageY+e[1].pageY)/2,!n&&i.options.zooming&&(n=i.__getScale(i.__initialTouches,e))):(o=e[0].pageX,r=e[0].pageY);var a=i.__positions;if(i.__isDragging){i.__decStopped=!1;var s=o-i.__lastTouchLeft,c=r-i.__lastTouchTop,l=i.__scrollLeft,u=i.__scrollTop,d=i.__zoomLevel;if(null!=n&&i.options.zooming){var f=d;if(d=d/i.__lastScale*n,d=Math.max(Math.min(d,i.options.maxZoom),i.options.minZoom),f!==d){var p=o-i.__clientLeft,h=r-i.__clientTop;l=(p+l)*d/f-p,u=(h+u)*d/f-h,i.__computeScrollMax(d)}}if(i.__enableScrollX){l-=s*i.options.speedMultiplier;var m=i.__maxScrollLeft;(l>m||0>l)&&(i.options.bouncing?l+=s/2*i.options.speedMultiplier:l=l>m?m:0)}if(i.__enableScrollY){u-=c*i.options.speedMultiplier;var g=i.__maxScrollTop;u>g||0>u?i.options.bouncing||i.__refreshHeight&&0>u?(u+=c/2*i.options.speedMultiplier,i.__enableScrollX||null==i.__refreshHeight||(0>u?(i.__refreshHidden=!1,i.__refreshShow()):(i.__refreshHide(),i.__refreshHidden=!0),!i.__refreshActive&&u<=-i.__refreshHeight?(i.__refreshActive=!0,i.__refreshActivate&&i.__refreshActivate()):i.__refreshActive&&u>-i.__refreshHeight&&(i.__refreshActive=!1,i.__refreshDeactivate&&i.__refreshDeactivate()))):u=u>g?g:0:i.__refreshHeight&&!i.__refreshHidden&&(i.__refreshHide(),i.__refreshHidden=!0)}a.length>60&&a.splice(0,30),a.push(l,u,t),i.__publish(l,u,d)}else{var v=i.options.locking?3:0,b=5,$=Math.abs(o-i.__initialTouchLeft),w=Math.abs(r-i.__initialTouchTop);i.__enableScrollX=i.options.scrollingX&&$>=v,i.__enableScrollY=i.options.scrollingY&&w>=v,a.push(i.__scrollLeft,i.__scrollTop,t),i.__isDragging=(i.__enableScrollX||i.__enableScrollY)&&($>=b||w>=b),i.__isDragging&&(i.__interruptedAnimation=!1,i.__fadeScrollbars("in"))}i.__lastTouchLeft=o,i.__lastTouchTop=r,i.__lastTouchMove=t,i.__lastScale=n}},doTouchEnd:function(t,n){n instanceof Date&&(n=n.valueOf()),"number"!=typeof n&&(n=Date.now());var i=this;if(i.__isTracking){if(i.__isTracking=!1,i.__isDragging)if(i.__isDragging=!1,i.__isSingleTouch&&i.options.animating&&n-i.__lastTouchMove<=100){for(var o=i.__positions,r=o.length-1,a=r,s=r;s>0&&o[s]>i.__lastTouchMove-100;s-=3)a=s;if(a!==r){var c=o[r]-o[a],l=i.__scrollLeft-o[a-2],u=i.__scrollTop-o[a-1];i.__decelerationVelocityX=l/c*(1e3/60),i.__decelerationVelocityY=u/c*(1e3/60);var d=i.options.paging||i.options.snapping?i.options.decelVelocityThresholdPaging:i.options.decelVelocityThreshold;(Math.abs(i.__decelerationVelocityX)>d||Math.abs(i.__decelerationVelocityY)>d)&&(i.__refreshActive||i.__startDeceleration(n))}else i.__scrollingComplete()}else n-i.__lastTouchMove>100&&i.__scrollingComplete();else i.__decStopped&&(t.isTapHandled=!0,i.__decStopped=!1);if(!i.__isDecelerating)if(i.__refreshActive&&i.__refreshStart){i.__publish(i.__scrollLeft,-i.__refreshHeight,i.__zoomLevel,!0);var f=new Date;i.refreshStartTime=f.getTime(),i.__refreshStart&&i.__refreshStart(),e.Platform.isAndroid()||i.__startDeceleration()}else(i.__interruptedAnimation||i.__isDragging)&&i.__scrollingComplete(),i.scrollTo(i.__scrollLeft,i.__scrollTop,!0,i.__zoomLevel),i.__refreshActive&&(i.__refreshActive=!1,i.__refreshDeactivate&&i.__refreshDeactivate());i.__positions.length=0}},__publish:function(e,t,o,r,a){var s=this,c=s.__isAnimating;if(c&&(pt.effect.Animate.stop(c),s.__isAnimating=!1),r&&s.options.animating){s.__scheduledLeft=e,s.__scheduledTop=t,s.__scheduledZoom=o;var l=s.__scrollLeft,u=s.__scrollTop,d=s.__zoomLevel,f=e-l,p=t-u,h=o-d,m=function(e,t,n){n&&(s.__scrollLeft=l+f*e,s.__scrollTop=u+p*e,s.__zoomLevel=d+h*e,s.__callback&&s.__callback(s.__scrollLeft,s.__scrollTop,s.__zoomLevel,a))},g=function(e){return s.__isAnimating===e},v=function(e,t,n){t===s.__isAnimating&&(s.__isAnimating=!1),(s.__didDecelerationComplete||n)&&s.__scrollingComplete(),s.options.zooming&&s.__computeScrollMax()};s.__isAnimating=pt.effect.Animate.start(m,g,v,s.options.animationDuration,c?n:i)}else s.__scheduledLeft=s.__scrollLeft=e,s.__scheduledTop=s.__scrollTop=t,s.__scheduledZoom=s.__zoomLevel=o,s.__callback&&s.__callback(e,t,o,a),s.options.zooming&&s.__computeScrollMax()},__computeScrollMax:function(e){var t=this;null==e&&(e=t.__zoomLevel),t.__maxScrollLeft=Math.max(t.__contentWidth*e-t.__clientWidth,0),t.__maxScrollTop=Math.max(t.__contentHeight*e-t.__clientHeight,0),t.__didWaitForSize||t.__maxScrollLeft||t.__maxScrollTop||(t.__didWaitForSize=!0,t.__waitForSize())},__waitForSize:function(){var e=this;clearTimeout(e.__sizerTimeout);var t=function(){e.resize(!0)};t(),e.__sizerTimeout=setTimeout(t,500)},__startDeceleration:function(){var e=this;if(e.options.paging){var t=Math.max(Math.min(e.__scrollLeft,e.__maxScrollLeft),0),n=Math.max(Math.min(e.__scrollTop,e.__maxScrollTop),0),i=e.__clientWidth,o=e.__clientHeight;e.__minDecelerationScrollLeft=Math.floor(t/i)*i,e.__minDecelerationScrollTop=Math.floor(n/o)*o,e.__maxDecelerationScrollLeft=Math.ceil(t/i)*i,e.__maxDecelerationScrollTop=Math.ceil(n/o)*o}else e.__minDecelerationScrollLeft=0,e.__minDecelerationScrollTop=0,e.__maxDecelerationScrollLeft=e.__maxScrollLeft,e.__maxDecelerationScrollTop=e.__maxScrollTop,e.__refreshActive&&(e.__minDecelerationScrollTop=-1*e.__refreshHeight);var r=function(t,n,i){e.__stepThroughDeceleration(i)};e.__minVelocityToKeepDecelerating=e.options.snapping?4:.1;var a=function(){var t=Math.abs(e.__decelerationVelocityX)>=e.__minVelocityToKeepDecelerating||Math.abs(e.__decelerationVelocityY)>=e.__minVelocityToKeepDecelerating;return t||(e.__didDecelerationComplete=!0,e.options.bouncing&&!e.__refreshActive&&e.scrollTo(Math.min(Math.max(e.__scrollLeft,0),e.__maxScrollLeft),Math.min(Math.max(e.__scrollTop,0),e.__maxScrollTop),e.__refreshActive)),t},s=function(){e.__isDecelerating=!1,e.__didDecelerationComplete&&e.__scrollingComplete(),e.options.paging&&e.scrollTo(e.__scrollLeft,e.__scrollTop,e.options.snapping)};e.__isDecelerating=pt.effect.Animate.start(r,a,s)},__stepThroughDeceleration:function(e){var t=this,n=t.__scrollLeft+t.__decelerationVelocityX,i=t.__scrollTop+t.__decelerationVelocityY;if(!t.options.bouncing){var o=Math.max(Math.min(t.__maxDecelerationScrollLeft,n),t.__minDecelerationScrollLeft);o!==n&&(n=o,t.__decelerationVelocityX=0);var r=Math.max(Math.min(t.__maxDecelerationScrollTop,i),t.__minDecelerationScrollTop);r!==i&&(i=r,t.__decelerationVelocityY=0)}if(e?t.__publish(n,i,t.__zoomLevel):(t.__scrollLeft=n,t.__scrollTop=i),!t.options.paging){var a=t.options.deceleration;t.__decelerationVelocityX*=a,t.__decelerationVelocityY*=a}if(t.options.bouncing){var s=0,c=0,l=t.options.penetrationDeceleration,u=t.options.penetrationAcceleration;if(nt.__maxDecelerationScrollLeft&&(s=t.__maxDecelerationScrollLeft-n),it.__maxDecelerationScrollTop&&(c=t.__maxDecelerationScrollTop-i),0!==s){var d=s*t.__decelerationVelocityX<=t.__minDecelerationScrollLeft;d&&(t.__decelerationVelocityX+=s*l);var f=Math.abs(t.__decelerationVelocityX)<=t.__minVelocityToKeepDecelerating;(!d||f)&&(t.__decelerationVelocityX=s*u)}if(0!==c){var p=c*t.__decelerationVelocityY<=t.__minDecelerationScrollTop;p&&(t.__decelerationVelocityY+=c*l);var h=Math.abs(t.__decelerationVelocityY)<=t.__minVelocityToKeepDecelerating;(!p||h)&&(t.__decelerationVelocityY=c*u)}}},__getDistance:function(e,t){var n=t.pageX-e.pageX,i=t.pageY-e.pageY;return Math.sqrt(n*n+i*i)},__getScale:function(e,t){return e.length>=2&&t.length>=2?this.__getDistance(t[0],t[1])/this.__getDistance(e[0],e[1]):1}}),e.scroll={isScrolling:!1,lastTop:0}}(ionic),function(e){var t=function(){},n=function(){};e.views.ScrollNative=e.views.View.inherit({initialize:function(n){var i=this;i.__container=i.el=n.el,i.__content=n.el.firstElementChild,i.isNative=!0,i.__scrollTop=i.el.scrollTop,i.__scrollLeft=i.el.scrollLeft,i.__clientHeight=i.__content.clientHeight,i.__clientWidth=i.__content.clientWidth,i.__maxScrollTop=Math.max(i.__contentHeight-i.__clientHeight,0),i.__maxScrollLeft=Math.max(i.__contentWidth-i.__clientWidth,0),i.options={freeze:!1,getContentWidth:function(){return Math.max(i.__content.scrollWidth,i.__content.offsetWidth)},getContentHeight:function(){return Math.max(i.__content.scrollHeight,i.__content.offsetHeight+2*i.__content.offsetTop)}};for(var o in n)i.options[o]=n[o];i.onScroll=function(){e.scroll.isScrolling||(e.scroll.isScrolling=!0),clearTimeout(i.scrollTimer),i.scrollTimer=setTimeout(function(){e.scroll.isScrolling=!1},80)},i.freeze=t,i.__initEventHandlers()},__callback:function(){n("__callback")},zoomTo:function(){n("zoomTo")},zoomBy:function(){n("zoomBy")},activatePullToRefresh:function(){n("activatePullToRefresh")},resize:function(e){var t=this;t.__container&&t.options&&t.setDimensions(t.__container.clientWidth,t.__container.clientHeight,t.options.getContentWidth(),t.options.getContentHeight(),e)},run:function(){this.resize()},getValues:function(){var e=this;return e.update(),{left:e.__scrollLeft,top:e.__scrollTop,zoom:1}},update:function(){var e=this;e.__scrollLeft=e.el.scrollLeft,e.__scrollTop=e.el.scrollTop},setDimensions:function(e,t,n,i){var o=this;(e||t||n||i)&&(e===+e&&(o.__clientWidth=e),t===+t&&(o.__clientHeight=t),n===+n&&(o.__contentWidth=n),i===+i&&(o.__contentHeight=i),o.__computeScrollMax())},getScrollMax:function(){return{left:this.__maxScrollLeft,top:this.__maxScrollTop}},scrollBy:function(e,t,n){var i=this;i.update();var o=i.__isAnimating?i.__scheduledLeft:i.__scrollLeft,r=i.__isAnimating?i.__scheduledTop:i.__scrollTop;i.scrollTo(o+(e||0),r+(t||0),n)},scrollTo:function(t,n,i){function o(t,n){function i(e){return--e*e*e+1}function o(){var u=Date.now(),d=Math.min(1,(u-a)/s),f=i(d);c!=t&&(r.el.scrollTop=parseInt(f*(t-c)+c,10)),l!=n&&(r.el.scrollLeft=parseInt(f*(n-l)+l,10)),1>d?e.requestAnimationFrame(o):(e.tap.removeClonedInputs(r.__container,r),r.resize())}var a=Date.now(),s=250,c=r.el.scrollTop,l=r.el.scrollLeft;return c===t&&l===n?void r.resize():void e.requestAnimationFrame(o)}var r=this;return i?void o(n,t):(r.el.scrollTop=n,r.el.scrollLeft=t,void r.resize())},__waitForSize:function(){var e=this;clearTimeout(e.__sizerTimeout);var t=function(){e.resize(!0)};t(),e.__sizerTimeout=setTimeout(t,500)},__computeScrollMax:function(){var e=this;e.__maxScrollLeft=Math.max(e.__contentWidth-e.__clientWidth,0),e.__maxScrollTop=Math.max(e.__contentHeight-e.__clientHeight,0),e.__didWaitForSize||e.__maxScrollLeft||e.__maxScrollTop||(e.__didWaitForSize=!0,e.__waitForSize())},__initEventHandlers:function(){var t,n=this,i=n.__container;n.scrollChildIntoView=function(o){var r=i.getBoundingClientRect().bottom;t=i.offsetHeight;var a=n.isShrunkForKeyboard,s=i.parentNode.classList.contains("modal"),c=s&&window.innerWidth>=680;if(!a){if(e.Platform.isIOS()||e.Platform.isFullScreen||c){var l=o.detail.viewportHeight-r,u=Math.max(0,o.detail.keyboardHeight-l);e.requestAnimationFrame(function(){t-=u,i.style.height=t+"px",n.resize()})}n.isShrunkForKeyboard=!0}o.detail.isElementUnderKeyboard&&e.requestAnimationFrame(function(){n.isShrunkForKeyboard&&!a&&(r=i.getBoundingClientRect().bottom);var s=.5*t,c=(o.detail.elementBottom+o.detail.elementTop)/2,l=c-r,u=l+s;u>0&&(e.Platform.isIOS()?setTimeout(function(){e.tap.cloneFocusedInput(i,n),n.scrollBy(0,u,!0),n.onScroll()},32):(n.scrollBy(0,u,!0),n.onScroll()))}),o.stopPropagation()},n.resetScrollView=function(){n.isShrunkForKeyboard&&(n.isShrunkForKeyboard=!1,i.style.height=""),n.resize()},i.addEventListener("scroll",n.onScroll),i.addEventListener("scrollChildIntoView",n.scrollChildIntoView),document.addEventListener("resetScrollView",n.resetScrollView)},__cleanup:function(){var n=this,i=n.__container;i.removeEventListener("resetScrollView",n.resetScrollView),i.removeEventListener("scroll",n.onScroll),i.removeEventListener("scrollChildIntoView",n.scrollChildIntoView),i.removeEventListener("resetScrollView",n.resetScrollView),e.tap.removeClonedInputs(i,n),delete n.__container,delete n.__content,delete n.__indicatorX,delete n.__indicatorY,delete n.options.el,n.resize=n.scrollTo=n.onScroll=n.resetScrollView=t,n.scrollChildIntoView=t,i=null}})}(ionic),function(e){"use strict";var t="item",n="item-content",i="item-sliding",o="item-options",r="item-placeholder",a="item-reordering",s="item-reorder",c=function(){};c.prototype={start:function(){},drag:function(){},end:function(){},isSameItem:function(){return!1}};var l=function(e){this.dragThresholdX=e.dragThresholdX||10,this.el=e.el,this.item=e.item,this.canSwipe=e.canSwipe};l.prototype=new c,l.prototype.start=function(r){var a,s,c,l;this.canSwipe()&&(a=r.target.classList.contains(n)?r.target:r.target.classList.contains(t)?r.target.querySelector("."+n):e.DomUtil.getParentWithClass(r.target,n),a&&(a.classList.remove(i),c=parseFloat(a.style[e.CSS.TRANSFORM].replace("translate3d(","").split(",")[0])||0,s=a.parentNode.querySelector("."+o),s&&(s.classList.remove("invisible"),l=s.offsetWidth,this._currentDrag={buttons:s,buttonsWidth:l,content:a,startOffsetX:c})))},l.prototype.isSameItem=function(e){return e._lastDrag&&this._currentDrag?this._currentDrag.content==e._lastDrag.content:!1},l.prototype.clean=function(t){function n(){i.buttons&&i.buttons.classList.add("invisible")}var i=this._lastDrag;i&&i.content&&(i.content.style[e.CSS.TRANSITION]="",i.content.style[e.CSS.TRANSFORM]="",t?(i.content.style[e.CSS.TRANSITION]="none",n(),e.requestAnimationFrame(function(){i.content.style[e.CSS.TRANSITION]=""})):e.requestAnimationFrame(function(){setTimeout(n,250)}))},l.prototype.drag=e.animationFrameThrottle(function(t){var n;if(this._currentDrag&&(!this._isDragging&&(Math.abs(t.gesture.deltaX)>this.dragThresholdX||Math.abs(this._currentDrag.startOffsetX)>0)&&(this._isDragging=!0),this._isDragging)){n=this._currentDrag.buttonsWidth;var i=Math.min(0,this._currentDrag.startOffsetX+t.gesture.deltaX);-n>i&&(i=Math.min(-n,-n+.4*(t.gesture.deltaX+n))),this._currentDrag.content.$$ionicOptionsOpen=0!==i,this._currentDrag.content.style[e.CSS.TRANSFORM]="translate3d("+i+"px, 0, 0)",this._currentDrag.content.style[e.CSS.TRANSITION]="none"}}),l.prototype.end=function(t,n){var i=this;if(!i._currentDrag)return void(n&&n());var o=-i._currentDrag.buttonsWidth;t.gesture.deltaX>-(i._currentDrag.buttonsWidth/2)&&("left"==t.gesture.direction&&Math.abs(t.gesture.velocityX)<.3?o=0:"right"==t.gesture.direction&&(o=0)),e.requestAnimationFrame(function(){if(0===o){i._currentDrag.content.style[e.CSS.TRANSFORM]="";var t=i._currentDrag.buttons;setTimeout(function(){t&&t.classList.add("invisible")},250)}else i._currentDrag.content.style[e.CSS.TRANSFORM]="translate3d("+o+"px,0,0)";i._currentDrag.content.style[e.CSS.TRANSITION]="",i._lastDrag||(i._lastDrag={}),e.extend(i._lastDrag,i._currentDrag),i._currentDrag&&(i._currentDrag.buttons=null,i._currentDrag.content=null),i._currentDrag=null,n&&n()})};var u=function(e){var t=this;if(t.dragThresholdY=e.dragThresholdY||0,t.onReorder=e.onReorder,t.listEl=e.listEl,t.el=t.item=e.el,t.scrollEl=e.scrollEl,t.scrollView=e.scrollView,t.listElTrueTop=0,t.listEl.offsetParent){var n=t.listEl;do t.listElTrueTop+=n.offsetTop,n=n.offsetParent;while(n)}};u.prototype=new c,u.prototype._moveElement=function(t){var n=t.gesture.center.pageY+this.scrollView.getValues().top-this._currentDrag.elementHeight/2-this.listElTrueTop;this.el.style[e.CSS.TRANSFORM]="translate3d(0, "+n+"px, 0)"},u.prototype.deregister=function(){this.listEl=this.el=this.scrollEl=this.scrollView=null},u.prototype.start=function(t){var n=e.DomUtil.getChildIndex(this.el,this.el.nodeName.toLowerCase()),i=this.el.scrollHeight,o=this.el.cloneNode(!0);o.classList.add(r),this.el.parentNode.insertBefore(o,this.el),this.el.classList.add(a),this._currentDrag={elementHeight:i,startIndex:n,placeholder:o,scrollHeight:scroll,list:o.parentNode},this._moveElement(t)},u.prototype.drag=e.animationFrameThrottle(function(t){var n=this;if(this._currentDrag){var i=0,o=t.gesture.center.pageY,r=this.listElTrueTop;if(this.scrollView){var a=this.scrollView.__container;i=this.scrollView.getValues().top;var s=a.offsetTop,c=s-o+this._currentDrag.elementHeight/2,l=o+this._currentDrag.elementHeight/2-s-a.offsetHeight;t.gesture.deltaY<0&&c>0&&i>0&&(this.scrollView.scrollBy(null,-c),e.requestAnimationFrame(function(){n.drag(t)})),t.gesture.deltaY>0&&l>0&&ithis.dragThresholdY&&(this._isDragging=!0),this._isDragging&&(this._moveElement(t),this._currentDrag.currentY=i+o-r)}}),u.prototype._getReorderIndex=function(){for(var e,t=this,n=Array.prototype.slice.call(t._currentDrag.placeholder.parentNode.children).filter(function(e){return e.nodeName===t.el.nodeName&&e!==t.el}),i=t._currentDrag.currentY,o=0,r=n.length;r>o;o++)if(e=n[o],o===r-1){if(i>e.offsetTop)return o}else if(0===o){if(ie.offsetTop-e.offsetHeight/2&&i5&&(i=n._getItem(t.target),i&&i.querySelector(".item-options")&&(n._dragOp=new l({el:n.el,item:i,canSwipe:n.canSwipe}),n._dragOp.start(t),t.preventDefault(),n.isScrollFreeze=n.scrollView.freeze(!0))):(i=n._getItem(t.target),i&&(n._dragOp=new u({listEl:n.el,el:i,scrollEl:n.scrollEl,scrollView:n.scrollView,onReorder:function(e,t,i){n.onReorder&&n.onReorder(e,t,i)}}),n._dragOp.start(t),t.preventDefault())),o&&n._dragOp&&!n._dragOp.isSameItem(o)&&t.defaultPrevented&&o.clean&&o.clean()},_handleEndDrag:function(e){var t=this;t.scrollView&&(t.isScrollFreeze=t.scrollView.freeze(!1)),t._didDragUpOrDown=!1,t._dragOp&&t._dragOp.end(e,function(){t._initDrag()})},_handleDrag:function(e){var t=this;Math.abs(e.gesture.deltaY)>5&&(t._didDragUpOrDown=!0),t.isDragging||t._dragOp||t._startDrag(e),t._dragOp&&(e.gesture.srcEvent.preventDefault(),t._dragOp.drag(e))}})}(ionic),function(e){"use strict";e.views.Modal=e.views.View.inherit({initialize:function(t){t=e.extend({focusFirstInput:!1,unfocusOnHide:!0,focusFirstDelay:600,backdropClickToClose:!0,hardwareBackButtonClose:!0},t),e.extend(this,t),this.el=t.el},show:function(){var e=this;e.focusFirstInput&&window.setTimeout(function(){var t=e.el.querySelector("input, textarea");t&&t.focus&&t.focus()},e.focusFirstDelay)},hide:function(){if(this.unfocusOnHide){var e=this.el.querySelectorAll("input, textarea");window.setTimeout(function(){for(var t=0;tt?-b:t>y?b:0,0))}e.continuous&&h.transitions&&(a(o(y-1),-b,0),a(o(y+1),b,0)),h.transitions||(w.style.left=y*-b+"px"),m.style.visibility="visible",e.slidesChanged&&e.slidesChanged()}}function n(t){e.continuous?r(y-1,t):y&&r(y-1,t)}function i(t){e.continuous?r(y+1,t):yy?t:y)-s-1),b*i,0);t=o(t),a(y,b*i,n||_),a(t,0,n||_),e.continuous&&a(o(t-i),-(b*i),0)}else t=o(t),c(y*-b,t*-b,n||_);y=t,p(e.callback&&e.callback(y,g[y]))}}function a(e,t,n){s(e,t,n),v[e]=t}function s(e,t,n){var i=g[e],o=i&&i.style;o&&(o.webkitTransitionDuration=o.MozTransitionDuration=o.msTransitionDuration=o.OTransitionDuration=o.transitionDuration=n+"ms",o.webkitTransform="translate("+t+"px,0)translateZ(0)",o.msTransform=o.MozTransform=o.OTransform="translateX("+t+"px)")}function c(t,n,i){if(!i)return void(w.style.left=n+"px");var o=+new Date,r=setInterval(function(){var a=+new Date-o;return a>i?(w.style.left=n+"px",x&&l(),e.transitionEnd&&e.transitionEnd.call(event,y,g[y]),void clearInterval(r)):void(w.style.left=(n-t)*(Math.floor(a/i*100)/100)+t+"px")},4)}function l(){S=setTimeout(i,x)}function u(){x=e.auto||0,clearTimeout(S)}var d=this,f=function(){},p=function(e){setTimeout(e||f,0)},h={addEventListener:!!window.addEventListener,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,transitions:function(e){var t=["transitionProperty","WebkitTransition","MozTransition","OTransition","msTransition"];for(var n in t)if(void 0!==e.style[t[n]])return!0;return!1}(document.createElement("swipe"))},m=e.el;if(m){var g,v,b,$,w=m.children[0];e=e||{};var y=parseInt(e.startSlide,10)||0,_=e.speed||300;e.continuous=void 0!==e.continuous?e.continuous:!0;var S,C,x=e.auto||0,k={},E={},T={handleEvent:function(n){switch(("mousedown"==n.type||"mouseup"==n.type||"mousemove"==n.type)&&(n.touches=[{pageX:n.pageX,pageY:n.pageY}]),n.type){case"mousedown":this.start(n);break;case"touchstart":this.start(n);break;case"touchmove":this.touchmove(n);break;case"mousemove":this.touchmove(n);break;case"touchend":p(this.end(n));break;case"mouseup":p(this.end(n));break;case"webkitTransitionEnd":case"msTransitionEnd":case"oTransitionEnd":case"otransitionend":case"transitionend":p(this.transitionEnd(n));break;case"resize":p(t)}e.stopPropagation&&n.stopPropagation()},start:function(e){var t=e.touches[0];k={x:t.pageX,y:t.pageY,time:+new Date},C=void 0,E={},h.touch?(w.addEventListener("touchmove",this,!1),w.addEventListener("touchend",this,!1)):(w.addEventListener("mousemove",this,!1),w.addEventListener("mouseup",this,!1),document.addEventListener("mouseup",this,!1))},touchmove:function(t){if(!(t.touches.length>1||t.scale&&1!==t.scale||d.slideIsDisabled)){e.disableScroll&&t.preventDefault();var n=t.touches[0];E={x:n.pageX-k.x,y:n.pageY-k.y},"undefined"==typeof C&&(C=!!(C||Math.abs(E.x)0||y==g.length-1&&E.x<0?Math.abs(E.x)/b+1:1),s(y-1,E.x+v[y-1],0),s(y,E.x+v[y],0),s(y+1,E.x+v[y+1],0)),e.onDrag&&e.onDrag())}},end:function(){var t=+new Date-k.time,n=Number(t)<250&&Math.abs(E.x)>20||Math.abs(E.x)>b/2,i=!y&&E.x>0||y==g.length-1&&E.x<0;e.continuous&&(i=!1);var r=E.x<0;C||(n&&!i?(r?(e.continuous?(a(o(y-1),-b,0),a(o(y+2),b,0)):a(y-1,-b,0),a(y,v[y]-b,_),a(o(y+1),v[o(y+1)]-b,_),y=o(y+1)):(e.continuous?(a(o(y+1),b,0),a(o(y-2),-b,0)):a(y+1,b,0),a(y,v[y]+b,_),a(o(y-1),v[o(y-1)]+b,_),y=o(y-1)),e.callback&&e.callback(y,g[y])):e.continuous?(a(o(y-1),-b,_),a(y,0,_),a(o(y+1),b,_)):(a(y-1,-b,_),a(y,0,_),a(y+1,b,_))),h.touch?(w.removeEventListener("touchmove",T,!1),w.removeEventListener("touchend",T,!1)):(w.removeEventListener("mousemove",T,!1),w.removeEventListener("mouseup",T,!1),document.removeEventListener("mouseup",T,!1)),e.onDragEnd&&e.onDragEnd()},transitionEnd:function(t){parseInt(t.target.getAttribute("data-index"),10)==y&&(x&&l(),e.transitionEnd&&e.transitionEnd.call(t,y,g[y]))}};this.update=function(){setTimeout(t)},this.setup=function(){t()},this.loop=function(t){return arguments.length&&(e.continuous=!!t),e.continuous},this.enableSlide=function(e){return arguments.length&&(this.slideIsDisabled=!e),!this.slideIsDisabled},this.slide=this.select=function(e,t){u(),r(e,t)},this.prev=this.previous=function(){u(),n()},this.next=function(){u(),i()},this.stop=function(){u()},this.start=function(){l()},this.autoPlay=function(e){!x||0>x?u():(x=e,l())},this.currentIndex=this.selected=function(){return y},this.slidesCount=this.count=function(){return $},this.kill=function(){u(),w.style.width="",w.style.left="",g&&(g=[]),h.addEventListener?(w.removeEventListener("touchstart",T,!1),w.removeEventListener("webkitTransitionEnd",T,!1),w.removeEventListener("msTransitionEnd",T,!1),w.removeEventListener("oTransitionEnd",T,!1),w.removeEventListener("otransitionend",T,!1),w.removeEventListener("transitionend",T,!1),window.removeEventListener("resize",T,!1)):window.onresize=null},this.load=function(){t(),x&&l(),h.addEventListener?(h.touch?w.addEventListener("touchstart",T,!1):w.addEventListener("mousedown",T,!1),h.transitions&&(w.addEventListener("webkitTransitionEnd",T,!1),w.addEventListener("msTransitionEnd",T,!1),w.addEventListener("oTransitionEnd",T,!1),w.addEventListener("otransitionend",T,!1),w.addEventListener("transitionend",T,!1)),window.addEventListener("resize",T,!1)):window.onresize=function(){t()}}}}})}(ionic),function(e){"use strict";e.views.Toggle=e.views.View.inherit({initialize:function(t){var n=this;this.el=t.el,this.checkbox=t.checkbox,this.track=t.track,this.handle=t.handle,this.openPercent=-1,this.onChange=t.onChange||function(){},this.triggerThreshold=t.triggerThreshold||20,this.dragStartHandler=function(e){n.dragStart(e)},this.dragHandler=function(e){n.drag(e)},this.holdHandler=function(e){n.hold(e)},this.releaseHandler=function(e){n.release(e)},this.dragStartGesture=e.onGesture("dragstart",this.dragStartHandler,this.el),this.dragGesture=e.onGesture("drag",this.dragHandler,this.el),this.dragHoldGesture=e.onGesture("hold",this.holdHandler,this.el),this.dragReleaseGesture=e.onGesture("release",this.releaseHandler,this.el)},destroy:function(){e.offGesture(this.dragStartGesture,"dragstart",this.dragStartGesture),e.offGesture(this.dragGesture,"drag",this.dragGesture),e.offGesture(this.dragHoldGesture,"hold",this.holdHandler),e.offGesture(this.dragReleaseGesture,"release",this.releaseHandler)},tap:function(){"disabled"!==this.el.getAttribute("disabled")&&this.val(!this.checkbox.checked)},dragStart:function(e){this.checkbox.disabled||(this._dragInfo={width:this.el.offsetWidth,left:this.el.offsetLeft,right:this.el.offsetLeft+this.el.offsetWidth,triggerX:this.el.offsetWidth/2,initialState:this.checkbox.checked},e.gesture.srcEvent.preventDefault(),this.hold(e))},drag:function(t){var n=this;this._dragInfo&&(t.gesture.srcEvent.preventDefault(),e.requestAnimationFrame(function(){if(n._dragInfo){var e=t.gesture.touches[0].pageX-n._dragInfo.left,i=n._dragInfo.width-n.triggerThreshold;n._dragInfo.initialState?en._dragInfo.triggerX&&n.setOpenPercent(100):ei&&n.setOpenPercent(100)}}))},endDrag:function(){this._dragInfo=null},hold:function(){this.el.classList.add("dragging")},release:function(e){this.el.classList.remove("dragging"),this.endDrag(e)},setOpenPercent:function(t){if(this.openPercent<0||tthis.openPercent+3)if(this.openPercent=t,0===t)this.val(!1);else if(100===t)this.val(!0);else{var n=Math.round(t/100*this.track.offsetWidth-this.handle.offsetWidth);n=1>n?0:n,this.handle.style[e.CSS.TRANSFORM]="translate3d("+n+"px,0,0)"}},val:function(t){return(t===!0||t===!1)&&(""!==this.handle.style[e.CSS.TRANSFORM]&&(this.handle.style[e.CSS.TRANSFORM]=""),this.checkbox.checked=t,this.openPercent=t?100:0,this.onChange&&this.onChange()),this.checkbox.checked}})}(ionic)}(),define("ionic",["angular"],function(e){return function(){var t;return t||e.ionic}}(this)),"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(e,t,n){"use strict";function i(e,t){return R(new(R(function(){},{prototype:e})),t)}function o(e){return V(arguments,function(t){t!==e&&V(t,function(t,n){e.hasOwnProperty(n)||(e[n]=t)})}),e}function r(e,t){var n=[];for(var i in e.path){if(e.path[i]!==t.path[i])break;n.push(e.path[i])}return n}function a(e){if(Object.keys)return Object.keys(e);var n=[];return t.forEach(e,function(e,t){n.push(t)}),n}function s(e,t){if(Array.prototype.indexOf)return e.indexOf(t,Number(arguments[2])||0);var n=e.length>>>0,i=Number(arguments[2])||0;for(i=0>i?Math.ceil(i):Math.floor(i),0>i&&(i+=n);n>i;i++)if(i in e&&e[i]===t)return i;return-1}function c(e,t,n,i){var o,c=r(n,i),l={},u=[];for(var d in c)if(c[d].params&&(o=a(c[d].params),o.length))for(var f in o)s(u,o[f])>=0||(u.push(o[f]),l[o[f]]=e[o[f]]);return R({},l,t)}function l(e,t,n){if(!n){n=[];for(var i in e)n.push(i)}for(var o=0;o "));if(b[n]=i,P(e))g.push(n,[function(){return t.get(e)}],l);else{var o=t.annotate(e);V(o,function(e){e!==n&&c.hasOwnProperty(e)&&p(c[e],e)}),g.push(n,e,o)}v.pop(),b[n]=r}}function h(e){return M(e)&&e.then&&e.$$promises}if(!M(c))throw new Error("'invocables' must be an object");var m=a(c||{}),g=[],v=[],b={};return V(c,p),c=v=b=null,function(i,r,a){function s(){--w||(y||o($,r.$$values),v.$$values=$,v.$$promises=v.$$promises||!0,delete v.$$inheritedValues,p.resolve($))}function c(e){v.$$failure=e,p.reject(e)}function l(n,o,r){function l(e){d.reject(e),c(e)}function u(){if(!O(v.$$failure))try{d.resolve(t.invoke(o,a,$)),d.promise.then(function(e){$[n]=e,s()},l)}catch(e){l(e)}}var d=e.defer(),f=0;V(r,function(e){b.hasOwnProperty(e)&&!i.hasOwnProperty(e)&&(f++,b[e].then(function(t){$[e]=t,--f||u()},l))}),f||u(),b[n]=d.promise}if(h(i)&&a===n&&(a=r,r=i,i=null),i){if(!M(i))throw new Error("'locals' must be an object")}else i=u;if(r){if(!h(r))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else r=f;var p=e.defer(),v=p.promise,b=v.$$promises={},$=R({},i),w=1+g.length/3,y=!1;if(O(r.$$failure))return c(r.$$failure),v;r.$$inheritedValues&&o($,d(r.$$inheritedValues,m)),R(b,r.$$promises),r.$$values?(y=o($,d(r.$$values,m)),v.$$inheritedValues=d(r.$$values,m),s()):(r.$$inheritedValues&&(v.$$inheritedValues=d(r.$$inheritedValues,m)),r.then(s,c));for(var _=0,S=g.length;S>_;_+=3)i.hasOwnProperty(g[_])?s():l(g[_],g[_+1],g[_+2]);return v}},this.resolve=function(e,t,n,i){return this.study(e)(t,n,i)}}function m(e,t,n){this.fromConfig=function(e,t,n){return O(e.template)?this.fromString(e.template,t):O(e.templateUrl)?this.fromUrl(e.templateUrl,t):O(e.templateProvider)?this.fromProvider(e.templateProvider,t,n):null},this.fromString=function(e,t){return L(e)?e(t):e},this.fromUrl=function(n,i){return L(n)&&(n=n(i)),null==n?null:e.get(n,{cache:t,headers:{Accept:"text/html"}}).then(function(e){return e.data})},this.fromProvider=function(e,t,i){return n.invoke(e,null,i||{params:t})}}function g(e,t,o){function r(t,n,i,o){if(g.push(t),h[t])return h[t];if(!/^\w+(-+\w+)*(?:\[\])?$/.test(t))throw new Error("Invalid parameter name '"+t+"' in pattern '"+e+"'");if(m[t])throw new Error("Duplicate parameter name '"+t+"' in pattern '"+e+"'");return m[t]=new F.Param(t,n,i,o),m[t]}function a(e,t,n){var i=["",""],o=e.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!t)return o;switch(n){case!1:i=["(",")"];break;case!0:i=["?(",")?"];break;default:i=["("+n+"|",")?"]}return o+i[0]+t+i[1]}function s(n,o){var r,a,s,c,l;return r=n[2]||n[3],l=t.params[r],s=e.substring(f,n.index),a=o?n[4]:n[4]||("*"==n[1]?".*":null),c=F.type(a||"string")||i(F.type("string"),{pattern:new RegExp(a)}),{id:r,regexp:a,segment:s,type:c,cfg:l}}t=R({params:{}},M(t)?t:{});var c,l=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,u=/([:]?)([\w\[\]-]+)|\{([\w\[\]-]+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,d="^",f=0,p=this.segments=[],h=o?o.params:{},m=this.params=o?o.params.$$new():new F.ParamSet,g=[];this.source=e;for(var v,b,$;(c=l.exec(e))&&(v=s(c,!1),!(v.segment.indexOf("?")>=0));)b=r(v.id,v.type,v.cfg,"path"),d+=a(v.segment,b.type.pattern.source,b.squash),p.push(v.segment),f=l.lastIndex;$=e.substring(f);var w=$.indexOf("?");if(w>=0){var y=this.sourceSearch=$.substring(w);if($=$.substring(0,w),this.sourcePath=e.substring(0,f+w),y.length>0)for(f=0;c=u.exec(y);)v=s(c,!0),b=r(v.id,v.type,v.cfg,"search"),f=l.lastIndex}else this.sourcePath=e,this.sourceSearch="";d+=a($)+(t.strict===!1?"/?":"")+"$",p.push($),this.regexp=new RegExp(d,t.caseInsensitive?"i":n),this.prefix=p[0],this.$$paramNames=g}function v(e){R(this,e)}function b(){function e(e){return null!=e?e.toString().replace(/\//g,"%2F"):e}function o(e){return null!=e?e.toString().replace(/%2F/g,"/"):e}function r(e){return this.pattern.test(e)}function c(){return{strict:$,caseInsensitive:m}}function l(e){return L(e)||N(e)&&L(e[e.length-1])}function u(){for(;S.length;){var e=S.shift();if(e.pattern)throw new Error("You cannot override a type's .pattern at runtime.");t.extend(y[e.name],h.invoke(e.def))}}function d(e){R(this,e||{})}F=this;var h,m=!1,$=!0,w=!1,y={},_=!0,S=[],C={string:{encode:e,decode:o,is:r,pattern:/[^/]*/},"int":{encode:e,decode:function(e){return parseInt(e,10)},is:function(e){return O(e)&&this.decode(e.toString())===e},pattern:/\d+/},bool:{encode:function(e){return e?1:0},decode:function(e){return 0!==parseInt(e,10)},is:function(e){return e===!0||e===!1},pattern:/0|1/},date:{encode:function(e){return this.is(e)?[e.getFullYear(),("0"+(e.getMonth()+1)).slice(-2),("0"+e.getDate()).slice(-2)].join("-"):n},decode:function(e){if(this.is(e))return e;var t=this.capture.exec(e);return t?new Date(t[1],t[2]-1,t[3]):n},is:function(e){return e instanceof Date&&!isNaN(e.valueOf())},equals:function(e,t){return this.is(e)&&this.is(t)&&e.toISOString()===t.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:t.toJson,decode:t.fromJson,is:t.isObject,equals:t.equals,pattern:/[^/]*/},any:{encode:t.identity,decode:t.identity,is:t.identity,equals:t.equals,pattern:/.*/}};b.$$getDefaultValue=function(e){if(!l(e.value))return e.value;if(!h)throw new Error("Injectable functions cannot be called at configuration time");return h.invoke(e.value)},this.caseInsensitive=function(e){return O(e)&&(m=e),m},this.strictMode=function(e){return O(e)&&($=e),$},this.defaultSquashPolicy=function(e){if(!O(e))return w;if(e!==!0&&e!==!1&&!P(e))throw new Error("Invalid squash policy: "+e+". Valid policies: false, true, arbitrary-string");return w=e,e},this.compile=function(e,t){return new g(e,R(c(),t))},this.isMatcher=function(e){if(!M(e))return!1;var t=!0;return V(g.prototype,function(n,i){L(n)&&(t=t&&O(e[i])&&L(e[i]))}),t},this.type=function(e,t,n){if(!O(t))return y[e];if(y.hasOwnProperty(e))throw new Error("A type named '"+e+"' has already been defined.");return y[e]=new v(R({name:e},t)),n&&(S.push({name:e,def:n}),_||u()),this},V(C,function(e,t){y[t]=new v(R({name:t},e))}),y=i(y,{}),this.$get=["$injector",function(e){return h=e,_=!1,u(),V(C,function(e,t){y[t]||(y[t]=new v(e))}),this}],this.Param=function(e,t,i,o){function r(e){var t=M(e)?a(e):[],n=-1===s(t,"value")&&-1===s(t,"type")&&-1===s(t,"squash")&&-1===s(t,"array");return n&&(e={value:e}),e.$$fn=l(e.value)?e.value:function(){return e.value},e}function c(t,n,i){if(t.type&&n)throw new Error("Param '"+e+"' has two type configurations.");return n?n:t.type?t.type instanceof v?t.type:new v(t.type):"config"===i?y.any:y.string}function u(){var t={array:"search"===o?"auto":!1},n=e.match(/\[\]$/)?{array:!0}:{};return R(t,n,i).array}function d(e,t){var n=e.squash;if(!t||n===!1)return!1;if(!O(n)||null==n)return w;if(n===!0||P(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function m(e,t,i,o){var r,a,c=[{from:"",to:i||t?n:""},{from:null,to:i||t?n:""}];return r=N(e.replace)?e.replace:[],P(o)&&r.push({from:o,to:n}),a=p(r,function(e){return e.from}),f(c,function(e){return-1===s(a,e.from)}).concat(r)}function g(){if(!h)throw new Error("Injectable functions cannot be called at configuration time");return h.invoke(i.$$fn)}function b(e){function t(e){return function(t){return t.from===e}}function n(e){var n=p(f(_.replace,t(e)),function(e){return e.to});return n.length?n[0]:e}return e=n(e),O(e)?_.type.decode(e):g()}function $(){return"{Param:"+e+" "+t+" squash: '"+x+"' optional: "+C+"}"}var _=this;i=r(i),t=c(i,t,o);var S=u();t=S?t.$asArray(S,"search"===o):t,"string"!==t.name||S||"path"!==o||i.value!==n||(i.value="");var C=i.value!==n,x=d(i,C),k=m(i,S,C,x);R(this,{id:e,type:t,location:o,array:S,squash:x,replace:k,isOptional:C,value:b,dynamic:n,config:i,toString:$})},d.prototype={$$new:function(){return i(this,R(new d,{$$parent:this}))},$$keys:function(){for(var e=[],t=[],n=this,i=a(d.prototype);n;)t.push(n),n=n.$$parent;return t.reverse(),V(t,function(t){V(a(t),function(t){-1===s(e,t)&&-1===s(i,t)&&e.push(t)})}),e},$$values:function(e){var t={},n=this;return V(n.$$keys(),function(i){t[i]=n[i].value(e&&e[i])}),t},$$equals:function(e,t){var n=!0,i=this;return V(i.$$keys(),function(o){var r=e&&e[o],a=t&&t[o];i[o].type.equals(r,a)||(n=!1)}),n},$$validates:function(e){var t,n,i,o=!0,r=this;return V(this.$$keys(),function(a){i=r[a],n=e[a],t=!n&&i.isOptional,o=o&&(t||!!i.type.is(n))}),o},$$parent:n},this.ParamSet=d}function $(e,i){function o(e){var t=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(e.source);return null!=t?t[1].replace(/\\(.)/g,"$1"):""}function r(e,t){return e.replace(/\$(\$|\d{1,2})/,function(e,n){return t["$"===n?0:Number(n)]})}function a(e,t,n){if(!n)return!1;var i=e.invoke(t,t,{$match:n});return O(i)?i:!0}function s(i,o,r,a){function s(e,t,n){return"/"===m?e:t?m.slice(0,-1)+e:n?m.slice(1)+e:e}function f(e){function t(e){var t=e(r,i);return t?(P(t)&&i.replace().url(t),!0):!1}if(!e||!e.defaultPrevented){var o=h&&i.url()===h;if(h=n,o)return!0;var a,s=l.length;for(a=0;s>a;a++)if(t(l[a]))return;u&&t(u)}}function p(){return c=c||o.$on("$locationChangeSuccess",f)}var h,m=a.baseHref(),g=i.url();return d||p(),{sync:function(){f()},listen:function(){return p()},update:function(e){return e?void(g=i.url()):void(i.url()!==g&&(i.url(g),i.replace()))},push:function(e,t,o){i.url(e.format(t||{})),h=o&&o.$$avoidResync?i.url():n,o&&o.replace&&i.replace()},href:function(n,o,r){if(!n.validates(o))return null;var a=e.html5Mode();t.isObject(a)&&(a=a.enabled);var c=n.format(o);if(r=r||{},a||null===c||(c="#"+e.hashPrefix()+c),c=s(c,a,r.absolute),!r.absolute||!c)return c;var l=!a&&c?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,l,c].join("")}}}var c,l=[],u=null,d=!1;this.rule=function(e){if(!L(e))throw new Error("'rule' must be a function");return l.push(e),this},this.otherwise=function(e){if(P(e)){var t=e;e=function(){return t}}else if(!L(e))throw new Error("'rule' must be a function");return u=e,this},this.when=function(e,t){var n,s=P(t);if(P(e)&&(e=i.compile(e)),!s&&!L(t)&&!N(t))throw new Error("invalid 'handler' in when()");var c={matcher:function(e,t){return s&&(n=i.compile(t),t=["$match",function(e){return n.format(e)}]),R(function(n,i){return a(n,t,e.exec(i.path(),i.search()))},{prefix:P(e.prefix)?e.prefix:""})},regex:function(e,t){if(e.global||e.sticky)throw new Error("when() RegExp must not be global or sticky");return s&&(n=t,t=["$match",function(e){return r(n,e)}]),R(function(n,i){return a(n,t,e.exec(i.path()))},{prefix:o(e)})}},l={matcher:i.isMatcher(e),regex:e instanceof RegExp};for(var u in l)if(l[u])return this.rule(c[u](e,t));throw new Error("invalid 'what' in when()")},this.deferIntercept=function(e){e===n&&(e=!0),d=e},this.$get=s,s.$inject=["$location","$rootScope","$injector","$browser"]}function w(e,o){function r(e){return 0===e.indexOf(".")||0===e.indexOf("^")}function d(e,t){if(!e)return n;var i=P(e),o=i?e:e.name,a=r(o);if(a){if(!t)throw new Error("No reference point given for path '"+o+"'");t=d(t);for(var s=o.split("."),c=0,l=s.length,u=t;l>c;c++)if(""!==s[c]||0!==c){if("^"!==s[c])break;if(!u.parent)throw new Error("Path '"+o+"' not valid for state '"+t.name+"'");u=u.parent}else u=t;s=s.slice(c).join("."),o=u.name+(u.name&&s?".":"")+s}var f=C[o];return!f||!i&&(i||f!==e&&f.self!==e)?n:f}function f(e,t){x[e]||(x[e]=[]),x[e].push(t)}function h(e){for(var t=x[e]||[];t.length;)m(t.shift())}function m(t){t=i(t,{self:t,resolve:t.resolve||{},toString:function(){return this.name}});var n=t.name;if(!P(n)||n.indexOf("@")>=0)throw new Error("State must have a valid name");if(C.hasOwnProperty(n))throw new Error("State '"+n+"'' is already defined");var o=-1!==n.indexOf(".")?n.substring(0,n.lastIndexOf(".")):P(t.parent)?t.parent:M(t.parent)&&P(t.parent.name)?t.parent.name:"";if(o&&!C[o])return f(o,t.self);for(var r in E)L(E[r])&&(t[r]=E[r](t,E.$delegates[r]));return C[n]=t,!t[k]&&t.url&&e.when(t.url,["$match","$stateParams",function(e,n){S.$current.navigable==t&&l(e,n)||S.transitionTo(t,e,{inherit:!0,location:!1})}]),h(n),t}function g(e){return e.indexOf("*")>-1}function v(e){var t=e.split("."),n=S.$current.name.split(".");if("**"===t[0]&&(n=n.slice(s(n,t[1])),n.unshift("**")),"**"===t[t.length-1]&&(n.splice(s(n,t[t.length-2])+1,Number.MAX_VALUE),n.push("**")),t.length!=n.length)return!1;for(var i=0,o=t.length;o>i;i++)"*"===t[i]&&(n[i]="*");return n.join("")===t.join("")}function b(e,t){return P(e)&&!O(t)?E[e]:L(t)&&P(e)?(E[e]&&!E.$delegates[e]&&(E.$delegates[e]=E[e]),E[e]=t,this):this}function $(e,t){return M(e)?t=e:t.name=e,m(t),this}function w(e,o,r,s,f,h,m){function b(t,n,i,r){var a=e.$broadcast("$stateNotFound",t,n,i);if(a.defaultPrevented)return m.update(),E;if(!a.retry)return null;if(r.$retry)return m.update(),T;var s=S.transition=o.when(a.retry);return s.then(function(){return s!==S.transition?w:(t.options.$retry=!0,S.transitionTo(t.to,t.toParams,t.options))},function(){return E}),m.update(),s}function $(e,n,i,a,c,l){var d=i?n:u(e.params.$$keys(),n),p={$stateParams:d};c.resolve=f.resolve(e.resolve,p,c.resolve,e);var h=[c.resolve.then(function(e){c.globals=e})];return a&&h.push(a),V(e.views,function(n,i){var o=n.resolve&&n.resolve!==e.resolve?n.resolve:{};o.$template=[function(){return r.load(i,{view:n,locals:p,params:d,notify:l.notify})||""}],h.push(f.resolve(o,p,c.resolve,e).then(function(r){if(L(n.controllerProvider)||N(n.controllerProvider)){var a=t.extend({},o,p);r.$$controller=s.invoke(n.controllerProvider,null,a)}else r.$$controller=n.controller;r.$$state=e,r.$$controllerAs=n.controllerAs,c[i]=r}))}),o.all(h).then(function(){return c})}var w=o.reject(new Error("transition superseded")),x=o.reject(new Error("transition prevented")),E=o.reject(new Error("transition aborted")),T=o.reject(new Error("transition failed"));return _.locals={resolve:null,globals:{$stateParams:{}}},S={params:{},current:_.self,$current:_,transition:null},S.reload=function(){return S.transitionTo(S.current,h,{reload:!0,inherit:!1,notify:!0})},S.go=function(e,t,n){return S.transitionTo(e,t,R({inherit:!0,relative:S.$current},n))},S.transitionTo=function(t,n,r){n=n||{},r=R({location:!0,inherit:!1,relative:null,notify:!0,reload:!1,$retry:!1},r||{});var a,l=S.$current,f=S.params,p=l.path,g=d(t,r.relative);if(!O(g)){var v={to:t,toParams:n,options:r},C=b(v,l.self,f,r);if(C)return C;if(t=v.to,n=v.toParams,r=v.options,g=d(t,r.relative),!O(g)){if(!r.relative)throw new Error("No such state '"+t+"'");throw new Error("Could not resolve '"+t+"' from state '"+r.relative+"'")}}if(g[k])throw new Error("Cannot transition to abstract state '"+t+"'");if(r.inherit&&(n=c(h,n||{},S.$current,g)),!g.params.$$validates(n))return T;n=g.params.$$values(n),t=g;var E=t.path,I=0,D=E[I],A=_.locals,L=[];if(!r.reload)for(;D&&D===p[I]&&D.ownParams.$$equals(n,f);)A=L[I]=D.locals,I++,D=E[I];if(y(t,l,A,r))return t.self.reloadOnSearch!==!1&&m.update(),S.transition=null,o.when(S.current);if(n=u(t.params.$$keys(),n||{}),r.notify&&e.$broadcast("$stateChangeStart",t.self,n,l.self,f).defaultPrevented)return m.update(),x;for(var P=o.when(A),M=I;M=I;i--)a=p[i],a.self.onExit&&s.invoke(a.self.onExit,a.self,a.locals.globals),a.locals=null;for(i=I;i=0?o:o+"@"+(r?r.state.name:"")}function k(e,t){var n,i=e.match(/^\s*({[^}]*})\s*$/);if(i&&(e=t+"("+i[1]+")"),n=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+e+"'");return{state:n[1],paramExpr:n[3]||null}}function E(e){var t=e.parent().inheritedData("$uiView");return t&&t.state&&t.state.name?t.state:void 0}function T(e,n){var i=["location","inherit","reload"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(o,r,a,s){var c=k(a.uiSref,e.current.name),l=null,u=E(r)||e.$current,d=null,f="A"===r.prop("tagName"),p="FORM"===r[0].nodeName,h=p?"action":"href",m=!0,g={relative:u,inherit:!0},v=o.$eval(a.uiSrefOpts)||{};t.forEach(i,function(e){e in v&&(g[e]=v[e])});var b=function(n){if(n&&(l=t.copy(n)),m){d=e.href(c.state,l,g);var i=s[1]||s[0];return i&&i.$$setStateInfo(c.state,l),null===d?(m=!1,!1):void a.$set(h,d)}};c.paramExpr&&(o.$watch(c.paramExpr,function(e){e!==l&&b(e)},!0),l=t.copy(o.$eval(c.paramExpr))),b(),p||r.bind("click",function(t){var i=t.which||t.button;if(!(i>1||t.ctrlKey||t.metaKey||t.shiftKey||r.attr("target"))){var o=n(function(){e.go(c.state,l,g)});t.preventDefault();var a=f&&!d?1:0;t.preventDefault=function(){a--<=0&&n.cancel(o)}}})}}}function I(e,t,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,i,o){function r(){a()?i.addClass(l):i.removeClass(l)}function a(){return"undefined"!=typeof o.uiSrefActiveEq?s&&e.is(s.name,c):s&&e.includes(s.name,c)}var s,c,l;l=n(o.uiSrefActiveEq||o.uiSrefActive||"",!1)(t),this.$$setStateInfo=function(t,n){s=e.get(t,E(i)),c=n,r()},t.$on("$stateChangeSuccess",r)}]}}function D(e){var t=function(t){return e.is(t)};return t.$stateful=!0,t}function A(e){var t=function(t){return e.includes(t)};return t.$stateful=!0,t}var O=t.isDefined,L=t.isFunction,P=t.isString,M=t.isObject,N=t.isArray,V=t.forEach,R=t.extend,B=t.copy;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),h.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",h),m.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",m);var F;g.prototype.concat=function(e,t){var n={caseInsensitive:F.caseInsensitive(),strict:F.strictMode(),squash:F.defaultSquashPolicy()};return new g(this.sourcePath+e+this.sourceSearch,R(n,t),this)},g.prototype.toString=function(){return this.source},g.prototype.exec=function(e,t){function n(e){function t(e){return e.split("").reverse().join("")}function n(e){return e.replace(/\\-/,"-")}var i=t(e).split(/-(?!\\)/),o=p(i,t);return p(o,n).reverse()}var i=this.regexp.exec(e);if(!i)return null;t=t||{};var o,r,a,s=this.parameters(),c=s.length,l=this.segments.length-1,u={};if(l!==i.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(o=0;l>o;o++){a=s[o];var d=this.params[a],f=i[o+1];for(r=0;ro;o++)a=s[o],u[a]=this.params[a].value(t[a]);return u},g.prototype.parameters=function(e){return O(e)?this.params[e]||null:this.$$paramNames},g.prototype.validates=function(e){return this.params.$$validates(e)},g.prototype.format=function(e){function t(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}e=e||{};var n=this.segments,i=this.parameters(),o=this.params;if(!this.validates(e))return null;var r,a=!1,s=n.length-1,c=i.length,l=n[0];for(r=0;c>r;r++){var u=s>r,d=i[r],f=o[d],h=f.value(e[d]),m=f.isOptional&&f.type.equals(f.value(),h),g=m?f.squash:!1,v=f.type.encode(h);if(u){var b=n[r+1];if(g===!1)null!=v&&(l+=N(v)?p(v,t).join("-"):encodeURIComponent(v)),l+=b;else if(g===!0){var $=l.match(/\/$/)?/\/?(.*)/:/(.*)/;l+=b.match($)[1]}else P(g)&&(l+=g+b)}else{if(null==v||m&&g!==!1)continue;N(v)||(v=[v]),v=p(v,encodeURIComponent).join("&"+d+"="),l+=(a?"&":"?")+(d+"="+v),a=!0}}return l},v.prototype.is=function(){return!0},v.prototype.encode=function(e){return e},v.prototype.decode=function(e){return e},v.prototype.equals=function(e,t){return e==t},v.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},v.prototype.pattern=/.*/,v.prototype.toString=function(){return"{Type:"+this.name+"}"},v.prototype.$asArray=function(e,t){function i(e,t){function i(e,t){return function(){return e[t].apply(e,arguments)}}function o(e){return N(e)?e:O(e)?[e]:[]}function r(e){switch(e.length){case 0:return n;case 1:return"auto"===t?e[0]:e;default:return e}}function a(e){return!e}function s(e,t){return function(n){n=o(n);var i=p(n,e);return t===!0?0===f(i,a).length:r(i)}}function c(e){return function(t,n){var i=o(t),r=o(n);if(i.length!==r.length)return!1;for(var a=0;a>>32-t}function i(e,t,n){return e^t^n}function o(e,t){var n=(65535&t)+(65535&e),i=(t>>>16)+(e>>>16)+(n>>>16);return(65535&i)<<16|65535&n}var r="0123456789abcdef";return function(e){for(var t,n=[],i=4*e.length,o=0;i>o;o++)t=e[o>>2]>>8*(3-o%4),n.push(r.charAt(t>>4&15)+r.charAt(15&t));return n.join("")}(function(e,r){var a,s,c,l,u,d=e.length,f=1732584193,p=4023233417,h=2562383102,m=271733878,g=3285377520,v=[];t(v,1518500249,20),t(v,1859775393,20),t(v,2400959708,20),t(v,3395469782,20),e[r>>5]|=128<<24-r%32,e[(r+65>>9<<4)+15]=r;for(var b=0;d>b;b+=16){a=f,s=p,c=h,l=m,u=g;for(var $=0,w=[];80>$;$++){w[$]=16>$?e[$+b]:n(w[$-3]^w[$-8]^w[$-14]^w[$-16],1);var y=function(e,t,n,i,o){var r=(65535&o)+(65535&e)+(65535&t)+(65535&n)+(65535&i),a=(o>>>16)+(e>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(r>>>16);return(65535&a)<<16|65535&r}(20>$?function(e,t,n){return e&t^~e&n}(s,c,l):40>$?i(s,c,l):60>$?function(e,t,n){return e&t^e&n^t&n}(s,c,l):i(s,c,l),u,v[$],w[$],n(a,5));u=l,l=c,c=n(s,30),s=a,a=y}f=o(f,a),p=o(p,s),h=o(h,c),m=o(m,l),g=o(g,u)}return[f,p,h,m,g]}(function(e){for(var t=[],n=255,i=8*e.length,o=0;i>o;o+=8)t[o>>5]|=(e.charCodeAt(o/8)&n)<<24-o%32;return t}(e).slice(),8*e.length))},log:function(e,t){"use strict";ImgCache.options.debug&&(t===LOG_LEVEL_INFO&&(e="INFO: "+e),t===LOG_LEVEL_WARNING&&(e="WARN: "+e),t===LOG_LEVEL_ERROR&&(e="ERROR: "+e),console.log(e))}},jQuery:window.jQuery||window.Zepto?!0:!1,jQueryLite:"undefined"!=typeof window.angular&&window.angular.element?!0:!1,ready:!1,attributes:{}},LOG_LEVEL_INFO=1,LOG_LEVEL_WARNING=2,LOG_LEVEL_ERROR=3;!function(e){"use strict";var t={};t.sanitizeURI=function(e){if(ImgCache.options.skipURIencoding)return e;var t=encodeURI(e);return t},t.URI=function(e){e||(e="");var t=/^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/,n=e.match(t);this.scheme=n[1]||null,this.authority=n[2]||null,this.path=n[3]||null,this.query=n[4]||null,this.fragment=n[5]||null},t.URIGetFileName=function(e){if(e){var t=e.lastIndexOf("/");if(t)return e.substr(t+1).toLowerCase()}},t.URIGetPath=function(e){if(e){var n=t.URI(e);return n.path.toLowerCase()}},t.FileGetExtension=function(e){if(!e)return"";e=e.split("?")[0];var t=e.split(".").pop();return!t||t.length>4?"":t},t.isCordova=function(){return"undefined"!=typeof cordova||"undefined"!=typeof phonegap},t.isCordovaAndroid=function(){return t.isCordova()&&device&&device.platform&&device.platform.toLowerCase().indexOf("android")>=0},t.isCordovaAndroidOlderThan4=function(){return t.isCordovaAndroid()&&device.version&&(0===device.version.indexOf("2.")||0===device.version.indexOf("3."))},t.EntryToURL=function(e){return t.isCordovaAndroidOlderThan4()&&"function"==typeof e.toNativeURL?e.toNativeURL():e.toURL()},t.EntryGetURL=function(e){return"function"==typeof e.toURL?t.EntryToURL(e):e.toURI()},t.EntryGetPath=function(e){return t.isCordova()&&"function"==typeof e.toURL?t.EntryToURL(e):e.fullPath},t.getCordovaStorageType=function(e){if("undefined"!=typeof LocalFileSystem){if(e&&LocalFileSystem.hasOwnProperty("PERSISTENT"))return LocalFileSystem.PERSISTENT;if(!e&&LocalFileSystem.hasOwnProperty("TEMPORARY"))return LocalFileSystem.TEMPORARY}return e?window.PERSISTENT:window.TEMPORARY};var n={};n.trigger=function(t,n){ImgCache.jQuery?e(t).trigger(n):(window.CustomEvent||(window.CustomEvent=function(e,t){var n;t=t||{bubbles:!1,cancelable:!1,detail:void 0};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail)}catch(i){n=document.createEvent("Event"),n.initEvent(e,t.bubbles,t.cancelable),n.detail=t.detail}return n}),t.dispatchEvent(new CustomEvent(n)))},n.removeAttribute=function(e,t){ImgCache.jQuery||ImgCache.jQueryLite?e.removeAttr(t):e.removeAttribute(t)},n.setAttribute=function(e,t,n){ImgCache.jQuery||ImgCache.jQueryLite?e.attr(t,n):e.setAttribute(t,n)},n.getAttribute=function(e,t){return ImgCache.jQuery||ImgCache.jQueryLite?e.attr(t):e.getAttribute(t)},n.getBackgroundImage=function(e){if(ImgCache.jQuery||ImgCache.jQueryLite)return e.css("background-image");var t=window.getComputedStyle(e,null);if(t)return t.backgroundImage},n.setBackgroundImage=function(e,t){ImgCache.jQuery||ImgCache.jQueryLite?e.css("background-image",t):e.style.backgroundImage=t};var i={attributes:{}};i.isImgCacheLoaded=function(){return ImgCache.attributes.filesystem&&ImgCache.attributes.dirEntry?!0:(ImgCache.overridables.log("ImgCache not loaded yet! - Have you called ImgCache.init() first?",LOG_LEVEL_WARNING),!1)},i.attributes.hasLocalStorage=!1,i.hasLocalStorage=function(){if(i.attributes.hasLocalStorage)return i.attributes.hasLocalStorage;try{var e=ImgCache.overridables.hash("imgcache_test");return localStorage.setItem(e,e),localStorage.removeItem(e),i.attributes.hasLocalStorage=!0,!0}catch(t){return ImgCache.overridables.log("Could not write to local storage: "+t.message,LOG_LEVEL_INFO),!1}},i.setCurrentSize=function(e){ImgCache.overridables.log("current size: "+e,LOG_LEVEL_INFO),i.hasLocalStorage()&&localStorage.setItem("imgcache:"+ImgCache.options.localCacheFolder,e)},i.getCachedFilePath=function(e){return ImgCache.options.localCacheFolder+"/"+i.getCachedFileName(e)},i.getCachedFileFullPath=function(e){var n=t.EntryGetPath(ImgCache.attributes.dirEntry);return(n?n+"/":"/")+i.getCachedFileName(e)},i.getCachedFileName=function(e){if(!e)return void ImgCache.overridables.log("No source given to getCachedFileName",LOG_LEVEL_WARNING);var n=ImgCache.overridables.hash(e),i=t.FileGetExtension(t.URIGetFileName(e));return n+(i?"."+i:"")},i.setNewImgPath=function(e,t,i){n.setAttribute(e,"src",t),n.setAttribute(e,o,i)},i.createCacheDir=function(e,i){if(!ImgCache.attributes.filesystem)return ImgCache.overridables.log("Filesystem instance was not initialised",LOG_LEVEL_ERROR),void(i&&i());var o=function(e){ImgCache.overridables.log("Failed to get/create local cache directory: "+e.code,LOG_LEVEL_ERROR),i&&i()},r=function(i){if(ImgCache.attributes.dirEntry=i,ImgCache.overridables.log("Local cache folder opened: "+t.EntryGetPath(i),LOG_LEVEL_INFO),t.isCordovaAndroid()){var r=function(){ImgCache.overridables.log(".nomedia file created.",LOG_LEVEL_INFO),e&&e()};i.getFile(".nomedia",{create:!0,exclusive:!1},r,o)}else i.setMetadata&&i.setMetadata(function(){ImgCache.overridables.log("com.apple.MobileBackup metadata set",LOG_LEVEL_INFO)},function(){ImgCache.overridables.log("com.apple.MobileBackup metadata could not be set",LOG_LEVEL_WARNING)},{"com.apple.MobileBackup":1}),e&&e();ImgCache.ready=!0,n.trigger(document,a)};ImgCache.attributes.filesystem.root.getDirectory(ImgCache.options.localCacheFolder,{create:!0,exclusive:!1},r,o)},i.FileTransferWrapper=function(e){t.isCordova()&&(this.fileTransfer=new FileTransfer),this.filesystem=e},i.FileTransferWrapper.prototype.download=function(e,t,n,i,o){var r=ImgCache.options.headers||{},a="function"==typeof o;if(this.fileTransfer)return a&&(this.fileTransfer.onprogress=o),this.fileTransfer.download(e,t,n,i,!1,{headers:r});var s=this.filesystem,c=function(n,i,o){ImgCache.overridables.log(n,i),o&&o({code:0,source:e,target:t})},l=new XMLHttpRequest;l.open("GET",e,!0),a&&(l.onprogress=o),l.responseType="blob";for(var u in r)l.setRequestHeader(u,r[u]);l.onload=function(){!l.response||200!==l.status&&0!==l.status?c("Image "+e+" could not be downloaded - status: "+l.status,3,i):s.root.getFile(t,{create:!0},function(e){e.createWriter(function(t){t.onerror=i,t.onwriteend=function(){n(e)},t.write(l.response,i)},i)},i)},l.onerror=function(){c("XHR error - Image "+e+" could not be downloaded - status: "+l.status,3,i)},l.send()},i.getBackgroundImageURL=function(e){var t=n.getBackgroundImage(e);if(t){var i=/\((.+)\)/,o=i.exec(t)[1];return o}},i.loadCachedFile=function(e,n,o,r,a){if(i.isImgCacheLoaded()&&e){var s=t.URIGetFileName(n),c=function(i){if(ImgCache.options.useDataURI){var c=function(t){var i=new FileReader;i.onloadend=function(t){var i=t.target.result;return i?(o(e,i,n),ImgCache.overridables.log("File "+s+" loaded from cache",LOG_LEVEL_INFO),void(r&&r(e))):(ImgCache.overridables.log("File in cache "+s+" is empty",LOG_LEVEL_WARNING),void(a&&a(e)))},i.readAsDataURL(t)},l=function(t){ImgCache.overridables.log("Failed to read file "+t.code,LOG_LEVEL_ERROR),a&&a(e)};i.file(c,l)}else{var u=t.EntryGetURL(i);o(e,u,n),ImgCache.overridables.log("File "+s+" loaded from cache",LOG_LEVEL_INFO),r&&r(e)}},l=function(){ImgCache.overridables.log("File "+s+" not in cache",LOG_LEVEL_INFO),a&&a(e)};ImgCache.attributes.filesystem.root.getFile(i.getCachedFilePath(n),{create:!1},c,l)}};var o="data-old-src",r="data-old-background",a="ImgCacheReady";ImgCache.init=function(e,n){ImgCache.attributes.init_callback=e;var o=function(e){if(ImgCache.options.cacheClearSize>0){var t=ImgCache.getCurrentSize();t>1024*ImgCache.options.cacheClearSize*1024?ImgCache.clearCache(e,e):e&&e()}else e&&e()},r=function(e){ImgCache.overridables.log("LocalFileSystem opened",LOG_LEVEL_INFO),ImgCache.attributes.filesystem=e,i.createCacheDir(function(){o(ImgCache.attributes.init_callback)},n)},a=function(e){ImgCache.overridables.log("Failed to initialise LocalFileSystem "+e.code,LOG_LEVEL_ERROR),n&&n()};if(t.isCordova())window.requestFileSystem(t.getCordovaStorageType(ImgCache.options.usePersistentCache),0,r,a);else{if(window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.storageInfo=window.storageInfo||(ImgCache.options.usePersistentCache?navigator.webkitPersistentStorage:navigator.webkitTemporaryStorage),!window.storageInfo)return ImgCache.overridables.log("Your browser does not support the html5 File API",LOG_LEVEL_WARNING),void(n&&n());var s=ImgCache.options.chromeQuota;window.storageInfo.requestQuota(s,function(){var e=ImgCache.options.usePersistentCache?window.storageInfo.PERSISTENT:window.storageInfo.TEMPORARY;window.requestFileSystem(e,s,r,a)},function(e){ImgCache.overridables.log("Failed to request quota: "+e.message,LOG_LEVEL_ERROR),n&&n()})}},ImgCache.getCurrentSize=function(){if(i.hasLocalStorage()){var e=localStorage.getItem("imgcache:"+ImgCache.options.localCacheFolder);return null===e?0:parseInt(e,10)}return 0},ImgCache.cacheFile=function(e,n,o,r){if(i.isImgCacheLoaded()&&e){e=t.sanitizeURI(e);var a=i.getCachedFileFullPath(e),s=new i.FileTransferWrapper(ImgCache.attributes.filesystem);s.download(e,a,function(e){e.getMetadata(function(e){e&&e.hasOwnProperty("size")?(ImgCache.overridables.log("Cached file size: "+e.size,LOG_LEVEL_INFO),i.setCurrentSize(ImgCache.getCurrentSize()+parseInt(e.size,10))):ImgCache.overridables.log("No metadata size property available",LOG_LEVEL_INFO)}),ImgCache.overridables.log("Download complete: "+t.EntryGetPath(e),LOG_LEVEL_INFO),e.setMetadata&&e.setMetadata(function(){ImgCache.overridables.log("com.apple.MobileBackup metadata set",LOG_LEVEL_INFO)},function(){ImgCache.overridables.log("com.apple.MobileBackup metadata could not be set",LOG_LEVEL_WARNING)},{"com.apple.MobileBackup":1}),n&&n()},function(e){e.source&&ImgCache.overridables.log("Download error source: "+e.source,LOG_LEVEL_ERROR),e.target&&ImgCache.overridables.log("Download error target: "+e.target,LOG_LEVEL_ERROR),ImgCache.overridables.log("Download error code: "+e.code,LOG_LEVEL_ERROR),o&&o()},r)}},ImgCache.getCachedFile=function(e,n){if(i.isImgCacheLoaded()&&n){e=t.sanitizeURI(e);var o=i.getCachedFilePath(e);t.isCordovaAndroid()&&0===o.indexOf("file://")&&(o=o.substr(7)),ImgCache.attributes.filesystem.root.getFile(o,{create:!1},function(t){n(e,t)},function(){n(e,null)})}},ImgCache.getCachedFileURL=function(e,n,i){var o=function(e,o){o?n(e,t.EntryGetURL(o)):i&&i(e)};ImgCache.getCachedFile(e,o)},ImgCache.isCached=function(e,t){ImgCache.getCachedFile(e,function(e,n){t(e,null!==n)})},ImgCache.useOnlineFile=function(e){if(i.isImgCacheLoaded()&&e){var t=n.getAttribute(e,o);t&&n.setAttribute(e,"src",t),n.removeAttribute(e,o)}},ImgCache.useCachedFile=function(e,t,o){i.isImgCacheLoaded()&&i.loadCachedFile(e,n.getAttribute(e,"src"),i.setNewImgPath,t,o)},ImgCache.useCachedFileWithSource=function(e,n,o,r){if(i.isImgCacheLoaded()){var a=t.sanitizeURI(n);i.loadCachedFile(e,a,i.setNewImgPath,o,r)}},ImgCache.clearCache=function(e,t){i.isImgCacheLoaded()&&ImgCache.attributes.dirEntry.removeRecursively(function(){ImgCache.overridables.log("Local cache cleared",LOG_LEVEL_INFO),i.setCurrentSize(0),i.createCacheDir(e,t)},function(e){ImgCache.overridables.log("Failed to remove directory or its contents: "+e.code,LOG_LEVEL_ERROR),t&&t()})},ImgCache.removeFile=function(e,n,o){e=t.sanitizeURI(e);var r=i.getCachedFilePath(e),a=function(e){ImgCache.overridables.log("Failed to remove file due to "+e.code,LOG_LEVEL_ERROR),o&&o()};ImgCache.attributes.filesystem.root.getFile(r,{create:!1},function(e){e.remove(function(){n&&n()},a)},a)},ImgCache.cacheBackground=function(e,t,n,o){if(i.isImgCacheLoaded()){var r=i.getBackgroundImageURL(e);if(!r)return ImgCache.overridables.log("No background to cache",LOG_LEVEL_WARNING),void(n&&n());ImgCache.overridables.log("Background image URL: "+r,LOG_LEVEL_INFO),ImgCache.cacheFile(r,t,n,o)}},ImgCache.useCachedBackground=function(e,t,o){if(i.isImgCacheLoaded()){var a=i.getBackgroundImageURL(e);if(!a)return ImgCache.overridables.log("No background to cache",LOG_LEVEL_WARNING),void(o&&o());var s=function(e,t,i){n.setBackgroundImage(e,'url("'+t+'")'),n.setAttribute(e,r,i)};i.loadCachedFile(e,a,s,t,o)}},ImgCache.useBackgroundOnlineFile=function(e){if(e){var t=n.getAttribute(e,r);t&&n.setBackgroundImage(e,'url("'+t+'")'),n.removeAttribute(e,r)}},ImgCache.getCacheFolderURI=function(){return i.isImgCacheLoaded()?t.EntryGetURL(ImgCache.attributes.dirEntry):void 0},"function"==typeof define&&define.amd?define("imgcache",[],function(){return ImgCache}):"object"==typeof module&&module.exports?module.exports=ImgCache:window.ImgCache=ImgCache}(window.jQuery||window.Zepto||function(){throw"jQuery is not available"}),define("window",[],function(){"use strict";return window}),define("templates-compiled",["angular"],function(e){e.module("app.templates",[]).run(["$templateCache",function(e){"use strict";e.put("templates/loading.html",'\n \n \n \n \n \n \n'),e.put("templates/login.html",''),e.put("templates/more.html",'\n \n \n \n \n \n Channel\n \n \n \n Notifications\n \n \n \n Logout\n \n \n\n \n'),e.put("templates/register.html",''),e.put("templates/tabs.html",'\n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n'),e.put("templates/tutorial.html",'\n \n \n \n \n \n
\n
\n \n

Expand your reach.

\n

Swipe left to begin.

\n

Swipe right to skip tutorial.

\n
\n
\n \n \n
\n

Subscribe

\n \n
\n
\n
\n \n
\n

{{entity.name}}

\n
\n
\n \n
\n \n \n \n \n \n \n
\n
\n
\n \n

Swipe right to subscribe or left to pass. If someone subscribes back you match and can chat.

\n
\n
\n \n \n
\n

Capture & Share

\n \n \n
\n \n \n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n
\n
\n
\n

Share great moments and ideas.

\n \n
\n
\n \n \n
\n

News

\n \n
\n \n \n \n

{{story.user}}

\n

now

\n \n
\n \n
\n

{{story.message}}

\n
\n \n \n
\n \n \n
\n
\n \n \n \n \n
\n

Discover

\n \n
\n
\n
\n \n
\n

Minds

\n
\n
\n \n \n
\n
\n \n

Vote to make trends.

\n
\n
\n \n \n
\n

Encrypted Chat

\n \n \n \n \n \n
\n Hello.\n
\n \n
\n \n \n \n
\n Hey!\n
\n \n
\n \n \n \n
\n It\'s great how we can chat without being spied on\n
\n \n
\n \n \n \n
\n Yeah! And the app is free and open-source too\n
\n \n
\n
\n \n

Message securely with matches.

\n
\n
\n \n \n
\n

Points

\n \n \n \n
\n +1\n
\n \n

Earn points for every vote, comment, remind, swipe, post and upload.

\n \n
\n
\n \n \n
\n

Boost

\n \n \n \n Boost\n \n

Use your points to go viral by boosting to the news feed or other channels.

\n \n
\n
\n \n \n
\n \n
\n
\n
\n\n
\n
'),e.put("templates/capture/default.html",'\n \n \n \n
\n \n \n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n
\n
\n \n
\n
\n \n \n
\n \n \n \n \n
\n \n \n \n
\n \n
\n \n

\n By uploading this content you confirm that you have the right to distribute this content under the selected license.\n

\n
\n
\n\n
\n \n
\n\n
'),e.put("templates/capture/status.html",'\n \n\n \n
\n \n
\n

Status Post

\n
\n \n
\n
\n \n \n \n
\n \n \n \n \n
\n \n \n

{{form.meta.title}}

\n

{{form.meta.description}}

\n \n
\n \n \n \n \n
\n \n
\n
'),e.put("templates/channels/channel.html",'\n\n \n\n \n \n Add banner in settings\n \n
\n \n
\n \n
\n\n
\n \n
\n
\n

\n

\n
\n \n
\n \n \n \n \n\n \n \n
\n
'),e.put("templates/channels/edit.html",'\n\n \n \n \n \n Save\n \n\n \n \n
\n \n \n \n \n
\n
\n \n {{location.address.town}}{{location.address.city}}, {{location.address.state}}\n \n
\n
\n \n \n \n \n \n \n Invite contacts\n \n \n \n Contact / Bug Reports\n \n \n \n Terms\n \n \n \n Privacy Policy\n \n \n \n Code\n \n \n \n \n Cancel channel\n \n \n \n
\n\n
\n
'),e.put("templates/channels/subscribers.html",'\n\n \n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n'),e.put("templates/channels/subscriptions.html",'\n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n'),e.put("templates/comments/list.html",'\n\n \n \n \n \n\n \n {{comment.ownerObj.name}}: {{comment.description}}\n \n\n \n \n
\n \n \n
\n \n
\n
'),e.put("templates/directives/activity.html",'\n \n
\n

\n
\n \n
\n

\n
\n \n \n\n
\n \n
\n \n \n
\n \n
\n \n \n
\n \n \n \n \n \n \n
\n\n
\n
\n \n
\n
\n\n
\n

\n

{{::activity.perma_url | domain}}

\n
\n \n
\n Boosted\n
\n \n '),e.put("templates/directives/owner-brief.html",'\n \n \n \n \n \n \n\n \n \n

\n

\n \n
'),e.put("templates/discover/entities/object.html",'\n\n\n
\n \n \n \n
\n

\n
\n\n \n \n
\n\n\n
\n
\n

\n
\n \n
\n\n\n
\n \n
\n\n
\n

\n

{{entity.perma_url}}

\n
\n\n
\n Boosted\n
\n\n\n'),e.put("templates/discover/entities/user.html",'\n \n
\n

{{entity.city}}\n

\n
\n
\n\n
\n Boosted\n
\n \n'),e.put("templates/discover/list.html",'\n\n \n
\n \n \n
\n
\n\n \n \n\n \n \n \n
\n
\n Discovering..\n
\n \n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n
\n \n
'),e.put("templates/discover/swipe.html",'\n\n \n
\n \n \n
\n
\n\n \n \n\n \n \n \n
\n
\n Discovering...\n
\n \n
\n \n
\n \n \n
\n
\n \n Boost\n \n
\n \n \n
\n
\n \n \n Boost\n \n\n
\n \n
\n
\n \n \n \n \n \n
\n \n \n \n
\n Location off\n Locating\n No results\n \n \n within \n \n of {{city}} \n \n
\n\n
\n
\n Discovering near you...\n
\n\n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n \n
\n
\n \n
\n \n
'),e.put("templates/gatherings/chat/conversation.html",'\n \n \n \n \n \n \n \n {{name}}\n \n \n\n \n\n \n \n \n \n\n \n \n \n
\n \n
\n \n {{message.time_created * 1000 | date:\'shortTime\'}} - {{message.time_created * 1000 | date:\'longDate\'}}

\n
\n \n
\n
\n downloading..\n
\n\n
\n\n
\n \n \n
\n \n
\n
\n \n
'),e.put("templates/gatherings/chat/list.html",'\n\n \n \n Invite\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n

\n

{{conversation.last_msg * 1000 | date:\'shortTime\'}} - {{conversation.last_msg * 1000 | date:\'longDate\'}}

\n \n
\n \n \n \n \n

{{conversation.name}}

\n
\n
\n \n
\n \n \n \n\n
\n
'),e.put("templates/gatherings/chat/setup.html",'\n\n \n\n
\n \n \n \n \n
\n \n
\n \n
\n \n
\n \n
\n \n
\n \n \n
\n \n
\n \n
\n \n
\n
\n \n

\n - You only need to enter this encryption password once as long as you stay signed in.
\n - It is important so that no one other than you and the people you are communicating with can access the content of your messages.
\n - By default the content of your messages is fully encrypted. For heightened security you may wish to go to your app settings and turn off push notifications in order to disallow metadata from being tracked. \n

\n

\n \n

\n\n
\n
'),e.put("templates/invite/invite.html",'\n \n \n
\n \n
\n

Invite contacts

\n
\n \n
\n
\n \n \n
\n
\n

{{contact.name.formatted}}

\n

{{contact.emails[0].value}}

\n \n
\n
\n
\n
'),e.put("templates/modals/avatar.html",'\n \n\n \n
\n \n
\n

Setup

\n
\n \n
\n
\n \n \n \n
\n \n
\n \n \n

Select the image above to select an avatar

\n \n \n \n
\n
'),e.put("templates/modals/optional.html",'\n \n\n \n
\n \n
\n

Optional

\n
\n \n \n
\n
\n \n \n \n
\n \n
\n Gender\n \n Male / \n Female / \n Private\n
\n \n \n \n
\n
\n \n {{location.address.town}}{{location.address.city}}, {{location.address.state}}\n \n
\n
\n \n \n
\n\n
\n
'),e.put("templates/newsfeed/boost.html",'\n \n\n \n
\n \n
\n

Boost Post

\n
\n \n \n \n
\n
\n \n \n \n
\n \n
\n \n

Channel

\n \n

Select a channel above to have your post distributed to their subscribers in exchange for points.

\n \n
\n
\n \n \n @{{user.username}}\n
\n
\n
\n \n
\n \n

Full Network

\n

Your post will appear at the top of everyone\'s newsfeed until your views are met.

\n Select\n\n
\n \n
\n \n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n

\n Transactions are non-refundable. \n You will be notified when your post reaches the requested number of views. \n The amount of time this will take depends on site activity, so don\'t worry if you don\'t hear from us for a while; we will keep it in circulation until it reaches the goal!\n

\n
\n \n
\n

\n You will be notified if you post is accepted or rejected by {{data.destination}}. Once they accept, this post will not be able to be deleted.\n

\n
\n \n \n \n
\n \n \n
\n
'),e.put("templates/newsfeed/compose.html",'\n \n

Write a post...

\n
\n \n
\n \n \n
\n
\n
'),e.put("templates/newsfeed/list.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n\n \n \n\n \n \n \n \n\n \n'),e.put("templates/newsfeed/view.html",'\n\n \n \n \n\n \n \n
\n \n
\n \n \n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n \n\n
\n
'),e.put("templates/notifications/entity.html",'\n\n \n \n \n \n \n \n \n
\n \n
\n\n
\n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n\n \n \n
\n
\n \n\n
\n
'),e.put("templates/notifications/list.html",'\n\n \n \n \n \n\n \n\n \n \n \n \n\n
\n
\n \n\n
\n \n \n

You have a match! {{notification.fromObj.name}} subscribed to you

\n

{{notification.fromObj.name}} subscribed to you

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n

\n
\n
\n \n \n \n \n \n \n \n
\n Sorry, there was an error viewing this notification\n
\n
\n \n {{ notification.time_created * 1000 | date : \'medium\' }}\n \n \n \n
\n
\n\n
\n \n \n\n
\n
'),e.put("templates/notifications/p2p-review.html",'\n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n'),e.put("templates/wallet/balance.html",'\n\n \n \n \n \n Purchase\n \n \n\n \n\n \n \n

{{points}} points

\n \n

1 point = {{boost_rate}} views

\n \n \n \n \n \n \n +{{transaction.points | abbr }}\n {{transaction.points | abbr}}\n

{{transaction.description}}

\n

{{transaction.time_created * 1000 | date:"MM/dd/yyyy \'at\' h:mma"}}

\n
\n
\n \n\n
\n
'),e.put("templates/wallet/boost.html",'\n \n\n \n
\n \n \n
\n

Boost

\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
'),e.put("templates/wallet/deposit.html",'\n\n \n Wallet\n \n\n \n\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n

Congratulations!

\n
\n\n
\n
'),e.put("templates/wallet/review_boost.html",'\n \n\n \n
\n \n
\n

Review

\n
\n \n \n \n
\n We couldn\'t load this post.\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
Accept
\n
\n
\n
Reject
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
') +return i=R(r,i),i.view&&(o=t.fromConfig(i.view,i.params,i.locals)),o&&i.notify&&e.$broadcast("$viewContentLoading",i),o}}}this.$get=e,e.$inject=["$rootScope","$templateFactory"]}function _(){var e=!1;this.useAnchorScroll=function(){e=!0},this.$get=["$anchorScroll","$timeout",function(t,n){return e?t:function(e){n(function(){e[0].scrollIntoView()},0,!1)}}]}function S(e,n,i,o){function r(){return n.has?function(e){return n.has(e)?n.get(e):null}:function(e){try{return n.get(e)}catch(t){return null}}}function a(e,t){var n=function(){return{enter:function(e,t,n){t.after(e),n()},leave:function(e,t){e.remove(),t()}}};if(l)return{enter:function(e,t,n){var i=l.enter(e,null,t,n);i&&i.then&&i.then(n)},leave:function(e,t){var n=l.leave(e,t);n&&n.then&&n.then(t)}};if(c){var i=c&&c(t,e);return{enter:function(e,t,n){i.enter(e,null,t),n()},leave:function(e,t){i.leave(e),t()}}}return n()}var s=r(),c=s("$animator"),l=s("$animate"),u={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(n,r,s){return function(n,r,c){function l(){d&&(d.remove(),d=null),p&&(p.$destroy(),p=null),f&&(v.leave(f,function(){d=null}),d=f,f=null)}function u(a){var u,d=x(n,c,r,o),b=d&&e.$current&&e.$current.locals[d];if(a||b!==h){u=n.$new(),h=e.$current.locals[d];var $=s(u,function(e){v.enter(e,r,function(){p&&p.$emit("$viewContentAnimationEnded"),(t.isDefined(g)&&!g||n.$eval(g))&&i(e)}),l()});f=$,p=u,p.$emit("$viewContentLoaded"),p.$eval(m)}}var d,f,p,h,m=c.onload||"",g=c.autoscroll,v=a(c,n);n.$on("$stateChangeSuccess",function(){u(!1)}),n.$on("$viewContentLoading",function(){u(!1)}),u(!0)}}};return u}function C(e,t,n,i){return{restrict:"ECA",priority:-400,compile:function(o){var r=o.html();return function(o,a,s){var c=n.$current,l=x(o,s,a,i),u=c&&c.locals[l];if(u){a.data("$uiView",{name:l,state:u.$$state}),a.html(u.$template?u.$template:r);var d=e(a.contents());if(u.$$controller){u.$scope=o;var f=t(u.$$controller,u);u.$$controllerAs&&(o[u.$$controllerAs]=f),a.data("$ngControllerController",f),a.children().data("$ngControllerController",f)}d(o)}}}}}function x(e,t,n,i){var o=i(t.uiView||t.name||"")(e),r=n.inheritedData("$uiView");return o.indexOf("@")>=0?o:o+"@"+(r?r.state.name:"")}function k(e,t){var n,i=e.match(/^\s*({[^}]*})\s*$/);if(i&&(e=t+"("+i[1]+")"),n=e.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+e+"'");return{state:n[1],paramExpr:n[3]||null}}function E(e){var t=e.parent().inheritedData("$uiView");return t&&t.state&&t.state.name?t.state:void 0}function T(e,n){var i=["location","inherit","reload"];return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(o,r,a,s){var c=k(a.uiSref,e.current.name),l=null,u=E(r)||e.$current,d=null,f="A"===r.prop("tagName"),p="FORM"===r[0].nodeName,h=p?"action":"href",m=!0,g={relative:u,inherit:!0},v=o.$eval(a.uiSrefOpts)||{};t.forEach(i,function(e){e in v&&(g[e]=v[e])});var b=function(n){if(n&&(l=t.copy(n)),m){d=e.href(c.state,l,g);var i=s[1]||s[0];return i&&i.$$setStateInfo(c.state,l),null===d?(m=!1,!1):void a.$set(h,d)}};c.paramExpr&&(o.$watch(c.paramExpr,function(e){e!==l&&b(e)},!0),l=t.copy(o.$eval(c.paramExpr))),b(),p||r.bind("click",function(t){var i=t.which||t.button;if(!(i>1||t.ctrlKey||t.metaKey||t.shiftKey||r.attr("target"))){var o=n(function(){e.go(c.state,l,g)});t.preventDefault();var a=f&&!d?1:0;t.preventDefault=function(){a--<=0&&n.cancel(o)}}})}}}function I(e,t,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(t,i,o){function r(){a()?i.addClass(l):i.removeClass(l)}function a(){return"undefined"!=typeof o.uiSrefActiveEq?s&&e.is(s.name,c):s&&e.includes(s.name,c)}var s,c,l;l=n(o.uiSrefActiveEq||o.uiSrefActive||"",!1)(t),this.$$setStateInfo=function(t,n){s=e.get(t,E(i)),c=n,r()},t.$on("$stateChangeSuccess",r)}]}}function D(e){var t=function(t){return e.is(t)};return t.$stateful=!0,t}function A(e){var t=function(t){return e.includes(t)};return t.$stateful=!0,t}var O=t.isDefined,L=t.isFunction,P=t.isString,M=t.isObject,N=t.isArray,V=t.forEach,R=t.extend,B=t.copy;t.module("ui.router.util",["ng"]),t.module("ui.router.router",["ui.router.util"]),t.module("ui.router.state",["ui.router.router","ui.router.util"]),t.module("ui.router",["ui.router.state"]),t.module("ui.router.compat",["ui.router"]),h.$inject=["$q","$injector"],t.module("ui.router.util").service("$resolve",h),m.$inject=["$http","$templateCache","$injector"],t.module("ui.router.util").service("$templateFactory",m);var F;g.prototype.concat=function(e,t){var n={caseInsensitive:F.caseInsensitive(),strict:F.strictMode(),squash:F.defaultSquashPolicy()};return new g(this.sourcePath+e+this.sourceSearch,R(n,t),this)},g.prototype.toString=function(){return this.source},g.prototype.exec=function(e,t){function n(e){function t(e){return e.split("").reverse().join("")}function n(e){return e.replace(/\\-/,"-")}var i=t(e).split(/-(?!\\)/),o=p(i,t);return p(o,n).reverse()}var i=this.regexp.exec(e);if(!i)return null;t=t||{};var o,r,a,s=this.parameters(),c=s.length,l=this.segments.length-1,u={};if(l!==i.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");for(o=0;l>o;o++){a=s[o];var d=this.params[a],f=i[o+1];for(r=0;ro;o++)a=s[o],u[a]=this.params[a].value(t[a]);return u},g.prototype.parameters=function(e){return O(e)?this.params[e]||null:this.$$paramNames},g.prototype.validates=function(e){return this.params.$$validates(e)},g.prototype.format=function(e){function t(e){return encodeURIComponent(e).replace(/-/g,function(e){return"%5C%"+e.charCodeAt(0).toString(16).toUpperCase()})}e=e||{};var n=this.segments,i=this.parameters(),o=this.params;if(!this.validates(e))return null;var r,a=!1,s=n.length-1,c=i.length,l=n[0];for(r=0;c>r;r++){var u=s>r,d=i[r],f=o[d],h=f.value(e[d]),m=f.isOptional&&f.type.equals(f.value(),h),g=m?f.squash:!1,v=f.type.encode(h);if(u){var b=n[r+1];if(g===!1)null!=v&&(l+=N(v)?p(v,t).join("-"):encodeURIComponent(v)),l+=b;else if(g===!0){var $=l.match(/\/$/)?/\/?(.*)/:/(.*)/;l+=b.match($)[1]}else P(g)&&(l+=g+b)}else{if(null==v||m&&g!==!1)continue;N(v)||(v=[v]),v=p(v,encodeURIComponent).join("&"+d+"="),l+=(a?"&":"?")+(d+"="+v),a=!0}}return l},v.prototype.is=function(){return!0},v.prototype.encode=function(e){return e},v.prototype.decode=function(e){return e},v.prototype.equals=function(e,t){return e==t},v.prototype.$subPattern=function(){var e=this.pattern.toString();return e.substr(1,e.length-2)},v.prototype.pattern=/.*/,v.prototype.toString=function(){return"{Type:"+this.name+"}"},v.prototype.$asArray=function(e,t){function i(e,t){function i(e,t){return function(){return e[t].apply(e,arguments)}}function o(e){return N(e)?e:O(e)?[e]:[]}function r(e){switch(e.length){case 0:return n;case 1:return"auto"===t?e[0]:e;default:return e}}function a(e){return!e}function s(e,t){return function(n){n=o(n);var i=p(n,e);return t===!0?0===f(i,a).length:r(i)}}function c(e){return function(t,n){var i=o(t),r=o(n);if(i.length!==r.length)return!1;for(var a=0;a>>32-t}function i(e,t,n){return e^t^n}function o(e,t){var n=(65535&t)+(65535&e),i=(t>>>16)+(e>>>16)+(n>>>16);return(65535&i)<<16|65535&n}var r="0123456789abcdef";return function(e){for(var t,n=[],i=4*e.length,o=0;i>o;o++)t=e[o>>2]>>8*(3-o%4),n.push(r.charAt(t>>4&15)+r.charAt(15&t));return n.join("")}(function(e,r){var a,s,c,l,u,d=e.length,f=1732584193,p=4023233417,h=2562383102,m=271733878,g=3285377520,v=[];t(v,1518500249,20),t(v,1859775393,20),t(v,2400959708,20),t(v,3395469782,20),e[r>>5]|=128<<24-r%32,e[(r+65>>9<<4)+15]=r;for(var b=0;d>b;b+=16){a=f,s=p,c=h,l=m,u=g;for(var $=0,w=[];80>$;$++){w[$]=16>$?e[$+b]:n(w[$-3]^w[$-8]^w[$-14]^w[$-16],1);var y=function(e,t,n,i,o){var r=(65535&o)+(65535&e)+(65535&t)+(65535&n)+(65535&i),a=(o>>>16)+(e>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(r>>>16);return(65535&a)<<16|65535&r}(20>$?function(e,t,n){return e&t^~e&n}(s,c,l):40>$?i(s,c,l):60>$?function(e,t,n){return e&t^e&n^t&n}(s,c,l):i(s,c,l),u,v[$],w[$],n(a,5));u=l,l=c,c=n(s,30),s=a,a=y}f=o(f,a),p=o(p,s),h=o(h,c),m=o(m,l),g=o(g,u)}return[f,p,h,m,g]}(function(e){for(var t=[],n=255,i=8*e.length,o=0;i>o;o+=8)t[o>>5]|=(e.charCodeAt(o/8)&n)<<24-o%32;return t}(e).slice(),8*e.length))},log:function(e,t){"use strict";ImgCache.options.debug&&(t===LOG_LEVEL_INFO&&(e="INFO: "+e),t===LOG_LEVEL_WARNING&&(e="WARN: "+e),t===LOG_LEVEL_ERROR&&(e="ERROR: "+e),console.log(e))}},jQuery:window.jQuery||window.Zepto?!0:!1,jQueryLite:"undefined"!=typeof window.angular&&window.angular.element?!0:!1,ready:!1,attributes:{}},LOG_LEVEL_INFO=1,LOG_LEVEL_WARNING=2,LOG_LEVEL_ERROR=3;!function(e){"use strict";var t={};t.sanitizeURI=function(e){if(ImgCache.options.skipURIencoding)return e;var t=encodeURI(e);return t},t.URI=function(e){e||(e="");var t=/^(?:([^:\/?\#]+):)?(?:\/\/([^\/?\#]*))?([^?\#]*)(?:\?([^\#]*))?(?:\#(.*))?/,n=e.match(t);this.scheme=n[1]||null,this.authority=n[2]||null,this.path=n[3]||null,this.query=n[4]||null,this.fragment=n[5]||null},t.URIGetFileName=function(e){if(e){var t=e.lastIndexOf("/");if(t)return e.substr(t+1).toLowerCase()}},t.URIGetPath=function(e){if(e){var n=t.URI(e);return n.path.toLowerCase()}},t.FileGetExtension=function(e){if(!e)return"";e=e.split("?")[0];var t=e.split(".").pop();return!t||t.length>4?"":t},t.isCordova=function(){return"undefined"!=typeof cordova||"undefined"!=typeof phonegap},t.isCordovaAndroid=function(){return t.isCordova()&&device&&device.platform&&device.platform.toLowerCase().indexOf("android")>=0},t.isCordovaAndroidOlderThan4=function(){return t.isCordovaAndroid()&&device.version&&(0===device.version.indexOf("2.")||0===device.version.indexOf("3."))},t.EntryToURL=function(e){return t.isCordovaAndroidOlderThan4()&&"function"==typeof e.toNativeURL?e.toNativeURL():e.toURL()},t.EntryGetURL=function(e){return"function"==typeof e.toURL?t.EntryToURL(e):e.toURI()},t.EntryGetPath=function(e){return t.isCordova()&&"function"==typeof e.toURL?t.EntryToURL(e):e.fullPath},t.getCordovaStorageType=function(e){if("undefined"!=typeof LocalFileSystem){if(e&&LocalFileSystem.hasOwnProperty("PERSISTENT"))return LocalFileSystem.PERSISTENT;if(!e&&LocalFileSystem.hasOwnProperty("TEMPORARY"))return LocalFileSystem.TEMPORARY}return e?window.PERSISTENT:window.TEMPORARY};var n={};n.trigger=function(t,n){ImgCache.jQuery?e(t).trigger(n):(window.CustomEvent||(window.CustomEvent=function(e,t){var n;t=t||{bubbles:!1,cancelable:!1,detail:void 0};try{n=document.createEvent("CustomEvent"),n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail)}catch(i){n=document.createEvent("Event"),n.initEvent(e,t.bubbles,t.cancelable),n.detail=t.detail}return n}),t.dispatchEvent(new CustomEvent(n)))},n.removeAttribute=function(e,t){ImgCache.jQuery||ImgCache.jQueryLite?e.removeAttr(t):e.removeAttribute(t)},n.setAttribute=function(e,t,n){ImgCache.jQuery||ImgCache.jQueryLite?e.attr(t,n):e.setAttribute(t,n)},n.getAttribute=function(e,t){return ImgCache.jQuery||ImgCache.jQueryLite?e.attr(t):e.getAttribute(t)},n.getBackgroundImage=function(e){if(ImgCache.jQuery||ImgCache.jQueryLite)return e.css("background-image");var t=window.getComputedStyle(e,null);if(t)return t.backgroundImage},n.setBackgroundImage=function(e,t){ImgCache.jQuery||ImgCache.jQueryLite?e.css("background-image",t):e.style.backgroundImage=t};var i={attributes:{}};i.isImgCacheLoaded=function(){return ImgCache.attributes.filesystem&&ImgCache.attributes.dirEntry?!0:(ImgCache.overridables.log("ImgCache not loaded yet! - Have you called ImgCache.init() first?",LOG_LEVEL_WARNING),!1)},i.attributes.hasLocalStorage=!1,i.hasLocalStorage=function(){if(i.attributes.hasLocalStorage)return i.attributes.hasLocalStorage;try{var e=ImgCache.overridables.hash("imgcache_test");return localStorage.setItem(e,e),localStorage.removeItem(e),i.attributes.hasLocalStorage=!0,!0}catch(t){return ImgCache.overridables.log("Could not write to local storage: "+t.message,LOG_LEVEL_INFO),!1}},i.setCurrentSize=function(e){ImgCache.overridables.log("current size: "+e,LOG_LEVEL_INFO),i.hasLocalStorage()&&localStorage.setItem("imgcache:"+ImgCache.options.localCacheFolder,e)},i.getCachedFilePath=function(e){return ImgCache.options.localCacheFolder+"/"+i.getCachedFileName(e)},i.getCachedFileFullPath=function(e){var n=t.EntryGetPath(ImgCache.attributes.dirEntry);return(n?n+"/":"/")+i.getCachedFileName(e)},i.getCachedFileName=function(e){if(!e)return void ImgCache.overridables.log("No source given to getCachedFileName",LOG_LEVEL_WARNING);var n=ImgCache.overridables.hash(e),i=t.FileGetExtension(t.URIGetFileName(e));return n+(i?"."+i:"")},i.setNewImgPath=function(e,t,i){n.setAttribute(e,"src",t),n.setAttribute(e,o,i)},i.createCacheDir=function(e,i){if(!ImgCache.attributes.filesystem)return ImgCache.overridables.log("Filesystem instance was not initialised",LOG_LEVEL_ERROR),void(i&&i());var o=function(e){ImgCache.overridables.log("Failed to get/create local cache directory: "+e.code,LOG_LEVEL_ERROR),i&&i()},r=function(i){if(ImgCache.attributes.dirEntry=i,ImgCache.overridables.log("Local cache folder opened: "+t.EntryGetPath(i),LOG_LEVEL_INFO),t.isCordovaAndroid()){var r=function(){ImgCache.overridables.log(".nomedia file created.",LOG_LEVEL_INFO),e&&e()};i.getFile(".nomedia",{create:!0,exclusive:!1},r,o)}else i.setMetadata&&i.setMetadata(function(){ImgCache.overridables.log("com.apple.MobileBackup metadata set",LOG_LEVEL_INFO)},function(){ImgCache.overridables.log("com.apple.MobileBackup metadata could not be set",LOG_LEVEL_WARNING)},{"com.apple.MobileBackup":1}),e&&e();ImgCache.ready=!0,n.trigger(document,a)};ImgCache.attributes.filesystem.root.getDirectory(ImgCache.options.localCacheFolder,{create:!0,exclusive:!1},r,o)},i.FileTransferWrapper=function(e){t.isCordova()&&(this.fileTransfer=new FileTransfer),this.filesystem=e},i.FileTransferWrapper.prototype.download=function(e,t,n,i,o){var r=ImgCache.options.headers||{},a="function"==typeof o;if(this.fileTransfer)return a&&(this.fileTransfer.onprogress=o),this.fileTransfer.download(e,t,n,i,!1,{headers:r});var s=this.filesystem,c=function(n,i,o){ImgCache.overridables.log(n,i),o&&o({code:0,source:e,target:t})},l=new XMLHttpRequest;l.open("GET",e,!0),a&&(l.onprogress=o),l.responseType="blob";for(var u in r)l.setRequestHeader(u,r[u]);l.onload=function(){!l.response||200!==l.status&&0!==l.status?c("Image "+e+" could not be downloaded - status: "+l.status,3,i):s.root.getFile(t,{create:!0},function(e){e.createWriter(function(t){t.onerror=i,t.onwriteend=function(){n(e)},t.write(l.response,i)},i)},i)},l.onerror=function(){c("XHR error - Image "+e+" could not be downloaded - status: "+l.status,3,i)},l.send()},i.getBackgroundImageURL=function(e){var t=n.getBackgroundImage(e);if(t){var i=/\((.+)\)/,o=i.exec(t)[1];return o}},i.loadCachedFile=function(e,n,o,r,a){if(i.isImgCacheLoaded()&&e){var s=t.URIGetFileName(n),c=function(i){if(ImgCache.options.useDataURI){var c=function(t){var i=new FileReader;i.onloadend=function(t){var i=t.target.result;return i?(o(e,i,n),ImgCache.overridables.log("File "+s+" loaded from cache",LOG_LEVEL_INFO),void(r&&r(e))):(ImgCache.overridables.log("File in cache "+s+" is empty",LOG_LEVEL_WARNING),void(a&&a(e)))},i.readAsDataURL(t)},l=function(t){ImgCache.overridables.log("Failed to read file "+t.code,LOG_LEVEL_ERROR),a&&a(e)};i.file(c,l)}else{var u=t.EntryGetURL(i);o(e,u,n),ImgCache.overridables.log("File "+s+" loaded from cache",LOG_LEVEL_INFO),r&&r(e)}},l=function(){ImgCache.overridables.log("File "+s+" not in cache",LOG_LEVEL_INFO),a&&a(e)};ImgCache.attributes.filesystem.root.getFile(i.getCachedFilePath(n),{create:!1},c,l)}};var o="data-old-src",r="data-old-background",a="ImgCacheReady";ImgCache.init=function(e,n){ImgCache.attributes.init_callback=e;var o=function(e){if(ImgCache.options.cacheClearSize>0){var t=ImgCache.getCurrentSize();t>1024*ImgCache.options.cacheClearSize*1024?ImgCache.clearCache(e,e):e&&e()}else e&&e()},r=function(e){ImgCache.overridables.log("LocalFileSystem opened",LOG_LEVEL_INFO),ImgCache.attributes.filesystem=e,i.createCacheDir(function(){o(ImgCache.attributes.init_callback)},n)},a=function(e){ImgCache.overridables.log("Failed to initialise LocalFileSystem "+e.code,LOG_LEVEL_ERROR),n&&n()};if(t.isCordova())window.requestFileSystem(t.getCordovaStorageType(ImgCache.options.usePersistentCache),0,r,a);else{if(window.requestFileSystem=window.requestFileSystem||window.webkitRequestFileSystem,window.storageInfo=window.storageInfo||(ImgCache.options.usePersistentCache?navigator.webkitPersistentStorage:navigator.webkitTemporaryStorage),!window.storageInfo)return ImgCache.overridables.log("Your browser does not support the html5 File API",LOG_LEVEL_WARNING),void(n&&n());var s=ImgCache.options.chromeQuota;window.storageInfo.requestQuota(s,function(){var e=ImgCache.options.usePersistentCache?window.storageInfo.PERSISTENT:window.storageInfo.TEMPORARY;window.requestFileSystem(e,s,r,a)},function(e){ImgCache.overridables.log("Failed to request quota: "+e.message,LOG_LEVEL_ERROR),n&&n()})}},ImgCache.getCurrentSize=function(){if(i.hasLocalStorage()){var e=localStorage.getItem("imgcache:"+ImgCache.options.localCacheFolder);return null===e?0:parseInt(e,10)}return 0},ImgCache.cacheFile=function(e,n,o,r){if(i.isImgCacheLoaded()&&e){e=t.sanitizeURI(e);var a=i.getCachedFileFullPath(e),s=new i.FileTransferWrapper(ImgCache.attributes.filesystem);s.download(e,a,function(e){e.getMetadata(function(e){e&&e.hasOwnProperty("size")?(ImgCache.overridables.log("Cached file size: "+e.size,LOG_LEVEL_INFO),i.setCurrentSize(ImgCache.getCurrentSize()+parseInt(e.size,10))):ImgCache.overridables.log("No metadata size property available",LOG_LEVEL_INFO)}),ImgCache.overridables.log("Download complete: "+t.EntryGetPath(e),LOG_LEVEL_INFO),e.setMetadata&&e.setMetadata(function(){ImgCache.overridables.log("com.apple.MobileBackup metadata set",LOG_LEVEL_INFO)},function(){ImgCache.overridables.log("com.apple.MobileBackup metadata could not be set",LOG_LEVEL_WARNING)},{"com.apple.MobileBackup":1}),n&&n()},function(e){e.source&&ImgCache.overridables.log("Download error source: "+e.source,LOG_LEVEL_ERROR),e.target&&ImgCache.overridables.log("Download error target: "+e.target,LOG_LEVEL_ERROR),ImgCache.overridables.log("Download error code: "+e.code,LOG_LEVEL_ERROR),o&&o()},r)}},ImgCache.getCachedFile=function(e,n){if(i.isImgCacheLoaded()&&n){e=t.sanitizeURI(e);var o=i.getCachedFilePath(e);t.isCordovaAndroid()&&0===o.indexOf("file://")&&(o=o.substr(7)),ImgCache.attributes.filesystem.root.getFile(o,{create:!1},function(t){n(e,t)},function(){n(e,null)})}},ImgCache.getCachedFileURL=function(e,n,i){var o=function(e,o){o?n(e,t.EntryGetURL(o)):i&&i(e)};ImgCache.getCachedFile(e,o)},ImgCache.isCached=function(e,t){ImgCache.getCachedFile(e,function(e,n){t(e,null!==n)})},ImgCache.useOnlineFile=function(e){if(i.isImgCacheLoaded()&&e){var t=n.getAttribute(e,o);t&&n.setAttribute(e,"src",t),n.removeAttribute(e,o)}},ImgCache.useCachedFile=function(e,t,o){i.isImgCacheLoaded()&&i.loadCachedFile(e,n.getAttribute(e,"src"),i.setNewImgPath,t,o)},ImgCache.useCachedFileWithSource=function(e,n,o,r){if(i.isImgCacheLoaded()){var a=t.sanitizeURI(n);i.loadCachedFile(e,a,i.setNewImgPath,o,r)}},ImgCache.clearCache=function(e,t){i.isImgCacheLoaded()&&ImgCache.attributes.dirEntry.removeRecursively(function(){ImgCache.overridables.log("Local cache cleared",LOG_LEVEL_INFO),i.setCurrentSize(0),i.createCacheDir(e,t)},function(e){ImgCache.overridables.log("Failed to remove directory or its contents: "+e.code,LOG_LEVEL_ERROR),t&&t()})},ImgCache.removeFile=function(e,n,o){e=t.sanitizeURI(e);var r=i.getCachedFilePath(e),a=function(e){ImgCache.overridables.log("Failed to remove file due to "+e.code,LOG_LEVEL_ERROR),o&&o()};ImgCache.attributes.filesystem.root.getFile(r,{create:!1},function(e){e.remove(function(){n&&n()},a)},a)},ImgCache.cacheBackground=function(e,t,n,o){if(i.isImgCacheLoaded()){var r=i.getBackgroundImageURL(e);if(!r)return ImgCache.overridables.log("No background to cache",LOG_LEVEL_WARNING),void(n&&n());ImgCache.overridables.log("Background image URL: "+r,LOG_LEVEL_INFO),ImgCache.cacheFile(r,t,n,o)}},ImgCache.useCachedBackground=function(e,t,o){if(i.isImgCacheLoaded()){var a=i.getBackgroundImageURL(e);if(!a)return ImgCache.overridables.log("No background to cache",LOG_LEVEL_WARNING),void(o&&o());var s=function(e,t,i){n.setBackgroundImage(e,'url("'+t+'")'),n.setAttribute(e,r,i)};i.loadCachedFile(e,a,s,t,o)}},ImgCache.useBackgroundOnlineFile=function(e){if(e){var t=n.getAttribute(e,r);t&&n.setBackgroundImage(e,'url("'+t+'")'),n.removeAttribute(e,r)}},ImgCache.getCacheFolderURI=function(){return i.isImgCacheLoaded()?t.EntryGetURL(ImgCache.attributes.dirEntry):void 0},"function"==typeof define&&define.amd?define("imgcache",[],function(){return ImgCache}):"object"==typeof module&&module.exports?module.exports=ImgCache:window.ImgCache=ImgCache}(window.jQuery||window.Zepto||function(){throw"jQuery is not available"}),define("window",[],function(){"use strict";return window}),define("templates-compiled",["angular"],function(e){e.module("app.templates",[]).run(["$templateCache",function(e){"use strict";e.put("templates/loading.html",'\n \n \n \n \n \n \n'),e.put("templates/login.html",''),e.put("templates/more.html",'\n \n \n \n \n \n Channel\n \n \n \n Notifications\n \n \n \n Logout\n \n \n\n \n'),e.put("templates/register.html",''),e.put("templates/tabs.html",'\n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n \n\n\n'),e.put("templates/tutorial.html",'\n \n\n\n \n \n
\n
\n \n

Expand your reach.

\n

Swipe left to begin.

\n

Swipe right to skip tutorial.

\n
\n
\n\n \n
\n

Subscribe

\n\n
\n
\n
\n \n
\n

{{entity.name}}

\n
\n
\n\n
\n \n \n \n \n \n \n
\n
\n
\n\n

Swipe right to subscribe or left to pass. If someone subscribes back you match and can chat.

\n
\n
\n\n \n
\n

Capture & Share

\n\n\n
\n \n\n\n \n

\n
\n\n \n

\n
\n\n \n

\n
\n\n \n

\n
\n\n
\n
\n
\n

Share great moments and ideas.

\n\n
\n
\n\n \n
\n

News

\n\n
\n \n \n\n

{{story.user}}

\n

now

\n\n
\n\n
\n

{{story.message}}

\n
\n\n \n
\n\n\n
\n
\n\n\n\n \n
\n

Discover

\n\n
\n
\n
\n \n
\n

Minds

\n
\n
\n\n \n
\n
\n\n

Vote to make trends.

\n
\n
\n\n \n
\n

Encrypted Chat

\n\n \n \n \n\n
\n Hello.\n
\n\n
\n \n \n\n
\n Hey!\n
\n\n
\n \n \n\n
\n It\'s great how we can chat without being spied on\n
\n\n
\n \n \n\n
\n Yeah! And the app is free and open-source too\n
\n\n
\n
\n\n

Message securely with matches.

\n
\n
\n\n \n
\n

Points

\n\n \n\n
\n +1\n
\n\n

Earn points for every vote, comment, remind, swipe, post and upload.

\n\n
\n
\n\n \n
\n

Boost

\n\n \n\n Boost\n\n

Use your points to go viral by boosting to the news feed or other channels.

\n\n
\n
\n\n \n
\n\n
\n
\n
\n\n
\n
\n'),e.put("templates/capture/default.html",'\n \n \n \n
\n \n \n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n \n

\n
\n \n
\n
\n \n
\n
\n \n \n
\n \n \n \n \n
\n \n \n \n
\n \n
\n \n

\n By uploading this content you confirm that you have the right to distribute this content under the selected license.\n

\n
\n
\n\n
\n \n
\n\n
'),e.put("templates/capture/status.html",'\n \n\n \n
\n \n
\n

Status Post

\n
\n \n
\n
\n \n \n \n
\n \n \n \n \n
\n \n \n

{{form.meta.title}}

\n

{{form.meta.description}}

\n \n
\n \n \n \n \n
\n \n
\n
'),e.put("templates/channels/channel.html",'\n\n \n\n \n \n Add banner in settings\n \n
\n \n
\n \n
\n\n
\n \n
\n
\n

\n

\n
\n \n
\n \n \n \n \n\n \n \n
\n
'),e.put("templates/channels/edit.html",'\n\n \n \n \n \n Save\n \n\n \n \n
\n \n \n \n \n
\n
\n \n {{location.address.town}}{{location.address.city}}, {{location.address.state}}\n \n
\n
\n \n \n \n \n \n \n Invite contacts\n \n \n \n Contact / Bug Reports\n \n \n \n Terms\n \n \n \n Privacy Policy\n \n \n \n Code\n \n \n \n \n Cancel channel\n \n \n \n
\n\n
\n
'),e.put("templates/channels/subscribers.html",'\n\n \n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n'),e.put("templates/channels/subscriptions.html",'\n\n \n \n \n\n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n'),e.put("templates/comments/list.html",'\n\n \n \n \n \n\n \n {{comment.ownerObj.name}}: {{comment.description}}\n \n\n \n \n
\n \n \n
\n \n
\n
'),e.put("templates/directives/activity.html",'\n \n
\n

\n
\n \n
\n

\n
\n \n \n\n
\n \n
\n \n \n
\n \n
\n \n \n
\n \n \n \n \n \n \n
\n\n
\n
\n \n
\n
\n\n
\n

\n

{{::activity.perma_url | domain}}

\n
\n \n
\n Boosted\n
\n \n '),e.put("templates/directives/owner-brief.html",'\n \n \n \n \n \n \n\n \n \n

\n

\n \n
'),e.put("templates/discover/entities/object.html",'\n\n\n
\n \n \n \n
\n

\n
\n\n \n \n
\n\n\n
\n
\n

\n
\n \n
\n\n\n
\n \n
\n\n
\n

\n

{{entity.perma_url}}

\n
\n\n
\n Boosted\n
\n\n\n'),e.put("templates/discover/entities/user.html",'\n \n
\n

{{entity.city}}\n

\n
\n
\n\n
\n Boosted\n
\n \n'),e.put("templates/discover/list.html",'\n\n \n
\n \n \n
\n
\n\n \n \n\n \n \n \n
\n
\n Discovering..\n
\n \n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n \n
\n \n
\n
\n \n
\n
\n \n \n \n \n \n
\n \n
'),e.put("templates/discover/swipe.html",'\n\n \n
\n \n \n
\n
\n\n \n \n\n \n \n \n
\n
\n Discovering...\n
\n \n
\n \n
\n \n \n
\n
\n \n Boost\n \n
\n \n \n
\n
\n \n \n Boost\n \n\n
\n \n
\n
\n \n \n \n \n \n
\n \n \n \n
\n Location off\n Locating\n No results\n \n \n within \n \n of {{city}} \n \n
\n\n
\n
\n Discovering near you...\n
\n\n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n \n
\n
\n \n
\n \n
'),e.put("templates/gatherings/chat/conversation.html",'\n \n \n \n \n \n \n \n {{name}}\n \n \n\n \n\n \n \n \n \n\n \n \n \n
\n \n
\n \n {{message.time_created * 1000 | date:\'shortTime\'}} - {{message.time_created * 1000 | date:\'longDate\'}}

\n
\n \n
\n
\n downloading..\n
\n\n
\n\n
\n \n \n
\n \n
\n
\n \n
'),e.put("templates/gatherings/chat/list.html",'\n\n \n \n Invite\n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n

\n

{{conversation.last_msg * 1000 | date:\'shortTime\'}} - {{conversation.last_msg * 1000 | date:\'longDate\'}}

\n \n
\n \n \n \n \n

{{conversation.name}}

\n
\n
\n \n
\n \n \n \n\n
\n
'),e.put("templates/gatherings/chat/setup.html",'\n\n \n\n
\n \n \n \n \n
\n \n
\n \n
\n \n
\n \n
\n \n
\n \n \n
\n \n
\n \n
\n \n
\n
\n \n

\n - You only need to enter this encryption password once as long as you stay signed in.
\n - It is important so that no one other than you and the people you are communicating with can access the content of your messages.
\n - By default the content of your messages is fully encrypted. For heightened security you may wish to go to your app settings and turn off push notifications in order to disallow metadata from being tracked. \n

\n

\n \n

\n\n
\n
'),e.put("templates/invite/invite.html",'\n \n \n
\n \n
\n

Invite contacts

\n
\n \n
\n
\n \n \n
\n
\n

{{contact.name.formatted}}

\n

{{contact.emails[0].value}}

\n \n
\n
\n
\n
'),e.put("templates/modals/avatar.html",'\n \n\n \n
\n \n
\n

Setup

\n
\n \n
\n
\n \n \n \n
\n \n
\n \n \n

Select the image above to select an avatar

\n \n \n \n
\n
'),e.put("templates/modals/optional.html",'\n \n\n \n
\n \n
\n

Optional

\n
\n \n \n
\n
\n \n \n \n
\n \n
\n Gender\n \n Male / \n Female / \n Private\n
\n \n \n \n
\n
\n \n {{location.address.town}}{{location.address.city}}, {{location.address.state}}\n \n
\n
\n \n \n
\n\n
\n
'),e.put("templates/newsfeed/boost.html",'\n \n\n \n
\n \n
\n

Boost Post

\n
\n \n \n \n
\n
\n \n \n \n
\n \n
\n \n

Channel

\n \n

Select a channel above to have your post distributed to their subscribers in exchange for points.

\n \n
\n
\n \n \n @{{user.username}}\n
\n
\n
\n \n
\n \n

Full Network

\n

Your post will appear at the top of everyone\'s newsfeed until your views are met.

\n Select\n\n
\n \n
\n \n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n

\n Transactions are non-refundable. \n You will be notified when your post reaches the requested number of views. \n The amount of time this will take depends on site activity, so don\'t worry if you don\'t hear from us for a while; we will keep it in circulation until it reaches the goal!\n

\n
\n \n
\n

\n You will be notified if you post is accepted or rejected by {{data.destination}}. Once they accept, this post will not be able to be deleted.\n

\n
\n \n \n \n
\n \n \n
\n
'),e.put("templates/newsfeed/compose.html",'\n \n

Write a post...

\n
\n \n
\n \n \n
\n
\n
'),e.put("templates/newsfeed/list.html",'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n\n \n \n\n \n \n \n \n\n \n'),e.put("templates/newsfeed/view.html",'\n\n \n \n \n\n \n \n
\n \n
\n \n \n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n \n
\n
\n \n \n
\n
\n \n\n
\n
'),e.put("templates/notifications/entity.html",'\n\n \n \n \n \n \n \n \n
\n \n
\n\n
\n
\n
\n
\n
\n \n
\n
\n \n \n \n
\n \n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n
\n\n \n \n
\n
\n \n\n
\n
'),e.put("templates/notifications/list.html",'\n\n \n \n \n \n\n \n\n \n \n \n \n\n
\n
\n \n\n
\n \n \n

You have a match! {{notification.fromObj.name}} subscribed to you

\n

{{notification.fromObj.name}} subscribed to you

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n

\n
\n
\n \n \n \n \n \n \n \n
\n Sorry, there was an error viewing this notification\n
\n
\n \n {{ notification.time_created * 1000 | date : \'medium\' }}\n \n \n \n
\n
\n\n
\n \n \n\n
\n
'),e.put("templates/notifications/p2p-review.html",'\n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n \n\n \n'),e.put("templates/wallet/balance.html",'\n\n \n \n \n \n Purchase\n \n \n\n \n\n \n \n

{{points}} points

\n \n

1 point = {{boost_rate}} views

\n \n \n \n \n \n \n +{{transaction.points | abbr }}\n {{transaction.points | abbr}}\n

{{transaction.description}}

\n

{{transaction.time_created * 1000 | date:"MM/dd/yyyy \'at\' h:mma"}}

\n
\n
\n \n\n
\n
'),e.put("templates/wallet/boost.html",'\n \n\n \n
\n \n \n
\n

Boost

\n
\n \n \n \n
\n
\n \n \n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n \n
\n
'),e.put("templates/wallet/deposit.html",'\n\n \n Wallet\n \n\n \n\n
\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n \n
\n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n

Congratulations!

\n
\n\n
\n
'),e.put("templates/wallet/review_boost.html",'\n \n\n \n
\n \n
\n

Review

\n
\n \n \n \n
\n We couldn\'t load this post.\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n
Accept
\n
\n
\n
Reject
\n
\n
\n \n \n
\n
\n
\n
\n
\n \n
\n
\n \n \n
\n
') }])}),define("services/api/OAuth",["angular"],function(e){"use strict";var t=function(t,n,i,o){var r=(Math.round((new Date).getTime()/1e3),{client_id:n.client_id,client_secret:n.client_secret,redirect_uri:t.node_url+"news",access_token:null,timestamp:0,buildParams:function(t){return e.extend(t,{client_id:n.client_id,access_token:o.get("access_token")})},login:function(e,n,a){i({method:"POST",url:t.node_url+"oauth2/token",data:{grant_type:"password",client_id:r.client_id,client_secret:r.client_secret,username:e,password:n},headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).success(function(e){o.set("user_id",e.user_id),o.set("user_guid",e.user_id),o.set("access_token",e.access_token),o.set("loggedin",!0),o.set("loggedin_",!0),a(!0)}).error(function(e,t,n,i){console.log("fail..",e,t,n,i),a(!1)})},refresh:function(e){i({method:"POST",url:t.node_url+"oauth2/token",data:{grant_type:"refresh_token",client_id:r.client_id,client_secret:r.client_secret,refresh_token:e},headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}).success(function(e){console.log(e)}).error(function(e,t,n,i){console.log("fail..",e,t,n,i),alert("fail...")})}});return r};return t.$inject=["$rootScope","OAuthConfig","$http","storage"],t}),define("services/storage",["angular"],function(){"use strict";var e=function(){var e=window.localStorage;return{set:function(t,n){return e.setItem(t,JSON.stringify(n))},get:function(t){var n=e.getItem(t);if(!n)return!1;try{return JSON.parse(n)}catch(i){return console.log(i),!1}},remove:function(t){return e.removeItem(t)}}};return e.$inject=[],e}),define("services/push",["angular"],function(){"use strict";var e=function(e,t){var n=[],i=function(e,t){for(var i=0;i0&&(console.log(n.regid),console.log(e.get("user_guid")),console.log(e.get("push-token")),e.get("user_guid")===!1||e.get("push-token")==n.regid&&e.get("push-token")||(console.log("submitting our push token"),t.post("api/v1/notifications",{service:"google",token:n.regid},function(){e.set("push-token",n.regid)},function(){console.log("error saving...")})));break;case"message":r?i(n.payload.uri,{service:"android"}):setTimeout(function(){i(n.payload.uri,{service:"android",changeState:!0})},1500);break;case"error":console.log("Notification error:: "+n.msg)}},{register:o,listen:function(e,t){console.log("new listener");var i=Date.now();return n.push({event:e,callback:t,id:i}),i},unlisten:function(e,t){for(var i=0;i{{message}}",replace:!0,scope:!0,link:function(e,i,r){i.html(o.getTrustedHtml('
decrypting...
')),crypt.setPrivateKey(n.get("private-key")),crypt.decrypt(r.message,function(n){e.message=t("linky")(n),i.html(o.getTrustedHtml(e.message))})}}};return e.$inject=["$rootScope","$filter","storage","$compile","$sce"],e}),define("directives/imageCache",["angular"],function(){"use strict";var e=function(){return{restrict:"A",link:function(){}}};return e.$inject=["$ionicPlatform"],e}),define("directives/thumbs",["angular"],function(e){"use strict";var t=function(t,n){return{restrict:"A",link:function(t,i,o){var r=o.$observe("thumbs",function(t){t.indexOf(n.get("user_guid"))>-1?e.element(i).addClass("selected"):e.element(i).removeClass("selected")});t.$on("$destroy",function(){r()})}}};return t.$inject=["$rootScope","storage"],t}),define("directives/playVideo",["angular"],function(){"use strict";var e=function(e,t,n,i,o,r,a,s,c,l){return{restrict:"AE",link:function(e,t,n){e.showVideo=!1;var a=n.$observe("playsrc",function(t){e.srcFull=i.trustAsResourceUrl(t),a()});e.play=function(){if(l.playing&&("android"==device.platform||"Android"==device.platform))return!1;l.playing=!0,e.$digest(),("android"==device.platform||"Android"==device.platform||"amazon-fireos"==device.platform)&&StatusBar.hide(),o.show({template:"Loading..."}),r(function(){o.hide()},5e3),e.showVideo=!0,("android"==device.platform||"Android"==device.platform)&&(e.showVideo=!1,e.$apply());var n=t[0].querySelector("#video");n.src=e.srcFull,console.log("video src == "+n.src),console.log("trying to play:: "+n.src),n.load(),n.play(),"iOS"==device.platform?n.webkitEnterFullscreen():n.webkitRequestFullscreen(),n.onplaying=function(){o.hide()},n.onerror=function(){o.hide(),l.playing=!1,alert("Sorry, there was a problem playing this video. Please try again in a few minutes.")},n.addEventListener("webkitendfullscreen",function(){n.pause(),e.showVideo=!1,l.playing=!1,e.$apply(),console.log("ended full screen"),StatusBar.show()}),n.addEventListener("webkitfullscreenchange",function(){e.showVideo=!1,e.$apply(),document.webkitIsFullScreen||(n.pause(),l.playing=!1,StatusBar.show())}),n.addEventListener("ended",function(){n.pause(),e.showVideo=!1,l.playing=!1,e.$apply(),StatusBar.show()},!1)},t.on("click",e.play),e.$on("$destroy",function(){t.off("click",e.play)})}}};return e.$inject=["$ionicScrollDelegate","$interval","Client","$sce","$ionicLoading","$timeout","$ionicGesture","$ionicPosition","$ionicPlatform","$rootScope"],e}),define("directives/subscribe",["angular"],function(e){"use strict";var t=function(t,n,i,o,r,a){return{restrict:"A",link:function(t,s){var c=s.find("i");t.entity.subscribed&&e.element(c).addClass("selected");var l=0;o.on("dragright",function(){if(l+=1,r(function(){l=0},600),l>2){if(a.show({template:''}),r(function(){a.hide()},1e3),t.entity.subscribed)return console.log("already subscribed"),!0;t.entity.subscribed=!0,e.element(c).addClass("selected"),console.log("posting to api/v1/subscribe/"+t.entity.guid),n.post("api/v1/subscribe/"+t.entity.guid,{},function(t){e.element(c).addClass("selected"),i.put("entities.cb",Date.now()),console.log(t)},function(t){e.element(c).removeClass("selected"),console.log("error",t)})}},s);var u=0;o.on("dragleft",function(){u+=1,r(function(){u=0},600),u>2&&(console.log(t.view),"swipe"==t.view&&s.remove())},s)}}};return t.$inject=["$rootScope","Client","Cacher","$ionicGesture","$timeout","$ionicLoading"],t}),define("directives/swipe",["angular"],function(){"use strict";var e=function(e,t,n,i){return{restrict:"A",scope:{swipeOnLeft:"&swipeOnLeft",swipeOnRight:"&swipeOnRight",swipeOnUp:"&swipeOnUp",swipeOnDown:"&swipeOnDown"},link:function(e,t,n){t.css("transform","translate3d(0px, 0px, 0)"),t.css("webkitTransform","translate3d(0px, 0px, 0)"),i.on("dragstart",function(e){e.preventDefault();{var t=320,n=window.innerWidth/2+1*(t/2);Math.abs(n-e.gesture.touches[0].pageX)}},t),i.on("drag",function(i){i.preventDefault(),ionic.requestAnimationFrame(function(){var o=i.gesture.deltaX/-1e3,r=Math.atan(o),a=.8*i.gesture.deltaX,s=.8*i.gesture.deltaY;if(e.$eval(n.swipeDisableVertical)){if(!(-15>a||a>15))return!1;if("android"==device.platform||"Android"==device.platform)return!1}e.$eval(n.swipeDisableVertical)&&(s=0),ionic.requestAnimationFrame(function(){t.css("transform","translate3d("+a+"px, "+s+"px, 0) rotate("+(r||0)+"rad)"),t.css("webkitTransform","translate3d("+a+"px, "+s+"px, 0) rotate("+(r||0)+"rad)")}),t.css("z-index",99999999)})},t),i.on("dragend",function(i){ionic.requestAnimationFrame(function(){t.css("webkitTransform","translate3d(0, 0, 0)"),t.css("transform","translate3d(0, 0, 0)");var o=100,r=-100,a=-140,s=140;return i.gesture.deltaX>o?(e.swipeOnRight(),!0):i.gesture.deltaXs?(e.swipeOnDown(),!0):void 0})},t)}}};return e.$inject=["$rootScope","Client","Cacher","$ionicGesture","$timeout","$ionicLoading","$compile"],e}),define("directives/walletCounter",["angular"],function(){"use strict";var e=function(e,t,n,i){return{restrict:"E",template:"{{$root.points}}",scope:{},link:function(){t(function(){i.getCount()})}}};return e.$inject=["$rootScope","$timeout","Client","wallet"],e}),define("directives/directives",["require","angular","services/services","directives/activityView","directives/remindView","directives/ownerBriefView","directives/decrypt","directives/imageCache","directives/thumbs","directives/playVideo","directives/subscribe","directives/swipe","directives/walletCounter"],function(e){"use strict";var t=e("angular"),n=(e("services/services"),t.module("app.directives",["app.services"]));return n.directive("activityView",e("directives/activityView")),n.directive("remindView",e("directives/remindView")),n.directive("ownerBriefView",e("directives/ownerBriefView")),n.directive("decrypt",e("directives/decrypt")),n.directive("imageCache",e("directives/imageCache")),n.directive("thumbs",e("directives/thumbs")),n.directive("playVideo",e("directives/playVideo")),n.directive("subscribe",e("directives/subscribe")),n.directive("swipe",e("directives/swipe")),n.directive("walletCounter",e("directives/walletCounter")),n}),define("controllers/LoadingCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){navigator.splashscreen.hide();var l=a(function(){t.go(r.get("access_token")&&r.get("loggedin")?"tab.newsfeed":"login")},100);intents.onIntent(function(){a.cancel(l),t.go("tab.capture"),c.registerBackButtonAction(function(){navigator.app.exitApp()},501)}),s.register()}return e.$inject=["$scope","$state","OAuth","Client","$ionicPopup","storage","$timeout","push","$ionicPlatform"],e}),define("controllers/TutorialCtrl",[],function(){"use strict";function e(e,t){e.entity={guid:"not-real",type:"username",name:"Albert Einstein",avatar_url:"http://content8.flixster.com/rtactor/42/23/42230_pro.jpg"},e.slideHasChanged=function(e){8==e&&t.go("tab.newsfeed")},e.news=[{guid:63,user:"Mark Harding",message:"Welcome to the Minds app!"},{guid:421,user:"Johnny Lagrange",message:"Share your videos, photos & status."}]}return e.$inject=["$scope","$state","storage"],e}),define("controllers/TabsCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){t.logout=function(){o.remove("loggedin"),o.remove("access_token"),o.remove("private-key"),n.go("login")},t.onTabSelect=function(e){return e==n.current.name?(n.go(e,{},{reload:!0}),!0):void n.go(e)},r.listen("chat",function(t){e.newChat="minds-yellow",e.$apply(),t.changeState&&"tab.chat"!=n.current.name&&n.go("tab.chat")}),r.listen("notification",function(t){e.newNotification="minds-yellow",e.$apply(),t.changeState&&"tab.notifications"!=n.current.name&&n.go("tab.notifications")}),s.init(),a.registerBackButtonAction(function(){return e.playing?(document.webkitExitFullscreen(),!1):void("tab.newsfeed"==n.current.name||"login"==n.current.name?navigator.app.exitApp():c.goBack())},100),document.addEventListener("memorywarning",function(){console.log("memory warning received"),c.clearCache()})}return e.$inject=["$rootScope","$scope","$state","$ionicPopover","storage","push","$ionicPlatform","analytics","$ionicHistory"],e}),define("controllers/LoginCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){cordova.plugins.Keyboard.disableScroll(!0),a.get("access_token")&&a.get("loggedin")&&n.go("tab.newsfeed"),console.log(a.get("access_token")),console.log(a.get("loggedin")),t.inprogress=!1,t.login=function(){return t.inprogress?!1:(c.show({template:""}),t.inprogress=!0,void i.login(t.username,t.password,function(i){if(c.hide(),i)s.register(),e.user_guid=a.get("user_guid"),o.get("api/v1/channel/me",{},function(e){a.set("city",e.channel.city)},function(){}),n.go("tutorial");else{var l=r.alert({title:"Ooops..",template:"We couldn't log you in. Please check your credentials and try again."});l.then(function(){})}t.inprogress=!1},function(){c.hide(),t.inprogress=!1}))}}return e.$inject=["$rootScope","$scope","$state","OAuth","Client","$ionicPopup","storage","push","$ionicLoading"],e}),define("controllers/RegisterCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l){t.data={referrer:""},t.inprogress=!1,t.toTutorial=function(){n.go("tutorial")},t.register=function(){return t.inprogress?!1:t.data.username?t.data.password?t.data.email?(t.inprogress=!0,l.show({template:"Please wait a moment..."}),void o.post("api/v1/register",{username:t.data.username,password:t.data.password,email:t.data.email,referrer:t.data.referrer},function(n){if(l.hide(),"error"==n.status){t.inprogress=!1;{r.alert({title:"Ooops..",template:n.message})}return!1}l.show({template:"Logging in..."}),i.login(t.data.username,t.data.password,function(n){if(l.hide(),n)e.user_guid=a.get("user_guid"),s.register(),c.fromTemplateUrl("templates/modals/avatar.html",{scope:t,animation:"slide-in-up"}).then(function(e){t.modal=e,t.modal.show()}),c.fromTemplateUrl("templates/modals/optional.html",{scope:t,animation:"slide-in-up"}).then(function(e){t.modal2=e});else{var i=r.alert({title:"Ooops..",template:"We couldn't log you in. Please check your credentials and try again."});i.then(function(){})}t.inprogress=!1},function(){l.hide(),t.inprogress=!1})},function(){t.inprogress=!1,l.hide();r.alert({title:"Ooops..",template:"Something went wrong.. Try again later."})})):(r.alert({title:"Ooops..",template:"You need to enter an email address"}),!1):(r.alert({title:"Ooops..",template:"You need to enter a password"}),!1):(r.alert({title:"Ooops..",template:"You need to enter a username"}),!1)},t.searching=!1,t.searchUsers=function(){t.searching=!0,"@"!=t.data.referrer.charAt(0)&&0!==t.data.referrer.length&&(t.data.referrer="@"+t.data.referrer);var e=t.data.referrer;"@"==e.charAt(0)&&(e=e.substr(1)),o.get("search",{q:e,type:"user",view:"json",limit:5},function(e){t.results=e.user[0]}),console.log("changing"),t.data.referrer||(t.searching=!1)},t.selectReferrer=function(e){t.searching=!1,t.data.referrer="@"+e.username}}return e.$inject=["$rootScope","$scope","$state","OAuth","Client","$ionicPopup","storage","push","$ionicModal","$ionicLoading"],e}),define("controllers/newsfeed/NewsfeedCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f,p,h){var m=e.$on("$stateChangeStart",function(e,n,i,o){n.name==o.name&&(a.scrollTop(),t.refresh())});t.$on("$destroy",function(){m()}),"tab.newsfeed"==n.current.name&&(e.$on("newsfeed:updated",function(){a.scrollTop(),t.refresh()}),e.$on("newsfeed:boost",function(n,i){n.stopPropagation(),i&&t.boost({guid:i,owner_guid:e.user_guid})})),e.newsfeedItems=[],t.newsfeedItems=[],t.next="",t.hasMoreData=!0,t.cachebreaker=0,t.loadMore=function(){f(function(){return console.log("==== loading more ===="),t.hasMoreData?void o.all({limit:12,offset:t.next,cachebreaker:t.cachebreaker},function(e){if(!e.activity)return t.hasMoreData=!1,t.$broadcast("scroll.infiniteScrollComplete"),!1;if(t.newsfeedItems.length>60)a.scrollTop(),t.newsfeedItems=e.activity;else for(var n in e.activity)t.newsfeedItems.push(e.activity[n]);t.next=e["load-next"],console.log("next is:: "+t.next),t.$broadcast("scroll.infiniteScrollComplete"),t.hasMoreData=!0},function(){t.hasMoreData=!1,t.$broadcast("scroll.infiniteScrollComplete")}):(console.log("==== canceling no more data ===="),void t.$broadcast("scroll.infiniteScrollComplete"))})},t.hasMore=function(){return!0},t.refresh=function(){console.log("=== refreshing ==="),t.hasMoreData=!0,o.all({limit:12,offset:"",cache_break:Date.now()},function(e){t.newsfeedItems=e.activity,t.next=e["load-next"],t.cachebreaker=Date.now(),s.put("newsfeed.cachebreaker",Date.now()),t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete")},function(){t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete")})},t.thumbsUp=function(n){e.points=e.points+1,t.ChannelItems&&(t.newsfeedItems=t.ChannelItems),t.activity&&(t.newsfeedItems[0]=t.activity),t.newsfeedItems.forEach(function(t,i,o){if(t.guid==n){o[i].hasOwnProperty("thumbs:up:user_guids")&&o[i]["thumbs:up:user_guids"]||(o[i]["thumbs:up:user_guids"]=[]);for(var r in o[i]["thumbs:up:user_guids"])if(o[i]["thumbs:up:user_guids"][r]===l.get("user_guid"))return delete o[i]["thumbs:up:user_guids"][r],o[i]["thumbs:up:count"]=o[i]["thumbs:up:count"]-1,e.points=e.points-2,!0;o[i]["thumbs:up:user_guids"][1]=l.get("user_guid"),o[i]["thumbs:up:count"]=o[i]["thumbs:up:count"]+1}}),c.put("api/v1/thumbs/"+n+"/up",{},function(){},function(){alert("failed..")}),d.show({template:''}),f(function(){d.hide()},1e3)},t.thumbsDown=function(n){e.points=e.points+1,t.ChannelItems&&(t.newsfeedItems=t.ChannelItems),t.activity&&(t.newsfeedItems[0]=t.activity),t.newsfeedItems.forEach(function(t,i,o){if(t.guid==n){o[i].hasOwnProperty("thumbs:down:user_guids")&&o[i]["thumbs:down:user_guids"]||(o[i]["thumbs:down:user_guids"]=[]);for(var r in o[i]["thumbs:down:user_guids"])if(o[i]["thumbs:down:user_guids"][r]===l.get("user_guid"))return delete o[i]["thumbs:down:user_guids"][r],o[i]["thumbs:down:count"]=o[i]["thumbs:down:count"]-1,e.points=e.points-2,!0;o[i]["thumbs:down:user_guids"][1]=l.get("user_guid"),o[i]["thumbs:down:count"]=o[i]["thumbs:down:count"]+1}}),c.put("api/v1/thumbs/"+n+"/down",{},function(){},function(){alert("failed..")}),d.show({template:''}),f(function(){d.hide()},1e3)},t.commentsData={},t.loadComments=function(e,n){t.comments.show(n),t.commentsData={};var i;i=e.entity_guid?e.entity_guid:e.guid,c.get("api/v1/comments/"+i,{cachebreaker:Date.now},function(e){console.log("success for "+i),console.log(e),t.commentsData=e.comments},function(){console.log("error")})},t.remind=function(n){c.post("api/v1/newsfeed/remind/"+n.guid,{},function(){},function(){alert("failed..")}),t.newsfeedItems.forEach(function(e,t,i){e.guid==n.guid&&(i[t].reminds=i[t].reminds+1)}),t.ChannelItems&&t.ChannelItems.forEach(function(e,t,i){e.guid==n.guid&&(i[t].reminds=i[t].reminds+1)}),t.activity&&(t.activity.reminds=t.activity.reminds+1),e.points=e.points+1,d.show({template:''}),f(function(){d.hide()},1e3)},t.remove=function(e){console.log("api/v1/newsfeed/"+e),c["delete"]("api/v1/newsfeed/"+e,{cachebreaker:Date.now},function(n){"success"==n.status&&(t.newsfeedItems.forEach(function(t,n,i){t.guid==e&&(console.log("removed"),i.splice(n,1))}),t.ChannelItems&&t.ChannelItems.forEach(function(t,n,i){t.guid==e&&(console.log("removed"),i.splice(n,1))}))},function(){console.log("error")})},t.loadNotifications=function(){n.go("tab.more-notifications",{},{reload:!0})};var g;t.openUrl=function(e){f.cancel(g),g=f(function(){window.open(e,"_blank","location=yes")},300)},t.boost=function(e){h.fromTemplateUrl("templates/newsfeed/boost.html",{scope:t,animation:"slide-in-up"}).then(function(n){t.modal=n,t.guid=e.guid,t.owner_guid=e.owner_guid,t.modal.show()})},t.openActions=function(n){var i=n.guid,o=[{text:"Share"},{text:"Report this"}];n.custom_data&&n.custom_data[0]&&n.custom_data[0].src&&o.push({text:"Download"}),p.show({buttons:o,destructiveText:"Delete",destructiveButtonClicked:function(){return n.p2p_boosted?(d.show({template:"Sorry, you can not delete a boosted post."}),f(function(){d.hide()},1e3),!1):n.owner_guid!=e.user_guid?(d.show({template:"Sorry, you can not delete posts that are not yourss."}),f(function(){d.hide()},1e3),!1):(confirm("are you sure?")&&t.remove(i),!0)},cancelText:"Cancel",cancel:function(){},buttonClicked:function(t){switch(t){case 0:window.plugins.socialsharing.share("via minds",null,null,e.node_url+"newsfeed/"+i);break;case 1:window.location.href="mailto:report@minds.com?subject=Report "+i+"&body=This content violates the terms and conditions";break;case 2:window.requestFileSystem(LocalFileSystem.PERSISTENT,0,function(e){var t=new FileTransfer;console.log(e.root.toURL()),e.root.getDirectory("minds",{create:!0,exclusive:!1},function(){},function(){}),t.download(n.custom_data[0].src,e.root.toURL()+"minds/"+i+".jpg",function(e){console.log("download complete: "+e.toURL())},function(e){console.log("download error source "+e.source),console.log("download error target "+e.target),console.log("upload error code"+e.code)},!1)})}return!0}})}}return e.$inject=["$rootScope","$scope","$state","$stateParams","NewsfeedAPI","$filter","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$timeout","$ionicActionSheet","$ionicModal","$ionicPlatform"],e}),define("controllers/newsfeed/NewsfeedCompoerCtrl",[],function(){"use strict";function e(e,t,n){e.post=function(){n.post({message:e.message},function(){t.go("tab.newsfeed")},function(){alert("there was an error and we couldn't save!")})}}return e.$inject=["$scope","$state","NewsfeedAPI"],e}),define("controllers/newsfeed/NewsfeedViewCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a){t.guid="",t.cb=Date.now(),t.activity={},t.comments=[],t.comment={},t.comment.body="",t.init=function(){i.get("api/v1/newsfeed/single/"+n.guid,{},function(e){t.activity=e.activity,t.guid=t.activity.entity_guid?t.activity.entity_guid:t.activity.guid,t.offset="",t.hasMore=!0,t.getComments()})},t.init(),t.inprogress=!1,t.getComments=function(){return t.inprogress?!1:(t.inprogress=!0,void i.get("api/v1/comments/"+t.guid,{cb:t.cb,limit:12,offset:t.offset},function(e){return t.inprogress=!1,e.comments&&0!==e.comments.length?(t.comments=t.comments.concat(e.comments),t.offset=e["load-next"],console.log(t.offset),null==t.offset&&(t.hasMore=!1),void t.$broadcast("scroll.infiniteScrollComplete")):(t.hasMore=!1,!1)},function(){t.inprogress=!1}))},t.submit=function(){t.comment.body&&(o.show({template:''}),i.post("api/v1/comments/"+t.guid,{comment:encodeURIComponent(t.comment.body)},function(e){o.hide(),t.comments.push(e.comment),t.cb=Date.now()},function(){}),t.comment.body="")},t.removeComment=function(n){var o=n.guid;return n.owner_guid!=e.user_guid?!1:void r.show({buttons:[],destructiveText:"Delete",destructiveButtonClicked:function(){return confirm("are you sure?")&&(i["delete"]("api/v1/comments/"+o,function(){}),t.comments.forEach(function(e,t,n){e.guid==o&&(console.log("removed"),n.splice(t,1))})),!0},cancelText:"Cancel",cancel:function(){}})},t.back=function(){a.goBack()}}return e.$inject=["$rootScope","$scope","$stateParams","Client","$ionicLoading","$ionicActionSheet","$ionicHistory"],e}),define("controllers/newsfeed/NewsfeedBoostCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){t.data={destination:"",points:null,impressions:0,rate:1,step:1},t.$watch("data.points",function(){t.data.impressions=""===t.data.destination?Math.round(t.data.points*t.data.rate):t.data.points},!0),s.get("api/v1/boost/rates",{cb:Date.now()},function(e){t.data.rate=e.rate}),t.boost=function(){if(t.data.points%1!==0)return t.data.points=Math.round(t.data.points),o.show({template:"Sorry, you must enter a whole point."}),a(function(){o.hide()},800),!1;if(0===t.data.points||!t.data.points)return t.data.points=1,o.show({template:"Sorry, you must enter a whole point."}),a(function(){o.hide()},800),!1;if(""===t.data.destination&&(0===t.data.impressions||0===Math.round(t.data.impressions)))return o.show({template:"Sorry, you must have at least 1 impression."}),a(function(){o.hide()},800),!1;o.show({template:"Please wait a moment."});var e=c.defer();return s.get("api/v1/wallet/count",{cb:Date.now()},function(i){if(o.hide(),i.countBuy points",type:"button-positive",onTap:function(){n.go("tab.newsfeed-wallet-deposit"),t.modal.remove()}},{text:"Close."}]}),e.resolve(!1);if(t.data.points>i.cap)return r.alert({title:"Ooops!",subTitle:"Sorry, there is a limit on how many points can be spent. ",buttons:[{text:"Lower rate?",type:"button-positive",onTap:function(){t.data.points=i.cap-1}},{text:"Close."}]}),e.resolve(!1);if(t.data.pointsIncrease?",type:"button-positive",onTap:function(){t.data.points=i.min}},{text:"Close."}]}),e.resolve(!1);if(i.count>=t.data.points){o.show({template:"Requesting Boost..."});var c="api/v1/boost/newsfeed/"+t.guid+"/"+t.owner_guid;t.data.destination&&(c="api/v1/boost/channel/"+t.guid+"/"+t.owner_guid),s.post(c,{impressions:t.data.impressions,destination:"@"==t.data.destination.charAt(0)?t.data.destination.substr(1):t.data.destination},function(n){return"success"==n.status?(o.hide(),t.modal.remove(),o.show({template:"Boost request submitted."}),a(function(){o.hide()},500),e.resolve(!0)):(o.hide(),o.show({template:"Sorry, something went wrong."}),a(function(){o.hide()},500),e.resolve(!1))},function(){return o.hide(),o.show({template:"Sorry, something went wrong."}),a(function(){o.hide()},500),e.resolve(!1)})}},function(){return e.resolve(!1)}),e.promise},t.searching=!1,t.results=[],t.changeDestination=function(e){t.searching=!0,"@"!=t.data.destination.charAt(0)&&0!==t.data.destination.length&&(t.data.destination="@"+t.data.destination),13==e.keyCode&&(t.searching=!1);var n=t.data.destination;"@"==n.charAt(0)&&(n=n.substr(1)),s.get("search",{q:n,type:"user",view:"json",limit:5},function(e){t.results=e.user[0]}),console.log("changing"),t.data.destination||(t.searching=!1)},t.selectDestination=function(e){t.searching=!1,t.data.destination="@"+e.username,t.nextStep() -},t.nextStep=function(){t.data.step=2},t.purchase=function(){n.go("tab.newsfeed-wallet-deposit"),t.modal.remove()}}return e.$inject=["$rootScope","$scope","$state","$stateParams","$ionicLoading","$ionicPopup","$timeout","Client","$q"],e}),define("controllers/gatherings/ChatCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){t.conversations=[],t.next="",t.hasMoreData=!0,t.cb=Date.now(),t.$on("$ionicView.beforeEnter",function(){return o.get("private-key")?(e.newChat=!1,void t.refresh()):(n.go("tab.chat-setup"),!1)}),r.listen("chat",function(){console.log("new message!"),"tab.chat"==n.current.name&&(t.cb=Date.now(),e.newChat=!1,t.refresh(),c.scrollTop())}),t.inprogress=!1,t.loadMore=function(e){return t.inprogress||!o.get("private-key")?!1:(t.inprogress=!0,void i.get("api/v1/conversations",{limit:12,offset:t.next,cb:t.cb},function(n){return n.conversations?(t.hasMoreData=!0,t.conversations=e?n.conversations:t.conversations.concat(n.conversations),t.next=n["load-next"],t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete"),void(t.inprogress=!1)):(t.hasMoreData=!1,!1)},function(){t.inprogress=!0}))},t.search={},t.doSearch=function(){return t.search.query?(console.log("doing search for "+t.search.query),void i.get("search",{q:t.search.query,type:"user",view:"json"},function(e){t.conversations=e.user[0]})):(t.refresh(),!0)},t.$on("$stateChangeSuccess",function(){console.log("state changed..")}),t.refresh=function(){t.search={},t.inprogress=!1,t.next="",t.previous="",t.cb=Date.now(),t.hasMoreData=!0,t.loadMore(!0)},t.subscribe=function(e){t.conversations[e].subscribed=!0,t.conversations[e].subscriber?window.location.href="#/tab/gatherings/conversations/"+t.conversations[e].guid+"/"+t.conversations[e].name:s.alert({title:"Subscribed",template:"You can chat with "+t.conversations[e].name+" when they subscribe to you too"}),i.post("api/v1/subscribe/"+t.conversations[e].guid,{},function(){},function(){})},t.invite=function(){i.get("api/v1/channel/"+e.user_guid,{},function(t){window.plugins.socialsharing.share("Hey! If you install the Minds app and tag me @"+t.channel.username+" we both get 100 points! \n\n","Join Minds and we both get 100 points to go viral!",null,e.node_url)},function(){})}}return e.$inject=["$rootScope","$scope","$state","Client","storage","push","$ionicModal","$ionicPopup","$ionicScrollDelegate"],e}),define("controllers/gatherings/ChatConversationCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f){function p(){a.scrollBottom()}function h(){i.go("tab.chat")}window.cordova&&(cordova.plugins.Keyboard.disableScroll(!1),cordova.plugins.Keyboard.close()),t.guid=n.username,t.name=n.name,t.messages=[],t.next="",t.previous="",t.hasMoreData=!0,t.publickeys={},t.inProgress=!1;var m=!0;if(t.loadMore=function(){t.inProgress=!0,console.log("loading messages from:"+t.next),o.get("api/v1/conversations/"+n.username,{limit:6,offset:t.next,cachebreak:Date.now()},function(n){if(e.newChat=!1,t.inProgress=!1,t.publickeys=n.publickeys,!t.publickeys[t.guid])return u.alert({title:"Sorry!",template:t.name+" has not yet configured their encrypted chat yet."}),i.go("tab.chat"),!0;if(!n.messages)return t.hasMoreData=!1,!1;t.hasMoreData=!0;var o;o=0===t.messages.length?!0:!1,t.messages=n.messages.concat(t.messages),console.log("------ MESSAGES ARE LOADED ------"),t.next=n["load-previous"],t.previous=n["load-next"],t.$broadcast("scroll.refreshComplete"),o&&s(function(){a.scrollBottom()},1e3),m=!0},function(){t.inProgress=!1})},t.loadMore(),!r.get("push-token")){var g=function(){return m?(console.log("checking for new messages.."),m=!1,void o.get("api/v1/conversations/"+n.username,{limit:1e3,start:t.previous,cachebreak:Date.now()},function(e){e&&e.messages&&(t.messages=t.messages.concat(e.messages),t.previous=e["load-next"],a.scrollBottom()),m=!0,clearTimeout(t.timeout),t.timeout=setTimeout(g,5e3)},function(){m=!0,console.log("polling for new messages failed")})):!1};t.timeout=setTimeout(g,5e3)}var v=l.listen("chat",function(){console.log("think you got a new message"),o.get("api/v1/conversations/"+n.username,{limit:1e3,start:t.previous,cachebreak:Date.now()},function(n){e.newChat=!1,n&&n.messages&&(t.messages=t.messages.concat(n.messages),t.previous=n["load-next"],a.scrollBottom())},function(){})});window.addEventListener("native.keyboardshow",function(){"tab.chat-conversation"==i.current.name&&a.scrollBottom()}),t.send=function(){if(!t.message)return u.alert({title:"Oooops...",template:"You need to enter a message before you can send."}),!1;if(t.message.length>180)return u.alert({title:"Oooops...",template:"Your message is too long. It must be less than 180 characters"}),!1;c.show({template:"Sending..."});var e=f.defer(),i={};for(var r in t.publickeys)!function(n){crypt.setPublicKey(t.publickeys[n]),crypt.encrypt(t.message,function(o){i[n]=encodeURIComponent(o),i.length==t.publickeys.length&&e.resolve(!0)})}(r);var s=!1;e.promise.then(function(){var e={};for(var r in i)e["message:"+r]=i[r];o.post("api/v1/conversations/"+n.username,e,function(e){s||(t.messages.push(e.message),t.previous=e.message.guid,s=!0),t.message="",c.hide(),a.scrollBottom()},function(e){c.hide(),alert("sorry, your message could not be sent"),console.log(e)})})},s(function(){window.addEventListener("native.keyboardhide",p),document.addEventListener("pause",h)},100),t.$on("$destroy",function(){clearTimeout(t.timeout),l.unlisten("chat",v),window.removeEventListener("native.keyboardhide",p),document.removeEventListener("pause",h)})}return e.$inject=["$rootScope","$scope","$stateParams","$state","Client","storage","$ionicScrollDelegate","$timeout","$ionicLoading","push","$ionicPopup","$ionicModal","$q"],e}),define("controllers/gatherings/ChatSetupCtrl",[],function(){"use strict";function e(e,t,n,i,o){e.configured=!1,e.data={},n.get("api/v1/channel/me",{},function(t){t.channel.chat&&(e.configured=!0)}),e.unlock=function(){n.get("api/v1/keys",{password:e.data.password,new_password:"abc123"},function(e){e.key?(o.set("private-key",e.key),t.go("tab.chat")):i.alert({title:"Ooops..",template:"We couldn't unlock your chat. Please check your password is correct."})},function(){})},e.setup=function(){return e.data.password?e.data.password!=e.data.password2?(i.alert({title:"Ooops..",template:"Your passwords must match."}),!1):void n.post("api/v1/keys/setup",{password:e.data.password},function(e){e.key?(o.set("private-key",e.key),t.go("tab.chat")):i.alert({title:"Ooops..",template:"We couldn't unlock your chat. Please check your password is correct."})},function(){}):(i.alert({title:"Ooops..",template:"You must enter a password."}),!1)}}return e.$inject=["$scope","$state","Client","$ionicPopup","storage"],e}),define("controllers/channels/ChannelCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l){if(void 0===i.username)return n.go("tab.newsfeed"),!1;t.loaded=!1,t.next="",t.ChannelItems=[];var u;t.cb=Date.now();var d=e.$on("$stateChangeSuccess",function(e,n,i,o){"tab.newsfeed-channel-edit"==o.name&&(t.cb=Date.now(),t.init()),"tab.newsfeed-channel"==o.name&&u&&s.cancel(u)});t.$on("$destroy",function(){u&&s.cancel(u),d()}),t.init=function(){console.log("init called"),o.get("api/v1/channel/"+i.username,{cb:t.cb},function(i){return"error"==i.status?(n.go("tab.newsfeed"),!0):(t.channel=i.channel,e.guid==t.channel.guid&&(l.set("city",t.channel.city),l.set("coordinates",t.channel.coordinates)),0===t.ChannelItems.length&&c(function(){t.loadMore()}),void(i.channel.carousels&&(r.update(),u=s(function(){r.$getByHandle("channel-banners").slide(0)},3e3*i.channel.carousels.length))))},function(){})},t.init(),t.loadMore=function(){return t.channel?(console.log("getting a users feed"),void o.get("api/v1/newsfeed/personal/"+t.channel.guid,{limit:6,offset:t.next,cb:Date.now()},function(e){return t.loaded=!0,e.activity?(console.log("found users feed, loading it"),t.hasMoreData=!0,t.ChannelItems=t.ChannelItems.concat(e.activity),t.next=e["load-next"],t.$broadcast("scroll.infiniteScrollComplete"),void t.$broadcast("scroll.refreshComplete")):(console.log("users feed not found"),t.$broadcast("scroll.refreshComplete"),t.hasMoreData=!1,!1)},function(){t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete")})):!1},t.channelRefresh=function(){return t.channel?(t.next="",void t.loadMore()):!1},t.subscribe=function(e){t.channel.subscribed=!0,t.channel.subscribers_count=t.channel.subscribers_count+1,o.post("api/v1/subscribe/"+e.guid,{},function(){},function(){t.channel.subscribed=!1,t.channel.subscribers_count=t.channel.subscribers_count-1})},t.unSubscribe=function(e){t.channel.subscribed=!1,t.channel.subscribers_count=t.channel.subscribers_count-1,o["delete"]("api/v1/subscribe/"+e.guid,{},function(){},function(){t.channel.subscribed=!0,t.channel.subscribers_count=t.channel.subscribers_count+1})}}return e.$inject=["$rootScope","$scope","$state","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate","$interval","$timeout","storage"],e}),define("controllers/channels/ChannelEditCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f,p,h){t.cb=Date.now();var m;i.guid||(i.guid=e.user_guid),o.get("api/v1/channel/"+i.guid,{cb:t.cb},function(e){t.channel=e.channel},function(){}),t.update=function(e){return t.channel.name?void o.post("api/v1/channel/info",t.channel,function(){c.show({template:''}),l(function(){c.hide()},1e3),e&&n.go("tab.newsfeed-channel",{username:"me",refresh:!0})},function(){}):(p.alert({title:"Oooops...",template:"Your need a name!"}),!1)},t.cities=[],t.autoSearchLocation=function(){l.cancel(m),m=l(function(){o.get("api/v1/geolocation/list",{q:t.channel.city},function(e){t.cities=e.results,console.log(t.cities)},function(){})},300)},t.selectSuggestedLocation=function(e){t.cities=[],t.channel.coordinates=e.lat+","+e.lon,e.address.city&&(t.channel.city=e.address.city),e.address.town&&(t.channel.city=e.address.town),r.set("city",t.channel.city),r.set("coordinates",t.channel.coordinates)},t.changeAvatar=function(){function n(n){var i=document.getElementById("avatar");i.src=n,c.show({template:"Uploading..."});var o=new FileTransfer,a=new FileUploadOptions;a.headers={Authorization:"Bearer "+r.get("access_token")},console.log(n),o.upload(n,encodeURI(e.node_url+"api/v1/channel/avatar"),function(){c.hide(),e.globalCB=Date.now(),e.$apply(),t.channel.cb=Date.now()},function(e){c.hide(),console.log("error"),console.log(e)},a)}function i(){}navigator.camera.getPicture(n,i,{quality:50,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,correctOrientation:!0})},t.addBanner=function(){t.channel.carousels?p.alert({title:"Warning!",subTitle:"Adding a new banner will replace all existing banners on your channel.",buttons:[{text:"Close"},{text:"Replace",type:"button-positive",onTap:function(){t.selectBanner()}}]}):t.selectBanner()},t.selectBanner=function(){function t(t){var n=new FileTransfer,i=new FileUploadOptions;i.headers={Authorization:"Bearer "+r.get("access_token")},console.log(t),n.upload(t,encodeURI(e.node_url+"api/v1/channel/banner"),function(){e.globalCB=Date.now()},function(e){console.log("error"),console.log(e)},i)}function n(){}navigator.camera.getPicture(t,n,{quality:50,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,correctOrientation:!0})},t.changeGender=function(e){t.channel.gender=e,t.$apply()},t.invite=function(){window.plugins.socialsharing.share("Hey! If you install the Minds app and tag me @"+t.channel.username+" we both get 100 points! \n\n","Join Minds and we both get 100 points to go viral!",null,e.node_url)},t.disable=function(){var e=h.defer();return p.alert({title:"Are you sure?",buttons:[{text:"No!"},{text:"Yes",type:"button-positive",onTap:function(){c.show({template:""}),o["delete"]("api/v1/channel",{},function(){c.hide(),t.logout()},function(){alert("sorry, we could not delete")}),e.resolve(!0)}}]}),e.promise},t.logout=function(){o.post("api/v1/logout",{},function(){},function(){}),r.remove("loggedin"),r.remove("user_guid"),r.remove("access_token"),r.remove("private-key"),r.remove("push-token"),ionic.Platform.exitApp(),f.clearCache(),n.go("login")}}return e.$inject=["$rootScope","$scope","$state","$stateParams","Client","storage","$ionicSlideBoxDelegate","$ionicScrollDelegate","$ionicLoading","$timeout","$window","$ionicModal","$ionicHistory","$ionicPopup","$q"],e}),define("controllers/channels/ChannelSubscribersCtrl",[],function(){"use strict";function e(e,t,n){e.next="",e.subscribers=[],e.guid=t.guid,e.inprogress=!1,e.loadMore=function(){return e.inprogress?!1:(e.inprogress=!0,void n.get("api/v1/subscribe/subscribers/"+t.guid,{limit:6,offset:e.next},function(n){return console.log(n),console.log("api/v1/subscribe/subscribers/"+t.guid),n.users&&n["load-next"]?(console.log("found users feed, loading it"),e.hasMoreData=!0,e.subscribers=e.subscribers.concat(n.users),e.next=n["load-next"],e.$broadcast("scroll.infiniteScrollComplete"),e.$broadcast("scroll.refreshComplete"),void(e.inprogress=!1)):(e.$broadcast("scroll.refreshComplete"),e.hasMoreData=!1,!1)},function(){e.inprogress=!1}))},e.loadMore()}return e.$inject=["$scope","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate"],e}),define("controllers/channels/ChannelSubscriptionsCtrl",[],function(){"use strict";function e(e,t,n){e.next="",e.subscriptions=[],e.guid=t.guid,e.inprogress=!1,e.loadMore=function(){return e.inprogress?!1:(e.inprogress=!0,console.log(e.next),console.log(t.guid),void n.get("api/v1/subscribe/subscriptions/"+t.guid,{limit:6,offset:e.next},function(t){return t.users.length&&t["load-next"]?(console.log("found users feed, loading it"),e.hasMoreData=!0,e.subscriptions=e.subscriptions.concat(t.users),e.next=t["load-next"],e.$broadcast("scroll.infiniteScrollComplete"),e.$broadcast("scroll.refreshComplete"),void(e.inprogress=!1)):(e.$broadcast("scroll.refreshComplete"),e.hasMoreData=!1,!1)},function(){e.inprogress=!1}))},e.loadMore()}return e.$inject=["$scope","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate"],e}),define("controllers/capture/CaptureCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u){e.captured=!1,e.progress=0,e.form={album_title:"Mobile",license:"attribution-cc"},e.type,e.video=function(){e.type="video",navigator.device.capture.captureVideo(function(t){e.captured=!0,e.$apply();var n,i,o;for(n=0,o=t.length;o>n;n+=1){var r=t[n];i=r.fullPath,e.upload(i,"video")}},function(){console.log("capture failed")},{limit:1,duration:360,saveToPhotoAlbum:!0})},e.photo=function(){e.type="image",navigator.device.capture.captureImage(function(t){e.captured=!0,e.$apply();var n,i,o;for(n=0,o=t.length;o>n;n+=1)i=t[n].fullPath,e.upload(i,"image")},function(){console.log("capture failed")},{limit:1,correctOrientation:!0,encodingType:0,destinationType:Camera.DestinationType.FILE_URI,allowEdit:!0,saveToPhotoAlbum:!0})},e.library=function(){navigator.camera.getPicture(function(t){e.captured=!0,e.$apply();for(var n=!1,i=["images","document/image",".jpg",".JPG",".jpeg",".JPEG",".png",".PNG",".bmp",".BMP",".gif",".GIF"],o=0;o-1){e.upload(t,"image"),e.type="image",n=!0;break}n||(e.upload(t,"video"),e.type="video")},function(){console.log("capture failed")},{correctOrientation:!0,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,mediaType:2})},e.reset=function(){e.captured=!1,e.guid=!1},e.upload=function(t,n){var o=new FileTransfer,r=new FileUploadOptions;r.httpMethod="image"==n?"PUT":"POST",r.headers={Authorization:"Bearer "+a.get("access_token")},console.log(t),o.upload(t,encodeURI(i.node_url+"api/v1/archive/"+n),function(t){if(t.response){var n=JSON.parse(t.response);e.guid=n.guid,e.$apply()}},function(e){console.log("error"),console.log(e)},r),o.onprogress=function(t){e.progress=Math.floor(t.loaded/t.total*100),e.$apply()}},e.save=function(){s.show({template:"Please wait a moment..."}),o.post("api/v1/archive/"+e.guid,e.form,function(t){n.go("tab.newsfeed",{},{reload:!0}),e.$emit("newsfeed:updated"),e.$emit("newsfeed:boost",t.activity_guid),e.reset(),s.hide()},function(){c.alert({title:"Error",template:"Saving failed."}),e.reset(),s.hide()})},e.postStatus=function(){if(!e.form.status)return c.alert({title:"Ooopss.",template:"You need to enter status before you can post."}),!1;s.show({template:"

Please wait...

"});var t={message:e.form.status,facebook:e.form.facebook,twitter:e.form.twitter};e.form.meta&&(t={message:encodeURIComponent(e.form.status),title:e.form.meta.title,description:encodeURIComponent(e.form.meta.description),thumbnail:encodeURIComponent(e.form.thumbnail),url:e.form.meta.canonical,facebook:e.form.facebook,twitter:e.form.twitter}),o.post("api/v1/newsfeed",t,function(t){s.hide(),e.modal.remove(),e.$emit("newsfeed:boost",t.guid),e.$emit("newsfeed:updated"),n.go("tab.newsfeed",{},{reload:!0})},function(){s.hide()})},window.intents&&"function"==typeof window.intents.onIntent&&intents.onIntent(function(t){"text"==t.type&&(e.activity(),e.form.status=t.data,e.getStatusPreview())}),e.activity=function(){l.fromTemplateUrl("templates/capture/status.html",{scope:e,animation:"slide-in-up"}).then(function(t){e.modal=t,e.modal.show()})},e.$on("modal.removed",function(){e.form={},intents.onIntent(function(){navigator.app.exitApp()})}),e.getStatusPreview=function(){var t=e.form.status,n=t.match(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi);if(n){var i;i=n instanceof Array?n[0]:n,i.length&&(e.form.url=i,i=i.replace("http://",""),i=i.replace("https://",""),u({method:"GET",url:"https://iframely.com/iframely",params:{uri:i},cache:!0}).success(function(t){console.log(t),e.form.meta=t.meta;for(var n=0;n-1&&(console.log(t.links[n]),e.form.thumbnail=t.links[n].href)}).error(function(e){console.log(e)}))}},e.fb=function(){return e.form.facebook?void(e.form.facebook=!1):void facebookConnectPlugin.getLoginStatus(function(t){return"connected"!=t.status?(facebookConnectPlugin.login(["public_profile"],function(){facebookConnectPlugin.login(["publish_actions"],function(){facebookConnectPlugin.getAccessToken(function(t){e.form.facebook=t,e.$apply()},function(e){alert("Could not get access token: "+e)})},function(){})},function(e){alert("error "+e)}),!0):(e.form.facebook=t.authResponse.accessToken,void e.$apply())},function(){e.fb()})},e.twitter=function(){if(e.form.twitter)return void(e.form.twitter=!1);if(!a.get("twitter")){var t=window.open(i.node_url+"plugin/social/authorize/twitter?access_token="+a.get("access_token")+"&client_id="+r.client_id,"_blank","location=yes");t.addEventListener("loadstart",function(n){var r=n.url;if(r.indexOf(i.node_url+"plugin/social/redirect")>-1){t.close();var a=r.split("?");o.get("plugin/social/redirect/twitter?"+a[1],{},function(t){e.form.twitter=t.oauth_token+"&&"+t.oauth_token_secret})}})}}}return e.$inject=["$scope","$stateParams","$state","$rootScope","Client","OAuth","storage","$ionicLoading","$ionicPopup","$ionicModal","$http","$timeout","$sanitize"],e}),define("controllers/notifications/NotificationsCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f){t.next="",t.hasMoreData=!0,t.cachebreaker=Date.now(),t.inprogress=!1,t.notificationItems=[],t.$on("$ionicView.beforeEnter",function(){e.newNotification=!1,t.notificationItems.length>0&&t.refresh()}),f.listen("notification",function(){"tab.notifications"==n.current.name&&(e.newNotification=!1,t.refresh())}),t.loadMore=function(){return console.log("==== loading more notifications ===="),t.inprogress?!1:(t.inprogress=!0,t.hasMoreData?void r.get("api/v1/notifications",{limit:12,offset:t.next,cachebreaker:t.cachebreaker},function(e){return t.inprogress=!1,e.notifications?(t.hasMoreData=!0,t.notificationItems=t.notificationItems.concat(e.notifications),o.put("notification.items",t.notificationItems),t.next=e["load-next"],o.put("notification.next",t.next),void t.$broadcast("scroll.infiniteScrollComplete")):(t.hasMoreData=!1,t.$broadcast("scroll.infiniteScrollComplete"),!1)},function(){t.inprogress=!1,t.$broadcast("scroll.infiniteScrollComplete")}):void(t.inprogress=!1))},t.refresh=function(){return t.inprogress?!1:(t.inprogress=!0,e.newNotification=!1,void r.get("api/v1/notifications",{limit:12,offset:"",cache_break:Date.now()},function(e){t.notificationItems=e.notifications,o.put("notification.items",t.notificationItems),t.next=e["load-next"],o.put("notification.cachebreaker",Date.now),t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete"),t.inprogress=!1,t.hasMoreData=!0},function(){t.inprogress=!1}))},t.subscribe=function(e){d(function(){for(var n=0;n'}),d(function(){c.hide()},300),e.fromObj.subscriber&&e.fromObj.subscribed&&u.alert({title:"Match!",subTitle:e.fromObj.name+" subscribed to you too!",buttons:[{text:"Send Message",type:"button-positive",onTap:function(){window.location.href="#/tab/gatherings/conversations/"+e.fromObj.guid+"/"+e.fromObj.name}},{text:"Continue..."}]})},t.goToChannel=function(e){n.go("tab.newsfeed-channel",{username:e})},t.loadBoostReview=function(e){t.guid=e,l.fromTemplateUrl("templates/wallet/review_boost.html",{scope:t,animation:"slide-in-up"}).then(function(n){t.modal=n,t.guid=e,t.modal.show()})}}return e.$inject=["$rootScope","$scope","$state","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicModal","$ionicPopup","$timeout","push"],e}),define("controllers/notifications/NotificationsEntityCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l){console.log("guid is... "+n.guid),cordova.plugins.Keyboard.disableScroll(!0),t.guid="",t.cb=Date.now(),t.offset="",t.hasMore=!1,t.comments=[],t.comment={},t.comment.body="",t.init=function(){r.get("api/v1/entities/entity/"+n.guid,{cb:t.cb},function(e){t.entity=e.entity,t.activity=e.entity,t.guid=t.entity.guid,t.entity.entity_guid&&(t.guid=t.entity.entity_guid),t.hasMore=!0,t.offset="",t.cb=Date.now(),t.comments=[],t.getComments()},function(e){console.log(e)})},t.init(),t.inprogress=!1,t.getComments=function(){return t.inprogress?!1:(t.inprogress=!0,void r.get("api/v1/comments/"+t.guid,{cb:t.cb,limit:12,offset:t.offset},function(e){return t.inprogress=!1,e.comments&&0!==e.comments.length?(t.comments=t.comments.concat(e.comments),t.offset=e["load-next"],null==t.offset&&(t.hasMore=!1),void t.$broadcast("scroll.infiniteScrollComplete")):(t.hasMore=!1,!1)},function(){t.inprogress=!1}))},t.submit=function(){t.comment.body&&(r.post("api/v1/comments/"+t.guid,{comment:encodeURIComponent(t.comment.body)},function(e){t.comments.push(e.comment),t.offset=e.guid},function(){}),t.comment.body="")},t.removeComment=function(n){var i=n.guid;return n.owner_guid!=e.user_guid?!1:void l.show({buttons:[],destructiveText:"Delete",destructiveButtonClicked:function(){return confirm("are you sure?")&&(r["delete"]("api/v1/comments/"+i,function(){}),t.comments.forEach(function(e,t,n){e.guid==i&&(console.log("removed"),n.splice(t,1))})),!0},cancelText:"Cancel",cancel:function(){}})},t.openUrl=function(e){var t;$timeout.cancel(t),t=$timeout(function(){window.open(e,"_blank","location=yes")},300)},t.pass=function(){r.post("api/v1/entities/suggested/pass/"+t.entity.guid,{},function(){},function(){}),t.entity["thumbs:pass:count"]=1},t.down=function(){r.put("api/v1/thumbs/"+t.entity.guid+"/down",{},function(){},function(){});for(var e in t.entity["thumbs:down:user_guids"])if(t.entity["thumbs:down:user_guids"][e]===a.get("user_guid"))return delete t.entity["thumbs:down:user_guids"][e],t.entity["thumbs:down:count"]=t.entity["thumbs:down:count"]-1,!0;t.entity["thumbs:down:count"]=t.entity["thumbs:down:count"]?t.entity["thumbs:down:count"]+1:1,t.entity["thumbs:down:user_guids"][1]=a.get("user_guid")},t.up=function(){r.put("api/v1/thumbs/"+t.entity.guid+"/up",{},function(){},function(){});for(var e in t.entity["thumbs:up:user_guids"])if(t.entity["thumbs:up:user_guids"][e]===a.get("user_guid"))return delete t.entity["thumbs:up:user_guids"][e],t.entity["thumbs:up:count"]=t.entity["thumbs:up:count"]-1,!0;t.entity["thumbs:up:count"]=t.entity["thumbs:up:count"]?t.entity["thumbs:up:count"]+1:1,t.entity["thumbs:up:user_guids"][1]=a.get("user_guid")}}return e.$inject=["$rootScope","$scope","$stateParams","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicActionSheet"],e}),define("controllers/notifications/NotificationsP2PReviewCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u){t.cb=Date.now(),t.init=function(){r.get("api/v1/boost/p2p",{cb:t.cb},function(e){t.review=e.boosts,t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete")},function(){t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete")})},t.init(),t.refresh=function(){t.cb=Date.now(),t.init()},t.$on("modal.removed",function(){t.refresh()}),t.loadBoostReview=function(e){t.guid=e,u.fromTemplateUrl("templates/wallet/review_boost.html",{scope:t,animation:"slide-in-up"}).then(function(n){t.modal=n,t.guid=e,t.modal.show()})}}return e.$inject=["$rootScope","$scope","$stateParams","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicActionSheet","$ionicModal"],e}),define("controllers/discover/DiscoverCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d){var f,p,h,m;e.entities=[],e.next=i.get("entities.next")?i.get("entities.next"):"",e.query={string:""},e.passed=[],e.acted=[],e.offset=0,e.city=d.get("city"),e.nearby=e.city?!0:!1,e.hasNearby=!0,e.location={distance:{name:"25 miles",miles:25}},e.hasMoreData=!0,e.cachebreaker=i.get("entities.cb")?i.get("entities.cb"):Date.now(),e.filter="suggested",e.type="channel",e.view="list",e.infinite=!0,e.setNearby=function(t){e.nearby=t,e.cachebreaker=Date.now(),e.entities=[],e.load()},e.distanceChanged=function(){e.nearby=!0,e.entities=[],e.load()},e.changeFilter=function(t){"suggested"==t?(e.view="swipe",e.infinite=!1,e.cachebreaker=Date.now()):e.view="list",e.query.string="",e.filter=t,e.entities=[],e.passed=[],e.next="",r.scrollTop(),e.load()},e.changeType=function(t){return"search"==e.filter?(e.type=t,e.search(),!0):(e.query.string="",e.type=t,e.entities=[],e.next="",r.scrollTop(),void e.load())},e.load=function(){return console.log("load triggered"),l.cancel(p),h&&h.cancel(),m&&m.cancel(),"search"==e.filter?void e.search():void(p=l(function(){var t,i;"channel"!=e.type?(t=e.type,i="object"):(t="",i="user"),console.log("loading entities..."),h=n.get("api/v1/entities/"+e.filter+"/"+i+"/"+t,{limit:16,offset:e.next,cachebreaker:e.cachebreaker,skip:e.offset,coordinates:d.get("coordinates")?d.get("coordinates"):!1,nearby:e.nearby,distance:e.location.distance.miles},function(t){return t.entities&&0!==t.entities.length?(e.hasMoreData=!0,e.entities=0===e.entities.length?t.entities:e.entities.concat(t.entities),e.next=t["load-next"],"suggested"==e.filter?e.cachebreaker=Date.now():"trending"==e.filter&&(e.next=e.entities.length),void e.$broadcast("scroll.infiniteScrollComplete")):(e.nearby&&(e.nearby=!1,e.hasNearby=!1,e.cachebreaker=Date.now(),e.load()),e.hasMoreData=!1,!1)},function(){})},600))},e.load(),e.refresh=function(){e.next="";var t,o;"channel"!=e.type?(t=e.type,o="object"):(t="",o="user"),i.put("entities.cb",Date.now()),n.get("api/v1/entities/"+e.filter,{type:o,subtype:t,limit:24,offset:e.next,cachebreaker:Date.now()},function(t){e.entities=t.entities,i.put("entities.data",e.entities),e.next=t["load-next"],e.$broadcast("scroll.infiniteScrollComplete")},function(){})},e.search=function(){l.cancel(f),l.cancel(p),m&&m.cancel(),h&&h.cancel(),e.next="",e.filter="search";var t,o;"channel"!=e.type?(t=e.type,o="object"):(t="",o="user"),f=l(function(){e.query.string.length>2&&(e.entities=[],m=n.get("search",{type:o,subtype:t,q:e.query.string,limit:24,offset:e.next,cachebreaker:Date.now(),view:"json"},function(n){r.scrollTop(),"user"==o?(e.entities=n[o][0],console.log(e.entities)):e.entities=n[o][t],i.put("entities.data",e.entities),e.next=n["load-next"],e.$broadcast("scroll.infiniteScrollComplete")},function(){}))},600)},e.pop=function(t){e.entities.forEach(function(n,i,o){n.guid==t.guid&&(o.splice(i,1),e.passed.push(t))}),e.entities.length<3&&(console.log("loading new..."),i.put("entities.cb",Date.now()),e.offset=3,e.load())},e.ignore=function(t){e.pop(t),n.post("api/v1/entities/suggested/pass/"+t.guid,{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300)},e.subscribe=function(t){"search"!=e.filter&&e.pop(t),console.log("api/v1/subscribe/"+t.guid),t.subscribed?(n["delete"]("api/v1/subscribe/"+t.guid,{},function(){},function(){}),t.subscribed=!1):(n.post("api/v1/subscribe/"+t.guid,{},function(){},function(){}),t.subscribed=!0),e.entities.forEach(function(e,n,i){e.guid==t.guid&&(i[n].subscribed=t.subscribed?!1:!0)}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),t.subscriber&&t.subscribed&&o.alert({title:"Match!",subTitle:t.name+" subscribed to you too!",buttons:[{text:"Send Message",type:"button-positive",onTap:function(){window.location.href="#/tab/gatherings/conversations/"+t.guid+"/"+t.name}},{text:"Continue..."}]})},e.pass=function(t){e.pop(t),n.post("api/v1/entities/suggested/pass/"+t.guid,{},function(){},function(){}),e.acted(t),a.show({template:'pass'}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.down=function(t){e.pop(t),n.put("api/v1/thumbs/"+t.guid+"/down",{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.up=function(t){e.pop(t),n.put("api/v1/thumbs/"+t.guid+"/up",{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.boost=function(t){s.fromTemplateUrl("templates/wallet/boost.html",{scope:e,animation:"slide-in-up"}).then(function(n){e.modal=n,e.type="suggested",e.entity=t,e.modal.show()})},e.acted=function(e){e.boosted&&n.post("api/v1/entities/suggested/acted/"+e.guid,{},function(){},function(){})},e.openActions=function(e){c.show({buttons:[{text:"Share"},{text:"Report this"}],cancelText:"Cancel",cancel:function(){},buttonClicked:function(t){switch(t){case 0:a.show({template:"

Copied to clipboard

"}),l(function(){a.hide()},1e3);break;case 1:window.location.href="mailto:report@minds.com?subject=Report "+e.guid+"&body=This content violates the terms and conditions"}return!0}})}}return e.$inject=["$scope","$stateParams","Client","Cacher","$ionicPopup","$ionicScrollDelegate","$ionicLoading","$ionicModal","$ionicActionSheet","$timeout","$q","storage"],e}),define("controllers/wallet/WalletCtrl",[],function(){"use strict";function e(e,t,n){n.get("api/v1/wallet/count",{cb:Date.now()},function(t){e.points=t.count,e.satoshi=t.satoshi,e.btc=t.btc,e.usd=t.usd,e.boost_rate=t.boost_rate},function(){}),e.transactions=[],e.hasMoreData=!0,e.next="",e.loadMore=function(){console.log("==== loading more transactions ===="),e.hasMoreData&&n.get("api/v1/wallet/transactions",{limit:12,offset:e.next,cachebreaker:Date.now()},function(t){return t.transactions?(e.hasMoreData=!0,e.transactions=e.transactions.concat(t.transactions),e.next=t["load-next"],void e.$broadcast("scroll.infiniteScrollComplete")):(e.hasMoreData=!1,e.$broadcast("scroll.infiniteScrollComplete"),!1) +},t.nextStep=function(){t.data.step=2},t.purchase=function(){n.go("tab.newsfeed-wallet-deposit"),t.modal.remove()}}return e.$inject=["$rootScope","$scope","$state","$stateParams","$ionicLoading","$ionicPopup","$timeout","Client","$q"],e}),define("controllers/gatherings/ChatCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){t.conversations=[],t.next="",t.hasMoreData=!0,t.cb=Date.now(),t.$on("$ionicView.beforeEnter",function(){return o.get("private-key")?(e.newChat=!1,void t.refresh()):(n.go("tab.chat-setup"),!1)}),r.listen("chat",function(){console.log("new message!"),"tab.chat"==n.current.name&&(t.cb=Date.now(),e.newChat=!1,t.refresh(),c.scrollTop())}),t.inprogress=!1,t.loadMore=function(e){return t.inprogress||!o.get("private-key")?!1:(t.inprogress=!0,void i.get("api/v1/conversations",{limit:12,offset:t.next,cb:t.cb},function(n){return n.conversations?(t.hasMoreData=!0,t.conversations=e?n.conversations:t.conversations.concat(n.conversations),t.next=n["load-next"],t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete"),void(t.inprogress=!1)):(t.hasMoreData=!1,!1)},function(){t.inprogress=!0}))},t.search={},t.doSearch=function(){return t.search.query?(console.log("doing search for "+t.search.query),void i.get("search",{q:t.search.query,type:"user",view:"json"},function(e){t.conversations=e.user[0]})):(t.refresh(),!0)},t.$on("$stateChangeSuccess",function(){console.log("state changed..")}),t.refresh=function(){t.search={},t.inprogress=!1,t.next="",t.previous="",t.cb=Date.now(),t.hasMoreData=!0,t.loadMore(!0)},t.subscribe=function(e){t.conversations[e].subscribed=!0,t.conversations[e].subscriber?window.location.href="#/tab/gatherings/conversations/"+t.conversations[e].guid+"/"+t.conversations[e].name:s.alert({title:"Subscribed",template:"You can chat with "+t.conversations[e].name+" when they subscribe to you too"}),i.post("api/v1/subscribe/"+t.conversations[e].guid,{},function(){},function(){})},t.invite=function(){i.get("api/v1/channel/"+e.user_guid,{},function(t){window.plugins.socialsharing.share("Hey! If you install the Minds app and tag me @"+t.channel.username+" we both get 100 points! \n\n","Join Minds and we both get 100 points to go viral!",null,e.node_url)},function(){})}}return e.$inject=["$rootScope","$scope","$state","Client","storage","push","$ionicModal","$ionicPopup","$ionicScrollDelegate"],e}),define("controllers/gatherings/ChatConversationCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f){function p(){a.scrollBottom()}function h(){i.go("tab.chat")}window.cordova&&(cordova.plugins.Keyboard.disableScroll(!1),cordova.plugins.Keyboard.close()),t.guid=n.username,t.name=n.name,t.messages=[],t.next="",t.previous="",t.hasMoreData=!0,t.publickeys={},t.inProgress=!1;var m=!0;if(t.loadMore=function(){t.inProgress=!0,console.log("loading messages from:"+t.next),o.get("api/v1/conversations/"+n.username,{limit:6,offset:t.next,cachebreak:Date.now()},function(n){if(e.newChat=!1,t.inProgress=!1,t.publickeys=n.publickeys,!t.publickeys[t.guid])return u.alert({title:"Sorry!",template:t.name+" has not yet configured their encrypted chat yet."}),i.go("tab.chat"),!0;if(!n.messages)return t.hasMoreData=!1,!1;t.hasMoreData=!0;var o;o=0===t.messages.length?!0:!1,t.messages=n.messages.concat(t.messages),console.log("------ MESSAGES ARE LOADED ------"),t.next=n["load-previous"],t.previous=n["load-next"],t.$broadcast("scroll.refreshComplete"),o&&s(function(){a.scrollBottom()},1e3),m=!0},function(){t.inProgress=!1})},t.loadMore(),!r.get("push-token")){var g=function(){return m?(console.log("checking for new messages.."),m=!1,void o.get("api/v1/conversations/"+n.username,{limit:1e3,start:t.previous,cachebreak:Date.now()},function(e){e&&e.messages&&(t.messages=t.messages.concat(e.messages),t.previous=e["load-next"],a.scrollBottom()),m=!0,clearTimeout(t.timeout),t.timeout=setTimeout(g,5e3)},function(){m=!0,console.log("polling for new messages failed")})):!1};t.timeout=setTimeout(g,5e3)}var v=l.listen("chat",function(){console.log("think you got a new message"),o.get("api/v1/conversations/"+n.username,{limit:1e3,start:t.previous,cachebreak:Date.now()},function(n){e.newChat=!1,n&&n.messages&&(t.messages=t.messages.concat(n.messages),t.previous=n["load-next"],a.scrollBottom())},function(){})});window.addEventListener("native.keyboardshow",function(){"tab.chat-conversation"==i.current.name&&a.scrollBottom()}),t.send=function(){if(!t.message)return u.alert({title:"Oooops...",template:"You need to enter a message before you can send."}),!1;if(t.message.length>180)return u.alert({title:"Oooops...",template:"Your message is too long. It must be less than 180 characters"}),!1;c.show({template:"Sending..."});var e=f.defer(),i={};for(var r in t.publickeys)!function(n){crypt.setPublicKey(t.publickeys[n]),crypt.encrypt(t.message,function(o){i[n]=encodeURIComponent(o),i.length==t.publickeys.length&&e.resolve(!0)})}(r);var s=!1;e.promise.then(function(){var e={};for(var r in i)e["message:"+r]=i[r];o.post("api/v1/conversations/"+n.username,e,function(e){s||(t.messages.push(e.message),t.previous=e.message.guid,s=!0),t.message="",c.hide(),a.scrollBottom()},function(e){c.hide(),alert("sorry, your message could not be sent"),console.log(e)})})},s(function(){window.addEventListener("native.keyboardhide",p),document.addEventListener("pause",h)},100),t.$on("$destroy",function(){clearTimeout(t.timeout),l.unlisten("chat",v),window.removeEventListener("native.keyboardhide",p),document.removeEventListener("pause",h)})}return e.$inject=["$rootScope","$scope","$stateParams","$state","Client","storage","$ionicScrollDelegate","$timeout","$ionicLoading","push","$ionicPopup","$ionicModal","$q"],e}),define("controllers/gatherings/ChatSetupCtrl",[],function(){"use strict";function e(e,t,n,i,o){e.configured=!1,e.data={},n.get("api/v1/channel/me",{},function(t){t.channel.chat&&(e.configured=!0)}),e.unlock=function(){n.get("api/v1/keys",{password:e.data.password,new_password:"abc123"},function(e){e.key?(o.set("private-key",e.key),t.go("tab.chat")):i.alert({title:"Ooops..",template:"We couldn't unlock your chat. Please check your password is correct."})},function(){})},e.setup=function(){return e.data.password?e.data.password!=e.data.password2?(i.alert({title:"Ooops..",template:"Your passwords must match."}),!1):void n.post("api/v1/keys/setup",{password:e.data.password},function(e){e.key?(o.set("private-key",e.key),t.go("tab.chat")):i.alert({title:"Ooops..",template:"We couldn't unlock your chat. Please check your password is correct."})},function(){}):(i.alert({title:"Ooops..",template:"You must enter a password."}),!1)}}return e.$inject=["$scope","$state","Client","$ionicPopup","storage"],e}),define("controllers/channels/ChannelCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l){if(void 0===i.username)return n.go("tab.newsfeed"),!1;t.loaded=!1,t.next="",t.ChannelItems=[];var u;t.cb=Date.now();var d=e.$on("$stateChangeSuccess",function(e,n,i,o){"tab.newsfeed-channel-edit"==o.name&&(t.cb=Date.now(),t.init()),"tab.newsfeed-channel"==o.name&&u&&s.cancel(u)});t.$on("$destroy",function(){u&&s.cancel(u),d()}),t.init=function(){console.log("init called"),o.get("api/v1/channel/"+i.username,{cb:t.cb},function(i){return"error"==i.status?(n.go("tab.newsfeed"),!0):(t.channel=i.channel,e.guid==t.channel.guid&&(l.set("city",t.channel.city),l.set("coordinates",t.channel.coordinates)),0===t.ChannelItems.length&&c(function(){t.loadMore()}),void(i.channel.carousels&&(r.update(),u=s(function(){r.$getByHandle("channel-banners").slide(0)},3e3*i.channel.carousels.length))))},function(){})},t.init(),t.loadMore=function(){return t.channel?(console.log("getting a users feed"),void o.get("api/v1/newsfeed/personal/"+t.channel.guid,{limit:6,offset:t.next,cb:Date.now()},function(e){return t.loaded=!0,e.activity?(console.log("found users feed, loading it"),t.hasMoreData=!0,t.ChannelItems=t.ChannelItems.concat(e.activity),t.next=e["load-next"],t.$broadcast("scroll.infiniteScrollComplete"),void t.$broadcast("scroll.refreshComplete")):(console.log("users feed not found"),t.$broadcast("scroll.refreshComplete"),t.hasMoreData=!1,!1)},function(){t.$broadcast("scroll.infiniteScrollComplete"),t.$broadcast("scroll.refreshComplete")})):!1},t.channelRefresh=function(){return t.channel?(t.next="",void t.loadMore()):!1},t.subscribe=function(e){t.channel.subscribed=!0,t.channel.subscribers_count=t.channel.subscribers_count+1,o.post("api/v1/subscribe/"+e.guid,{},function(){},function(){t.channel.subscribed=!1,t.channel.subscribers_count=t.channel.subscribers_count-1})},t.unSubscribe=function(e){t.channel.subscribed=!1,t.channel.subscribers_count=t.channel.subscribers_count-1,o["delete"]("api/v1/subscribe/"+e.guid,{},function(){},function(){t.channel.subscribed=!0,t.channel.subscribers_count=t.channel.subscribers_count+1})}}return e.$inject=["$rootScope","$scope","$state","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate","$interval","$timeout","storage"],e}),define("controllers/channels/ChannelEditCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f,p,h){t.cb=Date.now();var m;i.guid||(i.guid=e.user_guid),o.get("api/v1/channel/"+i.guid,{cb:t.cb},function(e){t.channel=e.channel},function(){}),t.update=function(e){return t.channel.name?void o.post("api/v1/channel/info",t.channel,function(){c.show({template:''}),l(function(){c.hide()},1e3),e&&n.go("tab.newsfeed-channel",{username:"me",refresh:!0})},function(){}):(p.alert({title:"Oooops...",template:"Your need a name!"}),!1)},t.cities=[],t.autoSearchLocation=function(){l.cancel(m),m=l(function(){o.get("api/v1/geolocation/list",{q:t.channel.city},function(e){t.cities=e.results,console.log(t.cities)},function(){})},300)},t.selectSuggestedLocation=function(e){t.cities=[],t.channel.coordinates=e.lat+","+e.lon,e.address.city&&(t.channel.city=e.address.city),e.address.town&&(t.channel.city=e.address.town),r.set("city",t.channel.city),r.set("coordinates",t.channel.coordinates)},t.changeAvatar=function(){function n(n){var i=document.getElementById("avatar");i.src=n,c.show({template:"Uploading..."});var o=new FileTransfer,a=new FileUploadOptions;a.headers={Authorization:"Bearer "+r.get("access_token")},console.log(n),o.upload(n,encodeURI(e.node_url+"api/v1/channel/avatar"),function(){c.hide(),e.globalCB=Date.now(),e.$apply(),t.channel.cb=Date.now()},function(e){c.hide(),console.log("error"),console.log(e)},a)}function i(){}navigator.camera.getPicture(n,i,{quality:50,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,correctOrientation:!0})},t.addBanner=function(){t.channel.carousels?p.alert({title:"Warning!",subTitle:"Adding a new banner will replace all existing banners on your channel.",buttons:[{text:"Close"},{text:"Replace",type:"button-positive",onTap:function(){t.selectBanner()}}]}):t.selectBanner()},t.selectBanner=function(){function t(t){var n=new FileTransfer,i=new FileUploadOptions;i.headers={Authorization:"Bearer "+r.get("access_token")},console.log(t),n.upload(t,encodeURI(e.node_url+"api/v1/channel/banner"),function(){e.globalCB=Date.now()},function(e){console.log("error"),console.log(e)},i)}function n(){}navigator.camera.getPicture(t,n,{quality:50,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,correctOrientation:!0})},t.changeGender=function(e){t.channel.gender=e,t.$apply()},t.invite=function(){window.plugins.socialsharing.share("Hey! If you install the Minds app and tag me @"+t.channel.username+" we both get 100 points! \n\n","Join Minds and we both get 100 points to go viral!",null,e.node_url)},t.disable=function(){var e=h.defer();return p.alert({title:"Are you sure?",buttons:[{text:"No!"},{text:"Yes",type:"button-positive",onTap:function(){c.show({template:""}),o["delete"]("api/v1/channel",{},function(){c.hide(),t.logout()},function(){alert("sorry, we could not delete")}),e.resolve(!0)}}]}),e.promise},t.logout=function(){o.post("api/v1/logout",{},function(){},function(){}),r.remove("loggedin"),r.remove("user_guid"),r.remove("access_token"),r.remove("private-key"),r.remove("push-token"),ionic.Platform.exitApp(),f.clearCache(),n.go("login")}}return e.$inject=["$rootScope","$scope","$state","$stateParams","Client","storage","$ionicSlideBoxDelegate","$ionicScrollDelegate","$ionicLoading","$timeout","$window","$ionicModal","$ionicHistory","$ionicPopup","$q"],e}),define("controllers/channels/ChannelSubscribersCtrl",[],function(){"use strict";function e(e,t,n){e.next="",e.subscribers=[],e.guid=t.guid,e.inprogress=!1,e.loadMore=function(){return e.inprogress?!1:(e.inprogress=!0,void n.get("api/v1/subscribe/subscribers/"+t.guid,{limit:6,offset:e.next},function(n){return console.log(n),console.log("api/v1/subscribe/subscribers/"+t.guid),n.users&&n["load-next"]?(console.log("found users feed, loading it"),e.hasMoreData=!0,e.subscribers=e.subscribers.concat(n.users),e.next=n["load-next"],e.$broadcast("scroll.infiniteScrollComplete"),e.$broadcast("scroll.refreshComplete"),void(e.inprogress=!1)):(e.$broadcast("scroll.refreshComplete"),e.hasMoreData=!1,!1)},function(){e.inprogress=!1}))},e.loadMore()}return e.$inject=["$scope","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate"],e}),define("controllers/channels/ChannelSubscriptionsCtrl",[],function(){"use strict";function e(e,t,n){e.next="",e.subscriptions=[],e.guid=t.guid,e.inprogress=!1,e.loadMore=function(){return e.inprogress?!1:(e.inprogress=!0,console.log(e.next),console.log(t.guid),void n.get("api/v1/subscribe/subscriptions/"+t.guid,{limit:6,offset:e.next},function(t){return t.users.length&&t["load-next"]?(console.log("found users feed, loading it"),e.hasMoreData=!0,e.subscriptions=e.subscriptions.concat(t.users),e.next=t["load-next"],e.$broadcast("scroll.infiniteScrollComplete"),e.$broadcast("scroll.refreshComplete"),void(e.inprogress=!1)):(e.$broadcast("scroll.refreshComplete"),e.hasMoreData=!1,!1)},function(){e.inprogress=!1}))},e.loadMore()}return e.$inject=["$scope","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate"],e}),define("controllers/capture/CaptureCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u){e.captured=!1,e.progress=0,e.form={album_title:"Mobile",license:"attribution-cc"},e.type,e.video=function(){e.type="video",navigator.device.capture.captureVideo(function(t){e.captured=!0,e.$apply();var n,i,o;for(n=0,o=t.length;o>n;n+=1){var r=t[n];i=r.fullPath,e.upload(i,"video")}},function(){console.log("capture failed")},{limit:1,duration:360,saveToPhotoAlbum:!0})},e.photo=function(){e.type="image",navigator.device.capture.captureImage(function(t){e.captured=!0,e.$apply();var n,i,o;for(n=0,o=t.length;o>n;n+=1)i=t[n].fullPath,e.upload(i,"image")},function(){console.log("capture failed")},{limit:1,correctOrientation:!0,encodingType:0,destinationType:Camera.DestinationType.FILE_URI,allowEdit:!0,saveToPhotoAlbum:!0})},e.library=function(){navigator.camera.getPicture(function(t){e.captured=!0,e.$apply();for(var n=!1,i=["images","document/image",".jpg",".JPG",".jpeg",".JPEG",".png",".PNG",".bmp",".BMP",".gif",".GIF"],o=0;o-1){e.upload(t,"image"),e.type="image",n=!0;break}n||(e.upload(t,"video"),e.type="video")},function(){console.log("capture failed")},{correctOrientation:!0,destinationType:Camera.DestinationType.FILE_URI,sourceType:0,mediaType:2})},e.reset=function(){e.captured=!1,e.guid=!1},e.upload=function(t,n){var o=new FileTransfer,r=new FileUploadOptions;r.httpMethod="image"==n?"PUT":"POST",r.headers={Authorization:"Bearer "+a.get("access_token")},console.log(t),o.upload(t,encodeURI(i.node_url+"api/v1/archive/"+n),function(t){if(t.response){var n=JSON.parse(t.response);e.guid=n.guid,e.$apply()}},function(e){console.log("error"),console.log(e)},r),o.onprogress=function(t){e.progress=Math.floor(t.loaded/t.total*100),e.$apply()}},e.save=function(){s.show({template:"Please wait a moment..."}),o.post("api/v1/archive/"+e.guid,e.form,function(t){n.go("tab.newsfeed",{},{reload:!0}),e.$emit("newsfeed:updated"),e.$emit("newsfeed:boost",t.activity_guid),e.reset(),s.hide()},function(){c.alert({title:"Error",template:"Saving failed."}),e.reset(),s.hide()})},e.postStatus=function(){if(!e.form.status)return c.alert({title:"Ooopss.",template:"You need to enter status before you can post."}),!1;s.show({template:"

Please wait...

"});var t={message:e.form.status,facebook:e.form.facebook,twitter:e.form.twitter};e.form.meta&&(t={message:encodeURIComponent(e.form.status),title:encodeURIComponent(e.form.meta.title),description:encodeURIComponent(e.form.meta.description),thumbnail:encodeURIComponent(e.form.thumbnail),url:encodeURIComponent(e.form.meta.canonical),facebook:e.form.facebook,twitter:e.form.twitter}),o.post("api/v1/newsfeed",t,function(t){s.hide(),e.modal.remove(),e.$emit("newsfeed:boost",t.guid),e.$emit("newsfeed:updated"),n.go("tab.newsfeed",{},{reload:!0})},function(){s.hide()})},window.intents&&"function"==typeof window.intents.onIntent&&intents.onIntent(function(t){"text"==t.type&&(e.activity(),e.form.status=t.data,e.getStatusPreview())}),e.activity=function(){l.fromTemplateUrl("templates/capture/status.html",{scope:e,animation:"slide-in-up"}).then(function(t){e.modal=t,e.modal.show()})},e.$on("modal.removed",function(){e.form={},intents.onIntent(function(){navigator.app.exitApp()})}),e.getStatusPreview=function(){var t=e.form.status,n=t.match(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi);if(n){var i;i=n instanceof Array?n[0]:n,i.length&&(e.form.url=i,i=i.replace("http://",""),i=i.replace("https://",""),u({method:"GET",url:"https://iframely.com/iframely",params:{uri:i},cache:!0}).success(function(t){console.log(t),e.form.meta=t.meta;for(var n=0;n-1&&(console.log(t.links[n]),e.form.thumbnail=t.links[n].href)}).error(function(e){console.log(e)}))}},e.fb=function(){return e.form.facebook?void(e.form.facebook=!1):void facebookConnectPlugin.getLoginStatus(function(t){return"connected"!=t.status?(facebookConnectPlugin.login(["public_profile"],function(){facebookConnectPlugin.login(["publish_actions"],function(){facebookConnectPlugin.getAccessToken(function(t){e.form.facebook=t,e.$apply()},function(e){alert("Could not get access token: "+e)})},function(){})},function(e){alert("error "+e)}),!0):(e.form.facebook=t.authResponse.accessToken,void e.$apply())},function(){e.fb()})},e.twitter=function(){if(e.form.twitter)return void(e.form.twitter=!1);if(!a.get("twitter")){var t=window.open(i.node_url+"plugin/social/authorize/twitter?access_token="+a.get("access_token")+"&client_id="+r.client_id,"_blank","location=yes");t.addEventListener("loadstart",function(n){var r=n.url;if(r.indexOf(i.node_url+"plugin/social/redirect")>-1){t.close();var a=r.split("?");o.get("plugin/social/redirect/twitter?"+a[1],{},function(t){e.form.twitter=t.oauth_token+"&&"+t.oauth_token_secret})}})}}}return e.$inject=["$scope","$stateParams","$state","$rootScope","Client","OAuth","storage","$ionicLoading","$ionicPopup","$ionicModal","$http","$timeout","$sanitize"],e}),define("controllers/notifications/NotificationsCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d,f){t.next="",t.hasMoreData=!0,t.cachebreaker=Date.now(),t.inprogress=!1,t.notificationItems=[];var p=e.$on("$stateChangeStart",function(e,n,o,r){n.name==r.name&&(i.scrollTop(),t.refresh())});f.listen("notification",function(){"tab.notifications"==n.current.name&&(e.newNotification=!1,t.refresh())}),t.loadMore=function(){return console.log("==== loading more notifications ===="),t.inprogress?!1:(t.inprogress=!0,t.hasMoreData?void r.get("api/v1/notifications",{limit:12,offset:t.next,cachebreaker:t.cachebreaker},function(e){return t.inprogress=!1,e.notifications?(t.hasMoreData=!0,t.notificationItems=t.notificationItems.concat(e.notifications),o.put("notification.items",t.notificationItems),t.next=e["load-next"],o.put("notification.next",t.next),void t.$broadcast("scroll.infiniteScrollComplete")):(t.hasMoreData=!1,t.$broadcast("scroll.infiniteScrollComplete"),!1)},function(){t.inprogress=!1,t.$broadcast("scroll.infiniteScrollComplete")}):void(t.inprogress=!1))},t.refresh=function(){return t.inprogress?!1:(t.inprogress=!0,e.newNotification=!1,void r.get("api/v1/notifications",{limit:12,offset:"",cache_break:Date.now()},function(e){t.notificationItems=e.notifications,o.put("notification.items",t.notificationItems),t.next=e["load-next"],o.put("notification.cachebreaker",Date.now),t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete"),t.inprogress=!1,t.hasMoreData=!0},function(){t.inprogress=!1}))},t.subscribe=function(e){d(function(){for(var n=0;n'}),d(function(){c.hide()},300),e.fromObj.subscriber&&e.fromObj.subscribed&&u.alert({title:"Match!",subTitle:e.fromObj.name+" subscribed to you too!",buttons:[{text:"Send Message",type:"button-positive",onTap:function(){window.location.href="#/tab/gatherings/conversations/"+e.fromObj.guid+"/"+e.fromObj.name}},{text:"Continue..."}]})},t.goToChannel=function(e){n.go("tab.newsfeed-channel",{username:e})},t.loadBoostReview=function(e){t.guid=e,l.fromTemplateUrl("templates/wallet/review_boost.html",{scope:t,animation:"slide-in-up"}).then(function(n){t.modal=n,t.guid=e,t.modal.show()})},t.$on("$destroy",function(){p()})}return e.$inject=["$rootScope","$scope","$state","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicModal","$ionicPopup","$timeout","push"],e}),define("controllers/notifications/NotificationsEntityCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l){console.log("guid is... "+n.guid),cordova.plugins.Keyboard.disableScroll(!0),t.guid="",t.cb=Date.now(),t.offset="",t.hasMore=!1,t.comments=[],t.comment={},t.comment.body="",t.init=function(){r.get("api/v1/entities/entity/"+n.guid,{cb:t.cb},function(e){t.entity=e.entity,t.activity=e.entity,t.guid=t.entity.guid,t.entity.entity_guid&&(t.guid=t.entity.entity_guid),t.hasMore=!0,t.offset="",t.cb=Date.now(),t.comments=[],t.getComments()},function(e){console.log(e)})},t.init(),t.inprogress=!1,t.getComments=function(){return t.inprogress?!1:(t.inprogress=!0,void r.get("api/v1/comments/"+t.guid,{cb:t.cb,limit:12,offset:t.offset},function(e){return t.inprogress=!1,e.comments&&0!==e.comments.length?(t.comments=t.comments.concat(e.comments),t.offset=e["load-next"],null==t.offset&&(t.hasMore=!1),void t.$broadcast("scroll.infiniteScrollComplete")):(t.hasMore=!1,!1)},function(){t.inprogress=!1}))},t.submit=function(){t.comment.body&&(r.post("api/v1/comments/"+t.guid,{comment:encodeURIComponent(t.comment.body)},function(e){t.comments.push(e.comment),t.offset=e.guid},function(){}),t.comment.body="")},t.removeComment=function(n){var i=n.guid;return n.owner_guid!=e.user_guid?!1:void l.show({buttons:[],destructiveText:"Delete",destructiveButtonClicked:function(){return confirm("are you sure?")&&(r["delete"]("api/v1/comments/"+i,function(){}),t.comments.forEach(function(e,t,n){e.guid==i&&(console.log("removed"),n.splice(t,1))})),!0},cancelText:"Cancel",cancel:function(){}})},t.openUrl=function(e){var t;$timeout.cancel(t),t=$timeout(function(){window.open(e,"_blank","location=yes")},300)},t.pass=function(){r.post("api/v1/entities/suggested/pass/"+t.entity.guid,{},function(){},function(){}),t.entity["thumbs:pass:count"]=1},t.down=function(){r.put("api/v1/thumbs/"+t.entity.guid+"/down",{},function(){},function(){});for(var e in t.entity["thumbs:down:user_guids"])if(t.entity["thumbs:down:user_guids"][e]===a.get("user_guid"))return delete t.entity["thumbs:down:user_guids"][e],t.entity["thumbs:down:count"]=t.entity["thumbs:down:count"]-1,!0;t.entity["thumbs:down:count"]=t.entity["thumbs:down:count"]?t.entity["thumbs:down:count"]+1:1,t.entity["thumbs:down:user_guids"][1]=a.get("user_guid")},t.up=function(){r.put("api/v1/thumbs/"+t.entity.guid+"/up",{},function(){},function(){});for(var e in t.entity["thumbs:up:user_guids"])if(t.entity["thumbs:up:user_guids"][e]===a.get("user_guid"))return delete t.entity["thumbs:up:user_guids"][e],t.entity["thumbs:up:count"]=t.entity["thumbs:up:count"]-1,!0;t.entity["thumbs:up:count"]=t.entity["thumbs:up:count"]?t.entity["thumbs:up:count"]+1:1,t.entity["thumbs:up:user_guids"][1]=a.get("user_guid")}}return e.$inject=["$rootScope","$scope","$stateParams","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicActionSheet"],e}),define("controllers/notifications/NotificationsP2PReviewCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u){t.cb=Date.now(),t.init=function(){r.get("api/v1/boost/p2p",{cb:t.cb},function(e){t.review=e.boosts,t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete")},function(){t.$broadcast("scroll.refreshComplete"),t.$broadcast("scroll.infiniteScrollComplete")})},t.init(),t.refresh=function(){t.cb=Date.now(),t.init()},t.$on("modal.removed",function(){t.refresh()}),t.loadBoostReview=function(e){t.guid=e,u.fromTemplateUrl("templates/wallet/review_boost.html",{scope:t,animation:"slide-in-up"}).then(function(n){t.modal=n,t.guid=e,t.modal.show()})}}return e.$inject=["$rootScope","$scope","$stateParams","$ionicScrollDelegate","Cacher","Client","storage","$ionicPopover","$ionicLoading","$ionicActionSheet","$ionicModal"],e}),define("controllers/discover/DiscoverCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c,l,u,d){var f,p,h,m;e.entities=[],e.next=i.get("entities.next")?i.get("entities.next"):"",e.query={string:""},e.passed=[],e.acted=[],e.offset=0,e.city=d.get("city"),e.nearby=e.city?!0:!1,e.hasNearby=!0,e.location={distance:{name:"25 miles",miles:25}},e.hasMoreData=!0,e.cachebreaker=i.get("entities.cb")?i.get("entities.cb"):Date.now(),e.filter="suggested",e.type="channel",e.view="list",e.infinite=!0,e.setNearby=function(t){e.nearby=t,e.cachebreaker=Date.now(),e.entities=[],e.load()},e.distanceChanged=function(){e.nearby=!0,e.entities=[],e.load()},e.changeFilter=function(t){"suggested"==t?(e.view="swipe",e.infinite=!1,e.cachebreaker=Date.now()):e.view="list",e.query.string="",e.filter=t,e.entities=[],e.passed=[],e.next="",r.scrollTop(),e.load()},e.changeType=function(t){return"search"==e.filter?(e.type=t,e.search(),!0):(e.query.string="",e.type=t,e.entities=[],e.next="",r.scrollTop(),void e.load())},e.load=function(){return console.log("load triggered"),l.cancel(p),h&&h.cancel(),m&&m.cancel(),"search"==e.filter?void e.search():void(p=l(function(){var t,i;"channel"!=e.type?(t=e.type,i="object"):(t="",i="user"),console.log("loading entities..."),h=n.get("api/v1/entities/"+e.filter+"/"+i+"/"+t,{limit:16,offset:e.next,cachebreaker:e.cachebreaker,skip:e.offset,coordinates:d.get("coordinates")?d.get("coordinates"):!1,nearby:e.nearby,distance:e.location.distance.miles},function(t){return t.entities&&0!==t.entities.length?(e.hasMoreData=!0,e.entities=0===e.entities.length?t.entities:e.entities.concat(t.entities),e.next=t["load-next"],"suggested"==e.filter?e.cachebreaker=Date.now():"trending"==e.filter&&(e.next=e.entities.length),void e.$broadcast("scroll.infiniteScrollComplete")):(e.nearby&&(e.nearby=!1,e.hasNearby=!1,e.cachebreaker=Date.now(),e.load()),e.hasMoreData=!1,!1)},function(){})},600))},e.load(),e.refresh=function(){e.next="";var t,o;"channel"!=e.type?(t=e.type,o="object"):(t="",o="user"),i.put("entities.cb",Date.now()),n.get("api/v1/entities/"+e.filter,{type:o,subtype:t,limit:24,offset:e.next,cachebreaker:Date.now()},function(t){e.entities=t.entities,i.put("entities.data",e.entities),e.next=t["load-next"],e.$broadcast("scroll.infiniteScrollComplete")},function(){})},e.search=function(){l.cancel(f),l.cancel(p),m&&m.cancel(),h&&h.cancel(),e.next="",e.filter="search";var t,o;"channel"!=e.type?(t=e.type,o="object"):(t="",o="user"),f=l(function(){e.query.string.length>2&&(e.entities=[],m=n.get("search",{type:o,subtype:t,q:e.query.string,limit:24,offset:e.next,cachebreaker:Date.now(),view:"json"},function(n){r.scrollTop(),"user"==o?(e.entities=n[o][0],console.log(e.entities)):e.entities=n[o][t],i.put("entities.data",e.entities),e.next=n["load-next"],e.$broadcast("scroll.infiniteScrollComplete")},function(){}))},600)},e.pop=function(t){e.entities.forEach(function(n,i,o){n.guid==t.guid&&(o.splice(i,1),e.passed.push(t))}),e.entities.length<3&&(console.log("loading new..."),i.put("entities.cb",Date.now()),e.offset=3,e.load())},e.ignore=function(t){e.pop(t),n.post("api/v1/entities/suggested/pass/"+t.guid,{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300)},e.subscribe=function(t){"search"!=e.filter&&e.pop(t),console.log("api/v1/subscribe/"+t.guid),t.subscribed?(n["delete"]("api/v1/subscribe/"+t.guid,{},function(){},function(){}),t.subscribed=!1):(n.post("api/v1/subscribe/"+t.guid,{},function(){},function(){}),t.subscribed=!0),e.entities.forEach(function(e,n,i){e.guid==t.guid&&(i[n].subscribed=t.subscribed?!1:!0)}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),t.subscriber&&t.subscribed&&o.alert({title:"Match!",subTitle:t.name+" subscribed to you too!",buttons:[{text:"Send Message",type:"button-positive",onTap:function(){window.location.href="#/tab/gatherings/conversations/"+t.guid+"/"+t.name}},{text:"Continue..."}]})},e.pass=function(t){e.pop(t),n.post("api/v1/entities/suggested/pass/"+t.guid,{},function(){},function(){}),e.acted(t),a.show({template:'pass'}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.down=function(t){e.pop(t),n.put("api/v1/thumbs/"+t.guid+"/down",{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.up=function(t){e.pop(t),n.put("api/v1/thumbs/"+t.guid+"/up",{},function(){},function(){}),e.acted(t),a.show({template:''}),l(function(){a.hide()},300),e.cachebreaker=Date.now()},e.boost=function(t){s.fromTemplateUrl("templates/wallet/boost.html",{scope:e,animation:"slide-in-up"}).then(function(n){e.modal=n,e.type="suggested",e.entity=t,e.modal.show()})},e.acted=function(e){e.boosted&&n.post("api/v1/entities/suggested/acted/"+e.guid,{},function(){},function(){})},e.openActions=function(e){c.show({buttons:[{text:"Share"},{text:"Report this"}],cancelText:"Cancel",cancel:function(){},buttonClicked:function(t){switch(t){case 0:a.show({template:"

Copied to clipboard

"}),l(function(){a.hide()},1e3);break;case 1:window.location.href="mailto:report@minds.com?subject=Report "+e.guid+"&body=This content violates the terms and conditions"}return!0}})}}return e.$inject=["$scope","$stateParams","Client","Cacher","$ionicPopup","$ionicScrollDelegate","$ionicLoading","$ionicModal","$ionicActionSheet","$timeout","$q","storage"],e}),define("controllers/wallet/WalletCtrl",[],function(){"use strict";function e(e,t,n){n.get("api/v1/wallet/count",{cb:Date.now()},function(t){e.points=t.count,e.satoshi=t.satoshi,e.btc=t.btc,e.usd=t.usd,e.boost_rate=t.boost_rate},function(){}),e.transactions=[],e.hasMoreData=!0,e.next="",e.loadMore=function(){console.log("==== loading more transactions ===="),e.hasMoreData&&n.get("api/v1/wallet/transactions",{limit:12,offset:e.next,cachebreaker:Date.now()},function(t){return t.transactions?(e.hasMoreData=!0,e.transactions=e.transactions.concat(t.transactions),e.next=t["load-next"],void e.$broadcast("scroll.infiniteScrollComplete")):(e.hasMoreData=!1,e.$broadcast("scroll.infiniteScrollComplete"),!1) },function(){})}}return e.$inject=["$scope","$stateParams","Client","$ionicSlideBoxDelegate","$ionicScrollDelegate"],e}),define("controllers/wallet/WalletDepositCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a){e.step="quote",e.data={points:1e3,usd:"---"},e.card={},i.post("api/v1/wallet/quote",{points:e.points},function(t){e.usd=t.usd},function(){}),e.$watch("data.points",function(){e.data.usd="...",a(function(){i.post("api/v1/wallet/quote",{points:e.data.points},function(t){e.data.usd=t.usd},function(){})},500)},!0),e.changeStep=function(t){e.step=t},e.process=function(){e.card.points=e.data.points,console.log(e.card),i.post("api/v1/wallet/charge",e.card,function(t){return t.id?(e.step="complete",!0):void alert("Sorry, we had trouble processing your card. Please check your details and try again.")},function(){})},e.proccessPaypal=function(){var n={PayPalEnvironmentProduction:"ATAByBA7wVln5oky2XKkglEoH7k0DJmZVOz3S-DGJYkrNrHcIjZCdX1HHLwH",PayPalEnvironmentSandbox:"AaUOIRC8rTb2jXZtnUvjMXWH1BH-5spBnL2kILF2AEPygMxvWOqME3e06hnj"};PayPalMobile.init(n,function(){var n={defaultUserEmail:null,defaultUserPhoneCountryCode:null,defaultUserPhoneNumber:null,merchantName:"Minds",merchantPrivacyPolicyURL:null,merchantUserAgreementURL:null,acceptCreditCards:!0,payPalShippingAddressOption:0,rememberUser:!0,languageOrLocale:null,disableBlurWhenBackgrounding:!1,presentingInPopover:!1,forceDefaultsInSandbox:!1,sandboxUserPassword:null,sandboxUserPin:null},r={subtotal:String(e.data.usd),shipping:"0.00",tax:"0.00",amount:String(e.data.usd),currency:"USD",shortDescription:"Points purchase",intent:"Auth"};PayPalMobile.prepareToRender("PayPalEnvironmentProduction",n,function(){PayPalMobile.renderSinglePaymentUI(r,function(n){o.show({template:"

Applying points...

"}),console.log("SUCCESS!!"),console.log(n),i.post("api/v1/wallet/paypal/confirm",{id:n.response.authorization_id,points:e.data.points},function(e){console.log(e),o.hide(),"success"==e.status&&t.go("tab.newsfeed-wallet")},function(){o.hide()})},function(){console.log("canceled paypal")})})})}}return e.$inject=["$scope","$state","$stateParams","Client","$ionicLoading","$ionicScrollDelegate","$timeout"],e}),define("controllers/wallet/BoostCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s,c){t.data={points:null,impressions:0,rate:1},t.$watch("data.points",function(){t.data.impressions=t.data.points*t.data.rate},!0),s.get("api/v1/boost/rates",{cb:Date.now(),referrer:"discovery"},function(e){t.data.rate=e.rate}),t.boost=function(){if(t.data.points%1!==0)return t.data.points=Math.round(t.data.points),o.show({template:"Sorry, you must enter a whole point."}),a(function(){o.hide()},800),!1;if(0===t.data.points)return t.data.points=1,o.show({template:"Sorry, you must enter a whole point."}),a(function(){o.hide()},800),!1;if(0===t.data.impressions||0===Math.round(t.data.impressions))return o.show({template:"Sorry, you must have at least 1 impression."}),a(function(){o.hide()},800),!1;o.show({template:"Please wait a moment."});var e=c.defer();return s.get("api/v1/wallet/count",{cb:Date.now(),referrer:"discovery"},function(i){return o.hide(),i.countBuy points",type:"button-positive",onTap:function(){n.go("tab.newsfeed-wallet-deposit"),t.modal.remove()}},{text:"Close."}]}),e.resolve(!1)):t.data.points>i.cap?(r.alert({title:"Ooops!",subTitle:"Sorry, there is a limit on how many points can be spent. ",buttons:[{text:"Lower rate",type:"button-positive",onTap:function(){t.data.points=i.cap-1}},{text:"Close."}]}),e.resolve(!1)):t.data.pointsIncrease?",type:"button-positive",onTap:function(){t.data.points=i.min}},{text:"Close."}]}),e.resolve(!1)):void(i.count>=t.data.points&&(o.show({template:"Requesting Boost..."}),s.post("api/v1/boost/"+t.type+"/"+t.entity.guid+"/"+t.entity.owner_guid,{impressions:t.data.impressions},function(n){return o.hide(),"success"==n.status?(t.modal.remove(),o.show({template:"Boost request submitted."}),a(function(){o.hide()},500),e.resolve(!0)):(o.hide(),o.show({template:"Sorry, something went wrong."}),a(function(){o.hide()},500),e.resolve(!1))},function(){return o.hide(),o.show({template:"Sorry, something went wrong."}),a(function(){o.hide()},500),e.resolve(!1)})))},function(){return e.resolve(!1)}),e.promise}}return e.$inject=["$rootScope","$scope","$state","$stateParams","$ionicLoading","$ionicPopup","$timeout","Client","$q"],e}),define("controllers/wallet/BoostReviewCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s){o.show(),s.get("api/v1/boost/"+t.guid,{cb:Date.now()},function(e){return"error"==e.status?(o.hide(),void t.modal.remove()):(o.hide(),t.entity=e.entity,t.activity=t.entity,void(t.points=e.points))},function(){o.hide(),t.modal.remove()}),t.accept=function(){t.modal.remove(),t.refresh(),s.put("api/v1/boost/"+t.guid,{cb:Date.now()},function(){},function(){})},t.reject=function(){t.modal.remove(),t.refresh(),s["delete"]("api/v1/boost/"+t.guid,{cb:Date.now()},function(){},function(){})}}return e.$inject=["$rootScope","$scope","$state","$stateParams","$ionicLoading","$ionicPopup","$timeout","Client"],e}),define("controllers/invite/InviteCtrl",[],function(){"use strict";function e(e,t,n,i,o,r,a,s){t.contacts=[],t.selected=[],navigator.contacts.pickContact(function(e){s.confirm({title:"Invite",template:"Are you sure you want to invite "+e.name.formatted+"?"}).then(function(n){n?(r.post("api/v1/invite",{contact:e},function(){},function(){}),t.modal.remove(),o.show({template:"

Invited "+e.name.formatted+"

"}),a(function(){o.hide()},1e3)):t.modal.remove()})},function(e){console.log("Error: "+e)}),t.isSelected=function(e){for(var n=0;ninviting...'}),r.post("api/v1/invite",{contacts:t.selected},function(){t.modal.remove(),o.hide()},function(){t.modal.remove(),o.hide()})}}return e.$inject=["$rootScope","$scope","$state","$stateParams","$ionicLoading","Client","$timeout","$ionicPopup"],e}),define("controllers/controllers",["require","angular","services/services","config","controllers/LoadingCtrl","controllers/TutorialCtrl","controllers/TabsCtrl","controllers/LoginCtrl","controllers/RegisterCtrl","controllers/newsfeed/NewsfeedCtrl","controllers/newsfeed/NewsfeedCompoerCtrl","controllers/newsfeed/NewsfeedViewCtrl","controllers/newsfeed/NewsfeedBoostCtrl","controllers/gatherings/ChatCtrl","controllers/gatherings/ChatConversationCtrl","controllers/gatherings/ChatSetupCtrl","controllers/channels/ChannelCtrl","controllers/channels/ChannelEditCtrl","controllers/channels/ChannelSubscribersCtrl","controllers/channels/ChannelSubscriptionsCtrl","controllers/capture/CaptureCtrl","controllers/notifications/NotificationsCtrl","controllers/notifications/NotificationsEntityCtrl","controllers/notifications/NotificationsP2PReviewCtrl","controllers/discover/DiscoverCtrl","controllers/wallet/WalletCtrl","controllers/wallet/WalletDepositCtrl","controllers/wallet/BoostCtrl","controllers/wallet/BoostReviewCtrl","controllers/invite/InviteCtrl"],function(e){"use strict";var t=e("angular"),n=(e("services/services"),e("config"),t.module("app.controllers",["app.services","app.config"]));return n.controller("LoadingCtrl",e("controllers/LoadingCtrl")),n.controller("TutorialCtrl",e("controllers/TutorialCtrl")),n.controller("TabsCtrl",e("controllers/TabsCtrl")),n.controller("LoginCtrl",e("controllers/LoginCtrl")),n.controller("RegisterCtrl",e("controllers/RegisterCtrl")),n.controller("NewsfeedCtrl",e("controllers/newsfeed/NewsfeedCtrl")),n.controller("NewsfeedComposerCtrl",e("controllers/newsfeed/NewsfeedCompoerCtrl")),n.controller("NewsfeedViewCtrl",e("controllers/newsfeed/NewsfeedViewCtrl")),n.controller("NewsfeedBoostCtrl",e("controllers/newsfeed/NewsfeedBoostCtrl")),n.controller("ChatCtrl",e("controllers/gatherings/ChatCtrl")),n.controller("ChatConversationCtrl",e("controllers/gatherings/ChatConversationCtrl")),n.controller("ChatSetupCtrl",e("controllers/gatherings/ChatSetupCtrl")),n.controller("ChannelCtrl",e("controllers/channels/ChannelCtrl")),n.controller("ChannelEditCtrl",e("controllers/channels/ChannelEditCtrl")),n.controller("ChannelSubscribersCtrl",e("controllers/channels/ChannelSubscribersCtrl")),n.controller("ChannelSubscriptionsCtrl",e("controllers/channels/ChannelSubscriptionsCtrl")),n.controller("CaptureCtrl",e("controllers/capture/CaptureCtrl")),n.controller("NotificationsCtrl",e("controllers/notifications/NotificationsCtrl")),n.controller("NotificationsEntityCtrl",e("controllers/notifications/NotificationsEntityCtrl")),n.controller("NotificationsP2PReviewCtrl",e("controllers/notifications/NotificationsP2PReviewCtrl")),n.controller("DiscoverCtrl",e("controllers/discover/DiscoverCtrl")),n.controller("WalletCtrl",e("controllers/wallet/WalletCtrl")),n.controller("WalletDepositCtrl",e("controllers/wallet/WalletDepositCtrl")),n.controller("BoostCtrl",e("controllers/wallet/BoostCtrl")),n.controller("BoostReviewCtrl",e("controllers/wallet/BoostReviewCtrl")),n.controller("InviteCtrl",e("controllers/invite/InviteCtrl")),n.run(["$rootScope","NODE_URL","storage","$timeout",function(e,t,n,i){e.node_url=t,e.user_guid=n.get("user_guid"),e.points="...",e.globalCB=Date.now();var o;document.onclick=function(e){e=e||window.event;var t=e.target||e.srcElement;return"A"==t.tagName&&t.href.indexOf("http")>=0?(i.cancel(o),o=i(function(){window.open(t.href,"_blank","location=yes")},300),!1):void 0}}]),window.addEventListener("keypress",function(e){13==e.keyCode&&cordova.plugins.Keyboard.close()},!1),n}),function(e,t,n){"use strict";function i(e,t,n){if(!e)throw ngMinErr("areq",t||"?",n||"required");return e}function o(e,t){return e||t?e?t?(M(e)&&(e=e.join(" ")),M(t)&&(t=t.join(" ")),e+" "+t):e:t:""}function r(e){var t={};return e&&(e.to||e.from)&&(t.to=e.to,t.from=e.from),t}function a(e,t,n){var i="";return e=M(e)?e:e&&N(e)&&e.length?e.split(/\s+/):[],P(e,function(e,o){e&&00?" ":"",i+=n?t+e:e+t)}),i}function s(e){if(e instanceof L)switch(e.length){case 0:return[];case 1:if(1===e[0].nodeType)return e;break;default:return L(c(e))}return 1===e.nodeType?L(e):void 0}function c(e){if(!e[0])return e;for(var t=0;t=0)&&(n=w(n)),0===n&&(n=null),i[t]=n}}),i}function w(e){var t=0;return e=e.split(/\s*,\s*/),P(e,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function y(e){return 0===e||null!=e}function _(e,t){var n=E,i=e+"s";return t?n+="Duration":i+=" linear all",[n,i]}function S(e,t){var n=t?"-"+t+"s":"";return x(e,[U,n]),[U,n]}function C(e,t){var n=t?"paused":"",i=I+"PlayState";return x(e,[i,n]),[i,n]}function x(e,t){e.style[t[0]]=t[1]}function k(){var e=Object.create(null);return{flush:function(){e=Object.create(null)},count:function(t){return(t=e[t])?t.total:0},get:function(t){return(t=e[t])&&t.value},put:function(t,n){e[t]?e[t].total++:e[t]={total:1,value:n}}}}var E,T,I,D,A=t.noop,O=t.extend,L=t.element,P=t.forEach,M=t.isArray,N=t.isString,V=t.isObject,R=t.isUndefined,B=t.isDefined,F=t.isFunction,j=t.isElement;e.ontransitionend===n&&e.onwebkittransitionend!==n?(E="WebkitTransition",T="webkitTransitionEnd transitionend"):(E="transition",T="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(I="WebkitAnimation",D="webkitAnimationEnd animationend"):(I="animation",D="animationend");var z=I+"Delay",H=I+"Duration",U=E+"Delay";e=E+"Duration";var q={transitionDuration:e,transitionDelay:U,transitionProperty:E+"Property",animationDuration:H,animationDelay:z,animationIterationCount:I+"IterationCount"},G={transitionDuration:e,transitionDelay:U,animationDuration:H,animationDelay:z};t.module("ngAnimate",[]).directive("ngAnimateChildren",[function(){return function(e,n,i){e=i.ngAnimateChildren,t.isString(e)&&0===e.length?n.data("$$ngAnimateChildren",!0):i.$observe("ngAnimateChildren",function(e){n.data("$$ngAnimateChildren","on"===e||"true"===e)})}}]).factory("$$rAFMutex",["$$rAF",function(e){return function(){var t=!1;return e(function(){t=!0}),function(n){t?n():e(n)}}}]).factory("$$rAFScheduler",["$$rAF",function(e){function t(e){o.push([].concat(e)),n()}function n(){if(o.length){for(var t=[],r=0;r=0;n--){var i=t[n];if(r.has(i)&&(i=r.get(i)(e)))return i}}function S(t,n){t.from&&t.to?(e(t.from.element).setHost(n),e(t.to.element).setHost(n)):e(t.element).setHost(n)}function C(){var t=e(d);!t||"leave"===g&&v.$$domOperationFired||t.end()}function x(e){d.off("$destroy",C),d.removeData("$$animationRunner"),l(d,v),p(d,v),v.domOperation(),I&&n.removeClass(d,I),d.removeClass("ng-animate"),E.complete(!e)}v=f(v);var k=0<=["enter","move","leave"].indexOf(g),E=new a({end:function(){x()},cancel:function(){x(!0)}});if(!t.length)return x(),E;d.data("$$animationRunner",E);var T=o(d.attr("class"),o(v.addClass,v.removeClass)),I=v.tempClasses;I&&(T+=" "+I,v.tempClasses=null);var D;return k||(D=u,u+=1),c.push({element:d,classes:T,event:g,classBasedIndex:D,structural:k,options:v,beforeStart:function(){d.addClass("ng-animate"),I&&n.addClass(d,I)},close:x}),d.on("$destroy",C),1=W&&t>=Y&&(B=!0,d())}if(!V){var a,c=[],l=function(e){if(B)R&&e&&(R=!1,d());else if(R=!e,ct.animationDuration)if(e=C(N,R),R)K.push(e);else{var t=K,n=t.indexOf(e);e>=0&&t.splice(n,1)}},u=st>0&&(ct.transitionDuration&&0===at.transitionDuration||ct.animationDuration&&0===at.animationDuration)&&Math.max(at.animationDelay,at.transitionDelay);u?s(e,Math.floor(u*st*1e3),!1):e(),j.resume=function(){l(!0)},j.pause=function(){l(!1)}}}var N=b(t);n=f(n);var V,R,B,F,j,q,W,Y,X,K=[],Z=t.attr("class"),J=r(n);if(0===n.duration||!l.animations&&!l.transitions)return O();var Q=n.event&&M(n.event)?n.event.join(" "):n.event,et="",tt="";Q&&n.structural?et=a(Q,"ng-",!0):Q&&(et=Q),n.addClass&&(tt+=a(n.addClass,"-add")),n.removeClass&&(tt.length&&(tt+=" "),tt+=a(n.removeClass,"-remove")),n.applyClassesEarly&&tt.length&&(A(t,n),tt="");var nt=[et,tt].join(" ").trim(),it=Z+" "+nt,ot=a(nt,"-active"),Z=J.to&&0=0&&b[r]!=i;r--);if(r>=0){for(o=b.length-1;o>=r;o--)n.end&&n.end(b[o]);b.length=r}}"string"!=typeof e&&(e=null===e||"undefined"==typeof e?"":""+e);var r,s,c,b=[],$=e;for(b.last=function(){return b[b.length-1]};e;){if(c="",s=!0,b.last()&&C[b.last()]?(e=e.replace(new RegExp("([\\W\\w]*)<\\s*\\/\\s*"+b.last()+"[^>]*>","i"),function(e,t){return t=t.replace(m,"$1").replace(v,"$1"),n.chars&&n.chars(a(t)),""}),o("",b.last())):(0===e.indexOf("",r)===r&&(n.comment&&n.comment(e.substring(4,r)),e=e.substring(r+3),s=!1)):g.test(e)?(r=e.match(g))&&(e=e.replace(r[0],""),s=!1):h.test(e)?(r=e.match(d))&&(e=e.substring(r[0].length),r[0].replace(d,o),s=!1):p.test(e)&&((r=e.match(u))?(r[4]&&(e=e.substring(r[0].length),r[0].replace(u,i)),s=!1):(c+="<",e=e.substring(1))),s&&(r=e.indexOf("<"),c+=0>r?e:e.substring(0,r),e=0>r?"":e.substring(r),n.chars&&n.chars(a(c)))),e==$)throw l("badparse",e);$=e}o()}function a(e){return e?(T.innerHTML=e.replace(//g,">")}function c(e,n){var i=!1,o=t.bind(e,e.push);return{start:function(e,r,a){e=t.lowercase(e),!i&&C[e]&&(i=e),i||!0!==x[e]||(o("<"),o(e),t.forEach(r,function(i,r){var a=t.lowercase(r),c="img"===e&&"src"===a||"background"===a;!0!==E[a]||!0===k[a]&&!n(i,c)||(o(" "),o(r),o('="'),o(s(i)),o('"'))}),o(a?"/>":">"))},end:function(e){e=t.lowercase(e),i||!0!==x[e]||(o("")),e==i&&(i=!1)},chars:function(e){i||o(s(e))}}}var l=t.$$minErr("$sanitize"),u=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,d=/^<\/\s*([\w:-]+)[^>]*>/,f=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,p=/^]*?)>/i,v=/"\u201d\u2019]/i,o=/^mailto:/i;return function(r,a){function s(e){e&&p.push(i(e))}function c(e,n){p.push("'),s(n),p.push("")}if(!r)return r;for(var l,u,d,f=r,p=[];l=f.match(n);)u=l[0],l[2]||l[4]||(u=(l[3]?"http://":"mailto:")+u),d=l.index,s(f.substr(0,d)),c(u,l[0].replace(o,"")),f=f.substring(d+l[0].length);return s(f),e(p.join(""))}}])}(window,window.angular),define("angularSanitize",["angular"],function(){}),function(){function e(e,t,n,i,o,r){function a(i,a,s,c,l){function d(){R.resizeRequiresRefresh($.__clientWidth,$.__clientHeight)&&g()}function f(){var e;return e={dataLength:0,width:0,height:0,resizeRequiresRefresh:function(t,n){var i=e.dataLength&&t&&n&&(t!==e.width||n!==e.height);return e.width=t,e.height=n,!!i},dataChangeRequiresRefresh:function(t){var n=t.length>0||t.length'),$.options.scrollingX&&e.addClass("horizontal"),e.append(n),$.__content.appendChild(e[0])}return e}function m(){M?v(M,I):I.computed=!0,N?v(N,D):D.computed=!0}function g(){var e=O.length>0;if(e&&(I.computed||D.computed)&&b(),e&&I.computed){if(I.value=A.height,!I.value)throw new Error('collection-repeat tried to compute the height of repeated elements "'+S+'", but was unable to. Please provide the "item-height" attribute. http://ionicframework.com/docs/api/directive/collectionRepeat/')}else!I.dynamic&&I.getValue&&(I.value=I.getValue());if(e&&D.computed){if(D.value=A.width,!D.value)throw new Error('collection-repeat tried to compute the width of repeated elements "'+S+'", but was unable to. Please provide the "item-width" attribute. http://ionicframework.com/docs/api/directive/collectionRepeat/')}else!D.dynamic&&D.getValue&&(D.value=D.getValue());p().refreshLayout()}function v(e,n){if(e){var i;try{i=t(e)}catch(o){e.trim().match(/\d+(px|%)$/)&&(e='"'+e+'"'),i=t(e)}var r=e.replace(/(\'|\"|px|%)/g,"").trim(),a=r.length&&!/([a-zA-Z]|\$|:|\?)/.test(r);if(n.attrValue=e,a){var s=parseInt(i());if(e.indexOf("%")>-1){var c=s/100;n.getValue=n===I?function(){return Math.floor(c*$.__clientHeight)}:function(){return Math.floor(c*$.__clientWidth)}}else n.value=s}else n.dynamic=!0,n.getValue=n===I?function(e,t){var n=i(e,t);return n.charAt&&"%"===n.charAt(n.length-1)?Math.floor(parseInt(n)/100*$.__clientHeight):parseInt(n)}:function(e,t){var n=i(e,t);return n.charAt&&"%"===n.charAt(n.length-1)?Math.floor(parseInt(n)/100*$.__clientWidth):parseInt(n)}}}function b(){F||l(j=i.$new(),function(e){e[0].removeAttribute("collection-repeat"),F=e[0]}),j[k]=(T(i)||[])[0],o.$$phase||j.$digest(),y.appendChild(F);var e=n.getComputedStyle(F);A.width=parseInt(e.width),A.height=parseInt(e.height),y.removeChild(F)}var $=c.scrollView,w=a[0],y=angular.element('
')[0];if(w.parentNode.replaceChild(y,w),$.options.scrollingX&&$.options.scrollingY)throw new Error("collection-repeat expected a parent x or y scrollView, not an xy scrollView.");var S=s.collectionRepeat,C=S.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!C)throw new Error("collection-repeat expected expression in form of '_item_ in _collection_[ track by _id_]' but got '"+s.collectionRepeat+"'.");var x,k=C[1],E=C[2],T=t(E),I={},D={},A={},O=[],L=s.itemRenderBuffer||s.collectionBufferSize,P=angular.isDefined(L)?parseInt(L):_,M=s.itemHeight||s.collectionItemHeight,N=s.itemWidth||s.collectionItemWidth,V=h(),R=f();m(),c.$element.on("scroll-resize",g),angular.element(n).on("resize",d);var B=o.$on("$ionicExposeAside",ionic.animationFrameThrottle(function(){c.scrollView.resize(),d()}));r(g,0,!1),i.$watchCollection(T,function(e){if(O=e||(e=[]),!angular.isArray(e))throw new Error("collection-repeat expected an array for '"+E+"', but got a "+typeof value);i.$$postDigest(function(){p().setData(O),R.dataChangeRequiresRefresh(O)&&g()})}),i.$on("$destroy",function(){angular.element(n).off("resize",d),B(),c.$element&&c.$element.off("scroll-resize",g),F&&F.parentNode&&F.parentNode.removeChild(F),j&&j.$destroy(),j=F=null,x&&x.destroy(),x=null});var F,j}return{restrict:"A",priority:1e3,transclude:"element",$$tlb:!0,require:"^^$ionicScroll",link:a}}function t(e,t,n){var i={primaryPos:0,secondaryPos:0,primarySize:0,secondarySize:0,rowPrimarySize:0};return function(o){function r(){return a(!0)}function a(t){if(!a.destroyed){var n,o,r,l,u,d=et.getScrollValue(),f=d+et.scrollPrimarySize;et.updateRenderRange(d,f),U=Math.max(0,U-x),q=Math.min(I.length-1,q+x);for(n in Z)(U>n||n>q)&&(r=Z[n],delete Z[n],X.push(r),r.isShown=!1);for(n=U;q>=n;n++)n>=I.length||Z[n]&&!t||(r=Z[n]||(Z[n]=X.length?X.pop():Y.length?Y.shift():new c),K.push(r),r.isShown=!0,u=r.scope,u.$index=n,u[C]=I[n],u.$first=0===n,u.$last=n===I.length-1,u.$middle=!(u.$first||u.$last),u.$odd=!(u.$even=0===(1&n)),u.$$disconnected&&ionic.Utils.reconnectScope(r.scope),l=et.getDimensions(n),(r.secondaryPos!==l.secondaryPos||r.primaryPos!==l.primaryPos)&&(r.node.style[ionic.CSS.TRANSFORM]=F.replace(R,r.primaryPos=l.primaryPos).replace(B,r.secondaryPos=l.secondaryPos)),(r.secondarySize!==l.secondarySize||r.primarySize!==l.primarySize)&&(r.node.style.cssText=r.node.style.cssText.replace(y,j.replace(R,(r.primarySize=l.primarySize)+1).replace(B,r.secondarySize=l.secondarySize))));for(q===I.length-1&&(l=et.getDimensions(I.length-1)||i,v.style[ionic.CSS.TRANSFORM]=F.replace(R,l.primaryPos+l.primarySize).replace(B,0));X.length;)r=X.pop(),r.scope.$broadcast("$collectionRepeatLeave"),ionic.Utils.disconnectScope(r.scope),Y.push(r),r.node.style[ionic.CSS.TRANSFORM]="translate3d(-9999px,-9999px,0)",r.primaryPos=r.secondaryPos=null;if($)for(n=0,o=K.length;o>n&&(r=K[n]);n++)if(r.images)for(var p,h=0,m=r.images.length;m>h&&(p=r.images[h]);h++){var g=p.src;p.src=w,p.src=g}if(t)for(var b=e.$$phase;K.length;)r=K.pop(),b||r.scope.$digest();else s()}}function s(){var t;s.running||(s.running=!0,n(function(){for(var n=e.$$phase;K.length;)t=K.pop(),t.isShown&&(n||t.scope.$digest());s.running=!1}))}function c(){var e=this;this.scope=k.$new(),this.id="item"+J++,T(this.scope,function(t){e.element=t,e.element.data("$$collectionRepeatItem",e),e.node=t[0],e.node.style[ionic.CSS.TRANSFORM]="translate3d(-9999px,-9999px,0)",e.node.style.cssText+=" height: 0px; width: 0px;",ionic.Utils.disconnectScope(e.scope),b.appendChild(e.node),e.images=t[0].getElementsByTagName("img")})}function l(){this.getItemPrimarySize=O,this.getItemSecondarySize=P,this.getScrollValue=function(){return Math.max(0,Math.min(E.__scrollTop-z,E.__maxScrollTop-z-H))},this.refreshDirection=function(){this.scrollPrimarySize=E.__clientHeight,this.scrollSecondarySize=E.__clientWidth,this.estimatedPrimarySize=m,this.estimatedSecondarySize=g,this.estimatedItemsAcross=N&&Math.floor(E.__clientWidth/g)||1}}function u(){this.getItemPrimarySize=P,this.getItemSecondarySize=O,this.getScrollValue=function(){return Math.max(0,Math.min(E.__scrollLeft-z,E.__maxScrollLeft-z-H))},this.refreshDirection=function(){this.scrollPrimarySize=E.__clientWidth,this.scrollSecondarySize=E.__clientHeight,this.estimatedPrimarySize=g,this.estimatedSecondarySize=m,this.estimatedItemsAcross=N&&Math.floor(E.__clientHeight/m)||1}}function d(){this.getEstimatedSecondaryPos=function(e){return e%this.estimatedItemsAcross*this.estimatedSecondarySize},this.getEstimatedPrimaryPos=function(e){return Math.floor(e/this.estimatedItemsAcross)*this.estimatedPrimarySize},this.getEstimatedIndex=function(e){return Math.floor(e/this.estimatedPrimarySize)*this.estimatedItemsAcross}}function f(){this.getEstimatedSecondaryPos=function(){return 0},this.getEstimatedPrimaryPos=function(e){return e*this.estimatedPrimarySize},this.getEstimatedIndex=function(e){return Math.floor(e/this.estimatedPrimarySize)}}function p(){this.getContentSize=function(){return this.getEstimatedPrimaryPos(I.length-1)+this.estimatedPrimarySize+z+H};var e={};this.getDimensions=function(t){return e.primaryPos=this.getEstimatedPrimaryPos(t),e.secondaryPos=this.getEstimatedSecondaryPos(t),e.primarySize=this.estimatedPrimarySize,e.secondarySize=this.estimatedSecondarySize,e},this.updateRenderRange=function(e,t){U=Math.max(0,this.getEstimatedIndex(e)),q=Math.min(I.length-1,this.getEstimatedIndex(t)+this.estimatedItemsAcross-1),W=Math.max(0,this.getEstimatedPrimaryPos(U)),G=this.getEstimatedPrimaryPos(q)+this.estimatedPrimarySize}}function h(){function e(e){var t,r,a;for(t=Math.max(0,n);e>=t&&(a=s[t]);t++)r=s[t-1]||i,a.primarySize=o.getItemPrimarySize(t,I[t]),a.secondarySize=o.scrollSecondarySize,a.primaryPos=r.primaryPos+r.primarySize,a.secondaryPos=0}function t(e){var t,r,a;for(t=Math.max(n,0);e>=t&&(a=s[t]);t++)r=s[t-1]||i,a.secondarySize=Math.min(o.getItemSecondarySize(t,I[t]),o.scrollSecondarySize),a.secondaryPos=r.secondaryPos+r.secondarySize,0===t||a.secondaryPos+a.secondarySize>o.scrollSecondarySize?(a.secondaryPos=0,a.primarySize=o.getItemPrimarySize(t,I[t]),a.primaryPos=r.primaryPos+r.rowPrimarySize,a.rowStartIndex=t,a.rowPrimarySize=a.primarySize):(a.primarySize=o.getItemPrimarySize(t,I[t]),a.primaryPos=r.primaryPos,a.rowStartIndex=r.rowStartIndex,s[a.rowStartIndex].rowPrimarySize=a.rowPrimarySize=Math.max(s[a.rowStartIndex].rowPrimarySize,a.primarySize),a.rowPrimarySize=Math.max(a.primarySize,a.rowPrimarySize))}var n,o=this,r=ionic.debounce(Q,25,!0),a=N?t:e,s=[];this.getContentSize=function(){var e=s[n]||i;return(e.primaryPos+e.primarySize||0)+this.getEstimatedPrimaryPos(I.length-n-1)+z+H},this.onDestroy=function(){s.length=0},this.onRefreshData=function(){var e,t;for(e=s.length,t=I.length;t>e;e++)s.push({});n=-1},this.onRefreshLayout=function(){n=-1},this.getDimensions=function(e){return e=Math.min(e,I.length-1),e>n&&(e>.9*I.length?(a(I.length-1),n=I.length-1,Q()):(a(e),n=e,r())),s[e]};var c=-1,l=-1;this.updateRenderRange=function(e,t){var n,i,o;if(this.getDimensions(2*this.getEstimatedIndex(t)),-1===c||0===e)n=0;else if(e>=l)for(n=c,i=I.length;i>n&&!((o=this.getDimensions(n))&&o.primaryPos+o.rowPrimarySize>=e);n++);else for(n=c;n>=0;n--)if((o=this.getDimensions(n))&&o.primaryPos<=e){n=N?o.rowStartIndex:n;break}U=Math.min(Math.max(0,n),I.length-1),W=-1!==U?this.getDimensions(U).primaryPos:-1;var r;for(n=U+1,i=I.length;i>n;n++)if((o=this.getDimensions(n))&&o.primaryPos+o.rowPrimarySize>t){if(N)for(r=o;i-1>n&&(o=this.getDimensions(n+1)).primaryPos===r.primaryPos;)n++;break}q=Math.min(n,I.length-1),G=-1!==q?(o=this.getDimensions(q)).primaryPos+(o.rowPrimarySize||o.primarySize):-1,l=e,c=U}}var m,g,v=o.afterItemsNode,b=o.containerNode,$=o.forceRefreshImages,_=o.heightData,S=o.widthData,C=o.keyExpression,x=o.renderBuffer,k=o.scope,E=o.scrollView,T=o.transclude,I=[],D={},A=_.getValue||function(){return _.value},O=function(e,t){return D[C]=t,D.$index=e,A(k,D)},L=S.getValue||function(){return S.value},P=function(e,t){return D[C]=t,D.$index=e,L(k,D)},M=!!E.options.scrollingY,N=M?S.dynamic||S.value!==E.__clientWidth:_.dynamic||_.value!==E.__clientHeight,V=!_.dynamic&&!S.dynamic,R="PRIMARY",B="SECONDARY",F=M?"translate3d(SECONDARYpx,PRIMARYpx,0)":"translate3d(PRIMARYpx,SECONDARYpx,0)",j=M?"height: PRIMARYpx; width: SECONDARYpx;":"height: SECONDARYpx; width: PRIMARYpx;",z=0,H=0,U=-1,q=-1,G=-1,W=-1,Y=[],X=[],K=[],Z={},J=0,Q=M?function(){E.setDimensions(null,null,null,et.getContentSize(),!0)}:function(){E.setDimensions(null,null,et.getContentSize(),null,!0)},et=M?new l:new u;(N?d:f).call(et),(V?p:h).call(et);var tt=M?"getContentHeight":"getContentWidth",nt=E.options[tt];E.options[tt]=angular.bind(et,et.getContentSize),E.__$callback=E.__callback,E.__callback=function(e,t,n,i){var o=et.getScrollValue();(-1===U||o+et.scrollPrimarySize>G||W>o)&&a(),E.__$callback(e,t,n,i)};var it=!1,ot=!1;this.refreshLayout=function(){I.length?(m=O(0,I[0]),g=P(0,I[0])):(m=100,g=100);var e=getComputedStyle(v)||{},n=v.firstElementChild&&getComputedStyle(v.firstElementChild)||{},i=v.lastElementChild&&getComputedStyle(v.lastElementChild)||{};H=(parseInt(e[M?"height":"width"])||0)+(n&&parseInt(n[M?"marginTop":"marginLeft"])||0)+(i&&parseInt(i[M?"marginBottom":"marginRight"])||0),z=0;var o=b;do z+=o[M?"offsetTop":"offsetLeft"];while(ionic.DomUtil.contains(E.__content,o=o.offsetParent));var a=b.previousElementSibling,s=a?t.getComputedStyle(a):{},l=parseInt(s[M?"marginBottom":"marginRight"]||0);if(b.style[ionic.CSS.TRANSFORM]=F.replace(R,-l).replace(B,0),z-=l,E.__clientHeight&&E.__clientWidth||(E.__clientWidth=E.__container.clientWidth,E.__clientHeight=E.__container.clientHeight),(et.onRefreshLayout||angular.noop)(),et.refreshDirection(),Q(),!it)for(var u=Math.max(20,3*x),d=0;u>d;d++)Y.push(new c);it=!0,it&&ot&&((E.__scrollLeft>E.__maxScrollLeft||E.__scrollTop>E.__maxScrollTop)&&E.resize(),r(!0))},this.setData=function(e){I=e,(et.onRefreshData||angular.noop)(),ot=!0},this.destroy=function(){a.destroyed=!0,Y.forEach(function(e){e.scope.$destroy(),e.scope=e.element=e.node=e.images=null}),Y.length=K.length=X.length=0,Z={},E.options[tt]=nt,E.__callback=E.__$callback,E.resize(),(et.onDestroy||angular.noop)()}}}function n(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 i(){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 o(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.$emit("$ionicSubheader",t.$hasSubheader)}),t.$on("$destroy",function(){delete t.$hasHeader,delete t.$hasSubheader}),o.align(),t.$on("$ionicHeader.align",function(){ionic.requestAnimationFrame(function(){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 r(e){return e.clientHeight}function a(e){e.stopPropagation()}var s=angular.module("ionic",["ngAnimate","ngSanitize","ui.router"]),c=angular.extend,l=angular.forEach,u=angular.isDefined,d=angular.isNumber,f=angular.isString,p=angular.element,h=angular.noop;s.factory("$ionicActionSheet",["$rootScope","$compile","$animate","$timeout","$ionicTemplateLoader","$ionicPlatform","$ionicBody","IONIC_BACK_PRIORITY",function(e,t,n,i,o,r,a,s){function l(o){function l(e){e&&/icon/.test(e)&&(u.$actionSheetHasIcon=!0)}var u=e.$new(!0);c(u,{cancel:h,destructiveButtonClicked:h,buttonClicked:h,$deregisterBackButton:h,buttons:[],cancelOnStateChange:!0},o||{});for(var d=0;d')(u),m=p(f[0].querySelector(".action-sheet-wrapper")),g=u.cancelOnStateChange?e.$on("$stateChangeSuccess",function(){u.cancel()}):h;return u.removeSheet=function(e){u.removed||(u.removed=!0,m.removeClass("action-sheet-up"),i(function(){a.removeClass("action-sheet-open")},400),u.$deregisterBackButton(),g(),n.removeClass(f,"active").then(function(){u.$destroy(),f.remove(),u.cancel.$scope=m=null,(e||h)()}))},u.showSheet=function(e){u.removed||(a.append(f).addClass("action-sheet-open"),n.addClass(f,"active").then(function(){u.removed||(e||h)()}),i(function(){u.removed||m.addClass("action-sheet-up")},20,!1))},u.$deregisterBackButton=r.registerBackButtonAction(function(){i(u.cancel)},s.actionSheet),u.cancel=function(){u.removeSheet(o.cancel)},u.buttonClicked=function(e){o.buttonClicked(e,o.buttons[e])===!0&&u.removeSheet()},u.destructiveButtonClicked=function(){o.destructiveButtonClicked()===!0&&u.removeSheet()},u.showSheet(),u.cancel.$scope=u,u.cancel}return{show:l}}]),p.prototype.addClass=function(e){var t,n,i,o,r,a;if(e&&"ng-scope"!=e&&"ng-isolate-scope"!=e)for(t=0;t=1&&a.addClass("active")}))}function o(){1===s&&(a.removeClass("active"),t(function(){0===s&&a.removeClass("visible")},400,!1)),s=Math.max(0,s-1)}function r(){return a}var a=p('
'),s=0;return e[0].body.appendChild(a[0]),{retain:i,release:o,getElement:r,_element:a}}]),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-1&&d.stack.length>0&&d.cursor=R.index;a--){var q=i.stack[a];q&&q.destroy&&q.destroy(),i.stack.splice(a)}z=R.historyId}d.historyId===b.historyId?j=D:b.historyId!==d.historyId&&(j=A,i=f(b.historyId),i&&i.parentHistoryId===d.parentHistoryId?j=L:(i=f(i.parentHistoryId),i&&i.historyId===d.historyId&&(j=O)))}else F=x;2>M&&(j=P),N.views[B]=this.createView({viewId:B,index:d.stack.length,historyId:d.historyId,backViewId:b&&b.viewId?b.viewId:null,forwardViewId:null,stateId:u,stateName:this.currentStateName(),stateParams:v(),url:H,canSwipeBack:$(c,t)}),d.stack.push(N.views[B])}if(_&&_(),o.cancel(S),y){if(y.disableAnimate&&(j=P),y.disableBack&&(N.views[B].backViewId=null),y.historyRoot){for(a=0;a0&&(d.stack[a-1].forwardViewId=null),N.forwardView=null,N.currentView.index=N.backView.index,N.currentView.backViewId=N.backView.backViewId,N.backView=l(N.backView),d.stack.splice(a,1);break}return d.cursor=N.currentView.index,{viewId:B,action:F,direction:j,historyId:z,enableBack:this.enabledBack(N.currentView),isHistoryRoot:0===N.currentView.index,ele:c}},registerHistory:function(e){e.$historyId=ionic.Utils.nextUid()},createView:function(e){var t=new V;return t.initialize(e)},getViewById:s,viewHistory:function(){return N},currentView:function(e){return arguments.length&&(N.currentView=e),N.currentView},currentHistoryId:function(){return N.currentView?N.currentView.historyId:null},currentTitle:function(e){return N.currentView?(arguments.length&&(N.currentView.title=e),N.currentView.title):void 0},backView:function(e){return arguments.length&&(N.backView=e),N.backView},backTitle:function(e){var t=e&&s(e.backViewId)||N.backView;return t&&t.title},forwardView:function(e){return arguments.length&&(N.forwardView=e),N.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=f(e);if(t&&t.stack.length){if(N.currentView&&N.currentView.viewId===t.stack[0].viewId)return;C={viewId:t.stack[0].viewId,action:E,direction:I},t.stack[0].go()}}},goBack:function(e){if(u(e)&&-1!==e){if(e>-1)return;var t=N.histories[this.currentHistoryId()],n=t.cursor+e+1;1>n&&(n=1),t.cursor=n,m(t.stack[n].viewId);for(var i=n-1,r=[],a=s(t.stack[i].forwardViewId);a&&(r.push(a.stateId||a.viewId),i++,!(i>=t.stack.length));)a=s(t.stack[i].forwardViewId);var c=this;r.length&&o(function(){c.clearCache(r)},600)}N.backView&&N.backView.go()},enabledBack:function(e){var t=l(e);return!(!t||t.historyId!==e.historyId)},clearHistory:function(){var e=N.histories,t=N.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 N.views)i!==t.viewId&&delete N.views[i];t&&m(t.viewId)},clearCache:function(e){o(function(){a._instances.forEach(function(t){t.clearCache(e)})})},nextViewOptions:function(t){return _&&_(),arguments.length&&(o.cancel(S),null===t?y=t:(y=y||{},c(y,t),y.expire&&(_=e.$on("$stateChangeSuccess",function(){S=o(function(){y=null},y.expire)})))),y},isAbstractEle:function(e,t){return t&&t.$$state&&t.$$state.self["abstract"]?!0:!(!e||!b(e)&&!b(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","IONIC_BACK_PRIORITY",function(e,t,n,i,o,r,a){function s(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)return null;var o=r.viewHistory(),a=i.historyId?o.histories[i.historyId]:null;if(a&&a.cursor>-1&&a.cursor-1&&(o.boxShadow="0 0 10px rgba(0,0,0,"+(r.shouldAnimate?.45*i:.3)+")"),o[ionic.CSS.TRANSFORM]="translate3d("+n+"%,0,0)",ionic.DomUtil.cachedStyles(e,o)}var r={run:function(i){"forward"==n?(o(e,1,99*(1-i),1-i),o(t,1-.1*i,-33*i,-1)):"back"==n?(o(e,1-.1*(1-i),-33*(1-i),-1),o(t,1,100*i,1-i)):(o(e,1,0,-1),o(t,0,0,-1))},shouldAnimate:i&&("forward"==n||"back"==n)};return r},o.transitions.navBar.ios=function(e,t,n,i){function o(e,t,n,i){var o={};o[ionic.CSS.TRANSITION_DURATION]=s.shouldAnimate?"":"0ms",o.opacity=1===t?"":t,e.setCss("buttons-left",o),e.setCss("buttons-right",o),e.setCss("back-button",o),o[ionic.CSS.TRANSFORM]="translate3d("+i+"px,0,0)",e.setCss("back-text",o),o[ionic.CSS.TRANSFORM]="translate3d("+n+"px,0,0)",e.setCss("title",o)}function r(e,t,n){if(e&&t){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&&t){var i=(-(e.titleTextX()-t.backButtonTextLeft())-e.titleLeftRight())*n;o(e,1-n,i,0)}}var s={run:function(n){var i=e.controller(),o=t&&t.controller();"back"==s.direction?(a(i,o,1-n),r(o,i,1-n)):(r(i,o,n),a(o,i,n))},direction:n,shouldAnimate:i&&("forward"==n||"back"==n)};return s},o.transitions.views.android=function(e,t,n,i){function o(e,t){var n={};n[ionic.CSS.TRANSITION_DURATION]=r.shouldAnimate?"":0,n[ionic.CSS.TRANSFORM]="translate3d("+t+"%,0,0)",ionic.DomUtil.cachedStyles(e,n)}i=i&&("forward"==n||"back"==n);var r={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};return r},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{run:function(n){o(e.controller(),n),o(t&&t.controller(),1-n)},shouldAnimate:i&&("forward"==n||"back"==n)}},o.transitions.views.none=function(e,t){return{run:function(n){o.transitions.views.android(e,t,!1,!1).run(n)},shouldAnimate:!1}},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)},shouldAnimate:!1}},o.setPlatformConfig=e,o.$get=function(){return o}}).config(["$compileProvider",function(e){e.aHrefSanitizationWhitelist(/^\s*(https?|tel|ftp|mailto|file|ghttps?|ms-appx|x-wmapp0):/),e.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|file|content|blob|ms-appx|x-wmapp0):|data:image\//)}]);var m='
',g="$ionicLoading instance.hide() has been deprecated. Use $ionicLoading.hide().",v="$ionicLoading instance.show() has been deprecated. Use $ionicLoading.show().",b="$ionicLoading instance.setContent() has been deprecated. Use $ionicLoading.show({ template: 'my content' }).";s.constant("$ionicLoadingConfig",{template:""}).factory("$ionicLoading",["$ionicLoadingConfig","$ionicBody","$ionicTemplateLoader","$ionicBackdrop","$timeout","$q","$log","$compile","$ionicPlatform","$rootScope","IONIC_BACK_PRIORITY",function(e,t,n,i,o,r,a,s,l,u,d){function f(){return w||(w=n.compile({template:m,appendTo:t.get()}).then(function(e){return e.show=function(a){var c=a.templateUrl?n.load(a.templateUrl):r.when(a.template||a.content||"");e.scope=a.scope||e.scope,e.isShown||(e.hasBackdrop=!a.noBackdrop&&a.showBackdrop!==!1,e.hasBackdrop&&(i.retain(),i.getElement().addClass("backdrop-loading"))),a.duration&&(o.cancel(e.durationTimeout),e.durationTimeout=o(angular.bind(e,e.hide),+a.duration)),y(),y=l.registerBackButtonAction(h,d.loading),c.then(function(n){if(n){var i=e.element.children();i.html(n),s(i.contents())(e.scope)}e.isShown&&(e.element.addClass("visible"),ionic.requestAnimationFrame(function(){e.isShown&&(e.element.addClass("active"),t.addClass("loading-active"))}))}),e.isShown=!0},e.hide=function(){y(),e.isShown&&(e.hasBackdrop&&(i.release(),i.getElement().removeClass("backdrop-loading")),e.element.removeClass("active"),t.removeClass("loading-active"),setTimeout(function(){!e.isShown&&e.element.removeClass("visible")},200)),o.cancel(e.durationTimeout),e.isShown=!1},e})),w}function p(t){t=c({},e||{},t||{});var n=t.delay||t.showDelay||0;return _(),S(),t.hideOnStateChange&&(_=u.$on("$stateChangeSuccess",$),S=u.$on("$stateChangeError",$)),o.cancel(C),C=o(h,n),C.then(f).then(function(e){return e.show(t)}),{hide:function(){return a.error(g),$.apply(this,arguments)},show:function(){return a.error(v),p.apply(this,arguments)},setContent:function(e){return a.error(b),f().then(function(t){t.show({template:e})})}}}function $(){_(),S(),o.cancel(C),f().then(function(e){e.hide()})}var w,y=h,_=h,S=h,C=r.when();return{show:p,hide:$,_getLoader:f}}]),s.factory("$ionicModal",["$rootScope","$ionicBody","$compile","$timeout","$ionicPlatform","$ionicTemplateLoader","$$q","$log","$ionicClickBlock","$window","IONIC_BACK_PRIORITY",function(e,t,n,i,o,r,a,s,l,u,d){var f=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 s.error("Cannot call "+n.viewType+".show() after remove(). Please create a new "+n.viewType+" instance."),a.when();l.show(600),v.add(n);var r=p(n.modalEl);n.el.classList.remove("hide"),i(function(){n._isShown&&t.addClass(n.viewType+"-open")},400,!1),n.el.parentElement||(r.addClass(n.animation),t.append(n.el));var c=r.data("$$ionicScrollController");return c&&c.resize(),e&&n.positionView&&(n.positionView(e,r),n._onWindowResize=function(){n._isShown&&n.positionView(e,r)},ionic.on("resize",n._onWindowResize,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):h,d.modal),ionic.views.Modal.prototype.show.call(n),i(function(){n._isShown&&(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._isShown&&n.$el.on("click",function(e){n.backdropClickToClose&&e.target===n.el&&v.isHighest(n)&&n.hide()})},400)},hide:function(){var e=this,n=p(e.modalEl);return l.show(600),v.remove(e),e.el.classList.remove("active"),n.addClass("ng-leave"),i(function(){e._isShown||n.addClass("ng-leave-active").removeClass("ng-enter ng-enter-active active")},20,!1),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",e._onWindowResize,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}}),m=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(""+t+"")(o);i.$el=r,i.el=r[0],i.modalEl=i.el.querySelector("."+i.viewType);var a=new f(i);return a.scope=o,i.scope||(o[i.viewType]=a),a},g=[],v={add:function(e){g.push(e)},remove:function(e){var t=g.indexOf(e);t>-1&&t-1&&t===g.length-1}};return{fromTemplate:function(e,t){var n=m(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=m(e,t||{});return i&&i(n),n})},stack:v}}]),s.service("$ionicNavBarDelegate",ionic.DelegateService(["align","showBackButton","showBar","title","changeTitle","setTitle","getTitle","back","getPreviousTitle"])),s.service("$ionicNavViewDelegate",ionic.DelegateService(["clearCache"])),s.constant("IONIC_BACK_PRIORITY",{view:100,sideMenu:150,modal:200,actionSheet:300,popup:400,loading:500}).provider("$ionicPlatform",function(){return{$get:["$q",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,n){var o=p(e.target||e),a=t.offset(o),s=n.prop("offsetWidth"),c=n.prop("offsetHeight"),l=i.innerWidth,u=i.innerHeight,d={left:a.left+a.width/2-s/2},f=p(n[0].querySelector(".popover-arrow"));d.leftl&&(d.left=l-s-r),a.top+a.height+c>u&&a.top-c>0?(d.top=a.top-c,n.addClass("popover-bottom")):(d.top=a.top+a.height,n.removeClass("popover-bottom")),f.css({left:a.left+a.width/2-f.prop("offsetWidth")/2-d.left+"px"}),n.css({top:d.top+"px",left:d.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 $='';s.factory("$ionicPopup",["$ionicTemplateLoader","$ionicBackdrop","$q","$timeout","$rootScope","$ionicBody","$compile","$ionicPlatform","$ionicModal","IONIC_BACK_PRIORITY",function(e,t,n,i,o,r,a,s,l,u){function d(t){t=c({scope:null,title:"",buttons:[]},t||{});var s={};return s.scope=(t.scope||o).$new(),s.element=p($),s.responseDeferred=n.defer(),r.get().appendChild(s.element[0]),a(s.element)(s.scope),c(s.scope,{title:t.title,buttons:t.buttons,subTitle:t.subTitle,cssClass:t.cssClass,$buttonTapped:function(e,t){var n=(e.onTap||h)(t);t=t.originalEvent||t,t.defaultPrevented||s.responseDeferred.resolve(n)}}),n.when(t.templateUrl?e.load(t.templateUrl):t.template||t.content||"").then(function(e){var t=p(s.element[0].querySelector(".popup-body"));e?(t.html(e),a(t.contents())(s.scope)):t.remove()}),s.show=function(){s.isShown||s.removed||(l.stack.add(s),s.isShown=!0,ionic.requestAnimationFrame(function(){s.isShown&&(s.element.removeClass("popup-hidden"),s.element.addClass("popup-showing active"),g(s.element))}))},s.hide=function(e){return e=e||h,s.isShown?(l.stack.remove(s),s.isShown=!1,s.element.removeClass("active"),s.element.addClass("popup-hidden"),void i(e,250,!1)):e()},s.remove=function(){!s.removed&&l.stack.isHighest(s)&&(s.hide(function(){s.element.remove(),s.scope.$destroy()}),s.removed=!0)},s}function f(){var e=_[_.length-1];e&&e.responseDeferred.resolve()}function m(e){function n(){_.push(o),i(o.show,a,!1),o.responseDeferred.promise.then(function(e){var n=_.indexOf(o);return-1!==n&&_.splice(n,1),_.length>0?_[_.length-1].show():(t.release(),i(function(){_.length||r.removeClass("popup-open")},400,!1),(S._backButtonActionDone||h)()),o.remove(),e})}var o=S._createPopup(e),a=0;return _.length>0?(_[_.length-1].hide(),a=y.stackPushDelay):(r.addClass("popup-open"),t.retain(),S._backButtonActionDone=s.registerBackButtonAction(f,u.popup)),o.responseDeferred.promise.close=function(e){o.removed||o.responseDeferred.resolve(e)},o.responseDeferred.notify({close:o.responseDeferred.close}),n(),o.responseDeferred.promise}function g(e){var t=e[0].querySelector("[autofocus]");t&&t.focus()}function v(e){return m(c({buttons:[{text:e.okText||"OK",type:e.okType||"button-positive",onTap:function(){return!0}}]},e||{}))}function b(e){return m(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 w(e){var t=o.$new(!0);t.data={};var n="";return e.template&&/<[a-z][\s\S]*>/i.test(e.template)===!1&&(n=""+e.template+"",delete e.template),m(c({template:n+'',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 y={stackPushDelay:75},_=[],S={show:m,alert:v,confirm:b,prompt:w,_createPopup:d,_popupStack:_};return S}]),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(p(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","freezeScroll","freezeAllScrolls","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():(f(e)&&(e=[e]),l(e,function(e){s.push(e)}),void(a&&r()))}function r(){var e;if(o._runCount++,a=!0,0!==s.length){for(var c=0;4>c&&(e=s.pop());)f(e)&&t.get(e,{cache:n}),c++;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").html(i).contents();return n.controller&&(r=t(n.controller,c(n.locals,{$scope:a})),s.children().data("$ngControllerController",r)),n.appendTo&&p(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 d(e,t,n,i){var r=s(e),a=g||A(t,"view-transition")||r.viewTransition||o.views.transition()||"ios",l=o.navBar.transition();return n=v||A(t,"view-direction")||r.viewDirection||n||"none",c(f(i),{transition:a,navBarTransition:"view"===l?a:l,direction:n,shouldAnimate:"none"!==a&&"none"!==n})}function f(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 A(e,x,t):A(e,x)}function m(e){if(e&&e.length){var t=e.scope();t&&(t.$emit("$ionicView.unloaded",e.data(C)),t.$destroy()),e.remove()}}var g,v,b="webkitTransitionEnd transitionend",$="$noCache",w="$destroyEle",y="$eleId",_="$accessed",S="$fallbackTimer",C="$viewData",x="nav-view",k="active",E="cached",T="stage",I=0;ionic.transition=ionic.transition||{},ionic.transition.isActive=!1;var D,A=ionic.DomUtil.cachedAttr,O=[],L=1100,P={create:function(t,l,p,x,D,M){var N,V,R,B=++I,F={init:function(e,t){P.isTransitioning(!0),F.loadViewElements(e),F.render(e,function(){t&&t()})},loadViewElements:function(e){var n,i,o,r=t.getViewElements(),s=a(l,p),c=t.activeEleId();for(n=0,i=r.length;i>n&&(o=r.eq(n),o.data(y)===s?o.data($)?(o.data(y,s+ionic.Utils.nextUid()),o.data(w,!0)):N=o:u(c)&&o.data(y)===c&&(V=o),!N||!V);n++);R=!!N,R||(N=e.ele||P.createViewEle(l),N.data(y,s)),M&&t.activeEleId(s),e.ele=null},render:function(e,n){if(R)ionic.Utils.reconnectScope(N.scope());else{h(N,T);var i=d(l,N,e.direction,p),r=o.transitions.views[i.transition]||o.transitions.views.none;r(N,null,i.direction,!0).run(0),N.data(C,{viewId:i.viewId,historyId:i.historyId,stateName:i.stateName,stateParams:i.stateParams}),(s(l).cache===!1||"false"===s(l).cache||"false"==N.attr("cache-view")||0===o.views.maxCache())&&N.data($,!0);var a=t.appendViewElement(N,l);delete i.direction,delete i.transition,a.$emit("$ionicView.loaded",i)}N.data(_,Date.now()),n&&n()},transition:function(a,s,u){function m(){h(N,U.shouldAnimate?"entering":k),h(V,U.shouldAnimate?"leaving":E),U.run(1),r._instances.forEach(function(e){e.triggerTransitionStart(B)}),U.shouldAnimate||w()}function $(e){e.target===this&&w()}function w(){w.x||(w.x=!0,N.off(b,$),e.cancel(N.data(S)),V&&e.cancel(V.data(S)),F.emit("after",j,z),C&&C.resolve(t),B===I&&(n.all(O).then(P.transitionEnd),F.cleanup(j)),r._instances.forEach(function(e){e.triggerTransitionEnd()}),g=v=p=x=N=V=null)}function y(e){e.target===this&&_()}function _(){h(N,E),h(V,k),N.off(b,y),e.cancel(N.data(S)),P.transitionEnd([t])}var C,j=d(l,N,a,p),z=c(c({},j),f(x));j.transitionId=z.transitionId=B,j.fromCache=!!R,j.enableBack=!!s,j.renderStart=D,j.renderEnd=M,A(N.parent(),"nav-view-transition",j.transition),A(N.parent(),"nav-view-direction",j.direction),e.cancel(N.data(S));var H=o.transitions.views[j.transition]||o.transitions.views.none,U=H(N,V,j.direction,j.shouldAnimate&&u&&M);if(U.shouldAnimate&&(N.on(b,$),N.data(S,e(w,L)),i.show(L)),D&&(F.emit("before",j,z),h(N,T),U.run(0)),M&&(C=n.defer(),O.push(C.promise)),D&&M)e(m,16);else{if(!M)return h(N,"entering"),h(V,"leaving"),{run:U.run,cancel:function(t){t?(N.on(b,y),N.data(S,e(_,L)),i.show(L)):_(),U.shouldAnimate=t,U.run(0),U=null}};M&&m()}},emit:function(e,t,n){var i=N.scope(),o=V&&V.scope();"after"==e&&(i&&i.$emit("$ionicView.enter",t),o?o.$emit("$ionicView.leave",n):i&&n&&n.viewId&&i.$emit("$ionicNavView.leave",n)),i&&i.$emit("$ionicView."+e+"Enter",t),o?o.$emit("$ionicView."+e+"Leave",n):i&&n&&n.viewId&&i.$emit("$ionicNavView."+e+"Leave",n)},cleanup:function(e){V&&"back"==e.direction&&!o.views.forwardCache()&&m(V);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(_)t&&(e=t+(g-v-5)),e},p.titleTextX=function(){return t[0].offsetWidth/2-p.titleWidth()/2},p.titleLeftRight=function(){return g-v},p.backButtonTextLeft=function(){for(var e=0,t=a(c);t;)e+=t.offsetLeft,t=t.parentElement;return e},p.resetBackButton=function(e){if(o.backButton.previousTitleText()){var t=a(d);if(t){t.classList.remove(f);var n=e&&r.getViewById(e.viewId),i=r.backTitle(n);i!==m&&(m=t.innerHTML=i)}var s=a(u);s&&s.classList.remove(f)}},p.align=function(e){var i=a(s);e=e||n.alignTitle||o.navBar.alignTitle();var r=p.calcWidths(e,!1);if(w&&m&&o.backButton.previousTitleText()){var c=p.calcWidths(e,!0),l=t[0].offsetWidth-c.titleLeft-c.titleRight;p.titleTextWidth()<=l&&(r=c)}return p.updatePositions(i,r.titleLeft,r.titleRight,r.buttonsLeft,r.buttonsRight,r.css,r.showPrevTitle)},p.calcWidths=function(e,n){var i,o,r,p,h,m,g,v,b,$=a(s),y=a(l),_=t[0].childNodes,S=0,C=0,x=0,k=0,E="",T=0;for(i=0;i<_.length;i++){if(h=_[i],g=0,1==h.nodeType){if(h===$){b=!0;continue}if(h.classList.contains(f))continue;if(w&&h===y){for(o=0;o10&&(x=k=I)}return{backButtonWidth:T,buttonsLeft:S,buttonsRight:C,titleLeft:x,titleRight:k,showPrevTitle:n,css:E}},p.updatePositions=function(e,n,r,s,c,l,h){var m=i.defer();if(e&&(n!==g&&(e.style.left=n?n+"px":"",g=n),r!==v&&(e.style.right=r?r+"px":"",v=r),l!==b&&(l&&e.classList.add(l),b&&e.classList.remove(b),b=l)),o.backButton.previousTitleText()){var $=a(d),w=a(u);$&&$.classList[h?"remove":"add"](f),w&&w.classList[h?"add":"remove"](f)}return ionic.requestAnimationFrame(function(){if(e&&e.offsetWidth+10i?n:i,r!==v&&(e.style.right=r+"px",v=r)}m.resolve()}),m.promise},p.setCss=function(e,t){ionic.DomUtil.cachedStyles(a(e),t)};var C={};e.$on("$destroy",function(){for(var e in C)C[e]=null})}]),s.controller("$ionInfiniteScroll",["$scope","$attrs","$element","$timeout",function(e,t,n,i){function o(){ionic.requestAnimationFrame(function(){n[0].classList.add("active")}),c.isLoading=!0,i(function(){e.$parent&&e.$parent.$apply(t.onInfinite||"")})}function r(){ionic.requestAnimationFrame(function(){n[0].classList.remove("active")}),i(function(){c.jsScrolling&&c.scrollView.resize(),(c.jsScrolling&&c.scrollView.__container&&c.scrollView.__container.offsetHeight>0||!c.jsScrolling)&&c.checkBounds()},30,!1),c.isLoading=!1}function a(){if(!c.isLoading){var e={};if(c.jsScrolling){e=c.getJSMaxScroll();var t=c.scrollView.getValues();(-1!==e.left&&t.left>=e.left||-1!==e.top&&t.top>=e.top)&&o()}else e=c.getNativeMaxScroll(),(-1!==e.left&&c.scrollEl.scrollLeft>=e.left-c.scrollEl.clientWidth||-1!==e.top&&c.scrollEl.scrollTop>=e.top-c.scrollEl.clientHeight)&&o()}}function s(e){var n=(t.distance||"2.5%").trim(),i=-1!==n.indexOf("%"); diff --git a/www/js/templates-compiled.js b/www/js/templates-compiled.js index 6d1b14b1..c539db07 100644 --- a/www/js/templates-compiled.js +++ b/www/js/templates-compiled.js @@ -138,29 +138,30 @@ define(['angular'], function(angular){ " \n" + " \n" + " \n" + - " \n" + + "\n" + " \n" + " \n" + " \n" + - " \n" + + "\n" + " \n" + " \n" + " \n" + - " \n" + - " \n" + + "\n" + + " \n" + " \n" + " \n" + - " \n" + + "\n" + " \n" + "\n" + - ""); + "\n" + + ""); $templateCache.put("templates/tutorial.html", "\n" + " \n" + - " \n" + - " \n" + + "\n" + + "\n" + " \n" + " \n" + "
\n" + @@ -171,11 +172,11 @@ define(['angular'], function(angular){ "

Swipe right to skip tutorial.

\n" + "
\n" + " \n" + - " \n" + + "\n" + " \n" + "
\n" + "

Subscribe

\n" + - " \n" + + "\n" + "
\n" + "
\n" + "
\n" + @@ -184,72 +185,72 @@ define(['angular'], function(angular){ "

{{entity.name}}

\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "
\n" + - " \n" + + "\n" + "

Swipe right to subscribe or left to pass. If someone subscribes back you match and can chat.

\n" + "
\n" + " \n" + - " \n" + + "\n" + " \n" + "
\n" + "

Capture & Share

\n" + - " \n" + - " \n" + + "\n" + + "\n" + "
\n" + " \n" + - " \n" + - " \n" + + "\n" + + "\n" + " \n" + "

\n" + "
\n" + - " \n" + + "\n" + " \n" + "

\n" + "
\n" + - " \n" + + "\n" + " \n" + "

\n" + "
\n" + - " \n" + + "\n" + " \n" + "

\n" + "
\n" + - " \n" + + "\n" + "
\n" + "
\n" + "
\n" + "

Share great moments and ideas.

\n" + - " \n" + + "\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "

News

\n" + - " \n" + + "\n" + "
\n" + " \n" + " \n" + - " \n" + + "\n" + "

{{story.user}}

\n" + "

now

\n" + - " \n" + + "\n" + "
\n" + - " \n" + + "\n" + "
\n" + "

{{story.message}}

\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + - " \n" + - " \n" + + "\n" + + "\n" + "
\n" + "
\n" + - " \n" + - " \n" + - " \n" + + "\n" + + "\n" + + "\n" + " \n" + "
\n" + "

Discover

\n" + - " \n" + + "\n" + "
\n" + "
\n" + "
\n" + - " \n" + + " \n" + "
\n" + "

Minds

\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "
\n" + - " \n" + + "\n" + "

Vote to make trends.

\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "

Encrypted Chat

\n" + - " \n" + + "\n" + " \n" + " \n" + " \n" + - " \n" + + "\n" + "
\n" + " Hello.\n" + "
\n" + - " \n" + + "\n" + "
\n" + " \n" + " \n" + - " \n" + + "\n" + "
\n" + " Hey!\n" + "
\n" + - " \n" + + "\n" + "
\n" + " \n" + " \n" + - " \n" + + "\n" + "
\n" + " It's great how we can chat without being spied on\n" + "
\n" + - " \n" + + "\n" + "
\n" + " \n" + " \n" + - " \n" + + "\n" + "
\n" + " Yeah! And the app is free and open-source too\n" + "
\n" + - " \n" + + "\n" + "
\n" + "
\n" + - " \n" + + "\n" + "

Message securely with matches.

\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "

Points

\n" + - " \n" + + "\n" + " \n" + - " \n" + + "\n" + "
\n" + " +1\n" + "
\n" + - " \n" + + "\n" + "

Earn points for every vote, comment, remind, swipe, post and upload.

\n" + - " \n" + + "\n" + "
\n" + "
\n" + - " \n" + + "\n" + " \n" + "
\n" + "

Boost

\n" + - " \n" + + "\n" + " \n" + - " \n" + + "\n" + "
Boost\n" + - " \n" + + "\n" + "

Use your points to go viral by boosting to the news feed or other channels.

\n" + - " \n" + + "\n" + "
\n" + " \n" + - " \n" + + "\n" + " \n" + "
\n" + - " \n" + + "\n" + "
\n" + "
\n" + " \n" + "\n" + " \n" + - ""); + "\n" + + ""); $templateCache.put("templates/capture/default.html", "\n" + " \n" +