2 lines
5.8 KiB
JavaScript
2 lines
5.8 KiB
JavaScript
import{S as e,i as t,a as n,b as i,s,q as o,n as l,g as r,t as a,o as c,e as u,c as d,w as p,d as h,u as m,f,l as g,x as b,y,r as w,j as v}from"./index-5b685137.js";import{w as j}from"./index-8744cf8a.js";import{loadLocaleContent as k,locales as H}from"../../../../../../../../../js/libraries/serverTools.js";function T(e,t,n){const i=e.slice();return i[23]=t[n][0],i[24]=t[n][1],i}function x(e){let t,n,s,o,l,a,c,v,j,k,x,W,M,O,E,N,S,R,U,q,z,I,A,B,C,D,F,G,J,K,P,Q,V,X,Y,Z,$,_,ee,te,ne,ie,se,oe,le,re,ae,ce,ue,de,pe,he=e[5].orgName+"",me=e[5].joinUs+"",fe=e[5].manifesto+"",ge=e[5].initiatives+"",be=e[5].groups+"",ye=e[5].communes+"",we=e[5].cooperatives+"",ve=e[5].parties+"",je=e[5].partners+"",ke=e[5].profile+"",He=Object.entries(H),Te=[];for(let t=0;t<He.length;t+=1)Te[t]=L(T(e,He,t));return{c(){t=u("header"),n=u("input"),s=d(),o=u("label"),o.innerHTML='<span id="hamb-line"></span>',l=d(),a=u("a"),c=u("img"),j=d(),k=u("span"),x=d(),W=u("nav"),M=u("ul"),O=u("li"),E=u("a"),N=p(me),S=d(),R=u("li"),U=u("a"),q=p(fe),z=d(),I=u("li"),A=u("button"),B=p(ge),C=d(),D=u("div"),F=u("a"),G=p(be),J=d(),K=u("a"),P=p(ye),Q=d(),V=u("a"),X=p(we),Y=d(),Z=u("a"),$=p(ve),_=d(),ee=u("a"),te=p(je),ne=d(),ie=u("li"),se=u("a"),oe=p(ke),le=d(),re=u("li"),ae=u("button"),ae.innerHTML='<picture><source srcset="/img/common/globe.webp"/> \n <source srcset="/img/common/globe.png"/> \n <img id="locales-img" alt="globe"/></picture>',ce=d(),ue=u("div");for(let e=0;e<Te.length;e+=1)Te[e].c();h(n,"type","checkbox"),h(n,"id","side-menu"),h(o,"id","hamb"),h(o,"for","side-menu"),m(c.src,v="/img/common/flag.png")||h(c,"src","/img/common/flag.png"),h(c,"id","navbar-logo"),h(c,"alt","logo"),h(k,"id","navbar-logo-text"),h(a,"id","logo-container"),h(a,"href","/"+e[8]+"/"),h(E,"href","/"+e[8]+"/join-us"),h(U,"href","/"+e[8]+"/manifesto"),h(A,"class","options-button"),h(F,"href","/"+e[8]+"/groups"),h(K,"href","/"+e[8]+"/communes"),h(V,"href","/"+e[8]+"/cooperatives"),h(Z,"href","/"+e[8]+"/parties"),h(ee,"href","/"+e[8]+"/partners"),h(D,"class","options-dropdown"),h(I,"id","options-container"),h(se,"href","/"+e[8]+"/profile"),h(re,"id","locales"),h(ue,"class","options-dropdown"),h(M,"id","menu"),h(W,"id","nav"),h(t,"id","navbar")},m(r,u){i(r,t,u),f(t,n),e[12](n),f(t,s),f(t,o),f(t,l),f(t,a),f(a,c),f(a,j),f(a,k),k.innerHTML=he,e[13](k),f(t,x),f(t,W),f(W,M),f(M,O),f(O,E),f(E,N),f(M,S),f(M,R),f(R,U),f(U,q),f(M,z),f(M,I),f(I,A),f(A,B),f(I,C),f(I,D),f(D,F),f(F,G),f(D,J),f(D,K),f(K,P),f(D,Q),f(D,V),f(V,X),f(D,Y),f(D,Z),f(Z,$),f(D,_),f(D,ee),f(ee,te),e[16](D),f(M,ne),f(M,ie),f(ie,se),f(se,oe),f(M,le),f(M,re),f(re,ae),f(M,ce),f(M,ue);for(let e=0;e<Te.length;e+=1)Te[e].m(ue,null);e[20](ue),e[21](t),de||(pe=[g(n,"click",e[9]),g(A,"click",e[14]),g(A,"focusout",e[15]),g(ae,"click",e[17]),g(ae,"focusout",e[18])],de=!0)},p(e,t){if(32&t&&he!==(he=e[5].orgName+"")&&(k.innerHTML=he),32&t&&me!==(me=e[5].joinUs+"")&&b(N,me),32&t&&fe!==(fe=e[5].manifesto+"")&&b(q,fe),32&t&&ge!==(ge=e[5].initiatives+"")&&b(B,ge),32&t&&be!==(be=e[5].groups+"")&&b(G,be),32&t&&ye!==(ye=e[5].communes+"")&&b(P,ye),32&t&&we!==(we=e[5].cooperatives+"")&&b(X,we),32&t&&ve!==(ve=e[5].parties+"")&&b($,ve),32&t&&je!==(je=e[5].partners+"")&&b(te,je),32&t&&ke!==(ke=e[5].profile+"")&&b(oe,ke),2048&t){let n;for(He=Object.entries(H),n=0;n<He.length;n+=1){const i=T(e,He,n);Te[n]?Te[n].p(i,t):(Te[n]=L(i),Te[n].c(),Te[n].m(ue,null))}for(;n<Te.length;n+=1)Te[n].d(1);Te.length=He.length}},d(n){n&&r(t),e[12](null),e[13](null),e[16](null),y(Te,n),e[20](null),e[21](null),de=!1,w(pe)}}}function L(e){let t,n,s,o,l=e[24]+"";function a(){return e[19](e[23])}return{c(){t=u("button"),n=p(l)},m(e,l){i(e,t,l),f(t,n),s||(o=g(t,"click",a),s=!0)},p(t,n){e=t},d(e){e&&r(t),s=!1,o()}}}function W(e){let t,n=0!=Object.keys(e[5]).length,s=n&&x(e);return{c(){s&&s.c(),t=o(),this.c=l},m(e,n){s&&s.m(e,n),i(e,t,n)},p(e,[i]){32&i&&(n=0!=Object.keys(e[5]).length),n?s?s.p(e,i):(s=x(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null)},i:l,o:l,d(e){s&&s.d(e),e&&r(t)}}}function M(e){setTimeout((()=>{e.style.display="none"}),100)}function O(e,t,n){let i,s,o,l,r,u,d=j(0),p=j({});a(e,p,(e=>n(5,i=e)));let h=k(p,"navbar-component",d);function m(e){let t=e.style.display;n(3,r.style.display="none",r),n(2,l.style.display="none",l),e.style.display="block"==t?"none":"block"}function f(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(H);t=t.filter((e=>!n.includes(e)));let i=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=i}c((()=>{!function(){if("ru"==h){let e=()=>{null==u?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=u.style.lineHeight?(n(4,u.style.lineHeight="120%",u),n(4,u.style.top="1rem",u),n(4,u.style.width="16rem",u)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=u.style.lineHeight&&(n(4,u.style.lineHeight="400%",u),n(4,u.style.top="0rem",u),n(4,u.style.width="auto",u))};e(),addEventListener("resize",e)}}()}));return[s,o,l,r,u,i,d,p,h,function(){s.checked?n(1,o.style.background="white",o):setTimeout((()=>{n(1,o.style.position="relative",o),n(1,o.style.background="",o),n(1,o.style.boxShadow="",o)}),510)},m,f,function(e){v[e?"unshift":"push"]((()=>{s=e,n(0,s)}))},function(e){v[e?"unshift":"push"]((()=>{u=e,n(4,u)}))},()=>m(r),()=>M(r),function(e){v[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},()=>m(l),()=>M(l),e=>f(e),function(e){v[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){v[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class E extends e{constructor(e){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/navbar.css';</style>",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},O,W,s,{},null),e&&e.target&&i(e.target,this,e.anchor)}}customElements.define("navbar-logged",E);export{E as default};
|