"use strict";var thrive;typeof thrive!="undefined"&&thrive||(thrive={});thrive.declineJoin=function(){var e,t,i,o,r,u,n,f=function(n,t){var r=$("#decline-invite"),i;r.empty();i=document.createElement("h2");i.setAttribute("class","text-center");i.appendChild(document.createTextNode(n));r.append(i);r.append(t)},l=function(){t?window.location.href=i:f("Still want to participate?","<p>Thanks, we'll let the Team Captain know that you're not interested.<\/p><p>If you'd like to join another team, or start a team of your own, you've still got a chance!<\/p><p>To find out more about the challenge, check out the <a href='"+r+"'>FAQs<\/a> or the <a href='"+u+"'>How it works<\/a> pages on The Official® 10,000 Steps Program website.<\/p><div class='text-center'><a class='btn btn-primary' href='"+n+"'>Join or start a team<\/a><\/div>")},s=function(){var e=$(".modal.in")[0];e?$(".modal.in").modal("hide"):t?window.location.href=i:f("Changed your mind?","<p>You've still got a chance to accept this invite!<\/p><p>To find out more about the challenge, check out the <a href='"+r+"'>FAQs<\/a> or the <a href='"+u+"'>How it works<\/a> pages on The Official® 10,000 Steps Program website.<\/p><div class='text-center'><a class='btn btn-primary' href='"+n+"'>Accept invite<\/a><\/div>")},h=function(t){f("Whoops, we've found a problem!","<p>"+t+"<\/p><div class='text-center'><a class='btn btn-default' href='"+o+"'>Contact support<\/a><a class='btn btn-primary' href='"+n+"'>Log in<\/a><\/div>")},c=function(n){n.preventDefault();$.ajax({url:thrive.api.team.declineInvite,data:{teamInviteId:e},type:"POST",cache:!1,success:function(n){n.Success?l():h(n.DisplayMessage)},error:function(n,t,i){h(i)}})},a=function(f){e=f.teamInviteId;t=f.isAuthenticated;i=f.returnUrl;o=f.supportUrl;r=f.faqUrl;u=f.howItWorksUrl;n=f.inviteUrl;$("#btnCancel").off("click").on("click",s);$("#btnDecline").off("click").on("click",c)};return{init:function(n){return a(n)},handleDeclineClick:function(n){return c(n)},handleCancelClick:function(n){return s(n)}}}();typeof thrive!=undefined&&thrive||(thrive={});thrive.anonymousDashboard={};thrive.anonymousDashboard=function(){var n=function(){if($("#showDecline").length>0&&$("#showDecline").data("team")!=""){var n=$("#showDecline").data("team");$.ajax({url:thrive.api.home.declineInvite+n,data:{id:n},type:"GET",success:function(n){$("#modalDeclineInvitation").html(n);$("#modalDeclineInvitation").modal("show");$(".btn-decline-invitation").off("click").on("click",thrive.declineJoin.handleDeclineClick);$(".btn-cancel-decline-invitation").off("click").on("click",thrive.declineJoin.handleCancelClick)},cache:!1})}};return{init:function(){return n()}}}();$(document).ready(function(){thrive.anonymousDashboard.init()})