stratux/web/maui/js/mobile-angular-ui.min.js

2 wiersze
25 KiB
JavaScript
Executable File

!function(){"use strict";function e(t,o){function r(e,t){return function(){return e.apply(t,arguments)}}var i;if(o=o||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=o.touchBoundary||10,this.layer=t,this.tapDelay=o.tapDelay||200,this.tapTimeout=o.tapTimeout||700,!e.notNeeded(t)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],c=this,u=0,l=a.length;l>u;u++)c[a[u]]=r(c[a[u]],c);n&&(t.addEventListener("mouseover",this.onMouse,!0),t.addEventListener("mousedown",this.onMouse,!0),t.addEventListener("mouseup",this.onMouse,!0)),t.addEventListener("click",this.onClick,!0),t.addEventListener("touchstart",this.onTouchStart,!1),t.addEventListener("touchmove",this.onTouchMove,!1),t.addEventListener("touchend",this.onTouchEnd,!1),t.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(t.removeEventListener=function(e,n,o){var r=Node.prototype.removeEventListener;"click"===e?r.call(t,e,n.hijacked||n,o):r.call(t,e,n,o)},t.addEventListener=function(e,n,o){var r=Node.prototype.addEventListener;"click"===e?r.call(t,e,n.hijacked||(n.hijacked=function(e){e.propagationStopped||n(e)}),o):r.call(t,e,n,o)}),"function"==typeof t.onclick&&(i=t.onclick,t.addEventListener("click",function(e){i(e)},!1),t.onclick=null)}}var t=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!t,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!t,r=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),i=o&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;e.prototype.needsClick=function(e){switch(e.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(e.disabled)return!0;break;case"input":if(o&&"file"===e.type||e.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(e.className)},e.prototype.needsFocus=function(e){switch(e.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(e.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!e.disabled&&!e.readOnly;default:return/\bneedsfocus\b/.test(e.className)}},e.prototype.sendClick=function(e,t){var n,o;document.activeElement&&document.activeElement!==e&&document.activeElement.blur(),o=t.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(e),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,e.dispatchEvent(n)},e.prototype.determineEventType=function(e){return n&&"select"===e.tagName.toLowerCase()?"mousedown":"click"},e.prototype.focus=function(e){var t;o&&e.setSelectionRange&&0!==e.type.indexOf("date")&&"time"!==e.type&&"month"!==e.type?(t=e.value.length,e.setSelectionRange(t,t)):e.focus()},e.prototype.updateScrollParent=function(e){var t,n;if(t=e.fastClickScrollParent,!t||!t.contains(e)){n=e;do{if(n.scrollHeight>n.offsetHeight){t=n,e.fastClickScrollParent=n;break}n=n.parentElement}while(n)}t&&(t.fastClickLastScrollTop=t.scrollTop)},e.prototype.getTargetElementFromEventTarget=function(e){return e.nodeType===Node.TEXT_NODE?e.parentNode:e},e.prototype.onTouchStart=function(e){var t,n,i;if(e.targetTouches.length>1)return!0;if(t=this.getTargetElementFromEventTarget(e.target),n=e.targetTouches[0],o){if(i=window.getSelection(),i.rangeCount&&!i.isCollapsed)return!0;if(!r){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return e.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(t)}}return this.trackingClick=!0,this.trackingClickStart=e.timeStamp,this.targetElement=t,this.touchStartX=n.pageX,this.touchStartY=n.pageY,e.timeStamp-this.lastClickTime<this.tapDelay&&e.preventDefault(),!0},e.prototype.touchHasMoved=function(e){var t=e.changedTouches[0],n=this.touchBoundary;return Math.abs(t.pageX-this.touchStartX)>n||Math.abs(t.pageY-this.touchStartY)>n?!0:!1},e.prototype.onTouchMove=function(e){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(e.target)||this.touchHasMoved(e))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},e.prototype.findControl=function(e){return void 0!==e.control?e.control:e.htmlFor?document.getElementById(e.htmlFor):e.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},e.prototype.onTouchEnd=function(e){var t,a,c,u,l,s=this.targetElement;if(!this.trackingClick)return!0;if(e.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(e.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=e.timeStamp,a=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,i&&(l=e.changedTouches[0],s=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||s,s.fastClickScrollParent=this.targetElement.fastClickScrollParent),c=s.tagName.toLowerCase(),"label"===c){if(t=this.findControl(s)){if(this.focus(s),n)return!1;s=t}}else if(this.needsFocus(s))return e.timeStamp-a>100||o&&window.top!==window&&"input"===c?(this.targetElement=null,!1):(this.focus(s),this.sendClick(s,e),o&&"select"===c||(this.targetElement=null,e.preventDefault()),!1);return o&&!r&&(u=s.fastClickScrollParent,u&&u.fastClickLastScrollTop!==u.scrollTop)?!0:(this.needsClick(s)||(e.preventDefault(),this.sendClick(s,e)),!1)},e.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},e.prototype.onMouse=function(e){return this.targetElement?e.forwardedTouchEvent?!0:e.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(e.stopImmediatePropagation?e.stopImmediatePropagation():e.propagationStopped=!0,e.stopPropagation(),e.preventDefault(),!1):!0:!0},e.prototype.onClick=function(e){var t;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===e.target.type&&0===e.detail?!0:(t=this.onMouse(e),t||(this.targetElement=null),t)},e.prototype.destroy=function(){var e=this.layer;n&&(e.removeEventListener("mouseover",this.onMouse,!0),e.removeEventListener("mousedown",this.onMouse,!0),e.removeEventListener("mouseup",this.onMouse,!0)),e.removeEventListener("click",this.onClick,!0),e.removeEventListener("touchstart",this.onTouchStart,!1),e.removeEventListener("touchmove",this.onTouchMove,!1),e.removeEventListener("touchend",this.onTouchEnd,!1),e.removeEventListener("touchcancel",this.onTouchCancel,!1)},e.notNeeded=function(e){var t,o,r,i;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(t=document.querySelector("meta[name=viewport]")){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),r[1]>=10&&r[2]>=3&&(t=document.querySelector("meta[name=viewport]")))){if(-1!==t.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===e.style.msTouchAction||"manipulation"===e.style.touchAction?!0:(i=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],i>=27&&(t=document.querySelector("meta[name=viewport]"),t&&(-1!==t.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===e.style.touchAction||"manipulation"===e.style.touchAction?!0:!1)},e.attach=function(t,n){return new e(t,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return e}):"undefined"!=typeof module&&module.exports?(module.exports=e.attach,module.exports.FastClick=e):window.FastClick=e}(),function(){"use strict";angular.module("mobile-angular-ui.core.activeLinks",[]).run(["$rootScope","$window","$document","$location",function(e,t,n,o){var r=function(){var e,r=o.url(),i=r.indexOf("#"),a=r.indexOf("?"),c=t.location.href,u=c.indexOf(r);-1===i&&-1===a?e=c:-1!==i&&i>a?e=c.slice(0,u+i):-1!==a&&a>i&&(e=c.slice(0,u+a));for(var l=n[0].links,s=0;s<l.length;s++){var d=l[s],f=angular.element(d);f.attr("href")&&""!==f.attr("href")&&d.href===e?f.addClass("active"):f.attr("href")&&""!==f.attr("href")&&d.href&&d.href.length&&f.removeClass("active")}};e.$on("$locationChangeSuccess",r),e.$on("$includeContentLoaded",r)}])}(),function(){"use strict";angular.module("mobile-angular-ui.core.capture",[]).run(["Capture","$rootScope",function(e,t){t.$on("$routeChangeSuccess",function(){e.resetAll()})}]).factory("Capture",["$compile",function(e){var t={};return{resetAll:function(){for(var e in t)t.hasOwnProperty(e)&&this.resetYielder(e)},resetYielder:function(e){var n=t[e];this.setContentFor(e,n.defaultContent,n.defaultScope)},putYielder:function(e,n,o,r){var i={};i.name=e,i.element=n,i.defaultContent=r||"",i.defaultScope=o,t[e]=i},getYielder:function(e){return t[e]},removeYielder:function(e){delete t[e]},setContentFor:function(n,o,r){var i=t[n];i&&(i.element.html(o),e(i.element.contents())(r))}}}]).directive("uiContentFor",["Capture",function(e){return{compile:function(t,n){var o=t.html();return(null===n.uiDuplicate||void 0===n.uiDuplicate)&&(t.html(""),t.remove()),function(t,n,r){e.setContentFor(r.uiContentFor,o,t)}}}}]).directive("uiYieldTo",["$compile","Capture",function(e,t){return{link:function(e,n,o){t.putYielder(o.uiYieldTo,n,e,n.html()),n.on("$destroy",function(){t.removeYielder(o.uiYieldTo)}),e.$on("$destroy",function(){t.removeYielder(o.uiYieldTo)})}}}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.fastclick",[]);e.run(["$window",function(e){function t(e,t){return function(){return e.apply(t,arguments)}}var n=FastClick.prototype.onTouchEnd;FastClick.prototype.onTouchEnd=function(e){e.changedTouches||(e.changedTouches=[{}]),(n=t(n,this))(e)},FastClick.attach(e.document.body)}]),angular.forEach(["select","input","textarea"],function(t){e.directive(t,function(){return{restrict:"E",compile:function(e){e.addClass("needsclick")}}})})}(),function(){"use strict";var e=function(e,t){for(var n=e;n.length>0;){if(n[0]===t[0])return n=null,!0;n=n.parent()}return n=null,!1};angular.module("mobile-angular-ui.core.outerClick",[]).factory("bindOuterClick",["$document","$timeout",function(t,n){return function(o,r,i,a){var c=function(t){e(angular.element(t.target),r)||o.$apply(function(){i(o,{$event:t})})},u=angular.noop,l=null;a?u=o.$watch(a,function(e){n.cancel(l),e?l=n(function(){t.on("click tap",c)},0):t.unbind("click tap",c)}):(n.cancel(l),t.on("click tap",c)),o.$on("$destroy",function(){u(),t.unbind("click tap",c)})}}]).directive("uiOuterClick",["bindOuterClick","$parse",function(e,t){return{restrict:"A",compile:function(n,o){var r=t(o.uiOuterClick),i=o.uiOuterClickIf;return function(t,n){e(t,n,r,i)}}}}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.sharedState",[]);e.factory("SharedState",["$rootScope",function(e){var t={},n={},o={},r={};return{initialize:function(i,a,c){c=c||{};var u=void 0===o[i],l=c.defaultValue,s=c.exclusionGroup;o[i.$id]=o[i.$id]||[],o[i.$id].push(a),n[a]?u&&n[a].references++:(n[a]=angular.extend({},c,{references:1}),e.$broadcast("mobile-angular-ui.state.initialized."+a,l),void 0!==l&&this.setOne(a,l),s&&(r[s]=r[s]||{},r[s][a]=!0)),i.$on("$destroy",function(){for(var c=o[i.$id]||[],u=0;u<c.length;u++){var l=n[c[u]];l.exclusionGroup&&(delete r[l.exclusionGroup][c[u]],0===Object.keys(r[l.exclusionGroup]).length&&delete r[l.exclusionGroup]),l.references--,l.references<=0&&(delete n[c[u]],delete t[c[u]],e.$broadcast("mobile-angular-ui.state.destroyed."+a))}delete o[i.$id]})},setOne:function(o,r){if(void 0!==n[o]){var i=t[o];return t[o]=r,i!==r&&e.$broadcast("mobile-angular-ui.state.changed."+o,r,i),r}console&&console.warn("Warning: Attempt to set uninitialized shared state:",o)},setMany:function(e){angular.forEach(e,function(e,t){this.setOne(t,e)},this)},set:function(e,t){angular.isObject(e)&&angular.isUndefined(t)?this.setMany(e):this.setOne(e,t)},turnOn:function(e){var t=n[e]&&n[e].exclusionGroup;if(t)for(var o=Object.keys(r[t]),i=0;i<o.length;i++){var a=o[i];a!==e&&this.turnOff(a)}return this.setOne(e,!0)},turnOff:function(e){return this.setOne(e,!1)},toggle:function(e){return this.get(e)?this.turnOff(e):this.turnOn(e)},get:function(e){return n[e]&&t[e]},isActive:function(e){return!!this.get(e)},active:function(e){return this.isActive(e)},isUndefined:function(e){return void 0===n[e]||void 0===this.get(e)},has:function(e){return void 0!==n[e]},referenceCount:function(e){var t=n[e];return void 0===t?0:t.references},equals:function(e,t){return this.get(e)===t},eq:function(e,t){return this.equals(e,t)},values:function(){return t}}}]);var t=function(e,t,n,o){n=n||"click tap",t.on(n,function(t){e.$apply(function(){o(e,{$event:t})})})};e.directive("uiState",["SharedState",function(e){return{restrict:"EA",priority:601,link:function(t,n,o){var r=o.uiState||o.id,i=o.uiDefault||o["default"],a=i?t.$eval(i):void 0;e.initialize(t,r,{defaultValue:a,exclusionGroup:o.uiExclusionGroup})}}}]),angular.forEach(["toggle","turnOn","turnOff","set"],function(n){var o="ui"+n[0].toUpperCase()+n.slice(1);e.directive(o,["$parse","$interpolate","SharedState",function(e,r,i){var a=i[n];return{restrict:"A",priority:1,compile:function(c,u){var l=u[o],s=l.match(/\{\{/),d=function(t){var o=l;if(s){var i=r(o);o=i(t)}return"set"===n&&(o=e(o)(t)),o};return function(e,n,o){var r=function(){var t=d(e);return a.call(i,t)};t(e,n,o.uiTriggers,r)}}}}])});var n=function(e){if(!e||""===e)return[];for(var t=e?e.trim().split(/ *, */):[],n=[],o=0;o<t.length;o++){var r=t[o].split(/ *as */);if(r.length>2||r.length<1)throw new Error('Error parsing uiScopeContext="'+e+'"');n.push(r)}return n},o=function(e,t,n){for(var o=0;o<t.length;o++){var r=t[o][0],i=t[o][1]||r;e[i]=r.split(".").reduce(function(e,t){return e[t]},n)}},r=function(e,t,r,i,a,c){var u,l=t[e],s=l.match(/\{\{/);u=s?function(e){var t=c(l),n=a(t(r));return n(e)}:a(l);var d=n(t.uiScopeContext);return function(){var e;return d.length?(e=angular.extend({},i.values()),o(e,d,r)):e=i.values(),u(e)}};e.directive("uiIf",["$animate","SharedState","$parse","$interpolate",function(e,t,n,o){function i(e){var t=e[0],n=e[e.length-1],o=[t];do{if(t=t.nextSibling,!t)break;o.push(t)}while(t!==n);return angular.element(o)}return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(a,c,u,l,s){var d,f,h,m=r("uiIf",u,a,t,n,o);a.$watch(m,function(t){if(t)f||s(function(t,n){f=n,t[t.length++]=document.createComment(" end uiIf: "+u.uiIf+" "),d={clone:t},e.enter(t,c.parent(),c)});else if(h&&(h.remove(),h=null),f&&(f.$destroy(),f=null),d){h=i(d.clone);var n=function(){h=null},o=e.leave(h,n);o&&o.then(n),d=null}})}}}]),e.directive("uiHide",["$animate","SharedState","$parse","$interpolate",function(e,t,n,o){var i="ng-hide",a="ng-hide-animate";return{restrict:"A",multiElement:!0,link:function(c,u,l){var s=r("uiHide",l,c,t,n,o);c.$watch(s,function(t){e[t?"addClass":"removeClass"](u,i,{tempClasses:a})})}}}]),e.directive("uiShow",["$animate","SharedState","$parse","$interpolate",function(e,t,n){var o="ng-hide",i="ng-hide-animate";return{restrict:"A",multiElement:!0,link:function(a,c,u){var l=r("uiShow",u,a,t,n);a.$watch(l,function(t){e[t?"removeClass":"addClass"](c,o,{tempClasses:i})})}}}]),e.directive("uiClass",["SharedState","$parse","$interpolate",function(e,t){return{restrict:"A",link:function(n,o,i){var a=r("uiClass",i,n,e,t);n.$watch(a,function(e){var t="",n="";angular.forEach(e,function(e,r){e?t+=" "+r:n+=" "+r,t=t.trim(),n=n.trim(),t.length&&o.addClass(t),n.length&&o.removeClass(n)})},!0)}}}]),e.run(["$rootScope","SharedState",function(e,t){e.Ui=t}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.core.touchmoveDefaults",[]);e.directive("uiPreventTouchmoveDefaults",function(){var e=function(e){e.allowTouchmoveDefault!==!0&&e.preventDefault()};return{compile:function(t){"ontouchmove"in document&&t.on("touchmove",e)}}}),e.factory("allowTouchmoveDefault",function(){var e=function(){return!0};return"ontouchmove"in document?function(t,n){n=n||e;var o=function(e){n(e)&&(e.allowTouchmoveDefault=!0)};return t=angular.element(t),t.on("touchmove",o),t.on("$destroy",function(){t.off("touchmove",o),t=null}),function(){t&&t.off("touchmove",o)}}:angular.noop})}(),function(){"use strict";angular.module("mobile-angular-ui.core",["mobile-angular-ui.core.fastclick","mobile-angular-ui.core.activeLinks","mobile-angular-ui.core.capture","mobile-angular-ui.core.outerClick","mobile-angular-ui.core.sharedState","mobile-angular-ui.core.touchmoveDefaults"])}(),function(e,t){var n=e.document,o=n.documentElement,r="overthrow-enabled",i="ontouchmove"in n,a="WebkitOverflowScrolling"in o.style||"msOverflowStyle"in o.style||!i&&e.screen.width>800||function(){var t=e.navigator.userAgent,n=t.match(/AppleWebKit\/([0-9]+)/),o=n&&n[1],r=n&&o>=534;return t.match(/Android ([0-9]+)/)&&RegExp.$1>=3&&r||t.match(/ Version\/([0-9]+)/)&&RegExp.$1>=0&&e.blackberry&&r||t.indexOf("PlayBook")>-1&&r&&-1===!t.indexOf("Android 2")||t.match(/Firefox\/([0-9]+)/)&&RegExp.$1>=4||t.match(/wOSBrowser\/([0-9]+)/)&&RegExp.$1>=233&&r||t.match(/NokiaBrowser\/([0-9\.]+)/)&&7.3===parseFloat(RegExp.$1)&&n&&o>=533}();e.overthrow={},e.overthrow.enabledClassName=r,e.overthrow.addClass=function(){-1===o.className.indexOf(e.overthrow.enabledClassName)&&(o.className+=" "+e.overthrow.enabledClassName)},e.overthrow.removeClass=function(){o.className=o.className.replace(e.overthrow.enabledClassName,"")},e.overthrow.set=function(){a&&e.overthrow.addClass()},e.overthrow.canBeFilledWithPoly=i,e.overthrow.forget=function(){e.overthrow.removeClass()},e.overthrow.support=a?"native":"none"}(this),function(e,t){e.overthrow.set()}(this),function(e,t,n){if(t!==n){t.scrollIndicatorClassName="overthrow";var o=e.document,r=o.documentElement,i="native"===t.support,a=t.canBeFilledWithPoly,c=(t.configure,t.set),u=t.forget,l=t.scrollIndicatorClassName;t.closest=function(e,n){return!n&&e.className&&e.className.indexOf(l)>-1&&e||t.closest(e.parentNode)};var s=!1;t.set=function(){if(c(),!s&&!i&&a){e.overthrow.addClass(),s=!0,t.support="polyfilled",t.forget=function(){u(),s=!1,o.removeEventListener&&o.removeEventListener("touchstart",b,!1)};var l,d,f,h,m=[],v=[],p=function(){m=[],d=null},g=function(){v=[],f=null},C=function(e){h=l.querySelectorAll("textarea, input");for(var t=0,n=h.length;n>t;t++)h[t].style.pointerEvents=e},k=function(e,t){if(o.createEvent){var r,i=(!t||t===n)&&l.parentNode||l.touchchild||l;i!==l&&(r=o.createEvent("HTMLEvents"),r.initEvent("touchend",!0,!0),l.dispatchEvent(r),i.touchchild=l,l=i,i.dispatchEvent(e))}},b=function(e){if(t.intercept&&t.intercept(),p(),g(),l=t.closest(e.target),l&&l!==r&&!(e.touches.length>1)){C("none");var n=e,o=l.scrollTop,i=l.scrollLeft,a=l.offsetHeight,c=l.offsetWidth,u=e.touches[0].pageY,s=e.touches[0].pageX,h=l.scrollHeight,b=l.scrollWidth,E=function(e){var t=o+u-e.touches[0].pageY,r=i+s-e.touches[0].pageX,C=t>=(m.length?m[0]:0),E=r>=(v.length?v[0]:0);t>0&&h-a>t||r>0&&b-c>r?e.preventDefault():k(n),d&&C!==d&&p(),f&&E!==f&&g(),d=C,f=E,l.scrollTop=t,l.scrollLeft=r,m.unshift(t),v.unshift(r),m.length>3&&m.pop(),v.length>3&&v.pop()},y=function(e){C("auto"),setTimeout(function(){C("none")},450),l.removeEventListener("touchmove",E,!1),l.removeEventListener("touchend",y,!1)};l.addEventListener("touchmove",E,!1),l.addEventListener("touchend",y,!1)}};o.addEventListener("touchstart",b,!1)}}}}(this,this.overthrow),function(){"use strict";angular.module("mobile-angular-ui.components.modals",[]).directive("modal",["$rootElement",function(e){return{restrict:"C",link:function(t,n){e.addClass("has-modal"),n.on("$destroy",function(){e.removeClass("has-modal")}),t.$on("$destroy",function(){e.removeClass("has-modal")}),n.hasClass("modal-overlay")&&(e.addClass("has-modal-overlay"),n.on("$destroy",function(){e.removeClass("has-modal-overlay")}),t.$on("$destroy",function(){e.removeClass("has-modal-overlay")}))}}}])}(),function(){"use strict";var e=angular.module("mobile-angular-ui.components.navbars",[]);angular.forEach(["top","bottom"],function(t){var n="navbarAbsolute"+t.charAt(0).toUpperCase()+t.slice(1);e.directive(n,["$rootElement",function(e){return{restrict:"C",link:function(n){e.addClass("has-navbar-"+t),n.$on("$destroy",function(){e.removeClass("has-navbar-"+t)})}}}])})}(),function(){"use strict";var e=angular.module("mobile-angular-ui.components.scrollable",["mobile-angular-ui.core.touchmoveDefaults"]),t=function(e){var t=e.touches&&e.touches.length?e.touches:[e],n=e.changedTouches&&e.changedTouches[0]||e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]||t[0].originalEvent||t[0];return n.clientY};e.directive("scrollableContent",function(){return{restrict:"C",controller:["$element","allowTouchmoveDefault",function(e,n){var o=e[0],r=e.parent()[0];if("ontouchmove"in document){var i,a,c,u,l,s=function(e){i=o.scrollTop>0,a=o.scrollTop<o.scrollHeight-o.clientHeight,c=null,u=null,l=t(e)};e.on("touchstart",s),e.on("$destroy",function(){e.off("touchstart")}),n(e,function(e){var n=t(e),o=n>l,r=!o;return l=n,o&&i||r&&a})}this.scrollableContent=o,this.scrollTo=function(e,t){if(t=t||0,angular.isNumber(e))o.scrollTop=e-t;else{var n=angular.element(e)[0];n.offsetParent&&n.offsetParent!==r?this.scrollTo(n.offsetParent,t-n.offsetTop):o.scrollTop=n.offsetTop-t}}}],link:function(e,t){"native"!==overthrow.support&&(t.addClass("overthrow"),overthrow.forget(),overthrow.set())}}}),angular.forEach(["input","textarea"],function(t){e.directive(t,["$rootScope","$timeout",function(e,t){return{require:"?^^scrollableContent",link:function(e,n,o,r){n.on("focus",function(){if(r&&r.scrollableContent){var e=r.scrollableContent.offsetHeight;t(function(){var t=r.scrollableContent.offsetHeight;e>t&&r.scrollTo(n,10)},500)}})}}}])}),angular.forEach({uiScrollTop:function(e){return 0===e.scrollTop},uiScrollBottom:function(e){return e.scrollHeight===e.scrollTop+e.clientHeight}},function(t,n){e.directive(n,[function(){return{restrict:"A",link:function(e,o,r){o.on("scroll",function(){t(o[0])&&e.$apply(function(){e.$eval(r[n])})})}}}])}),angular.forEach({Top:"scrollableHeader",Bottom:"scrollableFooter"},function(t,n){e.directive(t,["$window",function(e){return{restrict:"C",link:function(t,o){var r=o[0],i=o.parent()[0].style,a=function(){var t=e.getComputedStyle(r),o=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10);i["padding"+n]=r.offsetHeight+o+"px"},c=setInterval(a,30);o.on("$destroy",function(){i["padding"+n]=null,clearInterval(c),c=a=o=null})}}}])})}(),function(){"use strict";var e=angular.module("mobile-angular-ui.components.sidebars",["mobile-angular-ui.core.sharedState","mobile-angular-ui.core.outerClick"]);angular.forEach(["left","right"],function(t){var n="sidebar"+t.charAt(0).toUpperCase()+t.slice(1),o="ui"+n.charAt(0).toUpperCase()+n.slice(1);e.directive(n,["$rootElement","SharedState","bindOuterClick","$location",function(e,n,r,i){return{restrict:"C",link:function(a,c,u){var l="has-sidebar-"+t,s="sidebar-"+t+"-visible",d="sidebar-"+t+"-in";u.id&&(o=u.id);var f=function(){n.turnOff(o)},h=function(){return n.isActive(o)};e.addClass(l),a.$on("$destroy",function(){e.removeClass(l),e.removeClass(s),e.removeClass(d)});var m=void 0!==u.active&&"false"!==u.active;n.initialize(a,o,{defaultValue:m}),a.$on("mobile-angular-ui.state.changed."+o,function(t,n){(""===u.uiTrackAsSearchParam||u.uiTrackAsSearchParam)&&i.search(o,n||null),n?(e.addClass(s),e.addClass(d)):e.removeClass(d)}),a.$on("$routeChangeSuccess",function(){n.turnOff(o)}),a.$on("$routeUpdate",function(){u.uiTrackAsSearchParam&&(i.search()[o]?n.turnOn(o):n.turnOff(o))}),a.$on("mobile-angular-ui.app.transitionend",function(){n.isActive(o)||e.removeClass(s)}),"false"!==u.closeOnOuterClicks&&r(a,c,f,h)}}}])}),e.directive("app",["$rootScope",function(e){return{restrict:"C",link:function(t,n){n.on("transitionend webkitTransitionEnd oTransitionEnd otransitionend",function(){e.$broadcast("mobile-angular-ui.app.transitionend")})}}}])}(),function(){"use strict";angular.module("mobile-angular-ui.components.switch",[]).directive("uiSwitch",["$injector",function(e){var t=e.has("$drag")&&e.get("$drag");return{restrict:"EA",scope:{model:"=ngModel",changeExpr:"@ngChange"},link:function(e,n,o){n.addClass("switch");var r=o.disabled||n.attr("disabled"),i=e.$watch(function(){return o.disabled||n.attr("disabled")},function(e){r=e&&"false"!==e&&"0"!==e?!0:!1}),a=angular.element('<div class="switch-handle"></div>');n.append(a),e.model&&n.addClass("active"),n.addClass("switch-transition-enabled");var c=e.$watch("model",function(e){e?n.addClass("active"):n.removeClass("active")}),u=function(){return!r},l=function(t){u()&&t!==e.model&&(e.model=t,e.$apply(),null!==e.changeExpr&&void 0!==e.changeExpr&&e.$parent.$eval(e.changeExpr))},s=function(){l(!e.model)};n.on("click tap",s);var d=angular.noop;t&&(d=t.bind(a,{transform:t.TRANSLATE_INSIDE(n),start:function(){n.off("click tap",s)},cancel:function(){a.removeAttr("style"),n.off("click tap",s),n.on("click tap",s)},end:function(){var e=a[0].getBoundingClientRect(),t=n[0].getBoundingClientRect();e.left-t.left<e.width/3?(l(!1),a.removeAttr("style")):t.right-e.right<e.width/3?(l(!0),a.removeAttr("style")):a.removeAttr("style"),n.on("click tap",s)}})),n.on("$destroy",function(){d(),i(),c(),u=l=d=c=i=s=null})}}}])}(),function(){"use strict";angular.module("mobile-angular-ui.components",["mobile-angular-ui.components.modals","mobile-angular-ui.components.navbars","mobile-angular-ui.components.sidebars","mobile-angular-ui.components.scrollable","mobile-angular-ui.components.switch"])}(),function(){"use strict";angular.module("mobile-angular-ui",["mobile-angular-ui.core","mobile-angular-ui.components"])}();
//# sourceMappingURL=mobile-angular-ui.min.js.map