Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/multiphp-manager-ng7/main.js
"use strict";(self.webpackChunkmultiphp_manager_ng7=self.webpackChunkmultiphp_manager_ng7||[]).push([[179],{9086:(L,et,g)=>{var V=g(1481),t=g(5062),_t=g(8746),j=g(9241),S=g(6304),h=g(6895),b=g(269),Q=g(591);class nt{constructor(s=0,e=[],n=!1){this.status=s,this.packages=e,this.hasFPMInstalled=n}}var c=g(5397),C=g(7709),Z=g(5419);let z=(()=>{class i{constructor(e){this.apiClient=e}getSystemDefault(){const e=new c.r(c.N.JsonApi,{method:"php_get_system_default_version"});return this.apiClient.get(e)}setSystemDefault(e){const n=new c.r(c.N.JsonApi,{method:"php_set_system_default_version",arguments:[new C.h("version",e)]});return this.apiClient.post(n)}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var a=g(352);let F=(()=>{class i{constructor(e,n){this.alertService=e,this.router=n}error(e){e.errors.forEach(n=>{this.alertService.error(n.message)})}routeTo(e){this.router.navigate([e])}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(a.c9),t.LFG(S.F0))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var M=g(7340),ft=g(6053),it=g(2198),ot=g(2986);let y=(()=>{class i{get nativeWindow(){return window}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();class E{constructor(s="",e){this.version=s,this.phpVersionRegex=/^\D+-php(\d{2,3})$/i,this._windowRef=e||new y}get isOutdated(){const s=this._windowRef.nativeWindow;if(s.PAGE&&s.PAGE.suppress_php_eol_status||this.version.startsWith("alt-"))return!1;const e=this.version.match(/php(\d+)/i);return!(!e||!e[1])&&parseInt(e[1],10)<parseInt(String(s.PAGE.oldest_supported_php_version).replace(".",""),10)}get formattedVersion(){return this.transformPHPFormat(this.version)}friendlyPHPFormat(s){let e=s||"";return e=`PHP ${s}`,e}transformPHPFormat(s){const e=this._windowRef.nativeWindow;let n=s||"";const o=s.match(this.phpVersionRegex);if(o){const r=o[1].replace(/(\d)$/,".$1");n=this.friendlyPHPFormat(r),n=`${n} ( ${s} )`}if(s.startsWith("alt-"))e.PAGE&&e.PAGE.suppress_php_eol_status||(n+=e.LOCALE&&e.LOCALE.maketext?" ["+e.LOCALE.maketext("Secured")+"]":" [Secured]");else if(!e.PAGE||!e.PAGE.suppress_php_eol_status){let r=s.match(/php(\d+)/);r&&r[1]&&parseInt(r[1])<parseInt(String(e.PAGE.oldest_supported_php_version).replace(".",""))&&(e.LOCALE&&e.LOCALE.maketext?n=n+" ["+e.LOCALE.maketext("Outdated")+"]":n+=" [Outdated]")}return n}}var u=g(7489),k=g(4850);let W=(()=>{class i{constructor(){}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})(),v=(()=>{class i{constructor(e,n,o,r){this.appDataService=e,this.phpHelper=n,this.apiClient=o,this.windowRef=r,this.fetchPhpListSubject=new Q.X({done:!1,result:null}),this._fetchFpmPackagesSubject=new Q.X({done:!1,result:null}),this.fpmPackagesReady$=this._fetchFpmPackagesSubject.asObservable()}reloadInstalledPhpVersions(){this.appDataService.installedPhpVersions=null,this.fetchInstalledPhpVersionList()}fetchInstalledPhpVersionList(){null!=this.appDataService.installedPhpVersions?this.fetchPhpListSubject.next({done:!0,result:this.appDataService.installedPhpVersions}):this.getPHPversions().subscribe(e=>{e.success?this.appDataService.installedPhpVersions=this.processPhpVersionInfo(e):(this.appDataService.installedPhpVersions=null,e.hasErrors&&this.phpHelper.error(e)),this.fetchPhpListSubject.next({done:!0,result:this.appDataService.installedPhpVersions})})}processPhpVersionInfo(e){return e.data.map(n=>new E(n,this.windowRef))}getPHPversions(){const e=new c.r(c.N.JsonApi,{method:"php_get_installed_versions"});return this.apiClient.get(e)}getEA4Recommendations(){const e=new c.r(c.N.JsonApi,{method:"ea4_recommendations"});return this.apiClient.get(e).pipe((0,k.U)(n=>{if(null!==n.data)return n.data=(0,u.filter)((0,u.keys)(n.data),o=>/^ea-php\d{2}$/.test(o)),n}))}getPhpVersionDataByPackage(e){return(0,u.find)(this.appDataService.installedPhpVersions,["version",e])}reloadFpmPackages(){this.appDataService.installedPhpFpmPackages=null,this.fetchInstalledPhpFpmPackages()}fetchInstalledPhpFpmPackages(){null!=this.appDataService.installedPhpFpmPackages?this._fetchFpmPackagesSubject.next({done:!0,result:this.appDataService.installedPhpFpmPackages}):this._fetchEA4Packages().subscribe(e=>{e.hasErrors?(this.appDataService.installedPhpFpmPackages=null,this._fetchFpmPackagesSubject.next({done:!0,result:null}),e.hasErrors&&this.phpHelper.error(e)):(this.appDataService.installedPhpFpmPackages=this.filterFpmPackages(e.data),this._fetchFpmPackagesSubject.next({done:!0,result:this.appDataService.installedPhpFpmPackages}))})}filterFpmPackages(e){return(0,u.filter)(e,n=>/-(?:php-)?fpm$/.test(n))}isPhpFpmInstalled(e){const n=this.appDataService.installedPhpFpmPackages;if(!n)return!1;if(n.includes(e))return!0;const o=e.replace(/-php-fpm$/,"-fpm");return o!==e&&n.includes(o)}_fetchEA4Packages(){const e=new c.r(c.N.JsonApi,{method:"package_manager_list_packages",arguments:[new C.h("state","installed")]});return this.apiClient.get(e).pipe((0,k.U)(n=>(n.data&&(n.data=n.data.map(o=>o.package)),n)))}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(W),t.LFG(F),t.LFG(Z.A4),t.LFG(y))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var Ct=g(5529);let st=(()=>{class i{constructor(e,n,o){this.zone=e,this._window=n,this.phpVersionService=o,this.initialized=!1,this.sseTask=new Ct.xQ,this.sseTask$=this.sseTask.asObservable()}init(){if(this.initialized)return;const e=this._window.nativeWindow.PAGE.cp_security_token;e&&(this.es=new EventSource(e+"/sse/PHPELS"),this.initialized=!0,this.es.addEventListener("php-els-install-status",o=>{let r=JSON.parse(o.data).status,l=JSON.parse(o.data).message;this.zone.run(()=>{this.sseTask.next({status:r,message:l}),"nothing-to-do"===r||"failed"===r?this.close():"completed"===r&&(this.phpVersionService.reloadInstalledPhpVersions(),this.phpVersionService.reloadFpmPackages(),this.close())})}))}close(){this.es?.close(),this.es=void 0,this.initialized=!1}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(t.R0b),t.LFG(y),t.LFG(v))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var H=(()=>{return(i=H||(H={})).button="button",i.dropdown="dropdown",H;var i})(),w=g(3044);function bt(i,s){1&i&&t._UZ(0,"i",9)}function xt(i,s){if(1&i){const e=t.EpF();t.ynx(0),t.TgZ(1,"li",6)(2,"a",7),t.NdJ("click",function(){const r=t.CHM(e).$implicit;return t.oxw(2).selectPhpVersion(r)}),t.YNc(3,bt,1,0,"i",8),t._uU(4),t.qZA()(),t.BQk()}if(2&i){const e=s.$implicit,n=t.oxw(2);t.xp6(1),t.hYB("id","",n.id,"-",e.version,"-drop-menu-item"),t.xp6(2),t.Q6J("ngIf",n.checkSelectedVersion(e)),t.xp6(1),t.Oqu(e.formattedVersion)}}function Mt(i,s){if(1&i&&(t.TgZ(0,"ul",4),t.YNc(1,xt,5,4,"ng-container",5),t.qZA()),2&i){const e=t.oxw();t.MGl("id","",e.id,"-drop-menu"),t.Q2q("aria-labelledby","",e.id,"-drop-button"),t.xp6(1),t.Q6J("ngForOf",e.phpVersionList)}}let U=(()=>{class i{constructor(e,n,o){this.locale=e,this.phpVersionService=n,this.appDataService=o,this.mode=H.button,this.buttonText="",this.disabled=!1,this.phpVersionChanged=new t.vpe,this.phpVersionList=[]}get dropdownText(){return this.mode===H.button?this.buttonText:this.selectedPhpVersion?this.selectedPhpVersion.formattedVersion:""}get showOutdatedPill(){return!(this.mode===H.button||!this.selectedPhpVersion)&&this.selectedPhpVersion.isOutdated}selectPhpVersion(e){this.phpVersionChanged.emit(e)}ngOnInit(){this.phpVersionService.fetchPhpListSubject?this.phpVersionService.fetchPhpListSubject.subscribe(e=>{e.done&&(this.phpVersionList=e.result)}):this.phpVersionList=this.appDataService.installedPhpVersions}checkSelectedVersion(e){let n=!1;return void 0!==this.selectedPhpVersion&&e.version===this.selectedPhpVersion.version&&(n=!0),n}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(v),t.Y36(W))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-php-dropdown"]],inputs:{id:"id",mode:"mode",buttonText:"buttonText",selectedPhpVersion:"selectedPhpVersion",disabled:"disabled"},outputs:{phpVersionChanged:"phpVersionChanged"},decls:5,vars:3,consts:[["dropdown","",1,"btn-group","phpDropdownButton",3,"isDisabled"],["dropdownToggle","","type","button",1,"btn","dropdown-toggle",3,"id"],[1,"caret"],["class","dropdown-menu","role","menu",3,"id",4,"dropdownMenu"],["role","menu",1,"dropdown-menu",3,"id"],[4,"ngFor","ngForOf"],["role","menuitem",3,"id"],[1,"dropdown-item",3,"click"],["class","fas fa-check versionIndicator","aria-hidden","true",4,"ngIf"],["aria-hidden","true",1,"fas","fa-check","versionIndicator"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"button",1),t._uU(2),t._UZ(3,"span",2),t.qZA(),t.YNc(4,Mt,2,3,"ul",3),t.qZA()),2&e&&(t.Q6J("isDisabled",n.disabled),t.xp6(1),t.MGl("id","",n.id,"-drop-button"),t.xp6(1),t.hij(" ",n.dropdownText," "))},directives:[w.TO,w.Mq,w.Hz,h.sg,h.O5],styles:[".phpDropdownButton[_ngcontent-%COMP%]{display:inline-block}html[dir=ltr][_ngcontent-%COMP%] .caret[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .caret[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .caret[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .caret[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .caret[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .caret[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .caret[_ngcontent-%COMP%]{margin-left:4px}html[dir=rtl][_ngcontent-%COMP%] .caret[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .caret[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .caret[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .caret[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .caret[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .caret[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .caret[_ngcontent-%COMP%]{margin-right:4px}.btn[_ngcontent-%COMP%]{text-transform:none;border:1px solid #ccc;background-color:#fff;white-space:normal;display:flex;align-items:center;justify-content:space-between;min-width:-moz-fit-content;min-width:fit-content}.btn[disabled][_ngcontent-%COMP%]{border:1px solid #ddd}html[dir=ltr][_ngcontent-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%]{margin-left:-15px;padding-right:4px}html[dir=rtl][_ngcontent-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .versionIndicator[_ngcontent-%COMP%]{margin-right:-15px;padding-left:4px}.dropdown-menu[_ngcontent-%COMP%]{max-width:280px;white-space:normal;word-break:break-word}.dropdown-item[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}"]}),i})();function vt(i,s){if(1&i&&(t.TgZ(0,"div",21),t._UZ(1,"i",22),t.TgZ(2,"span",23),t._uU(3),t.qZA()()),2&i){const e=t.oxw(2);t.xp6(2),t.Q6J("@fadeText",e.phpelsInstall.status),t.xp6(1),t.Oqu(e.phpelsInstall.message)}}function Ot(i,s){if(1&i&&(t.TgZ(0,"div",21),t._UZ(1,"i",24),t.TgZ(2,"span",23),t._uU(3),t.qZA()()),2&i){const e=t.oxw(2);t.xp6(2),t.Q6J("@fadeText",e.phpelsInstall.status),t.xp6(1),t.Oqu(e.phpelsInstall.message)}}function wt(i,s){if(1&i&&(t.TgZ(0,"div",21),t._UZ(1,"i",22),t.TgZ(2,"span",23),t._uU(3),t.qZA()()),2&i){const e=t.oxw(2);t.xp6(2),t.Q6J("@fadeText",e.phpelsInstall.status),t.xp6(1),t.Oqu(e.phpelsInstall.message)}}function St(i,s){if(1&i&&(t.TgZ(0,"div",21),t._UZ(1,"i",25),t.TgZ(2,"span",23),t._uU(3),t.qZA()()),2&i){const e=t.oxw(2);t.xp6(2),t.Q6J("@fadeText",e.phpelsInstall.status),t.xp6(1),t.Oqu(e.phpelsInstall.message)}}function kt(i,s){if(1&i&&(t.TgZ(0,"div",12)(1,"div",13)(2,"div",14)(3,"h4",15),t._uU(4),t.qZA()(),t.TgZ(5,"div",16)(6,"div",17),t.YNc(7,vt,4,2,"div",18),t.YNc(8,Ot,4,2,"div",18),t.YNc(9,wt,4,2,"div",18),t.YNc(10,St,4,2,"div",18),t.qZA(),t.TgZ(11,"div",19),t._UZ(12,"div",20),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngClass",e.phpelsInstall.status),t.xp6(3),t.Oqu(e.installTitle),t.xp6(2),t.Q6J("ngSwitch",e.phpelsInstall.status),t.xp6(1),t.Q6J("ngSwitchCase",e.phpElsInstallStatus.processing),t.xp6(1),t.Q6J("ngSwitchCase",e.phpElsInstallStatus.completed),t.xp6(1),t.Q6J("ngSwitchCase",e.phpElsInstallStatus.starting),t.xp6(1),t.Q6J("ngSwitchCase",e.phpElsInstallStatus.failed),t.xp6(1),t.uIk("aria-label",e.locale.maketext("Installation progress")),t.xp6(1),t.Udp("width",e.phpelsInstall.progress||0,"%"),t.uIk("aria-valuenow",e.phpelsInstall.progress||0)}}function Tt(i,s){1&i&&(t.TgZ(0,"div",29),t._UZ(1,"i",30),t.qZA())}function Ft(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"section",26)(1,"multiphp-mgr-php-dropdown",27),t.NdJ("phpVersionChanged",function(o){return t.CHM(e),t.oxw().selectVersion(o)}),t.qZA(),t.YNc(2,Tt,2,0,"div",28),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("selectedPhpVersion",e.selectedVersion),t.xp6(1),t.Q6J("ngIf",e.changingVersion&&!e.outdatedChanging)}}function yt(i,s){if(1&i&&(t.TgZ(0,"section",31)(1,"div",29),t._UZ(2,"i",30)(3,"span",32),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.Q6J("innerHtml",e.locale.maketext("Loading [asis,PHP] versions \u2026"),t.oJD)}}function Dt(i,s){if(1&i&&(t.TgZ(0,"div",33)(1,"a",34),t._UZ(2,"span",35),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.Oqu(e.locale.maketext("Supported Versions"))}}function It(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",36)(1,"cp-callout",37)(2,"div",38)(3,"strong"),t._uU(4),t.qZA(),t.TgZ(5,"p"),t._uU(6),t.TgZ(7,"a",39),t._uU(8),t.qZA()()(),t.TgZ(9,"div",40)(10,"cp-action-button",41),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.applyAction(o.selectedVersion)}),t._uU(11),t.qZA(),t.TgZ(12,"button",42),t.NdJ("click",function(){return t.CHM(e),t.oxw().cancelWarning()}),t._uU(13),t.qZA()()()()}if(2&i){const e=t.oxw();t.xp6(4),t.Oqu(e.locale.maketext("Warning:")),t.xp6(2),t.hij(" ",e.locale.maketext("You are trying to switch to a PHP version that has reached EOL. We recommend that you update to a supported version of PHP.")," "),t.xp6(2),t.Oqu(e.locale.maketext("Learn more about supported versions.")),t.xp6(2),t.Q6J("id",e.applyPHPVersion.id)("buttonClass",e.applyPHPVersion.buttonClass)("buttonState",e.applyPHPVersion.buttonState),t.xp6(1),t.Oqu(e.locale.maketext("Apply Outdated Version")),t.xp6(2),t.Oqu(e.locale.maketext("Cancel"))}}var x=(()=>{return(i=x||(x={})).nothingToDo="nothing-to-do",i.starting="starting",i.processing="processing",i.completed="completed",i.failed="failed",x;var i})();let Zt=(()=>{class i{constructor(e,n,o,r,l,d){this.locale=e,this.phpService=n,this.phpHelper=o,this.alertService=r,this.phpVersionService=l,this.sseService=d,this.systemDefaultChange=new t.vpe,this.changingVersion=!1,this.loadingSystemPhp=!0,this.outdatedChanging=!1,this.phpelsInstall={progress:0},this.applyPHPVersion={id:"applyPHPVersionBtn",buttonClass:"btn btn-primary",buttonState:a.FP.enabled},this.phpElsInstallStatus=x,this.lastStatusUpdateTime=0,this.isDestroyed=!1,this.isSseInitializing=!1}get installTitle(){return this.locale.maketext(this.phpelsInstall.status===x.completed?"[_1] installation complete.":"Installing [_1]","PHP ELS")}get showSupportedVersionLink(){return!!this.systemDefaultPhp&&this.systemDefaultPhp.isOutdated}get showOutdatedWarning(){return!!this.selectedVersion&&this.selectedVersion.isOutdated&&this.changingVersion}ngOnInit(){this.phpelsInstall.showDiv=!1,this.loadSystemPhp()}ngOnDestroy(){this.isDestroyed=!0,this.sseTask?.unsubscribe(),this.stopProgressTimer(),this.clearStatusUpdateTimer()}initializeSSE(){if(!(this.isDestroyed||this.sseTask||this.isSseInitializing)){this.isSseInitializing=!0;try{this.sseService.init(),this.sseTask=this.sseService.sseTask$.subscribe(e=>this.handleSSETask(e.status,e.message))}finally{this.isSseInitializing=!1}}}selectVersion(e){this.changingVersion=!0,this.applyPHPVersion.buttonState=a.FP.enabled,this.selectedVersion=e,this.outdatedChanging=!0,e.isOutdated||(this.applyAction(e),this.outdatedChanging=!1)}applyAction(e){this.phpService.setSystemDefault(e.version).subscribe(n=>{n.hasErrors?(this.changingVersion=!1,this.phpHelper.error(n),this.selectedVersion=this.systemDefaultPhp):(this.changingVersion=!1,this.systemDefaultChange.emit(e.version),this.alertService.success(this.locale.maketext("The system default [asis,PHP] version has been set to \u201c[_1]\u201d.",e.formattedVersion)),this.systemDefaultPhp=this.selectedVersion)}),this.outdatedChanging=!1,this.applyPHPVersion.buttonState=a.FP.loading}cancelWarning(){this.changingVersion=!1,this.selectedVersion=this.systemDefaultPhp}setupSystemPhpDropdown(){this.selectedVersion=this.systemDefaultPhp}toPhpElsInstallStatus(e){switch(e){case x.nothingToDo:case x.starting:case x.processing:case x.completed:case x.failed:return e;default:return}}handleSSETask(e,n){const o=this.toPhpElsInstallStatus(e);if(!o)return;const l=Date.now()-this.lastStatusUpdateTime;l>=2e3?this.applyStatusUpdate(o,n):(this.pendingStatusUpdate={status:o,message:n},this.clearStatusUpdateTimer(),this.statusUpdateTimer=setTimeout(()=>{this.pendingStatusUpdate&&(this.applyStatusUpdate(this.pendingStatusUpdate.status,this.pendingStatusUpdate.message),this.pendingStatusUpdate=void 0)},2e3-l))}applyStatusUpdate(e,n){this.lastStatusUpdateTime=Date.now(),e===x.nothingToDo?(this.phpelsInstall.showDiv=!1,this.phpelsInstall.progress=0,this.stopProgressTimer()):e===x.starting?(this.phpelsInstall.showDiv=!0,this.phpelsInstall.progress=1,this.startProgressTimer()):e===x.processing?(this.phpelsInstall.showDiv=!0,this.phpelsInstall.progress=Math.min((this.phpelsInstall.progress||0)+5,95),this.startProgressTimer()):e===x.completed?(this.phpelsInstall.progress=100,this.stopProgressTimer(),this.loadSystemPhp()):e===x.failed&&this.stopProgressTimer(),this.phpelsInstall.message=n,this.phpelsInstall.status=e}clearStatusUpdateTimer(){this.statusUpdateTimer&&(clearTimeout(this.statusUpdateTimer),this.statusUpdateTimer=void 0)}startProgressTimer(){this.stopProgressTimer(),this.progressTimer=setInterval(()=>{this.phpelsInstall.progress<90&&(this.phpelsInstall.progress=Math.min(this.phpelsInstall.progress+.5,90))},1e3)}stopProgressTimer(){this.progressTimer&&(clearInterval(this.progressTimer),this.progressTimer=void 0)}loadSystemPhp(){if(!this.phpVersionService.fetchPhpListSubject||!this.fetchSystemPhpSubject)return;this.loadingSystemPhp=!0;const e=this.phpVersionService.fetchPhpListSubject.pipe((0,it.h)(o=>!!o&&o.done),(0,ot.q)(1)),n=this.fetchSystemPhpSubject.pipe((0,it.h)(o=>!!o&&o.done),(0,ot.q)(1));(0,ft.aj)([e,n]).subscribe(([o,r])=>{this.systemDefaultPhp=this.phpVersionService.getPhpVersionDataByPackage(r.result),this.setupSystemPhpDropdown(),this.loadingSystemPhp=!1,this.initializeSSE()})}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(z),t.Y36(F),t.Y36(a.c9),t.Y36(v),t.Y36(st))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-system-php-settings"]],inputs:{fetchSystemPhpSubject:"fetchSystemPhpSubject"},outputs:{systemDefaultChange:"systemDefaultChange"},decls:14,vars:7,consts:[[1,"phpVersions"],[1,"row"],["class","col-xs-12 col-sm-12 col-md-12","style","padding-bottom: 15px;",4,"ngIf"],[1,"col-xs-12","col-sm-8","col-md-7"],[1,"col-xs-12","col-sm-4"],[1,"col-xs-12","col-sm-8"],["id","selectorSection",4,"ngIf"],["id","loadingSection","class","notifyLoading",4,"ngIf"],[1,"col-xs-12"],[1,"help-block",3,"innerHtml"],["class","supportedVersions col-xs-12 col-sm-4 col-md-5",4,"ngIf"],["class","outdatedWarning",4,"ngIf"],[1,"col-xs-12","col-sm-12","col-md-12",2,"padding-bottom","15px"],["role","status","aria-live","polite",1,"phpelse-install-card",3,"ngClass"],[1,"install-header"],[1,"install-title"],[1,"install-content"],[1,"status-message",3,"ngSwitch"],["class","status-inner",4,"ngSwitchCase"],[1,"progress-bar-container"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar-fill"],[1,"status-inner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","status-icon"],[1,"status-text"],["aria-hidden","true",1,"far","fa-check-circle","status-icon"],["aria-hidden","true",1,"fas","fa-exclamation-circle","status-icon"],["id","selectorSection"],["id","system-php","mode","PhpDropdownMode.dropdown",3,"selectedPhpVersion","phpVersionChanged"],["class","processing-spinner",4,"ngIf"],[1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],["id","loadingSection",1,"notifyLoading"],[3,"innerHtml"],[1,"supportedVersions","col-xs-12","col-sm-4","col-md-5"],["href","https://go.cpanel.net/PHPSupportedVersions","target","_blank",1,"float-right","flip"],["aria-hidden","true",1,"fas","fa-external-link-alt"],[1,"outdatedWarning"],["id","outdatedWarning","calloutType","warning"],[1,"warningText"],["href","https://go.cpanel.net/PHPSupportedVersions","target","_blank"],[1,"warningButtons"],[1,"outdatedButton",3,"id","buttonClass","buttonState","click"],["id","cancelWarning","type","button",1,"btn","btn-default","cancelWarning",3,"click"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t.YNc(2,kt,13,11,"div",2),t.TgZ(3,"div",3)(4,"div",1)(5,"h3",4),t._uU(6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Ft,3,2,"section",6),t.YNc(9,yt,4,1,"section",7),t.qZA(),t.TgZ(10,"div",8),t._UZ(11,"span",9),t.qZA()()(),t.YNc(12,Dt,4,1,"div",10),t.qZA()(),t.YNc(13,It,14,8,"div",11)),2&e&&(t.xp6(2),t.Q6J("ngIf",n.phpelsInstall.showDiv),t.xp6(4),t.hij(" ",n.locale.maketext("[asis,PHP] Version")," "),t.xp6(2),t.Q6J("ngIf",!n.loadingSystemPhp),t.xp6(1),t.Q6J("ngIf",n.loadingSystemPhp),t.xp6(2),t.Q6J("innerHtml",n.locale.maketext("This setting applies to new account creations and domains set to inherit the System [asis,PHP] Version."),t.oJD),t.xp6(1),t.Q6J("ngIf",n.showSupportedVersionLink),t.xp6(1),t.Q6J("ngIf",n.showOutdatedWarning))},directives:[h.O5,h.mk,h.RF,h.n9,U,a.Oc,a.xV],styles:['.phpVersions[_ngcontent-%COMP%]{border:1px solid #eaeaea;padding:20px}.phpVersions[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0;padding-top:10px}.supportedVersions[_ngcontent-%COMP%]{text-decoration:underline;padding-top:10px}.deprecationWarning[_ngcontent-%COMP%]{margin-top:-15px}.warningButtons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-top:15px}html[dir=ltr][_ngcontent-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%]{padding-left:5px}html[dir=rtl][_ngcontent-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] #selectorSection[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%]{padding-right:5px}.phpelse-install-card[_ngcontent-%COMP%]{background:#fff;padding:1.5rem 1.75rem;border-radius:4px;max-width:450px}.install-header[_ngcontent-%COMP%]{margin-bottom:1.5rem;padding-bottom:1rem;border-bottom:1px solid #e8e8e8}.install-title[_ngcontent-%COMP%]{margin:0;font-size:1.25rem;font-weight:600;color:#2f3b45}.install-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.25rem}.status-message[_ngcontent-%COMP%]{display:block}.status-inner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.status-icon[_ngcontent-%COMP%]{font-size:1rem;flex-shrink:0}.status-text[_ngcontent-%COMP%]{color:#4a5568;font-size:.9rem;line-height:1.4}.progress-bar-container[_ngcontent-%COMP%]{width:100%;height:12px;background-color:#e2e8f0;border-radius:4px;overflow:hidden}.progress-bar-fill[_ngcontent-%COMP%]{height:100%;background-color:#3182ce;transition:width .3s ease,background-color .3s ease;border-radius:4px;position:relative;overflow:hidden}.progress-bar-fill[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;width:100%;height:100%;animation:shimmer 2s infinite}html[dir=ltr][_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=ltr][_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=ltr][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, html[dir=ltr][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, html[dir=ltr] [_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=ltr][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=ltr] [_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after{left:-100%;background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.3) 50%,rgba(255,255,255,0) 100%)}html[dir=rtl][_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=rtl][_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=rtl][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, html[dir=rtl][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, html[dir=rtl] [_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=rtl][_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after, [dir=rtl] [_nghost-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]:after{right:-100%;background:linear-gradient(-90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.3) 50%,rgba(255,255,255,0) 100%)}@keyframes shimmer{0%{left:-100%}to{left:100%}}.phpelse-install-card.processing[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{color:#3182ce}.phpelse-install-card.processing[_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]{background-color:#3182ce}.phpelse-install-card.starting[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{color:#d69e2e}.phpelse-install-card.starting[_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]{background-color:#d69e2e}.phpelse-install-card.completed[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{color:#38a169}.phpelse-install-card.completed[_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]{background-color:#38a169}.phpelse-install-card.failed[_ngcontent-%COMP%] .status-icon[_ngcontent-%COMP%]{color:#e53e3e}.phpelse-install-card.failed[_ngcontent-%COMP%] .progress-bar-fill[_ngcontent-%COMP%]{background-color:#e53e3e}'],data:{animation:[(0,M.X$)("fadeText",[(0,M.eR)(":enter",[(0,M.oB)({opacity:0,transform:"translateY(2px)"}),(0,M.jt)("250ms ease",(0,M.oB)({opacity:1,transform:"translateY(0)"}))]),(0,M.eR)(":leave",[(0,M.oB)({opacity:1,transform:"translateY(0)"}),(0,M.jt)("200ms ease",(0,M.oB)({opacity:0,transform:"translateY(-2px)"}))])])]}}),i})();var _=(()=>{return(i=_||(_={}))[i.disabled=0]="disabled",i[i.enabled=1]="enabled",_;var i})(),Ht=g(1715),G=g(537);class At{constructor(s,e,n,o,r,l){this.totalDomains=s,this.domainsUsingFpm=e,this.domainToBeEnabled=n,this.domainsToEnableWithoutOverload=o,this.memoryNeeded=r,this.showWarning=l}}let Jt=(()=>{class i{constructor(e){this.apiClient=e}fetchFPMStatus(){const e=new c.r(c.N.JsonApi,{method:"php_get_default_accounts_to_fpm"});return this.apiClient.get(e)}setSystemFPMDefault(e){const n=new c.r(c.N.JsonApi,{method:"php_set_default_accounts_to_fpm",arguments:[new C.h("default_accounts_to_fpm",e)]});return this.apiClient.post(n)}enablePhpFpmOnAllDomains(){const e=new c.r(c.N.JsonApi,{method:"convert_all_domains_to_fpm"});return this.apiClient.post(e).pipe((0,k.U)(n=>{if(n.hasErrors)throw n;return n.success?n.data=n.data.build:n.data}))}phpFpmConversionInProgress(){const e=new c.r(c.N.JsonApi,{method:"is_conversion_in_progress"});return this.apiClient.post(e).pipe((0,k.U)(n=>{if(n.hasErrors)throw n;return n.success?n.data=!(!n.data||1!==n.data.inProgress):n.data}))}reviewPhpFpmConversion(){const e=new c.r(c.N.JsonApi,{method:"get_fpm_count_and_utilization"});return this.apiClient.post(e).pipe((0,k.U)(n=>{if(n.hasErrors)throw n;if(n.success){const o=n.data;return n.data=new At(o.total_domains,o.domains_using_fpm,o.domains_to_be_enabled,o.number_of_new_fpm_accounts_we_can_handle,o.memory_needed,o.show_warning),n.data}return n.data}))}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();function Lt(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"cp-toggle-switch",18),t.NdJ("toggleStatus",function(){return t.CHM(e),t.oxw(2).toggleFpm()}),t.qZA()}if(2&i){const e=t.oxw(2);t.s9C("onText",e.locale.maketext("Enabled")),t.s9C("offText",e.locale.maketext("Disabled")),t.Q6J("toggleState",e.systemFPMToggle.toggleState)("labelPosition",e.systemFPMToggle.labelPosition)}}function Vt(i,s){if(1&i&&(t.TgZ(0,"div",19),t._UZ(1,"span",20),t._uU(2),t.qZA()),2&i){const e=t.oxw(2);t.xp6(2),t.hij(" ",e.locale.maketext("Unavailable")," ")}}function Ut(i,s){if(1&i&&(t.TgZ(0,"section",15),t.YNc(1,Lt,1,4,"cp-toggle-switch",16),t.YNc(2,Vt,3,1,"ng-template",null,17,t.W1O),t.qZA()),2&i){const e=t.MAs(3),n=t.oxw();t.xp6(1),t.Q6J("ngIf",!0===n.systemFPMInfo.hasFPMInstalled)("ngIfElse",e)}}function qt(i,s){if(1&i&&(t.TgZ(0,"section",21)(1,"div",22),t._UZ(2,"i",23)(3,"span",24),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.Q6J("innerHtml",e.locale.maketext("Loading system setting for [asis,PHP-FPM] \u2026"),t.oJD)}}function Bt(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"cp-action-button",25),t.NdJ("click",function(){return t.CHM(e),t.oxw().enablePhpFpmOnAllDomains()}),t._uU(1),t.qZA()}if(2&i){const e=t.oxw();t.s9C("title",e.locale.maketext("Click here to enable [asis,PHP-FPM] on all domains.")),t.Q6J("buttonClass",e.phpFpmAllButton.buttonClass)("buttonState",e.phpFpmAllButton.buttonState),t.xp6(1),t.hij(" ",e.locale.maketext("Enable on all domains[comment,button title]")," ")}}function Qt(i,s){if(1&i&&t._UZ(0,"p",24),2&i){const e=t.oxw(2);t.Q6J("innerHtml",e.phpFpmConversion.memoryWarningText,t.oJD)}}function Et(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",7)(2,"cp-callout",26)(3,"span",27),t._uU(4),t.qZA(),t._UZ(5,"p",28),t.YNc(6,Qt,1,1,"p",29),t._UZ(7,"p",24),t.TgZ(8,"cp-action-button",30),t.NdJ("click",function(){return t.CHM(e),t.oxw().confirmEnablePhpFpmOnAllDomains()}),t._uU(9),t.qZA(),t.TgZ(10,"button",31),t.NdJ("click",function(){return t.CHM(e),t.oxw().cancelPhpFpmAllDomains()}),t._uU(11),t.qZA()()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("calloutType",e.phpFpmConversion.calloutType),t.xp6(2),t.Oqu(e.phpFpmConversion.reviewHeading),t.xp6(1),t.Q6J("innerHtml",e.phpFpmConversion.reviewSubHeading,t.oJD),t.xp6(1),t.Q6J("ngIf",e.phpFpmConversion.showMemoryWarning),t.xp6(1),t.Q6J("innerHtml",e.locale.maketext("For more information, read our [output,url,_1,PHP-FPM documentation,target,blank].","https://go.cpanel.net/phpfpm"),t.oJD),t.xp6(1),t.s9C("title",e.locale.maketext("Click here to confirm.")),t.Q6J("buttonClass",e.confirmPhpFpmAllButton.buttonClass)("buttonState",e.confirmPhpFpmAllButton.buttonState),t.xp6(1),t.hij(" ",e.locale.maketext("Enable")," "),t.xp6(1),t.Q6J("title",e.locale.maketext("Cancel enabling [asis,PHP-FPM] on all domains")),t.xp6(1),t.hij(" ",e.locale.maketext("Cancel")," ")}}function Nt(i,s){if(1&i&&(t.TgZ(0,"div",1)(1,"div",7)(2,"cp-callout",32),t._UZ(3,"span",24),t.qZA()()()),2&i){const e=t.oxw();t.xp6(3),t.Q6J("innerHtml",e.phpFpmConversionInProgressMessage,t.oJD)}}function Yt(i,s){1&i&&t._UZ(0,"i",43)}function Rt(i,s){1&i&&t._UZ(0,"i",44)}function jt(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",33)(1,"cp-callout",34)(2,"div",35)(3,"strong"),t._uU(4),t.qZA(),t._UZ(5,"p",36),t.qZA(),t.TgZ(6,"div",37)(7,"a",38),t._UZ(8,"span",39),t._uU(9),t.qZA(),t.TgZ(10,"button",40),t.NdJ("click",function(){return t.CHM(e),t.oxw().refreshPackages()}),t.YNc(11,Yt,1,0,"i",41),t.YNc(12,Rt,1,0,"ng-template",null,42,t.W1O),t._uU(14),t.qZA()()()()}if(2&i){const e=t.MAs(13),n=t.oxw();t.xp6(4),t.Oqu(n.locale.maketext("Warning:")),t.xp6(1),t.Q6J("innerHTML",n.locale.maketext("You [output,strong,cannot] set the system default to use [asis,PHP-FPM]. You do [output,strong,not] have the [asis,PHP-FPM] package for your system\u2019s default [asis,PHP] version installed."),t.oJD),t.xp6(2),t.s9C("href",n.installPhpFpmUrl,t.LSH),t.xp6(2),t.hij(" ",n.locale.maketext("Install")," "),t.xp6(1),t.Q6J("disabled",n.refreshPhpFpm),t.xp6(1),t.Q6J("ngIf",n.refreshPhpFpm)("ngIfElse",e),t.xp6(3),t.hij(" ",n.locale.maketext("Refresh")," ")}}let zt=(()=>{class i{constructor(e,n,o,r,l,d,P){this.fpmService=e,this.alertService=n,this.locale=o,this.location=r,this.phpHelper=l,this.phpVersionService=d,this._window=P,this.systemFPMInfo=new nt,this.systemFPMToggle={toggleState:a.Yg.toggleOff,labelPosition:a.Gy.right,isDisabled:!1},this.refreshPhpFpm=!1,this.loadingSystemFpm=!0,this.liteSpeedRunning=!1,this.fpmPackageForSystemPhp="",this.phpFpmConversionLog=`${this._window.nativeWindow.PAGE.base}/php-fpm-conversion`,this.phpFpmAllButton={buttonClass:"btn btn-outline-primary btn-sm float-right flip",buttonState:a.FP.enabled},this.confirmPhpFpmAllButton={buttonClass:"btn btn-sm btn-primary button-bar",buttonState:a.FP.enabled},this.phpFpmConversion={localStorageKey:"fpmConversionBuildId",showReview:!1,timerHandle:null,timerInterval:3e3,buildId:null,isRunning:!1,reviewHeading:"",reviewSubHeading:"",memoryWarningText:"",showMemoryWarning:!1,calloutType:""},this.showEnableAllDomainsPrompt=!1}get showEnableAllButton(){return this.systemFPMInfo.hasFPMInstalled&&!this.loadingSystemFpm&&this.systemFPMToggle.toggleState===a.Yg.toggleOn&&!this.liteSpeedRunning&&!this.showEnableAllDomainsPrompt}get phpFpmConversionInProgressMessage(){let e="";return this.phpFpmConversion.isRunning&&(e=this.locale.maketext("[asis,PHP-FPM] conversion has started. Click here to view the progress: [output,url,_1,conversion log,target,blank,id,viewConversionLink].",`${this.phpFpmConversionLog}/${this.phpFpmConversion.buildId}`)),e}get installPhpFpmUrl(){const e="install="+encodeURIComponent(this.fpmPackageForSystemPhp);return this.location.prepareExternalUrl(this.location.path()).split("multiphp-manager/system")[0]+"EasyApache4/review?"+e}showFpmWarning(){return!this.systemFPMInfo.hasFPMInstalled&&!this.loadingSystemFpm&&!this.liteSpeedRunning}toggleFpm(){this.systemFPMToggle.toggleState=a.Yg.toggleUpdating,this.systemFPMInfo.status===_.disabled?this.fpmService.setSystemFPMDefault(_.enabled).subscribe(e=>{e.hasErrors?this.phpHelper.error(e):this.showEnableAllFpmPrompt()}):(this.cancelPhpFpmAllDomains(),this.fpmService.setSystemFPMDefault(_.disabled).subscribe(e=>{e.hasErrors?this.phpHelper.error(e):(this.systemFPMToggle.toggleState=a.Yg.toggleOff,this.systemFPMInfo.status=_.disabled,this.alertService.success(this.locale.maketext("You have disabled [asis,PHP-FPM] as a default for your system.")))}))}gotoPhpFpmSettings(){this.phpHelper.routeTo("system/fpm-settings")}refreshPackages(){this.refreshPhpFpm=!0,this.phpVersionService.reloadFpmPackages()}ngOnInit(){this.liteSpeedRunning=1===this._window.nativeWindow.PAGE.litespeed_running,this.loadSystemFpmData(),this.checkPhpFpmConversionProgress()}checkPhpFpmConversionProgress(){this.phpFpmConversion.isRunning=this._window.nativeWindow.PAGE.fpmConversion_in_progress,this.phpFpmConversion.isRunning&&(this.phpFpmAllButton.buttonState=a.FP.loading,this.phpFpmConversion.buildId=localStorage.getItem(this.phpFpmConversion.localStorageKey),this.monitorPhpFpmConversions())}loadSystemFpmData(){this.fetchSystemPhpSubject&&this.fetchSystemPhpSubject.subscribe(e=>{e.done&&(this.systemPhpVersion=e.result,this.fpmPackageForSystemPhp=this.systemPhpVersion+"-php-fpm",this.phpVersionService.fpmPackagesReady$.subscribe(n=>{n.done&&(this.systemFPMInfo.hasFPMInstalled=this.phpVersionService.isPhpFpmInstalled(this.fpmPackageForSystemPhp),this.fpmService.fetchFPMStatus().subscribe(o=>{o.hasErrors?this.phpHelper.error(o):this.populateSystemFpm(o.data),this.loadingSystemFpm=!1,this.refreshPhpFpm=!1}))}))})}populateSystemFpm(e){e.default_accounts_to_fpm&&this.systemFPMInfo.hasFPMInstalled&&(this.systemFPMInfo.status=_.enabled,this.systemFPMToggle.toggleState=a.Yg.toggleOn)}enablePhpFpmOnAllDomains(){this.phpFpmAllButton.buttonState=a.FP.loading,this.fpmService.reviewPhpFpmConversion().subscribe(e=>{this.phpFpmConversion.showReview=e.showWarning,e.showWarning?(this.phpFpmConversion.calloutType="warning",this.phpFpmConversion.reviewHeading=this.locale.maketext("Review information before you enable [asis,PHP-FPM] on all domains[comment,header title]"),this.phpFpmConversion.reviewSubHeading=this.locale.maketext("You are attempting to enable [asis,PHP-FPM] on \u201c[output,strong,_1]\u201d domains.",e.domainToBeEnabled),this.phpFpmConversion.showMemoryWarning=!0,this.phpFpmConversion.memoryWarningText=this.locale.maketext("Enabling these domains may use more memory than your server had configured. If your server runs out of memory, you may experience severe data loss."),this.phpFpmAllButton.buttonState=a.FP.disabled):this.confirmEnablePhpFpmOnAllDomains()},e=>{this.phpHelper.error(e),this.phpFpmAllButton.buttonState=a.FP.enabled})}confirmEnablePhpFpmOnAllDomains(){this.phpFpmConversion.showReview=!1,this.fpmService.enablePhpFpmOnAllDomains().subscribe(e=>{this.phpFpmConversion.isRunning=!0,this.phpFpmConversion.buildId=e,localStorage.setItem(this.phpFpmConversion.localStorageKey,e.toString()),this.monitorPhpFpmConversions()},e=>{this.phpHelper.error(e),this.phpFpmAllButton.buttonState=a.FP.enabled})}cancelPhpFpmAllDomains(){this.phpFpmConversion.showReview=!1,this.showEnableAllDomainsPrompt=!1,this.phpFpmAllButton.buttonState=a.FP.enabled,this.confirmPhpFpmAllButton.buttonState=a.FP.enabled}showEnableAllFpmPrompt(){this.fpmService.reviewPhpFpmConversion().subscribe(e=>{this.systemFPMToggle.toggleState=a.Yg.toggleOn,this.systemFPMInfo.status=_.enabled,this.alertService.success(this.locale.maketext("You have enabled [asis,PHP-FPM] as a default for your system.")),this.phpFpmConversion.showReview=!e.showWarning&&e.domainToBeEnabled>0,this.phpFpmConversion.showReview&&(this.phpFpmConversion.calloutType="info",this.showEnableAllDomainsPrompt=!0,this.phpFpmConversion.reviewHeading=this.locale.maketext("You have enabled [asis,PHP-FPM] as a system default[comment,header title]"),this.phpFpmConversion.reviewSubHeading=this.locale.maketext("Would you also like to enable [asis,PHP-FPM] on all domains?"),this.phpFpmConversion.showMemoryWarning=!1,this.phpFpmConversion.memoryWarningText="")})}monitorPhpFpmConversions(){this.phpFpmConversion.timerHandle=(0,Ht.F)(this.phpFpmConversion.timerInterval).subscribe(()=>{this.fpmService.phpFpmConversionInProgress().pipe((0,G.x)(()=>{this.phpFpmConversion.isRunning||this.phpFpmConversion.timerHandle.unsubscribe()})).subscribe(e=>{this.phpFpmConversion.isRunning=e||!1,e||(localStorage.removeItem(this.phpFpmConversion.localStorageKey),this.alertService.success(this.locale.maketext("[asis,PHP-FPM] is applied to all domains whose [asis,PHP] versions have [asis,PHP-FPM] extension installed.")),this.showEnableAllDomainsPrompt=!1,this.phpFpmAllButton.buttonState=a.FP.enabled,this.confirmPhpFpmAllButton.buttonState=a.FP.enabled)},e=>{this.phpHelper.error(e),this.phpFpmConversion.isRunning=!1,this.phpFpmAllButton.buttonState=a.FP.enabled})})}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(Jt),t.Y36(a.c9),t.Y36(b.g),t.Y36(h.Ye),t.Y36(F),t.Y36(v),t.Y36(y))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-system-fpm"]],inputs:{fetchSystemPhpSubject:"fetchSystemPhpSubject"},decls:19,vars:8,consts:[[1,"phpFPM"],[1,"row"],[1,"col-xs-12","col-sm-8","col-md-7"],[1,"col-xs-12","col-sm-4"],[1,"col-xs-12","col-sm-8"],["id","fpmSettingSection",4,"ngIf"],["id","loadingSection","class","notifyLoading",4,"ngIf"],[1,"col-xs-12"],[1,"help-block",3,"innerHtml"],[1,"manageFPMSettings","col-xs-12","col-sm-4","col-md-5"],["href","javascript:void(0)","id","manageSystemFpmSettings",1,"btn","btn-outline-primary","btn-sm","float-right","flip",3,"click"],["id","btn-enable-fpm-all-domains",3,"buttonClass","buttonState","title","click",4,"ngIf"],["id","php-fpm-conversion-messages"],["class","row",4,"ngIf"],["class","fpmWarning",4,"ngIf"],["id","fpmSettingSection"],["id","systemFPM","class","fpmToggle",3,"onText","offText","toggleState","labelPosition","toggleStatus",4,"ngIf","ngIfElse"],["unavailable",""],["id","systemFPM",1,"fpmToggle",3,"onText","offText","toggleState","labelPosition","toggleStatus"],[1,"fpmUnsupported"],["aria-hidden","true",1,"fas","fa-ban"],["id","loadingSection",1,"notifyLoading"],[1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],[3,"innerHtml"],["id","btn-enable-fpm-all-domains",3,"buttonClass","buttonState","title","click"],["id","fpm-convert-review",3,"calloutType"],["callout-heading",""],[1,"fpmPromptSubheading",3,"innerHtml"],[3,"innerHtml",4,"ngIf"],["id","btn-confirm-enable-fpm-all-domains",3,"buttonClass","buttonState","title","click"],["id","cancel-enable-fpm-all-domains","type","button",1,"btn","btn-sm","btn-link",3,"title","click"],["id","fpm-convert-review","calloutType","info"],[1,"fpmWarning"],["id","fpmWarning","calloutType","warning"],[1,"warningText"],[3,"innerHTML"],[1,"warningButtons"],["id","installPHPFPM-button","target","_blank",1,"btn","btn-primary",3,"href"],["aria-hidden","true",1,"fas","fa-external-link-alt","fpmInstallLink"],["id","refreshFPM",1,"btn","btn-default","button-bar",3,"disabled","click"],["class","fas fa-sync fa-spin","aria-hidden","true",4,"ngIf","ngIfElse"],["noSpin",""],["aria-hidden","true",1,"fas","fa-sync","fa-spin"],["aria-hidden","true",1,"fas","fa-sync"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",1)(4,"h3",3),t._uU(5,"PHP-FPM"),t.qZA(),t.TgZ(6,"div",4),t.YNc(7,Ut,4,2,"section",5),t.YNc(8,qt,4,1,"section",6),t.qZA(),t.TgZ(9,"div",7),t._UZ(10,"span",8),t.qZA()()(),t.TgZ(11,"div",9)(12,"a",10),t.NdJ("click",function(){return n.gotoPhpFpmSettings()}),t._uU(13),t.qZA(),t.YNc(14,Bt,2,4,"cp-action-button",11),t.qZA()(),t.TgZ(15,"section",12),t.YNc(16,Et,12,11,"div",13),t.YNc(17,Nt,4,1,"div",13),t.qZA()(),t.YNc(18,jt,15,8,"div",14)),2&e&&(t.xp6(7),t.Q6J("ngIf",!n.loadingSystemFpm),t.xp6(1),t.Q6J("ngIf",n.loadingSystemFpm),t.xp6(2),t.Q6J("innerHtml",n.locale.maketext("System [asis,PHP-FPM] setting applies to only new account creations."),t.oJD),t.xp6(3),t.hij(" ",n.locale.maketext("Manage Settings")," "),t.xp6(1),t.Q6J("ngIf",n.showEnableAllButton),t.xp6(2),t.Q6J("ngIf",n.phpFpmConversion.showReview),t.xp6(1),t.Q6J("ngIf",n.phpFpmConversion.isRunning),t.xp6(1),t.Q6J("ngIf",n.showFpmWarning()))},directives:[h.O5,a.MF,a.xV,a.Oc],styles:[".phpFPM[_ngcontent-%COMP%]{border-right:1px solid #eaeaea;border-bottom:1px solid #eaeaea;border-left:1px solid #eaeaea;padding:25px 20px}.phpFPM[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-top:0;padding-top:10px}.phpFPM[_ngcontent-%COMP%] .toggle-switch-wrapper{margin-top:5px}.fpmUnsupported[_ngcontent-%COMP%]{margin-top:10px}.fpmWarning[_ngcontent-%COMP%]{margin-top:-15px}.warningButtons[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}html[dir=ltr][_ngcontent-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding-right:10px}html[dir=rtl][_ngcontent-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .warningButtons[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding-left:10px}.warningText[_ngcontent-%COMP%]{display:inline-flex}.warningText[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{padding-top:3px;color:#f1c40f}.warningText[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{padding-left:5px;padding-right:5px}html[dir=ltr][_ngcontent-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%]{padding-right:4px}html[dir=rtl][_ngcontent-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .fpmInstallLink[_ngcontent-%COMP%]{padding-left:4px}.fpmPromptSubheading[_ngcontent-%COMP%]{margin-bottom:5px}#manageSystemFpmSettings[_ngcontent-%COMP%]{padding:6px 26px}"]}),i})();class rt{constructor(s=!1,e="",n="",o="",r="",l={}){this.showBanner=s,this.purchaseLink=e,this.actionText=n,this.linkTarget=o,this.icon=r,this.data=l}}function Wt(i,s){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.hij(" ",e.locale.maketext("Contact your provider for more information on upgrading to [_1] or [_2].","CloudLinux","TuxCare PHP ELS")," ")}}function Gt(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"a",10),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).sendMixPanelEvent("PHPELS-Purchase-Started-MultiPHP")}),t._UZ(2,"img",11),t.TgZ(3,"span",12),t._uU(4),t.qZA()()()}if(2&i){const e=t.oxw(3);t.xp6(1),t.s9C("href",e.phpelsLinkData.purchaseLink,t.LSH),t.s9C("target",e.phpelsLinkData.linkTarget),t.Q6J("id",e.phpelsUpgradeButtonId),t.xp6(1),t.Q6J("src",e.phpelsLinkData.icon,t.LSH),t.xp6(2),t.Oqu(e.phpelsLinkData.actionText)}}function $t(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"a",10),t.NdJ("click",function(){return t.CHM(e),t.oxw(3).sendMixPanelEvent("Cloudlinux-Purchase-Started-MultiPHP")}),t._UZ(2,"img",13),t.TgZ(3,"span",12),t._uU(4),t.qZA()()()}if(2&i){const e=t.oxw(3);t.xp6(1),t.s9C("href",e.cloudlinuxLinkData.purchaseLink,t.LSH),t.s9C("target",e.cloudlinuxLinkData.linkTarget),t.Q6J("id",e.upgradeButtonId),t.xp6(1),t.Q6J("src",e.cloudlinuxLinkData.icon,t.LSH),t.xp6(2),t.Oqu(e.cloudlinuxLinkData.actionText)}}function Xt(i,s){if(1&i&&(t.TgZ(0,"div",8),t.YNc(1,Gt,5,5,"div",9),t.YNc(2,$t,5,5,"div",9),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.cloudlinuxLinkData.data.promote_phpels),t.xp6(1),t.Q6J("ngIf",e.cloudlinuxLinkData.data.cl_is_supported)}}function Kt(i,s){if(1&i&&(t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t._UZ(4,"p",5),t.qZA(),t.YNc(5,Wt,2,1,"p",6),t.YNc(6,Xt,3,2,"ng-template",null,7,t.W1O),t.qZA()()()),2&i){const e=t.MAs(7),n=t.oxw();t.xp6(4),t.Q6J("innerHtml",n.bannerText,t.oJD),t.xp6(1),t.Q6J("ngIf",n.hideUpgradeOption)("ngIfElse",e)}}let at=(()=>{class i{constructor(e,n){this.locale=e,this._window=n,this.cloudlinuxLinkData=new rt,this.phpelsLinkData=new rt}get hideUpgradeOption(){let e=this.cloudlinuxLinkData.data.purchase_cl_data;return!!(e.server_timeout||e.error_msg&&""!==e.error_msg)}get cloudlinuxLinkIcon(){return this.cloudlinuxLinkData.data.purchase_cl_data.is_url?"fa-external-link-alt":"fa-envelope"}get phpelsLinkIcon(){return"fa-external-link-alt"}get bannerText(){const e=this.cloudlinuxLinkData.data;if(this.lsapiInstalled)return this.locale.maketext("To utilize the [asis,LSAPI] handler\u2019s full functionality and performance benefits, upgrade your system to [asis,CloudLinux]. To learn more about this feature, please read [output,url,_1,CloudLinux - Mod_lsapi Feature,target,_2].","https://go.cpanel.net/CL-lsapi","blank");let r=this.locale.maketext("[output,strong,Need to keep older PHP versions secure?]")+"<br>"+this.locale.maketext("cPanel provides the latest stable versions of PHP. If you require legacy versions like PHP 5.6 or 7.x, you can keep outdated websites secure with [output,strong,TuxCare Extended Lifecycle Support (ELS)] from CloudLinux. This service provides hardened PHP versions continuously patched against known vulnerabilities, making it the easiest way to maintain security for older PHP versions. [output,url,_1,Learn more.,target,_2]","https://go.cpanel.net/about-elsphp","blank"),P=this.locale.maketext("[output,strong,Upgrade your server security and performance.]")+"<br>"+this.locale.maketext("[output,strong,CloudLinux OS] is a feature-rich platform solution that addresses multiple server challenges in a single package, including hardened PHP for legacy version, while also delivering enhanced security, performance, and resource isolation across your hosting environment. [output,url,_1,Learn more.,target,_2]","https://go.cpanel.net/about-cloudlinux","blank");return e.promote_phpels?e.cl_is_supported?r+"<br><br>"+P:r:e.cl_is_supported&&!e.cl_is_installed?P:void 0}get upgradeButtonId(){return this.lsapiInstalled?"lsapiUpgradeButton":"clUpgradeButton"}get phpelsUpgradeButtonId(){return"phpelsUpgradeButton"}ngOnInit(){this.setCloudLinuxInfo(this._window.nativeWindow.PAGE.cl_data)}setCloudLinuxInfo(e){if(e){const n=e.purchase_cl_data,o=e.purchase_phpels_data;if(this.cloudlinuxLinkData.data=e,this.cloudlinuxLinkData.icon=e.clicon,this.phpelsLinkData.icon=e.phpelsicon,this.cloudlinuxLinkData.showBanner=!1,(e.promote_phpels||e.cl_is_supported&&!e.cl_is_installed)&&(this.cloudlinuxLinkData.showBanner=!0),o&&(this.phpelsLinkData.purchaseLink=o.url,this.phpelsLinkData.actionText=this.locale.maketext("Buy [_1]","TuxCare PHP ELS "),this.phpelsLinkData.linkTarget=o.target||"_blank"),n&&n.is_url&&!n.server_timeout)this.cloudlinuxLinkData.purchaseLink=n.url,this.cloudlinuxLinkData.actionText=this.locale.maketext("Upgrade to [asis,CloudLinux]"),this.cloudlinuxLinkData.linkTarget=n.target||"_blank";else{const r="Upgrade to Cloud Linux",l="I am interested in more information on how I can benefit from CloudLinux on my cPanel server.",d="mailto:"+encodeURIComponent(n.email||"")+"?subject="+encodeURIComponent(r)+"&body="+encodeURIComponent(l);this.cloudlinuxLinkData.purchaseLink=d,this.cloudlinuxLinkData.linkTarget="_top",this.cloudlinuxLinkData.actionText=this.locale.maketext("Email Provider")}}}sendMixPanelEvent(e){const n=window?.mixpanel;!n?.track||n.track(e,{})}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(y))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-cloudlinux-banner"]],inputs:{lsapiInstalled:"lsapiInstalled"},decls:1,vars:1,consts:[["id","cloudlinuxBanner","class","promotion",4,"ngIf"],["id","cloudlinuxBanner",1,"promotion"],[1,"row"],[1,"col-xs-12"],[1,"banner-text","clb-banner-text"],[3,"innerHtml"],[4,"ngIf","ngIfElse"],["upgrade",""],[1,"actions","action-button","clb-action-row"],[4,"ngIf"],[1,"btn","btn-sm","btn-default","clb-action-btn",3,"href","id","target","click"],["alt","PHP-ELS","loading","lazy",1,"icon","clb-icon-32",3,"src"],[1,"btn-text"],["alt","CloudLinux","loading","lazy",1,"icon","clb-icon-32",3,"src"]],template:function(e,n){1&e&&t.YNc(0,Kt,8,3,"div",0),2&e&&t.Q6J("ngIf",n.cloudlinuxLinkData.showBanner)},directives:[h.O5],styles:['.promotion[_ngcontent-%COMP%]{background-color:#f5f5f5;margin:20px 0;padding:20px;position:relative}html[dir=ltr][_ngcontent-%COMP%] .promotion[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .promotion[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .promotion[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .promotion[_ngcontent-%COMP%]{border-left-width:3px;border-left-style:solid;border-left-color:#f78e1e}html[dir=rtl][_ngcontent-%COMP%] .promotion[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .promotion[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .promotion[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .promotion[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .promotion[_ngcontent-%COMP%]{border-right-width:3px;border-right-style:solid;border-right-color:#f78e1e}.promotion[_ngcontent-%COMP%] div.actions[_ngcontent-%COMP%]{margin-top:15px}html[dir=ltr][_ngcontent-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%]{padding-right:5px}html[dir=rtl][_ngcontent-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .linkIcon[_ngcontent-%COMP%]{padding-left:5px}.icon-container[_ngcontent-%COMP%]{display:block}html[dir=ltr][_ngcontent-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .icon-container[_ngcontent-%COMP%]{float:left;margin:0 12px 8px 0}html[dir=rtl][_ngcontent-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .icon-container[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .icon-container[_ngcontent-%COMP%]{float:right;margin:0 0 8px 12px}.icon-container[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:64px;height:64px;display:block}.promotion[_ngcontent-%COMP%]:after{content:"";display:table;clear:both}.action-button[_ngcontent-%COMP%]{clear:both}']}),i})();class te extends E{constructor(s="",e="",n=[],o=!1){super(s),this.version=s,this.currentHandler=e,this.availableHandlers=n,this.handlerIsChanging=o}}var O=(()=>{return(i=O||(O={})).ascending="asc",i.descending="desc",O;var i})();let ee=(()=>{class i{constructor(e){this.apiClient=e,this.handlerListSubject=new Q.X({done:!1,result:null})}fetchVersionHandlerList(){const e=new c.r(c.N.JsonApi,{method:"php_get_handlers"});return this.apiClient.get(e)}applyVersionHandler(e,n){const o=new c.r(c.N.JsonApi,{method:"php_set_handler",arguments:[new C.h("version",e),new C.h("handler",n)]});return this.apiClient.post(o)}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var m=g(4719);function ne(i,s){if(1&i&&t._UZ(0,"i",7),2&i){const e=t.oxw();t.Q6J("ngClass",e.sortDirectionClass())}}function ie(i,s){if(1&i&&t._UZ(0,"i",7),2&i){const e=t.oxw();t.Q6J("ngClass",e.sortDirectionClass())}}function oe(i,s){if(1&i&&(t.TgZ(0,"option",14),t._uU(1),t.qZA()),2&i){const e=s.$implicit;t.Q6J("ngValue",e),t.xp6(1),t.hij(" ",e," ")}}function se(i,s){1&i&&(t.TgZ(0,"div",15),t._UZ(1,"i",16),t.qZA())}function re(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"tr",9)(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td",10)(4,"select",11),t.NdJ("ngModelChange",function(o){return t.CHM(e).$implicit.currentHandler=o})("change",function(){const r=t.CHM(e).$implicit;return t.oxw(2).applyHandler(r.version,r.currentHandler)}),t.YNc(5,oe,2,2,"option",12),t.qZA(),t.YNc(6,se,2,0,"div",13),t.qZA()()}if(2&i){const e=s.$implicit;t.xp6(2),t.Oqu(e.formattedVersion),t.xp6(2),t.MGl("id","handlerDropdown_",e.version,""),t.Q2q("aria-label","handlerDropdown_",e.version,""),t.Q6J("ngModel",e.currentHandler)("disabled",e.handlerIsChanging),t.xp6(1),t.Q6J("ngForOf",e.availableHandlers),t.xp6(1),t.Q6J("ngIf",e.handlerIsChanging)}}function ae(i,s){if(1&i&&(t.ynx(0),t.YNc(1,re,7,7,"tr",8),t.BQk()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngForOf",e.installedPHPVersions)}}function le(i,s){if(1&i&&(t.TgZ(0,"tr",17)(1,"td",18),t._UZ(2,"span",19),t.TgZ(3,"span",20),t._uU(4),t.qZA()()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(e.locale.maketext("Loading [asis,PHP] Handlers \u2026"))}}let pe=(()=>{class i{constructor(e,n,o,r,l,d,P){this.locale=e,this.handlerService=n,this.alertService=o,this.phpHelper=r,this.phpVersionService=l,this.appDataService=d,this.sseService=P,this.lsapiInstalled=new t.vpe,this.sortDirection=O.ascending,this.installedPHPVersions=[],this.loadingPhpList=!0,this.columnToSort=""}ngOnInit(){this.fetchHandlers(),this.sseService.init(),this.sseSub=this.sseService.sseTask$.subscribe(e=>{"completed"===e.status&&this.fetchHandlers()})}ngOnDestroy(){this.sseSub?.unsubscribe()}fetchHandlers(){this.handlerService.fetchVersionHandlerList().subscribe(e=>{if(e.hasErrors)this.phpHelper.error(e);else if(this.phpVersionService.fetchPhpListSubject){this.phpVersionService.fetchPhpListSubject.subscribe(o=>{o.done&&(this.installedPHPVersions=this.convertToSystemVersions(o.result),this.populateHandlers(e.data))});const n=(0,u.includes)((0,u.uniq)((0,u.flatten)((0,u.map)(e.data,"available_handlers"))),"lsapi");this.lsapiInstalled.emit(n)}else this.installedPHPVersions=this.convertToSystemVersions(this.appDataService.installedPhpVersions),this.populateHandlers(e.data);this.loadingPhpList=!1})}populateHandlers(e){e.forEach(n=>{this.installedPHPVersions.forEach(o=>{o.version===n.version&&(o.availableHandlers=n.available_handlers,o.currentHandler=n.current_handler)})})}convertToSystemVersions(e){let n=[];return e&&null!==e&&(n=e.map(o=>new te(o.version))),n}applyHandler(e,n){const o=(0,u.find)(this.installedPHPVersions,["version",e]);o&&(o.handlerIsChanging=!0,this.handlerService.applyVersionHandler(e,n).subscribe(r=>{r.hasErrors?this.phpHelper.error(r):(o.currentHandler=n,this.alertService.success(this.locale.maketext("Successfully applied the \u201c[_1]\u201d [asis,PHP] handler to the \u201c[_2]\u201d package.",n,e))),o.handlerIsChanging=!1}))}sort(e){this.columnToSort=e,this.installedPHPVersions=(0,u.orderBy)(this.installedPHPVersions,"version"===e?"version":"currentHandler",this.sortDirection=this.sortDirection===O.ascending?O.descending:O.ascending)}sortDirectionClass(){return this.sortDirection===O.ascending?"icon-arrow-down":"icon-arrow-up"}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(ee),t.Y36(a.c9),t.Y36(F),t.Y36(v),t.Y36(W),t.Y36(st))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-system-handlers"]],outputs:{lsapiInstalled:"lsapiInstalled"},decls:14,vars:6,consts:[[1,"table","table-striped"],[1,"tableHeaders"],["id","versionSort",1,"headerBtn",3,"click"],["aria-hidden","true",3,"ngClass",4,"ngIf"],["id","handlerSort",1,"headerBtn",3,"click"],[4,"ngIf"],["class","info empty-row",4,"ngIf"],["aria-hidden","true",3,"ngClass"],["class","form-inline",4,"ngFor","ngForOf"],[1,"form-inline"],[1,"handlerDropdownColumn"],[1,"form-control","handlerDropdown",3,"id","ngModel","disabled","ngModelChange","change"],[3,"ngValue",4,"ngFor","ngForOf"],["class","processing-spinner",4,"ngIf"],[3,"ngValue"],[1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],[1,"info","empty-row"],["colspan","2","id","loadingRow"],[1,"fas","fa-spinner","fa-spin"],[1,"loading-text"]],template:function(e,n){1&e&&(t.TgZ(0,"table",0)(1,"thead",1)(2,"tr")(3,"th",2),t.NdJ("click",function(){return n.sort("version")}),t.TgZ(4,"a"),t._uU(5),t.qZA(),t.YNc(6,ne,1,1,"i",3),t.qZA(),t.TgZ(7,"th",4),t.NdJ("click",function(){return n.sort("handler")}),t.TgZ(8,"a"),t._uU(9),t.qZA(),t.YNc(10,ie,1,1,"i",3),t.qZA()()(),t.TgZ(11,"tbody"),t.YNc(12,ae,2,1,"ng-container",5),t.YNc(13,le,5,1,"tr",6),t.qZA()()),2&e&&(t.xp6(5),t.Oqu(n.locale.maketext("[asis,PHP] Version")),t.xp6(1),t.Q6J("ngIf","version"===n.columnToSort),t.xp6(3),t.Oqu(n.locale.maketext("[asis,PHP] Handler")),t.xp6(1),t.Q6J("ngIf","handler"===n.columnToSort),t.xp6(2),t.Q6J("ngIf",!n.loadingPhpList),t.xp6(1),t.Q6J("ngIf",n.loadingPhpList))},directives:[h.O5,h.mk,h.sg,m.EJ,m.JJ,m.On,m.YN,m.Kr],styles:[".table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{border-top:none!important}.tableHeaders[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{color:#428bca;font-weight:600}.handlerDropdown[_ngcontent-%COMP%]{width:60%}.handlerDropdownColumn[_ngcontent-%COMP%]{width:40%}.headerBtn[_ngcontent-%COMP%]:hover{cursor:pointer}html[dir=ltr][_ngcontent-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{padding-left:2px}html[dir=rtl][_ngcontent-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .headerBtn[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{padding-right:2px}html[dir=ltr][_ngcontent-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%]{padding-left:5px}html[dir=rtl][_ngcontent-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .handlerDropdownColumn[_ngcontent-%COMP%] > .processing-spinner[_ngcontent-%COMP%]{padding-right:5px}"]}),i})();function ce(i,s){if(1&i&&t._UZ(0,"multiphp-mgr-cloudlinux-banner",8),2&i){const e=t.oxw();t.Q6J("lsapiInstalled",e.lsapiInstalled)}}let lt=(()=>{class i{constructor(e,n,o){this.locale=e,this.phpService=n,this.phpHelper=o,this.systemFPMChange=new t.vpe,this.phpList=[],this.systemFPMInfo=new nt,this.fetchSystemPhpSubject=new Q.X({done:!1,result:null}),this.outdatedVersions=[],this.lsapiInstalled=!1}onSystemDefaultChange(e){this.fetchSystemPhpSubject.next({done:!0,result:e})}lsapiInstalledCheck(e){this.lsapiInstalled=e}ngOnInit(){this.fetchSystemPhp()}fetchSystemPhp(){this.phpService.getSystemDefault().subscribe(e=>{let n;e.hasErrors?this.phpHelper.error(e):n=e.data.version,this.fetchSystemPhpSubject.next({done:!0,result:n})})}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(z),t.Y36(F))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-system-settings"]],outputs:{systemFPMChange:"systemFPMChange"},decls:15,vars:4,consts:[[1,"systemSettingsSection"],[1,"row"],[1,"col-xs-12","col-md-10","col-lg-9"],[3,"fetchSystemPhpSubject","systemDefaultChange"],[3,"fetchSystemPhpSubject"],[1,"heading"],[1,"handlersSection"],[3,"lsapiInstalled",4,"ngIf"],[3,"lsapiInstalled"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"multiphp-mgr-system-php-settings",3),t.NdJ("systemDefaultChange",function(r){return n.onSystemDefaultChange(r)}),t.qZA()()(),t.TgZ(4,"div",1)(5,"div",2),t._UZ(6,"multiphp-mgr-system-fpm",4),t.qZA()(),t.TgZ(7,"div",5)(8,"h3"),t._uU(9),t.qZA()(),t.TgZ(10,"div",6)(11,"div",1)(12,"div",2),t.YNc(13,ce,1,1,"multiphp-mgr-cloudlinux-banner",7),t.TgZ(14,"multiphp-mgr-system-handlers",8),t.NdJ("lsapiInstalled",function(r){return n.lsapiInstalledCheck(r)}),t.qZA()()()()()),2&e&&(t.xp6(3),t.Q6J("fetchSystemPhpSubject",n.fetchSystemPhpSubject),t.xp6(3),t.Q6J("fetchSystemPhpSubject",n.fetchSystemPhpSubject),t.xp6(3),t.Oqu(n.locale.maketext("[asis,PHP] Handlers")),t.xp6(4),t.Q6J("ngIf",n.lsapiInstalled))},directives:[Zt,zt,h.O5,at,pe],styles:[".heading[_ngcontent-%COMP%]{border-bottom:1px solid #eaeaea;margin-top:40px}.handlersSection[_ngcontent-%COMP%]{margin-top:20px}"]}),i})();var D=g(755),he=g(5380),N=g(3357);class pt{constructor(s="",e="",n="",o="",r=!1,l=!1,d=_.disabled,P={},I="",A,J){this.account=s,this.accountOwner=e,this.documentRoot=n,this.homeDirectory=o,this.isSuspended=r,this.isMainDomain=l,this.fpmStatus=d,this.phpFpmPoolParams=P,this.phpVersionSource=I,this.phpVersion=A,this.vhost=J}}class de{constructor(s="",e){this.domain=s,this.model=e,this.phpVersionChangeInProcess=!1,this.displayDetails=!1,this.selected=!1,this.applyInheritButton={buttonClass:"btn btn-sm btn-primary",buttonState:a.FP.enabled},this.isInherit=!1,this.domainFpmToggle={toggleState:a.Yg.toggleOff,labelPosition:a.Gy.right,isDisabled:!1},this.showInheritPromptMessage="",this.showInheritPrompt=!1,this.inheritInProcess=!1,this.wantToInherit=!1}}let $=(()=>{class i{constructor(e,n,o){this.apiClient=e,this.phpVersionService=n,this.windowRef=o}getPhpDataForDomains(e){return this._getDomainPhpVersions(e)}getPhpDataForDomain(e){return this._getDomainPhpVersions({filters:[new N.w("vhost",N.p.Equal,e)]}).pipe((0,k.U)(n=>{if(n.success){const o=n.data[0];let r=this.phpVersionService.getPhpVersionDataByPackage(o.version);r=r||new E(o.version,this.windowRef),n.data=new pt(o.account,o.account_owner,o.documentroot,o.homedir,1===o.is_suspended,1===o.main_domain,1===o.php_fpm?_.enabled:_.disabled,o.php_fpm_pool_params,this.getInheritSource(o.phpversion_source,o.vhost),r,o.vhost)}return n}))}_getDomainPhpVersions(e){const n=new c.r(c.N.JsonApi,{method:"php_get_vhost_versions",...e});return this.apiClient.get(n)}getImpactedDomainsForDomain(e){return this._getImpactedDomains("domain",e)}getImpactedDomainsForSystem(){return this._getImpactedDomains("system_default",1)}applyPhpVersionToDomains(e,n){const o=e.map(l=>new C.h("vhost",l));o.push(new C.h("version",n));const r=new c.r(c.N.JsonApi,{method:"php_set_vhost_versions",arguments:o});return this.apiClient.post(r)}applyFPMToDomain(e,n){const o=new c.r(c.N.JsonApi,{method:"php_set_vhost_versions",arguments:[new C.h("php_fpm",n),new C.h("vhost",e)]});return this.apiClient.post(o)}bulkToggleFPMToDomains(e,n){const o=e.map(l=>new C.h("vhost",l));o.push(new C.h("php_fpm",n));const r=new c.r(c.N.JsonApi,{method:"php_set_vhost_versions",arguments:o});return this.apiClient.post(r)}setInheritToDomains(e){return this.applyPhpVersionToDomains(e,"inherit")}getInheritSource(e,n){let o="";if(e){const r=(0,u.keys)(e)[0];if((0,u.includes)(["system_default","domain"],r))switch(r){case"system_default":o="system_default";break;case"domain":n!==e.domain&&(o=e.domain)}}return o}_getImpactedDomains(e,n){const o=new c.r(c.N.JsonApi,{method:"php_get_impacted_domains",arguments:[new C.h(e,n)]});return this.apiClient.get(o)}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4),t.LFG(v),t.LFG(y))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();function ge(i,s){if(1&i&&(t.TgZ(0,"div",2)(1,"div",3)(2,"cp-callout",4)(3,"pre",5),t._uU(4),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(e.loadFailureMessage)}}function me(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",31)(1,"pagination",32),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw(2).pagination.currentPage=o})("pageChanged",function(o){return t.CHM(e),t.oxw(2).pageChanged(o)}),t.qZA(),t.TgZ(2,"p",33),t._uU(3),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("boundaryLinks",e.pagination.showBoundaryLinks)("ngModel",e.pagination.currentPage)("totalItems",e.pagination.totalItems)("maxSize",e.pagination.maxSize)("itemsPerPage",e.pagination.pageSize),t.xp6(2),t.Oqu(e.paginationDetailsText)}}function ue(i,s){1&i&&(t.TgZ(0,"span",34),t._UZ(1,"i",35),t.qZA())}function _e(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){return t.CHM(e),t.oxw(4).changePageSize()}),t._uU(1),t.qZA()}if(2&i){const e=s.$implicit;t.s9C("btnRadio",e),t.xp6(1),t.hij(" ",e," ")}}function fe(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"li",39)(1,"div",42),t._uU(2),t.qZA(),t.TgZ(3,"div",43),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw(3).pagination.pageSize=o}),t.YNc(4,_e,2,2,"button",44),t.qZA()()}if(2&i){const e=t.oxw(3);t.xp6(2),t.hij(" ",e.locale.maketext("Entries Per Page")," "),t.xp6(1),t.Q6J("ngModel",e.pagination.pageSize),t.xp6(1),t.Q6J("ngForOf",e.pagination.pageSizes)}}function Pe(i,s){1&i&&t._UZ(0,"li",46)}function Ce(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"ul",36),t.YNc(1,fe,5,3,"li",37),t.YNc(2,Pe,1,0,"li",38),t.TgZ(3,"li",39)(4,"a",40),t.NdJ("click",function(){return t.CHM(e),t.oxw(2).loadDomainList()}),t._UZ(5,"i",41),t._uU(6),t.qZA()()()}if(2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showPageSizeSelector),t.xp6(1),t.Q6J("ngIf",e.showPageSizeSelector),t.xp6(4),t.hij(" ",e.locale.maketext("Refresh")," ")}}function be(i,s){if(1&i&&t._UZ(0,"i"),2&i){const e=t.oxw(2).$implicit,n=t.oxw(2);t.Tol(n.sortDirClass),t.uIk("title",e.title)}}function xe(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"a",50),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit;return t.oxw(2).changeSort(o.key)}),t._UZ(1,"span",51),t._uU(2," \xa0 "),t.YNc(3,be,1,3,"i",52),t.qZA()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.title,t.oJD),t.xp6(2),t.Q6J("ngIf",e.key===n.tableMetaData.sorts[0].column)}}function Me(i,s){if(1&i&&t._UZ(0,"span",51),2&i){const e=t.oxw().$implicit;t.Q6J("innerHtml",e.title,t.oJD)}}function ve(i,s){if(1&i&&(t.TgZ(0,"th",47),t.YNc(1,xe,4,2,"a",48),t.YNc(2,Me,1,1,"span",49),t.qZA()),2&i){const e=s.$implicit;t.Q6J("ngClass",e.cssClasses),t.xp6(1),t.Q6J("ngIf",e.isSortable),t.xp6(1),t.Q6J("ngIf",!e.isSortable&&""!==e.title)}}function Oe(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"tr",57)(1,"td",58),t.NdJ("inheritStateChanged",function(o){return t.CHM(e),t.oxw(4).onInheritStateChanged(o)})("rowPhpVersionChanged",function(o){return t.CHM(e),t.oxw(4).onRowPhpVersionChanged(o)})("confirmInheritStateChanged",function(o){return t.CHM(e),t.oxw(4).performInheritPhp(o)})("cancelInheritStateChange",function(o){return t.CHM(e),t.oxw(4).cancelPerformInheritPhp(o)}),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(3);t.MGl("id","",e.model.vhost,"-domain-details-row"),t.xp6(1),t.Q6J("rowData",e),t.uIk("colspan",n.emptyRowColSpan)}}function we(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"tr",59)(1,"td")(2,"multiphp-mgr-inherit-warning",60),t.NdJ("confirmInheritStateChanged",function(o){return t.CHM(e),t.oxw(4).performInheritPhp(o)})("cancelInheritStateChange",function(o){return t.CHM(e),t.oxw(4).cancelPerformInheritPhp(o)}),t.qZA()()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(3);t.MGl("id","",e.model.vhost,"-domain-inherit-prompt-row"),t.xp6(1),t.uIk("colspan",n.emptyRowColSpan),t.xp6(1),t.Q6J("rowData",e)}}function Se(i,s){if(1&i){const e=t.EpF();t.ynx(0),t.TgZ(1,"tr",54),t.NdJ("rowSelectionChanged",function(o){return t.CHM(e),t.oxw(3).onRowSelectionChanged(o)})("rowPhpVersionChanged",function(o){return t.CHM(e),t.oxw(3).onRowPhpVersionChanged(o)})("inheritStateChanged",function(o){return t.CHM(e),t.oxw(3).onInheritStateChanged(o)}),t.qZA(),t.YNc(2,Oe,2,3,"tr",55),t.YNc(3,we,3,3,"tr",56),t.BQk()}if(2&i){const e=s.$implicit;t.xp6(1),t.MGl("id","",e.model.vhost,"-domain-list-row"),t.Q6J("rowData",e),t.xp6(1),t.Q6J("ngIf",e.displayDetails),t.xp6(1),t.Q6J("ngIf",e.showInheritPrompt&&!e.displayDetails)}}function ke(i,s){if(1&i&&(t.TgZ(0,"tbody"),t.YNc(1,Se,4,4,"ng-container",53),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.displayRows)}}function Te(i,s){if(1&i&&(t.TgZ(0,"tbody")(1,"tr",61)(2,"td"),t._uU(3),t.qZA()()()),2&i){const e=t.oxw(2);t.xp6(2),t.uIk("colspan",e.emptyRowColSpan),t.xp6(1),t.hij(" ",e.locale.maketext("The account list is empty.")," ")}}function Fe(i,s){if(1&i&&(t.TgZ(0,"tbody")(1,"tr",62)(2,"td"),t._uU(3),t.qZA()()()),2&i){const e=t.oxw(2);t.xp6(2),t.uIk("colspan",e.emptyRowColSpan),t.xp6(1),t.hij(" ",e.locale.maketext("No results match your query.")," ")}}function ye(i,s){if(1&i&&(t.TgZ(0,"tbody")(1,"tr",63)(2,"td"),t._UZ(3,"span",64),t.TgZ(4,"span",65),t._uU(5),t.qZA()()()()),2&i){const e=t.oxw(2);t.xp6(2),t.uIk("colspan",e.emptyRowColSpan),t.xp6(3),t.Oqu(e.locale.maketext("Loading domains with [asis,PHP] versions \u2026"))}}function De(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",66)(1,"p",33),t._uU(2),t.qZA(),t.TgZ(3,"pagination",67),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw(2).pagination.currentPage=o})("pageChanged",function(o){return t.CHM(e),t.oxw(2).pageChanged(o)}),t.qZA()()}if(2&i){const e=t.oxw(2);t.xp6(2),t.Oqu(e.paginationDetailsText),t.xp6(1),t.Q6J("boundaryLinks",e.pagination.showBoundaryLinks)("ngModel",e.pagination.currentPage)("totalItems",e.pagination.totalItems)("maxSize",e.pagination.maxSize)("itemsPerPage",e.pagination.pageSize)}}function Ie(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",2)(1,"div",3)(2,"div",2)(3,"div",6)(4,"cp-search",7),t.NdJ("valueChange",function(o){return t.CHM(e),t.oxw().changeFilter(o)}),t.qZA()(),t.TgZ(5,"div",8),t.YNc(6,me,4,6,"div",9),t.qZA()(),t.TgZ(7,"div",10)(8,"div",3)(9,"div",11)(10,"div",12)(11,"label",13)(12,"input",14),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selectAllState=o})("change",function(){return t.CHM(e),t.oxw().toggleSelectAll()}),t.qZA()()(),t.TgZ(13,"multiphp-mgr-php-dropdown",15),t.NdJ("phpVersionChanged",function(o){return t.CHM(e),t.oxw().changePhpVersion(o)}),t.qZA(),t.YNc(14,ue,2,0,"span",16),t.TgZ(15,"cp-action-button",17),t.NdJ("click",function(){return t.CHM(e),t.oxw().bulkApplyInherit()}),t._uU(16),t.qZA(),t.TgZ(17,"cp-action-button",18),t.NdJ("click",function(){return t.CHM(e),t.oxw().bulkDisablePhpFpm()}),t._uU(18),t.qZA()(),t.TgZ(19,"div",19)(20,"div",20)(21,"button",21),t._UZ(22,"i",22)(23,"span",23),t.qZA(),t.YNc(24,Ce,7,3,"ul",24),t.qZA()()()(),t.TgZ(25,"section",25)(26,"table",26)(27,"thead")(28,"tr"),t.YNc(29,ve,3,3,"th",27),t.qZA()(),t.YNc(30,ke,2,1,"tbody",28),t.YNc(31,Te,4,2,"tbody",28),t.YNc(32,Fe,4,2,"tbody",28),t.YNc(33,ye,6,2,"tbody",28),t.qZA()(),t.TgZ(34,"div",29)(35,"div",3),t.YNc(36,De,4,6,"div",30),t.qZA()()()()}if(2&i){const e=t.oxw();t.xp6(4),t.s9C("label",e.searchHelpText),t.s9C("placeholder",e.searchHelpText),t.xp6(2),t.Q6J("ngIf",e.pagination.show),t.xp6(6),t.Q6J("ngModel",e.selectAllState),t.uIk("aria-label",e.locale.maketext("Select all rows.")),t.xp6(1),t.Q6J("buttonText",e.locale.maketext("Set [asis,PHP] Version"))("disabled",e.disableBulkPhpDropdown),t.xp6(1),t.Q6J("ngIf",e.processingBulkPhpDropdown),t.xp6(1),t.Q6J("buttonClass",e.bulkInheritPhpButton.buttonClass)("buttonState",e.bulkInheritButtonState),t.xp6(1),t.hij(" ",e.locale.maketext("Set Inherit")," "),t.xp6(1),t.Q6J("buttonClass",e.bulkDisablePhpFpmButton.buttonClass)("buttonState",e.bulkDisablePhpFpmButtonState),t.xp6(1),t.hij(" ",e.locale.maketext("Disable [asis,PHP-FPM]")," "),t.xp6(3),t.uIk("aria-label",e.locale.maketext("Table Settings")),t.xp6(8),t.Q6J("ngForOf",e.tableHeaders),t.xp6(1),t.Q6J("ngIf",e.showList),t.xp6(1),t.Q6J("ngIf",e.showWhenListIsEmpty),t.xp6(1),t.Q6J("ngIf",e.showWhenSearchIsEmpty),t.xp6(1),t.Q6J("ngIf",e.showLoadingMessage),t.xp6(3),t.Q6J("ngIf",e.pagination.show)}}let q=(()=>{class i{constructor(e,n,o,r,l,d){this.locale=e,this.domainPhpService=n,this.phpHelper=o,this.alertService=r,this.phpVersionService=l,this.windowRef=d,this.displayRows=[],this.domainList=[],this.loadingData=!0,this.loadFailureMessage="",this.searchHelpText="",this.pagination={pageSizes:[20,50,100,500,1e3],currentPage:1,pageSize:20,showBoundaryLinks:!0,maxSize:5,start:1,limit:1,show:!1,totalItems:0},this.tableMetaData={sorts:[new D.PE("vhost",D.Sr.Ascending)],pager:new he.uE(this.pagination.currentPage,this.pagination.pageSize)},this.selectAllState=!1,this.checkedCount=0,this.processingBulkPhpDropdown=!1,this.bulkInheritPhpButton={buttonClass:"btn btn-sm btn-default button-bar",buttonState:a.FP.disabled},this.bulkDisablePhpFpmButton={buttonClass:"btn btn-sm btn-default button-bar",buttonState:a.FP.disabled}}get sortDirClass(){return this.tableMetaData.sorts[0].direction===D.Sr.Ascending?"icon-arrow-up":"icon-arrow-down"}get showLoadingMessage(){return this.loadingData&&""===this.loadFailureMessage}get showFailureMessageOnLoad(){return!this.loadingData&&""!==this.loadFailureMessage}get showContent(){return!this.loadingData&&""===this.loadFailureMessage}get showWhenSearchIsEmpty(){return!this.loadingData&&0===this.domainList.length&&0!==this.tableMetaData.filters?.length}get showWhenListIsEmpty(){return!this.loadingData&&0===this.domainList.length&&0===this.tableMetaData.filters?.length}get emptyRowColSpan(){return this.tableHeaders.length+1}get showList(){return!this.loadingData&&this.displayRows.length>0}get showPageSizeSelector(){return this.pagination.totalItems>(0,u.min)(this.pagination.pageSizes)}get disableBulkPhpDropdown(){return 0===this.checkedCount||this.processingBulkPhpDropdown}get bulkInheritButtonState(){return this.bulkInheritPhpButton.buttonState===a.FP.loading?this.bulkInheritPhpButton.buttonState:0===this.checkedCount?a.FP.disabled:a.FP.enabled}get bulkDisablePhpFpmButtonState(){return this.bulkDisablePhpFpmButton.buttonState===a.FP.loading?this.bulkDisablePhpFpmButton.buttonState:this._activateDisablePhpFpmButtonState()?a.FP.enabled:a.FP.disabled}get paginationDetailsText(){return this.locale.maketext("[_1] - [_2] of [_3][comment,Table pagination details. Example: 1 - 20 of 300]",this.pagination.start,this.pagination.limit,this.pagination.totalItems)}ngOnInit(){this.tableHeaders=[{key:"checkbox",title:"",cssClasses:["bulkAction","hidden-xs"],isSortable:!1},{key:"vhost",title:this.locale.maketext("Domain"),cssClasses:["domain-column-header"],isSortable:!0},{key:"account",title:this.locale.maketext("Account"),cssClasses:["hidden-xs","account"],isSortable:!0},{key:"version",title:this.locale.maketext("PHP Version"),cssClasses:["hidden-xs","phpVersion"],isSortable:!0},{key:"fpmStatus",title:this.locale.maketext("[asis,PHP-FPM][comment,This is title.]"),cssClasses:["hidden-xs","phpFpm"],isSortable:!1},{key:"actions",title:"",cssClasses:[],isSortable:!1}],this.searchHelpText=this.locale.maketext("Search for domain or user"),this.loadDomainList()}changeFilter(e){this.tableMetaData.filters=[new N.w("*",N.p.Contains,e)],1!==this.pagination.currentPage?(this.pagination.currentPage=1,this.tableMetaData.pager.page=this.pagination.currentPage):this.loadDomainList()}loadDomainList(){this.loadingData=!0,this.domainPhpService.getPhpDataForDomains(this.tableMetaData).subscribe(e=>{e.success?(this.domainList=e.data.map(o=>{let r=this.phpVersionService.getPhpVersionDataByPackage(o.version);return r=r||new E(o.version,this.windowRef),new pt(o.account,o.account_owner,o.documentroot,o.homedir,1===o.is_suspended,1===o.main_domain,1===o.php_fpm?_.enabled:_.disabled,o.php_fpm_pool_params,this.domainPhpService.getInheritSource(o.phpversion_source,o.vhost),r,o.vhost)}),this.displayRows=this.domainList.map(o=>new de(o.vhost,o)),this._updatePaginationMetadata(e.meta),this.checkedCount=0,this.selectAllState=!1):e.hasErrors&&e.errors.length>0&&this.phpHelper.error(e),this.loadingData=!1},e=>{this.loadFailureMessage=e,this.loadingData=!1},()=>{this.loadingData=!1})}changeSort(e){if(this.tableMetaData.sorts){const n=this.tableMetaData.sorts.findIndex(o=>o.column===e);if(-1!==n)return this.tableMetaData.sorts[n].direction=this.tableMetaData.sorts[n].direction===D.Sr.Ascending?D.Sr.Descending:D.Sr.Ascending,void this.loadDomainList()}this.tableMetaData.sorts=[new D.PE(e,D.Sr.Descending)],this.loadDomainList()}toggleSelectAll(){0!==this.domainList.length&&(this.checkedCount=this.selectAllState?this.domainList.length:0,(0,u.each)(this.displayRows,e=>{e.selected=this.selectAllState}))}onRowSelectionChanged(e){e.selected?this.checkedCount++:this.checkedCount--,this.selectAllState=this.checkedCount===this.domainList.length}onRowPhpVersionChanged(e){e.phpVersionChangeInProcess=!0,this.domainPhpService.applyPhpVersionToDomains([e.domain],e.model.phpVersion.version).subscribe(n=>{n.success?this.domainPhpService.getImpactedDomainsForDomain(e.domain).subscribe(o=>{o.success?(this.updatePhpVersionForImpactedDomains(o.data,e.model.phpVersion),this.alertService.success(this.locale.maketext("The default [asis,PHP] version for \u201c[_1]\u201d has been set to \u201c[_2]\u201d.",e.domain,e.model.phpVersion.version))):this.phpHelper.error(o)}):this.phpHelper.error(n),e.phpVersionChangeInProcess=!1})}updatePhpVersionForImpactedDomains(e,n){if(e)for(let o=0;o<=e.length;o++){const r=(0,u.find)(this.displayRows,["model.vhost",e[o]]);!r||(r.model.phpVersion=n)}}onInheritStateChanged(e){e.showInheritPrompt=!0,e.wantToInherit?e.showInheritPromptMessage=this.locale.maketext("You are setting the domain \u201c[output,strong,_1]\u201d to \u201c[output,strong,Inherit]\u201d its [asis,PHP] version.",e.model.vhost):(e.showInheritPromptMessage=this.locale.maketext("You are attempting to move from inheriting the [asis,PHP] version \u201c[output,strong,_1]\u201d from \u201c[output,strong,_2]\u201d. Your [asis,PHP] version will no longer be in sync with \u201c[output,strong,_2]\u201d once you move.",e.model.phpVersion.formattedVersion,e.model.phpVersionSource),e.newPhpVersionToMoveFromInherit=e.model.phpVersion)}performInheritPhp(e){if(e.applyInheritButton.buttonState=a.FP.loading,e.wantToInherit)this.domainPhpService.setInheritToDomains([e.model.vhost]).pipe((0,G.x)(()=>{e.applyInheritButton.buttonState=a.FP.enabled})).subscribe(n=>{n.success?(e.isInherit=e.wantToInherit,this.domainPhpService.getPhpDataForDomain(e.model.vhost).subscribe(o=>{o.success?(e.model=o.data,this.domainPhpService.getImpactedDomainsForDomain(e.model.vhost).subscribe(r=>{r.success?this.updatePhpVersionForImpactedDomains(r.data,e.model.phpVersion):this.phpHelper.error(r)}),this.alertService.success(this.locale.maketext("The domain \u201c[_1]\u201d now inherits the \u201c[_2]\u201d [asis,PHP] version from \u201c[_3]\u201d.",e.model.vhost,e.model.phpVersion.formattedVersion,e.model.phpVersionSource))):o.hasErrors&&o.errors.length>0&&(this.phpHelper.error(o),this.alertService.error("Could not retrieve updated domain data. Try to refresh the table to get updated information.")),this._resetInheritPhp(e)})):(this.phpHelper.error(n),this.cancelPerformInheritPhp(e))},()=>{this.cancelPerformInheritPhp(e)});else{const n=e.model.vhost,o=e.newPhpVersionToMoveFromInherit;this.domainPhpService.applyPhpVersionToDomains([n],o.version).pipe((0,G.x)(()=>{e.applyInheritButton.buttonState=a.FP.enabled})).subscribe(r=>{r.success?(this.domainPhpService.getImpactedDomainsForDomain(n).subscribe(l=>{l.success?this.updatePhpVersionForImpactedDomains(l.data,o):this.phpHelper.error(l)}),this.alertService.success(this.locale.maketext("The domain \u201c[_1]\u201d no longer inherits the [asis,PHP] version. It is now set to \u201c[_2]\u201d.",n,o.formattedVersion)),e.model.phpVersion=o,e.isInherit=e.wantToInherit,e.domainFpmToggle.toggleState=e.model.fpmStatus===_.enabled?a.Yg.toggleOn:a.Yg.toggleOff,this._resetInheritPhp(e)):(this.phpHelper.error(r),this.cancelPerformInheritPhp(e))},()=>{this.cancelPerformInheritPhp(e)})}}cancelPerformInheritPhp(e){e.isInherit=e.wantToInherit=!e.wantToInherit,this._resetInheritPhp(e)}changePageSize(){this.pagination.pageSize=Number(this.pagination.pageSize),this.pagination.currentPage=1,this.tableMetaData.pager.pageSize=this.pagination.pageSize,this.tableMetaData.pager.page=this.pagination.currentPage,this.loadDomainList()}pageChanged(e){this.pagination.currentPage=e.page,this.tableMetaData.pager.page=this.pagination.currentPage,this.loadDomainList()}changePhpVersion(e){this.processingBulkPhpDropdown=!0;const n=(0,u.map)((0,u.filter)(this.displayRows,["selected",!0]),o=>o.model.vhost);this.domainPhpService.applyPhpVersionToDomains(n,e.version).subscribe(o=>{o.hasErrors?this.phpHelper.error(o):(this.alertService.success(this.locale.maketext("The [asis,PHP] version \u201c[_1]\u201d has been applied to all selected domains.",e.formattedVersion)),this.loadDomainList(),this.selectAllState=!1),this.processingBulkPhpDropdown=!1})}bulkApplyInherit(){const e=(0,u.map)((0,u.filter)(this.displayRows,["selected",!0]),n=>n.model.vhost);e?.length>0&&(this.bulkInheritPhpButton.buttonState=a.FP.loading,this.domainPhpService.setInheritToDomains(e).subscribe(n=>{n.success?(this.alertService.success(this.locale.maketext("The selected domains now inherit a [asis,PHP] version. You can see the inherited [asis,PHP] version in each domain\u2019s row in the table.")),this.loadDomainList()):this.phpHelper.error(n),this.bulkInheritPhpButton.buttonState=a.FP.enabled}))}bulkDisablePhpFpm(){const e=(0,u.filter)(this.displayRows,["selected",!0]);if(e?.length>0&&this._activateDisablePhpFpmButtonState(e)){const n=(0,u.map)(e,o=>o.model.vhost);this.bulkDisablePhpFpmButton.buttonState=a.FP.loading,this.domainPhpService.bulkToggleFPMToDomains(n,_.disabled).subscribe(o=>{o.success?(this.alertService.success(this.locale.maketext("[asis,PHP-FPM] is disabled on the selected domains.")),this.loadDomainList()):this.phpHelper.error(o),this.bulkDisablePhpFpmButton.buttonState=a.FP.enabled})}}updateNewPhpVersionInDomainRow(e,n){n.newPhpVersionToMoveFromInherit=e}gotoPhpFpmSettings(){this.phpHelper.routeTo("system/fpm-settings")}_activateDisablePhpFpmButtonState(e){e||(e=(0,u.filter)(this.displayRows,["selected",!0]));let n=!1;return n=(0,u.some)(e,o=>!o.isInherit&&this.phpVersionService.isPhpFpmInstalled(`${o.model.phpVersion.version}-php-fpm`)&&o.model.fpmStatus===_.enabled),n}_resetInheritPhp(e){e.showInheritPrompt=!1,e.showInheritPromptMessage="",e.inheritInProcess=!1,e.applyInheritButton.buttonState=a.FP.enabled}_updatePaginationMetadata(e){this.pagination.totalItems=e.totalRecords,this.pagination.totalItems>(0,u.min)(this.pagination.pageSizes)?(this.pagination.show=!0,this.pagination.start=e.record,this.pagination.limit=Math.min(this.pagination.totalItems,this.pagination.start-1+this.pagination.pageSize)):(this.pagination.show=!1,this.pagination.start=0===this.pagination.totalItems?0:1,this.pagination.limit=this.pagination.totalItems)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36($),t.Y36(F),t.Y36(a.c9),t.Y36(v),t.Y36(y))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-domain-list"]],decls:3,vars:2,consts:[["id","user-domain-list"],["class","row",4,"ngIf"],[1,"row"],[1,"col-xs-12"],["id","loadFailureMessage","calloutType","danger"],[1,"unlink-error-pre"],[1,"col-xs-12","col-sm-6","col-md-4","padding-bottom-20"],["id","searchDomainList","autofocus","true",3,"label","placeholder","valueChange"],[1,"col-xs-12","col-sm-6","col-md-8","padding-bottom-20"],["class","pagination-container hidden-xs hidden-sm",4,"ngIf"],[1,"row","action-bar"],[1,"pull-left","flip","hidden-xs"],[1,"table-action-button-container"],[1,"table-action-button-label","table-action-button-sm"],["type","checkbox","name","checkAllInList","id","checkAllInList",3,"ngModel","ngModelChange","change"],["id","bulk-domain-php",3,"buttonText","disabled","phpVersionChanged"],["id","bulk-domain-php-processing-spinner","class","processing-spinner",4,"ngIf"],["id","bulk-inherit-php","title","[% locale.maketext('Set multiple selected domains to Inherit their [asis,PHP] version.') %]",3,"buttonClass","buttonState","click"],["id","bulk-disable-php-fpm","title","[% locale.maketext('Disable [asis,PHP-FPM] on multiple selected domains.') %]",3,"buttonClass","buttonState","click"],[1,"pull-right","flip"],["dropdown","","auto-close","outsideClick",1,"btn-group","pull-right"],["id","table-settings-dropdown","type","button","dropdownToggle","",1,"btn","btn-default","btn-sm","dropdown-toggle","button-bar"],[1,"fas","fa-cog"],[1,"caret"],["id","table-settings-menu","class","dropdown-menu dropdown-menu-right","role","menu","aria-labelledby","table-settings-dropdown",4,"dropdownMenu"],[1,"list-section"],["id","user-domain-table",1,"table","table-striped","responsive-table","details-table"],[3,"ngClass",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"row","visible-sm-block","visible-xs-block","hidden-lg","hidden-md"],["class","pagination-container pull-right flip",4,"ngIf"],[1,"pagination-container","hidden-xs","hidden-sm"],["firstText","\u2039\u2039","lastText","\u203a\u203a","previousText","\u2039","nextText","\u203a","id","user-domain-pagination",3,"boundaryLinks","ngModel","totalItems","maxSize","itemsPerPage","ngModelChange","pageChanged"],[1,"text-small"],["id","bulk-domain-php-processing-spinner",1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],["id","table-settings-menu","role","menu","aria-labelledby","table-settings-dropdown",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem",4,"ngIf"],["class","divider",4,"ngIf"],["role","menuitem"],[3,"click"],[1,"fas","fa-sync-alt"],[1,"text-small","text-uppercase"],["btnRadioGroup","","role","group",1,"btn-group","pageSizeButtons",3,"ngModel","ngModelChange"],["type","button","class","btn btn-default btn-sm",3,"btnRadio","click",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-default","btn-sm",3,"btnRadio","click"],[1,"divider"],[3,"ngClass"],["class","sort-link","href","javascript:void(0)",3,"click",4,"ngIf"],[3,"innerHtml",4,"ngIf"],["href","javascript:void(0)",1,"sort-link",3,"click"],[3,"innerHtml"],[3,"class",4,"ngIf"],[4,"ngFor","ngForOf"],["multiphp-mgr-user-domain","",1,"data-row",3,"id","rowData","rowSelectionChanged","rowPhpVersionChanged","inheritStateChanged"],["class","expand-panel-data",3,"id",4,"ngIf"],["class","empty-row",3,"id",4,"ngIf"],[1,"expand-panel-data",3,"id"],["multiphp-mgr-user-domain-details","",3,"rowData","inheritStateChanged","rowPhpVersionChanged","confirmInheritStateChanged","cancelInheritStateChange"],[1,"empty-row",3,"id"],["calloutCss","rowCalloutCss",3,"rowData","confirmInheritStateChanged","cancelInheritStateChange"],["id","emptyListRow",1,"info","empty-row"],["id","emptySearchRow",1,"info","empty-row"],["id","loadingRow",1,"info","empty-row"],[1,"fas","fa-spinner","fa-spin"],[1,"loading-text"],[1,"pagination-container","pull-right","flip"],["firstText","\u2039\u2039","lastText","\u203a\u203a","previousText","\u2039","nextText","\u203a","id","user-domain-pagination-bottom",3,"boundaryLinks","ngModel","totalItems","maxSize","itemsPerPage","ngModelChange","pageChanged"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0),t.YNc(1,ge,5,1,"div",1),t.YNc(2,Ie,37,21,"div",1),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",n.showFailureMessageOnLoad),t.xp6(1),t.Q6J("ngIf",!n.showFailureMessageOnLoad))},styles:["html[dir=ltr][_ngcontent-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%]{padding-left:44px}html[dir=rtl][_ngcontent-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .domain-column-header[_ngcontent-%COMP%]{padding-right:44px}.actionButton[_ngcontent-%COMP%]{text-align:center}.processing-spinner[_ngcontent-%COMP%]{padding:0 5px}.padding-bottom-20[_ngcontent-%COMP%]{padding-bottom:20px}"]}),i})(),ct=(()=>{class i{constructor(){}ngOnInit(){}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-domain-settings"]],decls:1,vars:0,template:function(e,n){1&e&&t._UZ(0,"multiphp-mgr-domain-list")},directives:[q],styles:[""]}),i})();var Y=g(835),f=(()=>{return(i=f||(f={}))[i.system=0]="system",i[i.domain=1]="domain",f;var i})(),p=(()=>{return(i=p||(p={})).maxRequests="pm_max_requests",i.maxChildren="pm_max_children",i.processIdleTimeout="pm_process_idle_timeout",i.allowUrlFopen="allow_url_fopen",i.logErrors="log_errors",i.shortOpenTag="short_open_tag",i.docroot="doc_root",i.errorLog="error_log",i.disableFunctions="disable_functions",i.errorReporting="error_reporting",p;var i})();class Ze{constructor(s=f.system,e="",n=0,o=0,r=0,l={value:!1,canOverride:!1},d={value:!1,canOverride:!1},P={value:!1,canOverride:!1},I={value:"",canOverride:!1,helpText:""},A={value:"",canOverride:!1,helpText:""},J={value:[],canOverride:!1},Jn={value:"",canOverride:!1}){this.type=s,this.domain=e,this.maxRequests=n,this.maxChildren=o,this.processIdleTimeout=r,this.allowUrlFopen=l,this.shortOpenTag=d,this.logErrors=P,this.errorLog=I,this.docroot=A,this.disableFunctions=J,this.errorReporting=Jn}}let He=(()=>{class i{constructor(e,n){this.apiClient=e,this.phpVersionService=n}getSystemPhpFpmSettings(){return this.getPhpFpmSettings("").pipe((0,k.U)(e=>{if(e.success){const n=this._buildPhpFpmSettingsModel(f.system,this._parsePhpFpmData(f.system,e.data.config,""));e.data=n}return e}))}getDomainPhpFpmSettings(e){return this.getPhpFpmSettings(e.vhost).pipe((0,k.U)(n=>{if(n.success){const o=this._buildPhpFpmSettingsModel(f.domain,this._parsePhpFpmData(f.domain,n.data.config,e.vhost),e);n.data=o}return n}))}getPhpFpmSettings(e){const n={method:"php_fpm_config_get",arguments:[new C.h("domain",e)],config:{json:!0}},o=new c.r(c.N.JsonApi,n);return this.apiClient.post(o)}updatePhpFpmSettings(e){return this.callFpmConfigApi(e,!1)}validatePhpFpmSettings(e){return this.callFpmConfigApi(e,!0)}callFpmConfigApi(e,n){const o=new c.r(c.N.JsonApi,{method:"php_fpm_config_set",arguments:[new C.h("domain",e.domain),new C.h("validate_only",n),new C.h("config",this._encodePhpFpmConfig(e))],config:{json:!0}});return this.apiClient.post(o)}_encodePhpFpmConfig(e){const n=[];return n.push(this._encodePoolOption(p.maxRequests,e.maxRequests)),n.push(this._encodePoolOption(p.maxChildren,e.maxChildren)),n.push(this._encodePoolOption(p.processIdleTimeout,e.processIdleTimeout)),n.push(this._encodePoolOption(p.allowUrlFopen,e.allowUrlFopen)),n.push(this._encodePoolOption(p.logErrors,e.logErrors)),n.push(this._encodePoolOption(p.shortOpenTag,e.shortOpenTag)),n.push(this._encodePoolOption(p.docroot,e.docroot)),n.push(this._encodePoolOption(p.errorLog,e.errorLog)),n.push(this._encodePoolOption(p.disableFunctions,e.disableFunctions)),n.push(this._encodePoolOption(p.errorReporting,e.errorReporting)),n}_encodePoolOption(e,n){const o={};switch(o.base_flag_name=e,e){case p.maxRequests:case p.maxChildren:case p.processIdleTimeout:o.value=n,o.trinary_admin_value=0;break;case p.allowUrlFopen:case p.logErrors:case p.shortOpenTag:const r=n;o.value=r.value?"on":"off",o.trinary_admin_value=this._encodeTrinaryAdminValue(r.canOverride);break;case p.docroot:const l=n;o.value=l.value,o.trinary_admin_value=this._encodeTrinaryAdminValue(l.canOverride);break;case p.errorLog:const d=n,P="[% homedir %]/logs",I="[% scrubbed_domain %].php.error.log";o.value=""===d.value?`${P}/${I}`:`${P}/${d.value}`,o.trinary_admin_value=this._encodeTrinaryAdminValue(d.canOverride);break;case p.disableFunctions:const A=n.value?n:{value:[],canOverride:!1};o.value=A.value.join(","),o.trinary_admin_value=this._encodeTrinaryAdminValue(A.canOverride);break;case p.errorReporting:const J=n;o.value=J.value,o.trinary_admin_value=this._encodeTrinaryAdminValue(J.canOverride)}return o}_encodeTrinaryAdminValue(e){let n=0;return n=e?1:2,n}_parsePhpFpmData(e,n,o){const r={};return n.forEach(l=>{r[l.base_flag_name]=this._parseOption(e,l,o)}),r}_parseOption(e,n,o){let r={};if(n.base_flag_name===p.maxChildren||n.base_flag_name===p.processIdleTimeout||n.base_flag_name===p.maxRequests){const l=parseInt(n.value,10);isNaN(l)?console.error(`Invalid number ${n.value} is returned for ${n.base_flag_name}.`):r={value:l}}else if(n.base_flag_name===p.allowUrlFopen||n.base_flag_name===p.logErrors||n.base_flag_name===p.shortOpenTag){let l=!1;"on"===n.value?l=!0:"off"===n.value?l=!1:console.error(`Invalid value \u2018${n.value}\u2019 is returned for \u2018${n.base_flag_name}\u2019.`),r={value:l,admin:this._convertTrinaryAdminValueToBinary(n.trinary_admin_value)}}else if(n.base_flag_name===p.docroot)e===f.domain&&(r={value:n.value,admin:this._convertTrinaryAdminValueToBinary(n.trinary_admin_value)});else if(n.base_flag_name===p.errorLog){if(e===f.domain){let l=n.value;if("string"!=typeof l)l="";else{const d=o.replace(/\./,"_");l=l.replace(/^\[% homedir %\]\/logs\//,""),l=l.replace(/^\[% scrubbed_domain %\]/,d)}r={value:l,admin:this._convertTrinaryAdminValueToBinary(n.trinary_admin_value)}}}else if(n.base_flag_name===p.disableFunctions){const l=n.value;let d=[];"string"==typeof l&&""!==l&&(d=l.split(",").map(P=>P.trim()),r={value:d,admin:this._convertTrinaryAdminValueToBinary(n.trinary_admin_value)})}else n.base_flag_name===p.errorReporting&&(r={value:n.value,admin:this._convertTrinaryAdminValueToBinary(n.trinary_admin_value)});return r}_convertTrinaryAdminValueToBinary(e){let n=!1;return 1===e?n=!0:2===e&&(n=!1),n}_buildPhpFpmSettingsModel(e,n,o){const r=new Ze(e);return r.maxRequests=n[p.maxRequests]?n[p.maxRequests].value:0,r.maxChildren=n[p.maxChildren]?n[p.maxChildren].value:0,r.processIdleTimeout=n[p.processIdleTimeout]?n[p.processIdleTimeout].value:0,n[p.allowUrlFopen]&&(r.allowUrlFopen.value=n[p.allowUrlFopen].value,r.allowUrlFopen.canOverride=n[p.allowUrlFopen].admin),n[p.logErrors]&&(r.logErrors.value=n[p.logErrors].value,r.logErrors.canOverride=n[p.logErrors].admin),n[p.shortOpenTag]&&(r.shortOpenTag.value=n[p.shortOpenTag].value,r.shortOpenTag.canOverride=n[p.shortOpenTag].admin),n[p.disableFunctions]&&(r.disableFunctions.value=n[p.disableFunctions].value,r.disableFunctions.canOverride=n[p.disableFunctions].admin),n[p.errorReporting]&&(r.errorReporting.value=n[p.errorReporting].value,r.errorReporting.canOverride=n[p.errorReporting].admin),e===f.domain&&(r.domain=o.vhost,n[p.errorLog]&&(r.errorLog.value=n[p.errorLog].value,r.errorLog.canOverride=n[p.errorLog].admin,r.errorLog.helpText=`${o.homeDirectory}/logs`),n[p.docroot]&&(r.docroot.value=n[p.docroot].value,r.docroot.canOverride=n[p.docroot].admin)),r}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4),t.LFG(v))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();const Ae=[[["","form-field-label",""]],[["","form-field-control",""]],[["","form-field-validator",""]]],Je=["[form-field-label]","[form-field-control]","[form-field-validator]"];let Le=(()=>{class i{constructor(){this.showAllHelp=!1}ngOnInit(){this.id=`formField_${this.for}`,this.labelID=`${this.id}_formLabel`}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-form-field"]],inputs:{for:"for",label:"label",showAllHelp:"showAllHelp"},ngContentSelectors:Je,decls:11,vars:5,consts:[[1,"form-group"],[1,"row"],[1,"col-xs-12"],[3,"id","for","labelText","showInfoBlock"]],template:function(e,n){1&e&&(t.F$t(Ae),t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"cp-form-label",3),t.Hsn(4),t.qZA()()(),t.TgZ(5,"div",1)(6,"div",2),t.Hsn(7,1),t.qZA()(),t.TgZ(8,"div",1)(9,"div",2),t.Hsn(10,2),t.qZA()()()),2&e&&(t.uIk("id",n.id),t.xp6(3),t.Q6J("id",n.labelID)("for",n.for)("labelText",n.label)("showInfoBlock",n.showAllHelp))},directives:[a._P],styles:[""]}),i})(),ht=(()=>{class i{constructor(e){this.locale=e}performRangeValidation(e,n,o){let r=null;return r={invalid:!1,message:"error"},n<=e&&e<=o?null:{invalid:!0,message:this.locale.maketext("The input must be a number between \u201c[_1]\u201d and \u201c[_2]\u201d.",n,o)}}performErrorReportingValidation(e){return/^[0-9a-z_\|~\!\^&\s]*$/i.test(e)?null:{invalid:!0,message:this.locale.maketext("The input must be an integer or a combination of [output,url,_1,named constants,target,blank] using these bitwise operators: [list_and,_2].","https://go.cpanel.net/php-ini-errorfunc",["|","~","!","^","&"])}}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(b.g))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})(),Ve=(()=>{class i{constructor(e){this.validatorHelper=e}validate(e){const n=this.rangeValidator(e,this.rangeMin,this.rangeMax);return n?{range:{message:n.message}}:null}rangeValidator(e,n,o){return""===e.value||null===e.value?null:this.validatorHelper.performRangeValidation(e.value,n,o)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(ht))},i.\u0275dir=t.lG2({type:i,selectors:[["","multiphpMgrRangeValidator",""]],inputs:{rangeMin:"rangeMin",rangeMax:"rangeMax"},features:[t._Bn([{provide:m.Cf,useExisting:i,multi:!0}])]}),i})(),Ue=(()=>{class i{validate(e){return m.kI.required(e)?{required:{message:this.message}}:null}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275dir=t.lG2({type:i,selectors:[["","multiphpMgrRequireValidator",""]],inputs:{message:["multiphpMgrRequireValidator","message"]},features:[t._Bn([{provide:m.Cf,useExisting:i,multi:!0}])]}),i})();var X=g(1765);let qe=(()=>{class i{constructor(e){this.validatorHelper=e}validate(e){const n=this.errorReportingValidator(e);return n?{errorReporting:{message:n.message}}:null}errorReportingValidator(e){return""===e.value?null:this.validatorHelper.performErrorReportingValidation(e.value)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(ht))},i.\u0275dir=t.lG2({type:i,selectors:[["","multiphpMgrErrorReportingValidator",""]],features:[t._Bn([{provide:m.Cf,useExisting:i,multi:!0}])]}),i})();const Be=["settingsForm"];function Qe(i,s){if(1&i&&(t.TgZ(0,"div",3)(1,"div",4)(2,"cp-callout",5),t._UZ(3,"span",6),t.qZA()()()),2&i){const e=t.oxw();t.xp6(3),t.Q6J("innerHTML",e.failureMessage,t.oJD)}}function Ee(i,s){if(1&i&&t._UZ(0,"span",10),2&i){const e=t.oxw(2);t.Q6J("innerHtml",e.locale.maketext("Loading [asis,PHP-FPM] settings for \u201c[_1]\u201d \u2026",e.currentDomainName),t.oJD)}}function Ne(i,s){if(1&i&&(t.TgZ(0,"div",7)(1,"div",4),t.YNc(2,Ee,1,1,"ng-template",null,8,t.W1O),t._UZ(4,"cp-loading-spinner",9),t.qZA()()),2&i){const e=t.MAs(3);t.xp6(4),t.Q6J("loadingTemplate",e)}}function Ye(i,s){if(1&i&&(t.TgZ(0,"span",93),t._UZ(1,"span",10),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.allowOverrideHelpTextForPhpFlag,t.oJD)}}function Re(i,s){if(1&i&&(t.TgZ(0,"span",94),t._UZ(1,"span",10),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.allowOverrideHelpTextForPhpFlag,t.oJD)}}function je(i,s){if(1&i&&(t.TgZ(0,"span",93),t._UZ(1,"span",10),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.allowOverrideHelpTextForPhpFlag,t.oJD)}}function ze(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"section")(1,"multiphp-mgr-form-field",95)(2,"div",67)(3,"div",42),t._UZ(4,"span",96)(5,"span",97),t.qZA()(),t.TgZ(6,"div",26)(7,"div",42)(8,"input",98),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw(2).fpmSettingsModel.errorLog.value=o}),t.qZA(),t._UZ(9,"span",99),t.qZA(),t.TgZ(10,"div",50)(11,"label",100)(12,"input",101),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw(2).fpmSettingsModel.errorLog.canOverride=o}),t.qZA(),t._UZ(13,"span",53),t.qZA()()(),t.TgZ(14,"div",30),t._UZ(15,"cp-validation-container",102),t.qZA()()()}if(2&i){t.oxw();const e=t.MAs(4),n=t.oxw();t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Error Log")),t.xp6(3),t.Q6J("innerHtml",n.locale.maketext("Name of the file where script errors should be logged."),t.oJD),t.xp6(1),t.Q6J("innerHtml",n.allowOverrideHelpTextForPhpValue,t.oJD),t.xp6(3),t.s9C("placeholder",n.locale.maketext("path/to/error_log/file [comment,example file path]")),t.Q6J("ngModel",n.fpmSettingsModel.errorLog.value),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Path relative to: [_1]",n.fpmSettingsModel.errorLog.helpText),t.oJD),t.xp6(3),t.Q6J("ngModel",n.fpmSettingsModel.errorLog.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(2),t.Q6J("control",e.controls.errorLog)}}function We(i,s){if(1&i&&(t._UZ(0,"span",10),t._uU(1)),2&i){const e=s.searchTerm,n=t.oxw(2);t.Q6J("innerHtml",n.locale.maketext("[output,strong,Add to the list]:"),t.oJD),t.xp6(1),t.hij("",e," ")}}function Ge(i,s){if(1&i&&(t.TgZ(0,"li")(1,"a",103),t._UZ(2,"i",104),t._uU(3),t.qZA()()),2&i){const e=s.$implicit;t.xp6(1),t.MGl("id","additionalResource-",e.id,""),t.Q6J("href",e.link,t.LSH),t.xp6(2),t.hij(" ",e.text," ")}}const $e=function(i,s){return{"fa-arrow-left":i,"fa-arrow-right":s}};function Xe(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"section",11)(1,"div",12)(2,"div",13)(3,"form",null,14)(5,"div",15)(6,"div",16),t._UZ(7,"div",17),t.TgZ(8,"div",18)(9,"button",19),t.NdJ("click",function(){return t.CHM(e),t.oxw().toggleHelp()}),t._uU(10),t._UZ(11,"i",20),t.qZA()(),t._UZ(12,"div",21),t.qZA(),t.TgZ(13,"div",22)(14,"h4",23),t._uU(15),t.qZA(),t.TgZ(16,"multiphp-mgr-form-field",24)(17,"div",25),t._uU(18),t.qZA(),t.TgZ(19,"div",26)(20,"div",27)(21,"input",28),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.maxRequests=o}),t.qZA(),t._UZ(22,"span",29),t.qZA()(),t.TgZ(23,"div",30),t._UZ(24,"cp-validation-container",31),t.qZA()(),t.TgZ(25,"multiphp-mgr-form-field",32)(26,"div",25),t._uU(27),t.qZA(),t.TgZ(28,"div",26)(29,"div",27)(30,"input",33),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.maxChildren=o}),t.qZA(),t._UZ(31,"span",34),t.qZA()(),t.TgZ(32,"div",30),t._UZ(33,"cp-validation-container",35),t.qZA()(),t.TgZ(34,"multiphp-mgr-form-field",36)(35,"div",25),t._uU(36),t.qZA(),t.TgZ(37,"div",26)(38,"div",27)(39,"input",37),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.processIdleTimeout=o}),t.qZA(),t._UZ(40,"span",38),t.qZA()(),t.TgZ(41,"div",30),t._UZ(42,"cp-validation-container",39),t.qZA()(),t.TgZ(43,"h4",23),t._uU(44),t.qZA(),t.TgZ(45,"div",40)(46,"div",12)(47,"div",4)(48,"div",41)(49,"div",42)(50,"label",43)(51,"input",44),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.allowUrlFopen.value=o}),t.qZA(),t._UZ(52,"span",45),t.TgZ(53,"a",46),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.toggleIniFlagInfoBlock(o.phpFpmPoolParams.Allow_Url_Fopen)}),t._UZ(54,"span",47)(55,"span",48),t.qZA()(),t.YNc(56,Ye,2,1,"span",49),t.qZA(),t.TgZ(57,"div",50)(58,"label",51)(59,"input",52),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.allowUrlFopen.canOverride=o}),t.qZA(),t._UZ(60,"span",53),t.qZA()()(),t.TgZ(61,"div",41)(62,"div",42)(63,"label",54)(64,"input",55),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.logErrors.value=o}),t.qZA(),t._UZ(65,"span",45),t.TgZ(66,"a",56),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.toggleIniFlagInfoBlock(o.phpFpmPoolParams.Log_Errors)}),t._UZ(67,"span",47)(68,"span",48),t.qZA()(),t.YNc(69,Re,2,1,"span",57),t.qZA(),t.TgZ(70,"div",50)(71,"label",58)(72,"input",59),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.logErrors.canOverride=o}),t.qZA(),t._UZ(73,"span",53),t.qZA()()(),t.TgZ(74,"div",41)(75,"div",42)(76,"label",60)(77,"input",61),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.shortOpenTag.value=o}),t.qZA(),t._UZ(78,"span",45),t.TgZ(79,"a",62),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.toggleIniFlagInfoBlock(o.phpFpmPoolParams.Short_Open_Tag)}),t._UZ(80,"span",47)(81,"span",48),t.qZA()(),t.YNc(82,je,2,1,"span",49),t.qZA(),t.TgZ(83,"div",50)(84,"label",63)(85,"input",64),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.shortOpenTag.canOverride=o}),t.qZA(),t._UZ(86,"span",53),t.qZA()()()()(),t.YNc(87,ze,16,10,"section",65),t.TgZ(88,"multiphp-mgr-form-field",66)(89,"div",67)(90,"div",42),t._UZ(91,"span",68)(92,"span",69),t.qZA()(),t.TgZ(93,"div",26)(94,"div",42)(95,"ng-select",70),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().selectedFunctionsToDisable=o})("add",function(){return t.CHM(e),t.oxw().updateDisableFunctionsInFpmSettingsModel()})("remove",function(){return t.CHM(e),t.oxw().updateDisableFunctionsInFpmSettingsModel()}),t.YNc(96,We,2,2,"ng-template",71),t.qZA()(),t.TgZ(97,"div",50)(98,"label",72)(99,"input",73),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.disableFunctions.canOverride=o}),t.qZA(),t._UZ(100,"span",53),t.qZA()()(),t.TgZ(101,"div",30),t._UZ(102,"cp-validation-container",74),t.qZA()(),t.TgZ(103,"multiphp-mgr-form-field",75)(104,"div",67)(105,"div",42),t._UZ(106,"span",76)(107,"span",77),t.qZA()(),t.TgZ(108,"div",26)(109,"div",42)(110,"input",78),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.errorReporting.value=o}),t.qZA(),t._UZ(111,"span",79),t.qZA(),t.TgZ(112,"div",50)(113,"label",80)(114,"input",81),t.NdJ("ngModelChange",function(o){return t.CHM(e),t.oxw().fpmSettingsModel.errorReporting.canOverride=o}),t.qZA(),t._UZ(115,"span",53),t.qZA()()(),t.TgZ(116,"div",30),t._UZ(117,"cp-validation-container",82),t.qZA()()()(),t.TgZ(118,"div",83)(119,"div",12)(120,"div",13)(121,"cp-action-button",84),t.NdJ("click",function(){return t.CHM(e),t.oxw().submitForm()}),t._uU(122),t.qZA(),t.TgZ(123,"cp-action-button",85),t.NdJ("click",function(){return t.CHM(e),t.oxw().validateFpmSettings()}),t._uU(124),t.qZA(),t.TgZ(125,"button",86),t.NdJ("click",function(){return t.CHM(e),t.oxw().resetSettings()}),t._uU(126),t.qZA()(),t.TgZ(127,"div",87)(128,"button",88),t.NdJ("click",function(){return t.CHM(e),t.oxw().goBackClicked()}),t._UZ(129,"i",89)(130,"span",10),t.qZA()()()()()()(),t.TgZ(131,"div",87)(132,"section",90)(133,"h3",91),t._uU(134),t.qZA(),t.TgZ(135,"ul"),t.YNc(136,Ge,4,3,"li",92),t.qZA()()()()()}if(2&i){const e=t.MAs(4),n=t.oxw();t.xp6(7),t.Q6J("innerHtml",n.settingsTitle,t.oJD),t.xp6(3),t.hij(" ",n.toggleHelpLabel," "),t.xp6(5),t.hij(" ",n.locale.maketext("[asis,PHP-FPM] Pool options")," "),t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Max Requests")),t.xp6(2),t.hij(" ",n.locale.maketext("Controls how many requests are served by a process (Max Children) before killing and spawning a new process.")," "),t.xp6(3),t.s9C("placeholder",n.locale.maketext("Max Requests")),t.Q6J("ngModel",n.fpmSettingsModel.maxRequests)("multiphpMgrRequireValidator",n.locale.maketext("The input must be a positive integer between \u201c[_1]\u201d and \u201c[_2]\u201d.","1","10000000"))("rangeMin",1)("rangeMax",1e7),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("[asis,cPanel] Default: [output,class,_1,defaultValue]",20),t.oJD),t.xp6(2),t.Q6J("control",e.controls.maxRequests),t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Max Children")),t.xp6(2),t.hij(" ",n.locale.maketext("The number of [asis,PHP-FPM] processes to spawn to process [asis,PHP] code for web server requests.")," "),t.xp6(3),t.s9C("placeholder",n.locale.maketext("Max Children")),t.Q6J("ngModel",n.fpmSettingsModel.maxChildren)("multiphpMgrRequireValidator",n.locale.maketext("The input must be a positive integer between \u201c[_1]\u201d and \u201c[_2]\u201d.","1","10000"))("rangeMin",1)("rangeMax",1e4),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("[asis,cPanel] Default: [output,class,_1,defaultValue]",5),t.oJD),t.xp6(2),t.Q6J("control",e.controls.maxChildren),t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Process Idle Timeout")),t.xp6(2),t.hij(" ",n.locale.maketext("The number of seconds after which an idle process is set to be killed so it releases CPU time and RAM.")," "),t.xp6(3),t.s9C("placeholder",n.locale.maketext("Process Idle Timeout")),t.Q6J("ngModel",n.fpmSettingsModel.processIdleTimeout)("multiphpMgrRequireValidator",n.locale.maketext("The input must be a positive integer between \u201c[_1]\u201d and \u201c[_2]\u201d.","1","10000000"))("rangeMin",1)("rangeMax",1e7),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("[asis,cPanel] Default: [output,class,_1,defaultValue]",10),t.oJD),t.xp6(2),t.Q6J("control",e.controls.processIdleTimeout),t.xp6(2),t.hij(" ",n.locale.maketext("[asis,PHP-FPM] [asis,INI] Settings")," "),t.xp6(7),t.Q6J("ngModel",n.fpmSettingsModel.allowUrlFopen.value),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Treat URLs as files ([asis,allow_url_fopen])[comment,checkbox label text]"),t.oJD),t.xp6(1),t.uIk("title",n.toggleActionTitle),t.xp6(2),t.Q6J("innerHtml",n.toggleActionTitle,t.oJD),t.xp6(1),t.Q6J("ngIf",n.helpBlocksForIniFlags[n.phpFpmPoolParams.Allow_Url_Fopen]),t.xp6(3),t.Q6J("ngModel",n.fpmSettingsModel.allowUrlFopen.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(4),t.Q6J("ngModel",n.fpmSettingsModel.logErrors.value),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Log errors ([asis,log_errors])[comment,checkbox label text]"),t.oJD),t.xp6(1),t.uIk("title",n.toggleActionTitle),t.xp6(2),t.Q6J("innerHtml",n.toggleActionTitle,t.oJD),t.xp6(1),t.Q6J("ngIf",n.helpBlocksForIniFlags[n.phpFpmPoolParams.Log_Errors]),t.xp6(3),t.Q6J("ngModel",n.fpmSettingsModel.logErrors.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(4),t.Q6J("ngModel",n.fpmSettingsModel.shortOpenTag.value),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Recognize code between tags as PHP source ([asis,short_open_tag])[comment,checkbox label text]"),t.oJD),t.xp6(1),t.uIk("title",n.toggleActionTitle),t.xp6(2),t.Q6J("innerHtml",n.toggleActionTitle,t.oJD),t.xp6(1),t.Q6J("ngIf",n.helpBlocksForIniFlags[n.phpFpmPoolParams.Short_Open_Tag]),t.xp6(3),t.Q6J("ngModel",n.fpmSettingsModel.shortOpenTag.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(1),t.Q6J("ngIf",n.showDomainSettings),t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Disable Functions")),t.xp6(3),t.Q6J("innerHtml",n.locale.maketext("Enter [asis,PHP] functions you intend to disable when [asis,PHP-FPM] is running."),t.oJD),t.xp6(1),t.Q6J("innerHtml",n.allowOverrideHelpTextForPhpValue,t.oJD),t.xp6(3),t.s9C("loadingText",n.locale.maketext("Validating \u2026")),t.Q6J("items",n.fpmSettingsModel.disableFunctions.value)("ngModel",n.selectedFunctionsToDisable)("addTag",n.addDisableFunctionRef)("loading",n.addingDisableFunction)("clearable",!1),t.xp6(4),t.Q6J("ngModel",n.fpmSettingsModel.disableFunctions.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(2),t.Q6J("control",e.controls.disableFunctions),t.xp6(1),t.Q6J("showAllHelp",n.showAllHelp)("label",n.locale.maketext("Error Reporting")),t.xp6(3),t.Q6J("innerHtml",n.locale.maketext("Error reporting can either be an integer representing a bit field, or named constants. [output,url,_1,Learn more,target,blank].","https://go.cpanel.net/php-ini-errorfunc"),t.oJD),t.xp6(1),t.Q6J("innerHtml",n.allowOverrideHelpTextForPhpValue,t.oJD),t.xp6(3),t.s9C("placeholder",n.locale.maketext("Integer or bit field")),t.Q6J("ngModel",n.fpmSettingsModel.errorReporting.value),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Example: [output,class,_1,defaultValue]","E_ALL & ~E_NOTICE"),t.oJD),t.xp6(3),t.Q6J("ngModel",n.fpmSettingsModel.errorReporting.canOverride),t.xp6(1),t.Q6J("innerHtml",n.locale.maketext("Block domain from changing the setting[comment,checkbox label text]"),t.oJD),t.xp6(2),t.Q6J("control",e.controls.errorReporting),t.xp6(4),t.s9C("title",n.locale.maketext("Click here to update [asis,PHP-FPM] settings.")),t.Q6J("buttonClass",n.fpmSettingsUpdateButton.buttonClass)("buttonState",n.updateButtonDisabled),t.xp6(1),t.hij(" ",n.locale.maketext("Update")," "),t.xp6(1),t.s9C("title",n.locale.maketext("Click here to validate if changed [asis,PHP-FPM] settings are valid.")),t.Q6J("buttonClass",n.fpmSettingsValidateButton.buttonClass)("buttonState",n.fpmSettingsValidateButton.buttonState),t.xp6(1),t.hij(" ",n.locale.maketext("Validate Settings")," "),t.xp6(1),t.s9C("title",n.locale.maketext("Reset changes back to previously saved settings.")),t.xp6(1),t.hij(" ",n.locale.maketext("Reset Settings")," "),t.xp6(2),t.Q6J("title",n.goBackLinkText),t.xp6(1),t.Q6J("ngClass",t.WLB(94,$e,!n.isRTL,n.isRTL)),t.xp6(1),t.Q6J("innerHtml",n.goBackLinkText,t.oJD),t.xp6(4),t.hij(" ",n.locale.maketext("Need Help?")," "),t.xp6(2),t.Q6J("ngForOf",n.additionalResourceList)}}let K=(()=>{class i{constructor(e,n,o,r,l,d){this._activeRoute=e,this.locale=n,this.phpHelper=o,this.phpFpmService=r,this.alertService=l,this.domainPhpService=d,this.showAllHelp=!1,this.loadingData=!0,this.failureOccurred=!1,this.failureMessage="",this.fpmSettingsUpdateButton={buttonClass:"btn btn-sm btn-primary button-bar",buttonState:a.FP.disabled},this.fpmSettingsValidateButton={buttonClass:"btn btn-sm btn-default button-bar",buttonState:a.FP.enabled},this.helpBlocksForIniFlags={},this.addingDisableFunction=!1,this.addDisableFunctionRef=this.addDisableFunction.bind(this),this.helpBlocksForIniFlags[p.allowUrlFopen]=!1,this.helpBlocksForIniFlags[p.logErrors]=!1,this.helpBlocksForIniFlags[p.shortOpenTag]=!1}get phpFpmPoolParams(){return p}get manageFpmSettingsForm(){return this._manageFpmSettingsForm}get toggleHelpLabel(){return this.locale.maketext(this.showAllHelp?"Hide Help Text":"Show Help Text")}get currentDomainName(){return this.type===f.domain?this._currentDomain:"System"}get goBackLinkText(){return this.locale.maketext(this.type===f.domain?"Go back to user domain settings[comment,link text]":"Go back to system settings[comment,link text]")}get additionalResourceList(){return[{id:"phpFpmConfig",text:this.locale.maketext("Official [asis,PHP-FPM] Configuration Documentation"),link:"https://go.cpanel.net/php-fpm-config"},{id:"bottleneck-child-processes",text:this.locale.maketext("Bottleneck with Child Processes"),link:"https://go.cpanel.net/ApachevsPHP-FPMBottleneckwithChildProcesses"},{id:"error-reporting-docs",text:this.locale.maketext("More documentation on error reporting"),link:"https://go.cpanel.net/php-ini-errorfunc"}]}get showLoadingMessage(){return this.loadingData&&!this.failureOccurred}get showContent(){return!this.loadingData&&!this.failureOccurred}get showFailureMessageOnLoad(){return!this.loadingData&&this.failureOccurred}get showDomainSettings(){return this.type===f.domain}get updateButtonDisabled(){return this.fpmSettingsUpdateButton.buttonState!==a.FP.loading&&(this.fpmSettingsUpdateButton.buttonState=this.manageFpmSettingsForm&&this.manageFpmSettingsForm.invalid?a.FP.disabled:a.FP.enabled),this.fpmSettingsUpdateButton.buttonState}get settingsTitle(){return this.type===f.domain?this.locale.maketext("[asis,PHP-FPM] Settings for: [output,class,_1,titleValue]",this._currentDomain):this.locale.maketext("System [asis,PHP-FPM] Settings")}get allowOverrideHelpTextForPhpValue(){return this.locale.maketext("Checking the box \u201cBlock domain from changing the setting\u201d would allow the configuration to use \u201c[_1]\u201d. It uses \u201c[_2]\u201d if unchecked.","php_admin_value","php_value")}get allowOverrideHelpTextForPhpFlag(){return this.locale.maketext("Checking the box \u201cBlock domain from changing the setting\u201d would allow the configuration to use \u201c[_1]\u201d. It uses \u201c[_2]\u201d if unchecked.","php_admin_flag","php_flag")}ngOnInit(){this._fpmSettingsParamSubscription=this._activeRoute.params.subscribe(e=>{this._currentDomain=e.domain,this.type=this._currentDomain&&""!==this._currentDomain?f.domain:f.system,this.loadPhpFpmSettings()})}loadPhpFpmSettings(){this.type===f.domain?this.domainPhpService.getPhpDataForDomain(this._currentDomain).subscribe(e=>{e.success&&(this.currentUserDomain=e.data,this.phpFpmService.getDomainPhpFpmSettings(this.currentUserDomain).subscribe(n=>{n.success?(this.fpmSettingsModel=n.data,this._createFpmSettingsCache(this.fpmSettingsModel),this._updateSelectedFunctionsToDisable(this.fpmSettingsModel.disableFunctions.value)):(this.phpHelper.error(n),this.failureOccurred=!0,this.failureMessage=this.locale.maketext("An error occurred while fetching [asis,PHP-FPM] settings.")),this.loadingData=!1}))}):this.phpFpmService.getSystemPhpFpmSettings().subscribe(e=>{e.success?(this.fpmSettingsModel=e.data,this._createFpmSettingsCache(this.fpmSettingsModel),this._updateSelectedFunctionsToDisable(this.fpmSettingsModel.disableFunctions.value)):(this.phpHelper.error(e),this.failureOccurred=!0,this.failureMessage=this.locale.maketext("An error occurred while fetching [asis,PHP-FPM] settings.")),this.loadingData=!1})}ngOnDestroy(){this._fpmSettingsParamSubscription&&this._fpmSettingsParamSubscription.unsubscribe()}toggleHelp(){this.showAllHelp=!this.showAllHelp,Object.keys(this.helpBlocksForIniFlags).forEach(e=>{this.helpBlocksForIniFlags[e]=this.showAllHelp})}toggleIniFlagInfoBlock(e){this.helpBlocksForIniFlags[e]=!this.helpBlocksForIniFlags[e]}goBackClicked(){this.phpHelper.routeTo(this.type===f.domain?"user":"system")}submitForm(){this.manageFpmSettingsForm.valid&&(this.fpmSettingsUpdateButton.buttonState=a.FP.loading,this.phpFpmService.updatePhpFpmSettings(this.fpmSettingsModel).subscribe(e=>{e.success?(this._createFpmSettingsCache(this.fpmSettingsModel),this.alertService.success(this.locale.maketext("[asis,PHP-FPM] configuration is updated with the new changes."))):this.phpHelper.error(e),this.fpmSettingsUpdateButton.buttonState=a.FP.enabled}))}addDisableFunction(e){return this.addingDisableFunction=!0,new Promise((n,o)=>{this.phpFpmService.validatePhpFpmSettings(this.fpmSettingsModel).subscribe(r=>{r.success?n(e):o(this.locale.maketext("The input must be a valid [asis,PHP] function.")),this.addingDisableFunction=!1})}).catch(n=>{this.manageFpmSettingsForm.controls.disableFunctions.setErrors({disableFuncAsync:{message:n}}),this.manageFpmSettingsForm.controls.disableFunctions.updateValueAndValidity()})}updateDisableFunctionsInFpmSettingsModel(){this.fpmSettingsModel.disableFunctions.value=this.selectedFunctionsToDisable}validateFpmSettings(){this.fpmSettingsValidateButton.buttonState=a.FP.loading,this.phpFpmService.validatePhpFpmSettings(this.fpmSettingsModel).subscribe(e=>{e.success?this.alertService.info(this.locale.maketext("The changed values are valid [asis,PHP-FPM] settings. Click \u201cUpdate\u201d to save the settings.")):this.phpHelper.error(e),this.fpmSettingsValidateButton.buttonState=a.FP.enabled})}resetSettings(){this.fpmSettingsModel=(0,u.cloneDeep)(this.fpmSettingsCache)}_updateSelectedFunctionsToDisable(e){this.selectedFunctionsToDisable=e}_createFpmSettingsCache(e){this.fpmSettingsCache=(0,u.cloneDeep)(e)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(S.gz),t.Y36(b.g),t.Y36(F),t.Y36(He),t.Y36(a.c9),t.Y36($))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-php-fpm-settings"]],viewQuery:function(e,n){if(1&e&&t.Gf(Be,5),2&e){let o;t.iGM(o=t.CRH())&&(n._manageFpmSettingsForm=o.first)}},inputs:{type:"type"},decls:3,vars:3,consts:[["id","fpm-settings-not-found","class","row",4,"ngIf"],["id","manage-view-loading","class","row",4,"ngIf"],["id","php-fpm-settings-view",4,"ngIf"],["id","fpm-settings-not-found",1,"row"],[1,"col-xs-12"],["id","loadFailureMessage","calloutType","danger"],[1,"unlink-error-pre",3,"innerHTML"],["id","manage-view-loading",1,"row"],["loadingDataTemplate",""],["id","loadingDataLoader",3,"loadingTemplate"],[3,"innerHtml"],["id","php-fpm-settings-view"],[1,"row"],[1,"col-xs-12","col-md-9"],["settingsForm","ngForm"],[1,"panel","panel-default"],[1,"panel-heading"],[1,"widget-title","pull-left","flip",3,"innerHtml"],[1,"pull-right","flip"],["type","button","id","lnkShowHideHelp",1,"btn","btn-default","btn-xs",3,"click"],["aria-hidden","true",1,"far","fa-question-circle","form-info-sign"],[1,"clearfix"],[1,"panel-body"],[1,"create-user-heading"],["for","max-requests",3,"showAllHelp","label"],["form-field-label",""],["form-field-control","",1,"row"],[1,"col-xs-12","col-md-6","col-lg-3"],["id","txt-max-requests","name","maxRequests","type","number","multiphpMgrRangeValidator","","aria-label","max-requests","autocomplete","off",1,"form-control",3,"ngModel","multiphpMgrRequireValidator","rangeMin","rangeMax","placeholder","ngModelChange"],["id","default-max-requests",1,"help-block","defaultBlock",3,"innerHtml"],["form-field-validator",""],["id","max-requests-validation-container",3,"control"],["for","max-children",3,"showAllHelp","label"],["id","txt-max-children","name","maxChildren","type","number","multiphpMgrRangeValidator","","aria-label","max-children","autocomplete","off",1,"form-control",3,"ngModel","multiphpMgrRequireValidator","rangeMin","rangeMax","placeholder","ngModelChange"],["id","default-max-children",1,"help-block","defaultBlock",3,"innerHtml"],["id","max-children-validation-container",3,"control"],["for","process-idle-timeout",3,"showAllHelp","label"],["id","txt-process-idle-timeout","name","processIdleTimeout","type","number","multiphpMgrRangeValidator","","aria-label","process-idle-timeout","autocomplete","off",1,"form-control",3,"ngModel","multiphpMgrRequireValidator","rangeMin","rangeMax","placeholder","ngModelChange"],["id","default-process-idle-timeout",1,"help-block","defaultBlock",3,"innerHtml"],["id","process-idle-timeout-validation-container",3,"control"],[1,"section-body"],[1,"row","form-group"],[1,"col-xs-12","col-md-6","col-lg-7"],["for","chk-allow_url_fopen"],["id","chk-allow_url_fopen","type","checkbox","name","allowUrlFopen",3,"ngModel","ngModelChange"],[1,"checkbox-fpm-settings",3,"innerHtml"],["id","chk-allow_url_fopen-infoIcon","href","javascript:void(0)","aria-label","allow-url-fopen-info",1,"text-primary","form-info-sign",3,"click"],["aria-hidden","true",1,"far","fa-question-circle","text-primary"],[1,"sr-only",3,"innerHtml"],["id","chk-allow_url_fopen-infoBlock","class","info-block",4,"ngIf"],[1,"col-xs-12","col-md-6","col-lg-5"],["for","chk-allow_url_fopen-allow-override"],["id","chk-allow_url_fopen-allow-override","name","allowUrlFopenAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],[1,"checkbox-fpm-settings","checkbox-allow-override",3,"innerHtml"],["for","chk-log_errors"],["id","chk-log_errors","name","logErrors","type","checkbox",3,"ngModel","ngModelChange"],["id","chk-log_errors-infoIcon","href","javascript:void(0)","aria-label","log-errors-info",1,"text-primary","form-info-sign",3,"click"],["id","chk-log_errors-infoBlock","class","info-block",4,"ngIf"],["for","chk-log_errors-allow-override"],["id","chk-log_errors-allow-override","name","logErrorsAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],["for","chk-short_open_tag"],["id","chk-short_open_tag","name","shortOpenTag","type","checkbox",3,"ngModel","ngModelChange"],["id","chk-short_open-infoIcon","href","javascript:void(0)","aria-label","short-open-info",1,"text-primary","form-info-sign",3,"click"],["for","chk-short_open_tag-allow-override"],["id","chk-short_open_tag-allow-override","name","shortOpenTagAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],[4,"ngIf"],["for","select-disable_functions",3,"showAllHelp","label"],["form-field-label","",1,"row"],["id","help-text-disable_functions",1,"help-block","defaultBlock",3,"innerHtml"],["id","allow-override-help-text-disable_functions",1,"help-block",3,"innerHtml"],["id","select-disable_functions","multiple","true","name","disableFunctions","aria-label","disable-functions",3,"items","ngModel","addTag","loading","loadingText","clearable","ngModelChange","add","remove"],["ng-tag-tmp",""],["for","chk-disable_functions-allow-override"],["id","chk-disable_functions-allow-override","name","disableFunctionsAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],["id","disable_functions-validation-container",3,"control"],["for","error-reporting",3,"showAllHelp","label"],["id","help-text-error-reporting",1,"help-block","defaultBlock",3,"innerHtml"],["id","allow-override-help-text-error-reporting",1,"help-block",3,"innerHtml"],["id","txt-error-reporting","name","errorReporting","type","text","aria-label","error-reporting","multiphpMgrErrorReportingValidator","","autocomplete","off",1,"form-control",3,"ngModel","placeholder","ngModelChange"],["id","default-error-reporting",1,"help-block","defaultBlock",3,"innerHtml"],["for","chk-error_reporting-allow-override"],["id","chk-error_reporting-allow-override","name","errorReportingAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],["id","error-reporting-validation-container",3,"control"],[1,"panel-footer"],["id","btn-update-fpm-settings",3,"buttonClass","buttonState","title","click"],["id","btn-validate-fpm-settings",3,"buttonClass","buttonState","title","click"],["id","btn-reset-fpm-settings","type","button",1,"btn","btn-sm","btn-default","button-bar",3,"title","click"],[1,"col-xs-12","col-md-3"],["id","go-back","type","button",1,"btn","btn-sm","btn-link","pull-right","flip",3,"title","click"],["aria-hidden","true",1,"fas",3,"ngClass"],[1,"widget","no-top-margin"],[1,"widget-title"],[4,"ngFor","ngForOf"],["id","chk-allow_url_fopen-infoBlock",1,"info-block"],["id","chk-log_errors-infoBlock",1,"info-block"],["for","txt-error_log",3,"showAllHelp","label"],["id","help-text-error_log",1,"help-block","defaultBlock",3,"innerHtml"],["id","allow-override-help-text-error_log",1,"help-block",3,"innerHtml"],["id","txt-error_log","name","errorLog","type","text","autocomplete","off",1,"form-control",3,"ngModel","placeholder","ngModelChange"],["id","default-error_log",1,"help-block","defaultBlock",3,"innerHtml"],["for","chk-error_log-allow-override"],["id","chk-error_log-allow-override","name","errorLogAllowOverride","type","checkbox",1,"form-check-input",3,"ngModel","ngModelChange"],["id","error_log-validation-container",3,"control"],["target","_blank",3,"href","id"],["aria-hidden","true",1,"fas","fa-fw","fa-external-link-alt"]],template:function(e,n){1&e&&(t.YNc(0,Qe,4,1,"div",0),t.YNc(1,Ne,5,1,"div",1),t.YNc(2,Xe,137,97,"section",2)),2&e&&(t.Q6J("ngIf",n.showFailureMessageOnLoad),t.xp6(1),t.Q6J("ngIf",n.showLoadingMessage),t.xp6(1),t.Q6J("ngIf",n.showContent))},directives:[h.O5,a.Oc,a.go,m._Y,m.JL,m.F,Le,m.wV,m.Fj,Ve,m.JJ,m.On,Ue,a.fm,m.Wl,X.w9,X.Jr,qe,a.xV,h.mk,h.sg],styles:[".defaultBlock[_ngcontent-%COMP%]{font-size:12px}.defaultValue[_ngcontent-%COMP%]{color:#333;font-style:italic}.checkbox-fpm-settings[_ngcontent-%COMP%]{padding:0 10px}.checkbox-allow-override[_ngcontent-%COMP%]{font-weight:400}.form-check-input[_ngcontent-%COMP%]{vertical-align:top}html[dir=ltr][_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%]{margin:3px 0 3px 15px}html[dir=rtl][_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .form-check-input[_ngcontent-%COMP%]{margin:3px 15px 3px 0}"]}),i})();function Ke(i,s){if(1&i&&t._UZ(0,"iframe",5),2&i){const e=t.oxw();t.Q6J("src",e.tailingUrl,t.uOi)}}const tn=[{path:"system",component:lt,data:{id:"system",tab:"system"}},{path:"user",component:ct,data:{id:"user",tab:"user"}},{path:"system/fpm-settings",component:K,data:{id:"system_fpm_settings",tab:"system"}},{path:"user/fpm-settings/:domain",component:K,data:{id:"user_fpm_settings",tab:"user"}},{path:"php-fpm-conversion/:build",component:(()=>{class i{constructor(e,n,o,r){this.locale=e,this._activeRoute=n,this._windowRef=o,this._sanitizer=r}ngOnInit(){this._routeParamSubscription=this._activeRoute.params.subscribe(e=>{this.buildId=e.build,this.startTailing()})}ngOnDestroy(){this._routeParamSubscription&&this._routeParamSubscription.unsubscribe()}startTailing(){this.tailingUrl=this._sanitizer.bypassSecurityTrustResourceUrl(`${this._windowRef.nativeWindow.PAGE.cp_security_token}/cgi/process_tail.cgi?process=ConvertToFPM&build_id=${this.buildId}`)}closeWindow(){this._windowRef.nativeWindow.close()}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(S.gz),t.Y36(y),t.Y36(V.H7))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-php-fpm-conversion"]],decls:8,vars:3,consts:[[1,"row"],[1,"col-xs-12"],[1,"section-header","pull-left","flip"],[1,"btn","btn-sm","btn-default","pull-right","flip",3,"click"],["class","log-frame","id","log-php-fpm-conversions",3,"src",4,"ngIf"],["id","log-php-fpm-conversions",1,"log-frame",3,"src"]],template:function(e,n){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"h3",2),t._uU(3),t.qZA(),t.TgZ(4,"button",3),t.NdJ("click",function(){return n.closeWindow()}),t._uU(5),t.qZA()(),t.TgZ(6,"div",1),t.YNc(7,Ke,1,1,"iframe",4),t.qZA()()),2&e&&(t.xp6(3),t.hij(" ",n.locale.maketext("Convert All Accounts to [asis,PHP-FPM]")," "),t.xp6(2),t.hij(" ",n.locale.maketext("Close this window")," "),t.xp6(2),t.Q6J("ngIf",n.tailingUrl))},directives:[h.O5],styles:[".log-frame[_ngcontent-%COMP%]{width:100%;height:500px}.section-header[_ngcontent-%COMP%]{margin-top:10px}"]}),i})(),pathMatch:"full"},{path:"",redirectTo:"system",pathMatch:"full"},{path:"**",redirectTo:"system",pathMatch:"full"}];let en=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[[S.Bz.forRoot(tn,{relativeLinkResolution:"legacy"}),h.ez,w.mr.forRoot(),Y.Fq.forRoot()],S.Bz]}),i})();var B=(()=>{return(i=B||(B={})).PHPELS_BANNER_SHOWN="PHPELS-Banner-Shown-MultiPHP-Manager",i.PHPELS_MORE_INFO_CLICKED="PHPELS-Banner-MoreInfo-Clicked-MultiPHP-Manager",B;var i})();let nn=(()=>{class i{constructor(e){this.apiClient=e}getOutdatedPhpCount(){const e=new c.r(c.N.JsonApi,{namespace:"EolPHPSites",method:"eol_php_sites",config:{json:!0}});return this.apiClient.post(e).pipe((0,k.U)(n=>{if(!n.success)throw new Error(String(n.errors?.[0]??"eol_php_sites failed"));return n.data.eol_php_sites}))}}return i.\u0275fac=function(e){return new(e||i)(t.LFG(Z.A4))},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})(),on=(()=>{class i{sendEvent(e){const n=window?.mixpanel;"function"==typeof n?.track&&n.track(e,{})}}return i.\u0275fac=function(e){return new(e||i)},i.\u0275prov=t.Yz7({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();function sn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4),t._UZ(4,"i",5),t.TgZ(5,"div",6)(6,"span",7),t._uU(7),t.qZA(),t.TgZ(8,"p",8),t._uU(9),t.TgZ(10,"a",9),t.NdJ("click",function(){return t.CHM(e),t.oxw().onMoreInfoClick()}),t._uU(11),t._UZ(12,"i",10),t.qZA()()()()()()()}if(2&i){const e=t.oxw();t.Q6J("@slideDown",void 0),t.xp6(7),t.hij(" ",e.outdatedPhpText," "),t.xp6(2),t.hij(" ",e.outdatedPhpDescription,"\xa0 "),t.xp6(2),t.hij(" ",e.locale.maketext("More Info")," ")}}const rn=(0,M.X$)("slideDown",[(0,M.eR)(":enter",[(0,M.oB)({opacity:0,transform:"translateY(-12px)"}),(0,M.jt)("250ms ease-out",(0,M.oB)({opacity:1,transform:"translateY(0)"}))])]);let an=(()=>{class i{constructor(e,n,o){this.locale=e,this.outdatedPhpService=n,this.mixpanelService=o,this.showBanner=!1,this.outdatedPhpText="",this.outdatedPhpDescription=this.locale.maketext("Outdated \u201c[_1]\u201d versions no longer receive security updates. Use \u201c[_2]\u201d to stay protected.","PHP","PHP ELS")}ngOnInit(){this.outdatedPhpService.getOutdatedPhpCount().subscribe({next:(e=0)=>{this.outdatedPhpText=this.locale.maketext("[quant,_1,site uses,sites use,No sites use] outdated [asis,PHP].",e),this.showBanner=e>0,this.showBanner&&this.mixpanelService.sendEvent(B.PHPELS_BANNER_SHOWN)},error:()=>{this.showBanner=!1}})}onMoreInfoClick(){this.mixpanelService.sendEvent(B.PHPELS_MORE_INFO_CLICKED)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(nn),t.Y36(on))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-outdated-php-banner"]],decls:1,vars:1,consts:[["id","outdatedPhpBanner","class","outdated-php-banner",4,"ngIf"],["id","outdatedPhpBanner",1,"outdated-php-banner"],[1,"row"],[1,"col-xs-12"],[1,"outdated-php-banner__content"],["aria-hidden","true",1,"fas","fa-exclamation-circle","text-danger","outdated-php-banner__icon"],[1,"outdated-php-banner__body"],[1,"outdated-php-banner__text"],[1,"outdated-php-banner__description"],["href","https://go.cpanel.net/about-elsphp","target","_blank","rel","noopener noreferrer",1,"outdated-php-banner__link",3,"click"],["aria-hidden","true",1,"fas","fa-external-link-alt"]],template:function(e,n){1&e&&t.YNc(0,sn,13,4,"div",0),2&e&&t.Q6J("ngIf",n.showBanner)},directives:[h.O5],styles:[".outdated-php-banner[_ngcontent-%COMP%]{background-color:#f5f5f5;margin:20px 0;padding:20px}html[dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%]{border-left-width:3px;border-left-style:solid;border-left-color:#d9534f}html[dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%]{border-right-width:3px;border-right-style:solid;border-right-color:#d9534f}.outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__content[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__icon[_ngcontent-%COMP%]{font-size:1.2em;margin-top:2px}.outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__body[_ngcontent-%COMP%]{display:flex;flex-direction:column}.outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__description[_ngcontent-%COMP%]{margin:4px 0 0}html[dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%]{margin-left:8px}html[dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%]{margin-right:8px}html[dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-left:4px}html[dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .outdated-php-banner[_ngcontent-%COMP%] .outdated-php-banner__link[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px}"],data:{animation:[rn]}}),i})();const ln=["phpTabSet"];function pn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"tabset",null,4)(2,"tab",5),t.NdJ("selectTab",function(){return t.CHM(e),t.oxw().routeTo("/system")}),t.qZA(),t.TgZ(3,"tab",6),t.NdJ("selectTab",function(){return t.CHM(e),t.oxw().routeTo("/user")}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(2),t.s9C("heading",e.locale.maketext("System Settings")),t.xp6(1),t.s9C("heading",e.locale.maketext("User Domain Settings"))}}let cn=(()=>{class i{constructor(e,n,o,r,l){this.router=e,this.route=n,this.locale=o,this.ngZone=r,this.phpVersionService=l,this.title="multiphp-manager",this.showTabSet=!0,e.events.subscribe(d=>{if(d instanceof S.m2){const I=(0,u.find)(this.phpTabSet.tabs,["id",n.root.firstChild.snapshot.data.tab]);I?(this.showTabSet=!0,I.active=!0):this.showTabSet=!1}})}ngOnInit(){this.phpVersionService.fetchInstalledPhpVersionList(),this.phpVersionService.fetchInstalledPhpFpmPackages()}routeTo(e){this.ngZone.run(()=>this.router.navigate([e]))}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(S.F0),t.Y36(S.gz),t.Y36(b.g),t.Y36(t.R0b),t.Y36(v))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-root"]],viewQuery:function(e,n){if(1&e&&t.Gf(ln,5),2&e){let o;t.iGM(o=t.CRH())&&(n.phpTabSet=o.first)}},decls:8,vars:1,consts:[["position","top-right"],["id","content"],[4,"ngIf"],[1,"body"],["phpTabSet",""],["id","system",3,"heading","selectTab"],["id","user",3,"heading","selectTab"]],template:function(e,n){1&e&&(t._UZ(0,"cp-alert-list",0),t.TgZ(1,"div",1),t._UZ(2,"multiphp-mgr-outdated-php-banner")(3,"multiphp-mgr-cloudlinux-banner"),t.TgZ(4,"div"),t.YNc(5,pn,4,2,"tabset",2),t.TgZ(6,"div",3),t._UZ(7,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("ngIf",n.showTabSet))},directives:[a.hF,an,at,h.O5,j.AH,j.wW,S.lC],styles:[".body[_ngcontent-%COMP%]{margin-top:30px}"]}),i})();var T=g(348);let R=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({providers:[],imports:[[h.ez,w.mr.forRoot(),T.m]]}),i})(),dt=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({providers:[],imports:[[h.ez,T.m]]}),i})(),hn=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i,bootstrap:[lt]}),i.\u0275inj=t.cJS({providers:[a.c9],imports:[[T.m,h.ez,a.df,a.zf,a.nM,a.CQ,a.zr,a.Op,m.u5,R,dt]]}),i})();var dn=g(529);const gn=["multiphp-mgr-user-domain",""];function mn(i,s){1&i&&(t.TgZ(0,"div",23),t._UZ(1,"i",24),t.qZA())}function un(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"div",20)(1,"multiphp-mgr-php-dropdown",21),t.NdJ("phpVersionChanged",function(o){t.CHM(e);const r=t.oxw();return r.changePhpVersion(o,r.rowData)}),t.qZA(),t.YNc(2,mn,2,0,"div",22),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.MGl("id","",e.rowData.model.vhost,"-domain-php"),t.Q6J("selectedPhpVersion",e.rowData.model.phpVersion)("mode",e.dropdown)("disabled",e.disableRow()),t.xp6(1),t.Q6J("ngIf",e.rowData.phpVersionChangeInProcess)}}function _n(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"cp-toggle-switch",25),t.NdJ("toggleStatus",function(){t.CHM(e);const o=t.oxw();return o.toggleFpm(o.rowData)}),t.qZA()}if(2&i){const e=t.oxw();t.MGl("id","",e.rowData.model.vhost,"-domain-FPM"),t.s9C("onText",e.locale.maketext("Enabled")),t.s9C("offText",e.locale.maketext("Disabled")),t.Q6J("toggleState",e.rowData.domainFpmToggle.toggleState)("labelPosition",e.rowData.domainFpmToggle.labelPosition)("isDisabled",e.rowData.domainFpmToggle.isDisabled)}}function fn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"button",26),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.openDetails(o.rowData)}),t._UZ(1,"span",27),t._uU(2),t.qZA()}if(2&i){const e=t.oxw();t.MGl("id","",e.rowData.model.vhost,"-unavailable"),t.Q6J("disabled",e.disableRow()),t.xp6(2),t.hij(" ",e.locale.maketext("Unavailable")," ")}}function Pn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"button",28),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return o.goToFpmSettings(o.rowData.model.vhost)}),t._UZ(1,"span",19),t._uU(2),t.qZA()}if(2&i){const e=t.oxw();t.MGl("id","",e.rowData.model.vhost,"-settings"),t.xp6(2),t.hij(" ",e.locale.maketext("[asis,PHP-FPM] Settings")," ")}}let tt=(()=>{class i{constructor(e,n,o,r,l,d){this.locale=e,this.domainService=n,this.phpHelper=o,this.alertService=r,this.phpService=l,this.phpVersionService=d,this.rowPhpVersionChanged=new t.vpe,this.rowSelectionChanged=new t.vpe,this.inheritStateChanged=new t.vpe,this.domainRowDisabled=!1}get isFpmEligible(){return!this.rowData.isInherit&&this.phpVersionService.isPhpFpmInstalled(`${this.rowData.model.phpVersion.version}-php-fpm`)}get showFpmSettingsButton(){return this.isFpmEligible&&this.rowData.model.fpmStatus===_.enabled}get displayDetailsCss(){return this.rowData.displayDetails?"fa-chevron-down":this.locale.isRtl?"fa-chevron-left":"fa-chevron-right"}get showOutdatedPill(){return!(!this.rowData.model.phpVersion.isOutdated||!this.rowData.isInherit)}toggleFpm(e){e.domainFpmToggle.toggleState=a.Yg.toggleUpdating,e.model.fpmStatus===_.disabled?this.domainService.applyFPMToDomain(e.domain,_.enabled).subscribe(n=>{n.hasErrors?this.phpHelper.error(n):(e.domainFpmToggle.toggleState=a.Yg.toggleOn,e.model.fpmStatus=_.enabled,this.alertService.success(this.locale.maketext("You enabled [asis,PHP-FPM] for \u201c[_1]\u201d.",e.domain)))}):this.domainService.applyFPMToDomain(e.domain,_.disabled).subscribe(n=>{n.hasErrors?this.phpHelper.error(n):(e.domainFpmToggle.toggleState=a.Yg.toggleOff,e.model.fpmStatus=_.disabled,this.alertService.success(this.locale.maketext("You disabled [asis,PHP-FPM] for \u201c[_1]\u201d.",e.domain)))})}goToFpmSettings(e){this.phpHelper.routeTo(`user/fpm-settings/${e}`)}openDetails(e){e.displayDetails=!e.displayDetails,e.domainFpmToggle.isDisabled=!e.domainFpmToggle.isDisabled}disableRow(){return this.domainRowDisabled=!(!this.rowData.inheritInProcess&&!this.rowData.displayDetails),this.domainRowDisabled}changePhpVersion(e,n){n.model.phpVersion=e,this.rowPhpVersionChanged.emit(n)}setupElementsBasedOnInheritStatus(){this.setInheritStatus(),this.setFpmStatus()}setFpmStatus(){this.rowData.model.fpmStatus===_.enabled&&(this.rowData.domainFpmToggle.toggleState=a.Yg.toggleOn)}setInheritStatus(){this.rowData.isInherit=this.rowData.wantToInherit=""!==this.rowData.model.phpVersionSource}selectionChanged(){this.rowSelectionChanged.emit(this.rowData)}onInheritCheckChanged(){this.rowData.inheritInProcess=!0,this.inheritStateChanged.emit(this.rowData)}showInheritLabel(e){let n="";return n=e.isInherit?this.locale.maketext("Inherit - [_1][comment,this is label]",e.model.phpVersion.formattedVersion):this.locale.maketext("Inherit"),n}ngOnInit(){this.setupElementsBasedOnInheritStatus()}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36($),t.Y36(F),t.Y36(a.c9),t.Y36(z),t.Y36(v))},i.\u0275cmp=t.Xpm({type:i,selectors:[["","multiphp-mgr-user-domain",""]],inputs:{rowData:"rowData",phpVersions:"phpVersions"},outputs:{rowPhpVersionChanged:"rowPhpVersionChanged",rowSelectionChanged:"rowSelectionChanged",inheritStateChanged:"inheritStateChanged"},attrs:gn,decls:25,vars:18,consts:[[1,"bulkActionColumn","hidden-xs"],["type","checkbox",3,"ngModel","ngModelChange","change"],[1,"domainColumn"],[1,"row-expand-container"],["title","View details.","aria-label","View details.",1,"btn","btn-link",3,"id","click"],["aria-hidden","true",1,"fas",3,"ngClass"],[1,"domain-name","collapse-text"],[1,"hidden-xs","accountColumn"],[1,"phpVersionColumn","hidden-xs"],[1,"phpVersionContainer"],["class","phpDropdown",4,"ngIf"],[1,"inheritCheckbox"],["type","checkbox",3,"id","ngModel","disabled","change","ngModelChange"],[1,"checkboxLabel",3,"id","innerHtml"],[1,"hidden-xs","fpmToggleColumn"],[3,"id","onText","offText","toggleState","labelPosition","isDisabled","toggleStatus",4,"ngIf","ngIfElse"],["unavailable",""],["class","btn btn-outline-primary btn-sm fpmSettings mobile-float","type","button",3,"id","click",4,"ngIf"],["type","button",1,"btn","btn-outline-primary","btn-sm","visible-xs","mobile-float",3,"id","click"],["aria-hidden","true",1,"fas","fa-wrench"],[1,"phpDropdown"],[3,"id","selectedPhpVersion","mode","disabled","phpVersionChanged"],["class","processing-spinner",4,"ngIf"],[1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],[3,"id","onText","offText","toggleState","labelPosition","isDisabled","toggleStatus"],["type","button",1,"btn","btn-default","btn-sm",3,"id","disabled","click"],["aria-hidden","true",1,"fas","fa-ban"],["type","button",1,"btn","btn-outline-primary","btn-sm","fpmSettings","mobile-float",3,"id","click"]],template:function(e,n){if(1&e&&(t.TgZ(0,"td",0)(1,"input",1),t.NdJ("ngModelChange",function(r){return n.rowData.selected=r})("change",function(){return n.selectionChanged()}),t.qZA()(),t.TgZ(2,"td",2)(3,"div",3)(4,"button",4),t.NdJ("click",function(){return n.openDetails(n.rowData)}),t._UZ(5,"i",5),t.qZA()(),t.TgZ(6,"span",6),t._uU(7),t.qZA()(),t.TgZ(8,"td",7),t._uU(9),t.qZA(),t.TgZ(10,"td",8)(11,"div",9),t.YNc(12,un,3,5,"div",10),t.TgZ(13,"label",11)(14,"input",12),t.NdJ("change",function(){return n.onInheritCheckChanged()})("ngModelChange",function(r){return n.rowData.wantToInherit=r}),t.qZA(),t._UZ(15,"span",13),t.qZA()()(),t.TgZ(16,"td",14),t.YNc(17,_n,1,6,"cp-toggle-switch",15),t.YNc(18,fn,3,3,"ng-template",null,16,t.W1O),t.qZA(),t.TgZ(20,"td"),t.YNc(21,Pn,3,2,"button",17),t.TgZ(22,"button",18),t.NdJ("click",function(){return n.openDetails(n.rowData)}),t._UZ(23,"span",19),t._uU(24),t.qZA()()),2&e){const o=t.MAs(19);t.xp6(1),t.Q6J("ngModel",n.rowData.selected),t.uIk("aria-label",n.locale.maketext("Select single row.")),t.xp6(3),t.MGl("id","",n.rowData.model.vhost,"-open-details"),t.xp6(1),t.Q6J("ngClass",n.displayDetailsCss),t.xp6(2),t.Oqu(n.rowData.model.vhost),t.xp6(2),t.hij(" ",n.rowData.model.account,"\n"),t.xp6(3),t.Q6J("ngIf",!n.rowData.isInherit),t.xp6(2),t.MGl("id","",n.rowData.model.vhost,"-inherit-checkbox"),t.Q6J("ngModel",n.rowData.wantToInherit)("disabled",n.disableRow()),t.uIk("aria-label",n.locale.maketext("Toggle [asis,PHP] version inherit.")),t.xp6(1),t.MGl("id","",n.rowData.model.vhost,"-inherit-label-text"),t.Q6J("innerHtml",n.showInheritLabel(n.rowData),t.oJD),t.xp6(2),t.Q6J("ngIf",n.isFpmEligible)("ngIfElse",o),t.xp6(4),t.Q6J("ngIf",n.showFpmSettingsButton),t.xp6(1),t.MGl("id","",n.rowData.model.vhost,"-manage"),t.xp6(2),t.hij(" ",n.locale.maketext("Manage")," ")}},directives:[m.Wl,m.JJ,m.On,h.mk,h.O5,U,a.MF],styles:[".phpVersionContainer[_ngcontent-%COMP%]{width:100%;display:inline-block}.inheritCheckbox[_ngcontent-%COMP%]{padding-top:4px;display:inline-block}.phpDropdown[_ngcontent-%COMP%]{display:inline-block}html[dir=ltr][_ngcontent-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%]{padding-right:10px}html[dir=rtl][_ngcontent-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .phpDropdown[_ngcontent-%COMP%]{padding-left:10px}.checkboxLabel[_ngcontent-%COMP%]{font-weight:400!important}html[dir=ltr][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%]{padding-left:4px}html[dir=rtl][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%]{padding-right:4px}.openDetailsColumn[_ngcontent-%COMP%]{cursor:pointer;color:#2980b9}html[dir=ltr][_ngcontent-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%]{padding-left:5px}html[dir=rtl][_ngcontent-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .processing-spinner[_ngcontent-%COMP%]{padding-right:5px}.domain-name[_ngcontent-%COMP%]{display:table-cell}"]}),i})();function Cn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"section")(1,"p"),t._uU(2),t.qZA(),t.TgZ(3,"multiphp-mgr-php-dropdown",8),t.NdJ("phpVersionChanged",function(o){t.CHM(e);const r=t.oxw();return r.domainList.updateNewPhpVersionInDomainRow(o,r.rowData)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(2),t.hij(" ",e.locale.maketext("Select a [asis,PHP] version and click \u201cApply\u201d to finish the process.")," "),t.xp6(1),t.MGl("id","",e.rowData.model.vhost,"-move-from-inherit-php"),t.Q6J("selectedPhpVersion",e.rowData.newPhpVersionToMoveFromInherit)("mode",e.dropdown)}}let gt=(()=>{class i{constructor(e,n){this.locale=e,this.domainList=n,this.confirmInheritStateChanged=new t.vpe,this.cancelInheritStateChange=new t.vpe}ngOnInit(){}handleApplyInheritState(){this.confirmInheritStateChanged.emit(this.rowData)}handleCancelInherit(){this.cancelInheritStateChange.emit(this.rowData)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(q))},i.\u0275cmp=t.Xpm({type:i,selectors:[["multiphp-mgr-inherit-warning"]],inputs:{rowData:"rowData",calloutCss:"calloutCss"},outputs:{confirmInheritStateChanged:"confirmInheritStateChanged",cancelInheritStateChange:"cancelInheritStateChange"},decls:11,vars:12,consts:[["calloutType","warning",3,"id","ngClass"],[1,"display-table"],[1,"display-table-cell"],[1,"box"],[1,"inherit-message","wordbreak",3,"innerHtml"],[4,"ngIf"],[3,"id","buttonClass","buttonState","title","click"],["type","button",1,"btn","btn-link","btn-sm",3,"id","click"],[3,"id","selectedPhpVersion","mode","phpVersionChanged"]],template:function(e,n){1&e&&(t.TgZ(0,"cp-callout",0)(1,"div",1)(2,"div",2)(3,"div",3),t._UZ(4,"p",4),t.YNc(5,Cn,4,4,"section",5),t.qZA(),t.TgZ(6,"div",3)(7,"cp-action-button",6),t.NdJ("click",function(){return n.handleApplyInheritState()}),t._uU(8),t.qZA(),t.TgZ(9,"button",7),t.NdJ("click",function(){return n.handleCancelInherit()}),t._uU(10),t.qZA()()()()()),2&e&&(t.MGl("id","",n.rowData.model.vhost,"-domain-inherit-prompt-row"),t.Q6J("ngClass",n.calloutCss),t.xp6(4),t.Q6J("innerHtml",n.rowData.showInheritPromptMessage,t.oJD),t.xp6(1),t.Q6J("ngIf",n.rowData.showInheritPrompt&&!n.rowData.wantToInherit),t.xp6(2),t.MGl("id","",n.rowData.model.vhost,"-inherit-apply-button"),t.s9C("title",n.locale.maketext("Click here to apply the selected [asis,PHP] version.")),t.Q6J("buttonClass",n.rowData.applyInheritButton.buttonClass)("buttonState",n.rowData.applyInheritButton.buttonState),t.uIk("aria-label",n.locale.maketext("Apply inherit.")),t.xp6(1),t.hij(" ",n.locale.maketext("Apply")," "),t.xp6(1),t.MGl("id","",n.rowData.model.vhost,"-cancel-inherit"),t.xp6(1),t.hij(" ",n.locale.maketext("Cancel")," "))},directives:[a.Oc,h.mk,h.O5,U,a.xV],styles:[".rowCalloutCss[_ngcontent-%COMP%] .callout{margin:-10px}"]}),i})();const bn=["multiphp-mgr-user-domain-details",""];function xn(i,s){1&i&&(t.TgZ(0,"div",20),t._UZ(1,"i",21),t.qZA())}function Mn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",17)(1,"multiphp-mgr-php-dropdown",18),t.NdJ("phpVersionChanged",function(o){t.CHM(e);const r=t.oxw();return r.detailsChangePhpVersion(o,r.rowData)}),t.qZA(),t.YNc(2,xn,2,0,"div",19),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.MGl("id","",e.rowData.model.vhost,"-domain-php-details"),t.Q6J("selectedPhpVersion",e.rowData.model.phpVersion)("mode",e.dropdown)("disabled",e.rowData.inheritInProcess),t.xp6(1),t.Q6J("ngIf",e.rowData.phpVersionChangeInProcess)}}function vn(i,s){if(1&i&&(t.TgZ(0,"div",4)(1,"span",2),t._UZ(2,"i",22),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.hij(" ",e.locale.maketext("You are using an outdated PHP Version. Update to a supported version.")," ")}}function On(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"multiphp-mgr-inherit-warning",23),t.NdJ("confirmInheritStateChanged",function(o){return t.CHM(e),t.oxw().handleApplyInheritState(o)})("cancelInheritStateChange",function(o){return t.CHM(e),t.oxw().handleCancelInherit(o)}),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("rowData",e.rowData)}}function wn(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"cp-toggle-switch",24),t.NdJ("toggleStatus",function(){t.CHM(e);const o=t.oxw();return o.detailsToggleFpm(o.rowData)}),t.qZA()}if(2&i){const e=t.oxw();t.MGl("id","",e.rowData.model.vhost,"-domain-FPM-details"),t.s9C("onText",e.locale.maketext("Enabled")),t.s9C("offText",e.locale.maketext("Disabled")),t.Q6J("toggleState",e.rowData.domainFpmToggle.toggleState)("labelPosition",e.rowData.domainFpmToggle.labelPosition)}}function Sn(i,s){if(1&i&&(t._UZ(0,"span",25),t._uU(1)),2&i){const e=t.oxw();t.xp6(1),t.hij(" ",e.locale.maketext("Unavailable")," ")}}function kn(i,s){if(1&i&&(t.TgZ(0,"div",4)(1,"span",2),t._UZ(2,"i",26),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.hij(" ",e.locale.maketext("You cannot enable [asis,PHP FPM] on a domain that inherits a [asis,PHP] version.")," ")}}function Tn(i,s){if(1&i&&(t.TgZ(0,"div",4)(1,"span",2),t._UZ(2,"i",26),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.hij(" ",e.locale.maketext("You must install the [asis,PHP-FPM] package in order to use [asis,PHP-FPM].")," ")}}let Fn=(()=>{class i{constructor(e,n,o,r){this.locale=e,this.userDomain=n,this.domainList=o,this.phpVersionService=r,this.inheritStateChanged=new t.vpe,this.confirmInheritStateChanged=new t.vpe,this.cancelInheritStateChange=new t.vpe,this.rowPhpVersionChanged=new t.vpe,this.outdatedWarning=!1}get outdatedWarningCheck(){return!!this.rowData.model.phpVersion.isOutdated}get isFpmEligible(){return!this.rowData.isInherit&&this.phpVersionService.isPhpFpmInstalled(`${this.rowData.model.phpVersion.version}-php-fpm`)}get showOutdatedPill(){return!(!this.rowData.model.phpVersion.isOutdated||!this.rowData.isInherit)}ngOnInit(){}closeDetails(e){e.displayDetails=!e.displayDetails,e.domainFpmToggle.isDisabled=!e.domainFpmToggle.isDisabled}showInheritLabel(e){return this.userDomain.showInheritLabel(e)}detailsInheritCheckChanged(){this.rowData.inheritInProcess=!0,this.inheritStateChanged.emit(this.rowData)}handleApplyInheritState(){this.confirmInheritStateChanged.emit(this.rowData)}handleCancelInherit(){this.cancelInheritStateChange.emit(this.rowData)}detailsToggleFpm(e){this.userDomain.toggleFpm(e)}detailsChangePhpVersion(e,n){n.model.phpVersion=e,this.rowPhpVersionChanged.emit(n)}}return i.\u0275fac=function(e){return new(e||i)(t.Y36(b.g),t.Y36(tt),t.Y36(q),t.Y36(v))},i.\u0275cmp=t.Xpm({type:i,selectors:[["","multiphp-mgr-user-domain-details",""]],inputs:{rowData:"rowData"},outputs:{inheritStateChanged:"inheritStateChanged",confirmInheritStateChanged:"confirmInheritStateChanged",cancelInheritStateChange:"cancelInheritStateChange",rowPhpVersionChanged:"rowPhpVersionChanged"},features:[t._Bn([tt,q])],attrs:bn,decls:38,vars:21,consts:[[1,"list-panel"],[1,"row"],[1,"col-xs-12"],["aria-hidden","true",1,"fas","fa-times","pull-right","flip",3,"click"],[1,"row","details-data-row"],[1,"col-xs-12","col-sm-2"],[1,"col-xs-12","col-sm-10"],[1,"phpVersionContainer","row"],["class","phpDropdown",4,"ngIf"],[1,"inheritCheckbox"],["type","checkbox",3,"id","ngModel","disabled","change","ngModelChange"],[1,"checkboxLabel",3,"id","innerHtml"],["class","row details-data-row",4,"ngIf"],[3,"rowData","confirmInheritStateChanged","cancelInheritStateChange",4,"ngIf"],[1,"phpFpmContainer","row"],[3,"id","onText","offText","toggleState","labelPosition","toggleStatus",4,"ngIf","ngIfElse"],["unavailable",""],[1,"phpDropdown"],[3,"id","selectedPhpVersion","mode","disabled","phpVersionChanged"],["class","processing-spinner",4,"ngIf"],[1,"processing-spinner"],["aria-hidden","true",1,"fas","fa-spinner","fa-spin","spinner"],["aria-hidden","true",1,"fas","fa-exclamation-triangle","warning"],[3,"rowData","confirmInheritStateChanged","cancelInheritStateChange"],[3,"id","onText","offText","toggleState","labelPosition","toggleStatus"],["aria-hidden","true",1,"fas","fa-ban"],["aria-hidden","true",1,"fas","fa-info-circle","info"]],template:function(e,n){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"i",3),t.NdJ("click",function(){return n.closeDetails(n.rowData)}),t.qZA()()(),t.TgZ(4,"div",4)(5,"label",5),t._uU(6),t.qZA(),t.TgZ(7,"span",6),t._uU(8),t.qZA()(),t.TgZ(9,"div",4)(10,"label",5),t._uU(11),t.qZA(),t.TgZ(12,"span",6),t._uU(13),t.qZA()(),t.TgZ(14,"div",4)(15,"label",5),t._uU(16),t.qZA(),t.TgZ(17,"span",6),t._uU(18),t.qZA()(),t.TgZ(19,"div",7)(20,"label",5),t._uU(21),t.qZA(),t.TgZ(22,"div",6),t.YNc(23,Mn,3,5,"span",8),t.TgZ(24,"label",9)(25,"input",10),t.NdJ("change",function(){return n.detailsInheritCheckChanged()})("ngModelChange",function(r){return n.rowData.wantToInherit=r}),t.qZA(),t._UZ(26,"span",11),t.qZA()()(),t.YNc(27,vn,4,1,"div",12),t.YNc(28,On,1,1,"multiphp-mgr-inherit-warning",13),t.TgZ(29,"div",14)(30,"label",5),t._uU(31),t.qZA(),t.TgZ(32,"div",6),t.YNc(33,wn,1,5,"cp-toggle-switch",15),t.YNc(34,Sn,2,1,"ng-template",null,16,t.W1O),t.qZA()(),t.YNc(36,kn,4,1,"div",12),t.YNc(37,Tn,4,1,"div",12),t.qZA()),2&e){const o=t.MAs(35);t.xp6(6),t.Oqu(n.locale.maketext("Domain")),t.xp6(2),t.Oqu(n.rowData.model.vhost),t.xp6(3),t.Oqu(n.locale.maketext("Account")),t.xp6(2),t.Oqu(n.rowData.model.account),t.xp6(3),t.Oqu(n.locale.maketext("Account Owner")),t.xp6(2),t.Oqu(n.rowData.model.accountOwner),t.xp6(3),t.Oqu(n.locale.maketext("PHP Version")),t.xp6(2),t.Q6J("ngIf",!n.rowData.isInherit),t.xp6(2),t.MGl("id","",n.rowData.model.vhost,"-inherit-checkbox-details"),t.Q6J("ngModel",n.rowData.wantToInherit)("disabled",n.rowData.inheritInProcess),t.uIk("aria-label",n.locale.maketext("Toggle [asis,PHP] version inherit.")),t.xp6(1),t.MGl("id","",n.rowData.model.vhost,"-inherit-label-text-details"),t.Q6J("innerHtml",n.showInheritLabel(n.rowData),t.oJD),t.xp6(1),t.Q6J("ngIf",n.outdatedWarningCheck),t.xp6(1),t.Q6J("ngIf",n.rowData.showInheritPrompt&&n.rowData.displayDetails),t.xp6(3),t.Oqu(n.locale.maketext("[asis,PHP-FPM]")),t.xp6(2),t.Q6J("ngIf",n.isFpmEligible)("ngIfElse",o),t.xp6(3),t.Q6J("ngIf",n.rowData.isInherit),t.xp6(1),t.Q6J("ngIf",!n.isFpmEligible&&!n.rowData.isInherit)}},directives:[h.O5,U,m.Wl,m.JJ,m.On,gt,a.MF],styles:[".checkboxLabel[_ngcontent-%COMP%]{font-weight:400!important}html[dir=ltr][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%]{padding-left:4px}html[dir=rtl][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .checkboxLabel[_ngcontent-%COMP%]{padding-right:4px}.phpVersionContainer[_ngcontent-%COMP%]{width:100%;display:inline-block}.inheritCheckbox[_ngcontent-%COMP%]{padding-top:4px}html[dir=ltr][_ngcontent-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%]{padding-left:10px}html[dir=rtl][_ngcontent-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .inheritCheckbox[_ngcontent-%COMP%]{padding-right:10px}.list-panel[_ngcontent-%COMP%]{overflow:inherit}html[dir=ltr][_ngcontent-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .list-panel[_ngcontent-%COMP%]{padding-left:50px;padding-right:5px}html[dir=rtl][_ngcontent-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .list-panel[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .list-panel[_ngcontent-%COMP%]{padding-right:50px;padding-left:5px}.details-data-row[_ngcontent-%COMP%]{padding-bottom:5px}.warning[_ngcontent-%COMP%]{color:#f6c342}.info[_ngcontent-%COMP%]{color:#179bd7}"]}),i})(),mt=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({providers:[],imports:[[h.ez,w.mr.forRoot(),T.m,a.df,a.zr,R]]}),i})();var ut=g(2521);let yn=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i,bootstrap:[ct]}),i.\u0275inj=t.cJS({providers:[a.c9],imports:[[h.ez,w.mr.forRoot(),Y.Fq.forRoot(),T.m,a.nM,a.df,a.CQ,a.Op,m.u5,R,a.zr,mt,a.t8,ut.u3.forRoot()]]}),i})();t.B6R(q,[h.O5,a.Oc,a.gS,ut.Qt,m.JJ,m.On,m.Wl,U,a.xV,w.TO,w.Mq,w.Hz,Y.pj,h.sg,Y.lz,h.mk,tt,Fn,gt],[]);let Dn=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({providers:[],imports:[[h.ez,T.m,a.kM]]}),i})(),In=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[[h.ez]]}),i})(),Zn=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i,bootstrap:[K]}),i.\u0275inj=t.cJS({providers:[a.c9],imports:[[T.m,h.ez,a.df,a.zf,a.nM,a.CQ,a.zr,a.Op,m.u5,a.wL,Dn,a.kM,In,X.A0]]}),i})(),Hn=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i}),i.\u0275inj=t.cJS({imports:[[h.ez,T.m]]}),i})(),An=(()=>{class i{}return i.\u0275fac=function(e){return new(e||i)},i.\u0275mod=t.oAB({type:i,bootstrap:[cn]}),i.\u0275inj=t.cJS({providers:[{provide:h.mr,useValue:window.PAGE.base}],imports:[[hn,yn,Zn,R,mt,dt,Hn,V.b2,_t.PW,h.ez,dn.JF,en,T.m,a.CQ,j.P4.forRoot(),m.u5]]}),i})();(0,t.G48)(),V.q6().bootstrapModule(An).catch(i=>console.error(i))}},L=>{L.O(0,[736],()=>L(L.s=9086)),L.O()}]);
Back to Directory
File Manager