function OmnisClubMemberFieldDefinitions(){this.fieldNames={alphaCode:"AlphaCode",altMemberNo:"AlternateMemberNo",golfLinkNo:"GolflinkNo",memberNo:"MemberNo",primaryKey:"Primary",dateOfBirth:"DOB",financialToDate:"FinancialToDate",firstName:"FirstName",fullName:"FullName",gender:"Gender",preferredName:"PreferredName",surname:"Surname",title:"Title",addressPrimary1:"Address1",addressPrimary2:"Address2",addressPrimary3:"Address3",addressPrimary4:"Suburb",addressPrimary5:"State",addressPrimary6:"PostCode",addressPrimaryType:null,addressSecondary1:"Address1A",addressSecondary2:"Address2A",addressSecondary3:"Address3A",addressSecondary4:"Address4A",addressSecondary5:"Address5A",addressSecondary6:"Address6A",addressSecondaryType:"AttressTypeA",addressTertiary1:"Address1B",addressTertiary2:"Address2B",addressTertiary3:"Address3B",addressTertiary4:"Address4B",addressTertiary5:"Address5B",addressTertiary6:"Address6B",addressTertiaryType:"AttressTypeB",phone1:"Phone",phone2:"PhoneA",phone3:"PhoneB",email1:"Email1",email2:"Email2",email3:null,fax1:"Fax",fax2:"FaxA",fax3:"FaxB",mobile1:"Mobile",mobile2:null,mobile3:null}}function ClubMember(n,t){this._member=n;this._fieldDefinitions=t||new{fieldNames:{}};this._fieldCache={};this._fieldValueCache={};this.clubId=n.clubId;this.clubMemberId=n.clubMemberId;this.profileImageUrl=n.profileImageUrl}function getCookie(n){var i=RegExp(n+"=.[^;]*"),t;return(matched=document.cookie.match(i),matched)?(t=matched[0].split("="),t[1]):!1}function getParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function endsWith(n,t){return n.indexOf(t,n.length-t.length)!==-1}var memberCommon;if(ClubMember.prototype.memberNo=function(){return this.getFieldValue("memberNo")},ClubMember.prototype.golfLinkNo=function(){return this.getFieldValue("golfLinkNo")},ClubMember.prototype.dateOfBirth=function(){return this.getFieldValue("dateOfBirth")},ClubMember.prototype.financialToDate=function(){return this.getFieldValue("financialToDate")},ClubMember.prototype.firstName=function(){return this.getFieldValue("firstName")},ClubMember.prototype.fullName=function(){return this.getFieldValue("fullName")},ClubMember.prototype.gender=function(){return this.getFieldValue("gender")},ClubMember.prototype.preferredName=function(){return this.getFieldValue("preferredName")},ClubMember.prototype.surname=function(){return this.getFieldValue("surname")},ClubMember.prototype.title=function(){return this.getFieldValue("title")},ClubMember.prototype.addressPrimary1=function(){return this.getFieldValue("addressPrimary1")},ClubMember.prototype.addressPrimary2=function(){return this.getFieldValue("addressPrimary2")},ClubMember.prototype.addressPrimary3=function(){return this.getFieldValue("addressPrimary3")},ClubMember.prototype.addressPrimary4=function(){return this.getFieldValue("addressPrimary4")},ClubMember.prototype.addressPrimary5=function(){return this.getFieldValue("addressPrimary5")},ClubMember.prototype.addressPrimary6=function(){return this.getFieldValue("addressPrimary6")},ClubMember.prototype.addressPrimaryType=function(){return this.getFieldValue("addressPrimaryType")},ClubMember.prototype.addressSecondary1=function(){return this.getFieldValue("addressSecondary1")},ClubMember.prototype.addressSecondary2=function(){return this.getFieldValue("addressSecondary2")},ClubMember.prototype.addressSecondary3=function(){return this.getFieldValue("addressSecondary3")},ClubMember.prototype.addressSecondary4=function(){return this.getFieldValue("addressSecondary4")},ClubMember.prototype.addressSecondary5=function(){return this.getFieldValue("addressSecondary5")},ClubMember.prototype.addressSecondary6=function(){return this.getFieldValue("addressSecondary6")},ClubMember.prototype.addressSecondaryType=function(){return this.getFieldValue("addressSecondaryType")},ClubMember.prototype.addressTertiary1=function(){return this.getFieldValue("addressTertiary1")},ClubMember.prototype.addressTertiary2=function(){return this.getFieldValue("addressTertiary2")},ClubMember.prototype.addressTertiary3=function(){return this.getFieldValue("addressTertiary3")},ClubMember.prototype.addressTertiary4=function(){return this.getFieldValue("addressTertiary4")},ClubMember.prototype.addressTertiary5=function(){return this.getFieldValue("addressTertiary5")},ClubMember.prototype.addressTertiary6=function(){return this.getFieldValue("addressTertiary6")},ClubMember.prototype.addressTertiaryType=function(){return this.getFieldValue("addressTertiaryType")},ClubMember.prototype.phone1=function(){return this.getFieldValue("phone1")},ClubMember.prototype.phone2=function(){return this.getFieldValue("phone2")},ClubMember.prototype.phone3=function(){return this.getFieldValue("phone3")},ClubMember.prototype.email1=function(){return this.getFieldValue("email1")},ClubMember.prototype.email2=function(){return this.getFieldValue("email2")},ClubMember.prototype.email3=function(){return this.getFieldValue("email3")},ClubMember.prototype.fax1=function(){return this.getFieldValue("fax1")},ClubMember.prototype.fax2=function(){return this.getFieldValue("fax2")},ClubMember.prototype.fax3=function(){return this.getFieldValue("fax3")},ClubMember.prototype.mobile1=function(){return this.getFieldValue("mobile1")},ClubMember.prototype.mobile2=function(){return this.getFieldValue("mobile2")},ClubMember.prototype.mobile3=function(){return this.getFieldValue("mobile3")},ClubMember.prototype.phone1Field=function(){return this.getField("phone1")},ClubMember.prototype.phone2Field=function(){return this.getField("phone2")},ClubMember.prototype.phone3Field=function(){return this.getField("phone3")},ClubMember.prototype.email1Field=function(){return this.getField("email1")},ClubMember.prototype.email2Field=function(){return this.getField("email2")},ClubMember.prototype.email3Field=function(){return this.getField("email3")},ClubMember.prototype.fax1Field=function(){return this.getField("fax1")},ClubMember.prototype.fax2Field=function(){return this.getField("fax2")},ClubMember.prototype.fax3Field=function(){return this.getField("fax3")},ClubMember.prototype.mobile1Field=function(){return this.getField("mobile1")},ClubMember.prototype.mobile2Field=function(){return this.getField("mobile2")},ClubMember.prototype.mobile3Field=function(){return this.getField("mobile3")},ClubMember.prototype.addressPrimary1Field=function(){return this.getField("addressPrimary1")},ClubMember.prototype.addressPrimary2Field=function(){return this.getField("addressPrimary2")},ClubMember.prototype.addressPrimary3Field=function(){return this.getField("addressPrimary3")},ClubMember.prototype.addressPrimary4Field=function(){return this.getField("addressPrimary4")},ClubMember.prototype.addressPrimary5Field=function(){return this.getField("addressPrimary5")},ClubMember.prototype.addressPrimary6Field=function(){return this.getField("addressPrimary6")},ClubMember.prototype.addressPrimaryTypeField=function(){return this.getField("addressPrimaryType")},ClubMember.prototype.addressSecondary1Field=function(){return this.getField("addressSecondary1")},ClubMember.prototype.addressSecondary2Field=function(){return this.getField("addressSecondary2")},ClubMember.prototype.addressSecondary3Field=function(){return this.getField("addressSecondary3")},ClubMember.prototype.addressSecondary4Field=function(){return this.getField("addressSecondary4")},ClubMember.prototype.addressSecondary5Field=function(){return this.getField("addressSecondary5")},ClubMember.prototype.addressSecondary6Field=function(){return this.getField("addressSecondary6")},ClubMember.prototype.addressSecondaryTypeField=function(){return this.getField("addressSecondaryType")},ClubMember.prototype.addressTertiary1Field=function(){return this.getField("addressTertiary1")},ClubMember.prototype.addressTertiary2Field=function(){return this.getField("addressTertiary2")},ClubMember.prototype.addressTertiary3Field=function(){return this.getField("addressTertiary3")},ClubMember.prototype.addressTertiary4Field=function(){return this.getField("addressTertiary4")},ClubMember.prototype.addressTertiary5Field=function(){return this.getField("addressTertiary5")},ClubMember.prototype.addressTertiary6Field=function(){return this.getField("addressTertiary6")},ClubMember.prototype.addressTertiaryTypeField=function(){return this.getField("addressTertiaryType")},ClubMember.prototype.contactMethodFields=function(){var t=this._fieldCache.__ClubMember__contactMethods,n;return t||(n=[],this.phone1Field()&&n.push(this.phone1Field()),this.phone2Field()&&n.push(this.phone2Field()),this.phone3Field()&&n.push(this.phone3Field()),this.email1Field()&&n.push(this.email1Field()),this.email2Field()&&n.push(this.email2Field()),this.email3Field()&&n.push(this.email3Field()),this.fax1Field()&&n.push(this.fax1Field()),this.fax2Field()&&n.push(this.fax2Field()),this.fax3Field()&&n.push(this.fax3Field()),this.mobile1Field()&&n.push(this.mobile1Field()),this.mobile2Field()&&n.push(this.mobile2Field()),this.mobile3Field()&&n.push(this.mobile3Field()),this._fieldCache.__ClubMember__contactMethods=n,t=this._fieldCache.__ClubMember__contactMethods),t},ClubMember.prototype.addressPrimaryFields=function(){var t=this._fieldCache.__ClubMember__addressPrimaryFields,n;return t||(n=[],this.addressPrimary1Field()&&n.push(this.addressPrimary1Field()),this.addressPrimary2Field()&&n.push(this.addressPrimary2Field()),this.addressPrimary3Field()&&n.push(this.addressPrimary3Field()),this.addressPrimary4Field()&&n.push(this.addressPrimary4Field()),this.addressPrimary5Field()&&n.push(this.addressPrimary5Field()),this.addressPrimary6Field()&&n.push(this.addressPrimary6Field()),this.addressPrimaryTypeField()&&n.push(this.addressPrimaryTypeField()),this._fieldCache.__ClubMember__addressPrimaryFields=n,t=this._fieldCache.__ClubMember__addressPrimaryFields),t},ClubMember.prototype.addressSecondaryFields=function(){var t=this._fieldCache.__ClubMember__addressSecondaryFields,n;return t||(n=[],this.addressSecondary1Field()&&n.push(this.addressSecondary1Field()),this.addressSecondary2Field()&&n.push(this.addressSecondary2Field()),this.addressSecondary3Field()&&n.push(this.addressSecondary3Field()),this.addressSecondary4Field()&&n.push(this.addressSecondary4Field()),this.addressSecondary5Field()&&n.push(this.addressSecondary5Field()),this.addressSecondary6Field()&&n.push(this.addressSecondary6Field()),this.addressSecondaryTypeField()&&n.push(this.addressSecondaryTypeField()),this._fieldCache.__ClubMember__addressSecondaryFields=n,t=this._fieldCache.__ClubMember__addressSecondaryFields),t},ClubMember.prototype.addressTertiaryFields=function(){var t=this._fieldCache.__ClubMember__addressTertiaryFields,n;return t||(n=[],this.addressTertiary1Field()&&n.push(this.addressTertiary1Field()),this.addressTertiary2Field()&&n.push(this.addressTertiary2Field()),this.addressTertiary3Field()&&n.push(this.addressTertiary3Field()),this.addressTertiary4Field()&&n.push(this.addressTertiary4Field()),this.addressTertiary5Field()&&n.push(this.addressTertiary5Field()),this.addressTertiary6Field()&&n.push(this.addressTertiary6Field()),this.addressTertiaryTypeField()&&n.push(this.addressTertiaryTypeField()),this._fieldCache.__ClubMember__addressTertiaryFields=n,t=this._fieldCache.__ClubMember__addressTertiaryFields),t},ClubMember.prototype.getField=function(n){var t=this._fieldCache[n],u,i,r;if(!t&&this._member&&this._member.fields&&this._fieldDefinitions.fieldNames[n])for(u=this._fieldDefinitions.fieldNames[n],i=0;!t&&i<this._member.fields.length;i++)r=this._member.fields[i],r&&r.name==u&&(this._fieldCache[n]=r,t=this._fieldCache[n]);return t},ClubMember.prototype.getFieldValue=function(n){var t=this._fieldValueCache[n],i;return t||(i=this.getField(n),i&&(this._fieldValueCache[n]=i.value,t=this._fieldValueCache[n])),t},ClubMember.prototype.fields=function(n){var t=[];return!this._member||!this._member.fields?t:(t=this._member.fields,t=t.filter(function(t){return t.section===n}),t.sort(function(n,t){return n.order<t.order?-1:n.order>t.order?1:0}))},memberCommon=angular.module("memberCommon.app",[]),memberCommon.controller("IntroDetailsWidgetController",["$scope","HttpRequestService",function(n,t){n.init=function(t,i){n.clientProxyUrl=t;n.memberLoyaltyUrl=i;n.loyaltyWidgetLoading=!1;n.data={loyaltyBalance:0};n.initialiseLoyaltyBalance()};n.initialiseLoyaltyBalance=function(){n.memberLoyaltyUrl&&(n.loyaltyWidgetLoading=!0,t.sendGetRequest(n.clientProxyUrl,n.memberLoyaltyUrl,function(t){n.data.loyaltyBalance=t.balance;n.loyaltyWidgetLoading=!1},function(){n.data.loyaltyBalance="?";n.statusMessage="An error occurred while contacting the server. Please try again.";n.loyaltyWidgetLoading=!1}))}}]),memberCommon.directive("loadingIndicator",function(){var n=function(n,t,i){n.$watch(i.loadingIndicator,function(){n[i.loadingIndicator]?t.prepend('<div class="mp-loading-centered loading-'+i.loadingIndicator+'"><\/div>'):t.children(".loading-"+i.loadingIndicator).remove()})},t=function(){};return{restrict:"A",controller:t,link:n}}),memberCommon.directive("templatePath",function(){return{restrict:"A",replace:!0,templateUrl:function(n,t){return t.templatePath}}}),memberCommon.directive("smCollapse",function(){var n=function(n,t){function r(){var n=$("body").width();n<767&&$(t).toggleClass("close")}$(t).addClass("sm-collapse");var i=$("body").width();i<767&&$(t).addClass("close");t.on("click",r)},t=function(){};return{restrict:"A",link:n,controller:t}}),memberCommon.directive("submitField",[function(){var n=function(n,t,i){t.keydown(function(n){var t=!0;return n.keyCode==13&&($(i.submitField).focus().click(),n.stopPropagation(),t=!1),t})},t=function(){};return{restrict:"A",link:n,controller:t}}]),navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1&&getCookie("Safari")==!1&&window.self!=window.top){var token=getParameterByName("token"),tokenQuery=token==""?"":["&token=",token].join(""),locationPath=endsWith(location.pathname,"/")?location.pathname:[location.pathname,"/"].join("");top.location=[location.protocol,"//",location.host,locationPath,"safari?destination=",document.referrer,tokenQuery].join("")}memberCommon.factory("HttpRequestService",["$http",function(n){var r=function(n,i,r,u){t(n,i,"DELETE",null,r,u)},u=function(n,i,r,u){t(n,i,"GET",null,r,u)},f=function(n,i,r,u,f){t(n,i,"POST",r,u,f)},e=function(n,i,r,u,f){t(n,i,"PUT",r,u,f)},t=function(t,r,u,f,e,o){r=i(t,r,u,"application/json");n({method:u,url:r,data:f}).success(e).error(o)},i=function(n,t,i,r){var u=t;return n&&n.length>0&&(u=n+"?url="+encodeURIComponent(t)+"&method="+encodeURI(i),r&&(u=u+"&type="+encodeURI(r))),u};return{sendDeleteRequest:r,sendGetRequest:u,sendPostRequest:f,sendPutRequest:e,formatClientProxyRequest:i}}]);memberCommon.factory("HypermediaService",["$filter",function(n){var t=function(t,i){var u=null,r;return t&&t.links&&(r=n("filter")(t.links,{rel:i},!0),r.length&&(u=r[0].href)),u};return{getReferenceLink:t}}]);memberCommon.factory("MemberDecoratorService",[function(){var n=new OmnisClubMemberFieldDefinitions,t=function(t){return new ClubMember(t,n)};return{getClubMember:t}}])