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

2 lines
4.7 KiB
JavaScript

import{S as t,i as o,a as n,b as e,s as r,e as i,n as a,d as c,c as s,o as m,f as l,t as g,g as p,h as u,j as h,k as d,l as f,m as b,p as x}from"./index-4348483d.js";import{w as j}from"./index-71440b21.js";import{addMarkersGroups as v,groupsByCountry as w}from"../../../../../../../../../js/groups.js";import{loadLocaleContent as y}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function k(t,o,n){const e=t.slice();return e[6]=o[n][0],e[7]=o[n][1],e}function z(t,o,n){const e=t.slice();return e[10]=o[n],e}function D(t){let o,n,r,i,a,s,m,j,v,y,z,D,E,O,R,T,A,C=t[1].heading+"",H=t[1].p1+"",L=t[1].subheading1+"",M=Object.entries(w),S=[];for(let o=0;o<M.length;o+=1)S[o]=N(k(t,M,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),i=g(C),a=p(),s=l("img"),j=p(),v=l("p"),y=g(H),z=p(),D=l("h3"),E=g(L),O=p(),R=l("map-component"),A=p();for(let t=0;t<S.length;t+=1)S[t].c();u(s,"id","groups-img"),h(s.src,m="/img/common/groups.svg")||u(s,"src","/img/common/groups.svg"),u(s,"alt","groups"),d(R,"id","map"),d(R,"callback",T=t[5]),u(n,"id","text-container"),u(o,"id","container")},m(t,c){e(t,o,c),f(o,n),f(n,r),f(r,i),f(n,a),f(n,s),f(n,j),f(n,v),f(v,y),f(n,z),f(n,D),f(D,E),f(n,O),f(n,R),f(n,A);for(let t=0;t<S.length;t+=1)S[t].m(n,null)},p(t,o){if(2&o&&C!==(C=t[1].heading+"")&&b(i,C),2&o&&H!==(H=t[1].p1+"")&&b(y,H),2&o&&L!==(L=t[1].subheading1+"")&&b(E,L),2&o&&T!==(T=t[5])&&d(R,"callback",T),2&o){let e;for(M=Object.entries(w),e=0;e<M.length;e+=1){const r=k(t,M,e);S[e]?S[e].p(r,o):(S[e]=N(r),S[e].c(),S[e].m(n,null))}for(;e<S.length;e+=1)S[e].d(1);S.length=M.length}},d(t){t&&c(o),x(S,t)}}}function E(t){let o,n,r,i,a,s,m,h,d,x,j,v,w,y,k,z,D,E,N,O=t[1].location+"",R=t[1][t[10].location[0][0]]+(""==t[10].location[0][1]?"":", "+t[1][t[10].location[0][1]]),T=t[1].members+"",A=t[10].members+"",C=t[1].contact+"",H=t[1][t[10].contact[1]]+"";return{c(){o=l("div"),n=l("p"),r=l("b"),i=g(O),a=g(": "),s=g(R),m=p(),h=l("p"),d=l("b"),x=g(T),j=g(": "),v=g(A),w=p(),y=l("p"),k=l("b"),z=g(C),D=g(": "),E=l("a"),N=g(H),u(E,"href",t[10].contact[0]),u(E,"target",";_blank;"),u(E,"rel","noreferrer"),u(o,"class","location-info")},m(t,c){e(t,o,c),f(o,n),f(n,r),f(r,i),f(r,a),f(n,s),f(o,m),f(o,h),f(h,d),f(d,x),f(d,j),f(h,v),f(o,w),f(o,y),f(y,k),f(k,z),f(k,D),f(y,E),f(E,N)},p(t,o){2&o&&O!==(O=t[1].location+"")&&b(i,O),2&o&&R!==(R=t[1][t[10].location[0][0]]+(""==t[10].location[0][1]?"":", "+t[1][t[10].location[0][1]]))&&b(s,R),2&o&&T!==(T=t[1].members+"")&&b(x,T),2&o&&C!==(C=t[1].contact+"")&&b(z,C),2&o&&H!==(H=t[1][t[10].contact[1]]+"")&&b(N,H)},d(t){t&&c(o)}}}function N(t){let o,n,r,i,a,s=t[1][t[6]]+"",m=t[7],h=[];for(let o=0;o<m.length;o+=1)h[o]=E(z(t,m,o));return{c(){o=l("h4"),n=g(s),r=p(),i=l("div");for(let t=0;t<h.length;t+=1)h[t].c();a=p(),u(o,"class","country-name"),u(i,"class","country-block")},m(t,c){e(t,o,c),f(o,n),e(t,r,c),e(t,i,c);for(let t=0;t<h.length;t+=1)h[t].m(i,null);f(i,a)},p(t,o){if(2&o&&s!==(s=t[1][t[6]]+"")&&b(n,s),2&o){let n;for(m=t[7],n=0;n<m.length;n+=1){const e=z(t,m,n);h[n]?h[n].p(e,o):(h[n]=E(e),h[n].c(),h[n].m(i,a))}for(;n<h.length;n+=1)h[n].d(1);h.length=m.length}},d(t){t&&c(o),t&&c(r),t&&c(i),x(h,t)}}}function O(t){let o,n=2==t[0]&&D(t);return{c(){n&&n.c(),o=i()},m(t,r){n&&n.m(t,r),e(t,o,r)},p(t,e){2==t[0]?n?n.p(t,e):(n=D(t),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&c(o)}}}function R(t){let o,n=t[0],s=O(t);return{c(){s.c(),o=i(),this.c=a},m(t,n){s.m(t,n),e(t,o,n)},p(t,[e]){1&e&&r(n,n=t[0])?(s.d(1),s=O(t),s.c(),s.m(o.parentNode,o)):s.p(t,e)},i:a,o:a,d(t){t&&c(o),s.d(t)}}}function T(t,o,n){let e,r,i=j(0);s(t,i,(t=>n(0,e=t)));let a=j({});function c(t,o){let n=t([22,0],2);v(n,o)}s(t,a,(t=>n(1,r=t))),y(a,"groups-component",i),y(a,"countries",i),m((()=>{}));return[e,r,i,a,c,t=>c(t,r)]}class A extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#groups-img{position:absolute;width:14rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.country-name{margin-bottom:0.5rem}.country-block{margin-bottom:2rem}.location-info{margin-bottom:0.75rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:3rem}#text-container{position:relative;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}</style>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},T,R,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("groups-component",A);export{A as default};