@vlci/cdmciutat 30.0.0 → 32.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.
@@ -0,0 +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.energia=e():t.energia=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:()=>ct,addPointInteger:()=>d,buildCamarasTrafico:()=>pt,buildTableCalidadAire:()=>ut,calculateMaxYAxis:()=>x,calculatePentahoPath:()=>dt,calculateXAxisStart:()=>S,chartBar:()=>Ct,chartTop10:()=>Mt,checkAllGroupsCollapsed:()=>it,configureDataBar:()=>$,configureDataGaugeCommon:()=>w,configureDataGaugeMonthCommon:()=>D,configureDataLine:()=>F,configureDataValidate:()=>Wt,configureLinesChartValidates:()=>Bt,convertToLanguageSelectorDateRange:()=>K,convertToTableTreeView:()=>at,distributionChart:()=>wt,downloadCSVTable:()=>lt,downloadPDFTable:()=>st,formatCellMultiplesLines:()=>ot,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>M,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>et,formatRoundTooltip:()=>A,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>l,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>b,formatTooltipPie:()=>v,formatTrimestre:()=>c,gaugeChart:()=>At,getEnvironment:()=>ft,getMaxFieldNumberFromData:()=>N,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>G,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>vt,initBarChartComparationMonth:()=>Tt,initChart:()=>p,initStackedBarChart:()=>bt,initStackedBarChartMonthSeries:()=>xt,initTable:()=>tt,initValueDefaultDate:()=>X,initialCalls:()=>ht,loadIframeOnClickEvent:()=>It,printDataChart:()=>y,printDataInHTMLElements:()=>I,printNoDataChart:()=>g,resetFilter:()=>j,resetFilterDate:()=>Y,resetFilterDates:()=>U,resetFilterToDefault:()=>Q,resultsetWithFields:()=>L,selectConfigDatasource:()=>H,selectConfigDatasourceAllValue:()=>_,selectFilterAll:()=>V,selectValueDefaultInFilter:()=>Z,splitDataset:()=>O,traverseRows:()=>rt,updateDomElement:()=>z,updateObject:()=>T,updateStackedBarOptions:()=>St});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 h(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 p(t,e){const o=t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",(()=>{o.resize()})),n.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o};let n=document.getElementById(t);return n?o(n):(document.body.addEventListener("MainContentLoadedCustom",(()=>(n=document.getElementById(t),n?o(n):(console.error(`El elemento con ID ${t} no está disponible.`),null)))),null)}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="url('./build/images/nodata1.png') no-repeat top center",n.hidden=!1)}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="#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 x(t,e){const o=Math.max(...t);return o+(e-o%e)}function v(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 A(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 w(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 p=r,g=a,y=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:h(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(y)}%`,`${String(p)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(y)}%`,`${String(g)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>d(Math.round(t))}}),y+=u,(o+1)%s==0&&(g+=a,p+=2*r,y=i);return[c,m]}function D(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 E(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 F(t,e=[],o=!1){const[n,r,a]=E(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 $(t,e,o=!1){const[n,r,a]=E(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function L(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 T(t,e){const o={...t};return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map(((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e}))):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=T(t[n]||{},e[n]))})),o}function I(t,e){console.log("INICIO HTML");const o=()=>{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]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function N(t,e){const o=L(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 z(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}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 W=["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"],P=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],k=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],R=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function V(t){const e=t.resultset.map((t=>t[0]));return this.dashboard.fireChange(this.parameter,e),t}function q(t){for(const e of t)if(Array.isArray(e)){if(!q(e))return!1}else if("All"!==e)return!1;return!0}function H(t,e,o,n){return q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function _(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function j(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function G(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(t="Todos"){const e=G(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function U(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function Y(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function X(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function Z(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function K(t){t.regional.es={monthNames:W,abbreviatedMonthNames:B,dayNames:P,abbreviatedDayNames:k,dayNamesMin:R,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Q(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function tt(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 et(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ot(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 nt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function rt(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function at(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 it(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function lt(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 st(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 ct={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 ut(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,ct.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,ct.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,ct.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,ct.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,ct.PM25)),e.push(r)})),e}function dt(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 ft(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function mt(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 ht(t){mt("include-html-cabecera",(function(){!function(){const t=ft();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ft();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),mt("include-html-menu"),mt("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),mt("include-html-copyright")}function pt(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 gt={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)}€`}}]},yt=(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 bt(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=>yt(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?T(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?T(l,o):l,p(t,s)}function St(t){let e={};return e=T(gt,t),e}function xt(t,e,o={},r={}){let a={};a=T(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:T(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=n(t[0])})),bt(t,s,a,l)}function vt(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=>A(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?T(o,e):o,p(t,n)}function At(t,e,o,n,r,a){const i={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:o,margin:"0",padding:0,top:"0",left:"60%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:n,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1,top:"bottom",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"400",color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},series:[{type:"gauge",center:["50%","65%"],startAngle:200,endAngle:-20,min:0,max:a,splitNumber:10,progress:{show:!0,width:40,itemStyle:{color:"#4BA3C3"}},pointer:{show:!1},axisLine:{lineStyle:{width:40}},axisTick:{distance:-50,splitNumber:5,lineStyle:{width:2,color:"#ccc"}},splitLine:{distance:-55,length:9,lineStyle:{width:2,color:"#ccc"}},axisLabel:{distance:0,textStyle:{color:"#999",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:12}},anchor:{show:!1,showAbove:!0,size:35,itemStyle:{borderWidth:40,color:"#284B63"}},detail:{formatter:t+e,width:"60%",borderRadius:8,offsetCenter:[0,0],valueAnimation:!0,textStyle:{color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:30}},data:[{value:t}]}]};echarts.init(document.getElementById(r)).setOption(i)}function Mt(t,e,o,n){return{grid:{top:"15%",bottom:"3%",left:"3%",right:"3%"},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontFamily:"Montserrat",fontSize:18,fontWeight:600,color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:17,fontWeight:500,color:"#666"}},tooltip:{textStyle:{fontFamily:"Montserrat"},renderMode:"html",tooltipFormatter:n},yAxis:{data:o.map((t=>t[0])),axisLabel:{show:!1}},series:[{data:o.map((t=>t[1])),type:"bar",barWidth:"75%",barCategoryGap:"20%",label:{show:!0,position:"insideLeft",formatter:"{b}",width:400,overflow:"truncate",textStyle:{fontSize:13,fontWeight:600,fontFamily:"Montserrat",color:"#284B63"}},itemStyle:{color:"#82bed4"}}]}}function Ct(t,e,o,n,r){const a={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descragar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1,orient:"vertical",top:"55",bottom:"5",left:"0",padding:[0,0],width:"20%",itemHeight:10,itemWidth:11,itemGap:10,textStyle:{fontSize:"12",lineHeight:14,fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:210,overflow:"break"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"none"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500}},xAxis:{data:o,axisLabel:{show:!0,margin:6,textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},yAxis:{type:"value",alignTicks:!0,scale:!0,axisLabel:{formatter:"{value} kWh",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400}}},series:[{data:n,type:"bar",itemStyle:{color:"#4BA3C3"}}]};echarts.init(document.getElementById(r)).setOption(a)}function wt(t,e,o,n,r,a,i){const l=echarts.init(document.getElementById(n)),s={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",fontWeight:500},formatter:function(t){return t.value[2]+o+r[t.value[0]]+i}},xAxis:{type:"category",data:r,boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisTick:{show:!1},axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:0,rotate:0,padding:0,margin:10,fontSize:10,lineHeight:13,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,fontSize:10,fontFamily:"Montserrat",fontWeight:500,color:"#333"}},series:[{name:"Consum Energètic",type:"scatter",color:"#4BA3C3",symbolSize:function(t){return 11*t[2]},data:a,animationDelay:function(t){return 5*t}}]};s&&l.setOption(s),window.addEventListener("resize",l.resize)}const Dt="es_ES",Et={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 Ft(t){return Math.max(...t.map((t=>Number(t[0]))))}function $t(t){const e=t.filter((e=>Number(e[0])===Ft(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Lt(t){const e=t.filter((e=>Number(e[0])===Ft(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 Tt(t,e,o=void 0){const n=Ft(e).toString(),r=(Ft(e)-1).toString();vt(t,T({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(Et,Dt),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:Lt(e)},{name:n,type:"bar",barGap:0,data:$t(e)}]},o))}function It(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 Nt="id",zt="fecha",Ot="value";function Wt(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Nt]}`)?n.push(`${t[zt]}`):o.includes(`${t[Nt]}`)&&r.push(`${t[zt]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,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:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter((t=>null!==t[Ot])).map((t=>parseInt(`${t[Ot]}`,10))))}]]}}]}function Bt(t,e,o=void 0){p(t,T({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,{echartBarEvolucioMensualAnual:()=>i,echartBarEvolucioMensualAnualDesagregado:()=>l,echartConsumoVertidoMedioMesAnyo:()=>r,echartDistribucionEdificios:()=>c,echartTop10:()=>s,getSelectCommonOptions:()=>t.getSelectCommonOptions,getSelectTwoColumnsOptions:()=>t.getSelectTwoColumnsOptions,initValueDesfaultDates:()=>u,resetFilter:()=>t.resetFilter,resetFilterDate:()=>t.resetFilterDate,resetFilterToDefault:()=>t.resetFilterToDefault,selectConfigDatasourceAllValue:()=>t.selectConfigDatasourceAllValue,selectValueDefaultInFilter:()=>d,widgetConsumoVertidoTotalMesAnyo:()=>a});var t=o(2725);function e(t){return t>=1e6?{value:(t/1e6).toFixed(2),unit:"gWh"}:t>=1e3?{value:(t/1e3).toFixed(2),unit:"mWh"}:{value:t.toFixed(2),unit:"kWh"}}function r(o){const n=o.resultset[0][1],r=o.resultset[0][2],a=o.resultset[0][3],i=e(parseFloat((r/n).toFixed(3))),l=function(t,e){return"gWh"===e?{value:Math.round(t/1e6),unit:"gWh"}:"mWh"===e?{value:Math.round(t/1e3),unit:"mWh"}:{value:Math.round(t),unit:"kWh"}}(a,i.unit),s=o.resultset[0][0];(0,t.gaugeChart)(i.value,i.unit,"CONSUM MITJÀ",s,"chartConsumoMedio",l.value)}function a(o){const n=e(o&&o.resultset&&o.resultset[0]&&o.resultset[0][0]),r=n.unit,a=`${(0,t.addPointInteger)(n.value)} ${r}`;void 0!==a?(0,t.updateDomElement)("#consumoTotal",a):console.error("No se pudo extraer el valor de data.resultset[0][0]")}function i(e){const{periodos:o,energiaTotal:n}=function(t){const e=[],o=[];return Array.isArray(t.resultset)&&t.resultset.forEach((t=>{e.push(t[0]),o.push(t[1])})),{periodos:e,energiaTotal:o}}(e),r=e.resultset[0][2],a=`ENERGIA ${String(r).toUpperCase()} PER EDIFICIS`,i=(l=o[0],/^\d{4}\/\d{2}$/.test(l)?"MENSUAL":"ANUAL");var l;(0,t.chartBar)(a,i,o,n,"chartDesagregatAnual")}function l(e){const{periodos:o,energiaTotal:n}=function(t){const e=[],o=[];return Array.isArray(t.resultset)&&t.resultset.forEach((t=>{e.push(t[0]),o.push(t[1])})),{periodos:e,energiaTotal:o}}(e),r=e.resultset[0][2],a=` ${String(r).toUpperCase()} PER EDIFICIS`,i=(l=o[0],/^\d{4}-\d{2}-\d{2}$/.test(l)?"DIARI":"MENSUAL");var l;(0,t.chartBar)(a,i,o,n,"chartDesagregatMensual")}function s(e){const o=e.resultset[0][2],n=e.resultset[0][3],r=`MAJOR ENERGIA ${String(n).toUpperCase()}`,a=e.resultset.reverse().map((t=>[t[0],t[1]])),i=(0,t.chartTop10)(r,o,a,(e=>`<b style="color: #000;">${e.name}</b>:<br /> ${(0,t.addPointInteger)(e.value)} kWh `));(0,t.initBarChart)("chartTop",i)}function c(e){const o=e.resultset.map((t=>t[0].toString())),n=e.resultset.map(((t,e)=>[e,0,t[1]])).map((t=>[t[0],t[1],t[2]])),r=e.resultset[0][2];(0,t.distributionChart)("DISTRIBUCIÓ DELS kWh",r," edificis consumeixen ","chartDistribucion",o,n,["kWh"])}function u(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function d(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}})(),n})()));
@@ -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.initialCalls=e():t.initialCalls=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:()=>w,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:()=>A,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>l,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>b,formatTooltipPie:()=>x,formatTrimestre:()=>c,getEnvironment:()=>ct,getMaxFieldNumberFromData:()=>O,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>J,getSelectTwoColumnsOptions:()=>V,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:()=>W,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 x(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 A(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 $(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 w(t,e=[],o=!1){const[n,r,a]=$(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]=$(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 P=["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"],k=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],B=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],R=["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 _(t){for(const e of t)if(Array.isArray(e)){if(!_(e))return!1}else if("All"!==e)return!1;return!0}function j(t,e,o,n){return _(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function W(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 V(){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:P,abbreviatedMonthNames:z,dayNames:k,abbreviatedDayNames:B,dayNamesMin:R,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=>A(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 xt(t){return Math.max(...t.map((t=>Number(t[0]))))}function At(t){const e=t.filter((e=>Number(e[0])===xt(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])===xt(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=xt(e).toString(),r=(xt(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:At(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",$t="fecha",wt="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[$t]}`):o.includes(`${t[Et]}`)&&r.push(`${t[$t]}`)})),[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 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.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},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,{calculatePentahoPath:()=>t.calculatePentahoPath,initialCalls:()=>t.initialCalls});var t=o(2725)})(),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.initialCalls=e():t.initialCalls=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:()=>ct,addPointInteger:()=>d,buildCamarasTrafico:()=>pt,buildTableCalidadAire:()=>ut,calculateMaxYAxis:()=>x,calculatePentahoPath:()=>dt,calculateXAxisStart:()=>S,chartBar:()=>wt,chartTop10:()=>At,checkAllGroupsCollapsed:()=>it,configureDataBar:()=>$,configureDataGaugeCommon:()=>C,configureDataGaugeMonthCommon:()=>E,configureDataLine:()=>D,configureDataValidate:()=>Wt,configureLinesChartValidates:()=>Pt,convertToLanguageSelectorDateRange:()=>K,convertToTableTreeView:()=>at,distributionChart:()=>Ct,downloadCSVTable:()=>lt,downloadPDFTable:()=>st,formatCellMultiplesLines:()=>ot,formatDayMonthYear:()=>i,formatMilMillionEuros:()=>A,formatMonthAnyo:()=>a,formatName:()=>h,formatNameHeaderColumn:()=>et,formatRoundTooltip:()=>M,formatShortMonthShortYear:()=>s,formatShortMonthYear:()=>l,formatToMillions:()=>f,formatToTons:()=>m,formatTooltip:()=>b,formatTooltipPie:()=>v,formatTrimestre:()=>c,gaugeChart:()=>Mt,getEnvironment:()=>ft,getMaxFieldNumberFromData:()=>T,getMonth:()=>n,getMonthList:()=>u,getSelectCommonOptions:()=>V,getSelectTwoColumnsOptions:()=>J,initBarChart:()=>vt,initBarChartComparationMonth:()=>zt,initChart:()=>p,initStackedBarChart:()=>bt,initStackedBarChartMonthSeries:()=>xt,initTable:()=>tt,initValueDefaultDate:()=>X,initialCalls:()=>ht,loadIframeOnClickEvent:()=>Nt,printDataChart:()=>g,printDataInHTMLElements:()=>N,printNoDataChart:()=>y,resetFilter:()=>G,resetFilterDate:()=>Y,resetFilterDates:()=>U,resetFilterToDefault:()=>Q,resultsetWithFields:()=>L,selectConfigDatasource:()=>R,selectConfigDatasourceAllValue:()=>j,selectFilterAll:()=>q,selectValueDefaultInFilter:()=>Z,splitDataset:()=>O,traverseRows:()=>rt,updateDomElement:()=>I,updateObject:()=>z,updateStackedBarOptions:()=>St});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 h(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 p(t,e){const o=t=>{const o=echarts.init(t);o.setOption(e,!0),window.addEventListener("resize",(()=>{null!=o&&void 0!==o&&o.resize()}));const n=document.getElementById("main-content");return n&&(n.addEventListener("shown.bs.collapse",(()=>{o.resize()})),n.addEventListener("hidden.bs.collapse",(()=>{o.resize()}))),o};let n=document.getElementById(t);return n?o(n):(document.body.addEventListener("MainContentLoadedCustom",(()=>(n=document.getElementById(t),n?o(n):(console.error(`El elemento con ID ${t} no está disponible.`),null)))),null)}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 x(t,e){const o=Math.max(...t);return o+(e-o%e)}function v(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 M(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 A(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${d(o)} €`:o>=e?`${d(o/e)} M €`:"-"}function w(t,e,o=1){const n=Math.max(...t.map((t=>t[e])))*o;return 5e3*Math.ceil(n/5e3)}function C(t,e,o,n=30,r=15,a=30,i=-70,l=70,s=3){const c=w(t,e.data,1.1),u=l,f=o.slice(),m=[];let p=r,y=a,g=i;for(let o=0;o<t.length;o+=1)m.push({value:t[o][e.data],name:h(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:f.shift(),title:{offsetCenter:[`${String(g)}%`,`${String(p)}%`],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,p+=2*r,g=i);return[c,m]}function E(t,e,o,r=0){return[w(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 F(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 D(t,e=[],o=!1){const[n,r,a]=F(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 $(t,e,o=!1){const[n,r,a]=F(t,o);return n.forEach((t=>{t.type="bar",t.color=e.shift(),t.smooth=!1})),[n,a,r]}function L(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 z(t,e){const o={...t};return Object.keys(e).forEach((n=>{Object.prototype.hasOwnProperty.call(e,n)&&("series"===n&&Array.isArray(e[n])?o[n]=e[n].map(((e,o)=>({...Array.isArray(t[n])&&t[n][o]||{},...e}))):"object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])?t[n]!==e[n]&&(o[n]=e[n]):o[n]=z(t[n]||{},e[n]))})),o}function N(t,e){console.log("INICIO HTML");const o=()=>{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]}))}))};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",(()=>{o()}))}}function T(t,e){const o=L(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){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}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 W=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],P=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],B=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],k=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],_=["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 H(t){for(const e of t)if(Array.isArray(e)){if(!H(e))return!1}else if("All"!==e)return!1;return!0}function R(t,e,o,n){return H(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function j(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function G(t){t.forEach((t=>{Dashboards.fireChange(t,["All"])}))}function V(t="Todos"){return{input:{root:{id:"All"},indexes:{id:0,label:0}},component:{Root:{strings:{isDisabled:"No disponible",allItems:t,noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}},Group:{Strings:{allItems:"Todos",noItems:"Ninguno",btnApply:"Aceptar",btnCancel:"Cancelar"}}}}}function J(t="Todos"){const e=V(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function U(t,e,o,n){const r=Dashboards.getParameterValue(o),a=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function Y(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function X(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function Z(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;t.dashboard.setParameter(n,[o])}function K(t){t.regional.es={monthNames:W,abbreviatedMonthNames:P,dayNames:B,abbreviatedDayNames:k,dayNamesMin:_,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function Q(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function tt(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 et(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ot(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 nt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function rt(t,e){t.getRows().forEach((t=>{t.getTreeChildren().length>0&&nt(t,e)}))}function at(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 it(t){let e=!0;return t.getGroups().forEach((t=>{t._group.visible&&(e=!1)})),e}function lt(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 st(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 ct={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 ut(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,ct.SO2)),r.appendChild(n(`${o.entityid}_no2`,o.no2value,ct.NO2)),r.appendChild(n(`${o.entityid}_o3`,o.o3value,ct.O3)),r.appendChild(n(`${o.entityid}_pm10`,o.pm10value,ct.PM10)),r.appendChild(n(`${o.entityid}_pm25`,o.pm25value,ct.PM25)),e.push(r)})),e}function dt(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 ft(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function mt(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 ht(t){mt("include-html-cabecera",(function(){!function(){const t=ft();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=ft();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()})),mt("include-html-menu"),mt("include-html-main-container",(function(){document.body.dispatchEvent(new Event("MainContentLoadedCustom")),function(){const t=document.querySelector("body");t.classList.remove("inicio"),t.classList.add(document.documentURI.split("%3A")[4].match(/(.*?).wcdf/)[1])}(),t&&t()})),mt("include-html-copyright")}function pt(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 yt={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)}€`}}]},gt=(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 bt(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=>gt(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?z(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?z(l,o):l,p(t,s)}function St(t){let e={};return e=z(yt,t),e}function xt(t,e,o={},r={}){let a={};a=z(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:z(r,i),s=e;s.forEach(((t,e)=>{s[e][0]=n(t[0])})),bt(t,s,a,l)}function vt(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=>M(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?z(o,e):o,p(t,n)}function Mt(t,e,o,n,r,a){const i={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:o,margin:"0",padding:0,top:"0",left:"60%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:n,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1,top:"bottom",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"400",color:"#666"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},series:[{type:"gauge",center:["50%","65%"],startAngle:200,endAngle:-20,min:0,max:a,splitNumber:10,progress:{show:!0,width:40,itemStyle:{color:"#4BA3C3"}},pointer:{show:!1},axisLine:{lineStyle:{width:40}},axisTick:{distance:-50,splitNumber:5,lineStyle:{width:2,color:"#ccc"}},splitLine:{distance:-55,length:9,lineStyle:{width:2,color:"#ccc"}},axisLabel:{distance:0,textStyle:{color:"#999",fontStyle:"normal",fontWeight:"400",fontFamily:"Montserrat",fontSize:12}},anchor:{show:!1,showAbove:!0,size:35,itemStyle:{borderWidth:40,color:"#284B63"}},detail:{formatter:t+e,width:"60%",borderRadius:8,offsetCenter:[0,0],valueAnimation:!0,textStyle:{color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:30}},data:[{value:t}]}]};echarts.init(document.getElementById(r)).setOption(i)}function At(t,e,o,n){return{grid:{top:"15%",bottom:"3%",left:"3%",right:"3%"},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontFamily:"Montserrat",fontSize:18,fontWeight:600,color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:17,fontWeight:500,color:"#666"}},tooltip:{textStyle:{fontFamily:"Montserrat"},renderMode:"html",tooltipFormatter:n},yAxis:{data:o.map((t=>t[0])),axisLabel:{show:!1}},series:[{data:o.map((t=>t[1])),type:"bar",barWidth:"75%",barCategoryGap:"20%",label:{show:!0,position:"insideLeft",formatter:"{b}",width:400,overflow:"truncate",textStyle:{fontSize:13,fontWeight:600,fontFamily:"Montserrat",color:"#284B63"}},itemStyle:{color:"#82bed4"}}]}}function wt(t,e,o,n,r){const a={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descragar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1,orient:"vertical",top:"55",bottom:"5",left:"0",padding:[0,0],width:"20%",itemHeight:10,itemWidth:11,itemGap:10,textStyle:{fontSize:"12",lineHeight:14,fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:210,overflow:"break"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"none"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500}},xAxis:{data:o,axisLabel:{show:!0,margin:6,textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:"500"}}},yAxis:{type:"value",alignTicks:!0,scale:!0,axisLabel:{formatter:"{value} kWh",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:400}}},series:[{data:n,type:"bar",itemStyle:{color:"#4BA3C3"}}]};echarts.init(document.getElementById(r)).setOption(a)}function Ct(t,e,o,n,r,a,i){const l=echarts.init(document.getElementById(n)),s={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:t,margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:e,subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},toolbox:{show:!0,right:"0",top:"0",feature:{saveAsImage:{title:"Descargar",textStyle:{fontSize:6,fontFamily:"Montserrat",fontWeight:300}}},emphasis:{iconStyle:{borderColor:"#ffcd00",textFill:"#666"}}},legend:{show:!1},tooltip:{textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",fontWeight:500},formatter:function(t){return t.value[2]+o+r[t.value[0]]+i}},xAxis:{type:"category",data:r,boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisTick:{show:!1},axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:0,rotate:0,padding:0,margin:10,fontSize:10,lineHeight:13,fontFamily:"Montserrat",fontWeight:400,color:"#333"}},yAxis:{type:"category",data:i,axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,fontSize:10,fontFamily:"Montserrat",fontWeight:500,color:"#333"}},series:[{name:"Consum Energètic",type:"scatter",color:"#4BA3C3",symbolSize:function(t){return 11*t[2]},data:a,animationDelay:function(t){return 5*t}}]};s&&l.setOption(s),window.addEventListener("resize",l.resize)}const Et="es_ES",Ft={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 Dt(t){return Math.max(...t.map((t=>Number(t[0]))))}function $t(t){const e=t.filter((e=>Number(e[0])===Dt(t))),o=Array.from({length:12},(()=>0));return e.forEach((([t,e,n])=>{const r=parseInt(e,10)-1;o[r]=n})),o}function Lt(t){const e=t.filter((e=>Number(e[0])===Dt(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 zt(t,e,o=void 0){const n=Dt(e).toString(),r=(Dt(e)-1).toString();vt(t,z({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(Ft,Et),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:Lt(e)},{name:n,type:"bar",barGap:0,data:$t(e)}]},o))}function Nt(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 Tt="id",It="fecha",Ot="value";function Wt(t,e,o,n,r="es_ES"){const[a,i]=function(t,e,o){const n=[],r=[];return t.forEach((t=>{e.includes(`${t[Tt]}`)?n.push(`${t[It]}`):o.includes(`${t[Tt]}`)&&r.push(`${t[It]}`)})),[n.map((t=>[t,0])),r.map((t=>[t,0]))]}(t,o,n);let l="es_ES"==r?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...a,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",u="";if(0===i.length){const e=t[t.length-1].fecha;c=e,u=e}else c=i[0][0],u=i[i.length-1][0];return[...e,s,{name:"Datos NO validados",type:"line",data:i,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:l,xAxis:c,yAxis:0},{name:"end",xAxis:u,yAxis:Math.max(...t.filter((t=>null!==t[Ot])).map((t=>parseInt(`${t[Ot]}`,10))))}]]}}]}function Pt(t,e,o=void 0){p(t,z({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.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},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,{calculatePentahoPath:()=>t.calculatePentahoPath,initialCalls:()=>t.initialCalls});var t=o(2725)})(),n})()));