import{S as e,i as t,a as n,b as o,s as i,h as s,j as l,n as r,k as m,l as a,m as u,d as p,r as c,c as d,q as f,o as g,e as h,f as b,z as j}from"./index-0d9f0c09.js";import{w as y}from"./index-1c123138.js";import*as v from"../../../../../../../../../js/libraries/authTools.js";import{svgFromObject as x}from"../../../../../../../../../js/libraries/miscTools.js";import"../../../../../../../../../js/components/pane-aligner.js";import"../../../../../../../../../js/components/profile-general.js";import"../../../../../../../../../js/components/profile-groups.js";import"../../../../../../../../../js/components/profile-communes.js";import"../../../../../../../../../js/components/profile-coops.js";import"../../../../../../../../../js/components/profile-parties.js";import"../../../../../../../../../js/components/profile-trade-unions.js";import"../../../../../../../../../js/components/groups-add-component.js";function w(e){let t,n,i,m,a,u,c,d,f,g,h;return{c(){t=s("profile-general"),n=l(),i=s("profile-groups"),m=l(),a=s("profile-parties"),u=l(),c=s("profile-trade-unions"),d=l(),f=s("profile-coops"),g=l(),h=s("profile-communes"),j(t,"display","none"),j(i,"display","none"),j(a,"display","none"),j(c,"display","none"),j(f,"display","none"),j(h,"display","none")},m(s,l){o(s,t,l),e[29](t),o(s,n,l),o(s,i,l),e[30](i),o(s,m,l),o(s,a,l),e[31](a),o(s,u,l),o(s,c,l),e[32](c),o(s,d,l),o(s,f,l),e[33](f),o(s,g,l),o(s,h,l),e[34](h)},p:r,d(o){o&&p(t),e[29](null),o&&p(n),o&&p(i),e[30](null),o&&p(m),o&&p(a),e[31](null),o&&p(u),o&&p(c),e[32](null),o&&p(d),o&&p(f),e[33](null),o&&p(g),o&&p(h),e[34](null)}}}function T(e){let t,n=1==e[13]&&w(e);return{c(){n&&n.c(),t=h()},m(e,i){n&&n.m(e,i),o(e,t,i)},p(e,o){1==e[13]?n?n.p(e,o):(n=w(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&p(t)}}}function k(e){let t,n,d,f,g,h,b,j,y,x,w,k,L,H,M,q,A,E,N,R=e[13],S=T(e);return{c(){t=s("pane-aligner"),n=s("div"),d=s("button"),d.innerHTML=' \n general',f=l(),g=s("button"),g.innerHTML=' \n groups',h=l(),b=s("button"),b.innerHTML=' \n communes',j=l(),y=s("button"),y.innerHTML=' \n cooperatives',x=l(),w=s("button"),w.innerHTML=' \n parties',k=l(),L=s("button"),L.innerHTML=' \n trade unions',H=l(),M=s("button"),M.innerHTML=' \n logout',q=l(),A=s("div"),S.c(),this.c=r,m(M,"id","logout-button"),m(n,"id","left-column"),m(n,"class","pane"),m(n,"slot","sidebar-left"),m(A,"id","main-column"),m(A,"slot","main")},m(i,s){o(i,t,s),a(t,n),a(n,d),e[16](d),a(n,f),a(n,g),e[18](g),a(n,h),a(n,b),e[20](b),a(n,j),a(n,y),e[22](y),a(n,x),a(n,w),e[24](w),a(n,k),a(n,L),e[26](L),a(n,H),a(n,M),e[28](n),a(t,q),a(t,A),S.m(A,null),E||(N=[u(d,"click",e[17]),u(g,"click",e[19]),u(b,"click",e[21]),u(y,"click",e[23]),u(w,"click",e[25]),u(L,"click",e[27]),u(M,"click",v.logout)],E=!0)},p(e,t){8192&t[0]&&i(R,R=e[13])?(S.d(1),S=T(e),S.c(),S.m(A,null)):S.p(e,t)},i:r,o:r,d(n){n&&p(t),e[16](null),e[18](null),e[20](null),e[22](null),e[24](null),e[26](null),e[28](null),S.d(n),E=!1,c(N)}}}function L(e){return null!=e&&null!=e}function H(e,t,n){let o,i,s,l,r,m,a,u,p,c,h,j,w,T,k,H;v.redirectNotLogged();let M={},q=y(0);d(e,q,(e=>n(13,o=e)));let A=y(0);function E(e,t){for(let e of p)e.style.display="none";for(let e of H)N(e,400,"#636363");e.style.display="initial",N(t,500,"#c52a28")}function N(e,t,n){let o=e.querySelector("object");if(null==o){setTimeout((()=>N(e,t,n)),100)}else{let i=x(o);if(0==i.length){setTimeout((()=>N(e,t,n)),100)}else{e.style.fontWeight=t;for(let e of i){let t=e.getAttribute("fill");"#fff"!=t&&null!=t&&e.setAttribute("fill",n)}}}}function R(){if(0!=Object.keys(M).length&&null!=i){for(let e of H)N(e,400,"#636363");N(H[0],500,"#c52a28")}else setTimeout(R,100)}function S(){if(p=[s,l,r,m,a],H=[c,h,j,w,T,k],1==o&&p.every((e=>L(e)))&&H.every((e=>L(e))))p=[s,l,r,m,a,u],H=[c,h,j,w,T,k],R(),n(1,s.style.display="initial",s);else{setTimeout((()=>S()),100)}}v.getUser(M,q),f("profile-component",{user:M,maps:{},reloadTrigger:function(){A.update((e=>e+1))}}),g((()=>{S()}));return[i,s,l,r,m,a,u,c,h,j,w,T,k,o,q,E,function(e){b[e?"unshift":"push"]((()=>{c=e,n(7,c)}))},()=>E(s,c),function(e){b[e?"unshift":"push"]((()=>{h=e,n(8,h)}))},()=>E(l,h),function(e){b[e?"unshift":"push"]((()=>{j=e,n(9,j)}))},()=>E(r,j),function(e){b[e?"unshift":"push"]((()=>{w=e,n(10,w)}))},()=>E(m,w),function(e){b[e?"unshift":"push"]((()=>{T=e,n(11,T)}))},()=>E(a,T),function(e){b[e?"unshift":"push"]((()=>{k=e,n(12,k)}))},()=>E(u,k),function(e){b[e?"unshift":"push"]((()=>{i=e,n(0,i)}))},function(e){b[e?"unshift":"push"]((()=>{s=e,n(1,s)}))},function(e){b[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){b[e?"unshift":"push"]((()=>{a=e,n(5,a)}))},function(e){b[e?"unshift":"push"]((()=>{u=e,n(6,u)}))},function(e){b[e?"unshift":"push"]((()=>{m=e,n(4,m)}))},function(e){b[e?"unshift":"push"]((()=>{r=e,n(3,r)}))}]}class M extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},H,k,i,{},null,[-1,-1]),e&&e.target&&o(e.target,this,e.anchor)}}customElements.define("profile-component",M);export{M as default};