Viewing File: /usr/local/cpanel/whostmgr/docroot/templates/account-enhancements/main.js
"use strict";(self.webpackChunkaccount_enhancements=self.webpackChunkaccount_enhancements||[]).push([[179],{6027:(p,O,c)=>{var b=c(1481),t=c(5062),s=c(6895),m=c(6507),h=c(269),x=c(537),T=c(2986),g=(()=>{return(e=g||(g={})).name="name",e.limit="limit",e.id="id",g;var e})(),f=c(7800),S=c(7709),v=c(4850),d=(()=>{return(e=d||(d={})).module="AccountEnhancements",e.list="list_account_enhancements",d;var e})(),y=c(5419);let P=(()=>{class e{constructor(n){this._whmApiClient=n}listAccountEnhancements(n){const o=new f.r(f.N.JsonApi,{method:d.list,arguments:[new S.h("module",d.module)],...n});return this._whmApiClient.get(o).pipe((0,v.U)(i=>{if(i.success)return i;throw i.errors}))}}return e.\u0275fac=function(n){return new(n||e)(t.LFG(y.A4))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var M=c(3357),u=c(755);let _=(()=>{class e{constructor(){this.pagination={pageSize:20,selectedPage:1,disabled:!1,totalRecords:0,recordsBeforeFilter:0},this.sorts=[],this._loading=!1}get loading(){return this._loading}set loading(n){this._loading=n}updateSelectedPage(n){this.pagination.selectedPage=n}updatePageSize(n){this.pagination.pageSize=n}updateSearchFilter(n,o){this.filters=[new M.w(n,M.p.Contains,o)],this.pagination.selectedPage=1}changeSort(n){const o=this.sorts?.find(i=>i.column===n);o&&(o.direction=this._changeSortDirection(o.direction)),this.sorts=[new u.PE(n,o?.direction||u.Sr.Ascending)]}getTableMetadata(){return{pager:{page:this.pagination.selectedPage,pageSize:this.pagination.pageSize},filters:this.filters,sorts:this.sorts}}getSortColumn(){return this.sorts[0]?.column}sortedInAscendingOrder(){return this.sorts[0]?.direction===u.Sr.Ascending}_changeSortDirection(n){return n===u.Sr.Ascending?u.Sr.Descending:u.Sr.Ascending}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var r=c(1781),k=c(7489),C=c(6775);function z(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"ul",5)(1,"li",6)(2,"div")(3,"cp-page-size-selector",7),t.NdJ("optionSelected",function(i){return t.CHM(n),t.oxw().pageSizeChanged.emit(i)}),t.qZA()()(),t._UZ(4,"li",8),t.TgZ(5,"li",6)(6,"a",9),t.NdJ("click",function(){return t.CHM(n),t.oxw().refreshClicked.emit()}),t._UZ(7,"i",10),t._uU(8),t.qZA()()()}if(2&e){const n=t.oxw();t.xp6(3),t.Q6J("pageSizeOptions",n.pageSizes)("selectedPageSize",null==n.tableService?null:n.tableService.pagination.pageSize),t.xp6(5),t.hij(" ",n.locale.maketext("Refresh")," ")}}let Z=(()=>{class e{constructor(n,o){this.tableService=n,this.locale=o,this.pageSizes=[20,50,100],this.pageSizeChanged=new t.vpe,this.refreshClicked=new t.vpe}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(_),t.Y36(h.g))},e.\u0275cmp=t.Xpm({type:e,selectors:[["cp-page-size-selector-dropdown"]],inputs:{pageSizes:"pageSizes"},outputs:{pageSizeChanged:"pageSizeChanged",refreshClicked:"refreshClicked"},decls:5,vars:1,consts:[["dropdown","","auto-close","outsideClick",1,"btn-group"],["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"],["id","table-settings-menu","role","menu","aria-labelledby","table-settings-dropdown",1,"dropdown-menu","dropdown-menu-right"],["role","menuitem"],["id","page-size-selector",3,"pageSizeOptions","selectedPageSize","optionSelected"],[1,"divider"],["id","page-size-selector__refresh",3,"click"],[1,"fas","fa-sync-alt"]],template:function(n,o){1&n&&(t.TgZ(0,"div",0)(1,"button",1),t._UZ(2,"i",2)(3,"span",3),t.qZA(),t.YNc(4,z,9,3,"ul",4),t.qZA()),2&n&&(t.xp6(1),t.uIk("aria-label",o.locale.maketext("Table Settings")))},directives:[C.TO,C.Mq,C.Hz,r.k6],styles:[""]}),e})();function A(e,a){if(1&e&&t._UZ(0,"i",11),2&e){const n=t.oxw(2).$implicit,o=t.oxw();t.ekj("icon-arrow-up",o.tableService.sortedInAscendingOrder())("icon-arrow-down",!o.tableService.sortedInAscendingOrder()),t.uIk("title",n.label)}}function F(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"button",8),t.NdJ("click",function(){t.CHM(n);const i=t.oxw().$implicit;return t.oxw().sort.emit(i.key)}),t.TgZ(1,"span",9),t._uU(2),t.qZA(),t.YNc(3,A,1,5,"i",10),t.qZA()}if(2&e){const n=t.oxw(),o=n.index,i=n.$implicit,l=t.oxw();t.hYB("id","column-button__",o,"-",i.key,""),t.xp6(2),t.Oqu(i.label),t.xp6(1),t.Q6J("ngIf",i.key===l.tableService.getSortColumn())}}function I(e,a){if(1&e&&(t.TgZ(0,"span",9),t._uU(1),t.qZA()),2&e){const n=t.oxw().$implicit;t.xp6(1),t.Oqu(n.label)}}const R=function(e){return{width:e}};function J(e,a){if(1&e&&(t.TgZ(0,"th",5),t.YNc(1,F,4,4,"button",6),t.YNc(2,I,2,1,"span",7),t.qZA()),2&e){const n=a.$implicit,o=t.oxw();t.Q6J("ngStyle",t.VKq(3,R,100/o.columns.length+"%")),t.xp6(1),t.Q6J("ngIf",n.sortable),t.xp6(1),t.Q6J("ngIf",!n.sortable)}}function Y(e,a){if(1&e&&(t.TgZ(0,"tr",12)(1,"td"),t._UZ(2,"span",13),t._uU(3," \xa0 "),t.TgZ(4,"span",14),t._uU(5),t.qZA()()()),2&e){const n=t.oxw();t.xp6(1),t.uIk("colspan",n.emptyRowColSpan),t.xp6(4),t.Oqu(n.locale.maketext("Loading \u2026"))}}function N(e,a){if(1&e&&(t.TgZ(0,"tr",15)(1,"td"),t._uU(2),t.qZA()()),2&e){const n=t.oxw();t.xp6(1),t.uIk("colspan",n.emptyRowColSpan),t.xp6(1),t.Oqu(n.noResultsReason)}}function Q(e,a){if(1&e&&(t.TgZ(0,"td",18),t._uU(1),t.qZA()),2&e){const n=a.$implicit,o=t.oxw(2),i=o.index,l=o.$implicit,ot=t.oxw();t.uIk("data-test",ot.getId(i,l,n.key)),t.xp6(1),t.hij(" ",l[n.key]||"-"," ")}}function D(e,a){if(1&e&&(t.TgZ(0,"tr"),t.YNc(1,Q,2,2,"td",17),t.qZA()),2&e){const n=t.oxw(),o=n.index,i=n.$implicit,l=t.oxw();t.uIk("data-test",l.getId(o,i,"row")),t.xp6(1),t.Q6J("ngForOf",l.columns)("ngForTrackBy",l.trackByFn)}}function B(e,a){if(1&e&&(t.ynx(0),t.YNc(1,D,2,3,"tr",16),t.BQk()),2&e){const n=a.$implicit,o=t.oxw();t.xp6(1),t.Q6J("ngIf",o.columnKeyExists(n))}}let U=(()=>{class e{constructor(n,o){this.tableService=n,this.locale=o,this.sort=new t.vpe,this.defaultConfig={stackable:!0,striped:!0},this.sortDirection=u.Sr,this.config=this.defaultConfig}get noResultsReason(){const n=this.tableService.loading,o=this.rows?.length,i=this.tableService.pagination?.recordsBeforeFilter;return n||o||i?n||o||!i?null:this.noQueryResultMessage||this.locale.maketext("No results match your query."):this.noResultsMessage||this.locale.maketext("No results available.")}ngOnInit(){this.emptyRowColSpan=this.columns?.length+1}columnKeyExists(n){return this.columns.some(o=>Object.keys(n).includes(o.key))}trackByFn(n){return n}getId(n,o,i){const l=`${i}-${n}`;return this.rowKeyData?`${l}_${encodeURI(o[this.rowKeyData])}`:l}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(_),t.Y36(h.g))},e.\u0275cmp=t.Xpm({type:e,selectors:[["cp-table"]],inputs:{columns:"columns",rows:"rows",rowKeyData:"rowKeyData",noResultsMessage:"noResultsMessage",noQueryResultMessage:"noQueryResultMessage",config:"config"},outputs:{sort:"sort"},decls:8,vars:10,consts:[[1,"ui","table"],[3,"ngStyle",4,"ngFor","ngForOf","ngForTrackBy"],["class","info empty-row","id","loadingRow",4,"ngIf"],["class","info empty-row","id","emptySearchRow",4,"ngIf"],[4,"ngFor","ngForOf","ngForTrackBy"],[3,"ngStyle"],["class","column-button btn btn-link p-0",3,"id","click",4,"ngIf"],["class","column-label separator",4,"ngIf"],[1,"column-button","btn","btn-link","p-0",3,"id","click"],[1,"column-label","separator"],["ngClass","column-icon",3,"icon-arrow-up","icon-arrow-down",4,"ngIf"],["ngClass","column-icon"],["id","loadingRow",1,"info","empty-row"],[1,"fas","fa-spinner","fa-spin"],[1,"loading-text"],["id","emptySearchRow",1,"info","empty-row"],[4,"ngIf"],["class","td",4,"ngFor","ngForOf","ngForTrackBy"],[1,"td"]],template:function(n,o){1&n&&(t.TgZ(0,"table",0)(1,"thead")(2,"tr"),t.YNc(3,J,3,5,"th",1),t.qZA()(),t.TgZ(4,"tbody"),t.YNc(5,Y,6,2,"tr",2),t.YNc(6,N,3,2,"tr",3),t.YNc(7,B,2,1,"ng-container",4),t.qZA()()),2&n&&(t.ekj("table-striped",o.config.striped)("unstackable",!o.config.stackable),t.xp6(3),t.Q6J("ngForOf",o.columns)("ngForTrackBy",o.trackByFn),t.xp6(2),t.Q6J("ngIf",o.tableService.loading),t.xp6(1),t.Q6J("ngIf",o.noResultsReason),t.xp6(1),t.Q6J("ngForOf",o.rows)("ngForTrackBy",o.trackByFn))},directives:[s.sg,s.PC,s.O5,s.mk],styles:[".table[_ngcontent-%COMP%]{table-layout:fixed;border-collapse:separate}.column-button[_ngcontent-%COMP%]{position:relative;padding:0}.column-button[_ngcontent-%COMP%]:hover > span[_ngcontent-%COMP%]{text-decoration:underline}.column-button[_ngcontent-%COMP%]:focus{outline:none}.column-label[_ngcontent-%COMP%]{display:inline-block}html[dir=ltr][_ngcontent-%COMP%] .column-label[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .column-label[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .column-label[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .column-label[_ngcontent-%COMP%]{margin-right:10px}html[dir=rtl][_ngcontent-%COMP%] .column-label[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .column-label[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .column-label[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .column-label[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .column-label[_ngcontent-%COMP%]{margin-left:10px}.column-icon[_ngcontent-%COMP%]{position:absolute;top:10px}thead[_ngcontent-%COMP%]{position:sticky;top:0;background:#fff}thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{padding:0 8px;background:#fff;background-clip:content-box}@media only screen and (max-width: 767px){.ui.table[_ngcontent-%COMP%]:not(.unstackable) thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:1px solid #323232;border-bottom:2px solid #323232;padding:0}.ui.table[_ngcontent-%COMP%]:not(.unstackable){width:100%;border-radius:.25rem}.ui.table[_ngcontent-%COMP%]:not(.unstackable) tbody[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{width:auto!important;display:block!important}.ui.table[_ngcontent-%COMP%]:not(.unstackable){padding:0}.ui.table[_ngcontent-%COMP%]:not(.unstackable) thead[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable) tfoot[_ngcontent-%COMP%]{display:block}.ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row){padding-top:1em;padding-bottom:1em;box-shadow:0 -1px #0000001a inset!important}.ui.table-striped.table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n), .ui.table-striped.table[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#f9f9f9}.ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{border:none!important;padding-top:0;padding-bottom:0;box-shadow:none!important}html[dir=ltr][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=ltr][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:0 0}html[dir=rtl][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%]:not(.empty-row) > td[_ngcontent-%COMP%], html[dir=rtl][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .ui.table[_ngcontent-%COMP%]:not(.unstackable) tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:100% 0}.ui.definition.table[_ngcontent-%COMP%]:not(.unstackable) thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child{box-shadow:none!important}}"]}),e})();function L(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",8)(1,"cp-search",9),t.NdJ("valueChange",function(i){return t.CHM(n),t.oxw(2).filterRows(i)}),t.qZA()()}if(2&e){const n=t.oxw(2);t.xp6(1),t.Q6J("autofocus",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.autofocus)("debounce",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.debounce)("disabled",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.disabled)("id",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.id)("label",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.label)("list",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.list)("placeholder",null==n.config||null==n.config.search||null==n.config.search.params?null:n.config.search.params.placeholder)}}function q(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"div",10)(1,"cp-pagination",11),t.NdJ("pageChanged",function(i){return t.CHM(n),t.oxw(2).pageChange(i)}),t.qZA()()}if(2&e){const n=t.oxw(2);t.xp6(1),t.Q6J("disabled",n.tableService.pagination.disabled)("maxPagesVisible",n.tableService.pagination.maxPagesVisible||3)("pageSize",n.tableService.pagination.pageSize)("selectedPage",n.tableService.pagination.selectedPage)("totalItems",n.tableService.pagination.totalRecords)}}function j(e,a){if(1&e&&(t.TgZ(0,"div",5),t.YNc(1,L,2,7,"div",6),t.YNc(2,q,2,5,"div",7),t.qZA()),2&e){const n=t.oxw();t.xp6(1),t.Q6J("ngIf",!(null!=n.config&&null!=n.config.search&&n.config.search.hide)),t.xp6(1),t.Q6J("ngIf",!(null!=n.config&&null!=n.config.pagination&&n.config.pagination.hide))}}const E=function(){return["/create"]};function $(e,a){if(1&e&&(t.TgZ(0,"a",12),t._UZ(1,"i",13),t._uU(2),t.qZA()),2&e){const n=t.oxw();t.Q6J("routerLink",t.DdM(3,E)),t.uIk("disabled",!(null!=n.config&&null!=n.config.create&&n.config.create.disabled)),t.xp6(2),t.hij(" ",n.locale.maketext(null==n.config?null:n.config.create.label)," ")}}function K(e,a){if(1&e){const n=t.EpF();t.TgZ(0,"cp-page-size-selector-dropdown",14),t.NdJ("pageSizeChanged",function(i){return t.CHM(n),t.oxw().pageSizeChange(i)})("refreshClicked",function(){return t.CHM(n),t.oxw().updateTable()}),t.qZA()}}let H=(()=>{class e{constructor(n,o){this.locale=n,this.tableService=o,this.update=new t.vpe,this.defaultConfig={create:{disabled:!1,hide:!1,label:"Create"},search:{async:!0,column:"*",hide:!1,params:{autofocus:!1,debounce:400,disabled:!1,id:"search",label:"Search",list:"",placeholder:""}}}}set rows(n){n&&(this.rowData=n,this._initialRows=n)}static _filterValuesOfObject(n,o){return n?.filter(i=>Object.values(i).some(l=>l.toString().toLowerCase().includes(o.toLowerCase())))}ngOnInit(){this.config=k.merge({},this.defaultConfig,this.config)}pageChange(n){n.page!==this.tableService.pagination.selectedPage&&(this.tableService.updateSelectedPage(n.page),this.updateTable())}pageSizeChange(n){this.tableService.updatePageSize(n),this.updateTable()}sortChange(n){this.tableService.changeSort(n),this.updateTable()}filterRows(n){this.config?.search?.async?this._asyncFilter(n):this._syncFilter(n)}updateTable(){this.rows=[],this.update.emit()}_asyncFilter(n){this.tableService.updateSearchFilter(this.config.search.column,n),this.updateTable()}_syncFilter(n){this.rowData=n?e._filterValuesOfObject(this._initialRows,n):[...this._initialRows]}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(h.g),t.Y36(_))},e.\u0275cmp=t.Xpm({type:e,selectors:[["cp-table-template"]],inputs:{columns:"columns",config:"config",rows:"rows"},outputs:{update:"update"},decls:5,vars:6,consts:[["class","search-pagination-wrapper",4,"ngIf"],[1,"pull-right","flip","create-page-size-selector-wrapper"],["id","create","class","btn btn-primary btn-sm create-button",3,"routerLink",4,"ngIf"],["id","page-size-selector-dropdown",3,"pageSizeChanged","refreshClicked",4,"ngIf"],[3,"columns","rows","rowKeyData","sort"],[1,"search-pagination-wrapper"],["class","search-container",4,"ngIf"],["class","pagination-container",4,"ngIf"],[1,"search-container"],[3,"autofocus","debounce","disabled","id","label","list","placeholder","valueChange"],[1,"pagination-container"],["id","pagination",3,"disabled","maxPagesVisible","pageSize","selectedPage","totalItems","pageChanged"],["id","create",1,"btn","btn-primary","btn-sm","create-button",3,"routerLink"],["aria-hidden","true",1,"fas","fa-plus"],["id","page-size-selector-dropdown",3,"pageSizeChanged","refreshClicked"]],template:function(n,o){1&n&&(t.YNc(0,j,3,2,"div",0),t.TgZ(1,"div",1),t.YNc(2,$,3,4,"a",2),t.YNc(3,K,1,0,"cp-page-size-selector-dropdown",3),t.qZA(),t.TgZ(4,"cp-table",4),t.NdJ("sort",function(l){return o.sortChange(l)}),t.qZA()),2&n&&(t.Q6J("ngIf",!(null!=o.config&&null!=o.config.pagination&&o.config.pagination.hide&&null!=o.config&&null!=o.config.search&&o.config.search.hide)),t.xp6(2),t.Q6J("ngIf",!(null!=o.config&&null!=o.config.create&&o.config.create.hide)),t.xp6(1),t.Q6J("ngIf",!(null!=o.config&&null!=o.config.pageSizeSelector&&o.config.pageSizeSelector.hide)),t.xp6(1),t.Q6J("columns",o.columns)("rows",o.rowData)("rowKeyData",null==o.config?null:o.config.rowKeyData))},directives:[s.O5,r.gS,r.Qt,m.yS,Z,U],styles:[".search-pagination-wrapper[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.search-container[_ngcontent-%COMP%]{min-width:100px;max-width:350px;flex-basis:350px;margin-bottom:12px;flex-grow:1}.pagination-container[_ngcontent-%COMP%]{min-width:max-content}html[dir=ltr][_ngcontent-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%]{margin-left:auto}html[dir=rtl][_ngcontent-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .pagination-container[_ngcontent-%COMP%]{margin-right:auto}html[dir=ltr][_ngcontent-%COMP%] .create-button[_ngcontent-%COMP%], [dir=ltr][_ngcontent-%COMP%] .create-button[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], html[dir=ltr][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], html[dir=ltr] [_nghost-%COMP%] .create-button[_ngcontent-%COMP%], [dir=ltr][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], [dir=ltr] [_nghost-%COMP%] .create-button[_ngcontent-%COMP%]{margin-right:.5rem}html[dir=rtl][_ngcontent-%COMP%] .create-button[_ngcontent-%COMP%], [dir=rtl][_ngcontent-%COMP%] .create-button[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], html[dir=rtl][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], html[dir=rtl] [_nghost-%COMP%] .create-button[_ngcontent-%COMP%], [dir=rtl][_nghost-%COMP%] .create-button[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .create-button[_ngcontent-%COMP%]{margin-left:.5rem}.create-page-size-selector-wrapper[_ngcontent-%COMP%]{margin-bottom:12px} div#pagination>p{margin-top:0}"]}),e})(),w=(()=>{class e{constructor(n,o,i,l){this.locale=n,this._apiService=o,this._tableService=i,this._alertService=l}ngOnInit(){this._setTableColumns(),this._tableService.changeSort(g.name),this._setTableRows(),this._setTableConfig()}updateRows(){this._setTableRows()}_setTableColumns(){this.columns=[{key:g.name,label:this.locale.maketext("Name"),sortable:!0},{key:g.id,label:this.locale.maketext("Item Identifier"),sortable:!0}]}_setTableRows(){this._tableService.loading=!0,this._apiService.listAccountEnhancements(this._tableService.getTableMetadata()).pipe((0,x.x)(()=>this._tableService.loading=!1)).pipe((0,T.q)(1)).subscribe(n=>{this._tableService.pagination.totalRecords=n?.meta?.totalRecords,this._tableService.pagination.recordsBeforeFilter=n?.meta?.recordsBeforeFilter,this.rows=n.data},n=>{this._alertService.error(n.message)})}_setTableConfig(){this.tableTemplateConfig={create:{hide:!0},search:{column:g.name},rowKeyData:"name"}}}return e.\u0275fac=function(n){return new(n||e)(t.Y36(h.g),t.Y36(P),t.Y36(_),t.Y36(r.c9))},e.\u0275cmp=t.Xpm({type:e,selectors:[["cp-account-enhancements-list"]],decls:5,vars:4,consts:[["id","description",1,"description"],["id","list"],[3,"config","rows","columns","update"]],template:function(n,o){1&n&&(t._UZ(0,"cp-alert-list"),t.TgZ(1,"section",0),t._uU(2),t.qZA(),t.TgZ(3,"section",1)(4,"cp-table-template",2),t.NdJ("update",function(){return o.updateRows()}),t.qZA()()),2&n&&(t.xp6(2),t.hij(" ",o.locale.maketext("You can use this interface to view and manage your server\u2018s account enhancements."),"\n"),t.xp6(2),t.Q6J("config",o.tableTemplateConfig)("rows",o.rows)("columns",o.columns))},directives:[r.hF,H],styles:[""]}),e})();const V=[{path:"list",component:w},{path:"",redirectTo:"list",pathMatch:"full"},{path:"**",component:w,pathMatch:"full"}];let X=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[[m.Bz.forRoot(V,{relativeLinkResolution:"legacy"})],m.Bz]}),e})(),G=(()=>{class e{constructor(){this.title="account-enhancements"}}return e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=t.Xpm({type:e,selectors:[["cp-account-enhancements-root"]],decls:1,vars:0,template:function(n,o){1&n&&t._UZ(0,"router-outlet")},directives:[m.lC],styles:[""]}),e})();var W=c(529),tt=c(348),nt=c(8746);let et=(()=>{class e{}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e,bootstrap:[G]}),e.\u0275inj=t.cJS({providers:[{provide:s.mr,useValue:window.PAGE.base},P,_],imports:[[r.zr,r.CQ,tt.m,X,nt.PW,C.mr.forRoot(),s.ez,W.JF,r.RV,r.u3,r.t8]]}),e})();(0,t.G48)(),b.q6().bootstrapModule(et).catch(e=>console.error(e))}},p=>{p.O(0,[736],()=>p(p.s=6027)),p.O()}]);
Back to Directory
File Manager