"use strict";(self.webpackChunklink_server_nodes=self.webpackChunklink_server_nodes||[]).push([[792],{4549:(C,E,d)=>{var R=d(345),t=d(3953),m=d(177),I=d(5037),U=d(8658),p=d(7901),r=d(9417),g=d(6381),T=d(7410);const z=window&&window.PAGE?window.PAGE.base:"",x=!(!window||!window.PAGE)&&"1"===window.PAGE.locale_is_rtl,F=window&&window.PAGE?window.PAGE.cp_security_token:"",J=window&&window.PAGE?window.PAGE.short_hostname:"";var h=d(6802),b=d(9323),W=d(686),q=d(6153),j=d(8391),u=d(6354),Q=d(8523);class A{constructor(s,e,i,o,a,c,k,v){if(this.deleting=!1,this.confirmingDelete=!1,this.handleApiToken="expire_24h",this.alias=s,this.hostname=e,this.username=i,this.enabledServices=o,a instanceof Date)this.lastCheck=a;else{const y=parseInt(a.toString(),10);this.lastCheck=new Date(1e3*y)}this.version=c,this.workerCapabilities=k,this.tlsVerified="boolean"==typeof v?v:"1"===v.toString()}}const Z=["hostname"];let w=(()=>{class n{constructor(e){this.apiClient=e}generateRemoteToken(e,i,o,a){const c=this._apiCall("execute_remote_whmapi1_with_password",{host:e,username:i,password:o,tls_verification:a?"off":"on",function:"api_token_create"});return c.addArgument(new h.e("parameter_name","token_name")),c.addArgument(new h.e("parameter_value",this._generateTokenName())),c.addArgument(new h.e("parameter_name","acl")),c.addArgument(new h.e("parameter_value","all")),this.apiClient.post(c).pipe((0,u.T)(this._parseTypedResponse))}forceDedistributeAccounts(e,i){const o=[new h.e("node_alias",e)];i.forEach(c=>{o.push(new h.e("user",c))});const a=new b.m(b.R.JsonApi,{method:"force_dedistribution_from_node",arguments:o});return this.apiClient.post(a).pipe((0,u.T)(this._parseForceDedistributeData))}linkServerNode(e,i,o,a,c){return this.generateRemoteToken(i,o,a,c).pipe((0,Q.q)(k=>{const y=this._apiCall("link_server_node_with_api_token",{alias:e,hostname:i,username:o,api_token:k.data.token,skip_tls_verification:c?"1":"0"});return this.apiClient.post(y).pipe((0,u.T)(this._parseTypedResponse))}))}listDistributedAccounts(e,i){const o=new b.m(b.R.JsonApi,{method:"PRIVATE_list_accounts_distributed_to_child_node",arguments:[new h.e("alias",e)],pager:new W.is(i.page,i.recordsPerPage),sorts:[new q.FU("username")],filters:[new j.d("username",j.t.Contains,i.filter)]});return this.apiClient.post(o).pipe((0,u.T)(this._parseListAccountResponse))}listLinkedServerNodes(){const e=this._apiCall("list_linked_server_nodes");return this.apiClient.post(e).pipe((0,u.T)(this._parseDataFromWhmApiResponse),(0,u.T)(i=>i.map(this._parseLinkedServerNode)))}unlinkServerNode(e,i){const o=this._apiCall("unlink_server_node",{alias:e,..."expire_24h"===i&&{handleApiToken:i}});return this.apiClient.post(o).pipe((0,u.T)(a=>{if(a.hasErrors)throw a.errors.pop();return a}))}updateServerNode(e,i){const o=this._apiCall("update_linked_server_node",{alias:e.alias});return Z.forEach(a=>{e[a]!==i[a]&&o.addArgument(new h.e(a,i[a]))}),this.apiClient.post(o).pipe((0,u.T)(a=>{if(a.hasErrors)throw a.errors.pop();return a}))}_apiCall(e,i){const o=i?Object.keys(i).map(a=>new h.e(a,i[a])):[];return new b.m(b.R.JsonApi,{method:e,arguments:o})}_parseDataFromWhmApiResponse(e){if(e.status)return e.data;if(e.hasErrors)throw e.errors.pop()}_parseForceDedistributeData(e){if(e.status){let i="";return e.data.log.forEach(o=>{i+=o.indent?`\t${o.contents}\n`:`${o.contents}\n`}),e.data.formattedLog=i,e.data}if(e.hasErrors)throw e.errors.pop()}_parseLinkedServerNode(e){return new A(e.alias,e.hostname,e.username,e.enabled_services,e.last_check,e.version,e.worker_capabilities,e.tls_verified)}_parseListAccountResponse(e){if(e.status)return e.meta.isPaged?{data:e.data.map(o=>(o.selected=!1,o)),pagination:{page:e.meta.page,recordsPerPage:e.meta.pageSize,totalPages:e.meta.totalPages,totalRecords:e.meta.totalRecords,start:e.meta.record,filter:""}}:e.data;if(e.hasErrors)throw e.errors.pop()}_generateTokenName(){const i="PARENT-DO_NOT_DELETE-"+J.replace(/[^a-z0-9_-]/gi,"_"),o=Math.random().toString(36).substr(2);return i.substring(0,49-o.length)+"-"+o}_parseTypedResponse(e){if(e.hasErrors){const i=e.errors.pop();throw e.data&&e.data.type&&(i.type=e.data.type,i.data=e.data),i}return e}static#t=this.\u0275fac=function(i){return new(i||n)(t.KVO(I.gB))};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();const K=(n,s)=>e=>n.find(o=>o.alias===e.value)?{aliasIsUnique:{message:s}}:null,M=(n,s)=>e=>n.find(o=>o.hostname===e.value)?{hostnameIsUnique:{message:s}}:null,tt=(n,s)=>{const e=r.k0.maxLength(n);return i=>e(i)?{maxLength:{message:s}}:null},et=(n,s)=>{const e=r.k0.pattern(n);return i=>e(i)?{pattern:{value:i.value,message:s}}:null},S=n=>s=>r.k0.required(s)?{required:{message:n}}:null;var nt=d(5964),l=d(389);const it=[[["","form-group-label",""]],[["","form-group-control",""]]],ot=["[form-group-label]","[form-group-control]"];let D=(()=>{class n{constructor(){}hasErrors(){return this.control.invalid}hasChanged(){return this.control.dirty||this.control.touched}getFieldErrors(){return Object.keys(this.control.errors).map(e=>({key:e,message:this.control.errors[e].message}))}getFieldStateClasses(){return this.hasChanged()?this.hasErrors()?"has-error":"has-success":""}ngOnInit(){this.id=`formGroup_${this.for}`,this.labelID=`${this.id}_formLabel`,this.validationContainerID=`${this.id}_validationContainer`}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-form-group"]],inputs:{for:"for",label:"label",control:"control",showAllHelp:"showAllHelp"},ngContentSelectors:ot,decls:11,vars:8,consts:[[1,"form-group",3,"ngClass"],[1,"row"],[1,"col-xs-12"],[3,"id","for","labelText","showInfoBlock"],[3,"id","control"]],template:function(i,o){1&i&&(t.NAR(it),t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"cp-form-label",3),t.SdG(4),t.k0s()()(),t.j41(5,"div",1)(6,"div",2),t.SdG(7,1),t.k0s()(),t.j41(8,"div",1)(9,"div",2),t.nrm(10,"cp-validation-container",4),t.k0s()()()),2&i&&(t.Y8G("ngClass",o.getFieldStateClasses()),t.BMQ("id",o.id),t.R7$(3),t.Y8G("id",o.labelID)("for",o.for)("labelText",o.label)("showInfoBlock",o.showAllHelp),t.R7$(7),t.Y8G("id",o.validationContainerID)("control",o.control))},dependencies:[m.YU,l.Wp,l.kl],encapsulation:2})}return n})();const P=()=>["/"],N=(n,s)=>({"fa-arrow-left":n,"fa-arrow-right":s});function st(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",3)(1,"div",4)(2,"div",5),t.EFF(3),t.k0s()(),t.j41(4,"div",6)(5,"cp-callout",7)(6,"span",8),t.EFF(7),t.k0s(),t.j41(8,"p"),t.EFF(9),t.k0s(),t.j41(10,"h4"),t.EFF(11),t.k0s(),t.j41(12,"ul")(13,"li")(14,"a",9),t.EFF(15),t.k0s()(),t.nrm(16,"li",10),t.k0s()()(),t.j41(17,"div",11)(18,"div")(19,"button",12),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.reset())}),t.nrm(20,"i",13),t.EFF(21),t.k0s(),t.j41(22,"button",14),t.nrm(23,"i",15),t.EFF(24),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(3),t.JRh(e.pageTitle),t.R7$(4),t.JRh(e.locale.maketext("Success!")),t.R7$(2),t.SpI(" ",e.locale.maketext("You have successfully created a new connection to the linked node.")," "),t.R7$(2),t.JRh(e.locale.maketext("What Next?")),t.R7$(3),t.Mz_("href","",e.cpSecurityToken,"/scripts5/wwwacctform",t.B4B),t.R7$(),t.SpI(" ",e.locale.maketext("Create a new account that uses this connection")," "),t.R7$(),t.Y8G("innerHTML",e.locale.maketext("[output,strong,Warning:] Do [output,strong,not] update your child node\u2019s hostname after you link two nodes. This operation could corrupt the nodes\u2019 ability to communicate."),t.npT),t.R7$(3),t.Y8G("title",e.locale.maketext("Click here to create another connection to a remote node.")),t.R7$(2),t.SpI(" ",e.locale.maketext("Create Another")," "),t.R7$(),t.FS9("title",e.locale.maketext("Go back to the list of linked nodes.")),t.Y8G("routerLink",t.lJ4(15,P)),t.BMQ("disabled",e.serverNodes.length?null:""),t.R7$(),t.Y8G("ngClass",t.l_i(16,N,!e.RTL,e.RTL)),t.R7$(),t.SpI(" ",e.locale.maketext("Go Back")," ")}}function at(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.locale.maketext("Show Details"))}}function rt(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.locale.maketext("Hide Details"))}}function lt(n,s){if(1&n&&(t.j41(0,"pre",46),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.verificationError)}}function ct(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",39)(1,"div",40)(2,"cp-callout",41)(3,"span",42),t.EFF(4),t.k0s(),t.j41(5,"p"),t.EFF(6),t.k0s(),t.j41(7,"a",43),t.bIt("click",function(){t.eBV(e);const o=t.XpG(3);return t.Njj(o.toggleErrorDetails())}),t.DNE(8,at,2,1,"span",24)(9,rt,2,1,"span",24),t.EFF(10," \xa0 "),t.nrm(11,"i",44),t.k0s(),t.DNE(12,lt,2,1,"pre",45),t.k0s()()()}if(2&n){const e=t.XpG(3);t.R7$(4),t.JRh(e.locale.maketext("Error:")),t.R7$(2),t.SpI(" ",e.locale.maketext("The system could not create the connection to the remote server because of an error.")," "),t.R7$(2),t.Y8G("ngIf",!e.showErrorDetails),t.R7$(),t.Y8G("ngIf",e.showErrorDetails),t.R7$(2),t.Y8G("ngClass",e.showErrorDetailsArrowClass),t.R7$(),t.Y8G("ngIf",e.showErrorDetails)}}function dt(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.locale.maketext("Show Details"))}}function mt(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.locale.maketext("Hide Details"))}}function pt(n,s){if(1&n&&(t.j41(0,"pre",46),t.EFF(1),t.k0s()),2&n){const e=t.XpG(4);t.R7$(),t.JRh(e.verificationError)}}function ut(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",47)(1,"div",40)(2,"cp-callout",48)(3,"span",42),t.EFF(4),t.k0s(),t.nrm(5,"p",49),t.j41(6,"a",43),t.bIt("click",function(){t.eBV(e);const o=t.XpG(3);return t.Njj(o.toggleErrorDetails())}),t.DNE(7,dt,2,1,"span",24)(8,mt,2,1,"span",24),t.EFF(9," \xa0 "),t.nrm(10,"i",44),t.k0s(),t.DNE(11,pt,2,1,"pre",45),t.j41(12,"div",50)(13,"label",51),t.nrm(14,"input",52),t.EFF(15),t.k0s()()()()()}if(2&n){const e=t.XpG(3);t.R7$(4),t.JRh(e.locale.maketext("Warning:")),t.R7$(),t.Y8G("innerHtml",e.locale.maketext("The system could not create a connection to the remote server because of a [output,abbr,TLS,Transport Layer Security] verification error. You can attempt to create an insecure connection between the servers instead."),t.npT),t.R7$(2),t.Y8G("ngIf",!e.showErrorDetails),t.R7$(),t.Y8G("ngIf",e.showErrorDetails),t.R7$(2),t.Y8G("ngClass",e.showErrorDetailsArrowClass),t.R7$(),t.Y8G("ngIf",e.showErrorDetails),t.R7$(4),t.SpI(" ",e.locale.maketext("I understand the risks. Connect anyway.")," ")}}function ht(n,s){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"section")(2,"cp-link-nodes-form-group",27)(3,"div",28),t.EFF(4),t.k0s(),t.j41(5,"div",29)(6,"input",30),t.bIt("blur",function(){t.eBV(e);const o=t.XpG(2);return t.Njj(o.onHostnameBlur())}),t.k0s(),t.j41(7,"span",31),t.EFF(8,":2087"),t.k0s()()(),t.j41(9,"cp-link-nodes-form-group",32)(10,"div",28),t.EFF(11),t.k0s(),t.nrm(12,"input",33),t.k0s(),t.j41(13,"cp-link-nodes-form-group",34)(14,"div",28),t.EFF(15),t.k0s(),t.j41(16,"div",35),t.nrm(17,"input",36),t.k0s()(),t.DNE(18,ct,13,6,"div",37)(19,ut,16,7,"div",38),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(2),t.Y8G("showAllHelp",e.showAllHelp)("control",e.hostname)("label",e.locale.maketext("Hostname")),t.R7$(2),t.SpI(" ",e.locale.maketext("Enter the hostname of the remote node for this connection.")," "),t.R7$(5),t.Y8G("showAllHelp",e.showAllHelp)("control",e.alias)("label",e.locale.maketext("Friendly Name")),t.R7$(2),t.Lme(" ",e.locale.maketext("Provide a name for the connection to the linked node.")," ",e.locale.maketext("You can only enter alphanumeric, dash, and underscore characters. The length must be less than or equal to [quant,_1,character,characters].",50)," "),t.R7$(2),t.Y8G("showAllHelp",e.showAllHelp)("control",e.password)("label",e.locale.maketext("Remote [asis,root] Password")),t.R7$(2),t.SpI(" ",e.locale.maketext("Enter the remote node\u2019s [asis,root] password for this connection.")," "),t.R7$(3),t.Y8G("ngIf",!e.showSkipTLSWarning&&e.verificationError),t.R7$(),t.Y8G("ngIf",e.showSkipTLSWarning)}}function _t(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(3);t.R7$(),t.JRh(e.locale.maketext("Linking to \u201c[_1]\u201d \u2026",e.alias.value))}}function gt(n,s){if(1&n&&(t.j41(0,"div")(1,"div",53),t.DNE(2,_t,2,1,"ng-template",null,0,t.C5r),t.nrm(4,"cp-loading-spinner",54),t.k0s(),t.nrm(5,"hr",55),t.k0s()),2&n){const e=t.sdS(3);t.R7$(4),t.Y8G("loadingTemplate",e)}}function ft(n,s){if(1&n){const e=t.RV6();t.j41(0,"form",16)(1,"div",17)(2,"div",18)(3,"div",19),t.EFF(4),t.k0s(),t.j41(5,"div",20)(6,"button",21),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.toggleHelp())}),t.EFF(7),t.nrm(8,"i",22),t.k0s()(),t.nrm(9,"div",23),t.k0s(),t.j41(10,"div",6),t.DNE(11,ht,20,15,"div",24)(12,gt,6,1,"div",24),t.k0s(),t.j41(13,"div",11)(14,"div")(15,"button",25),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.create())}),t.nrm(16,"i",13),t.EFF(17),t.k0s(),t.j41(18,"button",26),t.nrm(19,"i",15),t.EFF(20),t.k0s()()()()()}if(2&n){const e=t.XpG();t.Y8G("formGroup",e.linkForm),t.R7$(4),t.JRh(e.pageTitle),t.R7$(3),t.SpI(" ",e.getToggleHelpLabel()," "),t.R7$(4),t.Y8G("ngIf",!e.creatingLink),t.R7$(),t.Y8G("ngIf",e.creatingLink),t.R7$(3),t.FS9("title",e.locale.maketext("Click here to connect this server to a remote node.")),t.Y8G("disabled",e.creatingLink),t.R7$(2),t.SpI(" ",e.locale.maketext("Create")," "),t.R7$(),t.FS9("title",e.locale.maketext("Go back to the list of linked nodes.")),t.Y8G("disabled",e.creatingLink)("routerLink",t.lJ4(14,P)),t.BMQ("disabled",e.serverNodes.length?null:""),t.R7$(),t.Y8G("ngClass",t.l_i(15,N,!e.RTL,e.RTL)),t.R7$(),t.SpI(" ",e.locale.maketext("Return to Linked Nodes")," ")}}let kt=(()=>{class n{constructor(e,i){this.locale=e,this.service=i,this.rtl=!1,this.cpSecurityToken=F,this.rtl=x,this.showErrorDetails=!1,this.showErrorDetailsArrowClass=this.rtl?"fas fa-chevron-left":"fas fa-chevron-right"}get alias(){return this.linkForm.get("alias")}get hostname(){return this.linkForm.get("hostname")}get password(){return this.linkForm.get("password")}get confirmNonTLS(){return this.linkForm.get("confirmNonTLS")}toggleHelp(){this.showAllHelp=!this.showAllHelp}reset(){this.showSkipTLSWarning=!1,this.verificationError=null,this.creationComplete=!1,this.creatingLink=!1,this.linkForm.reset({hostname:"",user:"root"})}showError(e){this.verificationError=e}toggleErrorDetails(){this.showErrorDetails=!this.showErrorDetails,this.showErrorDetailsArrowClass=this.showErrorDetails?"fas fa-chevron-down":this.rtl?"fas fa-chevron-left":"fas fa-chevron-right"}create(){if(Object.keys(this.linkForm.controls).forEach(e=>{this.linkForm.controls[e].markAsTouched(),this.linkForm.controls[e].updateValueAndValidity()}),this.linkForm.updateValueAndValidity(),this.linkForm.markAsTouched(),this.linkForm.valid)return this._create()}getToggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}loadLinkedServerNodes(){this.service.listLinkedServerNodes().subscribe(e=>{this.serverNodes.splice(0,this.serverNodes.length),e.forEach(i=>{this.serverNodes.push(i)})})}populateEmptyAlias(){if(this.alias.untouched){const i=this.hostname.value.replace(/[^a-z0-9_-]/gi,"-");this.alias.setValue(i)}}onHostnameBlur(){this.hostname.valid&&this.populateEmptyAlias()}ngOnInit(){this.serverNodes=[],this.pageTitle=this.locale.maketext("Create A New Connection"),this.linkForm=new r.J3({alias:new r.hs("",[S(this.locale.maketext("You [output,strong,must] enter a friendly name for the connection.")),tt(50,this.locale.maketext("The friendly name cannot be longer than [quant,_1,character,characters].",50)),et(/^[a-zA-Z0-9_-]{1,}$/,this.locale.maketext("The friendly name can only contain alphanumeric, dash, and underscore characters.")),K(this.serverNodes,this.locale.maketext("The friendly name [output,strong,must] be unique. A connection with this friendly name already exists."))]),user:new r.hs("root"),hostname:new r.hs("",[S(this.locale.maketext("You [output,strong,must] enter a hostname.")),M(this.serverNodes,this.locale.maketext("The hostname must be unique. A connection with this hostname already exists.")),T.md.fqdn()]),password:new r.hs("",[S(this.locale.maketext("You [output,strong,must] enter a [asis,root] password for the remote node."))]),confirmNonTLS:new r.hs(!1,[this._validateConfirmNonTLS.bind(this)])});const e={};["alias","hostname","password"].forEach(function(i){this.linkForm.get(i).valueChanges.pipe((0,nt.p)(o=>o!==e[i])).subscribe(o=>{e[i]=o,this.showSkipTLSWarning=!1,this.verificationError=null})},this),this.loadLinkedServerNodes()}_validateConfirmNonTLS(e){return this.linkForm&&this.showSkipTLSWarning&&r.k0.requiredTrue(e)?{requiredTrue:{message:this.locale.maketext("You [output,strong,must] confirm that you acknowledge the risks.")}}:null}_generateSSLDetailMessage(e){if(e.data&&e.data.detail){const i=[];return"1"!==e.data.detail.matches_host.toString()&&i.push(this.locale.maketext("The remote hostname does not match the installed certificate.")),"DEPTH_ZERO_SELF_SIGNED_CERT"===e.data.detail.handshake_verify_text&&i.push(this.locale.maketext("The remote certificate is self-signed.")),i.length?this.locale.maketext("Verification of the remote node\u2019s [asis,SSL] certificate failed for the following [numerate,_1,reason,reasons]:",i.length)+"\n"+i.join("\n"):e.message}return e.message}_create(){return this.linkForm.disable(),this.creatingLink=!0,this.service.linkServerNode(this.linkForm.value.alias,this.linkForm.value.hostname,this.linkForm.value.user,this.linkForm.value.password,this.linkForm.value.confirmNonTLS).subscribe({error:e=>{let i=e.message;this.linkForm.value.confirmNonTLS||"TLSVerification"!==e.type?this.showSkipTLSWarning=!1:(this.showSkipTLSWarning=!0,i=this._generateSSLDetailMessage(e)),this.showError(i),this.creatingLink=!1,this.linkForm.enable()},next:()=>{this.linkForm.enable(),this.creationComplete=!0,this.creatingLink=!1,this.loadLinkedServerNodes()}})}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(g.h),t.rXU(w))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-create"]],decls:3,vars:2,consts:[["creatingLinkTemplate",""],["class","panel panel-success",4,"ngIf"],["id","createLinkForm","name","createLinkForm",3,"formGroup",4,"ngIf"],[1,"panel","panel-success"],[1,"panel-heading","text-left"],[1,"widget-title"],[1,"panel-body"],["id","creationSuccessfulCallout","calloutType","success"],["callout-heading","",2,"text-transform","none"],[3,"href"],[3,"innerHTML"],[1,"panel-footer"],["id","btnPostSuccessContinue","type","submit",1,"btn","btn-primary",3,"click","title"],["aria-hidden","true",1,"fas","fa-plus"],["id","btnCancelCreateAnother","type","button",1,"btn","btn-link","pull-right","flip",3,"routerLink","title"],["aria-hidden","true",1,"fas",3,"ngClass"],["id","createLinkForm","name","createLinkForm",3,"formGroup"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"pull-right","flip"],["type","button","id","lnkshowHideHelp",1,"btn","btn-default","btn-xs",3,"click"],[1,"far","fa-question-circle","form-info-sign"],[1,"clearfix"],[4,"ngIf"],["id","btnCreateServerLink","type","submit",1,"btn","btn-primary",3,"click","disabled","title"],["id","btnCancelServerLink","type","button",1,"btn","btn-link","pull-right","flip",3,"disabled","routerLink","title"],["for","hostname",3,"showAllHelp","control","label"],["form-group-label",""],["form-group-control","",1,"input-group"],["type","text","id","hostname","name","hostname","placeholder","host.example.com","formControlName","hostname",1,"form-control",3,"blur"],[1,"input-group-addon"],["for","alias",3,"showAllHelp","control","label"],["form-group-control","","type","text","id","alias","placeholder","mymailserver","formControlName","alias",1,"form-control"],["for","password",3,"showAllHelp","control","label"],["form-group-control",""],["type","password","id","password","name","password","autocomplete","off","formControlName","password",1,"form-control"],["class","row",4,"ngIf"],["class","tls-warning-callout",4,"ngIf"],[1,"row"],[1,"col-xs-12"],["id","connectionVerifiedCallout","calloutType","danger",1,"tlsVerification"],["callout-heading",""],["href","javascript:void(0)",1,"btn","btn-link","show-error-details-btn",3,"click"],["aria-hidden","true",3,"ngClass"],["class","verification-error-pre",4,"ngIf"],[1,"verification-error-pre"],[1,"tls-warning-callout"],["id","connectionCheckCallout","calloutType","warning"],[3,"innerHtml"],[1,"checkbox"],["for","confirmNonTLS"],["type","checkbox","name","confirmNonTLS","id","confirmNonTLS","formControlName","confirmNonTLS"],[1,"checkbox","creating-link-spinner"],["id","creatingLinkLoader",3,"loadingTemplate"],[1,"separator"]],template:function(i,o){1&i&&(t.j41(0,"div"),t.DNE(1,st,25,19,"div",1)(2,ft,21,18,"form",2),t.k0s()),2&i&&(t.R7$(),t.Y8G("ngIf",o.creationComplete),t.R7$(),t.Y8G("ngIf",!o.creationComplete))},dependencies:[p.Wk,m.YU,m.bT,r.qT,r.me,r.Zm,r.BC,r.cb,r.j4,r.JD,l.GV,l.NB,D],styles:[".verification-error-pre[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word}.tls-warning-callout[_ngcontent-%COMP%]{margin-top:-15px}.show-error-details-btn[_ngcontent-%COMP%]{padding-left:0;padding-right:0;margin-top:0}"]})}return n})();var H=d(7376),bt=d(1584),Ct=d(3229),f=d(5532),L=d(4722);const vt=["*"];let $=(()=>{class n{constructor(e){this.locale=e,this.deleteConfirmationHeader=this.locale.maketext("Are you sure?")}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(g.h))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-deletion-callout"]],inputs:{id:"id"},ngContentSelectors:vt,decls:8,vars:1,consts:[[1,"delete-confirm-container"],[1,"callout","callout-danger"],[1,"delete-confirm-message"],[1,"callout-heading"],[1,"delete-dialog-icon","fas","fa-question-circle"],[1,"delete-dialog-content"]],template:function(i,o){1&i&&(t.NAR(),t.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.EFF(4),t.k0s(),t.nrm(5,"i",4),t.j41(6,"div",5),t.SdG(7),t.k0s()()()()),2&i&&(t.R7$(4),t.JRh(o.deleteConfirmationHeader))},styles:[".delete-confirm-container[_ngcontent-%COMP%]{padding:0}.delete-confirm-container[_ngcontent-%COMP%] .callout[_ngcontent-%COMP%]{padding-top:0;padding-bottom:0;margin-bottom:0;overflow:hidden}.delete-confirm-message[_ngcontent-%COMP%]{position:relative;padding:3rem 6rem 1.5rem}.delete-confirm-message[_ngcontent-%COMP%] > strong[_ngcontent-%COMP%]{font-size:1.4em}.delete-dialog-icon[_ngcontent-%COMP%]{position:absolute;top:-21px;padding:0;font-size:9em;color:#e74c3c38;pointer-events:none}html[dir=ltr][_ngcontent-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%]{left:-32px}html[dir=rtl][_ngcontent-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .delete-dialog-icon[_ngcontent-%COMP%]{right:-32px}.callout[_ngcontent-%COMP%]{margin-top:0;margin-bottom:5px}.delete-note[_ngcontent-%COMP%]{font-size:.95em;padding-top:10px;display:block}.delete-confirm[_ngcontent-%COMP%]{overflow:hidden}html[dir=ltr][_ngcontent-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%]{padding-left:0}html[dir=rtl][_ngcontent-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .delete-confirm[_ngcontent-%COMP%]{padding-right:0}"]})}return n})();const Rt=()=>["/create"],xt=n=>["/manage",n];function Ft(n,s){if(1&n&&(t.nrm(0,"i",9),t.EFF(1," \xa0 "),t.nrm(2,"span",10)),2&n){const e=t.XpG();t.R7$(2),t.Y8G("innerHtml",e.locale.maketext("[output,abbr,TLS,Transport Layer Security] Verified"),t.npT)}}function wt(n,s){if(1&n&&(t.nrm(0,"i",11),t.EFF(1," \xa0 "),t.nrm(2,"span",10)),2&n){const e=t.XpG();t.R7$(2),t.Y8G("innerHtml",e.locale.maketext("Not [output,abbr,TLS,Transport Layer Security] Verified"),t.npT)}}function St(n,s){1&n&&t.nrm(0,"i",23)}function Tt(n,s){1&n&&t.nrm(0,"i",11)}function Lt(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",24)(1,"pagination",25),t.bIt("pageChanged",function(o){t.eBV(e);const a=t.XpG(2);return t.Njj(a.pageChanged(o))}),t.k0s(),t.j41(2,"p",26),t.EFF(3),t.k0s()()}if(2&n){const e=t.XpG(2);t.R7$(),t.Y8G("boundaryLinks",e.pagination.showBoundaryLinks)("totalItems",e.items.length)("maxSize",e.pagination.maxSize)("itemsPerPage",e.pagination.pageSize),t.R7$(2),t.JRh(e.showingText)}}function $t(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",12)(1,"div",13)(2,"div",14)(3,"form",15),t.nrm(4,"input",16),t.k0s(),t.j41(5,"span",17)(6,"button",18),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.searchFilter="")}),t.DNE(7,St,1,0,"i",19)(8,Tt,1,0,"i",20),t.k0s()()()(),t.j41(9,"div",21),t.DNE(10,Lt,4,5,"div",22),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(3),t.Y8G("formGroup",e.searchFilterForm),t.R7$(),t.Y8G("placeholder",e.locale.maketext("Search"))("title",e.locale.maketext("Search")),t.BMQ("aria-label",e.locale.maketext("Search")),t.R7$(2),t.BMQ("aria-label",e.locale.maketext(e.searchFilter?"Search":"Clear")),t.R7$(),t.Y8G("ngIf",e.searchFilter),t.R7$(),t.Y8G("ngIf",!e.searchFilter),t.R7$(2),t.Y8G("ngIf",e.pagination.show)}}function Gt(n,s){if(1&n&&(t.j41(0,"label",46),t.EFF(1),t.k0s()),2&n){const e=s.$implicit;t.FS9("btnRadio",e),t.R7$(),t.JRh(e)}}function yt(n,s){if(1&n&&(t.j41(0,"ul",39)(1,"li",40)(2,"div",41),t.EFF(3),t.k0s(),t.j41(4,"div")(5,"div",42)(6,"form",15)(7,"div",43)(8,"div",44),t.DNE(9,Gt,2,2,"label",45),t.k0s()()()()()()()),2&n){const e=t.XpG(3);t.R7$(3),t.SpI(" ",e.locale.maketext("Entries Per Page")," "),t.R7$(3),t.Y8G("formGroup",e.pageSizeForm),t.R7$(3),t.Y8G("ngForOf",e.pagination.pageSizes)}}function Et(n,s){1&n&&(t.j41(0,"div",34)(1,"button",35),t.nrm(2,"i",36)(3,"span",37),t.k0s(),t.DNE(4,yt,10,3,"ul",38),t.k0s())}function It(n,s){if(1&n&&(t.j41(0,"div",27)(1,"div",28),t.nrm(2,"div",29),t.j41(3,"div",30)(4,"a",31),t.nrm(5,"i",32),t.EFF(6),t.k0s(),t.EFF(7," \xa0 "),t.DNE(8,Et,5,0,"div",33),t.k0s()()()),2&n){const e=t.XpG();t.R7$(4),t.Y8G("routerLink",t.lJ4(3,Rt)),t.R7$(2),t.SpI(" ",e.locale.maketext("Create A New Connection")," "),t.R7$(2),t.Y8G("ngIf",e.items.length>e.pagination.pageSizes[0])}}function jt(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",47)(1,"div",28)(2,"cp-callout",48),t.bIt("close",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.closeDeleteFailure())}),t.j41(3,"p"),t.EFF(4),t.k0s(),t.j41(5,"pre",49),t.EFF(6),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("closeable",!0),t.R7$(2),t.SpI(" ",e.locale.maketext("The server failed to remove the connection to the linked node.")," "),t.R7$(2),t.JRh(e.deletionFailureMessage)}}function At(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.JRh(e.locale.maketext("Loading \u2026"))}}function Mt(n,s){if(1&n&&(t.j41(0,"div",47)(1,"div",28),t.DNE(2,At,2,1,"ng-template",null,2,t.C5r),t.nrm(4,"cp-loading-spinner",50),t.k0s()()),2&n){const e=t.sdS(3);t.R7$(4),t.Y8G("loadingTemplate",e)}}function Dt(n,s){if(1&n&&(t.j41(0,"div",47)(1,"div",28)(2,"cp-callout",51)(3,"pre",49),t.EFF(4),t.k0s()()()()),2&n){const e=t.XpG();t.R7$(4),t.JRh(e.loadFailureMessage)}}function Pt(n,s){if(1&n&&t.nrm(0,"i"),2&n){const e=t.XpG().$implicit,i=t.XpG(2);t.HbH(i.sortDirClass),t.BMQ("title",e.title)}}function Nt(n,s){if(1&n){const e=t.RV6();t.j41(0,"th")(1,"a",55),t.bIt("click",function(){const o=t.eBV(e).$implicit,a=t.XpG(2);return t.Njj(a.changeSort(o.key))}),t.nrm(2,"span",10),t.EFF(3," \xa0 "),t.DNE(4,Pt,1,3,"i",56),t.k0s()()}if(2&n){const e=s.$implicit,i=t.XpG(2);t.R7$(2),t.Y8G("innerHtml",e.label,t.npT),t.R7$(2),t.Y8G("ngIf",e.key===i.sortConfig.key)}}function Ht(n,s){if(1&n&&(t.j41(0,"tr")(1,"td")(2,"cp-callout",57),t.nrm(3,"i",58),t.EFF(4),t.k0s()()()),2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.R7$(),t.BMQ("colspan",i.tableHeaders.length+1),t.R7$(),t.Mz_("id","",e.alias,"_deleteCallout"),t.R7$(),t.BMQ("id",i.spinnerId),t.R7$(),t.SpI(" ",i.locale.maketext("Unlinking \u201c[_1]\u201d\u2026",e.hostname)," ")}}function Yt(n,s){1&n&&t.eu8(0)}function Ot(n,s){if(1&n){const e=t.RV6();t.j41(0,"tr")(1,"td"),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.DNE(6,Yt,1,0,"ng-container",59),t.k0s(),t.j41(7,"td")(8,"div",60)(9,"a",61),t.nrm(10,"i",62),t.EFF(11),t.k0s(),t.j41(12,"button",63),t.bIt("click",function(){t.eBV(e);const o=t.XpG().$implicit,a=t.XpG(3);return t.Njj(a.openDeletionConfirmation(o))}),t.nrm(13,"i",64),t.EFF(14),t.k0s()()()()}if(2&n){const e=t.XpG(),i=e.$implicit,o=e.index,a=t.XpG(3),c=t.sdS(1),k=t.sdS(3);t.R7$(2),t.JRh(i.alias),t.R7$(2),t.JRh(i.hostname),t.R7$(2),t.Y8G("ngTemplateOutlet",i.tlsVerified?c:k),t.R7$(3),t.Mz_("id","getAccountListBtn_",o,""),t.Y8G("routerLink",t.eq3(10,xt,i.alias)),t.R7$(2),t.SpI(" ",a.locale.maketext("Manage")," "),t.R7$(),t.Mz_("id","unlinkServerBtn_",o,""),t.R7$(2),t.SpI(" ",a.locale.maketext("Unlink")," ")}}function Vt(n,s){if(1&n){const e=t.RV6();t.j41(0,"tr")(1,"td")(2,"cp-link-nodes-deletion-callout",65)(3,"form",66)(4,"div")(5,"p")(6,"strong"),t.EFF(7),t.k0s()(),t.j41(8,"p"),t.EFF(9),t.k0s(),t.j41(10,"div",67)(11,"label")(12,"input",68),t.mxI("ngModelChange",function(o){t.eBV(e);const a=t.XpG(4);return t.DH7(a.confirmDeletionCheck,o)||(a.confirmDeletionCheck=o),t.Njj(o)}),t.k0s(),t.EFF(13),t.k0s()(),t.j41(14,"p",69)(15,"strong"),t.EFF(16),t.k0s()(),t.j41(17,"div",70)(18,"label")(19,"input",71),t.mxI("ngModelChange",function(o){t.eBV(e);const a=t.XpG().$implicit;return t.DH7(a.handleApiToken,o)||(a.handleApiToken=o),t.Njj(o)}),t.k0s(),t.EFF(20),t.k0s(),t.nrm(21,"br"),t.j41(22,"label")(23,"input",72),t.mxI("ngModelChange",function(o){t.eBV(e);const a=t.XpG().$implicit;return t.DH7(a.handleApiToken,o)||(a.handleApiToken=o),t.Njj(o)}),t.k0s(),t.EFF(24),t.k0s()()(),t.j41(25,"div",73)(26,"button",74),t.bIt("click",function(){t.eBV(e);const o=t.XpG().$implicit,a=t.XpG(3);return t.Njj(a.terminateLinkage(o))}),t.nrm(27,"i",64),t.EFF(28),t.k0s(),t.EFF(29," \xa0 "),t.j41(30,"button",75),t.bIt("click",function(){t.eBV(e);const o=t.XpG().$implicit;return t.Njj(o.confirmingDelete=!1)}),t.EFF(31),t.k0s()()()()()()}if(2&n){const e=t.XpG().$implicit,i=t.XpG(3);t.R7$(),t.BMQ("colspan",i.tableHeaders.length+1),t.R7$(6),t.JRh(i.locale.maketext("Are you sure you want to remove the connection to the \u201c[_1]\u201d linked node?",e.hostname)),t.R7$(2),t.SpI(" ",i.locale.maketext("This will permanently remove the connection.")," "),t.R7$(3),t.R50("ngModel",i.confirmDeletionCheck),t.R7$(),t.SpI(" ",i.locale.maketext("Select this checkbox to confirm that you want to remove the connection to the linked node.")," "),t.R7$(3),t.JRh(i.locale.maketext("What do you want to do with the API token used for this connection?")),t.R7$(3),t.Y8G("value","expire_24h"),t.R50("ngModel",e.handleApiToken),t.R7$(),t.SpI(" ",i.locale.maketext("Set it to expire in [quant,_1,hour,hours].",24)," "),t.R7$(3),t.Y8G("value",""),t.R50("ngModel",e.handleApiToken),t.R7$(),t.SpI(" ",i.locale.maketext("Leave token active. (Not recommended.)")," "),t.R7$(2),t.Y8G("disabled",!i.confirmDeletionCheck),t.R7$(2),t.SpI(" \xa0 ",i.locale.maketext("Yes, remove this connection")," "),t.R7$(3),t.SpI(" ",i.locale.maketext("Cancel")," ")}}function Xt(n,s){if(1&n&&(t.qex(0),t.DNE(1,Ht,5,5,"tr",54)(2,Ot,15,12,"tr",54)(3,Vt,32,15,"tr",54),t.bVm()),2&n){const e=s.$implicit;t.R7$(),t.Y8G("ngIf",e.deleting),t.R7$(),t.Y8G("ngIf",!e.confirmingDelete&&!e.deleting),t.R7$(),t.Y8G("ngIf",e.confirmingDelete)}}function Bt(n,s){if(1&n&&(t.j41(0,"tbody"),t.DNE(1,Xt,4,3,"ng-container",53),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.Y8G("ngForOf",e.displayItems)}}function Ut(n,s){if(1&n&&(t.j41(0,"tbody")(1,"tr",76)(2,"td"),t.EFF(3),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(2),t.BMQ("colspan",e.tableHeaders.length+1),t.R7$(),t.SpI(" ",e.locale.maketext("No connections exist.")," ")}}function zt(n,s){if(1&n&&(t.j41(0,"tbody")(1,"tr",76)(2,"td"),t.EFF(3),t.k0s()()()),2&n){const e=t.XpG(2);t.R7$(2),t.BMQ("colspan",e.tableHeaders.length+1),t.R7$(),t.SpI(" ",e.locale.maketext("No results match your query.")," ")}}function Jt(n,s){if(1&n&&(t.j41(0,"table",52)(1,"thead")(2,"tr"),t.DNE(3,Nt,5,2,"th",53),t.nrm(4,"th"),t.k0s()(),t.DNE(5,Bt,2,1,"tbody",54)(6,Ut,4,2,"tbody",54)(7,zt,4,2,"tbody",54),t.k0s()),2&n){const e=t.XpG();t.R7$(3),t.Y8G("ngForOf",e.tableHeaders),t.R7$(2),t.Y8G("ngIf",e.filteredItems.length>0),t.R7$(),t.Y8G("ngIf",0===e.items.length),t.R7$(),t.Y8G("ngIf",0!==e.items.length&&0===e.filteredItems.length)}}let Wt=(()=>{class n{constructor(e,i,o,a){this.service=e,this.locale=i,this.router=o,this.alertService=a,this.items=[],this.filteredItems=[],this.loadingData=!0,this.confirmDeletionCheck=!1,this.displayItems=[],this.pagination={pageSizes:[20,50,100],currentPage:1,pageSize:20,showBoundaryLinks:!0,maxSize:5,_start:1,_limit:1,show:!0},this.sortConfig={direction:"asc",key:"alias"}}get htmlDir(){return x?"rtl":"ltr"}get sortDirClass(){return"asc"===this.sortConfig.direction?"icon-arrow-up":"icon-arrow-down"}get showingText(){return this.locale.maketext("[_1] - [_2] of [_3]",this.pagination._start+1,this.pagination._limit,this.filteredItems.length)}ngOnInit(){this.tableHeaders=[{key:"alias",title:this.locale.maketext("Friendly Name"),label:this.locale.maketext("Friendly Name")},{key:"hostname",title:this.locale.maketext("Hostname"),label:this.locale.maketext("Hostname")},{key:"tlsVerified",title:this.locale.maketext("[asis,TLS] Verified"),label:this.locale.maketext("[output,abbr,TLS,Transport Layer Security] Verified")}],this.loadingData=!0,this.confirmDeletionCheck=!1,this.loadFailureMessage=null,this.loadLinkedServerNodes(),this.pageSizeForm=new r.J3({pageSize:new r.hs(this.pagination.pageSizes[0])}),this.pageSizeForm.valueChanges.pipe((0,u.T)(e=>e.pageSize)).subscribe({next:e=>{this.pagination.pageSize=e,this.fetch()}}),this.searchFilterForm=new r.J3({searchFilter:new r.hs("")}),this.searchFilterForm.valueChanges.pipe((0,Ct.s)(()=>(0,bt.O)(500)),(0,u.T)(e=>e.searchFilter)).subscribe({next:e=>{this.searchFilter=e,this.fetch()}})}showDeleteFailure(e){this.deletionFailureMessage=e}closeDeleteFailure(){this.deletionFailureMessage=null}openDeletionConfirmation(e){e.confirmingDelete=!0,e.handleApiToken="expire_24h",this.confirmDeletionCheck=!1}terminateLinkage(e){e.deleting=!0,e.confirmingDelete=!1,this.service.unlinkServerNode(e.alias,e.handleApiToken).subscribe({next:i=>{this.loadLinkedServerNodes(),"expire_24h"===e.handleApiToken&&this.alertService.warn(this.locale.maketext("Token is set to expire in [quant,_1,hour,hours].",24))},error:i=>{e.deleting=!1,this.showDeleteFailure(i.message)}})}pageChanged(e){this.pagination.currentPage=e.page,this._paginate()}changeSort(e){this.sortConfig.key===e&&(this.sortConfig.direction="asc"===this.sortConfig.direction?"desc":"asc"),this.sortConfig.key=e,this.filteredItems=this._sort(this.filteredItems),this.pagination.currentPage=1,this._paginate()}fetch(){this.pagination.currentPage=1;let e=this.items;e=this._filter(e),e=this._sort(e),this.filteredItems=e,this.displayItems=this._paginate()}loadLinkedServerNodes(){this.service.listLinkedServerNodes().subscribe({next:e=>{this.items=e,0===this.items.length?this.router.navigateByUrl("/create"):(this.fetch(),this.loadingData=!1)},error:e=>{this.loadFailureMessage=e.message}})}_paginate(){return this.pagination.show=!(this.pagination.pageSize>=this.filteredItems.length),this.pagination._start=this.pagination.pageSize*(this.pagination.currentPage-1),this.pagination._limit=Math.min(this.filteredItems.length,this.pagination._start+this.pagination.pageSize),this.displayItems=this.filteredItems.slice(this.pagination._start,this.pagination._limit),this.displayItems}_sort(e){return H.orderBy(e,this.sortConfig.key,"asc"===this.sortConfig.direction?"asc":"desc")}_filter(e){if(!this.searchFilter)return e;const i=new RegExp(this.searchFilter,"gi");return H.filter(e,o=>i.test(o.alias)||i.test(o.hostname))}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(w),t.rXU(g.h),t.rXU(p.Ix),t.rXU(l.uE))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-list"]],decls:12,vars:7,consts:[["tlsVerified",""],["tlsNotVerified",""],["loadingDataTemplate",""],[1,"section"],["class","row search-page-container",4,"ngIf"],[1,"row","table-controls-row"],["class","row action-bar",4,"ngIf"],["class","row",4,"ngIf"],["class","table table-striped","id","items_table",4,"ngIf"],["aria-hidden","true",1,"fas","fa-check"],[3,"innerHtml"],["aria-hidden","true",1,"fas","fa-times"],[1,"row","search-page-container"],[1,"col-xs-12","col-sm-12","col-md-4","col-lg-4"],[1,"input-group"],[1,"form-inline",3,"formGroup"],["type","text","id","searchField_input","formControlName","searchFilter",1,"form-control",3,"placeholder","title"],[1,"input-group-btn"],["id","searchField_submit_btn","type","button",1,"btn","btn-default",3,"click"],["class","fas fa-search","aria-hidden","true",4,"ngIf"],["class","fas fa-times","aria-hidden","true",4,"ngIf"],[1,"col-xs-12","col-sm-12","col-md-8","col-lg-8"],["class","pagination-container hidden-xs hidden-sm",4,"ngIf"],["aria-hidden","true",1,"fas","fa-search"],[1,"pagination-container","hidden-xs","hidden-sm"],["firstText","\u2039\u2039","lastText","\u203a\u203a","previousText","\u2039","nextText","\u203a",3,"pageChanged","boundaryLinks","totalItems","maxSize","itemsPerPage"],[1,"text-small"],[1,"row","action-bar"],[1,"col-xs-12"],[1,"pull-left"],[1,"pull-right","flip"],[1,"btn","btn-primary","btn-sm",3,"routerLink"],["aria-hidden","true",1,"fas","fa-plus"],["class","btn-group","dropdown","","auto-close","outsideClick",4,"ngIf"],["dropdown","","auto-close","outsideClick",1,"btn-group"],["id","single-button","type","button","dropdownToggle","","aria-controls","dropdown-basic",1,"btn","btn-default","btn-sm","dropdown-toggle"],[1,"fas","fa-cog"],[1,"caret"],["class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","single-button",4,"dropdownMenu"],["role","menu","aria-labelledby","single-button",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],[1,"text-small","text-uppercase"],["role","group",1,"btn-group","pageSizeButtons"],[1,"form-group"],["btnRadioGroup","","formControlName","pageSize",1,"btn-group"],["class","btn btn-default btn-sm","tabindex","0","role","button",3,"btnRadio",4,"ngFor","ngForOf"],["tabindex","0","role","button",1,"btn","btn-default","btn-sm",3,"btnRadio"],[1,"row"],["id","deletionFailureMessage","calloutType","danger",3,"close","closeable"],[1,"unlink-error-pre"],["id","loadingDataLoader",3,"loadingTemplate"],["id","loadFailureMessage","calloutType","danger"],["id","items_table",1,"table","table-striped"],[4,"ngFor","ngForOf"],[4,"ngIf"],["href","javascript:void(0)",1,"sort-link",3,"click"],[3,"class",4,"ngIf"],["calloutType","danger",3,"id"],[1,"fas","fa-spinner","fa-spin","spinner"],[4,"ngTemplateOutlet"],[1,"pull-right"],[1,"btn","btn-outline-primary","btn-sm","flip",3,"routerLink","id"],["aria-hidden","true",1,"fas","fa-wrench"],[1,"btn","btn-outline-danger","btn-sm","flip",3,"click","id"],["aria-hidden","true",1,"fas","fa-trash"],["id","confirmDeletionCallout"],["id","confirmDeletionForm",1,"form-inline"],[1,"checkbox"],["id","confirmDeletionCheck","name","confirmDeletionCheck","type","checkbox",3,"ngModelChange","ngModel"],[1,"handle-token"],[1,"radio"],["id","expire","name","handleApiToken","type","radio",3,"ngModelChange","value","ngModel"],["id","doNotExpire","name","handleApiToken","type","radio",3,"ngModelChange","value","ngModel"],[1,"form-group","action-group"],["type","submit",1,"btn","btn-primary",3,"click","disabled"],["type","button",1,"btn","btn-sm","btn-link",3,"click"],[1,"info","empty-row"]],template:function(i,o){1&i&&(t.DNE(0,Ft,3,1,"ng-template",null,0,t.C5r)(2,wt,3,1,"ng-template",null,1,t.C5r),t.j41(4,"div",3),t.DNE(5,$t,11,8,"div",4),t.nrm(6,"div",5),t.DNE(7,It,9,4,"div",6)(8,jt,7,3,"div",7)(9,Mt,5,1,"div",7)(10,Dt,5,1,"div",7)(11,Jt,8,4,"table",8),t.k0s()),2&i&&(t.R7$(4),t.BMQ("dir",o.htmlDir),t.R7$(),t.Y8G("ngIf",!o.loadingData),t.R7$(2),t.Y8G("ngIf",!o.loadingData),t.R7$(),t.Y8G("ngIf",o.deletionFailureMessage),t.R7$(),t.Y8G("ngIf",o.loadingData&&!o.loadFailureMessage),t.R7$(),t.Y8G("ngIf",o.loadFailureMessage),t.R7$(),t.Y8G("ngIf",!o.loadingData))},dependencies:[p.Wk,m.Sq,m.bT,m.T3,r.qT,r.me,r.Zm,r.Fm,r.BC,r.cb,r.j4,r.JD,r.vS,r.cV,l.GV,l.NB,f.hs,f.UL,f.Kk,L.p4,L.ew,$],styles:[".unlink-error-pre[_ngcontent-%COMP%]{white-space:pre-wrap;word-wrap:break-word;max-width:95%}.handle-token[_ngcontent-%COMP%]{margin-top:10px}"]})}return n})();var Y=d(9390),_=function(n){return n.up="icon-arrow-up",n.down="icon-arrow-down",n}(_||{}),G=d(1960),O=d(1413);let V=(()=>{class n{constructor(){this.description=new O.B}clear(){this.description.next()}set(e){this.description.next(e)}get(){return this.description}static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275prov=t.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var X=d(980);const B=n=>({disabled:n});function qt(n,s){if(1&n){const e=t.RV6();t.j41(0,"div",28)(1,"div",8)(2,"pre",29),t.EFF(3),t.k0s(),t.j41(4,"button",30),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.dismissLogOutput())}),t.nrm(5,"i",31),t.EFF(6),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(3),t.JRh(e.dedistributeLogText),t.R7$(3),t.SpI(" ",e.locale.maketext("Dismiss")," ")}}function Qt(n,s){1&n&&t.nrm(0,"i",16)}function Zt(n,s){if(1&n){const e=t.RV6();t.j41(0,"cp-link-nodes-deletion-callout",32),t.nrm(1,"div",33),t.j41(2,"cp-action-button",34),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.forceDedistributeAccounts())}),t.DNE(3,Qt,1,0,"i",35),t.EFF(4),t.k0s(),t.j41(5,"button",36),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.toggleConfirmationVisibility())}),t.EFF(6),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.Y8G("innerHTML",e.dedistributeConfirmationWarningText,t.npT),t.R7$(),t.Y8G("buttonState",e.dedistributeBtnState)("buttonClass",e.confirmationBtnClass),t.R7$(),t.Y8G("ngIf",!e.isDedistributing),t.R7$(),t.SpI(" ",e.locale.maketext("Force Dedistribute ([_1])?",e.totalSelectedAccounts)," "),t.R7$(2),t.SpI(" ",e.locale.maketext("Cancel")," ")}}function Kt(n,s){if(1&n){const e=t.RV6();t.j41(0,"ul",37)(1,"li",38)(2,"cp-page-size-selector",39),t.bIt("optionSelected",function(o){t.eBV(e);const a=t.XpG();return t.Njj(a.selectPageSize(o))}),t.k0s()()()}if(2&n){const e=t.XpG();t.R7$(2),t.Y8G("selectedPageSize",e.pageSize)}}function te(n,s){if(1&n){const e=t.RV6();t.j41(0,"a",40),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.isContentSuccessful&&o.sortColumn())}),t.EFF(1),t.nrm(2,"i",41),t.k0s()}if(2&n){const e=t.XpG();t.R7$(),t.SpI(" ",e.locale.maketext("Account Name")," "),t.R7$(),t.Y8G("ngClass",e.caretClass)}}function ee(n,s){if(1&n&&(t.qex(0),t.EFF(1),t.bVm()),2&n){const e=t.XpG();t.R7$(),t.SpI(" ",e.locale.maketext("Account Name")," ")}}function ne(n,s){if(1&n&&(t.j41(0,"tr",42)(1,"td",43),t.nrm(2,"i",44),t.EFF(3),t.k0s()()),2&n){const e=t.XpG();t.R7$(3),t.SpI(" ",e.locale.maketext("Fetching the account list for \u201c[_1]\u201d \u2026",e.alias)," ")}}function ie(n,s){if(1&n&&(t.j41(0,"tr",42)(1,"td",43),t.EFF(2),t.k0s()()),2&n){const e=t.XpG(2);t.R7$(2),t.SpI(" ",e.locale.maketext("No accounts utilize this linkage.")," ")}}function oe(n,s){if(1&n){const e=t.RV6();t.qex(0),t.j41(1,"tr",46)(2,"td",47)(3,"label",48)(4,"input",49),t.mxI("ngModelChange",function(o){const a=t.eBV(e).$implicit;return t.DH7(a.selected,o)||(a.selected=o),t.Njj(o)}),t.bIt("click",function(){const o=t.eBV(e).$implicit,a=t.XpG(2);return t.Njj(a.toggleSelectSingleRow(o))}),t.k0s()()(),t.j41(5,"td",50)(6,"a",51),t.EFF(7),t.k0s()()(),t.bVm()}if(2&n){const e=s.$implicit,i=s.index,o=t.XpG(2);t.R7$(),t.Mz_("id","accountRow_",i,""),t.R7$(2),t.Mz_("for","rowCheckbox_",i,""),t.R7$(),t.Mz_("id","rowCheckbox_",i,""),t.FS9("disabled",o.isConfirmationVisible),t.R50("ngModel",e.selected),t.R7$(2),t.Mz_("id","accountNameLink_",i,""),t.FS9("href",o.getListAcctLink(e),t.B4B),t.FS9("title",o.locale.maketext("Navigate to the Modify an Account interface.")),t.R7$(),t.SpI(" ",e.username," ")}}function se(n,s){if(1&n&&(t.qex(0),t.DNE(1,ie,3,1,"tr",27)(2,oe,8,13,"ng-container",45),t.bVm()),2&n){const e=t.XpG();t.R7$(),t.Y8G("ngIf",!e.accountList.length),t.R7$(),t.Y8G("ngForOf",e.accountList)}}let ae=(()=>{class n{static#t=this.pagination={page:1,recordsPerPage:20,totalPages:0,totalRecords:0,start:1,filter:""};constructor(e,i,o,a,c){this._activatedRoute=e,this._listService=i,this.locale=o,this._alertService=a,this._locationService=c,this.accountList=[],this.caretClass=_.up,this.dedistributeBtnState=l.kj.enabled,this.isConfirmationVisible=!1,this.isContentLoading=!0,this.isContentSuccessful=!1,this.isDedistributing=!1,this.isDedistributingLogVisible=!1,this.isSelectAllSelected=!1,this.isRTL=x}get confirmationBtnClass(){return"btn btn-primary btn-sm"}get dedistributeAccountsText(){return this.locale.maketext("Force Dedistribute Accounts ([_1])[comment,action button text]",this.totalSelectedAccounts)}get dedistributeConfirmationWarningText(){return`${this.locale.maketext("The system will force all of the selected distributed accounts to use only the local server. Performing this action [output,strong,will] result in account data loss.")} ${this.modifyAcctLinkText}`}get isAnyRowSelected(){for(let e=0,i=this.accountList.length;e<i;e++)if(this.accountList[e].selected)return!0;return!1}get modifyAcctLink(){return`${this._path.rootUrl}${F}/scripts/edituser`}get modifyAcctLinkText(){return this.locale.maketext("Use [asis,WHM]\u2019s [output,url,_1,Modify an Account,_2,_3] interface to gracefully dedistribute an account.",this.modifyAcctLink,"target","_blank")}get pageSize(){return n.pagination.recordsPerPage}get totalRecords(){return n.pagination.totalRecords}get totalSelectedAccounts(){return this.accountList.filter(i=>i.selected).length}get selectedRowsUsernames(){const e=[];return this.accountList.forEach(i=>{i.selected&&e.push(i.username)}),e}dismissLogOutput(){this.isDedistributingLogVisible=!1}filterAccounts(e){e.trim(),n.pagination.filter=e,this._fetchAccountList()}forceDedistributeAccounts(){this.dedistributeBtnState=l.kj.loading,this.isDedistributing=!0,this._listService.forceDedistributeAccounts(this.alias,this.selectedRowsUsernames).pipe((0,X.j)(()=>{this.dedistributeBtnState=l.kj.enabled,this.isDedistributing=!1})).subscribe({next:e=>{this.dedistributeLogText=e.formattedLog,this.isDedistributingLogVisible=!0,this.isConfirmationVisible=!1,this._fetchAccountList()},error:e=>{this._alertService.error(e.message)}})}selectPageSize(e){e!==n.pagination.recordsPerPage&&(n.pagination.recordsPerPage=e,this._fetchAccountList())}sortColumn(){this.caretClass=this.caretClass===_.up?_.down:_.up,this.accountList.sort(this.caretClass===_.up?(e,i)=>e.username<i.username?-1:1:(e,i)=>e.username<i.username?1:-1)}toggleConfirmationVisibility(){this.isAnyRowSelected&&(this.isConfirmationVisible=!this.isConfirmationVisible)}toggleSelectAllRows(){this.isSelectAllSelected=!this.isSelectAllSelected,this.accountList.forEach(e=>{e.selected=this.isSelectAllSelected})}toggleSelectSingleRow(e){if(e.selected=!e.selected,e.selected)for(let i=0,o=this.accountList.length;i<o;i++){if(!this.accountList[i].selected){this.isSelectAllSelected=!1;break}this.isSelectAllSelected=!0}else this.isSelectAllSelected=!1}updatePage(e){n.pagination.page!==e&&(n.pagination.page=e,this._fetchAccountList())}getListAcctLink(e){const i=encodeURIComponent(e.username);return`${this._path.rootUrl}${F}/scripts4/listaccts?search=${i}&searchtype=user`}ngOnInit(){this._path=new Y.KL(this._locationService),this._activatedRoute.paramMap.subscribe(e=>{this.alias=e.get("alias"),this._fetchAccountList()})}_fetchAccountList(){this.isContentLoading=!0,this.caretClass=_.up,this._listService.listDistributedAccounts(this.alias,n.pagination).pipe((0,X.j)(()=>{this.isContentLoading=!1,this.isSelectAllSelected=!1})).subscribe({next:e=>{this.accountList=e.data;const i=n.pagination.filter;n.pagination=e.pagination,n.pagination.filter=i,this.isContentSuccessful=!0},error:e=>{this._alertService.error(e.message),this.isContentSuccessful=!1}})}static#e=this.\u0275fac=function(i){return new(i||n)(t.rXU(p.nX),t.rXU(w),t.rXU(g.h),t.rXU(l.uE),t.rXU(G.N))};static#n=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-distributed-accts-list"]],decls:36,vars:19,consts:[[1,"row"],[1,"pull-left","flip","col-xs-12","col-sm-5"],[1,"search-container"],["id","linkedAccountListSearch","name","linkedAccountListSearch",3,"valueChange","disabled"],[1,"pull-right","text-right","flip","col-xs-12","col-sm-7"],["id","accountListPagination",3,"pageChanged","totalItems","pageSize","disabled"],["class","row logRow",4,"ngIf"],[1,"row","confirm-dedistribute-callout-row"],[1,"col-xs-12"],["id","deleteConfirmationCallout",4,"ngIf"],[1,"row","action-bar"],[1,"pull-left","flip"],[1,"table-action-button-container"],["for","selectAllAccountsCheckbox",1,"table-action-button-label","table-action-button-sm"],["type","checkbox","id","selectAllAccountsCheckbox",3,"ngModelChange","click","ngModel","disabled"],["type","button","id","forceDedistributeBtn",1,"btn","btn-sm","btn-danger",3,"click","ngClass"],["aria-hidden","true",1,"fas","fa-unlink"],[1,"pull-right","flip","hidden-xs"],["dropdown","",1,"btn-group","pull-right","flip"],["id","pageSizeDropdownBtn","dropdownToggle","","type","button","aria-controls","dropdown-basic",1,"btn","btn-sm","btn-default","dropdown-toggle",3,"ngClass"],[1,"fas","fa-cog"],[1,"caret"],["id","pageSizeDropdownList","class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","button-basic",4,"dropdownMenu"],["id","listAccountsTable",1,"table","table-striped","table-details"],["scope","col"],["href","javascript:void(0)",3,"click",4,"ngIf"],[4,"ngIf"],["class","info empty-row",4,"ngIf"],[1,"row","logRow"],["id","dedistributeOutputLog",1,"log"],["type","button",1,"btn","btn-link","btn-sm","pull-right","flip",3,"click"],["aria-hidden","true",1,"fas","fa-times"],["id","deleteConfirmationCallout"],[3,"innerHTML"],["id","confirmDedistributeBtn",3,"click","buttonState","buttonClass"],["class","fas fa-unlink","aria-hidden","true",4,"ngIf"],["type","button","id","cancelDedistributeConfirmationBtn",1,"btn","btn-sm","btn-link",3,"click"],["id","pageSizeDropdownList","role","menu","aria-labelledby","button-basic",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],["id","listAccountsPageSizeSelection",3,"optionSelected","selectedPageSize"],["href","javascript:void(0)",3,"click"],[3,"ngClass"],[1,"info","empty-row"],["colspan","2"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin"],[4,"ngFor","ngForOf"],[1,"data-row",3,"id"],[1,"check-column"],[1,"tableRowCheckboxLabel",3,"for"],["type","checkbox",3,"ngModelChange","click","id","disabled","ngModel"],[1,"name-column"],["target","_blank",3,"id","href","title"]],template:function(i,o){1&i&&(t.j41(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"cp-search",3),t.bIt("valueChange",function(c){return o.filterAccounts(c)}),t.k0s()()(),t.j41(5,"div",4)(6,"cp-pagination",5),t.bIt("pageChanged",function(c){return o.updatePage(c.page)}),t.k0s()()(),t.DNE(7,qt,7,2,"div",6),t.j41(8,"div",7)(9,"div",8),t.DNE(10,Zt,7,6,"cp-link-nodes-deletion-callout",9),t.k0s()(),t.j41(11,"div",10)(12,"div",8)(13,"div",11)(14,"div",12)(15,"label",13)(16,"input",14),t.mxI("ngModelChange",function(c){return t.DH7(o.isSelectAllSelected,c)||(o.isSelectAllSelected=c),c}),t.bIt("click",function(){return o.toggleSelectAllRows()}),t.k0s()()(),t.j41(17,"button",15),t.bIt("click",function(){return o.toggleConfirmationVisibility()}),t.nrm(18,"i",16),t.EFF(19),t.k0s()(),t.j41(20,"div",17)(21,"div",18)(22,"button",19),t.nrm(23,"i",20)(24,"span",21),t.k0s(),t.DNE(25,Kt,3,1,"ul",22),t.k0s()()()(),t.j41(26,"table",23)(27,"thead")(28,"tr"),t.nrm(29,"th",24),t.j41(30,"th",24),t.DNE(31,te,3,2,"a",25)(32,ee,2,1,"ng-container",26),t.k0s()()(),t.j41(33,"tbody"),t.DNE(34,ne,4,1,"tr",27)(35,se,3,2,"ng-container",26),t.k0s()()()),2&i&&(t.R7$(4),t.Y8G("disabled",o.isConfirmationVisible),t.R7$(2),t.Y8G("totalItems",o.totalRecords)("pageSize",o.pageSize)("disabled",o.isConfirmationVisible),t.R7$(),t.Y8G("ngIf",o.isDedistributingLogVisible),t.R7$(3),t.Y8G("ngIf",o.isConfirmationVisible),t.R7$(6),t.FS9("disabled",o.isConfirmationVisible),t.R50("ngModel",o.isSelectAllSelected),t.R7$(),t.Y8G("ngClass",t.eq3(15,B,!o.isAnyRowSelected||o.isConfirmationVisible)),t.R7$(2),t.SpI(" ",o.dedistributeAccountsText," "),t.R7$(3),t.Y8G("ngClass",t.eq3(17,B,o.isConfirmationVisible)),t.R7$(9),t.Y8G("ngIf",!o.isConfirmationVisible),t.R7$(),t.Y8G("ngIf",o.isConfirmationVisible),t.R7$(2),t.Y8G("ngIf",o.isContentLoading),t.R7$(),t.Y8G("ngIf",o.isContentSuccessful&&!o.isContentLoading))},dependencies:[m.YU,m.Sq,m.bT,r.Zm,r.BC,r.vS,l.eK,l.br,f.hs,f.UL,f.Kk,l.Sy,l.C7,$],styles:["table[_ngcontent-%COMP%]{margin-top:15px}.return-link[_ngcontent-%COMP%]{padding-top:2em;padding-bottom:2em;text-align:center}.check-column[_ngcontent-%COMP%]{max-width:5%}#pageSizeDropdownList[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0 5px}.search-container[_ngcontent-%COMP%]{margin-top:20px}.description[_ngcontent-%COMP%]{margin-bottom:10px}.tableRowCheckboxLabel[_ngcontent-%COMP%]{margin-bottom:0}.log[_ngcontent-%COMP%]{height:500px}.logRow[_ngcontent-%COMP%]{margin-bottom:10px}.logRow[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:0}.confirm-dedistribute-callout-row[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return n})();function re(n,s){if(1&n&&(t.j41(0,"span"),t.EFF(1),t.k0s()),2&n){const e=t.XpG(2);t.R7$(),t.JRh(e.locale.maketext("Loading \u2026"))}}function le(n,s){if(1&n&&(t.j41(0,"div"),t.DNE(1,re,2,1,"ng-template",null,0,t.C5r),t.nrm(3,"cp-loading-spinner",4),t.k0s()),2&n){const e=t.sdS(2);t.R7$(3),t.Y8G("loadingTemplate",e)}}function ce(n,s){1&n&&(t.j41(0,"div",8),t.nrm(1,"input",9),t.j41(2,"span",10),t.EFF(3,":2087"),t.k0s()())}function de(n,s){if(1&n&&(t.j41(0,"cp-link-nodes-form-group",5)(1,"div",6),t.EFF(2),t.k0s(),t.DNE(3,ce,4,0,"div",7),t.k0s()),2&n){const e=t.XpG();t.Y8G("showAllHelp",e.showAllHelp)("control",e.hostname)("label",e.locale.maketext("Hostname")),t.R7$(2),t.SpI(" ",e.locale.maketext("Enter the hostname of the child node for this connection.")," "),t.R7$(),t.Y8G("ngIf",e.showFormElements)}}function me(n,s){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"button",11),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.beginConfirmUpdateHostname())}),t.nrm(2,"i",12),t.EFF(3),t.k0s()()}if(2&n){const e=t.XpG();t.R7$(),t.FS9("title",e.locale.maketext("Click here to update the hostname.")),t.R7$(2),t.SpI(" ",e.locale.maketext("Update Hostname")," ")}}function pe(n,s){1&n&&t.nrm(0,"i",12)}function ue(n,s){if(1&n){const e=t.RV6();t.j41(0,"div")(1,"cp-link-nodes-deletion-callout",13)(2,"div")(3,"p")(4,"strong"),t.EFF(5),t.k0s()(),t.nrm(6,"p",14),t.j41(7,"div",15)(8,"label"),t.nrm(9,"input",16),t.EFF(10),t.k0s()()(),t.j41(11,"div",17)(12,"cp-action-button",18),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.updateHostname())}),t.DNE(13,pe,1,0,"i",19),t.EFF(14),t.k0s(),t.j41(15,"button",20),t.bIt("click",function(){t.eBV(e);const o=t.XpG();return t.Njj(o.endConfirmUpdateHostname())}),t.EFF(16),t.k0s()()()()}if(2&n){const e=t.XpG();t.R7$(5),t.JRh(e.locale.maketext("Are you sure that you want to update the hostname for the child node \u201c[_1]\u201d from \u201c[_2]\u201d to \u201c[_3]\u201d?",e.currentNode.alias,e.currentNode.hostname,e.hostname.value)),t.R7$(),t.Y8G("innerHtml",e.locale.maketext("Ideally, the hostname on the linkage [output,strong,should] match the hostname of the child node. For more information, read our [output,url,_1,documentation,target,_blank].","https://go.cpanel.net/whmlinkednodes"),t.npT),t.R7$(4),t.SpI(" ",e.locale.maketext("Select this checkbox to confirm that you want to rename the hostname of the child node.")," "),t.R7$(2),t.Y8G("buttonState",e.confirmRenameHostnameBtnState),t.R7$(),t.Y8G("ngIf",!e.hostnameIsUpdating),t.R7$(),t.SpI(" ",e.locale.maketext("Update Hostname")," "),t.R7$(2),t.SpI(" ",e.locale.maketext("Cancel")," ")}}let he=(()=>{class n{constructor(e,i,o,a){this._activatedRoute=e,this._alertService=i,this._mainService=o,this.locale=a,this.showFormElements=!1,this.showConfirmHostnameChangePanel=!1,this._serverNodes=new O.B,this.showLoadingMessage=!0,this.confirmDeletionCheck=!1,this.confirmRenameHostnameBtnState=l.kj.enabled,this._activatedRoute.paramMap.subscribe(c=>{this.alias=c.get("alias")})}get hostname(){return this.hostnameForm.get("hostname")}get confirmRenameHostname(){return this.hostnameForm.get("confirmRenameHostname")}get confirmRenameHostnameHeader(){return this.locale.maketext("Are you sure?")}ngOnInit(){this.hostnameForm=new r.J3({hostname:new r.hs(""),confirmRenameHostname:new r.hs(!1,[])}),this.hostnameForm.valueChanges.subscribe(e=>{this.hostnameIsUpdating||(this.confirmRenameHostnameBtnState=e.confirmRenameHostname?l.kj.enabled:l.kj.disabled)}),this._serverNodes.subscribe(e=>{this.currentNode=e.find(o=>o.alias===this.alias),this._resetForm();const i=e.filter(o=>o.alias!==this.currentNode.alias);this.hostname.setValidators([S(this.locale.maketext("You [output,strong,must] enter a hostname.")),M(i,this.locale.maketext("The hostname must be unique. A connection with this hostname already exists.")),T.md.fqdn()])}),this._updateLinkedServerNodes()}beginConfirmUpdateHostname(){if(this.hostnameForm.invalid)return!1;this.showFormElements=!1,this.showConfirmHostnameChangePanel=!0}endConfirmUpdateHostname(){this.showFormElements=!0,this.showConfirmHostnameChangePanel=!1}updateHostname(){if(this.hostnameForm.updateValueAndValidity(),this.confirmRenameHostnameBtnState=l.kj.loading,this.hostnameIsUpdating=!0,this.confirmRenameHostname.disable(),this.hostnameForm.valid){const e=new A(this.currentNode?.alias,this.hostname?.value,this.currentNode?.username,this.currentNode?.enabledServices,this.currentNode?.lastCheck,this.currentNode?.version,this.currentNode?.workerCapabilities,this.currentNode?.tlsVerified);this._mainService.updateServerNode(this.currentNode,e).subscribe({next:i=>{this._alertService.success(this.locale.maketext("The system successfully updated the hostname for \u201c[_1]\u201d to \u201c[_2]\u201d.",this.alias,this.hostname.value)),this._updateHostnameCompleted(),this._updateLinkedServerNodes()},error:i=>{this._alertService.error(i.message),this._updateHostnameCompleted(),this._resetForm()}})}}_updateHostnameCompleted(){this.endConfirmUpdateHostname(),this.confirmRenameHostnameBtnState=l.kj.enabled,this.hostnameIsUpdating=!1,this.confirmRenameHostname.enable()}_updateLinkedServerNodes(){this.showFormElements=!1,this.showLoadingMessage=!0,this._mainService.listLinkedServerNodes().subscribe(e=>{this._serverNodes.next(e),this.showFormElements=!0,this.showLoadingMessage=!1})}_resetForm(){this.hostnameForm.reset({hostname:this.currentNode?this.currentNode.hostname:"",confirmRenameHostname:!1})}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(p.nX),t.rXU(l.uE),t.rXU(w),t.rXU(g.h))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-update-hostname-form"]],decls:6,vars:5,consts:[["loadingHostnameData",""],["id","hostnameForm","name","hostnameForm",3,"formGroup"],[4,"ngIf"],["for","hostname",3,"showAllHelp","control","label",4,"ngIf"],["id","loadingHostnameDataPanel",3,"loadingTemplate"],["for","hostname",3,"showAllHelp","control","label"],["form-group-label",""],["class","input-group","form-group-control","",4,"ngIf"],["form-group-control","",1,"input-group"],["type","text","id","hostname","name","hostname","placeholder","host.example.com","formControlName","hostname",1,"form-control"],[1,"input-group-addon"],["id","btnUpdateHostname","type","submit",1,"btn","btn-outline-primary",3,"click","title"],["aria-hidden","true",1,"fas","fa-save"],["id","confirmHostnameChangeCallout"],[3,"innerHtml"],[1,"checkbox"],["id","confirmRenameHostname","name","confirmRenameHostname","type","checkbox","formControlName","confirmRenameHostname"],[1,"form-group","action-group"],["id","btnUpdateHostnameConfirm","type","submit","buttonClass","btn btn-sm btn-primary",3,"click","buttonState"],["class","fas fa-save","aria-hidden","true",4,"ngIf"],["id","btnCancelUpdateHostname","type","button",1,"btn","btn-link",3,"click"]],template:function(i,o){1&i&&(t.j41(0,"form",1),t.DNE(1,le,4,1,"div",2)(2,de,4,5,"cp-link-nodes-form-group",3),t.j41(3,"div"),t.DNE(4,me,4,2,"div",2)(5,ue,17,7,"div",2),t.k0s()()),2&i&&(t.Y8G("formGroup",o.hostnameForm),t.R7$(),t.Y8G("ngIf",o.showLoadingMessage),t.R7$(),t.Y8G("ngIf",o.showFormElements),t.R7$(2),t.Y8G("ngIf",o.showFormElements),t.R7$(),t.Y8G("ngIf",o.showConfirmHostnameChangePanel))},dependencies:[m.bT,r.qT,r.me,r.Zm,r.BC,r.cb,r.j4,r.JD,l.NB,l.C7,D,$],styles:[".panel-danger[_ngcontent-%COMP%] > .panel-heading[_ngcontent-%COMP%]{color:#e74c3c}"]})}return n})();const _e=(n,s)=>({"text-right":n,"text-left":s}),ge=()=>["/list"],fe=(n,s)=>({"fa-arrow-left":n,"fa-arrow-right":s}),ke=[{path:"create",component:kt,data:{showResourcePanel:!0}},{path:"list",component:Wt,data:{showResourcePanel:!1}},{path:"manage/:alias",component:(()=>{class n{constructor(e,i,o,a){this._activatedRoute=e,this.locale=i,this._locationService=o,this._pageDescriptionService=a,this.caretClass=_.up,this.isRTL=x,this._path=new Y.KL(this._locationService),this._activatedRoute.paramMap.subscribe(c=>{this.alias=c.get("alias"),this._pageDescriptionService.set(this.locale.maketext("Use this interface to manage the \u201c[_1]\u201d child node.",this.alias)),this.distributedAcctsPanelTitle=this.locale.maketext("Manage Distributed Accounts for \u201c[_1]\u201d",this.alias),this.hostnamePanelTitle=this.locale.maketext("Manage Hostname for \u201c[_1]\u201d",this.alias)})}get distributedAcctsDescription(){return`${this.locale.maketext("[output,strong,Warning:] This action will result in account data loss. [output,strong,Only] use this procedure in an emergency situation.")} ${this.modifyAcctLinkText}`}get modifyAcctLink(){return`${this._path.rootUrl}${F}/scripts/edituser`}get modifyAcctLinkText(){return this.locale.maketext("Use [asis,WHM]\u2019s [output,url,_1,Modify an Account,_2,_3] interface to gracefully dedistribute an account.",this.modifyAcctLink,"target","_blank")}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(p.nX),t.rXU(g.h),t.rXU(G.N),t.rXU(V))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-manage"]],decls:28,vars:15,consts:[["id","listAccountsPerLinkageAlertList"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip"],[1,"clearfix"],[1,"panel-body"],[1,"row"],[1,"col-md-12"],[3,"innerHTML"],[1,"panel-footer"],[3,"ngClass"],["id","btnCancelModifyAcct","type","button","id","returnToLinkListBtn",1,"btn","btn-link",3,"routerLink","title"],["aria-hidden","true",1,"fas",3,"ngClass"],[1,"panel","panel-danger"]],template:function(i,o){1&i&&(t.nrm(0,"cp-alert-list",0),t.j41(1,"div",1)(2,"div",2)(3,"div",3),t.EFF(4),t.k0s(),t.nrm(5,"div",4),t.k0s(),t.j41(6,"div",5)(7,"div",6)(8,"div",7),t.nrm(9,"p",8),t.k0s()(),t.j41(10,"div",6)(11,"div",7),t.nrm(12,"cp-link-nodes-distributed-accts-list"),t.k0s()()(),t.j41(13,"div",9)(14,"div",10)(15,"button",11),t.nrm(16,"i",12),t.EFF(17),t.k0s()()()(),t.j41(18,"div",13)(19,"div",2)(20,"div",3),t.EFF(21),t.k0s(),t.nrm(22,"div",4),t.k0s(),t.j41(23,"div",5)(24,"div",6)(25,"div",7)(26,"section"),t.nrm(27,"cp-link-nodes-update-hostname-form"),t.k0s()()()()()),2&i&&(t.R7$(4),t.SpI(" ",o.distributedAcctsPanelTitle," "),t.R7$(5),t.Y8G("innerHTML",o.distributedAcctsDescription,t.npT),t.R7$(5),t.Y8G("ngClass",t.l_i(8,_e,!o.isRTL,o.isRTL)),t.R7$(),t.FS9("title",o.locale.maketext("Go back to the list of linked nodes.")),t.Y8G("routerLink",t.lJ4(11,ge)),t.R7$(),t.Y8G("ngClass",t.l_i(12,fe,!o.isRTL,o.isRTL)),t.R7$(),t.SpI(" ",o.locale.maketext("Go Back")," "),t.R7$(4),t.JRh(o.hostnamePanelTitle))},dependencies:[p.Wk,m.YU,l.Ab,ae,he],encapsulation:2})}return n})(),data:{showResourcePanel:!0}},{path:"**",redirectTo:"list",pathMatch:"full"}];let be=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n});static#n=this.\u0275inj=t.G2t({providers:[G.N],imports:[p.iI.forRoot(ke),m.MD,l.rY,l.H7,r.X1,r.YN,l.jM,l.ys,l.x6,l.Qg,f.zE.forRoot(),L.Cp.forRoot(),l.sb,l.tq,l.pt,p.iI]})}return n})();function Ce(n,s){if(1&n&&(t.j41(0,"div",3)(1,"div",4),t.nrm(2,"p",9),t.k0s()()),2&n){const e=t.XpG();t.R7$(2),t.Y8G("innerHTML",e.description,t.npT)}}function ve(n,s){1&n&&t.eu8(0)}function Re(n,s){if(1&n&&(t.j41(0,"div",6)(1,"div",10),t.DNE(2,ve,1,0,"ng-container",11),t.k0s()()),2&n){const e=t.XpG(),i=t.sdS(11);t.Y8G("ngClass",e.sidePanelClasses),t.R7$(2),t.Y8G("ngTemplateOutlet",i)}}function xe(n,s){1&n&&t.eu8(0)}function Fe(n,s){if(1&n&&(t.j41(0,"div",12)(1,"div",10),t.DNE(2,xe,1,0,"ng-container",11),t.k0s()()),2&n){t.XpG();const e=t.sdS(11);t.R7$(2),t.Y8G("ngTemplateOutlet",e)}}function we(n,s){if(1&n&&(t.j41(0,"section",13)(1,"h3",14),t.EFF(2),t.k0s(),t.j41(3,"ul")(4,"li")(5,"a",15),t.nrm(6,"i",16),t.EFF(7),t.k0s()(),t.j41(8,"li")(9,"a",17),t.nrm(10,"i",18),t.EFF(11),t.k0s()()()(),t.j41(12,"section",13)(13,"h3",14),t.EFF(14),t.k0s(),t.j41(15,"ul")(16,"li")(17,"a",19),t.nrm(18,"i",20),t.EFF(19),t.k0s()()()()),2&n){const e=t.XpG();t.R7$(2),t.JRh(e.locale.maketext("I want to \u2026")),t.R7$(3),t.FS9("title",e.locale.maketext("Create a New [asis,cPanel] Account")),t.R7$(2),t.SpI(" ",e.locale.maketext("Create a new [asis,cPanel] Account")," "),t.R7$(2),t.FS9("title",e.locale.maketext("Distribute an Existing [asis,cPanel] Account")),t.R7$(2),t.SpI(" ",e.locale.maketext("Distribute an Existing [asis,cPanel] Account")," "),t.R7$(3),t.JRh(e.locale.maketext("Need Help?")),t.R7$(3),t.FS9("title",e.locale.maketext("Need help? Click here to read more about this interface.")),t.R7$(2),t.SpI(" ",e.locale.maketext("About This Interface")," ")}}let Se=(()=>{class n{constructor(e,i,o,a){this.router=e,this.route=i,this.locale=o,this.pageDescriptionService=a,T.uv.locale=this.locale,e.events.subscribe(c=>{c instanceof p.Z&&this.pageDescriptionService.clear(),c instanceof p.wF&&(this.showResourcePanel=i.root.firstChild.snapshot.data.showResourcePanel,this._updatePanelClasses())})}get description(){return this._description}ngOnInit(){this.showResourcePanel=!1,this._updatePanelClasses(),this.pageDescriptionService.get().subscribe(e=>{this._description=e})}_updatePanelClasses(){this.sidePanelClasses="col-md-4 hidden-xs hidden-sm",this.sidePanelClasses+=" ",this.sidePanelClasses+="pull-right",this.mainPanelClasses=this.showResourcePanel?"col-xs-12 col-sm-12 col-md-8 pull-left":"col-xs-12"}static#t=this.\u0275fac=function(i){return new(i||n)(t.rXU(p.Ix),t.rXU(p.nX),t.rXU(g.h),t.rXU(V))};static#e=this.\u0275cmp=t.VBU({type:n,selectors:[["cp-link-nodes-root"]],decls:12,vars:4,consts:[["resourceTemplate",""],["id","content"],["class","row",4,"ngIf"],[1,"row"],[1,"col-xs-12","col-lg-8"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],["id","viewContent",1,"ng-cloak","section","animate-view"],["class","col-xs-12 hidden-lg hidden-md",4,"ngIf"],[1,"description",3,"innerHTML"],[1,"section"],[4,"ngTemplateOutlet"],[1,"col-xs-12","hidden-lg","hidden-md"],[1,"widget"],[1,"widget-title"],["id","lnkCreateNewAccount","href","../../scripts5/wwwacctform",3,"title"],["aria-hidden","true",1,"fas","fa-plus"],["id","lnkModifyExistingAcct","href","../../scripts/edituser",3,"title"],["aria-hidden","true",1,"fas","fa-wrench"],["href","https://go.cpanel.net/whmlinkednodes","id","linkAboutTheInterface","target","whm_documentation",3,"title"],["aria-hidden","true",1,"fas","fa-fw","fa-external-link-alt"]],template:function(i,o){1&i&&(t.j41(0,"div",1)(1,"div"),t.DNE(2,Ce,3,1,"div",2),t.nrm(3,"cp-alert-list"),t.j41(4,"div",3)(5,"div",4),t.DNE(6,Re,3,2,"div",5),t.j41(7,"div",6),t.nrm(8,"router-outlet",7),t.k0s(),t.DNE(9,Fe,3,1,"div",8),t.k0s()()()(),t.DNE(10,we,20,8,"ng-template",null,0,t.C5r)),2&i&&(t.R7$(2),t.Y8G("ngIf",o.description),t.R7$(4),t.Y8G("ngIf",o.showResourcePanel),t.R7$(),t.Y8G("ngClass",o.mainPanelClasses),t.R7$(2),t.Y8G("ngIf",o.showResourcePanel))},dependencies:[m.YU,m.bT,m.T3,p.n3,l.Ab],encapsulation:2})}return n})(),Te=(()=>{class n{static#t=this.\u0275fac=function(i){return new(i||n)};static#e=this.\u0275mod=t.$C({type:n,bootstrap:[Se]});static#n=this.\u0275inj=t.G2t({providers:[l.uE,{provide:m.kB,useValue:z}],imports:[R.Bb,be,U.B,m.MD,l.jM,I.fg,l.sb]})}return n})();(0,t.SmG)(),R.sG().bootstrapModule(Te).catch(n=>console.error(n))}},C=>{C.O(0,[128,996,538],()=>C(C.s=4549)),C.O()}]);