ar-poncho 2.0.309 → 2.0.310

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const ponchoColorDefinitionsList=[{description:"",name:"Azul",color:"#0072BB",code:"primary",alias:["azul","primary"]},{description:"Acción principal o exitosa",name:"Verde",color:"#2E7D33",code:"success",alias:["verde","success"]},{description:"Atención o peligro",name:"Rojo",color:"#C62828",code:"danger",alias:["rojo","danger"]},{description:"Foco o alerta",name:"Amarillo",color:"#F9A822",code:"warning",alias:["amarillo","warning"]},{description:"",name:"Celeste",color:"#2897D4",code:"info",alias:["celeste","info"]},{description:"Elementos básicos",name:"Negro",color:"#333333",code:"black",alias:["negro","black"]},{description:"Enlace visitado",name:"Uva",color:"#6A1B99",code:"uva",alias:["uva"]},{description:"Texto secundario (subtitulos)",name:"Gris",color:"#525252",code:"muted",alias:["gris","muted"]},{description:"Gris área",name:"Gris intermedio",color:"#F2F2F2",code:"gray",alias:["grisintermedio","gris-area","gray"]},{description:"Fondo footer/header",name:"Celeste Argentina",color:"#37BBED",code:"celeste-argentina",alias:["celesteargentina","celeste-argentina"]},{description:"",name:"Fucsia",color:"#EC407A",code:"fucsia",alias:["fucsia"]},{description:"",name:"Arándano",color:"#C2185B",code:"arandano",alias:["arandano"]},{description:"",name:"Cielo",color:"#039BE5",code:"cielo",alias:["cielo"]},{description:"",name:"Verdin",color:"#6EA100",code:"verdin",alias:["verdin"]},{description:"",name:"Lima",color:"#CDDC39",code:"lima",alias:["lima"]},{description:"",name:"Maiz",color:"#FFCE00",code:"maiz",alias:["maiz","maíz"]},{description:"",name:"Tomate",color:"#EF5350",code:"tomate",alias:["tomate"]},{description:"",name:"Naranja oscuro",color:"#EF6C00",code:"naranja",alias:["naranjaoscuro","naranja"]},{description:"",name:"Verde azulado",color:"#008388",code:"verde-azulado",alias:["verdeazulado","verde-azulado"]},{description:"",name:"Escarapela",color:"#2CB9EE",code:"escarapela",alias:["escarapela"]},{description:"",name:"Lavanda",color:"#9284BE",code:"lavanda",alias:["lavanda"]},{description:"",name:"Mandarina",color:"#F79525",code:"mandarina",alias:["mandarina"]},{description:"",name:"Palta",color:"#50B7B2",code:"palta",alias:["palta"]},{description:"",name:"Cereza",color:"#ED3D8F",code:"cereza",alias:["cereza"]},{description:"",name:"Limón",color:"#D7DF23",code:"limon",alias:["limon"]},{description:"",name:"Verde Jade",color:"#006666",code:"verde-jade",alias:["verdejade","verde-jade"]},{description:"",name:"Verde Aloe",color:"#4FBB73",code:"verde-aloe",alias:["verdealoe","verde-aloe"]},{description:"",name:"Verde Cemento",color:"#B4BEBA",code:"verde-cemento",alias:["verdecemento","verde-cemento"]}],colorVariations={high:["primary","verde-jade","success","naranja","danger","arandano","uva","celeste-argentina","palta","verdin","warning","tomate","fucsia","lavanda","black"],medium:["info","verde-azulado","verdin","warning","tomate","fucsia","lavanda","palta","lima","maiz","muted"]},ponchoColorDefinitions=t=>{return ponchoColorDefinitionsList.find(e=>e.alias.some(e=>null!=typeof t&&e==t))||!1},ponchoColor=e=>ponchoColorDefinitions(e)?.color||e,cleanUpHex=e=>{let t=e.toString().replace("#","").trim().toUpperCase();return t=3==t.length?Array.from(t).map(e=>e.repeat(2)).join(""):t},findPonchoColorByHex=t=>ponchoColorDefinitionsList.find(e=>{return cleanUpHex(t)==cleanUpHex(e.color)});async function fetch_json(e,t="GET"){e=await fetch(e,{method:t,headers:{Accept:"application/json","Content-Type":"application/json"}});if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}const replaceSpecialChars=e=>{if(!e)return"";var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż",s="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz";const a=t+t.toUpperCase(),r=s+s.toUpperCase();t=new RegExp(a.split("").join("|"),"g");return e.toString().replace(t,e=>r.charAt(a.indexOf(e)))},slugify=e=>{if(!e)return e;const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";var s=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(s,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},secureHTML=(e,t=[])=>{var s;return!t.some(e=>"*"===e)&&(e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;"),0<t.length)?(s=new RegExp("&lt;("+t.join("|")+")(.*?)&gt;","g"),t=new RegExp("&lt;/("+t.join("|")+")(.*?)&gt;","g"),e.replace(s,"<$1$2>").replace(t,"</$1>")):e};function ponchoTable(e){return ponchoTableLegacyPatch(),ponchoTableDependant(e)}ponchoTableLegacyPatch=()=>{document.querySelectorAll("select[id=ponchoTableFiltro]").forEach(e=>{var e=e.parentElement,t=document.createElement("div");t.id="ponchoTableFiltro",t.classList.add("row"),e.parentElement.appendChild(t),e.remove()})};const ponchoTableDependant=u=>{var m,_=[],y={},s=!(!u.hasOwnProperty("orderFilter")||!u.orderFilter),g={},b=["*"];let v={tables:!0,simpleLineBreaks:!0,extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"]};document.querySelector("#ponchoTable").classList.add("state-loading"),jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy();const C=(e,t)=>{return s?(t=t,e.toString().localeCompare(t.toString(),"es",{numeric:!0})):null},x=e=>[...new Set(e)],k=(e=0,t,s,a=!1)=>{var r=document.createElement("option");return r.value=s.toString().trim(),r.dataset.column=e,r.textContent=t.toString().trim(),a&&r.setAttribute("selected","selected"),r},l=e=>e.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=e=>e<=0?0:e,p=()=>[...document.querySelectorAll("[data-filter]")].map(e=>e.value),E=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter")),w=e=>e.every(e=>{try{return showdown.extension(e),!0}catch(e){return!1}}),S=(e,t)=>{var s=document.createElement("a");return s.setAttribute("aria-label",e),s.classList.add("btn","btn-primary","btn-sm","margin-btn"),s.target="_blank",s.href=t,s.textContent=e,s.setAttribute("rel","noopener noreferrer"),s.outerHTML},j=e=>{var t=e.split("/"),t=new Date(t[2],t[1]-1,t[0]),s=document.createElement("span");return s.style.display="none",s.textContent=t.toISOString().split("T")[0],s.outerHTML+e},L=e=>replaceSpecialChars(e.toLowerCase()),n=(n,l,c)=>{l=l==_.length?l-1:l;const d=p();var e=m.entries.flatMap(e=>{t=n,s=e,a=c,r=d;var t,s,a,r,o=[...Array(h(t+1)).keys()].map(e=>s[_[h(t-1)]]==r[h(t-1)]&&s[_[h(t)]]==a||""==r[h(t-1)]).every(e=>e);if(e[_[h(l-1)]]==c&&o){const i=e[_[h(l)]];return T(l,y)?A(l).filter(e=>L(i).includes(L(e))):i}}).filter(e=>e),e=x(e);return e.sort(C),e},T=e=>{var t=Object.keys(y);return!!g.hasOwnProperty("filtro-"+t[e])},A=e=>{var t=Object.keys(y);return g.hasOwnProperty("filtro-"+t[e])?g["filtro-"+t[e]]:[]},a=(t,a)=>{var r=Object.keys(y);const o=p();for(let s=t+1;s<=r.length&&r.length!=s;s++){let e=n(t,s,a);0==e.length&&(e=((s,a,r)=>{var e=m.entries.flatMap(e=>{const t=e[_[h(a)]];return(e[_[h(s)]]==r||""==r)&&(T(a,y)?A(a).filter(e=>L(t).includes(L(e))):t)}).filter(e=>e),e=x(e);return e.sort(C),e})(t,s,a));const i=document.querySelector("#"+r[s]);i.innerHTML="",i.appendChild(k(s,"Todos","",!0)),e.forEach(e=>{var t;e.trim()&&(t=o[s]==e,i.appendChild(k(s,e,e,t)))})}},t=()=>{return window.location.hash.replace("#","")||!1},O=()=>{var e=jQuery.fn.DataTable.ext.type.search;e.string=e=>e?"string"==typeof e?replaceSpecialChars(e):e:"",e.html=e=>e?"string"==typeof e?replaceSpecialChars(e.replace(/<.*?>/g,"")):e:"";let n=jQuery("#ponchoTable").DataTable({lengthChange:!1,autoWidth:!1,pageLength:u.cantidadItems,columnDefs:[{type:"html-num",targets:u.tipoNumero},{targets:u.ocultarColumnas,visible:!1}],ordering:u.orden,order:[[u.ordenColumna-1,u.ordenTipo]],dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'i>><'row'<'col-sm-12'tr>><'row'<'col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8'p>>",language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:".",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery("#ponchoTableSearch").keyup(function(){n.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()}),jQuery("#ponchoTable_filter").parent().parent().remove(),1<document.querySelectorAll("#ponchoTableFiltro option").length&&(document.querySelector("#ponchoTableFiltroCont").style.display="block"),jQuery("select[data-filter]").change(function(){var e=jQuery(this).find("option:selected").data("column"),t=jQuery(this).find("option:selected").val();a(e,t),n.columns().search("").columns().search("").draw();const o=Object.keys(y),i=p();i.forEach((e,t)=>{s=o[t];var s=Object.keys(m.headers).indexOf("filtro-"+s),a=l(i[t]),r=l(replaceSpecialChars(i[t]));T(t,y)?n.columns(s).search(L(i[t])):n.columns(s).search(i[t]?`^(${a}|${r})$`:"",!0,!1,!0)}),n.draw()}),u.hasOwnProperty("hash")&&u.hash&&(e=(e=t())?decodeURIComponent(e):"",document.querySelector("#ponchoTableSearch").value=e,n.search(jQuery.fn.DataTable.ext.type.search.string(e)).draw())},r=e=>{(m=e).entries="function"==typeof u.refactorEntries&&null!==u.refactorEntries?u.refactorEntries(m.entries):m.entries,m.headers=(u.hasOwnProperty("headers")&&u.headers?u:m).headers,_=Object.keys(m.headers).filter(e=>e.startsWith("filtro-")),g=u.asFilter?u.asFilter(m.entries):{},y=((r,o)=>{let i={};return o.forEach((t,s)=>{let e=[];e=g.hasOwnProperty(o[s])?g[o[s]]:r.entries.map(e=>e[t]);var a=x(e);a.sort(C),t=t.replace("filtro-",""),i[t]=[],a.forEach(e=>{i[t].push({columna:s,value:e})})}),i})(m,_),u.hasOwnProperty("filterContClassList")&&u.filterContClassList&&((e=document.getElementById("ponchoTableFiltroCont")).removeAttribute("class"),e.classList.add(...u.filterContClassList)),u.hasOwnProperty("searchContClassList")&&u.searchContClassList&&((e=document.getElementById("ponchoTableSearchCont")).removeAttribute("class"),e.classList.add(...u.searchContClassList));{var i=m;(e=document.querySelector("#ponchoTable thead")).innerHTML="";const c=document.createElement("tr"),d=(Object.keys(i.headers).forEach((e,t)=>{var s=document.createElement("th");s.textContent=i.headers[e],s.setAttribute("scope","col"),c.appendChild(s)}),e.appendChild(c),(e=document.querySelector("#ponchoTable caption")).innerHTML="",e.textContent=u.tituloTabla,document.querySelector("#ponchoTable tbody"));d.innerHTML="",i.entries.forEach((r,e)=>{if(Object.values(r).some(e=>String(e).trim())){r="function"==typeof u.customEntry&&null!==u.customEntry?u.customEntry(r):r;const o=d.insertRow();o.id="id_"+e;let a;E()&&(e=u.hasOwnProperty("markdownOptions")?u.markdownOptions:v,a=w(e.extensions)?e:{}),Object.keys(i.headers).forEach(e=>{filas=r[e],e.startsWith("btn-")&&""!=filas?filas=S(e.replace("btn-","").replace("-"," "),filas):e.startsWith("fecha-")&&""!=filas&&(filas=j(filas));var t=o.insertCell(),s=(t.dataset.title=i.headers[e],""==filas&&(t.className="hidden-xs"),u.hasOwnProperty("allowedTags")?u.allowedTags:b),s=e.startsWith("btn-")&&""!=filas?[...s,"a"]:s,e=secureHTML(filas,s);E()?(s=new showdown.Converter(a),t.innerHTML=s.makeHtml(e)):t.innerHTML=e})}})}var t=m,s=document.querySelector("#ponchoTableFiltro");for(f in s.innerHTML="",y){const h=y[f][0].columna||0;var a,r=y[f].map(e=>e.value).sort(C),o=document.createElement("div"),n=(u.hasOwnProperty("filterClassList")?(a="string"==typeof u.filterClassList?u.filterClassList.split(" "):u.filterClassList,o.classList.add(...a)):(a=Math.floor(12/Object.keys(y).length),o.classList.add("col-sm-12","col-md-"+a)),document.createElement("div")),l=(n.className="form-group",document.createElement("label"));l.setAttribute("for",f),l.textContent=t.headers["filtro-"+f];const p=document.createElement("select");p.classList.add("form-control"),p.dataset.filter=1,p.name=f,p.id=f,p.appendChild(k(h,"Todos","",!0)),r.forEach(e=>{e&&p.appendChild(k(h,e,e,!1))}),n.appendChild(l),n.appendChild(p),o.appendChild(n),s.appendChild(o)}document.querySelector("#ponchoTableSearchCont").style.display="block",document.querySelector("#ponchoTable").classList.remove("state-loading"),O()},o=e=>{jQuery.getJSON(e,function(e){var t=new GapiSheetData;m=t.json_data(e),r(m)})};if(u.jsonData){var e=Object.fromEntries(Object.keys(u.jsonData[0]).map(e=>[e,e])),e={entries:u.jsonData,headers:e};r(e)}else if(u.jsonUrl)o(u.jsonUrl);else if(u.hojaNombre&&u.idSpread){e=(new GapiSheetData).url(u.hojaNombre,u.idSpread);o(e)}else{if(!u.hojaNumero||!u.idSpread)throw"¡Error! No hay datos suficientes para crear la tabla.";{var i=u.hojaNumero;const c=new GapiSheetData;e=["https://sheets.googleapis.com/v4/spreadsheets/",u.idSpread,"/?alt=json&key=",c.gapi_key].join("");jQuery.getJSON(e,function(e){e=e.sheets[i-1].properties.title,e=c.url(e,u.idSpread);o(e)})}}};var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}var ponchoUbicacion=function(e){var s,a,r,o,t="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geoprovincias.json",i="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geolocalidades.json",n=jQuery('input[name="submitted['+e.provincia+']"]'),l=jQuery('input[name="submitted['+e.localidad+']"]');function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e,t,s,a=!1,r=!1,o=!1){var i=jQuery("<select></select>").attr("id",t).attr("name",e).addClass("form-control form-select").prop("required",a);return r&&i.append("<option value=''>Seleccione una opción</option>"),jQuery.each(s,function(e,t){let s="";o==t.nombre&&(s='selected="selected"'),i.append("<option value='"+t.id+"' "+s+">"+t.nombre+"</option>")}),i}function h(e,t){var s=l.prop("required");return n.val()?d("sLocalidades","sLocalidades",e.filter(function(e){return String(e.provincia.id)==String(t)}).map(function(e){return e.departamento.nombre&&(e.nombre=c(e.departamento.nombre.toLowerCase())+" - "+c(e.nombre.toLowerCase())),e}).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),s,emptyOption=!!l.val(),l.val()):d("sLocalidades","sLocalidades",[],s,!0,!1)}t=e.urlProvincias||t,i=e.urlLocalidades||i,jQuery.getJSON(t,function(e){var t;s=[],e.results.forEach(function(e,t){s.push(e)}),e=[],e=(t=s).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),t=n.prop("required"),(r=d("sProvincias","sProvincias",e,t,!0,n.val())).on("change",function(e){var t;n.val(""),l.val(""),o.children("option:not(:first)").remove(),""!=r.val()&&(n.val(r.find(":selected").text()),t=h(a,r.val()).find("option"),o.append(t),o.val(""))}),n.after(r),jQuery(r).select2()}),jQuery.getJSON(i,function(e){a=[],e.results.forEach(function(e,t){a.push(e)}),(o=h(a,r.val())).on("change",function(e){l.val(""),""!=o.val()&&l.val(o.find(":selected").text())}),l.after(o),jQuery(o).select2()}),n.hide(),l.hide()};function ponchoChart(t){"use strict";var e;function _e(e){var t={Line:"line",Bar:"bar",Pie:"pie",Area:"line","Horizontal Bar":"horizontalBar","Stacked Bar":"bar",Mixed:"mixed",HeatMap:"heatmap",default:""};return t[e]||t.default}function ye(e){var e=e.toString().replace(".",","),t=e.split(","),s=new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(t[0]);return e=1<t.length?s.concat(",",t[1].substr(0,2)):s}function s(e,a){var F,t,s,H,r,o,B,D,z,i,n,N,G,l,c,R,U,$,d,h,Q,p,V,u,W,m,f=[],_=[],y=[],Z=[],g=[],b=[],v=[],C=[],x=0,k="",J=[],E=0,w=[],Y=[],X=0,S=a.posicionLeyendas||"top",j="",j=void 0===a.mostrarLeyendas||a.mostrarLeyendas,L="",L=void 0===a.mostrarTotalStacked||a.mostrarTotalStacked,T=_e(a.tipoGrafico),A=e.values;if(jQuery.each(Object.keys(A[0]),function(e,t){var s;"eje-y"==A[0][e].substr(0,5)?(s=(s=A[0][e].split("-"))[0]+s[1],_.push(s),y.push(e)):"nombre-corto"==A[0][e]&&"heatmap"==T&&(X=e)}),jQuery.each(A,function(r,e){var a;0==r&&jQuery.each(y,function(e,t){var s=A[r][y[e]].split("-"),a=s[0]+s[1];v[a]=[],Z.push(s[2]),"mixed"==T&&(3<s.length&&("barra"==s[3]||"linea"==s[3])?J.push(s[3]):(0==e&&J.push("barra"),1==e&&J.push("linea")))}),1==r&&jQuery.each(y,function(e,t){"pie"==T||"heatmap"==T?f.push(A[r][y[e]]):(b.push(A[r][y[e]]),x+=1)}),1<r&&(a=!1,jQuery.each(y,function(e,t){var s=A[0][y[e]].split("-"),s=s[0]+s[1];"pie"==T?v[s].push(A[r][y[e]]):"heatmap"==T?(0==a&&(b.push(A[r][0]),a=!0,x+=1),e!=X&&v[s].push(A[r][y[e]]),e+2==X&&(void 0===A[r][e+2]?Y.push("*"):Y.push(A[r][e+2]))):(0==a&&(f.push(A[r][0]),a=!0),v[s].push(A[r][y[e]]))}))}),"pie"==T?(F=[],jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&F.push(v[e])}),C=F):1==x&&jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e])}),"mixed"==T&&0<(t=a.porcentajesMixed||"").length&&(w=t.split(",")),k=1==a.porcentajes?"line"==T&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}},mode:"index",intersect:!1}:"pie"==T?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s+"%"}}}:"Stacked Bar"==a.tipoGrafico?1==L?{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:"line"==T&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}},mode:"index",intersect:!1}:"pie"==T?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s}}}:"Stacked Bar"==a.tipoGrafico&&1<x?1==L?{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)}}}:{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}},"pie"==T&&(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),t=f,L=C,z=T,i=g,s=a.idComponenteGrafico,N=S,G=k,n=j,s=document.getElementById(s),new Chart(s,{type:z,data:{labels:t,datasets:[{data:L,borderColor:i,backgroundColor:i,borderWidth:2}]},options:{legend:{display:n,position:N},responsive:!0,tooltips:G}})),1==x&&(s=ponchoColor(Z[0]),"Line"==a.tipoGrafico&&(z=f,L=C,i=T,n=s,N=b[0],G=a.ejeYenCero,l=a.idComponenteGrafico,c=S,R=k,U=j,l=document.getElementById(l),new Chart(l,{type:i,data:{labels:z,datasets:[{data:L,borderColor:n,backgroundColor:n,borderWidth:2,lineTension:0,fill:!1,label:N}]},options:{legend:{display:U,position:c},tooltips:R,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:G}}]}}})),"bar"!=T&&"Area"!=a.tipoGrafico||(l=f,L=C,U=T,c=s,R=b[0],H=a.ejeYenCero,r=a.idComponenteGrafico,o=S,B=k,D=j,r=document.getElementById(r),new Chart(r,{type:U,data:{labels:l,datasets:[{data:L,borderColor:c,backgroundColor:c,borderWidth:2,lineTension:0,label:R}]},options:{legend:{display:D,position:o},tooltips:B,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:H}}]}}})),"horizontalBar"==T)&&(r=f,L=C,D=T,o=s,B=b[0],H=a.ejeYenCero,O=a.idComponenteGrafico,re=S,oe=k,ee=j,O=document.getElementById(O),new Chart(O,{type:D,data:{labels:r,datasets:[{data:L,borderColor:o,backgroundColor:o,borderWidth:2,lineTension:0,label:B}]},options:{legend:{display:ee,position:re},tooltips:oe,responsive:!0,scales:{xAxes:[{ticks:{beginAtZero:H}}]}}})),1<x)if("heatmap"==T)if(void 0!==a.heatMapColors&&""!=a.heatMapColors&&void 0!==a.heatMapColorsRange&&""!=a.heatMapColorsRange){for(var K=[],O="labelFila",L="labelColumna",ee="labelValor",te=(void 0!==a.datosTooltip&&0<a.datosTooltip.length&&(void 0!==a.datosTooltip[0]&&void 0!==a.datosTooltip[0].labelFila&&(O=a.datosTooltip[0].labelFila),void 0!==a.datosTooltip[1]&&void 0!==a.datosTooltip[1].labelColumna&&(L=a.datosTooltip[1].labelColumna),void 0!==a.datosTooltip[2])&&void 0!==a.datosTooltip[2].labelValor&&(ee=a.datosTooltip[2].labelValor),jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e],K.push(C))}),[]),M=0;M<b.length;M++){for(var e=[],se=0;se<f.length;se++){C={x:f[se],y:parseInt(K[se][M])};e.push(C)}te.push({name:("*"!=Y[M]?Y:b)[M],data:e})}for(var ae=[],M=0;M<a.heatMapColorsRange.length-1;M++){e={from:a.heatMapColorsRange[M],to:a.heatMapColorsRange[M+1],color:ponchoColor(a.heatMapColors[M])};ae.push(e)}var re="",re=void 0===a.mostrarEjeY||a.mostrarEjeY,oe=te,ie=a.idComponenteGrafico,ne=b,le=ae,ce=O,de=L,he=ee,L=a.tituloGrafico,P=re,pe=S,ue=j,ie=document.getElementById(ie),me=(new ApexCharts(ie,{series:oe,chart:{height:650,type:"heatmap"},dataLabels:{enabled:!1},title:{text:L},tooltip:{custom:function({series:e,seriesIndex:t,dataPointIndex:s,w:a}){e=ye(e[t][s]);return'<div class="arrow_box"><span>'+ce+": "+ne[t]+"<br>"+de+": "+a.globals.labels[s]+"<br>"+he+": "+e+"</span></div>"}},plotOptions:{heatmap:{shadeIntensity:.5,radius:0,useFillColorAsStroke:!1,colorScale:{ranges:le}}},yaxis:{show:P},legend:{show:ue,position:pe},responsive:[{breakpoint:1e3,options:{yaxis:{show:!1},legend:{show:ue,position:"top"}}}]}).render(),document.getElementsByClassName("apexcharts-toolbar"));for(let e=0;e<me.length;e++)me[e].style.display="none"}else void 0!==a.heatMapColors&&a.heatMapColors,void 0!==a.heatMapColorsRange&&a.heatMapColorsRange;else{var I=[],q=0,fe=(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),0);jQuery.each(Object.keys(_),function(e,t){var s,e=_[e];v.hasOwnProperty(e)&&(C=v[e],"Line"==a.tipoGrafico?s={label:b[q],data:C,borderColor:g[q],fill:!1,borderWidth:2,lineTension:0,backgroundColor:g[q]}:"Bar"==a.tipoGrafico||"Area"==a.tipoGrafico||"Horizontal Bar"==a.tipoGrafico||"Stacked Bar"==a.tipoGrafico?s={label:b[q],data:C,borderColor:g[q],backgroundColor:g[q],borderWidth:2,lineTension:0}:"Mixed"==a.tipoGrafico&&("barra"==(e=J[fe])?s={label:b[q],data:C,backgroundColor:g[q],yAxisID:"left-y-axis",type:"bar"}:"linea"==e&&(s={label:b[q],data:C,borderColor:g[q],backgroundColor:g[q],type:"line",yAxisID:"right-y-axis",fill:!1})),I.push(s),q+=1,fe+=1)}),"mixed"==T&&(2==w.length?E=2:1==w.length?"eje-y1"==w[0]?E=0:"eje-y2"==w[0]&&(E=1):E=3),"Stacked Bar"==a.tipoGrafico?(ie=f,L=T,le=I,P=a.idComponenteGrafico,pe=a.ejeYenCero,ue=S,w=k,W=j,P=document.getElementById(P),new Chart(P,{type:L,data:{labels:ie,datasets:le},options:{legend:{display:W,position:ue,labels:{textAlign:"center"}},tooltips:w,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:pe},stacked:!0}],xAxes:[{stacked:!0}]}}})):"Mixed"==a.tipoGrafico?(L=f,W="bar",w=I,d=a.idComponenteGrafico,h=a.ejeYenCero,Q=S,p=E,E=b[0],V=b[1],u=j,d=document.getElementById(d),new Chart(d,{type:W,data:{labels:L,datasets:w},options:{legend:{display:u,position:Q,labels:{textAlign:"center"}},tooltips:{enabled:!0,mode:"single",callbacks:{label:function(e,t){var s="",a=((2==p||e.datasetIndex==p)&&(s="%"),ye(e.yLabel));return t.datasets[e.datasetIndex].label+": "+a+" "+s}}},responsive:!0,scales:{yAxes:[{id:"left-y-axis",type:"linear",position:"left",ticks:{beginAtZero:h,callback:function(e){return e+(1!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:V,fontColor:"black"}},{id:"right-y-axis",type:"linear",position:"right",ticks:{beginAtZero:h,callback:function(e){return e+(0!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:E,fontColor:"black"}}]}}})):"Horizontal Bar"==a.tipoGrafico?(d=f,L=T,w=I,u=a.idComponenteGrafico,Q=a.ejeYenCero,V=S,h=k,E=j,u=document.getElementById(u),new Chart(u,{type:L,data:{labels:d,datasets:w},options:{legend:{display:E,position:V,labels:{textAlign:"center"}},tooltips:h,responsive:!0,maintainAspectRatio:!0,scales:{xAxes:[{ticks:{beginAtZero:Q}}]}}})):(L=f,w=T,E=I,m=a.idComponenteGrafico,$=a.ejeYenCero,S=S,k=k,j=j,m=document.getElementById(m),new Chart(m,{type:w,data:{labels:L,datasets:E},options:{legend:{display:j,position:S,labels:{textAlign:"center"}},tooltips:k,responsive:!0,maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:$}}]}}}))}""!=a.tituloGrafico&&void 0!==a.tituloGrafico&&(m=a.idTagTituloGrafico,w=a.tituloGrafico,document.getElementById(m))&&(document.getElementById(m).innerHTML=w)}!function(e){var t=!1;(e.idSpread&&e.hojaNombre||e.jsonUrl||e.jsonInput)&&void 0!==e.tipoGrafico&&""!=e.tipoGrafico&&void 0!==e.idComponenteGrafico&&""!=e.idComponenteGrafico&&""!=_e(e.tipoGrafico)&&(t=!0);return t}(t)?(void 0!==t.idSpread&&t.idSpread,void 0!==t.hojaNombre&&t.hojaNombre,void 0!==t.tipoGrafico&&t.tipoGrafico,void 0!==t.idComponenteGrafico&&t.idComponenteGrafico,_e(t.tipoGrafico)):t.jsonInput?s(jQuery.parseJSON(t.jsonInput),t):(e=t.jsonUrl||"https://sheets.googleapis.com/v4/spreadsheets/"+t.idSpread+"/values/"+t.hojaNombre+"?alt=json&key=AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",jQuery.getJSON(e,function(e){s(e,t)}))}const gapi_legacy=e=>{const o=e.values[0],i=/ |\/|_/gi;let n=[];return e.values.forEach((e,t)=>{if(0<t){var s={};for(const r in o){var a=e.hasOwnProperty(r)?e[r].trim():"";s["gsx$"+o[r].toLowerCase().replace(i,"")]={$t:a}}n.push(s)}}),{feed:{entry:n}}};class PonchoMap{constructor(e,t){var s={error_reporting:!0,no_info:!1,title:!1,id:"id",template:!1,template_structure:{container_classlist:["info-container"],definition_classlist:[],definition_list_classlist:["definition-list"],definition_list_tag:"dl",definition_tag:"dd",term_classlist:["h6","m-b-0"],term_tag:"dt",title_classlist:["h4","text-primary","m-t-0"]},allowed_tags:[],template_innerhtml:!1,template_markdown:!1,markdown_options:{extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"],simpleLineBreaks:!0,tables:!0},render_slider:!0,scope:"",slider:!1,scroll:!1,hash:!1,headers:{},header_icons:[],content_selector:!1,map_selector:"map",anchor_delay:0,slider_selector:".slider",map_view:[-40.44,-63.59],map_anchor_zoom:16,map_zoom:4,min_zoom:2,reset_zoom:!0,latitud:"latitud",longitud:"longitud",marker:"azul",tooltip:!1,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[13,-18],sticky:!1,opacity:.8},marker_cluster_options:{spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,maxClusterRadius:30,spiderfyDistanceMultiplier:.5,spiderLegPolylineOptions:{weight:1,color:"#666666",opacity:.5,"fill-opacity":.5}},accesible_menu_extras:[{text:"Ayudá a mejorar el mapa",anchor:"https://www.argentina.gob.ar/sugerencias"}]},a=Object.assign({},s,t);this.error_reporting=a.error_reporting,this.scope=a.scope,this.render_slider=a.render_slider,this.template=a.template,this.template_structure={...s.template_structure,...t.template_structure},this.template_innerhtml=a.template_innerhtml,this.template_markdown=a.template_markdown,this.markdown_options=a.markdown_options,this.allowed_tags=a.allowed_tags,this.map_selector=a.map_selector,this.headers=this.setHeaders(a.headers),this.header_icons=a.header_icons,this.hash=a.hash,this.scroll=a.scroll,this.map_view=a.map_view,this.anchor_delay=a.anchor_delay,this.map_zoom=a.map_zoom,this.min_zoom=a.min_zoom,this.map_anchor_zoom=a.map_anchor_zoom,this.tooltip_options=a.tooltip_options,this.tooltip=a.tooltip,this.marker_cluster_options=a.marker_cluster_options,this.marker_color=a.marker,this.id=a.id,this.title=a.title,this.latitude=a.latitud,this.longitude=a.longitud,this.slider=a.slider,this.no_info=a.no_info,this.reset_zoom=a.reset_zoom,this.slider_selector=this._selectorName(a.slider_selector),this.selected_marker,this.scope_selector=`[data-scope="${this.scope}"]`,this.scope_sufix="--"+this.scope,this.content_selector=a.content_selector||".js-content"+this.scope_sufix,this.data=this.formatInput(e),this.geometryTypes=["Point","LineString","Polygon","MultiPoint","MultiLineString"],this.featureStyle={stroke:"dodgerblue","stroke-opacity":1,"stroke-width":2,"fill-opacity":.5},this.accesible_menu_search=[],this.accesible_menu_filter=[],this.accesible_menu_extras=a.accesible_menu_extras,this.geojson,this.map=new L.map(this.map_selector,{renderer:L.svg()}).setView(this.map_view,this.map_zoom),this.titleLayer=new L.tileLayer("https://mapa-ign.argentina.gob.ar/osm/{z}/{x}/{-y}.png",{attribution:'Contribuidores: <a href="https://www.ign.gob.ar/AreaServicios/Argenmap/Introduccion" target="_blank">Instituto Geográfico Nacional</a>, <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>'}),this.markers=new L.markerClusterGroup(this.marker_cluster_options),this.ponchoLoaderTimeout}isGeoJSON=e=>"FeatureCollection"===e?.type;get entries(){return this.data.features}get geoJSON(){return this.featureCollection(this.entries)}formatInput=e=>{e.length<1&&this.errorMessage("No se puede visualizar el mapa, el documento está vacío","warning");let t;return t=this.isGeoJSON(e)?e:(e=this.features(e),this.featureCollection(e)),this._setIdIfNotExists(t)};errorMessage=(e=!1,t="danger")=>{document.querySelectorAll("#js-error-message"+this.scope_sufix).forEach(e=>e.remove());const s=document.createElement("div");s.id="js-error-message"+this.scope_sufix,s.classList.add("poncho-map--message",t);var a=document.createElement("i"),r=(a.classList.add("icono-arg-mapa-argentina","poncho-map--message__icon"),document.createElement("h2"));r.classList.add("h6","title","sr-only"),r.textContent="¡Se produjo un error!",s.appendChild(a),s.appendChild(r);throw[["En estos momentos tenemos inconvenientes para mostrar el mapa.","text-center"],["<em>Disculpe las molestias</em>","text-center","p"]].forEach(e=>{var t=document.createElement(void 0!==(t=e[2])||t?t:"p");void 0===e[1]&&!e[1]||(t.className=e[1]),t.innerHTML=e[0],s.appendChild(t)}),this.error_reporting&&((a=document.querySelector(this.scope_selector+".poncho-map")).parentNode.insertBefore(s,a),"danger"==t)&&document.getElementById(this.map_selector).remove(),e};feature=e=>{var t=e[this.latitude],s=e[this.longitude];return[t,s].forEach(e=>{isNaN(Number(e))&&this.errorMessage("El archivo contiene errores en la definición de latitud y longitud.\n "+e)}),delete e[this.latitude],delete e[this.longitude],{type:"Feature",properties:e,geometry:{type:"Point",coordinates:[s,t]}}};featureCollection=e=>({type:"FeatureCollection",features:e});features=e=>e.map(this.feature);_setIdIfNotExists=e=>{var t;return e.features.filter((e,t)=>0===t).every(e=>e.properties.hasOwnProperty("id"))||(t=e.features.map((e,t)=>{var t=t+1,s=this.title&&e.properties[this.title]?"-"+slugify(e.properties[this.title]):"";return e.properties.id=t+s,e}),e.features=t),e};addHash=e=>{if(!this.hash||this.no_info)return null;window.location.hash="#"+e};entry=t=>this.entries.find(e=>e.properties[this.id]==t);searchEntries=(t,e)=>{return e=void 0===e?this.geoJSON:e,t?e.filter(e=>{if(this.searchEntry(t,e.properties))return e}):e};searchEntry=(e,t)=>{for(const r of[...new Set([this.title,...this.search_fields])].filter(e=>e))if(t.hasOwnProperty(r)){var s=replaceSpecialChars(e).toUpperCase(),a=replaceSpecialChars(t[r]).toString().toUpperCase();try{if(a.includes(s))return t}catch(e){}}return null};_selectorName=e=>e.replace(/^(\.|\#)/,"");scrollCenter=()=>{var e=document.getElementById(this.map_selector),t=e.getBoundingClientRect(),e=(e.offsetLeft+e.offsetWidth)/2,t=t.top+window.scrollY;window.scrollTo({top:t,left:e,behavior:"smooth"})};_clearContent=()=>document.querySelector(".js-content"+this.scope_sufix).innerHTML="";toggleSlider=()=>{this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.toggle(this.slider_selector+"--in")}),document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.style.display=this.isSliderOpen()?"block":"none"}))};_focusOnFeature=t=>{this.map.eachLayer(e=>{e?.options?.id==t&&(e?._path?e._path.focus():e?._icon&&e._icon.focus())})};_clickToggleSlider=()=>document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>e.addEventListener("click",()=>{this._clearContent(),this.toggleSlider(),this._focusOnFeature(e.dataset.entryId)}));isSliderOpen=()=>{let t=[];return document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.contains(this.slider_selector+"--in")&&t.push(!0)}),t.some(e=>e)};setContent=t=>{if(!this.no_info){this._focusOnSlider(),this.isSliderOpen()||this.toggleSlider();const s="function"==typeof this.template?this.template(this,t):this.defaultTemplate(this,t);document.querySelectorAll(this.content_selector).forEach(e=>{e.innerHTML=s}),document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>{e.dataset.entryId=t[this.id]})}};_focusOnSlider=()=>{var e;this.no_info||(this.isSliderOpen()?document.querySelector(".js-close-slider"+this.scope_sufix).focus():(e=document.querySelector(".js-slider"+this.scope_sufix))&&e.addEventListener("animationend",()=>{document.querySelector(".js-close-slider"+this.scope_sufix).focus()}))};setHeaders=e=>{var t;return[this.template_structure,this.template_structure.mixing].every(e=>e)?(t=this.template_structure.mixing.reduce((e,t)=>{if([t.key].every(e=>e))return{...e,[t.key]:t.header||""}},{}),{...e,...t}):e};header=e=>this.headers.hasOwnProperty(e)?this.headers[e]:e;_renderSlider=()=>{var e,t,s,a;this.render_slider&&!this.no_info&&(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>e.remove()),(e=document.createElement("button")).classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-slider"+this.scope_sufix),e.title="Cerrar panel",e.setAttribute("role","button"),e.setAttribute("aria-label","Cerrar panel de información"),e.innerHTML='<span class="sr-only">Cerrar</span>✕',(t=document.createElement("a")).setAttribute("tabindex",0),t.id="js-anchor-slider"+this.scope_sufix,(s=document.createElement("div")).classList.add("content-container"),(a=document.createElement("div")).classList.add("content","js-content"+this.scope_sufix),a.tabIndex=0,s.appendChild(a),(a=document.createElement("div")).style.display="none",a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de información"),a.classList.add("slider","js-slider"+this.scope_sufix),a.id="slider"+this.scope_sufix,a.appendChild(e),a.appendChild(t),a.appendChild(s),document.querySelector(this.scope_selector+".poncho-map").appendChild(a))};_showSlider=(e,t)=>{e.hasOwnProperty("_latlng")?this.map.setView(e._latlng,this.map_anchor_zoom):this.map.fitBounds(e.getBounds()),e.fireEvent("click")};_showPopup=e=>{e.hasOwnProperty("_latlng")?this.markers.zoomToShowLayer(e,()=>{e.openPopup()}):(this.map.fitBounds(e.getBounds()),e.openPopup())};removeHash=()=>history.replaceState(null,null," ");hasHash=()=>{return window.location.hash.replace("#","")||!1};gotoHashedEntry=()=>{var e=this.hasHash();e&&this.gotoEntry(e)};gotoEntry=t=>{const s=this.entry(t),a=(e,t,s)=>{e.options.hasOwnProperty("id")&&e.options.id==t&&(this._setSelectedMarker(t,e),this.hash&&this.addHash(t),this.slider&&this.hash?this._showSlider(e,s):this._showPopup(e))};this.markers.eachLayer(e=>a(e,t,s)),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&a(e,t,s)})};_setClickeable=s=>{s.on("keypress click",t=>{document.querySelectorAll(".marker--active").forEach(e=>e.classList.remove("marker--active")),["_icon","_path"].forEach(e=>{t.sourceTarget.hasOwnProperty(e)&&t.sourceTarget[e].classList.add("marker--active")});var e=this.entries.find(e=>e.properties[this.id]==s.options.id);this.setContent(e.properties)})};isFeature=e=>!!e.hasOwnProperty("feature");_clickeableFeatures=()=>{this.reset_zoom&&this.map.eachLayer(e=>{this.isFeature(e)&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&this._setClickeable(e)})};_clickeableMarkers=()=>{this.no_info||this.markers.eachLayer(this._setClickeable)};_urlHash=()=>{const t=e=>{e.on("click",()=>{this.addHash(e.options.id)})};this.markers.eachLayer(t),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&t(e)})};removeListElement=(e,t)=>{t=e.indexOf(t);return-1<t&&e.splice(t,1),e};_templateTitle=e=>{if(!e.hasOwnProperty(this.title))return!1;var t=this.template_structure,s=!!t.hasOwnProperty("title")&&t.title,a=this.title||!1;if(t.hasOwnProperty("title")&&"boolean"==typeof t.title)return!1;if(!s&&!a)return!1;s=s||a;let r;t?.header?((a=document.createElement("div")).innerHTML=this._mdToHtml(t.header(this,e)),this.template_innerhtml&&(a.innerHTML=t.header(this,e)),r=a):((r=document.createElement("h2")).classList.add(...t.title_classlist),r.textContent=e[s]);a=document.createElement("header");return a.className="header",a.appendChild(r),a};_templateList=e=>{var t=this.template_structure,s=Object.keys(e);let a=s;if(t.hasOwnProperty("values")&&0<t?.values?.length)a=t.values;else if(t.hasOwnProperty("exclude")&&0<t.exclude.length)for(const r of t.exclude)a=this.removeListElement(s,r);return a};_mdToHtml=e=>{var t,s;return this.template_markdown&&this._markdownEnable()?(t=new showdown.Converter(this.markdown_options),s=secureHTML(e,this.allowed_tags),t.makeHtml((""+s).trim())):e};_markdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_templateMixing=r=>{if(this.template_structure.hasOwnProperty("mixing")&&0<this.template_structure.mixing.length){var e=this.template_structure.mixing;let a={};return e.forEach(e=>{var{values:e,separator:t=", ",key:s}=e;void 0===s&&this.errorMessage("Mixing requiere un valor en el atributo «key».","warning"),a[s]=e.map(e=>e in r?r[e]:e.toString()).filter(e=>e).join(t)}),Object.assign({},r,a)}return r};_setType=(e,t=!1,s=!1)=>"function"==typeof e?e(this,t,s):e;_lead=e=>{var t,s,a,r;if(this.template_structure.hasOwnProperty("lead"))return this.template_structure.lead.hasOwnProperty("key")||this.errorMessage("Lead requiere un valor en el atributo «key».","warning"),{key:a=!1,css:t="small",style:r=!1}=this.template_structure.lead,(s=document.createElement("p")).textContent=e[a],(a=this._setType(r,e))&&s.setAttribute("style",a),(r=this._setType(t,e))&&s.classList.add(...r.split(" ")),s};_termIcon=(e,t)=>{var s=this.header_icons.find(e=>e.key==t);if(s){var{css:s=!1,style:a=!1,html:r=!1}=s,r=this._setType(r,e,t),a=this._setType(a,e,t),s=this._setType(s,e,t);if(s)return(e=document.createElement("i")).setAttribute("aria-hidden","true"),e.classList.add(...s.split(" ")),a&&e.setAttribute("style",a),e;if(r)return(s=document.createElement("template")).innerHTML=r,s.content}return!1};defaultTemplate=(e,t)=>{t=this._templateMixing(t);var s,a,r=this["template_structure"],o=this._templateList(t),i=this._templateTitle(t),n=document.createElement("article"),l=(n.classList.add(...r.container_classlist),document.createElement(r.definition_list_tag));l.classList.add(...r.definition_list_classlist),l.style.fontSize="1rem";for(const c of o)t.hasOwnProperty(c)&&t[c]&&((s=document.createElement(r.term_tag)).classList.add(...r.term_classlist),(a=this._termIcon(t,c))&&(s.appendChild(a),s.insertAdjacentText("beforeend"," ")),s.insertAdjacentText("beforeend",this.header(c)),(a=document.createElement(r.definition_tag)).classList.add(...r.definition_classlist),a.textContent=t[c],this.template_markdown?a.innerHTML=this._mdToHtml(t[c]):this.template_innerhtml&&(a.innerHTML=secureHTML(t[c],this.allowed_tags)),""!=this.header(c)&&l.appendChild(s),l.appendChild(a));o=this._lead(t);return o&&n.appendChild(o),i&&n.appendChild(i),n.appendChild(l),n.outerHTML};icon=(e="azul")=>new L.icon({iconUrl:"https://www.argentina.gob.ar/sites/default/files/"+`marcador-${e}.svg`,iconSize:[29,40],iconAnchor:[14,40],popupAnchor:[0,-37]});resetView=()=>this.map.setView(this.map_view,this.map_zoom);fitBounds=()=>{try{this.map.fitBounds(this.geojson.getBounds())}catch(e){}};_resetViewButton=()=>{this.reset_zoom&&(document.querySelectorAll(".js-reset-view"+this.scope_sufix).forEach(e=>e.remove()),document.querySelectorAll(this.scope_selector+" .leaflet-control-zoom-in").forEach(e=>{var t=document.createElement("i"),s=(t.classList.add("fa","fa-expand"),t.setAttribute("aria-hidden","true"),document.createElement("a"));s.classList.add("js-reset-view"+this.scope_sufix,"leaflet-control-zoom-reset"),s.href="#",s.title="Zoom para ver todo el mapa",s.setAttribute("role","button"),s.setAttribute("aria-label","Zoom para ver todo el mapa"),s.appendChild(t),s.onclick=e=>{e.preventDefault(),this.cleanState(),this.resetView()},e.after(s)}))};marker=e=>{var t;return this.marker_color&&"boolean"!=typeof this.marker_color?"string"==typeof this.marker_color?this.icon(this.marker_color):"string"==typeof this.marker_color(this,e)?(t=this.marker_color(this,e),this.icon(t)):"function"==typeof this.marker_color?this.marker_color(this,e):void 0:null};_clearLayers=()=>{this.markers.clearLayers(),this.map.eachLayer(e=>{this.isFeature(e)&&this.map.removeLayer(e)})};markersMap=e=>{var r=this;this._clearLayers(),this.geojson=new L.geoJson(e,{pointToLayer:function(e,t){var e=e["properties"],s=r.marker(e),a={},s=(a.id=e[r.id],s&&(a.icon=s),r.title&&(a.alt=e[r.title]),new L.marker(t,a));return r.map.options.minZoom=r.min_zoom,r.markers.addLayer(s),r.tooltip&&e[r.title]&&s.bindTooltip(e[r.title],r.tooltip_options),r.no_info||r.slider||(t="function"==typeof r.template?r.template(r,e):r.defaultTemplate(r,e),s.bindPopup(t)),r.markers},onEachFeature:function(e,t){var{properties:s,geometry:a}=e;t.options.id=s[r.id],e.properties.name=s[r.title],r.tooltip&&s[r.title]&&"Point"!=a.type&&"MultiPoint"!=a.type&&t.bindTooltip(s[r.title],r.tooltip_options),r.no_info||r.slider||"Point"==a.type||"MultiPoint"==a.type||(e="function"==typeof r.template?r.template(r,s):r.defaultTemplate(r,s),t.bindPopup(e))},style:function(e){const s=e["properties"];e=(e,t=!1)=>s.hasOwnProperty(e)?s[e]:t||r.featureStyle[e];return{color:e("stroke-color",e("stroke")),strokeOpacity:e("stroke-opacity"),weight:e("stroke-width"),fillColor:e("stroke"),opacity:e("stroke-opacity"),fillOpacity:e("fill-opacity")}}}),this.geojson.addTo(this.map)};_setSelectedMarker=(e,t)=>{e={entry:this.entry(e),marker:t};return this.selected_marker=e};_selectedMarker=()=>{this.map.eachLayer(t=>{this.isFeature(t)&&t.on("click",e=>{this._setSelectedMarker(t.options.id,t)})})};_hiddenSearchInput=()=>{const t=document.createElement("input");t.type="hidden",t.name="js-search-input"+this.scope_sufix,t.setAttribute("disabled","disabled"),t.id="js-search-input"+this.scope_sufix,document.querySelectorAll(this.scope_selector+".poncho-map").forEach(e=>e.appendChild(t))};_setFetureAttributes=()=>{const t=(e,t)=>{e.hasOwnProperty(t)&&(e[t].setAttribute("aria-label",e?.feature?.properties?.[this.title]),e[t].setAttribute("role","button"),e[t].setAttribute("tabindex",0),e[t].dataset.entryId=e?.feature?.properties?.[this.id],e[t].dataset.leafletId=e._leaflet_id)};this.map.eachLayer(e=>t(e,"_path"))};_accesibleAnchors=()=>{var e=[[this.scope_selector+" .leaflet-map-pane","leaflet-map-pane"+this.scope_sufix,[["role","region"]]],[this.scope_selector+" .leaflet-control-zoom","leaflet-control-zoom"+this.scope_sufix,[["aria-label","Herramientas de zoom"],["role","region"]]]];return e.forEach(e=>{const t=document.querySelector(e[0]);t.id=e[1],e[2].forEach(e=>t.setAttribute(e[0],e[1]))}),e};_accesibleMenu=()=>{document.querySelectorAll(this.scope_selector+" .accesible-nav").forEach(e=>e.remove());var e=this._accesibleAnchors(),e=[...e=[{text:"Ir a los marcadores del mapa",anchor:"#"+e[0][1]},{text:"Ajustar marcadores al mapa",anchor:"#",class:"js-fit-bounds"},{text:"Ir al panel de zoom",anchor:"#"+e[1][1]}],...this.accesible_menu_filter,...this.accesible_menu_search,...this.accesible_menu_extras],t=document.createElement("i");t.classList.add("icono-arg-sitios-accesibles","accesible-nav__icon"),t.setAttribute("aria-hidden","true");const s=document.createElement("div"),a=(s.classList.add("accesible-nav","top"),s.id="accesible-nav"+this.scope_sufix,s.setAttribute("aria-label","Menú para el mapa"),s.setAttribute("role","navigation"),s.tabIndex=0,document.createElement("ul"));e.forEach((e,t)=>{var s=document.createElement("a"),e=(s.textContent=e.text,s.tabIndex=0,s.href=e.anchor,e.hasOwnProperty("class")&&""!=e.class&&s.classList.add(...e.class.split(" ")),document.createElement("li"));e.appendChild(s),a.appendChild(e)}),s.appendChild(t),s.appendChild(a);e=document.createElement("a");e.textContent="Ir a la navegación del mapa",e.href="#accesible-nav"+this.scope_sufix,e.id="accesible-return-nav"+this.scope_sufix;const r=document.createElement("div");r.classList.add("accesible-nav","bottom"),r.appendChild(t.cloneNode(!0)),r.appendChild(e),document.querySelectorAll(""+this.scope_selector).forEach(e=>{e.insertBefore(s,e.children[0]),e.appendChild(r)}),this.fit()};fit=()=>document.querySelectorAll(this.scope_selector+" .js-fit-bounds").forEach(e=>{e.onclick=e=>{e.preventDefault(),this.fitBounds()}});clearAll=()=>{[".js-filter-container"+this.scope_sufix,".js-slider"+this.scope_sufix].forEach(e=>document.querySelectorAll(e).forEach(e=>e.remove()))};cleanState=()=>history.replaceState(null,null," ");render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this.titleLayer.addTo(this.map),this.markersMap(this.entries),this._selectedMarker(),this.slider&&(this._renderSlider(),this._clickeableFeatures(),this._clickeableMarkers(),this._clickToggleSlider()),this.hash&&this._urlHash(),this.scroll&&this.hasHash()&&this.scrollCenter(),setTimeout(this.gotoHashedEntry,this.anchor_delay),this._setFetureAttributes(),this._accesibleMenu()}}class PonchoMapLoader{constructor(e){e=Object.assign({},{scope:"",timeout:5e4},e);this.scope=e.scope,this.timeout=e.timeout,this.scope_sufix="--"+this.scope,this.scope_selector=`[data-scope="${this.scope}"]`,this.ponchoLoaderTimeout}close=()=>document.querySelectorAll(".js-poncho-map__loader"+this.scope_sufix).forEach(e=>e.remove());load=()=>{this.close(),clearTimeout(this.ponchoLoaderTimeout);var e=document.querySelector(".poncho-map"+this.scope_selector),t=document.createElement("span"),s=(t.className="loader",document.createElement("div"));s.dataset.scope=this.selector,s.classList.add("poncho-map__loader","js-poncho-map__loader"+this.scope_sufix),s.appendChild(t),e.appendChild(s),this.ponchoLoaderTimeout=setTimeout(this.remove,this.timeout)};loader=(e,t=500)=>{this.load(),setTimeout(()=>{e(),this.remove()},t)}}class PonchoMapFilter extends PonchoMap{constructor(e,t){super(e,t);e=Object.assign({},{filters:[],filters_visible:!1,filters_info:!1,search_fields:[],messages:{reset:' <a href="#" class="{{reset_search}}" title="Restablece el mapa a su estado inicial">Restablecer mapa</a>',initial:"Hay {{total_results}} puntos en el mapa.",no_results_by_term:"No encontramos resultados para tu búsqueda.",no_results:"No s + this.messages.resete encontraron entradas.",results:"{{total_results}} resultados coinciden con tu búsqueda.",one_result:"{{total_results}} resultado coincide con tu búsqueda.",has_filters:'<i title="¡Advertencia!" aria-hidden="true" class="fa fa-warning text-danger"></i> Se están usando filtros.'}},t);this.filters=e.filters,this.filters_info=e.filters_info,this.filters_visible=e.filters_visible,this.valid_fields=["checkbox","radio"],this.search_fields=e.search_fields,this.messages=e.messages,this.accesible_menu_filter=[{text:"Ir al panel de filtros",anchor:"#filtrar-busqueda"+this.scope_sufix}]}tplParser=(e,a)=>Object.keys(a).reduce(function(e,t){var s=new RegExp("\\{\\{\\s{0,2}"+t+"\\s{0,2}\\}\\}","gm");return e=e.replace(s,a[t])},e);_helpText=e=>{var t=document.querySelectorAll(this.scope_selector+" .js-poncho-map__help");const a={total_results:e.length,total_entries:this.entries.length,total_filtered_entries:this.filtered_entries.length,filter_class:"js-close-filter"+this.scope_sufix,anchor:"#",term:this.inputSearchValue,reset_search:"js-poncho-map-reset"+this.scope_sufix};t.forEach(e=>{e.innerHTML="";var t=document.createElement("ul"),s=(t.classList.add("m-b-0","list-unstyled"),t.setAttribute("aria-live","polite"),e=>{var t=document.createElement("li");return t.innerHTML=e,t});a.total_entries===a.total_results?t.appendChild(s(this.tplParser(this.messages.initial,a))):a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results_by_term+this.messages.reset,a))):""===this.inputSearchValue&&a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results+this.messages.reset,a))):1==a.total_results?t.appendChild(s(this.tplParser(this.messages.one_result+this.messages.reset,a))):1<a.total_results&&t.appendChild(s(this.tplParser(this.messages.results+this.messages.reset,a))),this.usingFilters(),e.appendChild(t)})};_filterPosition=e=>{e=/^([\w\-]+?)(?:__([0-9]+))(?:__([0-9]+))?$/gm.exec(e);return e?[e[1],e[2]]:null};isFilterOpen=()=>document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.contains("filter--in");toggleFilter=()=>{document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.toggle("filter--in")};_filterContainerHeight=()=>{var e=document.querySelector(".js-filter-container"+this.scope_sufix),t=document.querySelector(".js-close-filter"+this.scope_sufix),s=e.offsetParent.offsetHeight,a=2*this._cssVarComputedDistance(),s=s-e.offsetTop-t.offsetHeight-a,e=document.querySelector(".js-poncho-map-filters"+this.scope_sufix),t=(e.style.maxHeight=s+"px",e.offsetHeight-45),a=document.querySelector(".js-filters"+this.scope_sufix);a.style.height=t+"px",a.style.overflow="auto"};_clickToggleFilter=()=>document.querySelectorAll(".js-close-filter"+this.scope_sufix).forEach(e=>e.onclick=e=>{e.preventDefault(),this.toggleFilter(),this._filterContainerHeight()});_setFilter=e=>{const[t,s="checked"]=e;e=this.entries.map(e=>{if(e.properties.hasOwnProperty(t))return e.properties[t]}).filter(e=>e),e=[...new Set(e)].map(e=>[t,e,[e],s]);return e.sort((e,t)=>{e=e[1].toUpperCase(),t=t[1].toUpperCase();return t<e?1:e<t?-1:0}),e};_fieldsToUse=e=>{var{fields:e=!1,field:t=!1}=e,e=(e||t||this.errorMessage("Filters requiere el uso del atributo `field` o `fields`.","warning"),e||this._setFilter(t));return e};_fields=(e,t)=>{var s=document.createElement("div"),a=(s.classList.add("field-list","p-b-1"),this._fieldsToUse(e));for(const c in a){var r=a[c],o=document.createElement("input"),i=(o.type=this.valid_fields.includes(e.type)?e.type:"checkbox",o.id=`id__${r[0]}__${t}__`+c,"radio"==e.type?o.name=r[0]+"__"+t:o.name=r[0]+`__${t}__`+c,o.className="form-check-input",o.value=c,void 0!==r[3]&&"checked"==r[3]&&o.setAttribute("checked","checked"),document.createElement("label")),n=(i.style.marginLeft=".33rem",i.textContent=r[1],i.className="form-check-label",i.setAttribute("for",`id__${r[0]}__${t}__`+c),document.createElement("span")),r=(n.dataset.info=r[0]+`__${t}__`+c,i.appendChild(n),document.createElement("div"));r.className="form-check",r.appendChild(o),r.appendChild(i),s.appendChild(r)}var l=document.createElement("div");return l.appendChild(s),l};_filterButton=()=>{var e=document.createElement("i"),t=(e.setAttribute("aria-hidden","true"),e.classList.add("fa","fa-filter"),document.createElement("span")),s=(t.textContent="Abre o cierra el filtro de búsqueda",t.classList.add("sr-only"),document.createElement("button")),e=(s.classList.add("btn","btn-secondary","btn-filter","js-close-filter"+this.scope_sufix),s.id="filtrar-busqueda"+this.scope_sufix,s.appendChild(e),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre o cierra el filtro de búsqueda"),s.setAttribute("aria-controls","poncho-map-filters"+this.scope_sufix),document.createElement("div"));e.classList.add("js-filter-container"+this.scope_sufix,"filter-container"),e.appendChild(s),document.querySelector(".poncho-map"+this.scope_selector).appendChild(e)};_cssVarComputedDistance=()=>{var e=document.querySelector(".poncho-map"),e=getComputedStyle(e).getPropertyValue("--slider-distance");return parseInt(e.toString().replace(/[^0-9]*/gm,""))||0};_controlZoomSize=()=>{var e=document.querySelector(this.scope_selector+" .leaflet-control-zoom");return{controlHeight:e.offsetHeight,controlTop:e.offsetTop}};_filterContainer=()=>{var e=document.createElement("div"),t=(e.className="js-filters"+this.scope_sufix,document.createElement("button")),s=(t.classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-filter"+this.scope_sufix),t.title="Cerrar panel",t.setAttribute("role","button"),t.setAttribute("aria-label","Cerrar panel de filtros"),t.innerHTML='<span class="sr-only">Cerrar </span>✕',document.createElement("form"));s.classList.add("js-formulario"+this.scope_sufix),s.appendChild(t),s.appendChild(e);const a=document.createElement("div");a.classList.add("js-poncho-map-filters"+this.scope_sufix,"poncho-map-filters"),a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de filtros"),a.id="poncho-map-filters"+this.scope_sufix,this.filters_visible&&a.classList.add("filter--in");t=this._cssVarComputedDistance(),e=this._controlZoomSize();const r=e.controlHeight+e.controlTop+t+"px";a.appendChild(s),document.querySelectorAll(".js-filter-container"+this.scope_sufix).forEach(e=>{e.style.top=r,e.appendChild(a)})};_checkUncheckButtons=e=>{var t=document.createElement("button"),s=(t.classList.add("js-select-items","select-items__button"),t.textContent="Marcar todos",t.dataset.field=e.field[0],t.dataset.value=1,document.createElement("button")),e=(s.classList.add("js-select-items","select-items__button"),s.textContent="Desmarcar todos",s.dataset.field=e.field[0],s.dataset.value=0,document.createElement("div"));return e.classList.add("select-items"),e.appendChild(t),e.appendChild(s),e};_createFilters=e=>{const r=document.querySelector(".js-filters"+this.scope_sufix);e.forEach((e,t)=>{var s=document.createElement("legend"),a=(s.textContent=e.legend,s.classList.add("m-b-1","text-primary","h6"),document.createElement("fieldset"));a.appendChild(s),e.hasOwnProperty("check_uncheck_all")&&e.check_uncheck_all&&a.appendChild(this._checkUncheckButtons(e)),a.appendChild(this._fields(e,t)),r.appendChild(a)})};formFilters=()=>{var e;return this.filters.length<1?[]:(e=document.querySelector(".js-formulario"+this.scope_sufix),e=new FormData(e),Array.from(e).map(e=>{var t=this._filterPosition(e[0]);return[parseInt(t[1]),parseInt(e[1]),t[0]]}))};defaultFiltersConfiguration=()=>{return this.filters.map((e,s)=>{return this._fieldsToUse(e).map((e,t)=>[s,t,e[0],"undefinded"!=typeof e[3]&&"checked"==e[3]])}).flat()};usingFilters=()=>{return this.defaultFiltersConfiguration().every(e=>document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked)};_resetFormFilters=()=>{this.defaultFiltersConfiguration().forEach(e=>{document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked=e[3]})};get inputSearchValue(){var e=document.querySelector("#js-search-input"+this.scope_sufix).value.trim();return""!==e&&e}_countOccurrences=(e,s,a)=>{return e.reduce((e,t)=>s.some(e=>t.properties[a].includes(e))?e+1:e,0)};totals=()=>{return this.formFilters().map(e=>{var t=this._fieldsToUse(this.filters[e[0]])[e[1]];return[t[1],this._countOccurrences(this.filtered_entries,t[2],t[0]),...e]})};_totalsInfo=()=>{if(!this.filters_info)return"";this.totals().forEach(e=>{var t=document.querySelector(""+this.scope_selector+` [data-info="${e[4]}__${e[2]}__${e[3]}"]`),s=e[1]<2?"":"s",a=document.createElement("i"),r=(a.style.cursor="help",a.style.opacity=".75",a.style.marginLeft=".5em",a.style.marginRight=".25em",a.classList.add("fa","fa-info-circle","small","text-info"),a.title=e[1]+" resultado"+s,a.setAttribute("aria-hidden","true"),document.createElement("span")),e=(r.className="sr-only",r.style.fontWeight="400",r.textContent=e[1]+` elemento${s}.`,document.createElement("small"));e.appendChild(a),e.appendChild(r),t.appendChild(e)})};_validateEntry=(t,s)=>{var a=this.filters.length,r=[];for(let e=0;e<a;e++)r.push(this._validateGroup(t,(t=>s.filter(e=>e[0]==t))(e)));return r.every(e=>e)};_search=(t,e,s)=>{const a=this._fieldsToUse(this.filters[e])[s];return a[2].filter(e=>e).some(e=>{if(t.hasOwnProperty(a[0]))return t[a[0]].includes(e)})};_validateGroup=(t,e)=>{return e.map(e=>this._search(t,e[0],e[1])).some(e=>e)};_filterData=()=>{var e=this.formFilters(),t=this.entries.filter(e=>this._validateEntry(e.properties,this.formFilters())),t=this.searchEntries(this.inputSearchValue,t);return t=this.filters.length<1||0<e.length?t:[],this.filtered_entries=t};_filteredData=e=>{e=void 0!==e?this.entries:this._filterData(),this.markersMap(e),this._selectedMarker(),this._helpText(e),this._resetSearch(),this._clickToggleFilter(),this.slider&&(this._renderSlider(),this._clickeableMarkers(),this._clickeableFeatures(),this._clickToggleSlider()),this.hash&&this._urlHash(),this._setFetureAttributes(),this._accesibleMenu()};_clearSearchInput=()=>document.querySelectorAll("#js-search-input"+this.scope_sufix).forEach(e=>e.value="");_resetSearch=()=>{document.querySelectorAll(".js-poncho-map-reset"+this.scope_sufix).forEach(e=>{e.onclick=e=>{e.preventDefault(),this._resetFormFilters(),this._filteredData(this.entries),this._clearSearchInput(),this.resetView()}})};filterChange=t=>document.querySelectorAll(".js-filters"+this.scope_sufix).forEach(e=>{e.onchange=t});checkUncheckFilters=()=>{document.querySelectorAll(this.scope_selector+" .js-select-items").forEach(t=>{t.onclick=e=>{e.preventDefault(),document.querySelectorAll(`${this.scope_selector} [id^=id__${t.dataset.field}]`).forEach(e=>{e.checked=parseInt(t.dataset.value)}),this._filteredData()}})};render=()=>{this._hiddenSearchInput(),this._resetViewButton(),0<this.filters.length&&(this._filterButton(),this._filterContainer(),this._createFilters(this.filters)),this.titleLayer.addTo(this.map),this._filteredData(),this._totalsInfo(),this.scroll&&this.hasHash()&&this.scrollCenter(),this.checkUncheckFilters(),this.filterChange(e=>{e.preventDefault(),this._filteredData()}),setTimeout(this.gotoHashedEntry,this.anchor_delay),this.filters_visible&&this._filterContainerHeight()}}class PonchoMapSearch{constructor(e,t){var s={scope:!1,placeholder:"Su búsqueda",search_fields:e.search_fields,sort:!0,sort_reverse:!1,sort_key:"text",datalist:!0},s=(this.instance=e,Object.assign({},s,t));this.text=e.title||!1,this.datalist=s.datalist,this.placeholder=s.placeholder,this.scope=s.scope,this.scope_sufix="--"+this.scope,this.sort=s.sort,this.sort_reverse=s.sort_reverse,this.search_scope_selector=this.scope?`[data-scope="${this.scope}"]`:"",this.instance.search_fields=s.search_fields,this.instance.accesible_menu_search=[{text:"Hacer una búsqueda",anchor:"#id-poncho-map-search"+this.scope_sufix}]}sortData=(e,a)=>{e=e.sort((e,t)=>{var s=e=>{this.instance.removeAccents(e).toUpperCase()};return s(e[a]),s(t[a]),s(e[a]),s(t[a]),0});return this.sort_reverse?e.reverse():e};_triggerSearch=()=>{const t=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input");t.id="id-poncho-map-search"+this.scope_sufix,document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__submit").forEach(e=>{e.onclick=e=>{e.preventDefault();document.querySelector("#js-search-input"+this.instance.scope_sufix).value=t.value;e=t.value;this._renderSearch(e)}})};_keyup=()=>{document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>{const t=document.querySelector("#js-search-input"+this.instance.scope_sufix);e.onkeyup=()=>{t.value=e.value},e.onkeydown=()=>{t.value=e.value}})};_placeHolder=()=>{if(!this.placeholder)return"";document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>e.placeholder=this.placeholder.toString())};_renderSearch=e=>{var t=this.instance._filterData();this.instance.markersMap(t),this.instance.slider&&(this.instance._renderSlider(),this.instance._clickeableFeatures(),this.instance._clickeableMarkers(),this.instance._clickToggleSlider()),this.instance.hash&&this.instance._urlHash(),this.instance.resetView(),1==t.length?this.instance.gotoEntry(t[0].properties[this.instance.id]):""!=e.trim()&&(this.instance.removeHash(),setTimeout(this.instance.fitBounds,this.instance.anchor_delay)),this.instance._helpText(t),this.instance._resetSearch(),this.instance._clickToggleFilter(),this.instance._setFetureAttributes(),this.instance._accesibleMenu()};_addDataListOptions=()=>{if(!this.datalist)return null;document.querySelectorAll(this.search_scope_selector+" .js-porcho-map-search__list,"+` ${this.search_scope_selector} .js-poncho-map-search__list`).forEach(s=>{s.innerHTML="";var e=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input"),t="id-datalist"+this.scope_sufix;e.setAttribute("list",t),s.id=t,this.instance.filtered_entries.forEach(e=>{var t;e.properties[this.text]&&s.appendChild((e=e.properties[this.text],(t=document.createElement("option")).value=e,t))})})};_searchRegion=()=>{var e=document.querySelector(this.search_scope_selector);e.setAttribute("role","region"),e.setAttribute("aria-label","Buscador")};render=()=>{this._placeHolder(),this._triggerSearch(),this._addDataListOptions(),this.instance.filterChange(e=>{e.preventDefault(),this.instance._filteredData(),this._addDataListOptions()}),this._searchRegion(),this._keyup(),this.instance._accesibleMenu()}}class GapiSheetData{constructor(e){e=Object.assign({},{gapi_key:"AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",gapi_uri:"https://sheets.googleapis.com/v4/spreadsheets/"},e);this.gapi_key=e.gapi_key,this.gapi_uri=e.gapi_uri}url=(e,t,s)=>{return["https://sheets.googleapis.com/v4/spreadsheets/",t,"/values/",e,"?key=",void 0!==s?s:this.gapi_key,"&alt=json"].join("")};json_data=e=>{e=this.feed(e);return{feed:e,entries:this.entries(e),headers:this.headers(e)}};feed=(e,o=!0)=>{const i=e.values[0],n=/ |\/|_/gi;let l=[];return e.values.forEach((e,t)=>{if(0<t){var s,a={};for(s in i){var r=e.hasOwnProperty(s)?e[s].trim():"";o?a[""+i[s].toLowerCase().replace(n,"")]=r:a[""+i[s].replace(n,"")]=r}l.push(a)}}),l};gapi_feed_row=(e,t="-",s=!0)=>{const a=s?"filtro-":"";s=Object.entries(e);let r={};return s.map(e=>{return r[e[0].replace("gsx$","").replace(a,"").replace(/-/g,t)]=e[1].$t}),r};entries=e=>e.filter((e,t)=>0<t);headers=e=>e.find((e,t)=>0==t)}class TranslateHTML{ATTRIBUTES=["title","placeholder","alt","value","href","src","lang"];constructor(e=[],t=[]){this.dictionary=e,this.attributes=t.length?t:this.ATTRIBUTES}translateAttributes=(e=!1)=>{const t=e||this.dictionary;this.attributes.forEach(s=>t.forEach(t=>document.querySelectorAll(`[${s}='${t[0]}']`).forEach(e=>e[s]=t[1])))};translateHTML=(s,a)=>{for(var e,t=document.evaluate("//*/text()",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[];e=t.iterateNext();)r.push(e);r.forEach(e=>{var t=e.textContent.replace(s,a);t!==e.textContent&&(t=document.createTextNode(t),e.parentNode.replaceChild(t,e))})};translate=()=>{this.dictionary.forEach(e=>{var t=new RegExp(e[0],"g");this.translateHTML(t,e[1])})}}
1
+ const ponchoColorDefinitionsList=[{description:"",name:"Azul",color:"#0072BB",code:"primary",alias:["azul","primary"]},{description:"Acción principal o exitosa",name:"Verde",color:"#2E7D33",code:"success",alias:["verde","success"]},{description:"Atención o peligro",name:"Rojo",color:"#C62828",code:"danger",alias:["rojo","danger"]},{description:"Foco o alerta",name:"Amarillo",color:"#F9A822",code:"warning",alias:["amarillo","warning"]},{description:"",name:"Celeste",color:"#2897D4",code:"info",alias:["celeste","info"]},{description:"Elementos básicos",name:"Negro",color:"#333333",code:"black",alias:["negro","black"]},{description:"Enlace visitado",name:"Uva",color:"#6A1B99",code:"uva",alias:["uva"]},{description:"Texto secundario (subtitulos)",name:"Gris",color:"#525252",code:"muted",alias:["gris","muted"]},{description:"Gris área",name:"Gris intermedio",color:"#F2F2F2",code:"gray",alias:["grisintermedio","gris-area","gray"]},{description:"Fondo footer/header",name:"Celeste Argentina",color:"#37BBED",code:"celeste-argentina",alias:["celesteargentina","celeste-argentina"]},{description:"",name:"Fucsia",color:"#EC407A",code:"fucsia",alias:["fucsia"]},{description:"",name:"Arándano",color:"#C2185B",code:"arandano",alias:["arandano"]},{description:"",name:"Cielo",color:"#039BE5",code:"cielo",alias:["cielo"]},{description:"",name:"Verdin",color:"#6EA100",code:"verdin",alias:["verdin"]},{description:"",name:"Lima",color:"#CDDC39",code:"lima",alias:["lima"]},{description:"",name:"Maiz",color:"#FFCE00",code:"maiz",alias:["maiz","maíz"]},{description:"",name:"Tomate",color:"#EF5350",code:"tomate",alias:["tomate"]},{description:"",name:"Naranja oscuro",color:"#EF6C00",code:"naranja",alias:["naranjaoscuro","naranja"]},{description:"",name:"Verde azulado",color:"#008388",code:"verde-azulado",alias:["verdeazulado","verde-azulado"]},{description:"",name:"Escarapela",color:"#2CB9EE",code:"escarapela",alias:["escarapela"]},{description:"",name:"Lavanda",color:"#9284BE",code:"lavanda",alias:["lavanda"]},{description:"",name:"Mandarina",color:"#F79525",code:"mandarina",alias:["mandarina"]},{description:"",name:"Palta",color:"#50B7B2",code:"palta",alias:["palta"]},{description:"",name:"Cereza",color:"#ED3D8F",code:"cereza",alias:["cereza"]},{description:"",name:"Limón",color:"#D7DF23",code:"limon",alias:["limon"]},{description:"",name:"Verde Jade",color:"#006666",code:"verde-jade",alias:["verdejade","verde-jade"]},{description:"",name:"Verde Aloe",color:"#4FBB73",code:"verde-aloe",alias:["verdealoe","verde-aloe"]},{description:"",name:"Verde Cemento",color:"#B4BEBA",code:"verde-cemento",alias:["verdecemento","verde-cemento"]}],colorVariations={high:["primary","verde-jade","success","naranja","danger","arandano","uva","celeste-argentina","palta","verdin","warning","tomate","fucsia","lavanda","black"],medium:["info","verde-azulado","verdin","warning","tomate","fucsia","lavanda","palta","lima","maiz","muted"]},ponchoColorDefinitions=t=>{return ponchoColorDefinitionsList.find(e=>e.alias.some(e=>null!=typeof t&&e==t))||!1},ponchoColor=e=>{var t="#99999";return"string"==typeof e&&(e=ponchoColorDefinitions(e))&&e.color||t},cleanUpHex=e=>{let t=e.toString().replace("#","").trim().toUpperCase();return!(t.length<3||6<t.length)&&"#"+(t=3==t.length?Array.from(t).map(e=>e.repeat(2)).join(""):t)},ponchoColorByHex=t=>ponchoColorDefinitionsList.find(e=>{return cleanUpHex(t)==cleanUpHex(e.color)});async function fetch_json(e,t={}){t=Object.assign({},{method:"GET",headers:{Accept:"application/json","Content-Type":"application/json"},redirect:"follow"},t),e=await fetch(e,t);if(e.ok)return e.json();throw new Error("HTTP error! status: "+e.status)}"undefined"!=typeof exports&&(module.exports={ponchoColorDefinitionsList:ponchoColorDefinitionsList,ponchoColorDefinitions:ponchoColorDefinitions,ponchoColor:ponchoColor,ponchoColorByHex:ponchoColorByHex,cleanUpHex:cleanUpHex});const replaceSpecialChars=e=>{if(!e)return"";var t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż",s="aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz";const a=t+t.toUpperCase(),r=s+s.toUpperCase();t=new RegExp(a.split("").join("|"),"g");return e.toString().replace(t,e=>r.charAt(a.indexOf(e)))},slugify=e=>{if(!e)return e;const t="àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìıİłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;";var s=new RegExp(t.split("").join("|"),"g");return e.toString().toLowerCase().replace(/\s+/g,"-").replace(s,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------".charAt(t.indexOf(e))).replace(/&/g,"-and-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},secureHTML=("undefined"!=typeof exports&&(module.exports={slugify:slugify,replaceSpecialChars:replaceSpecialChars}),(e,t=[])=>{var s;return!t.some(e=>"*"===e)&&(e=e.toString().replace(/</g,"&lt;").replace(/>/g,"&gt;"),0<t.length)?(s=new RegExp("&lt;("+t.join("|")+")(.*?)&gt;","g"),t=new RegExp("&lt;/("+t.join("|")+")(.*?)&gt;","g"),e.replace(s,"<$1$2>").replace(t,"</$1>")):e});function flattenNestedObjects(e){return e.map(e=>flattenObject(e,""))}function flattenObject(e,t){var s={};for(const i in e){var a=e[i],r=t?t+"__"+i:i;"object"==typeof a&&null!==a?Object.assign(s,flattenObject(a,r)):s[r]=a}return s}function ponchoTable(e){return ponchoTableLegacyPatch(),ponchoTableDependant(e)}"undefined"!=typeof exports&&(module.exports={secureHTML:secureHTML}),ponchoTableLegacyPatch=()=>{document.querySelectorAll("select[id=ponchoTableFiltro]").forEach(e=>{var e=e.parentElement,t=document.createElement("div");t.id="ponchoTableFiltro",t.classList.add("row"),e.parentElement.appendChild(t),e.remove()})};class PonchoAgenda{DATE_REGEX=/^([1-9]|0[1-9]|[1-2][0-9]|3[0-1])\/([1-9]|0[1-9]|1[0-2])\/([1-9][0-9]{3})$/;constructor(e={}){e.headers=this._refactorHeaders(e),e.headersOrder=this._refactorHeadersOrder(e),this.opts=Object.assign({},this.defaults,e),this.categoryTitleClassList=this.opts.categoryTitleClassList,this.itemContClassList=this.opts.itemContClassList,this.itemClassList=this.opts.itemClassList,this.groupCategory=this.opts.groupCategory,this.dateSeparator=this.opts.dateSeparator,this.startDateId=this.opts.startDateId,this.endDateId=this.opts.endDateId,this.timeId=this.opts.timeId,this.descriptionId=this.opts.descriptionId,this.criteriaOneId=this.opts.criteriaOneId,this.criteriaTwoId=this.opts.criteriaTwoId,this.criteriaThreeId=this.opts.criteriaThreeId}defaults={allowedTags:["strong","span","dl","dt","dd","img","em","button","button","p","div","h3","ul","li","time","a","h1"],criteriaOneId:"destinatarios",criteriaThreeId:"destacado",criteriaTwoId:"url",descriptionId:"descripcion",categoryTitleClassList:["h6","text-secondary"],itemContClassList:["list-unstyled"],itemClassList:["m-b-2"],dateSeparator:"/",filterStatus:{header:"Estado",nextDates:"Próximas",pastDates:"Anteriores"},endDateId:"hasta",groupCategory:"filtro-ministerio",rangeLabel:"Fechas",startDateId:"desde",timeId:"horario"};_refactorHeadersOrder=e=>{if(e.hasOwnProperty("headersOrder")&&0<e.headersOrder.length){var t=e.headersOrder;for(const s of["range","filtro-status"])e.headersOrder.includes(s)||e.headersOrder.push(s);return t}return[]};_header=e=>this.opts.headers.hasOwnProperty(e)?this.opts.headers[e]:e;_refactorHeaders=e=>{let t=this.defaults.filterStatus.header,s=(e?.filterStatus?.header&&(t=e.filterStatus.header),this.defaults.rangeLabel);return{range:s=e?.rangeLabel?e.rangeLabel:s,...e.headers,"filtro-status":t}};_isMarkdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_markdownOptions=()=>this._isMarkdownEnable()&&this.opts.hasOwnProperty("markdownOptions")&&"object"==typeof this.opts.markdownOptions?this.opts.markdownOptions:{};_markdownConverter=e=>{return this._isMarkdownEnable()?new showdown.Converter(this._markdownOptions()).makeHtml(e):e};_isPastDate=e=>{return!!this._isValidDateFormat(e)&&this._dateParser(e).date.getTime()<this._currentDate().date.getTime()};_dateTimeFormat=(e,t=!1)=>{var{day:e,month:s,year:a}=e;let r="";return[e,s,a].join(this.dateSeparator)+(r=t?[hours,minutes].join(":"):r)};_currentDate=()=>{var e=new Date,t=e.getFullYear(),s=e.getMonth()+1,e=e.getDate(),e=[this._pad(e),this._pad(s),t].join(this.dateSeparator);return{...this._dateParser(e),format:e}};_pad=(e,t=2)=>e.toString().padStart(t,"0");_dateParser=(e,t="00:00:00")=>{var s,a;if(this._isValidDateFormat(e))return[,e,s,a]=this.DATE_REGEX.exec(e),t=new Date(a+`-${s}-${e} `+t),{day:this._pad(e),month:this._pad(s),year:a,hours:this._pad(t.getHours()),minutes:this._pad(t.getMinutes()),date:t}};_isValidDateFormat=e=>{return null!==this.DATE_REGEX.exec(e)};_groupByFingerprintAndCategory=e=>{var t={};for(const r of e){var s=r[this.groupCategory],a=r["fingerprint"];t[a]||(t[a]={}),t[a][s]||(t[a][s]=[]),t[a][s].push(r)}return t};_refactorEntries=e=>{let d=[];return e.forEach(e=>{var t=e[this.startDateId];let s=e[this.endDateId];s=""===s.trim()?t:s;var{pastDates:a,nextDates:r}=this.opts.filterStatus,a=this._isPastDate(s)?a:r,r=this._dateParser(t),i=this._dateParser(s),o=r.date.getTime(),n=i.date.getTime(),l=[o,n].join("_");let c=this._dateTimeFormat(r);o!=n&&(c=`Del ${this._dateTimeFormat(r)} al `+this._dateTimeFormat(i));o={...e,range:c,"filtro-status":a,fingerprint:l,desde:t,hasta:s};d.push(o)}),d};itemTemplate=(e,t,s,a,r,i)=>{const o=document.createElement("dl");let n;return i?(r=this._dateParser(r,i),(n=document.createElement("time")).setAttribute("datetime",r.date.toISOString()),n.textContent=r.hours+":"+r.minutes+"hs."):(n=document.createElement("span")).textContent="--:--",[["Descripción",this._markdownConverter(e),!0,!0,"description"],[this._header(this.criteriaOneId),this._markdownConverter(t),!1,!0,"criteria-one"],[this._header(this.criteriaThreeId),this._markdownConverter(a),!1,!0,"criteria-three"],[this._header(this.criteriaTwoId),this._markdownConverter(s),!1,!0,"criteria-two"],[this._header(this.timeId),n.outerHTML,!1,!0,"time"]].forEach(e=>{var t,[e,s,a,r,i]=e;s&&((t=document.createElement("dt")).textContent=e,t.classList.add("agenda-item__dt","agenda-item__dt-"+i),a&&t.classList.add("sr-only"),(e=document.createElement("dd")).textContent=s,e.classList.add("agenda-item__dd","agenda-item__dd-"+i),r&&o.appendChild(t),o.appendChild(e))}),this.itemClassList.some(e=>e)&&o.classList.add("agenda-item",...this.itemClassList),o};_groupedEntries=e=>{let i=[];return Object.values(e).forEach(e=>{var r;Object.values(e).forEach(e=>{var t="",s="";const a=document.createElement("div");this.itemContClassList.some(e=>e)&&a.classList.add(...this.itemContClassList),e.forEach(e=>{s!=(r=e)[this.groupCategory]&&(s=r[this.groupCategory],t=document.createElement("p"),this.categoryTitleClassList.some(e=>e))&&(t.classList.add(...this.categoryTitleClassList),t.textContent=s,a.appendChild(t));var t=this.itemTemplate(e.descripcion,e.destinatarios,e.url,e.destacados,e.desde,e.horario);a.appendChild(t)}),t+=a.outerHTML,delete r.fingerprint;e={};e[this.descriptionId]=t,i.push({...r,...e})})}),i};_ponchoTableExists=()=>void 0!==ponchoTable;render=()=>{var e;this.opts.hasOwnProperty("jsonData")&&(e=this._refactorEntries(this.opts.jsonData),e=this._groupByFingerprintAndCategory(e),this.opts.jsonData=this._groupedEntries(e),this._ponchoTableExists())&&ponchoTable(this.opts)}}"undefined"!=typeof exports&&(module.exports=PonchoAgenda);const ponchoTableDependant=c=>{var p,h=[],u=!(!c.hasOwnProperty("wizard")||!c.wizard),d=c.hasOwnProperty("emptyLabel")&&c.emptyLabel?c.emptyLabel:"Todos",m={},s=!(!c.hasOwnProperty("orderFilter")||!c.orderFilter),f={},_=["*"];let e={tables:!0,simpleLineBreaks:!0,extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"]};document.querySelector("#ponchoTable").classList.add("state-loading"),jQuery.fn.DataTable.isDataTable("#ponchoTable")&&jQuery("#ponchoTable").DataTable().destroy();const y=(e,t)=>{return s?(t=t,e.toString().localeCompare(t.toString(),"es",{numeric:!0})):null},g=e=>[...new Set(e)],b=(e=0,t,s,a=!1)=>{var r=document.createElement("option");return r.value=s.toString().trim(),r.dataset.column=e,r.textContent=t.toString().trim(),a&&r.setAttribute("selected","selected"),r},v=(e="")=>e.toString().replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=e=>e<=0?0:e,x=()=>[...document.querySelectorAll("[data-filter]")].map(e=>e.value),E=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter")),a=()=>c.hasOwnProperty("markdownOptions")&&"object"===c.markdownOptions?c.markdownOptions:e,w=t=>{if("string"==typeof t){if(!E())return t;let e;return a().extensions.every(e=>{try{return showdown.extension(e),!0}catch(e){return!1}})?(e=new showdown.Converter(a())).makeHtml(t):(e=new showdown.Converter).makeHtml(t)}},k=(e,t)=>{var s=document.createElement("a");return s.setAttribute("aria-label",e),s.classList.add("btn","btn-primary","btn-sm","margin-btn"),s.target="_blank",s.href=t,s.textContent=e,s.setAttribute("rel","noopener noreferrer"),s.outerHTML},S=e=>{var t=e.split("/"),t=new Date(t[2],t[1]-1,t[0]).toISOString().split("T")[0],s=document.createElement("span"),a=(s.style.display="none",s.textContent=t,document.createElement("time"));return a.setAttribute("datetime",t),a.textContent=e,s.outerHTML+a.outerHTML},T=e=>replaceSpecialChars(e.toLowerCase()),n=(n,l,c)=>{l=l==h.length?l-1:l;const d=x();var e=p.entries.flatMap(e=>{t=n,s=e,a=c,r=d;var t,s,a,r,i=[...Array(C(t+1)).keys()].map(e=>s[h[C(t-1)]]==r[C(t-1)]&&s[h[C(t)]]==a||""==r[C(t-1)]).every(e=>e);if(e[h[C(l-1)]]==c&&i){const o=e[h[C(l)]];return L(l,m)?j(l).filter(e=>T(o).includes(T(e))):o}}).filter(e=>e),e=g(e);return e.sort(y),e},L=e=>{var t=Object.keys(m);return!!f.hasOwnProperty("filtro-"+t[e])},j=e=>{var t=Object.keys(m);return f.hasOwnProperty("filtro-"+t[e])?f["filtro-"+t[e]]:[]},r=(t,a)=>{var r=Object.keys(m);const i=x();for(let s=t+1;s<=r.length&&r.length!=s;s++){let e=n(t,s,a);0==e.length&&(e=((s,a,r)=>{var e=p.entries.flatMap(e=>{const t=e[h[C(a)]];return(e[h[C(s)]]==r||""==r)&&(L(a,m)?j(a).filter(e=>T(t).includes(T(e))):t)}).filter(e=>e),e=g(e);return e.sort(y),e})(t,s,a));const o=document.querySelector("#"+r[s]);o.innerHTML="",o.appendChild(b(s,d,"",!0)),e.forEach(e=>{var t;e.trim()&&(t=i[s]==e,o.appendChild(b(s,e,e,t)))})}},o=()=>{return window.location.hash.replace("#","")||!1},A=(_hideTable=(e=!0)=>{const t=e?"none":"block",s=e?"block":"none";document.querySelectorAll('[data-visible-as-table="true"],#ponchoTable_wrapper').forEach(e=>e.style.display=t),document.querySelectorAll('[data-visible-as-table="false"]').forEach(e=>e.style.display=s)},()=>{var e=jQuery.fn.DataTable.ext.type.search;e.string=e=>e?"string"==typeof e?replaceSpecialChars(e):e:"",e.html=e=>e?"string"==typeof e?replaceSpecialChars(e.replace(/<.*?>/g,"")):e:"";let d=jQuery("#ponchoTable").DataTable({initComplete:(e,t)=>{u&&_hideTable()},lengthChange:!1,autoWidth:!1,pageLength:c.cantidadItems,columnDefs:[{type:"html-num",targets:c.tipoNumero},{targets:c.ocultarColumnas,visible:!1}],ordering:c.orden,order:[[c.ordenColumna-1,c.ordenTipo]],dom:'<"row"<"col-sm-6"l><"col-sm-6"f>><"row"<"col-sm-12"i>><"row"<"col-sm-12"tr>><"row"<"col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8"p>>',language:{sProcessing:"Procesando...",sLengthMenu:"Mostrar _MENU_ registros",sZeroRecords:"No se encontraron resultados",sEmptyTable:"Ningún dato disponible en esta tabla",sInfo:"_TOTAL_ resultados",sInfoEmpty:"No hay resultados",sInfoFiltered:"",sInfoPostFix:"",sSearch:"Buscar:",sUrl:"",sInfoThousands:".",sLoadingRecords:"Cargando...",oPaginate:{sFirst:"<<",sLast:">>",sNext:">",sPrevious:"<"},oAria:{sSortAscending:": Activar para ordenar la columna de manera ascendente",sSortDescending:": Activar para ordenar la columna de manera descendente",paginate:{first:"Ir a la primera página",previous:"Ir a la página anterior",next:"Ir a la página siguiente",last:"Ir a la última página"}}}});jQuery("#ponchoTableSearch").keyup(function(){d.search(jQuery.fn.DataTable.ext.type.search.string(this.value)).draw()}),jQuery("#ponchoTable_filter").parent().parent().remove(),1<document.querySelectorAll("#ponchoTableFiltro option").length&&(document.querySelector("#ponchoTableFiltroCont").style.display="block");const h=e=>{e=document.querySelectorAll(e+" option");return Object.values(e).map(e=>e.value).some(e=>e)};if(jQuery("select[data-filter]").change(function(){var e=jQuery(this).find("option:selected").data("column"),t=jQuery(this).find("option:selected").val();r(e,t),d.columns().search("").columns().search("").draw();const i=Object.keys(m),o=x();if(o.forEach((e,t)=>{s=i[t];var s=Object.keys(p.headers).indexOf("filtro-"+s),a=v(o[t]),r=v(replaceSpecialChars(o[t]));L(t,m)?d.columns(s).search(T(o[t])):d.columns(s).search(o[t]?`^(${a}|${r})$`:"",!0,!1,!0)}),d.draw(),u){var[n,l=0,c=""]=[i,e,t];let r=!1;n.forEach((e,t)=>{var s=h("#"+e);let a="none";s&&c&&t<=l+1?a="block":s&&!c&&t<=l+1&&(document.querySelectorAll("#"+n[l+1]).forEach(e=>e.innerHTML=""),a="block",r=!1),document.querySelectorAll(`[data-filter-name="${e}"]`).forEach(e=>e.style.display=a)}),(r=h("#"+n[l])&&c&&!h("#"+n[l+1])?!0:r)?_hideTable(!1):_hideTable()}}),c.hasOwnProperty("hash")&&c.hash){e=o();const t=e?decodeURIComponent(e):"";document.querySelectorAll("#ponchoTableSearch").forEach(e=>{e.value=t,d.search(jQuery.fn.DataTable.ext.type.search.string(t)).draw()})}}),l=e=>{(p=e).entries="function"==typeof c.refactorEntries&&null!==c.refactorEntries?c.refactorEntries(p.entries):p.entries,p.headers=(c.hasOwnProperty("headers")&&c.headers?c:p).headers,p.headers=(e=>{if(c.hasOwnProperty("headersOrder")&&0<c.headersOrder.length){var t={};for(i of c.headersOrder)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}return e})(p.headers,c.headersOrder),h=Object.keys(p.headers).filter(e=>e.startsWith("filtro-")),f=c.asFilter?c.asFilter(p.entries):{},m=((r,i)=>{let o={};return i.forEach((t,s)=>{let e=[];e=f.hasOwnProperty(i[s])?f[i[s]]:r.entries.map(e=>e[t]);var a=g(e);a.sort(y),t=t.replace("filtro-",""),o[t]=[],a.forEach(e=>{o[t].push({columna:s,value:e})})}),o})(p,h),c.hasOwnProperty("filterContClassList")&&c.filterContClassList&&((e=document.getElementById("ponchoTableFiltroCont")).removeAttribute("class"),e.classList.add(...c.filterContClassList)),c.hasOwnProperty("searchContClassList")&&c.searchContClassList&&((e=document.getElementById("ponchoTableSearchCont")).removeAttribute("class"),e.classList.add(...c.searchContClassList));{var o=p;(e=document.querySelector("#ponchoTable thead")).innerHTML="";const a=document.createElement("tr"),t=(Object.keys(o.headers).forEach((e,t)=>{var s=document.createElement("th");s.textContent=o.headers[e],s.setAttribute("scope","col"),a.appendChild(s)}),e.appendChild(a),(e=document.querySelector("#ponchoTable caption")).innerHTML="",e.textContent=c.tituloTabla,document.querySelector("#ponchoTable tbody"));t.innerHTML="",o.entries.forEach((r,e)=>{if(Object.values(r).some(e=>String(e).trim())){r="function"==typeof c.customEntry&&null!==c.customEntry?c.customEntry(r):r;const i=t.insertRow();i.id="id_"+e,Object.keys(o.headers).forEach(e=>{let t=r[e];e.startsWith("btn-")&&""!=t?(s=e.replace("btn-","").replace("-"," "),t=k(s,t)):e.startsWith("fecha-")&&""!=t&&(t=S(t));var s=i.insertCell();s.dataset.title=o.headers[e],""==t&&(s.className="hidden-xs");let a=c.hasOwnProperty("allowedTags")?c.allowedTags:_;e.startsWith("btn-")&&""!=t?a=[...a,"a"]:e.startsWith("fecha-")&&""!=t&&(a=[...a,"span","time"]);e=secureHTML(t,a);E()?s.innerHTML=w(e):s.innerHTML=e})}})}{var n=p;const l=document.querySelector("#ponchoTableFiltro");l.innerHTML="",Object.keys(m).forEach((e,t)=>{const s=m[e][0].columna||0;var a=m[e].map(e=>e.value).sort(y),r=document.createElement("div"),i=(c.hasOwnProperty("filterClassList")?(i="string"==typeof c.filterClassList?c.filterClassList.split(" "):c.filterClassList,r.classList.add(...i)):(i=Math.floor(12/Object.keys(m).length),r.classList.add("col-sm-12","col-md-"+i)),r.dataset.index=t,r.dataset.filterName=e,u&&0<t&&(r.style.display="none"),document.createElement("div")),t=(i.className="form-group",document.createElement("label"));t.setAttribute("for",e),t.textContent=n.headers["filtro-"+e];const o=document.createElement("select");o.classList.add("form-control"),o.dataset.filter=1,o.name=e,o.id=e,o.appendChild(b(s,d,"",!0)),a.forEach(e=>{e&&o.appendChild(b(s,e,e,!1))}),i.appendChild(t),i.appendChild(o),r.appendChild(i),l.appendChild(r)})}document.querySelector("#ponchoTableSearchCont").style.display="block",document.querySelector("#ponchoTable").classList.remove("state-loading"),A()},t=e=>{jQuery.getJSON(e,function(e){var t=new GapiSheetData;p=t.json_data(e),l(p)})};if(c.jsonData){var O=Object.fromEntries(Object.keys(c.jsonData[0]).map(e=>[e,e])),O={entries:c.jsonData,headers:O};l(O)}else if(c.jsonUrl)t(c.jsonUrl);else if(c.hojaNombre&&c.idSpread){O=(new GapiSheetData).url(c.hojaNombre,c.idSpread);t(O)}else{if(!c.hojaNumero||!c.idSpread)throw"¡Error! No hay datos suficientes para crear la tabla.";{var I=c.hojaNumero;const P=new GapiSheetData;O=["https://sheets.googleapis.com/v4/spreadsheets/",c.idSpread,"/?alt=json&key=",P.gapi_key].join("");jQuery.getJSON(O,function(e){e=e.sheets[I-1].properties.title,e=P.url(e,c.idSpread);t(e)})}}};var content_popover=document.getElementById("content-popover");function popshow(){content_popover.classList.toggle("hidden")}function pophidde(){content_popover.classList.add("hidden")}var ponchoUbicacion=function(e){var s,a,r,i,t="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geoprovincias.json",o="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geolocalidades.json",n=jQuery('input[name="submitted['+e.provincia+']"]'),l=jQuery('input[name="submitted['+e.localidad+']"]');function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d(e,t,s,a=!1,r=!1,i=!1){var o=jQuery("<select></select>").attr("id",t).attr("name",e).addClass("form-control form-select").prop("required",a);return r&&o.append("<option value=''>Seleccione una opción</option>"),jQuery.each(s,function(e,t){let s="";i==t.nombre&&(s='selected="selected"'),o.append("<option value='"+t.id+"' "+s+">"+t.nombre+"</option>")}),o}function h(e,t){var s=l.prop("required");return n.val()?d("sLocalidades","sLocalidades",e.filter(function(e){return String(e.provincia.id)==String(t)}).map(function(e){return e.departamento.nombre&&(e.nombre=c(e.departamento.nombre.toLowerCase())+" - "+c(e.nombre.toLowerCase())),e}).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),s,emptyOption=!!l.val(),l.val()):d("sLocalidades","sLocalidades",[],s,!0,!1)}t=e.urlProvincias||t,o=e.urlLocalidades||o,jQuery.getJSON(t,function(e){var t;s=[],e.results.forEach(function(e,t){s.push(e)}),e=[],e=(t=s).sort(function(e,t){e=e.nombre.toUpperCase(),t=t.nombre.toUpperCase();return e.localeCompare(t)}),t=n.prop("required"),(r=d("sProvincias","sProvincias",e,t,!0,n.val())).on("change",function(e){var t;n.val(""),l.val(""),i.children("option:not(:first)").remove(),""!=r.val()&&(n.val(r.find(":selected").text()),t=h(a,r.val()).find("option"),i.append(t),i.val(""))}),n.after(r),jQuery(r).select2()}),jQuery.getJSON(o,function(e){a=[],e.results.forEach(function(e,t){a.push(e)}),(i=h(a,r.val())).on("change",function(e){l.val(""),""!=i.val()&&l.val(i.find(":selected").text())}),l.after(i),jQuery(i).select2()}),n.hide(),l.hide()};function ponchoChart(t){"use strict";var e;function _e(e){var t={Line:"line",Bar:"bar",Pie:"pie",Area:"line","Horizontal Bar":"horizontalBar","Stacked Bar":"bar",Mixed:"mixed",HeatMap:"heatmap",default:""};return t[e]||t.default}function ye(e){var e=e.toString().replace(".",","),t=e.split(","),s=new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(t[0]);return e=1<t.length?s.concat(",",t[1].substr(0,2)):s}function s(e,a){var F,t,s,q,r,i,H,B,z,o,n,N,G,l,c,R,U,$,d,h,V,p,Q,u,J,m,f=[],_=[],y=[],Z=[],g=[],b=[],v=[],C=[],x=0,E="",W=[],w=0,k=[],Y=[],X=0,S=a.posicionLeyendas||"top",T="",T=void 0===a.mostrarLeyendas||a.mostrarLeyendas,L="",L=void 0===a.mostrarTotalStacked||a.mostrarTotalStacked,j=_e(a.tipoGrafico),A=e.values;if(jQuery.each(Object.keys(A[0]),function(e,t){var s;"eje-y"==A[0][e].substr(0,5)?(s=(s=A[0][e].split("-"))[0]+s[1],_.push(s),y.push(e)):"nombre-corto"==A[0][e]&&"heatmap"==j&&(X=e)}),jQuery.each(A,function(r,e){var a;0==r&&jQuery.each(y,function(e,t){var s=A[r][y[e]].split("-"),a=s[0]+s[1];v[a]=[],Z.push(s[2]),"mixed"==j&&(3<s.length&&("barra"==s[3]||"linea"==s[3])?W.push(s[3]):(0==e&&W.push("barra"),1==e&&W.push("linea")))}),1==r&&jQuery.each(y,function(e,t){"pie"==j||"heatmap"==j?f.push(A[r][y[e]]):(b.push(A[r][y[e]]),x+=1)}),1<r&&(a=!1,jQuery.each(y,function(e,t){var s=A[0][y[e]].split("-"),s=s[0]+s[1];"pie"==j?v[s].push(A[r][y[e]]):"heatmap"==j?(0==a&&(b.push(A[r][0]),a=!0,x+=1),e!=X&&v[s].push(A[r][y[e]]),e+2==X&&(void 0===A[r][e+2]?Y.push("*"):Y.push(A[r][e+2]))):(0==a&&(f.push(A[r][0]),a=!0),v[s].push(A[r][y[e]]))}))}),"pie"==j?(F=[],jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&F.push(v[e])}),C=F):1==x&&jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e])}),"mixed"==j&&0<(t=a.porcentajesMixed||"").length&&(k=t.split(",")),E=1==a.porcentajes?"line"==j&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}},mode:"index",intersect:!1}:"pie"==j?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s+"%"}}}:"Stacked Bar"==a.tipoGrafico?1==L?{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s+"%"}}}:"line"==j&&1<x?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}},mode:"index",intersect:!1}:"pie"==j?{enabled:!0,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.labels[e.index]+": "+s}}}:"Stacked Bar"==a.tipoGrafico&&1<x?1==L?{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s},footer:(e,t)=>{e=e.reduce((e,t)=>e+parseFloat(t.yLabel),0);return"Total: "+new Intl.NumberFormat("es-AR",{maximumFractionDigits:2}).format(e)}}}:{enabled:!0,mode:"index",intersect:!1,callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}}:{enabled:!0,mode:"index",callbacks:{label:function(e,t){var s=ye(t.datasets[e.datasetIndex].data[e.index]);return t.datasets[e.datasetIndex].label+": "+s}}},"pie"==j&&(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),t=f,L=C,z=j,o=g,s=a.idComponenteGrafico,N=S,G=E,n=T,s=document.getElementById(s),new Chart(s,{type:z,data:{labels:t,datasets:[{data:L,borderColor:o,backgroundColor:o,borderWidth:2}]},options:{legend:{display:n,position:N},responsive:!0,tooltips:G}})),1==x&&(s=ponchoColor(Z[0]),"Line"==a.tipoGrafico&&(z=f,L=C,o=j,n=s,N=b[0],G=a.ejeYenCero,l=a.idComponenteGrafico,c=S,R=E,U=T,l=document.getElementById(l),new Chart(l,{type:o,data:{labels:z,datasets:[{data:L,borderColor:n,backgroundColor:n,borderWidth:2,lineTension:0,fill:!1,label:N}]},options:{legend:{display:U,position:c},tooltips:R,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:G}}]}}})),"bar"!=j&&"Area"!=a.tipoGrafico||(l=f,L=C,U=j,c=s,R=b[0],q=a.ejeYenCero,r=a.idComponenteGrafico,i=S,H=E,B=T,r=document.getElementById(r),new Chart(r,{type:U,data:{labels:l,datasets:[{data:L,borderColor:c,backgroundColor:c,borderWidth:2,lineTension:0,label:R}]},options:{legend:{display:B,position:i},tooltips:H,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:q}}]}}})),"horizontalBar"==j)&&(r=f,L=C,B=j,i=s,H=b[0],q=a.ejeYenCero,O=a.idComponenteGrafico,re=S,ie=E,ee=T,O=document.getElementById(O),new Chart(O,{type:B,data:{labels:r,datasets:[{data:L,borderColor:i,backgroundColor:i,borderWidth:2,lineTension:0,label:H}]},options:{legend:{display:ee,position:re},tooltips:ie,responsive:!0,scales:{xAxes:[{ticks:{beginAtZero:q}}]}}})),1<x)if("heatmap"==j)if(void 0!==a.heatMapColors&&""!=a.heatMapColors&&void 0!==a.heatMapColorsRange&&""!=a.heatMapColorsRange){for(var K=[],O="labelFila",L="labelColumna",ee="labelValor",te=(void 0!==a.datosTooltip&&0<a.datosTooltip.length&&(void 0!==a.datosTooltip[0]&&void 0!==a.datosTooltip[0].labelFila&&(O=a.datosTooltip[0].labelFila),void 0!==a.datosTooltip[1]&&void 0!==a.datosTooltip[1].labelColumna&&(L=a.datosTooltip[1].labelColumna),void 0!==a.datosTooltip[2])&&void 0!==a.datosTooltip[2].labelValor&&(ee=a.datosTooltip[2].labelValor),jQuery.each(Object.keys(_),function(e,t){e=_[e];v.hasOwnProperty(e)&&(C=v[e],K.push(C))}),[]),I=0;I<b.length;I++){for(var e=[],se=0;se<f.length;se++){C={x:f[se],y:parseInt(K[se][I])};e.push(C)}te.push({name:("*"!=Y[I]?Y:b)[I],data:e})}for(var ae=[],I=0;I<a.heatMapColorsRange.length-1;I++){e={from:a.heatMapColorsRange[I],to:a.heatMapColorsRange[I+1],color:ponchoColor(a.heatMapColors[I])};ae.push(e)}var re="",re=void 0===a.mostrarEjeY||a.mostrarEjeY,ie=te,oe=a.idComponenteGrafico,ne=b,le=ae,ce=O,de=L,he=ee,L=a.tituloGrafico,P=re,pe=S,ue=T,oe=document.getElementById(oe),me=(new ApexCharts(oe,{series:ie,chart:{height:650,type:"heatmap"},dataLabels:{enabled:!1},title:{text:L},tooltip:{custom:function({series:e,seriesIndex:t,dataPointIndex:s,w:a}){e=ye(e[t][s]);return'<div class="arrow_box"><span>'+ce+": "+ne[t]+"<br>"+de+": "+a.globals.labels[s]+"<br>"+he+": "+e+"</span></div>"}},plotOptions:{heatmap:{shadeIntensity:.5,radius:0,useFillColorAsStroke:!1,colorScale:{ranges:le}}},yaxis:{show:P},legend:{show:ue,position:pe},responsive:[{breakpoint:1e3,options:{yaxis:{show:!1},legend:{show:ue,position:"top"}}}]}).render(),document.getElementsByClassName("apexcharts-toolbar"));for(let e=0;e<me.length;e++)me[e].style.display="none"}else void 0!==a.heatMapColors&&a.heatMapColors,void 0!==a.heatMapColorsRange&&a.heatMapColorsRange;else{var M=[],D=0,fe=(Z.forEach(function(e,t,s){g.push(ponchoColor(e))}),0);jQuery.each(Object.keys(_),function(e,t){var s,e=_[e];v.hasOwnProperty(e)&&(C=v[e],"Line"==a.tipoGrafico?s={label:b[D],data:C,borderColor:g[D],fill:!1,borderWidth:2,lineTension:0,backgroundColor:g[D]}:"Bar"==a.tipoGrafico||"Area"==a.tipoGrafico||"Horizontal Bar"==a.tipoGrafico||"Stacked Bar"==a.tipoGrafico?s={label:b[D],data:C,borderColor:g[D],backgroundColor:g[D],borderWidth:2,lineTension:0}:"Mixed"==a.tipoGrafico&&("barra"==(e=W[fe])?s={label:b[D],data:C,backgroundColor:g[D],yAxisID:"left-y-axis",type:"bar"}:"linea"==e&&(s={label:b[D],data:C,borderColor:g[D],backgroundColor:g[D],type:"line",yAxisID:"right-y-axis",fill:!1})),M.push(s),D+=1,fe+=1)}),"mixed"==j&&(2==k.length?w=2:1==k.length?"eje-y1"==k[0]?w=0:"eje-y2"==k[0]&&(w=1):w=3),"Stacked Bar"==a.tipoGrafico?(oe=f,L=j,le=M,P=a.idComponenteGrafico,pe=a.ejeYenCero,ue=S,k=E,J=T,P=document.getElementById(P),new Chart(P,{type:L,data:{labels:oe,datasets:le},options:{legend:{display:J,position:ue,labels:{textAlign:"center"}},tooltips:k,responsive:!0,scales:{yAxes:[{ticks:{beginAtZero:pe},stacked:!0}],xAxes:[{stacked:!0}]}}})):"Mixed"==a.tipoGrafico?(L=f,J="bar",k=M,d=a.idComponenteGrafico,h=a.ejeYenCero,V=S,p=w,w=b[0],Q=b[1],u=T,d=document.getElementById(d),new Chart(d,{type:J,data:{labels:L,datasets:k},options:{legend:{display:u,position:V,labels:{textAlign:"center"}},tooltips:{enabled:!0,mode:"single",callbacks:{label:function(e,t){var s="",a=((2==p||e.datasetIndex==p)&&(s="%"),ye(e.yLabel));return t.datasets[e.datasetIndex].label+": "+a+" "+s}}},responsive:!0,scales:{yAxes:[{id:"left-y-axis",type:"linear",position:"left",ticks:{beginAtZero:h,callback:function(e){return e+(1!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:Q,fontColor:"black"}},{id:"right-y-axis",type:"linear",position:"right",ticks:{beginAtZero:h,callback:function(e){return e+(0!=p&&2!=p?"":"%")}},scaleLabel:{display:!0,labelString:w,fontColor:"black"}}]}}})):"Horizontal Bar"==a.tipoGrafico?(d=f,L=j,k=M,u=a.idComponenteGrafico,V=a.ejeYenCero,Q=S,h=E,w=T,u=document.getElementById(u),new Chart(u,{type:L,data:{labels:d,datasets:k},options:{legend:{display:w,position:Q,labels:{textAlign:"center"}},tooltips:h,responsive:!0,maintainAspectRatio:!0,scales:{xAxes:[{ticks:{beginAtZero:V}}]}}})):(L=f,k=j,w=M,m=a.idComponenteGrafico,$=a.ejeYenCero,S=S,E=E,T=T,m=document.getElementById(m),new Chart(m,{type:k,data:{labels:L,datasets:w},options:{legend:{display:T,position:S,labels:{textAlign:"center"}},tooltips:E,responsive:!0,maintainAspectRatio:!0,scales:{yAxes:[{ticks:{beginAtZero:$}}]}}}))}""!=a.tituloGrafico&&void 0!==a.tituloGrafico&&(m=a.idTagTituloGrafico,k=a.tituloGrafico,document.getElementById(m))&&(document.getElementById(m).innerHTML=k)}!function(e){var t=!1;(e.idSpread&&e.hojaNombre||e.jsonUrl||e.jsonInput)&&void 0!==e.tipoGrafico&&""!=e.tipoGrafico&&void 0!==e.idComponenteGrafico&&""!=e.idComponenteGrafico&&""!=_e(e.tipoGrafico)&&(t=!0);return t}(t)?(void 0!==t.idSpread&&t.idSpread,void 0!==t.hojaNombre&&t.hojaNombre,void 0!==t.tipoGrafico&&t.tipoGrafico,void 0!==t.idComponenteGrafico&&t.idComponenteGrafico,_e(t.tipoGrafico)):t.jsonInput?s(jQuery.parseJSON(t.jsonInput),t):(e=t.jsonUrl||"https://sheets.googleapis.com/v4/spreadsheets/"+t.idSpread+"/values/"+t.hojaNombre+"?alt=json&key=AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",jQuery.getJSON(e,function(e){s(e,t)}))}const gapi_legacy=e=>{if(!e||!e.values||0===e.values.length)throw new TypeError("Invalid response format");if(!Array.isArray(e.values)||!Array.isArray(e.values[0]))throw new TypeError("Invalid response format: values should be arrays");const i=e.values[0],o=/ |\/|_/gi;let n=[];return e.values.forEach((e,t)=>{if(0<t){var s={};for(const r in i){var a=e.hasOwnProperty(r)?e[r].trim():"";s["gsx$"+i[r].toLowerCase().replace(o,"")]={$t:a}}n.push(s)}}),{feed:{entry:n}}};"undefined"!=typeof exports&&(module.exports=gapi_legacy);class PonchoMap{constructor(e,t){var s={error_reporting:!0,no_info:!1,title:!1,id:"id",id_mixing:[],template:!1,template_structure:{container_classlist:["info-container"],definition_classlist:[],definition_list_classlist:["definition-list"],definition_list_tag:"dl",definition_tag:"dd",term_classlist:["h6","m-b-0"],term_tag:"dt",title_classlist:["h4","pm-color-primary","m-t-0"]},fit_bounds_onevent:!0,allowed_tags:[],template_innerhtml:!1,template_markdown:!1,theme_ui:!1,theme_map:!1,theme_tool:!0,map_opacity:1,map_background:"#DDD",theme:"default",default_themes:[["default","Original"],["contrast","Alto contraste"],["dark","Oscuro"],["grayscale","Gris"],["relax","Relax"]],markdown_options:{extensions:["details","images","alerts","numbers","ejes","button","target","bootstrap-tables","video"],simpleLineBreaks:!0,tables:!0},render_slider:!0,scope:"",slider:!1,scroll:!1,hash:!1,headers:{},header_icons:[],content_selector:!1,map_selector:"map",anchor_delay:0,slider_selector:".slider",map_view:[-40.44,-63.59],map_anchor_zoom:16,map_zoom:4,min_zoom:2,map_init_options:{},reset_zoom:!0,latitud:"latitud",longitud:"longitud",marker:"azul",tooltip:!1,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[13,-18],sticky:!1,opacity:1},marker_cluster_options:{spiderfyOnMaxZoom:!0,showCoverageOnHover:!1,zoomToBoundsOnClick:!0,maxClusterRadius:30,spiderfyDistanceMultiplier:.5,spiderLegPolylineOptions:{weight:1,color:"#666666",opacity:.5,"fill-opacity":.5}},accesible_menu_extras:[{text:"Ayudá a mejorar el mapa",anchor:"https://www.argentina.gob.ar/sugerencias"}]},a=Object.assign({},s,t);this.error_reporting=a.error_reporting,this.scope=a.scope,this.render_slider=a.render_slider,this.template=a.template,this.template_structure={...s.template_structure,...t.template_structure},this.template_innerhtml=a.template_innerhtml,this.template_markdown=a.template_markdown,this.markdown_options=a.markdown_options,this.allowed_tags=a.allowed_tags,this.map_selector=a.map_selector,this.headers=this.setHeaders(a.headers),this.header_icons=a.header_icons,this.hash=a.hash,this.scroll=a.scroll,this.fit_bounds_onevent=a.fit_bounds_onevent,this.map_view=a.map_view,this.map_init_options=a.map_init_options,this.anchor_delay=a.anchor_delay,this.map_zoom=a.map_zoom,this.min_zoom=a.min_zoom,this.map_anchor_zoom=a.map_anchor_zoom,this.tooltip_options=a.tooltip_options,this.tooltip=a.tooltip,this.marker_cluster_options=a.marker_cluster_options,this.marker_color=a.marker,this.id=a.id,this.id_mixing=a.id_mixing,this.title=a.title,this.map_background=a.map_background,this.theme=a.theme,this.theme_tool=a.theme_tool,this.default_themes=a.default_themes,this.temes_not_visibles=[["transparent","Transparent"]],this.theme_ui=a.theme_ui,this.theme_map=a.theme_map,this.map_opacity=a.map_opacity,this.latitude=a.latitud,this.longitude=a.longitud,this.slider=a.slider,this.no_info=a.no_info,this.reset_zoom=a.reset_zoom,this.slider_selector=this._selectorName(a.slider_selector),this.selected_marker,this.scope_selector=`[data-scope="${this.scope}"]`,this.scope_sufix="--"+this.scope,this.content_selector=a.content_selector||".js-content"+this.scope_sufix,this.content_outside=this.content_selector!==".js-content"+this.scope_sufix,this.data=this.formatInput(e),this.geometryTypes=["Point","LineString","Polygon","MultiPoint","MultiLineString"],this.featureStyle={stroke:"dodgerblue","stroke-opacity":1,"stroke-width":2,"fill-opacity":.5},this.accesible_menu_search=[],this.accesible_menu_filter=[],this.accesible_menu_extras=a.accesible_menu_extras,this.geojson,this.map=new L.map(this.map_selector,{renderer:L.svg(),...this.map_init_options}).setView(this.map_view,this.map_zoom),this.titleLayer=new L.tileLayer("https://mapa-ign.argentina.gob.ar/osm/{z}/{x}/{-y}.png",{attribution:'Contribuidores: <a href="https://www.ign.gob.ar/AreaServicios/Argenmap/Introduccion" target="_blank">Instituto Geográfico Nacional</a>, <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>'}),this.markers=new L.markerClusterGroup(this.marker_cluster_options),this.ponchoLoaderTimeout}mapOpacity=(e=!1)=>{const t=e||this.map_opacity;document.querySelectorAll(this.scope_selector+" .leaflet-pane .leaflet-tile-pane").forEach(e=>e.style.opacity=t)};mapBackgroundColor=(e=!1)=>{const t=e||this.map_background;document.querySelectorAll(this.scope_selector+" .leaflet-container").forEach(e=>e.style.backgroundColor=t)};_menuTheme=()=>{if(this.theme_tool){document.querySelectorAll("#themes-tool"+this.scope_sufix).forEach(e=>e.remove());const r=document.createElement("ul");r.classList.add("pm-list-unstyled","pm-list","pm-tools","js-themes-tool"+this.scope_sufix);var e=document.createElement("li"),t=(e.setAttribute("tabindex","-1"),e.dataset.toggle="true",document.createElement("i")),s=(t.setAttribute("aria-hidden","true"),t.classList.add("pmi","pmi-adjust"),document.createElement("button"));s.title="Cambiar tema",s.tabIndex="0",s.classList.add("pm-btn","pm-btn-rounded-circle"),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre el panel de temas");const i=document.createElement("ul");i.classList.add("pm-container","pm-list","pm-list-unstyled","pm-p-1","pm-caret","pm-caret-b","pm-toggle");var t=document.createElement("button"),a=(t.textContent="Restablecer",t.classList.add("pm-item-link","js-reset-theme"),document.createElement("li"));a.classList.add("pm-item-separator"),a.appendChild(t),i.appendChild(a),this.default_themes.map(e=>e[0]).forEach((e,t)=>{var s=document.createElement("button"),e=(s.dataset.theme=e,s.textContent=this.default_themes[t][1],s.classList.add("js-set-theme","pm-item-link"),document.createElement("li"));e.appendChild(s),i.appendChild(e)}),e.appendChild(s),e.appendChild(i),r.appendChild(e),document.querySelectorAll(this.scope_selector).forEach(e=>e.appendChild(r)),document.querySelectorAll(".js-reset-theme").forEach(e=>e.addEventListener("click",()=>{localStorage.removeItem("mapTheme"),this._removeThemes(),this._setThemes()})),document.querySelectorAll(".js-set-theme").forEach(t=>t.addEventListener("click",()=>{var e=t.dataset.theme;this.useTheme(e),localStorage.setItem("mapTheme",e)}))}};_setThemeStyles=(t=!1,e=["ui","map"])=>e.map(e=>!!["ui","map"].includes(e)&&e+"-"+t);_removeThemes=(s=["ui","map"])=>{document.querySelectorAll(this.scope_selector).forEach(t=>{[...this.default_themes,...this.temes_not_visibles].map(e=>e[0]).forEach(e=>{t.classList.remove(...this._setThemeStyles(e,s))})})};_setTheme=(t,s)=>{var e=document.querySelectorAll(this.scope_selector);this._removeThemes(s),e.forEach(e=>{e.classList.add(...this._setThemeStyles(t,s))})};useTheme=(e=!1)=>{e=e||this.theme;this._setTheme(e,["ui","map"])};useMapTheme=e=>this._setTheme(e,["map"]);useUiTheme=e=>this._setTheme(e,["ui"]);_setThemes=()=>{localStorage.hasOwnProperty("mapTheme")?this._setTheme(localStorage.getItem("mapTheme"),["ui","map"]):this.theme_ui||this.theme_map?(this.theme_ui&&this._setTheme(this.theme_ui,["ui"]),this.theme_map&&this._setTheme(this.theme_map,["map"])):this.useTheme()};_slugify=e=>slugify(e);isGeoJSON=e=>"FeatureCollection"===e?.type;get entries(){return this.data.features}get geoJSON(){return this.featureCollection(this.entries)}formatInput=e=>{e.length<1&&this.errorMessage("No se puede visualizar el mapa, el documento está vacío","warning");let t;return t=this.isGeoJSON(e)?e:(e=this.features(e),this.featureCollection(e)),this._setIdIfNotExists(t)};errorMessage=(e=!1,t="danger")=>{document.querySelectorAll("#js-error-message"+this.scope_sufix).forEach(e=>e.remove());const s=document.createElement("div");s.id="js-error-message"+this.scope_sufix,s.classList.add("poncho-map--message",t);var a=document.createElement("i"),r=(a.classList.add("icono-arg-mapa-argentina","poncho-map--message__icon"),document.createElement("h2"));r.classList.add("h6","title","pm-visually-hidden"),r.textContent="¡Se produjo un error!",s.appendChild(a),s.appendChild(r);throw[["En estos momentos tenemos inconvenientes para mostrar el mapa.","text-center"],["<em>Disculpe las molestias</em>","text-center","p"]].forEach(e=>{var t=document.createElement(void 0!==(t=e[2])||t?t:"p");void 0===e[1]&&!e[1]||(t.className=e[1]),t.innerHTML=e[0],s.appendChild(t)}),this.error_reporting&&((a=document.querySelector(this.scope_selector+".poncho-map")).parentNode.insertBefore(s,a),"danger"==t)&&document.getElementById(this.map_selector).remove(),e};feature=e=>{var t=e[this.latitude],s=e[this.longitude];return[t,s].forEach(e=>{isNaN(Number(e))&&this.errorMessage("El archivo contiene errores en la definición de latitud y longitud.\n "+e)}),delete e[this.latitude],delete e[this.longitude],{type:"Feature",properties:e,geometry:{type:"Point",coordinates:[s,t]}}};featureCollection=e=>({type:"FeatureCollection",features:e});features=e=>e.map(this.feature);_isIdMixing=()=>Array.isArray(this.id_mixing)&&0<this.id_mixing||"function"==typeof this.id_mixing;_idMixing=t=>{var e;if(this._isIdMixing())return"function"==typeof this.id_mixing?this.id_mixing(this,t).join(""):(e=this.id_mixing.map(e=>t.properties[e]?t.properties[e].toString():e),this._slugify(e.join("-")))};_setIdIfNotExists=e=>{var t=e.features.filter((e,t)=>0===t).every(e=>e.properties.hasOwnProperty("id"));return!this._isIdMixing()&&t||(t=e.features.map((e,t)=>{var s;return this._isIdMixing()?e.properties.id=this._idMixing(e):(t=t+1,s=this.title&&e.properties[this.title]?this._slugify(e.properties[this.title]):"",e.properties.id=[t,s].filter(e=>e).join("-")),e}),e.features=t),e};addHash=e=>{"string"!=typeof e&&!e||!this.hash||this.no_info||(window.location.hash="#"+e)};entry=t=>this.entries.find(e=>!(!e?.properties||e.properties[this.id]!==t||"n"===e.properties?.["pm-interactive"]));searchEntries=(t,e)=>{return e=void 0===e?this.geoJSON:e,t?e.filter(e=>{if(this.searchEntry(t,e.properties))return e}):e};searchEntry=(e,t)=>{for(const r of[...new Set([this.title,...this.search_fields])].filter(e=>e))if(t.hasOwnProperty(r)){var s=replaceSpecialChars(e).toUpperCase(),a=replaceSpecialChars(t[r]).toString().toUpperCase();try{if(a.includes(s))return t}catch(e){}}return null};_selectorName=e=>e.replace(/^(\.|\#)/,"");scrollCenter=()=>{var e=document.getElementById(this.map_selector),t=e.getBoundingClientRect(),e=(e.offsetLeft+e.offsetWidth)/2,t=t.top+window.scrollY;window.scrollTo({top:t,left:e,behavior:"smooth"})};_clearContent=()=>document.querySelector(".js-content"+this.scope_sufix).innerHTML="";toggleSlider=()=>{this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.toggle(this.slider_selector+"--in")}),document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.style.display=this.isSliderOpen()?"block":"none"}))};_focusOnFeature=t=>{this.map.eachLayer(e=>{e?.options?.id==t&&(e?._path?e._path.focus():e?._icon&&e._icon.focus())})};_clickToggleSlider=()=>document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>e.addEventListener("click",()=>{this._clearContent(),this.toggleSlider(),this._focusOnFeature(e.dataset.entryId)}));isSliderOpen=()=>{let t=[];return document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>{e.classList.contains(this.slider_selector+"--in")&&t.push(!0)}),t.some(e=>e)};setContent=t=>{if(!this.no_info){this._focusOnSlider(),this.isSliderOpen()||this.toggleSlider();const s="function"==typeof this.template?this.template(this,t):this.defaultTemplate(this,t);document.querySelectorAll(this.content_selector).forEach(e=>{e.innerHTML=s}),document.querySelectorAll(".js-close-slider"+this.scope_sufix).forEach(e=>{e.dataset.entryId=t[this.id]})}};_focusOnSlider=()=>{var e;this.no_info||(this.isSliderOpen()?document.querySelector(".js-close-slider"+this.scope_sufix).focus():(e=document.querySelector(".js-slider"+this.scope_sufix))&&e.addEventListener("animationend",()=>{document.querySelector(".js-close-slider"+this.scope_sufix).focus()}))};setHeaders=e=>{var t;return[this.template_structure,this.template_structure.mixing].every(e=>e)?(t=this.template_structure.mixing.reduce((e,t)=>{if([t.key].every(e=>e))return{...e,[t.key]:t.header||""}},{}),{...e,...t}):e};header=e=>this.headers.hasOwnProperty(e)?this.headers[e]:e;_renderSlider=()=>{var e,t,s,a;!this.render_slider||this.content_outside||this.no_info||(document.querySelectorAll(".js-slider"+this.scope_sufix).forEach(e=>e.remove()),(e=document.createElement("button")).classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-slider"+this.scope_sufix),e.title="Cerrar panel",e.setAttribute("role","button"),e.setAttribute("aria-label","Cerrar panel de información"),e.innerHTML='<span class="pm-visually-hidden">Cerrar</span>✕',(t=document.createElement("a")).setAttribute("tabindex",0),t.id="js-anchor-slider"+this.scope_sufix,(s=document.createElement("div")).classList.add("content-container"),(a=document.createElement("div")).classList.add("content","js-content"+this.scope_sufix),a.tabIndex=0,s.appendChild(a),(a=document.createElement("div")).style.display="none",a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de información"),a.classList.add("pm-container","slider","js-slider"+this.scope_sufix),a.id="slider"+this.scope_sufix,a.appendChild(e),a.appendChild(t),a.appendChild(s),document.querySelector(this.scope_selector+".poncho-map").appendChild(a))};_removeTooltips=()=>{let t=this;this.map.eachLayer(function(e){"tooltipPane"===e.options.pane&&e.removeFrom(t.map)})};_showSlider=e=>{this._removeTooltips(),e.hasOwnProperty("_latlng")?this.map.setView(e._latlng,this.map_anchor_zoom):this.fit_bounds_onevent&&this.map.fitBounds(e.getBounds().pad(.005)),e.fireEvent("click")};_showPopup=e=>{e.hasOwnProperty("_latlng")?this.markers.zoomToShowLayer(e,()=>{e.openPopup()}):(this.map.fitBounds(e.getBounds().pad(.005)),e.openPopup())};removeHash=()=>history.replaceState(null,null," ");hasHash=()=>{return window.location.hash.replace("#","")||!1};gotoHashedEntry=()=>{var e=this.hasHash();e&&this.gotoEntry(e)};gotoEntry=t=>{const s=this.entry(t),a=(e,t,s)=>{e.options.hasOwnProperty("id")&&e.options.id==t&&(this._setSelectedMarker(t,e),this.hash&&this.addHash(t),this.slider?this._showSlider(e,s):this._showPopup(e))};this.markers.eachLayer(e=>a(e,t,s)),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&a(e,t,s)})};_setClickeable=s=>{s.on("keypress click",t=>{document.querySelectorAll(".marker--active").forEach(e=>e.classList.remove("marker--active")),["_icon","_path"].forEach(e=>{t.sourceTarget.hasOwnProperty(e)&&t.sourceTarget[e].classList.add("marker--active")});var e=this.entries.find(e=>e?.properties&&e.properties[this.id]===s.options.id);this.setContent(e.properties)})};isFeature=e=>!!e.hasOwnProperty("feature");_clickeableFeatures=()=>{this.reset_zoom&&this.map.eachLayer(e=>{this.isFeature(e)&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&"n"!=e?.feature?.properties["pm-interactive"]&&this._setClickeable(e)})};_clickeableMarkers=()=>{this.no_info||this.markers.eachLayer(this._setClickeable)};_urlHash=()=>{const t=e=>{e.on("click",()=>{this.addHash(e.options.id)})};this.markers.eachLayer(t),this.map.eachLayer(e=>{e.hasOwnProperty("feature")&&"Point"!=e.feature.geometry.type&&"MultiPoint"!=e.feature.geometry.type&&t(e)})};removeListElement=(e,t)=>{t=e.indexOf(t);return-1<t&&e.splice(t,1),e};_templateTitle=e=>{if(!e.hasOwnProperty(this.title))return!1;var t=this.template_structure,s=!!t.hasOwnProperty("title")&&t.title,a=this.title||!1;if(t.hasOwnProperty("title")&&"boolean"==typeof t.title)return!1;if(!s&&!a)return!1;s=s||a;let r;t?.header?((a=document.createElement("div")).innerHTML=this._mdToHtml(t.header(this,e)),this.template_innerhtml&&(a.innerHTML=t.header(this,e)),r=a):((r=document.createElement("h2")).classList.add(...t.title_classlist),r.textContent=e[s]);a=document.createElement("header");return a.className="header",a.appendChild(r),a};_templateList=e=>{var t=this.template_structure,s=Object.keys(e);let a=s;if(t.hasOwnProperty("values")&&0<t?.values?.length)a=t.values;else if(t.hasOwnProperty("exclude")&&0<t.exclude.length)for(const r of t.exclude)a=this.removeListElement(s,r);return a};_mdToHtml=e=>{var t,s;return this.template_markdown&&this._markdownEnable()?(t=new showdown.Converter(this.markdown_options),s=secureHTML(e,this.allowed_tags),t.makeHtml((""+s).trim())):e};_markdownEnable=()=>!("undefined"==typeof showdown||!showdown.hasOwnProperty("Converter"));_templateMixing=r=>{if(this.template_structure.hasOwnProperty("mixing")&&0<this.template_structure.mixing.length){var e=this.template_structure.mixing;let a={};return e.forEach(e=>{var{values:e,separator:t=", ",key:s}=e;void 0===s&&this.errorMessage("Mixing requiere un valor en el atributo «key».","warning"),a[s]=e.map(e=>e in r?r[e]:e.toString()).filter(e=>e).join(t)}),Object.assign({},r,a)}return r};_setType=(e,t=!1,s=!1)=>"function"==typeof e?e(this,t,s):e;_lead=e=>{if(this.template_structure.hasOwnProperty("lead")){this.template_structure.lead.hasOwnProperty("key")||this.errorMessage("Lead requiere un valor en el atributo «key».","warning");var t,{key:s=!1,css:a="small",style:r=!1}=this.template_structure.lead;if(e[s].trim())return(t=document.createElement("p")).textContent=e[s],(s=this._setType(r,e))&&t.setAttribute("style",s),(r=this._setType(a,e))&&t.classList.add(...r.split(" ")),t}};_termIcon=(e,t)=>{var s=this.header_icons.find(e=>e.key==t);if(s){var{css:s=!1,style:a=!1,html:r=!1}=s,r=this._setType(r,e,t),a=this._setType(a,e,t),s=this._setType(s,e,t);if(s)return(e=document.createElement("i")).setAttribute("aria-hidden","true"),e.classList.add(...s.split(" ")),a&&e.setAttribute("style",a),e;if(r)return(s=document.createElement("template")).innerHTML=r,s.content}return!1};defaultTemplate=(e,t)=>{t=this._templateMixing(t);var s,a,r=this["template_structure"],i=this._templateList(t),o=this._templateTitle(t),n=document.createElement("article"),l=(n.classList.add(...r.container_classlist),document.createElement(r.definition_list_tag));l.classList.add(...r.definition_list_classlist),l.style.fontSize="1rem";for(const c of i)t.hasOwnProperty(c)&&t[c]&&((s=document.createElement(r.term_tag)).classList.add(...r.term_classlist),(a=this._termIcon(t,c))&&(s.appendChild(a),s.insertAdjacentText("beforeend"," ")),s.insertAdjacentText("beforeend",this.header(c)),(a=document.createElement(r.definition_tag)).classList.add(...r.definition_classlist),a.textContent=t[c],this.template_markdown?a.innerHTML=this._mdToHtml(t[c]):this.template_innerhtml&&(a.innerHTML=secureHTML(t[c],this.allowed_tags)),""!=this.header(c)&&l.appendChild(s),l.appendChild(a));i=this._lead(t);return i&&n.appendChild(i),o&&n.appendChild(o),n.appendChild(l),n.outerHTML};icon=(e="azul")=>new L.icon({iconUrl:"https://www.argentina.gob.ar/sites/default/files/"+`marcador-${e}.svg`,iconSize:[29,40],iconAnchor:[14,40],popupAnchor:[0,-37]});resetView=()=>this.map.setView(this.map_view,this.map_zoom);fitBounds=()=>{try{this.map.fitBounds(this.geojson.getBounds().pad(.005))}catch(e){}};_resetViewButton=()=>{this.reset_zoom&&(document.querySelectorAll(".js-reset-view"+this.scope_sufix).forEach(e=>e.remove()),document.querySelectorAll(this.scope_selector+" .leaflet-control-zoom-in").forEach(e=>{var t=document.createElement("i"),s=(t.classList.add("pmi","pmi-expand"),t.setAttribute("aria-hidden","true"),document.createElement("a"));s.classList.add("js-reset-view"+this.scope_sufix,"leaflet-control-zoom-reset"),s.href="#",s.title="Zoom para ver todo el mapa",s.setAttribute("role","button"),s.setAttribute("aria-label","Zoom para ver todo el mapa"),s.appendChild(t),s.onclick=e=>{e.preventDefault(),this.cleanState(),this.resetView()},e.after(s)}))};marker=e=>{var t;return this.marker_color&&"boolean"!=typeof this.marker_color?"string"==typeof this.marker_color?this.icon(this.marker_color):"string"==typeof this.marker_color(this,e)?(t=this.marker_color(this,e),this.icon(t)):"function"==typeof this.marker_color?this.marker_color(this,e):void 0:null};_clearLayers=()=>{this.markers.clearLayers(),this.map.eachLayer(e=>{this.isFeature(e)&&this.map.removeLayer(e)})};markersMap=e=>{var r=this;this._clearLayers(),this.geojson=new L.geoJson(e,{pointToLayer:function(e,t){var e=e["properties"],s=r.marker(e),a={},s=(a.id=e[r.id],s&&(a.icon=s),r.title&&(a.alt=e[r.title]),new L.marker(t,a));return r.map.options.minZoom=r.min_zoom,r.markers.addLayer(s),r.tooltip&&e[r.title]&&s.bindTooltip(e[r.title],r.tooltip_options),r.no_info||r.slider||(t="function"==typeof r.template?r.template(r,e):r.defaultTemplate(r,e),s.bindPopup(t)),r.markers},onEachFeature:function(e,t){var{properties:s,geometry:a}=e;t.options.id=s[r.id],e.properties.name=s[r.title],r.tooltip&&s[r.title]&&"Point"!=a.type&&"MultiPoint"!=a.type&&t.bindTooltip(s[r.title],r.tooltip_options),r.no_info||r.slider||"Point"==a.type||"MultiPoint"==a.type||(e="function"==typeof r.template?r.template(r,s):r.defaultTemplate(r,s),t.bindPopup(e))},style:function(e){const s=e["properties"];e=(e,t=!1)=>s.hasOwnProperty(e)?s[e]:t||r.featureStyle[e];return{color:e("stroke-color",e("stroke")),strokeOpacity:e("stroke-opacity"),weight:e("stroke-width"),fillColor:e("stroke"),opacity:e("stroke-opacity"),fillOpacity:e("fill-opacity")}}}),this.geojson.addTo(this.map)};_setSelectedMarker=(e,t)=>{e={entry:this.entry(e),marker:t};return this.selected_marker=e};_selectedMarker=()=>{this.map.eachLayer(t=>{this.isFeature(t)&&t.on("click",e=>{this._setSelectedMarker(t.options.id,t)})})};_hiddenSearchInput=()=>{const t=document.createElement("input");t.type="hidden",t.name="js-search-input"+this.scope_sufix,t.setAttribute("disabled","disabled"),t.id="js-search-input"+this.scope_sufix,document.querySelectorAll(this.scope_selector+".poncho-map").forEach(e=>e.appendChild(t))};_setFetureAttributes=()=>{const t=(e,t)=>{e.hasOwnProperty(t)&&(e[t].setAttribute("aria-label",e?.feature?.properties?.[this.title]),e[t].setAttribute("tabindex",0),e[t].dataset.entryId=e?.feature?.properties?.[this.id],"n"==e?.feature?.properties?.["pm-interactive"]?(e[t].dataset.interactive="n",e[t].setAttribute("role","graphics-symbol")):e[t].setAttribute("role","button"),e[t].dataset.leafletId=e._leaflet_id)};this.map.eachLayer(e=>t(e,"_path"))};_accesibleAnchors=()=>{var e=[[this.scope_selector+" .leaflet-map-pane","leaflet-map-pane"+this.scope_sufix,[["role","region"]]],[this.scope_selector+" .leaflet-control-zoom","leaflet-control-zoom"+this.scope_sufix,[["aria-label","Herramientas de zoom"],["role","region"]]],[".js-themes-tool"+this.scope_sufix,"themes-tool"+this.scope_sufix,[["aria-label","Herramienta para cambiar de tema visual"],["role","region"]]]];return e.forEach(e=>{document.querySelectorAll(e[0]).forEach(t=>{t.id=e[1],e[2].forEach(e=>t.setAttribute(e[0],e[1]))})}),e};_accesibleMenu=()=>{document.querySelectorAll(this.scope_selector+" .pm-accesible-nav").forEach(e=>e.remove());var e=this._accesibleAnchors(),e=[...e=[{text:"Ir a los marcadores del mapa",anchor:"#"+e[0][1]},{text:"Ajustar marcadores al mapa",anchor:"#",class:"js-fit-bounds"},{text:"Ir al panel de zoom",anchor:"#"+e[1][1]},{text:"Cambiar de tema",anchor:"#"+e[2][1]}],...this.accesible_menu_filter,...this.accesible_menu_search,...this.accesible_menu_extras],t=document.createElement("i");t.classList.add("pmi","pmi-universal-access","accesible-nav__icon"),t.setAttribute("aria-hidden","true");const s=document.createElement("div"),a=(s.classList.add("pm-accesible-nav","top","pm-list"),s.id="pm-accesible-nav"+this.scope_sufix,s.setAttribute("aria-label","Menú para el mapa"),s.setAttribute("role","navigation"),s.tabIndex=0,document.createElement("ul"));a.classList.add("pm-list-unstyled"),e.forEach((e,t)=>{var s=document.createElement("a"),e=(s.classList.add("pm-item-link","pm-accesible"),s.textContent=e.text,s.tabIndex=0,s.href=e.anchor,e.hasOwnProperty("class")&&""!=e.class&&s.classList.add(...e.class.split(" ")),document.createElement("li"));e.appendChild(s),a.appendChild(e)}),s.appendChild(t),s.appendChild(a);e=document.createElement("a");e.textContent="Ir a la navegación del mapa",e.classList.add("pm-item-link","pm-accesible"),e.href="#pm-accesible-nav"+this.scope_sufix,e.id="accesible-return-nav"+this.scope_sufix;const r=document.createElement("div");r.classList.add("pm-accesible-nav","bottom"),r.appendChild(t.cloneNode(!0)),r.appendChild(e),document.querySelectorAll(""+this.scope_selector).forEach(e=>{e.insertBefore(s,e.children[0]),e.appendChild(r)}),this.fit()};fit=()=>document.querySelectorAll(this.scope_selector+" .js-fit-bounds").forEach(e=>{e.onclick=e=>{e.preventDefault(),this.fitBounds()}});clearAll=()=>{[".js-filter-container"+this.scope_sufix,".js-slider"+this.scope_sufix].forEach(e=>document.querySelectorAll(e).forEach(e=>e.remove()))};cleanState=()=>history.replaceState(null,null," ");render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._setThemes(),this.titleLayer.addTo(this.map),this.markersMap(this.entries),this._selectedMarker(),this.slider&&(this._renderSlider(),this._clickeableFeatures(),this._clickeableMarkers(),this._clickToggleSlider()),this.hash&&this._urlHash(),this.scroll&&this.hasHash()&&this.scrollCenter(),setTimeout(this.gotoHashedEntry,this.anchor_delay),this._setFetureAttributes(),this._accesibleMenu(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapLoader{constructor(e){e=Object.assign({},{scope:"",timeout:5e4},e);this.scope=e.scope,this.timeout=e.timeout,this.scope_sufix="--"+this.scope,this.scope_selector=`[data-scope="${this.scope}"]`,this.ponchoLoaderTimeout}close=()=>document.querySelectorAll(".js-poncho-map__loader"+this.scope_sufix).forEach(e=>e.remove());load=()=>{this.close(),clearTimeout(this.ponchoLoaderTimeout);var e=document.querySelector(".poncho-map"+this.scope_selector),t=document.createElement("span"),s=(t.className="loader",document.createElement("div"));s.dataset.scope=this.selector,s.classList.add("poncho-map__loader","js-poncho-map__loader"+this.scope_sufix),s.appendChild(t),e.appendChild(s),this.ponchoLoaderTimeout=setTimeout(this.remove,this.timeout)};loader=(e,t=500)=>{this.load(),setTimeout(()=>{e(),this.remove()},t)}}class PonchoMapFilter extends PonchoMap{constructor(e,t){super(e,t);e=Object.assign({},{filters:[],filters_visible:!1,filters_info:!1,search_fields:[],messages:{reset:' <a href="#" class="{{reset_search}}" title="Restablece el mapa a su estado inicial">Restablecer mapa</a>',initial:"Hay {{total_results}} puntos en el mapa.",no_results_by_term:"No encontramos resultados para tu búsqueda.",no_results:"No s + this.messages.resete encontraron entradas.",results:"{{total_results}} resultados coinciden con tu búsqueda.",one_result:"{{total_results}} resultado coincide con tu búsqueda.",has_filters:'<i title="¡Advertencia!" aria-hidden="true" class="fa fa-warning text-danger"></i> Se están usando filtros.'}},t);this.filters=e.filters,this.filters_info=e.filters_info,this.filters_visible=e.filters_visible,this.valid_fields=["checkbox","radio"],this.search_fields=e.search_fields,this.messages=e.messages,this.accesible_menu_filter=[{text:"Ir al panel de filtros",anchor:"#filtrar-busqueda"+this.scope_sufix}]}tplParser=(e,a)=>Object.keys(a).reduce(function(e,t){var s=new RegExp("\\{\\{\\s{0,2}"+t+"\\s{0,2}\\}\\}","gm");return e=e.replace(s,a[t])},e);_helpText=e=>{var t=document.querySelectorAll(this.scope_selector+" .js-poncho-map__help");const a={total_results:e.length,total_entries:this.entries.length,total_filtered_entries:this.filtered_entries.length,filter_class:"js-close-filter"+this.scope_sufix,anchor:"#",term:this.inputSearchValue,reset_search:"js-poncho-map-reset"+this.scope_sufix};t.forEach(e=>{e.innerHTML="";var t=document.createElement("ul"),s=(t.classList.add("m-b-0","list-unstyled"),t.setAttribute("aria-live","polite"),e=>{var t=document.createElement("li");return t.innerHTML=e,t});a.total_entries===a.total_results?t.appendChild(s(this.tplParser(this.messages.initial,a))):a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results_by_term+this.messages.reset,a))):""===this.inputSearchValue&&a.total_results<1?t.appendChild(s(this.tplParser(this.messages.no_results+this.messages.reset,a))):1==a.total_results?t.appendChild(s(this.tplParser(this.messages.one_result+this.messages.reset,a))):1<a.total_results&&t.appendChild(s(this.tplParser(this.messages.results+this.messages.reset,a))),this.usingFilters(),e.appendChild(t)})};_filterPosition=e=>{e=/^([\w\-]+?)(?:__([0-9]+))(?:__([0-9]+))?$/gm.exec(e);return e?[e[1],e[2]]:null};isFilterOpen=()=>document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.contains("filter--in");toggleFilter=()=>{document.querySelector(".js-poncho-map-filters"+this.scope_sufix).classList.toggle("filter--in")};_filterContainerHeight=()=>{var e=document.querySelector(".js-filter-container"+this.scope_sufix),t=document.querySelector(".js-close-filter"+this.scope_sufix),s=e.offsetParent.offsetHeight,a=3*this._cssVarComputedDistance(),s=s-e.offsetTop-t.offsetHeight-a,e=document.querySelector(".js-poncho-map-filters"+this.scope_sufix),t=(e.style.maxHeight=s+"px",e.offsetHeight-45),a=document.querySelector(".js-filters"+this.scope_sufix);a.style.height=t+"px",a.style.overflow="auto"};_clickToggleFilter=()=>document.querySelectorAll(".js-close-filter"+this.scope_sufix).forEach(e=>e.onclick=e=>{e.preventDefault(),this.toggleFilter(),this._filterContainerHeight()});_setFilter=e=>{const[t,s="checked"]=e;e=this.entries.map(e=>{if(e.properties.hasOwnProperty(t))return e.properties[t]}).filter(e=>e),e=[...new Set(e)].map(e=>[t,e,[e],s]);return e.sort((e,t)=>{e=e[1].toUpperCase(),t=t[1].toUpperCase();return t<e?1:e<t?-1:0}),e};_fieldsToUse=e=>{var{type:e="checkbox",fields:t=!1,field:s=!1}=e;t||s||this.errorMessage("Filters requiere el uso del atributo `field` o `fields`.","warning"),s&&"radio"===e&&(s[1]=!1);let a=t||this._setFilter(s);return"radio"===e&&!1===t&&(s=a.map(e=>e[1]),a=[[a[0][0],"Todos",s,"checked"],...a]),a};_fields=(e,t)=>{var s=document.createElement("div"),a=(s.classList.add("field-list","p-b-1"),this._fieldsToUse(e));for(const c in a){var r=a[c],i=document.createElement("input"),o=(i.type=this.valid_fields.includes(e.type)?e.type:"checkbox",i.id=`id__${r[0]}__${t}__`+c,"radio"==e.type?i.name=r[0]+"__"+t:i.name=r[0]+`__${t}__`+c,i.className="form-check-input",i.value=c,void 0!==r[3]&&"checked"==r[3]&&i.setAttribute("checked","checked"),document.createElement("label")),n=(o.style.marginLeft=".33rem",o.textContent=r[1],o.className="form-check-label",o.setAttribute("for",`id__${r[0]}__${t}__`+c),document.createElement("span")),r=(n.dataset.info=r[0]+`__${t}__`+c,o.appendChild(n),document.createElement("div"));r.className="form-check",r.appendChild(i),r.appendChild(o),s.appendChild(r)}var l=document.createElement("div");return l.appendChild(s),l};_filterButton=()=>{var e=document.createElement("i"),t=(e.setAttribute("aria-hidden","true"),e.classList.add("pmi","pmi-filter"),document.createElement("span")),s=(t.textContent="Abre o cierra el filtro de búsqueda",t.classList.add("pm-visually-hidden"),document.createElement("button")),e=(s.classList.add("pm-btn","pm-btn-rounded-circle","pm-my-1","js-close-filter"+this.scope_sufix),s.id="filtrar-busqueda"+this.scope_sufix,s.appendChild(e),s.appendChild(t),s.setAttribute("role","button"),s.setAttribute("aria-label","Abre o cierra el filtro de búsqueda"),s.setAttribute("aria-controls","poncho-map-filters"+this.scope_sufix),document.createElement("div"));e.classList.add("js-filter-container"+this.scope_sufix,"filter-container"),e.appendChild(s),document.querySelector(".poncho-map"+this.scope_selector).appendChild(e)};_cssVarComputedDistance=()=>{var e=document.querySelector(".poncho-map"),e=getComputedStyle(e).getPropertyValue("--pm-slider-distance");return parseInt(e.toString().replace(/[^0-9]*/gm,""))||0};_controlZoomSize=()=>{var e=document.querySelector(this.scope_selector+" .leaflet-control-zoom");return{controlHeight:e.offsetHeight,controlTop:e.offsetTop}};_filterContainer=()=>{var e=document.createElement("div"),t=(e.className="js-filters"+this.scope_sufix,document.createElement("button")),s=(t.classList.add("btn","btn-xs","btn-secondary","btn-close","js-close-filter"+this.scope_sufix),t.title="Cerrar panel",t.setAttribute("role","button"),t.setAttribute("aria-label","Cerrar panel de filtros"),t.innerHTML='<span class="pm-visually-hidden">Cerrar </span>✕',document.createElement("form"));s.classList.add("js-formulario"+this.scope_sufix),s.appendChild(t),s.appendChild(e);const a=document.createElement("div");a.classList.add("js-poncho-map-filters"+this.scope_sufix,"pm-container","poncho-map-filters","pm-caret","pm-caret-t"),a.setAttribute("role","region"),a.setAttribute("aria-live","polite"),a.setAttribute("aria-label","Panel de filtros"),a.id="poncho-map-filters"+this.scope_sufix,this.filters_visible&&a.classList.add("filter--in");this._cssVarComputedDistance();t=this._controlZoomSize();const r=t.controlHeight+t.controlTop+"px";a.appendChild(s),document.querySelectorAll(".js-filter-container"+this.scope_sufix).forEach(e=>{e.style.top=r,e.appendChild(a)})};_checkUncheckButtons=e=>{var t=document.createElement("button"),s=(t.classList.add("js-select-items","select-items__button"),t.textContent="Marcar todos",t.dataset.field=e.field[0],t.dataset.value=1,document.createElement("button")),e=(s.classList.add("js-select-items","select-items__button"),s.textContent="Desmarcar todos",s.dataset.field=e.field[0],s.dataset.value=0,document.createElement("div"));return e.classList.add("select-items"),e.appendChild(t),e.appendChild(s),e};_createFilters=e=>{const r=document.querySelector(".js-filters"+this.scope_sufix);e.forEach((e,t)=>{var s=document.createElement("legend"),a=(s.textContent=e.legend,s.classList.add("m-b-1","color-primary","h6"),document.createElement("fieldset"));a.appendChild(s),e.hasOwnProperty("check_uncheck_all")&&e.check_uncheck_all&&"radio"!=e?.type&&a.appendChild(this._checkUncheckButtons(e)),a.appendChild(this._fields(e,t)),r.appendChild(a)})};formFilters=()=>{var e;return this.filters.length<1?[]:(e=document.querySelector(".js-formulario"+this.scope_sufix),e=new FormData(e),Array.from(e).map(e=>{var t=this._filterPosition(e[0]);return[parseInt(t[1]),parseInt(e[1]),t[0]]}))};defaultFiltersConfiguration=()=>{return this.filters.map((e,s)=>{return this._fieldsToUse(e).map((e,t)=>[s,t,e[0],"undefinded"!=typeof e[3]&&"checked"==e[3]])}).flat()};usingFilters=()=>{return this.defaultFiltersConfiguration().every(e=>document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked)};_resetFormFilters=()=>{this.defaultFiltersConfiguration().forEach(e=>{document.querySelector(`#id__${e[2]}__${e[0]}__`+e[1]).checked=e[3]})};get inputSearchValue(){var e=document.querySelector("#js-search-input"+this.scope_sufix).value.trim();return""!==e&&e}_countOccurrences=(e,s,a)=>{return e.reduce((e,t)=>s.some(e=>t.properties[a].includes(e))?e+1:e,0)};totals=()=>{return this.formFilters().map(e=>{var t=this._fieldsToUse(this.filters[e[0]])[e[1]];return[t[1],this._countOccurrences(this.filtered_entries,t[2],t[0]),...e]})};_totalsInfo=()=>{if(!this.filters_info)return"";this.totals().forEach(e=>{var t=document.querySelector(""+this.scope_selector+` [data-info="${e[4]}__${e[2]}__${e[3]}"]`),s=e[1]<2?"":"s",a=document.createElement("i"),r=(a.style.cursor="help",a.style.opacity=".75",a.style.marginLeft=".5em",a.style.marginRight=".25em",a.classList.add("fa","fa-info-circle","small","text-info"),a.title=e[1]+" resultado"+s,a.setAttribute("aria-hidden","true"),document.createElement("span")),e=(r.className="pm-visually-hidden",r.style.fontWeight="400",r.textContent=e[1]+` elemento${s}.`,document.createElement("small"));e.appendChild(a),e.appendChild(r),t.appendChild(e)})};_validateEntry=(t,s)=>{var a=this.filters.length,r=[];for(let e=0;e<a;e++)r.push(this._validateGroup(t,(t=>s.filter(e=>e[0]==t))(e)));return r.every(e=>e)};_search=(t,e,s)=>{const a=this._fieldsToUse(this.filters[e])[s];return a[2].filter(e=>e).some(e=>{if(t.hasOwnProperty(a[0]))return t[a[0]].includes(e)})};_validateGroup=(t,e)=>{return e.map(e=>this._search(t,e[0],e[1])).some(e=>e)};_filterData=()=>{var e=this.formFilters(),t=this.entries.filter(e=>this._validateEntry(e.properties,this.formFilters())),t=this.searchEntries(this.inputSearchValue,t);return t=this.filters.length<1||0<e.length?t:[],this.filtered_entries=t};_filteredData=e=>{e=void 0!==e?this.entries:this._filterData(),this.markersMap(e),this._selectedMarker(),this._helpText(e),this._resetSearch(),this._clickToggleFilter(),this.slider&&(this._renderSlider(),this._clickeableMarkers(),this._clickeableFeatures(),this._clickToggleSlider()),this.hash&&this._urlHash(),this._setFetureAttributes(),this._accesibleMenu()};_clearSearchInput=()=>document.querySelectorAll("#js-search-input"+this.scope_sufix).forEach(e=>e.value="");_resetSearch=()=>{document.querySelectorAll(".js-poncho-map-reset"+this.scope_sufix).forEach(e=>{e.onclick=e=>{e.preventDefault(),this._resetFormFilters(),this._filteredData(this.entries),this._clearSearchInput(),this.resetView()}})};filterChange=t=>document.querySelectorAll(".js-filters"+this.scope_sufix).forEach(e=>{e.onchange=t});checkUncheckFilters=()=>{document.querySelectorAll(this.scope_selector+" .js-select-items").forEach(t=>{t.onclick=e=>{e.preventDefault(),document.querySelectorAll(`${this.scope_selector} [id^=id__${t.dataset.field}]`).forEach(e=>{e.checked=parseInt(t.dataset.value)}),this._filteredData()}})};render=()=>{this._hiddenSearchInput(),this._resetViewButton(),this._menuTheme(),this._setThemes(),0<this.filters.length&&(this._filterButton(),this._filterContainer(),this._createFilters(this.filters)),this.titleLayer.addTo(this.map),this._filteredData(),this._totalsInfo(),this.scroll&&this.hasHash()&&this.scrollCenter(),this.checkUncheckFilters(),this.filterChange(e=>{e.preventDefault(),this._filteredData()}),setTimeout(this.gotoHashedEntry,this.anchor_delay),this.filters_visible&&this._filterContainerHeight(),this.mapOpacity(),this.mapBackgroundColor()}}class PonchoMapSearch{constructor(e,t){var s={scope:!1,placeholder:"Su búsqueda",search_fields:e.search_fields,sort:!0,sort_reverse:!1,sort_key:"text",datalist:!0},s=(this.instance=e,Object.assign({},s,t));this.text=e.title||!1,this.datalist=s.datalist,this.placeholder=s.placeholder,this.scope=s.scope,this.scope_sufix="--"+this.scope,this.sort=s.sort,this.sort_reverse=s.sort_reverse,this.search_scope_selector=this.scope?`[data-scope="${this.scope}"]`:"",this.instance.search_fields=s.search_fields,this.instance.accesible_menu_search=[{text:"Hacer una búsqueda",anchor:"#id-poncho-map-search"+this.scope_sufix}]}sortData=(e,a)=>{e=e.sort((e,t)=>{var s=e=>{this.instance.removeAccents(e).toUpperCase()};return s(e[a]),s(t[a]),s(e[a]),s(t[a]),0});return this.sort_reverse?e.reverse():e};_triggerSearch=()=>{const t=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input");t.id="id-poncho-map-search"+this.scope_sufix,document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__submit").forEach(e=>{e.onclick=e=>{e.preventDefault();document.querySelector("#js-search-input"+this.instance.scope_sufix).value=t.value;e=t.value;this._renderSearch(e)}})};_keyup=()=>{document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>{const t=document.querySelector("#js-search-input"+this.instance.scope_sufix);e.onkeyup=()=>{t.value=e.value},e.onkeydown=()=>{t.value=e.value}})};_placeHolder=()=>{if(!this.placeholder)return"";document.querySelectorAll(this.search_scope_selector+" .js-poncho-map-search__input").forEach(e=>e.placeholder=this.placeholder.toString())};_renderSearch=e=>{var t=this.instance._filterData();this.instance.markersMap(t),this.instance.slider&&(this.instance._renderSlider(),this.instance._clickeableFeatures(),this.instance._clickeableMarkers(),this.instance._clickToggleSlider()),this.instance.hash&&this.instance._urlHash(),this.instance.resetView(),1==t.length?this.instance.gotoEntry(t[0].properties[this.instance.id]):""!=e.trim()&&(this.instance.removeHash(),setTimeout(this.instance.fitBounds,this.instance.anchor_delay)),this.instance._helpText(t),this.instance._resetSearch(),this.instance._clickToggleFilter(),this.instance._setFetureAttributes(),this.instance._accesibleMenu()};_addDataListOptions=()=>{if(!this.datalist)return null;document.querySelectorAll(this.search_scope_selector+" .js-porcho-map-search__list,"+` ${this.search_scope_selector} .js-poncho-map-search__list`).forEach(s=>{s.innerHTML="";var e=document.querySelector(this.search_scope_selector+" .js-poncho-map-search__input"),t="id-datalist"+this.scope_sufix;e.setAttribute("list",t),s.id=t,this.instance.filtered_entries.forEach(e=>{var t;e.properties[this.text]&&s.appendChild((e=e.properties[this.text],(t=document.createElement("option")).value=e,t))})})};_searchRegion=()=>{var e=document.querySelector(this.search_scope_selector);e.setAttribute("role","region"),e.setAttribute("aria-label","Buscador")};render=()=>{this._placeHolder(),this._triggerSearch(),this._addDataListOptions(),this.instance.filterChange(e=>{e.preventDefault(),this.instance._filteredData(),this._addDataListOptions()}),this._searchRegion(),this._keyup(),this.instance._accesibleMenu()}}const PONCHOMAP_GEOJSON_PROVINCES="/profiles/argentinagobar/themes/contrib/poncho/resources/jsons/geo-provincias-argentinas.json",ponchoMapProvinceMergeData=(a={},r={},i="provincia")=>{if(a.hasOwnProperty("features"))return a.features.forEach((t,e)=>{var s=r.find(e=>e[i]==t.properties.fna||e[i]==t.properties.nam);!s&&t.properties.fna?delete a.features[e]:(s?.color&&!t.properties["pm-type"]&&(a.features[e].properties.stroke=ponchoColor(s.color)),"n"===t.properties["pm-interactive"]&&"n"!==s?.["pm-interactive"]&&delete s["pm-interactive"],Object.assign(a.features[e].properties,s))}),a;throw new Error("Invalid data format")},ponchoMapProvinceCssStyles=e=>{e||document.querySelectorAll(".poncho-map-province__toggle-map,.poncho-map-province__toggle-element").forEach(e=>{e.classList.remove("poncho-map-province__toggle-map","poncho-map-province__toggle-element")})};class PonchoMapProvinces extends PonchoMapFilter{constructor(e,t,s){s=Object.assign({},{initial_entry:!1,random_entry:!1,overlay_image:!0,overlay_image_bounds:[[-20.56830872133435,-44.91768177759874],[-55.861359445914566,-75.2246121480093]],overlay_image_opacity:.8,overlay_image_url:"https://www.argentina.gob.ar/sites/default/files/map-shadow.png",hide_select:!0,province_index:"provincia",fit_bounds:!0,map_view:[-40.47815508388363,-60.0045383246273],map_init_options:{zoomSnap:.2,zoomControl:!0,doubleClickZoom:!1,scrollWheelZoom:!1,boxZoom:!1},map_zoom:4.4,tooltip_options:{permanent:!1,className:"leaflet-tooltip-own",direction:"auto",offset:[0,-3],sticky:!0,opacity:1},tooltip:!0,slider:!0},s),ponchoMapProvinceCssStyles(s.hide_select),e=ponchoMapProvinceMergeData(e,t,s.province_index);super(e,s),this.initialEntry=s.initial_entry,this.randomEntry=s.random_entry,this.overlayImage=s.overlay_image,this.overlayImageUrl=s.overlay_image_url,this.overlayImageBounds=s.overlay_image_bounds,this.overlayImageOpacity=s.overlay_image_opacity,this.mapView=s.map_view,this.hideSelect=s.hide_select,this.fitToBounds=s.fit_bounds}sortObject=(e,s=0)=>e.sort((e,t)=>{e=e[s].toUpperCase(),t=t[s].toUpperCase();return t<e?1:e<t?-1:0});_randomEntry=e=>e[Math.floor(Math.random()*e.length)][0];_provincesFromGeoJSON=(e,a)=>{let r={};return e.features.map(e=>{var{name:t=!1,"pm-interactive":s=!1}=e.properties;if("n"===s||!t)return!1;r[e.properties[a]]=t}).filter(e=>e),this.sortObject(Object.entries(r),1)};_selectedEntry=e=>{var t=window.location.hash.replace("#","");let s="";return t?s=t:this.initialEntry?s=this.initialEntry:this.randomEntry&&(s=this._randomEntry(e)),s};_setSelectProvinces=e=>{window.location.hash.replace("#","");e=this._provincesFromGeoJSON(e.geoJSON,e.id);const s=this._selectedEntry(e),a=document.getElementById("id_provincia");return[["","Seleccione una provincia"],...e].forEach(e=>{var t=document.createElement("option");e[0]===s&&t.setAttribute("selected","selected"),t.value=e[0],t.textContent=e[1],a.appendChild(t)}),{object:a,selected:s}};_selectedPolygon=e=>{e.map.eachLayer(e=>{e.on("keypress click",e=>{e?.target?.feature?.properties&&(e=e.target.feature.properties["id"],document.getElementById("id_provincia").value=e)})})};_selectProvinces=t=>{this._selectedPolygon(t);const s=this._setSelectProvinces(t);s.selected&&t.gotoEntry(s.selected),s.object.addEventListener("change",e=>{t.gotoEntry(e.target.value),e.value=s.selected})};_overlayImage=()=>{this.overlayImage&&L.imageOverlay(this.overlayImageUrl,this.overlayImageBounds,{opacity:this.overlayImageOpacity}).addTo(this.map)};renderProvinceMap=()=>{this._overlayImage(),this.render(),this.fitToBounds&&this.fitBounds(),this._selectProvinces(this)}}class GapiSheetData{constructor(e){e=Object.assign({},{gapi_key:"AIzaSyCq2wEEKL9-6RmX-TkW23qJsrmnFHFf5tY",gapi_uri:"https://sheets.googleapis.com/v4/spreadsheets/"},e);this.gapi_key=e.gapi_key,this.gapi_uri=e.gapi_uri}url=(e,t,s)=>{return["https://sheets.googleapis.com/v4/spreadsheets/",t,"/values/",e,"?key=",void 0!==s?s:this.gapi_key,"&alt=json"].join("")};json_data=e=>{e=this.feed(e);return{feed:e,entries:this.entries(e),headers:this.headers(e)}};feed=(e,i=!0)=>{const o=e.values[0],n=/ |\/|_/gi;let l=[];return e.values.forEach((e,t)=>{if(0<t){var s,a={};for(s in o){var r=e.hasOwnProperty(s)?e[s].trim():"";i?a[""+o[s].toLowerCase().replace(n,"")]=r:a[""+o[s].replace(n,"")]=r}l.push(a)}}),l};gapi_feed_row=(e,t="-",s=!0)=>{const a=s?"filtro-":"";s=Object.entries(e);let r={};return s.map(e=>{return r[e[0].replace("gsx$","").replace(a,"").replace(/-/g,t)]=e[1].$t}),r};entries=e=>e.filter((e,t)=>0<t);headers=e=>e.find((e,t)=>0==t)}"undefined"!=typeof exports&&(module.exports=GapiSheetData);class TranslateHTML{ATTRIBUTES=["title","placeholder","alt","value","href","src","html.lang"];constructor(e=[],t=[]){this.dictionary=this.sortByLength(e),this.attributes=t.length?t:this.ATTRIBUTES}sortByLength=e=>(e.sort((e,t)=>e[0].length>t[0].length?-1:e[0].length<t[0].length?1:e[0]-t[0]),e);translateAttributes=(e=!1)=>{const t=e||this.dictionary;this.attributes.forEach(e=>{e=e.split(".").slice(-2);const s=2===e.length?e[0]:"",a=2===e.length?e[1]:e[0];t.forEach(t=>{document.querySelectorAll(`${s}[${a}='${t[0]}']`).forEach(e=>e[a]=t[1])})})};translateHTML=(s,a)=>{for(var e,t=document.evaluate("//*/text()",document,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE,null),r=[];e=t.iterateNext();)r.push(e);r.forEach(e=>{var t=e.textContent.replace(s,a);t!==e.textContent&&(t=document.createTextNode(t),e.parentNode.replaceChild(t,e))})};translate=()=>{this.dictionary.forEach(e=>{var t=new RegExp(e[0],"g");this.translateHTML(t,e[1])})}}
@@ -39,14 +39,14 @@ function cleanner(e,n){"object"!=typeof n&&(n=[]);var r=["html","body","div","sp
39
39
  <p></p>
40
40
  </div>
41
41
  </div>
42
- </div>`:t})}}]}),showdown.extension("ejes",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/(col([1-4])<<)[\s\S]*?\[\[ejes-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>)/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
42
+ </div>`:t})}}]}),showdown.extension("ejes",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/((?:\[\[)?col(1[0-2]|[1-9])(?:-\{|<<))[\s\S]*?\[\[ejes-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>|\}-\]\])/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
43
43
  <div class="icon-item">
44
44
  <i class="${e[5]} ${e[6]}"></i>
45
45
  <p></p>
46
46
  <h3>${e[3]}</h3>
47
47
  <p>${e[4]}</p>
48
48
  </div>
49
- </div>`})}}]}),showdown.extension("numbers",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/(col([1-4])<<)[\s\S]*?\[\[numeros-\{([^\{\}-]*?)-([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>)/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
49
+ </div>`})}}]}),showdown.extension("numbers",function(){"use strict";return[{type:"lang",filter:function(e,t,n){const r=/((?:\[\[)?col([2-4])(?:-\{|<<))[\s\S]*?\[\[numeros-\{([^\{\}-]*?)-([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}-\{([^\{\}]*?)\}\]\][\s\S]*?(>>|\}-\]\])/;var a=new RegExp(r,"gmi");return e=e.replace(a,function(e){var e=new RegExp(r,"gmi").exec(e),t={2:"6",3:"4",4:"3",1:"12"};return`<div class="col-xs-12 col-sm-${t[e[2]]} col-md-${t[e[2]]}">
50
50
  <div class="h2 ${e[7]}">
51
51
  ${e[3]}<small>${e[4]}</small>
52
52
  </div>