@vlci/cdmciutat 29.0.1-4 → 30.0.0
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.
- package/dist/js/aigua.js +1 -1
- package/dist/js/analitica.js +1 -1
- package/dist/js/ciclista.js +1 -1
- package/dist/js/contaminacio.js +1 -1
- package/dist/js/emt.js +1 -1
- package/dist/js/initialCalls.js +1 -1
- package/dist/js/piae.js +1 -1
- package/dist/js/residus.js +1 -1
- package/dist/js/seuElectronica.js +1 -1
- package/dist/js/vehicles.js +1 -1
- package/package.json +1 -1
package/dist/js/aigua.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aigua=e():t.aigua=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{addPointInteger:()=>d,buildCamarasTrafico:()=>dt,buildTableCalidadAire:()=>st,calculateMaxYAxis:()=>v,calculatePentahoPath:()=>it,calculateXAxisStart:()=>S,checkAllGroupsCollapsed:()=>ot,configureDataBar:()=>E,configureDataGaugeCommon:()=>D,configureDataGaugeMonthCommon:()=>C,configureDataLine:()=>w,configureDataValidate:()=>wt,configureLinesChartValidates:()=>Et,convertToLanguageSelectorDateRange:()=>X,convertToTableTreeView:()=>at,downloadCSVTable:()=>rt,downloadPDFTable:()=>nt,formatCellMultiplesLines:()=>Q,formatDayMonthYear:()=>s,formatMilMillionEuros:()=>x,formatMonthAnyo:()=>n,formatName:()=>m,formatNameHeaderColumn:()=>K,formatRoundTooltip:()=>M,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>i,formatToMillions:()=>p,formatToTons:()=>h,formatTooltip:()=>b,formatTooltipPie:()=>A,formatTrimestre:()=>c,getEnvironment:()=>lt,getMaxFieldNumberFromData:()=>F,getMonth:()=>o,getMonthList:()=>u,getSelectCommonOptions:()=>j,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>yt,initBarChartComparationMonth:()=>xt,initChart:()=>f,initStackedBarChart:()=>mt,initStackedBarChartMonthSeries:()=>gt,initTable:()=>Z,initValueDefaultDate:()=>q,initialCalls:()=>ut,loadIframeOnClickEvent:()=>$t,printDataChart:()=>y,printDataInHTMLElements:()=>U,printNoDataChart:()=>g,resetFilter:()=>V,resetFilterDate:()=>Y,resetFilterDates:()=>W,resultsetWithFields:()=>k,selectConfigDatasource:()=>G,selectFilterAll:()=>P,selectValueDefaultInFilter:()=>H,splitDataset:()=>T,traverseRows:()=>et,updateObject:()=>L,updateStackedBarOptions:()=>ft});const a={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function o(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),a[t.substring(4,6)]]}function n(t){const[e,a]=r(t);return`${a} ${e}`}function s(t){const[e,o,r]=function(t){return[t.substring(0,4),a[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${o} ${e}`}function i(t){const[e,a]=r(t);return`${a.substring(0,3)} ${e}`}function l(t){const[e,a]=r(t);return`${a.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,a]=t.split("-");return`${parseFloat(a)/3}T ${e}`}function u(t,e){const a=t[e];return Array.from(a.values()).map((t=>t.slice(0,3)))}function d(t,e=2){let a=navigator.language||navigator.userLanguage;a=a.length<=2?`${a}-${a.toUpperCase()}`:a;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===a?t.toLocaleString("de-DE",o):t.toLocaleString(a,o)}function p(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t){return t>=1e3?t/1e3+" Tn":t.toString()}function m(t,e=29){if(t.length>=e){const a=t.split(" ");let o="",r="";return a.forEach((t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(r+=`${o}\n`,o=t)})),r+=o,r}return t}function f(t,e){const a=document.getElementById(t);if(!a)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const o=echarts.init(a);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const r=document.getElementById("main-content");return r&&(r.addEventListener("shown.bs.collapse",(()=>{o.resize()})),r.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o}function g(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function y(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function b(t,e=!1,a=!0,o=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,s=a?`<div style="font-weight: 400;color: #666;">${i=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${i}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${d(n)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${d(n)} ${o}`:"-"}\n </span>\n </div>`;var i;r+=s})),r}function S(t){return 100*(t-120)/t}function v(t,e){const a=Math.max(...t);return a+(e-a%e)}function A(t,e=!1){const a=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,o=e?`${t.percent}%`:d(t.value);return`<div> ${a} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function M(t,e){let a=`${t.name} : `;return a+=`<span style="font-weight:500">${d(Math.round(t.value))}</span>`,e&&(a+=`<span> (${t.percent}%)</span>`),t.marker+a}function x(t){const e=1e6,a=Number(t);return a>=0&&a<e?`${d(a)} €`:a>=e?`${d(a/e)} M €`:"-"}function $(t,e,a=1){const o=Math.max(...t.map((t=>t[e])))*a;return 5e3*Math.ceil(o/5e3)}function D(t,e,a,o=30,r=15,n=30,s=-70,i=70,l=3){const c=$(t,e.data,1.1),u=i,p=a.slice(),h=[];let f=r,g=n,y=s;for(let a=0;a<t.length;a+=1)h.push({value:t[a][e.data],name:m(String(t[a][e.type]).replace(/\[.*?\]/g,"")),color:p.shift(),title:{offsetCenter:[`${String(y)}%`,`${String(f)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(y)}%`,`${String(g)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),y+=u,(a+1)%l==0&&(g+=n,f+=2*r,y=s);return[c,h]}function C(t,e,a,r=0){return[$(e,a.data,1),t=>function(t,e,a){const r=d(Math.round(e)),n=o(t[a][0]),s=t[a][1],i=`\n${n} ${s} : ${r}`,l=`${r}\n${n} ${s}`;return window.innerWidth<=1710?i:l}(e,t,r),[{value:e[r][a.data]}]]}function I(t,e){const{resultset:a}={resultset:t},o=new Set,r=new Set,n=a.map((([t,a,n])=>{const s=e?Math.round(n):n;return o.add(t),r.add(a),{day:a,type:t,value:s}})),s=Array.from(r.values()),i=Array.from(o.values());return i.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[i.map((t=>{const e=n.filter((e=>e.type===t)).map((({day:e,value:a})=>[e,t,a])),a=s.map((t=>{const a=e.find((([e])=>e===t));return a?a[2]:null}));return{name:t,data:a}})),i,r]}function w(t,e=[],a=!1){const[o,r,n]=I(t,a);return o.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[o,n,r]}function E(t,e,a=!1){const[o,r,n]=I(t,a);return o.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[o,n,r]}function k(t){const{resultset:e,metadata:a}=t,o=[];return e.forEach((t=>{const e={};t.forEach(((t,o)=>{e[a[o].colName]=t})),o.push(e)})),o}function L(t,e){const a=t;return Object.keys(e).forEach((o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o?a[o]=e[o].map(((e,a)=>({...t[o][a],...e}))):"object"!=typeof e[o]||Array.isArray(e[o])?a[o]=e[o]:a[o]=L(t[o]||{},e[o]))})),t}function U(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((a=>{const o=a[0],r=a[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[o]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][o].format(t[o])):document.querySelector(r).textContent=t[o]}))}))}function F(t,e){const a=k(t),o=[];let r=null;return a.forEach((t=>{const a=t[e];"number"!=typeof a||Number.isNaN(a)||o.push(a)})),o.length>0&&(r=Math.max(...o)),r}function T(t,e=!0){const a={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?a.Cont.push([t[3],t[4],t[2]]):a.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?a.Mob.push([t[3],t[4],t[2]]):a.Mob.push([t[3],t[2]]))})),a}const N=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],B=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],z=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],O=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],_=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function P(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function R(t){for(const e of t)if(Array.isArray(e)){if(!R(e))return!1}else if("All"!==e)return!1;return!0}function G(t,e,a,o){return R(e)?(t.queryDefinition.dataAccessId=a,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function V(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function j(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function W(t,e,a,o){const r=Dashboards.getParameterValue(a),n=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[n]),!0}function Y(t,e){const a=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[a]),!0}function q(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function H(t,e){const a=Dashboards.getParameterValue(e),o=t.parameter;t.dashboard.setParameter(o,[a])}function X(t){t.regional.es={monthNames:N,abbreviatedMonthNames:B,dayNames:z,abbreviatedDayNames:O,dayNamesMin:_,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Z(t,e){const a=document.getElementById(t);return a?new Tabulator(a,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function K(t,e){let a=t.getValue();return a.length>e&&(a=`${a.substr(0,e)}<br>${a.substr(e)}`),a}function Q(t,e){const a=t.getValue().split(" ");let o="",r="";return a.forEach((t=>{(r+t).length<=e?r+=`${t} `:(o+=`${r}<br>`,r=`${t} `)})),o+=`${r}<br>`,o}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const a=t.getTreeChildren();a.length>0&&a.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function at(t,e,a,o){const r=[];for(const n in t)if(t.hasOwnProperty(n)){const s=t[n],i={[e]:s[0],_children:[]};s.shift(),s.forEach(((t,r)=>{const n={[e]:a[r],[o]:t};i._children.push(n)})),r.push(i)}return r}function ot(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function rt(t,e,a){const o=document.getElementById(a),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function nt(t,e,a){const o=document.getElementById(a),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}function st(t){const e=[],a=[100,200,350,500,750,751],o=[40,90,120,230,340,341],r=[50,100,130,240,380,381],n=[20,40,50,100,150,151],s=[10,20,25,50,75,76],i={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function l(t,e,a){const o=document.createElement("td");if(o.setAttribute("id",t),null!=e){o.innerHTML=e;const t=function(t,e){let a;return void 0===e?a=6:"ND"===e?a=7:(a=5,t.forEach(((t,o)=>{e<=t&&5===a&&(a=o)}))),i[a]}(a,e);o.classList.add(t)}return o}return t.forEach((t=>{const i=t;"noData"===i.operationalstatus&&(i.so2value="ND",i.no2value="ND",i.o3value="ND",i.pm10value="ND",i.pm25value="ND"),"A09_CABANYAL_60m"===i.entityid&&(i.pm10value=void 0,i.pm25value=void 0);const c=document.createElement("tr"),u=document.createElement("td");u.innerHTML=i.address,c.appendChild(u),c.appendChild(l(`${i.entityid}_so2`,i.so2value,a)),c.appendChild(l(`${i.entityid}_no2`,i.no2value,o)),c.appendChild(l(`${i.entityid}_o3`,i.o3value,r)),c.appendChild(l(`${i.entityid}_pm10`,i.pm10value,n)),c.appendChild(l(`${i.entityid}_pm25`,i.pm25value,s)),e.push(c)})),e}function it(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function lt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ct(t,e){document.querySelectorAll(`[${t}]`).forEach((a=>{!function(t,e,a){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,a&&a()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(a.getAttribute(t),a,e)}))}function ut(t){ct("include-html-cabecera",(function(){!function(){const t=lt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=lt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ct("include-html-menu"),ct("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),ct("include-html-copyright")}function dt(t,e,a,o,r,n){let s=!1,i=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(a);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),i=!0):(e.classList.remove("blur"),u(),i=!1)}const p=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(i||u(),s||(s=!0,window.setTimeout(d,n)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),p(l)),c&&(c.setAttribute("sandbox","allow-scripts"),p(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,n)}))):document.querySelectorAll(o)[0].style.display="none"}const pt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${p(t)}€`}}]},ht=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const a={};e.forEach((e=>{const o=e[1],r=e[0];r!==t.seriesName||a[o]||(a[o]=0),r===t.seriesName&&(a[o]+=e[2])}));let o=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(a))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${d(r)}</span></div>`;return o};function mt(t,e,a=void 0,o=void 0){const r=null===o?void 0:o,n=new Set(e.map((t=>t[1])));let s;const i={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>ht(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,a,o,r){const n={},s=r.contentSize[1]/2,i=r.viewSize[1],l=t[1];return l<s?n.top=10:l+s>i?n.bottom=10:n.top=l-s,t[0]<r.viewSize[0]/2?n.left=t[0]+20:n.right=r.viewSize[0]-t[0]+20,n}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>d(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>d(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(s=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const a=function(t){return t.reduce(((t,e)=>{const a=e[0];return t[a]||(t[a]=[]),t[a].push(e),t}),{})}(e),o=Object.keys(a);n.forEach((t=>{o.forEach((e=>{void 0===a[e].find((e=>e[1]===t))&&(a[e].push([a[e][0][0],t,void 0]),a[e].sort())}))}));const i=[];return Object.keys(a).forEach((e=>{s&&(t.itemStyle={borderColor:s.shift()}),t.name=e,t.data=a[e].map((t=>t[2]));let o={};o=void 0!==r?L(t,r):t,i.push({...o})})),i})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==a?L(i,a):i,f(t,l)}function ft(t){let e={};return e=L(t,pt),e}function gt(t,e,a={},r={}){let n={};n=L(a,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const s={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},i=null===r?s:L(r,s),l=e;l.forEach(((t,e)=>{l[e][0]=o(t[0])})),mt(t,l,n,i)}function yt(t,e=void 0){const a={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>M(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?L(a,e):a,f(t,o)}const bt="es_ES",St={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function vt(t){return Math.max(...t.map((t=>Number(t[0]))))}function At(t){const e=t.filter((e=>Number(e[0])===vt(t))),a=Array.from({length:12},(()=>0));return e.forEach((([t,e,o])=>{const r=parseInt(e,10)-1;a[r]=o})),a}function Mt(t){const e=t.filter((e=>Number(e[0])===vt(t)-1)),a=Array.from({length:12},(()=>0));return e.forEach((([t,e,o])=>{const r=parseInt(e,10)-1;a[r]=o})),a}function xt(t,e,a=void 0){const o=vt(e).toString(),r=(vt(e)-1).toString();yt(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,o],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:u(St,bt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:Mt(e)},{name:o,type:"bar",barGap:0,data:At(e)}]},a))}function $t(t,e,a){const o=document.querySelector(e),r=document.querySelector(t);let n=!1;r.addEventListener("click",(()=>{!1===n&&(n=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",a),o.onload=()=>{n=!1})})),r.disabled=!1}const Dt="id",Ct="fecha",It="value";function wt(t,e,a,o){const[r,n]=function(t,e,a){const o=[],r=[];return t.forEach((t=>{e.includes(`${t[Dt]}`)?o.push(`${t[Ct]}`):a.includes(`${t[Dt]}`)&&r.push(`${t[Ct]}`)})),[o.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,a,o);let s="Datos sin validar";0===n.length&&(s="");const i={name:"Datos validados",type:"line",data:[...r,n[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let l="",c="";if(0===n.length){const e=t[t.length-1].fecha;l=e,c=e}else l=n[0][0],c=n[n.length-1][0];return[...e,i,{name:"Datos NO validados",type:"line",data:n,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:s,xAxis:l,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[It])).map((t=>parseInt(`${t[It]}`,10))))}]]}}]}function Et(t,e,a=void 0){f(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>b(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},a))}return e})(),t.exports=e()}},e={};function a(o){var r=e[o];if(void 0!==r)return r.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,a),n.exports}a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";a.r(o),a.d(o,{echartAiguaBarMonth:()=>K,echartAiguaGaugeSemicircle:()=>Q,echartAiguaRelojSemicircle:()=>tt,echartAiguaStackedBarYears:()=>at,echartBarrisBarYear:()=>ot,echartBarrisGaugeMonth:()=>ct,echartBarrisGaugeYear:()=>lt,echartBarrisLineMonth:()=>rt,echartBenimamet:()=>_,echartConsumAguaBarris:()=>P,echartConsumTotalAgua:()=>R,echartExposicio:()=>V,echartMalilla:()=>J,echartMestalla:()=>Y,echartPerellonet:()=>H,echartSotenis:()=>Z,listeneresAgua:()=>z});const t="8%",e="2.5%",r="5%",n="18%",s="20%",i="10%",l="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],p=33,h=27,m=30;function f(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const a={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",a):t.toLocaleString(e,a)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let a=`<p>${t[0].name}</p>`;return t.forEach((t=>{const o=e?Math.round(t.data):t.data,r=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?f(o):"-"}</strong></div>`;var n;a+=r})),a}function b(t){return f(t)}function S(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function v(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function A(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function M(t,e){return t.reduce(((t,a)=>{const o=a[e];return t[o]||(t[o]=[]),t[o].push(a),t}),{})}function x(t,e,a=1){const o=Math.max(...t.map((t=>t[e])))*a;return 5e3*Math.ceil(o/5e3)}function D(t){return Math.round(document.getElementById(t).offsetWidth/p)}function C(a,o,d,p,h,m,f,g=5,S="",v=h,A=100,M,x=void 0,$=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:o?{type:"plain",data:o,textStyle:{fontFamily:"Montserrat"},top:x||t,selected:M}:null,grid:{left:e,right:r,bottom:n,top:o?x?"30%":s:i,heigh:l,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:p,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,f]},type:"value",scale:!0,min:$,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:a,dataZoom:[{show:m,data:d,start:v,end:A,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function I(t,e,a,o){return{color:d,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:o,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const a=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let o=`${t.name} : `;return o+=`<span style="font-weight:bold">${f(t.value)}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),a+o}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>f(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:a,detail:{fontSize:o/1.2,color:"inherit",formatter:t=>f(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function w(t,e,a="",o){return{title:{text:a,left:"center",top:"top",padding:10,textStyle:{fontSize:o,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:x(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>f(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:o+5,fontWeight:"bolder",formatter:a=>function(t,e,a){const o=f(Math.round(e)),r=(n=t[a][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(n.toString(),10)]);var n;const s=t[a][1],i=`\n\n\n${r} ${s} : ${o}`,l=`${o}\n${r} ${s}`;return window.innerWidth<=1710?i:l}(t,a,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function E(t){if(t.length>=29){const e=t.split(" ");let a="",o="";for(const t of e)`${a} ${t}`.length<=29?a+=(a?" ":"")+t:(o+=`${a}\n`,a=t);return o+=a,o}return t}function k(t,e,a,o,r){let n=20,s=35,i=-190,l=o;t.length<=2&&(i=-140,l+=100,n=25,s=42);const c=d.slice(),u=[];for(let o=0;o<t.length;o+=1)u.push({value:t[o][e],name:E(t[o][a]),color:c.shift(),title:{offsetCenter:[String(i),`${String(n)}%`],fontFamily:"Montserrat",fontSize:r-3},detail:{offsetCenter:[String(i),`${String(s)}%`],fontFamily:"Montserrat"}}),i+=l,(o+1)%3==0&&(s+=30,n+=30,i=-190);return u}function L(t,e){const a=document.getElementById(t);if(!a)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const o=echarts.init(a);return o.setOption(e,!0),$(window).on("resize",(()=>{null!=o&&void 0!==o&&o.resize()})),o}function U(t,e,a){const o=$("#formFilterDates");if(""===Dashboards.getParameterValue("updateFilter")){const a=new Set;for(let o=t-1;o>0;--o)a.add(e[o]);for(const[t,e]of a.entries())o.append(`<input type="checkbox" id="${t}" onclick="legacy.filterDatesUpdate();" />${e}<br /></input>`);(function(){const t=$("#formFilterDates").find("input");$(t).each(((t,e)=>{e.checked&&(e.checked=!1)}));const e=$("#formFilterVar").find("input");$(e).each(((t,e)=>{e.checked&&(e.checked=!1)})),function(){let t=0;const e=$("#formFilterDates").find("input");$(e).each(((e,a)=>{t+=1,a.checked=!0})),t=0;const a=$("#formFilterVar").find("input");$(a).each(((e,a)=>{t+=1,null!=render_tableVariacio?t<=2&&(a.checked=!0):t<=3&&(a.checked=!0)})),console.error(`VALORES FILTRO: ${Dashboards.getParameterValue("filterVarParam")}`),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}()})(),function(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,a)=>{a.checked&&e.push(a.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}()}}function F(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function T(t){return 100*(t-120)/t}function N(t,e,a,o,r,n,s,i,l=!1,c=!1,u=void 0,p=!0,h=d.slice(),m=!1,f=void 0,y=void 0){const b=t.resultset||t;if(0===b.length)v(`#${n}`,`#${s}`),i&&v(`#${i}`,`#${s}`);else{A(`#${s}`,`#${n}`),i&&A(`#${s}`,`#${i}`);const t=function(t,e,a=!1){const{resultset:o}={resultset:t},r=new Set,n=new Set,s=e,i=o.map((([t,e,o])=>{const s=a?Math.round(o):o;return r.add(t),n.add(e),{day:e,type:t,value:s}})),l=Array.from(n.values()),c=Array.from(r.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=i.filter((e=>e.type===t)).map((({day:e,value:a})=>[e,t,a])),a=l.map((t=>{const a=e.find((([e])=>e===t));return a?a[2]:null}));return{name:t,type:"line",symbol:"circle",color:s.shift(),symbolSize:6,smooth:!1,data:a}})),n,c]}(b,h,m),d=t[0],v=t[1],M=t[2],x=p?M:null,$=c?(S=v,Array.from(S.values()).map((t=>{const[e,a]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)}))):Array.from(v.values());void 0===u&&(u=l?g(v.size):T(v.size)),L(n,C(d,x,$,r,u,e,a,void 0,o,void 0,void 0,void 0,f,y))}var S}function B(t,e,a,o,r,n,s,i,l,c=""){const u=C(t,e,a,o,r,n,l,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=s,u.yAxis.min=i,delete u.toolbox.show,u}function z(){render_echartMestalla.listeners=["filterDatesParam","updateFilter"],render_echartMalilla.listeners=["filterDatesParam","updateFilter"],render_echartPerellonet.listeners=["filterDatesParam","updateFilter"],render_echartExposicio.listeners=["filterDatesParam","updateFilter"],render_echartSotenis.listeners=["filterDatesParam","updateFilter"],render_echartBeninamet.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const O=-20;function _(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartBenimamet").hide(),$("#chartBenimametStacked").hide(),$("#no_dataBeninamet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataBeninamet").show();else{$("#no_dataBeninamet").hide(),$("#chartBenimamet").css("background","#ffffff"),$("#chartBenimametStacked").css("background","#ffffff"),$("#chartBenimamet").show(),$("#chartBenimametStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE BENIMÀMET",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Benimamet"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=T(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartBenimamet",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,O,t)),L("chartBenimametStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,O,t))}}function P(t,e){let a=e.resultset.filter((t=>"València Ciutat"!==t[1]));a=a.map((t=>t.slice(1))),N(a,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function R(t,e){let a=e.resultset.filter((t=>"kpi-valencia-ciudad-total"===t[0]));a=a.map((t=>t.slice(1))),N(a,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}const G=-20;function V(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartExposicio").hide(),$("#chartExposicioStacked").hide(),$("#no_dataExposicio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExposicio").show();else{$("#no_dataExposicio").hide(),$("#chartExposicio").css("background","#ffffff"),$("#chartExposicioStacked").css("background","#ffffff"),$("#chartExposicio").show(),$("#chartExposicioStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE EXPOSICIÓ",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Exposicio"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=T(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartExposicio",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,G,t)),L("chartExposicioStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,G,t))}}const j=-20;function J(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartMalilla").hide(),$("#chartMalillaStacked").hide(),$("#no_dataMalilla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMalilla").show();else{$("#no_dataMalilla").hide(),$("#chartMalilla").css("background","#ffffff"),$("#chartMalillaStacked").css("background","#ffffff"),$("#chartMalilla").show(),$("#chartMalillaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MALILLA",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Malilla"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=T(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartMalilla",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,j,t)),L("chartMalillaStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,j,t))}}const W=-20;function Y(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartMestalla").hide(),$("#chartMestallaStacked").hide(),$("#no_dataMestalla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMestalla").show();else{$("#no_dataMestalla").hide(),$("#chartMestalla").css("background","#ffffff"),$("#chartMestallaStacked").css("background","#ffffff"),$("#chartMestalla").show(),$("#chartMestallaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MESTALLA",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Mestalla"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));else{for(let t=0;t<r;t+=1)"Mestalla"===o[t][6]&&("Industrial"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),i.push(o[t][8]),d+=o[t][8]),"Domèstic"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),l.push(o[t][8]),d+=o[t][8]),"Serv.Municipal"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),c.push(o[t][8]),d+=o[t][8]),"Aigua no registrada per comptadors"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),u.push(o[t][8]),d+=o[t][8]),n.add(o[t][3]),s.push(o[t][4]));U(s.length,s)}let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],D=[{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],C=T(n.size);L("chartMestalla",B(D,x,Array.from(n.values()),h[0].measureunit,C,!0,null,0,W,t)),L("chartMestallaStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],x,Array.from(n.values()),"%",C,!0,100,0,W,t))}}const q=-20;function H(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartPerellonet").hide(),$("#chartPerellonetStacked").hide(),$("#no_dataPerellonet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPerellonet").show();else{$("#no_dataPerellonet").hide(),$("#chartPerellonet").css("background","#ffffff"),$("#chartPerellonetStacked").css("background","#ffffff"),$("#chartPerellonet").show(),$("#chartPerellonetStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE PERELLONET",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Perellonet"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=T(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],C=[{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}];L("chartPerellonet",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,q,t)),L("chartPerellonetStacked",B(C,D,Array.from(n.values()),"%",x,!0,100,0,q,t))}}const X=-20;function Z(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartSotenis").hide(),$("#chartSotenisStacked").hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSotenis").show();else{$("#no_dataSotenis").hide(),$("#chartSotenis").css("background","#ffffff"),$("#chartSotenisStacked").css("background","#ffffff"),$("#chartSotenis").show(),$("#chartSotenisStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE SOTERNES",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Soternes"===o[e][6]&&(n.add(F(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=T(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartSotenis",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,X,t)),L("chartSotenisStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,X,t))}}function K(t,e){0===e.resultset.length?v("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(A("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),L("chartAiguaTotalBarMonth",function(t,e,a=-45,o="",r=e){const n=new Set,s=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),s.push(Math.round(t[2]))}));const i=s.length<100?40:80;return C({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:s},null,Array.from(n.values()),e,i,!0,a,25,o)}(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function Q(t,e){if(0===e.resultset.length)v("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{A("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=D("chartYearAiguaTotalgauge_semicircle"),a=function(t,e="",a){const o=[],r=x(t,1,1.1),n=r.toString().length>=9?100:95,s=115===n?-45:-35;let i=t.length<5?t.length*s:-190;for(let e=0;e<t.length;e+=1)o.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(i),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(i),"35%"],fontFamily:"Montserrat"}}),i+=n;return I(e,r,o,a)}(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t);L("chartYearAiguaTotalgauge_semicircle",a)}}function tt(t,e){if(0===e.resultset.length)v("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),v("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{A("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),A("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,a=1,o=e.resultset,r=D("chartAiguaTotalreloj_semicircle");L("chartAiguaTotalreloj_semicircle",w(o,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",r)),L("chartAiguaTotalreloj_semicircle_lastmonth",w(o,a,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",r))}}var et=a(2725);function at(t,e){if(0===e.resultset.length)v("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{A("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,et.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function ot(t,a){!function(t,a,o,i,c="",u="total",p=0,h=1,m=2,S=d){if(0===o.length)v(`#${t}`,`#${a}`);else{A(`#${a}`,`#${t}`);const d=[];let v=M(o,p);const x=new Set(o.map((t=>t[h]))),$=Object.keys(v);x.forEach((t=>{$.forEach((e=>{void 0===v[e].find((e=>e[h]===t))&&(v[e].push([v[e][0][p],t,void 0]),v[e][0][1].length>4?v[e].sort(((t,e)=>{const[a,o]=t[1].split("/"),[r,n]=e[1].split("/"),s=new Date(o,a-1,1),i=new Date(n,r-1,1);return s.getTime()-i.getTime()})):v[e].sort())}))}));const D=Object.entries(v).sort(((t,e)=>t[0].localeCompare(e[0]))),C=""===u?90:0;v=Object.fromEntries(D),Object.keys(v).forEach((t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:C,formatter:t=>f(Math.round(t.value))},emphasis:{focus:"series"},data:v[t].map((t=>t[m]))})}));const I=""!==u?g(x.size):100*(1-7/x.size);L(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:n,top:s,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:i,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...x],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...x],start:I,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}}("chartBarrisBar","no_dataBarrisBar",a.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function rt(t,e){N(e,!0,1,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ: HISTÒRIC MENSUAL","m3","chartBarrisLineMonth","no_dataBarrisLineMonth",void 0,!0,void 0,void 0,void 0,void 0,!0)}const nt={es_ES:new Map([["chartNameBarrisGaugeYear","INYECCIÓN DE AGUA POR BARRIOS: EVOLUCIÓN DEL AÑO"]]),ca_ES:new Map([["chartNameBarrisGaugeYear","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ANY"]])},st="ca_ES",it={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function lt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e){const a=e.resultset,o=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,et.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,et.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[r,n]=(0,et.configureDataGaugeCommon)(a,e,o.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),s={...it};s.title.text=t.chartName,s.series.max=r,s.series.data=n,s.series.detail.fontSize=t.fontSize,s.series.detail.formatter=t=>(0,et.addPointInteger)(Math.round(t)),s.series.axisTick.splitNumber=5,s.color=o.slice(),s.series.axisLabel.formatter=t=>(0,et.addPointInteger)(Math.round(t)),s.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,et.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,et.initChart)(t.idChart,s)}}({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${nt[st].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)}))}))}function ct(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e,a,o,r,n,s){if(0===r.length)v(`#${t}`,`#${a}`),v(`#${e}`,`#${o}`);else{A(`#${a}`,`#${t}`),A(`#${o}`,`#${e}`);const i=0,l=2,c=function(t,e){const a=x(t,e,1.1);let o=50,r=180;a>9999999&&(o=65,r=95);const n=M(t,1);let[s,i]=Object.values(n);return Object.values(n).slice(1).forEach((t=>{i=t})),[i,s,n,a,o,r]}(r,l),u=c[0],d=c[1],p=c[2],h=c[3],m=c[5],f=D(t),g=k(u,l,i,m,f),y=k(d,l,i,m,f);L(t,I(`${n}${S(String(Object.keys(p)[1]))}`,h,g,f)),L(e,I(`${s}${S(String(Object.keys(p)[0]))}`,h,y,f))}}("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")}))}))}})(),o})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.aigua=e():t.aigua=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,a)=>{for(var o in a)t.o(a,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:a[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>st,addPointInteger:()=>d,buildCamarasTrafico:()=>pt,buildTableCalidadAire:()=>it,calculateMaxYAxis:()=>v,calculatePentahoPath:()=>lt,calculateXAxisStart:()=>S,checkAllGroupsCollapsed:()=>ot,configureDataBar:()=>w,configureDataGaugeCommon:()=>D,configureDataGaugeMonthCommon:()=>C,configureDataLine:()=>E,configureDataValidate:()=>wt,configureLinesChartValidates:()=>kt,convertToLanguageSelectorDateRange:()=>X,convertToTableTreeView:()=>at,downloadCSVTable:()=>rt,downloadPDFTable:()=>nt,formatCellMultiplesLines:()=>Q,formatDayMonthYear:()=>s,formatMilMillionEuros:()=>x,formatMonthAnyo:()=>n,formatName:()=>m,formatNameHeaderColumn:()=>K,formatRoundTooltip:()=>M,formatShortMonthShortYear:()=>l,formatShortMonthYear:()=>i,formatToMillions:()=>p,formatToTons:()=>h,formatTooltip:()=>b,formatTooltipPie:()=>A,formatTrimestre:()=>c,getEnvironment:()=>ct,getMaxFieldNumberFromData:()=>U,getMonth:()=>o,getMonthList:()=>u,getSelectCommonOptions:()=>j,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>bt,initBarChartComparationMonth:()=>$t,initChart:()=>f,initStackedBarChart:()=>ft,initStackedBarChartMonthSeries:()=>yt,initTable:()=>Z,initValueDefaultDate:()=>q,initialCalls:()=>dt,loadIframeOnClickEvent:()=>Dt,printDataChart:()=>y,printDataInHTMLElements:()=>T,printNoDataChart:()=>g,resetFilter:()=>V,resetFilterDate:()=>Y,resetFilterDates:()=>W,resultsetWithFields:()=>k,selectConfigDatasource:()=>G,selectFilterAll:()=>_,selectValueDefaultInFilter:()=>H,splitDataset:()=>F,traverseRows:()=>et,updateObject:()=>L,updateStackedBarOptions:()=>gt});const a={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function o(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),a[t.substring(4,6)]]}function n(t){const[e,a]=r(t);return`${a} ${e}`}function s(t){const[e,o,r]=function(t){return[t.substring(0,4),a[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${o} ${e}`}function i(t){const[e,a]=r(t);return`${a.substring(0,3)} ${e}`}function l(t){const[e,a]=r(t);return`${a.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,a]=t.split("-");return`${parseFloat(a)/3}T ${e}`}function u(t,e){const a=t[e];return Array.from(a.values()).map((t=>t.slice(0,3)))}function d(t,e=2){let a=navigator.language||navigator.userLanguage;a=a.length<=2?`${a}-${a.toUpperCase()}`:a;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===a?t.toLocaleString("de-DE",o):t.toLocaleString(a,o)}function p(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function h(t){return t>=1e3?t/1e3+" Tn":t.toString()}function m(t,e=29){if(t.length>=e){const a=t.split(" ");let o="",r="";return a.forEach((t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(r+=`${o}\n`,o=t)})),r+=o,r}return t}function f(t,e){const a=document.getElementById(t);if(!a)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const o=echarts.init(a);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const r=document.getElementById("main-content");return r&&(r.addEventListener("shown.bs.collapse",(()=>{o.resize()})),r.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o}function g(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function y(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function b(t,e=!1,a=!0,o=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const n=e?Math.round(t.data):t.data,s=a?`<div style="font-weight: 400;color: #666;">${i=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${i}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${d(n)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${d(n)} ${o}`:"-"}\n </span>\n </div>`;var i;r+=s})),r}function S(t){return 100*(t-120)/t}function v(t,e){const a=Math.max(...t);return a+(e-a%e)}function A(t,e=!1){const a=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,o=e?`${t.percent}%`:d(t.value);return`<div> ${a} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function M(t,e){let a=`${t.name} : `;return a+=`<span style="font-weight:500">${d(Math.round(t.value))}</span>`,e&&(a+=`<span> (${t.percent}%)</span>`),t.marker+a}function x(t){const e=1e6,a=Number(t);return a>=0&&a<e?`${d(a)} €`:a>=e?`${d(a/e)} M €`:"-"}function $(t,e,a=1){const o=Math.max(...t.map((t=>t[e])))*a;return 5e3*Math.ceil(o/5e3)}function D(t,e,a,o=30,r=15,n=30,s=-70,i=70,l=3){const c=$(t,e.data,1.1),u=i,p=a.slice(),h=[];let f=r,g=n,y=s;for(let a=0;a<t.length;a+=1)h.push({value:t[a][e.data],name:m(String(t[a][e.type]).replace(/\[.*?\]/g,"")),color:p.shift(),title:{offsetCenter:[`${String(y)}%`,`${String(f)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(y)}%`,`${String(g)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),y+=u,(a+1)%l==0&&(g+=n,f+=2*r,y=s);return[c,h]}function C(t,e,a,r=0){return[$(e,a.data,1),t=>function(t,e,a){const r=d(Math.round(e)),n=o(t[a][0]),s=t[a][1],i=`\n${n} ${s} : ${r}`,l=`${r}\n${n} ${s}`;return window.innerWidth<=1710?i:l}(e,t,r),[{value:e[r][a.data]}]]}function I(t,e){const{resultset:a}={resultset:t},o=new Set,r=new Set,n=a.map((([t,a,n])=>{const s=e?Math.round(n):n;return o.add(t),r.add(a),{day:a,type:t,value:s}})),s=Array.from(r.values()),i=Array.from(o.values());return i.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[i.map((t=>{const e=n.filter((e=>e.type===t)).map((({day:e,value:a})=>[e,t,a])),a=s.map((t=>{const a=e.find((([e])=>e===t));return a?a[2]:null}));return{name:t,data:a}})),i,r]}function E(t,e=[],a=!1){const[o,r,n]=I(t,a);return o.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[o,n,r]}function w(t,e,a=!1){const[o,r,n]=I(t,a);return o.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[o,n,r]}function k(t){const{resultset:e,metadata:a}=t,o=[];return e.forEach((t=>{const e={};t.forEach(((t,o)=>{e[a[o].colName]=t})),o.push(e)})),o}function L(t,e){const a=t;return Object.keys(e).forEach((o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o?a[o]=e[o].map(((e,a)=>({...t[o][a],...e}))):"object"!=typeof e[o]||Array.isArray(e[o])?a[o]=e[o]:a[o]=L(t[o]||{},e[o]))})),t}function T(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((a=>{const o=a[0],r=a[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[o]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][o].format(t[o])):document.querySelector(r).textContent=t[o]}))}))}function U(t,e){const a=k(t),o=[];let r=null;return a.forEach((t=>{const a=t[e];"number"!=typeof a||Number.isNaN(a)||o.push(a)})),o.length>0&&(r=Math.max(...o)),r}function F(t,e=!0){const a={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?a.Cont.push([t[3],t[4],t[2]]):a.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?a.Mob.push([t[3],t[4],t[2]]):a.Mob.push([t[3],t[2]]))})),a}const N=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],B=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],O=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],P=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function _(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function R(t){for(const e of t)if(Array.isArray(e)){if(!R(e))return!1}else if("All"!==e)return!1;return!0}function G(t,e,a,o){return R(e)?(t.queryDefinition.dataAccessId=a,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function V(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function j(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function W(t,e,a,o){const r=Dashboards.getParameterValue(a),n=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[n]),!0}function Y(t,e){const a=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[a]),!0}function q(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function H(t,e){const a=Dashboards.getParameterValue(e),o=t.parameter;t.dashboard.setParameter(o,[a])}function X(t){t.regional.es={monthNames:N,abbreviatedMonthNames:B,dayNames:O,abbreviatedDayNames:z,dayNamesMin:P,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Z(t,e){const a=document.getElementById(t);return a?new Tabulator(a,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function K(t,e){let a=t.getValue();return a.length>e&&(a=`${a.substr(0,e)}<br>${a.substr(e)}`),a}function Q(t,e){const a=t.getValue().split(" ");let o="",r="";return a.forEach((t=>{(r+t).length<=e?r+=`${t} `:(o+=`${r}<br>`,r=`${t} `)})),o+=`${r}<br>`,o}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const a=t.getTreeChildren();a.length>0&&a.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function at(t,e,a,o){const r=[];for(const n in t)if(t.hasOwnProperty(n)){const s=t[n],i={[e]:s[0],_children:[]};s.shift(),s.forEach(((t,r)=>{const n={[e]:a[r],[o]:t};i._children.push(n)})),r.push(i)}return r}function ot(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function rt(t,e,a){const o=document.getElementById(a),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function nt(t,e,a){const o=document.getElementById(a),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const st={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function it(t){const e=[],a={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function o(t,e,o){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let o;return void 0===e?o=6:"ND"===e?o=7:(o=5,t.forEach(((t,a)=>{e<=t&&5===o&&(o=a)}))),a[o]}(o,e);r.classList.add(t)}return r}return t.forEach((t=>{const a=t;"noData"===a.operationalstatus&&(a.so2value="ND",a.no2value="ND",a.o3value="ND",a.pm10value="ND",a.pm25value="ND"),"A09_CABANYAL_60m"===a.entityid&&(a.pm10value=void 0,a.pm25value=void 0);const r=document.createElement("tr"),n=document.createElement("td");n.innerHTML=a.address,r.appendChild(n),r.appendChild(o(`${a.entityid}_so2`,a.so2value,st.SO2)),r.appendChild(o(`${a.entityid}_no2`,a.no2value,st.NO2)),r.appendChild(o(`${a.entityid}_o3`,a.o3value,st.O3)),r.appendChild(o(`${a.entityid}_pm10`,a.pm10value,st.PM10)),r.appendChild(o(`${a.entityid}_pm25`,a.pm25value,st.PM25)),e.push(r)})),e}function lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ut(t,e){document.querySelectorAll(`[${t}]`).forEach((a=>{!function(t,e,a){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,a&&a()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(a.getAttribute(t),a,e)}))}function dt(t){ut("include-html-cabecera",(function(){!function(){const t=ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ut("include-html-menu"),ut("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),ut("include-html-copyright")}function pt(t,e,a,o,r,n){let s=!1,i=!1;const l=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(l&&l.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(a);t?(l&&(l.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),i=!0):(e.classList.remove("blur"),u(),i=!1)}const p=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(i||u(),s||(s=!0,window.setTimeout(d,n)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(l&&(l.setAttribute("sandbox","allow-scripts"),p(l)),c&&(c.setAttribute("sandbox","allow-scripts"),p(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,n)}))):document.querySelectorAll(o)[0].style.display="none"}const ht={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${p(t)}€`}}]},mt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const a={};e.forEach((e=>{const o=e[1],r=e[0];r!==t.seriesName||a[o]||(a[o]=0),r===t.seriesName&&(a[o]+=e[2])}));let o=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(a))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${d(r)}</span></div>`;return o};function ft(t,e,a=void 0,o=void 0){const r=null===o?void 0:o,n=new Set(e.map((t=>t[1])));let s;const i={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>mt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,a,o,r){const n={},s=r.contentSize[1]/2,i=r.viewSize[1],l=t[1];return l<s?n.top=10:l+s>i?n.bottom=10:n.top=l-s,t[0]<r.viewSize[0]/2?n.left=t[0]+20:n.right=r.viewSize[0]-t[0]+20,n}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>d(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(n),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>d(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(s=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const a=function(t){return t.reduce(((t,e)=>{const a=e[0];return t[a]||(t[a]=[]),t[a].push(e),t}),{})}(e),o=Object.keys(a);n.forEach((t=>{o.forEach((e=>{void 0===a[e].find((e=>e[1]===t))&&(a[e].push([a[e][0][0],t,void 0]),a[e].sort())}))}));const i=[];return Object.keys(a).forEach((e=>{s&&(t.itemStyle={borderColor:s.shift()}),t.name=e,t.data=a[e].map((t=>t[2]));let o={};o=void 0!==r?L(t,r):t,i.push({...o})})),i})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let l={};l=void 0!==a?L(i,a):i,f(t,l)}function gt(t){let e={};return e=L(t,ht),e}function yt(t,e,a={},r={}){let n={};n=L(a,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const s={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},i=null===r?s:L(r,s),l=e;l.forEach(((t,e)=>{l[e][0]=o(t[0])})),ft(t,l,n,i)}function bt(t,e=void 0){const a={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>M(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?L(a,e):a,f(t,o)}const St="es_ES",vt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function At(t){return Math.max(...t.map((t=>Number(t[0]))))}function Mt(t){const e=t.filter((e=>Number(e[0])===At(t))),a=Array.from({length:12},(()=>0));return e.forEach((([t,e,o])=>{const r=parseInt(e,10)-1;a[r]=o})),a}function xt(t){const e=t.filter((e=>Number(e[0])===At(t)-1)),a=Array.from({length:12},(()=>0));return e.forEach((([t,e,o])=>{const r=parseInt(e,10)-1;a[r]=o})),a}function $t(t,e,a=void 0){const o=At(e).toString(),r=(At(e)-1).toString();bt(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,o],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:u(vt,St),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:xt(e)},{name:o,type:"bar",barGap:0,data:Mt(e)}]},a))}function Dt(t,e,a){const o=document.querySelector(e),r=document.querySelector(t);let n=!1;r.addEventListener("click",(()=>{!1===n&&(n=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",a),o.onload=()=>{n=!1})})),r.disabled=!1}const Ct="id",It="fecha",Et="value";function wt(t,e,a,o){const[r,n]=function(t,e,a){const o=[],r=[];return t.forEach((t=>{e.includes(`${t[Ct]}`)?o.push(`${t[It]}`):a.includes(`${t[Ct]}`)&&r.push(`${t[It]}`)})),[o.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,a,o);let s="Datos sin validar";0===n.length&&(s="");const i={name:"Datos validados",type:"line",data:[...r,n[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let l="",c="";if(0===n.length){const e=t[t.length-1].fecha;l=e,c=e}else l=n[0][0],c=n[n.length-1][0];return[...e,i,{name:"Datos NO validados",type:"line",data:n,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:s,xAxis:l,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[Et])).map((t=>parseInt(`${t[Et]}`,10))))}]]}}]}function kt(t,e,a=void 0){f(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>b(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},a))}return e})(),t.exports=e()}},e={};function a(o){var r=e[o];if(void 0!==r)return r.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,a),n.exports}a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";a.r(o),a.d(o,{echartAiguaBarMonth:()=>K,echartAiguaGaugeSemicircle:()=>Q,echartAiguaRelojSemicircle:()=>tt,echartAiguaStackedBarYears:()=>at,echartBarrisBarYear:()=>ot,echartBarrisGaugeMonth:()=>ct,echartBarrisGaugeYear:()=>lt,echartBarrisLineMonth:()=>rt,echartBenimamet:()=>P,echartConsumAguaBarris:()=>_,echartConsumTotalAgua:()=>R,echartExposicio:()=>V,echartMalilla:()=>J,echartMestalla:()=>Y,echartPerellonet:()=>H,echartSotenis:()=>Z,listeneresAgua:()=>O});const t="8%",e="2.5%",r="5%",n="18%",s="20%",i="10%",l="90%",c="1%",u="0%",d=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"],p=33,h=27,m=30;function f(t){let e=navigator.language||navigator.userLanguage;e=e.length<=2?`${e}-${e.toUpperCase()}`:e;const a={minimumFractionDigits:0,maximumFractionDigits:2};return"es-ES"===e?t.toLocaleString("de-DE",a):t.toLocaleString(e,a)}function g(t){return 100*(1-17/t)}function y(t,e=!1){let a=`<p>${t[0].name}</p>`;return t.forEach((t=>{const o=e?Math.round(t.data):t.data,r=`<div>${n=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${n}"></span>`} ${t.seriesName}: <strong style="float: right; margin-left:20px">${t.data?f(o):"-"}</strong></div>`;var n;a+=r})),a}function b(t){return f(t)}function S(t){return{1:"GENER",2:"FEBRER",3:"MARÇ",4:"ABRIL",5:"MAIG",6:"JUNY",7:"JULIO",8:"AGOST",9:"SETEMBRE",10:"OCTUBRE",11:"NOVEMBRE",12:"DESEMBRE"}[t]}function v(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function A(t,e){const a=t?document.querySelector(t):null,o=e?document.querySelector(e):null;a&&(a.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function M(t,e){return t.reduce(((t,a)=>{const o=a[e];return t[o]||(t[o]=[]),t[o].push(a),t}),{})}function x(t,e,a=1){const o=Math.max(...t.map((t=>t[e])))*a;return 5e3*Math.ceil(o/5e3)}function D(t){return Math.round(document.getElementById(t).offsetWidth/p)}function C(a,o,d,p,h,m,f,g=5,S="",v=h,A=100,M,x=void 0,$=void 0){return{title:{text:S,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",show:!0,formatter:t=>y(t),textStyle:{fontFamily:"Montserrat"}},legend:o?{type:"plain",data:o,textStyle:{fontFamily:"Montserrat"},top:x||t,selected:M}:null,grid:{left:e,right:r,bottom:n,top:o?x?"30%":s:i,heigh:l,containLabel:!0},xAxis:{type:"category",data:d,boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{name:p,nameLocation:"end",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"bold",padding:[0,0,0,f]},type:"value",scale:!0,min:$,axisLabel:{margin:g,formatter:b,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},series:a,dataZoom:[{show:m,data:d,start:v,end:A,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}],toolbox:{show:m,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:c,top:u}}}function I(t,e,a,o){return{color:d,title:{text:t,left:"center",top:"top",padding:10,textStyle:{fontSize:o,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"},formatter:t=>function(t,e){const a=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${t.color};"></span>`;let o=`${t.name} : `;return o+=`<span style="font-weight:bold">${f(t.value)}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),a+o}(t,!1)},splitNumber:3,series:{type:"gauge",max:e,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:5},axisLabel:{show:!0,distance:70,formatter:t=>f(Math.round(t)),fontFamily:"Montserrat",color:"#666"},data:a,detail:{fontSize:o/1.2,color:"inherit",formatter:t=>f(Math.round(t))}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function E(t,e,a="",o){return{title:{text:a,left:"center",top:"top",padding:10,textStyle:{fontSize:o,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},series:{type:"gauge",startAngle:-180,endAngle:0,splitNumber:2,max:x(t,2),itemStyle:{color:"#FFAB91"},progress:{show:!0,width:30},pointer:{show:!1},axisLine:{lineStyle:{width:30}},axisTick:{distance:10,splitNumber:5,lineStyle:{width:2,color:"#999"}},splitLine:{distance:10,length:14,lineStyle:{width:3,color:"#999"}},axisLabel:{fontFamily:"Montserrat",color:"#666",fontSize:14,show:!0,distance:40,formatter:t=>f(Math.round(t))},anchor:{show:!1},title:{show:!1},detail:{valueAnimation:!0,width:"60%",lineHeight:40,borderRadius:8,offsetCenter:[-5,"-10%"],fontSize:o+5,fontWeight:"bolder",formatter:a=>function(t,e,a){const o=f(Math.round(e)),r=(n=t[a][0],{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(n.toString(),10)]);var n;const s=t[a][1],i=`\n\n\n${r} ${s} : ${o}`,l=`${o}\n${r} ${s}`;return window.innerWidth<=1710?i:l}(t,a,e),fontFamily:"Montserrat",color:"inherit"},data:[{value:t[e][2]}]},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:h,top:m}}}function w(t){if(t.length>=29){const e=t.split(" ");let a="",o="";for(const t of e)`${a} ${t}`.length<=29?a+=(a?" ":"")+t:(o+=`${a}\n`,a=t);return o+=a,o}return t}function k(t,e,a,o,r){let n=20,s=35,i=-190,l=o;t.length<=2&&(i=-140,l+=100,n=25,s=42);const c=d.slice(),u=[];for(let o=0;o<t.length;o+=1)u.push({value:t[o][e],name:w(t[o][a]),color:c.shift(),title:{offsetCenter:[String(i),`${String(n)}%`],fontFamily:"Montserrat",fontSize:r-3},detail:{offsetCenter:[String(i),`${String(s)}%`],fontFamily:"Montserrat"}}),i+=l,(o+1)%3==0&&(s+=30,n+=30,i=-190);return u}function L(t,e){const a=document.getElementById(t);if(!a)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const o=echarts.init(a);return o.setOption(e,!0),$(window).on("resize",(()=>{null!=o&&void 0!==o&&o.resize()})),o}function T(t,e,a){const o=$("#formFilterDates");if(""===Dashboards.getParameterValue("updateFilter")){const a=new Set;for(let o=t-1;o>0;--o)a.add(e[o]);for(const[t,e]of a.entries())o.append(`<input type="checkbox" id="${t}" onclick="legacy.filterDatesUpdate();" />${e}<br /></input>`);(function(){const t=$("#formFilterDates").find("input");$(t).each(((t,e)=>{e.checked&&(e.checked=!1)}));const e=$("#formFilterVar").find("input");$(e).each(((t,e)=>{e.checked&&(e.checked=!1)})),function(){let t=0;const e=$("#formFilterDates").find("input");$(e).each(((e,a)=>{t+=1,a.checked=!0})),t=0;const a=$("#formFilterVar").find("input");$(a).each(((e,a)=>{t+=1,null!=render_tableVariacio?t<=2&&(a.checked=!0):t<=3&&(a.checked=!0)})),console.error(`VALORES FILTRO: ${Dashboards.getParameterValue("filterVarParam")}`),Dashboards.getParameterValue("filterVarParam").length>0&&Dashboards.fireChange("filterVarParam")}()})(),function(){const t=$("#formFilterDates").find("input"),e=[];$(t).each(((t,a)=>{a.checked&&e.push(a.id)})),Dashboards.fireChange("filterDatesParam",e),Dashboards.fireChange("updateFilter","True")}()}}function U(t){return t.replace(/^(\d{4})[-|\/](\d{2})[-|\/](\d{2})$/g,"$3/$2/$1")}function F(t){return 100*(t-120)/t}function N(t,e,a,o,r,n,s,i,l=!1,c=!1,u=void 0,p=!0,h=d.slice(),m=!1,f=void 0,y=void 0){const b=t.resultset||t;if(0===b.length)v(`#${n}`,`#${s}`),i&&v(`#${i}`,`#${s}`);else{A(`#${s}`,`#${n}`),i&&A(`#${s}`,`#${i}`);const t=function(t,e,a=!1){const{resultset:o}={resultset:t},r=new Set,n=new Set,s=e,i=o.map((([t,e,o])=>{const s=a?Math.round(o):o;return r.add(t),n.add(e),{day:e,type:t,value:s}})),l=Array.from(n.values()),c=Array.from(r.values());return c.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[c.map((t=>{const e=i.filter((e=>e.type===t)).map((({day:e,value:a})=>[e,t,a])),a=l.map((t=>{const a=e.find((([e])=>e===t));return a?a[2]:null}));return{name:t,type:"line",symbol:"circle",color:s.shift(),symbolSize:6,smooth:!1,data:a}})),n,c]}(b,h,m),d=t[0],v=t[1],M=t[2],x=p?M:null,$=c?(S=v,Array.from(S.values()).map((t=>{const[e,a]=t.split("/");return function(t){const e=t.slice(0,2);return`${t.slice(3,5)}/${e}`}(t)}))):Array.from(v.values());void 0===u&&(u=l?g(v.size):F(v.size)),L(n,C(d,x,$,r,u,e,a,void 0,o,void 0,void 0,void 0,f,y))}var S}function B(t,e,a,o,r,n,s,i,l,c=""){const u=C(t,e,a,o,r,n,l,void 0,c);return u.yAxis.nameTextStyle.align="left",delete u.yAxis.axisLabel.margin,u.yAxis.max=s,u.yAxis.min=i,delete u.toolbox.show,u}function O(){render_echartMestalla.listeners=["filterDatesParam","updateFilter"],render_echartMalilla.listeners=["filterDatesParam","updateFilter"],render_echartPerellonet.listeners=["filterDatesParam","updateFilter"],render_echartExposicio.listeners=["filterDatesParam","updateFilter"],render_echartSotenis.listeners=["filterDatesParam","updateFilter"],render_echartBeninamet.listeners=["filterDatesParam","updateFilter"],Dashboards.fireChange("filterDatesParam"),Dashboards.fireChange("updateFilter")}const z=-20;function P(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartBenimamet").hide(),$("#chartBenimametStacked").hide(),$("#no_dataBeninamet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataBeninamet").show();else{$("#no_dataBeninamet").hide(),$("#chartBenimamet").css("background","#ffffff"),$("#chartBenimametStacked").css("background","#ffffff"),$("#chartBenimamet").show(),$("#chartBenimametStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE BENIMÀMET",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Benimamet"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=F(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartBenimamet",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,z,t)),L("chartBenimametStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,z,t))}}function _(t,e){let a=e.resultset.filter((t=>"València Ciutat"!==t[1]));a=a.map((t=>t.slice(1))),N(a,!0,1,"INJECCIÓ D'AIGUA PER BARRIS","m3","chartConsumAguaBarris","no_dataConsumAguaBarris")}function R(t,e){let a=e.resultset.filter((t=>"kpi-valencia-ciudad-total"===t[0]));a=a.map((t=>t.slice(1))),N(a,!0,1,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ DIÀRIA","m3","chartConsumTotalAgua","no_dataConsumTotalAgua",void 0,void 0,void 0,void 0,!1)}const G=-20;function V(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartExposicio").hide(),$("#chartExposicioStacked").hide(),$("#no_dataExposicio").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataExposicio").show();else{$("#no_dataExposicio").hide(),$("#chartExposicio").css("background","#ffffff"),$("#chartExposicioStacked").css("background","#ffffff"),$("#chartExposicio").show(),$("#chartExposicioStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE EXPOSICIÓ",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Exposicio"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=F(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartExposicio",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,G,t)),L("chartExposicioStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,G,t))}}const j=-20;function J(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartMalilla").hide(),$("#chartMalillaStacked").hide(),$("#no_dataMalilla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMalilla").show();else{$("#no_dataMalilla").hide(),$("#chartMalilla").css("background","#ffffff"),$("#chartMalillaStacked").css("background","#ffffff"),$("#chartMalilla").show(),$("#chartMalillaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MALILLA",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Malilla"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=F(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartMalilla",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,j,t)),L("chartMalillaStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,j,t))}}const W=-20;function Y(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length)$("#chartMestalla").hide(),$("#chartMestallaStacked").hide(),$("#no_dataMestalla").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataMestalla").show();else{$("#no_dataMestalla").hide(),$("#chartMestalla").css("background","#ffffff"),$("#chartMestallaStacked").css("background","#ffffff"),$("#chartMestalla").show(),$("#chartMestallaStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE MESTALLA",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Mestalla"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));else{for(let t=0;t<r;t+=1)"Mestalla"===o[t][6]&&("Industrial"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),i.push(o[t][8]),d+=o[t][8]),"Domèstic"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),l.push(o[t][8]),d+=o[t][8]),"Serv.Municipal"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),c.push(o[t][8]),d+=o[t][8]),"Aigua no registrada per comptadors"===o[t][7]&&(n.add(o[t][3]),s.push(o[t][4]),u.push(o[t][8]),d+=o[t][8]),n.add(o[t][3]),s.push(o[t][4]));T(s.length,s)}let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],D=[{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],C=F(n.size);L("chartMestalla",B(D,x,Array.from(n.values()),h[0].measureunit,C,!0,null,0,W,t)),L("chartMestallaStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],x,Array.from(n.values()),"%",C,!0,100,0,W,t))}}const q=-20;function H(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartPerellonet").hide(),$("#chartPerellonetStacked").hide(),$("#no_dataPerellonet").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataPerellonet").show();else{$("#no_dataPerellonet").hide(),$("#chartPerellonet").css("background","#ffffff"),$("#chartPerellonetStacked").css("background","#ffffff"),$("#chartPerellonet").show(),$("#chartPerellonetStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE PERELLONET",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Perellonet"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=0,g=0,y=0,b=0)}const x=F(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"],C=[{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}];L("chartPerellonet",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,q,t)),L("chartPerellonetStacked",B(C,D,Array.from(n.values()),"%",x,!0,100,0,q,t))}}const X=-20;function Z(t,e){const a=Dashboards.getParameterValue("filterDatesParam");if(0===e.resultset.length||0===a.length)$("#chartSotenis").hide(),$("#chartSotenisStacked").hide(),$("#no_dataSotenis").css("background","url('./build/images/nodata1.png') no-repeat top center"),$("#no_dataSotenis").show();else{$("#no_dataSotenis").hide(),$("#chartSotenis").css("background","#ffffff"),$("#chartSotenisStacked").css("background","#ffffff"),$("#chartSotenis").show(),$("#chartSotenisStacked").show();const t="INJECCIÓ D'AIGUA AL BARRI DE SOTERNES",o=e.resultset,r=e.resultset.length,n=new Set,s=[];let i=[],l=[],c=[],u=[],d=0;const p=[],h=[];let m;if(a.length>0)for(let t=a.length;t>=0;t-=1)for(let e=0;e<r;e+=1)a[t]===o[e][4]&&"Soternes"===o[e][6]&&(n.add(U(o[e][1])),s.push(o[e][4]),m={fecha:o[e][1],mesAbr:o[e][4],diaAbr:o[e][3],tipoUso:o[e][7],valor:o[e][8],measureunit:o[e][9]},h.push(m));let f=0,g=0,y=0,b=0;const S=[],v=[],A=[],M=[];i=[],l=[],c=[],u=[];for(let t=0;t<h.length;t+=1){const e=t+1<h.length?t+1:h.length-1;t===h.length-1?("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null):h[t].fecha===h[e].fecha?(d+=h[t].valor,"Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor)):("Domèstic"===h[t].tipoUso&&(f=h[t].valor),"Industrial"===h[t].tipoUso&&(g=h[t].valor),"Serv.Municipal"===h[t].tipoUso&&(y=h[t].valor),"Aigua no registrada per comptadors"===h[t].tipoUso&&(b=h[t].valor),d+=h[t].valor,i.push(g),l.push(f),c.push(y),u.push(b),f=f/d*100,g=g/d*100,y=y/d*100,b=b/d*100,p.push([f,g,y,b]),S.push(f),v.push(g),A.push(y),M.push(b),d=0,f=null,g=null,y=null,b=null)}const x=F(n.size),D=["Aigua no registrada per comptadors","Domèstic","Industrial","Serv.Municipal"];L("chartSotenis",B([{name:"Aigua no registrada per comptadors",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:u},{name:"Domèstic",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:l},{name:"Industrial",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:i},{name:"Serv.Municipal",type:"line",smooth:!1,symbol:"circle",symbolSize:6,data:c}],D,Array.from(n.values()),h[0].measureunit,x,!0,null,0,X,t)),L("chartSotenisStacked",B([{name:"Aigua no registrada per comptadors",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:M},{name:"Domèstic",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:S},{name:"Industrial",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:v},{name:"Serv.Municipal",type:"bar",stack:"total",label:{show:!1},emphasis:{focus:"series"},data:A}],D,Array.from(n.values()),"%",x,!0,100,0,X,t))}}function K(t,e){0===e.resultset.length?v("#chartAiguaTotalBarMonth","#no_dataAiguaTotalBarMonth"):(A("#no_dataAiguaTotalBarMonth","#chartAiguaTotalBarMonth"),L("chartAiguaTotalBarMonth",function(t,e,a=-45,o="",r=e){const n=new Set,s=[];t.forEach((t=>{const e=t[0].toString().padStart(2,"0");n.add(`${e}/${t[1]}`),s.push(Math.round(t[2]))}));const i=s.length<100?40:80;return C({name:r,type:"bar",smooth:!1,barMaxWidth:40,itemStyle:{color:"#5470c6"},textStyle:{fontFamily:"Montserrat"},data:s},null,Array.from(n.values()),e,i,!0,a,25,o)}(e.resultset,"m3",void 0,"INJECCIÓ TOTAL D'AIGUA: EVOLUCIÓ MENSUAL","València Ciutat")))}function Q(t,e){if(0===e.resultset.length)v("#chartYearAiguaTotalgauge_semicircle","#no_dataYearAiguaTotalgauge_semicircle");else{A("#no_dataYearAiguaTotalgauge_semicircle","#chartYearAiguaTotalgauge_semicircle");const t=D("chartYearAiguaTotalgauge_semicircle"),a=function(t,e="",a){const o=[],r=x(t,1,1.1),n=r.toString().length>=9?100:95,s=115===n?-45:-35;let i=t.length<5?t.length*s:-190;for(let e=0;e<t.length;e+=1)o.push({value:t[e][1],name:String(t[e][0]),title:{offsetCenter:[String(i),"20%"],fontFamily:"Montserrat"},detail:{offsetCenter:[String(i),"35%"],fontFamily:"Montserrat"}}),i+=n;return I(e,r,o,a)}(e.resultset,"INJECCIÓ TOTAL D'AIGUA: ÚLTIMS ANYS",t);L("chartYearAiguaTotalgauge_semicircle",a)}}function tt(t,e){if(0===e.resultset.length)v("#chartAiguaTotalreloj_semicircle","#no_dataAiguaTotalreloj_semicircle"),v("#chartAiguaTotalreloj_semicircle_lastmonth","#no_dataAiguaTotalreloj_semicircle_lastmonth");else{A("#no_dataAiguaTotalreloj_semicircle","#chartAiguaTotalreloj_semicircle"),A("#no_dataAiguaTotalreloj_semicircle_lastmonth","#chartAiguaTotalreloj_semicircle_lastmonth");const t=0,a=1,o=e.resultset,r=D("chartAiguaTotalreloj_semicircle");L("chartAiguaTotalreloj_semicircle",E(o,t,"INJECCIÓ TOTAL D'AIGUA: MES ACTUAL",r)),L("chartAiguaTotalreloj_semicircle_lastmonth",E(o,a,"INJECCIÓ TOTAL D'AIGUA: MES ANTERIOR",r))}}var et=a(2725);function at(t,e){if(0===e.resultset.length)v("#chartAiguaTotalstackedBarYears","#no_dataAiguaTotalstackedBarYears");else{A("#no_dataAiguaTotalstackedBarYears","#chartAiguaTotalstackedBarYears");const t={title:{text:"INJECCIÓ TOTAL D'AIGUA: DESGLOSSAMENT DELS ÚLTIMS ANYS"},xAxis:{name:"\n\n\n\nm3"}};(0,et.initStackedBarChartMonthSeries)("chartAiguaTotalstackedBarYears",e.resultset,t)}}function ot(t,a){!function(t,a,o,i,c="",u="total",p=0,h=1,m=2,S=d){if(0===o.length)v(`#${t}`,`#${a}`);else{A(`#${a}`,`#${t}`);const d=[];let v=M(o,p);const x=new Set(o.map((t=>t[h]))),$=Object.keys(v);x.forEach((t=>{$.forEach((e=>{void 0===v[e].find((e=>e[h]===t))&&(v[e].push([v[e][0][p],t,void 0]),v[e][0][1].length>4?v[e].sort(((t,e)=>{const[a,o]=t[1].split("/"),[r,n]=e[1].split("/"),s=new Date(o,a-1,1),i=new Date(n,r-1,1);return s.getTime()-i.getTime()})):v[e].sort())}))}));const D=Object.entries(v).sort(((t,e)=>t[0].localeCompare(e[0]))),C=""===u?90:0;v=Object.fromEntries(D),Object.keys(v).forEach((t=>{d.push({name:t,type:"bar",stack:u,label:{show:!0,fontFamily:"Montserrat",rotate:C,formatter:t=>f(Math.round(t.value))},emphasis:{focus:"series"},data:v[t].map((t=>t[m]))})}));const I=""!==u?g(x.size):100*(1-7/x.size);L(t,{color:S,title:{text:c,left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat"},formatter:t=>y(t,!0)},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:e,right:r,bottom:n,top:s,heigh:l,containLabel:!0},yAxis:{type:"value",splitNumber:4,name:i,nameLocation:"end",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666"},axisLabel:{formatter:b,textStyle:{fontSize:8,fontFamily:"Montserrat",color:"#666"}}},xAxis:{type:"category",data:[...x],axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:d,toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50},dataZoom:[{show:!0,data:[...x],start:I,end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}}]})}}("chartBarrisBar","no_dataBarrisBar",a.resultset,"m3","INJECCIÓ D'AIGUA PER BARRIS: HISTÒRIC ANUAL","")}function rt(t,e){N(e,!0,1,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ: HISTÒRIC MENSUAL","m3","chartBarrisLineMonth","no_dataBarrisLineMonth",void 0,!0,void 0,void 0,void 0,void 0,!0)}const nt={es_ES:new Map([["chartNameBarrisGaugeYear","INYECCIÓN DE AGUA POR BARRIOS: EVOLUCIÓN DEL AÑO"]]),ca_ES:new Map([["chartNameBarrisGaugeYear","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ANY"]])},st="ca_ES",it={color:void 0,title:{text:"",left:"center",top:"top",padding:10,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat"}},splitNumber:3,series:{type:"gauge",max:void 0,startAngle:-180,endAngle:0,splitNumber:2,pointer:{show:!1,icon:"roundRect"},progress:{show:!0,overlap:!1,roundCap:!0,clip:!0,itemStyle:{borderWidth:1,borderColor:"#464646"}},axisLine:{lineStyle:{width:60}},splitLine:{show:!0,distance:10,length:10},axisTick:{show:!0,splitNumber:10},axisLabel:{show:!0,distance:70,formatter:void 0,fontFamily:"Montserrat",color:"#666"},data:[],detail:{fontSize:12,color:"inherit"}},toolbox:{show:!0,feature:{saveAsImage:{title:"Desar"}},right:27,top:30}};function lt(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e){const a=e.resultset,o=["#9c89b8","#4ea8de","#05668d","#ffbf69","#e56b6f","#83c5be","#02c39a","#ee9b00","#cdb4db","#ffadad","#ce4257","#b7b7a4"];if(0===e.length)(0,et.printNoDataChart)(`#${t.idChart}`,`#${t.idNoData}`);else{(0,et.printDataChart)(`#${t.idNoData}`,`#${t.idChart}`);const e={type:0,data:1,time:2},[r,n]=(0,et.configureDataGaugeCommon)(a,e,o.slice(),t.fontSize,t.paramOffsetCenterTitle,t.paramOffsetCenterDetail,t.paramOffsetLabel,t.paramCalculatedOffset,t.paramNumberOfElementsByLine),s={...it};s.title.text=t.chartName,s.series.max=r,s.series.data=n,s.series.detail.fontSize=t.fontSize,s.series.detail.formatter=t=>(0,et.addPointInteger)(Math.round(t)),s.series.axisTick.splitNumber=5,s.color=o.slice(),s.series.axisLabel.formatter=t=>(0,et.addPointInteger)(Math.round(t)),s.tooltip.formatter=t=>function(t){let e=`${t.name} : `;return e+=`<span style="font-weight:bold">${(0,et.addPointInteger)(Math.round(t.value))}</span>`,t.marker+e}(t),(0,et.initChart)(t.idChart,s)}}({idChart:"chartBarrisGaugeYear",idNoData:"no_dataBarrisGaugeYear",chartName:`${nt[st].get("chartNameBarrisGaugeYear")} ${e.resultset[0][2]}`,fontSize:12,paramOffsetCenterTitle:15,paramOffsetCenterDetail:30,paramOffsetLabel:-100,paramCalculatedOffset:100,paramNumberOfElementsByLine:3},e)}))}))}function ct(t,e){document.querySelector("#tabConsumAguaBarris").addEventListener("click",(()=>{requestAnimationFrame((()=>{!function(t,e,a,o,r,n,s){if(0===r.length)v(`#${t}`,`#${a}`),v(`#${e}`,`#${o}`);else{A(`#${a}`,`#${t}`),A(`#${o}`,`#${e}`);const i=0,l=2,c=function(t,e){const a=x(t,e,1.1);let o=50,r=180;a>9999999&&(o=65,r=95);const n=M(t,1);let[s,i]=Object.values(n);return Object.values(n).slice(1).forEach((t=>{i=t})),[i,s,n,a,o,r]}(r,l),u=c[0],d=c[1],p=c[2],h=c[3],m=c[5],f=D(t),g=k(u,l,i,m,f),y=k(d,l,i,m,f);L(t,I(`${n}${S(String(Object.keys(p)[1]))}`,h,g,f)),L(e,I(`${s}${S(String(Object.keys(p)[0]))}`,h,y,f))}}("chartBarrisMesActual","chartBarrisMesAnterior","no_dataBarrisMesActual","no_dataBarrisMesAnterior",e.resultset,"INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ","INJECCIÓ D'AIGUA PER BARRIS: EVOLUCIÓ ")}))}))}})(),o})()));
|
package/dist/js/analitica.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.analitica=e():t.analitica=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{addPointInteger:()=>d,buildCamarasTrafico:()=>dt,buildTableCalidadAire:()=>it,calculateMaxYAxis:()=>v,calculatePentahoPath:()=>lt,calculateXAxisStart:()=>S,checkAllGroupsCollapsed:()=>nt,configureDataBar:()=>F,configureDataGaugeCommon:()=>D,configureDataGaugeMonthCommon:()=>E,configureDataLine:()=>$,configureDataValidate:()=>$t,configureLinesChartValidates:()=>Ft,convertToLanguageSelectorDateRange:()=>X,convertToTableTreeView:()=>ot,downloadCSVTable:()=>rt,downloadPDFTable:()=>at,formatCellMultiplesLines:()=>Q,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>M,formatMonthAnyo:()=>a,formatName:()=>p,formatNameHeaderColumn:()=>K,formatRoundTooltip:()=>x,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>l,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>b,formatTooltipPie:()=>A,formatTrimestre:()=>c,getEnvironment:()=>st,getMaxFieldNumberFromData:()=>I,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>V,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>gt,initBarChartComparationMonth:()=>Mt,initChart:()=>h,initStackedBarChart:()=>pt,initStackedBarChartMonthSeries:()=>yt,initTable:()=>Z,initValueDefaultDate:()=>U,initialCalls:()=>ut,loadIframeOnClickEvent:()=>Ct,printDataChart:()=>g,printDataInHTMLElements:()=>T,printNoDataChart:()=>y,resetFilter:()=>_,resetFilterDate:()=>H,resetFilterDates:()=>G,resultsetWithFields:()=>N,selectConfigDatasource:()=>j,selectFilterAll:()=>q,selectValueDefaultInFilter:()=>Y,splitDataset:()=>O,traverseRows:()=>et,updateObject:()=>L,updateStackedBarOptions:()=>ht});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),o[t.substring(4,6)]]}function a(t){const[e,o]=r(t);return`${o} ${e}`}function i(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function l(t){const[e,o]=r(t);return`${o.substring(0,3)} ${e}`}function s(t){const[e,o]=r(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function u(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function d(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function m(t){return t>=1e3?t/1e3+" Tn":t.toString()}function p(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)})),r+=n,r}return t}function h(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);n.setOption(e,!0),window.addEventListener("resize",(()=>{null!=n&&void 0!==n&&n.resize()}));const r=document.getElementById("main-content");return r&&(r.addEventListener("shown.bs.collapse",(()=>{n.resize()})),r.addEventListener("hidden.bs.collapse",(()=>{n.resize()}))),n}function y(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function g(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function b(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i})),r}function S(t){return 100*(t-120)/t}function v(t,e){const o=Math.max(...t);return o+(e-o%e)}function A(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:d(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function x(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${d(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function M(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${d(o)} €`:o>=e?`${d(o/e)} M €`:"-"}function C(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function D(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=C(t,e.data,1.1),u=l,f=o.slice(),m=[];let h=r,y=a,g=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:p(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(g)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(g)}%`,`${String(y)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),g+=u,(o+1)%s==0&&(y+=a,h+=2*r,g=i);return[c,m]}function E(t,e,o,r=0){return[C(e,o.data,1),t=>function(t,e,o){const r=d(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function w(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map((([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),l=Array.from(n.values());return l.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[l.map((t=>{const e=a.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),l,r]}function $(t,e=[],o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,a,r]}function F(t,e,o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function N(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function L(t,e){const o=t;return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n?o[n]=e[n].map(((e,o)=>({...t[n][o],...e}))):"object"!=typeof e[n]||Array.isArray(e[n])?o[n]=e[n]:o[n]=L(t[n]||{},e[n]))})),t}function T(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]}))}))}function I(t,e){const o=N(t),n=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(r=Math.max(...n)),r}function O(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const k=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],z=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],P=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],B=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],W=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function q(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function R(t){for(const e of t)if(Array.isArray(e)){if(!R(e))return!1}else if("All"!==e)return!1;return!0}function j(t,e,o,n){return R(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function _(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function V(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function G(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function H(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function U(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function Y(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function X(t){t.regional.es={monthNames:k,abbreviatedMonthNames:z,dayNames:P,abbreviatedDayNames:B,dayNamesMin:W,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Z(t,e){const o=document.getElementById(t);return o?new Tabulator(o,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function K(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function Q(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)})),n+=`${r}<br>`,n}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function ot(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)})),r.push(l)}return r}function nt(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function rt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function at(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}function it(t){const e=[],o=[100,200,350,500,750,751],n=[40,90,120,230,340,341],r=[50,100,130,240,380,381],a=[20,40,50,100,150,151],i=[10,20,25,50,75,76],l={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function s(t,e,o){const n=document.createElement("td");if(n.setAttribute("id",t),null!=e){n.innerHTML=e;const t=function(t,e){let o;return void 0===e?o=6:"ND"===e?o=7:(o=5,t.forEach(((t,n)=>{e<=t&&5===o&&(o=n)}))),l[o]}(o,e);n.classList.add(t)}return n}return t.forEach((t=>{const l=t;"noData"===l.operationalstatus&&(l.so2value="ND",l.no2value="ND",l.o3value="ND",l.pm10value="ND",l.pm25value="ND"),"A09_CABANYAL_60m"===l.entityid&&(l.pm10value=void 0,l.pm25value=void 0);const c=document.createElement("tr"),u=document.createElement("td");u.innerHTML=l.address,c.appendChild(u),c.appendChild(s(`${l.entityid}_so2`,l.so2value,o)),c.appendChild(s(`${l.entityid}_no2`,l.no2value,n)),c.appendChild(s(`${l.entityid}_o3`,l.o3value,r)),c.appendChild(s(`${l.entityid}_pm10`,l.pm10value,a)),c.appendChild(s(`${l.entityid}_pm25`,l.pm25value,i)),e.push(c)})),e}function lt(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function st(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ct(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function ut(t){ct("include-html-cabecera",(function(){!function(){const t=st();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=st();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ct("include-html-menu"),ct("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),ct("include-html-copyright")}function dt(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,a)}))):document.querySelectorAll(n)[0].style.display="none"}const ft={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},mt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${d(r)}</span></div>`;return n};function pt(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>mt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>d(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>d(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);a.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const l=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==r?L(t,r):t,l.push({...n})})),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?L(l,o):l,h(t,s)}function ht(t){let e={};return e=L(t,ft),e}function yt(t,e,o={},r={}){let a={};a=L(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:L(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=n(t[0])})),pt(t,s,a,l)}function gt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>x(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?L(o,e):o,h(t,n)}const bt="es_ES",St={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function vt(t){return Math.max(...t.map((t=>Number(t[0]))))}function At(t){const e=t.filter((e=>Number(e[0])===vt(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function xt(t){const e=t.filter((e=>Number(e[0])===vt(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Mt(t,e,o=void 0){const n=vt(e).toString(),r=(vt(e)-1).toString();gt(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:u(St,bt),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:xt(e)},{name:n,type:"bar",barGap:0,data:At(e)}]},o))}function Ct(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",(()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})})),r.disabled=!1}const Dt="id",Et="fecha",wt="value";function $t(t,e,o,n){const[r,a]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Dt]}`)?n.push(`${t[Et]}`):o.includes(`${t[Dt]}`)&&r.push(`${t[Et]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let i="Datos sin validar";0===a.length&&(i="");const l={name:"Datos validados",type:"line",data:[...r,a[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let s="",c="";if(0===a.length){const e=t[t.length-1].fecha;s=e,c=e}else s=a[0][0],c=a[a.length-1][0];return[...e,l,{name:"Datos NO validados",type:"line",data:a,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:i,xAxis:s,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[wt])).map((t=>parseInt(`${t[wt]}`,10))))}]]}}]}function Ft(t,e,o=void 0){h(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>b(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{loadAnaliticaFrames:()=>e});var t=o(2725);function e(){(0,t.loadIframeOnClickEvent)("#tabSmartCity","#iframeSmartCity","https://lookerstudio.google.com/embed/reporting/ff43c17f-23cb-4edb-923b-a7b061d829dc/page/6WdoC?hl=ca"),(0,t.loadIframeOnClickEvent)("#tabCdmCiutat","#iframeCdMCiutat","https://lookerstudio.google.com/embed/reporting/2da9d93e-d833-4a00-833a-19ac0746dc9f/page/6WdoC?hl=ca"),window.addEventListener("load",(()=>{document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca")}))}})(),n})()));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.analitica=e():t.analitica=e()}(self,(()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{THRESHOLDS:()=>it,addPointInteger:()=>d,buildCamarasTrafico:()=>ft,buildTableCalidadAire:()=>lt,calculateMaxYAxis:()=>v,calculatePentahoPath:()=>st,calculateXAxisStart:()=>S,checkAllGroupsCollapsed:()=>nt,configureDataBar:()=>F,configureDataGaugeCommon:()=>D,configureDataGaugeMonthCommon:()=>E,configureDataLine:()=>$,configureDataValidate:()=>Ft,configureLinesChartValidates:()=>Nt,convertToLanguageSelectorDateRange:()=>X,convertToTableTreeView:()=>ot,downloadCSVTable:()=>rt,downloadPDFTable:()=>at,formatCellMultiplesLines:()=>Q,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>M,formatMonthAnyo:()=>a,formatName:()=>p,formatNameHeaderColumn:()=>K,formatRoundTooltip:()=>x,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>l,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>b,formatTooltipPie:()=>A,formatTrimestre:()=>c,getEnvironment:()=>ct,getMaxFieldNumberFromData:()=>O,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>V,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>bt,initBarChartComparationMonth:()=>Ct,initChart:()=>h,initStackedBarChart:()=>ht,initStackedBarChartMonthSeries:()=>gt,initTable:()=>Z,initValueDefaultDate:()=>U,initialCalls:()=>dt,loadIframeOnClickEvent:()=>Dt,printDataChart:()=>g,printDataInHTMLElements:()=>T,printNoDataChart:()=>y,resetFilter:()=>_,resetFilterDate:()=>H,resetFilterDates:()=>G,resultsetWithFields:()=>N,selectConfigDatasource:()=>j,selectFilterAll:()=>q,selectValueDefaultInFilter:()=>Y,splitDataset:()=>I,traverseRows:()=>et,updateObject:()=>L,updateStackedBarOptions:()=>yt});const o={"01":"Enero","02":"Febrero","03":"Marzo","04":"Abril","05":"Mayo","06":"Junio","07":"Julio","08":"Agosto","09":"Septiembre",10:"Octubre",11:"Noviembre",12:"Diciembre"};function n(t){return{1:"Gen",2:"Feb",3:"Mar",4:"Abr",5:"Mai",6:"Jun",7:"Jul",8:"Ago",9:"Sep",10:"Oct",11:"Nov",12:"Des"}[parseInt(t.toString(),10)]}function r(t){return[t.substring(0,4),o[t.substring(4,6)]]}function a(t){const[e,o]=r(t);return`${o} ${e}`}function i(t){const[e,n,r]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${n} ${e}`}function l(t){const[e,o]=r(t);return`${o.substring(0,3)} ${e}`}function s(t){const[e,o]=r(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function c(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function u(t,e){const o=t[e];return Array.from(o.values()).map((t=>t.slice(0,3)))}function d(t,e=2){let o=navigator.language||navigator.userLanguage;o=o.length<=2?`${o}-${o.toUpperCase()}`:o;const n={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===o?t.toLocaleString("de-DE",n):t.toLocaleString(o,n)}function f(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function m(t){return t>=1e3?t/1e3+" Tn":t.toString()}function p(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",r="";return o.forEach((t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(r+=`${n}\n`,n=t)})),r+=n,r}return t}function h(t,e){const o=document.getElementById(t);if(!o)return console.error(`No se pudo encontrar el elemento con ID ${t}.`),null;const n=echarts.init(o);n.setOption(e,!0),window.addEventListener("resize",(()=>{null!=n&&void 0!==n&&n.resize()}));const r=document.getElementById("main-content");return r&&(r.addEventListener("shown.bs.collapse",(()=>{n.resize()})),r.addEventListener("hidden.bs.collapse",(()=>{n.resize()}))),n}function y(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}function g(t,e){const o=t?document.querySelector(t):null,n=e?document.querySelector(e):null;o&&(o.hidden=!0),n&&(n.style.background="#ffffff",n.hidden=!1)}function b(t,e=!1,o=!0,n=""){let r=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach((t=>{const a=e?Math.round(t.data):t.data,i=o?`<div style="font-weight: 400;color: #666;">${l=t.color,`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;font-weight: 500;background-color:${l}"></span>`} ${t.seriesName}: \n <span style="float: right; margin-left:20px;font-weight: 600;color: #565656;">\n ${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${d(a)} ${n}`:"-"}\n </span>\n </div>`;var l;r+=i})),r}function S(t){return 100*(t-120)/t}function v(t,e){const o=Math.max(...t);return o+(e-o%e)}function A(t,e=!1){const o=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,n=e?`${t.percent}%`:d(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function x(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${d(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function M(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${d(o)} €`:o>=e?`${d(o/e)} M €`:"-"}function C(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function D(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=C(t,e.data,1.1),u=l,f=o.slice(),m=[];let h=r,y=a,g=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:p(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(g)}%`,`${String(h)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(g)}%`,`${String(y)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),g+=u,(o+1)%s==0&&(y+=a,h+=2*r,g=i);return[c,m]}function E(t,e,o,r=0){return[C(e,o.data,1),t=>function(t,e,o){const r=d(Math.round(e)),a=n(t[o][0]),i=t[o][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][o.data]}]]}function w(t,e){const{resultset:o}={resultset:t},n=new Set,r=new Set,a=o.map((([t,o,a])=>{const i=e?Math.round(a):a;return n.add(t),r.add(o),{day:o,type:t,value:i}})),i=Array.from(r.values()),l=Array.from(n.values());return l.sort(((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0}))),[l.map((t=>{const e=a.filter((e=>e.type===t)).map((({day:e,value:o})=>[e,t,o])),o=i.map((t=>{const o=e.find((([e])=>e===t));return o?o[2]:null}));return{name:t,data:o}})),l,r]}function $(t,e=[],o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())})),[n,a,r]}function F(t,e,o=!1){const[n,r,a]=w(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function N(t){const{resultset:e,metadata:o}=t,n=[];return e.forEach((t=>{const e={};t.forEach(((t,n)=>{e[o[n].colName]=t})),n.push(e)})),n}function L(t,e){const o=t;return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n?o[n]=e[n].map(((e,o)=>({...t[n][o],...e}))):"object"!=typeof e[n]||Array.isArray(e[n])?o[n]=e[n]:o[n]=L(t[n]||{},e[n]))})),t}function T(t,e){t.forEach((t=>{t.id in e&&Object.entries(e[t.id]).forEach((o=>{const n=o[0],r=o[1];"object"==typeof r?r.className?document.querySelector(r.className).className=t[n]:r.element&&r.format&&(document.querySelector(r.element).textContent=e[t.id][n].format(t[n])):document.querySelector(r).textContent=t[n]}))}))}function O(t,e){const o=N(t),n=[];let r=null;return o.forEach((t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)})),n.length>0&&(r=Math.max(...n)),r}function I(t,e=!0){const o={Cont:[],Mob:[]};return t.forEach((t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?o.Cont.push([t[3],t[4],t[2]]):o.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?o.Mob.push([t[3],t[4],t[2]]):o.Mob.push([t[3],t[2]]))})),o}const k=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],z=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],P=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],B=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],W=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function q(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function R(t){for(const e of t)if(Array.isArray(e)){if(!R(e))return!1}else if("All"!==e)return!1;return!0}function j(t,e,o,n){return R(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function _(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function V(){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(){const t={input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}};return t.input.indexes.id=1,t.input.indexes.label=0,t}function G(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function H(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function U(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function Y(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function X(t){t.regional.es={monthNames:k,abbreviatedMonthNames:z,dayNames:P,abbreviatedDayNames:B,dayNamesMin:W,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Z(t,e){const o=document.getElementById(t);return o?new Tabulator(o,e):(console.error(`No se pudo encontrar el elemento con ID ${t}.`),null)}function K(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function Q(t,e){const o=t.getValue().split(" ");let n="",r="";return o.forEach((t=>{(r+t).length<=e?r+=`${t} `:(n+=`${r}<br>`,r=`${t} `)})),n+=`${r}<br>`,n}function tt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function et(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&tt(t,e)}))}function ot(t,e,o,n){const r=[];for(const a in t)if(t.hasOwnProperty(a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach(((t,r)=>{const a={[e]:o[r],[n]:t};l._children.push(a)})),r.push(l)}return r}function nt(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function rt(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("csv",`${e}.csv`,{delimiter:";"})}))}function at(t,e,o){const n=document.getElementById(o),r=n.cloneNode(!0);n.parentNode.replaceChild(r,n),r.addEventListener("click",(()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})}))}const it={SO2:[100,200,350,500,750,751],NO2:[40,90,120,230,340,341],O3:[50,100,130,240,380,381],PM10:[20,40,50,100,150,151],PM25:[10,20,25,50,75,76]};function lt(t){const e=[],o={0:"b",1:"a",2:"d",3:"m",4:"mm",5:"em",6:"",7:"nd"};function n(t,e,n){const r=document.createElement("td");if(r.setAttribute("id",t),null!=e){r.innerHTML=e;const t=function(t,e){let n;return void 0===e?n=6:"ND"===e?n=7:(n=5,t.forEach(((t,o)=>{e<=t&&5===n&&(n=o)}))),o[n]}(n,e);r.classList.add(t)}return r}return t.forEach((t=>{const o=t;"noData"===o.operationalstatus&&(o.so2value="ND",o.no2value="ND",o.o3value="ND",o.pm10value="ND",o.pm25value="ND"),"A09_CABANYAL_60m"===o.entityid&&(o.pm10value=void 0,o.pm25value=void 0);const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=o.address,r.appendChild(a),r.appendChild(n(`${o.entityid}_so2`,o.so2value,it.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,it.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,it.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,it.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,it.PM25)),e.push(r)})),e}function st(t){document.location=`${document.documentURI.split("%3A")[0]}%3A${document.documentURI.split("%3A")[1]}%3A${document.documentURI.split("%3A")[2]}%3A${document.documentURI.split("%3A")[3]}%3A${t}`}function ct(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function ut(t,e){document.querySelectorAll(`[${t}]`).forEach((o=>{!function(t,e,o){const n=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(n.innerHTML=this.responseText,o&&o()),404===this.status&&(n.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(o.getAttribute(t),o,e)}))}function dt(t){ut("include-html-cabecera",(function(){!function(){const t=ct();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ct();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),ut("include-html-menu"),ut("include-html-main-container",(function(){(function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])})(),t&&t()})),ut("include-html-copyright")}function ft(t,e,o,n,r,a){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),u=()=>{"undefined"!=typeof Liferay&&"ca-ES"===Liferay.ThemeDisplay.getBCP47LanguageId()?(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=cas"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=cas")):(s&&s.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?camara=1&lang=val"),c&&c.setAttribute("src","https://camaras.valencia.es/camaras/ocimovil.html?lang=val"))};function d(t=!0){const e=document.querySelector(o);t?(s&&(s.src="about:blank"),c&&(c.src="about:blank"),e.classList.add("blur"),l=!0):(e.classList.remove("blur"),u(),l=!1)}const f=t=>{new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&(l||u(),i||(i=!0,window.setTimeout(d,a)))}))})).observe(t)};!function(){const{userAgent:t}=navigator;return/iPad|iPhone|iPod|Macintosh/.test(t)&&!window.MSStream}()?(s&&(s.setAttribute("sandbox","allow-scripts"),f(s)),c&&(c.setAttribute("sandbox","allow-scripts"),f(c)),document.querySelector(r).addEventListener("click",(()=>{d(!1),window.setTimeout(d,a)}))):document.querySelectorAll(n)[0].style.display="none"}const mt={grid:{containLabel:!0},title:{left:"center",top:"0",textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"}},legend:{orient:"horizontal",bottom:"0",left:"center",width:"100%",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400,color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{restore:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}},saveAsImage:{textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12}},xAxis:[{type:"category",axisLabel:{show:!0,interval:0,textStyle:{fontFamily:"Montserrat",fontSize:11}},data:[]}],yAxis:[{type:"value",alignTicks:!0,position:"right",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${t}%`}},{type:"value",position:"left",axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400},formatter:t=>`${f(t)}€`}}]},pt=(t,e)=>{e.sort(((t,e)=>parseInt(t.anyo)-parseInt(e.anyo)));const o={};e.forEach((e=>{const n=e[1],r=e[0];r!==t.seriesName||o[n]||(o[n]=0),r===t.seriesName&&(o[n]+=e[2])}));let n=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${d(r)}</span></div>`;return n};function ht(t,e,o=void 0,n=void 0){const r=null===n?void 0:n,a=new Set(e.map((t=>t[1])));let i;const l={title:{text:"SIN TITULO",left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},tooltip:{axisPointer:{type:"shadow"},trigger:"item",formatter:t=>pt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,r){const a={},i=r.contentSize[1]/2,l=r.viewSize[1],s=t[1];return s<i?a.top=10:s+i>l?a.bottom=10:a.top=s-i,t[0]<r.viewSize[0]/2?a.left=t[0]+20:a.right=r.viewSize[0]-t[0]+20,a}},legend:{padding:40,textStyle:{fontFamily:"Montserrat"}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"value",splitNumber:10,name:"SIN NOMBRE",nameLocation:"start",nameTextStyle:{fontWeight:"bold",fontFamily:"Montserrat",color:"#666",padding:-40},axisLabel:{margin:5,textStyle:{fontFamily:"Montserrat"},formatter:t=>d(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(a),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>d(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};r&&r.itemStyle&&Array.isArray(r.itemStyle.borderColor)&&(i=[...r.itemStyle.borderColor],delete r.itemStyle.borderColor);const o=function(t){return t.reduce(((t,e)=>{const o=e[0];return t[o]||(t[o]=[]),t[o].push(e),t}),{})}(e),n=Object.keys(o);a.forEach((t=>{n.forEach((e=>{void 0===o[e].find((e=>e[1]===t))&&(o[e].push([o[e][0][0],t,void 0]),o[e].sort())}))}));const l=[];return Object.keys(o).forEach((e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=o[e].map((t=>t[2]));let n={};n=void 0!==r?L(t,r):t,l.push({...n})})),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?L(l,o):l,h(t,s)}function yt(t){let e={};return e=L(t,mt),e}function gt(t,e,o={},r={}){let a={};a=L(o,{color:["#81B1CC","#ABD9EA","#C2EEF9","#F9E2AF","#F9C780","#FDAE61","#F46D43","#FDAE61","#F9E2AF","#C2EEF9","#ABD9EA","#81B1CC"],yAxis:{data:function(){const t=new Set;return e.forEach((e=>{t.add(e[1])})),Array.from(t).sort(((t,e)=>t-e))}()}});const i={itemStyle:{borderWidth:2,borderColor:["#448DAD","#89CADB","#A0DEE8","#F4D28C","#F4B569","#F79646","#F25930","#F79646","#F4D28C","#A0DEE8","#89CADB","#448DAD"]}},l=null===r?i:L(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=n(t[0])})),ht(t,s,a,l)}function bt(t,e=void 0){const o={title:{text:"SIN TITULO",left:"center",top:"top",padding:50,textStyle:{fontSize:14,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},legend:{show:!1},grid:{top:"30%",bottom:"5%",left:"8%",right:"8%"},xAxis:{type:"value",show:!1},yAxis:{show:!1,type:"category"},tooltip:{show:!0,textStyle:{fontFamily:"Montserrat",fontWeight:"600"},appendToBody:!0,formatter:t=>x(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?L(o,e):o,h(t,n)}const St="es_ES",vt={es_ES:new Map([["1","Enero"],["2","Febrero"],["3","Marzo"],["4","Abril"],["5","Mayo"],["6","Junio"],["7","Julio"],["8","Agosto"],["9","Septiembre"],["10","Octubre"],["11","Noviembre"],["12","Diciembre"]]),ca_ES:new Map([["1","Gener"],["2","Febrer"],["3","Març"],["4","Abril"],["5","Maig"],["6","Juny"],["7","Juliol"],["8","Agost"],["9","Setembre"],["10","Octubre"],["11","Novembre"],["12","Desembre"]])};function At(t){return Math.max(...t.map((t=>Number(t[0]))))}function xt(t){const e=t.filter((e=>Number(e[0])===At(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Mt(t){const e=t.filter((e=>Number(e[0])===At(t)-1)),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Ct(t,e,o=void 0){const n=At(e).toString(),r=(At(e)-1).toString();bt(t,L({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[r,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:u(vt,St),interval:0,margin:10,axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],yAxis:[{type:"value",axisLabel:{formatter:t=>t.toLocaleString("es-ES"),textStyle:{fontSize:10,fontFamily:"Montserrat",fontWeight:400}}}],series:[{name:r,type:"bar",data:Mt(e)},{name:n,type:"bar",barGap:0,data:xt(e)}]},o))}function Dt(t,e,o){const n=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",(()=>{!1===a&&(a=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{a=!1})})),r.disabled=!1}const Et="id",wt="fecha",$t="value";function Ft(t,e,o,n){const[r,a]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Et]}`)?n.push(`${t[wt]}`):o.includes(`${t[Et]}`)&&r.push(`${t[wt]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let i="Datos sin validar";0===a.length&&(i="");const l={name:"Datos validados",type:"line",data:[...r,a[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let s="",c="";if(0===a.length){const e=t[t.length-1].fecha;s=e,c=e}else s=a[0][0],c=a[a.length-1][0];return[...e,l,{name:"Datos NO validados",type:"line",data:a,lineStyle:{color:"#80D4CF",width:4},showSymbol:!1,tooltip:{show:!1},markArea:{silent:!0,itemStyle:{opacity:.6,color:"#eee"},tooltip:{show:!1},label:{color:"#333",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:11},data:[[{name:i,xAxis:s,yAxis:0},{name:"end",xAxis:c,yAxis:Math.max(...t.filter((t=>null!==t[$t])).map((t=>parseInt(`${t[$t]}`,10))))}]]}}]}function Nt(t,e,o=void 0){h(t,L({grid:{left:"2.5%",right:"5%",bottom:"70",top:"150",containLabel:!0},title:{left:"center",top:"top",textStyle:{fontSize:20,fontFamily:"Montserrat",fontWeight:600,color:"#666"}},legend:{type:"plain",top:"50",width:"98%",textStyle:{fontFamily:"Montserrat"}},tooltip:{trigger:"axis",show:!0,formatter:t=>b(t),textStyle:{fontFamily:"Montserrat"}},xAxis:{type:"category",boundaryGap:!1,splitLine:{show:!1},axisLabel:{textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},yAxis:{type:"value",nameLocation:"end",nameGap:"0",nameTextStyle:{fontFamily:"Montserrat",fontWeight:"500",padding:[-25,0,0,-48],margin:0,align:"left",verticalAlign:"top",width:"auto"},scale:!0,splitNumber:"6",axisLabel:{margin:10,textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#666"}}},dataZoom:{end:100,borderColor:"#eee",fillerColor:"rgba(0,0,0,.05)",textStyle:{fontSize:10,fontFamily:"Montserrat",color:"#333",textBorderColor:"#fff",textBorderWidth:3,fontWeight:"600"},selectedDataBackground:{lineStyle:{color:"#333"},areaStyle:{color:"#ffcd00"}},dataBackground:{backgroundColor:"rgba(0,0,0,1)",lineStyle:{color:"#333"},areaStyle:{color:"rgba(0,0,0,0.5)"}},handleStyle:{color:"rgba(0,0,0,0.2)"},moveHandleStyle:{color:"rgba(0,0,0,0.3)"},emphasis:{handleStyle:{color:"rgba(255,205,0,1)"},moveHandleStyle:{color:"rgba(255,205,0,1)"}}},toolbox:{feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:"1%",top:"0%"},series:e},o))}return e})(),t.exports=e()}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";o.r(n),o.d(n,{loadAnaliticaFrames:()=>e});var t=o(2725);function e(){(0,t.loadIframeOnClickEvent)("#tabSmartCity","#iframeSmartCity","https://lookerstudio.google.com/embed/reporting/ff43c17f-23cb-4edb-923b-a7b061d829dc/page/6WdoC?hl=ca"),(0,t.loadIframeOnClickEvent)("#tabCdmCiutat","#iframeCdMCiutat","https://lookerstudio.google.com/embed/reporting/2da9d93e-d833-4a00-833a-19ac0746dc9f/page/6WdoC?hl=ca"),window.addEventListener("load",(()=>{document.querySelector("#iframeValenciaMinut").setAttribute("src","https://lookerstudio.google.com/embed/reporting/14a41533-3cd8-4f75-b303-9a494c0e4a9d/page/6WdoC?hl=ca")}))}})(),n})()));
|