Indi={},Indi.VersionBust={v:110},Indi.Analytics={},Indi.Ajax={},Indi.Ajax.Error=function(n){for(var e=jQuery.parseJSON(n.responseText),r,f,u=0;u<e.Rules.length;u++)r=e.Rules[u],f="500 Unknown Server Error Occurred.",r.Allowed===!1&&(f=r.HttpResponseCode+" "+r.StatusCode+": "+r.Message);alert(f);try{Indi.UI.AjaxSpinner.hide()}catch(o){}},Indi.Analytics.Data={Identity:{anonymousId:null,userId:null,traits:{}},Page:{path:null,referrer:null,search:null,title:null,url:null,mediaType:null,entityType:null}},Indi.Analytics.Track=function(n,t,i,r){var u="All",o,e;t=isNaN(t)?1:t,o=function(n){n=n?n:new Date;var t=function(n,t){t=isNaN(t)?2:t;var i=t-n.toString().length+1;return Array(+(i>0&&i)).join("0")+n};return n.getUTCFullYear()+"-"+t(n.getUTCMonth()+1)+"-"+t(n.getUTCDate())+"T"+t(n.getUTCHours())+":"+t(n.getUTCMinutes())+":"+t(n.getUTCSeconds())+"."+(n.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};try{switch(n){case"Video View":u="Content";break;case"Video Seconds":u="Content";break;case"Photo View":u="Content"}r=r?r:{},r.traits=Indi.Analytics.Data.Identity.traits,r.value=t;var s=o(),h={anonymousId:Indi.Analytics.Data.Identity.anonymousId,library:{name:"indi.js",version:"3.0.0"},context:{page:Indi.Analytics.Data.Page},event:n,properties:r,sentAt:s,type:"track",userId:Indi.Analytics.Data.Identity.userId,originalTimestamp:s},f=new XMLHttpRequest;f.open("POST","https://skl9cjbve4.execute-api.eu-west-1.amazonaws.com/prod/tracking/event",!0),f.setRequestHeader("Content-Type","text/plain; charset=UTF-8"),f.send(JSON.stringify(h)),e={hitType:"event",eventCategory:u,eventAction:n,eventValue:t},r.trackingUrl&&(e.eventLabel=r.trackingUrl),ga("send",e)}catch(c){}},Indi.Analytics.Identify=function(){Indi.Analytics.Data.Identity.traits={"indi-continent":Indi.Auth.Profile.indiContinent,"indi-country":Indi.Auth.Profile.indiCountry,"indi-metro":Indi.Auth.Profile.indiMetro,"indi-subdivision":Indi.Auth.Profile.indiSubdivision,"indi-city":Indi.Auth.Profile.indiCity,"indi-language":Indi.Auth.Profile.indiLanguage,"indi-tc":Indi.Auth.Profile.TC};var n=$.cookie("indianon");typeof n=="undefined"&&(n=uuid(),$.cookie("indianon",n,{path:"/",expires:365})),Indi.Analytics.Data.Identity.anonymousId=n,Indi.Auth.Profile.id&&(Indi.Analytics.Data.Identity.userId=Indi.Auth.Profile.id)},Indi.Analytics.Page=function(n){n=n?n:{},Indi.Analytics.Data.Page.url=n.url?n.url:location.href,Indi.Analytics.Data.Page.path=n.path?n.path:location.pathname,Indi.Analytics.Data.Page.search=n.search?n.search:location.search,Indi.Analytics.Data.Page.title=n.title?n.title:document.title,Indi.Analytics.Data.Page.referrer=n.referrer?n.referrer:document.referrer,Indi.Analytics.Data.Page.mediaType=n.mediaType?n.mediaType:null,Indi.Analytics.Data.Page.entityType=n.entityType?n.entityType:null,ga("set","page",Indi.Analytics.Data.Page.path),Indi.Analytics.Data.Page.entityType&&ga("set","contentGroup1",Indi.Analytics.Data.Page.entityType),ga("send","pageview"),Indi.Analytics.Data.Page.mediaType},typeof Indi=="undefined"&&(Indi={}),Indi.Util={},Indi.Util.UrlParams={},Indi.Util.UrlParams={};for(var match,pl=/\+/g,search=/([^&=]+)=?([^&]*)/g,decode=function(n){return decodeURIComponent(n.replace(pl," "))},query=window.location.search.substring(1);match=search.exec(query);)Indi.Util.UrlParams[decode(match[1])]=decode(match[2]);Indi.Util.Validate={email:function(n){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(n)},zipcode:function(n){var t=/^\d{5}$/;return t.test(n)},passwordStrength:function(n,t){if(t=parseInt(t)>-1?parseInt(t):Indi.Auth.minPasswordLength,n.length==0)return"none";if(n.length<t)return"short";var i=0;return(n.length>6&&(i+=1),n.length>9&&(i+=1),n.length>12&&(i+=1),n.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(i+=1),n.match(/([a-zA-Z])/)&&n.match(/([0-9])/)&&(i+=1),n.match(/([!,%,&,@,#,$,^,*,?,_,~])/)&&(i+=1),n.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)&&(i+=1),n.match(/(?!.*([A-Za-z0-9])\1{2})/)&&(i+=1),i<4)?"weak":i<5?"good":"strong"}},Indi.Util.setParams=function(n,t){t&&$.each(t,function(t,i){n[t]!=undefined&&(n[t]=i)})},Indi.Util.Format={padZeros:function(n,t){if(isNaN(n))return"";var i=t-n.toString().length+1;return Array(+(i>0&&i)).join("0")+n},numeral:function(n,t){t=t?t:"0";try{return numeral(n).format(t)}catch(i){return n.toString()}},duration:function(n){var i;try{var u=parseInt(n/3600)%24,r=parseInt(n/60)%60,t=parseInt(n)%60;i=u>0?(r<10?"0"+r:r)+":"+(t<10?"0"+t:t):r+":"+(t<10?"0"+t:t)}catch(f){i="00:00"}return i}},Indi.Util.compareVersions=function(n,t){if(typeof n+typeof t!="stringstring")return!1;for(var r=n.split("."),u=t.split("."),i=0,f=Math.max(r.length,u.length);i<f;i++){if(r[i]&&!u[i]&&parseInt(r[i])>0||parseInt(r[i])>parseInt(u[i]))return 1;if(u[i]&&!r[i]&&parseInt(u[i])>0||parseInt(r[i])<parseInt(u[i]))return-1}return 0},Indi.Util.getBrowserLanguage=function(){var n="en";try{n=navigator.language||navigator.userLanguage,n=n.split("-")[0]}catch(t){}return n},Indi.Util.removeProperty=function(n,t){confirm("Are you sure you wish to remove this item?")&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Manage/Entity/RemoveProperty",data:{id:n,property:t},dataType:"json",success:function(){location.reload()},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}}))},Indi.Util.removeAsset=function(n){confirm("Are you sure you wish to remove this item?")&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Manage/Entity/RemoveAsset",data:{id:n},dataType:"json",success:function(){location.reload()},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}}))},Indi.Util.CleanQuotes=function(n){return n.replace("'","~squote~").replace('"',"~dquote~").replace("~squote~","'").replace("~dquote~",'"')},typeof Indi=="undefined"&&(Indi={}),Indi.UI={},Indi.UI.embed=!1,Indi.UI.mimicMobile=!1,Indi.UI.setMouseOver=function(n,t){if(n){t||(t=n),t.addClass("hover");var i=setInterval(function(){n.is(":hover")||(t.removeClass("hover"),clearInterval(i))},100)}},Indi.UI.Initialize=function(){$(window).bind("scroll",Indi.UI.setScrollStart),Indi.UI.$indi=$("body"),setTimeout(function(){Indi.UI.$indi.addClass("initialized")},500),Indi.UI.mobile=Indi.UI.isMobile()||Indi.UI.mimicMobile,Indi.UI.mobile&&Indi.UI.$indi.addClass("mobile")},$(document).ready(Indi.UI.Initialize),Indi.UI.setScrollStart=function(){var n=Indi.UI.$indi.hasClass("minimal")?$(window).width()*.15:50;$(window).scrollTop()>n?Indi.UI.$indi.addClass("scrollstart"):Indi.UI.$indi.removeClass("scrollstart")},Indi.UI.Navtabs={setSelected:function(n){Indi.UI.Menu.clearSelected(),Indi.UI.$indi.find("[navtabs-id='"+n+"']").addClass("item-selected")}},Indi.UI.Menu={open:function(){Indi.UI.$indi.addClass("menu-open")},close:function(){Indi.UI.$indi.removeClass("menu-open")},toggle:function(){Indi.UI.$indi.toggleClass("menu-open")},clearSelected:function(){Indi.UI.$indi.find(".menu .menu-link").removeClass("menu-link-selected")},setSelected:function(n){Indi.UI.Menu.clearSelected(),Indi.UI.$indi.find("[menu-id='"+n+"']").addClass("item-selected")}},Indi.UI.Menu.Search={open:function(){},close:function(){},toggle:function(){Indi.UI.$indi.find(".menu-header").hasClass("search-open")?Indi.UI.Menu.Search.close():Indi.UI.Menu.Search.open()}},Indi.UI.AjaxSpinner={show:function(){$("body").append('<div class="indi-ajax-background"><div class="indi-ajax-loader"><div class="indi-ajax-reel"><\/div><\/div><\/div>')},hide:function(){$(".indi-ajax-background").remove()}},Indi.UI.Popup={open:function(n){$("#ModalEdit").is(":visible")?$("#ModalEdit .modal-content").load(n):$("#ModalEdit").modal({remote:n,show:!0})},close:function(){$("#ModalEdit").modal("hide")}},Indi.UI.UpdateAuthProfile=function(){Indi.Auth.authenticated===!0?(Indi.UI.$indi.addClass("authenticated"),$(".navbar-notifications-loggedin").hide()):(Indi.UI.$indi.removeClass("authenticated"),$("#navbar-icon-notifications").hide(),$(".navbar-notifications-loggedin").hide()),Indi.Auth.Profile.name!==null?$(".navbar-username").html(Indi.Auth.Profile.name):$(".navbar-username").html(""),Indi.Auth.Profile.image!==null&&Indi.Auth.Profile.image!=="null"?($(".navbar-userimage").attr("src",Indi.Auth.Profile.image+"?width=32&height=32&mode=crop&autorotate=true"),$(".navbar-userimage").show()):$(".navbar-userimage").hide()},Indi.UI.Clip={interact:function(n,t,i){var u,r,f,e;i=i===!0?!0:!1,u=$(t),r=u.parents(".video-clip, .video-thumb, .user-toolbar"),r.hasClass("interacted")||(i?setTimeout(function(){r.is(":hover")&&r.addClass("interacted")},2e3):r.addClass("interacted"),f=r.find(".clip-button.like, .social-actions li.like"),e=r.find(".clip-button.follow, .social-actions li.follow, li.follow"),Indi.Feedback.Get(n,function(n){try{n.Like&&f.addClass("item-selected"),n.Follow&&e.addClass("item-selected")}catch(t){}}))},setLike:function(n,t){var u=$(t),r=u.parents(".video-clip, .video-thumb"),i=r.find(".clip-button.like, .social-actions li.like");i.hasClass("item-selected")?i.removeClass("item-selected"):i.addClass("item-selected"),r.addClass("interacted"),Indi.Feedback.Like(n)},setFollow:function(n,t){var u=$(t),r=u.parents(".video-clip, .video-thumb, .user-toolbar"),i=r.find(".clip-button.follow, .social-actions li.follow, li.follow");i.hasClass("item-selected")?i.removeClass("item-selected"):i.addClass("item-selected"),r.addClass("interacted"),Indi.Feedback.Follow(n)},pause:function(n){n.pause(),Indi.UI.Video.Player.autoResume()}},Indi.UI.validateMature=function(n,t){if(t=t?t:"/",!n)return!0;var i=$.cookie("indiMature")=="true";if(i)return!0;$("body").append("<div id='maturescreen' style='position:absolute;width:100%;height:100%;top:0;left:0;background:#151B17;'><\/div>"),setTimeout(function(){if(confirm("This page contains mature content that may be offensive to some people and not suitable for persons under the age of 18."))return $.cookie("indiMature","true",{path:"/"}),$("#maturescreen").hide(),!0;location.href=t},50)},Indi.UI.isMobile=function(){return/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())},Indi.UI.isIOS=function(){return/iphone|ipad|ipod/i.test(navigator.userAgent.toLowerCase())},Indi.UI.useHLS=function(){return!1},Indi.UI.versionBuster=function(){return 1},Indi.UI.Form={updateChecklist:function(){$(".form-group[indi-checklist-item]").each(function(){$(this).hasClass("has-success")?$(".checklist-item[indi-checklist-item='"+$(this).attr("indi-checklist-item")+"']").addClass("has-success"):$(".checklist-item[indi-checklist-item='"+$(this).attr("indi-checklist-item")+"']").removeClass("has-success")})}},typeof Indi=="undefined"&&(Indi={}),typeof Indi.Feedback=="undefined"&&(Indi.Feedback={}),Indi.ListSubmissions=function(n){Indi.Auth.CheckLogin()&&(document.location.href="/l/"+n+"?challengelist=true")},Indi.Submit=function(n){if(Indi.UI.embed){var t="/submit/onepagesubmit/"+n;if(window.location.hostname.indexOf("dev-embed.indi.com")>-1){window.open("http://dev.indi.com"+t,"_blank");return}if(window.location.hostname.indexOf("embed.indi.com")>-1){window.open("https://indi.com"+t,"_blank");return}window.open(t,"_blank");return}document.location.href="/submit/onepagesubmit/"+n},Indi.Share=function(n,t,i,r,u){var f="",e="",o="",s=i&&Indi.Auth.Profile.id&&t==Indi.Auth.Profile.id;s&&(f="&shareInstagramTag="+encodeURIComponent(i)),r&&(e="&shareImage="+encodeURIComponent(r)),u&&(o="&shareDesc="+encodeURIComponent(Indi.Util.CleanQuotes(u))),Indi.UI.Popup.open("/Popup/Share?shareUrl="+encodeURIComponent(n)+f+e+o)},Indi.ShareId=function(n){Indi.UI.Popup.open("/Popup/ShareId?id="+encodeURIComponent(n))},Indi.Feedback.Comment=function(n){Indi.Auth.CheckLogin()&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Feedback/Comment",data:{message:n},dataType:"json",success:function(n){n==!0&&Indi.UI.Popup.close()},complete:function(){Indi.UI.AjaxSpinner.hide()}}))},Indi.Feedback.Report=function(n,t){Indi.Auth.CheckLogin()&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Feedback/Report",data:{id:n,message:t},dataType:"json",success:function(n){n==!0&&Indi.UI.Popup.close()},complete:function(){Indi.UI.AjaxSpinner.hide()}}))},Indi.Feedback.Like=function(n){Indi.Auth.CheckLogin()&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Feedback/Like",data:{id:n},dataType:"json",success:function(n){n==!0},complete:function(){Indi.UI.AjaxSpinner.hide()}}))},Indi.Feedback.Follow=function(n){Indi.Auth.CheckLogin()&&(Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Feedback/Follow",data:{id:n},dataType:"json",success:function(n){n==!0},complete:function(){Indi.UI.AjaxSpinner.hide()}}))},Indi.Feedback.Get=function(n,t){$.ajax({type:"POST",async:!0,url:"/Feedback/Get",data:{id:n},dataType:"json",success:function(n){try{t(n)}catch(i){}},complete:function(){}})},typeof Indi=="undefined"&&(Indi={}),typeof Indi.Entity=="undefined"&&(Indi.Entity={}),Indi.Auth={authenticated:!1,cookieAuthToken:"rn45z39s",cookieProfileName:"indiname",cookieProfileImage:"indiimage",cookieProfilePermalink:"indipermalink",cookieIndiId:"indiId",cookieIndiContinent:"indiContinent",cookieIndiCountry:"indiCountry",cookieIndiSubdivision:"indiSubdivision",cookieIndiMetro:"indiMetro",cookieIndiCity:"indiCity",cookieIndiLanguage:"indiLanguage",cookieIndiAccountType:"indiAccountType",cookieIndiVerifiedEmail:"indiVE",cookieIndiVerifiedUser:"indiVU",cookieIndiTC:"indiTC",minPasswordLength:6},Indi.Auth.CheckLogin=function(){return Indi.Auth.authenticated?!0:(Indi.UI.Popup.open("/Popup/CreateUser"),!1)},Indi.Auth.Initialize=function(){Indi.Auth.ValidateLocal(),Indi.Auth.ValidateServer()},$(document).ready(Indi.Auth.Initialize),Indi.Auth.Profile={id:null,name:null,image:null,VerifiedEmail:null,VerifiedUser:null,TC:null,indiContinent:null,indiCountry:null,indiSubdivision:null,indiMetro:null,indiCity:null,indiLanguage:null,indiAccountType:"Anonymous"},Indi.Entity.Feature=function(n){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/manage/entity/feature",data:{id:n},dataType:"json",success:function(){setTimeout(function(){document.location.reload()},2e3)},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}})},Indi.Entity.UnFeature=function(n){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/manage/entity/unfeature",data:{id:n},dataType:"json",success:function(){setTimeout(function(){document.location.reload()},2e3)},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}})},Indi.Entity.InDemoMode=function(n){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/manage/entity/InDemoMode",data:{id:n},dataType:"json",success:function(){setTimeout(function(){document.location.reload()},3e3)},complete:function(){},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}})},Indi.Entity.Activate=function(n){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/manage/entity/activate",data:{id:n},dataType:"json",success:function(){setTimeout(function(){document.location.reload()},3e3)},complete:function(){},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}})},Indi.Entity.Deactivate=function(n){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/manage/entity/deactivate",data:{id:n},dataType:"json",success:function(){setTimeout(function(){document.location.reload()},3e3)},complete:function(){},error:function(n,t,i){Indi.Ajax.Error(n,t,i)}})},Indi.Auth.ValidateLocal=function(){var r=$.cookie(Indi.Auth.cookieAuthToken),u=$.cookie(Indi.Auth.cookieIndiId),t=$.cookie(Indi.Auth.cookieProfileName),n=$.cookie(Indi.Auth.cookieProfileImage);n&&(n=n.replace("http://","https://"));var f=$.cookie(Indi.Auth.cookieProfilePermalink),i=$.cookie(Indi.Auth.cookieIndiAccountType),e=$.cookie(Indi.Auth.cookieIndiVerifiedEmail),o=$.cookie(Indi.Auth.cookieIndiVerifiedUser),s=$.cookie(Indi.Auth.cookieIndiTC);typeof r!="undefined"&&typeof t!="undefined"?(Indi.Auth.authenticated=!0,Indi.Auth.Profile.id=u,Indi.Auth.Profile.name=t,Indi.Auth.Profile.VerifiedEmail=e,Indi.Auth.Profile.VerifiedUser=o,Indi.Auth.Profile.TC=s,Indi.Auth.Profile.image=typeof n!="undefined"?n:null,Indi.Auth.Profile.permalink=f,typeof i!="undefined"&&(Indi.Auth.Profile.indiAccountType=i)):(Indi.Auth.authenticated=!1,Indi.Auth.Profile.id=null,Indi.Auth.Profile.name=null,Indi.Auth.Profile.image=null,Indi.Auth.Profile.permalink=null,Indi.Auth.Profile.indiAccountType="Anonymous",Indi.Auth.Profile.VerifiedEmail=null,Indi.Auth.Profile.VerifiedUser=null,Indi.Auth.Profile.TC=null),Indi.Auth.SetGeo(),Indi.UI.UpdateAuthProfile()},Indi.Auth.ValidateServer=function(){$.ajax({type:"POST",async:!0,url:"/Account/Me",dataType:"json",success:function(n){Indi.Auth.SetCookies(n)},error:function(){Indi.Auth.ClearCookies()},complete:function(){}})},Indi.Auth.SetGeo=function(){try{$.cookie(Indi.Auth.cookieIndiContinent)?(Indi.Auth.Profile.indiContinent=$.cookie(Indi.Auth.cookieIndiContinent),Indi.Auth.Profile.indiCountry=$.cookie(Indi.Auth.cookieIndiCountry),Indi.Auth.Profile.indiSubdivision=$.cookie(Indi.Auth.cookieIndiSubdivision),Indi.Auth.Profile.indiMetro=$.cookie(Indi.Auth.cookieIndiMetro),Indi.Auth.Profile.indiCity=$.cookie(Indi.Auth.cookieIndiCity),Indi.Auth.Profile.indiLanguage=$.cookie(Indi.Auth.cookieIndiLanguage),Indi.Analytics.Identify()):$.ajax({type:"GET",url:"/account/geolocation",success:function(n){var t=n,i;indiContinent=t.Continent,$.cookie(Indi.Auth.cookieIndiContinent,indiContinent),indiCountry=t.Country,$.cookie(Indi.Auth.cookieIndiCountry,indiCountry),indiSubdivision=t.Subdivision,$.cookie(Indi.Auth.cookieIndiSubdivision,indiSubdivision),indiMetro=t.Metro,$.cookie(Indi.Auth.cookieIndiMetro,indiMetro),indiCity=t.City,$.cookie(Indi.Auth.cookieIndiCity,indiCity),i="";try{i=navigator.language||navigator.userLanguage,i=i.split("-")[0]}catch(r){}indiLanguage=i,$.cookie(Indi.Auth.cookieIndiLanguage,indiLanguage),Indi.Analytics.Identify()}})}catch(n){}Indi.Auth.Profile.indiCountry=="US"?$("body").addClass("indi-country-us"):$("body").removeClass("indi-country-us")},Indi.Auth.Facebook={},Indi.Auth.Facebook.CheckLoginState=function(){FB.getLoginStatus(function(n){n.status==="connected"&&Indi.Auth.Facebook.SendLogin(n.authResponse.accessToken)})},Indi.Auth.Facebook.Login=function(){Indi.UI.AjaxSpinner.show(),FB.login(function(n){n.authResponse&&Indi.Auth.Facebook.CheckLoginState()},{scope:"public_profile,email"})},Indi.Auth.Facebook.SendLogin=function(n){$.ajax({type:"POST",async:!0,url:"/Account/LoginFacebook",data:{accessToken:n},dataType:"json",success:function(n){Indi.Auth.Login(n)},error:function(){alert("Unable login with Facebook account.")},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.UpdateEmail=function(){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Account/UpdateEmail",data:{email:$("#email").val()},dataType:"json",success:function(n){alert(n.Message),n.Success==!0&&Indi.UI.Popup.close()},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.ForgotPassword=function(){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Account/ForgotPassword",data:{email:$("#email").val(),password:$("#password").val()},dataType:"json",success:function(n){alert(n.Message),n.Success==!0&&Indi.UI.Popup.close()},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.CreateUser=function(){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Account/Register",data:{password:$("#password").val(),email:$("#email").val(),name:$("#username").val(),language:Indi.Util.getBrowserLanguage(),returnUrl:window.location.pathname},dataType:"json",success:function(n){alert(n.Message),n.Success==!0&&Indi.UI.Popup.close()},error:function(){alert("Unable to register user.")},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.UpdatePassword=function(){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Account/UpdatePassword",data:{currentpassword:$("#currentpassword").val(),newpassword:$("#password").val()},dataType:"json",success:function(n){alert(n.Message),n.Success==!0&&Indi.UI.Popup.close()},error:function(){alert("Error Updating Password.")},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.IndiLogin=function(){Indi.UI.AjaxSpinner.show(),$.ajax({type:"POST",async:!0,url:"/Account/LoginIndi",data:{password:$("#password").val(),email:$("#email").val()},dataType:"json",success:function(n){Indi.Auth.Login(n)},error:function(){alert("Invalid Email or Password.")},complete:function(){Indi.UI.AjaxSpinner.hide()}})},Indi.Auth.Login=function(n){Indi.Auth.SetCookies(n),Indi.UI.Popup.close()},Indi.Auth.Logout=function(){Indi.Auth.ClearCookies(),document.location.href="/account/logout"},Indi.Auth.SetCookies=function(n){$.cookie(Indi.Auth.cookieProfileName,n.UserName,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieProfileImage,n.UserImage,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieProfilePermalink,n.Headers["indi-permalink"],{path:"/",expires:365}),$.cookie(Indi.Auth.cookieIndiId,n.UserId,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieIndiVerifiedEmail,n.VerifiedEmail,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieIndiVerifiedUser,n.VerifiedUser,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieIndiTC,n.TC,{path:"/",expires:365}),$.cookie(Indi.Auth.cookieIndiAccountType,n.Headers["indi-accounttype"],{path:"/",expires:365}),Indi.Auth.ValidateLocal()},Indi.Auth.ClearCookies=function(){$.removeCookie(Indi.Auth.cookieAuthToken,{path:"/"}),$.removeCookie(Indi.Auth.cookieProfileName,{path:"/"}),$.removeCookie(Indi.Auth.cookieProfileImage,{path:"/"}),$.removeCookie(Indi.Auth.cookieProfilePermalink,{path:"/"}),$.removeCookie(Indi.Auth.cookieIndiId,{path:"/"}),$.removeCookie(Indi.Auth.cookieIndiVerifiedEmail,{path:"/"}),$.removeCookie(Indi.Auth.cookieIndiVerifiedUser,{path:"/"}),$.removeCookie(Indi.Auth.cookieIndiTC,{path:"/"}),$.removeCookie(Indi.Auth.cookieIndiAccountType,{path:"/"}),Indi.Auth.ValidateLocal()},typeof Indi=="undefined"&&(Indi={}),typeof Indi.UI=="undefined"&&(Indi.UI={}),Indi.UI.Video={setSource:function(n){var u=$("<video><\/video>")[0],r=[],t={},i="";$(n).each(function(i,f){var e=f.type,o=u.canPlayType(e);o!=""?(r.push(e),typeof t[e]=="undefined"?t[e]=[f]:t[e].push(f)):n.splice(i,1)});try{i=t[r[0]][0]}catch(f){}return typeof i=="undefined"&&(i=""),i}},Indi.UI.Video.BCPlayer={initializebyid:function(n,t,i,r,u,f,e){try{this.$player=t,this.aspectRatio=.5625,this.resize(),this.trackingProps=r,this.$ui=t.find(".ui"),this.$video=t.find("video"),this.video=this.$video[0],this.videoId=n,this.videoData=i,this.autoPlay=u===!1?!1:!0,this.videoTitle=e?e:"",this.trackedView=!1,this.bindEvents(),this.vastServerUrl=f,this.bcPlayer,this.loadVideo(0,this.autoPlay)}catch(o){console.log(o);return}},initialize:function(n,t,i,r,u,f){try{this.$player=n,this.aspectRatio=.5625,this.resize(),this.trackingProps=i,this.$ui=n.find(".ui"),this.$video=n.find("video"),this.video=this.$video[0],this.videoId="indi-video-player",this.videoData=t,this.autoPlay=r===!1?!1:!0,this.videoTitle=f?f:"",this.trackedView=!1,this.bindEvents(),this.vastServerUrl=u,this.bcPlayer,this.loadVideo(0,this.autoPlay)}catch(e){console.log(e);return}},bindEvents:function(){$(window).bind("resize",function(){try{Indi.UI.Video.BCPlayer.resize()}catch(n){}}),this.$video.bind("timeupdate",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.BCPlayer.trackingProps,!1,Indi.UI.Video.BCPlayer.videoTitle)}).bind("ended",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.BCPlayer.trackingProps,!0,Indi.UI.Video.BCPlayer.videoTitle)}).bind("play",function(){Indi.UI.Video.BCPlayer.$player.addClass("playing")}).bind("pause",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.BCPlayer.trackingProps,!0,Indi.UI.Video.BCPlayer.videoTitle),Indi.UI.Video.BCPlayer.$player.removeClass("playing")})},error:function(){},resize:function(){this.$player.height(Math.floor(this.$player.width()*this.aspectRatio)),setTimeout(function(){Indi.UI.Video.BCPlayer.$player.height(Math.floor(Indi.UI.Video.BCPlayer.$player.width()*Indi.UI.Video.BCPlayer.aspectRatio))},1e3)},loadVideo:function(n,t){t=t===!1?!1:!0,$(document).ready(function(){Indi.UI.Video.BCPlayer.video.poster=Indi.UI.Video.BCPlayer.videoData[n].poster;var t=Indi.UI.Video.setSource(Indi.UI.Video.BCPlayer.videoData[n].source);if(Indi.UI.isIOS())for(i=0;i<t.length;i++)t[i].src=t[i].src+"?cb="+Date.now();Indi.UI.Video.BCPlayer.video.src=t.src,Indi.UI.Video.BCPlayer.video.type=t.type}),this.resize()},play:function(){this.video.play(),this.$player.removeClass("auto-paused")},pause:function(){this.video.pause()},autoPause:function(){try{this.video.paused||(this.pause(),this.$player.addClass("auto-paused"))}catch(n){}},autoResume:function(){try{this.$player.hasClass("auto-paused")&&this.play()}catch(n){}}},Indi.UI.Video.Player={initialize:function(n,t,i,r){try{this.$player=n,this.aspectRatio=.5625,this.resize(),this.trackingProps=i,this.$ui=n.find(".ui"),this.$video=n.find("video"),this.video=this.$video[0],this.$loadProgressBar=this.$player.find(".indi-progress .load"),this.$playProgressBar=this.$player.find(".indi-progress .play"),this.$loader=this.$player.find(".video-loader"),this.videoData=t,this.userPlayGesture=!1,this.autoPlay=r===!1?!1:!0,this.trackedView=!1,this.bindEvents(),this.loadVideo(0,this.autoPlay)}catch(u){console.log(u);return}},bindEvents:function(){$(window).bind("resize",function(){try{Indi.UI.Video.Player.resize()}catch(n){}}),this.$video.bind("timeupdate",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.Player.trackingProps,!1),Indi.UI.Video.Player.timeUpdate(this),Indi.UI.Video.Player.loadingProgress(this)}).bind("progress",function(){Indi.UI.Video.Player.loadingProgress(this)}).bind("loadeddata",function(){Indi.UI.Video.Player.loadingProgress(this)}).bind("ended",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.Player.trackingProps,!0),Indi.UI.Video.Player.endVideo(this)}).bind("play",function(){Indi.UI.Video.Player.$player.addClass("playing")}).bind("loadstart",function(){Indi.UI.Video.Player.loading(!0)}).bind("playing",function(){Indi.UI.Video.Player.playing()}).bind("pause",function(){Indi.UI.Video.trackViewTime(this,Indi.UI.Video.Player.trackingProps,!0),Indi.UI.Video.Player.$player.removeClass("playing")}),this.$player.bind("mouseover",function(){Indi.UI.Video.Player.mouseOver()}).bind("mousemove",function(){Indi.UI.Video.Player.mouseMove()}).bind("click",function(){Indi.UI.Video.Player.userPlayGesture=!0,Indi.UI.Video.Player.togglePlayPause()})},resize:function(){this.$player.height(Math.floor(this.$player.width()*this.aspectRatio))},loadVideo:function(n,t){t=t===!1?!1:!0,this.$player.addClass("hide-ui"),setTimeout(function(){Indi.UI.Video.Player.$player.removeClass("hide-ui")},1500),setTimeout(function(){Indi.UI.Video.Player.video.paused==!0&&Indi.UI.Video.Player.userPlayGesture==!1&&(Indi.UI.Video.Player.$ui.find(".action-button").addClass("rotate"),setTimeout(function(){Indi.UI.Video.Player.video.paused==!0&&Indi.UI.Video.Player.userPlayGesture==!1},6e3))},6e3),this.loadingAnimationInterval=setInterval(function(){Indi.UI.Video.Player.$player.hasClass("loading")?Indi.UI.Video.Player.$loader.toggleClass("rotate"):clearInterval(Indi.UI.Video.Player.loadingAnimationInterval)},2e3),this.$video.html("");var i=Indi.UI.Video.setSource(this.videoData[n].source);this.$video.attr("src",i.src).attr("type",i.type).attr("poster",this.videoData[n].poster),this.video.load(),this.resize(),t&&this.play()},playing:function(){setTimeout(function(){Indi.UI.Video.Player.loading(!1)},1e3)},endVideo:function(n){Indi.VideoPlayer.trackViewTime(n,Indi.UI.Video.Player.trackingProps,!1);try{this.video.webkitExitFullscreen()}catch(t){}},timeUpdate:function(n){Indi.UI.Video.Player.loading(!1),Indi.UI.Video.Player.$playProgressBar.width((n.currentTime/n.duration).toFixed(2)*100+"%")},loadingProgress:function(n){try{Indi.UI.Video.Player.$loadProgressBar.width((n.buffered.end(0)/n.duration).toFixed(2)*100+"%")}catch(t){}},togglePlayPause:function(){this.video.paused?this.play():this.pause()},play:function(){this.video.play(),this.$player.removeClass("auto-paused")},pause:function(){this.video.pause()},loading:function(n){n=n===!0?!0:!1,n?(clearTimeout(this.loaderDelayTimeout),Indi.UI.Video.Player.video.paused==!0&&Indi.UI.Video.Player.userPlayGesture==!1||(this.loaderDelayTimeout=setTimeout(function(){Indi.UI.Video.Player.$player.addClass("loading")},2e3))):(clearTimeout(this.loaderDelayTimeout),Indi.UI.Video.Player.$player.removeClass("loading"),setTimeout(function(){Indi.UI.Video.Player.$player.removeClass("hide-ui")},1e3))},mouseOver:function(){this.$player.addClass("mouseover"),this.mouseOverInterval=setInterval(function(){Indi.UI.Video.Player.$player.is(":hover")||Indi.UI.Video.Player.mouseOut()},100)},mouseMove:function(){clearTimeout(this.mouseMoveTimout),this.$player.addClass("mousemove"),this.mouseMoveTimout=setTimeout(function(){Indi.UI.Video.Player.$player.removeClass("mousemove")},1e3)},mouseOut:function(){this.$player.removeClass("mouseover")},autoPause:function(){try{this.video.paused||(this.pause(),this.$player.addClass("auto-paused"))}catch(n){}},autoResume:function(){try{this.$player.hasClass("auto-paused")&&this.play()}catch(n){}}},Indi.UI.Video.Header={initialize:function(n,t,i,r){try{this.$player=n,this.$video=n.find("video"),this.video=this.$video[0],this.videoData=t,this.trackingProps=r,this.videoCount=t.length,this.videoIndex=0,this.clipDuration=isNaN(i)?0:i,this.$videoLabel=$(".header .video-label"),this.$videoLink=$(".header .video-link"),Indi.UI.mobile?this.loadMobile(this.videoIndex):(this.bindEvents(),this.loadVideo(this.videoIndex))}catch(u){return}},bindEvents:function(){this.$video.bind("timeupdate",function(){Indi.UI.Video.Header.timeUpdate(this)}).bind("ended",function(){Indi.UI.Video.Header.endVideo(this)}),window.addEventListener("blur",function(){Indi.UI.Video.Header.video.pause()}),window.addEventListener("focus",function(){Indi.UI.Video.Header.video.play()})},loadMobile:function(n){this.$player.find(".banner-background").css("background-image","url("+this.videoData[n].poster+")"),this.videoIndex++,this.videoIndex==this.videoCount&&(this.videoIndex=0),setTimeout(function(){Indi.UI.Video.Header.loadMobile(Indi.UI.Video.Header.videoIndex)},5e3)},loadVideo:function(n){this.$video.html("");var t=Indi.UI.Video.setSource(this.videoData[n].source);this.$video.attr("src",t.src).attr("type",t.type).attr("poster",this.videoData[n].poster),this.$player.find(".banner-background").css("background-image","url("+this.videoData[n].poster+")"),this.$videoLink.prop("href","/"+this.videoData[n].permalink),this.$videoLabel.html(this.videoData[n].title),this.video.load(),this.video.play()},endVideo:function(){this.videoIndex++,this.videoIndex==this.videoCount&&(this.videoIndex=0),this.loadVideo(this.videoIndex)},timeUpdate:function(n){var t=Indi.UI.Video.Header.clipDuration;t>0&&n.currentTime>t&&(this.videoIndex++,this.videoIndex==this.videoCount&&(this.videoIndex=0),this.loadVideo(this.videoIndex))},toggleMuted:function(){this.$video.prop("muted")?this.$video.prop("muted",!1):this.$video.prop("muted",!0),$(".header").toggleClass("muted")}},Indi.UI.Video.Clip=function(n,t,i,r){var u=this,e=$(n),f=n,o;if(r=r?r:"",!f.paused){u.pause();return}e.bind("timeupdate",function(){Indi.UI.Video.trackViewTime(this,i,!1,r),u.timeUpdate(this)}).bind("pause",function(){Indi.UI.Video.trackViewTime(this,i,!0,r)}).bind("ended",function(){Indi.UI.Video.trackViewTime(this,i,!0,r),u.endVideo(this)}),o=Indi.UI.Video.setSource(t.source),u.loadVideo=function(){e.html(""),e.attr("src",o.src).attr("type",o.type),Indi.UI.Video.Player.autoPause(),f.load(),f.play()},u.endVideo=function(){try{f.webkitExitFullscreen()}catch(n){}},u.timeUpdate=function(){},u.loadVideo()},Indi.UI.Video.trackViewTime=function(n,t,i,r){var a,p,s;try{r=r?r:"";var u=$(n),e=Date.now(),v=u.data("trackedView"),h=100,c=u.data("viewed_ts"),f=u.data("viewed_ms"),y=u[0].duration,l=5,o=Math.round(y/100);o<l&&(o=l),a=o*1e3,p=5e3,c?(f+=e-c,(i||f>=a)&&f<h*1e3?(v||i||(u.data("trackedView",!0),Indi.Analytics.Track("Video View",1,r,t)),s=Math.round(f/1e3),s>0&&Indi.Analytics.Track("Video Seconds",s,r,t),u.removeData("viewed_ts"),u.removeData("viewed_ms")):(u.data("viewed_ts",e),f<h*1e3?u.data("viewed_ms",f):u.data("viewed_ms",0))):(u.data("viewed_ts",e),u.data("viewed_ms",0))}catch(w){}},typeof Indi=="undefined"&&(Indi={}),typeof Indi.UI=="undefined"&&(Indi.UI={}),Indi.UI.PinGrid=function(n,t){var i=this;n!=undefined&&(i.container=n.charAt(0)!="#"?$("#"+n):$(n),i.containerWidth=i.container.outerWidth(),i.container.css("position")==undefined&&i.container.css("position","relative"),i.rowStyle="fill",i.columnStyle="fit",i.resizeInterval=null,i.resizeIntervalDuration=1e3,i.paddingPx=20,i.alignment="center",i.direction="ltr",i.firstItem=!1,i.firstItemTop=0,i.hasMenuColumn=!1,i.menuMinColumnCount=1,i.cleanUpEvent=Indi.UI.cleanUpEvent,Indi.Util.setParams(i,t),i.initLayout=function(){i.formatLayout(),clearInterval(i.container.attr("pingrid-resize-interval")),i.resizeInterval=setInterval(function(){i.formatLayout()},i.resizeIntervalDuration),i.container.attr("pingrid-resize-interval",i.resizeInterval.toString()),i.bindCleanup()},i.formatBelow=function(n){var u=parseInt(n.parents(".cardContainer").attr("indi-pingrid-column"),10),f=n.parents(".cardContainer").height()+i.paddingPx,r=parseInt(n.parents(".cardContainer").css("top"),10),t=r+f;i.container.children("div").each(function(){var n=$(this);u==parseInt(n.attr("indi-pingrid-column"),10)&&parseInt(n.css("top"),10)>r&&(n.css("top",t),t+=n.height()+i.paddingPx)}),i.container.height()<t&&i.container.height(t)},i.formatLayout=function(n,t){var e,u,o,s;if(n=n==!0?!0:!1,t=typeof t=="undefined"?i.hasMenuColumn:t===!0?!0:!1,i.alignment=i.alignment!=undefined?i.alignment.toLowerCase():"center",i.direction=i.direction!=undefined?i.direction.toLowerCase():"ltr",i.containerWidth=i.container.outerWidth(),n||parseInt(i.container.attr("pingrid-width"))!=i.containerWidth||i.container.children("div[indi-pingrid-formatted='true']").length!=i.container.children("div").length){i.container.attr("pingrid-width",i.containerWidth),e=i.container.children(":not([indi-pingrid-columnskip]):first").width()+i.paddingPx,u=Math.floor(i.container.outerWidth()/e),u=u>0?u:1;switch(i.alignment){case"left":o=i.direction=="rtl"?i.paddingPx+i.containerWidth-i.paddingPx-e*u:i.paddingPx;break;case"right":o=i.direction=="rtl"?i.paddingPx:i.paddingPx+i.containerWidth-i.paddingPx-e*u;break;default:o=i.paddingPx+Math.floor((i.containerWidth-i.paddingPx-e*u)/2)}var y=0,f=[],c=[];for(s=0;s<u;s++)f[s]=i.paddingPx,c[s]=0;var l=i.paddingPx,r=0,a=0,v=f[0],h=0;i.firstItem=!1,i.container.children("div").each(function(){var n,k,d,s,nt,g,p,w,b;if(y++,n=$(this),n.css("opacity")==0){n.attr("indi-pingrid-formatted","true"),n.attr("indi-pingrid-column",-1);return}if(k=n.height()+i.paddingPx,a=r,d=u>i.menuMinColumnCount&&t&&c[0]>0,d&&(r=1),(r==u-1||i.columnStyle=="order")&&(r=0),!i.firstItem&&n.hasClass("card-item")){for(i.firstItem=!0,r=0,s=0;s<u;s++)f[s]<f[0]&&(f[s]=f[0]);console.log("first item")}else for(s=0;s<u;s++)(nt=!1,d&&s==0)||(f[s]<f[r]&&(r=s),f[s]>h&&(h=f[s]));if(n.attr("indi-pingrid-float")=="right"&&(r=u-1),n.attr("indi-pingrid-float")=="left"&&(r=0),f[r]+k>h&&f[r]>v&&r==u-1&&i.rowStyle=="snap"&&(f[r]=f[a]),i.direction!="rtl"?n.css({position:"absolute",top:f[r]+"px",left:o+r*e+"px"}).show():n.css({position:"absolute",top:f[r]+"px",right:o+r*e+"px"}).show(),c[r]++,n.attr("indi-pingrid-formatted","true"),n.attr("indi-pingrid-column",r),n.attr("indi-pingrid-maxheight",h),v=f[r],g=n.attr("indi-pingrid-maxwidth"),typeof n.attr("indi-pingrid-columnskip")!=typeof undefined&&n.attr("indi-pingrid-columnskip")!==!1){p=n.attr("indi-pingrid-columnskip"),w=e-i.paddingPx,!isNaN(p)&&u>1&&(g=="true"?(w=e*(u-p)+o>e?e*(u-p)+o:w,n.css("left",0)):w=e*(u-p)-i.paddingPx>e-i.paddingPx?e*(u-p)-i.paddingPx:w),(u==1||p==0)&&g=="true"&&(w=i.containerWidth,n.css("left",0)),n.width(w);try{Indi.UI.Video.Player.resize()}catch(tt){}k=$(this).height()+i.paddingPx}if(f[r]=f[r]+k,!isNaN(p)&&u>1)for(b=r;b<u-p&&b<u;b++)f[b]=f[r];f[r]>l&&(l=f[r])}),i.container.css("height",l+"px")}},i.cleanUp=function(){clearInterval(i.resizeInterval),i.unbindCleanUp(),i={}},i.bindCleanup=function(){$(window).on(Indi.UI.pageUnloadEvent,i.cleanUp)},i.unbindCleanUp=function(){$(window).unbind(Indi.UI.pageUnloadEvent,i.cleanUp)},i.initLayout())}