define(["angular","lodash","cjt/util/locale","app/utils/cloneUrlParser","ngSanitize","uiBootstrap","app/services/knownHostsService","cjt/directives/actionButtonDirective"],(function(t,e,n,o){"use strict";t.module("cpanel.versionControl.sshKeyVerificationService",["cpanel.versionControl.knownHostsService","ui.bootstrap","ngSanitize","cjt2.directives.actionButton"]).factory("sshKeyVerification",["knownHostsService","$uibModal",function(t,i){var r,s,c,a=(r=e.memoize(t.verify,l),s=r.cache,(c=r.bind(t)).cache=s,c),u={verify:a,getHostnameAndPort:function(t){var e=o.parse(t);if("ssh://"===e.scheme||!e.scheme&&e.userInfo)return{hostname:e.authority||e.ipv6Authority,port:e.port}},openModal:function(t){var e=this;return e.modal=i.open({templateUrl:"views/sshKeyVerification.ptt",controllerAs:"modal",controller:h,resolve:{props:function(){return t}}}),e.modal.result.finally((function(){delete e.modal})),e.modal}};function h(t){e.assign(this,t)}function l(t,e){return t+(e=e?":"+e:"")}return h.$inject=["props"],e.assign(h.prototype,{acceptIdentity:function(){var e=this,n=t.create(e.hostname,e.port).then((function(t){return t.status})).finally((function(){var t=l(e.hostname,e.port);a.cache.delete(t),a(e.hostname,e.port)}));return e.onAccept?e.onAccept(n):n},rejectIdentity:function(){u.modal.dismiss()},newKeyIntro:function(){return n.maketext("You have not connected this [asis,cPanel] account to the SSH server for “[output,strong,_1].” The system cannot verify the server’s identity.",this.hostname)},changedKeyIntro:function(){return n.maketext("The current identity of the SSH server at “[output,strong,_1]” does not match its identity in your account’s [asis,known_hosts] file.",this.hostname)},keyIsNew:function(){return"unrecognized-new"===this.type},keyIsChanged:function(){return"unrecognized-changed"===this.type}}),u}])}));