1import{E as Ce,F as ve,N as Gt}from"./chunk-OYATQFGM.js";import"./chunk-W5PWWL3S.js";import{a as qt,b as Po}from"./chunk-HBI7IJGN.js";import{a as Lt,b as $t,c as zt,d as Bt}from"./chunk-6P2NMSJW.js";import{a as kt,b as Mo}from"./chunk-5PASBIKL.js";import"./chunk-QGJOUZ3R.js";import"./chunk-AMGQR6EA.js";import"./chunk-ECL75VY6.js";import"./chunk-PF4Z3JNB.js";import"./chunk-JW3M5Z3A.js";import{u as N,x as bt}from"./chunk-UN6XKWOX.js";import"./chunk-B2HHYB3B.js";import"./chunk-UHWS37YH.js";import"./chunk-UJFZTR3P.js";import{a as Rt,b as To}from"./chunk-TYHINWKN.js";import"./chunk-KRNCEH6Y.js";import"./chunk-WWEPBD52.js";import{a as Et,b as bo}from"./chunk-IOJGKQNR.js";import"./chunk-QGMKTOB5.js";import{da as Vt,ga as _o}from"./chunk-Q7IKE2T5.js";import{a as Nt,c as It,d as At}from"./chunk-MDM2BX4O.js";import{a as gt,b as so}from"./chunk-46OL7WOI.js";import"./chunk-U54IYYUT.js";import"./chunk-THMLHAD6.js";import{a as Ot,c as X,d as Dt,e as Oe}from"./chunk-WUQY46XX.js";import"./chunk-MABE6BTK.js";import{e as Ke,g as lo}from"./chunk-WG5UC7GQ.js";import"./chunk-DKGLJWI4.js";import{a as Ft,c as xo}from"./chunk-7F53FRKN.js";import{e as wt,f as vo}from"./chunk-5YN5ZIHV.js";import"./chunk-YYLBEQWK.js";import"./chunk-EJLOOPQH.js";import{c as we,f as Co}from"./chunk-H2IHNPAE.js";import"./chunk-F6OWKBNI.js";import{a as yt,b as fo}from"./chunk-F2UTMROW.js";import"./chunk-Z6VZ3VYU.js";import"./chunk-IDYR3LYL.js";import"./chunk-I2YVYIKD.js";import"./chunk-7XQ5O7SK.js";import"./chunk-SY2R3TBF.js";import"./chunk-TXGSQK5D.js";import"./chunk-YYQWPRWZ.js";import"./chunk-TBT3ZXV3.js";import{a as jt,b as ho}from"./chunk-JXVFHAUH.js";import{d as he}from"./chunk-VOK6JB5E.js";import"./chunk-4HGQ6I6X.js";import{a as R,b as ce}from"./chunk-U5HMTXMF.js";import"./chunk-ETYUKCND.js";import{a as ot,b as ro}from"./chunk-56T4BLNX.js";import{a as Qe,b as Xe,c as Je,g as Ye,h as Ze,i as je}from"./chunk-OKKXXE6U.js";import"./chunk-7RNOXEAC.js";import{I as mo,u as ft}from"./chunk-JZKSQYUK.js";import"./chunk-5RPK2RIA.js";import"./chunk-PAWQFYYV.js";import"./chunk-W4GMHQFP.js";import"./chunk-LMEWIH4L.js";import{e as _e,f as ge,g as fe}from"./chunk-53JIH2RP.js";import"./chunk-YJSQHK5X.js";import{e as ue,f as Pt}from"./chunk-UCDH2FPD.js";import{a as de,b as xt,e as Mt,h as Tt,i as pe}from"./chunk-7GAYV3L3.js";import"./chunk-FWDKKLTJ.js";import{d as pt,e as ut,f as _t}from"./chunk-SYSO6FKY.js";import"./chunk-SMHBTYZ5.js";import{D as dt,F as re,G as se,H as me,a as it,b as ne,d as ae,g as le,h as nt,n as at,o as lt,s as rt,t as st,u as mt,v as ct}from"./chunk-OKMJK5O3.js";import{a as St,b as go}from"./chunk-HKUBF5RU.js";import"./chunk-YE4K5QIV.js";import{e as ht,f as co}from"./chunk-PZVXREA4.js";import{a as Ct,b as po}from"./chunk-LFZS5KZ5.js";import{c as oe,g as ie,h as tt,i as K}from"./chunk-UIBJVLO3.js";import"./chunk-VD4QE6ER.js";import"./chunk-7K34GDKE.js";import{J as ao,z as Ue}from"./chunk-YXWIGH3W.js";import{W as ye,Z as no}from"./chunk-O3AO23VE.js";import{a as vt,c as uo}from"./chunk-NGDDSYSH.js";import"./chunk-73CYGA5R.js";import"./chunk-KHDQMKAP.js";import"./chunk-TS32VRUD.js";import"./chunk-7L27BDPL.js";import"./chunk-BFTIQ2FP.js";import{M as q,O as Se,P as io}from"./chunk-YXPM6B6U.js";import{e as k,f as Q}from"./chunk-IXAMAGTW.js";import"./chunk-5G6RYABW.js";import"./chunk-FUM4WPNX.js";import{b as We,c as Ve,e as oo,n as ee,w as He}from"./chunk-NOMO3ERR.js";import{b as G,c as et,d as te}from"./chunk-X5ABTCX7.js";import"./chunk-2EX2QP7W.js";import"./chunk-R3HFPUDU.js";import"./chunk-FZGIOLLW.js";import"./chunk-MBNWJ725.js";import"./chunk-5PKUNPXF.js";import"./chunk-I7DFKFDU.js";import"./chunk-ES3I7JXJ.js";import{Ka as to,qa as Ge}from"./chunk-5XA6NXWV.js";import"./chunk-MEDUJNMX.js";import"./chunk-HHBTWF3C.js";import{Ce as F,Ea as eo,Fd as Ae,Gd as Re,Hd as $,Ia as Fe,Ic as f,Kc as h,Ld as Z,Mc as ke,Md as Le,Nc as z,Oa as D,Oc as B,Pc as u,Qc as l,Rc as a,Sc as M,Vb as r,Vd as $e,Xa as b,Ya as x,Yd as ze,Zc as P,_d as Pe,da as Ee,de as V,ed as g,gd as c,hb as y,jb as Y,kc as E,le as A,me as S,ne as Be,od as Ne,pd as Ie,qc as Me,qd as I,rd as Te,sd as U,te as qe,vd as d,wa as xe,wd as j,xd as L}from"./chunk-J4S5G7ZA.js";import{a as w,b as O,e as H}from"./chunk-RJZPLZKV.js";var Wt,Ht=H(()=>{F();_t();ce();Q();bo();F();_t();Wt=(()=>{class i{constructor(){this.project=S(),this.selected=S(),this.optionClicked=A(),this.toggleSelection=A(),this.searchedText=S()}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=E({type:i,selectors:[["sm-project-option-row"]],inputs:{project:[1,"project"],selected:[1,"selected"],searchedText:[1,"searchedText"]},outputs:{optionClicked:"optionClicked",toggleSelection:"toggleSelection"},decls:4,vars:4,consts:[[1,"project-option-row",3,"click"],[3,"change","click","checked"],["smShowTooltipIfEllipsis","",1,"ellipsis",3,"smTooltip","sm
1SearchText"]],template:function(o,t){o&1&&(l(0,"div",0),g("click",function(m){return t.optionClicked.emit(m)}),l(1,"mat-checkbox",1),g("change",function(){return t.toggleSelection.emit()})("click",function(m){return m.stopPropagation()}),a(),l(2,"div",2),d(3),a()()),o&2&&(r(),u("checked",t.selected()),r(),u("smTooltip",t.project().name)("smSearchText",t.searchedText()),r(),j(t.project().name))},dependencies:[ut,pt,R,k,Et],styles:["[_nghost-%COMP%]{display:block;width:100%}[_nghost-%COMP%] .project-option-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:42px 1fr;align-items:center;gap:8px;height:42px;padding-right:16px}"],changeDetection:0})}}return i})()});function Vo(i,s){if(i&1){let e=P();l(0,"button",3),g("click",function(t){b(e);let n=c();return t.preventDefault(),x(n.toggleSelection.emit())}),M(1,"mat-icon",4),a()}}var Ut,Kt=H(()=>{F();te();K();ce();Q();F();Ut=(()=>{class i{constructor(){this.project=S(),this.hideTrash=S(!1),this.toggleSelection=A()}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=E({type:i,selectors:[["sm-project-selected-row"]],inputs:{project:[1,"project"],hideTrash:[1,"hideTrash"]},outputs:{toggleSelection:"toggleSelection"},decls:5,vars:3,consts:[[1,"selected-project-row"],["smShowTooltipIfEllipsis","",1,"ms-2","ellipsis",3,"smTooltip"],["mat-icon-button","",1,"sm"],["mat-icon-button","",1,"sm",3,"click"],["fontSet","al","fontIcon","al-ico-trash"]],template:function(o,t){if(o&1&&(l(0,"div",0)(1,"div",1),d(2),a(),l(3,"div"),f(4,Vo,2,0,"button",2),a()()),o&2){let n;r(),u("smTooltip",t.project().name),r(),j((n=t.project())==null?null:n.name),r(2),h(t.hideTrash()?-1:4)}},dependencies:[G,oe,R,k],styles:["[_nghost-%COMP%] .selected-project-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 42px;gap:8px;align-items:center;height:42px}[_nghost-%COMP%] .selected-project-row[_ngcontent-%COMP%] > mat-icon[_ngcontent-%COMP%]{margin-left:12px;font-style:normal;text-align:center}[_nghost-%COMP%] .selected-project-row[_ngcontent-%COMP%] .al-ico-trash[_ngcontent-%COMP%]{cursor:pointer;visibility:hidden;opacity:0;transition:.35s}[_nghost-%COMP%] .selected-project-row[_ngcontent-%COMP%]:hover{background-color:var(--mat-menu-item-hover-state-layer-color)}[_nghost-%COMP%] .selected-project-row[_ngcontent-%COMP%]:hover .al-ico-trash[_ngcontent-%COMP%]{visibility:visible;opacity:1}"],changeDetection:0})}}return i})()});function wo(i,s){if(i&1&&M(0,"mat-icon",4),i&2){let e=c();u("smTooltip",e.hint())}}function Oo(i,s){if(i&1){let e=P();l(0,"button",14),g("click",function(t){b(e);let n=c(),m=I(6);return t.preventDefault(),t.stopPropagation(),n.clearInput(),x(m.focus())}),M(1,"mat-icon",15),a()}}function Do(i,s){i&1&&M(0,"mat-icon",7)}function Eo(i,s){if(i&1){let e=P();l(0,"mat-option",16),g("onSelectionChange",function(t){let n=b(e).$implicit,m=c();return x(m.autocompleteEnterHandler(t,n))}),l(1,"sm-project-option-row",17),g("toggleSelection",function(){let t=b(e).$implicit,n=c();return x(n.toggleSelection(t))})("optionClicked",function(t){let n=b(e).$implicit,m=c();return x(m.optionClicked(t,n))}),a()()}if(i&2){let e=s.$implicit,o=c(),t=I(6);u("value",e),r(),u("project",e)("searchedText",t.value)("selected",o.isProjectSelected(e))}}function Fo(i,s){i&1&&(l(0,"div",10),M(1,"mat-spinner",18),a()),i&2&&(r(),u("diameter",32)("strokeWidth",4))}function ko(i,s){if(i&1){let e=P();l(0,"sm-project-selected-row",20),g("toggleSelection",function(){let t=b(e).$implicit,n=c(2);return x(n.toggleSelection(t))}),a()}if(i&2){let e=s.$implicit;u("project",e)}}function No(i,s){if(i&1&&(l(0,"div",13),z(1,ko,1,1,"sm-project-selected-row",19,Qt),a()),i&2){let e=c();r(),B(e.selectedProjects())}}var Qt,Xt,Jt=H(()=>{F();me();Oe();Pt();fe();te();K();Q();Ht();Kt();ho();lo();uo();po();F();fe();Oe();me();Qt=(i,s)=>s.id;Xt=(()=>{class i{constructor(){this.cdr=D(qe),this.autocompleteTrigger=Be(X),this.projects=S([]),this.placeHolder=S(""),this.label=S(""),this.hint=S(""),this.loading=S(!1),this.getEntities=A(),this.loadMore=A(),this.data=y(""),this.selectionIds=y([]),this.selectedProjects=y([]),this.noMoreOptions=y(!1),this.orderedOptions=V(()=>{let e=this.projects()||[],o=new Set;return[...this.selectedProjects(),...e].filter(t=>o.has(t.id)?!1:(o.add(t.id),!0))}),Y(()=>{let e=this.projects();if(e){let o=e.length;this.noMoreOptions.set(o===this.previousLength||o<Ke),this.previousLength=o;let t=this.selectionIds();t.length>0&&this.selectedProjects.update(n=>{let m=new Set(n.map(C=>C.id)),_=t.filter(C=>!m.has(C)).map(C=>e.find(p=>p.id===C)).filter(C=>!!C);return _.length>0?[...n,..._]:n})}})}writeValue(e){let o=e||[];this.selectionIds.set(o);let t=this.projects();this.selectedProjects.set(o.map(n=>t?.find(m=>m.id===n)).filter(n=>!!n)),this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}toggleSelection(e){this.previousLength=0,this.selectionIds().includes(e.id)?(this.selectedProjects.update(t=>t.filter(n=>n.id!==e.id)),this.selectionIds.update(t=>t.filter(n=>n!==e.id))):(this.selectedProjects.update(t=>[...t,e]),this.selectionIds.update(t=>[...t,e.id])),this.onChange?.(this.selectionIds()),this.onTouched?.(),this.autocompleteTrigger()?.panelOpen&&setTimeout(()=>this.autocompleteTrigger().updatePosition())}loadMoreEntities(e){this.loadMore.emit(e)}onInput(e){this.data.set(e),this.getEntities.emit(e)}clearInput(){this.data.set(""),this.getEntities.emit("")}displayFn(){return this.data()}isProjectSelected(e){return this.selectionIds().includes(e.id)}autocompleteEnterHandler(e,o){e.isUserInput&&this.toggleSelection(o)}optionClicked(e,o){e.stopPropagation(),this.toggleSelection(o)}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=E({type:i,selectors:[["sm-paginated-project-selector"]],viewQuery:function(o,t){o&1&&Ne(t.autocompleteTrigger,X,5),o&2&&Ie()},inputs:{projects:[1,"projects"],placeHolder:[1,"placeHolder"],label:[1,"label"],hint:[1,"hint"],loading:[1,"loading"]},outputs:{getEntities:"getEntities",loadMore:"loadMore"},features:[Z([{provide:it,useExisting:Fe(()=>i),multi:!0}])],decls:17,vars:14,consts:[["inputRef",""],["auto","matAutocomplete"],[1,"w-100"],["appearance","outline",1,"m-0","no-bottom","w-100"],["fontSet","al","fontIcon","al-ico-info-circle",1,"xs",3,"smTooltip"],["matInput","","type","text",3,"input","keydown.enter","focusout","matAutocomplete","placeholder","ngModel"],["mat-icon-button","","matSuffix","",1,"sm"],["fontSet","al","fontIcon","al-ico-search","matSuffix",""],["autoActiveFirstOption","",1,"light-theme",3,"opened","displayWith"],[3,"value"],[1,"py-4","pe-none"],["smClickStopPropagation","",3,"loadMore","loading"],["disabled","",2,"height","0","min-height","0","padding","0"],[1,"selected-items"],["mat-icon-button","","matSuffix","",1,"sm",3,"click"],["fontSet","al","fontIcon","al-ico-dialog-x"],[3,"onSelectionChange","value"],["smClickStopPropagation","",3,"toggleSelection","optionClicked","project","searchedText","selected"],["color","accent",1,"m-auto",3,"diameter","strokeWidth"],[3,"project"],[3,"toggleSelection","project"]],template:function(o,t){if(o&1){let n=P();l(0,"section",2)(1,"mat-form-field",3)(2,"mat-label"),d(3),f(4,wo,1,1,"mat-icon",4),a(),l(5,"input",5,0),g("input",function(){b(n);let _=I(6);return x(t.onInput(_.value))})("keydown.enter",function(_){return _.preventDefault()})("focusout",function(){return t.onTouched&&t.onTouched()}),a(),f(7,Oo,2,0,"button",6)(8,Do,1,0,"mat-icon",7),l(9,"mat-autocomplete",8,1),g("opened",function(){let _;return b(n),x((!((_=t.projects())!=null&&_.length)||t.data())&&t.getEntities.emit(t.data()))}),z(11,Eo,2,4,"mat-option",9,Qt),f(13,Fo,2,2,"div",10),l(14,"sm-dots-load-more",11),g("loadMore",function(){return t.loadMoreEntities(t.data())}),a(),M(15,"mat-option",12),a()(),f(16,No,3,0,"div",13),a()}if(o&2){let n,m,_=I(10);r(),U("no-bottom-border-radius",t.selectedProjects().length),r(2),L("",t.label()," "),r(),h(t.hint()?4:-1),r(),u("matAutocomplete",_)("placeholder",t.placeHolder())("ngModel",t.data()),r(2),h(t.data()?7:8),r(2),u("displayWith",t.displayFn.bind(t)),r(2),B(t.orderedOptions()),r(2),h(t.loading()&&!((n=t.projects())!=null&&n.length)?13:-1),r(),U("hidden",!((m=t.projects())!=null&&m.length)||t.noMoreOptions()),u("loading",t.loading()),r(2),h(t.selectedProjects().length?16:-1)}},dependencies:[ue,pe,de,Mt,ge,_e,Dt,Ot,he,X,G,oe,re,ne,le,at,se,k,Wt,Ut,jt,vt,Ct],styles:["[_nghost-%COMP%]{display:block;margin-bottom:12px}[_nghost-%COMP%] .no-bottom-border-radius .mdc-notched-outline__leading{border-bottom-left-radius:0}[_nghost-%COMP%] .no-bottom-border-radius .mdc-notched-outline__trailing{border-bottom-right-radius:0}[_nghost-%COMP%] .selected-items[_ngcontent-%COMP%]{border:1px solid var(--color-outline-variant);border-top:none;max-height:120px;overflow:auto;background-color:var(--color-surface);border-radius:0 0 4px 4px} .light-theme .mat-pseudo-checkbox{display:none!important} .light-theme .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled){background:none!important} .light-theme .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled) .mdc-list-item__primary-text{color:inherit!important} .mat-mdc-form-field-flex .mat-mdc-form-field-icon-suffix>.mat-icon{padding:0}mat-option[_ngcontent-%COMP%]{height:42px;padding:0!important}mat-option[_ngcontent-%COMP%] .mdc-list-item__content{padding:0!important}mat-option[_ngcontent-%COMP%] .mdc-list-item__primary-text{width:100%}"],changeDetection:0})}}return i})()});function Ao(i,s){i&1&&(l(0,"mat-error"),d(1,"Name is required"),a())}function Ro(i,s){i&1&&(l(0,"mat-error"),d(1,"Name should be unique"),a())}function Lo(i,s){if(i&1){let e=P();l(0,"sm-paginated-project-selector",16),g("getEntities",function(t){b(e);let n=c();return x(n.loadProjects(t,!1))}
1)("loadMore",function(t){b(e);let n=c();return x(n.loadProjects(t,!0))}),a()}if(i&2){let e=c();u("projects",e.projects())("loading",e.projectsLoading())}}function $o(i,s){if(i&1&&(l(0,"mat-option",12),d(1),a()),i&2){let e=s.$implicit;u("value",e.id),r(),j(e.name)}}function zo(i,s){i&1&&(l(0,"mat-error"),d(1,"Volume Template is required"),a())}function Bo(i,s){i&1&&d(0,"Default value: ")}function qo(i,s){if(i&1&&(l(0,"span"),f(1,Bo,1,0),d(2),a()),i&2){let e=c(2).$implicit;r(),h(e.get("description").value?1:-1),r(),j(e.get("defaultValue").value)}}function Go(i,s){i&1&&(l(0,"span"),d(1,"---"),a())}function Wo(i,s){i&1&&d(0,"Description: ")}function Ho(i,s){if(i&1&&(l(0,"span"),f(1,Wo,1,0),d(2),a()),i&2){let e=c(2).$implicit;r(),h(e.get("defaultValue").value?1:-1),r(),j(e.get("description").value)}}function Uo(i,s){if(i&1&&(l(0,"sm-multi-line-tooltip",24)(1,"div",27),f(2,qo,3,2,"span"),f(3,Go,2,0,"span"),f(4,Ho,3,2,"span"),a()()),i&2){let e=c().$implicit;u("smallIcon",!0),r(2),h(e.get("defaultValue").value?2:-1),r(),h(e.get("defaultValue").value&&e.get("description").value?3:-1),r(),h(e.get("description").value?4:-1)}}function Ko(i,s){i&1&&(l(0,"mat-error",26),d(1,"Variable value is required"),a())}function Qo(i,s){if(i&1&&(l(0,"div",20)(1,"mat-form-field",21)(2,"mat-label",22)(3,"span",23),d(4),a(),f(5,Uo,5,4,"sm-multi-line-tooltip",24),a(),M(6,"input",25),f(7,Ko,2,0,"mat-error",26),a()()),i&2){let e,o=s.$implicit,t=s.$index;u("formGroupName",t),r(3),u("smTooltip",o.get("displayName").value),r(),j(o.get("displayName").value),r(),h(o.get("description").value||o.get("defaultValue").value?5:-1),r(2),h((e=o.get("value").errors)!=null&&e.required&&o.get("value").touched?7:-1)}}function Xo(i,s){if(i&1&&(l(0,"div",13)(1,"div",17)(2,"span",18),d(3,"Template Parameters"),a(),M(4,"sm-system-variables-menu"),a(),l(5,"div",19),z(6,Qo,8,5,"div",20,ke),a()()),i&2){let e=c();r(6),B(e.variables.controls)}}var Io,De,Yt=H(()=>{F();me();je();Pt();fe();At();K();co();Bt();ro();te();He();bt();Gt();oo();eo();To();xo();go();no();ao();Jt();Q();ce();Co();F();je();fe();At();Oe();K();Bt();me();Io=(i,s)=>s.id;De=(()=>{class i{constructor(){this.fb=D(dt),this.dialogRef=D(Qe),this.store=D(ee),this.data=D(Xe,{optional:!0}),this.volumes=this.store.selectSignal(Ce),this.volumeTemplates=this.store.selectSignal(ve),this.projects=this.store.selectSignal(Ue),this.projectsLoading=y(!1),this.existingNames=V(()=>this.volumes()?.filter(e=>e.id!==this.data?.volume?.id).map(e=>e.name)||[]),this.volumeForm=this.fb.group({name:["",[ae.required,we,e=>Ft(this.existingNames())(e)]],description:[""],public:[!1],projects:[[]],volume_template:["",ae.required],variables:this.fb.array([])}),this.volumeTemplateId=Ve(this.volumeForm.get("volume_template").valueChanges.pipe(xe(this.volumeForm.get("volume_template").value))),this.formVariablesValue=Ve(this.volumeForm.get("variables").valueChanges.pipe(xe(this.volumeForm.get("variables").value))),this.hasVariablesChangedFromData=V(()=>{if(!this.data?.volume)return!1;let e=this.data.volume.variables||{};return(this.formVariablesValue()||[]).some(t=>(e[t.name]??"")!==(t.value??""))}),this.selectedTemplate=V(()=>{let e=this.volumeTemplateId();return this.volumeTemplates()?.find(o=>o.id===e)}),this.selectedTemplate$=We(this.selectedTemplate),Y(()=>{this.projects()&&this.projectsLoading.set(!1)}),this.volumeForm.get("public").valueChanges.subscribe(e=>{e&&this.volumeForm.get("projects").reset([])})}get variables(){return this.volumeForm.get("variables")}ngOnInit(){this.store.dispatch(N.getVolumes()),this.store.dispatch(N.getVolumeTemplates()),this.store.dispatch(ye({searchString:"",loadMore:!1,additionalProjects:this.data?.volume?.projects?.map(e=>e.id)})),this.selectedTemplate$.pipe(Ee()).subscribe(e=>{if(this.buildVariablesForm(e),e&&this.data?.volume&&e.id===this.data.volume.base_volume?.id){let o=this.data.volume.variables||{};this.variables.controls.forEach(t=>{let n=t.get("name").value;o[n]!==void 0&&t.get("value").setValue(o[n]||t.get("defaultValue").value||"")})}}),this.data?.volume&&this.volumeForm.patchValue({name:this.data.volume.name,description:this.data.volume.description,public:this.data.volume.public||!1,projects:this.data.volume.projects?.map(e=>typeof e=="string"?e:e.id)||[],volume_template:this.data.volume.base_volume?.id},{emitEvent:!0})}loadProjects(e,o){this.projectsLoading.set(!0),this.store.dispatch(ye({searchString:e||"",loadMore:o}))}buildVariablesForm(e){this.variables.clear(),e?.variables&&e.variables.forEac
1h(o=>{this.variables.push(this.fb.group({name:[o.name],value:[o.default_value||"",o.mandatory?[ae.required,we]:[]],description:[o.description],defaultValue:[o.default_value],displayName:[o.display_name]}))})}add(){if(this.volumeForm.valid){let e=this.volumeForm.value,o=O(w({},e),{variables:e.variables?.reduce((t,n)=>O(w({},t),{[n.name]:n.value}),{})});this.dialogRef.close(o)}}cancel(){this.dialogRef.close()}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=E({type:i,selectors:[["sm-volume-create-dialog"]],features:[Z([{provide:Tt,useValue:{subscriptSizing:"fixed",floatLabel:"always"}}])],decls:34,vars:12,consts:[["iconClass","al-ico-queues",3,"xClicked","header","displayX"],[1,"volume-form",3,"submit","formGroup"],["appearance","outline"],["matInput","","formControlName","name","placeholder","Name","data-id","nameField"],["matInput","","formControlName","description","rows","3","placeholder","Description","data-id","volumeDescField"],[1,"radio-group-container"],[1,"label"],["formControlName","public"],["data-id","allProjectsRadioButton",1,"me-3",3,"value"],["data-id","selectedProjectsRadioButton",1,"me-3",3,"value"],["formControlName","projects","label","Projects","placeHolder","Select projects",3,"projects","loading"],["formControlName","volume_template","placeholder","Select","data-id","volumeTemplateField"],["data-id","volumeTemplateMenuItem",3,"value"],[1,"template-parameters"],["mat-stroked-button","","type","button","data-id","cancelButton",3,"click"],["mat-flat-button","","color","primary","data-id","addButton",3,"click","disabled"],["formControlName","projects","label","Projects","placeHolder","Select projects",3,"getEntities","loadMore","projects","loading"],[1,"d-flex","justify-content-between","align-items-center","mb-2"],[1,"section-title"],["formArrayName","variables"],[3,"formGroupName"],["appearance","outline",1,"w-100"],[1,"template-parameters-label"],["smShowTooltipIfEllipsis","",1,"ellipsis",3,"smTooltip"],["customClass","xs",3,"smallIcon"],["matInput","","formControlName","value","data-id","templateParamsField"],[1,"w-100"],[1,"d-flex","flex-column"]],template:function(o,t){if(o&1&&(l(0,"sm-dialog-template",0),g("xClicked",function(){return t.cancel()}),l(1,"form",1),g("submit",function(){return t.add()}),l(2,"mat-form-field",2)(3,"mat-label"),d(4,"Name"),a(),M(5,"input",3),f(6,Ao,2,0,"mat-error"),f(7,Ro,2,0,"mat-error"),a(),l(8,"mat-form-field",2)(9,"mat-label"),d(10,"Description"),a(),M(11,"textarea",4),a(),l(12,"div",5)(13,"mat-label",6),d(14,"Availability"),a(),l(15,"mat-radio-group",7)(16,"mat-radio-button",8),d(17,"All Projects"),a(),l(18,"mat-radio-button",9),d(19,"Selected Projects"),a()()(),f(20,Lo,1,2,"sm-paginated-project-selector",10),l(21,"mat-form-field",2)(22,"mat-label"),d(23,"Volume Template"),a(),l(24,"mat-select",11),z(25,$o,2,2,"mat-option",12,Io),a(),f(27,zo,2,0,"mat-error"),a(),f(28,Xo,8,0,"div",13),a()(),l(29,"mat-dialog-actions")(30,"button",14),g("click",function(){return t.cancel()}),d(31,"CANCEL"),a(),l(32,"button",15),g("click",function(){return t.add()}),d(33),a()()),o&2){let n;u("header",(t.data!=null&&t.data.volume?"EDIT":"ADD")+" VOLUME")("displayX",!0),r(),u("formGroup",t.volumeForm),r(5),h(t.volumeForm.controls.name.errors!=null&&t.volumeForm.controls.name.errors.required&&t.volumeForm.controls.name.touched?6:-1),r(),h(t.volumeForm.controls.name.errors!=null&&t.volumeForm.controls.name.errors.uniqueName&&t.volumeForm.controls.name.touched?7:-1),r(9),u("value",!0),r(2),u("value",!1),r(2),h(t.volumeForm.value.public?-1:20),r(5),B(t.volumeTemplates()),r(2),h(t.volumeForm.controls.volume_template.errors!=null&&t.volumeForm.controls.volume_template.errors.required&&t.volumeForm.controls.volume_template.touched?27:-1),r(),h(((n=t.selectedTemplate())==null||n.variables==null?null:n.variables.length)>0?28:-1),r(4),u("disabled",t.volumeForm.invalid||t.volumeForm.pristine&&!t.hasVariablesChangedFromData()),r(),j(t.data!=null&&t.data.volume?"UPDATE":"ADD")}},dependencies:[Ze,Ye,ue,pe,de,xt,ge,_e,It,Nt,he,tt,ie,ht,et,zt,Lt,$t,se,lt,ne,le,nt,ct,mt,rt,st,ot,Rt,St,re,Xt,k,R],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}sm-dialog-template[_ngcontent-%COMP%]{flex:1;min-height:0}.volume-form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:4px}.user-groups[_ngcontent-%COMP%]{margin-bottom:12px}mat-dialog-actions[_ngcontent-%COMP%]{justify-content:center;gap:12px;padding:12px 0 32px}button[_ngcontent-%COMP%]{min-width:100px;border-radius:20px}.template-parameters[_ngcontent-%COMP%]{border-top:1px solid var(--border-color);padding-top:12px;margin-top:4px}.template-parameters[_ngcontent-%COMP%] .section-title[_ngcontent-%COMP%]{font-weight:500;color:var(--color-on-surface-variant)}.template-parameters[_ngcontent-%COMP%] .template-parameters-label[_ngcontent-%COMP%]{display:inline-flex;align-items:center;max-width:400px}.template-parameters[_ngcontent-%COMP%] .template-parameters-label[_ngcontent-%COMP%] .ellipsis[_ngcontent-%COMP%]{min-width:0}.template-parameters[_ngcontent-%COMP%] .template-parameters-label[_ngcontent-%COMP%] sm-multi-line-tooltip[_ngcontent-%COMP%]{flex-shrink:0}.more-info-tooltip[_ngcontent-%COMP%]{margin-right:8px}.radio-group-container[_ngcontent-%COMP%]{display:flex;flex-direction:column}.radio-group-container[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{font-size:12px;font-weight:var(--mat-form-field-outlined-label-text-weight);letter-spacing:var(--mat-form-field-outlined-label-text-tracking)}"],changeDetection:0})}}return i})()});function Yo(i,s){if(i&1&&(l(0,"div",10)(1,"div",12),d(2),a()()),i&2){let e=c().$implicit;r(2),j(e.header)}}function Zo(i,s){if(i&1){let e=P();l(0,"sm-table-filter-sort",13),$e(1,"filter"),g("sortOrderChanged",function(){b(e);let t=c().$implicit,n=c();return x(n.onSortChanged(!1,t.id))})("filterChanged",function(t){b(e);let n=c().$implicit,m=c();return x(m.tableFilterChanged(n,t))})("searchValueChanged",function(t){b(e);let n=c().$implicit,m=c();return x(m.searchValueChanged(t.value,n.id))}),a()}if(i&2){let e=c().$implicit,o=c();u("column",e)("value",o.filtersValues()[e.id])("searchValue",o.searchValues()[e.id])("options",ze(1,5,o.filtersOptions()[e.id],o.searchValues()[e.id],"label"))("sortOrder",o.tableSortFieldsObject()[e.id])}}function ei(i,s){if(i&1&&f(0,Yo,3,1,"div",10)(1,Zo,2,9,"sm-table-filter-sort",11),i&2){let e=s.$implicit;h(e.id.startsWith("custom_")?0:1)}}function ti(i,s){}function oi(i,s){i&1&&M(0,"mat-icon",18)}function ii(i,s){if(i&1&&(l(0,"div",14),f(1,oi,1,0,"mat-icon",18),l(2,"div",15),d(3),a()()),i&2){c();let e=$(0);r(),h(e.valid?-1:1),r(),u("smTooltip",e.name),r(),L(" ",e.name," ")}}function ni(i,s){if(i&1&&(l(0,"div",15),d(1),a()),i&2){c();let e=$(0);u("smTooltip",e.base_volume==null?null:e.base_volume.name),r(),L(" ",e.base_volume==null?null:e.base_volume.name," ")}}function ai(i,s){if(i&1&&M(0,"sm-dynamic-label-list",16),i&2){c();let e=$(0),o=c(),t=I(13);u("items",e.public?Le(2,Jo):o.getProjectNames(e))("itemTemplate",t)}}function li(i,s){if(i&1){let e=P();l(0,"div",17)(1,"button",19),g("click",function(t){b(e),c();let n=$(0),m=c();return t.stopPropagation(),x(m.editVolume(n))}),M(2,"mat-icon",20),a(),l(3,"button",21),g("click",function(t){b(e),c();let n=$(0),m=c();return t.stopPropagation(),x(m.deleteVolume(n))}),M(4,"mat-icon",22),a()()}}function ri(i,s){if(i&1&&(l(0,"div",15),d(1),a()),i&2){let e=c().$implicit,o=$(0),t=e.id.startsWith("custom_")?c().getVariableValue(o,e):o[e.id];u("smTooltip",t||"-"),r(),L(" ",t||"-"," ")}}function si(i,s){if(i&1&&(Ae(0),f(1,ti,0,0)(2,ii,4,3,"div",14)(3,ni,2,2,"div",15)(4,ai,1,3,"sm-dynamic-label-list",16)(5,li,5,0,"div",17)(6,ri,2,2,"div",15)),i&2){let e,o=s.$implicit,t=s.rowData,n=c();Re(n.asVolume(t)),r(),h((e=o.id)==="active"?1:e==="name"?2:e==="base_volume"?3:e==="projects"?4:e==="action"?5:6)}}function mi(i,s){if(i&1){let e=P();l(0,"div",24)(1,"span"),d(2,"No matching results. "),l(3,"a",25),g("click",function(){b(e);let t=c(2);return x(t.clearFilters())}),d(4,"Clear filters"),a()()()}if(i&2){let e=c().noDataTop;Te("top",e,"px")}}function ci(i,s){if(i&1&&(l(0,"div",24)(1,"span"),d(2,"No data to show"),a()()),i&2){let e=c().noDataTop;Te("top",e,"px")}}function di(i,s){if(i&1&&f(0,mi,5,2,"div",23)(1,ci,3,2,"div",23),i&2){let e=c();h(e.hasActiveFilters()?0:e.filteredVolumes()!==null?1:-1)}}function pi(i,s){if(i&1&&(l(0,"span",26),d(1),a()),i&2){let e=s.$implicit;U("all-projects",e==="All projects"),r(),L(" ",e," ")}}var Jo,Kn,ui=H(()=>{F();Mo();io();Q();ce();_o();to();K();te();je();Yt();He();so();Gt();bt();vo();fo();Po();mo();F();Jo=()=>["All projects"];Kn=(()=>{class i{constructor(){this.dialog=D(Je),this.store=D(ee),this.volumes=this.store.selectSignal(Ce),this.volumeTemplates=this.store.selectSignal(ve),this.filtersValues=y({}),this.searchValues=y({}),this.sortFields=y([]),this.hasActiveFilters=V(()=>Object.values(this.filtersValues()).some(e=>e?.length>0)),this.columnsSize=y({}),this.filteredVolumes=V(()=>{let e=this.volumes();if(!e)return null;let o=[...e],t=this.filtersValues(),n=this.searchValues(),m=this.sortFields();return Object.entries(t).forEach(([_,C])=>{C&&C.length>0&&(o=o.filter(p=>{if(_==="base_volume")return C.includes(p.base_volume?.name);if(_==="projects")return p.public?C.includes("All projects"):p.projects?.some(W=>C.includes(W.name));let v=this.columns().find(W=>W.id===_),T=_.startsWith("custom_")?this.getVariableValue(p,v):p[_];return C.includes(T)}))}
1),Object.entries(n).forEach(([_,C])=>{if(C){let p=C.toLowerCase();o=o.filter(v=>{let T=this.columns().find(J=>J.id===_);return(_.startsWith("custom_")?this.getVariableValue(v,T)?.toString():v[_]?.toString())?.toLowerCase().includes(p)})}}),m.length>0&&(o=[...o].sort((_,C)=>{for(let p of m){let v=_[p.field],T=C[p.field];if(p.field==="base_volume")v=_.base_volume?.name,T=C.base_volume?.name;else if(p.field.startsWith("custom_")){let J=this.columns().find(Zt=>Zt.id===p.field);v=this.getVariableValue(_,J),T=this.getVariableValue(C,J)}if(v===T)continue;return v==null?1:T==null?-1:(v<T?-1:1)*p.order}return 0})),o}),this.tableSortFieldsObject=V(()=>this.sortFields()?.reduce((e,o,t)=>(e[o.field]={index:t,field:o.field,order:o.order>0?Se.ASC:Se.DESC},e),{})??{}),this.filtersOptions=V(()=>{let e=this.volumes()||[],o=new Set;return e.forEach(t=>{t.public&&o.add("All projects"),t.projects?.forEach(n=>o.add(n.name))}),{name:[],base_volume:this.volumeTemplates()?.map(t=>({label:t.name,value:t.name}))||[],projects:Array.from(o).sort().map(t=>({label:t,value:t}))}}),this.baseColumns=V(()=>{let e=[{id:"name",header:"NAME",sortable:!0,filterable:!1,headerType:q.sortFilter,style:{width:"300px",maxWidth:"450px"}},{id:"description",header:"DESCRIPTION",sortable:!1,filterable:!1,style:{width:"300px",maxWidth:"450px"}},{id:"base_volume",header:"VOLUME TEMPLATE",sortable:!0,filterable:!0,headerType:q.sortFilter,style:{width:"200px"}},{id:"projects",header:"PROJECTS",sortable:!1,filterable:!0,headerType:q.sortFilter,style:{width:"200px"}}],o=new Map((this.volumeTemplates()||[]).map(p=>[p.id,p])),t=new Map;(this.volumeTemplates()||[]).forEach(p=>{p.variables?.forEach(v=>{let T=v.display_name||v.name;t.has(T)||t.set(T,{displayName:T,templateVariableKeyMap:{}}),t.get(T).templateVariableKeyMap[p.id]=v.name})});let n=this.volumes()||[],m=new Set;n.forEach(p=>{p.base_volume?.id&&o.get(p.base_volume.id)?.variables?.forEach(T=>{m.add(T.display_name||T.name)})});let _=Array.from(t.entries()).filter(([p])=>m.has(p)).sort(([p],[v])=>p.localeCompare(v)).map(([p,v])=>({id:`custom_${p}`,header:p.toUpperCase(),displayName:v.displayName,key:p,templateVariableKeyMap:v.templateVariableKeyMap,sortable:!1,filterable:!1,headerType:q.sortFilter,style:{width:"150px"}})),C={id:"action",header:"",sortable:!1,filterable:!1,headerType:q.title,style:{width:"120px"},frozen:!0,alignFrozen:"right"};return[...e,..._,C]}),this.columns=V(()=>this.baseColumns().map(e=>Object.hasOwn(this.columnsSize(),e.id)?O(w({},e),{style:O(w({},e.style),{width:this.columnsSize()[e.id]})}):e))}ngOnInit(){this.store.dispatch(N.getVolumes()),this.store.dispatch(N.getVolumeTemplates())}columnResized({columnId:e,widthPx:o}){this.columnsSize.update(t=>O(w({},t),{[e]:`${o}px`}))}onSortChanged(e,o){let n=this.sortFields().find(m=>m.field===o)?.order===1?-1:1;if(e){let m=this.sortFields().filter(_=>_.field!==o);this.sortFields.set([...m,{field:o,order:n}])}else this.sortFields.set([{field:o,order:n}])}clearFilters(){this.filtersValues.set({})}tableFilterChanged(e,o){this.filtersValues.update(t=>O(w({},t),{[e.id]:o.value}))}searchValueChanged(e,o){this.searchValues.update(t=>O(w({},t),{[o]:e}))}addVolume(){this.dialog.open(De,{panelClass:"dialog-md"}).afterClosed().subscribe(e=>{e&&this.store.dispatch(N.addVolume({volume:e}))})}editVolume(e){this.dialog.open(De,{panelClass:"dialog-md",data:{volume:e}}).afterClosed().subscribe(o=>{o&&this.store.dispatch(N.updateVolume({volume:O(w({},o),{id:e.id})}))})}deleteVolume(e){this.dialog.open(gt,{data:{title:"Delete Volume",body:`<div>Are you sure you want to delete <b>${ft(e.name,200)}</b> volume?</div> 2${e.used_in_projects?.length>0?"<div>This action will remove volume mounts from "+e.used_in_projects.length+" projects</div>":""}`,yes:"DELETE",no:"Cancel",iconClass:"al-ico-trash",centerText:!0},panelClass:"dialog-md"}).afterClosed().subscribe(o=>{o&&this.store.dispatch(N.deleteVolume({id:e.id}))})}getVariableValue(e,o){let t=e.base_volume?.id,n=o.templateVariableKeyMap?.[t];return n?e.variables?.[n]:void 0}asVolume(e){return e}getProjectNames(e){return e.projects?.map(o=>o.name)||[]}static{this.\u0275fac=function(o){return new(o||i)}}static{this.\u0275cmp=E({type:i,selectors:[["sm-volumes"]],decls:14,vars:6,consts:[["noDataTemplate",""],["projectLabelTemplate",""],[1,"sm-entity-page-header"],[1,"header-title"],["mat-flat-button","","data-id","addVolumeButton",3,"click"],["fontSet","al","fontIcon","al-ico-add"],[1,"table-container"],[3,"sortChanged","columnResized","tableData","columns","resizableColumns","scrollable","selectionMode","noDataTemplate"],["pTemplate","sort-filter"],["pTemplate","body"],[1,"col-header","d-flex","align-items-center"],[3,"column","value","searchValue","options","sortOrder"],[1,"ellipsis"],[3,"sortOrderChanged","filterChanged","searchValueChanged","column","value","searchValue","options","sortOrder"],[1,"d-flex","align-items-center"],["smShowTooltipIfEllipsis","",1,"ellipsis",3,"smTooltip"],[3,"items","itemTemplate"],[1,"actions"],["fontSet","al","fontIcon","al-ico-alert","smTooltip","Volume setup mismatch",1,"xs","me-2"],["mat-stroked-button","","smTooltip","Edit Volume",1,"edit-button","icon-only",3,"click"],["fontSet","al","fontIcon","al-ico-edit"],["mat-stroked-button","","smTooltip","Delete Volume",1,"icon-only",3,"click"],["fontSet","al","fontIcon","al-ico-trash"],[1,"n
2o-output",3,"top"],[1,"no-output"],[1,"link",3,"click"],[1,"sys-tag","tag-item"]],template:function(o,t){if(o&1&&(l(0,"header",2)(1,"div",3),d(2," VOLUMES "),a(),l(3,"button",4),g("click",function(){return t.addVolume()}),M(4,"mat-icon",5),d(5," ADD VOLUME "),a()(),l(6,"div",6)(7,"sm-table",7),g("sortChanged",function(m){return t.onSortChanged(m.isShift,m.field)})("columnResized",function(m){return t.columnResized(m)}),Me(8,ei,2,1,"ng-template",8)(9,si,7,2,"ng-template",9),a()(),Me(10,di,2,1,"ng-template",null,0,Pe)(12,pi,2,3,"ng-template",null,1,Pe)),o&2){let n=I(11);r(7),u("tableData",t.filteredVolumes())("columns",t.columns())("resizableColumns",!0)("scrollable",!0)("selectionMode",null)("noDataTemplate",n)}},dependencies:[kt,k,R,Vt,Ge,ie,G,wt,qt,yt],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}[_nghost-%COMP%] .sys-tag[_ngcontent-%COMP%]{--sys-tag-height: 18px;display:inline-block;position:relative;min-width:50px;max-width:180px;height:var(--sys-tag-height);font-size:11px;border-radius:4px;border:1px solid color-mix(in srgb,var(--color-primary-container),var(--color-on-surface) 20%);padding:0 8px 0 14px;margin-right:5px;background-color:var(--color-primary-container);color:var(--color-on-surface);text-transform:uppercase;overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .sys-tag[_ngcontent-%COMP%]:before{font-family:trains;content:"\\e91c";width:12px;font-size:24px;text-align:left;position:absolute;left:-12px;top:50%;transform:translateY(-50%)}[_nghost-%COMP%] .tag-item[_ngcontent-%COMP%]{margin-right:5px;flex:0 2 content;transition:flex-shrink .3s}[_nghost-%COMP%] .tag-item[_ngcontent-%COMP%]:hover{flex-shrink:0}[_nghost-%COMP%] .tag-item[_ngcontent-%COMP%]{padding-left:16px}[_nghost-%COMP%] .group-rest[_ngcontent-%COMP%]{background:transparent;border-color:transparent;min-width:0;text-overflow:unset;padding:0 6px;overflow:visible}[_nghost-%COMP%] .group-rest[_ngcontent-%COMP%]:before{content:""}[_nghost-%COMP%] tr.selected .group-rest{color:var(--color-surface)}[_nghost-%COMP%] .sys-tag[_ngcontent-%COMP%]:before{content:"\\e90a";font-size:18px;left:-9px}.header-title[_ngcontent-%COMP%]{font-size:16px;color:var(--color-on-primary-container)}.table-container[_ngcontent-%COMP%]{height:calc(100% - 56px)}.table-container[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{gap:12px}.table-container[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover .edit-button[_ngcontent-%COMP%]{visibility:visible}.table-container[_ngcontent-%COMP%] .al-ico-alert[_ngcontent-%COMP%]{color:var(--color-warning)}.table-container[_ngcontent-%COMP%] sm-multi-line-tooltip[_ngcontent-%COMP%]{flex-shrink:0}.table-container[_ngcontent-%COMP%] .all-projects[_ngcontent-%COMP%]{background-color:var(--color-secondary-container);color:var(--color-on-secondary-container);text-transform:uppercase}.icon-only[_ngcontent-%COMP%]{min-width:40px;padding:0}.no-output[_ngcontent-%COMP%]{color:var(--color-empty-state);font-size:14px;display:flex;position:absolute;width:100%}.no-output[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:sticky;left:50%;transform:translate(-50%);white-space:nowrap}.no-output[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]{color:var(--color-primary);cursor:pointer;text-decoration:none;margin-left:4px}.no-output[_ngcontent-%COMP%] .link[_ngcontent-%COMP%]:hover{text-decoration:underline}.no-output.centered[_ngcontent-%COMP%]{justify-content:center}.no-output.centered[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:static;left:unset;transform:none}.col-header[_ngcontent-%COMP%]{font-weight:500;font-size:12px}']})}}return i})()});ui();export{Kn as VolumesComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.