(function(){"use strict";function n(n,t,i,r,u){function o(){return f}function s(n){var t=/\/([^\/]+)/i.exec(n),u=t&&t.splice(1,1).pop();return u?$http.get(r.user.replace(/(users\/)[^\/]+/i,"$1"+u)).then(function(n){f=n.data}):i.resolve()}function h(){return t.path()}function c(){return u.getCurrentUserOrWait().then(function(t){return t.subject===null?i.resolve(null):n.get(t.hrefGet).then(function(n){return n.data})})}function l(t){return angular.equals({},t)||!t.subject?e():n.get(r.getRsaContact.replace("00000000-0000-0000-0000-000000000000",t.subject)).then(function(n){return n.data},function(){return e()})}function e(){return n.get(r.getOrganization).then(function(n){return n.data})}var f={};return{getCurrentUser:c,getContactUser:l,loadUser:function(){return s(h())},getUser:o}}angular.module("app").factory("contactService",["dataContext","$location","$q","hrefs","identity",n])})(_),function(n){"use strict";function i(t,i){function u(n){r.contactUser.firstName=n.person.firstName;r.contactUser.lastName=n.person.lastName;r.contactUser.phone=n.profile.phone1;r.contactUser.email=n.profile.personalEmail}function f(n){r.contactUser.firstName="";r.contactUser.lastName="";r.contactUser.phone=n.primaryPhoneNumber;r.contactUser.email=n.email}var r=this;r.currentUser={};r.contactUser={};this.contactForUser?(r.currentUser=this.contactForUser,t.getContactUser(r.currentUser).then(function(t){!n.equals({},r.currentUser)&&t.person?u(t):f(t)})):i.getCurrentUserOrWait().then(function(i){r.currentUser=i;t.getContactUser(r.currentUser).then(function(t){!n.equals({},r.currentUser)&&t.person?u(t):f(t)})})}var t=n.module("app");t.component("contact",{controller:["contactService","identity",i],controllerAs:"vm",templateUrl:["templateUrls",function(n){return n.contact.toString()}],bindings:{contactForUser:"<"}})}(angular)