import{a as B}from"./chunk-VNUV3WOR.js";import{a as U,b as _}from"./chunk-5YZW47FK.js";import{i as F,j as L,x as W}from"./chunk-ZSNLO3TX.js";import"./chunk-2JONWNYA.js";import"./chunk-FVG4OCAJ.js";import"./chunk-B47LJMRU.js";import"./chunk-EHV5JSNA.js";import"./chunk-5VEBEOBK.js";import{d as j}from"./chunk-S2V6IA2C.js";import"./chunk-QG2WC3H3.js";import"./chunk-6KEUYGBO.js";import"./chunk-ZBEJAM5I.js";import"./chunk-N2PQ6HLD.js";import"./chunk-RYOTKPRJ.js";import"./chunk-ORQ34GH7.js";import"./chunk-DZT3OJCU.js";import"./chunk-7SMWJ3GR.js";import"./chunk-P2NRYBYH.js";import"./chunk-XXO64O37.js";import"./chunk-M7AISLOK.js";import{a as T}from"./chunk-URVBFPQY.js";import"./chunk-OP2OM2NB.js";import"./chunk-YFKO2YMD.js";import{a as A}from"./chunk-KMX5PVQZ.js";import"./chunk-H7ZIYAN2.js";import"./chunk-D5M6Y5VI.js";import"./chunk-PFQHIQUX.js";import"./chunk-3CODJNWE.js";import"./chunk-HJB5ICMZ.js";import"./chunk-QU4JA34D.js";import"./chunk-TAYSHZWB.js";import"./chunk-GDIYNKGM.js";import"./chunk-L4FY67IO.js";import"./chunk-7WODUV7D.js";import"./chunk-CX23ZL4L.js";import"./chunk-EP2DJHVF.js";import"./chunk-ZVZZ3QVR.js";import"./chunk-EQ67X7AF.js";import"./chunk-LMRN7T6T.js";import"./chunk-KHAMQZND.js";import"./chunk-KANMOB5U.js";import"./chunk-D3YCQTGW.js";import"./chunk-OBT56KUD.js";import"./chunk-NMCXU7N6.js";import{B as b,Ba as w,Bc as P,F as E,Jc as k,K as M,P as y,bc as h,cc as I,da as u,ea as f,ha as i,mc as x,o as H,p as r,tb as p,u as d,v as m,w as l}from"./chunk-IYD54RT7.js";import"./chunk-RVFOIZLJ.js";var V=(()=>{let s=class s{constructor(g,a,v,C){this.dialog=g,this.structureService=a,this.headerService=v,this.preferencesService=C,this.preferences=this.structureService.preferences,this.isEditing=this.preferences.pipe(d(e=>e.inEditMode),u(),f(1)),this.currentElementHeaders=m([this.headerService.AllElementHeaders,this.preferences]).pipe(i(([e,n])=>r(n.columnPreferences).pipe(l(c=>H(c).pipe(E(t=>e.includes(t.name)&&t.enabled),d(t=>t.name),M((t,o)=>[...t,o],[]))))),l(e=>b(()=>e.length!==0,r(e),this.isEditing.pipe(i(n=>n?r(U):r(_))))),u(),f(1)),this.currentStructureHeaders=m([this.headerService.AllStructureHeaders,this.preferences]).pipe(i(([e,n])=>r(n.columnPreferences).pipe(l(c=>H(c).pipe(E(t=>e.includes(t.name)&&t.enabled),d(t=>t.name),M((t,o)=>[...t,o],[]))))),l(e=>b(()=>e.length!==0,r(e),r(["name","description","interfaceMinSimultaneity","interfaceMaxSimultaneity","interfaceTaskFileType","interfaceStructureCategory"]))),i(e=>r([...e])),u(),f(1)),this.settingsDialog=m([this.structureService.BranchId,this.isEditing,this.preferencesService.globalPrefs,this.currentElementHeaders,this.currentStructureHeaders,this.headerService.AllElementHeaders,this.headerService.AllStructureHeaders]).pipe(y(1),i(([e,n,c,t,o,O,R])=>this.dialog.open(B,{data:{branchId:e,allowedHeaders1:o,allHeaders1:R,allHeaders2:O,allowedHeaders2:t,editable:n,headers1Label:"Structure Headers",headers2Label:"Element Headers",headersTableActive:!0,wordWrap:c.wordWrap}}).afterClosed().pipe(y(1),i(D=>this.structureService.updatePreferences(D).pipe(i(q=>this.preferencesService.createOrUpdateGlobalUserPrefs(D)))))))}openSettingsDialog(){this.settingsDialog.subscribe()}};s.\u0275fac=function(a){return new(a||s)(p(j),p(W),p(L),p(F))},s.\u0275cmp=w({type:s,selectors:[["osee-messaging-usermenu"]],standalone:!0,features:[k],decls:5,vars:0,consts:[["mat-menu-item","","data-cy","mim-settings",3,"click"]],template:function(a,v){a&1&&(h(0,"button",0),x("click",function(){return v.openSettingsDialog()}),h(1,"mat-icon"),P(2,"settings"),I(),h(3,"span"),P(4,"Settings"),I()())},dependencies:[T,A],encapsulation:2});let S=s;return S})(),G=V;export{G as default};
