1 "use strict";(self
.webpackChunkceph_dashboard
=self
.webpackChunkceph_dashboard
||[]).push([[281],{59281:(ri
,Oe
,r
)=>{r
.r(Oe
),r
.d(Oe
,{RgwModule
:()=>e_
,RoutedRgwModule
:()=>ai
});var f
=r(12057),a
=r(24751),w
=r(6283),M
=r(38549),Ue
=r(37496),A
=r(79512),O_
=r(44466),U_
=r(66265),W_
=r(23815),u
=r
.n(W_
),Y
=r(35758),Me
=r(95152),We
=r(33394),Ze
=r(64762),$e
=r(58497),me
=r(25917),he
=r(19773),Z_
=r(96736),$_
=r(5304),ge
=r(20523),h_
=r(93523),e
=r(74788);let O
=class{constructor(o
,_
){this.http
=o
,this.rgwDaemonService
=_
,this.url
="api/rgw/user"}list(){return this.enumerate().pipe((0,he
.zg
)(o
=>o
.length
>0?(0,Y
.D
)(o
.map(_
=>this.get(_
))):(0,me
.of)([])))}enumerate(){return this.rgwDaemonService
.request(o
=>this.http
.get(this.url
,{params
:o
}))}enumerateEmail(){return this.rgwDaemonService
.request(o
=>this.http
.get(`${this.url}/get_emails`,{params
:o
}))}get(o
){return this.rgwDaemonService
.request(_
=>this.http
.get(`${this.url}/${o}`,{params
:_
}))}getQuota(o
){return this.rgwDaemonService
.request(_
=>this.http
.get(`${this.url}/${o}/quota`,{params
:_
}))}create(o
){return this.rgwDaemonService
.request(_
=>(u().keys(o
).forEach(n
=>{_
=_
.append(n
,o
[n
])}),this.http
.post(this.url
,null,{params
:_
})))}update(o
,_
){return this.rgwDaemonService
.request(n
=>(u().keys(_
).forEach(i
=>{n
=n
.append(i
,_
[i
])}),this.http
.put(`${this.url}/${o}`,null,{params
:n
})))}updateQuota(o
,_
){return this.rgwDaemonService
.request(n
=>(u().keys(_
).forEach(i
=>{n
=n
.append(i
,_
[i
])}),this.http
.put(`${this.url}/${o}/quota`,null,{params
:n
})))}delete(o
){return this.rgwDaemonService
.request(_
=>this.http
.delete(`${this.url}/${o}`,{params
:_
}))}createSubuser(o
,_
){return this.rgwDaemonService
.request(n
=>(u().keys(_
).forEach(i
=>{n
=n
.append(i
,_
[i
])}),this.http
.post(`${this.url}/${o}/subuser`,null,{params
:n
})))}deleteSubuser(o
,_
){return this.rgwDaemonService
.request(n
=>this.http
.delete(`${this.url}/${o}/subuser/${_}`,{params
:n
}))}addCapability(o
,_
,n
){return this.rgwDaemonService
.request(i
=>(i
=(i
=i
.append("type",_
)).append("perm",n
),this.http
.post(`${this.url}/${o}/capability`,null,{params
:i
})))}deleteCapability(o
,_
,n
){return this.rgwDaemonService
.request(i
=>(i
=(i
=i
.append("type",_
)).append("perm",n
),this.http
.delete(`${this.url}/${o}/capability`,{params
:i
})))}addS3Key(o
,_
){return this.rgwDaemonService
.request(n
=>(n
=n
.append("key_type","s3"),u().keys(_
).forEach(i
=>{n
=n
.append(i
,_
[i
])}),this.http
.post(`${this.url}/${o}/key`,null,{params
:n
})))}deleteS3Key(o
,_
){return this.rgwDaemonService
.request(n
=>(n
=(n
=n
.append("key_type","s3")).append("access_key",_
),this.http
.delete(`${this.url}/${o}/key`,{params
:n
})))}exists(o
){return this.get(o
).pipe((0,Z_
.h
)(!0),(0,$_
.K
)(_
=>(u().isFunction(_
.preventDefault
)&&_
.preventDefault(),(0,me
.of)(!1))))}emailExists(o
){return o
=decodeURIComponent(o
),this.enumerateEmail().pipe((0,he
.zg
)(_
=>{const n
=u().indexOf(_
,o
);return(0,me
.of)(-1!==n
)}))}};O
.\u0275fac=function(o
){return new(o
||O
)(e
.LFG($e
.eN
),e
.LFG(ge
.b
))},O
.\u0275prov=e
.Yz7({token
:O
,factory
:O
.\u0275fac,providedIn
:"root"}),O
=(0,Ze
.gn
)([h_
.o
,(0,Ze
.w6
)("design:paramtypes",[$e
.eN
,ge
.b
])],O
);var D
=r(65862),Ae
=r(18001),Ie
=r(93614),m
=r(77205),ve
=r(97161),k
=(()=>{return(t
=k
||(k
={})).ENABLED
="Enabled",t
.DISABLED
="Disabled",k
;var t
})(),B
=(()=>{return(t
=B
||(B
={})).ENABLED
="Enabled",t
.SUSPENDED
="Suspended",B
;var t
})(),J
=r(62862),Fe
=r(63622),V
=r(41582),H
=r(56310),q
=r(87925),X
=r(94276),j
=r(82945),I_
=r(18372),ee
=r(30839),K
=r(10545);function v_(t
,o
){1&t
&&(e
.TgZ(0,"div",9),e
.TgZ(1,"label",35),e
.SDv(2,36),e
.qZA(),e
.TgZ(3,"div",12),e
._UZ(4,"input",37),e
.qZA(),e
.qZA())}function F_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,39),e
.qZA())}function L_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,40),e
.qZA())}function D_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,41),e
.qZA())}function y_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,42),e
.qZA())}function x_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,43),e
.qZA())}function q_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,44),e
.qZA())}function w_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,45),e
.qZA())}function k_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,46),e
.qZA())}function B_(t
,o
){1&t
&&(e
.TgZ(0,"option",47),e
.SDv(1,48),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function H_(t
,o
){1&t
&&(e
.TgZ(0,"option",47),e
.SDv(1,49),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function X_(t
,o
){if(1&t
&&(e
.TgZ(0,"option",50),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
),e
.xp6(1),e
.Oqu(_
)}}function K_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,51),e
.qZA())}function z_(t
,o
){1&t
&&(e
.TgZ(0,"option",47),e
.SDv(1,53),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function Q_(t
,o
){1&t
&&(e
.TgZ(0,"option",47),e
.SDv(1,54),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function Y_(t
,o
){if(1&t
&&(e
.TgZ(0,"option",50),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
.name
),e
.xp6(1),e
.Oqu(_
.description
)}}function J_(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,55),e
.qZA())}function V_(t
,o
){if(1&t
&&(e
.TgZ(0,"select",52),e
.YNc(1,z_
,2,1,"option",18),e
.YNc(2,Q_
,2,1,"option",18),e
.YNc(3,Y_
,2,2,"option",19),e
.qZA(),e
.YNc(4,J_
,2,0,"span",14)),2&t
){e
.oxw();const _
=e
.MAs(2),n
=e
.oxw();e
.xp6(1),e
.Q6J("ngIf",null===n
.placementTargets
),e
.xp6(1),e
.Q6J("ngIf",null!==n
.placementTargets
),e
.xp6(1),e
.Q6J("ngForOf",n
.placementTargets
),e
.xp6(1),e
.Q6J("ngIf",n
.bucketForm
.showError("placement-target",_
,"required"))}}function j_(t
,o
){1&t
&&(e
.ynx(0),e
._UZ(1,"input",56),e
.BQk())}function et(t
,o
){if(1&t
){const _
=e
.EpF();e
.TgZ(0,"fieldset"),e
.TgZ(1,"legend",25),e
.SDv(2,57),e
.qZA(),e
.TgZ(3,"div",9),e
.TgZ(4,"div",27),e
.TgZ(5,"div",28),e
.TgZ(6,"input",58),e
.NdJ("change",function(){return e
.CHM(_
),e
.oxw(2).setMfaDeleteValidators()}),e
.qZA(),e
.TgZ(7,"label",59),e
.SDv(8,60),e
.qZA(),e
.TgZ(9,"cd-helper"),e
.TgZ(10,"span"),e
.SDv(11,61),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA()}}function _t(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,70),e
.qZA())}function tt(t
,o
){if(1&t
&&(e
.TgZ(0,"div",9),e
.TgZ(1,"label",67),e
.SDv(2,68),e
.qZA(),e
.TgZ(3,"div",12),e
._UZ(4,"input",69),e
.YNc(5,_t
,2,0,"span",14),e
.qZA(),e
.qZA()),2&t
){e
.oxw(2);const _
=e
.MAs(2),n
=e
.oxw();e
.xp6(5),e
.Q6J("ngIf",n
.bucketForm
.showError("mfa-token-serial",_
,"required"))}}function nt(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,74),e
.qZA())}function ot(t
,o
){if(1&t
&&(e
.TgZ(0,"div",9),e
.TgZ(1,"label",71),e
.SDv(2,72),e
.qZA(),e
.TgZ(3,"div",12),e
._UZ(4,"input",73),e
.YNc(5,nt
,2,0,"span",14),e
.qZA(),e
.qZA()),2&t
){e
.oxw(2);const _
=e
.MAs(2),n
=e
.oxw();e
.xp6(5),e
.Q6J("ngIf",n
.bucketForm
.showError("mfa-token-pin",_
,"required"))}}function it(t
,o
){if(1&t
){const _
=e
.EpF();e
.TgZ(0,"fieldset"),e
.TgZ(1,"legend",25),e
.SDv(2,62),e
.qZA(),e
.TgZ(3,"div",9),e
.TgZ(4,"div",27),e
.TgZ(5,"div",28),e
.TgZ(6,"input",63),e
.NdJ("change",function(){return e
.CHM(_
),e
.oxw(2).setMfaDeleteValidators()}),e
.qZA(),e
.TgZ(7,"label",64),e
.SDv(8,65),e
.qZA(),e
.TgZ(9,"cd-helper"),e
.TgZ(10,"span"),e
.SDv(11,66),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.YNc(12,tt
,6,1,"div",8),e
.YNc(13,ot
,6,1,"div",8),e
.qZA()}if(2&t
){const _
=e
.oxw(2);e
.xp6(12),e
.Q6J("ngIf",_
.areMfaCredentialsRequired()),e
.xp6(1),e
.Q6J("ngIf",_
.areMfaCredentialsRequired())}}function st(t
,o
){1&t
&&(e
.TgZ(0,"div",9),e
.TgZ(1,"label",75),e
.SDv(2,76),e
.qZA(),e
.TgZ(3,"div",12),e
.TgZ(4,"select",77),e
.TgZ(5,"option",78),e
.SDv(6,79),e
.qZA(),e
.TgZ(7,"option",80),e
.SDv(8,81),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA())}function at(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,86),e
.qZA())}function rt(t
,o
){1&t
&&(e
.TgZ(0,"span",38),e
.SDv(1,87),e
.qZA())}function lt(t
,o
){if(1&t
&&(e
.TgZ(0,"div",9),e
.TgZ(1,"label",82),e
.ynx(2),e
.SDv(3,83),e
.BQk(),e
.TgZ(4,"cd-helper"),e
.SDv(5,84),e
.qZA(),e
.qZA(),e
.TgZ(6,"div",12),e
._UZ(7,"input",85),e
.YNc(8,at
,2,0,"span",14),e
.YNc(9,rt
,2,0,"span",14),e
.qZA(),e
.qZA()),2&t
){e
.oxw();const _
=e
.MAs(2),n
=e
.oxw();e
.xp6(8),e
.Q6J("ngIf",n
.bucketForm
.showError("lock_retention_period_days",_
,"pattern")),e
.xp6(1),e
.Q6J("ngIf",n
.bucketForm
.showError("lock_retention_period_days",_
,"lockDays"))}}const Le=function(t
){return{required
:t
}};function ct(t
,o
){if(1&t
){const _
=e
.EpF();e
.TgZ(0,"div",1),e
.TgZ(1,"form",2,3),e
.TgZ(3,"div",4),e
.TgZ(4,"div",5),e
.SDv(5,6),e
.ALo(6,"titlecase"),e
.ALo(7,"upperFirst"),e
.qZA(),e
.TgZ(8,"div",7),e
.YNc(9,v_
,5,0,"div",8),e
.TgZ(10,"div",9),e
.TgZ(11,"label",10),e
.SDv(12,11),e
.qZA(),e
.TgZ(13,"div",12),e
._UZ(14,"input",13),e
.YNc(15,F_
,2,0,"span",14),e
.YNc(16,L_
,2,0,"span",14),e
.YNc(17,D_
,2,0,"span",14),e
.YNc(18,y_
,2,0,"span",14),e
.YNc(19,x_
,2,0,"span",14),e
.YNc(20,q_
,2,0,"span",14),e
.YNc(21,w_
,2,0,"span",14),e
.YNc(22,k_
,2,0,"span",14),e
.qZA(),e
.qZA(),e
.TgZ(23,"div",9),e
.TgZ(24,"label",15),e
.SDv(25,16),e
.qZA(),e
.TgZ(26,"div",12),e
.TgZ(27,"select",17),e
.YNc(28,B_
,2,1,"option",18),e
.YNc(29,H_
,2,1,"option",18),e
.YNc(30,X_
,2,2,"option",19),e
.qZA(),e
.YNc(31,K_
,2,0,"span",14),e
.qZA(),e
.qZA(),e
.TgZ(32,"div",9),e
.TgZ(33,"label",20),e
.SDv(34,21),e
.qZA(),e
.TgZ(35,"div",12),e
.YNc(36,V_
,5,4,"ng-template",null,22,e
.W1O
),e
.YNc(38,j_
,2,0,"ng-container",23),e
.qZA(),e
.qZA(),e
.YNc(39,et
,12,0,"fieldset",24),e
.YNc(40,it
,14,2,"fieldset",24),e
.TgZ(41,"fieldset"),e
.TgZ(42,"legend",25),e
.SDv(43,26),e
.qZA(),e
.TgZ(44,"div",9),e
.TgZ(45,"div",27),e
.TgZ(46,"div",28),e
._UZ(47,"input",29),e
.TgZ(48,"label",30),e
.SDv(49,31),e
.qZA(),e
.TgZ(50,"cd-helper"),e
.TgZ(51,"span"),e
.SDv(52,32),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.YNc(53,st
,9,0,"div",8),e
.YNc(54,lt
,10,2,"div",8),e
.qZA(),e
.qZA(),e
.TgZ(55,"div",33),e
.TgZ(56,"cd-form-button-panel",34),e
.NdJ("submitActionEvent",function(){return e
.CHM(_
),e
.oxw().submit()}),e
.ALo(57,"titlecase"),e
.ALo(58,"upperFirst"),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA()}if(2&t
){const _
=e
.MAs(2),n
=e
.MAs(37),i
=e
.oxw();e
.xp6(1),e
.Q6J("formGroup",i
.bucketForm
),e
.xp6(6),e
.pQV(e
.lcZ(6,29,i
.action
))(e
.lcZ(7,31,i
.resource
)),e
.QtT(5),e
.xp6(2),e
.Q6J("ngIf",i
.editing
),e
.xp6(2),e
.Q6J("ngClass",e
.VKq(37,Le
,!i
.editing
)),e
.xp6(3),e
.Q6J("readonly",i
.editing
)("autofocus",!i
.editing
),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"required")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"bucketNameInvalid")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"bucketNameNotAllowed")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"containsUpperCase")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"lowerCaseOrNumber")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"ipAddress")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"onlyLowerCaseAndNumbers")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("bid",_
,"shouldBeInRange")),e
.xp6(5),e
.Q6J("autofocus",i
.editing
),e
.xp6(1),e
.Q6J("ngIf",null===i
.owners
),e
.xp6(1),e
.Q6J("ngIf",null!==i
.owners
),e
.xp6(1),e
.Q6J("ngForOf",i
.owners
),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.showError("owner",_
,"required")),e
.xp6(2),e
.Q6J("ngClass",e
.VKq(39,Le
,!i
.editing
)),e
.xp6(5),e
.Q6J("ngIf",i
.editing
)("ngIfElse",n
),e
.xp6(1),e
.Q6J("ngIf",i
.editing
),e
.xp6(1),e
.Q6J("ngIf",i
.editing
),e
.xp6(13),e
.Q6J("ngIf",i
.bucketForm
.getValue("lock_enabled")),e
.xp6(1),e
.Q6J("ngIf",i
.bucketForm
.getValue("lock_enabled")),e
.xp6(2),e
.Q6J("form",i
.bucketForm
)("submitText",e
.lcZ(57,33,i
.action
)+" "+e
.lcZ(58,35,i
.resource
))}}let De
=(()=>{class t
extends Ie
.E
{constructor(_
,n
,i
,s
,c
,d
,E
,g
){super(),this.route
=_
,this.router
=n
,this.formBuilder
=i
,this.rgwBucketService
=s
,this.rgwSiteService
=c
,this.rgwUserService
=d
,this.notificationService
=E
,this.actionLabels
=g
,this.editing
=!1,this.owners
=null,this.placementTargets
=[],this.isVersioningAlreadyEnabled
=!1,this.isMfaDeleteAlreadyEnabled
=!1,this.icons
=D
.P
,this.editing
=this.router
.url
.startsWith(`/rgw/bucket/${A.MQ.EDIT}`),this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.CREATE
,this.resource
="bucket",this.createForm()}get isVersioningEnabled(){return this.bucketForm
.getValue("versioning")}get isMfaDeleteEnabled(){return this.bucketForm
.getValue("mfa-delete")}createForm(){const _
=this,n
=m
.h
.custom("lockDays",()=>{if(!_
.bucketForm
||!u().get(_
.bucketForm
.getRawValue(),"lock_enabled"))return!1;const i
=Number(_
.bucketForm
.getValue("lock_retention_period_days"));return!Number
.isInteger(i
)||0===i
});this.bucketForm
=this.formBuilder
.group({id
:[null],bid
:[null,[a
.kI
.required
],this.editing
?[]:[m
.h
.bucketName(),m
.h
.bucketExistence(!1,this.rgwBucketService
)]],owner
:[null,[a
.kI
.required
]],"placement-target":[null,this.editing
?[]:[a
.kI
.required
]],versioning
:[null],"mfa-delete":[null],"mfa-token-serial":[""],"mfa-token-pin":[""],lock_enabled
:[{value
:!1,disabled
:this.editing
}],lock_mode
:["COMPLIANCE"],lock_retention_period_days
:[0,[m
.h
.number(!1),n
]]})}ngOnInit(){const _
={owners
:this.rgwUserService
.enumerate()};this.editing
||(_
.getPlacementTargets
=this.rgwSiteService
.get("placement-targets")),this.route
.params
.subscribe(n
=>{if(n
.hasOwnProperty("bid")){const i
=decodeURIComponent(n
.bid
);_
.getBid
=this.rgwBucketService
.get(i
)}(0,Y
.D
)(_
).subscribe(i
=>{if(this.owners
=i
.owners
.sort(),i
.getPlacementTargets
){const s
=i
.getPlacementTargets
;this.zonegroup
=s
.zonegroup
,u().forEach(s
.placement_targets
,c
=>{c
.description
=`${c.name} (${"pool"}: ${c.data_pool})`,this.placementTargets
.push(c
)}),1===this.placementTargets
.length
&&this.bucketForm
.get("placement-target").setValue(this.placementTargets
[0].name
)}if(i
.getBid
){const s
=i
.getBid
,c
=u().clone(this.bucketForm
.getRawValue());let d
=u().pick(s
,u().keys(c
));d
.lock_retention_period_days
=this.rgwBucketService
.getLockDays(s
),d
["placement-target"]=s
.placement_rule
,d
.versioning
=s
.versioning
===B
.ENABLED
,d
["mfa-delete"]=s
.mfa_delete
===k
.ENABLED
,d
=u().merge(c
,d
),this.bucketForm
.setValue(d
),this.editing
&&(this.isVersioningAlreadyEnabled
=this.isVersioningEnabled
,this.isMfaDeleteAlreadyEnabled
=this.isMfaDeleteEnabled
,this.setMfaDeleteValidators(),d
.lock_enabled
&&this.bucketForm
.controls
.versioning
.disable())}this.loadingReady()})})}goToListView(){this.router
.navigate(["/rgw/bucket"])}submit(){if(this.bucketForm
.pristine
)return void this.goToListView();const _
=this.bucketForm
.value
;if(this.editing
){const n
=this.getVersioningStatus(),i
=this.getMfaDeleteStatus();this.rgwBucketService
.update(_
.bid
,_
.id
,_
.owner
,n
,i
,_
["mfa-token-serial"],_
["mfa-token-pin"],_
.lock_mode
,_
.lock_retention_period_days
).subscribe(()=>{this.notificationService
.show(Ae
.k
.success
,"Updated Object Gateway bucket '" + _
.bid
+ "'."),this.goToListView()},()=>{this.bucketForm
.setErrors({cdSubmitButton
:!0})})}else this.rgwBucketService
.create(_
.bid
,_
.owner
,this.zonegroup
,_
["placement-target"],_
.lock_enabled
,_
.lock_mode
,_
.lock_retention_period_days
).subscribe(()=>{this.notificationService
.show(Ae
.k
.success
,"Created Object Gateway bucket '" + _
.bid
+ "'"),this.goToListView()},()=>{this.bucketForm
.setErrors({cdSubmitButton
:!0})})}areMfaCredentialsRequired(){return this.isMfaDeleteEnabled
!==this.isMfaDeleteAlreadyEnabled
||this.isMfaDeleteAlreadyEnabled
&&this.isVersioningEnabled
!==this.isVersioningAlreadyEnabled
}setMfaDeleteValidators(){const _
=this.bucketForm
.get("mfa-token-serial"),n
=this.bucketForm
.get("mfa-token-pin");this.areMfaCredentialsRequired()?(_
.setValidators(a
.kI
.required
),n
.setValidators(a
.kI
.required
)):(_
.setValidators(null),n
.setValidators(null)),_
.updateValueAndValidity(),n
.updateValueAndValidity()}getVersioningStatus(){return this.isVersioningEnabled
?B
.ENABLED
:B
.SUSPENDED
}getMfaDeleteStatus(){return this.isMfaDeleteEnabled
?k
.ENABLED
:k
.DISABLED
}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(w
.gz
),e
.Y36(w
.F0
),e
.Y36(J
.O
),e
.Y36(Me
.o
),e
.Y36(We
.I
),e
.Y36(O
),e
.Y36(ve
.g
),e
.Y36(A
.p4
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-bucket-form"]],features
:[e
.qOj
],decls
:1,vars
:1,consts:function(){let o
,_
,n
,i
,s
,c
,d
,E
,g
,C
,b
,P
,G
,N
,p
,U
,W
,Z
,$,h
,I
,v
,F
,T
,y
,x
,S
,_e
,te
,ne
,oe
,ie
,se
,ae
,re
,le
,ce
,de
,ue
,Re
;return o
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_
="Name",n
="Name...",i
="Owner",s
="Placement target",c
="Locking",d
="Enabled",E
="Enables locking for the objects in the bucket. Locking can only be enabled while creating a bucket.",g
="Id",C
="This field is required.",b
="Bucket names can only contain lowercase letters, numbers, periods and hyphens.",P
="The chosen name is already in use.",G
="Bucket names must not contain uppercase characters or underscores.",N
="Each label must start and end with a lowercase letter or a number.",p
="Bucket names cannot be formatted as IP address.",U
="Bucket labels cannot be empty and can only contain lowercase letters, numbers and hyphens.",W
="Bucket names must be 3 to 63 characters long.",Z
="Loading...",$="-- Select a user --",h
="This field is required.",I
="Loading...",v
="-- Select a placement target --",F
="This field is required.",T
="Versioning",y
="Enabled",x
="Enables versioning for the objects in the bucket.",S
="Multi-Factor Authentication",_e
="Delete enabled",te
="Enables MFA (multi-factor authentication) Delete, which requires additional authentication for changing the bucket versioning state.",ne
="Token Serial Number",oe
="This field is required.",ie
="Token PIN",se
="This field is required.",ae
="Mode",re
="Compliance",le
="Governance",ce
="Days",de
="The number of days that you want to specify for the default retention period that will be applied to new objects placed in this bucket.",ue
="The entered value must be a positive integer.",Re
="Retention Days must be a positive integer.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["name","bucketForm","novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],o
,[1,"card-body"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","bid",1,"cd-col-form-label",3,"ngClass"],_
,[1,"cd-col-form-input"],["id","bid","name","bid","type","text","placeholder",n
,"formControlName","bid",1,"form-control",3,"readonly","autofocus"],["class","invalid-feedback",4,"ngIf"],["for","owner",1,"cd-col-form-label","required"],i
,["id","owner","name","owner","formControlName","owner",1,"form-control",3,"autofocus"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],["for","placement-target",1,"cd-col-form-label",3,"ngClass"],s
,["placementTargetSelect",""],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"cd-header"],c
,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","lock_enabled","formControlName","lock_enabled","type","checkbox",1,"custom-control-input"],["for","lock_enabled",1,"custom-control-label"],d
,E
,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],["for","id",1,"cd-col-form-label"],g
,["id","id","name","id","type","text","formControlName","id","readonly","",1,"form-control"],[1,"invalid-feedback"],C
,b
,P
,G
,N
,p
,U
,W
,[3,"ngValue"],Z
,$,[3,"value"],h
,["id","placement-target","name","placement-target","formControlName","placement-target",1,"form-control"],I
,v
,F
,["id","placement-target","name","placement-target","formControlName","placement-target","type","text","readonly","",1,"form-control"],T
,["type","checkbox","id","versioning","name","versioning","formControlName","versioning",1,"custom-control-input",3,"change"],["for","versioning",1,"custom-control-label"],y
,x
,S
,["type","checkbox","id","mfa-delete","name","mfa-delete","formControlName","mfa-delete",1,"custom-control-input",3,"change"],["for","mfa-delete",1,"custom-control-label"],_e
,te
,["for","mfa-token-serial",1,"cd-col-form-label"],ne
,["type","text","id","mfa-token-serial","name","mfa-token-serial","formControlName","mfa-token-serial",1,"form-control"],oe
,["for","mfa-token-pin",1,"cd-col-form-label"],ie
,["type","text","id","mfa-token-pin","name","mfa-token-pin","formControlName","mfa-token-pin",1,"form-control"],se
,["for","lock_mode",1,"cd-col-form-label"],ae
,["formControlName","lock_mode","name","lock_mode","id","lock_mode",1,"form-control"],["value","COMPLIANCE"],re
,["value","GOVERNANCE"],le
,["for","lock_retention_period_days",1,"cd-col-form-label"],ce
,de
,["type","number","id","lock_retention_period_days","formControlName","lock_retention_period_days","min","0",1,"form-control"],ue
,Re
]},template:function(_
,n
){1&_
&&e
.YNc(0,ct
,59,41,"div",0),2&_
&&e
.Q6J("cdFormLoading",n
.loading
)},directives
:[Fe
.y
,a
._Y
,a
.JL
,V
.V
,a
.sg
,f
.O5
,H
.P
,f
.mk
,q
.o
,a
.Fj
,X
.b
,a
.JJ
,a
.u
,j
.U
,a
.EJ
,f
.sg
,a
.Wl
,I_
.S
,ee
.p
,a
.YN
,a
.Kr
,a
.wV
,a
.qQ
],pipes
:[f
.rS
,K
.m
],styles
:[""]}),t
})();var ye
=r(18891),be
=r(68136),xe
=r(30982),z
=r(35905),Pe
=r(68774),qe
=r(47557),we
=r(66369),Q
=r(51847),Ee
=r(74937),Te
=r(63285),ke
=r(94928),dt
=r(96102),Be
=r(68962);function ut(t
,o
){1&t
&&(e
.TgZ(0,"td"),e
.SDv(1,24),e
.qZA())}function Rt(t
,o
){if(1&t
&&(e
.TgZ(0,"td"),e
._uU(1),e
.ALo(2,"dimless"),e
.qZA()),2&t
){const _
=e
.oxw(3);e
.xp6(1),e
.hij(" ",e
.lcZ(2,1,_
.selection
.bucket_quota
.max_size
)," ")}}function gt(t
,o
){1&t
&&(e
.TgZ(0,"td"),e
.SDv(1,25),e
.qZA())}function Et(t
,o
){if(1&t
&&(e
.TgZ(0,"td"),e
._uU(1),e
.qZA()),2&t
){const _
=e
.oxw(3);e
.xp6(1),e
.hij(" ",_
.selection
.bucket_quota
.max_objects
," ")}}function Tt(t
,o
){if(1&t
&&(e
.TgZ(0,"div"),e
.TgZ(1,"legend"),e
.SDv(2,20),e
.qZA(),e
.TgZ(3,"table",1),e
.TgZ(4,"tbody"),e
.TgZ(5,"tr"),e
.TgZ(6,"td",2),e
.SDv(7,21),e
.qZA(),e
.TgZ(8,"td",4),e
._uU(9),e
.ALo(10,"booleanText"),e
.qZA(),e
.qZA(),e
.TgZ(11,"tr"),e
.TgZ(12,"td",5),e
.SDv(13,22),e
.qZA(),e
.YNc(14,ut
,2,0,"td",0),e
.YNc(15,Rt
,3,3,"td",0),e
.qZA(),e
.TgZ(16,"tr"),e
.TgZ(17,"td",5),e
.SDv(18,23),e
.qZA(),e
.YNc(19,gt
,2,0,"td",0),e
.YNc(20,Et
,2,1,"td",0),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA()),2&t
){const _
=e
.oxw(2);e
.xp6(9),e
.Oqu(e
.lcZ(10,5,_
.selection
.bucket_quota
.enabled
)),e
.xp6(5),e
.Q6J("ngIf",_
.selection
.bucket_quota
.max_size
<=-1),e
.xp6(1),e
.Q6J("ngIf",_
.selection
.bucket_quota
.max_size
>-1),e
.xp6(4),e
.Q6J("ngIf",_
.selection
.bucket_quota
.max_objects
<=-1),e
.xp6(1),e
.Q6J("ngIf",_
.selection
.bucket_quota
.max_objects
>-1)}}function St(t
,o
){if(1&t
&&(e
.ynx(0),e
.TgZ(1,"tr"),e
.TgZ(2,"td",5),e
.SDv(3,26),e
.qZA(),e
.TgZ(4,"td"),e
._uU(5),e
.qZA(),e
.qZA(),e
.TgZ(6,"tr"),e
.TgZ(7,"td",5),e
.SDv(8,27),e
.qZA(),e
.TgZ(9,"td"),e
._uU(10),e
.qZA(),e
.qZA(),e
.BQk()),2&t
){const _
=e
.oxw(2);e
.xp6(5),e
.Oqu(_
.selection
.lock_mode
),e
.xp6(5),e
.Oqu(_
.selection
.lock_retention_period_days
)}}function ft(t
,o
){if(1&t
&&(e
.ynx(0),e
.TgZ(1,"table",1),e
.TgZ(2,"tbody"),e
.TgZ(3,"tr"),e
.TgZ(4,"td",2),e
.SDv(5,3),e
.qZA(),e
.TgZ(6,"td",4),e
._uU(7),e
.qZA(),e
.qZA(),e
.TgZ(8,"tr"),e
.TgZ(9,"td",5),e
.SDv(10,6),e
.qZA(),e
.TgZ(11,"td"),e
._uU(12),e
.qZA(),e
.qZA(),e
.TgZ(13,"tr"),e
.TgZ(14,"td",5),e
.SDv(15,7),e
.qZA(),e
.TgZ(16,"td"),e
._uU(17),e
.qZA(),e
.qZA(),e
.TgZ(18,"tr"),e
.TgZ(19,"td",5),e
.SDv(20,8),e
.qZA(),e
.TgZ(21,"td"),e
._uU(22),e
.qZA(),e
.qZA(),e
.TgZ(23,"tr"),e
.TgZ(24,"td",5),e
.SDv(25,9),e
.qZA(),e
.TgZ(26,"td"),e
._uU(27),e
.qZA(),e
.qZA(),e
.TgZ(28,"tr"),e
.TgZ(29,"td",5),e
.SDv(30,10),e
.qZA(),e
.TgZ(31,"td"),e
._uU(32),e
.qZA(),e
.qZA(),e
.TgZ(33,"tr"),e
.TgZ(34,"td",5),e
.SDv(35,11),e
.qZA(),e
.TgZ(36,"td"),e
._uU(37),e
.qZA(),e
.qZA(),e
.TgZ(38,"tr"),e
.TgZ(39,"td",5),e
.SDv(40,12),e
.qZA(),e
.TgZ(41,"td"),e
._uU(42),e
.qZA(),e
.qZA(),e
.TgZ(43,"tr"),e
.TgZ(44,"td",5),e
.SDv(45,13),e
.qZA(),e
.TgZ(46,"td"),e
._uU(47),e
.qZA(),e
.qZA(),e
.TgZ(48,"tr"),e
.TgZ(49,"td",5),e
.SDv(50,14),e
.qZA(),e
.TgZ(51,"td"),e
._uU(52),e
.ALo(53,"cdDate"),e
.qZA(),e
.qZA(),e
.TgZ(54,"tr"),e
.TgZ(55,"td",5),e
.SDv(56,15),e
.qZA(),e
.TgZ(57,"td"),e
._uU(58),e
.qZA(),e
.qZA(),e
.TgZ(59,"tr"),e
.TgZ(60,"td",5),e
.SDv(61,16),e
.qZA(),e
.TgZ(62,"td"),e
._uU(63),e
.qZA(),e
.qZA(),e
.TgZ(64,"tr"),e
.TgZ(65,"td",5),e
.SDv(66,17),e
.qZA(),e
.TgZ(67,"td"),e
._uU(68),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.YNc(69,Tt
,21,7,"div",0),e
.TgZ(70,"legend"),e
.SDv(71,18),e
.qZA(),e
.TgZ(72,"table",1),e
.TgZ(73,"tbody"),e
.TgZ(74,"tr"),e
.TgZ(75,"td",2),e
.SDv(76,19),e
.qZA(),e
.TgZ(77,"td",4),e
._uU(78),e
.ALo(79,"booleanText"),e
.qZA(),e
.qZA(),e
.YNc(80,St
,11,2,"ng-container",0),e
.qZA(),e
.qZA(),e
.BQk()),2&t
){const _
=e
.oxw();e
.xp6(7),e
.Oqu(_
.selection
.bid
),e
.xp6(5),e
.Oqu(_
.selection
.id
),e
.xp6(5),e
.Oqu(_
.selection
.owner
),e
.xp6(5),e
.Oqu(_
.selection
.index_type
),e
.xp6(5),e
.Oqu(_
.selection
.placement_rule
),e
.xp6(5),e
.Oqu(_
.selection
.marker
),e
.xp6(5),e
.Oqu(_
.selection
.max_marker
),e
.xp6(5),e
.Oqu(_
.selection
.ver
),e
.xp6(5),e
.Oqu(_
.selection
.master_ver
),e
.xp6(5),e
.Oqu(e
.lcZ(53,16,_
.selection
.mtime
)),e
.xp6(6),e
.Oqu(_
.selection
.zonegroup
),e
.xp6(5),e
.Oqu(_
.selection
.versioning
),e
.xp6(5),e
.Oqu(_
.selection
.mfa_delete
),e
.xp6(1),e
.Q6J("ngIf",_
.selection
.bucket_quota
),e
.xp6(9),e
.Oqu(e
.lcZ(79,18,_
.selection
.lock_enabled
)),e
.xp6(2),e
.Q6J("ngIf",_
.selection
.lock_enabled
)}}let Ct
=(()=>{class t
{constructor(_
){this.rgwBucketService
=_
}ngOnChanges(){this.selection
&&this.rgwBucketService
.get(this.selection
.bid
).subscribe(_
=>{_
.lock_retention_period_days
=this.rgwBucketService
.getLockDays(_
),this.selection
=_
})}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(Me
.o
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-bucket-details"]],inputs
:{selection
:"selection"},features
:[e
.TTD
],decls
:1,vars
:1,consts:function(){let o
,_
,n
,i
,s
,c
,d
,E
,g
,C
,b
,P
,G
,N
,p
,U
,W
,Z
,$,h
,I
,v
,F
;return o
="Name",_
="ID",n
="Owner",i
="Index type",s
="Placement rule",c
="Marker",d
="Maximum marker",E
="Version",g
="Master version",C
="Modification time",b
="Zonegroup",P
="Versioning",G
="MFA Delete",N
="Locking",p
="Enabled",U
="Bucket quota",W
="Enabled",Z
="Maximum size",$="Maximum objects",h
="Unlimited",I
="Unlimited",v
="Mode",F
="Days",[[4,"ngIf"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],o
,[1,"w-75"],[1,"bold"],_
,n
,i
,s
,c
,d
,E
,g
,C
,b
,P
,G
,N
,p
,U
,W
,Z
,$,h
,I
,v
,F
]},template:function(_
,n
){1&_
&&e
.YNc(0,ft
,81,20,"ng-container",0),2&_
&&e
.Q6J("ngIf",n
.selection
)},directives
:[f
.O5
],pipes
:[dt
.N
,Be
.T
,we
.n
],styles
:["table[_ngcontent-%COMP%]{table-layout:fixed}table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{word-wrap:break-word}"]}),t
})();var He
=r(60251);const pt
=["bucketSizeTpl"],Mt
=["bucketObjectTpl"];function mt(t
,o
){if(1&t
&&e
._UZ(0,"cd-usage-bar",8),2&t
){const _
=e
.oxw().row
;e
.Q6J("total",_
.bucket_quota
.max_size
)("used",_
.bucket_size
)}}function At(t
,o
){1&t
&&e
.SDv(0,9)}function bt(t
,o
){if(1&t
&&(e
.YNc(0,mt
,1,2,"cd-usage-bar",6),e
.YNc(1,At
,1,0,"ng-template",null,7,e
.W1O
)),2&t
){const _
=o
.row
,n
=e
.MAs(2);e
.Q6J("ngIf",_
.bucket_quota
.max_size
>0&&_
.bucket_quota
.enabled
)("ngIfElse",n
)}}function Pt(t
,o
){if(1&t
&&e
._UZ(0,"cd-usage-bar",12),2&t
){const _
=e
.oxw().row
;e
.Q6J("total",_
.bucket_quota
.max_objects
)("used",_
.num_objects
)("isBinary",!1)}}function Gt(t
,o
){1&t
&&e
.SDv(0,13)}function Nt(t
,o
){if(1&t
&&(e
.YNc(0,Pt
,1,3,"cd-usage-bar",10),e
.YNc(1,Gt
,1,0,"ng-template",null,11,e
.W1O
)),2&t
){const _
=o
.row
,n
=e
.MAs(2);e
.Q6J("ngIf",_
.bucket_quota
.max_objects
>0&&_
.bucket_quota
.enabled
)("ngIfElse",n
)}}let Ut
=(()=>{class t
extends be
.o
{constructor(_
,n
,i
,s
,c
,d
,E
,g
){super(g
),this.authStorageService
=_
,this.dimlessBinaryPipe
=n
,this.dimlessPipe
=i
,this.rgwBucketService
=s
,this.modalService
=c
,this.urlBuilder
=d
,this.actionLabels
=E
,this.ngZone
=g
,this.columns
=[],this.buckets
=[],this.selection
=new Pe
.r
}ngOnInit(){this.permission
=this.authStorageService
.getPermissions().rgw
,this.columns
=[{name
:"Name",prop
:"bid",flexGrow
:2},{name
:"Owner",prop
:"owner",flexGrow
:2.5},{name
:"Used Capacity",prop
:"bucket_size",flexGrow
:.6,pipe
:this.dimlessBinaryPipe
},{name
:"Capacity Limit %",prop
:"size_usage",cellTemplate
:this.bucketSizeTpl
,flexGrow
:.8},{name
:"Objects",prop
:"num_objects",flexGrow
:.6,pipe
:this.dimlessPipe
},{name
:"Object Limit %",prop
:"object_usage",cellTemplate
:this.bucketObjectTpl
,flexGrow
:.8}];const _
=()=>this.selection
.first()&&`${encodeURIComponent(this.selection.first().bid)}`;this.tableActions
=[{permission
:"create",icon
:D
.P
.add
,routerLink
:()=>this.urlBuilder
.getCreate(),name
:this.actionLabels
.CREATE
,canBePrimary
:c
=>!c
.hasSelection
},{permission
:"update",icon
:D
.P
.edit
,routerLink
:()=>this.urlBuilder
.getEdit(_()),name
:this.actionLabels
.EDIT
},{permission
:"delete",icon
:D
.P
.destroy
,click
:()=>this.deleteAction(),disable
:()=>!this.selection
.hasSelection
,name
:this.actionLabels
.DELETE
,canBePrimary
:c
=>c
.hasMultiSelection
}],this.setTableRefreshTimeout()}transformBucketData(){u().forEach(this.buckets
,_
=>{const n
=_
.bucket_quota
.max_size
,i
=_
.bucket_quota
.max_objects
;_
.bucket_size
=0,_
.num_objects
=0,u().isEmpty(_
.usage
)||(_
.bucket_size
=_
.usage
["rgw.main"].size_actual
,_
.num_objects
=_
.usage
["rgw.main"].num_objects
),_
.size_usage
=n
>0?_
.bucket_size
/n:void 0,_.object_usage=i>0?_.num_objects/i:void 0})}getBucketList(_
){this.setTableRefreshTimeout(),this.rgwBucketService
.list(!0).subscribe(n
=>{this.buckets
=n
,this.transformBucketData()},()=>{_
.error()})}updateSelection(_
){this.selection
=_
}deleteAction(){this.modalService
.show(xe
.M
,{itemDescription
:this.selection
.hasSingleSelection
?"bucket":"buckets",itemNames
:this.selection
.selected
.map(_
=>_
.bid
),submitActionObservable
:()=>new ye
.y(_
=>{(0,Y
.D
)(this.selection
.selected
.map(n
=>this.rgwBucketService
.delete(n
.bid
))).subscribe({error
:n
=>{_
.error(n
),this.table
.refreshBtn()},complete
:()=>{_
.complete(),this.table
.refreshBtn()}})})})}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(Ee
.j
),e
.Y36(qe
.$),e
.Y36(we
.n
),e
.Y36(Me
.o
),e
.Y36(Te
.Z
),e
.Y36(Q
.F
),e
.Y36(A
.p4
),e
.Y36(e
.R0b
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-bucket-list"]],viewQuery:function(_
,n
){if(1&_
&&(e
.Gf(z
.a
,7),e
.Gf(pt
,7),e
.Gf(Mt
,7)),2&_
){let i
;e
.iGM(i
=e
.CRH())&&(n
.table
=i
.first
),e
.iGM(i
=e
.CRH())&&(n
.bucketSizeTpl
=i
.first
),e
.iGM(i
=e
.CRH())&&(n
.bucketObjectTpl
=i
.first
)}},features
:[e
._Bn([{provide
:Q
.F
,useValue
:new Q
.F("rgw/bucket")}]),e
.qOj
],decls
:8,vars
:9,consts:function(){let o
,_
;return o
="No Limit",_
="No Limit",[["columnMode","flex","selectionType","multiClick","identifier","bid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["bucketSizeTpl",""],["bucketObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],o
,[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],_
]},template:function(_
,n
){1&_
&&(e
.TgZ(0,"cd-table",0,1),e
.NdJ("setExpandedRow",function(s
){return n
.setExpandedRow(s
)})("updateSelection",function(s
){return n
.updateSelection(s
)})("fetchData",function(s
){return n
.getBucketList(s
)}),e
._UZ(2,"cd-table-actions",2),e
._UZ(3,"cd-rgw-bucket-details",3),e
.qZA(),e
.YNc(4,bt
,3,2,"ng-template",null,4,e
.W1O
),e
.YNc(6,Nt
,3,2,"ng-template",null,5,e
.W1O
)),2&_
&&(e
.Q6J("autoReload",!1)("data",n
.buckets
)("columns",n
.columns
)("hasDetails",!0)("status",n
.tableStatus
),e
.xp6(2),e
.Q6J("permission",n
.permission
)("selection",n
.selection
)("tableActions",n
.tableActions
),e
.xp6(1),e
.Q6J("selection",n
.expandedRow
))},directives
:[z
.a
,ke
.K
,Ct
,f
.O5
,He
.O
],styles
:[""]}),t
})();var Wt
=r(58111),Xe
=r(59376),Zt
=r(61350),$t
=r(98056),Ke
=r(76317);function ht(t
,o
){if(1&t
){const _
=e
.EpF();e
.TgZ(0,"cd-table-key-value",11),e
.NdJ("fetchData",function(){return e
.CHM(_
),e
.oxw(2).getMetaData()}),e
.qZA()}if(2&t
){const _
=e
.oxw(2);e
.Q6J("data",_
.metadata
)}}function It(t
,o
){if(1&t
&&e
._UZ(0,"cd-table-performance-counter",12),2&t
){const _
=e
.oxw(2);e
.Q6J("serviceId",_
.serviceMapId
)}}function vt(t
,o
){if(1&t
&&e
._UZ(0,"cd-grafana",15),2&t
){const _
=e
.oxw(3);e
.Q6J("grafanaPath","rgw-instance-detail?var-rgw_servers=rgw."+_
.serviceId
)("type","metrics")}}function Ft(t
,o
){1&t
&&(e
.TgZ(0,"li",13),e
.TgZ(1,"a",4),e
.SDv(2,14),e
.qZA(),e
.YNc(3,vt
,1,2,"ng-template",6),e
.qZA())}function Lt(t
,o
){if(1&t
&&(e
.ynx(0),e
.TgZ(1,"ul",1,2),e
.TgZ(3,"li",3),e
.TgZ(4,"a",4),e
.SDv(5,5),e
.qZA(),e
.YNc(6,ht
,1,1,"ng-template",6),e
.qZA(),e
.TgZ(7,"li",7),e
.TgZ(8,"a",4),e
.SDv(9,8),e
.qZA(),e
.YNc(10,It
,1,1,"ng-template",6),e
.qZA(),e
.YNc(11,Ft
,4,0,"li",9),e
.qZA(),e
._UZ(12,"div",10),e
.BQk()),2&t
){const _
=e
.MAs(2),n
=e
.oxw();e
.xp6(11),e
.Q6J("ngIf",n
.grafanaPermission
.read
),e
.xp6(1),e
.Q6J("ngbNavOutlet",_
)}}let Dt
=(()=>{class t
{constructor(_
,n
){this.rgwDaemonService
=_
,this.authStorageService
=n
,this.serviceId
="",this.serviceMapId
="",this.grafanaPermission
=this.authStorageService
.getPermissions().grafana
}ngOnChanges(){this.selection
&&(this.serviceId
=this.selection
.id
,this.serviceMapId
=this.selection
.service_map_id
)}getMetaData(){u().isEmpty(this.serviceId
)||this.rgwDaemonService
.get(this.serviceId
).subscribe(_
=>{this.metadata
=_
.rgw_metadata
})}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(ge
.b
),e
.Y36(Ee
.j
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-daemon-details"]],inputs
:{selection
:"selection"},features
:[e
.TTD
],decls
:1,vars
:1,consts:function(){let o
,_
,n
;return o
="Details",_
="Performance Counters",n
="Performance Details",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-daemon-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],o
,["ngbNavContent",""],["ngbNavItem","performance-counters"],_
,["ngbNavItem","performance-details",4,"ngIf"],[3,"ngbNavOutlet"],[3,"data","fetchData"],["serviceType","rgw",3,"serviceId"],["ngbNavItem","performance-details"],n
,["uid","x5ARzZtmk","grafanaStyle","one",3,"grafanaPath","type"]]},template:function(_
,n
){1&_
&&e
.YNc(0,Lt
,13,2,"ng-container",0),2&_
&&e
.Q6J("ngIf",n
.selection
)},directives
:[f
.O5
,M
.Pz
,Xe
.m
,M
.nv
,M
.Vx
,M
.uN
,M
.tO
,Zt
.b
,$t
.p
,Ke
.F
],styles
:[""]}),t
})();function yt(t
,o
){if(1&t
){const _
=e
.EpF();e
.TgZ(0,"cd-table",8),e
.NdJ("setExpandedRow",function(i
){return e
.CHM(_
),e
.oxw().setExpandedRow(i
)})("fetchData",function(i
){return e
.CHM(_
),e
.oxw().getDaemonList(i
)}),e
._UZ(1,"cd-rgw-daemon-details",9),e
.qZA()}if(2&t
){const _
=e
.oxw();e
.Q6J("data",_
.daemons
)("columns",_
.columns
)("hasDetails",!0),e
.xp6(1),e
.Q6J("selection",_
.expandedRow
)}}function xt(t
,o
){1&t
&&e
._UZ(0,"cd-grafana",11),2&t
&&e
.Q6J("grafanaPath","rgw-overview?")("type","metrics")}function qt(t
,o
){1&t
&&(e
.TgZ(0,"li",2),e
.TgZ(1,"a",3),e
.SDv(2,10),e
.qZA(),e
.YNc(3,xt
,1,2,"ng-template",5),e
.qZA())}function wt(t
,o
){1&t
&&e
._UZ(0,"cd-grafana",13),2&t
&&e
.Q6J("grafanaPath","radosgw-sync-overview?")("type","metrics")}function kt(t
,o
){1&t
&&(e
.TgZ(0,"li",2),e
.TgZ(1,"a",3),e
.SDv(2,12),e
.qZA(),e
.YNc(3,wt
,1,2,"ng-template",5),e
.qZA())}let Bt
=(()=>{class t
extends be
.o
{constructor(_
,n
,i
,s
){super(),this.rgwDaemonService
=_
,this.authStorageService
=n
,this.cephShortVersionPipe
=i
,this.rgwSiteService
=s
,this.columns
=[],this.daemons
=[],this.updateDaemons
=c
=>{this.daemons
=c
}}ngOnInit(){this.grafanaPermission
=this.authStorageService
.getPermissions().grafana
,this.columns
=[{name
:"ID",prop
:"id",flexGrow
:2},{name
:"Hostname",prop
:"server_hostname",flexGrow
:2},{name
:"Zone",prop
:"zone_name",flexGrow
:2},{name
:"Zone Group",prop
:"zonegroup_name",flexGrow
:2},{name
:"Realm",prop
:"realm_name",flexGrow
:2},{name
:"Version",prop
:"version",flexGrow
:1,pipe
:this.cephShortVersionPipe
}],this.rgwSiteService
.get("realms").subscribe(_
=>this.isMultiSite
=_
.length
>0)}getDaemonList(_
){this.rgwDaemonService
.list().subscribe(this.updateDaemons
,()=>{_
.error()})}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(ge
.b
),e
.Y36(Ee
.j
),e
.Y36(Wt
.F
),e
.Y36(We
.I
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-daemon-list"]],features
:[e
.qOj
],decls
:9,vars
:3,consts:function(){let o
,_
,n
;return o
="Daemons List",_
="Overall Performance",n
="Sync Performance",[["ngbNav","",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem",""],["ngbNavLink",""],o
,["ngbNavContent",""],["ngbNavItem","",4,"ngIf"],[3,"ngbNavOutlet"],["columnMode","flex",3,"data","columns","hasDetails","setExpandedRow","fetchData"],["cdTableDetail","",3,"selection"],_
,["uid","WAkugZpiz","grafanaStyle","two",3,"grafanaPath","type"],n
,["uid","rgw-sync-overview","grafanaStyle","two",3,"grafanaPath","type"]]},template:function(_
,n
){if(1&_
&&(e
.TgZ(0,"ul",0,1),e
.TgZ(2,"li",2),e
.TgZ(3,"a",3),e
.SDv(4,4),e
.qZA(),e
.YNc(5,yt
,2,4,"ng-template",5),e
.qZA(),e
.YNc(6,qt
,4,0,"li",6),e
.YNc(7,kt
,4,0,"li",6),e
.qZA(),e
._UZ(8,"div",7)),2&_
){const i
=e
.MAs(1);e
.xp6(6),e
.Q6J("ngIf",n
.grafanaPermission
.read
),e
.xp6(1),e
.Q6J("ngIf",n
.grafanaPermission
.read
&&n
.isMultiSite
),e
.xp6(1),e
.Q6J("ngbNavOutlet",i
)}},directives
:[M
.Pz
,M
.nv
,M
.Vx
,M
.uN
,f
.O5
,M
.tO
,z
.a
,Dt
,Ke
.F
],styles
:[""]}),t
})();var Ht
=r(58071),Ge
=r(28211),Se
=(()=>{return(t
=Se
||(Se
={})).USERS
="users",t
.BUCKETS
="buckets",t
.METADATA
="metadata",t
.USAGE
="usage",t
.ZONE
="zone",Se
;var t
})();let ze
=(()=>{class t
{static getAll(){return Object
.values(t
.capabilities
)}}return t
.capabilities
=Se
,t
})();var fe
=r(60312);function Xt(t
,o
){1&t
&&e
._UZ(0,"input",22),2&t
&&e
.Q6J("readonly",!0)}function Kt(t
,o
){1&t
&&(e
.TgZ(0,"option",17),e
.SDv(1,25),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function zt(t
,o
){if(1&t
&&(e
.TgZ(0,"option",26),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
),e
.xp6(1),e
.Oqu(_
)}}function Qt(t
,o
){if(1&t
&&(e
.TgZ(0,"select",23),e
.YNc(1,Kt
,2,1,"option",24),e
.YNc(2,zt
,2,2,"option",19),e
.qZA()),2&t
){const _
=e
.oxw();e
.xp6(1),e
.Q6J("ngIf",null!==_
.types
),e
.xp6(1),e
.Q6J("ngForOf",_
.types
)}}function Yt(t
,o
){1&t
&&(e
.TgZ(0,"span",27),e
.SDv(1,28),e
.qZA())}function Jt(t
,o
){if(1&t
&&(e
.TgZ(0,"option",26),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
),e
.xp6(1),e
.hij(" ",_
," ")}}function Vt(t
,o
){1&t
&&(e
.TgZ(0,"span",27),e
.SDv(1,29),e
.qZA())}const jt=function(t
){return{required
:t
}},en=function(){return["read","write","*"]};let _n
=(()=>{class t
{constructor(_
,n
,i
){this.formBuilder
=_
,this.activeModal
=n
,this.actionLabels
=i
,this.submitAction
=new e
.vpe
,this.editing
=!0,this.types
=[],this.resource
="capability",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({type
:[null,[a
.kI
.required
]],perm
:[null,[a
.kI
.required
]]})}setEditing(_
=!0){this.editing
=_
,this.action
=this.editing
?this.actionLabels
.EDIT
:this.actionLabels
.ADD
}setValues(_
,n
){this.formGroup
.setValue({type
:_
,perm
:n
})}setCapabilities(_
){const n
=[];_
.forEach(i
=>{n
.push(i
.type
)}),this.types
=[],ze
.getAll().forEach(i
=>{-1===u().indexOf(n
,i
)&&this.types
.push(i
)})}onSubmit(){this.submitAction
.emit(this.formGroup
.value
),this.activeModal
.close()}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(J
.O
),e
.Y36(M
.Kz
),e
.Y36(A
.p4
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-user-capability-modal"]],outputs
:{submitAction
:"submitAction"},decls
:29,vars
:24,consts:function(){let o
,_
,n
,i
,s
,c
,d
;return o
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_
="Type",n
="Permission",i
="-- Select a permission --",s
="-- Select a type --",c
="This field is required.",d
="This field is required.",[[3,"modalRef"],[1,"modal-title"],o
,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","type",1,"cd-col-form-label",3,"ngClass"],_
,[1,"cd-col-form-input"],["id","type","class","form-control","type","text","formControlName","type",3,"readonly",4,"ngIf"],["id","type","class","form-control","formControlName","type","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],n
,["id","perm","formControlName","perm",1,"form-control"],[3,"ngValue"],i
,[3,"value",4,"ngFor","ngForOf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],["id","type","type","text","formControlName","type",1,"form-control",3,"readonly"],["id","type","formControlName","type","autofocus","",1,"form-control"],[3,"ngValue",4,"ngIf"],s
,[3,"value"],[1,"invalid-feedback"],c
,d
]},template:function(_
,n
){if(1&_
&&(e
.TgZ(0,"cd-modal",0),e
.ynx(1,1),e
.SDv(2,2),e
.ALo(3,"titlecase"),e
.ALo(4,"upperFirst"),e
.BQk(),e
.ynx(5,3),e
.TgZ(6,"form",4,5),e
.TgZ(8,"div",6),e
.TgZ(9,"div",7),e
.TgZ(10,"label",8),e
.SDv(11,9),e
.qZA(),e
.TgZ(12,"div",10),e
.YNc(13,Xt
,1,1,"input",11),e
.YNc(14,Qt
,3,2,"select",12),e
.YNc(15,Yt
,2,0,"span",13),e
.qZA(),e
.qZA(),e
.TgZ(16,"div",7),e
.TgZ(17,"label",14),e
.SDv(18,15),e
.qZA(),e
.TgZ(19,"div",10),e
.TgZ(20,"select",16),e
.TgZ(21,"option",17),e
.SDv(22,18),e
.qZA(),e
.YNc(23,Jt
,2,2,"option",19),e
.qZA(),e
.YNc(24,Vt
,2,0,"span",13),e
.qZA(),e
.qZA(),e
.qZA(),e
.TgZ(25,"div",20),e
.TgZ(26,"cd-form-button-panel",21),e
.NdJ("submitActionEvent",function(){return n
.onSubmit()}),e
.ALo(27,"titlecase"),e
.ALo(28,"upperFirst"),e
.qZA(),e
.qZA(),e
.qZA(),e
.BQk(),e
.qZA()),2&_
){const i
=e
.MAs(7);e
.Q6J("modalRef",n
.activeModal
),e
.xp6(4),e
.pQV(e
.lcZ(3,13,n
.action
))(e
.lcZ(4,15,n
.resource
)),e
.QtT(2),e
.xp6(2),e
.Q6J("formGroup",n
.formGroup
),e
.xp6(4),e
.Q6J("ngClass",e
.VKq(21,jt
,!n
.editing
)),e
.xp6(3),e
.Q6J("ngIf",n
.editing
),e
.xp6(1),e
.Q6J("ngIf",!n
.editing
),e
.xp6(1),e
.Q6J("ngIf",n
.formGroup
.showError("type",i
,"required")),e
.xp6(6),e
.Q6J("ngValue",null),e
.xp6(2),e
.Q6J("ngForOf",e
.DdM(23,en
)),e
.xp6(1),e
.Q6J("ngIf",n
.formGroup
.showError("perm",i
,"required")),e
.xp6(2),e
.Q6J("form",n
.formGroup
)("submitText",e
.lcZ(27,17,n
.action
)+" "+e
.lcZ(28,19,n
.resource
))}},directives
:[fe
.z
,a
._Y
,a
.JL
,V
.V
,a
.sg
,H
.P
,f
.mk
,f
.O5
,q
.o
,a
.EJ
,X
.b
,a
.JJ
,a
.u
,a
.YN
,a
.Kr
,f
.sg
,ee
.p
,a
.Fj
,j
.U
],pipes
:[f
.rS
,K
.m
],styles
:[""]}),t
})();var Ce
=r(4416),pe
=r(58039);function tn(t
,o
){1&t
&&e
._UZ(0,"input",17),2&t
&&e
.Q6J("readonly",!0)}function nn(t
,o
){1&t
&&(e
.TgZ(0,"option",21),e
.SDv(1,22),e
.qZA()),2&t
&&e
.Q6J("ngValue",null)}function on(t
,o
){if(1&t
&&(e
.TgZ(0,"option",23),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
),e
.xp6(1),e
.Oqu(_
)}}function sn(t
,o
){if(1&t
&&(e
.TgZ(0,"select",18),e
.YNc(1,nn
,2,1,"option",19),e
.YNc(2,on
,2,2,"option",20),e
.qZA()),2&t
){const _
=e
.oxw();e
.xp6(1),e
.Q6J("ngIf",null!==_
.userCandidates
),e
.xp6(1),e
.Q6J("ngForOf",_
.userCandidates
)}}function an(t
,o
){1&t
&&(e
.TgZ(0,"span",24),e
.SDv(1,25),e
.qZA())}function rn(t
,o
){1&t
&&(e
.TgZ(0,"div",7),e
.TgZ(1,"div",26),e
.TgZ(2,"div",27),e
._UZ(3,"input",28),e
.TgZ(4,"label",29),e
.SDv(5,30),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA())}function ln(t
,o
){1&t
&&(e
.TgZ(0,"span",24),e
.SDv(1,38),e
.qZA())}const Ne=function(t
){return{required
:t
}};function cn(t
,o
){if(1&t
&&(e
.TgZ(0,"div",7),e
.TgZ(1,"label",31),e
.SDv(2,32),e
.qZA(),e
.TgZ(3,"div",10),e
.TgZ(4,"div",33),e
._UZ(5,"input",34),e
.TgZ(6,"span",35),e
._UZ(7,"button",36),e
._UZ(8,"cd-copy-2-clipboard-button",37),e
.qZA(),e
.qZA(),e
.YNc(9,ln
,2,0,"span",13),e
.qZA(),e
.qZA()),2&t
){const _
=e
.oxw(),n
=e
.MAs(7);e
.xp6(1),e
.Q6J("ngClass",e
.VKq(3,Ne
,!_
.viewing
)),e
.xp6(4),e
.Q6J("readonly",_
.viewing
),e
.xp6(4),e
.Q6J("ngIf",_
.formGroup
.showError("access_key",n
,"required"))}}function dn(t
,o
){1&t
&&(e
.TgZ(0,"span",24),e
.SDv(1,44),e
.qZA())}function un(t
,o
){if(1&t
&&(e
.TgZ(0,"div",7),e
.TgZ(1,"label",39),e
.SDv(2,40),e
.qZA(),e
.TgZ(3,"div",10),e
.TgZ(4,"div",33),e
._UZ(5,"input",41),e
.TgZ(6,"span",35),e
._UZ(7,"button",42),e
._UZ(8,"cd-copy-2-clipboard-button",43),e
.qZA(),e
.qZA(),e
.YNc(9,dn
,2,0,"span",13),e
.qZA(),e
.qZA()),2&t
){const _
=e
.oxw(),n
=e
.MAs(7);e
.xp6(1),e
.Q6J("ngClass",e
.VKq(3,Ne
,!_
.viewing
)),e
.xp6(4),e
.Q6J("readonly",_
.viewing
),e
.xp6(4),e
.Q6J("ngIf",_
.formGroup
.showError("secret_key",n
,"required"))}}let Qe
=(()=>{class t
{constructor(_
,n
,i
){this.formBuilder
=_
,this.activeModal
=n
,this.actionLabels
=i
,this.submitAction
=new e
.vpe
,this.viewing
=!0,this.userCandidates
=[],this.resource
="S3 Key",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({user
:[null,[a
.kI
.required
]],generate_key
:[!0],access_key
:[null,[m
.h
.requiredIf({generate_key
:!1})]],secret_key
:[null,[m
.h
.requiredIf({generate_key
:!1})]]})}setViewing(_
=!0){this.viewing
=_
,this.action
=this.viewing
?this.actionLabels
.SHOW
:this.actionLabels
.CREATE
}setValues(_
,n
,i
){this.formGroup
.setValue({user
:_
,generate_key
:u().isEmpty(n
),access_key
:n
,secret_key
:i
})}setUserCandidates(_
){this.userCandidates
=_
}onSubmit(){this.submitAction
.emit(this.formGroup
.value
),this.activeModal
.close()}}return t
.\u0275fac=function(_
){return new(_
||t
)(e
.Y36(J
.O
),e
.Y36(M
.Kz
),e
.Y36(A
.p4
))},t
.\u0275cmp=e
.Xpm({type
:t
,selectors
:[["cd-rgw-user-s3-key-modal"]],outputs
:{submitAction
:"submitAction"},decls
:23,vars
:24,consts:function(){let o
,_
,n
,i
,s
,c
,d
,E
,g
;return o
="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_
="Username",n
="-- Select a username --",i
="This field is required.",s
="Auto-generate key",c
="Access key",d
="This field is required.",E
="Secret key",g
="This field is required.",[[3,"modalRef"],[1,"modal-title"],o
,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","user",1,"cd-col-form-label",3,"ngClass"],_
,[1,"cd-col-form-input"],["id","user","class","form-control","type","text","formControlName","user",3,"readonly",4,"ngIf"],["id","user","class","form-control","formControlName","user","autofocus","",4,"ngIf"],["class","invalid-feedback",4,"ngIf"],["class","form-group row",4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","showSubmit","submitActionEvent"],["id","user","type","text","formControlName","user",1,"form-control",3,"readonly"],["id","user","formControlName","user","autofocus","",1,"form-control"],[3,"ngValue",4,"ngIf"],[3,"value",4,"ngFor","ngForOf"],[3,"ngValue"],n
,[3,"value"],[1,"invalid-feedback"],i
,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],s
,["for","access_key",1,"cd-col-form-label",3,"ngClass"],c
,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control",3,"readonly"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],d
,["for","secret_key",1,"cd-col-form-label",3,"ngClass"],E
,["id","secret_key","type","password","formControlName","secret_key",1,"form-control",3,"readonly"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],g
]},template:function(_
,n
){if(1&_
&&(e
.TgZ(0,"cd-modal",0),e
.ynx(1,1),e
.SDv(2,2),e
.ALo(3,"titlecase"),e
.ALo(4,"upperFirst"),e
.BQk(),e
.ynx(5,3),e
.TgZ(6,"form",4,5),e
.TgZ(8,"div",6),e
.TgZ(9,"div",7),e
.TgZ(10,"label",8),e
.SDv(11,9),e
.qZA(),e
.TgZ(12,"div",10),e
.YNc(13,tn
,1,1,"input",11),e
.YNc(14,sn
,3,2,"select",12),e
.YNc(15,an
,2,0,"span",13),e
.qZA(),e
.qZA(),e
.YNc(16,rn
,6,0,"div",14),e
.YNc(17,cn
,10,5,"div",14),e
.YNc(18,un
,10,5,"div",14),e
.qZA(),e
.TgZ(19,"div",15),e
.TgZ(20,"cd-form-button-panel",16),e
.NdJ("submitActionEvent",function(){return n
.onSubmit()}),e
.ALo(21,"titlecase"),e
.ALo(22,"upperFirst"),e
.qZA(),e
.qZA(),e
.qZA(),e
.BQk(),e
.qZA()),2&_
){const i
=e
.MAs(7);e
.Q6J("modalRef",n
.activeModal
),e
.xp6(4),e
.pQV(e
.lcZ(3,14,n
.action
))(e
.lcZ(4,16,n
.resource
)),e
.QtT(2),e
.xp6(2),e
.Q6J("formGroup",n
.formGroup
),e
.xp6(4),e
.Q6J("ngClass",e
.VKq(22,Ne
,!n
.viewing
)),e
.xp6(3),e
.Q6J("ngIf",n
.viewing
),e
.xp6(1),e
.Q6J("ngIf",!n
.viewing
),e
.xp6(1),e
.Q6J("ngIf",n
.formGroup
.showError("user",i
,"required")),e
.xp6(1),e
.Q6J("ngIf",!n
.viewing
),e
.xp6(1),e
.Q6J("ngIf",!n
.formGroup
.getValue("generate_key")),e
.xp6(1),e
.Q6J("ngIf",!n
.formGroup
.getValue("generate_key")),e
.xp6(2),e
.Q6J("form",n
.formGroup
)("submitText",e
.lcZ(21,18,n
.action
)+" "+e
.lcZ(22,20,n
.resource
))("showSubmit",!n
.viewing
)}},directives
:[fe
.z
,a
._Y
,a
.JL
,V
.V
,a
.sg
,H
.P
,f
.mk
,f
.O5
,ee
.p
,q
.o
,a
.Fj
,X
.b
,a
.JJ
,a
.u
,a
.EJ
,j
.U
,f
.sg
,a
.YN
,a
.Kr
,a
.Wl
,Ce
.C
,pe
.s
],pipes
:[f
.rS
,K
.m
],styles
:[""]}),t
})();class Rn
{}function gn(t
,o
){1&t
&&(e
.TgZ(0,"span",29),e
.SDv(1,30),e
.qZA())}function En(t
,o
){1&t
&&(e
.TgZ(0,"span",29),e
.SDv(1,31),e
.qZA())}function Tn(t
,o
){if(1&t
&&(e
.TgZ(0,"option",32),e
._uU(1),e
.qZA()),2&t
){const _
=o
.$implicit
;e
.Q6J("value",_
),e
.xp6(1),e
.hij(" ",_
," ")}}function Sn(t
,o
){1&t
&&(e
.TgZ(0,"span",29),e
.SDv(1,33),e
.qZA())}function fn(t
,o
){1&t
&&(e
.TgZ(0,"span",29),e
.SDv(1,48),e
.qZA())}function Cn(t
,o
){if(1&t
&&(e
.TgZ(0,"div",7),e
.TgZ(1,"label",41),e
.SDv(2,42),e
.qZA(),e
.TgZ(3,"div",10),e
.TgZ(4,"div",43),e
._UZ(5,"input",44),e
.TgZ(6,"span",45),e
._UZ(7,"button",46),e
._UZ(8,"cd-copy-2-clipboard-button",47),e
.qZA(),e
.qZA(),e
.YNc(9,fn
,2,0,"span",15),e
.qZA(),e
.qZA()),2&t
){const _
=e
.oxw(2),n
=e
.MAs(7);e
.xp6(9),e
.Q6J("ngIf",_
.formGroup
.showError("secret_key",n
,"required"))}}function pn(t
,o
){if(1&t
&&(e
.TgZ(0,"fieldset"),e
.TgZ(1,"legend"),e
.SDv(2,34),e
.qZA(),e
.TgZ(3,"div",7),e
.TgZ(4,"div",35),e
.TgZ(5,"div",36),e
._UZ(6,"input",37),e
.TgZ(7,"label",38),e
.SDv(8,39),e
.qZA(),e
.qZA(),e
.qZA(),e
.qZA(),e
.YNc(9,Cn
,10,1,"div",40),e
.qZA()),2&t
){const _
=e
.oxw();e
.xp6(9),e
.Q6J("ngIf",!_
.editing
&&!_
.formGroup
.getValue("generate_secret"))}}const Mn=function(t
){return{required
:t
}},mn=function(){return["read","write"]};let An
=(()=>{class t
{constructor(_
,n
,i
){this.formBuilder
=_
,this.bsModalRef
=n
,this.actionLabels
=i
,this.submitAction
=new e
.vpe
,this.editing
=!0,this.subusers
=[],this.resource
="Subuser",this.createForm()}createForm(){this.formGroup
=this.formBuilder
.group({uid
:[null],subuid
:[null,[a
.kI
.required
,this.subuserValidator()]],perm
:[null,[a
.kI
.required
]],generate_secret
:[!0],secret_key
:[null,[m
.h
.requiredIf({generate_secret
:!1})]]})}subuserValidator(){const _
=this;return n
=>_
.editing
||(0,m
.P
)(n
.value
)?null:_
.subusers
.some(s
=>u().isEqual(_
.getSubuserName(s
.id
),n
.value
))?{subuserIdExists
:!0}:null}getSubuserName(_
){if(u().isEmpty(_
))return _
;const n
=_
.match(/([^:]+)(:(.+))?/);return u().isUndefined(n[3])?n[1]:n[3]}setEditing(_=!0){this.editing=_,this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE}setValues(_,n="",i=""){this.formGroup.setValue({uid:_,subuid:this.getSubuserName(n),perm:i,generate_secret:!0,secret_key:null})}setSubusers(_){this.subusers=_}onSubmit(){const _=this.formGroup.value,n=new Rn;n.id=`${_.uid}:${_.subuid}`,n.permissions=_.perm,n.generate_secret=_.generate_secret,n.secret_key=_.secret_key,this.submitAction.emit(n),this.bsModalRef.close()}}return t.\u0275fac=function(_){return new(_||t)(e.Y36(J.O),e.Y36(M.Kz),e.Y36(A.p4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["cd-rgw-user-subuser-modal"]],outputs:{submitAction:"submitAction"},decls:39,vars:26,consts:function(){let o,_,n,i,s,c,d,E,g,C,b,P,G,N;return o="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_="Username",n="Subuser",i="Permission",s="-- Select a permission --",c="read, write",d="full",E="This field is required.",g="The chosen subuser ID is already in use.",C="This field is required.",b="Swift key",P="Auto-generate secret",G="Secret key",N="This field is required.",[[3,"modalRef"],[1,"modal-title"],o,[1,"modal-content"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"modal-body"],[1,"form-group","row"],["for","uid",1,"cd-col-form-label"],_,[1,"cd-col-form-input"],["id","uid","type","text","formControlName","uid",1,"form-control",3,"readonly"],["for","subuid",1,"cd-col-form-label",3,"ngClass"],n,["id","subuid","type","text","formControlName","subuid","autofocus","",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],["for","perm",1,"cd-col-form-label","required"],i,["id","perm","formControlName","perm",1,"form-control"],[3,"ngValue"],s,[3,"value",4,"ngFor","ngForOf"],["value","read-write"],c,["value","full-control"],d,[4,"ngIf"],[1,"modal-footer"],[3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],E,g,[3,"value"],C,b,[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","generate_secret","type","checkbox","formControlName","generate_secret",1,"custom-control-input"],["for","generate_secret",1,"custom-control-label"],P,["class","form-group row",4,"ngIf"],["for","secret_key",1,"cd-col-form-label","required"],G,[1,"input-group"],["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],N]},template:function(_,n){if(1&_&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.ALo(3,"titlecase"),e.ALo(4,"upperFirst"),e.BQk(),e.ynx(5,3),e.TgZ(6,"form",4,5),e.TgZ(8,"div",6),e.TgZ(9,"div",7),e.TgZ(10,"label",8),e.SDv(11,9),e.qZA(),e.TgZ(12,"div",10),e._UZ(13,"input",11),e.qZA(),e.qZA(),e.TgZ(14,"div",7),e.TgZ(15,"label",12),e.SDv(16,13),e.qZA(),e.TgZ(17,"div",10),e._UZ(18,"input",14),e.YNc(19,gn,2,0,"span",15),e.YNc(20,En,2,0,"span",15),e.qZA(),e.qZA(),e.TgZ(21,"div",7),e.TgZ(22,"label",16),e.SDv(23,17),e.qZA(),e.TgZ(24,"div",10),e.TgZ(25,"select",18),e.TgZ(26,"option",19),e.SDv(27,20),e.qZA(),e.YNc(28,Tn,2,2,"option",21),e.TgZ(29,"option",22),e.SDv(30,23),e.qZA(),e.TgZ(31,"option",24),e.SDv(32,25),e.qZA(),e.qZA(),e.YNc(33,Sn,2,0,"span",15),e.qZA(),e.qZA(),e.YNc(34,pn,10,1,"fieldset",26),e.qZA(),e.TgZ(35,"div",27),e.TgZ(36,"cd-form-button-panel",28),e.NdJ("submitActionEvent",function(){return n.onSubmit()}),e.ALo(37,"titlecase"),e.ALo(38,"upperFirst"),e.qZA(),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&_){const i=e.MAs(7);e.Q6J("modalRef",n.bsModalRef),e.xp6(4),e.pQV(e.lcZ(3,15,n.action))(e.lcZ(4,17,n.resource)),e.QtT(2),e.xp6(2),e.Q6J("formGroup",n.formGroup),e.xp6(7),e.Q6J("readonly",!0),e.xp6(2),e.Q6J("ngClass",e.VKq(23,Mn,!n.editing)),e.xp6(3),e.Q6J("readonly",n.editing),e.xp6(1),e.Q6J("ngIf",n.formGroup.showError("subuid",i,"required")),e.xp6(1),e.Q6J("ngIf",n.formGroup.showError("subuid",i,"subuserIdExists")),e.xp6(6),e.Q6J("ngValue",null),e.xp6(2),e.Q6J("ngForOf",e.DdM(25,mn)),e.xp6(5),e.Q6J("ngIf",n.formGroup.showError("perm",i,"required")),e.xp6(1),e.Q6J("ngIf",!n.editing),e.xp6(2),e.Q6J("form",n.formGroup)("submitText",e.lcZ(37,19,n.action)+" "+e.lcZ(38,21,n.resource))}},directives:[fe.z,a._Y,a.JL,V.V,a.sg,H.P,q.o,a.Fj,X.b,a.JJ,a.u,f.mk,j.U,f.O5,a.EJ,a.YN,a.Kr,f.sg,ee.p,a.Wl,Ce.C,pe.s],pipes:[f.rS,K.m],styles:[""]}),t})();var bn=r(13472);let Ye=(()=>{class t{constructor(_,n){this.activeModal=_,this.actionLabels=n,this.resource="Swift Key",this.action=this.actionLabels.SHOW}setValues(_,n){this.user=_,this.secret_key=n}}return t.\u0275fac=function(_){return new(_||t)(e.Y36(M.Kz),e.Y36(A.p4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["cd-rgw-user-swift-key-modal"]],decls:24,vars:11,consts:function(){let o,_,n;return o="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_="Username",n="Secret key",[[3,"modalRef"],[1,"modal-title"],o,[1,"modal-content"],[1,"modal-body"],["novalidate",""],[1,"form-group","row"],["for","user",1,"cd-col-form-label"],_,[1,"cd-col-form-input"],["id","user","name","user","type","text",1,"form-control",3,"readonly","ngModel","ngModelChange"],["for","secret_key",1,"cd-col-form-label"],n,[1,"input-group"],["id","secret_key","name","secret_key","type","password",1,"form-control",3,"ngModel","readonly","ngModelChange"],[1,"input-group-append"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],[1,"modal-footer"],[3,"backAction"]]},template:function(_,n){1&_&&(e.TgZ(0,"cd-modal",0),e.ynx(1,1),e.SDv(2,2),e.ALo(3,"titlecase"),e.ALo(4,"upperFirst"),e.BQk(),e.ynx(5,3),e.TgZ(6,"div",4),e.TgZ(7,"form",5),e.TgZ(8,"div",6),e.TgZ(9,"label",7),e.SDv(10,8),e.qZA(),e.TgZ(11,"div",9),e.TgZ(12,"input",10),e.NdJ("ngModelChange",function(s){return n.user=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(13,"div",6),e.TgZ(14,"label",11),e.SDv(15,12),e.qZA(),e.TgZ(16,"div",9),e.TgZ(17,"div",13),e.TgZ(18,"input",14),e.NdJ("ngModelChange",function(s){return n.secret_key=s}),e.qZA(),e.TgZ(19,"span",15),e._UZ(20,"button",16),e._UZ(21,"cd-copy-2-clipboard-button",17),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(22,"div",18),e.TgZ(23,"cd-back-button",19),e.NdJ("backAction",function(){return n.activeModal.close()}),e.qZA(),e.qZA(),e.BQk(),e.qZA()),2&_&&(e.Q6J("modalRef",n.activeModal),e.xp6(4),e.pQV(e.lcZ(3,7,n.action))(e.lcZ(4,9,n.resource)),e.QtT(2),e.xp6(8),e.Q6J("readonly",!0)("ngModel",n.user),e.xp6(6),e.Q6J("ngModel",n.secret_key)("readonly",!0))},directives:[fe.z,a._Y,a.JL,a.F,H.P,q.o,a.Fj,X.b,a.JJ,a.On,Ce.C,pe.s,bn.W],pipes:[f.rS,K.m],styles:[""]}),t})();var Pn=r(17932);function Gn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,50),e.qZA())}function Nn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,51),e.qZA())}function On(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,52),e.qZA())}function Un(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,56),e.qZA())}function Wn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,57),e.qZA())}function Zn(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",53),e.SDv(2,54),e.qZA(),e.TgZ(3,"div",11),e._UZ(4,"input",55),e.YNc(5,Un,2,0,"span",13),e.YNc(6,Wn,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(4),e.Q6J("readonly",n.editing),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("tenant",_,"pattern")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("tenant",_,"notUnique"))}}function $n(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,58),e.qZA())}function hn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,59),e.qZA())}function In(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,60),e.qZA())}function vn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,61),e.qZA())}function Fn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,64),e.qZA())}function Ln(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,65),e.qZA())}function Dn(t,o){if(1&t&&(e.TgZ(0,"div",8),e._UZ(1,"label",62),e.TgZ(2,"div",11),e._UZ(3,"input",63),e.YNc(4,Fn,2,0,"span",13),e.YNc(5,Ln,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(4),e.Q6J("ngIf",n.userForm.showError("max_buckets",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("max_buckets",_,"min"))}}function yn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,77),e.qZA())}function xn(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",70),e.SDv(2,71),e.qZA(),e.TgZ(3,"div",11),e.TgZ(4,"div",72),e._UZ(5,"input",73),e.TgZ(6,"span",74),e._UZ(7,"button",75),e._UZ(8,"cd-copy-2-clipboard-button",76),e.qZA(),e.qZA(),e.YNc(9,yn,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw(2);const _=e.MAs(2),n=e.oxw();e.xp6(9),e.Q6J("ngIf",n.userForm.showError("access_key",_,"required"))}}function qn(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,83),e.qZA())}function wn(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",78),e.SDv(2,79),e.qZA(),e.TgZ(3,"div",11),e.TgZ(4,"div",72),e._UZ(5,"input",80),e.TgZ(6,"span",74),e._UZ(7,"button",81),e._UZ(8,"cd-copy-2-clipboard-button",82),e.qZA(),e.qZA(),e.YNc(9,qn,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw(2);const _=e.MAs(2),n=e.oxw();e.xp6(9),e.Q6J("ngIf",n.userForm.showError("secret_key",_,"required"))}}function kn(t,o){if(1&t&&(e.TgZ(0,"fieldset"),e.TgZ(1,"legend"),e.SDv(2,66),e.qZA(),e.TgZ(3,"div",8),e.TgZ(4,"div",14),e.TgZ(5,"div",15),e._UZ(6,"input",67),e.TgZ(7,"label",68),e.SDv(8,69),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(9,xn,10,1,"div",19),e.YNc(10,wn,10,1,"div",19),e.qZA()),2&t){const _=e.oxw(2);e.xp6(9),e.Q6J("ngIf",!_.editing&&!_.userForm.getValue("generate_key")),e.xp6(1),e.Q6J("ngIf",!_.editing&&!_.userForm.getValue("generate_key"))}}function Bn(t,o){1&t&&(e.TgZ(0,"span",93),e.TgZ(1,"span",94),e.SDv(2,95),e.qZA(),e.qZA())}const L=function(t){return[t]};function Hn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"span"),e.TgZ(1,"div",72),e.TgZ(2,"div",96),e.TgZ(3,"span",97),e._UZ(4,"i"),e.qZA(),e.qZA(),e._UZ(5,"input",98),e.TgZ(6,"div",99),e.TgZ(7,"span",97),e._UZ(8,"i"),e.qZA(),e.qZA(),e._UZ(9,"input",98),e.TgZ(10,"span",74),e.TgZ(11,"button",100),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).showSubuserModal(s)}),e._UZ(12,"i",90),e.qZA(),e.TgZ(13,"button",101),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).deleteSubuser(s)}),e._UZ(14,"i",90),e.qZA(),e.qZA(),e.qZA(),e._UZ(15,"span",94),e.qZA()}if(2&t){const _=o.$implicit,n=e.oxw(3);e.xp6(4),e.Tol(n.icons.user),e.xp6(1),e.s9C("value",_.id),e.xp6(3),e.Tol(n.icons.share),e.xp6(1),e.s9C("value","full-control"===_.permissions?"full":_.permissions),e.xp6(3),e.Q6J("ngClass",e.VKq(10,L,n.icons.edit)),e.xp6(2),e.Q6J("ngClass",e.VKq(12,L,n.icons.destroy))}}function Xn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"fieldset"),e.TgZ(1,"legend"),e.SDv(2,84),e.qZA(),e.TgZ(3,"div",85),e.TgZ(4,"div",14),e.YNc(5,Bn,3,0,"span",86),e.YNc(6,Hn,16,14,"span",87),e.TgZ(7,"div",85),e.TgZ(8,"div",88),e.TgZ(9,"button",89),e.NdJ("click",function(){return e.CHM(_),e.oxw(2).showSubuserModal()}),e._UZ(10,"i",90),e.ynx(11),e.SDv(12,91),e.ALo(13,"titlecase"),e.ALo(14,"upperFirst"),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(15,"span",92),e.qZA(),e.qZA(),e.qZA()}if(2&t){const _=e.oxw(2);e.xp6(5),e.Q6J("ngIf",0===_.subusers.length),e.xp6(1),e.Q6J("ngForOf",_.subusers),e.xp6(4),e.Q6J("ngClass",e.VKq(9,L,_.icons.add)),e.xp6(4),e.pQV(e.lcZ(13,5,_.actionLabels.CREATE))(e.lcZ(14,7,_.subuserLabel)),e.QtT(12)}}function Kn(t,o){1&t&&(e.TgZ(0,"span",93),e.TgZ(1,"span",94),e.SDv(2,107),e.qZA(),e.qZA())}function zn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"span"),e.TgZ(1,"div",72),e.TgZ(2,"div",96),e.TgZ(3,"div",97),e._UZ(4,"i"),e.qZA(),e.qZA(),e._UZ(5,"input",98),e.TgZ(6,"span",74),e.TgZ(7,"button",108),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).showS3KeyModal(s)}),e._UZ(8,"i",90),e.qZA(),e.TgZ(9,"button",109),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).deleteS3Key(s)}),e._UZ(10,"i",90),e.qZA(),e.qZA(),e.qZA(),e._UZ(11,"span",94),e.qZA()}if(2&t){const _=o.$implicit,n=e.oxw(3);e.xp6(4),e.Tol(n.icons.key),e.xp6(1),e.s9C("value",_.user),e.xp6(3),e.Q6J("ngClass",e.VKq(6,L,n.icons.show)),e.xp6(2),e.Q6J("ngClass",e.VKq(8,L,n.icons.destroy))}}function Qn(t,o){1&t&&(e.TgZ(0,"span",93),e.TgZ(1,"span",94),e.SDv(2,110),e.qZA(),e.qZA())}function Yn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"span"),e.TgZ(1,"div",72),e.TgZ(2,"div",96),e.TgZ(3,"span",97),e._UZ(4,"i"),e.qZA(),e.qZA(),e._UZ(5,"input",98),e.TgZ(6,"span",74),e.TgZ(7,"button",111),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).showSwiftKeyModal(s)}),e._UZ(8,"i",90),e.qZA(),e.qZA(),e.qZA(),e._UZ(9,"span",94),e.qZA()}if(2&t){const _=o.$implicit,n=e.oxw(3);e.xp6(4),e.Tol(n.icons.key),e.xp6(1),e.s9C("value",_.user),e.xp6(3),e.Q6J("ngClass",e.VKq(5,L,n.icons.show))}}function Jn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"fieldset"),e.TgZ(1,"legend"),e.SDv(2,102),e.qZA(),e.TgZ(3,"div",8),e.TgZ(4,"label",62),e.SDv(5,103),e.qZA(),e.TgZ(6,"div",11),e.YNc(7,Kn,3,0,"span",86),e.YNc(8,zn,12,10,"span",87),e.TgZ(9,"div",85),e.TgZ(10,"div",88),e.TgZ(11,"button",104),e.NdJ("click",function(){return e.CHM(_),e.oxw(2).showS3KeyModal()}),e._UZ(12,"i",90),e.ynx(13),e.SDv(14,105),e.ALo(15,"titlecase"),e.ALo(16,"upperFirst"),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(17,"span",92),e.qZA(),e._UZ(18,"hr"),e.qZA(),e.TgZ(19,"div",8),e.TgZ(20,"label",62),e.SDv(21,106),e.qZA(),e.TgZ(22,"div",11),e.YNc(23,Qn,3,0,"span",86),e.YNc(24,Yn,10,7,"span",87),e.qZA(),e.qZA(),e.qZA()}if(2&t){const _=e.oxw(2);e.xp6(7),e.Q6J("ngIf",0===_.s3Keys.length),e.xp6(1),e.Q6J("ngForOf",_.s3Keys),e.xp6(4),e.Q6J("ngClass",e.VKq(11,L,_.icons.add)),e.xp6(4),e.pQV(e.lcZ(15,7,_.actionLabels.CREATE))(e.lcZ(16,9,_.s3keyLabel)),e.QtT(14),e.xp6(7),e.Q6J("ngIf",0===_.swiftKeys.length),e.xp6(1),e.Q6J("ngForOf",_.swiftKeys)}}function Vn(t,o){1&t&&(e.TgZ(0,"span",93),e.TgZ(1,"span",94),e.SDv(2,115),e.qZA(),e.qZA())}function jn(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"span"),e.TgZ(1,"div",72),e.TgZ(2,"span",96),e.TgZ(3,"div",97),e._UZ(4,"i"),e.qZA(),e.qZA(),e._UZ(5,"input",98),e.TgZ(6,"span",74),e.TgZ(7,"button",116),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).showCapabilityModal(s)}),e._UZ(8,"i",90),e.qZA(),e.TgZ(9,"button",117),e.NdJ("click",function(){const s=e.CHM(_).index;return e.oxw(3).deleteCapability(s)}),e._UZ(10,"i",90),e.qZA(),e.qZA(),e.qZA(),e._UZ(11,"span",94),e.qZA()}if(2&t){const _=o.$implicit,n=e.oxw(3);e.xp6(4),e.Tol(n.icons.share),e.xp6(1),e.hYB("value","",_.type,":",_.perm,""),e.xp6(3),e.Q6J("ngClass",e.VKq(7,L,n.icons.edit)),e.xp6(2),e.Q6J("ngClass",e.VKq(9,L,n.icons.destroy))}}function eo(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"fieldset"),e.TgZ(1,"legend"),e.SDv(2,112),e.qZA(),e.TgZ(3,"div",8),e.TgZ(4,"div",14),e.YNc(5,Vn,3,0,"span",86),e.YNc(6,jn,12,11,"span",87),e.TgZ(7,"div",85),e.TgZ(8,"div",88),e.TgZ(9,"button",113),e.NdJ("click",function(){return e.CHM(_),e.oxw(2).showCapabilityModal()}),e.ALo(10,"pipeFunction"),e.ALo(11,"pipeFunction"),e._UZ(12,"i",90),e.ynx(13),e.SDv(14,114),e.ALo(15,"titlecase"),e.ALo(16,"upperFirst"),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e._UZ(17,"span",92),e.qZA(),e.qZA(),e.qZA()}if(2&t){const _=e.oxw(2);e.xp6(5),e.Q6J("ngIf",0===_.capabilities.length),e.xp6(1),e.Q6J("ngForOf",_.capabilities),e.xp6(3),e.Q6J("disabled",e.xi3(10,7,_.capabilities,_.hasAllCapabilities))("disableTooltip",!e.xi3(11,10,_.capabilities,_.hasAllCapabilities)),e.xp6(3),e.Q6J("ngClass",e.VKq(17,L,_.icons.add)),e.xp6(4),e.pQV(e.lcZ(15,13,_.actionLabels.ADD))(e.lcZ(16,15,_.capabilityLabel)),e.QtT(14)}}function _o(t,o){1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"div",14),e.TgZ(2,"div",15),e._UZ(3,"input",118),e.TgZ(4,"label",119),e.SDv(5,120),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function to(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,124),e.qZA())}function no(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,125),e.qZA())}function oo(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",121),e.SDv(2,122),e.qZA(),e.TgZ(3,"div",11),e._UZ(4,"input",123),e.YNc(5,to,2,0,"span",13),e.YNc(6,no,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(5),e.Q6J("ngIf",n.userForm.showError("user_quota_max_size",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("user_quota_max_size",_,"quotaMaxSize"))}}function io(t,o){1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"div",14),e.TgZ(2,"div",15),e._UZ(3,"input",126),e.TgZ(4,"label",127),e.SDv(5,128),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function so(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,132),e.qZA())}function ao(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,133),e.qZA())}function ro(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",129),e.SDv(2,130),e.qZA(),e.TgZ(3,"div",11),e._UZ(4,"input",131),e.YNc(5,so,2,0,"span",13),e.YNc(6,ao,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(5),e.Q6J("ngIf",n.userForm.showError("user_quota_max_objects",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("user_quota_max_objects",_,"min"))}}function lo(t,o){1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"div",14),e.TgZ(2,"div",15),e._UZ(3,"input",134),e.TgZ(4,"label",135),e.SDv(5,136),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function co(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,140),e.qZA())}function uo(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,141),e.qZA())}function Ro(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",137),e.SDv(2,138),e.qZA(),e.TgZ(3,"div",11),e._UZ(4,"input",139),e.YNc(5,co,2,0,"span",13),e.YNc(6,uo,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(5),e.Q6J("ngIf",n.userForm.showError("bucket_quota_max_size",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("bucket_quota_max_size",_,"quotaMaxSize"))}}function go(t,o){1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"div",14),e.TgZ(2,"div",15),e._UZ(3,"input",142),e.TgZ(4,"label",143),e.SDv(5,144),e.qZA(),e.qZA(),e.qZA(),e.qZA())}function Eo(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,148),e.qZA())}function To(t,o){1&t&&(e.TgZ(0,"span",49),e.SDv(1,149),e.qZA())}function So(t,o){if(1&t&&(e.TgZ(0,"div",8),e.TgZ(1,"label",145),e.SDv(2,146),e.qZA(),e.TgZ(3,"div",11),e._UZ(4,"input",147),e.YNc(5,Eo,2,0,"span",13),e.YNc(6,To,2,0,"span",13),e.qZA(),e.qZA()),2&t){e.oxw();const _=e.MAs(2),n=e.oxw();e.xp6(5),e.Q6J("ngIf",n.userForm.showError("bucket_quota_max_objects",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("bucket_quota_max_objects",_,"min"))}}const Je=function(t){return{required:t}};function fo(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"div",1),e.TgZ(1,"form",2,3),e.TgZ(3,"div",4),e.TgZ(4,"div",5),e.SDv(5,6),e.ALo(6,"titlecase"),e.ALo(7,"upperFirst"),e.qZA(),e.TgZ(8,"div",7),e.TgZ(9,"div",8),e.TgZ(10,"label",9),e.SDv(11,10),e.qZA(),e.TgZ(12,"div",11),e._UZ(13,"input",12),e.YNc(14,Gn,2,0,"span",13),e.YNc(15,Nn,2,0,"span",13),e.YNc(16,On,2,0,"span",13),e.qZA(),e.qZA(),e.TgZ(17,"div",8),e.TgZ(18,"div",14),e.TgZ(19,"div",15),e.TgZ(20,"input",16),e.NdJ("click",function(){return e.CHM(_),e.oxw().updateFieldsWhenTenanted()}),e.qZA(),e.TgZ(21,"label",17),e.SDv(22,18),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(23,Zn,7,3,"div",19),e.TgZ(24,"div",8),e.TgZ(25,"label",20),e.SDv(26,21),e.qZA(),e.TgZ(27,"div",11),e._UZ(28,"input",22),e.YNc(29,$n,2,0,"span",13),e.YNc(30,hn,2,0,"span",13),e.qZA(),e.qZA(),e.TgZ(31,"div",8),e.TgZ(32,"label",23),e.SDv(33,24),e.qZA(),e.TgZ(34,"div",11),e._UZ(35,"input",25),e.YNc(36,In,2,0,"span",13),e.YNc(37,vn,2,0,"span",13),e.qZA(),e.qZA(),e.TgZ(38,"div",8),e.TgZ(39,"label",26),e.SDv(40,27),e.qZA(),e.TgZ(41,"div",11),e.TgZ(42,"select",28),e.NdJ("change",function(i){return e.CHM(_),e.oxw().onMaxBucketsModeChange(i.target.value)}),e.TgZ(43,"option",29),e.SDv(44,30),e.qZA(),e.TgZ(45,"option",31),e.SDv(46,32),e.qZA(),e.TgZ(47,"option",33),e.SDv(48,34),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(49,Dn,6,2,"div",19),e.TgZ(50,"div",8),e.TgZ(51,"div",14),e.TgZ(52,"div",15),e._UZ(53,"input",35),e.TgZ(54,"label",36),e.SDv(55,37),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(56,kn,11,2,"fieldset",38),e.YNc(57,Xn,16,11,"fieldset",38),e.YNc(58,Jn,25,13,"fieldset",38),e.YNc(59,eo,18,19,"fieldset",38),e.TgZ(60,"fieldset"),e.TgZ(61,"legend"),e.SDv(62,39),e.qZA(),e.TgZ(63,"div",8),e.TgZ(64,"div",14),e.TgZ(65,"div",15),e._UZ(66,"input",40),e.TgZ(67,"label",41),e.SDv(68,42),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(69,_o,6,0,"div",19),e.YNc(70,oo,7,2,"div",19),e.YNc(71,io,6,0,"div",19),e.YNc(72,ro,7,2,"div",19),e.qZA(),e.TgZ(73,"fieldset"),e.TgZ(74,"legend"),e.SDv(75,43),e.qZA(),e.TgZ(76,"div",8),e.TgZ(77,"div",14),e.TgZ(78,"div",15),e._UZ(79,"input",44),e.TgZ(80,"label",45),e.SDv(81,46),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(82,lo,6,0,"div",19),e.YNc(83,Ro,7,2,"div",19),e.YNc(84,go,6,0,"div",19),e.YNc(85,So,7,2,"div",19),e.qZA(),e.qZA(),e.TgZ(86,"div",47),e.TgZ(87,"cd-form-button-panel",48),e.NdJ("submitActionEvent",function(){return e.CHM(_),e.oxw().onSubmit()}),e.ALo(88,"titlecase"),e.ALo(89,"upperFirst"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&t){const _=e.MAs(2),n=e.oxw();e.xp6(1),e.Q6J("formGroup",n.userForm),e.xp6(6),e.pQV(e.lcZ(6,30,n.action))(e.lcZ(7,32,n.resource)),e.QtT(5),e.xp6(3),e.Q6J("ngClass",e.VKq(38,Je,!n.editing)),e.xp6(3),e.Q6J("readonly",n.editing),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("user_id",_,"required")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("user_id",_,"pattern")),e.xp6(1),e.Q6J("ngIf",!n.userForm.getValue("show_tenant")&&n.userForm.showError("user_id",_,"notUnique")),e.xp6(4),e.Q6J("readonly",!0),e.xp6(3),e.Q6J("ngIf",n.userForm.getValue("show_tenant")),e.xp6(2),e.Q6J("ngClass",e.VKq(40,Je,!n.editing)),e.xp6(4),e.Q6J("ngIf",n.userForm.showError("display_name",_,"pattern")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("display_name",_,"required")),e.xp6(6),e.Q6J("ngIf",n.userForm.showError("email",_,"email")),e.xp6(1),e.Q6J("ngIf",n.userForm.showError("email",_,"notUnique")),e.xp6(12),e.Q6J("ngIf",1==n.userForm.get("max_buckets_mode").value),e.xp6(7),e.Q6J("ngIf",!n.editing),e.xp6(1),e.Q6J("ngIf",n.editing),e.xp6(1),e.Q6J("ngIf",n.editing),e.xp6(1),e.Q6J("ngIf",n.editing),e.xp6(10),e.Q6J("ngIf",n.userForm.controls.user_quota_enabled.value),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.user_quota_enabled.value&&!n.userForm.getValue("user_quota_max_size_unlimited")),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.user_quota_enabled.value),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.user_quota_enabled.value&&!n.userForm.getValue("user_quota_max_objects_unlimited")),e.xp6(10),e.Q6J("ngIf",n.userForm.controls.bucket_quota_enabled.value),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.bucket_quota_enabled.value&&!n.userForm.getValue("bucket_quota_max_size_unlimited")),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.bucket_quota_enabled.value),e.xp6(1),e.Q6J("ngIf",n.userForm.controls.bucket_quota_enabled.value&&!n.userForm.getValue("bucket_quota_max_objects_unlimited")),e.xp6(2),e.Q6J("form",n.userForm)("submitText",e.lcZ(88,34,n.action)+" "+e.lcZ(89,36,n.resource))}}let Ve=(()=>{class t extends Ie.E{constructor(_,n,i,s,c,d,E){super(),this.formBuilder=_,this.route=n,this.router=i,this.rgwUserService=s,this.modalService=c,this.notificationService=d,this.actionLabels=E,this.editing=!1,this.submitObservables=[],this.icons=D.P,this.subusers=[],this.s3Keys=[],this.swiftKeys=[],this.capabilities=[],this.showTenant=!1,this.previousTenant=null,this.resource="user",this.subuserLabel="subuser",this.s3keyLabel="S3 Key",this.capabilityLabel="capability",this.editing=this.router.url.startsWith(`/rgw
/user/${A.MQ.EDIT}
`),this.action=this.editing?this.actionLabels.EDIT:this.actionLabels.CREATE,this.createForm()}createForm(){this.userForm=this.formBuilder.group({user_id:[null,[a.kI.required,a.kI.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[m.h.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("tenant"))]],show_tenant:[this.editing],tenant:[null,[a.kI.pattern(/^[a-zA-Z0-9!@#%^&*()_-]+$/)],this.editing?[]:[m.h.unique(this.rgwUserService.exists,this.rgwUserService,()=>this.userForm.getValue("user_id"),!0)]],display_name:[null,[a.kI.required,a.kI.pattern(/^[a-zA-Z0-9!@#%^&*()_ -]+$/)]],email:[null,[m.h.email],[m.h.unique(this.rgwUserService.emailExists,this.rgwUserService)]],max_buckets_mode:[1],max_buckets:[1e3,[m.h.requiredIf({max_buckets_mode:"1"}),m.h.number(!1)]],suspended:[!1],generate_key:[!0],access_key:[null,[m.h.requiredIf({generate_key:!1})]],secret_key:[null,[m.h.requiredIf({generate_key:!1})]],user_quota_enabled:[!1],user_quota_max_size_unlimited:[!0],user_quota_max_size:[null,[m.h.composeIf({user_quota_enabled:!0,user_quota_max_size_unlimited:!1},[a.kI.required,this.quotaMaxSizeValidator])]],user_quota_max_objects_unlimited:[!0],user_quota_max_objects:[null,[m.h.requiredIf({user_quota_enabled:!0,user_quota_max_objects_unlimited:!1})]],bucket_quota_enabled:[!1],bucket_quota_max_size_unlimited:[!0],bucket_quota_max_size:[null,[m.h.composeIf({bucket_quota_enabled:!0,bucket_quota_max_size_unlimited:!1},[a.kI.required,this.quotaMaxSizeValidator])]],bucket_quota_max_objects_unlimited:[!0],bucket_quota_max_objects:[null,[m.h.requiredIf({bucket_quota_enabled:!0,bucket_quota_max_objects_unlimited:!1})]]})}ngOnInit(){this.route.params.subscribe(_=>{if(!_.hasOwnProperty("uid"))return void this.loadingReady();const n=decodeURIComponent(_.uid),i=[];i.push(this.rgwUserService.get(n)),i.push(this.rgwUserService.getQuota(n)),(0,Y.D)(i).subscribe(s=>{const c=u().clone(this.userForm.value);let d=u().pick(s[0],u().keys(this.userForm.value));switch(d.max_buckets){case-1:d.max_buckets_mode=-1,d.max_buckets="";break;case 0:d.max_buckets_mode=0,d.max_buckets="";break;default:d.max_buckets_mode=1}["user","bucket"].forEach(g=>{const C=s[1][g+"_quota"];d[g+"_quota_enabled"]=C.enabled,C.max_size<0?(d[g+"_quota_max_size_unlimited"]=!0,d[g+"_quota_max_size"]=null):(d[g+"_quota_max_size_unlimited"]=!1,d[g+"_quota_max_size"]=`${C.max_size} B
`),C.max_objects<0?(d[g+"_quota_max_objects_unlimited"]=!0,d[g+"_quota_max_objects"]=null):(d[g+"_quota_max_objects_unlimited"]=!1,d[g+"_quota_max_objects"]=C.max_objects)}),d=u().merge(c,d),this.userForm.setValue(d),this.subusers=s[0].subusers,this.s3Keys=s[0].keys,this.swiftKeys=s[0].swift_keys;const E={"read, write":"*"};s[0].caps.forEach(g=>{g.perm in E&&(g.perm=E[g.perm])}),this.capabilities=s[0].caps,this.loadingReady()},()=>{this.loadingError()})})}goToListView(){this.router.navigate(["/rgw/user"])}onSubmit(){let _;if(this.userForm.pristine)return void this.goToListView();const n=this.getUID();if(this.editing){if(this._isGeneralDirty()){const i=this._getUpdateArgs();this.submitObservables.push(this.rgwUserService.update(n,i))}_="Updated Object Gateway user '" + n + "'"}else{const i=this._getCreateArgs();this.submitObservables.push(this.rgwUserService.create(i)),_="Created Object Gateway user '" + n + "'"}if(this._isUserQuotaDirty()){const i=this._getUserQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(n,i))}if(this._isBucketQuotaDirty()){const i=this._getBucketQuotaArgs();this.submitObservables.push(this.rgwUserService.updateQuota(n,i))}(0,Ht.z)(...this.submitObservables).subscribe({error:()=>{this.userForm.setErrors({cdSubmitButton:!0})},complete:()=>{this.notificationService.show(Ae.k.success,_),this.goToListView()}})}updateFieldsWhenTenanted(){this.showTenant=this.userForm.getValue("show_tenant"),this.showTenant?(this.userForm.get("user_id").markAsTouched(),this.previousTenant=this.userForm.get("tenant").value,this.userForm.get("tenant").patchValue(null)):(this.userForm.get("user_id").markAsUntouched(),this.userForm.get("tenant").patchValue(this.previousTenant))}getUID(){var _;let n=this.userForm.getValue("user_id");const i=null===(_=this.userForm)||void 0===_?void 0:_.getValue("tenant");return i&&i.length>0&&(n=`${this.userForm.getValue("tenant")}
$${n}
`),n}quotaMaxSizeValidator(_){return(0,m.P)(_.value)?null:null===RegExp("^(\\d+(\\.\\d+)?)\\s*(B|K(B|iB)?|M(B|iB)?|G(B|iB)?|T(B|iB)?)?$","i").exec(_.value)||(new Ge.H).toBytes(_.value)<1024?{quotaMaxSize:!0}:null}setSubuser(_,n){const i={"full-control":"full","read-write":"readwrite"},s=this.getUID();this.submitObservables.push(this.rgwUserService.createSubuser(s,{subuser:_.id,access:_.permissions in i?i[_.permissions]:_.permissions,key_type:"swift",secret_key:_.secret_key,generate_secret:_.generate_secret?"true":"false"})),u().isNumber(n)?this.subusers[n]=_:(this.subusers.push(_),this.swiftKeys.push({user:_.id,secret_key:_.generate_secret?"Apply your changes first...":_.secret_key})),this.userForm.markAsDirty()}deleteSubuser(_){const n=this.subusers[_];this.submitObservables.push(this.rgwUserService.deleteSubuser(this.getUID(),n.id)),this.s3Keys=this.s3Keys.filter(i=>i.user!==n.id),this.swiftKeys=this.swiftKeys.filter(i=>i.user!==n.id),this.subusers.splice(_,1),this.userForm.markAsDirty()}setCapability(_,n){const i=this.getUID();if(u().isNumber(n)){const s=this.capabilities[n];this.submitObservables.push(this.rgwUserService.deleteCapability(i,s.type,s.perm)),this.submitObservables.push(this.rgwUserService.addCapability(i,_.type,_.perm)),this.capabilities[n]=_}else this.submitObservables.push(this.rgwUserService.addCapability(i,_.type,_.perm)),this.capabilities=[...this.capabilities,_];this.userForm.markAsDirty()}deleteCapability(_){const n=this.capabilities[_];this.submitObservables.push(this.rgwUserService.deleteCapability(this.getUID(),n.type,n.perm)),this.capabilities.splice(_,1),this.capabilities=[...this.capabilities],this.userForm.markAsDirty()}hasAllCapabilities(_){return!u().difference(ze.getAll(),u().map(_,"type")).length}setS3Key(_,n){if(!u().isNumber(n)){const i=_.user.match(/([^:]+)(:(.+))?/),s=i[1],c={subuser:i[2]?i[3]:"",generate_key:_.generate_key?"true":"false"};"false"===c.generate_key&&(u().isNil(_.access_key)||(c.access_key=_.access_key),u().isNil(_.secret_key)||(c.secret_key=_.secret_key)),this.submitObservables.push(this.rgwUserService.addS3Key(s,c)),this.s3Keys.push({user:_.user,access_key:_.generate_key?"Apply your changes first...":_.access_key,secret_key:_.generate_key?"Apply your changes first...":_.secret_key})}this.userForm.markAsDirty()}deleteS3Key(_){const n=this.s3Keys[_];this.submitObservables.push(this.rgwUserService.deleteS3Key(this.getUID(),n.access_key)),this.s3Keys.splice(_,1),this.userForm.markAsDirty()}showSubuserModal(_){const n=this.getUID(),i=this.modalService.show(An);if(u().isNumber(_)){const s=this.subusers[_];i.componentInstance.setEditing(),i.componentInstance.setValues(n,s.id,s.permissions)}else i.componentInstance.setEditing(!1),i.componentInstance.setValues(n),i.componentInstance.setSubusers(this.subusers);i.componentInstance.submitAction.subscribe(s=>{this.setSubuser(s,_)})}showS3KeyModal(_){const n=this.modalService.show(Qe);if(u().isNumber(_)){const i=this.s3Keys[_];n.componentInstance.setViewing(),n.componentInstance.setValues(i.user,i.access_key,i.secret_key)}else{const i=this._getS3KeyUserCandidates();n.componentInstance.setViewing(!1),n.componentInstance.setUserCandidates(i),n.componentInstance.submitAction.subscribe(s=>{this.setS3Key(s)})}}showSwiftKeyModal(_){const n=this.modalService.show(Ye),i=this.swiftKeys[_];n.componentInstance.setValues(i.user,i.secret_key)}showCapabilityModal(_){const n=this.modalService.show(_n);if(u().isNumber(_)){const i=this.capabilities[_];n.componentInstance.setEditing(),n.componentInstance.setValues(i.type,i.perm)}else n.componentInstance.setEditing(!1),n.componentInstance.setCapabilities(this.capabilities);n.componentInstance.submitAction.subscribe(i=>{this.setCapability(i,_)})}_isGeneralDirty(){return["display_name","email","max_buckets_mode","max_buckets","suspended"].some(_=>this.userForm.get(_).dirty)}_isUserQuotaDirty(){return["user_quota_enabled","user_quota_max_size_unlimited","user_quota_max_size","user_quota_max_objects_unlimited","user_quota_max_objects"].some(_=>this.userForm.get(_).dirty)}_isBucketQuotaDirty(){return["bucket_quota_enabled","bucket_quota_max_size_unlimited","bucket_quota_max_size","bucket_quota_max_objects_unlimited","bucket_quota_max_objects"].some(_=>this.userForm.get(_).dirty)}_getCreateArgs(){const _={uid:this.getUID(),display_name:this.userForm.getValue("display_name"),suspended:this.userForm.getValue("suspended"),email:"",max_buckets:this.userForm.getValue("max_buckets"),generate_key:this.userForm.getValue("generate_key"),access_key:"",secret_key:""},n=this.userForm.getValue("email");u().isString(n)&&n.length>0&&u().merge(_,{email:n}),this.userForm.getValue("generate_key")||u().merge(_,{generate_key:!1,access_key:this.userForm.getValue("access_key"),secret_key:this.userForm.getValue("secret_key")});const s=parseInt(this.userForm.getValue("max_buckets_mode"),10);return u().includes([-1,0],s)&&u().merge(_,{max_buckets:s}),_}_getUpdateArgs(){const _={},n=["display_name","email","max_buckets","suspended"];for(const s of n)_[s]=this.userForm.getValue(s);const i=parseInt(this.userForm.getValue("max_buckets_mode"),10);return u().includes([-1,0],i)&&(_.max_buckets=i),_}_getUserQuotaArgs(){const _={quota_type:"user",enabled:this.userForm.getValue("user_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("user_quota_max_size_unlimited")){const n=(new Ge.H).toBytes(this.userForm.getValue("user_quota_max_size"));_.max_size_kb=(n/1024).toFixed(0)}return this.userForm.getValue("user_quota_max_objects_unlimited")||(_.max_objects=this.userForm.getValue("user_quota_max_objects")),_}_getBucketQuotaArgs(){const _={quota_type:"bucket",enabled:this.userForm.getValue("bucket_quota_enabled"),max_size_kb:-1,max_objects:-1};if(!this.userForm.getValue("bucket_quota_max_size_unlimited")){const n=(new Ge.H).toBytes(this.userForm.getValue("bucket_quota_max_size"));_.max_size_kb=(n/1024).toFixed(0)}return this.userForm.getValue("bucket_quota_max_objects_unlimited")||(_.max_objects=this.userForm.getValue("bucket_quota_max_objects")),_}_getS3KeyUserCandidates(){let _=[];const n=this.getUID();return u().isString(n)&&!u().isEmpty(n)&&_.push(n),this.subusers.forEach(i=>{_.push(i.id)}),this.s3Keys.forEach(i=>{_.push(i.user)}),_=u().uniq(_),_}onMaxBucketsModeChange(_){"1"===_&&(this.userForm.get("max_buckets").valid||this.userForm.patchValue({max_buckets:1e3}))}}return t.\u0275fac=function(_){return new(_||t)(e.Y36(J.O),e.Y36(w.gz),e.Y36(w.F0),e.Y36(O),e.Y36(Te.Z),e.Y36(ve.g),e.Y36(A.p4))},t.\u0275cmp=e.Xpm({type:t,selectors:[["cd-rgw-user-form"]],features:[e.qOj],decls:1,vars:1,consts:function(){let o,_,n,i,s,c,d,E,g,C,b,P,G,N,p,U,W,Z,$,h,I,v,F,T,y,x,S,_e,te,ne,oe,ie,se,ae,re,le,ce,de,ue,Re,R,__,t_,n_,o_,i_,s_,a_,r_,l_,c_,d_,u_,R_,g_,E_,T_,S_,f_,C_,p_,M_,m_,A_,b_,P_,G_,N_;return o="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",_="User ID",n="Show Tenant",i="Full name",s="Email address",c="Max. buckets",d="Disabled",E="Unlimited",g="Custom",C="Suspended",b="User quota",P="Enabled",G="Bucket quota",N="Enabled",p="This field is required.",U="The value is not valid.",W="The chosen user ID is already in use.",Z="Tenant",$="The value is not valid.",h="The chosen user ID exists in this tenant.",I="The value is not valid.",v="This field is required.",F="This is not a valid email address.",T="The chosen email address is already in use.",y="This field is required.",x="The entered value must be >= 1.",S="S3 key",_e="Auto-generate key",te="Access key",ne="This field is required.",oe="Secret key",ie="This field is required.",se="Subusers",ae="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",re="There are no subusers.",le="Edit",ce="Delete",de="Keys",ue="S3",Re="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",R="Swift",__="There are no keys.",t_="Show",n_="Delete",o_="There are no keys.",i_="Show",s_="Capabilities",a_="All capabilities are already added.",r_="" + "\ufffd0\ufffd" + " " + "\ufffd1\ufffd" + "",l_="There are no capabilities.",c_="Edit",d_="Delete",u_="Unlimited size",R_="Max. size",g_="This field is required.",E_="The value is not valid.",T_="Unlimited objects",S_="Max. objects",f_="This field is required.",C_="The entered value must be >= 0.",p_="Unlimited size",M_="Max. size",m_="This field is required.",A_="The value is not valid.",b_="Unlimited objects",P_="Max. objects",G_="This field is required.",N_="The entered value must be >= 0.",[["class","cd-col-form",4,"cdFormLoading"],[1,"cd-col-form"],["novalidate","",3,"formGroup"],["frm","ngForm"],[1,"card"],[1,"card-header"],o,[1,"card-body"],[1,"form-group","row"],["for","user_id",1,"cd-col-form-label",3,"ngClass"],_,[1,"cd-col-form-input"],["id","user_id","type","text","formControlName","user_id",1,"form-control",3,"readonly"],["class","invalid-feedback",4,"ngIf"],[1,"cd-col-form-offset"],[1,"custom-control","custom-checkbox"],["id","show_tenant","type","checkbox","formControlName","show_tenant",1,"custom-control-input",3,"readonly","click"],["for","show_tenant",1,"custom-control-label"],n,["class","form-group row",4,"ngIf"],["for","display_name",1,"cd-col-form-label",3,"ngClass"],i,["id","display_name","type","text","formControlName","display_name",1,"form-control"],["for","email",1,"cd-col-form-label"],s,["id","email","type","text","formControlName","email",1,"form-control"],["for","max_buckets_mode",1,"cd-col-form-label"],c,["formControlName","max_buckets_mode","name","max_buckets_mode","id","max_buckets_mode",1,"form-control",3,"change"],["value","-1"],d,["value","0"],E,["value","1"],g,["id","suspended","type","checkbox","formControlName","suspended",1,"custom-control-input"],["for","suspended",1,"custom-control-label"],C,[4,"ngIf"],b,["id","user_quota_enabled","type","checkbox","formControlName","user_quota_enabled",1,"custom-control-input"],["for","user_quota_enabled",1,"custom-control-label"],P,G,["id","bucket_quota_enabled","type","checkbox","formControlName","bucket_quota_enabled",1,"custom-control-input"],["for","bucket_quota_enabled",1,"custom-control-label"],N,[1,"card-footer"],["wrappingClass","text-right",3,"form","submitText","submitActionEvent"],[1,"invalid-feedback"],p,U,W,["for","tenant",1,"cd-col-form-label"],Z,["id","tenant","type","text","formControlName","tenant","autofocus","",1,"form-control",3,"readonly"],$,h,I,v,F,T,[1,"cd-col-form-label"],["id","max_buckets","type","number","formControlName","max_buckets","min","1",1,"form-control"],y,x,S,["id","generate_key","type","checkbox","formControlName","generate_key",1,"custom-control-input"],["for","generate_key",1,"custom-control-label"],_e,["for","access_key",1,"cd-col-form-label","required"],te,[1,"input-group"],["id","access_key","type","password","formControlName","access_key",1,"form-control"],[1,"input-group-append"],["type","button","cdPasswordButton","access_key",1,"btn","btn-light"],["source","access_key"],ne,["for","secret_key",1,"cd-col-form-label","required"],oe,["id","secret_key","type","password","formControlName","secret_key",1,"form-control"],["type","button","cdPasswordButton","secret_key",1,"btn","btn-light"],["source","secret_key"],ie,se,[1,"row"],["class","no-border",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"col-12"],["type","button",1,"btn","btn-light","float-right","tc_addSubuserButton",3,"click"],[3,"ngClass"],ae,[1,"help-block"],[1,"no-border"],[1,"form-text","text-muted"],re,[1,"input-group-prepend"],[1,"input-group-text"],["type","text","readonly","",1,"cd-form-control",3,"value"],[1,"input-group-prepend","border-left-0","border-right-0"],["type","button","ngbTooltip",le,1,"btn","btn-light","tc_showSubuserButton",3,"click"],["type","button","ngbTooltip",ce,1,"btn","btn-light","tc_deleteSubuserButton",3,"click"],de,ue,["type","button",1,"btn","btn-light","float-right","tc_addS3KeyButton",3,"click"],Re,R,__,["type","button","ngbTooltip",t_,1,"btn","btn-light","tc_showS3KeyButton",3,"click"],["type","button","ngbTooltip",n_,1,"btn","btn-light","tc_deleteS3KeyButton",3,"click"],o_,["type","button","ngbTooltip",i_,1,"btn","btn-light","tc_showSwiftKeyButton",3,"click"],s_,["type","button","ngbTooltip",a_,"triggers","pointerenter:pointerleave",1,"btn","btn-light","float-right","tc_addCapButton",3,"disabled","disableTooltip","click"],r_,l_,["type","button","ngbTooltip",c_,1,"btn","btn-light","tc_editCapButton",3,"click"],["type","button","ngbTooltip",d_,1,"btn","btn-light","tc_deleteCapButton",3,"click"],["id","user_quota_max_size_unlimited","type","checkbox","formControlName","user_quota_max_size_unlimited",1,"custom-control-input"],["for","user_quota_max_size_unlimited",1,"custom-control-label"],u_,["for","user_quota_max_size",1,"cd-col-form-label","required"],R_,["id","user_quota_max_size","type","text","formControlName","user_quota_max_size","cdDimlessBinary","",1,"form-control"],g_,E_,["id","user_quota_max_objects_unlimited","type","checkbox","formControlName","user_quota_max_objects_unlimited",1,"custom-control-input"],["for","user_quota_max_objects_unlimited",1,"custom-control-label"],T_,["for","user_quota_max_objects",1,"cd-col-form-label","required"],S_,["id","user_quota_max_objects","type","number","formControlName","user_quota_max_objects","min","0",1,"form-control"],f_,C_,["id","bucket_quota_max_size_unlimited","type","checkbox","formControlName","bucket_quota_max_size_unlimited",1,"custom-control-input"],["for","bucket_quota_max_size_unlimited",1,"custom-control-label"],p_,["for","bucket_quota_max_size",1,"cd-col-form-label","required"],M_,["id","bucket_quota_max_size","type","text","formControlName","bucket_quota_max_size","cdDimlessBinary","",1,"form-control"],m_,A_,["id","bucket_quota_max_objects_unlimited","type","checkbox","formControlName","bucket_quota_max_objects_unlimited",1,"custom-control-input"],["for","bucket_quota_max_objects_unlimited",1,"custom-control-label"],b_,["for","bucket_quota_max_objects",1,"cd-col-form-label","required"],P_,["id","bucket_quota_max_objects","type","number","formControlName","bucket_quota_max_objects","min","0",1,"form-control"],G_,N_]},template:function(_,n){1&_&&e.YNc(0,fo,90,42,"div",0),2&_&&e.Q6J("cdFormLoading",n.loading)},directives:[Fe.y,a._Y,a.JL,V.V,a.sg,H.P,f.mk,q.o,a.Fj,X.b,a.JJ,a.u,f.O5,a.Wl,a.EJ,a.YN,a.Kr,ee.p,j.U,a.wV,a.qQ,Ce.C,pe.s,f.sg,M._L,Pn.Q],pipes:[f.rS,K.m,Ue.i],styles:[""]}),t})();var je=r(99466),Co=r(78877),po=r(86969);const Mo=["accessKeyTpl"],mo=["secretKeyTpl"];function Ao(t,o){if(1&t&&(e.TgZ(0,"tr"),e.TgZ(1,"td",15),e.SDv(2,20),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(4),e.Oqu(_.user.email)}}function bo(t,o){if(1&t&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&t){const _=o.$implicit;e.xp6(1),e.AsE(" ",_.id," (",_.permissions,") ")}}function Po(t,o){if(1&t&&(e.TgZ(0,"tr"),e.TgZ(1,"td",15),e.SDv(2,21),e.qZA(),e.TgZ(3,"td"),e.YNc(4,bo,2,2,"div",22),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(4),e.Q6J("ngForOf",_.user.subusers)}}function Go(t,o){if(1&t&&(e.TgZ(0,"div"),e._uU(1),e.qZA()),2&t){const _=o.$implicit;e.xp6(1),e.AsE(" ",_.type," (",_.perm,") ")}}function No(t,o){if(1&t&&(e.TgZ(0,"tr"),e.TgZ(1,"td",15),e.SDv(2,23),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Go,2,2,"div",22),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(4),e.Q6J("ngForOf",_.user.caps)}}function Oo(t,o){if(1&t&&(e.TgZ(0,"tr"),e.TgZ(1,"td",15),e.SDv(2,24),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"join"),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(4),e.Oqu(e.lcZ(5,1,_.user.mfa_ids))}}function Uo(t,o){1&t&&(e.TgZ(0,"td"),e._uU(1,"-"),e.qZA())}function Wo(t,o){1&t&&(e.TgZ(0,"td"),e.SDv(1,29),e.qZA())}function Zo(t,o){if(1&t&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"dimlessBinary"),e.qZA()),2&t){const _=e.oxw(5);e.xp6(1),e.hij(" ",e.lcZ(2,1,_.user.user_quota.max_size)," ")}}function $o(t,o){1&t&&(e.TgZ(0,"td"),e._uU(1,"-"),e.qZA())}function ho(t,o){1&t&&(e.TgZ(0,"td"),e.SDv(1,30),e.qZA())}function Io(t,o){if(1&t&&(e.TgZ(0,"td"),e._uU(1),e.qZA()),2&t){const _=e.oxw(5);e.xp6(1),e.hij(" ",_.user.user_quota.max_objects," ")}}function vo(t,o){if(1&t&&(e.TgZ(0,"div"),e.TgZ(1,"legend"),e.SDv(2,25),e.qZA(),e.TgZ(3,"table",9),e.TgZ(4,"tbody"),e.TgZ(5,"tr"),e.TgZ(6,"td",10),e.SDv(7,26),e.qZA(),e.TgZ(8,"td",12),e._uU(9),e.ALo(10,"booleanText"),e.qZA(),e.qZA(),e.TgZ(11,"tr"),e.TgZ(12,"td",15),e.SDv(13,27),e.qZA(),e.YNc(14,Uo,2,0,"td",0),e.YNc(15,Wo,2,0,"td",0),e.YNc(16,Zo,3,3,"td",0),e.qZA(),e.TgZ(17,"tr"),e.TgZ(18,"td",15),e.SDv(19,28),e.qZA(),e.YNc(20,$o,2,0,"td",0),e.YNc(21,ho,2,0,"td",0),e.YNc(22,Io,2,1,"td",0),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(9),e.Oqu(e.lcZ(10,7,_.user.user_quota.enabled)),e.xp6(5),e.Q6J("ngIf",!_.user.user_quota.enabled),e.xp6(1),e.Q6J("ngIf",_.user.user_quota.enabled&&_.user.user_quota.max_size<=-1),e.xp6(1),e.Q6J("ngIf",_.user.user_quota.enabled&&_.user.user_quota.max_size>-1),e.xp6(4),e.Q6J("ngIf",!_.user.user_quota.enabled),e.xp6(1),e.Q6J("ngIf",_.user.user_quota.enabled&&_.user.user_quota.max_objects<=-1),e.xp6(1),e.Q6J("ngIf",_.user.user_quota.enabled&&_.user.user_quota.max_objects>-1)}}function Fo(t,o){1&t&&(e.TgZ(0,"td"),e._uU(1,"-"),e.qZA())}function Lo(t,o){1&t&&(e.TgZ(0,"td"),e.SDv(1,35),e.qZA())}function Do(t,o){if(1&t&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"dimlessBinary"),e.qZA()),2&t){const _=e.oxw(5);e.xp6(1),e.hij(" ",e.lcZ(2,1,_.user.bucket_quota.max_size)," ")}}function yo(t,o){1&t&&(e.TgZ(0,"td"),e._uU(1,"-"),e.qZA())}function xo(t,o){1&t&&(e.TgZ(0,"td"),e.SDv(1,36),e.qZA())}function qo(t,o){if(1&t&&(e.TgZ(0,"td"),e._uU(1),e.qZA()),2&t){const _=e.oxw(5);e.xp6(1),e.hij(" ",_.user.bucket_quota.max_objects," ")}}function wo(t,o){if(1&t&&(e.TgZ(0,"div"),e.TgZ(1,"legend"),e.SDv(2,31),e.qZA(),e.TgZ(3,"table",9),e.TgZ(4,"tbody"),e.TgZ(5,"tr"),e.TgZ(6,"td",10),e.SDv(7,32),e.qZA(),e.TgZ(8,"td",12),e._uU(9),e.ALo(10,"booleanText"),e.qZA(),e.qZA(),e.TgZ(11,"tr"),e.TgZ(12,"td",15),e.SDv(13,33),e.qZA(),e.YNc(14,Fo,2,0,"td",0),e.YNc(15,Lo,2,0,"td",0),e.YNc(16,Do,3,3,"td",0),e.qZA(),e.TgZ(17,"tr"),e.TgZ(18,"td",15),e.SDv(19,34),e.qZA(),e.YNc(20,yo,2,0,"td",0),e.YNc(21,xo,2,0,"td",0),e.YNc(22,qo,2,1,"td",0),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const _=e.oxw(4);e.xp6(9),e.Oqu(e.lcZ(10,7,_.user.bucket_quota.enabled)),e.xp6(5),e.Q6J("ngIf",!_.user.bucket_quota.enabled),e.xp6(1),e.Q6J("ngIf",_.user.bucket_quota.enabled&&_.user.bucket_quota.max_size<=-1),e.xp6(1),e.Q6J("ngIf",_.user.bucket_quota.enabled&&_.user.bucket_quota.max_size>-1),e.xp6(4),e.Q6J("ngIf",!_.user.bucket_quota.enabled),e.xp6(1),e.Q6J("ngIf",_.user.bucket_quota.enabled&&_.user.bucket_quota.max_objects<=-1),e.xp6(1),e.Q6J("ngIf",_.user.bucket_quota.enabled&&_.user.bucket_quota.max_objects>-1)}}function ko(t,o){if(1&t&&(e.TgZ(0,"div"),e.TgZ(1,"table",9),e.TgZ(2,"tbody"),e.TgZ(3,"tr"),e.TgZ(4,"td",10),e.SDv(5,11),e.qZA(),e.TgZ(6,"td",12),e._uU(7),e.qZA(),e.qZA(),e.TgZ(8,"tr"),e.TgZ(9,"td",10),e.SDv(10,13),e.qZA(),e.TgZ(11,"td",12),e._uU(12),e.qZA(),e.qZA(),e.TgZ(13,"tr"),e.TgZ(14,"td",10),e.SDv(15,14),e.qZA(),e.TgZ(16,"td",12),e._uU(17),e.qZA(),e.qZA(),e.TgZ(18,"tr"),e.TgZ(19,"td",15),e.SDv(20,16),e.qZA(),e.TgZ(21,"td"),e._uU(22),e.qZA(),e.qZA(),e.YNc(23,Ao,5,1,"tr",0),e.TgZ(24,"tr"),e.TgZ(25,"td",15),e.SDv(26,17),e.qZA(),e.TgZ(27,"td"),e._uU(28),e.ALo(29,"booleanText"),e.qZA(),e.qZA(),e.TgZ(30,"tr"),e.TgZ(31,"td",15),e.SDv(32,18),e.qZA(),e.TgZ(33,"td"),e._uU(34),e.ALo(35,"booleanText"),e.qZA(),e.qZA(),e.TgZ(36,"tr"),e.TgZ(37,"td",15),e.SDv(38,19),e.qZA(),e.TgZ(39,"td"),e._uU(40),e.ALo(41,"map"),e.qZA(),e.qZA(),e.YNc(42,Po,5,1,"tr",0),e.YNc(43,No,5,1,"tr",0),e.YNc(44,Oo,6,3,"tr",0),e.qZA(),e.qZA(),e.YNc(45,vo,23,9,"div",0),e.YNc(46,wo,23,9,"div",0),e.qZA()),2&t){const _=e.oxw(3);e.xp6(7),e.Oqu(_.user.tenant),e.xp6(5),e.Oqu(_.user.user_id),e.xp6(5),e.Oqu(_.user.uid),e.xp6(5),e.Oqu(_.user.display_name),e.xp6(1),e.Q6J("ngIf",null==_.user.email?null:_.user.email.length),e.xp6(5),e.Oqu(e.lcZ(29,13,_.user.suspended)),e.xp6(6),e.Oqu(e.lcZ(35,15,"true"===_.user.system)),e.xp6(6),e.Oqu(e.xi3(41,17,_.user.max_buckets,_.maxBucketsMap)),e.xp6(2),e.Q6J("ngIf",_.user.subusers&&_.user.subusers.length),e.xp6(1),e.Q6J("ngIf",_.user.caps&&_.user.caps.length),e.xp6(1),e.Q6J("ngIf",null==_.user.mfa_ids?null:_.user.mfa_ids.length),e.xp6(1),e.Q6J("ngIf",_.user.user_quota),e.xp6(1),e.Q6J("ngIf",_.user.bucket_quota)}}function Bo(t,o){if(1&t&&e.YNc(0,ko,47,20,"div",0),2&t){const _=e.oxw(2);e.Q6J("ngIf",_.user)}}const Ho=function(t){return[t]};function Xo(t,o){if(1&t){const _=e.EpF();e.TgZ(0,"cd-table",39),e.NdJ("updateSelection",function(i){return e.CHM(_),e.oxw(3).updateKeysSelection(i)}),e.TgZ(1,"div",40),e.TgZ(2,"div",41),e.TgZ(3,"button",42),e.NdJ("click",function(){return e.CHM(_),e.oxw(3).showKeyModal()}),e._UZ(4,"i",43),e.ynx(5),e.SDv(6,44),e.BQk(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&t){const _=e.oxw(3);e.Q6J("data",_.keys)("columns",_.keysColumns),e.xp6(3),e.Q6J("disabled",!_.keysSelection.hasSingleSelection),e.xp6(1),e.Q6J("ngClass",e.VKq(4,Ho,_.icons.show))}}function Ko(t,o){1&t&&(e.TgZ(0,"li",37),e.TgZ(1,"a",4),e.SDv(2,38),e.qZA(),e.YNc(3,Xo,7,6,"ng-template",6),e.qZA())}function zo(t,o){if(1&t&&(e.ynx(0),e.TgZ(1,"ul",1,2),e.TgZ(3,"li",3),e.TgZ(4,"a",4),e.SDv(5,5),e.qZA(),e.YNc(6,Bo,1,1,"ng-template",6),e.qZA(),e.YNc(7,Ko,4,0,"li",7),e.qZA(),e._UZ(8,"div",8),e.BQk()),2&t){const _=e.MAs(2),n=e.oxw();e.xp6(7),e.Q6J("ngIf",n.keys.length),e.xp6(1),e.Q6J("ngbNavOutlet",_)}}let Qo=(()=>{class t{constructor(_,n){this.rgwUserService=_,this.modalService=n,this.keys=[],this.keysColumns=[],this.keysSelection=new Pe.r,this.icons=D.P}ngOnInit(){this.keysColumns=[{name:"Username",prop:"username",flexGrow:1},{name:"Type",prop:"type",flexGrow:1}],this.maxBucketsMap={"-1":"Disabled",0:"Unlimited"}}ngOnChanges(){this.selection&&(this.user=this.selection,this.user.subusers=u().sortBy(this.user.subusers,"id"),this.user.caps=u().sortBy(this.user.caps,"type"),this.rgwUserService.getQuota(this.user.uid).subscribe(_=>{u().extend(this.user,_)}),this.keys=[],this.user.keys&&this.user.keys.forEach(_=>{this.keys.push({id:this.keys.length+1,type:"S3",username:_.user,ref:_})}),this.user.swift_keys&&this.user.swift_keys.forEach(_=>{this.keys.push({id:this.keys.length+1,type:"Swift",username:_.user,ref:_})}),this.keys=u().sortBy(this.keys,"user"))}updateKeysSelection(_){this.keysSelection=_}showKeyModal(){const _=this.keysSelection.first(),n=this.modalService.show("S3"===_.type?Qe:Ye);switch(_.type){case"S3":n.componentInstance.setViewing(),n.componentInstance.setValues(_.ref.user,_.ref.access_key,_.ref.secret_key);break;case"Swift":n.componentInstance.setValues(_.ref.user,_.ref.secret_key)}}}return t.\u0275fac=function(_){return new(_||t)(e.Y36(O),e.Y36(Te.Z))},t.\u0275cmp=e.Xpm({type:t,selectors:[["cd-rgw-user-details"]],viewQuery:function(_,n){if(1&_&&(e.Gf(Mo,5),e.Gf(mo,5)),2&_){let i;e.iGM(i=e.CRH())&&(n.accessKeyTpl=i.first),e.iGM(i=e.CRH())&&(n.secretKeyTpl=i.first)}},inputs:{selection:"selection"},features:[e.TTD],decls:1,vars:1,consts:function(){let o,_,n,i,s,c,d,E,g,C,b,P,G,N,p,U,W,Z,$,h,I,v,F,T,y,x;return o="Details",_="Tenant",n="User ID",i="Username",s="Full name",c="Suspended",d="System",E="Maximum buckets",g="Email address",C="Subusers",b="Capabilities",P="MFAs(Id)",G="User quota",N="Enabled",p="Maximum size",U="Maximum objects",W="Unlimited",Z="Unlimited",$="Bucket quota",h="Enabled",I="Maximum size",v="Maximum objects",F="Unlimited",T="Unlimited",y="Keys",x="Show",[[4,"ngIf"],["ngbNav","","cdStatefulTab","rgw-user-details",1,"nav-tabs"],["nav","ngbNav"],["ngbNavItem","details"],["ngbNavLink",""],o,["ngbNavContent",""],["ngbNavItem","keys",4,"ngIf"],[3,"ngbNavOutlet"],[1,"table","table-striped","table-bordered"],[1,"bold","w-25"],_,[1,"w-75"],n,i,[1,"bold"],s,c,d,E,g,C,[4,"ngFor","ngForOf"],b,P,G,N,p,U,W,Z,$,h,I,v,F,T,["ngbNavItem","keys"],y,["columnMode","flex","selectionType","multi","forceIdentifier","true",3,"data","columns","updateSelection"],[1,"table-actions"],["dropdown","",1,"btn-group"],["type","button",1,"btn","btn-accent",3,"disabled","click"],[3,"ngClass"],x]},template:function(_,n){1&_&&e.YNc(0,zo,9,2,"ng-container",0),2&_&&e.Q6J("ngIf",n.selection)},directives:[f.O5,M.Pz,Xe.m,M.nv,M.Vx,M.uN,M.tO,f.sg,z.a,q.o,f.mk],pipes:[Be.T,Co.b,po.A,qe.$],styles:[""]}),t})();const Yo=["userSizeTpl"],Jo=["userObjectTpl"];function Vo(t,o){if(1&t&&e._UZ(0,"cd-usage-bar",8),2&t){const _=e.oxw().row;e.Q6J("total",_.user_quota.max_size)("used",_.stats.size_actual)}}function jo(t,o){1&t&&e.SDv(0,9)}function ei(t,o){if(1&t&&(e.YNc(0,Vo,1,2,"cd-usage-bar",6),e.YNc(1,jo,1,0,"ng-template",null,7,e.W1O)),2&t){const _=o.row,n=e.MAs(2);e.Q6J("ngIf",_.user_quota.max_size>0&&_.user_quota.enabled)("ngIfElse",n)}}function _i(t,o){if(1&t&&e._UZ(0,"cd-usage-bar",12),2&t){const _=e.oxw().row;e.Q6J("total",_.user_quota.max_objects)("used",_.stats.num_objects)("isBinary",!1)}}function ti(t,o){1&t&&e.SDv(0,13)}function ni(t,o){if(1&t&&(e.YNc(0,_i,1,3,"cd-usage-bar",10),e.YNc(1,ti,1,0,"ng-template",null,11,e.W1O)),2&t){const _=o.row,n=e.MAs(2);e.Q6J("ngIf",_.user_quota.max_objects>0&&_.user_quota.enabled)("ngIfElse",n)}}let ii=(()=>{class t extends be.o{constructor(_,n,i,s,c,d){super(d),this.authStorageService=_,this.rgwUserService=n,this.modalService=i,this.urlBuilder=s,this.actionLabels=c,this.ngZone=d,this.columns=[],this.users=[],this.selection=new Pe.r}ngOnInit(){this.permission=this.authStorageService.getPermissions().rgw,this.columns=[{name:"Username",prop:"uid",flexGrow:1},{name:"Tenant",prop:"tenant",flexGrow:1},{name:"Full name",prop:"display_name",flexGrow:1},{name:"Email address",prop:"email",flexGrow:1},{name:"Suspended",prop:"suspended",flexGrow:1,cellClass:"text-center",cellTransformation:je.e.checkIcon},{name:"Max. buckets",prop:"max_buckets",flexGrow:1,cellTransformation:je.e.map,customTemplateConfig:{"-1":"Disabled",0:"Unlimited"}},{name:"Capacity Limit %",prop:"size_usage",cellTemplate:this.userSizeTpl,flexGrow:.8},{name:"Object Limit %",prop:"object_usage",cellTemplate:this.userObjectTpl,flexGrow:.8}];const _=()=>this.selection.first()&&`${encodeURIComponent(this.selection.first().uid)}
`;this.tableActions=[{permission:"create",icon:D.P.add,routerLink:()=>this.urlBuilder.getCreate(),name:this.actionLabels.CREATE,canBePrimary:c=>!c.hasSelection},{permission:"update",icon:D.P.edit,routerLink:()=>this.urlBuilder.getEdit(_()),name:this.actionLabels.EDIT},{permission:"delete",icon:D.P.destroy,click:()=>this.deleteAction(),disable:()=>!this.selection.hasSelection,name:this.actionLabels.DELETE,canBePrimary:c=>c.hasMultiSelection}],this.setTableRefreshTimeout()}getUserList(_){this.setTableRefreshTimeout(),this.rgwUserService.list().subscribe(n=>{this.users=n},()=>{_.error()})}updateSelection(_){this.selection=_}deleteAction(){this.modalService.show(xe.M,{itemDescription:this.selection.hasSingleSelection?"user":"users",itemNames:this.selection.selected.map(_=>_.uid),submitActionObservable:()=>new ye.y(_=>{(0,Y.D)(this.selection.selected.map(n=>this.rgwUserService.delete(n.uid))).subscribe({error:n=>{_.error(n),this.table.refreshBtn()},complete:()=>{_.complete(),this.table.refreshBtn()}})})})}}return t.\u0275fac=function(_){return new(_||t)(e.Y36(Ee.j),e.Y36(O),e.Y36(Te.Z),e.Y36(Q.F),e.Y36(A.p4),e.Y36(e.R0b))},t.\u0275cmp=e.Xpm({type:t,selectors:[["cd-rgw-user-list"]],viewQuery:function(_,n){if(1&_&&(e.Gf(z.a,7),e.Gf(Yo,7),e.Gf(Jo,7)),2&_){let i;e.iGM(i=e.CRH())&&(n.table=i.first),e.iGM(i=e.CRH())&&(n.userSizeTpl=i.first),e.iGM(i=e.CRH())&&(n.userObjectTpl=i.first)}},features:[e._Bn([{provide:Q.F,useValue:new Q.F("rgw/user")}]),e.qOj],decls:8,vars:9,consts:function(){let o,_;return o="No Limit",_="No Limit",[["columnMode","flex","selectionType","multiClick","identifier","uid",3,"autoReload","data","columns","hasDetails","status","setExpandedRow","updateSelection","fetchData"],["table",""],[1,"table-actions",3,"permission","selection","tableActions"],["cdTableDetail","",3,"selection"],["userSizeTpl",""],["userObjectTpl",""],[3,"total","used",4,"ngIf","ngIfElse"],["noSizeQuota",""],[3,"total","used"],o,[3,"total","used","isBinary",4,"ngIf","ngIfElse"],["noObjectQuota",""],[3,"total","used","isBinary"],_]},template:function(_,n){1&_&&(e.TgZ(0,"cd-table",0,1),e.NdJ("setExpandedRow",function(s){return n.setExpandedRow(s)})("updateSelection",function(s){return n.updateSelection(s)})("fetchData",function(s){return n.getUserList(s)}),e._UZ(2,"cd-table-actions",2),e._UZ(3,"cd-rgw-user-details",3),e.qZA(),e.YNc(4,ei,3,2,"ng-template",null,4,e.W1O),e.YNc(6,ni,3,2,"ng-template",null,5,e.W1O)),2&_&&(e.Q6J("autoReload",!1)("data",n.users)("columns",n.columns)("hasDetails",!0)("status",n.tableStatus),e.xp6(2),e.Q6J("permission",n.permission)("selection",n.selection)("tableActions",n.tableActions),e.xp6(1),e.Q6J("selection",n.expandedRow))},directives:[z.a,ke.K,Qo,f.O5,He.O],styles:[""]}),t})(),e_=(()=>{class t{}return t.\u0275fac=function(_){return new(_||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[[f.ez,O_.m,a.u5,a.UX,U_.B,M.Oz,w.Bz,M.HK,Ue.b]]}),t})();const si=[{path:""},{path:"daemon",component:Bt,data:{breadcrumbs:"Daemons"}},{path:"user",data:{breadcrumbs:"Users"},children:[{path:"",component:ii},{path:A.MQ.CREATE,component:Ve,data:{breadcrumbs:A.Qn.CREATE}},{path:`${A.MQ.EDIT}
/:uid
`,component:Ve,data:{breadcrumbs:A.Qn.EDIT}}]},{path:"bucket",data:{breadcrumbs:"Buckets"},children:[{path:"",component:Ut},{path:A.MQ.CREATE,component:De,data:{breadcrumbs:A.Qn.CREATE}},{path:`${A.MQ.EDIT}
/:bid
`,component:De,data:{breadcrumbs:A.Qn.EDIT}}]}];let ai=(()=>{class t{}return t.\u0275fac=function(_){return new(_||t)},t.\u0275mod=e.oAB({type:t}),t.\u0275inj=e.cJS({imports:[[e_,w.Bz.forChild(si)]]}),t})()}}]);