text: !function(){"use strict";function e(e,n){function i(e){n.setGallery(e.ionGalleryItems),n.setRowSize(parseInt(e.ionGalleryRow));var i=function(){e.items=n.buildGallery(),e.responsiveGrid=n.getGridSize()};i(),function(){e.$watch(function(){return e.ionGalleryItems.length},function(t,o){t!==o&&(n.setGallery(e.ionGalleryItems),i())})}()}function t(e,n,i){e.ionSliderToggle="false"===i.ionGalleryToggle?!1:!0}return i.$inject=["$scope"],{restrict:"AE",scope:{ionGalleryItems:"=ionGalleryItems",ionGalleryRow:"=ionGalleryRow"},controller:i,link:t,replace:!0,templateUrl:"gallery.html"}}angular.module("ion-gallery",["templates"]).directive("ionGallery",e),e.$inject=["$ionicPlatform","ionGalleryData"]}(),function(){"use strict";function e(){var e,n,i=3,t=this;t.setGalleryLength=function(n){e=n},this.getGalleryLength=function(){return e},this.setRowSize=function(e){var n=t.getGalleryLength;i=isNaN(e)===!0?3:e>n?n:0>=e?1:e},this.getRowSize=function(){return i},this.setGallery=function(e){n=e,t.setGalleryLength(e.length)},this.getGallery=function(){return n},this.buildGallery=function(){for(var e=this.getGallery(),n=this.getRowSize(),i=[],t=-1,o=0,l=0;l<e.length;l++)l%n===0&&(t++,i[t]=[],o=0),e[l].hasOwnProperty("sub")||(e[l].sub=""),i[t][o]=e[l],o++;return i},this.getGridSize=function(){return parseInt(1/this.getRowSize()*100)}}angular.module("ion-gallery").service("ionGalleryData",e),e.$inject=[]}(),function(){"use strict";function e(){function e(e,n,i){n.bind("load",function(e){this.naturalHeight>this.naturalWidth?n.attr("width","100%"):n.attr("height",n.parent()[0].offsetHeight+"px")})}return{restrict:"A",link:e}}angular.module("ion-gallery").directive("ionImageScale",e),e.$inject=[]}(),function(){"use strict";function e(){function e(e,n,i){n.css("height",n[0].offsetWidth*parseInt(e.$parent.responsiveGrid)/100+"px")}return{restrict:"A",link:e}}angular.module("ion-gallery").directive("ionRowHeight",e),e.$inject=[]}(),function(){"use strict";function e(e,n){function i(i,t,o){var l=!1,a=function(){i.$emit(c()>1?"ZoomStarted":"ZoomOriginal")},r=function(e){l=!0,n(function(){l=!1,i.$emit("DoubleTapEvent",{x:e.gesture.touches[0].pageX,y:e.gesture.touches[0].pageY})},200)},s=function(e){l!==!0&&n(function(){l!==!0&&i.$emit("TapEvent")},200)},c=function(){var e=t[0].getElementsByClassName("scroll")[0].style.webkitTransform.match(/scale\(([^)]+)\)/);return parseFloat(e[1])},u=e.on("pinch",a,t),d=e.on("doubletap",function(e){r(e)},t),g=e.on("tap",s,t);i.$on("$destroy",function(){e.off(d,"doubletap",r),e.off(g,"tap",s),e.off(u,"pinch",a)})}return{restrict:"A",link:i}}angular.module("ion-gallery").directive("ionSlideAction",e),e.$inject=["$ionicGesture","$timeout"]}(),function(){"use strict";function e(e,n,i,t,o){function l(e){function i(){s=!1,c()}var l,a,r=n.getRowSize(),s=!1;e.selectedSlide=1,e.hideAll=!1,e.showImage=function(i,t){e.slides=[],a=i*r+t;var o=n.getGalleryLength(),s=a,c=s-1,u=s+1;0>c&&(c=o-1),u>=o&&(u=0),e.slides[0]=e.ionGalleryItems[c],e.slides[1]=e.ionGalleryItems[s],e.slides[2]=e.ionGalleryItems[u],l=1,e.loadModal()},e.slideChanged=function(i){if(i!==l){var t,r=e.slides.length-l-i,s=n.getGalleryLength();switch(l+">"+i){case"0>1":a++,t=a+1;break;case"1>2":a++,t=a+1;break;case"2>0":a++,t=a+1;break;case"0>2":a--,t=a-1;break;case"1>0":a--,t=a-1;break;case"2>1":a--,t=a-1}0>a&&(a=s-1),a>s&&(a=0),0>t&&(t=s+t),t>=s&&(t-=s),o.$getByHandle("slide-"+r).zoomTo(1),e.slides[r]=e.ionGalleryItems[t],l=i}},e.$on("ZoomStarted",function(n){t(function(){s=!0,e.hideAll=!0})}),e.$on("ZoomOriginal",function(e){t(function(){i()},300)}),e.$on("TapEvent",function(e){t(function(){c()})}),e.$on("DoubleTapEvent",function(e,n){t(function(){u(n)})});var c=function(){return s===!0?(o.$getByHandle("slide-"+l).zoomTo(1,!0),void t(function(){i()},300)):void(e.hasOwnProperty("ionSliderToggle")&&e.ionSliderToggle===!1&&e.hideAll===!1||s===!0||(e.hideAll=!e.hideAll))},u=function(n){s===!1?(o.$getByHandle("slide-"+l).zoomTo(3,!0,n.x,n.y),s=!0,e.hideAll=!0):c()}}function a(n,i,t){var o;n.loadModal=function(){e.fromTemplateUrl("slider.html",{scope:n,animation:"fade-in"}).then(function(e){o=e,n.openModal()})},n.openModal=function(){o.show()},n.closeModal=function(){o.hide()},n.$on("$destroy",function(){o.remove()})}return l.$inject=["$scope"],{restrict:"A",controller:l,link:a}}angular.module("ion-gallery").directive("ionSlider",e),e.$inject=["$ionicModal","ionGalleryData","$ionicPlatform","$timeout","$ionicScrollDelegate"]}(),angular.module("templates",[]).run(["$templateCache",function(e){e.put("gallery.html",'<div class="gallery-view">\n  <div class="row" ng-repeat="item in items track by $index" ion-row-height>\n    <div ng-repeat="photo in item track by $index"\n         class="col col-{{responsiveGrid}} image-container">\n      \n      <img ion-image-scale\n           ng-src="{{photo.src}}"\n           ng-click="showImage({{$parent.$index}},{{$index}})">\n      \n    </div>\n  </div>\n  <div ion-slider></div>\n</div>'),e.put("slider.html",'<ion-modal-view class="blackBackground imageView">\n  <ion-header-bar class="headerView" ng-show="!hideAll">\n    <button class="button button-outline button-light close-btn" ng-click="closeModal()">Done</button>\n  </ion-header-bar>\n    \n  <ion-content class="has-no-header" scroll="false">\n    <ion-slide-box does-continue="true" active-slide="selectedSlide" show-pager="false" class="listContainer" on-slide-changed="slideChanged($index)">\n      <ion-slide ng-repeat="single in slides track by $index">\n        <ion-scroll direction="xy"\n                    locking="false" \n                    zooming="true"\n                    min-zoom="1"\n                    scrollbar-x="false"\n                    scrollbar-y="false"\n                    ion-slide-action\n                    delegate-handle="slide-{{$index}}"\n                    >\n        <div class="item item-image centerPictureVertical gallery-slide-view">\n          <img ng-src="{{single.src}}">\n        </div>\n        <div ng-if="single.sub.length > 0" class="image-subtitle" ng-show="!hideAll">\n            <span ng-bind-html=\'single.sub\'></span>\n        </div>\n        </ion-scroll>\n      </ion-slide>\n    </ion-slide-box>\n  </ion-content>\n</ion-modal-view>')}]);