2 lines
5.6 KiB
JavaScript
2 lines
5.6 KiB
JavaScript
import{S as t,i as o,a as n,b as e,s as r,e as a,n as i,d as c,c as s,o as m,h as l,t as p,j as u,k as g,w as d,x as f,l as h,y as b,p as j}from"./index-0d9f0c09.js";import{w as x}from"./index-1c123138.js";import{loadLocaleContent as y,getData as w}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as k,translate as v}from"../../../../../../../../../js/libraries/mapTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t,o,n){const e=t.slice();return e[13]=o[n][0],e[3]=o[n][1],e}function N(t,o,n){const e=t.slice();return e[16]=o[n],e}function O(t){let o,n,r,a,i,s,m,x,y,w,k,v,N,O,T,E,R,S,_,A,C=t[1].groups+"",G=t[1].p1+"",H=t[1].subheading1+"",J=t[1]["map-prompt"]+"",K=Object.entries(t[0]),L=[];for(let o=0;o<K.length;o+=1)L[o]=D(z(t,K,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),a=p(C),i=u(),s=l("img"),x=u(),y=l("p"),w=p(G),k=u(),v=l("h3"),N=p(H),O=u(),T=l("map-component"),R=u(),S=l("p"),_=p(J),A=u();for(let t=0;t<L.length;t+=1)L[t].c();g(s,"id","groups-img"),d(s.src,m="/img/common/groups.svg")||g(s,"src","/img/common/groups.svg"),g(s,"alt","groups"),g(y,"class","description"),f(T,"id","map"),f(T,"callback",E=t[10]),g(S,"id","add-prompt"),g(n,"id","text-container"),g(o,"id","container")},m(t,c){e(t,o,c),h(o,n),h(n,r),h(r,a),h(n,i),h(n,s),h(n,x),h(n,y),h(y,w),h(n,k),h(n,v),h(v,N),h(n,O),h(n,T),h(n,R),h(n,S),h(S,_),h(n,A);for(let t=0;t<L.length;t+=1)L[t].m(n,null)},p(t,o){if(2&o&&C!==(C=t[1].groups+"")&&b(a,C),2&o&&G!==(G=t[1].p1+"")&&b(w,G),2&o&&H!==(H=t[1].subheading1+"")&&b(N,H),2&o&&E!==(E=t[10])&&f(T,"callback",E),2&o&&J!==(J=t[1]["map-prompt"]+"")&&b(_,J),771&o){let e;for(K=Object.entries(t[0]),e=0;e<K.length;e+=1){const r=z(t,K,e);L[e]?L[e].p(r,o):(L[e]=D(r),L[e].c(),L[e].m(n,null))}for(;e<L.length;e+=1)L[e].d(1);L.length=K.length}},d(t){t&&c(o),j(L,t)}}}function T(t){let o,n,r,a,i,s,m,d,f,j,x,y,w,k,v,z,N,O,T,D,E=t[1].location+"",R=t[9](t[16])+"",S=t[1].members+"",_=t[16].members+"",A=t[1].contact+"",C=t[16].contact+"";return{c(){o=l("div"),n=l("p"),r=l("b"),a=p(E),i=p(": "),s=p(R),m=u(),d=l("p"),f=l("b"),j=p(S),x=p(": "),y=p(_),w=u(),k=l("p"),v=l("b"),z=p(A),N=p(": "),O=l("a"),T=p(C),g(O,"href",D=t[16].contact),g(O,"target",";_blank;"),g(O,"rel","noreferrer"),g(o,"class","location-info")},m(t,c){e(t,o,c),h(o,n),h(n,r),h(r,a),h(r,i),h(n,s),h(o,m),h(o,d),h(d,f),h(f,j),h(f,x),h(d,y),h(o,w),h(o,k),h(k,v),h(v,z),h(v,N),h(k,O),h(O,T)},p(t,o){2&o&&E!==(E=t[1].location+"")&&b(a,E),1&o&&R!==(R=t[9](t[16])+"")&&b(s,R),2&o&&S!==(S=t[1].members+"")&&b(j,S),1&o&&_!==(_=t[16].members+"")&&b(y,_),2&o&&A!==(A=t[1].contact+"")&&b(z,A),1&o&&C!==(C=t[16].contact+"")&&b(T,C),1&o&&D!==(D=t[16].contact)&&g(O,"href",D)},d(t){t&&c(o)}}}function D(t){let o,n,r,a,i,s=t[8](t[13])+"",m=t[3],d=[];for(let o=0;o<m.length;o+=1)d[o]=T(N(t,m,o));return{c(){o=l("h4"),n=p(s),r=u(),a=l("div");for(let t=0;t<d.length;t+=1)d[t].c();i=u(),g(o,"class","country-name"),g(a,"class","country-block")},m(t,c){e(t,o,c),h(o,n),e(t,r,c),e(t,a,c);for(let t=0;t<d.length;t+=1)d[t].m(a,null);h(a,i)},p(t,o){if(1&o&&s!==(s=t[8](t[13])+"")&&b(n,s),515&o){let n;for(m=t[3],n=0;n<m.length;n+=1){const e=N(t,m,n);d[n]?d[n].p(e,o):(d[n]=T(e),d[n].c(),d[n].m(a,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=m.length}},d(t){t&&c(o),t&&c(r),t&&c(a),j(d,t)}}}function E(t){let o,n=3==t[2]&&O(t);return{c(){n&&n.c(),o=a()},m(t,r){n&&n.m(t,r),e(t,o,r)},p(t,e){3==t[2]?n?n.p(t,e):(n=O(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[2],s=E(t);return{c(){s.c(),o=a(),this.c=i},m(t,n){s.m(t,n),e(t,o,n)},p(t,[e]){4&e&&r(n,n=t[2])?(s.d(1),s=E(t),s.c(),s.m(o.parentNode,o)):s.p(t,e)},i:i,o:i,d(t){t&&c(o),s.d(t)}}}function S(t,o,n){let e,r,a=x(0);s(t,a,(t=>n(2,r=t)));let i,c,l=x({});s(t,l,(t=>n(1,e=t)));let p=y(l,"groups-component",a);y(l,"countries",a);function u(t,o,n){let e,r="<b>"+o.Group+"</b><br>";for(let a of["location","members","contact"]){let i=o[a]+": ";if("contact"==a)r+=i+"<a href='"+t.contact+"' target='_blank' rel=noreferrer>"+t.contact+"</a>";else if("location"==a){let a,c=[t.country,t.state,t.town].filter((t=>null!=t&&null!=t));a="en"==n?c.map((t=>t)).join(", "):c.map((t=>v(o,t))).join(", "),r+=i+a+"<br>",e=[t.latitude,t.longitude]}else r+=i+t[a]+"<br>"}return{text:r,coordinates:e}}function g(t,o,n){let e=t([22,0],2);k(i,c,e,o,n,u,"green")}w("/assets/groups.json",(t=>{n(3,i=JSON.parse(t)),n(0,c={});for(let t of i){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in c?c[o].push(t):n(0,c[o]=[t],c)}a.update((t=>t+1))})),m((()=>{}));return[c,e,r,i,a,l,p,g,function(t){return"en"==p?t:v(e,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:v(e,t))).join(", ")},t=>g(t,e,p)]}class _ extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#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:0.5rem}#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 p{text-align:justify}</style>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},S,R,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("partners-component",_);export{_ as default};
|