(function(){"use strict";angular.module("t101SharedModule",["ngTouch","ngResource","angular-cache"]);angular.module("t101SharedModule").config(["$compileProvider",function(n){n.aHrefSanitizationWhitelist(/^\s*(https?|mailto|javascript):/)}]);angular.module("t101SharedModule").config(["$sceDelegateProvider",function(n){n.resourceUrlWhitelist(["self","https://recon-*.t101cdn.net/**",/https?:\/\/[^:\/.?&;]*\.recon\.([^:\/.?&;]*|((dev|alpha|gamma|uat)\.(test|t101.dev)))\/.*/,/https?:\/\/recon\.t101api\.([^:\/.?&;]*|((dev|alpha|gamma|uat)\.(test|t101.dev)))\/.*/])}]);angular.module("t101SharedModule").config(["CacheFactoryProvider",function(n){angular.extend(n.defaults,{maxAge:9e5})}]);angular.module("t101SharedModule").config(["$httpProvider",function(n){n.interceptors.push(["$window","$q",function(n,t){var i=!1;return{responseError:function(r){return r.status===401?(window.t101.SessionIdStorage.clear(),i||(i=!0,n.location.reload()),t.reject(r)):t.reject(r)}}}])}]);angular.module("t101SharedModule").config(["$locationProvider",function(n){n.html5Mode(!0)}])})(),function(){function n(){var n=1,t=t101.helpers.getLanguageFromUrl()||t101.helpers.getLanguageFromCookie(),i="application/vnd.t101.v{0}+json";this.createRequestHeaders=function(r,u){var o,f,e,s;if(r=r||1,o=window.localStorage.getItem("sessionId"),f={Accept:i.format(parseInt(r,10)),"Content-Type":"application/json; charset=utf-8","X-DeviceType":n,"X-Language":t},o&&(f.Authorization="Bearer "+o),u!=undefined)for(e in u)s=u[e],s==null?delete f[e]:f[e]=s;return f}}angular.module("t101SharedModule").service("ApiService",n)}(),function(){"use strict";function n(n,t,i){this.translations=recon_localisation;this.profiles=[];this.loading=!1;this.dataService=n;this.constants=t;this.dialogService=i;this.page=1;this.loadProfiles()}var t=1,i=2;angular.module("t101SharedModule").component("t101BlockedMemberList",{controller:n,bindings:{},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/BlockedMemberList.component.ng-template?"+t101.settings.versionKeyValue},require:{paginableListController:"^^?t101PaginableList"}});n.$inject=["dataService","sharedConstants","dialogService"];n.prototype.loadProfiles=function(){var n=this,t;return this.loading=!0,this.profiles=[],t=(this.page-1)*this.constants.profileListPageSize,t<0&&(t=0),this.dataService.getBlockedMembers(t).then(function(t){if(n.profiles=t.data,n.profileCount=t.headers("X-ListCount"),n.loading=!1,n.paginableListController){if(n.paginableListController.paginatorScope){var i=Math.ceil(n.profileCount/n.constants.profileListPageSize);n.paginableListController.paginatorScope.maxPage=i}n.paginableListController.scope.hidePaginator=n.profileCount==0||n.profileCount==null}})};n.prototype.hasExceededBlockLimit=function(){return this.profileCount>t101.settings.blockMemberLimit};n.prototype.unblock=function(n,t){var i=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.UnblockMemberDialogTitle);this.dialogService.setHtmlContent(recon_localisation.UnblockMemberDialogConfirmation);this.dialogService.setButtons("YesAndNo");this.dialogService.yesFunction=function(){i.dataService.unblock(n).then(function(){i.dialogService.closeDialog();i.profiles.splice(t,1);i.profiles.length==0&&i.paginableListController&&i.paginableListController.setPage(--i.page)}).catch(function(n){i.catchError(n)})};this.dialogService.noFunction=function(){i.dialogService.closeDialog()};this.dialogService.toggleDialog(!0)};n.prototype.unblockAll=function(){var n=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.Unblock);this.dialogService.setHtmlContent(recon_localisation.UnblockAllDialogConfirmation);this.dialogService.setButtons("YesAndNo");this.dialogService.yesFunction=function(){n.dataService.unblockAll().then(function(){n.dialogService.closeDialog();n.loadProfiles()}).catch(function(t){n.catchError(t)})};this.dialogService.noFunction=function(){n.dialogService.closeDialog()};this.dialogService.toggleDialog(!0)};n.prototype.unblockMultiple=function(){var n=this,r;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.UnblockMultipleMembers);r=[{value:t,text:recon_localisation.UnblockAllMembers},{value:i,text:recon_localisation.UnblockAllExceptMessage.format(t101.settings.blockMemberLimit)}];this.dialogService.setMultipleChoiceContent("",r,"<br>");this.dialogService.setButtons("MultipleChoice");this.dialogService.confirmationFunction=function(){var r=parseInt(n.dialogService.getSelectedValue(),10);switch(r){case t:n.dialogService.setTitle(recon_localisation.Unblock);n.dialogService.setHtmlContent(recon_localisation.UnblockAllDialogConfirmation);n.dialogService.setButtons("YesAndNo");n.dialogService.yesFunction=function(){n.dataService.unblockAll().then(function(){n.dialogService.closeDialog();n.loadProfiles()}).catch(function(t){n.catchError(t)})};n.dialogService.noFunction=function(){n.dialogService.closeDialog()};n.dialogService.updateContent();break;case i:n.dialogService.setTitle(recon_localisation.Unblock);n.dialogService.setHtmlContent(recon_localisation.UnblockMultipleConfirmation.format(t101.settings.blockMemberLimit));n.dialogService.setButtons("YesAndNo");n.dialogService.yesFunction=function(){n.dataService.unblockAllExceptLatest().then(function(){n.dialogService.closeDialog();n.loadProfiles()}).catch(function(t){n.catchError(t)})};n.dialogService.noFunction=function(){n.dialogService.closeDialog()};n.dialogService.updateContent()}};this.dialogService.toggleDialog(!0)};n.prototype.catchError=function(n){var t=this;t.dialogService.setTitle(n.data[0].Key);t.dialogService.setHtmlContent(n.data[0].Value);t.dialogService.setButtons("OK");t.dialogService.confirmationFunction=function(){t.dialogService.closeDialog()};t.dialogService.updateContent()};n.prototype.$postLink=function(){var n=this;this.paginableListController&&(this.page=this.paginableListController.scope.page,this.paginableListController.scope.$watch("page",function(t){n.page=t;n.loadProfiles()}))}}(),function(){"use strict";function n(n,t){n.t101KeyPressed=function(n){switch(n.which){case 27:t.$broadcast("escKeyPressed",{});t101.dialog!==undefined&&t101.dialog!==null&&t101.dialog.hide();break;case 37:t.$broadcast("leftArrowKeyPressed",{});break;case 39:t.$broadcast("rightArrowKeyPressed",{})}}}angular.module("t101SharedModule").controller("bodyController",n);n.$inject=["$scope","$rootScope"]}(),function(){"use strict";function n(n,t,i,r){this.$sce=n;this.$element=t;this.$rootScope=i;this.customHeader=r.isSlotFilled("header")}n.prototype.$onInit=function(){this.safeTitle=this.$sce.trustAsHtml(this.title);this.toggleType=this.toggleType||"chevron"};n.prototype.toggle=function(n){if(this.isOpen=arguments.length?!!n:!this.isOpen,this.isOpen){var t=this.$element.siblings("t101-collapsible-panel");angular.forEach(t,function(n){var t=angular.element(n).isolateScope();t&&t.$ctrl&&t.$ctrl.isOpen&&t.$ctrl.toggle()});this.$rootScope.$$phase||this.$rootScope.$apply();this.fixHeight();this.onOpen&&this.onOpen()}else this.onClose&&this.onClose()};n.prototype.fixHeight=function(){var e=this.$element.children(".cp-content"),i=e.children("div").first(),r,u=i.find("t101-collapsible-panel"),n,o,t,s,f;if(u.length){for(t=0,n=0,o=u.length;n<o;n++)s=angular.element(u[n]).children(".cp-content").children("div").first().height(),t=Math.max(t,s);r=i.height()+t}else r=i.height();for(e.css("max-height",r),f=this.$element.parents("t101-collapsible-panel"),n=0;n<f.length;n++)angular.element(f[n]).isolateScope().$ctrl.fixHeight();this.$rootScope.$$phase||this.$rootScope.$apply()};n.prototype.$postLink=function(){var n=this;this.$element.children(".cp-header").on("click",function(){n.toggle();n.$rootScope.$$phase||n.$rootScope.$apply()});this.toggle(!!this.isOpen);window.setTimeout(function(){n.fixHeight()},0)};n.prototype.$onChanges=function(n){n.hasOwnProperty("isOpen")&&this.toggle(n.isOpen.currentValue)};angular.module("t101SharedModule").component("t101CollapsiblePanel",{controller:n,bindings:{title:"@",toggleType:"@?",isOpen:"<?open",onOpen:"&?",onClose:"&?"},transclude:{"switch":"?t101ToggleButton",header:"?t101CustomPanelHeader"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/CollapsiblePanel.ng-template?"+t101.settings.versionKeyValue}});n.$inject=["$sce","$element","$rootScope","$transclude"]}(),function(){"use strict";function n(n){function t(t,i,r){t.$watch(function(n){return n.$eval(r.t101Compile)},function(r){r!==null&&r!==undefined&&(r.$$unwrapTrustedValue&&(r=r.$$unwrapTrustedValue()),i.html(r),n(i.contents())(t))})}return{restrict:"A",link:t}}angular.module("t101SharedModule").directive("t101Compile",n);n.$inject=["$compile"]}(),function(){"use strict";for(var t,u,i={"48x66Fixed":0,"500x500Box":1,"33x24Fixed":2,"150x130Box":3,"78x78Fixed":4,"567x567Box":5,"121x58Fixed":6,"261x125Fixed":7,"36x50Fixed":8,"320x326Cropped":9,"640x652Cropped":10,"66x66Cropped":11,"132x132Cropped":12,"720x720Box":13,"1440x1440Box":14,"255x255Cropped":15,"450x450Cropped":16,"30x30Cropped":17,"60x60Cropped":18,"129x83Fixed":19,"256x167Fixed":20,"484x98Box":21,"464x530Box":22,FullSize:23,"480x490Cropped":24,"100x100Cropped":25,"1080x1080Box":26,"338x338Cropped":27,"46x46Cropped":28},r=[],n=18;n<=100;n++)r.push({value:n,text:n,"default":!1});t=[];u=[1,2,4,5,6,7,8,9,10,13,15,18,19,20,27,30,31,34,36,37,38,39];u.forEach(function(n){t.push({value:n,text:recon_localisation["_"+n+"_title"],"default":!1})});t.sort(function(n,t){return n.text===t.text?0:n.text>t.text?1:-1});angular.module("t101SharedModule").constant("sharedConstants",{get apiBasePath(){return angular.injector(["ng","t101SharedModule"]).get("AppSettings").apiBaseUrl},travelPlansPageSize:8,memberImagePath:t101.settings.paths.memberImages,profileImageBaseUrl:t101.settings.paths.memberImages+i["132x132Cropped"]+"/",profileImageFullSizeBaseUrl:t101.settings.paths.memberImages+i["567x567Box"]+"/",imageClassification:{NotClassified:0,NonSexual:1,Sexual:2,Unacceptable:3,Unsure:4,ForMobile:5},imagePremiumOnly:[2],imageSizes:i,imageDisplaySizes:{UNKNOWN:0,THUMBNAIL:1,LARGE:2},newsfeedTypes:{NEWSSTORY:1,MICRONEWS:2,EVENTADDED:3,CHECKOUTMEMBERS:4,CRUISE:5,EVENTATTENDANCE:6,EVENTPHOTOUPLOAD:7,FRIENDREQUEST:8,MEMBERPHOTOUPLOAD:9,RECOMMENDEDFORYOU:10,WADDONATION:11,SPONSOREDLINK:12,FRIENDREQUESTACCEPTED:13,properties:{1:{jsonName:"News"},2:{jsonName:"MicroNews"},3:{jsonName:"EventAdded"},4:{jsonName:"CheckoutTheseMembers"},5:{jsonName:"Cruise"},6:{jsonName:"EventAttendance"},7:{jsonName:"EventPhotoUpload"},8:{jsonName:"FriendRequest"},9:{jsonName:"MemberPhotoUpload"},10:{jsonName:"RecommendedForYou"},11:{jsonName:"WadDonation"},12:{jsonName:"SponsoredLink"},13:{jsonName:"FriendRequestAccepted"}},supported:[1,2,3,4,5,6,7,8,9,10,11,12,13]},linkTypes:{EXTERNAL:0,EVENT:1,NEWS:2,PROFILE:3},systemNotificationTypes:{NONE:0,SERVICENOTIFICATION:1,PREMIUMMEMBERSHIPEXPIRY:2,PREMIUMMEMBERSHIPEXPIRED:3,STANDARDMEMBERUPGRADE:4,UPLOADPHOTONOTIFICATION:5,NEWMEMBERWELCOME:6,EMAILNOTVERIFIED:7,INVALIDEMAILNOTIFICATION:8,NOTESRETIRING:10},systemNotificationCategories:{NEWMEMBER:1,TEXTAPICALL:2,TEXTONLY:3,TEXTWITHACTION:4,TEXTWITHURL:5},systemNotificationActions:{NONE:0,PROFILES:1,MESSAGES:2,FAVOURITES:3,VISITORS:4,CALENDAR:5,GALLERIES:6,EDITPROFILE:7,MANAGEPHOTOS:8,TRAVELPLANS:9,MEMBERSHIP:10,SETTINGS:11,HELP:12,NOTES:13},systemNotificationRequestTypes:{1:"GET",2:"POST",3:"DELETE"},newsfeedRefreshRate:3e4,newsfeedPageSize:25,friendFavouriteStatus:{None:0,Favourite:1,FavouritePendingFriendRequest:2,Friend:3,RestrictedGuest:10},facebookAppId:"422280324639855",profileListPageSize:30,newsfeedNewAlertPanelDisplayTime:3e3,newsfeedIndividualCruises:3,transparentGif:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",favouritePhotoReferenceType:{Profile:1,Event:2},galleryTypes:{MAIN_PHOTOS:-1,REGULAR:0,HIDDEN:1},galleryNameMaxLength:20,galleryImages:{minNumOnRow:1,maxNumOnRow:8},numMainPhotos:8,keyCodes:{ENTER:13,ESCAPE:27,LEFT:37,RIGHT:39},generalCursorOffset:28,niceScrollConfig:{touchbehavior:!1,cursorcolor:"#292929",cursoropacitymax:.6,cursorwidth:4,horizrailenabled:!1,cursorborder:"1px solid #bababa"},filters:{interests:{options:t},visitorShow:{options:[{value:1,text:recon_localisation.MembersShow,"default":!0},{value:2,text:recon_localisation.MembersDontShow,"default":!1},{value:3,text:recon_localisation.MembersOnlyShow,"default":!1}]},visitorPeriod:{options:[{value:1,text:recon_localisation.MembersHereNow,"default":!1},{value:2,text:recon_localisation.MembersWithinPeriod.format(7),"default":!1},{value:3,text:recon_localisation.MembersWithinPeriod.format(14),"default":!0},{value:4,text:recon_localisation.MembersWithinPeriod.format(30),"default":!1},{value:5,text:recon_localisation.MembersWithinPeriod.format(60),"default":!1},{value:6,text:recon_localisation.MembersWithinPeriod.format(90),"default":!1}]},minAge:{options:r},maxAge:{options:r},dateCreated:{options:[{value:-1,text:recon_localisation.AnyTime,"default":!0},{value:30,text:recon_localisation._1Month,"default":!1},{value:14,text:recon_localisation._14Days,"default":!1},{value:7,text:recon_localisation._7Days,"default":!1},{value:1,text:recon_localisation._24Hours,"default":!1}]},activeWithin:{options:[{value:-1,text:recon_localisation.AnyTime,"default":!0},{value:1,text:recon_localisation._24Hours,"default":!1},{value:7,text:recon_localisation._7Days,"default":!1},{value:14,text:recon_localisation._14Days,"default":!1},{value:30,text:recon_localisation._1Month,"default":!1}]},height:{options:[]}}})}(),function(){"use strict";function n(){this.forceBool=function(n){return!!(angular.isString(n)?/^true$/i.test(n):n)};this.forceInt=function(n){return parseInt(n,10)};this.forceString=function(n){return""+n}}angular.module("t101SharedModule").service("ControllerHelper",n)}(),function(){"use strict";function n(n){return function(t,i){function s(){o=i.apply(u||this,e||[]);u=e=null}function h(){r&&(n.cancel(r),r=null)}function f(){u=this;e=arguments;h();r=n(s,t)}function c(){var n=!!u;return n&&(h(),s()),n}var e,u,o,r;return f.flush=function(){return c()||r||s(),o},f.flushPending=function(){return c(),o},f.cancel=h,f}}angular.module("t101SharedModule").factory("debounce",n);n.$inject=["$timeout"]}(),function(){function n(){function n(n,t,i){function f(t){n.$apply(function(){switch(t.which){case i.keyCodes.ESCAPE:n.closeDialog()}})}function e(u){o();var e=n.dialogService.getViewData();e&&(n.title=e.Title,n.content=e.Content||e.MultipleContent,n.buttonContent=e.ButtonContent,n.showDialog=u,n.dark=!!e.dark,window.setTimeout(function(){r();t.onAfterShow()},0),u?window.setTimeout(function(){angular.element(window).on("keyup",f);angular.element(".t101NgDialogContent").niceScroll(i.niceScrollConfig);angular.element(".t101NgDialogContent").getNiceScroll().show();angular.element(".t101NgDialogContent").getNiceScroll().resize()},400):(angular.element(window).off("keyup",f),angular.element(".t101NgDialogContent").getNiceScroll().hide(),angular.element(".t101NgDialogContent").getNiceScroll().remove()))}function o(){n.showDialog=!1;n.title="";n.content="";n.buttonContent="";document.getElementById("dialog-errors").innerHTML="";angular.element(".t101NgDialogContent").getNiceScroll().remove();angular.element("t101-dialog .nicescroll-rails").remove();$(".t101NgDialog").css("width",360)}function s(){var t=angular.element("#t101DialogBody"),i,r;t.length!==0&&(i=Math.max(0,(window.innerWidth-t.width()-40)/2),r=Math.max(0,(window.innerHeight-t.height()-40)/2),t.css({left:i,top:r}),n.dialogService.needsRedraw=!1,angular.element(".t101NgDialogContent").getNiceScroll().resize())}function r(){var t=angular.element("#t101DialogBody"),r,u,n,i;t.length!==0&&(t.css("width","auto"),t.width(),r=angular.element(".t101NgDialogTitle"),u=r.width(),t.css("width",Math.min(Math.max(u+75,360),angular.element(window).width())),n=angular.element(".t101NgDialogContent"),n.css("height","auto"),i=t.height()-(n.offset().top-t.offset().top)+10,n.css("height",i+"px"),n.css("overflow","hidden"),n.getNiceScroll().resize(),window.setTimeout(function(){var t=n.find("t101-gallery-overview");t.length>0&&t.css("max-height",i-132+"px");t=n.find("t101-gallery-selector .dropdownList");t.length>0&&t.css("max-height",i-132+"px")},0),s())}function u(){n.buttonContent='<img class="spinner" src="/Content/images/spinner.gif" width="40" height="40" />'}function h(){var t=n.dialogService.getViewData();t&&(n.buttonContent=t.ButtonContent)}n.dialogService=t;n.hideCloseButton=t.hideCloseButton;n.staticSitePath=t101.settings.paths.staticSitePath;n.closeText=recon_localisation.Close;n.console=console;n.$watch("dialogService.display",function(t){if(t){angular.element(window).on("resize",r);angular.element(".t101NgDialogContent").getNiceScroll().show();e(t);return}angular.element(window).off("resize",r);angular.element(".t101NgDialogContent").getNiceScroll().hide();n.closeDialog()});n.$watch("dialogService.needsRedraw",function(t){t&&(r(),n.dialogService.needsRedraw=!1)});n.$watch("dialogService.buttonBusy",function(t){t&&(u(),n.dialogService.buttonBusy=!1)});n.$watch("dialogService.resetButtons",function(t){t&&(h(),n.dialogService.resetButtons=!1)});n.$watch("dialogService.contentUpdated",function(n){n&&(t.contentUpdated=!1,e(t.display))});n.$watch("dialogService.hideCloseButton",function(t){n.hideCloseButton=t});n.closeDialog=function(){n.showDialog=!1;o();t.closeDialog()};n.OK=function(){u();t.confirmationFunction(n)};n.Yes=function(){u();t.yesFunction()};n.submit=function(){t.yesFunction()};n.No=function(){u();t.noFunction()}}return{restrict:"E",scope:{dark:"=?"},templateUrl:function(){return"/Scripts/Shared/dialogView.ng-template?"+t101.settings.versionKeyValue},controller:["$scope","dialogService","sharedConstants",n]}}angular.module("t101SharedModule").directive("t101Dialog",n)}(),function(){function n(){function t(){for(var t=Array.prototype.slice.call(arguments),i=t.shift();method=t.shift();)if(!n(i,method))return!1;return!0}function i(){for(var t=Array.prototype.slice.call(arguments),i=t.shift();method=t.shift();)n(i,method)||(i[method]=function(){})}function n(n,t){return typeof n[t]=="function"}return{type:t,forceType:i}}angular.module("t101SharedModule").factory("Duck",n)}(),function(){"use strict";function n(n){function t(t){var i="https://www.facebook.com/v2.5/dialog/share?app_id="+n.facebookAppId,r;i+="&display=popup";i+="&href="+encodeURIComponent(t);i+="&redirect_uri="+encodeURIComponent(t101.settings.paths.siteUrl+"/"+t101_links.Newsfeed+"?wc=1");r=["left=300","top=300","height=290","width=555","menubar=no","toolbar=no","location=no","personalbar=no","status=no","dependent=yes","resizable=yes"];window.open(i+"&sdk=joey&version=v2.5","facebookShare",r.join(","))}return{share:t}}angular.module("t101SharedModule").factory("facebookService",n);n.$inject=["sharedConstants"]}(),function(){"use strict";function n(n,t){function i(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/AcceptFriendRequest?profileId="+i,method:"POST"})}function r(i,r){var u=t.apiBasePath+"/Helpers/ProfileActions/AddFriend?profileId="+i;return r&&(u+="&updateVisibility=true"),n.runHttp({url:u,method:"POST"})}function u(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/RejectFriendRequest?profileId="+i,method:"POST"})}function f(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/RemoveFriend?profileId="+i,method:"POST"})}function e(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/AddToFavourites?profileId="+i,method:"POST"})}function o(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/RemoveFromFavourites?profileId="+i,method:"POST"})}function s(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/DowngradeFriendToFavourite?profileId="+i,method:"POST"})}function h(i){return n.runHttp({url:t.apiBasePath+"/Helpers/ProfileActions/CancelFriendRequest?profileId="+i,method:"POST"})}return{acceptFriend:i,denyFriendRequest:u,addFriend:r,removeFriend:f,addFavourite:e,removeFavourite:o,downgradeFriend:s,cancelFriendRequest:h,OPTION_ADD_FRIEND:1,OPTION_ADD_FAVOURITE:2,OPTION_REMOVE_FRIEND:3,OPTION_REMOVE_FAVOURITE:4,OPTION_REMOVE_COMPLETE:5,OPTION_CANCEL_REQUEST:6,OPTION_CANCEL_AND_REMOVE:7}}angular.module("t101SharedModule").factory("friendActionsService",n);n.$inject=["runner","sharedConstants"]}(),function(){function n(){function t(){return t101.settings.paths.staticSitePath+"Scripts/Shared/donationThumbnail.ng-template?"+t101.settings.versionKeyValue}function n(){return t101.settings.paths.staticSitePath+"Scripts/Shared/mainImageThumbnail.ng-template?"+t101.settings.versionKeyValue}function i(){return t101.settings.paths.staticSitePath+"Scripts/Shared/newImageThumbnail.ng-template?"+t101.settings.versionKeyValue}function r(){return t101.settings.paths.staticSitePath+"Scripts/Shared/blockedMemberThumbnail.ng-template?"+t101.settings.versionKeyValue}function u(u){if(u===undefined||u===null)return n();switch(u){default:case t101.constants.thumbnailMode.Main:return n();case t101.constants.thumbnailMode.WAD:return t();case t101.constants.thumbnailMode.newPhotos:return i();case t101.constants.thumbnailMode.blockedMember:return r()}}function f(n,t){return n===t101.constants.thumbnailMode.WAD?t.profileListItem===undefined||t.profileListItem===null||!t.profileListItem.Promotion:n===t101.constants.thumbnailMode.newPhotos?t.profileListItem.Thumbnails.length<=0:!1}return{restrict:"E",templateUrl:function(n,t){return u(t.mode)},link:function(n,t,i){function u(n,t){var u=null,r,i;if(n===undefined||n===null||n.length<=0||t===undefined||t===null)return null;for(r=0;r<n.length;r++)if((i=n[r],i!==undefined&&i!==null)&&i.Id===t){u=i;break}return u}n.wadLink=t101.settings.paths.wadLink;n.staticSitePath=t101.settings.paths.staticSitePath;var r=i.mode;if(f(r,n)){t.hide();return}n.showWADLanding=function(){t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.MemberListWorldAidsDay,"Member clicked on the World Aids Day Button.")};n.openProfile=function(){var t=n.profileListItem.Id;t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.MemberListProfileViewed,"Member opened a profile from the member list.");getProfileWindowDimensions();newWindowOpen=window.open("/"+profilepage+"?id="+t,t,"resizable=yes,scrollbars=yes,status=0,width="+xWidth+",height="+xHeight);giveWindowFocus(0)};n.getImageSource=function(n,t){if(n===undefined||n===null)return"";var r=t101.settings.paths.siteImages+"xxx.png",i=t101.settings.paths.memberImages+"11/"+n.Id+".jpg";return t?i:n.Classification!==t101.settings.imageClassification.Sexual?i:r};n.hasProfileMainImage=function(){return n.profileListItem.Image!==undefined&&n.profileListItem.Image!==null&&n.profileListItem.Image.Id!==undefined&&n.profileListItem.Image.Id!==null};n.showProfile=function(t){var f,i,r;(getProfileWindowDimensions(),f=n.profileListItem,i=u(n.profileListItem.Thumbnails,t),i!==undefined&&i!==null)&&(r="/profile/"+f.Name,i.IsPrimaryImage&&(i.Id===undefined||i.Id===null)?newWindowOpen=window.open(r,f.Id,"resizable=yes,scrollbars=yes,status=0,width="+xWidth+",height="+xHeight):i.IsPrimaryImage?(r+="&imageId="+i.Id,newWindowOpen=window.open(r,f.Id,"resizable=yes,scrollbars=yes,status=0,width="+xWidth+",height="+xHeight)):i.GalleryId!==undefined&&i.GalleryId!==null&&(r+="&imageId="+i.Id+"&galleryId="+i.GalleryId,newWindowOpen=window.open(r,f.Id,"resizable=yes,scrollbars=yes,status=0,width="+xWidth+",height="+xHeight)),t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.MemberListProfileImageClicked,"Member clicked on a profle image from the member list."),giveWindowFocus(0))};n.isSafeToDisplayImage=function(n,t){return t?!0:n!==t101.settings.imageClassification.Sexual}}}}angular.module("t101SharedModule").directive("t101FunctionalThumbnail",n)}(),function(){function n(){function n(n,t,i){t.on("click",function(){for(var t=i.kpi.split(";"),n=0,r=t.length;n<r;n++)t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis[t[n]])})}return{restrict:"A",link:n}}angular.module("t101SharedModule").directive("kpi",n)}(),function(){"use strict";function n(){return{controller:["$scope","dataService","sessionStorage","$rootScope",t],bindings:{model:"=",disableCache:"@?",onLocationChange:"&?"},templateUrl:t101.settings.paths.staticSitePath+"Scripts/Shared/locationSelector.ng-template?"+t101.settings.versionKeyValue}}function t(n,t,i,r){var u=this;this.translations={world:recon_localisation.World,select:recon_localisation.Select};this.disableCache=this.disableCache==!0;this.$onInit=function(){this.options=[];this.model=this.model||{};this.localValues=JSON.parse(JSON.stringify(this.model));t.getProfileLocationTree().then(function(n){u.options[0]=n.data.Branch1});for(var n=2;this.localValues.hasOwnProperty("branch"+n);n++)(function(n){var r=u.localValues["branch"+n];r&&r>0&&(i.get("location-"+r)&&!u.disableCache?u.options[n]=i.get("location-"+r):t.getLocationLists(r).then(function(t){u.options[n]=t.data;i.set("location-"+r,t.data)}))})(n-1)};this.changedValue=function(){for(var f,n=1;u.localValues.hasOwnProperty("branch"+n);n++)if(!u.model.hasOwnProperty("branch"+n)||u.localValues["branch"+n]!=u.model["branch"+n]){for(u.localValues["branch"+n]&&(function(n){var r=u.localValues["branch"+n];r&&r>0&&(i.get("location-"+r)&&!u.disableCache?u.options[n]=i.get("location-"+r):t.getLocationLists(r).then(function(t){u.options[n]=t.data;i.set("location-"+r,t.data)}))}(n),n++),f=u.options.length;n<=f;n++)delete u.options[n],delete u.localValues["branch"+n];break}if(u.model=JSON.parse(JSON.stringify(u.localValues)),r.$$phase||r.$apply(),this.onLocationChange)this.onLocationChange({location:this.model})};n.$watch("ctrl.model",function(n,t){angular.equals(n,t)||angular.equals(n,u.localValues)||u.$onInit()},!0)}angular.module("t101SharedModule").component("t101LocationSelector",n())}(),function(){"use strict";function n(n,t,i){function r(n,r,u,f){n.friendFlagEnabled=n.friendFlagEnabled==="true"||n.friendFlagEnabled;n.cruiseFlagEnabled=n.cruiseFlagEnabled==="true"||n.cruiseFlagEnabled;n.onlineFlagEnabled=n.onlineFlagEnabled==="true"||n.onlineFlagEnabled;n.newFlagEnabled=n.newFlagEnabled==="true"||n.newFlagEnabled;n.visitorFlagEnabled=n.visitorFlagEnabled==="true"||n.visitorFlagEnabled;n.photoFlagEnabled=n.photoFlagEnabled==="true"||n.photoFlagEnabled;n.messageEnabled=n.messageEnabled==="true"||n.messageEnabled;n.cruiseEnabled=n.cruiseEnabled==="true"||n.cruiseEnabled;n.friendEnabled=n.friendEnabled==="true"||n.friendEnabled;n.showResultCount=n.showResultCount==="true"||n.showResultCount;n.numResults=0;n.profiles=n.profiles||[];n.translations={emptyList:recon_localisation.EmptyListTextNoFilter,members:recon_localisation.SearchResultMembers};n.noResultsMessage=n.noResultsMessage||n.translations.emptyList;f&&(n.plcs=f.scope,n.$watch("plcs.page",function(t){n.page=t;n.loadProfiles()},!0),n.$watch("profileSource",function(n,t){n!==t&&f.setPage(1)}));n.loadProfiles=function(){var r,o,s,e;if(n.profileSource&&(n.page==1&&(f&&f.paginatorScope&&(f.paginatorScope.maxPage=-1),n.numResults=0),!(n.page<1))){n.loading=!0;n.profiles=[];r=null;switch(n.profileSource){case"membernameSearch":o=u.membername;e=(n.page-1)*t.profileListPageSize;r=i.getProfilesByUsername(o,e).then(function(i){var r=parseInt(i.headers("X-ListCount"),10),u=Math.ceil(r/t.profileListPageSize);return f.paginatorScope.maxPage=u,n.numResults=r,i.data});break;case"constraintSearch":n.$attrs=u;n.$watch("$attrs.constraints",function(n,t){n!=t&&f.setPage(1)});s=JSON.parse(u.constraints);e=(n.page-1)*t.profileListPageSize;r=i.getProfilesBySearchCriteria(s,e).then(function(i){var r=parseInt(i.headers("X-ListCount"),10),u=Math.ceil(r/t.profileListPageSize);return f.paginatorScope.maxPage=u,n.numResults=r,i.data})}r&&r.then(function(i){f.scope.hidePaginator=!1;i.length&&i.length<t.profileListPageSize?f.paginatorScope.maxPage=n.page:i.length==0&&(n.page==1&&(f.scope.hidePaginator=!0),f.paginatorScope.maxPage=n.page-1,f.setPage(n.page-1));n.profiles=i;n.loading=!1}).catch(function(){f.scope.hidePaginator=!0;f.paginatorScope.maxPage=0;f.setPage(0);n.profiles=[];n.loading=!1})}}}return{restrict:"E",scope:{profileSource:"@?",profiles:"<?",showTimestamp:"=?",timestampPrefix:"@?",countString:"@?",friendFlagEnabled:"<?friendFlag",cruiseFlagEnabled:"<?cruiseFlag",onlineFlagEnabled:"<?onlineFlag",newFlagEnabled:"<?newFlag",visitorFlagEnabled:"<?visitorFlag",photoFlagEnabled:"<?photoFlag",messageEnabled:"<?messageButton",cruiseEnabled:"<?cruiseButton",friendEnabled:"<?friendButton",showResultCount:"<?",noResultsMessage:"=?",loading:"<?"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/memberList.ng-template?"+t101.settings.versionKeyValue},link:r,require:"^^?t101PaginableList",transclude:{header:"?t101Header"}}}angular.module("t101SharedModule").directive("t101MemberList",n);n.$inject=["profileListService","sharedConstants","searchDataService"]}(),function(){"use strict";function n(){function n(n,i){this.$onInit=function(){this.width=parseInt(this.width,10);this.height=parseInt(this.height,10);this.urlField||(this.urlField="ThumbnailUrl");i.css({width:this.width,height:this.height});var u=angular.element("body").first().scope().isPremium,r="",f=this.img?this.img.Id||this.img.ImageGuid:null;r=this.img&&t(f)?this.img[this.urlField]:n.transparentGif;!u&&this.img&&n.imagePremiumOnly.indexOf(this.img.Classification)!=-1&&(r="/Content/images/xxx.png");this.src=r}}function t(n){return n&&n!="00000000-0000-0000-0000-000000000000"}return{restrict:"E",controller:["sharedConstants","$element",n],controllerAs:"ctrl",bindToController:!0,scope:{img:"=",width:"@?",height:"@?",alt:"@?",urlField:"@?"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/memberPhoto.ng-template?"+t101.settings.versionKeyValue},replace:!0}}angular.module("t101SharedModule").directive("t101MemberPhoto",n)}(),function(){function n(n){function t(n,t,i){t.on("click",function(){n.ctrl.handle(i.metric)})}function i(){this.handle=function(t){t=t.split(";");n.log(t[0],t[1],t[2])}}return{restrict:"A",link:t,controller:i,controllerAs:"ctrl"}}angular.module("t101SharedModule").directive("metric",n);n.$inject=["metricService"]}(),function(){"use strict";function n(){var n=function(n,t,i){Object.defineProperties(this,{type:{value:n},sourceId:{value:t},metricType:{value:i},timestamp:{value:new Date}})};return n.prototype.toServerFormat=function(){return{Type:this.type,SourceId:this.sourceId,Metric:this.metricType,Timestamp:this.timestamp.toISOString()}},n.CLICK=2,n.SHARE=3,n}angular.module("t101SharedModule").factory("metricModel",n)}(),function(){function n(n){function t(t,u,f){t.service=n;n.registerPanel(t,f.id);t.$watch("service.display[id]",function(n){n?i(t):r(t)})}function i(t){var i='<div class="modalOverlay" id="overlay-'+t.id+'"><\/div><div class="modalPanel" id="panel-'+t.id+'"><div class="modalClose" id="modalClose-'+t.id+'"><\/div>';i+=n.getContent(t.id).html();i+="<\/div>";$("body").append(i);$("#overlay-"+t.id).hide().fadeIn(500);$("#panel-"+t.id).animate({top:50},350);$("#overlay-"+t.id).on("click",function(){n.hidePanel(t.id);t.$apply()});$("#modalClose-"+t.id).on("click",function(){n.hidePanel(t.id);t.$apply()});n.onAfterShow()}function r(t){$("#panel-"+t.id).animate({top:-1e3},500);$("#overlay-"+t.id).fadeOut(500,function(){$("#panel-"+t.id).remove();$("#overlay-"+t.id).remove()});n.onClose()}return{restrict:"E",scope:{id:"@"},link:t,template:""}}angular.module("t101SharedModule").directive("t101ModalPanel",n);n.$inject=["modalPanelService"]}(),function(){function n(n){function e(n,i){t[i]=n}function o(i,u){t.hasOwnProperty(i)?r[i]=n(u)(t[i]):console.error("unknown panel")}function s(n){return t.hasOwnProperty(n)?r[n]:console.error("unknown panel")}function h(n){i[n]=!0}function c(n){i[n]=!1;t[n].$$phase||t[n].$apply()}function l(n,i,r){t.hasOwnProperty(n)?t[n][i]=r:console.error("unknown panel")}var t={},r={},i={},u=function(){},f=function(){};return{registerPanel:e,setPanelContent:o,showPanel:h,hidePanel:c,extendScope:l,getContent:s,display:i,onAfterShow:u,onClose:f}}angular.module("t101SharedModule").factory("modalPanelService",n);n.$inject=["$compile"]}(),function(){"use strict";function n(n){this.NotificationService=n;this.translations={title:recon_localisation.WhatAreYouInto,content:recon_localisation.InterestsPromptContent};this.link=t101_links.EditInterests}n.prototype.$onInit=function(){this.NotificationService.setMultipleInterestPopupSeen()};n.$inject=["notificationService"];angular.module("t101SharedModule").component("t101MultipleInterestsPrompt",{controller:n,bindings:{},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/multipleInterestsPrompt.component.ng-template?"+t101.settings.versionKeyValue}})}(),function(){"use strict";function n(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.ngEnter)}),t.preventDefault())})}}angular.module("t101SharedModule").directive("ngEnter",n)}(),function(){"use strict";function n(n){return{restrict:"A",link:function(t,i,r){t101.helpers.isMobileDevice()||t.$watch(r.ngFocusMe,function(t){n(function(){t?i.focus():i.blur()})})}}}angular.module("t101SharedModule").directive("ngFocusMe",n);n.$inject=["$timeout"]}(),function(){"use strict";function n(){return function(n,t){t.on("click",function(n){n.preventDefault()})}}angular.module("t101SharedModule").directive("ngPreventClick",n)}(),function(){"use strict";function n(n){return{restrict:"A",link:function(t,i,r){t.$watch(r.ngScrollOn,function(t){n(function(){t&&jQuery(document).scrollTop(r.ngScrollTo||0)})})}}}angular.module("t101SharedModule").directive("ngScrollOn",n);n.$inject=["$timeout"]}(),function(){"use strict";function n(n,t){var i="Non-assignable model expression: ";return{restrict:"A",link:function(r,u,f){var e=function(t){var r={};if(r.get=n(t),r.set=r.get.assign,!r.set)throw Error(i+t);return r},c=f.ngTarget+"._focusTrigger",o=e(c),v=e(f.ngTarget+".focus");o.set(r,0);v.set(r,function(){o.set(r,1)});r.$watch(c,function(n){n>0&&t(function(){u[0].focus();o.set(r,0)},50)});var l=f.ngTarget+"._blurTrigger",s=e(l),y=e(f.ngTarget+".blur");s.set(r,0);y.set(r,function(){s.set(r,1)});r.$watch(l,function(n){n>0&&t(function(){u[0].blur();s.set(r,0)},50)});var a=f.ngTarget+"._selectTrigger",h=e(a),p=e(f.ngTarget+".select");h.set(r,0);p.set(r,function(){h.set(r,1)});r.$watch(a,function(n){n>0&&t(function(){u[0].select();h.set(r,0)},50)})}}}angular.module("t101SharedModule").directive("ngTarget",n);n.$inject=["$parse","$timeout"]}(),function(){"use strict";function t(){return{restrict:"E",scope:{page:"=?",maxPage:"=?",scroll:"=?",onPaging:"&?",hidePaginator:"<?"},transclude:!0,controller:["$scope","$rootScope",n],templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/paginableList.ng-template?"+t101.settings.versionKeyValue},link:i}}function n(n,t){var r,i,u;this.scope=n;this.scope.brandName=t101.settings.brandName;this.scope.scroll=this.scope.scroll==undefined?!0:!!this.scope.scroll;this.scope.hidePaginator=!!this.scope.hidePaginator;this.scope.controller=this;r=parseInt(t101.helpers.getQueryStringByKey("page"))||1;this.scope.page=r||i.scope.page||1;i=this;u=History.getState().data||{};window.addEventListener("popstate",function(){if(i.scope.onPaging)i.scope.onPaging({page:i.scope.page});t.$$phase||t.$apply()})}function i(){}angular.module("t101SharedModule").directive("t101PaginableList",t);n.prototype.setPage=function(n){if(n&&n!=this.scope.page){this.scope.page=n;this.scope.scroll&&window.scrollTo(0,0);var t=History.getState().data||{};if(t!=={}&&(t.page=n,t.currentPage=n,History.pushState(t,t101.settings.brandName,"?page="+n)),window.gtag("send","pageview","profileList"),t101&&t101.ads&&t101.ads.refreshAdverts&&t101.ads.refreshAdverts(),this.scope.onPaging)this.scope.onPaging({page:this.scope.page})}}}(),function(){"use strict";function n(n){function t(t,i,r,u){function f(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t);o&&n.apply(u,f)}}t.page=parseInt(t.page,10)||1;t.maxPage=parseInt(t.maxPage,10)||-1;var e=t101.helpers.getAreaFromUrl();t.models={page:t.page};u.paginatorScope=t;t.setPage=function(i){var r=t.maxPage>0?n.clamp(i,1,t.maxPage):Math.max(1,i),u=r!=t.models.page;u&&(t.models.page=r,t.setNewPage(r))};t.$watch("page",t.setPage);t.nextPage=function(){t.setPage(t.models.page+1)};t.previousPage=function(){t.setPage(t.models.page-1)};t.pageInputChanged=function(){if(t.models.page!=undefined){var r=t.models.page||1,i=t.maxPage>0?n.clamp(r,1,t.maxPage):Math.max(1,r);t.models.page=i;t.paginator.pageNum.$rollbackViewValue();i!==t.page&&t.setNewPage(i)}};t.setNewPage=function(n){t.page=n;u&&u.setPage(n)};t.stopEnter=function(n){if(n.keyCode===13)return t.pageInputChanged(),n.preventDefault(),n.stopPropagation(),!1};$(document).keyup(f(function(n){n.keyCode===37&&t.models.page>1&&t.previousPage();n.keyCode===39&&t.models.page<t.maxPage&&t.nextPage()},500))}return{restrict:"E",require:"^^?t101PaginableList",scope:{page:"=?",maxPage:"=?"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/paginator.ng-template?"+t101.settings.versionKeyValue},link:t}}angular.module("t101SharedModule").directive("t101Paginator",n);n.$inject=["mathService"]}(),function(){"use strict";angular.module("t101SharedModule").service("pagingService",[function(){this.init=function(n){function t(t){n.skip=n.listSize*n.pageNumber-n.listSize;n.listFunction();t&&jQuery("html, body").scrollTop(0);t101.ads.refreshAdverts()}n.listSize=t101.settings.listSize;n.pageNumber=t101.helpers.getQueryStringByKey("page")||1;n.listType=t101.helpers.getQueryStringByKey("listType");n.listFunction=null;n.pageStateHandler=null;n.totalCount=0;n.totalPages=1;n.skip=0;jQuery(window).on("statechange",function(){n.stateChanged()});return n.getNextPage=function(){if(isNaN(n.pageNumber)&&(n.pageNumber=t101.helpers.getQueryStringByKey("page")||1),n.pageNumber>=n.totalPages){n.pageNumber=n.totalPages;return}n.pageNumber=parseInt(n.pageNumber,10)+1;n.skip=n.listSize*n.pageNumber-n.listSize;t(!0)},n.getPrevPage=function(){if(isNaN(n.pageNumber)&&(n.pageNumber=t101.helpers.getQueryStringByKey("page")||1),n.pageNumber<=1){n.pageNumber=1;return}n.pageNumber=parseInt(n.pageNumber,10)-1;t(!0)},n.clearState=function(){var n=History.getState();n.data={page:null,listType:null};History.pushState(n,t101.settings.brandName,window.location.pathname)},n.stateChanged=function(){function r(){return n.listType&&n.listType.indexOf("search")>-1}function u(){return n.pageStateHandler!==undefined&&n.pageStateHandler!==null}var i=History.getState().data;(t101.helpers.log("state change"),t101.helpers.log(i),i!==undefined&&i!=null)&&(r()&&u()&&n.pageStateHandler()||i.page===n.pageNumber&&i.listType===n.listType||isNaN(i.page)&&n.pageNumber===1||(i.page!==n.pageNumber||i.listType!==undefined&&i.listType!==null)&&(n.pageNumber=isNaN(i.page)?1:parseInt(i.page,10),t(!0)))},n.gotoPage=function(i){isNaN(n.pageNumber)&&(n.pageNumber=t101.helpers.getQueryStringByKey("page")||1);n.pageNumber>n.totalPages&&(n.pageNumber=n.totalPages);n.pageNumber<1&&(n.pageNumber=1);n.pageNumber=parseInt(n.pageNumber,10);t(i);jQuery(".paginationJumpToPage").blur()},n}}])}(),function(){function n(n,t,i){function u(n){if(r.hasOwnProperty(n)){var i=t.defer();return i.resolve(r[n]),i.promise}return e().then(function(){return r.hasOwnProperty(n)?r[n]:null}).catch(function(){return null})}function f(t,u){return r[t]=u,n.runHttp({url:i.apiBasePath+"/Preferences/"+t101.profile.id,data:r,method:"PUT"})}function e(){return n.runHttp({url:i.apiBasePath+"/Preferences/"+t101.profile.id,method:"GET"}).then(function(n){r=n.data})}var r={};return{getPreference:u,updatePreference:f}}n.$inject=["runner","$q","sharedConstants"];angular.module("t101SharedModule").factory("preferencesService",n)}(),function(){"use strict";function n(n,t){function r(i,r){var u=t.defer();return i===undefined||i===null||i<0?setTimeout(function(){u.reject({data:[{Key:"Error",Value:recon_localisation.dialogErrorGeneralText}]})},800):n.runHttp({url:r,method:"POST"}).then(function(n){n.status>=200&&n.status<300?u.resolve(n):u.reject(n)},function(n){u.reject(n)}),u.promise}function e(){var n=t.defer();return n.reject({data:[{Key:"Restricted",Value:recon_localisation.EmailVerificationRequiredText.format(t101.settings.email.supportAddress)}]}),n.promise}var i=angular.injector(["ng","t101SharedModule"]).get("AppSettings").apiBaseUrl,u=this,f=!!angular.element("body").first().scope().isGuest;this.changeFromFriendToFavourite=function(n){return r(n,i+"/Helpers/ProfileActions/DowngradeFriendToFavourite?profileId="+n)};this.cruiseMember=function(n,t){if(f)return e();var u=i+"/Helpers/ProfileActions/CruiseMember?profileId="+n;return t&&(u+="&updatePrefs=true"),r(n,u)};this.addFavourite=function(n){return r(n,i+"/Helpers/ProfileActions/AddToFavourites?profileId="+n)};this.addFriend=function(n){return r(n,i+"/Helpers/ProfileActions/AddFriend?profileId="+n)};this.removeFriend=function(n){return r(n,i+"/Helpers/ProfileActions/RemoveFriend?profileId="+n)};this.removeFavourite=function(n){return r(n,i+"/Helpers/ProfileActions/RemoveFromFavourites?profileId="+n)};this.cancelFriendRequest=function(n){return r(n,i+"/Helpers/ProfileActions/CancelFriendRequest?profileId="+n)};this.getCruiseCount=function(){return n.runHttp({url:i+"/Helpers/Count/Visitors",method:"GET"}).then(function(n){return n.data.WhoCruisedMe})};this.sendRequest=function(n,t){switch(t){case t101.constants.actions.Cruise:return u.cruiseMember(n);case t101.constants.actions.AddFriend:case t101.constants.actions.ChangeFromFavouriteToFriend:return u.addFriend(n);case t101.constants.actions.AddFavourite:return u.addFavourite(n);case t101.constants.actions.RemoveFriend:return u.removeFriend(n);case t101.constants.actions.RemoveFavourite:return u.removeFavourite(n);case t101.constants.actions.ChangeFromFriendToFavourite:return u.changeFromFriendToFavourite(n);case t101.constants.actions.CancelFriendRequest:return u.cancelFriendRequest(n);default:return r(null,"")}}}angular.module("t101SharedModule").service("profileActionService",n);n.$inject=["runner","$q"]}(),function(){"use strict";angular.module("t101SharedModule").service("scopeService",["pagingService",function(n){this.configureScope=function(t){return t=n.init(t),t.totalCount=0,t.ListItems=[],t.showNoResults=!1,t.noResultsMessage=null,t.processSuccessfullResponse=function(n){var i,r;t101.analytics.trackListEvent(t.listType);t.ListItems=n;t.showNoResults=t.ListItems.length===0;i={page:t.pageNumber};t.listType!=null&&(i=jQuery.extend({},i,{listType:t.listType}));(t.location>0||t.listType==="newmembers"||t.listType==="online")&&(i=jQuery.extend({},i,{location:t.location}));t101.helpers.pushHistoryState(i);t.ListItems.length>0&&jQuery("#profileListItems").removeClass("hideProfileList");r=t.totalCount%t.listSize;t.totalPages=Math.floor(t.totalCount/t.listSize)+(r>0?1:0);t.ListItems.length>=0&&t.totalPages===0&&(t.totalPages=1);ui.hideBusy()},t.processFailedResponse=function(n,i){t.ListItems=[];ui.hideBusy();i===400;(i===401||i===403)&&t101.layout.login.show();i===404;i===500},t.displayProfile=function(n,t){return t===undefined||t===null?(viewprofile(n),!1):(viewprofile(n,t),!1)},t.getListCountFromHeaders=function(n){var i=n();if(i["x-listcount"]!==undefined&&i["x-listcount"]!==null)try{t.totalCount=parseInt(i["x-listcount"],10)}catch(r){}},t.displayDialogWithErrorMessages=function(n){var t,r,i,u;if(n!==undefined&&n!==null&&n.length!==0){for(t=null,r=n.length,i=0;i<r;i++)t='<p class="dialogContent">'+n[i].Value+"<\/p>";t!==null&&(u=jQuery("<input />").addClass("actionButton dialogActionButtons").attr("value","OK").attr("type","button").on("click",t101.dialog.hide),t101.dialog.ready(),t101.dialog.setWidth(320),t101.dialog.setTitle(recon_localisation.dialogErrorTitle),t101.dialog.setContent(t),t101.dialog.appendButton(u),t101.dialog.show())}},t.displayDialogWithSuccessTitleAndMessage=function(n,t){var i=jQuery("<input />").addClass("actionButton dialogActionButtons").attr("value","OK").attr("type","button").on("click",t101.dialog.hide);t101.dialog.ready();t101.dialog.setWidth(320);t101.dialog.setTitle(n);t101.dialog.setContent("<p>"+t+"<\/p>");t101.dialog.appendButton(i);t101.dialog.show()},t};this.resetScope=function(n){return n.ListItems=[],n.showNoResults=!1,n.skip=0,n.pageNumber=1,n};this.centerDialog=function(){jQuery(window).resize(function(){t101.dialog.centerNgDialog()});t101.dialog.centerNgDialog()}}])}();angular.module("t101SharedModule").directive("t101Touchend",function(){return{controller:["$scope","$element",function(n,t){function i(i){var r=t.attr("t101-touchend");n.$event=i;n.$apply(r)}t.bind("touchend mouseup",i)}]}}),function(){"use strict";function n(n){function t(t,i){i.on("click",function(){n.setTitle(recon_localisation.DialogUnacceptableContentTitle);var i=recon_localisation.DialogUnacceptableContent.format('<a href="'+t101.settings.paths.photoClassificationArticle+'" target="_blank">'+recon_localisation.ClickHere+"<\/a>");n.setHtmlContent(i);n.setButtons("OK");n.toggleDialog(!0);n.confirmationFunction=n.closeDialog;n.yesFunction=null;n.noFunction=null;t.$apply()});i.css("cursor","pointer")}return{restrict:"A",link:t}}angular.module("t101SharedModule").directive("t101UnacceptableContent",n);n.$inject=["dialogService"]}(),function(){"use strict";function n(n,t,i,r){function f(){return r.getGalleries().then(function(n){return u(n.data)})}function e(n){var t="";return t=n.Name.$$unwrapTrustedValue?n.Name.$$unwrapTrustedValue():n.Name,r.addGallery(t).then(function(n){return u(n.data)})}function o(n){return r.deleteGallery(n.Id)}function s(n){return r.renameGallery(n.Id,n.Name)}function u(n){return angular.isArray(n)||(n=[n]),n.map(function(n){return n.Thumbnail={Id:n.ThumbnailUrl},n.Type=t.galleryTypes.FAVOURITE,new i(n)})}return{getGalleries:f,createGallery:e,deleteGallery:o,updateGallery:s}}angular.module("t101SharedModule").factory("favouriteGalleryService",n);n.$inject=["runner","sharedConstants","GalleryModel","favouritePhotosService"]}(),function(){"use strict";function n(n,t,i,r){function u(n){return r.getPhotosForGallery(n.Id).then(function(n){return n.data.map(function(n){return new i(n)})})}function f(n){return r.deletePhoto(n)}function e(n,t){var i=n.OriginalData;return i.GalleryId=t.Id,r.updateFavouritePhotos([i])}function o(n,t){return r.updateFavouritePhotoPosition(n.OriginalData.Id,t)}return{getImagesForGallery:u,deleteImage:f,moveImage:e,updatePhotoPosition:o}}angular.module("t101SharedModule").factory("favouriteImageService",n);n.$inject=["runner","sharedConstants","PhotoModel","favouritePhotosService"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h){this.Duck=n;this.ControllerHelper=t;this.galleries=[];this.images=[];this.selected={};this.numSelected={};this.placeholders=0;this.currentGallery=null;this.translations=recon_localisation;this.dialogService=i;this.limitService=r;this.theatreOverlayService=u;this.preferencesService=o;this.GalleryModel=s;this.$q=f;this.constants=e;this.$window=h;this.randomMainProfilePicture=!1;this.galleryLoading=!0;this.imageSize=0;this.imageRows=2}angular.module("t101SharedModule").component("t101GalleriesManager",{controller:n,bindings:{galleryService:"<",galleryServiceOptions:"<",imageService:"<",imageServiceOptions:"<",allowAddition:"<",ignoreClassification:"<",allowEditing:"<?",countDisplay:"<?",showTheatreLink:"<?",sortable:"<?",inverseSorting:"<?",limitsKey:"@?"},transclude:{header:"?galleriesHeader",footer:"?galleriesFooter",moremenu:"?moreMenuOptions"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/Photos/galleriesManager.ng-template?"+t101.settings.versionKeyValue}});n.$inject=["Duck","ControllerHelper","dialogService","limitService","theatreOverlayService","$q","sharedConstants","preferencesService","GalleryModel","$window"];n.prototype.$onInit=function(){if(!this.Duck.type(this.galleryService,"getGalleries","createGallery","deleteGallery","updateGallery"))throw new TypeError("Invalid galleryService encountered");if(!this.Duck.type(this.imageService,"getImagesForGallery","deleteImage","moveImage"))throw new TypeError("Invalid imageService encountered");this.allowAddition=this.ControllerHelper.forceBool(this.allowAddition)||!1;this.ignoreClassification=this.ControllerHelper.forceBool(this.ignoreClassification)||!1;this.sortable=this.ControllerHelper.forceBool(this.sortable)||!1;this.inverseSorting=this.ControllerHelper.forceBool(this.inverseSorting)||!1;this.galleryServiceOptions=this.galleryServiceOptions||{};this.imageServiceOptions=this.imageServiceOptions||{};this.limitsKey=this.limitsKey||"Galleries";this.loadGalleries();this.loadProfilePicSettings()};n.prototype.onGalleryChange=function(n){if(n!=this.currentGallery)if(this.currentGallery=n,n)this.loadImages(),this.placeholders=n.Type==this.constants.galleryTypes.MAIN_PHOTOS?this.constants.numMainPhotos:0;else{this.images=[];return}};n.prototype.loadGalleries=function(){var n=this,t=this.currentGallery;return this.galleries=[],this.currentGallery=null,this.images=[],n.galleryService.getGalleries(this.galleryServiceOptions).then(function(i){if(i.length==0&&(n.dialogService.reset(),n.dialogService.setTitle(recon_localisation.dialogFavouritePhotosNoGalleriesHeader),n.dialogService.setHtmlContent(recon_localisation.dialogFavouritePhotosNoGalleriesText),n.dialogService.setButtons("OK"),n.dialogService.toggleDialog(!0),i.push(new n.GalleryModel({Name:recon_localisation.dialogFavouritePhotosDefaultGallery,Type:n.constants.galleryTypes.HIDDEN}))),n.galleries=i,t&&(n.currentGallery=t),!n.currentGallery&&n.galleries.length||i.findIndex(function(t){return t.Id==n.currentGallery.Id})==-1)n.onGalleryChange(n.galleries[0])})};n.prototype.loadImages=function(){var n=this;return this.galleryLoading=!0,this.imageService.getImagesForGallery(this.currentGallery,this.imageServiceOptions).then(function(t){n.images=t;n.theatreOverlayService.setImages(n.viewableImages());n.galleryLoading=!1;n.onResize()})};n.prototype.viewableImages=function(){var n=this;return this.images.filter(function(t){return n.ignoreClassification&&!t.Hidden?!0:!t.Hidden&&t.Viewable})};n.prototype.onAfterAdd=function(){var n=this;this.loadGalleries().then(function(){n.loadImages()})};n.prototype.onAfterDelete=function(){var n=this;this.loadGalleries().then(function(){n.loadImages()})};n.prototype.onOrderChange=function(n,t){var r,i;return r=this.currentGallery.Type==this.constants.galleryTypes.MAIN_PHOTOS?this.imageService.updateMainPhotoPosition(n,t):this.imageService.updatePhotoPosition(n,t),i=this,r.then(function(){i.theatreOverlayService.setImages(i.viewableImages())})};n.prototype.onSelectedChange=function(n){var t,i;this.selected=n;this.numSelected={};for(t in this.selected){this.numSelected[t]=0;for(i in this.selected[t])this.numSelected[t]++}};n.prototype.addGallery=function(){var n=this;this.limitService.getLimits(this.limitsKey).then(function(t){n.dialogService.reset();t.Remaining>0?(n.dialogService.setButtons("Save"),n.dialogService.setTitle(recon_localisation.dialogAddGalleryDialogHeader),n.dialogService.setHtmlContent('<fieldset style="margin-top: 0;"><label>'+recon_localisation.dialogAddGalleryDialogText1+'<br><input type="text" minlength="1" maxlength="20" id="new_gallery_name" required inputmode="latin" style="width: 100%;"><\/label>'+recon_localisation.dialogAddGalleryDialogText2+'<\/fieldset><p id="dialog-errors" class="error" style="margin-bottom: 0;"><\/p>'),n.dialogService.confirmationFunction=function(){var t=document.getElementById("new_gallery_name").value.trim();if(t=="")return document.getElementById("dialog-errors").innerHTML=recon_localisation.ErrorGalleryNameRequired,n.dialogService.resetSpinner(),!1;n.galleryService.createGallery({Name:t}).then(function(t){n.loadGalleries().then(function(){n.onGalleryChange(t[0])});n.dialogService.closeDialog()}).catch(function(t){for(var i="",r=0,u;u=t.data[r];r++)i+=u.Value+"<br>";document.getElementById("dialog-errors").innerHTML=i;n.dialogService.resetSpinner()})},n.dialogService.onAfterShow=function(){var t=angular.element("#new_gallery_name");t.on("keyup",function(t){t.keyCode==n.constants.keyCodes.ENTER&&(n.dialogService.showSpinner(),n.dialogService.confirmationFunction())});t.focus()}):(n.dialogService.setButtons("OK"),n.dialogService.setHtmlContent(recon_localisation.onAddGalleryCompleteTooManyGalleries));n.dialogService.toggleDialog(!0)})};n.prototype.deleteGallery=function(){var n=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.dialogDeleteGalleryDialogHeader);this.dialogService.setHtmlContent(recon_localisation.dialogDeleteGalleryDialogText.format(this.currentGallery.Name));this.dialogService.setButtons("YesAndNo");this.dialogService.noFunction=this.dialogService.closeDialog;this.dialogService.yesFunction=function(){n.galleryService.deleteGallery(n.currentGallery).then(function(){n.currentGallery=null;n.loadGalleries();n.dialogService.closeDialog()})};this.dialogService.toggleDialog(!0)};n.prototype.renameGallery=function(){var n=this,t;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.dialogRenameGalleryDialogHeader);t="<fieldset><label>";t+=recon_localisation.dialogRenameGalleryDialogText1;t+='<input id="new_gallery_name" value="'+this.currentGallery.Name+'" maxlength="'+n.constants.galleryNameMaxLength+'" /><\/label>';t+=recon_localisation.dialogRenameGalleryDialogText2;t+="<\/fieldset>";this.dialogService.setHtmlContent(t);this.dialogService.setButtons("OK");this.dialogService.confirmationFunction=function(){var i=n.currentGallery.Name,t=document.getElementById("new_gallery_name").value.trim();if(t=="")return document.getElementById("dialog-errors").innerHTML=recon_localisation.ErrorGalleryNameRequired,n.dialogService.resetSpinner(),!1;n.currentGallery.Name=t;n.galleryService.updateGallery(n.currentGallery).then(function(){n.loadGalleries().then(function(){n.loadImages()});n.dialogService.closeDialog()}).catch(function(t){var r,u,f;for(n.currentGallery.Name=i,r="",u=0;f=t.data[u];u++)r+=f.Value+"<br>";document.getElementById("dialog-errors").innerHTML=r;n.dialogService.resetSpinner()})};this.dialogService.onAfterShow=function(){var t=angular.element("#new_gallery_name");t.focus();t[0].setSelectionRange&&t[0].setSelectionRange(n.constants.galleryNameMaxLength,n.constants.galleryNameMaxLength);t.on("keyup",function(t){t.keyCode==n.constants.keyCodes.ENTER&&(n.dialogService.showSpinner(),n.dialogService.confirmationFunction())})};this.dialogService.toggleDialog(!0)};n.prototype.openTheatre=function(){var n=this,t=0;this.selected&&this.currentGallery&&this.selected.hasOwnProperty(this.currentGallery.Id)&&this.selectedNum()>0&&angular.forEach(this.viewableImages(),function(i,r){t>0||n.selected[n.currentGallery.Id].hasOwnProperty(i.OriginalData.Id)&&n.selected[n.currentGallery.Id][i.OriginalData.Id]&&(t=r)});this.theatreOverlayService.openTheatreWithIndex(t)};n.prototype.deletePhotos=function(n){if(this.selectedNum()==0)return this.showSelectionAlert(n);var t=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.dialogDeleteThumbnailDialogHeader);this.dialogService.setHtmlContent(this.currentGallery.Type==this.constants.galleryTypes.MAIN_PHOTOS?recon_localisation.dialogDeleteThumbnailDialogText:recon_localisation.dialogDeleteFavouriteImageText);this.dialogService.setButtons("YesAndNo");this.dialogService.noFunction=this.dialogService.closeDialog;this.dialogService.yesFunction=function(){var n=[];t.selected&&t.currentGallery&&t.selected.hasOwnProperty(t.currentGallery.Id)&&t.selectedNum()>0&&angular.forEach(t.selected[t.currentGallery.Id],function(i,r){if(i){t.findImage(r).Processing=!0;var u=function(n){return function(){t.images.splice(t.findImageIndex(n),1)}}(r),f=t.imageService.deleteImage(r).then(u);n.push(f)}});t.$q.all(n).then(function(){t.dialogService.closeDialog();t.selected={};t.loadGalleries().then(function(){return t.loadImages()})})};this.dialogService.toggleDialog(!0)};n.prototype.deleteMainPhotos=function(n){if(this.selectedNum()==0)return this.showSelectionAlert(n);var t=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.dialogDeleteThumbnailDialogHeader);this.dialogService.setHtmlContent(recon_localisation.dialogDeleteThumbnailDialogText);this.dialogService.setButtons("YesAndNo");this.dialogService.noFunction=this.dialogService.closeDialog;this.dialogService.yesFunction=function(){var n=[];t.selected&&t.currentGallery&&t.selected.hasOwnProperty(t.currentGallery.Id)&&t.selectedNum()>0&&angular.forEach(t.selected[t.currentGallery.Id],function(i,r){i&&(t.findImage(r).Processing=!0,n.push(r))});n.length&&t.imageService.removeFromPrimaryImages(n).then(function(){t.dialogService.closeDialog();t.selected={};t.loadGalleries().then(function(){return t.loadImages()})})};this.dialogService.toggleDialog(!0)};n.prototype.movePhotos=function(n){if(this.galleries.length<2)return!1;if(this.selectedNum()==0)return this.showSelectionAlert(n);var t=this;t.galleryService.getGalleries({includeMainPhotosGallery:!1}).then(function(n){var i=n.filter(function(n){return n.Id!=t.currentGallery.Id}).reduce(function(n,t){return n+'<div class="dialog-gallery" data-move-to="'+t.Id+'" style="cursor: pointer;"><img src="'+t.Thumbnail.DisplayUrl+'" alt="" /><div class="label"><p class="title">'+t.Name+'<\/p><p class="summary">'+t.Count+" "+recon_localisation[t.Count==1?"PhotoWord":"PhotosWord"]+"<\/p><\/div><\/div>"},'<div style="width: 320px; max-width: 100%;">');t.dialogService.reset();t.dialogService.setTitle(recon_localisation.MoveTo);t.dialogService.setHtmlContent(i+'<div style="clear: both;"><\/div><\/div>');t.dialogService.setButtons("Empty");t.dialogService.onAfterShow=function(){angular.element("[data-move-to].dialog-gallery").on("click",function(){var r=this,i=[];angular.forEach(n,function(n){n.Id==angular.element(r).data("moveTo")&&angular.forEach(t.selected[t.currentGallery.Id],function(r,u){var f,e;r&&(f=t.findImage(u),f.Processing=!0,e=t.imageService.moveImage(f,n).then(function(){t.images.splice(t.findImageIndex(u),1)}),i.push(e))})});t.dialogService.closeDialog();t.$q.all(i).then(function(){t.selected={};t.loadGalleries().then(function(){t.loadImages()})})})};t.dialogService.toggleDialog(!0)})};n.prototype.changeMainPhotoPref=function(){this.preferencesService.updatePreference("RandomisePrimaryImage",this.randomMainProfilePicture)};n.prototype.loadProfilePicSettings=function(){var n=this;this.preferencesService.getPreference("RandomisePrimaryImage").then(function(t){n.randomMainProfilePicture=t})};n.prototype.selectedNum=function(){var n=0;return this.selected&&this.currentGallery&&this.selected.hasOwnProperty(this.currentGallery.Id)&&angular.forEach(this.selected[this.currentGallery.Id],function(t){t&&n++}),n};n.prototype.findImageIndex=function(n){return this.images.findIndex(function(t){return t.Id==n||t.OriginalData.Id==n})};n.prototype.findImage=function(n){return this.images.find(function(t){return t.Id==n||t.OriginalData.Id==n})};n.prototype.showSelectionAlert=function(n){var i=angular.element(".pointerAlert"),t;i.fadeOut(500,function(){i.remove()});t=angular.element(document.createElement("div"));t.addClass("pointerAlert");t.html(recon_localisation.SelectAPhoto);t.css({position:"absolute",top:Math.max(n.pageY-this.constants.generalCursorOffset,0),left:n.pageX});t.hide();angular.element("body").append(t);t.fadeIn(500);window.setTimeout(function(){t.fadeOut(500,function(){t.remove()})},3500)};n.prototype.needsFixedHeader=function(){var t;if(this.imageSize==0)return!0;var i=angular.element(".gallery-manager-header")[0].offsetHeight,r=parseInt(angular.element(".gallery-manager-header").css("padding-top")),u=this.imageRows*this.imageSize,f=angular.element("footer")[0].offsetHeight,n=i+u+f;return r==0&&(n+=88),t=angular.element(window).height(),t<n?!1:!0};n.prototype.onResize=function(){var t=angular.element("t101-gallery-overview"),n=angular.element(".gallery-manager-header"),i=angular.element("#PageContent");this.needsFixedHeader()?(t.css("margin-top",n[0].offsetHeight-78),n.css({width:i[0].offsetWidth,position:"fixed","padding-top":78})):(n.css({padding:0,position:"relative"}),t.css({"margin-top":0}))};n.prototype.$postLink=function(){angular.element("t101-gallery-overview, galleries-footer").css("opacity",0);var n=this;angular.element(this.$window).on("resize",function(){n.onResize()});this.$window.setTimeout(function(){n.onResize();angular.element("t101-gallery-overview, galleries-footer").css("opacity",1)},400)}}(),function(){"use strict";function n(n,t){return function(i){i!=null&&Object.defineProperties(this,{Id:{value:i.Id||0,enumerable:!0},Name:{value:i.Name||"",enumerable:!0,writable:!0},Thumbnail:{value:new n(i.Thumbnail||null),enumerable:!0,writable:!0},Count:{value:i.TotalPhotos||i.Count||0,enumerable:!0},Type:{value:i.Type,enumerable:!0},Deletable:{get:function(){return this.Type!==t.galleryTypes.MAIN_PHOTOS&&this.Type!==t.galleryTypes.HIDDEN}},Renamable:{get:function(){return this.Type!==t.galleryTypes.MAIN_PHOTOS&&this.Type!==t.galleryTypes.HIDDEN}}})}}angular.module("t101SharedModule").factory("GalleryModel",n);n.$inject=["PhotoModel","sharedConstants"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l,a){this.images=this.images||[];this.allowAddition=n.forceBool(this.allowAddition);this.ignoreClassification=n.forceBool(this.ignoreClassification);this.keepSelection=n.forceBool(this.keepSelection);this.sortable=n.forceBool(this.sortable);this.adultUpgradeDialog=n.forceBool(this.adultUpgradeDialog);this.inverseSorting=n.forceBool(this.inverseSorting);this.mainSelection=n.forceBool(this.mainSelection);this.placeholders=n.forceInt(this.placeholders)||0;this.minImageSize=n.forceInt(this.minImageSize)||60;this.galleryLoading=n.forceBool(this.galleryLoading);this.noScroll=n.forceBool(this.noScroll);this.enforceMinHeight=!this.noEnforceMinHeight;this.$window=t;this.$element=r;this.$rootScope=a;this.dialogService=u;this.modalPanelService=f;this.MathService=e;this.arrayService=o;this.constants=s;this.limitService=h;this.ApiService=c;this.$timeout=l;this.translations=recon_localisation;this.selected={};var v=this;this.$onChanges=function(t){var i,r;if(t.images){if(v.updateImageSizes(),v.keepSelection){if(v.gallery&&v.selected.hasOwnProperty(v.gallery.Id))for(i in v.selected[v.gallery.Id])r=v.images.find(function(n){return n.Id==i}),r&&v.selected[v.gallery.Id][i]&&(r.Selected=!0)}else v.selected={},v.onSelectedChange&&v.onSelectedChange();v.$postLink()}t.allowAddition&&(this.allowAddition=n.forceBool(this.allowAddition));t.ignoreClassification&&(this.ignoreClassification=n.forceBool(this.ignoreClassification));t.placeholders&&(this.placeholders=n.forceInt(this.placeholders)||0);t.minImageSize&&(this.minImageSize=n.forceInt(this.minImageSize)||60)}}angular.module("t101SharedModule").component("t101GalleryOverview",{controller:n,bindings:{gallery:"<",images:"<",imageService:"<",allowAddition:"<?",placeholders:"<?",ignoreClassification:"<?",minImageSize:"<?",keepSelection:"<?",onAfterAdd:"&?",onAfterDelete:"&?",onSelectedChange:"&?",openTheatreWithIndex:"&?",onOrderChange:"&?",markAdult:"<?",mainSelection:"<?",sortable:"<?",inverseSorting:"<?",adultUpgradeDialog:"<?",noEnforceMinHeight:"<?",galleryLoading:"<?",noScroll:"<?"},require:{manager:"?^^t101-galleries-manager"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/Photos/galleryOverview.ng-template?"+t101.settings.versionKeyValue}});n.$inject=["ControllerHelper","$window","debounce","$element","dialogService","modalPanelService","mathService","arrayService","sharedConstants","limitService","ApiService","$timeout","$rootScope"];n.prototype.updateImageSizes=function(){var u=this.$element.width(),n=Math.floor((u+1)/(this.minImageSize+1)),r,t,i,f;for(n=this.MathService.clamp(n,this.constants.galleryImages.minNumOnRow,this.constants.galleryImages.maxNumOnRow),r=(u-(n-1))/n,this.manager&&(this.manager.imageSize=r),this.$element.find("li").css("width",r+"px"),t=this.constants.galleryImages.maxNumOnRow;t>0;t--)this.$element.find("li:nth-child("+n+"n+"+t+")").css("margin-right",t==n?"0":"1px");i=this.images.length;i<this.placeholders&&(i=this.placeholders);this.allowAddition&&(i+=1);f=Math.ceil(i/n);this.enforceMinHeight&&this.$element.css("min-height",Math.min(3,f)*r+"px")};n.prototype.addImage=function(){if(this.allowAddition)switch(this.gallery.Type){case this.constants.galleryTypes.MAIN_PHOTOS:this.selectMainPhoto();break;case this.constants.galleryTypes.REGULAR:case this.constants.galleryTypes.HIDDEN:this.addNewPhoto();break;default:return}};n.prototype.onDoubleClick=function(n){var t=this,u,i,r;n.Hidden?(this.dialogService.reset(),this.dialogService.setTitle(recon_localisation.dialogFavouritePhotoRemovedHeader),this.dialogService.setHtmlContent(recon_localisation.dialogFavouritePhotoRemovedText),this.dialogService.setButtons("YesAndNo"),this.dialogService.noFunction=this.dialogService.closeDialog,this.dialogService.yesFunction=function(){n.Processing=!0;t.imageService.deleteImage(n.OriginalData.Id).then(function(){t.onAfterDelete()});t.dialogService.closeDialog()},this.dialogService.toggleDialog(!0)):!this.adultUpgradeDialog||this.ignoreClassification||n.Viewable?this.openTheatreWithIndex&&(i=this.manager?this.manager.viewableImages():this.images,r=i.indexOf(i.filter(function(t){return t.OriginalData.Id==n.OriginalData.Id})[0]),r>-1&&this.openTheatreWithIndex({index:r})):(this.dialogService.reset(),this.dialogService.setTitle(recon_localisation.upgradeAccountTitle),this.dialogService.setHtmlContent(recon_localisation.upgradeAccountMessage),u='<a href="/Account" class="actionButton dialogActionButtons">'+recon_localisation.UpgradeNow+"<\/a>",this.dialogService.setButtons("Custom",u),this.dialogService.toggleDialog(!0))};n.prototype.toggleSelected=function(n,t){var i=this,u,f,r;if(this.selected.hasOwnProperty(this.gallery.Id)||(this.selected[this.gallery.Id]={}),this.selected[this.gallery.Id][n.OriginalData.Id])return n.Selected=!1,this.selected[this.gallery.Id][n.OriginalData.Id]=!1,this.onSelectedChange&&this.onSelectedChange({selected:this.selected});if(this.mainSelection&&(u=0,angular.forEach(this.selected,function(n){angular.forEach(n,function(n){n&&u++})}),u>=this.constants.numMainPhotos))return!1;if(this.selected[this.gallery.Id][n.OriginalData.Id]=!0,this.mainSelection&&[this.constants.imageClassification.NotClassified,this.constants.imageClassification.Unsure].indexOf(n.Classification)!=-1){this.modalPanelService.setPanelContent("galleryManager-modalPanel","<div><p>"+recon_localisation.dialogMoveThumbnailDialogText+'<\/p><p><a class="actionButton dialogActionButtons" id="no-adult">'+recon_localisation.No+'<\/a><a class="actionButton dialogActionButtons" id="yes-adult">'+recon_localisation.Yes+"<\/a><\/p><\/div>");this.modalPanelService.showPanel("galleryManager-modalPanel");this.modalPanelService.onAfterShow=function(){angular.element("#no-adult").on("click",function(){i.selected[i.gallery.Id][n.OriginalData.Id]=!0;n.Selected=!0;i.onSelectedChange&&i.onSelectedChange({selected:i.selected});i.modalPanelService.hidePanel("galleryManager-modalPanel")});angular.element("#yes-adult").on("click",function(){i.selected[i.gallery.Id][n.OriginalData.Id]=!1;n.Selected=!1;n.Classification=i.constants.imageClassification.Sexual;i.modalPanelService.hidePanel("galleryManager-modalPanel")})};return}this.mainSelection&&n.Adult&&(f=angular.element(".pointerAlert"),f.fadeOut(500,function(){f.remove()}),r=angular.element(document.createElement("div")),r.addClass("pointerAlert"),r.html(recon_localisation.onGetThumbnailsComplete),r.css({position:"absolute",top:Math.max(t.pageY-this.constants.generalCursorOffset,0),left:t.pageX}),r.hide(),angular.element("body").append(r),r.fadeIn(500),window.setTimeout(function(){r.fadeOut(500,function(){r.remove()})},3500),this.selected[this.gallery.Id][n.Id]=!1);n.Selected=this.selected[this.gallery.Id][n.OriginalData.Id];this.onSelectedChange&&this.onSelectedChange({selected:this.selected})};n.prototype.selectMainPhoto=function(){var n=this;this.dialogService.reset();this.dialogService.setTitle(recon_localisation.SelectPhotos);this.dialogService.setHtmlContent("<t101-main-photo-selector><\/t101-main-photo-selector>");this.dialogService.setButtons("Empty");this.dialogService.toggleDark();this.dialogService.onAfterShow=function(){n.dialogService.forceRedraw()};this.dialogService.confirmationFunction=function(){n.dialogService.closeDialog();n.onAfterAdd&&n.onAfterAdd()};this.dialogService.toggleDialog(!0)};n.prototype.addNewPhoto=function(){var n=this,r;if(!window.FileList||!window.FileReader){setTimeout(function(){n.dialogService.reset();n.dialogService.setTitle(recon_localisation.displayUploadErrorGeneral);n.dialogService.setHtmlContent(recon_localisation.UnsupportedBrowser);n.dialogService.setButtons("OK");n.dialogService.toggleDialog(!0);n.$rootScope.$$phase||n.$rootScope.$apply()},0);return}var t=angular.element("#new-image"),i=0,u=angular.injector(["ng","t101SharedModule"]).get("AppSettings").apiBaseUrl;t.replaceWith(t.val("").clone(!0));r=new qq.FineUploaderBasic({autoUpload:!0,debug:!1,validation:{sizeLimit:t101.settings.imageSizes.maxFileSize,stopOnFirstInvalidFile:!1,acceptFiles:"image/*",allowedExtensions:["jpg","jpeg","gif","png","bmp"],image:{minWidth:t101.settings.imageSizes.minWidth,minHeight:t101.settings.imageSizes.minHeight}},request:{inputName:"FileName",params:{galleryId:this.gallery.Id,isWebUpload:!0},endpoint:u+"/ProfileImage",customHeaders:n.ApiService.createRequestHeaders(2,{"Content-Type":null})},deleteFile:{enabled:!0,endpoint:u+"/ProfileImage"},messages:{typeError:recon_localisation.displayQueueErrorInvalidType,tooManyItemsError:recon_localisation.displayQueueErrorQueueLimitExceeded,sizeError:recon_localisation.displayQueueErrorSizeLimit,minHeightImageError:recon_localisation.PhotoNotMinimumSize.format(t101.settings.imageSizes.minWidth,t101.settings.imageSizes.minHeight),minWidthImageError:recon_localisation.PhotoNotMinimumSize.format(t101.settings.imageSizes.minWidth,t101.settings.imageSizes.minHeight)},callbacks:{onComplete:function(){r._storedIds.length&&r.uploadStoredFiles()},onAllComplete:function(){n.onAfterAdd&&n.onAfterAdd();i=0},onError:function(r,u,f,e){var o;e!=undefined&&e.responseText!=undefined&&(e.status===400&&(o=JSON.parse(e.responseText)[0],o.Key=="ImageTooSmall"&&o.Value!=undefined&&(f=o.Value)),e.status===500&&(o=JSON.parse(e.responseText),o.ExceptionMessage&&(f=recon_localisation.onEditImageComplete)));i>0&&i!=t[0].files.length&&(f=recon_localisation.PhotoMultiUploadFailed.format(i,t101.settings.imageSizes.minWidth,t101.settings.imageSizes.minHeight));n.modalPanelService.setPanelContent("galleryManager-modalPanel",'<div><h6 class="t101NgDialogTitle">'+recon_localisation.dialogErrorTitle+"<\/h6><p>"+f+'<\/p><p><a class="actionButton dialogActionButtons" id="ok-error">'+recon_localisation.Ok+"<\/a><\/p><\/div>");n.modalPanelService.showPanel("galleryManager-modalPanel");n.modalPanelService.onAfterShow=function(){angular.element("#ok-error").on("click",function(){n.modalPanelService.hidePanel("galleryManager-modalPanel")})};n.onAfterAdd()}}});t.off("change");t.on("change",function(){n.limitService.getLimits("Photos").then(function(u){var e,f,o;if(u.Allowance)if(u.Remaining>=(t[0].files?t[0].files.length:1)){if(window.FileReader)for(e=0;f=t[0].files[e];e++)f.type.match("image.*")&&(o=new FileReader,o.onload=function(t){var r={Id:t.name,Processing:!0,OriginalData:{Id:t.name}};return n.images.unshift(r),function(t){r.DisplayUrl=t.target.result;var u=new Image;u.onload=function(){(this.width<t101.settings.imageSizes.minWidth||this.height<t101.settings.imageSizes.minHeight)&&i++};u.src=t.target.result;n.$rootScope.$apply();n.updateImageSizes()}}(f),o.readAsDataURL(f),n.updateImageSizes());r.clearStoredFiles();r.addFiles(t[0].files?t[0].files:t[0])}else n.dialogService.reset(),n.dialogService.setTitle(recon_localisation.displayUploadErrorGeneral),n.dialogService.setHtmlContent(recon_localisation.displayUploadErrorLimit.format(t[0].files.length-u.Remaining)),n.dialogService.setButtons("OK"),n.dialogService.toggleDialog(!0);else n.dialogService.reset(),n.dialogService.setTitle(recon_localisation.displayUploadErrorGeneral),n.dialogService.setHtmlContent(recon_localisation.dialogErrorGeneralText),n.dialogService.setButtons("OK"),n.dialogService.toggleDialog(!0)})});t.focus().trigger("click")};n.prototype.updateScroll=function(){this.noScroll||(this.$element.niceScroll(this.constants.niceScrollConfig),this.$element.getNiceScroll().show(),this.$element.getNiceScroll().resize())};n.prototype.$postLink=function(){function r(){n.updateScroll();n.updateImageSizes()}var n=this,t,i;angular.element(this.$window).off("resize",r);angular.element(this.$window).on("resize",r);if(n.updateScroll(),n.updateImageSizes(),this.sortable){t=-1;i=-1;angular.forEach(this.$element.find(".gallery-item"),function(r){var r=angular.element(r);r.off("dragstart");r.off("dragover");r.off("dragend");r.off("drop");r.on("dragstart",function(u){t=n.images.findIndex(function(n){return n.OriginalData.Id==r.data("imageId")});i=t;r.isDropped=!1;u.originalEvent.dataTransfer.setData("text/plain",r.data("imageId"));u.originalEvent.dataTransfer.effectAllowed="move"});r.on("dragover",function(i){var r,e,u,o,f;return(i.preventDefault(),i.originalEvent.preventDefault(),i.originalEvent.dataTransfer.dropEffect="move",r=angular.element(i.currentTarget),e=r.offset().top-n.$element.offset().top,e+r.height()>n.$element.height()&&n.$element.niceScroll().scrollTop(n.$element.niceScroll().scrollTop()+r.height()),e-r.height()<0&&n.$element.niceScroll().scrollTop(n.$element.niceScroll().scrollTop()-r.height()),u=n.images.findIndex(function(n){return n.OriginalData.Id==r.data("imageId")}),u==t)?!1:(o=i.originalEvent.layerX<=.5*r.width(),f=u+(t<u?o?-1:0:o?0:1),f==t)?!1:(n.$rootScope.$apply(function(){n.images.splice(f,0,n.images.splice(t,1)[0]);t=f;n.updateImageSizes()}),n.updateImageSizes(),!1)});r.on("drop",function(u){var f,e;if(r.isDropped=!0,u.preventDefault(),t==i)return!1;n.onOrderChange&&(f=n.images.find(function(n){return n.OriginalData.Id==r.data("imageId")}),f.Processing=!0,e=0,e=n.inverseSorting?n.images.length-t:t+1,n.onOrderChange({image:f,position:e}).then(function(){f.Processing=!1}))});r.on("dragend",function(){r.isDropped||n.$rootScope.$apply(function(){n.images.splice(i,0,n.images.splice(t,1)[0]);n.updateImageSizes()});n.$element.getNiceScroll().remove();n.$element.niceScroll(n.constants.niceScrollConfig)})});n.$element.on("$destroy",function(){n.$element.getNiceScroll().remove()})}}}(),function(){"use strict";function n(n,t,i,r){this.recon_localisation=recon_localisation;this.constants=n;this.ControllerHelper=r;this.dropdownOpen=!1;this.$timeout=t;this.$element=i;this.$onChanges=function(n){n.galleries&&!this.currentGallery&&this.changeGallery(this.galleries[0]);n.currentGallery&&this.changeGallery(this.currentGallery)};i.on("$destroy",function(){i.find(".dropdownList").getNiceScroll().remove()})}angular.module("t101SharedModule").component("t101GallerySelector",{controller:n,bindings:{galleries:"<",showNumSelected:"=?",numSelected:"<?",currentGallery:"=?",onGalleryChange:"&?",ignoreClassification:"<?"},templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/Photos/gallerySelector.ng-template?"+t101.settings.versionKeyValue}});n.$inject=["sharedConstants","$timeout","$element","ControllerHelper"];n.prototype.$onInit=function(){this.ignoreClassification=this.ControllerHelper.forceBool(this.ignoreClassification);this.changeGallery(this.galleries.length?this.galleries[0]:null);this.showNumSelected=this.showNumSelected||!1};n.prototype.changeGallery=function(n){this.currentGallery=n;this.onGalleryChange({gallery:this.currentGallery});this.onResize();this.closeDropdown()};n.prototype.toggleDropdown=function(){return this.dropdownOpen?this.closeDropdown():this.openDropdown()};n.prototype.openDropdown=function(){var i=this,u=angular.element(window).height(),r=0,n=this.$element.find(".dropdownList")[0],t=!1;do n.id&&n.id=="t101DialogBody"&&(t=!0),r+=n.offsetTop,n=n.offsetParent;while(n&&!t);t||this.$element.find(".dropdownList").css("max-height",u-r-30+"px");this.dropdownOpen=!0;this.$timeout(function(){var n=i.$element.find(".dropdownList");n[0].scrollIntoView&&n[0].scrollIntoView(!1);n.niceScroll(i.constants.niceScrollConfig);n.getNiceScroll().show();n.getNiceScroll().resize()},410);angular.forEach(angular.element("t101-gallery-overview"),function(n){angular.element(n).getNiceScroll().remove()})};n.prototype.closeDropdown=function(){var n=this;this.dropdownOpen=!1;this.$element.find(".dropdownList").getNiceScroll().hide();angular.forEach(angular.element("t101-gallery-overview"),function(t){angular.element(t).niceScroll(n.constants.niceScrollConfig)})};n.prototype.onResize=function(){var n=this.$element.find("t101-gallery-overview");n.getNiceScroll().resize()};n.prototype.$postLink=function(){var n=this,t=n.$element.find("t101-gallery-overview");t.niceScroll(this.constants.niceScrollConfig);angular.element("window").on("resize",function(){n.onResize()});n.onResize()}}(),function(){"use strict";function n(n,t,i,r,u,f){function o(f){return i.runHttp({url:t.apiBasePath+"/Gallery/",method:"GET",headers:n.createRequestHeaders(1),params:{profileId:t101.profile.id}}).then(function(n){return e(n.data)}).then(function(n){return f&&f.includeMainPhotosGallery?u.getMainPhotos().then(function(i){return n.unshift(new r({Id:-1,Name:recon_localisation.MainPhotos,Count:i.length,Thumbnail:i[0],Type:t.galleryTypes.MAIN_PHOTOS})),n}):n})}function s(r){var u="";return u=r.Name.$$unwrapTrustedValue?r.Name.$$unwrapTrustedValue():r.Name,i.runHttp({url:t.apiBasePath+"/Gallery/",method:"POST",headers:n.createRequestHeaders(1),data:{Name:u}}).then(function(n){return e(n.data)})}function h(r){return i.runHttp({url:t.apiBasePath+"/Gallery/"+r.Id,method:"DELETE",headers:n.createRequestHeaders(1)})}function c(r){return r.Thumbnail.Id==0&&(r.Thumbnail=null),i.runHttp({url:t.apiBasePath+"/Gallery/"+r.Id,method:"PUT",headers:n.createRequestHeaders(1),data:r}).then(function(n){return r.Thumbnail==null&&(r.Thumbnail=new f(null)),e(n.data)})}function e(n){return angular.isArray(n)||(n=[n]),n.map(function(n){return new r(n)})}return{getGalleries:o,createGallery:s,deleteGallery:h,updateGallery:c}}angular.module("t101SharedModule").factory("galleryService",n);n.$inject=["ApiService","sharedConstants","runner","GalleryModel","imageService","PhotoModel"]}(),function(){"use strict";function n(n,t,i){function r(r){var u=n.apiBasePath+"/ProfileImage/";return r&&r.Id&&r.Id>0&&(u+="?galleryId="+r.Id),i.runHttp({url:u,method:"GET"}).then(function(n){return n.data.map(function(n){return new t(n)})})}function u(){return r()}function f(t){return i.runHttp({url:n.apiBasePath+"/EncodedProfileImage/"+t,method:"GET"}).then(function(n){return n.data})}function e(t,r){return i.runHttp({url:n.apiBasePath+"/EncodedProfileImage/"+t,method:"POST",data:r})}function o(t){return i.runHttp({url:n.apiBasePath+"/ProfileImage/"+t,method:"DELETE"})}function s(t){return i.runHttp({url:n.apiBasePath+"/Helpers/GalleryActions/RemoveListFromPrimaryImages/",method:"POST",data:{Guids:t}})}function h(t,r){return i.runHttp({url:n.apiBasePath+"/Helpers/GalleryActions/MoveImageListToGallery/",method:"POST",data:{Guids:[t.Id]},params:{galleryId:r.Id}})}function c(t){return angular.isArray(t)||(t=[t]),i.runHttp({url:n.apiBasePath+"/Helpers/GalleryActions/AddListToPrimaryImages/",method:"POST",data:{Guids:t}})}function l(t,r){return i.runHttp({url:n.apiBasePath+"/Helpers/GalleryActions/UpdateGalleryImageSortOrder",method:"POST",params:{imageId:t.Id,displayPosition:r}})}function a(t,r){return i.runHttp({url:n.apiBasePath+"/Helpers/GalleryActions/UpdatePrimaryImageSortOrder",method:"POST",params:{imageId:t.Id,displayPosition:r}})}function v(r){var u=n.apiBasePath+"/EventPhoto?eventId="+r;return i.runHttp({url:u,method:"GET"}).then(function(n){return n.data.map(function(n){return new t(n)})})}return{getImagesForGallery:r,getMainPhotos:u,getImageAsBase64:f,saveBase64Image:e,deleteImage:o,removeFromPrimaryImages:s,moveImage:h,addToPrimaryImages:c,updatePhotoPosition:l,updateMainPhotoPosition:a,getImagesForEvent:v}}angular.module("t101SharedModule").factory("imageService",n);n.$inject=["sharedConstants","PhotoModel","runner"]}(),function(){"use strict";function n(n,t,i){this.galleryService=n;this.imageService=t;this.dialogService=i;this.galleries=[];this.images=[];this.currentGallery=null;this.selected={};this.numSelected={};this.totalSelected=0;this.translations=recon_localisation;this.loadGalleries()}angular.module("t101SharedModule").component("t101MainPhotoSelector",{controller:n,templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/Photos/mainPhotoSelector.ng-template?"+t101.settings.versionKeyValue}});n.$inject=["galleryService","imageService","dialogService"];n.prototype.loadGalleries=function(){var n=this,t=this.currentGallery;return this.galleries=[],this.images=[],this.galleryService.getGalleries().then(function(i){if(n.galleries=i,t&&(n.currentGallery=t),i.length&&!n.currentGallery||i.findIndex(function(t){return t.Id==n.currentGallery.Id})==-1)n.onGalleryChange(i[0])})};n.prototype.loadImages=function(){var n=this;this.imageService.getImagesForGallery(this.currentGallery).then(function(t){n.images=t;n.dialogService.forceRedraw()})};n.prototype.onGalleryChange=function(n){this.currentGallery=n;this.loadImages()};n.prototype.onSelectedChange=function(n){var t,i;this.selected=n;this.numSelected={};this.totalSelected=0;for(t in this.selected){this.numSelected[t]=0;for(i in this.selected[t])this.selected[t][i]&&(this.numSelected[t]++,this.totalSelected++)}};n.prototype.onAfterAdd=function(){var n=this;this.loadGalleries().then(function(){n.loadImages()})};n.prototype.addPhotosToMain=function(){var n,t,i;if(this.totalSelected!=0){angular.element("t101-dialog t101-action-button button img")[0].src="/Content/images/spinner.gif";n=[];for(t in this.selected)for(i in this.selected[t])this.selected[t][i]&&n.push(i);this.imageService.addToPrimaryImages(n).then(this.dialogService.confirmationFunction)}}}(),function(){"use strict";function n(n){var t=function(t){t||(t={});Object.defineProperties(this,{Id:{value:t.ImageId||t.Id||0,enumerable:!0},Classification:{value:t.Classification||n.imageClassification.NotClassified,writable:!0,enumerable:!0},Adult:{get:function(){return this.Classification==n.imageClassification.Sexual},enumerable:!0},Primary:{value:t.IsPrimaryImage||t.Primary||!1,enumerable:!0},GalleryId:{value:t.GalleryId||0,writable:!0,enumerable:!0},Hidden:{value:t.Hidden||!1,writable:!0,enumerable:!0},DisplayUrl:{get:function(){var t=n.transparentGif;return(this.Url||this.ThumbnailUrl)&&!this.Hidden&&(t=this.Viewable?this.ThumbnailUrl||this.Url:"/content/images/xxx.png"),this.Hidden&&(t="/content/images/photo-removed.png"),t}},Premium:{get:function(){return n.imagePremiumOnly.indexOf(this.Classification)>-1}},Viewable:{get:function(){return!(this.Premium&&t101.profile.isStandard)}},OriginalData:{value:t}});t.Url?Object.defineProperty(this,"Url",{value:t.Url,enumerable:!0}):Object.defineProperty(this,"Url",{get:function(){return this.Id==0?n.transparentGif:n.profileImageFullSizeBaseUrl+this.Id+".jpg"},enumerable:!0});t.ThumbnailUrl?Object.defineProperty(this,"ThumbnailUrl",{value:t.ThumbnailUrl,enumerable:!0}):Object.defineProperty(this,"ThumbnailUrl",{get:function(){return this.Id==0?n.transparentGif:n.profileImageBaseUrl+this.Id+".jpg"},enumerable:!0});t.Dimensions?Object.defineProperty(this,"Dimensions",{value:t.Dimensions,enumerable:!0}):Object.defineProperty(this,"Dimensions",{value:[null,null]});t.ThumbnailDimensions?Object.defineProperty(this,"ThumbnailDimensions",{value:t.ThumbnailDimensions,enumerable:!0}):Object.defineProperty(this,"ThumbnailDimensions",{value:[null,null]})};return t.prototype.createUrlForBucket=function(t){return n.memberImagePath+t+"/"+this.Id+".jpg"},t}angular.module("t101SharedModule").factory("PhotoModel",n);n.$inject=["sharedConstants"]}(),function(){"use strict";function n(n,t,i,r,u,f,e,o){function s(f,o,s,h){function l(t){f.$apply(function(){switch(t.which){case h.keyCodes.LEFT:n.previousImage();break;case h.keyCodes.RIGHT:n.nextImage();break;case h.keyCodes.ESCAPE:n.closeTheatre()}})}var c=this;n.setElementScope(f);f.theatreOverlayService=n;f.allowCrop=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?!1:!0;f.translations={closeTitle:recon_localisation.Close,saveTitle:recon_localisation.Save,cropTitle:recon_localisation.Crop,flipTitle:recon_localisation.Flip,rotateLeftTitle:recon_localisation.RotateLeft,rotateRightTitle:recon_localisation.RotateRight,makeFavourite:recon_localisation.dialogFavouritePhotoAdd};f.$attrs=s;f.addToFavourites=!!f.addToFavourites;f.$watch("theatreOverlayService.isTheatreOpen()",function(n){if(n){f.$attrs.addToFavourites=o.attr("data-add-to-favourites");f.$attrs.referenceId=o.attr("data-reference-id");f.$attrs.referenceType=o.attr("data-reference-type");o.fadeIn();c.drawImage();angular.element(window).on("keyup",l)}else o.fadeOut(),e.removeCropper(),angular.element(window).off("keyup",l)},!0);f.$watch("theatreOverlayService.getCurrentImageIndex()",function(){c.drawImage()},!0);c.next=function(){c.checkDirty(1)&&n.nextImage()};c.prev=function(){c.checkDirty(-1)&&n.previousImage()};c.checkDirty=function(t){var e=i.isImageDirty();return e&&(r.reset(),r.setTitle(""),r.setHtmlContent(recon_localisation.SaveChanges),r.setButtons("YesAndNo"),r.confirmationFunction=r.closeDialog,r.yesFunction=function(){i.saveImage(!1).then(function(){n[(t>0?"next":"previous")+"Image"]();r.closeDialog()})},r.noFunction=function(){n[(t>0?"next":"previous")+"Image"]();r.closeDialog()},r.toggleDialog(!0),u.$$phase||f.$apply()),!e};c.checkProcessing=function(){return i.isProcessing()};c.drawImage=function(){var e=f.image=n.getCurrentImage(),r,o,u;if(e){r=document.getElementById("theatreStage");r.width=100;r.height=100;r.onAfterEdit=function(){angular.element(window).width()<=480||angular.element(window).height()<=560?angular.element(r).css({"margin-top":-.5*r.offsetHeight,"margin-left":-.5*r.offsetWidth}):angular.element(r).css({"margin-top":0,"margin-left":"20px"})};r.onAfterEdit();angular.element(window).on("resize",r.onAfterEdit);o=r.getContext("2d");o.clearRect(0,0,r.width,r.height);u=new Image;u.onload=function(){n.originalImageSize={};n.originalImageSize.width=u.width;n.originalImageSize.height=u.height;r.width=u.width;r.height=u.height;o.drawImage(u,0,0,r.width,r.height);r.onAfterEdit();angular.element(window).width()<=480&&angular.element(r).css({"margin-top":-.5*r.offsetHeight,"margin-left":-.5*r.offsetWidth});r.style.display="none";r.style.display="block"};f.editbuttons?t.getImageAsBase64(e.Id).then(function(n){i.setCurrentImage(n);u.src="data:image/jpg;base64,"+n.Data}):u.src=t101.settings.paths.memberImages+h.imageSizes["1080x1080Box"]+"/"+e.Id+".jpg"}};c.createLink=function(n){if(!n)return"";var t="";if(n.OriginalData)switch(n.OriginalData.ImageType){case h.favouritePhotoReferenceType.Profile:t=t101_links.ViewProfile.format(n.OriginalData.ReferenceId,"");break;case h.favouritePhotoReferenceType.Event:t=t101_links.EventsGallery.format(n.OriginalData.ReferenceId)}return t};c.updateCurrent=function(){var r=n.getCurrentImageIndex();typeof r=="number"&&t.getImagesForGallery(f.currentGallery).then(function(t){n.updateImages(t);var u=t[r].Id;i.updateCurrentImageWithNewId(u)})};c.createText=function(n){if(!n)return"";var t="";return n.OriginalData&&(t=n.OriginalData.DisplayName),t}}return{restrict:"E",controller:["$scope","$element","$attrs","sharedConstants",s],controllerAs:"vm",templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/Photos/theatreOverlay.ng-template?"+t101.settings.versionKeyValue},scope:{editbuttons:"<?",countDisplay:"<?",showLink:"<?",onAfterSafe:"&?",addToFavourites:"<?",currentGallery:"<?"},link:function(n,t){t.hide();n.editbuttons=o.forceBool(n.editbuttons);n.countDisplay=o.forceBool(n.countDisplay);n.showLink=o.forceBool(n.showLink)}}}angular.module("t101SharedModule").directive("t101TheatreOverlay",n);n.$inject=["theatreOverlayService","imageService","saveService","dialogService","$rootScope","sharedConstants","cropService","ControllerHelper"]}(),function(){"use strict";function n(n,t,i){function s(t){f=!0;angular.element("body").css("overflow-y","hidden");t||(window.location.hash="#theatreOpen",window.onhashchange=function(){window.location.hash!="#theatreOpen"?h():f=!0;n.$$phase||n.$apply()})}function c(n,t){r=n;s(t)}function h(){(o=t.isProcessing(),o)||(angular.element("body").css("overflow-y","auto"),t.isImageDirty()?(i.reset(),i.setTitle(""),i.setHtmlContent(recon_localisation.SaveChanges),i.setButtons("YesAndNo"),i.confirmationFunction=i.closeDialog,i.yesFunction=function(){t.saveImage().then(function(){i.closeDialog();window.location.hash="";f=!1;n.$$phase||e.$apply()})},i.noFunction=function(){t.cleanImage();i.closeDialog();window.location.hash="";f=!1;n.$$phase||e.$apply()},i.toggleDialog(!0),n.$$phase||e.$apply()):(window.location.hash!=""&&(window.location.hash=""),f=!1,n.$$phase||e.$apply()))}function l(){return f}function a(n){e=n}function v(n){u=n}function y(n){u=n;r%=u.length}function p(){return u}function w(){return u[r]}function b(){return r}function k(){r++;r%=u.length}function d(){r--;r<0&&(r+=u.length)}var f=!1,r=0,u=[],e=null,o=!1;return{openTheatre:s,openTheatreWithIndex:c,closeTheatre:h,isTheatreOpen:l,setElementScope:a,setImages:v,updateImages:y,getImages:p,getCurrentImage:w,getCurrentImageIndex:b,nextImage:k,previousImage:d,isProcessing:o}}angular.module("t101SharedModule").factory("theatreOverlayService",n);n.$inject=["$rootScope","saveService","dialogService"]}(),function(){"use strict";function n(n,t,i){function r(r,u,f){r.busy=!1;u.on("click",function(){r.busy=!0;n.acceptFriend(f.profileId).then(function(){t.decrementCount("friendRequests");r.onAfterAction({actionType:"friendAccepted"});r.busy=!1;t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.FriendRequestAccepted)}).catch(function(n){r.busy=!1;i.reset();i.setTitle(recon_localisation.dialogErrorTitle);i.setHtmlContent(n.data[0].Value);i.setButtons("OK");i.toggleDialog(!0)})})}return{init:r}}angular.module("t101SharedModule").factory("acceptFriendService",n);n.$inject=["friendActionsService","badgeService","dialogService"]}(),function(){"use strict";function n(){return{restict:"E",transclude:!0,link:function(n,t,i,r,u){u(function(n){t.append(n)})}}}angular.module("t101SharedModule").directive("t101ActionBar",n)}(),function(){"use strict";function n(){return{restrict:"E",template:"<span><\/span>"}}angular.module("t101SharedModule").directive("t101ActionBarSpacer",n)}(),function(){"use strict";function n(n){function t(t,i,r){t.busy=!1;t.service&&(t.serviceInstance=n.get(t.service),t.serviceInstance.init(t,i,r));i.on("keydown",function(n){(n.keyCode===13||event.keyCode===32)&&i.find("button").click()})}return{restrict:"E",scope:{icon:"@",color:"@",title:"@?",service:"@?",gallerySelector:"@?",onAfterAction:"&?",disabled:"=?",busy:"=?",buttonText:"@?",textColor:"@?",tabbableIndex:"@?"},link:t,template:'<button title="{{title}}" tabindex="{{tabbableIndex}}" ng-disabled="disabled" ng-style="{\'background-color\': \'{{color}}\'}"><img src="/Content/images/spinner.gif" ng-if="busy" width="24" height="24" class="spinner" /><img ng-if="!busy" ng-src="/Content/images/{{icon}}.png" width="40" height="40" alt="{{title}}"><span ng-if="buttonText" ng-style="{color: \'{{textColor}}\'}">{{buttonText}}<\/span><\/button>'}}angular.module("t101SharedModule").directive("t101ActionButton",n);n.$inject=["$injector"]}(),function(){"use strict";function n(n,t,i,r,u){function f(f,e,o){function c(){var i=JSON.parse(o.profile);n.addFriend(i.ProfileId||i.Id,!0).then(function(n){return i.FriendFavouriteStatus=r.friendFavouriteStatus.FavouritePendingFriendRequest,o.profile=JSON.stringify(i),t.closeDialog(),n}).then(h).catch(s)}function h(n){t.reset();u(function(){t.setTitle(recon_localisation.FriendRequestSent);t.setHtmlContent(recon_localisation.FriendRequestSentDialogText.format(n.headers("Favourites-Remaining-Allowance")));t.setButtons("OK");t.confirmationFunction=t.closeDialog;t.toggleDialog(!0)},0)}function s(n){t.reset();u(function(){var r,i,u;t.setTitle(recon_localisation.dialogErrorTitle);switch(n.data[0].Key){case"ProfileHidden":t.setHtmlContent(n.data[0].Value);t.setButtons("YesAndNo");t.noFunction=t.closeDialog;t.yesFunction=c;break;default:for(r="",i=0,u=n.data.length;i<u;i++)r+="<p>"+n.data[i].Value+"<\/p>";t.setHtmlContent(r);t.setButtons("OK");t.confirmationFunction=t.closeDialog}t.toggleDialog(!0)},0)}e.on("click",function(){t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.MemberFavourited);var l=!!angular.element("body").scope().isGuest,u=JSON.parse(o.profile),e="",c="";if(t.reset(),l){t.setTitle(recon_localisation.dialogErrorTitle);t.setHtmlContent(recon_localisation.EmailVerificationRequiredText.format(t101.settings.email.supportAddress));t.setButtons("OK");t.confirmationFunction=t.closeDialog;t.toggleDialog(!0);return}u.FriendFavouriteStatus==r.friendFavouriteStatus.Friend?(e=recon_localisation.FriendFavouriteStatus_Friend,t.setTitle(recon_localisation.FriendFavourite),t.setButtons("MultipleChoice"),t.setMultipleChoiceContent(e+"<br>",[{value:n.OPTION_REMOVE_FRIEND,text:recon_localisation.ChangeFromFriendToFav},{value:n.OPTION_REMOVE_COMPLETE,text:recon_localisation.RemoveFriend}],"<br>"+c),t.confirmationFunction=function(){var i=parseInt(t.getSelectedValue(),10);switch(i){case n.OPTION_REMOVE_FRIEND:n.downgradeFriend(u.ProfileId||u.Id).then(function(){u.FriendFavouriteStatus=r.friendFavouriteStatus.Favourite;o.profile=JSON.stringify(u);t.closeDialog()}).catch(s);break;case n.OPTION_REMOVE_COMPLETE:n.removeFriend(u.ProfileId||u.Id).then(function(){u.FriendFavouriteStatus=r.friendFavouriteStatus.None;o.profile=JSON.stringify(u);t.closeDialog()}).catch(s)}}):u.FriendFavouriteStatus==r.friendFavouriteStatus.FavouritePendingFriendRequest?(e=recon_localisation.FriendFavouriteStatus_FavouriteFriendRequestPending,t.setTitle(recon_localisation.FriendFavourite),t.setButtons("YesAndNo"),t.setHtmlContent(recon_localisation.FriendFavouriteStatus_FavouriteFriendRequestPending),t.yesFunction=function(){n.cancelFriendRequest(u.ProfileId||u.Id).then(function(){u.FriendFavouriteStatus=r.friendFavouriteStatus.None;o.profile=JSON.stringify(u);t.closeDialog()}).catch(s)},t.noFunction=function(){t.closeDialog()}):u.FriendFavouriteStatus==r.friendFavouriteStatus.Favourite?(e=recon_localisation.FriendFavouriteStatus_Favourite,t.setTitle(recon_localisation.FriendFavourite),t.setButtons("MultipleChoice"),t.setMultipleChoiceContent(e+"<br>",[{value:n.OPTION_ADD_FRIEND,text:recon_localisation.ChangeFromFavToFriend},{value:n.OPTION_REMOVE_FAVOURITE,text:recon_localisation.RemoveFavourite}],"<br>"+c),t.confirmationFunction=function(){var i=parseInt(t.getSelectedValue(),10);switch(i){case n.OPTION_ADD_FRIEND:n.addFriend(u.ProfileId||u.Id).then(function(n){return u.FriendFavouriteStatus=r.friendFavouriteStatus.FavouritePendingFriendRequest,o.profile=JSON.stringify(u),t.closeDialog(),n}).then(h).catch(s);break;case n.OPTION_REMOVE_FAVOURITE:n.removeFavourite(u.ProfileId||u.Id).then(function(){u.FriendFavouriteStatus=r.friendFavouriteStatus.None;o.profile=JSON.stringify(u);t.closeDialog()}).catch(s)}}):(e=recon_localisation.FriendFavouriteStatus_NotFriendOrFavourite,t.setTitle(recon_localisation.FriendFavourite),t.setButtons("MultipleChoice"),t.setMultipleChoiceContent(e+"<br>",[{value:n.OPTION_ADD_FRIEND,text:recon_localisation.AddAsAFriend},{value:n.OPTION_ADD_FAVOURITE,text:recon_localisation.AddAsAFavourite}],"<br>"+c),t.confirmationFunction=function(){var i=parseInt(t.getSelectedValue(),10);switch(i){case n.OPTION_ADD_FRIEND:n.addFriend(u.ProfileId||u.Id).then(function(n){return u.FriendFavouriteStatus=r.friendFavouriteStatus.FavouritePendingFriendRequest,o.profile=JSON.stringify(u),t.closeDialog(),n}).then(h).catch(s);break;case n.OPTION_ADD_FAVOURITE:n.addFavourite(u.ProfileId||u.Id).then(function(){u.FriendFavouriteStatus=r.friendFavouriteStatus.Favourite;o.profile=JSON.stringify(u);t.closeDialog()}).catch(s)}});t.toggleDialog(!0);i.$$phase||f.$apply()})}return{init:f}}angular.module("t101SharedModule").factory("addFriendService",n);n.$inject=["friendActionsService","dialogService","$rootScope","sharedConstants","$timeout"]}(),function(){"use strict";function n(n,t,i,r,u){function f(f,e){e.on("click",function(){r.getLimits("Galleries").then(function(r){r.Remaining>0?(n.reset(),n.setButtons("Save"),n.yesFunction=null,n.noFunction=null,n.setTitle(recon_localisation.dialogAddGalleryDialogHeader),n.setHtmlContent('<fieldset style="margin-top: 0;"><label>'+recon_localisation.dialogAddGalleryDialogText1+'<br><input type="text" minlength="1" maxlength="20" id="new_gallery_name" required inputmode="latin" style="width: 100%;"><\/label>'+recon_localisation.dialogAddGalleryDialogText2+'<\/fieldset><p id="dialog-errors" class="error" style="margin-bottom: 0;"><\/p>'),n.confirmationFunction=function(){t.createGallery(new i({Name:document.getElementById("new_gallery_name").value})).then(function(t){u.forceReloadGalleries();u.selectGallery(t);n.closeDialog()}).catch(function(t){for(var i="",r=0,u;u=t.data[r];r++)i+=u.Value+"<br>";document.getElementById("dialog-errors").innerHTML=i;n.resetSpinner()})},n.onAfterShow=function(){var t=angular.element("#new_gallery_name");t.on("keyup",function(t){t.keyCode==13&&n.confirmationFunction()});t.focus()}):(n.setButtons("OK"),n.confirmationFunction=n.closeDialog,n.yesFunction=null,n.noFunction=null,n.setHtmlContent(recon_localisation.onAddGalleryCompleteTooManyGalleries));n.toggleDialog(!0)})})}return{init:f}}angular.module("t101SharedModule").factory("t101AddGalleryService",n);n.$inject=["dialogService","GalleryService","GalleryModel","limitService","gallerySelectorService"]}(),function(){function n(n,t,i){function nt(t,g,nt){r=angular.element("#"+nt.target);g.on("click",function(){var nt=document.getElementById("theatreStage");t.image=i.getCurrentImage();var tt=angular.element(nt).context.clientWidth,it=angular.element(nt).context.clientHeight,g=it<tt?it:tt;w=!1;b();s=r[0].offsetLeft;h=r[0].offsetTop;y=s+r[0].offsetWidth;p=h+r[0].offsetHeight;u=g<t101.settings.imageSizes.minWidth?g:t101.settings.imageSizes.minWidth;f=g<t101.settings.imageSizes.minHeight?g:t101.settings.imageSizes.minHeight;e=(s+y-u)/2;o=(h+p-f)/2;c=angular.element('<div class="cropper"><\/div>');c.css({width:u,height:f,top:o,left:e});c.html('<div class="resize" id="SE"><\/div><div class="ok"><\/div><div class="cancel"><\/div>');r.parent().append(c);c.on("mousedown",function(n){var t=angular.element(document);t.off("mousemove");t.off("mouseup");v=!0;l=n.screenX;a=n.screenY;t.on("mousemove",k);t.on("mouseup",function(){t.off("mousemove",k);v=!1})});$(".cropper .resize").on("mousedown",function(n){n.preventDefault();n.stopPropagation();var t=angular.element(document);t.off("mousemove");t.off("mouseup");v=!1;l=n.screenX;a=n.screenY;t.on("mousemove",d);t.on("mouseup",function(){t.off("mousemove",d)})});$(".cropper .ok").on("click",function(){var t=new Image;t.onload=function(){var i=r[0],v=(e-s)*t.width/i.offsetWidth,y=(o-h)*t.height/i.offsetHeight,c=u*t.width/i.offsetWidth,l=f*t.height/i.offsetHeight,a;i.width=c;i.height=l;angular.element(window).width()<=480&&angular.element(i).css({"margin-top":-.5*i.offsetHeight,"margin-left":-.5*i.offsetWidth});a=i.getContext("2d");a.drawImage(t,v,y,c,l,0,0,c,l);r.onAfterEdit&&r.onAfterEdit();n.setImageDirty()};t.src=r[0].toDataURL();b()});$(".cropper .cancel").on("click",function(){b()})})}function b(){angular.element(".cropper").remove()}function tt(){e<s&&(e=s);e+u>y&&(e=y-u);o<h&&(o=h);o+f>p&&(o=p-f)}function it(){var n=t101.settings.imageSizes.minWidth,t=t101.settings.imageSizes.minHeight;if(i.originalImageSize){var a=100-r[0].offsetWidth/i.originalImageSize.width*100,v=100-r[0].offsetHeight/i.originalImageSize.height*100,c=t101.settings.imageSizes.minWidth-t101.settings.imageSizes.minWidth/100*a,l=t101.settings.imageSizes.minHeight-t101.settings.imageSizes.minHeight/100*v;c>0&&(n=c);l>0&&(t=l)}u+e-s>r[0].offsetWidth&&(u=r[0].offsetWidth-e+s);f+o-h>r[0].offsetHeight&&(f=r[0].offsetHeight-o+h);u<n&&(u=n,w||g());f<t&&(f=t,w||g())}function k(n){if(n.offsetX<0||n.offsetY<0||n.offsetX>u||n.offsetY>f||!v)return n.preventDefault(),n.stopPropagation(),!1;e+=n.screenX-l;o+=n.screenY-a;l=n.screenX;a=n.screenY;tt();c.css({top:o,left:e})}function d(n){if(v)return n.preventDefault(),n.stopPropagation(),!1;u+=n.screenX-l;f+=n.screenY-a;l=n.screenX;a=n.screenY;it();c.css({width:u,height:f})}function g(){t.reset();t.setTitle(recon_localisation.dialogErrorTitle);t.setHtmlContent(recon_localisation.PhotoCropRestriction.format(t101.settings.imageSizes.minWidth,t101.settings.imageSizes.minHeight));t.setButtons("OK");t.toggleDialog(!0);w=!0}var c=null,r=null,s,h,y,p,e,o,u,f,v=!1,l,a,w=!1;return{init:nt,removeCropper:b}}angular.module("t101SharedModule").factory("cropService",n);n.$inject=["saveService","dialogService","theatreOverlayService"]}(),function(){"use strict";function n(n,t,i){function r(r,u,f){function s(){t.closeDialog();n.cruiseMember(f.profileId,!0).then(e).catch(o)}function e(){t.reset();t.setTitle(recon_localisation.cruiseProfileSuccessfulDialogHeader);t.setHtmlContent("<div>"+recon_localisation.cruiseProfileSuccessfulDialogText+"<\/div>");t.setButtons("OK");t.confirmationFunction=t.closeDialog;t.toggleDialog(!0);t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.MemberCruised)}function o(n){if(n.data!==undefined&&n.data!==null&&!(n.data.length<=0)){t.reset();t.setTitle(recon_localisation.dialogErrorTitle);switch(n.data[0].Key){case"OptedOut":case"Hidden":case"HiddenAndOptedOut":t.setHtmlContent("<div>"+n.data[0].Value+"<\/div>");t.setButtons("YesAndNo");t.noFunction=t.closeDialog;t.yesFunction=s;break;default:t.setHtmlContent("<div>"+n.data[0].Value+"<\/div>");t.setButtons("OK");t.confirmationFunction=t.closeDialog}t.toggleDialog(!0)}}$("t101-dialog")||$("body").append(i("<t101-dialog><\/t101-dialog>")(r));u.on("click",function(){n.cruiseMember(f.profileId).then(e).catch(o)})}return{init:r}}angular.module("t101SharedModule").factory("cruiseService",n);n.$inject=["profileActionService","dialogService","$compile"]}(),function(){"use strict";function n(n,t,i,r){function u(u,f){f.on("click",function(){i.reset();i.setTitle(recon_localisation.dialogDeleteGalleryDialogHeader);i.setHtmlContent(recon_localisation.dialogDeleteGalleryDialogText.format(n.selectedGallery[u.gallerySelector].Name));i.setButtons("YesAndNo");i.confirmationFunction=i.closeDialog;i.yesFunction=function(){t.deleteGallery(n.selectedGallery[u.gallerySelector]).then(function(){n.forceReloadGalleries();r.$$phase||u.$apply();i.closeDialog()})};i.noFunction=function(){i.closeDialog()};i.toggleDialog(!0)});u.gallerySelectorService=n;u.$watch("gallerySelectorService.selectedGallery[gallerySelector]",function(n){n&&(n.Type==0?f.show():f.hide())},!0)}return{init:u}}angular.module("t101SharedModule").factory("t101DeleteGalleryService",n);n.$inject=["gallerySelectorService","GalleryService","dialogService","$rootScope"]}(),function(){"use strict";function n(n,t){function i(i,r,u){i.busy=!1;r.on("click",function(){i.busy=!0;n.denyFriendRequest(u.profileId).then(function(){t.decrementCount("friendRequests");i.onAfterAction({actionType:"friendDenied"});i.busy=!1;t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.FriendRequestIgnored)})})}return{init:i}}angular.module("t101SharedModule").factory("denyFriendService",n);n.$inject=["friendActionsService","badgeService"]}(),function(){"use strict";function n(n){function t(t,i){t.busy=!1;t.translations={addMe:recon_localisation.AddMe,attending:recon_localisation.IAmAttending};i.on("click",function(){t.busy=!0;n.updateEventAttendanceService(t.event.EventId||t.event.Id,!t.event.Attending).then(function(){t.busy=!1;t.event.Attending=!t.event.Attending;angular.forEach(angular.element("t101-event-attendance-button"),function(n){if(n=angular.element(n),n&&n.isolateScope&&n.isolateScope().event){var i=t.event.EventId||t.event.Id;(n.isolateScope().event.EventId==i||n.isolateScope().event.Id==i)&&(n.isolateScope().event.Attending=t.event.Attending)}});t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.EventsRSVPAttending);t.onAfterAction&&t.onAfterAction()})})}return{restrict:"E",scope:{event:"=",attendingColor:"@",defaultColor:"@",onAfterAction:"&?"},link:t,templateUrl:function(){return t101.settings.paths.staticSitePath+"Scripts/Shared/actionBar/eventAttendanceButton.ng-template?"+t101.settings.versionKeyValue}}}angular.module("t101SharedModule").directive("t101EventAttendanceButton",n);n.$inject=["eventDataService"]}(),function(){"use strict";function n(n){function t(t,i,r){i.on("click",function(t){var i=r.url.substr(0,4)=="http"?r.url:t101.settings.paths.siteUrl+"/"+r.url;t.preventDefault();t.stopPropagation();n.share(i)})}return{init:t}}angular.module("t101SharedModule").factory("facebookShareService",n);n.$inject=["facebookService"]}(),function(){"use strict";function n(n,t,i){function r(t,r,u){t.busy=!1;r.on("click",function(){t.busy=!0;n.getGalleries().then(function(r){var f="<p>"+recon_localisation.dialogFavouritePhotoGallerySelect+"<\/p>",e,s,o;for(f+='<select id="favGals">',e=0,s=r.data.length;e<s;e++)o=r.data[e],f+='<option value="'+o.Id+'">'+o.Name+"<\/option>";f+="<\/select>";i.reset();i.setTitle(recon_localisation.dialogFavouritePhotoAdd);i.setHtmlContent(f);i.setButtons("Save");i.confirmationFunction=function(){var t=angular.element("#favGals").val(),r=u.imageId,f=u.referenceType,e=u.referenceId;n.addPhoto(t,r,f,e).then(function(){i.closeDialog()})};i.toggleDialog(!0);t.busy=!1})})}return{init:r}}angular.module("t101SharedModule").factory("favouritePhotoService",n);n.$inject=["favouritePhotosService","sharedConstants","dialogService"]}(),function(){function n(n){function t(t,i,r){i.on("click",function(){n.setImageDirty();var t=document.getElementById(r.target),i=new Image;i.onload=function(){var n=t.getContext("2d");n.save();n.translate(t.width,0);n.scale(-1,1);n.drawImage(this,0,0);n.restore();t.onAfterEdit&&t.onAfterEdit()};i.src=t.toDataURL()})}return{init:t}}angular.module("t101SharedModule").factory("flipService",n);n.$inject=["saveService"]}(),function(){"use strict";function n(n){function t(t,i,r){i.on("click",function(){var t=!!angular.element("body").scope().isGuest;if(t){n.reset();n.setTitle(recon_localisation.dialogErrorTitle);n.setHtmlContent(recon_localisation.EmailVerificationRequiredText.format(t101.settings.email.supportAddress));n.setButtons("OK");n.confirmationFunction=n.closeDialog;n.toggleDialog(!0);return}openNewChat(t101.settings.paths.messageUrl,r.profileName);t101.analytics.trackEvent(t101.analytics.Kpis,t101.constants.gaKpis.SendMessageClicked)})}return{init:t}}angular.module("t101SharedModule").factory("messageMemberService",n);n.$inject=["dialogService"]}(),function(){"use strict";function n(){function n(n,t){t.on("click",function(){n.$apply(function(){n.menuOpen=!n.menuOpen})})}return{restrict:"E",transclude:!0,scope:{icon:"@",color:"@",title:"@"},link:n,template:'<button title="{{title}}" data-ng-style="{\'background-color\': \'{{color}}\'}"><img data-ng-src="/Content/images/{{icon}}.png"><\/button><div data-ng-show="menuOpen" data-ng-transclude><\/div>'}}angular.module("t101SharedModule").directive("t101MoreButton",n);n.$inject=[]}(),function(){"use strict";function n(n){function t(t,i,r){t.service&&(t.serviceInstance=n.get(t.service),t.serviceInstance.init(t,i,r))}return{restrict:"E",scope:{color:"@",title:"@",service:"@",gallerySelector:"@?"},link:t,template:'<button title="{{title}}" style="background-color: {{color}};">{{title}}<\/button>'}}angular.module("t101SharedModule").directive("t101MoreMenuButton",n);n.$inject=["$injector"]}(),function(){"use strict";function n(n,t,i,r,u){function f(f,e){e.on("click",function(){t.getGalleriesForUser(t101.profile.id).then(function(t){var e,o,f;for(u.reset(),u.setTitle(recon_localisation.MoveTo),u.setButtons("Empty"),e='<div style="width: 320px;">',o=0;f=t[o];o++)f.Id!=i.selectedGallery["default"].Id&&(e+='<div class="gallerySelectorDropdownItem" data-move-to="'+f.Id+'" style="cursor: pointer;"><img class="gallerySelectorDropdownImg" src="'+(f.Thumbnail.URL||t101.settings.staticPath+"/content/images/photo-removed.png")+'" alt="" /><div class="gallerySelectorDropdownLabel"><p class="gallerySelectorDropdownTitle">'+f.Name+'<\/p><p class="gallerySelectorDropdownSummary">'+f.Count+" "+(f.Count==1?recon_localisation.PhotoWord:recon_localisation.PhotosWord)+"<\/p><\/div><\/div>");u.setHtmlContent(e+'<div style="clear: both;"><\/div><\/div>');u.onAfterShow=function(){angular.element("t101-dialog [data-move-to]").on("click",function(){for(var e,o,s,h,f=0;e=t[f];f++)if(e.Id==$(this).data("moveTo")){for(o=n.getSelectedItems("managePhotos"),s=0;h=o[s];s++)angular.element("li[data-image-id="+h+"]").scope().image.new=!0;r.moveIdsToGallery(o,e).then(function(){i.forceReloadGalleries()});break}u.toggleDialog(!1)})};u.toggleDialog(!0)})});f.selectableItemService=n;f.$watch("selectableItemService.selectedItems",function(){n.getSelectedItems("managePhotos").length>0?e.show():e.hide()},!0)}return{init:f}}angular.module("t101SharedModule").factory("t101MovePhotoButtonService",n);n.$inject=["t101SelectableItemService","GalleryService","gallerySelectorService","PhotoService","dialogService","$q"]}(),function(){"use strict";function n(n,t,i,r){function u(u,f){f.on("click",function(f){f.stopPropagation();f.preventDefault();var o=n.getSelectedItems("managePhotos"),e=[];i.reset();i.setButtons("YesAndNo");i.confirmationFunction=i.closeDialog;i.yesFunction=function(){for(var f,s,u,n=0;f=o[n];n++)s=angular.element("li[data-image-id="+f+"]"),u=s.scope().image,u.new=!0,e.push(u);t.removeFromPrimaryImages(e).then(function(){r.forceReloadGalleries()});i.closeDialog()};i.noFunction=i.closeDialog;i.setTitle(recon_localisation.dialogDeleteThumbnailDialogHeader);i.setHtmlContent(recon_localisation.dialogDeleteThumbnailDialogText);i.toggleDialog(!0);u.$apply()});u.selectableItemService=n;u.$watch("selectableItemService.selectedItems",function(){n.getSelectedItems("managePhotos").length>0?f.show():f.hide()},!0)}return{init:u}}angular.module("t101SharedModule").factory("t101RemoveMainPhotoButtonService",n);n.$inject=["t101SelectableItemService","PhotoService","dialogService","gallerySelectorService"]}(),function(){"use strict";function n(n,t,i,r,u){function e(e,o){o.on("click",function(e){e.stopPropagation();e.preventDefault();var o=n.getSelectedItems("managePhotos"),s=[];t.getImagesForCurrentUser().then(function(n){var e=n.reduce(function(n,t){return o.indexOf(t.Id)>-1&&n++,n},0),h=e>0?recon_localisation.DialogDeleteImagesIncludeMainContent.replace("<#>",e):recon_localisation.DialogDeleteImagesContent;i.reset();i.setTitle(recon_localisation.dialogDeleteImageDialogHeader);i.setHtmlContent(h);i.setButtons("YesAndNo");i.confirmationFunction=i.closeDialog;i.yesFunction=function(){for(var l,a,c=[],e=0,h;h=o[e];e++)l=t.deleteImageById(h),c.push(l),s.push(h),angular.element("li[data-image-id="+h+"]").remove();for(i.toggleDialog(!1),n.splice(0,n.length),e=0;a=f[e];e++)a(s);r.all(c).then(function(){u.forceReloadGalleries()})};i.noFunction=i.closeDialog;i.toggleDialog(!0)})});e.selectableItemService=n;e.$watch("selectableItemService.selectedItems",function(){n.getSelectedItems("managePhotos").length>0?o.show():o.hide()},!0)}function o(n){f.push(n)}var f=[];return{init:e,listen:o}}angular.module("t101SharedModule").factory("t101RemovePhotoButtonService",n);n.$inject=["t101SelectableItemService","PhotoService","dialogService","$q","gallerySelectorService"]}(),function(){"use strict";function n(n,t,i){function r(r,u){r.gallerySelectorService=n;r.$watch("gallerySelectorService.selectedGallery[gallerySelector]",function(n){n&&(n.Type==0?u.show():u.hide())},!0);u.on("click",function(){i.reset();i.setButtons("Save");i.yesFunction=null;i.noFunction=null;i.setTitle(recon_localisation.dialogRenameGalleryDialogHeader);i.setHtmlContent('<fieldset style="margin-top: 0;"><label>'+recon_localisation.dialogRenameGalleryDialogText1+'<br><input type="text" minlength="1" maxlength="20" id="new_gallery_name" required inputmode="latin" style="width: 100%;"><\/label>'+recon_localisation.dialogRenameGalleryDialogText2+'<\/fieldset><p id="dialog-errors" class="error" style="margin-bottom: 0;"><\/p><br>');i.confirmationFunction=function(){var u=n.selectedGallery[r.gallerySelector],f=u.Name;u.Name=document.getElementById("new_gallery_name").value;t.updateGallery(u).then(function(t){n.forceReloadGalleries();n.selectGallery(t);i.closeDialog()}).catch(function(n){var t,i,r;for(u.Name=f,t="",i=0;r=n.data[i];i++)t+=r.Value+"<br>";document.getElementById("dialog-errors").innerHTML=t})};i.onAfterShow=function(){var t=angular.element("#new_gallery_name");t.on("keyup",function(n){n.keyCode==13&&i.confirmationFunction()});t.val(n.selectedGallery[r.gallerySelector].Name);t.focus()};i.toggleDialog(!0)})}return{init:r}}angular.module("t101SharedModule").factory("t101RenameGalleryService",n);n.$inject=["gallerySelectorService","GalleryService","dialogService"]}(),function(){function n(n,t){function i(i,r,u){r.on("click",function(){n.setImageDirty();var r=document.getElementById(u.target),f=new Image;f.onload=function(){var n=this,u=angular.element(r).css("max-height");angular.element(r).css("max-height",0);r.width=this.height;r.height=this.width;window.setTimeout(function(){var f=r.getContext("2d");f.save();f.translate(r.width/2,r.height/2);f.rotate(-.5*Math.PI);f.drawImage(n,r.height/-2,r.width/-2);f.restore();angular.element(r).css("max-height",u);r.onAfterEdit&&r.onAfterEdit();t.$$phase||i.$apply()},0)};f.src=r.toDataURL()})}return{init:i}}angular.module("t101SharedModule").factory("rotateLeftService",n);n.$inject=["saveService","$rootScope"]}(),function(){function n(n,t){function i(i,r,u){r.on("click",function(){n.setImageDirty();var r=document.getElementById(u.target),f=new Image;f.onload=function(){var u=this,n=angular.element(r).css("max-height");n>0&&angular.element(r).css("max-height",0);r.width=this.height;r.height=this.width;window.setTimeout(function(){var f=r.getContext("2d");f.save();f.translate(r.width/2,r.height/2);f.rotate(.5*Math.PI);f.drawImage(u,r.height/-2,r.width/-2);f.restore();n>0&&angular.element(r).css("max-height",n);r.onAfterEdit&&r.onAfterEdit();t.$$phase||i.$apply()},0)};f.src=r.toDataURL()})}return{init:i}}angular.module("t101SharedModule").factory("rotateRightService",n);n.$inject=["saveService","$rootScope"]}(),function(){function n(n){function c(n,i,r){f=n;t=i;e=r.target;t.hide();i.on("click",function(){o(!0)})}function o(){var u;if(i&&!r){r=!0;u=t.find("img").attr("src");t.find("img").attr("src","/Content/images/spinner.gif");t.find("button").attr("disabled",!0);var s=document.getElementById(e),o=s.toDataURL(),c=o.indexOf(";base64,"),l=o.substring(c+8);return i.data=l,n.saveBase64Image(i.Id,i).finally(function(){t.find("img").attr("src",u);t.find("button").attr("disabled",!1);r=!1;h();f.onAfterAction&&f.onAfterAction()})}}function s(n){i=n;t.hide();u=!1}function l(){t.show();u=!0}function a(){return u}function h(){u=!1;t.hide()}function v(n){i.Id=n;s(i)}function y(){return r}var f=null,i=null,t=null,r=!1,u=!1,e=null;return{init:c,setCurrentImage:s,setImageDirty:l,isImageDirty:a,saveImage:o,cleanImage:h,isProcessing:y,updateCurrentImageWithNewId:v}}angular.module("t101SharedModule").factory("saveService",n);n.$inject=["imageService"]}(),function(){"use strict";function n(){function n(n,t,i){t.on("click",function(n){var t="https://twitter.com/intent/tweet";return t+="?via="+encodeURIComponent(t101.settings.TwitterHandle),t+="&text="+encodeURIComponent(i.text),i.url&&(t+="&url="+encodeURIComponent(i.url.substr(0,4)=="http"?i.url:t101.settings.paths.siteUrl+"/"+i.url)),window.open(t,"twitterShare","innerwidth=690,innerheight=460,centerscreen=1,menubar=0,toolbar=0,location=0,personalbar=0,status=0,dialog=1",!1),n.preventDefault(),n.stopPropagation(),!1})}return{init:n}}angular.module("t101SharedModule").factory("twitterShareService",n)}(),function(){"use strict";function n(n,t,i,r){function u(u,f){f.hide();f.on("click",function(f){if(f.preventDefault(),f.stopPropagation(),t.getSelectedItems("managePhotos").length){var e=t.getSelectedItems("managePhotos")[0];r.getImagesForGallery(i.selectedGallery[u.gallerySelector]).then(function(t){for(var i=0,r=t.length;i<r;i++)if(t[i].Id==e){n.openTheatreWithIndex(i);break}})}else n.openTheatre();u.$apply()});u.gallerySelectorService=i;u.$watch("gallerySelectorService.selectedGallery[gallerySelector]",function(n){if(n){var t=null;t=n.Id==0?r.getImagesForCurrentUser():r.getImagesForGallery(n);t.then(function(n){n.length?f.show():f.hide()})}},!0)}return{init:u}}angular.module("t101SharedModule").factory("t101ViewPhotoButtonService",n);n.$inject=["theatreOverlayService","t101SelectableItemService","gallerySelectorService","PhotoService"]}(),function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){var o=!1,c=!1,w=0,b=2e3,u=0,a=["webkit","ms","moz","o"],t=window.requestAnimationFrame||!1,i=window.cancelAnimationFrame||!1,v,s,f,e;if(!t)for(v in a)s=a[v],t||(t=window[s+"RequestAnimationFrame"]),i||(i=window[s+"CancelAnimationFrame"]||window[s+"CancelRequestAnimationFrame"]);var r=window.MutationObserver||window.WebKitMutationObserver||!1,y={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"5px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:60,mousescrollstep:24,touchbehavior:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var n=document.getElementsByTagName("script"),n=n.length?n[n.length-1].src.split("?")[0]:"";return 0<n.split("/").length?n.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0},l=!1,k=function(){if(l)return l;var e=document.createElement("DIV"),i=e.style,t=navigator.userAgent,u=navigator.platform,n={haspointerlock:"pointerLockElement"in document||"webkitPointerLockElement"in document||"mozPointerLockElement"in document};for(n.isopera=("opera"in window),n.isopera12=n.isopera&&("getUserMedia"in navigator),n.isoperamini="[object OperaMini]"===Object.prototype.toString.call(window.operamini),n.isie=("all"in document)&&("attachEvent"in e)&&!n.isopera,n.isieold=n.isie&&!("msInterpolationMode"in i),n.isie7=n.isie&&!n.isieold&&(!("documentMode"in document)||7==document.documentMode),n.isie8=n.isie&&("documentMode"in document)&&8==document.documentMode,n.isie9=n.isie&&("performance"in window)&&9<=document.documentMode,n.isie10=n.isie&&("performance"in window)&&10==document.documentMode,n.isie11=("msRequestFullscreen"in e)&&11<=document.documentMode,n.isieedge=navigator.userAgent.match(/Edge\/12\./),n.isie9mobile=/iemobile.9/i.test(t),n.isie9mobile&&(n.isie9=!1),n.isie7mobile=!n.isie9mobile&&n.isie7&&/iemobile/i.test(t),n.ismozilla=("MozAppearance"in i),n.iswebkit=("WebkitAppearance"in i),n.ischrome=("chrome"in window),n.ischrome22=n.ischrome&&n.haspointerlock,n.ischrome26=n.ischrome&&("transition"in i),n.cantouch=("ontouchstart"in document.documentElement)||("ontouchstart"in window),n.hasmstouch=window.MSPointerEvent||!1,n.hasw3ctouch=(window.PointerEvent||!1)&&(0<navigator.MaxTouchPoints||0<navigator.msMaxTouchPoints),n.ismac=/^mac$/i.test(u),n.isios=n.cantouch&&/iphone|ipad|ipod/i.test(u),n.isios4=n.isios&&!("seal"in Object),n.isios7=n.isios&&("webkitHidden"in document),n.isandroid=/android/i.test(t),n.haseventlistener=("addEventListener"in e),n.trstyle=!1,n.hastransform=!1,n.hastranslate3d=!1,n.transitionstyle=!1,n.hastransition=!1,n.transitionend=!1,u=["transform","msTransform","webkitTransform","MozTransform","OTransform"],t=0;t<u.length;t++)if("undefined"!=typeof i[u[t]]){n.trstyle=u[t];break}n.hastransform=!!n.trstyle;n.hastransform&&(i[n.trstyle]="translate3d(1px,2px,3px)",n.hastranslate3d=/translate3d/.test(i[n.trstyle]));n.transitionstyle=!1;n.prefixstyle="";n.transitionend=!1;for(var u="transition webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),f=" -webkit- -ms- -moz- -o- -o -khtml-".split(" "),o="transitionend webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),t=0;t<u.length;t++)if(u[t]in i){n.transitionstyle=u[t];n.prefixstyle=f[t];n.transitionend=o[t];break}n.ischrome26&&(n.prefixstyle=f[1]);n.hastransition=n.transitionstyle;n:{for(t=["-webkit-grab","-moz-grab","grab"],(n.ischrome&&!n.ischrome22||n.isie)&&(t=[]),u=0;u<t.length;u++)if(f=t[u],i.cursor=f,i.cursor==f){i=f;break n}i="url(//mail.google.com/mail/images/2/openhand.cur),n-resize"}return n.cursorgrabvalue=i,n.hasmousecapture="setCapture"in e,n.hasMutationObserver=!1!==r,l=n},d=function(f,e){function nt(){var n=s.doc.css(h.trstyle);return n&&"matrix"==n.substr(0,6)?n.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function ut(){var n=s.win,t;if("zIndex"in n)return n.zIndex();for(;0<n.length&&9!=n[0].nodeType;){if(t=n.css("zIndex"),!isNaN(t)&&0!=t)return parseInt(t);n=n.parent()}return!1}function l(n,t,i){return t=n.css(t),n=parseFloat(t),isNaN(n)?(n=rt[t]||0,i=3==n?i?s.win.outerHeight()-s.win.innerHeight():s.win.outerWidth()-s.win.innerWidth():1,s.isie8&&n&&(n+=1),i?n:0):n}function tt(n,t,i,r){s._bind(n,t,function(r){r=r?r:window.event;var u={original:r,target:r.target||r.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==r.type?0:1,deltaX:0,deltaZ:0,preventDefault:function(){return r.preventDefault?r.preventDefault():r.returnValue=!1,!1},stopImmediatePropagation:function(){r.stopImmediatePropagation?r.stopImmediatePropagation():r.cancelBubble=!0}};return"mousewheel"==t?(u.deltaY=-.025*r.wheelDelta,r.wheelDeltaX&&(u.deltaX=-.025*r.wheelDeltaX)):u.deltaY=r.detail,i.call(n,u)},r)}function it(n,t,i){var r,u;if(0==n.deltaMode?(r=-Math.floor(s.opt.mousescrollstep/54*n.deltaX),u=-Math.floor(s.opt.mousescrollstep/54*n.deltaY)):1==n.deltaMode&&(r=-Math.floor(n.deltaX*s.opt.mousescrollstep),u=-Math.floor(n.deltaY*s.opt.mousescrollstep)),t&&s.opt.oneaxismousemode&&0==r&&u&&(r=u,u=0,i&&(0>r?s.getScrollLeft()>=s.page.maxw:0>=s.getScrollLeft())&&(u=r,r=0)),r&&(s.scrollmom&&s.scrollmom.stop(),s.lastdeltax+=r,s.debounced("mousewheelx",function(){var n=s.lastdeltax;s.lastdeltax=0;s.rail.drag||s.doScrollLeftBy(n)},15)),u){if(s.opt.nativeparentscrolling&&i&&!s.ispage&&!s.zoomactive)if(0>u){if(s.getScrollTop()>=s.page.maxh)return!0}else if(0>=s.getScrollTop())return!0;s.scrollmom&&s.scrollmom.stop();s.lastdeltay+=u;s.debounced("mousewheely",function(){var n=s.lastdeltay;s.lastdeltay=0;s.rail.drag||s.doScrollBy(n)},15)}return n.stopImmediatePropagation(),n.preventDefault()}var s=this,v,h,d,a,g,rt;if(this.version="3.6.6",this.name="nicescroll",this.me=e,this.opt={doc:n("body"),win:!1},n.extend(this.opt,y),this.opt.snapbackspeed=80,f)for(v in s.opt)"undefined"!=typeof f[v]&&(s.opt[v]=f[v]);this.iddoc=(this.doc=s.opt.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(s.opt.win?s.opt.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=!1!==s.opt.win;this.win=s.opt.win||(this.ispage?n(window):this.doc);this.docscroll=this.ispage&&!this.haswrapper?n(window):this.win;this.body=n("body");this.iframe=this.isfixed=this.viewport=!1;this.isiframe="IFRAME"==this.doc[0].nodeName&&"IFRAME"==this.win[0].nodeName;this.istextarea="TEXTAREA"==this.win[0].nodeName;this.forcescreen=!1;this.canshowonmouseevent="scroll"!=s.opt.autohidemode;this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;this.isrtlmode="auto"==this.opt.rtlmode?"rtl"==(this.win[0]==window?this.body:this.win).css("direction"):!0===this.opt.rtlmode;this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;do this.id="ascrail"+b++;while(document.getElementById(this.id));this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.visibility=!0;this.hidden=this.locked=this.railslocked=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=s.opt.overflowx;this.overflowy=s.opt.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=k();h=n.extend({},this.detected);this.ishwscroll=(this.canhwscroll=h.hastransform&&s.opt.hwacceleration)&&s.haswrapper;this.hasreversehr=this.isrtlmode&&!h.iswebkit;this.istouchcapable=!1;h.cantouch&&!h.isios&&!h.isandroid&&(h.iswebkit||h.ismozilla)&&(this.istouchcapable=!0,h.cantouch=!1);s.opt.enablemouselockapi||(h.hasmousecapture=!1,h.haspointerlock=!1);this.debounced=function(n,t,i){var r=s.delaylist[n];s.delaylist[n]=t;r||(s.debouncedelayed=setTimeout(function(){if(s){var t=s.delaylist[n];s.delaylist[n]=!1;t.call(s)}},i))};d=!1;this.synched=function(n,i){return s.synclist[n]=i,function(){d||(t(function(){var n,t;d=!1;for(n in s.synclist)t=s.synclist[n],t&&t.call(s),s.synclist[n]=!1}),d=!0)}(),n};this.unsynched=function(n){s.synclist[n]&&(s.synclist[n]=!1)};this.css=function(n,t){for(var i in t)s.saved.css.push([n,i,n.css(i)]),n.css(i,t[i])};this.scrollTop=function(n){return"undefined"==typeof n?s.getScrollTop():s.setScrollTop(n)};this.scrollLeft=function(n){return"undefined"==typeof n?s.getScrollLeft():s.setScrollLeft(n)};a=function(n,t,i,r,u,f,e){this.st=n;this.ed=t;this.spd=i;this.p1=r||0;this.p2=u||1;this.p3=f||0;this.p4=e||1;this.ts=(new Date).getTime();this.df=this.ed-this.st};a.prototype={B2:function(n){return 3*n*n*(1-n)},B3:function(n){return 3*n*(1-n)*(1-n)},B4:function(n){return(1-n)*(1-n)*(1-n)},getNow:function(){var n=1-((new Date).getTime()-this.ts)/this.spd,t=this.B2(n)+this.B3(n)+this.B4(n);return 0>n?this.ed:this.st+Math.round(this.df*t)},update:function(n,t){return this.st=this.getNow(),this.ed=n,this.spd=t,this.ts=(new Date).getTime(),this.df=this.ed-this.st,this}};this.ishwscroll?(this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"},h.hastranslate3d&&h.isios&&this.doc.css("-webkit-backface-visibility","hidden"),this.getScrollTop=function(n){if(!n){if(n=nt())return 16==n.length?-n[13]:-n[5];if(s.timerscroll&&s.timerscroll.bz)return s.timerscroll.bz.getNow()}return s.doc.translate.y},this.getScrollLeft=function(n){if(!n){if(n=nt())return 16==n.length?-n[12]:-n[4];if(s.timerscroll&&s.timerscroll.bh)return s.timerscroll.bh.getNow()}return s.doc.translate.x},this.notifyScrollEvent=function(n){var t=document.createEvent("UIEvents");t.initUIEvent("scroll",!1,!0,window,1);t.niceevent=!0;n.dispatchEvent(t)},g=this.isrtlmode?1:-1,h.hastranslate3d&&s.opt.enabletranslate3d?(this.setScrollTop=function(n,t){s.doc.translate.y=n;s.doc.translate.ty=-1*n+"px";s.doc.css(h.trstyle,"translate3d("+s.doc.translate.tx+","+s.doc.translate.ty+",0px)");t||s.notifyScrollEvent(s.win[0])},this.setScrollLeft=function(n,t){s.doc.translate.x=n;s.doc.translate.tx=n*g+"px";s.doc.css(h.trstyle,"translate3d("+s.doc.translate.tx+","+s.doc.translate.ty+",0px)");t||s.notifyScrollEvent(s.win[0])}):(this.setScrollTop=function(n,t){s.doc.translate.y=n;s.doc.translate.ty=-1*n+"px";s.doc.css(h.trstyle,"translate("+s.doc.translate.tx+","+s.doc.translate.ty+")");t||s.notifyScrollEvent(s.win[0])},this.setScrollLeft=function(n,t){s.doc.translate.x=n;s.doc.translate.tx=n*g+"px";s.doc.css(h.trstyle,"translate("+s.doc.translate.tx+","+s.doc.translate.ty+")");t||s.notifyScrollEvent(s.win[0])})):(this.getScrollTop=function(){return s.docscroll.scrollTop()},this.setScrollTop=function(n){return setTimeout(function(){s.docscroll.scrollTop(n)},1)},this.getScrollLeft=function(){return s.detected.ismozilla&&s.isrtlmode?Math.abs(s.docscroll.scrollLeft()):s.docscroll.scrollLeft()},this.setScrollLeft=function(n){return setTimeout(function(){s.docscroll.scrollLeft(s.detected.ismozilla&&s.isrtlmode?-n:n)},1)});this.getTarget=function(n){return n?n.target?n.target:n.srcElement?n.srcElement:!1:!1};this.hasParent=function(n,t){if(!n)return!1;for(var i=n.target||n.srcElement||n||!1;i&&i.id!=t;)i=i.parentNode||!1;return!1!==i};rt={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=function(){return{top:window.pageYOffset||document.documentElement.scrollTop,left:window.pageXOffset||document.documentElement.scrollLeft}};this.getOffset=function(){if(s.isfixed){var n=s.win.offset(),t=s.getDocumentScrollOffset();return n.top-=t.top,n.left-=t.left,n}return(n=s.win.offset(),!s.viewport)?n:(t=s.viewport.offset(),{top:n.top-t.top,left:n.left-t.left})};this.updateScrollBar=function(n){if(s.ishwscroll)s.rail.css({height:s.win.innerHeight()-(s.opt.railpadding.top+s.opt.railpadding.bottom)}),s.railh&&s.railh.css({width:s.win.innerWidth()-(s.opt.railpadding.left+s.opt.railpadding.right)});else{var u=s.getOffset(),r=u.top,i=u.left-(s.opt.railpadding.left+s.opt.railpadding.right),r=r+l(s.win,"border-top-width",!0),i=i+(s.rail.align?s.win.outerWidth()-l(s.win,"border-right-width")-s.rail.width:l(s.win,"border-left-width")),t=s.opt.railoffset;t&&(t.top&&(r+=t.top),t.left&&(i+=t.left));s.railslocked||s.rail.css({top:r,left:i,height:(n?n.h:s.win.innerHeight())-(s.opt.railpadding.top+s.opt.railpadding.bottom)});s.zoom&&s.zoom.css({top:r+1,left:1==s.rail.align?i-20:i+s.rail.width+4});s.railh&&!s.railslocked&&(r=u.top,i=u.left,(t=s.opt.railhoffset)&&(t.top&&(r+=t.top),t.left&&(i+=t.left)),n=s.railh.align?r+l(s.win,"border-top-width",!0)+s.win.innerHeight()-s.railh.height:r+l(s.win,"border-top-width",!0),i+=l(s.win,"border-left-width"),s.railh.css({top:n-(s.opt.railpadding.top+s.opt.railpadding.bottom),left:i,width:s.railh.width}))}};this.doRailClick=function(n,t,i){var r;s.railslocked||(s.cancelEvent(n),t?(t=i?s.doScrollLeft:s.doScrollTop,r=i?(n.pageX-s.railh.offset().left-s.cursorwidth/2)*s.scrollratio.x:(n.pageY-s.rail.offset().top-s.cursorheight/2)*s.scrollratio.y,t(r)):(t=i?s.doScrollLeftBy:s.doScrollBy,r=i?s.scroll.x:s.scroll.y,n=i?n.pageX-s.railh.offset().left:n.pageY-s.rail.offset().top,i=i?s.view.w:s.view.h,t(r>=n?i:-i)))};s.hasanimationframe=t;s.hascancelanimationframe=i;s.hasanimationframe?s.hascancelanimationframe||(i=function(){s.cancelAnimationFrame=!0}):(t=function(n){return setTimeout(n,15-Math.floor(+new Date/1e3)%16)},i=clearInterval);this.init=function(){var e,f,b,l,a,k,i,d,v,g,t,y;if(s.saved.css=[],h.isie7mobile||h.isoperamini)return!0;if(h.hasmstouch&&s.css(s.ispage?n("html"):s.win,{"-ms-touch-action":"none"}),s.zindex="auto",s.zindex=s.ispage||"auto"!=s.opt.zindex?s.opt.zindex:ut()||"auto",!s.ispage&&"auto"!=s.zindex&&s.zindex>u&&(u=s.zindex),s.isie&&0==s.zindex&&"auto"==s.opt.zindex&&(s.zindex="auto"),!s.ispage||!h.cantouch&&!h.isieold&&!h.isie9mobile){e=s.docscroll;s.ispage&&(e=s.haswrapper?s.win:s.doc);h.isie9mobile||s.css(e,{"overflow-y":"hidden"});s.ispage&&h.isie7&&("BODY"==s.doc[0].nodeName?s.css(n("html"),{"overflow-y":"hidden"}):"HTML"==s.doc[0].nodeName&&s.css(n("body"),{"overflow-y":"hidden"}));!h.isios||s.ispage||s.haswrapper||s.css(n("body"),{"-webkit-overflow-scrolling":"touch"});f=n(document.createElement("div"));f.css({position:"relative",top:0,float:"right",width:s.opt.cursorwidth,height:"0px","background-color":s.opt.cursorcolor,border:s.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":s.opt.cursorborderradius,"-moz-border-radius":s.opt.cursorborderradius,"border-radius":s.opt.cursorborderradius});f.hborder=parseFloat(f.outerHeight()-f.innerHeight());f.addClass("nicescroll-cursors");s.cursor=f;t=n(document.createElement("div"));t.attr("id",s.id);t.addClass("nicescroll-rails nicescroll-rails-vr");a=["left","right","top","bottom"];for(k in a)l=a[k],(b=s.opt.railpadding[l])?t.css("padding-"+l,b+"px"):s.opt.railpadding[l]=0;t.append(f);t.width=Math.max(parseFloat(s.opt.cursorwidth),f.outerWidth());t.css({width:t.width+"px",zIndex:s.zindex,background:s.opt.background,cursor:"default"});t.visibility=!0;t.scrollable=!0;t.align="left"==s.opt.railalign?0:1;s.rail=t;f=s.rail.drag=!1;!s.opt.boxzoom||s.ispage||h.isieold||(f=document.createElement("div"),s.bind(f,"click",s.doZoom),s.bind(f,"mouseenter",function(){s.zoom.css("opacity",s.opt.cursoropacitymax)}),s.bind(f,"mouseleave",function(){s.zoom.css("opacity",s.opt.cursoropacitymin)}),s.zoom=n(f),s.zoom.css({cursor:"pointer","z-index":s.zindex,backgroundImage:"url("+s.opt.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0px 0px"}),s.opt.dblclickzoom&&s.bind(s.win,"dblclick",s.doZoom),h.cantouch&&s.opt.gesturezoom&&(s.ongesturezoom=function(n){return 1.5<n.scale&&s.doZoomIn(n),.8>n.scale&&s.doZoomOut(n),s.cancelEvent(n)},s.bind(s.win,"gestureend",s.ongesturezoom)));s.railh=!1;s.opt.horizrailenabled&&(s.css(e,{"overflow-x":"hidden"}),f=n(document.createElement("div")),f.css({position:"absolute",top:0,height:s.opt.cursorwidth,width:"0px","background-color":s.opt.cursorcolor,border:s.opt.cursorborder,"background-clip":"padding-box","-webkit-border-radius":s.opt.cursorborderradius,"-moz-border-radius":s.opt.cursorborderradius,"border-radius":s.opt.cursorborderradius}),h.isieold&&f.css({overflow:"hidden"}),f.wborder=parseFloat(f.outerWidth()-f.innerWidth()),f.addClass("nicescroll-cursors"),s.cursorh=f,i=n(document.createElement("div")),i.attr("id",s.id+"-hr"),i.addClass("nicescroll-rails nicescroll-rails-hr"),i.height=Math.max(parseFloat(s.opt.cursorwidth),f.outerHeight()),i.css({height:i.height+"px",zIndex:s.zindex,background:s.opt.background}),i.append(f),i.visibility=!0,i.scrollable=!0,i.align="top"==s.opt.railvalign?0:1,s.railh=i,s.railh.drag=!1);s.ispage?(t.css({position:"fixed",top:"0px",height:"100%"}),t.align?t.css({right:"0px"}):t.css({left:"0px"}),s.body.append(t),s.railh&&(i.css({position:"fixed",left:"0px",width:"100%"}),i.align?i.css({bottom:"0px"}):i.css({top:"0px"}),s.body.append(i))):(s.ishwscroll?("static"==s.win.css("position")&&s.css(s.win,{position:"relative"}),e="HTML"==s.win[0].nodeName?s.body:s.win,n(e).scrollTop(0).scrollLeft(0),s.zoom&&(s.zoom.css({position:"absolute",top:1,right:0,"margin-right":t.width+4}),e.append(s.zoom)),t.css({position:"absolute",top:0}),t.align?t.css({right:0}):t.css({left:0}),e.append(t),i&&(i.css({position:"absolute",left:0,bottom:0}),i.align?i.css({bottom:0}):i.css({top:0}),e.append(i))):(s.isfixed="fixed"==s.win.css("position"),e=s.isfixed?"fixed":"absolute",s.isfixed||(s.viewport=s.getViewport(s.win[0])),s.viewport&&(s.body=s.viewport,0==/fixed|absolute/.test(s.viewport.css("position"))&&s.css(s.viewport,{position:"relative"})),t.css({position:e}),s.zoom&&s.zoom.css({position:e}),s.updateScrollBar(),s.body.append(t),s.zoom&&s.body.append(s.zoom),s.railh&&(i.css({position:e}),s.body.append(i))),h.isios&&s.css(s.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),h.isie&&s.opt.disableoutline&&s.win.attr("hideFocus","true"),h.iswebkit&&s.opt.disableoutline&&s.win.css({outline:"none"}));!1===s.opt.autohidemode?(s.autohidedom=!1,s.rail.css({opacity:s.opt.cursoropacitymax}),s.railh&&s.railh.css({opacity:s.opt.cursoropacitymax})):!0===s.opt.autohidemode||"leave"===s.opt.autohidemode?(s.autohidedom=n().add(s.rail),h.isie8&&(s.autohidedom=s.autohidedom.add(s.cursor)),s.railh&&(s.autohidedom=s.autohidedom.add(s.railh)),s.railh&&h.isie8&&(s.autohidedom=s.autohidedom.add(s.cursorh))):"scroll"==s.opt.autohidemode?(s.autohidedom=n().add(s.rail),s.railh&&(s.autohidedom=s.autohidedom.add(s.railh))):"cursor"==s.opt.autohidemode?(s.autohidedom=n().add(s.cursor),s.railh&&(s.autohidedom=s.autohidedom.add(s.cursorh))):"hidden"==s.opt.autohidemode&&(s.autohidedom=!1,s.hide(),s.railslocked=!1);h.isie9mobile?(s.scrollmom=new p(s),s.onmangotouch=function(){var n=s.getScrollTop(),t=s.getScrollLeft(),i,r;if(n==s.scrollmom.lastscrolly&&t==s.scrollmom.lastscrollx)return!0;if(i=n-s.mangotouch.sy,r=t-s.mangotouch.sx,0!=Math.round(Math.sqrt(Math.pow(r,2)+Math.pow(i,2)))){var f=0>i?-1:1,e=0>r?-1:1,u=+new Date;s.mangotouch.lazy&&clearTimeout(s.mangotouch.lazy);80<u-s.mangotouch.tm||s.mangotouch.dry!=f||s.mangotouch.drx!=e?(s.scrollmom.stop(),s.scrollmom.reset(t,n),s.mangotouch.sy=n,s.mangotouch.ly=n,s.mangotouch.sx=t,s.mangotouch.lx=t,s.mangotouch.dry=f,s.mangotouch.drx=e,s.mangotouch.tm=u):(s.scrollmom.stop(),s.scrollmom.update(s.mangotouch.sx-r,s.mangotouch.sy-i),s.mangotouch.tm=u,i=Math.max(Math.abs(s.mangotouch.ly-n),Math.abs(s.mangotouch.lx-t)),s.mangotouch.ly=n,s.mangotouch.lx=t,2<i&&(s.mangotouch.lazy=setTimeout(function(){s.mangotouch.lazy=!1;s.mangotouch.dry=0;s.mangotouch.drx=0;s.mangotouch.tm=0;s.scrollmom.doMomentum(30)},100)))}},t=s.getScrollTop(),i=s.getScrollLeft(),s.mangotouch={sy:t,ly:t,dry:0,sx:i,lx:i,drx:0,lazy:!1,tm:0},s.bind(s.docscroll,"scroll",s.onmangotouch)):((h.cantouch||s.istouchcapable||s.opt.touchbehavior||h.hasmstouch)&&(s.scrollmom=new p(s),s.ontouchstart=function(t){var i,r;if(t.pointerType&&2!=t.pointerType&&"touch"!=t.pointerType)return!1;if(s.hasmoving=!1,!s.railslocked){if(h.hasmstouch)for(i=t.target?t.target:!1;i;){if(r=n(i).getNiceScroll(),0<r.length&&r[0].me==s.me)break;if(0<r.length)return!1;if("DIV"==i.nodeName&&i.id==s.id)break;i=i.parentNode?i.parentNode:!1}if(s.cancelScroll(),(i=s.getTarget(t))&&/INPUT/i.test(i.nodeName)&&/range/i.test(i.type))return s.stopPropagation(t);if(!("clientX"in t)&&"changedTouches"in t&&(t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY),s.forcescreen&&(r=t,t={original:t.original?t.original:t},t.clientX=r.screenX,t.clientY=r.screenY),s.rail.drag={x:t.clientX,y:t.clientY,sx:s.scroll.x,sy:s.scroll.y,st:s.getScrollTop(),sl:s.getScrollLeft(),pt:2,dl:!1},s.ispage||!s.opt.directionlockdeadzone)s.rail.drag.dl="f";else{var r=n(window).width(),u=n(window).height(),u=Math.max(0,Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)-u),r=Math.max(0,Math.max(document.body.scrollWidth,document.documentElement.scrollWidth)-r);s.rail.drag.ck=!s.rail.scrollable&&s.railh.scrollable?0<u?"v":!1:s.rail.scrollable&&!s.railh.scrollable?0<r?"h":!1:!1;s.rail.drag.ck||(s.rail.drag.dl="f")}if(s.opt.touchbehavior&&s.isiframe&&h.isie&&(r=s.win.position(),s.rail.drag.x+=r.left,s.rail.drag.y+=r.top),s.hasmoving=!1,s.lastmouseup=!1,s.scrollmom.reset(t.clientX,t.clientY),!h.cantouch&&!this.istouchcapable&&!t.pointerType){if(!i||!/INPUT|SELECT|TEXTAREA/i.test(i.nodeName))return!s.ispage&&h.hasmousecapture&&i.setCapture(),s.opt.touchbehavior?(i.onclick&&!i._onclick&&(i._onclick=i.onclick,i.onclick=function(n){if(s.hasmoving)return!1;i._onclick.call(this,n)}),s.cancelEvent(t)):s.stopPropagation(t);/SUBMIT|CANCEL|BUTTON/i.test(n(i).attr("type"))&&(pc={tg:i,click:!1},s.preventclick=pc)}}},s.ontouchend=function(n){if(!s.rail.drag)return!0;if(2==s.rail.drag.pt){if(n.pointerType&&2!=n.pointerType&&"touch"!=n.pointerType)return!1;if(s.scrollmom.doMomentum(),s.rail.drag=!1,s.hasmoving&&(s.lastmouseup=!0,s.hideCursor(),h.hasmousecapture&&document.releaseCapture(),!h.cantouch))return s.cancelEvent(n)}else if(1==s.rail.drag.pt)return s.onmouseup(n)},d=s.opt.touchbehavior&&s.isiframe&&!h.hasmousecapture,s.ontouchmove=function(t,i){var r,e,c,f,o,l;if(!s.rail.drag||t.targetTouches&&s.opt.preventmultitouchscrolling&&1<t.targetTouches.length||t.pointerType&&2!=t.pointerType&&"touch"!=t.pointerType)return!1;if(2==s.rail.drag.pt){if(h.cantouch&&h.isios&&"undefined"==typeof t.original)return!0;s.hasmoving=!0;s.preventclick&&!s.preventclick.click&&(s.preventclick.click=s.preventclick.tg.onclick||!1,s.preventclick.tg.onclick=s.onpreventclick);t=n.extend({original:t},t);"changedTouches"in t&&(t.clientX=t.changedTouches[0].clientX,t.clientY=t.changedTouches[0].clientY);s.forcescreen&&(e=t,t={original:t.original?t.original:t},t.clientX=e.screenX,t.clientY=e.screenY);e=r=0;d&&!i&&(r=s.win.position(),e=-r.left,r=-r.top);c=t.clientY+r;r=c-s.rail.drag.y;var a=t.clientX+e,o=a-s.rail.drag.x,u=s.rail.drag.st-r;if(s.ishwscroll&&s.opt.bouncescroll?0>u?u=Math.round(u/2):u>s.page.maxh&&(u=s.page.maxh+Math.round((u-s.page.maxh)/2)):(0>u&&(c=u=0),u>s.page.maxh&&(u=s.page.maxh,c=0)),s.railh&&s.railh.scrollable&&(f=s.isrtlmode?o-s.rail.drag.sl:s.rail.drag.sl-o,s.ishwscroll&&s.opt.bouncescroll?0>f?f=Math.round(f/2):f>s.page.maxw&&(f=s.page.maxw+Math.round((f-s.page.maxw)/2)):(0>f&&(a=f=0),f>s.page.maxw&&(f=s.page.maxw,a=0))),e=!1,s.rail.drag.dl)e=!0,"v"==s.rail.drag.dl?f=s.rail.drag.sl:"h"==s.rail.drag.dl&&(u=s.rail.drag.st);else if(r=Math.abs(r),o=Math.abs(o),l=s.opt.directionlockdeadzone,"v"==s.rail.drag.ck){if(r>l&&o<=.3*r)return s.rail.drag=!1,!0;o>l&&(s.rail.drag.dl="f",n("body").scrollTop(n("body").scrollTop()))}else if("h"==s.rail.drag.ck){if(o>l&&r<=.3*o)return s.rail.drag=!1,!0;r>l&&(s.rail.drag.dl="f",n("body").scrollLeft(n("body").scrollLeft()))}if(s.synched("touchmove",function(){s.rail.drag&&2==s.rail.drag.pt&&(s.prepareTransition&&s.prepareTransition(0),s.rail.scrollable&&s.setScrollTop(u),s.scrollmom.update(a,c),s.railh&&s.railh.scrollable?(s.setScrollLeft(f),s.showCursor(u,f)):s.showCursor(u),h.isie10&&document.selection.clear())}),h.ischrome&&s.istouchcapable&&(e=!1),e)return s.cancelEvent(t)}else if(1==s.rail.drag.pt)return s.onmousemove(t)}),s.onmousedown=function(n,t){if(!s.rail.drag||1==s.rail.drag.pt){if(s.railslocked)return s.cancelEvent(n);s.cancelScroll();s.rail.drag={x:n.clientX,y:n.clientY,sx:s.scroll.x,sy:s.scroll.y,pt:1,hr:!!t};var i=s.getTarget(n);return!s.ispage&&h.hasmousecapture&&i.setCapture(),s.isiframe&&!h.hasmousecapture&&(s.saved.csspointerevents=s.doc.css("pointer-events"),s.css(s.doc,{"pointer-events":"none"})),s.hasmoving=!1,s.cancelEvent(n)}},s.onmouseup=function(n){if(s.rail.drag)return 1!=s.rail.drag.pt?!0:(h.hasmousecapture&&document.releaseCapture(),s.isiframe&&!h.hasmousecapture&&s.doc.css("pointer-events",s.saved.csspointerevents),s.rail.drag=!1,s.hasmoving&&s.triggerScrollEnd(),s.cancelEvent(n))},s.onmousemove=function(n){if(s.rail.drag){if(1==s.rail.drag.pt){if(h.ischrome&&0==n.which)return s.onmouseup(n);if(s.cursorfreezed=!0,s.hasmoving=!0,s.rail.drag.hr){s.scroll.x=s.rail.drag.sx+(n.clientX-s.rail.drag.x);0>s.scroll.x&&(s.scroll.x=0);var t=s.scrollvaluemaxw;s.scroll.x>t&&(s.scroll.x=t)}else s.scroll.y=s.rail.drag.sy+(n.clientY-s.rail.drag.y),0>s.scroll.y&&(s.scroll.y=0),t=s.scrollvaluemax,s.scroll.y>t&&(s.scroll.y=t);return s.synched("mousemove",function(){s.rail.drag&&1==s.rail.drag.pt&&(s.showCursor(),s.rail.drag.hr?s.hasreversehr?s.doScrollLeft(s.scrollvaluemaxw-Math.round(s.scroll.x*s.scrollratio.x),s.opt.cursordragspeed):s.doScrollLeft(Math.round(s.scroll.x*s.scrollratio.x),s.opt.cursordragspeed):s.doScrollTop(Math.round(s.scroll.y*s.scrollratio.y),s.opt.cursordragspeed))}),s.cancelEvent(n)}}else s.checkarea=0},h.cantouch||s.opt.touchbehavior?(s.onpreventclick=function(n){if(s.preventclick)return s.preventclick.tg.onclick=s.preventclick.click,s.preventclick=!1,s.cancelEvent(n)},s.bind(s.win,"mousedown",s.ontouchstart),s.onclick=h.isios?!1:function(n){return s.lastmouseup?(s.lastmouseup=!1,s.cancelEvent(n)):!0},s.opt.grabcursorenabled&&h.cursorgrabvalue&&(s.css(s.ispage?s.doc:s.win,{cursor:h.cursorgrabvalue}),s.css(s.rail,{cursor:h.cursorgrabvalue}))):(v=function(n){if(s.selectiondrag){if(n){var t=s.win.outerHeight();n=n.pageY-s.selectiondrag.top;0<n&&n<t&&(n=0);n>=t&&(n-=t);s.selectiondrag.df=n}0!=s.selectiondrag.df&&(s.doScrollBy(2*-Math.floor(s.selectiondrag.df/6)),s.debounced("doselectionscroll",function(){v()},50))}},s.hasTextSelected="getSelection"in document?function(){return 0<document.getSelection().rangeCount}:"selection"in document?function(){return"None"!=document.selection.type}:function(){return!1},s.onselectionstart=function(){s.ispage||(s.selectiondrag=s.win.offset())},s.onselectionend=function(){s.selectiondrag=!1},s.onselectiondrag=function(n){s.selectiondrag&&s.hasTextSelected()&&s.debounced("selectionscroll",function(){v(n)},250)}),h.hasw3ctouch?(s.css(s.rail,{"touch-action":"none"}),s.css(s.cursor,{"touch-action":"none"}),s.bind(s.win,"pointerdown",s.ontouchstart),s.bind(document,"pointerup",s.ontouchend),s.bind(document,"pointermove",s.ontouchmove)):h.hasmstouch?(s.css(s.rail,{"-ms-touch-action":"none"}),s.css(s.cursor,{"-ms-touch-action":"none"}),s.bind(s.win,"MSPointerDown",s.ontouchstart),s.bind(document,"MSPointerUp",s.ontouchend),s.bind(document,"MSPointerMove",s.ontouchmove),s.bind(s.cursor,"MSGestureHold",function(n){n.preventDefault()}),s.bind(s.cursor,"contextmenu",function(n){n.preventDefault()})):this.istouchcapable&&(s.bind(s.win,"touchstart",s.ontouchstart),s.bind(document,"touchend",s.ontouchend),s.bind(document,"touchcancel",s.ontouchend),s.bind(document,"touchmove",s.ontouchmove)),!s.opt.cursordragontouch&&(h.cantouch||s.opt.touchbehavior)||(s.rail.css({cursor:"default"}),s.railh&&s.railh.css({cursor:"default"}),s.jqbind(s.rail,"mouseenter",function(){if(!s.ispage&&!s.win.is(":visible"))return!1;s.canshowonmouseevent&&s.showCursor();s.rail.active=!0}),s.jqbind(s.rail,"mouseleave",function(){s.rail.active=!1;s.rail.drag||s.hideCursor()}),s.opt.sensitiverail&&(s.bind(s.rail,"click",function(n){s.doRailClick(n,!1,!1)}),s.bind(s.rail,"dblclick",function(n){s.doRailClick(n,!0,!1)}),s.bind(s.cursor,"click",function(n){s.cancelEvent(n)}),s.bind(s.cursor,"dblclick",function(n){s.cancelEvent(n)})),s.railh&&(s.jqbind(s.railh,"mouseenter",function(){if(!s.ispage&&!s.win.is(":visible"))return!1;s.canshowonmouseevent&&s.showCursor();s.rail.active=!0}),s.jqbind(s.railh,"mouseleave",function(){s.rail.active=!1;s.rail.drag||s.hideCursor()}),s.opt.sensitiverail&&(s.bind(s.railh,"click",function(n){s.doRailClick(n,!1,!0)}),s.bind(s.railh,"dblclick",function(n){s.doRailClick(n,!0,!0)}),s.bind(s.cursorh,"click",function(n){s.cancelEvent(n)}),s.bind(s.cursorh,"dblclick",function(n){s.cancelEvent(n)})))),h.cantouch||s.opt.touchbehavior?(s.bind(h.hasmousecapture?s.win:document,"mouseup",s.ontouchend),s.bind(document,"mousemove",s.ontouchmove),s.onclick&&s.bind(document,"click",s.onclick),s.opt.cursordragontouch&&(s.bind(s.cursor,"mousedown",s.onmousedown),s.bind(s.cursor,"mouseup",s.onmouseup),s.cursorh&&s.bind(s.cursorh,"mousedown",function(n){s.onmousedown(n,!0)}),s.cursorh&&s.bind(s.cursorh,"mouseup",s.onmouseup))):(s.bind(h.hasmousecapture?s.win:document,"mouseup",s.onmouseup),s.bind(document,"mousemove",s.onmousemove),s.onclick&&s.bind(document,"click",s.onclick),s.bind(s.cursor,"mousedown",s.onmousedown),s.bind(s.cursor,"mouseup",s.onmouseup),s.railh&&(s.bind(s.cursorh,"mousedown",function(n){s.onmousedown(n,!0)}),s.bind(s.cursorh,"mouseup",s.onmouseup)),!s.ispage&&s.opt.enablescrollonselection&&(s.bind(s.win[0],"mousedown",s.onselectionstart),s.bind(document,"mouseup",s.onselectionend),s.bind(s.cursor,"mouseup",s.onselectionend),s.cursorh&&s.bind(s.cursorh,"mouseup",s.onselectionend),s.bind(document,"mousemove",s.onselectiondrag)),s.zoom&&(s.jqbind(s.zoom,"mouseenter",function(){s.canshowonmouseevent&&s.showCursor();s.rail.active=!0}),s.jqbind(s.zoom,"mouseleave",function(){s.rail.active=!1;s.rail.drag||s.hideCursor()}))),s.opt.enablemousewheel&&(s.isiframe||s.bind(h.isie&&s.ispage?document:s.win,"mousewheel",s.onmousewheel),s.bind(s.rail,"mousewheel",s.onmousewheel),s.railh&&s.bind(s.railh,"mousewheel",s.onmousewheelhr)),s.ispage||h.cantouch||/HTML|^BODY/.test(s.win[0].nodeName)||(s.win.attr("tabindex")||s.win.attr({tabindex:w++}),s.jqbind(s.win,"focus",function(n){o=s.getTarget(n).id||!0;s.hasfocus=!0;s.canshowonmouseevent&&s.noticeCursor()}),s.jqbind(s.win,"blur",function(){o=!1;s.hasfocus=!1}),s.jqbind(s.win,"mouseenter",function(n){c=s.getTarget(n).id||!0;s.hasmousefocus=!0;s.canshowonmouseevent&&s.noticeCursor()}),s.jqbind(s.win,"mouseleave",function(){c=!1;s.hasmousefocus=!1;s.rail.drag||s.hideCursor()})));s.onkeypress=function(t){var r;if(s.railslocked&&0==s.page.maxh||(t=t?t:window.e,r=s.getTarget(t),r&&/INPUT|TEXTAREA|SELECT|OPTION/.test(r.nodeName)&&(!r.getAttribute("type")&&!r.type||!/submit|button|cancel/i.tp)||n(r).attr("contenteditable")))return!0;if(s.hasfocus||s.hasmousefocus&&!o||s.ispage&&!o&&!c){if(r=t.keyCode,s.railslocked&&27!=r)return s.cancelEvent(t);var u=t.ctrlKey||!1,f=t.shiftKey||!1,i=!1;switch(r){case 38:case 63233:s.doScrollBy(72);i=!0;break;case 40:case 63235:s.doScrollBy(-72);i=!0;break;case 37:case 63232:s.railh&&(u?s.doScrollLeft(0):s.doScrollLeftBy(72),i=!0);break;case 39:case 63234:s.railh&&(u?s.doScrollLeft(s.page.maxw):s.doScrollLeftBy(-72),i=!0);break;case 33:case 63276:s.doScrollBy(s.view.h);i=!0;break;case 34:case 63277:s.doScrollBy(-s.view.h);i=!0;break;case 36:case 63273:s.railh&&u?s.doScrollPos(0,0):s.doScrollTo(0);i=!0;break;case 35:case 63275:s.railh&&u?s.doScrollPos(s.page.maxw,s.page.maxh):s.doScrollTo(s.page.maxh);i=!0;break;case 32:s.opt.spacebarenabled&&(f?s.doScrollBy(s.view.h):s.doScrollBy(-s.view.h),i=!0);break;case 27:s.zoomactive&&(s.doZoom(),i=!0)}if(i)return s.cancelEvent(t)}};s.opt.enablekeyboard&&s.bind(document,h.isopera&&!h.isopera12?"keypress":"keydown",s.onkeypress);s.bind(document,"keydown",function(n){n.ctrlKey&&(s.wheelprevented=!0)});s.bind(document,"keyup",function(n){n.ctrlKey||(s.wheelprevented=!1)});s.bind(window,"blur",function(){s.wheelprevented=!1});s.bind(window,"resize",s.lazyResize);s.bind(window,"orientationchange",s.lazyResize);s.bind(window,"load",s.lazyResize);!h.ischrome||s.ispage||s.haswrapper||(g=s.win.attr("style"),t=parseFloat(s.win.css("width"))+1,s.win.css("width",t),s.synched("chromefix",function(){s.win.attr("style",g)}));s.onAttributeChange=function(){s.lazyResize(s.isieold?250:30)};!1!==r&&(s.observerbody=new r(function(t){return t.forEach(function(t){if("attributes"==t.type)return n("body").hasClass("modal-open")&&!n.contains(n(".modal-dialog")[0],s.doc[0])?s.hide():s.show()}),document.body.scrollHeight!=s.page.maxh?s.lazyResize(30):void 0}),s.observerbody.observe(document.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]}));s.ispage||s.haswrapper||(!1!==r?(s.observer=new r(function(n){n.forEach(s.onAttributeChange)}),s.observer.observe(s.win[0],{childList:!0,characterData:!1,attributes:!0,subtree:!1}),s.observerremover=new r(function(n){n.forEach(function(n){if(0<n.removedNodes.length)for(var t in n.removedNodes)if(s&&n.removedNodes[t]==s.win[0])return s.remove()})}),s.observerremover.observe(s.win[0].parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(s.bind(s.win,h.isie&&!h.isie9?"propertychange":"DOMAttrModified",s.onAttributeChange),h.isie9&&s.win[0].attachEvent("onpropertychange",s.onAttributeChange),s.bind(s.win,"DOMNodeRemoved",function(n){n.target==s.win[0]&&s.remove()})));!s.ispage&&s.opt.boxzoom&&s.bind(window,"resize",s.resizeZoom);s.istextarea&&(s.bind(s.win,"keydown",s.lazyResize),s.bind(s.win,"mouseup",s.lazyResize));s.lazyResize(30)}"IFRAME"==this.doc[0].nodeName&&(y=function(){var t,i;s.iframexd=!1;try{t="contentDocument"in this?this.contentDocument:this.contentWindow.document}catch(r){s.iframexd=!0;t=!1}if(s.iframexd)return"console"in window&&console.log("NiceScroll error: policy restriced iframe"),!0;s.forcescreen=!0;s.isiframe&&(s.iframe={doc:n(t),html:s.doc.contents().find("html")[0],body:s.doc.contents().find("body")[0]},s.getContentSize=function(){return{w:Math.max(s.iframe.html.scrollWidth,s.iframe.body.scrollWidth),h:Math.max(s.iframe.html.scrollHeight,s.iframe.body.scrollHeight)}},s.docscroll=n(s.iframe.body));h.isios||!s.opt.iframeautoresize||s.isiframe||(s.win.scrollTop(0),s.doc.height(""),i=Math.max(t.getElementsByTagName("html")[0].scrollHeight,t.body.scrollHeight),s.doc.height(i));s.lazyResize(30);h.isie7&&s.css(n(s.iframe.html),{"overflow-y":"hidden"});s.css(n(s.iframe.body),{"overflow-y":"hidden"});h.isios&&s.haswrapper&&s.css(n(t.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?s.bind(this.contentWindow,"scroll",s.onscroll):s.bind(t,"scroll",s.onscroll);s.opt.enablemousewheel&&s.bind(t,"mousewheel",s.onmousewheel);s.opt.enablekeyboard&&s.bind(t,h.isopera?"keypress":"keydown",s.onkeypress);(h.cantouch||s.opt.touchbehavior)&&(s.bind(t,"mousedown",s.ontouchstart),s.bind(t,"mousemove",function(n){return s.ontouchmove(n,!0)}),s.opt.grabcursorenabled&&h.cursorgrabvalue&&s.css(n(t.body),{cursor:h.cursorgrabvalue}));s.bind(t,"mouseup",s.ontouchend);s.zoom&&(s.opt.dblclickzoom&&s.bind(t,"dblclick",s.doZoom),s.ongesturezoom&&s.bind(t,"gestureend",s.ongesturezoom))},this.doc[0].readyState&&"complete"==this.doc[0].readyState&&setTimeout(function(){y.call(s.doc[0],!1)},500),s.bind(this.doc,"load",y))};this.showCursor=function(n,t){if(s.cursortimeout&&(clearTimeout(s.cursortimeout),s.cursortimeout=0),s.rail){if(s.autohidedom&&(s.autohidedom.stop().css({opacity:s.opt.cursoropacitymax}),s.cursoractive=!0),s.rail.drag&&1==s.rail.drag.pt||("undefined"!=typeof n&&!1!==n&&(s.scroll.y=Math.round(1*n/s.scrollratio.y)),"undefined"!=typeof t&&(s.scroll.x=Math.round(1*t/s.scrollratio.x))),s.cursor.css({height:s.cursorheight,top:s.scroll.y}),s.cursorh){var i=s.hasreversehr?s.scrollvaluemaxw-s.scroll.x:s.scroll.x;!s.rail.align&&s.rail.visibility?s.cursorh.css({width:s.cursorwidth,left:i+s.rail.width}):s.cursorh.css({width:s.cursorwidth,left:i});s.cursoractive=!0}s.zoom&&s.zoom.stop().css({opacity:s.opt.cursoropacitymax})}};this.hideCursor=function(n){s.cursortimeout||!s.rail||!s.autohidedom||s.hasmousefocus&&"leave"==s.opt.autohidemode||(s.cursortimeout=setTimeout(function(){s.rail.active&&s.showonmouseevent||(s.autohidedom.stop().animate({opacity:s.opt.cursoropacitymin}),s.zoom&&s.zoom.stop().animate({opacity:s.opt.cursoropacitymin}),s.cursoractive=!1);s.cursortimeout=0},n||s.opt.hidecursordelay))};this.noticeCursor=function(n,t,i){s.showCursor(t,i);s.rail.active||s.hideCursor(n)};this.getContentSize=s.ispage?function(){return{w:Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),h:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}}:s.haswrapper?function(){return{w:s.doc.outerWidth()+parseInt(s.win.css("paddingLeft"))+parseInt(s.win.css("paddingRight")),h:s.doc.outerHeight()+parseInt(s.win.css("paddingTop"))+parseInt(s.win.css("paddingBottom"))}}:function(){return{w:s.docscroll[0].scrollWidth,h:s.docscroll[0].scrollHeight}};this.onResize=function(n,t){if(!s||!s.win)return!1;if(!s.haswrapper&&!s.ispage){if("none"==s.win.css("display"))return s.visibility&&s.hideRail().hideRailHr(),!1;s.hidden||s.visibility||s.showRail().showRailHr()}var i=s.page.maxh,r=s.page.maxw,u=s.view.h,f=s.view.w;if(s.view={w:s.ispage?s.win.width():parseInt(s.win[0].clientWidth),h:s.ispage?s.win.height():parseInt(s.win[0].clientHeight)},s.page=t?t:s.getContentSize(),s.page.maxh=Math.max(0,s.page.h-s.view.h),s.page.maxw=Math.max(0,s.page.w-s.view.w),s.page.maxh==i&&s.page.maxw==r&&s.view.w==f&&s.view.h==u){if(s.ispage||(i=s.win.offset(),s.lastposition&&(r=s.lastposition,r.top==i.top&&r.left==i.left)))return s;s.lastposition=i}return(0==s.page.maxh?(s.hideRail(),s.scrollvaluemax=0,s.scroll.y=0,s.scrollratio.y=0,s.cursorheight=0,s.setScrollTop(0),s.rail&&(s.rail.scrollable=!1)):(s.page.maxh-=s.opt.railpadding.top+s.opt.railpadding.bottom,s.rail.scrollable=!0),0==s.page.maxw?(s.hideRailHr(),s.scrollvaluemaxw=0,s.scroll.x=0,s.scrollratio.x=0,s.cursorwidth=0,s.setScrollLeft(0),s.railh&&(s.railh.scrollable=!1)):(s.page.maxw-=s.opt.railpadding.left+s.opt.railpadding.right,s.railh&&(s.railh.scrollable=s.opt.horizrailenabled)),s.railslocked=s.locked||0==s.page.maxh&&0==s.page.maxw,s.railslocked)?(s.ispage||s.updateScrollBar(s.view),!1):(s.hidden||s.visibility?!s.railh||s.hidden||s.railh.visibility||s.showRailHr():s.showRail().showRailHr(),s.istextarea&&s.win.css("resize")&&"none"!=s.win.css("resize")&&(s.view.h-=20),s.cursorheight=Math.min(s.view.h,Math.round(s.view.h/s.page.h*s.view.h)),s.cursorheight=s.opt.cursorfixedheight?s.opt.cursorfixedheight:Math.max(s.opt.cursorminheight,s.cursorheight),s.cursorwidth=Math.min(s.view.w,Math.round(s.view.w/s.page.w*s.view.w)),s.cursorwidth=s.opt.cursorfixedheight?s.opt.cursorfixedheight:Math.max(s.opt.cursorminheight,s.cursorwidth),s.scrollvaluemax=s.view.h-s.cursorheight-s.cursor.hborder-(s.opt.railpadding.top+s.opt.railpadding.bottom),s.railh&&(s.railh.width=0<s.page.maxh?s.view.w-s.rail.width:s.view.w,s.scrollvaluemaxw=s.railh.width-s.cursorwidth-s.cursorh.wborder-(s.opt.railpadding.left+s.opt.railpadding.right)),s.ispage||s.updateScrollBar(s.view),s.scrollratio={x:s.page.maxw/s.scrollvaluemaxw,y:s.page.maxh/s.scrollvaluemax},s.getScrollTop()>s.page.maxh?s.doScrollTop(s.page.maxh):(s.scroll.y=Math.round(s.getScrollTop()*(1/s.scrollratio.y)),s.scroll.x=Math.round(s.getScrollLeft()*(1/s.scrollratio.x)),s.cursoractive&&s.noticeCursor()),s.scroll.y&&0==s.getScrollTop()&&s.doScrollTo(Math.floor(s.scroll.y*s.scrollratio.y)),s)};this.resize=s.onResize;this.lazyResize=function(n){return n=isNaN(n)?30:n,s.debounced("resize",s.resize,n),s};this.jqbind=function(t,i,r){s.events.push({e:t,n:i,f:r,q:!0});n(t).bind(i,r)};this.bind=function(n,t,i,r){var u="jquery"in n?n[0]:n;"mousewheel"==t?"onwheel"in s.win?s._bind(u,"wheel",i,r||!1):(n="undefined"!=typeof document.onmousewheel?"mousewheel":"DOMMouseScroll",tt(u,n,i,r||!1),"DOMMouseScroll"==n&&tt(u,"MozMousePixelScroll",i,r||!1)):u.addEventListener?(h.cantouch&&/mouseup|mousedown|mousemove/.test(t)&&s._bind(u,"mousedown"==t?"touchstart":"mouseup"==t?"touchend":"touchmove",function(n){if(n.touches){if(2>n.touches.length){var t=n.touches.length?n.touches[0]:n;t.original=n;i.call(this,t)}}else n.changedTouches&&(t=n.changedTouches[0],t.original=n,i.call(this,t))},r||!1),s._bind(u,t,i,r||!1),h.cantouch&&"mouseup"==t&&s._bind(u,"touchcancel",i,r||!1)):s._bind(u,t,function(n){return(n=n||window.event||!1)&&n.srcElement&&(n.target=n.srcElement),"pageY"in n||(n.pageX=n.clientX+document.documentElement.scrollLeft,n.pageY=n.clientY+document.documentElement.scrollTop),!1===i.call(u,n)||!1===r?s.cancelEvent(n):!0})};h.haseventlistener?(this._bind=function(n,t,i,r){s.events.push({e:n,n:t,f:i,b:r,q:!1});n.addEventListener(t,i,r||!1)},this.cancelEvent=function(n){return n?(n=n.original?n.original:n,n.preventDefault(),n.stopPropagation(),n.preventManipulation&&n.preventManipulation(),!1):!1},this.stopPropagation=function(n){return n?(n=n.original?n.original:n,n.stopPropagation(),!1):!1},this._unbind=function(n,t,i,r){n.removeEventListener(t,i,r)}):(this._bind=function(n,t,i,r){s.events.push({e:n,n:t,f:i,b:r,q:!1});n.attachEvent?n.attachEvent("on"+t,i):n["on"+t]=i},this.cancelEvent=function(n){return(n=window.event||!1,!n)?!1:(n.cancelBubble=!0,n.cancel=!0,n.returnValue=!1)},this.stopPropagation=function(n){return(n=window.event||!1,!n)?!1:(n.cancelBubble=!0,!1)},this._unbind=function(n,t,i){n.detachEvent?n.detachEvent("on"+t,i):n["on"+t]=!1});this.unbindAll=function(){for(var n,t=0;t<s.events.length;t++)n=s.events[t],n.q?n.e.unbind(n.n,n.f):s._unbind(n.e,n.n,n.f,n.b)};this.showRail=function(){return 0!=s.page.maxh&&(s.ispage||"none"!=s.win.css("display"))&&(s.visibility=!0,s.rail.visibility=!0,s.rail.css("display","block")),s};this.showRailHr=function(){return s.railh?(0!=s.page.maxw&&(s.ispage||"none"!=s.win.css("display"))&&(s.railh.visibility=!0,s.railh.css("display","block")),s):s};this.hideRail=function(){return s.visibility=!1,s.rail.visibility=!1,s.rail.css("display","none"),s};this.hideRailHr=function(){return s.railh?(s.railh.visibility=!1,s.railh.css("display","none"),s):s};this.show=function(){return s.hidden=!1,s.railslocked=!1,s.showRail().showRailHr()};this.hide=function(){return s.hidden=!0,s.railslocked=!0,s.hideRail().hideRailHr()};this.toggle=function(){return s.hidden?s.show():s.hide()};this.remove=function(){var r,i,t,u;for(s.stop(),s.cursortimeout&&clearTimeout(s.cursortimeout),s.debouncedelayed&&clearTimeout(s.debouncedelayed),s.doZoomOut(),s.unbindAll(),h.isie9&&s.win[0].detachEvent("onpropertychange",s.onAttributeChange),!1!==s.observer&&s.observer.disconnect(),!1!==s.observerremover&&s.observerremover.disconnect(),!1!==s.observerbody&&s.observerbody.disconnect(),s.events=null,s.cursor&&s.cursor.remove(),s.cursorh&&s.cursorh.remove(),s.rail&&s.rail.remove(),s.railh&&s.railh.remove(),s.zoom&&s.zoom.remove(),r=0;r<s.saved.css.length;r++)i=s.saved.css[r],i[0].css(i[1],"undefined"==typeof i[2]?"":i[2]);s.saved=!1;s.me.data("__nicescroll","");t=n.nicescroll;t.each(function(n){if(this&&this.id===s.id){delete t[n];for(var i=++n;i<t.length;i++,n++)t[n]=t[i];t.length--;t.length&&delete t[t.length]}});for(u in s)s[u]=null,delete s[u];s=null};this.scrollstart=function(n){return this.onscrollstart=n,s};this.scrollend=function(n){return this.onscrollend=n,s};this.scrollcancel=function(n){return this.onscrollcancel=n,s};this.zoomin=function(n){return this.onzoomin=n,s};this.zoomout=function(n){return this.onzoomout=n,s};this.isScrollable=function(t){if(t=t.target?t.target:t,"OPTION"==t.nodeName)return!0;for(;t&&1==t.nodeType&&!/^BODY|HTML/.test(t.nodeName);){var i=n(t),i=i.css("overflowY")||i.css("overflowX")||i.css("overflow")||"";if(/scroll|auto/.test(i))return t.clientHeight!=t.scrollHeight;t=t.parentNode?t.parentNode:!1}return!1};this.getViewport=function(t){var i,r;for(t=t&&t.parentNode?t.parentNode:!1;t&&1==t.nodeType&&!/^BODY|HTML/.test(t.nodeName);){if((i=n(t),/fixed|absolute/.test(i.css("position")))||(r=i.css("overflowY")||i.css("overflowX")||i.css("overflow")||"",/scroll|auto/.test(r)&&t.clientHeight!=t.scrollHeight||0<i.getNiceScroll().length))return i;t=t.parentNode?t.parentNode:!1}return!1};this.triggerScrollEnd=function(){if(s.onscrollend){var n=s.getScrollLeft(),t=s.getScrollTop();s.onscrollend.call(s,{type:"scrollend",current:{x:n,y:t},end:{x:n,y:t}})}};this.onmousewheel=function(n){if(!s.wheelprevented){if(s.railslocked)return s.debounced("checkunlock",s.resize,250),!0;if(s.rail.drag)return s.cancelEvent(n);if("auto"==s.opt.oneaxismousemode&&0!=n.deltaX&&(s.opt.oneaxismousemode=!1),s.opt.oneaxismousemode&&0==n.deltaX&&!s.rail.scrollable)return s.railh&&s.railh.scrollable?s.onmousewheelhr(n):!0;var t=+new Date,i=!1;return(s.opt.preservenativescrolling&&s.checkarea+600<t&&(s.nativescrollingarea=s.isScrollable(n),i=!0),s.checkarea=t,s.nativescrollingarea)?!0:((n=it(n,!1,i))&&(s.checkarea=0),n)}};this.onmousewheelhr=function(n){if(!s.wheelprevented){if(s.railslocked||!s.railh.scrollable)return!0;if(s.rail.drag)return s.cancelEvent(n);var t=+new Date,i=!1;return s.opt.preservenativescrolling&&s.checkarea+600<t&&(s.nativescrollingarea=s.isScrollable(n),i=!0),s.checkarea=t,s.nativescrollingarea?!0:s.railslocked?s.cancelEvent(n):it(n,!0,i)}};this.stop=function(){return s.cancelScroll(),s.scrollmon&&s.scrollmon.stop(),s.cursorfreezed=!1,s.scroll.y=Math.round(s.getScrollTop()*(1/s.scrollratio.y)),s.noticeCursor(),s};this.getTransitionSpeed=function(n){return n=Math.min(Math.round(10*s.opt.scrollspeed),Math.round(n/20*s.opt.scrollspeed)),20<n?n:0};s.opt.smoothscroll?s.ishwscroll&&h.hastransition&&s.opt.usetransition&&s.opt.smoothscroll?(this.prepareTransition=function(n,t){var i=t?20<n?n:0:s.getTransitionSpeed(n),r=i?h.prefixstyle+"transform "+i+"ms ease-out":"";return s.lasttransitionstyle&&s.lasttransitionstyle==r||(s.lasttransitionstyle=r,s.doc.css(h.transitionstyle,r)),i},this.doScrollLeft=function(n,t){var i=s.scrollrunning?s.newscrolly:s.getScrollTop();s.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=s.scrollrunning?s.newscrollx:s.getScrollLeft();s.doScrollPos(i,n,t)},this.doScrollPos=function(n,t,i){var r=s.getScrollTop(),u=s.getScrollLeft();if(((0>(s.newscrolly-r)*(t-r)||0>(s.newscrollx-u)*(n-u))&&s.cancelScroll(),0==s.opt.bouncescroll&&(0>t?t=0:t>s.page.maxh&&(t=s.page.maxh),0>n?n=0:n>s.page.maxw&&(n=s.page.maxw)),s.scrollrunning&&n==s.newscrollx&&t==s.newscrolly)||(s.newscrolly=t,s.newscrollx=n,s.newscrollspeed=i||!1,s.timer))return!1;s.timer=setTimeout(function(){var r=s.getScrollTop(),u=s.getScrollLeft(),i=Math.round(Math.sqrt(Math.pow(n-u,2)+Math.pow(t-r,2))),i=s.newscrollspeed&&1<s.newscrollspeed?s.newscrollspeed:s.getTransitionSpeed(i);s.newscrollspeed&&1>=s.newscrollspeed&&(i*=s.newscrollspeed);s.prepareTransition(i,!0);s.timerscroll&&s.timerscroll.tm&&clearInterval(s.timerscroll.tm);0<i&&(!s.scrollrunning&&s.onscrollstart&&s.onscrollstart.call(s,{type:"scrollstart",current:{x:u,y:r},request:{x:n,y:t},end:{x:s.newscrollx,y:s.newscrolly},speed:i}),h.transitionend?s.scrollendtrapped||(s.scrollendtrapped=!0,s.bind(s.doc,h.transitionend,s.onScrollTransitionEnd,!1)):(s.scrollendtrapped&&clearTimeout(s.scrollendtrapped),s.scrollendtrapped=setTimeout(s.onScrollTransitionEnd,i)),s.timerscroll={bz:new a(r,s.newscrolly,i,0,0,.58,1),bh:new a(u,s.newscrollx,i,0,0,.58,1)},s.cursorfreezed||(s.timerscroll.tm=setInterval(function(){s.showCursor(s.getScrollTop(),s.getScrollLeft())},60)));s.synched("doScroll-set",function(){s.timer=0;s.scrollendtrapped&&(s.scrollrunning=!0);s.setScrollTop(s.newscrolly);s.setScrollLeft(s.newscrollx);s.scrollendtrapped||s.onScrollTransitionEnd()})},50)},this.cancelScroll=function(){if(!s.scrollendtrapped)return!0;var n=s.getScrollTop(),t=s.getScrollLeft();return s.scrollrunning=!1,h.transitionend||clearTimeout(h.transitionend),s.scrollendtrapped=!1,s._unbind(s.doc[0],h.transitionend,s.onScrollTransitionEnd),s.prepareTransition(0),s.setScrollTop(n),s.railh&&s.setScrollLeft(t),s.timerscroll&&s.timerscroll.tm&&clearInterval(s.timerscroll.tm),s.timerscroll=!1,s.cursorfreezed=!1,s.showCursor(n,t),s},this.onScrollTransitionEnd=function(){s.scrollendtrapped&&s._unbind(s.doc[0],h.transitionend,s.onScrollTransitionEnd);s.scrollendtrapped=!1;s.prepareTransition(0);s.timerscroll&&s.timerscroll.tm&&clearInterval(s.timerscroll.tm);s.timerscroll=!1;var n=s.getScrollTop(),t=s.getScrollLeft();if(s.setScrollTop(n),s.railh&&s.setScrollLeft(t),s.noticeCursor(!1,n,t),s.cursorfreezed=!1,0>n?n=0:n>s.page.maxh&&(n=s.page.maxh),0>t?t=0:t>s.page.maxw&&(t=s.page.maxw),n!=s.newscrolly||t!=s.newscrollx)return s.doScrollPos(t,n,s.opt.snapbackspeed);s.onscrollend&&s.scrollrunning&&s.triggerScrollEnd();s.scrollrunning=!1}):(this.doScrollLeft=function(n,t){var i=s.scrollrunning?s.newscrolly:s.getScrollTop();s.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=s.scrollrunning?s.newscrollx:s.getScrollLeft();s.doScrollPos(i,n,t)},this.doScrollPos=function(n,r,u){function l(){if(s.cancelAnimationFrame)return!0;if(s.scrollrunning=!0,v=1-v)return s.timer=t(l)||1;var u=0,r,n,i=n=s.getScrollTop();s.dst.ay?(i=s.bzscroll?s.dst.py+s.bzscroll.getNow()*s.dst.ay:s.newscrolly,r=i-n,(0>r&&i<s.newscrolly||0<r&&i>s.newscrolly)&&(i=s.newscrolly),s.setScrollTop(i),i==s.newscrolly&&(u=1)):u=1;n=r=s.getScrollLeft();s.dst.ax?(n=s.bzscroll?s.dst.px+s.bzscroll.getNow()*s.dst.ax:s.newscrollx,r=n-r,(0>r&&n<s.newscrollx||0<r&&n>s.newscrollx)&&(n=s.newscrollx),s.setScrollLeft(n),n==s.newscrollx&&(u+=1)):u+=1;2==u?(s.timer=0,s.cursorfreezed=!1,s.bzscroll=!1,s.scrollrunning=!1,0>i?i=0:i>s.page.maxh&&(i=s.page.maxh),0>n?n=0:n>s.page.maxw&&(n=s.page.maxw),n!=s.newscrollx||i!=s.newscrolly?s.doScrollPos(n,i):s.onscrollend&&s.triggerScrollEnd()):s.timer=t(l)||1}var e,o,f,c,h,v;if(r="undefined"==typeof r||!1===r?s.getScrollTop(!0):r,s.timer&&s.newscrolly==r&&s.newscrollx==n)return!0;s.timer&&i(s.timer);s.timer=0;e=s.getScrollTop();o=s.getScrollLeft();(0>(s.newscrolly-e)*(r-e)||0>(s.newscrollx-o)*(n-o))&&s.cancelScroll();s.newscrolly=r;s.newscrollx=n;s.bouncescroll&&s.rail.visibility||(0>s.newscrolly?s.newscrolly=0:s.newscrolly>s.page.maxh&&(s.newscrolly=s.page.maxh));s.bouncescroll&&s.railh.visibility||(0>s.newscrollx?s.newscrollx=0:s.newscrollx>s.page.maxw&&(s.newscrollx=s.page.maxw));s.dst={};s.dst.x=n-o;s.dst.y=r-e;s.dst.px=o;s.dst.py=e;f=Math.round(Math.sqrt(Math.pow(s.dst.x,2)+Math.pow(s.dst.y,2)));s.dst.ax=s.dst.x/f;s.dst.ay=s.dst.y/f;c=0;h=f;0==s.dst.x?(c=e,h=r,s.dst.ay=1,s.dst.py=0):0==s.dst.y&&(c=o,h=n,s.dst.ax=1,s.dst.px=0);f=s.getTransitionSpeed(f);u&&1>=u&&(f*=u);s.bzscroll=0<f?s.bzscroll?s.bzscroll.update(h,f):new a(c,h,f,0,1,0,1):!1;s.timer||((e==s.page.maxh&&r>=s.page.maxh||o==s.page.maxw&&n>=s.page.maxw)&&s.checkContentSize(),v=1,s.cancelAnimationFrame=!1,s.timer=1,s.onscrollstart&&!s.scrollrunning&&s.onscrollstart.call(s,{type:"scrollstart",current:{x:o,y:e},request:{x:n,y:r},end:{x:s.newscrollx,y:s.newscrolly},speed:f}),l(),(e==s.page.maxh&&r>=e||o==s.page.maxw&&n>=o)&&s.checkContentSize(),s.noticeCursor())},this.cancelScroll=function(){return s.timer&&i(s.timer),s.timer=0,s.bzscroll=!1,s.scrollrunning=!1,s}):(this.doScrollLeft=function(n,t){var i=s.getScrollTop();s.doScrollPos(n,i,t)},this.doScrollTop=function(n,t){var i=s.getScrollLeft();s.doScrollPos(i,n,t)},this.doScrollPos=function(n,t){var r=n>s.page.maxw?s.page.maxw:n,i;0>r&&(r=0);i=t>s.page.maxh?s.page.maxh:t;0>i&&(i=0);s.synched("scroll",function(){s.setScrollTop(i);s.setScrollLeft(r)})},this.cancelScroll=function(){});this.doScrollBy=function(n,t){var r=0,r=t?Math.floor((s.scroll.y-n)*s.scrollratio.y):(s.timer?s.newscrolly:s.getScrollTop(!0))-n,i;if(s.bouncescroll&&(i=Math.round(s.view.h/2),r<-i?r=-i:r>s.page.maxh+i&&(r=s.page.maxh+i)),s.cursorfreezed=!1,i=s.getScrollTop(!0),0>r&&0>=i)return s.noticeCursor();if(r>s.page.maxh&&i>=s.page.maxh)return s.checkContentSize(),s.noticeCursor();s.doScrollTop(r)};this.doScrollLeftBy=function(n,t){var r=0,r=t?Math.floor((s.scroll.x-n)*s.scrollratio.x):(s.timer?s.newscrollx:s.getScrollLeft(!0))-n,i;if(s.bouncescroll&&(i=Math.round(s.view.w/2),r<-i?r=-i:r>s.page.maxw+i&&(r=s.page.maxw+i)),s.cursorfreezed=!1,i=s.getScrollLeft(!0),0>r&&0>=i||r>s.page.maxw&&i>=s.page.maxw)return s.noticeCursor();s.doScrollLeft(r)};this.doScrollTo=function(n){s.cursorfreezed=!1;s.doScrollTop(n)};this.checkContentSize=function(){var n=s.getContentSize();n.h==s.page.h&&n.w==s.page.w||s.resize(!1,n)};s.onscroll=function(){s.rail.drag||s.cursorfreezed||s.synched("scroll",function(){s.scroll.y=Math.round(s.getScrollTop()*(1/s.scrollratio.y));s.railh&&(s.scroll.x=Math.round(s.getScrollLeft()*(1/s.scrollratio.x)));s.noticeCursor()})};s.bind(s.docscroll,"scroll",s.onscroll);this.doZoomIn=function(t){var i,f,e,r;if(!s.zoomactive){s.zoomactive=!0;s.zoomrestore={style:{}};i="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" ");f=s.win[0].style;for(e in i)r=i[e],s.zoomrestore.style[r]="undefined"!=typeof f[r]?f[r]:"";return s.zoomrestore.style.width=s.win.css("width"),s.zoomrestore.style.height=s.win.css("height"),s.zoomrestore.padding={w:s.win.outerWidth()-s.win.width(),h:s.win.outerHeight()-s.win.height()},h.isios4&&(s.zoomrestore.scrollTop=n(window).scrollTop(),n(window).scrollTop(0)),s.win.css({position:h.isios4?"absolute":"fixed",top:0,left:0,"z-index":u+100,margin:"0px"}),i=s.win.css("backgroundColor"),(""==i||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(i))&&s.win.css("backgroundColor","#fff"),s.rail.css({"z-index":u+101}),s.zoom.css({"z-index":u+102}),s.zoom.css("backgroundPosition","0px -18px"),s.resizeZoom(),s.onzoomin&&s.onzoomin.call(s),s.cancelEvent(t)}};this.doZoomOut=function(t){if(s.zoomactive)return s.zoomactive=!1,s.win.css("margin",""),s.win.css(s.zoomrestore.style),h.isios4&&n(window).scrollTop(s.zoomrestore.scrollTop),s.rail.css({"z-index":s.zindex}),s.zoom.css({"z-index":s.zindex}),s.zoomrestore=!1,s.zoom.css("backgroundPosition","0px 0px"),s.onResize(),s.onzoomout&&s.onzoomout.call(s),s.cancelEvent(t)};this.doZoom=function(n){return s.zoomactive?s.doZoomOut(n):s.doZoomIn(n)};this.resizeZoom=function(){if(s.zoomactive){var t=s.getScrollTop();s.win.css({width:n(window).width()-s.zoomrestore.padding.w+"px",height:n(window).height()-s.zoomrestore.padding.h+"px"});s.onResize();s.setScrollTop(Math.min(s.page.maxh,t))}};this.init();n.nicescroll.push(this)},p=function(n){var t=this;this.nc=n;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.time=function(){return+new Date};this.reset=function(n,i){t.stop();var r=t.time();t.steptime=0;t.lasttime=r;t.speedx=0;t.speedy=0;t.lastx=n;t.lasty=i;t.lastscrollx=-1;t.lastscrolly=-1};this.update=function(n,i){var r=t.time();t.steptime=r-t.lasttime;t.lasttime=r;var r=i-t.lasty,e=n-t.lastx,u=t.nc.getScrollTop(),f=t.nc.getScrollLeft(),u=u+r,f=f+e;t.snapx=0>f||f>t.nc.page.maxw;t.snapy=0>u||u>t.nc.page.maxh;t.speedx=e;t.speedy=r;t.lastx=n;t.lasty=i};this.stop=function(){t.nc.unsynched("domomentum2d");t.timer&&clearTimeout(t.timer);t.timer=0;t.lastscrollx=-1;t.lastscrolly=-1};this.doSnapy=function(n,i){var r=!1;0>i?(i=0,r=!0):i>t.nc.page.maxh&&(i=t.nc.page.maxh,r=!0);0>n?(n=0,r=!0):n>t.nc.page.maxw&&(n=t.nc.page.maxw,r=!0);r?t.nc.doScrollPos(n,i,t.nc.opt.snapbackspeed):t.nc.triggerScrollEnd()};this.doMomentum=function(n){var e=t.time(),u=n?e+n:t.lasttime,f;n=t.nc.getScrollLeft();var h=t.nc.getScrollTop(),o=t.nc.page.maxh,s=t.nc.page.maxw;if(t.speedx=0<s?Math.min(60,t.speedx):0,t.speedy=0<o?Math.min(60,t.speedy):0,u=u&&60>=e-u,(0>h||h>o||0>n||n>s)&&(u=!1),n=t.speedx&&u?t.speedx:!1,t.speedy&&u&&t.speedy||n){f=Math.max(16,t.steptime);50<f&&(n=f/50,t.speedx*=n,t.speedy*=n,f=50);t.demulxy=0;t.lastscrollx=t.nc.getScrollLeft();t.chkx=t.lastscrollx;t.lastscrolly=t.nc.getScrollTop();t.chky=t.lastscrolly;var i=t.lastscrollx,r=t.lastscrolly,c=function(){var n=600<t.time()-e?.04:.02;t.speedx&&(i=Math.floor(t.lastscrollx-t.speedx*(1-t.demulxy)),t.lastscrollx=i,0>i||i>s)&&(n=.1);t.speedy&&(r=Math.floor(t.lastscrolly-t.speedy*(1-t.demulxy)),t.lastscrolly=r,0>r||r>o)&&(n=.1);t.demulxy=Math.min(1,t.demulxy+n);t.nc.synched("domomentum2d",function(){t.speedx&&(t.nc.getScrollLeft()!=t.chkx&&t.stop(),t.chkx=i,t.nc.setScrollLeft(i));t.speedy&&(t.nc.getScrollTop()!=t.chky&&t.stop(),t.chky=r,t.nc.setScrollTop(r));t.timer||(t.nc.hideCursor(),t.doSnapy(i,r))});1>t.demulxy?t.timer=setTimeout(c,f):(t.stop(),t.nc.hideCursor(),t.doSnapy(i,r))};c()}else t.doSnapy(t.nc.getScrollLeft(),t.nc.getScrollTop())}},h=n.fn.scrollTop;n.cssHooks.pageYOffset={get:function(t,i){return(i=n.data(t,"__nicescroll")||!1)&&i.ishwscroll?i.getScrollTop():h.call(t)},set:function(t,i){var r=n.data(t,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollTop(parseInt(i)):h.call(t,i),this}};n.fn.scrollTop=function(t){if("undefined"==typeof t){var i=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return i&&i.ishwscroll?i.getScrollTop():h.call(this)}return this.each(function(){var i=n.data(this,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollTop(parseInt(t)):h.call(n(this),t)})};f=n.fn.scrollLeft;n.cssHooks.pageXOffset={get:function(t,i){return(i=n.data(t,"__nicescroll")||!1)&&i.ishwscroll?i.getScrollLeft():f.call(t)},set:function(t,i){var r=n.data(t,"__nicescroll")||!1;return r&&r.ishwscroll?r.setScrollLeft(parseInt(i)):f.call(t,i),this}};n.fn.scrollLeft=function(t){if("undefined"==typeof t){var i=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return i&&i.ishwscroll?i.getScrollLeft():f.call(this)}return this.each(function(){var i=n.data(this,"__nicescroll")||!1;i&&i.ishwscroll?i.setScrollLeft(parseInt(t)):f.call(n(this),t)})};e=function(t){var i=this,r,u;if(this.length=0,this.name="nicescrollarray",this.each=function(n){for(var t=0,r=0;t<i.length;t++)n.call(i[t],r++);return i},this.push=function(n){i[i.length]=n;i.length++},this.eq=function(n){return i[n]},t)for(r=0;r<t.length;r++)u=n.data(t[r],"__nicescroll")||!1,u&&(this[this.length]=u,this.length++);return this},function(n,t,i){for(var r=0;r<t.length;r++)i(n,t[r])}(e.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(n,t){n[t]=function(){var n=arguments;return this.each(function(){this[t].apply(this,n)})}});n.fn.getNiceScroll=function(t){return"undefined"==typeof t?new e(this):this[t]&&n.data(this[t],"__nicescroll")||!1};n.extend(n.expr[":"],{nicescroll:function(t){return n.data(t,"__nicescroll")?!0:!1}});n.fn.niceScroll=function(t,i){var r,u;return"undefined"!=typeof i||"object"!=typeof t||"jquery"in t||(i=t,t=!1),i=n.extend({},i),r=new e,"undefined"==typeof i&&(i={}),t&&(i.doc=n(t),i.win=n(this)),u=!("doc"in i),u||"win"in i||(i.win=n(this)),this.each(function(){var t=n(this).data("__nicescroll")||!1;t||(i.doc=u?n(this):i.doc,t=new d(i,n(this)),n(this).data("__nicescroll",t));r.push(t)}),1==r.length?r[0]:r};window.NiceScroll={getjQuery:function(){return n}};n.nicescroll||(n.nicescroll=new e,n.nicescroll.options=y)})