/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v0.10.0 */ !function(e,t,n){"use strict";function a(e,n,a,i,r,d,o,s){function c(e,n){var i=l.compile(e,n);return e.addClass("md-dragging"),function(e,n,c,l){function m(t){p(e)||(t.stopPropagation(),n.addClass("md-dragging"),h={width:$.prop("offsetWidth")},n.removeClass("transition"))}function u(e){if(h){e.stopPropagation(),e.srcEvent&&e.srcEvent.preventDefault();var t=e.pointer.distanceX/h.width,n=l.$viewValue?1+t:t;n=Math.max(0,Math.min(1,n)),$.css(r.CSS.TRANSFORM,"translate3d("+100*n+"%,0,0)"),h.translate=n}}function g(e){if(h){e.stopPropagation(),n.removeClass("md-dragging"),$.css(r.CSS.TRANSFORM,"");var t=l.$viewValue?h.translate<.5:h.translate>.5;t&&v(!l.$viewValue),h=null}}function v(t){e.$apply(function(){l.$setViewValue(t),l.$render()})}l=l||a.fakeNgModel();var p=d(c.ngDisabled),$=t.element(n[0].querySelector(".md-thumb-container")),f=t.element(n[0].querySelector(".md-container"));o(function(){n.removeClass("md-dragging")}),i(e,n,c,l),t.isDefined(c.ngDisabled)&&e.$watch(p,function(e){n.attr("tabindex",e?-1:0)}),s.register(f,"drag"),f.on("$md.dragstart",m).on("$md.drag",u).on("$md.dragend",g);var h}}var l=e[0];return{restrict:"E",priority:210,transclude:!0,template:'
',require:"?ngModel",compile:c}}t.module("material.components.switch",["material.core","material.components.checkbox"]).directive("mdSwitch",a),a.$inject=["mdCheckboxDirective","$mdTheming","$mdUtil","$document","$mdConstant","$parse","$$rAF","$mdGesture"]}(window,window.angular);