site-libsoc/Server/public/js/components/parties-component.js

2 lines
5.5 KiB
JavaScript

import{S as t,i as e,a as n,b as o,s as i,e as r,n as a,d as m,c as l,o as s,f as c,t as g,g as p,h as d,j as h,k as f,l as u,m as b,p as x}from"./index-4348483d.js";import{w as y}from"./index-71440b21.js";import{addMarkersParties as w,partiesByCountry as j}from"../../../../../../../../../js/parties.js";import{loadLocaleContent as v}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function k(t,e,n){const o=t.slice();return o[6]=e[n][0],o[7]=e[n][1],o}function z(t,e,n){const o=t.slice();return o[10]=e[n],o}function D(t){let e,n,i,r,a,l,s,y,w,v,z,D,E,O,R,T,A,C=t[1].heading+"",H=t[1].p1+"",L=t[1].subheading1+"",M=Object.entries(j),S=[];for(let e=0;e<M.length;e+=1)S[e]=N(k(t,M,e));return{c(){e=c("div"),n=c("div"),i=c("h1"),r=g(C),a=p(),l=c("img"),y=p(),w=c("p"),v=g(H),z=p(),D=c("h3"),E=g(L),O=p(),R=c("map-component"),A=p();for(let t=0;t<S.length;t+=1)S[t].c();d(l,"id","party-img"),h(l.src,s="/img/common/parties.svg")||d(l,"src","/img/common/parties.svg"),d(l,"alt","party"),f(R,"id","map"),f(R,"callback",T=t[5]),d(n,"id","text-container"),d(e,"id","container")},m(t,m){o(t,e,m),u(e,n),u(n,i),u(i,r),u(n,a),u(n,l),u(n,y),u(n,w),u(w,v),u(n,z),u(n,D),u(D,E),u(n,O),u(n,R),u(n,A);for(let t=0;t<S.length;t+=1)S[t].m(n,null)},p(t,e){if(2&e&&C!==(C=t[1].heading+"")&&b(r,C),2&e&&H!==(H=t[1].p1+"")&&b(v,H),2&e&&L!==(L=t[1].subheading1+"")&&b(E,L),2&e&&T!==(T=t[5])&&f(R,"callback",T),2&e){let o;for(M=Object.entries(j),o=0;o<M.length;o+=1){const i=k(t,M,o);S[o]?S[o].p(i,e):(S[o]=N(i),S[o].c(),S[o].m(n,null))}for(;o<S.length;o+=1)S[o].d(1);S.length=M.length}},d(t){t&&m(e),x(S,t)}}}function E(t){let e,n,i,r,a,l,s,h,f,x,y,w,j,v,k,z,D,E,N,O,R,T,A,C,H,L,M,S,_,q,B,F,G,I,J=t[1].name+"",K=t[10].name+"",P=t[1].location+"",Q=t[1][t[10].location[0]]+"",U=t[1].link+"",V=t[10].link+"",W=t[1].description+"",X=t[1][t[10].description]+"";return{c(){e=c("div"),n=c("div"),i=c("picture"),r=c("source"),a=p(),l=c("source"),s=p(),h=c("img"),f=p(),x=c("div"),y=c("p"),w=c("b"),j=g(J),v=g(": "),k=g(K),z=p(),D=c("p"),E=c("b"),N=g(P),O=g(": "),R=g(Q),T=p(),A=c("p"),C=c("b"),H=g(U),L=g(": "),M=c("a"),S=g(V),_=p(),q=c("p"),B=c("b"),F=g(W),G=g(": "),I=g(X),d(r,"srcset","/img/parties/"+t[10].logo+".webp"),d(l,"srcset","/img/parties/"+t[10].logo+".jpg"),d(h,"class","party-logo"),d(h,"alt","logo"),d(M,"href",t[10].link),d(M,"target",";_blank;"),d(M,"rel","noreferrer"),d(n,"class","img-general-info"),d(e,"class","location-info")},m(t,m){o(t,e,m),u(e,n),u(n,i),u(i,r),u(i,a),u(i,l),u(i,s),u(i,h),u(n,f),u(n,x),u(x,y),u(y,w),u(w,j),u(w,v),u(y,k),u(x,z),u(x,D),u(D,E),u(E,N),u(E,O),u(D,R),u(x,T),u(x,A),u(A,C),u(C,H),u(C,L),u(A,M),u(M,S),u(e,_),u(e,q),u(q,B),u(B,F),u(B,G),u(q,I)},p(t,e){2&e&&J!==(J=t[1].name+"")&&b(j,J),2&e&&P!==(P=t[1].location+"")&&b(N,P),2&e&&Q!==(Q=t[1][t[10].location[0]]+"")&&b(R,Q),2&e&&U!==(U=t[1].link+"")&&b(H,U),2&e&&W!==(W=t[1].description+"")&&b(F,W),2&e&&X!==(X=t[1][t[10].description]+"")&&b(I,X)},d(t){t&&m(e)}}}function N(t){let e,n,i,r,a,l=t[6]+"",s=t[7],h=[];for(let e=0;e<s.length;e+=1)h[e]=E(z(t,s,e));return{c(){e=c("h4"),n=g(l),i=p(),r=c("div");for(let t=0;t<h.length;t+=1)h[t].c();a=p(),d(e,"class","country-name"),d(r,"class","country-block")},m(t,m){o(t,e,m),u(e,n),o(t,i,m),o(t,r,m);for(let t=0;t<h.length;t+=1)h[t].m(r,null);u(r,a)},p(t,e){if(2&e){let n;for(s=t[7],n=0;n<s.length;n+=1){const o=z(t,s,n);h[n]?h[n].p(o,e):(h[n]=E(o),h[n].c(),h[n].m(r,a))}for(;n<h.length;n+=1)h[n].d(1);h.length=s.length}},d(t){t&&m(e),t&&m(i),t&&m(r),x(h,t)}}}function O(t){let e,n=2==t[0]&&D(t);return{c(){n&&n.c(),e=r()},m(t,i){n&&n.m(t,i),o(t,e,i)},p(t,o){2==t[0]?n?n.p(t,o):(n=D(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&m(e)}}}function R(t){let e,n=t[0],l=O(t);return{c(){l.c(),e=r(),this.c=a},m(t,n){l.m(t,n),o(t,e,n)},p(t,[o]){1&o&&i(n,n=t[0])?(l.d(1),l=O(t),l.c(),l.m(e.parentNode,e)):l.p(t,o)},i:a,o:a,d(t){t&&m(e),l.d(t)}}}function T(t,e,n){let o,i,r=y(0);l(t,r,(t=>n(0,o=t)));let a=y({});function m(t,e){let n=t([22,0],2);w(n,e)}l(t,a,(t=>n(1,i=t))),v(a,"countries",r),v(a,"parties-component",r),s((()=>{}));return[o,i,r,a,m,t=>m(t,i)]}class A extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#party-img{position:absolute;width:11.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}h4{margin-bottom:2rem}.country-name{margin-bottom:1rem}.country-block{margin-bottom:2rem}.location-info{position:relative;margin-bottom:1rem}.location-info p{margin-bottom:0}.img-general-info{display:flex;align-content:center;width:100%;gap:1.5rem;align-items:center;margin-bottom:0.75rem}.img-general-info>:nth-child(2){flex:none}.party-logo{position:relative;right:0;max-height:5.5rem;max-width:100%;border-radius:1rem}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:3rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container>div>p{margin-bottom:1rem}#container p{text-align:justify}@media only screen and (max-width: 500px){.img-general-info{display:flex;flex-direction:column;align-content:left;width:100%;gap:1rem;align-items:left;margin-bottom:0rem}.img-general-info>:nth-child(1){width:max-content}.img-general-info>:nth-child(2){width:100%}}</style>",e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},T,R,i,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("parties-component",A);export{A as default};