2 lines
7.6 KiB
JavaScript
2 lines
7.6 KiB
JavaScript
import{S as t,i as e,a as o,b as n,s as r,e as i,n as s,d as a,c,o as m,h as l,t as p,j as g,k as d,w as u,x as f,l as h,y as b,p as w}from"./index-0d9f0c09.js";import{w as x}from"./index-1c123138.js";import{loadLocaleContent as v,getData as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as k,translate as y}from"../../../../../../../../../js/libraries/mapTools.js";import{addCoopPinContent as z}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t,e,o){const n=t.slice();return n[12]=e[o][0],n[3]=e[o][1],n}function O(t,e,o){const n=t.slice();return n[15]=e[o],n}function T(t){let e,o,r,i,s,c,m,x,v,j,k,y,z,O,T,C,E,R,S,_,A=t[1].cooperatives+"",F=t[1].p1+"",G=t[1].subheading1+"",H=t[1]["map-prompt"]+"",J=Object.entries(t[0]),K=[];for(let e=0;e<J.length;e+=1)K[e]=D(N(t,J,e));return{c(){e=l("div"),o=l("div"),r=l("h1"),i=p(A),s=g(),c=l("img"),x=g(),v=l("p"),j=p(F),k=g(),y=l("h3"),z=p(G),O=g(),T=l("map-component"),E=g(),R=l("p"),S=p(H),_=g();for(let t=0;t<K.length;t+=1)K[t].c();d(c,"id","coops-img"),u(c.src,m="/img/common/coops.svg")||d(c,"src","/img/common/coops.svg"),d(c,"alt","coops"),d(v,"class","description"),f(T,"id","map"),f(T,"callback",C=t[10]),d(R,"id","add-prompt"),d(o,"id","text-container"),d(e,"id","container")},m(t,a){n(t,e,a),h(e,o),h(o,r),h(r,i),h(o,s),h(o,c),h(o,x),h(o,v),h(v,j),h(o,k),h(o,y),h(y,z),h(o,O),h(o,T),h(o,E),h(o,R),h(R,S),h(o,_);for(let t=0;t<K.length;t+=1)K[t].m(o,null)},p(t,e){if(2&e&&A!==(A=t[1].cooperatives+"")&&b(i,A),2&e&&F!==(F=t[1].p1+"")&&b(j,F),2&e&&G!==(G=t[1].subheading1+"")&&b(z,G),2&e&&C!==(C=t[10])&&f(T,"callback",C),2&e&&H!==(H=t[1]["map-prompt"]+"")&&b(S,H),771&e){let n;for(J=Object.entries(t[0]),n=0;n<J.length;n+=1){const r=N(t,J,n);K[n]?K[n].p(r,e):(K[n]=D(r),K[n].c(),K[n].m(o,null))}for(;n<K.length;n+=1)K[n].d(1);K.length=J.length}},d(t){t&&a(e),w(K,t)}}}function C(t){let e,o,r,i,s,c,m,u,f,w,x,v,j,k,y,z,N,O,T,C,D,E,R,S,_,A,F,G,H,J,K,L,M,Q,U,q,B,I,P,V,W,X,Y,Z,$,tt,et,ot,nt,rt,it,st,at,ct,mt,lt,pt,gt,dt,ut,ft,ht,bt,wt=t[1].name+"",xt=t[15].name+"",vt=t[1].location+"",jt=t[9](t[15])+"",kt=t[1].market+"",yt=t[15].market+"",zt=t[1].workers+"",Nt=t[15].workers+"",Ot=t[1].status+"",Tt=t[15].status+"",Ct=t[1].website+"",Dt=t[15].website+"",Et=t[1].contact+"",Rt=t[15].contact+"",St=t[1].description+"",_t=t[15].description+"";return{c(){e=l("div"),o=l("div"),r=l("div"),i=l("p"),s=l("b"),c=p(wt),m=p(": "),u=p(xt),f=g(),w=l("p"),x=l("b"),v=p(vt),j=p(": "),k=p(jt),y=g(),z=l("p"),N=l("b"),O=p(kt),T=p(": "),C=p(yt),D=g(),E=l("p"),R=l("b"),S=p(zt),_=p(": "),A=p(Nt),F=g(),G=l("p"),H=l("b"),J=p(Ot),K=p(": "),L=p(Tt),M=g(),Q=l("p"),U=l("b"),q=p(Ct),B=p(": "),I=l("a"),P=p(Dt),W=g(),X=l("p"),Y=l("b"),Z=p(Et),$=p(": "),tt=l("a"),et=p(Rt),nt=g(),rt=l("picture"),it=l("source"),at=g(),ct=l("source"),lt=g(),pt=l("img"),gt=g(),dt=l("p"),ut=l("b"),ft=p(St),ht=p(": "),bt=p(_t),d(I,"href",V=t[15].website),d(I,"target","_blank"),d(I,"rel","noreferrer"),d(tt,"href",ot=t[15].contact),d(tt,"target",";_blank;"),d(tt,"rel","noreferrer"),d(it,"srcset",st="/img/coops/"+t[15].logo+".webp"),d(ct,"srcset",mt="/img/coops/"+t[15].logo+".png"),d(pt,"class","coop-logo"),d(pt,"alt","logo"),d(o,"class","img-general-info"),d(e,"class","location-info")},m(t,a){n(t,e,a),h(e,o),h(o,r),h(r,i),h(i,s),h(s,c),h(s,m),h(i,u),h(r,f),h(r,w),h(w,x),h(x,v),h(x,j),h(w,k),h(r,y),h(r,z),h(z,N),h(N,O),h(N,T),h(z,C),h(r,D),h(r,E),h(E,R),h(R,S),h(R,_),h(E,A),h(r,F),h(r,G),h(G,H),h(H,J),h(H,K),h(G,L),h(r,M),h(r,Q),h(Q,U),h(U,q),h(U,B),h(Q,I),h(I,P),h(r,W),h(r,X),h(X,Y),h(Y,Z),h(Y,$),h(X,tt),h(tt,et),h(o,nt),h(o,rt),h(rt,it),h(rt,at),h(rt,ct),h(rt,lt),h(rt,pt),h(e,gt),h(e,dt),h(dt,ut),h(ut,ft),h(ut,ht),h(dt,bt)},p(t,e){2&e&&wt!==(wt=t[1].name+"")&&b(c,wt),1&e&&xt!==(xt=t[15].name+"")&&b(u,xt),2&e&&vt!==(vt=t[1].location+"")&&b(v,vt),1&e&&jt!==(jt=t[9](t[15])+"")&&b(k,jt),2&e&&kt!==(kt=t[1].market+"")&&b(O,kt),1&e&&yt!==(yt=t[15].market+"")&&b(C,yt),2&e&&zt!==(zt=t[1].workers+"")&&b(S,zt),1&e&&Nt!==(Nt=t[15].workers+"")&&b(A,Nt),2&e&&Ot!==(Ot=t[1].status+"")&&b(J,Ot),1&e&&Tt!==(Tt=t[15].status+"")&&b(L,Tt),2&e&&Ct!==(Ct=t[1].website+"")&&b(q,Ct),1&e&&Dt!==(Dt=t[15].website+"")&&b(P,Dt),1&e&&V!==(V=t[15].website)&&d(I,"href",V),2&e&&Et!==(Et=t[1].contact+"")&&b(Z,Et),1&e&&Rt!==(Rt=t[15].contact+"")&&b(et,Rt),1&e&&ot!==(ot=t[15].contact)&&d(tt,"href",ot),1&e&&st!==(st="/img/coops/"+t[15].logo+".webp")&&d(it,"srcset",st),1&e&&mt!==(mt="/img/coops/"+t[15].logo+".png")&&d(ct,"srcset",mt),2&e&&St!==(St=t[1].description+"")&&b(ft,St),1&e&&_t!==(_t=t[15].description+"")&&b(bt,_t)},d(t){t&&a(e)}}}function D(t){let e,o,r,i,s,c=t[8](t[12])+"",m=t[3],u=[];for(let e=0;e<m.length;e+=1)u[e]=C(O(t,m,e));return{c(){e=l("h4"),o=p(c),r=g(),i=l("div");for(let t=0;t<u.length;t+=1)u[t].c();s=g(),d(e,"class","country-name"),d(i,"class","country-block")},m(t,a){n(t,e,a),h(e,o),n(t,r,a),n(t,i,a);for(let t=0;t<u.length;t+=1)u[t].m(i,null);h(i,s)},p(t,e){if(1&e&&c!==(c=t[8](t[12])+"")&&b(o,c),515&e){let o;for(m=t[3],o=0;o<m.length;o+=1){const n=O(t,m,o);u[o]?u[o].p(n,e):(u[o]=C(n),u[o].c(),u[o].m(i,s))}for(;o<u.length;o+=1)u[o].d(1);u.length=m.length}},d(t){t&&a(e),t&&a(r),t&&a(i),w(u,t)}}}function E(t){let e,o=3==t[2]&&T(t);return{c(){o&&o.c(),e=i()},m(t,r){o&&o.m(t,r),n(t,e,r)},p(t,n){3==t[2]?o?o.p(t,n):(o=T(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&a(e)}}}function R(t){let e,o=t[2],c=E(t);return{c(){c.c(),e=i(),this.c=s},m(t,o){c.m(t,o),n(t,e,o)},p(t,[n]){4&n&&r(o,o=t[2])?(c.d(1),c=E(t),c.c(),c.m(e.parentNode,e)):c.p(t,n)},i:s,o:s,d(t){t&&a(e),c.d(t)}}}function S(t,e,o){let n,r,i=x(0);c(t,i,(t=>o(2,r=t)));let s,a,l=x({});c(t,l,(t=>o(1,n=t)));let p=v(l,"cooperatives-component",i);v(l,"countries",i);function g(t,e,o){let n=t([22,0],2);k(s,a,n,e,o,z,"blue",{enableCountryGrouping:!0})}j("/assets/cooperatives.json",(t=>{o(3,s=JSON.parse(t)),o(0,a={});for(let t of s){let e=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),e in a?a[e].push(t):o(0,a[e]=[t],a)}i.update((t=>t+1))})),m((()=>{}));return[a,n,r,s,i,l,p,g,function(t){return"en"==p?t:y(n,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:y(n,t))).join(", ")},t=>g(t,n,p)]}class _ extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#coops-img{position:absolute;width:10.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.img-general-info{display:flex;align-content:center;width:100%;justify-content:space-between;gap:3rem;align-items:center}.img-general-info>:first-child{flex:none}.coop-logo{position:relative;right:0;max-height:6rem;max-width:100%}.country-name{margin-bottom:1rem}.country-block{margin-bottom:2rem}.location-info{position:relative;margin-bottom:2rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-top:1rem;margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container p{text-align:justify}@media only screen and (max-width: 600px){.img-general-info{display:flex;flex-direction:column-reverse;align-content:left;width:100%;gap:1rem;align-items:left;margin-bottom:0rem}.img-general-info>:nth-child(2){width:max-content}.img-general-info>:nth-child(1){width:100%}}</style>",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},S,R,r,{},null),t&&t.target&&n(t.target,this,t.anchor)}}customElements.define("cooperatives-component",_);export{_ as default};
|