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

2 lines
6.7 KiB
JavaScript

import{S as t,i as e,a as o,b as n,s as i,e as r,n as a,d as s,c,o as m,f as l,t as p,g,h as d,j as h,k as f,l as u,m as b,p as w}from"./index-4348483d.js";import{w as x}from"./index-71440b21.js";import{addMarkersCoops as v,coopsByCountry as k}from"../../../../../../../../../js/coops.js";import{loadLocaleContent as j}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function y(t,e,o){const n=t.slice();return n[7]=e[o][0],n[8]=e[o][1],n}function z(t,e,o){const n=t.slice();return n[11]=e[o],n}function D(t){let e,o,i,r,a,c,m,x,v,j,z,D,E,O,R,T,_,A=t[1].heading+"",C=t[1].p1+"",H=t[1].subheading1+"",L=Object.entries(k),M=[];for(let e=0;e<L.length;e+=1)M[e]=N(y(t,L,e));return{c(){e=l("div"),o=l("div"),i=l("h1"),r=p(A),a=g(),c=l("img"),x=g(),v=l("p"),j=p(C),z=g(),D=l("h3"),E=p(H),O=g(),R=l("map-component"),_=g();for(let t=0;t<M.length;t+=1)M[t].c();d(c,"id","coops-img"),h(c.src,m="/img/common/coops.svg")||d(c,"src","/img/common/coops.svg"),d(c,"alt","coops"),f(R,"id","map"),f(R,"callback",T=t[6]),d(o,"id","text-container"),d(e,"id","container")},m(t,s){n(t,e,s),u(e,o),u(o,i),u(i,r),u(o,a),u(o,c),u(o,x),u(o,v),u(v,j),u(o,z),u(o,D),u(D,E),u(o,O),u(o,R),u(o,_);for(let t=0;t<M.length;t+=1)M[t].m(o,null)},p(t,e){if(2&e&&A!==(A=t[1].heading+"")&&b(r,A),2&e&&C!==(C=t[1].p1+"")&&b(j,C),2&e&&H!==(H=t[1].subheading1+"")&&b(E,H),2&e&&T!==(T=t[6])&&f(R,"callback",T),2&e){let n;for(L=Object.entries(k),n=0;n<L.length;n+=1){const i=y(t,L,n);M[n]?M[n].p(i,e):(M[n]=N(i),M[n].c(),M[n].m(o,null))}for(;n<M.length;n+=1)M[n].d(1);M.length=L.length}},d(t){t&&s(e),w(M,t)}}}function E(t){let e,o,i,r,a,c,m,h,f,w,x,v,k,j,y,z,D,E,N,O,R,T,_,A,C,H,L,M,S,q,B,F,G,I,J,K,P,Q,U,V,W,X,Y,Z,$,tt,et,ot,nt,it,rt,at,st,ct,mt,lt,pt,gt,dt,ht=t[1].name+"",ft=t[11].name+"",ut=t[1].location+"",bt=t[1][t[11].location[0][0]]+(""==t[11].location[0][1]?"":", "+t[1][t[11].location[0][1]]),wt=t[1].market+"",xt=t[1][t[11].market]+"",vt=t[1].workers+"",kt=t[11].workers+"",jt=t[1].status+"",yt=t[1][t[11].status]+"",zt=t[1].website+"",Dt=t[11].website+"",Et=t[1].contact+"",Nt=t[1][t[11].contact[1]]+"",Ot=t[1].description+"",Rt=t[1][t[11].description]+"";return{c(){e=l("div"),o=l("div"),i=l("div"),r=l("p"),a=l("b"),c=p(ht),m=p(": "),h=p(ft),f=g(),w=l("p"),x=l("b"),v=p(ut),k=p(": "),j=p(bt),y=g(),z=l("p"),D=l("b"),E=p(wt),N=p(": "),O=p(xt),R=g(),T=l("p"),_=l("b"),A=p(vt),C=p(": "),H=p(kt),L=g(),M=l("p"),S=l("b"),q=p(jt),B=p(": "),F=p(yt),G=g(),I=l("p"),J=l("b"),K=p(zt),P=p(": "),Q=l("a"),U=p(Dt),V=g(),W=l("p"),X=l("b"),Y=p(Et),Z=p(": "),$=l("a"),tt=p(Nt),et=g(),ot=l("picture"),nt=l("source"),it=g(),rt=l("source"),at=g(),st=l("img"),ct=g(),mt=l("p"),lt=l("b"),pt=p(Ot),gt=p(": "),dt=p(Rt),d(Q,"href","https://www."+t[11].website),d(Q,"target","_blank"),d(Q,"rel","noreferrer"),d($,"href",t[11].contact[0]),d($,"target",";_blank;"),d($,"rel","noreferrer"),d(nt,"srcset","/img/coops/"+t[11].logo+".webp"),d(rt,"srcset","/img/coops/"+t[11].logo+".png"),d(st,"class","coop-logo"),d(st,"alt","logo"),d(o,"class","img-general-info"),d(e,"class","location-info")},m(t,s){n(t,e,s),u(e,o),u(o,i),u(i,r),u(r,a),u(a,c),u(a,m),u(r,h),u(i,f),u(i,w),u(w,x),u(x,v),u(x,k),u(w,j),u(i,y),u(i,z),u(z,D),u(D,E),u(D,N),u(z,O),u(i,R),u(i,T),u(T,_),u(_,A),u(_,C),u(T,H),u(i,L),u(i,M),u(M,S),u(S,q),u(S,B),u(M,F),u(i,G),u(i,I),u(I,J),u(J,K),u(J,P),u(I,Q),u(Q,U),u(i,V),u(i,W),u(W,X),u(X,Y),u(X,Z),u(W,$),u($,tt),u(o,et),u(o,ot),u(ot,nt),u(ot,it),u(ot,rt),u(ot,at),u(ot,st),u(e,ct),u(e,mt),u(mt,lt),u(lt,pt),u(lt,gt),u(mt,dt)},p(t,e){2&e&&ht!==(ht=t[1].name+"")&&b(c,ht),2&e&&ut!==(ut=t[1].location+"")&&b(v,ut),2&e&&bt!==(bt=t[1][t[11].location[0][0]]+(""==t[11].location[0][1]?"":", "+t[1][t[11].location[0][1]]))&&b(j,bt),2&e&&wt!==(wt=t[1].market+"")&&b(E,wt),2&e&&xt!==(xt=t[1][t[11].market]+"")&&b(O,xt),2&e&&vt!==(vt=t[1].workers+"")&&b(A,vt),2&e&&jt!==(jt=t[1].status+"")&&b(q,jt),2&e&&yt!==(yt=t[1][t[11].status]+"")&&b(F,yt),2&e&&zt!==(zt=t[1].website+"")&&b(K,zt),2&e&&Et!==(Et=t[1].contact+"")&&b(Y,Et),2&e&&Nt!==(Nt=t[1][t[11].contact[1]]+"")&&b(tt,Nt),2&e&&Ot!==(Ot=t[1].description+"")&&b(pt,Ot),2&e&&Rt!==(Rt=t[1][t[11].description]+"")&&b(dt,Rt)},d(t){t&&s(e)}}}function N(t){let e,o,i,r,a,c=t[1][t[7]]+"",m=t[8],h=[];for(let e=0;e<m.length;e+=1)h[e]=E(z(t,m,e));return{c(){e=l("h4"),o=p(c),i=g(),r=l("div");for(let t=0;t<h.length;t+=1)h[t].c();a=g(),d(e,"class","country-name"),d(r,"class","country-block")},m(t,s){n(t,e,s),u(e,o),n(t,i,s),n(t,r,s);for(let t=0;t<h.length;t+=1)h[t].m(r,null);u(r,a)},p(t,e){if(2&e&&c!==(c=t[1][t[7]]+"")&&b(o,c),2&e){let o;for(m=t[8],o=0;o<m.length;o+=1){const n=z(t,m,o);h[o]?h[o].p(n,e):(h[o]=E(n),h[o].c(),h[o].m(r,a))}for(;o<h.length;o+=1)h[o].d(1);h.length=m.length}},d(t){t&&s(e),t&&s(i),t&&s(r),w(h,t)}}}function O(t){let e,o=2==t[0]&&D(t);return{c(){o&&o.c(),e=r()},m(t,i){o&&o.m(t,i),n(t,e,i)},p(t,n){2==t[0]?o?o.p(t,n):(o=D(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&s(e)}}}function R(t){let e,o=t[0],c=O(t);return{c(){c.c(),e=r(),this.c=a},m(t,o){c.m(t,o),n(t,e,o)},p(t,[n]){1&n&&i(o,o=t[0])?(c.d(1),c=O(t),c.c(),c.m(e.parentNode,e)):c.p(t,n)},i:a,o:a,d(t){t&&s(e),c.d(t)}}}function T(t,e,o){let n,i,r=x(0);c(t,r,(t=>o(0,n=t)));let a=x({});c(t,a,(t=>o(1,i=t))),j(a,"countries",r);let s=j(a,"cooperatives-component",r);function l(t,e){let o=t([22,0],2);v(o,e)}m((()=>{}));return[n,i,r,a,s,l,t=>l(t,i)]}class _ extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#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:1rem}.location-info p{margin-bottom:0}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: 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},T,R,i,{},null),t&&t.target&&n(t.target,this,t.anchor)}}customElements.define("cooperatives-component",_);export{_ as default};