@vlci/cdmciutat 38.0.0 → 39.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.
@@ -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.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,{MONTHS_YEAR:()=>a,MONTHS_YEAR_SHORT:()=>r,TEXTS_COMMON:()=>i,THRESHOLDS:()=>vt,addPointInteger:()=>b,buildCamarasTrafico:()=>Ct,buildTableCalidadAire:()=>At,calculateMaxYAxis:()=>F,calculatePentahoPath:()=>wt,calculateXAxisStart:()=>L,capitalizarTexto:()=>w,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>H,configureDataGaugeCommon:()=>O,configureDataGaugeMonthCommon:()=>I,configureDataLine:()=>k,configureDataValidate:()=>Vt,configureLinesChartValidates:()=>Gt,convertDateToInteger:()=>y,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>yt,downloadCSVTable:()=>St,downloadPDFTable:()=>xt,formatCellMultiplesLines:()=>ht,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>A,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>W,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>x,formatTooltip:()=>$,formatTooltipPie:()=>z,formatTrimestre:()=>m,formatWithPrefix:()=>v,getEnvironment:()=>Mt,getMaxFieldNumberFromData:()=>V,getMonth:()=>n,getMonthList:()=>h,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>at,initBarChart:()=>Tt,initBarChartComparationMonth:()=>kt,initChart:()=>D,initElement:()=>M,initStackedBarChart:()=>Ft,initStackedBarChartMonthSeries:()=>Wt,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>Et,loadIframeOnClickEvent:()=>Ht,printDataChart:()=>C,printDataInHTMLElements:()=>R,printEchart:()=>P,printNoDataChart:()=>E,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>rt,resetFilterToDefault:()=>ut,resultsetWithFields:()=>q,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>U,subtractOneDay:()=>g,subtractOneMonth:()=>p,traverseRows:()=>pt,updateDomElement:()=>G,updateObject:()=>B,updateStackedBarOptions:()=>zt});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)]}const a={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"]])},r={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function u(t){const[e,n,a]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${a} ${n} ${e}`}function d(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function h(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function g(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function p(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function y(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(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 S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function x(t){return t>=1e3?t/1e3+" Tn":t.toString()}function v(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function A(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",a="";return o.forEach(t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(a+=`${n}\n`,n=t)}),a+=n,a}return t}function w(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function M(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise(a=>{document.body.addEventListener(o,()=>{n=document.getElementById(t),n?a(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),a(null))})})}function D(t,e){return M(t,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})}function E(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 C(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 $(t,e=!1,o=!0,n=""){let a=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const r=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?`${b(r)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(r)} ${n}`:"-"}\n </span>\n </div>`;var l;a+=i}),a}function L(t){return 100*(t-120)/t}function F(t,e){const o=Math.max(...t);return o+(e-o%e)}function z(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}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function W(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function T(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function P(t,e,o){return 0===t.length?(E(`#${e}`,`#${o}`),!1):(C(`#${o}`,`#${e}`),!0)}function N(t,e,o=1){const n=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(n/5e3)}function O(t,e,o,n=30,a=15,r=30,i=-70,l=70,s=3){const c=N(t,e.data,1.1),u=l,d=o.slice(),f=[];let m=a,h=r,g=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:A(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(g)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(g)}%`,`${String(h)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),g+=u,(o+1)%s===0&&(h+=r,m+=2*a,g=i);return[c,f]}function I(t,e,o,a=0){return[N(e,o.data,1),t=>function(t,e,o){const a=b(Math.round(e)),r=n(t[o][0]),i=t[o][1],l=`\n${r} ${i} : ${a}`,s=`${a}\n${r} ${i}`;return window.innerWidth<=1710?l:s}(e,t,a),[{value:e[a][o.data]}]]}function _(t,e){const{resultset:o}={resultset:t},n=new Set,a=new Set,r=o.map(([t,o,r])=>{const i=e?Math.round(r):r;return n.add(t),a.add(o),{day:o,type:t,value:i}}),i=Array.from(a.values()),l=Array.from(n.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.map(t=>{const e=r.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,a]}function k(t,e=[],o=!1){const[n,a,r]=_(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,r,a]}function H(t,e,o=!1){const[n,a,r]=_(t,o);return n.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[n,r,a]}function q(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 B(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]=B(t[n]||{},e[n]))}),o}function R(t,e){const o=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(o=>{const n=o[0],a=o[1];"object"==typeof a?a.className?document.querySelector(a.className).className=t[n]:a.element&&a.format&&(document.querySelector(a.element).textContent=e[t.id][n].format(t[n])):document.querySelector(a).textContent=t[n]})})};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{o()})}}function V(t,e){const o=q(t),n=[];let a=null;return o.forEach(t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)}),n.length>0&&(a=Math.max(...n)),a}function G(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function U(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 j=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],J=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Y=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],Z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(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 tt(t,e,o,n){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function nt(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 at(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,o,n){const a=Dashboards.getParameterValue(o),r=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[a]),Dashboards.fireChange(e,[r]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;""!==o&&t.dashboard.setParameter(n,[o])}function ct(t){t.regional.es={monthNames:j,abbreviatedMonthNames:J,dayNames:Y,abbreviatedDayNames:Z,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function dt(t,e,o,n=0){const a=t.resultset.slice(0,o).map(t=>t[n]);return Dashboards.setParameter(e,a),t}function ft(t,e){return M(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ht(t,e){const o=t.getValue().split(" ");let n="",a="";return o.forEach(t=>{(a+t).length<=e?a+=`${t} `:(n+=`${a}<br>`,a=`${t} `)}),n+=`${a}<br>`,n}function gt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&gt(t,e)})}function pt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&gt(t,e)})}function yt(t,e,o,n){const a=[];for(const r in t)if(t.hasOwnProperty(r)){const i=t[r],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,a)=>{const r={[e]:o[a],[n]:t};l._children.push(r)}),a.push(l)}return a}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";"})})}function xt(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",()=>{t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8}}})})}const vt={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 At(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 a=document.createElement("td");if(a.setAttribute("id",t),null!=e){a.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);a.classList.add(t)}return a}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");const a=document.createElement("tr"),r=document.createElement("td");r.innerHTML=o.address,a.appendChild(r),a.appendChild(n(`${o.entityid}_so2`,o.so2value,vt.SO2)),a.appendChild(n(`${o.entityid}_no2`,o.no2value,vt.NO2)),a.appendChild(n(`${o.entityid}_o3`,o.o3value,vt.O3)),a.appendChild(n(`${o.entityid}_pm10`,o.pm10value,vt.PM10)),a.appendChild(n(`${o.entityid}_pm25`,o.pm25value,vt.PM25)),e.push(a)}),e}function wt(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 Mt(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Dt(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 Et(t){Dt("include-html-cabecera",function(){!function(){const t=Mt();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Mt();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Dt("include-html-menu"),Dt("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()}),Dt("include-html-copyright"),function(t="MainContentLoadedCustom"){let e=["FilterComponent","buttonComponent"];const o=document.body.getAttribute("update-component-types");o&&(e=o.split(",").map(t=>t.trim())),document.body.addEventListener(t,()=>{const t=(Dashboards.components||[]).filter(t=>e.includes(t.type));0!==t.length&&t.forEach(t=>{document.getElementById(t.htmlObject)?"function"==typeof t.update?setTimeout(()=>{try{t.update()}catch(e){console.error(`Error al actualizar "${t.name}":`,e)}},250):console.error(`El componente de Pentaho "${t.name}" no tiene método .update().`):console.warn(`No se encontró el contenedor para el componente "${t.name}" de tipo "${t.type}".`)})},{once:!0})}()}function Ct(t,e,o,n,a,r){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,r)))})}).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(a).addEventListener("click",()=>{d(!1),window.setTimeout(d,r)})):document.querySelectorAll(n)[0].style.display="none"}const $t={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=>`${S(t)}€`}}]},Lt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const o={};e.forEach(e=>{const n=e[1],a=e[0];a!==t.seriesName||o[n]||(o[n]=0),a===t.seriesName&&(o[n]+=e[2])});let n=`<p>${t.seriesName}</p>`;for(const[e,a]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(a)}</span></div>`;return n};function Ft(t,e,o=void 0,n=void 0){const a=null===n?void 0:n,r=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=>Lt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,a){const r={},i=a.contentSize[1]/2,l=a.viewSize[1],s=t[1];return s<i?r.top=10:s+i>l?r.bottom=10:r.top=s-i,t[0]<a.viewSize[0]/2?r.left=t[0]+20:r.right=a.viewSize[0]-t[0]+20,r}},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=>b(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(r),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>b(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};a&&a.itemStyle&&Array.isArray(a.itemStyle.borderColor)&&(i=[...a.itemStyle.borderColor],delete a.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);r.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!==a?B(t,a):t,l.push({...n})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?B(l,o):l,D(t,s)}function zt(t){let e={};return e=B($t,t),e}function Wt(t,e,o={},a={}){let r={};r=B(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===a?i:B(a,i),s=e;s.forEach((t,e)=>{s[e][0]=n(t[0])}),Ft(t,s,r,l)}function Tt(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=>W(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?B(o,e):o,D(t,n)}const Pt="es_ES",Nt={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 Ot(t){return Math.max(...t.map(t=>Number(t[0])))}function It(t){const e=t.filter(e=>Number(e[0])===Ot(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n}),o}function _t(t){const e=t.filter(e=>Number(e[0])===Ot(t)-1),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n}),o}function kt(t,e,o=void 0){const n=Ot(e).toString(),a=(Ot(e)-1).toString();Tt(t,B({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[a,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(Nt,Pt),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:a,type:"bar",data:_t(e)},{name:n,type:"bar",barGap:0,data:It(e)}]},o))}function Ht(t,e,o){const n=document.querySelector(e),a=document.querySelector(t);let r=!1;a.addEventListener("click",()=>{!1===r&&(r=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{r=!1})}),a.disabled=!1}const qt="id",Bt="fecha",Rt="value";function Vt(t,e,o,n,a="es_ES"){const[r,i]=function(t,e,o){const n=[],a=[];return t.forEach(t=>{e.includes(`${t[qt]}`)?n.push(`${t[Bt]}`):o.includes(`${t[qt]}`)&&a.push(`${t[Bt]}`)}),[n.map(t=>[t,0]),a.map(t=>[t,0])]}(t,o,n);let l="es_ES"==a?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...r,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[Rt]).map(t=>parseInt(`${t[Rt]}`,10)))}]]}}]}function Gt(t,e,o=void 0){D(t,B({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=>$(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 a=e[n];if(void 0!==a)return a.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.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,{echartBarEvolucion:()=>E,echartBarEvolucionDesagregada:()=>C,echartGaugeEnergiaMedia:()=>y,echartLineAnual:()=>T,echartLineDiaria:()=>z,echartLineMensual:()=>W,echartPie:()=>S,echartTop10:()=>b,getSelectCommonOptions:()=>t.getSelectCommonOptions,getSelectTwoColumnsOptions:()=>t.getSelectTwoColumnsOptions,indicadorEnergiaTotal:()=>s,initElement:()=>t.initElement,initValueDefaultDates:()=>t.initValueDefaultDates,resetFilter:()=>t.resetFilter,resetFilterDate:()=>t.resetFilterDate,resetFilterToDefault:()=>t.resetFilterToDefault,selectConfigDatasourceAllValue:()=>t.selectConfigDatasourceAllValue,setFechaDatosRecientes:()=>l});var t=o(2725);const e="Wh";function a(o){const{value:n,prefix:a}=(0,t.formatWithPrefix)(o);return`${n.toLocaleString("es-ES")} ${a}${e}`}function r(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?t.map(r):Object.entries(t).reduce((t,[e,o])=>({...t,[e]:"function"==typeof o?o:r(o)}),{})}function i(t){return`${t.substring(0,4)}/${t.substring(4,6)}`}function l(e,o){const n=(0,t.resultsetWithFields)(e);(0,t.initElement)(o,t=>{t.textContent=n[0].fecha_maxima})}function s(e){const o=(0,t.resultsetWithFields)(e),n=o[0].id,r={[n]:{value:{element:"#consumoTotal",format:a},id:{element:"#tipoEnergia",format:t=>`Total ${t}`}}};(0,t.printDataInHTMLElements)(o,r)}const c={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:"",margin:0,padding:0,top:"0",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{show:!0,trigger:"none"},series:[{type:"gauge",center:["50%","75%"],radius:"85%",startAngle:200,endAngle:-20,data:[{value:null}],detail:{width:"50%",borderRadius:0,offsetCenter:[0,0],valueAnimation:!0,color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:18,lineHeight:18,formatter:a},progress:{show:!0,width:20,itemStyle:{color:"#B9D9EB"}},axisLine:{lineStyle:{width:20}},axisTick:{distance:-25,splitNumber:5,length:3,lineStyle:{width:1,color:"#ccc"}},splitLine:{distance:-28,length:2,lineStyle:{width:1,color:"#ccc"}},axisLabel:{distance:6,fontSize:10,fontWeight:"400",fontFamily:"Montserrat",color:"#666"},anchor:{show:!1},pointer:{show:!1}}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{maxHeight:150},option:{title:{itemGap:2},series:[{center:["50%","78%"],detail:{fontSize:14,lineHeight:14}}]}},{query:{minWidth:420},option:{series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:40},axisLine:{lineStyle:{width:40}},axisTick:{distance:-45},splitLine:{distance:-50,length:5},axisLabel:{distance:15,fontSize:12}}]}},{query:{minWidth:420,minHeight:360},option:{series:[{detail:{fontSize:32,lineHeight:32}}]}},{query:{minWidth:420,minHeight:345},option:{series:[{detail:{fontSize:40,lineHeight:40}}]}},{query:{minWidth:460,maxHeight:230},option:{series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:30},axisLine:{lineStyle:{width:30}},axisTick:{distance:-35},splitLine:{distance:-40,length:5},axisLabel:{distance:15,fontSize:12}}]}},{query:{minWidth:326,minHeight:214},option:{title:{top:"10"},series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:30},axisLine:{lineStyle:{width:30}},axisTick:{distance:-35},splitLine:{distance:-40,length:5},axisLabel:{distance:15,fontSize:12}}]}}]},u={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"290",overflow:"break"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",textAlight:"right"},formatter(t){const e=a(t.value);return`\n <div style="display: block;width: 260px;white-space: wrap;line-height: 130%; font-weight: 500;color: #666;">${t.name}:</div>\n <div style="text-align: right;display: block;font-weight: 600;color: #333;">\n ${e}\n </div>\n `}},xAxis:{show:!1,axisLabel:{show:!1},type:"value"},yAxis:{show:!1,axisLabel:{show:!1},type:"category",data:[]},series:[{type:"bar",data:[],itemStyle:{color:"#B9D9EB"},yAxisIndex:"0",barMinWidth:"15",barGap:0,label:{show:!0,position:"insideLeft",textStyle:{fontFamily:"Montserrat",fontSize:10,lineHeight:11,fontWeight:600,color:"#333"},width:"280",padding:3,overflow:"break",formatter(t){const e=a(t.value);return`{name|${t.name}}\n${e}`},rich:{name:{fontFamily:"Montserrat",fontSize:8,padding:[2,0,2,0]}}}}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{minWidth:310},option:{series:[{label:{width:"310",rich:{name:{fontSize:9}}}}]}},{query:{minWidth:339},option:{series:[{label:{width:"339"}}]}},{query:{minWidth:420},option:{series:[{label:{width:"auto",overflow:"none",formatter(t){const e=a(t.value);return`{name|${t.name}}: ${e}`},rich:{name:{fontSize:11,padding:[2,0,0,0]}}}}]}},{query:{minHeight:320},option:{series:[{barMinWidth:"20",label:{textStyle:{fontSize:14,lineHeight:14}}}]}},{query:{minWidth:695},option:{series:[{label:{textStyle:{fontSize:16,lineHeight:16},rich:{name:{fontSize:13}}}}]}},{query:{minWidth:420,maxHeight:310},option:{grid:{top:"50"},title:{subtextStyle:{width:"auto",overflow:"none"}}}},{query:{minWidth:465,minHeight:343},option:{title:{top:"5",subtextStyle:{width:"auto",overflow:"none"}},series:[{barMinWidth:"20",label:{textStyle:{fontSize:14,lineHeight:14},width:"auto",overflow:"none",formatter(t){const e=a(t.value);return`{name|${t.name}}: ${e}`},rich:{name:{fontSize:11,padding:[2,0,0,0]}}}}]}}]},d={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"5",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"100%"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:600,color:"#333"},formatter(t){const e=a(t.value.toFixed(1));return`<span style="font-weight: 500;color: #666;">${t.name}:</span><br />${e} `}},series:[{type:"pie",radius:"30%",center:["50%","40%"],startAngle:265,endAngle:"auto",label:{show:!0,textStyle:{fontFamily:"Montserrat",fontSize:9,lineHeight:11,fontWeight:500},formatter(t){const e=a(t.value);return`${t.name}:\n${e}`}},labelLayout:{},labelLine:{show:!0,length:3},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:[]}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}},series:[{center:["50%","60%"],label:{width:"150",overflow:"break"}}]}},{query:{maxWidth:400},option:{series:[{label:{width:"108",overflow:"break"}}]}},{query:{maxWidth:300},option:{series:[{center:["50%","65%"],label:{width:"100",overflow:"break"},labelLine:{length:5,length2:10}}]}},{query:{minWidth:431},option:{series:[{radius:"35%",center:["50%","55%"],label:{textStyle:{fontSize:11,lineHeight:13},formatter(t){const e=a(t.value);return`${t.name}:\n{value|${e}}`},rich:{value:{fontFamily:"Montserrat",fontWeight:600,fontSize:13}}},labelLine:{length:5}}]}},{query:{minWidth:500},option:{series:[{radius:"40%",label:{textStyle:{fontSize:12,lineHeight:14},rich:{value:{fontSize:14}}},labelLine:{length:10}}]}},{query:{minWidth:500},option:{series:[{radius:"45%",center:["50%","60%"],labelLine:{length:15}}]}},{query:{minWidth:690},option:{series:[{radius:"60%",center:["50%","50%"],label:{textStyle:{fontSize:12,lineHeight:14},rich:{value:{fontSize:14}}}}]}},{query:{minWidth:950},option:{series:[{radius:"70%",labelLine:{length2:70}}]}}]},f={grid:{left:"0",right:"1%",bottom:"0",top:"65",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"5",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666",width:"300",overflow:"break"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"300",overflow:"break"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"-5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:600},formatter:t=>t},xAxis:{data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:8,color:"#333"}}},yAxis:{type:"value",gridIndex:0,min:0,offset:0,axisLabel:{formatter:a,margin:5,textStyle:{fontSize:8,fontFamily:"Montserrat",fontWeight:400}}},series:[{type:"bar",barWidth:"auto",barMinWidth:3,barMaxWidth:8,color:"#ccc",data:[]}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{minWidth:670},option:{series:[{barMinWidth:5,barMaxWidth:15}]}},{query:{minWidth:950},option:{xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}}}},{query:{minWidth:673,minHeight:343},option:{xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}}}}]},m={color:Object.values(["#F1AB86","#48A9A6","#ffbf69","#4BA3C3","#e56b6f","#284B63","#F96E46","#307473","#F6AE2D","#05668d","#A23E48","#0B3948"]),grid:{left:"0",right:"1%",bottom:"120",top:"65",containLabel:!0},title:{text:"",margin:0,padding:0,top:"5",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666",width:"280",overflow:"break"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"300",overflow:"break"}},legend:{show:!0,orient:"horizontal",bottom:"50",left:"0",data:[],padding:[0,5],itemWidth:6,itemGap:3,icon:"circle",textStyle:{fontSize:"10",fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:"290",overflow:"truncate"}},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500},renderMode:"html",formatter:t=>t},xAxis:{data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:8,color:"#333"}}},yAxis:{type:"value",axisLabel:{formatter:a,margin:5,textStyle:{fontSize:8,fontFamily:"Montserrat",fontWeight:400}}},series:[{value:null}],dataZoom:{left:0,right:5,start:95,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:"#72A0C1"}},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:"#72A0C1"},moveHandleStyle:{color:"#5D8AA8"}}},media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}},tooltip:{width:"260",textStyle:{fontSize:9,overflow:"break"}}}},{query:{minWidth:420},option:{grid:{bottom:"125"},legend:{padding:[0,10],itemWidth:8,textStyle:{fontSize:"11",width:"400"}}}},{query:{minWidth:670},option:{legend:{itemWidth:20,itemHeight:10,textStyle:{fontSize:"12",width:"660"},icon:"roundRect"},dataZoom:{start:75}}},{query:{minWidth:950},option:{grid:{bottom:"100"},xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}},dataZoom:{start:50}}},{query:{minWidth:673,minHeight:343},option:{grid:{bottom:"130"},xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}},dataZoom:{start:50}}}]},h={es_ES:new Map([["energia_media","ENERGIA MEDIA"],["distribucion_energia","DISTRIBUCIÓN ENERGÍA"],["top_energia","TOP ENERGÍA"],["por_grupos","POR GRUPOS"],["evolucion_energia","EVOLUCIÓN ENERGÍA"],["desagregada","DESAGREGADA"],["mensual","MENSUAL"],["diaria","DIARIA"],["anual","ANUAL"],["comparativa_energia","COMPARATIVA ENERGÍA"],["energia","Energía"]]),ca_ES:new Map([["energia_media","MITJANA ENERGIA"],["distribucion_energia","DISTRIBUCIÓ ENERGIA"],["top_energia","TOP ENERGIA"],["por_grupos","PER GRUPS"],["evolucion_energia","EVOLUCIÓ ENERGIA"],["desagregada","DESAGREGADA"],["mensual","MENSUAL"],["diaria","DIÀRIA"],["anual","ANUAL"],["comparativa_energia","COMPARATIVA ENERGIA"],["energia","Energia"]])},g="ca_ES";function p(e){const o=function(t){return t.length>0&&t[0].consumo_medio?t[0].consumo_medio:null}(e),n=function(t){return t.length>0&&t[0].consumo_maximo?t[0].consumo_maximo:10}(e),i=r(c),l=(0,t.formatWithPrefix)(o);return i.title.text=`${h[g].get("energia_media")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}`,i.title.subtext="MENSUAL"===Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()?`${h[g].get("diaria")}`:`${h[g].get("mensual")}`,i.series[0].max=(0,t.formatWithPrefix)(n).value,i.series[0].detail.formatter=a,i.series[0].axisLabel.formatter=t=>Math.round(t),i.series[0].data[0].value=l.value,i}function y(e){const o="chartConsumoMedio",n="no_dataConsumoMedio",a=(0,t.resultsetWithFields)(e);if(0===a.length)(0,t.printNoDataChart)(`#${o}`,`#${n}`);else{(0,t.printDataChart)(`#${n}`,`#${o}`);const e=p(a);(0,t.initChart)(o,e)}}function b(e){const o=r(u),n="chartTop",a="no_dataTop";0===e.resultset.length?(0,t.printNoDataChart)(`#${n}`,`#${a}`):(0,t.printDataChart)(`#${a}`,`#${n}`),(0,t.resultsetWithFields)(e).reverse().forEach(t=>{o.yAxis.data.push(t.address),o.series[0].data.push(t.total_energia)}),o.title.text=`${h[g].get("top_energia")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()} | ${function(){const e=Dashboards.getParameterValue("filterParamMesAnio")[0].toUpperCase();return"MENSUAL"===Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()?(0,t.formatShortMonthShortYear)(e):e}()}`,o.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2")[0].toUpperCase()}`,(0,t.initChart)(n,o)}function S(e){const o=["#54bebe","#76c8c8","#98d1d1","#badbdb","#B7D8E1","#A8D0DB","#a7d5ed","#63bff0","#22a7f0","#48b5c4"],n=r(d),a=e.resultset,i="chartDistribucion",l="no_dataDistribucion";0===a.length?(0,t.printNoDataChart)(`#${i}`,`#${l}`):(0,t.printDataChart)(`#${l}`,`#${i}`);const s=a.map(([t,e],n)=>({name:t,value:e,itemStyle:{color:o[n%o.length]}}));n.series[0].data=s,n.title.text=`${h[g].get("distribucion_energia")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}`,n.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()} ${h[g].get("por_grupos")}`,(0,t.initChart)(i,n)}const x="#B9D9EB",v="#ccc";function A(){return Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}function w(){return Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()}function M(e){const[{name:o}]=e;let n=o;6===o.length&&(n=i(o));const r=(0,t.capitalizarTexto)(A()),l=a(e[0].value);return`<span style="font-weight: 500;color: #666;">${h[g].get("energia")} ${r}</span>\n <span style="font-weight: 500;color: #666;">${n}:</span><br />\n <span style="text-align: right;display: block;font-weight: 600;color: #333;">\n ${l}\n </span>\n `}function D(t,e){const o=Object.values(t),n=[...new Set(o.map(t=>t.periodo))],a=r(f),i=function(t,e,o){const n=Dashboards.getParameterValue("filterParamMesAnio")[0].toUpperCase();return t.map(t=>{const a=e.find(e=>e.periodo===t),r=a?a.energia_total:0;let i=o;return t===n&&(i=x),{value:r,itemStyle:{color:i}}})}(n,o,e);return a.series[0].data=i,a.xAxis.data=n,a.tooltip.formatter=M,a.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2")[0].toUpperCase()}`,a}function E(e,o,n){const a=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(a,o,n)){let e=D(a,v);e=function(t){const e=r(t),o=A(),n=w();return e.title.text=`${h[g].get("evolucion_energia")} ${o}`,"MENSUAL"===n&&(e.xAxis.axisLabel.formatter=i),e}(e),(0,t.initChart)(o,e)}}function C(e,o,n){const a=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(a,o,n)){let e=D(a,x);e=function(t){const e=r(t),o=A(),n=w();return e.title.text=`${h[g].get("evolucion_energia")} ${o} ${h[g].get("desagregada")}`,"ANUAL"===n&&(e.xAxis.axisLabel.formatter=i),e.toolbox.top=5,e}(e),(0,t.initChart)(o,e)}}function $(){return Dashboards.getParameterValue("filterParamEnergia_comp")[0].toUpperCase()}function L(t){const[{name:e}]=t;let o=e;6===e.length&&(o=i(e));let n=`<strong>${o}</strong></br>`;return n+=t.map(t=>`<div style="display: inline-flex; justify-content: space-between; gap: 20px; width: 100%">\n <span>${t.marker} ${t.seriesName}</span>\n <span><strong>${a(t.value)}</strong></span>\n </div>`).join("<br />"),n}function F(t){const e=r(m),o=Object.values(t),n=Math.max(...o.map(t=>t.energia_total)),a=[...new Set(o.map(t=>t.periodo))],i={};o.forEach(({cups:t,periodo:e,energia_total:o})=>{i[t]||(i[t]={}),i[t][e]=o});const l=Object.keys(i).map(t=>({name:t,type:"line",smooth:!0,data:a.map(e=>i[t][e]||0)}));return e.xAxis.data=a,e.series=l,e.legend.data=Object.keys(i),e.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1_comp")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2_comp")[0].toUpperCase()}`,e.tooltip.formatter=L,e.yAxis.max=n>0?n:10,e}function z(e){const o="chartLineDesagregatDiari",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatDiari")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("diaria")}`,(0,t.initChart)(o,e)}}function W(e){const o="chartLineDesagregatMensual",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatMensual")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("mensual")}`,(0,t.initChart)(o,e)}}function T(e){const o="chartLineDesagregatAnual",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatAnual")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("anual")}`,e.dataZoom.start=50,(0,t.initChart)(o,e)}}})(),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.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,{MONTHS_YEAR:()=>a,MONTHS_YEAR_SHORT:()=>r,TEXTS_COMMON:()=>i,THRESHOLDS:()=>At,addPointInteger:()=>b,buildCamarasTrafico:()=>Lt,buildTableCalidadAire:()=>Mt,calculateMaxYAxis:()=>F,calculatePentahoPath:()=>Dt,calculateXAxisStart:()=>L,capitalizarTexto:()=>A,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>H,configureDataGaugeCommon:()=>O,configureDataGaugeMonthCommon:()=>I,configureDataLine:()=>k,configureDataValidate:()=>Ut,configureLinesChartValidates:()=>jt,convertDateToInteger:()=>y,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>yt,downloadCSVTable:()=>St,downloadPDFTable:()=>xt,formatCellMultiplesLines:()=>ht,formatDayMonthYear:()=>d,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>w,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>W,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>u,formatToMillions:()=>S,formatToTons:()=>x,formatTooltip:()=>$,formatTooltipPie:()=>z,formatTrimestre:()=>m,formatWithPrefix:()=>v,getEnvironment:()=>Et,getMaxFieldNumberFromData:()=>G,getMonth:()=>n,getMonthList:()=>h,getSelectCommonOptions:()=>nt,getSelectTwoColumnsOptions:()=>at,initBarChart:()=>Nt,initBarChartComparationMonth:()=>qt,initChart:()=>D,initContractAllGroups:()=>vt,initElement:()=>M,initExpandAllGroups:()=>wt,initStackedBarChart:()=>Wt,initStackedBarChartMonthSeries:()=>Pt,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>$t,loadIframeOnClickEvent:()=>Bt,printDataChart:()=>C,printDataInHTMLElements:()=>R,printEchart:()=>P,printNoDataChart:()=>E,resetFilter:()=>ot,resetFilterDate:()=>it,resetFilterDates:()=>rt,resetFilterToDefault:()=>dt,resultsetWithFields:()=>q,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>ut,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>U,subtractOneDay:()=>g,subtractOneMonth:()=>p,traverseRows:()=>pt,updateDomElement:()=>V,updateObject:()=>B,updateStackedBarOptions:()=>Tt});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)]}const a={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"]])},r={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),o[t.substring(4,6)]]}function c(t){const[e,o]=s(t);return`${o} ${e}`}function d(t){const[e,n,a]=function(t){return[t.substring(0,4),o[t.substring(4,6)],t.substring(6,8)]}(t);return`${a} ${n} ${e}`}function u(t){const[e,o]=s(t);return`${o.substring(0,3)} ${e}`}function f(t){const[e,o]=s(t);return`${o.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,o]=t.split("-");return`${parseFloat(o)/3}T ${e}`}function h(t,e){const o=t[e];return Array.from(o.values()).map(t=>t.slice(0,3))}function g(t){const e=Math.floor(t/1e4),o=new Date(e,t%1e4/100-1,t%100);return o.setDate(o.getDate()-1),`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}${o.getDate().toString().padStart(2,"0")}`}function p(t){let e;const o=new Date(Math.floor(t/100),t%100-1,0);return e=`${o.getFullYear()}${(o.getMonth()+1).toString().padStart(2,"0")}`,e}function y(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(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 S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function x(t){return t>=1e3?t/1e3+" Tn":t.toString()}function v(t){let e,o;return t>=1e6?(e=t/1e6,o="G"):t>=1e3?(e=t/1e3,o="M"):(e=t,o="k"),{value:Math.round(100*e)/100,prefix:o}}function w(t,e=29){if(t.length>=e){const o=t.split(" ");let n="",a="";return o.forEach(t=>{`${n} ${t}`.length<=e?n+=(n?" ":"")+t:(a+=`${n}\n`,n=t)}),a+=n,a}return t}function A(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,o)=>e+o[0].toUpperCase())}function M(t,e,o="MainContentLoadedCustom"){let n=document.getElementById(t);return n?Promise.resolve(e(n)):new Promise(a=>{document.body.addEventListener(o,()=>{n=document.getElementById(t),n?a(e(n)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),a(null))})})}function D(t,e){return M(t,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})}function E(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 C(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 $(t,e=!1,o=!0,n=""){let a=`<p style="font-weight: 500;color: #565656;">${t[0].name}</p>`;return t.forEach(t=>{const r=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?`${b(r)} ${n}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(r)} ${n}`:"-"}\n </span>\n </div>`;var l;a+=i}),a}function L(t){return 100*(t-120)/t}function F(t,e){const o=Math.max(...t);return o+(e-o%e)}function z(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}%`:b(t.value);return`<div> ${o} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${n} </span></div>`}function W(t,e){let o=`${t.name} : `;return o+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(o+=`<span> (${t.percent}%)</span>`),t.marker+o}function T(t){const e=1e6,o=Number(t);return o>=0&&o<e?`${b(o)} €`:o>=e?`${b(o/e)} M €`:"-"}function P(t,e,o){return 0===t.length?(E(`#${e}`,`#${o}`),!1):(C(`#${o}`,`#${e}`),!0)}function N(t,e,o=1){const n=Math.max(...t.map(t=>t[e]))*o;return 5e3*Math.ceil(n/5e3)}function O(t,e,o,n=30,a=15,r=30,i=-70,l=70,s=3){const c=N(t,e.data,1.1),d=l,u=o.slice(),f=[];let m=a,h=r,g=i;for(let o=0;o<t.length;o+=1)f.push({value:t[o][e.data],name:w(String(t[o][e.type]).replace(/\[.*?\]/g,"")),color:u.shift(),title:{offsetCenter:[`${String(g)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:n},detail:{offsetCenter:[`${String(g)}%`,`${String(h)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),g+=d,(o+1)%s===0&&(h+=r,m+=2*a,g=i);return[c,f]}function I(t,e,o,a=0){return[N(e,o.data,1),t=>function(t,e,o){const a=b(Math.round(e)),r=n(t[o][0]),i=t[o][1],l=`\n${r} ${i} : ${a}`,s=`${a}\n${r} ${i}`;return window.innerWidth<=1710?l:s}(e,t,a),[{value:e[a][o.data]}]]}function _(t,e){const{resultset:o}={resultset:t},n=new Set,a=new Set,r=o.map(([t,o,r])=>{const i=e?Math.round(r):r;return n.add(t),a.add(o),{day:o,type:t,value:i}}),i=Array.from(a.values()),l=Array.from(n.values());return l.sort((t,e)=>t.toLowerCase().localeCompare(e.toLowerCase(),"es",{ignorePunctuation:!0})),[l.map(t=>{const e=r.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,a]}function k(t,e=[],o=!1){const[n,a,r]=_(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,r,a]}function H(t,e,o=!1){const[n,a,r]=_(t,o);return n.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[n,r,a]}function q(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 B(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]=B(t[n]||{},e[n]))}),o}function R(t,e){const o=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(o=>{const n=o[0],a=o[1];"object"==typeof a?a.className?document.querySelector(a.className).className=t[n]:a.element&&a.format&&(document.querySelector(a.element).textContent=e[t.id][n].format(t[n])):document.querySelector(a).textContent=t[n]})})};try{o()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{o()})}}function G(t,e){const o=q(t),n=[];let a=null;return o.forEach(t=>{const o=t[e];"number"!=typeof o||Number.isNaN(o)||n.push(o)}),n.length>0&&(a=Math.max(...n)),a}function V(t,e){const o=document.querySelector(t);o?o.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function U(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 j=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],J=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],Y=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],Z=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],X=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(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 tt(t,e,o,n){return Q(e)?(t.queryDefinition.dataAccessId=o,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=n,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function ot(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function nt(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 at(t="Todos"){const e=nt(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function rt(t,e,o,n){const a=Dashboards.getParameterValue(o),r=Dashboards.getParameterValue(n);return Dashboards.fireChange(t,[a]),Dashboards.fireChange(e,[r]),!0}function it(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[o]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const o=Dashboards.getParameterValue(e),n=t.parameter;""!==o&&t.dashboard.setParameter(n,[o])}function ct(t){t.regional.es={monthNames:j,abbreviatedMonthNames:J,dayNames:Y,abbreviatedDayNames:Z,dayNamesMin:X,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function dt(t,e){const o=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(o)?o:[o]),!0}function ut(t,e,o,n=0){const a=t.resultset.slice(0,o).map(t=>t[n]);return Dashboards.setParameter(e,a),t}function ft(t,e){return M(t,t=>new Tabulator(t,e))}function mt(t,e){let o=t.getValue();return o.length>e&&(o=`${o.substr(0,e)}<br>${o.substr(e)}`),o}function ht(t,e){const o=t.getValue().split(" ");let n="",a="";return o.forEach(t=>{(a+t).length<=e?a+=`${t} `:(n+=`${a}<br>`,a=`${t} `)}),n+=`${a}<br>`,n}function gt(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const o=t.getTreeChildren();o.length>0&&o.forEach(t=>{t.getTreeChildren().length>0&&gt(t,e)})}function pt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&gt(t,e)})}function yt(t,e,o,n){const a=[];return Object.keys(t).forEach(r=>{if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,a)=>{const r={[e]:o[a],[n]:t};l._children.push(r)}),a.push(l)}}),a}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function xt(t,e,o){const n=document.getElementById(o),a=n.cloneNode(!0);n.parentNode.replaceChild(a,n),a.addEventListener("click",()=>{const o=t.getRows().map(t=>t.getData()),n=t.getColumns(),a={};n.forEach((t,e)=>{const n=t.getField();n&&o.every(t=>{const e=t[n];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(a[e]={halign:"right"})}),t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8,lineWidth:.1,lineColor:[200,200,200]},headStyles:{halign:"center"},columnStyles:a}})})}function vt(t,e,o){const n=document.getElementById(o);n&&n.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function wt(t,e,o){const n=document.getElementById(o);n&&n.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const At={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 Mt(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 a=document.createElement("td");if(a.setAttribute("id",t),null!=e){a.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);a.classList.add(t)}return a}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");const a=document.createElement("tr"),r=document.createElement("td");r.innerHTML=o.address,a.appendChild(r),a.appendChild(n(`${o.entityid}_so2`,o.so2value,At.SO2)),a.appendChild(n(`${o.entityid}_no2`,o.no2value,At.NO2)),a.appendChild(n(`${o.entityid}_o3`,o.o3value,At.O3)),a.appendChild(n(`${o.entityid}_pm10`,o.pm10value,At.PM10)),a.appendChild(n(`${o.entityid}_pm25`,o.pm25value,At.PM25)),e.push(a)}),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 Et(){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 $t(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},Ct("include-html-cabecera",function(){!function(){const t=Et();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Et();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Ct("include-html-menu"),Ct("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()}),Ct("include-html-copyright"),function(t="MainContentLoadedCustom"){document.body.addEventListener(t,()=>{try{Dashboards.init=window.realDashboardsInit,Dashboards.init()}catch(t){console.warn("No se pudo restaurar Dashboards.init; la función original no está disponible.")}},{once:!0})}()}function Lt(t,e,o,n,a,r){let i=!1,l=!1;const s=document.querySelector(t),c=document.querySelector(e),d=()=>{"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 u(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"),d(),l=!1)}const f=t=>{new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(l||d(),i||(i=!0,window.setTimeout(u,r)))})}).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(a).addEventListener("click",()=>{u(!1),window.setTimeout(u,r)})):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=>`${S(t)}€`}}]},zt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const o={};e.forEach(e=>{const n=e[1],a=e[0];a!==t.seriesName||o[n]||(o[n]=0),a===t.seriesName&&(o[n]+=e[2])});let n=`<p>${t.seriesName}</p>`;for(const[e,a]of Object.entries(o))n+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(a)}</span></div>`;return n};function Wt(t,e,o=void 0,n=void 0){const a=null===n?void 0:n,r=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=>zt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,o,n,a){const r={},i=a.contentSize[1]/2,l=a.viewSize[1],s=t[1];return s<i?r.top=10:s+i>l?r.bottom=10:r.top=s-i,t[0]<a.viewSize[0]/2?r.left=t[0]+20:r.right=a.viewSize[0]-t[0]+20,r}},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=>b(t)},splitLine:{lineStyle:{color:"#DDD"}}},yAxis:{type:"category",data:Array.from(r),axisLabel:{textStyle:{fontFamily:"Montserrat"}}},series:(()=>{const t={name:"SIN NOMBRE",type:"bar",stack:"total",label:{show:!0,fontFamily:"Montserrat",fontSize:10,formatter:t=>b(Math.round(t.value))},itemStyle:void 0,emphasis:{focus:"series"},data:void 0};a&&a.itemStyle&&Array.isArray(a.itemStyle.borderColor)&&(i=[...a.itemStyle.borderColor],delete a.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);r.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!==a?B(t,a):t,l.push({...n})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==o?B(l,o):l,D(t,s)}function Tt(t){let e={};return e=B(Ft,t),e}function Pt(t,e,o={},a={}){let r={};r=B(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===a?i:B(a,i),s=e;s.forEach((t,e)=>{s[e][0]=n(t[0])}),Wt(t,s,r,l)}function Nt(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=>W(t,!1)},series:[{type:"bar",showBackground:!0}]};let n={};n=void 0!==e?B(o,e):o,D(t,n)}const Ot="es_ES",It={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 _t(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===_t(t)),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n}),o}function Ht(t){const e=t.filter(e=>Number(e[0])===_t(t)-1),o=Array.from({length:12},()=>0);return e.forEach(([t,e,n])=>{const a=parseInt(e,10)-1;o[a]=n}),o}function qt(t,e,o=void 0){const n=_t(e).toString(),a=(_t(e)-1).toString();Nt(t,B({title:{left:"center",top:"-12%",textStyle:{fontSize:15,fontFamily:"Montserrat"}},legend:{top:"10%",show:!0,data:[a,n],textStyle:{fontFamily:"Montserrat"}},grid:{bottom:"8%",top:"20%",right:"2%"},xAxis:[{type:"category",data:h(It,Ot),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:a,type:"bar",data:Ht(e)},{name:n,type:"bar",barGap:0,data:kt(e)}]},o))}function Bt(t,e,o){const n=document.querySelector(e),a=document.querySelector(t);let r=!1;a.addEventListener("click",()=>{!1===r&&(r=!0,n.setAttribute("src","about:blank"),n.setAttribute("src",o),n.onload=()=>{r=!1})}),a.disabled=!1}const Rt="id",Gt="fecha",Vt="value";function Ut(t,e,o,n,a="es_ES"){const[r,i]=function(t,e,o){const n=[],a=[];return t.forEach(t=>{e.includes(`${t[Rt]}`)?n.push(`${t[Gt]}`):o.includes(`${t[Rt]}`)&&a.push(`${t[Gt]}`)}),[n.map(t=>[t,0]),a.map(t=>[t,0])]}(t,o,n);let l="es_ES"==a?"Datos sin validar":"Dades sense validar";0===i.length&&(l="");const s={name:"Datos validados",type:"line",data:[...r,i[0]],lineStyle:{color:"#00A9A0",width:4},showSymbol:!1,tooltip:{show:!1}};let c="",d="";if(0===i.length){const e=t[t.length-1].fecha;c=e,d=e}else c=i[0][0],d=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:d,yAxis:Math.max(...t.filter(t=>null!==t[Vt]).map(t=>parseInt(`${t[Vt]}`,10)))}]]}}]}function jt(t,e,o=void 0){D(t,B({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=>$(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 a=e[n];if(void 0!==a)return a.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,o),r.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,{echartBarEvolucion:()=>E,echartBarEvolucionDesagregada:()=>C,echartGaugeEnergiaMedia:()=>y,echartLineAnual:()=>T,echartLineDiaria:()=>z,echartLineMensual:()=>W,echartPie:()=>S,echartTop10:()=>b,getSelectCommonOptions:()=>t.getSelectCommonOptions,getSelectTwoColumnsOptions:()=>t.getSelectTwoColumnsOptions,indicadorEnergiaTotal:()=>s,initElement:()=>t.initElement,initValueDefaultDates:()=>t.initValueDefaultDates,resetFilter:()=>t.resetFilter,resetFilterDate:()=>t.resetFilterDate,resetFilterToDefault:()=>t.resetFilterToDefault,selectConfigDatasourceAllValue:()=>t.selectConfigDatasourceAllValue,setFechaDatosRecientes:()=>l});var t=o(2725);const e="Wh";function a(o){const{value:n,prefix:a}=(0,t.formatWithPrefix)(o);return`${n.toLocaleString("es-ES")} ${a}${e}`}function r(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?t.map(r):Object.entries(t).reduce((t,[e,o])=>({...t,[e]:"function"==typeof o?o:r(o)}),{})}function i(t){return`${t.substring(0,4)}/${t.substring(4,6)}`}function l(e,o){const n=(0,t.resultsetWithFields)(e);(0,t.initElement)(o,t=>{t.textContent=n[0].fecha_maxima})}function s(e){const o=(0,t.resultsetWithFields)(e),n=o[0].id,r={[n]:{value:{element:"#consumoTotal",format:a},id:{element:"#tipoEnergia",format:t=>`Total ${t}`}}};(0,t.printDataInHTMLElements)(o,r)}const c={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:"",margin:0,padding:0,top:"0",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"100%"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{show:!0,trigger:"none"},series:[{type:"gauge",center:["50%","75%"],radius:"85%",startAngle:200,endAngle:-20,data:[{value:null}],detail:{width:"50%",borderRadius:0,offsetCenter:[0,0],valueAnimation:!0,color:"#284B63",fontStyle:"normal",fontWeight:"600",fontFamily:"Montserrat",fontSize:18,lineHeight:18,formatter:a},progress:{show:!0,width:20,itemStyle:{color:"#B9D9EB"}},axisLine:{lineStyle:{width:20}},axisTick:{distance:-25,splitNumber:5,length:3,lineStyle:{width:1,color:"#ccc"}},splitLine:{distance:-28,length:2,lineStyle:{width:1,color:"#ccc"}},axisLabel:{distance:6,fontSize:10,fontWeight:"400",fontFamily:"Montserrat",color:"#666"},anchor:{show:!1},pointer:{show:!1}}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{maxHeight:150},option:{title:{itemGap:2},series:[{center:["50%","78%"],detail:{fontSize:14,lineHeight:14}}]}},{query:{minWidth:420},option:{series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:40},axisLine:{lineStyle:{width:40}},axisTick:{distance:-45},splitLine:{distance:-50,length:5},axisLabel:{distance:15,fontSize:12}}]}},{query:{minWidth:420,minHeight:360},option:{series:[{detail:{fontSize:32,lineHeight:32}}]}},{query:{minWidth:420,minHeight:345},option:{series:[{detail:{fontSize:40,lineHeight:40}}]}},{query:{minWidth:460,maxHeight:230},option:{series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:30},axisLine:{lineStyle:{width:30}},axisTick:{distance:-35},splitLine:{distance:-40,length:5},axisLabel:{distance:15,fontSize:12}}]}},{query:{minWidth:326,minHeight:214},option:{title:{top:"10"},series:[{center:["50%","75%"],radius:"90%",detail:{fontSize:25,lineHeight:25},progress:{width:30},axisLine:{lineStyle:{width:30}},axisTick:{distance:-35},splitLine:{distance:-40,length:5},axisLabel:{distance:15,fontSize:12}}]}}]},d={grid:{left:"0",right:"0",bottom:"0",top:"60",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"0",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:"15",lineHeight:15,fontFamily:"Montserrat",fontWeight:"500",color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:500,color:"#666",width:"290",overflow:"break"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,textStyle:{fontFamily:"Montserrat",fontSize:12,color:"#666",textAlight:"right"},formatter(t){const e=a(t.value);return`\n <div style="display: block;width: 260px;white-space: wrap;line-height: 130%; font-weight: 500;color: #666;">${t.name}:</div>\n <div style="text-align: right;display: block;font-weight: 600;color: #333;">\n ${e}\n </div>\n `}},xAxis:{show:!1,axisLabel:{show:!1},type:"value"},yAxis:{show:!1,axisLabel:{show:!1},type:"category",data:[]},series:[{type:"bar",data:[],itemStyle:{color:"#B9D9EB"},yAxisIndex:"0",barMinWidth:"15",barGap:0,label:{show:!0,position:"insideLeft",textStyle:{fontFamily:"Montserrat",fontSize:10,lineHeight:11,fontWeight:600,color:"#333"},width:"280",padding:3,overflow:"break",formatter(t){const e=a(t.value);return`{name|${t.name}}\n${e}`},rich:{name:{fontFamily:"Montserrat",fontSize:8,padding:[2,0,2,0]}}}}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{minWidth:310},option:{series:[{label:{width:"310",rich:{name:{fontSize:9}}}}]}},{query:{minWidth:339},option:{series:[{label:{width:"339"}}]}},{query:{minWidth:420},option:{series:[{label:{width:"auto",overflow:"none",formatter(t){const e=a(t.value);return`{name|${t.name}}: ${e}`},rich:{name:{fontSize:11,padding:[2,0,0,0]}}}}]}},{query:{minHeight:320},option:{series:[{barMinWidth:"20",label:{textStyle:{fontSize:14,lineHeight:14}}}]}},{query:{minWidth:695},option:{series:[{label:{textStyle:{fontSize:16,lineHeight:16},rich:{name:{fontSize:13}}}}]}},{query:{minWidth:420,maxHeight:310},option:{grid:{top:"50"},title:{subtextStyle:{width:"auto",overflow:"none"}}}},{query:{minWidth:465,minHeight:343},option:{title:{top:"5",subtextStyle:{width:"auto",overflow:"none"}},series:[{barMinWidth:"20",label:{textStyle:{fontSize:14,lineHeight:14},width:"auto",overflow:"none",formatter(t){const e=a(t.value);return`{name|${t.name}}: ${e}`},rich:{name:{fontSize:11,padding:[2,0,0,0]}}}}]}}]},u={grid:{left:"0",right:"0",bottom:"0",top:"50",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"5",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"100%"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:600,color:"#333"},formatter(t){const e=a(t.value.toFixed(1));return`<span style="font-weight: 500;color: #666;">${t.name}:</span><br />${e} `}},series:[{type:"pie",radius:"30%",center:["50%","40%"],startAngle:265,endAngle:"auto",label:{show:!0,textStyle:{fontFamily:"Montserrat",fontSize:9,lineHeight:11,fontWeight:500},formatter(t){const e=a(t.value);return`${t.name}:\n${e}`}},labelLayout:{},labelLine:{show:!0,length:3},emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},data:[]}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}},series:[{center:["50%","60%"],label:{width:"150",overflow:"break"}}]}},{query:{maxWidth:400},option:{series:[{label:{width:"108",overflow:"break"}}]}},{query:{maxWidth:300},option:{series:[{center:["50%","65%"],label:{width:"100",overflow:"break"},labelLine:{length:5,length2:10}}]}},{query:{minWidth:431},option:{series:[{radius:"35%",center:["50%","55%"],label:{textStyle:{fontSize:11,lineHeight:13},formatter(t){const e=a(t.value);return`${t.name}:\n{value|${e}}`},rich:{value:{fontFamily:"Montserrat",fontWeight:600,fontSize:13}}},labelLine:{length:5}}]}},{query:{minWidth:500},option:{series:[{radius:"40%",label:{textStyle:{fontSize:12,lineHeight:14},rich:{value:{fontSize:14}}},labelLine:{length:10}}]}},{query:{minWidth:500},option:{series:[{radius:"45%",center:["50%","60%"],labelLine:{length:15}}]}},{query:{minWidth:690},option:{series:[{radius:"60%",center:["50%","50%"],label:{textStyle:{fontSize:12,lineHeight:14},rich:{value:{fontSize:14}}}}]}},{query:{minWidth:950},option:{series:[{radius:"70%",labelLine:{length2:70}}]}}]},f={grid:{left:"0",right:"1%",bottom:"0",top:"65",containLabel:!0},title:{text:"",margin:"0",padding:0,top:"5",left:"50%",textAlign:"center",itemGap:3,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666",width:"300",overflow:"break"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"300",overflow:"break"}},legend:{show:!1},toolbox:{show:!0,right:"0",top:"-5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{confine:!0,trigger:"axis",axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:600},formatter:t=>t},xAxis:{data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:8,color:"#333"}}},yAxis:{type:"value",gridIndex:0,min:0,offset:0,axisLabel:{formatter:a,margin:5,textStyle:{fontSize:8,fontFamily:"Montserrat",fontWeight:400}}},series:[{type:"bar",barWidth:"auto",barMinWidth:3,barMaxWidth:8,color:"#ccc",data:[]}],media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}}}},{query:{minWidth:670},option:{series:[{barMinWidth:5,barMaxWidth:15}]}},{query:{minWidth:950},option:{xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}}}},{query:{minWidth:673,minHeight:343},option:{xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}}}}]},m={color:Object.values(["#F1AB86","#48A9A6","#ffbf69","#4BA3C3","#e56b6f","#284B63","#F96E46","#307473","#F6AE2D","#05668d","#A23E48","#0B3948"]),grid:{left:"0",right:"1%",bottom:"120",top:"65",containLabel:!0},title:{text:"",margin:0,padding:0,top:"5",left:"50%",textAlign:"center",itemGap:5,textStyle:{fontSize:15,fontFamily:"Montserrat",fontWeight:500,color:"#666",width:"280",overflow:"break"},subtext:"",subtextStyle:{fontFamily:"Montserrat",fontSize:12,lineHeight:12,fontWeight:400,color:"#666",width:"300",overflow:"break"}},legend:{show:!0,orient:"horizontal",bottom:"50",left:"0",data:[],padding:[0,5],itemWidth:6,itemGap:3,icon:"circle",textStyle:{fontSize:"10",fontFamily:"Montserrat",fontWeight:"400",color:"#666",width:"290",overflow:"truncate"}},toolbox:{show:!0,right:"0",top:"5",feature:{saveAsImage:{title:"Descarregar"}},emphasis:{iconStyle:{borderColor:"#ffcd00"}},showTitle:!1,tooltip:{show:!0,padding:[5,8],position:"left",formatter:t=>`<div>${t.title}</div>`,backgroundColor:"#fff",textStyle:{fontSize:11,fontFamily:"Montserrat",fontWeight:600},extraCssText:"box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);border-radius: 0;"}},tooltip:{trigger:"axis",confine:!0,axisPointer:{type:"shadow"},textStyle:{fontFamily:"Montserrat",fontSize:12,fontWeight:500},renderMode:"html",formatter:t=>t},xAxis:{data:[],axisTick:{show:!1},boundaryGap:["20%","20%"],gridIndex:0,offset:0,axisLine:{lineStyle:{color:"#ccc"}},axisLabel:{show:!0,interval:"auto",textStyle:{fontFamily:"Montserrat",fontSize:8,color:"#333"}}},yAxis:{type:"value",axisLabel:{formatter:a,margin:5,textStyle:{fontSize:8,fontFamily:"Montserrat",fontWeight:400}}},series:[{value:null}],dataZoom:{left:0,right:5,start:95,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:"#72A0C1"}},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:"#72A0C1"},moveHandleStyle:{color:"#5D8AA8"}}},media:[{query:{maxWidth:430},option:{title:{textStyle:{fontSize:13,width:"265"},subtextStyle:{fontSize:11,lineHeight:11,width:"265"}},tooltip:{width:"260",textStyle:{fontSize:9,overflow:"break"}}}},{query:{minWidth:420},option:{grid:{bottom:"125"},legend:{padding:[0,10],itemWidth:8,textStyle:{fontSize:"11",width:"400"}}}},{query:{minWidth:670},option:{legend:{itemWidth:20,itemHeight:10,textStyle:{fontSize:"12",width:"660"},icon:"roundRect"},dataZoom:{start:75}}},{query:{minWidth:950},option:{grid:{bottom:"100"},xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}},dataZoom:{start:50}}},{query:{minWidth:673,minHeight:343},option:{grid:{bottom:"130"},xAxis:{axisLabel:{textStyle:{fontSize:10}}},yAxis:{axisLabel:{textStyle:{fontSize:10}}},dataZoom:{start:50}}}]},h={es_ES:new Map([["energia_media","ENERGIA MEDIA"],["distribucion_energia","DISTRIBUCIÓN ENERGÍA"],["top_energia","TOP ENERGÍA"],["por_grupos","POR GRUPOS"],["evolucion_energia","EVOLUCIÓN ENERGÍA"],["desagregada","DESAGREGADA"],["mensual","MENSUAL"],["diaria","DIARIA"],["anual","ANUAL"],["comparativa_energia","COMPARATIVA ENERGÍA"],["energia","Energía"]]),ca_ES:new Map([["energia_media","MITJANA ENERGIA"],["distribucion_energia","DISTRIBUCIÓ ENERGIA"],["top_energia","TOP ENERGIA"],["por_grupos","PER GRUPS"],["evolucion_energia","EVOLUCIÓ ENERGIA"],["desagregada","DESAGREGADA"],["mensual","MENSUAL"],["diaria","DIÀRIA"],["anual","ANUAL"],["comparativa_energia","COMPARATIVA ENERGIA"],["energia","Energia"]])},g="ca_ES";function p(e){const o=function(t){return t.length>0&&t[0].consumo_medio?t[0].consumo_medio:null}(e),n=function(t){return t.length>0&&t[0].consumo_maximo?t[0].consumo_maximo:10}(e),i=r(c),l=(0,t.formatWithPrefix)(o);return i.title.text=`${h[g].get("energia_media")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}`,i.title.subtext="MENSUAL"===Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()?`${h[g].get("diaria")}`:`${h[g].get("mensual")}`,i.series[0].max=(0,t.formatWithPrefix)(n).value,i.series[0].detail.formatter=a,i.series[0].axisLabel.formatter=t=>Math.round(t),i.series[0].data[0].value=l.value,i}function y(e){const o="chartConsumoMedio",n="no_dataConsumoMedio",a=(0,t.resultsetWithFields)(e);if(0===a.length)(0,t.printNoDataChart)(`#${o}`,`#${n}`);else{(0,t.printDataChart)(`#${n}`,`#${o}`);const e=p(a);(0,t.initChart)(o,e)}}function b(e){const o=r(d),n="chartTop",a="no_dataTop";0===e.resultset.length?(0,t.printNoDataChart)(`#${n}`,`#${a}`):(0,t.printDataChart)(`#${a}`,`#${n}`),(0,t.resultsetWithFields)(e).reverse().forEach(t=>{o.yAxis.data.push(t.address),o.series[0].data.push(t.total_energia)}),o.title.text=`${h[g].get("top_energia")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()} | ${function(){const e=Dashboards.getParameterValue("filterParamMesAnio")[0].toUpperCase();return"MENSUAL"===Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()?(0,t.formatShortMonthShortYear)(e):e}()}`,o.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2")[0].toUpperCase()}`,(0,t.initChart)(n,o)}function S(e){const o=["#54bebe","#76c8c8","#98d1d1","#badbdb","#B7D8E1","#A8D0DB","#a7d5ed","#63bff0","#22a7f0","#48b5c4"],n=r(u),a=e.resultset,i="chartDistribucion",l="no_dataDistribucion";0===a.length?(0,t.printNoDataChart)(`#${i}`,`#${l}`):(0,t.printDataChart)(`#${l}`,`#${i}`);const s=a.map(([t,e],n)=>({name:t,value:e,itemStyle:{color:o[n%o.length]}}));n.series[0].data=s,n.title.text=`${h[g].get("distribucion_energia")} ${Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}`,n.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()} ${h[g].get("por_grupos")}`,(0,t.initChart)(i,n)}const x="#B9D9EB",v="#ccc";function w(){return Dashboards.getParameterValue("filterParamEnergia")[0].toUpperCase()}function A(){return Dashboards.getParameterValue("filterParamPeriodo")[0].toUpperCase()}function M(e){const[{name:o}]=e;let n=o;6===o.length&&(n=i(o));const r=(0,t.capitalizarTexto)(w()),l=a(e[0].value);return`<span style="font-weight: 500;color: #666;">${h[g].get("energia")} ${r}</span>\n <span style="font-weight: 500;color: #666;">${n}:</span><br />\n <span style="text-align: right;display: block;font-weight: 600;color: #333;">\n ${l}\n </span>\n `}function D(t,e){const o=Object.values(t),n=[...new Set(o.map(t=>t.periodo))],a=r(f),i=function(t,e,o){const n=Dashboards.getParameterValue("filterParamMesAnio")[0].toUpperCase();return t.map(t=>{const a=e.find(e=>e.periodo===t),r=a?a.energia_total:0;let i=o;return t===n&&(i=x),{value:r,itemStyle:{color:i}}})}(n,o,e);return a.series[0].data=i,a.xAxis.data=n,a.tooltip.formatter=M,a.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2")[0].toUpperCase()}`,a}function E(e,o,n){const a=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(a,o,n)){let e=D(a,v);e=function(t){const e=r(t),o=w(),n=A();return e.title.text=`${h[g].get("evolucion_energia")} ${o}`,"MENSUAL"===n&&(e.xAxis.axisLabel.formatter=i),e}(e),(0,t.initChart)(o,e)}}function C(e,o,n){const a=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(a,o,n)){let e=D(a,x);e=function(t){const e=r(t),o=w(),n=A();return e.title.text=`${h[g].get("evolucion_energia")} ${o} ${h[g].get("desagregada")}`,"ANUAL"===n&&(e.xAxis.axisLabel.formatter=i),e.toolbox.top=5,e}(e),(0,t.initChart)(o,e)}}function $(){return Dashboards.getParameterValue("filterParamEnergia_comp")[0].toUpperCase()}function L(t){const[{name:e}]=t;let o=e;6===e.length&&(o=i(e));let n=`<strong>${o}</strong></br>`;return n+=t.map(t=>`<div style="display: inline-flex; justify-content: space-between; gap: 20px; width: 100%">\n <span>${t.marker} ${t.seriesName}</span>\n <span><strong>${a(t.value)}</strong></span>\n </div>`).join("<br />"),n}function F(t){const e=r(m),o=Object.values(t),n=Math.max(...o.map(t=>t.energia_total)),a=[...new Set(o.map(t=>t.periodo))],i={};o.forEach(({cups:t,periodo:e,energia_total:o})=>{i[t]||(i[t]={}),i[t][e]=o});const l=Object.keys(i).map(t=>({name:t,type:"line",smooth:!0,data:a.map(e=>i[t][e]||0)}));return e.xAxis.data=a,e.series=l,e.legend.data=Object.keys(i),e.title.subtext=`${Dashboards.getParameterValue("filterParamCategoria1_comp")[0].toUpperCase()}: ${Dashboards.getParameterValue("filterParamCategoria2_comp")[0].toUpperCase()}`,e.tooltip.formatter=L,e.yAxis.max=n>0?n:10,e}function z(e){const o="chartLineDesagregatDiari",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatDiari")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("diaria")}`,(0,t.initChart)(o,e)}}function W(e){const o="chartLineDesagregatMensual",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatMensual")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("mensual")}`,(0,t.initChart)(o,e)}}function T(e){const o="chartLineDesagregatAnual",n=(0,t.resultsetWithFields)(e);if((0,t.printEchart)(n,o,"no_dataLineDesagregatAnual")){const e=F(n);e.title.text=`${h[g].get("comparativa_energia")} ${$()} ${h[g].get("anual")}`,e.dataZoom.start=50,(0,t.initChart)(o,e)}}})(),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,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[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,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>Mt,addPointInteger:()=>b,buildCamarasTrafico:()=>$t,buildTableCalidadAire:()=>At,calculateMaxYAxis:()=>N,calculatePentahoPath:()=>xt,calculateXAxisStart:()=>F,capitalizarTexto:()=>x,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>R,configureDataGaugeCommon:()=>z,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>B,configureDataValidate:()=>Wt,configureLinesChartValidates:()=>Vt,convertDateToInteger:()=>g,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>gt,downloadCSVTable:()=>St,downloadPDFTable:()=>vt,formatCellMultiplesLines:()=>pt,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>O,formatMonthAnyo:()=>c,formatName:()=>A,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>T,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>v,formatTooltip:()=>w,formatTooltipPie:()=>L,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>Et,getMaxFieldNumberFromData:()=>W,getMonth:()=>o,getMonthList:()=>p,getSelectCommonOptions:()=>ot,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>Ot,initBarChartComparationMonth:()=>Bt,initChart:()=>D,initElement:()=>E,initStackedBarChart:()=>Nt,initStackedBarChartMonthSeries:()=>Tt,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>Ct,loadIframeOnClickEvent:()=>Rt,printDataChart:()=>$,printDataInHTMLElements:()=>j,printEchart:()=>P,printNoDataChart:()=>C,resetFilter:()=>nt,resetFilterDate:()=>it,resetFilterDates:()=>at,resetFilterToDefault:()=>ut,resultsetWithFields:()=>J,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>H,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>yt,updateDomElement:()=>V,updateObject:()=>q,updateStackedBarOptions:()=>Lt});const n={"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)]}const r={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"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),n[t.substring(4,6)]]}function c(t){const[e,n]=s(t);return`${n} ${e}`}function u(t){const[e,o,r]=function(t){return[t.substring(0,4),n[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${o} ${e}`}function d(t){const[e,n]=s(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=s(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function p(t,e){const n=t[e];return Array.from(n.values()).map(t=>t.slice(0,3))}function h(t){const e=Math.floor(t/1e4),n=new Date(e,t%1e4/100-1,t%100);return n.setDate(n.getDate()-1),`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}${n.getDate().toString().padStart(2,"0")}`}function y(t){let e;const n=new Date(Math.floor(t/100),t%100-1,0);return e=`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(t,e=2){let n=navigator.language||navigator.userLanguage;n=n.length<=2?`${n}-${n.toUpperCase()}`:n;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===n?t.toLocaleString("de-DE",o):t.toLocaleString(n,o)}function S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function v(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,n;return t>=1e6?(e=t/1e6,n="G"):t>=1e3?(e=t/1e3,n="M"):(e=t,n="k"),{value:Math.round(100*e)/100,prefix:n}}function A(t,e=29){if(t.length>=e){const n=t.split(" ");let o="",r="";return n.forEach(t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(r+=`${o}\n`,o=t)}),r+=o,r}return t}function x(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function E(t,e,n="MainContentLoadedCustom"){let o=document.getElementById(t);return o?Promise.resolve(e(o)):new Promise(r=>{document.body.addEventListener(n,()=>{o=document.getElementById(t),o?r(e(o)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function D(t,e){return E(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",()=>{n.resize()}),o.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function C(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function $(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function w(t,e=!1,n=!0,o=""){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=n?`<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?`${b(a)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(a)} ${o}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function F(t){return 100*(t-120)/t}function N(t,e){const n=Math.max(...t);return n+(e-n%e)}function L(t,e=!1){const n=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,o=e?`${t.percent}%`:b(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function T(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function O(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${b(n)} €`:n>=e?`${b(n/e)} M €`:"-"}function P(t,e,n){return 0===t.length?(C(`#${e}`,`#${n}`),!1):($(`#${n}`,`#${e}`),!0)}function I(t,e,n=1){const o=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(o/5e3)}function z(t,e,n,o=30,r=15,a=30,i=-70,l=70,s=3){const c=I(t,e.data,1.1),u=l,d=n.slice(),f=[];let m=r,p=a,h=i;for(let n=0;n<t.length;n+=1)f.push({value:t[n][e.data],name:A(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),h+=u,(n+1)%s===0&&(p+=a,m+=2*r,h=i);return[c,f]}function k(t,e,n,r=0){return[I(e,n.data,1),t=>function(t,e,n){const r=b(Math.round(e)),a=o(t[n][0]),i=t[n][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][n.data]}]]}function _(t,e){const{resultset:n}={resultset:t},o=new Set,r=new Set,a=n.map(([t,n,a])=>{const i=e?Math.round(a):a;return o.add(t),r.add(n),{day:n,type:t,value:i}}),i=Array.from(r.values()),l=Array.from(o.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:n})=>[e,t,n]),n=i.map(t=>{const n=e.find(([e])=>e===t);return n?n[2]:null});return{name:t,data:n}}),l,r]}function B(t,e=[],n=!1){const[o,r,a]=_(t,n);return o.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[o,a,r]}function R(t,e,n=!1){const[o,r,a]=_(t,n);return o.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[o,a,r]}function J(t){const{resultset:e,metadata:n}=t,o=[];return e.forEach(t=>{const e={};t.forEach((t,o)=>{e[n[o].colName]=t}),o.push(e)}),o}function q(t,e){const n={...t};return Object.keys(e).forEach(o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o&&Array.isArray(e[o])?n[o]=e[o].map((e,n)=>({...Array.isArray(t[o])&&t[o][n]||{},...e})):"object"!=typeof e[o]||null===e[o]||Array.isArray(e[o])?t[o]!==e[o]&&(n[o]=e[o]):n[o]=q(t[o]||{},e[o]))}),n}function j(t,e){const n=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(n=>{const o=n[0],r=n[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]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function W(t,e){const n=J(t),o=[];let r=null;return n.forEach(t=>{const n=t[e];"number"!=typeof n||Number.isNaN(n)||o.push(n)}),o.length>0&&(r=Math.max(...o)),r}function V(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function H(t,e=!0){const n={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?n.Cont.push([t[3],t[4],t[2]]):n.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?n.Mob.push([t[3],t[4],t[2]]):n.Mob.push([t[3],t[2]]))}),n}const G=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Y=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],U=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(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 tt(t,e,n,o){return Q(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function nt(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function ot(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 rt(t="Todos"){const e=ot(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function at(t,e,n,o){const r=Dashboards.getParameterValue(n),a=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function it(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const n=Dashboards.getParameterValue(e),o=t.parameter;""!==n&&t.dashboard.setParameter(o,[n])}function ct(t){t.regional.es={monthNames:G,abbreviatedMonthNames:Y,dayNames:U,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function dt(t,e,n,o=0){const r=t.resultset.slice(0,n).map(t=>t[o]);return Dashboards.setParameter(e,r),t}function ft(t,e){return E(t,t=>new Tabulator(t,e))}function mt(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function pt(t,e){const n=t.getValue().split(" ");let o="",r="";return n.forEach(t=>{(r+t).length<=e?r+=`${t} `:(o+=`${r}<br>`,r=`${t} `)}),o+=`${r}<br>`,o}function ht(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function yt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function gt(t,e,n,o){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]:n[r],[o]:t};l._children.push(a)}),r.push(l)}return r}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,n){const o=document.getElementById(n),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";"})})}function vt(t,e,n){const o=document.getElementById(n),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 Mt={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 At(t){const e=[],n={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,n)=>{e<=t&&5===o&&(o=n)})),n[o]}(o,e);r.classList.add(t)}return r}return t.forEach(t=>{const n=t;"noData"===n.operationalstatus&&(n.so2value="ND",n.no2value="ND",n.o3value="ND",n.pm10value="ND",n.pm25value="ND");const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=n.address,r.appendChild(a),r.appendChild(o(`${n.entityid}_so2`,n.so2value,Mt.SO2)),r.appendChild(o(`${n.entityid}_no2`,n.no2value,Mt.NO2)),r.appendChild(o(`${n.entityid}_o3`,n.o3value,Mt.O3)),r.appendChild(o(`${n.entityid}_pm10`,n.pm10value,Mt.PM10)),r.appendChild(o(`${n.entityid}_pm25`,n.pm25value,Mt.PM25)),e.push(r)}),e}function xt(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 Et(){const t=window.location.href;let e="";return e=t.includes("localhost")?"local":t.includes("sc_valencia_pre")?"PRE":"PRO",e}function Dt(t,e){document.querySelectorAll(`[${t}]`).forEach(n=>{!function(t,e,n){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,n&&n()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(n.getAttribute(t),n,e)})}function Ct(t){Dt("include-html-cabecera",function(){!function(){const t=Et();"PRO"!==t&&(document.title+=` (${t})`)}(),function(){const t=Et();"PRO"!==t&&(document.querySelector("nav").querySelectorAll("span")[1].textContent+=` (${t})`)}()}),Dt("include-html-menu"),Dt("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()}),Dt("include-html-copyright"),function(t="MainContentLoadedCustom"){let e=["FilterComponent","buttonComponent"];const n=document.body.getAttribute("update-component-types");n&&(e=n.split(",").map(t=>t.trim())),document.body.addEventListener(t,()=>{const t=(Dashboards.components||[]).filter(t=>e.includes(t.type));0!==t.length&&t.forEach(t=>{document.getElementById(t.htmlObject)?"function"==typeof t.update?setTimeout(()=>{try{t.update()}catch(e){console.error(`Error al actualizar "${t.name}":`,e)}},250):console.error(`El componente de Pentaho "${t.name}" no tiene método .update().`):console.warn(`No se encontró el contenedor para el componente "${t.name}" de tipo "${t.type}".`)})},{once:!0})}()}function $t(t,e,n,o,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(n);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(o)[0].style.display="none"}const wt={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=>`${S(t)}€`}}]},Ft=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const n={};e.forEach(e=>{const o=e[1],r=e[0];r!==t.seriesName||n[o]||(n[o]=0),r===t.seriesName&&(n[o]+=e[2])});let o=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(n))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(r)}</span></div>`;return o};function Nt(t,e,n=void 0,o=void 0){const r=null===o?void 0:o,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=>Ft(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,o,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=>b(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=>b(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 n=function(t){return t.reduce((t,e)=>{const n=e[0];return t[n]||(t[n]=[]),t[n].push(e),t},{})}(e),o=Object.keys(n);a.forEach(t=>{o.forEach(e=>{void 0===n[e].find(e=>e[1]===t)&&(n[e].push([n[e][0][0],t,void 0]),n[e].sort())})});const l=[];return Object.keys(n).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=n[e].map(t=>t[2]);let o={};o=void 0!==r?q(t,r):t,l.push({...o})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==n?q(l,n):l,D(t,s)}function Lt(t){let e={};return e=q(wt,t),e}function Tt(t,e,n={},r={}){let a={};a=q(n,{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:q(r,i),s=e;s.forEach((t,e)=>{s[e][0]=o(t[0])}),Nt(t,s,a,l)}function Ot(t,e=void 0){const n={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=>T(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?q(n,e):n,D(t,o)}const Pt="es_ES",It={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 zt(t){return Math.max(...t.map(t=>Number(t[0])))}function kt(t){const e=t.filter(e=>Number(e[0])===zt(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const r=parseInt(e,10)-1;n[r]=o}),n}function _t(t){const e=t.filter(e=>Number(e[0])===zt(t)-1),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const r=parseInt(e,10)-1;n[r]=o}),n}function Bt(t,e,n=void 0){const o=zt(e).toString(),r=(zt(e)-1).toString();Ot(t,q({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:p(It,Pt),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:_t(e)},{name:o,type:"bar",barGap:0,data:kt(e)}]},n))}function Rt(t,e,n){const o=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",()=>{!1===a&&(a=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",n),o.onload=()=>{a=!1})}),r.disabled=!1}const Jt="id",qt="fecha",jt="value";function Wt(t,e,n,o,r="es_ES"){const[a,i]=function(t,e,n){const o=[],r=[];return t.forEach(t=>{e.includes(`${t[Jt]}`)?o.push(`${t[qt]}`):n.includes(`${t[Jt]}`)&&r.push(`${t[qt]}`)}),[o.map(t=>[t,0]),r.map(t=>[t,0])]}(t,n,o);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[jt]).map(t=>parseInt(`${t[jt]}`,10)))}]]}}]}function Vt(t,e,n=void 0){D(t,q({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=>w(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},n))}return e})(),t.exports=e()}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.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";n.r(o),n.d(o,{calculatePentahoPath:()=>t.calculatePentahoPath,initialCalls:()=>t.initialCalls});var t=n(2725)})(),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.initialCalls=e():t.initialCalls=e()}(self,()=>(()=>{var t={2725:t=>{var e;self,e=()=>(()=>{"use strict";var t={d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[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,{MONTHS_YEAR:()=>r,MONTHS_YEAR_SHORT:()=>a,TEXTS_COMMON:()=>i,THRESHOLDS:()=>xt,addPointInteger:()=>b,buildCamarasTrafico:()=>Ft,buildTableCalidadAire:()=>Dt,calculateMaxYAxis:()=>L,calculatePentahoPath:()=>Et,calculateXAxisStart:()=>F,capitalizarTexto:()=>x,checkAllGroupsCollapsed:()=>bt,configureDataBar:()=>R,configureDataGaugeCommon:()=>z,configureDataGaugeMonthCommon:()=>k,configureDataLine:()=>B,configureDataValidate:()=>Vt,configureLinesChartValidates:()=>Ht,convertDateToInteger:()=>g,convertToLanguageSelectorDateRange:()=>ct,convertToTableTreeView:()=>gt,downloadCSVTable:()=>St,downloadPDFTable:()=>vt,formatCellMultiplesLines:()=>pt,formatDayMonthYear:()=>u,formatMilMillionEuros:()=>T,formatMonthAnyo:()=>c,formatName:()=>A,formatNameHeaderColumn:()=>mt,formatRoundTooltip:()=>O,formatShortMonthShortYear:()=>f,formatShortMonthYear:()=>d,formatToMillions:()=>S,formatToTons:()=>v,formatTooltip:()=>$,formatTooltipPie:()=>N,formatTrimestre:()=>m,formatWithPrefix:()=>M,getEnvironment:()=>Ct,getMaxFieldNumberFromData:()=>W,getMonth:()=>o,getMonthList:()=>p,getSelectCommonOptions:()=>ot,getSelectTwoColumnsOptions:()=>rt,initBarChart:()=>Pt,initBarChartComparationMonth:()=>qt,initChart:()=>E,initContractAllGroups:()=>Mt,initElement:()=>D,initExpandAllGroups:()=>At,initStackedBarChart:()=>Ot,initStackedBarChartMonthSeries:()=>It,initTable:()=>ft,initValueDefaultDate:()=>lt,initialCalls:()=>$t,loadIframeOnClickEvent:()=>Jt,printDataChart:()=>w,printDataInHTMLElements:()=>j,printEchart:()=>I,printNoDataChart:()=>C,resetFilter:()=>nt,resetFilterDate:()=>it,resetFilterDates:()=>at,resetFilterToDefault:()=>ut,resultsetWithFields:()=>q,selectConfigDatasource:()=>tt,selectConfigDatasourceAllValue:()=>et,selectFilterAll:()=>K,selectFilterNumItemsDefault:()=>dt,selectValueDefaultInFilter:()=>st,separateDayMonthYearToSlash:()=>l,splitDataset:()=>V,subtractOneDay:()=>h,subtractOneMonth:()=>y,traverseRows:()=>yt,updateDomElement:()=>G,updateObject:()=>J,updateStackedBarOptions:()=>Tt});const n={"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)]}const r={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"]])},a={es_ES:new Map([["1","Ene"],["2","Feb"],["3","Mar"],["4","Abr"],["5","May"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Sep"],["10","Oct"],["11","Nov"],["12","Dic"]]),ca_ES:new Map([["1","Gen"],["2","Feb"],["3","Mar"],["4","Abr"],["5","Mai"],["6","Jun"],["7","Jul"],["8","Ago"],["9","Set"],["10","Oct"],["11","Nov"],["12","Des"]])},i={es_ES:new Map([["last_update","Última actualización"]]),ca_ES:new Map([["last_update","Última actualització"]])};function l(t){return`${t.substring(6,8)}/${t.substring(4,6)}/${t.substring(0,4)}`}function s(t){return[t.substring(0,4),n[t.substring(4,6)]]}function c(t){const[e,n]=s(t);return`${n} ${e}`}function u(t){const[e,o,r]=function(t){return[t.substring(0,4),n[t.substring(4,6)],t.substring(6,8)]}(t);return`${r} ${o} ${e}`}function d(t){const[e,n]=s(t);return`${n.substring(0,3)} ${e}`}function f(t){const[e,n]=s(t);return`${n.substring(0,3)} '${e.substring(2,4)}`}function m(t){const[e,n]=t.split("-");return`${parseFloat(n)/3}T ${e}`}function p(t,e){const n=t[e];return Array.from(n.values()).map(t=>t.slice(0,3))}function h(t){const e=Math.floor(t/1e4),n=new Date(e,t%1e4/100-1,t%100);return n.setDate(n.getDate()-1),`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}${n.getDate().toString().padStart(2,"0")}`}function y(t){let e;const n=new Date(Math.floor(t/100),t%100-1,0);return e=`${n.getFullYear()}${(n.getMonth()+1).toString().padStart(2,"0")}`,e}function g(t){return"string"==typeof t?parseInt(t.replace("-",""),10):t}function b(t,e=2){let n=navigator.language||navigator.userLanguage;n=n.length<=2?`${n}-${n.toUpperCase()}`:n;const o={minimumFractionDigits:0,maximumFractionDigits:e};return"es-ES"===n?t.toLocaleString("de-DE",o):t.toLocaleString(n,o)}function S(t){const e=1e6;return t>=e?t/e+"M":t.toString()}function v(t){return t>=1e3?t/1e3+" Tn":t.toString()}function M(t){let e,n;return t>=1e6?(e=t/1e6,n="G"):t>=1e3?(e=t/1e3,n="M"):(e=t,n="k"),{value:Math.round(100*e)/100,prefix:n}}function A(t,e=29){if(t.length>=e){const n=t.split(" ");let o="",r="";return n.forEach(t=>{`${o} ${t}`.length<=e?o+=(o?" ":"")+t:(r+=`${o}\n`,o=t)}),r+=o,r}return t}function x(t){return t.includes("N/D")?t:t.toLowerCase().replace(/(^|\s|[.,;:!?¡¿(){}[\]])([^\s])/gu,(t,e,n)=>e+n[0].toUpperCase())}function D(t,e,n="MainContentLoadedCustom"){let o=document.getElementById(t);return o?Promise.resolve(e(o)):new Promise(r=>{document.body.addEventListener(n,()=>{o=document.getElementById(t),o?r(e(o)):(console.error(`El elemento con ID ${t} aún no está disponible después del evento.`),r(null))})})}function E(t,e){return D(t,t=>{const n=echarts.init(t);n.setOption(e,!0),window.addEventListener("resize",()=>{null!=n&&void 0!==n&&n.resize()});const o=document.getElementById("main-content");return o&&(o.addEventListener("shown.bs.collapse",()=>{n.resize()}),o.addEventListener("hidden.bs.collapse",()=>{n.resize()})),n})}function C(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="url('./build/images/nodata1.png') no-repeat top center",o.hidden=!1)}function w(t,e){const n=t?document.querySelector(t):null,o=e?document.querySelector(e):null;n&&(n.hidden=!0),o&&(o.style.background="#ffffff",o.hidden=!1)}function $(t,e=!1,n=!0,o=""){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=n?`<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?`${b(a)} ${o}`:"-"}\n </span>\n </div>`:`<div>\n <span style="font-weight: 600;color: #565656;">${t.data?`${b(a)} ${o}`:"-"}\n </span>\n </div>`;var l;r+=i}),r}function F(t){return 100*(t-120)/t}function L(t,e){const n=Math.max(...t);return n+(e-n%e)}function N(t,e=!1){const n=`<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:${t.color}"></span>`,o=e?`${t.percent}%`:b(t.value);return`<div> ${n} ${t.name} <span style="float: right; margin-left:20px;font-weight: 600;color: #333;"> ${o} </span></div>`}function O(t,e){let n=`${t.name} : `;return n+=`<span style="font-weight:500">${b(Math.round(t.value))}</span>`,e&&(n+=`<span> (${t.percent}%)</span>`),t.marker+n}function T(t){const e=1e6,n=Number(t);return n>=0&&n<e?`${b(n)} €`:n>=e?`${b(n/e)} M €`:"-"}function I(t,e,n){return 0===t.length?(C(`#${e}`,`#${n}`),!1):(w(`#${n}`,`#${e}`),!0)}function P(t,e,n=1){const o=Math.max(...t.map(t=>t[e]))*n;return 5e3*Math.ceil(o/5e3)}function z(t,e,n,o=30,r=15,a=30,i=-70,l=70,s=3){const c=P(t,e.data,1.1),u=l,d=n.slice(),f=[];let m=r,p=a,h=i;for(let n=0;n<t.length;n+=1)f.push({value:t[n][e.data],name:A(String(t[n][e.type]).replace(/\[.*?\]/g,"")),color:d.shift(),title:{offsetCenter:[`${String(h)}%`,`${String(m)}%`],fontFamily:"Montserrat",fontSize:o},detail:{offsetCenter:[`${String(h)}%`,`${String(p)}%`],fontFamily:"Montserrat",width:"33%",formatter:t=>b(Math.round(t))}}),h+=u,(n+1)%s===0&&(p+=a,m+=2*r,h=i);return[c,f]}function k(t,e,n,r=0){return[P(e,n.data,1),t=>function(t,e,n){const r=b(Math.round(e)),a=o(t[n][0]),i=t[n][1],l=`\n${a} ${i} : ${r}`,s=`${r}\n${a} ${i}`;return window.innerWidth<=1710?l:s}(e,t,r),[{value:e[r][n.data]}]]}function _(t,e){const{resultset:n}={resultset:t},o=new Set,r=new Set,a=n.map(([t,n,a])=>{const i=e?Math.round(a):a;return o.add(t),r.add(n),{day:n,type:t,value:i}}),i=Array.from(r.values()),l=Array.from(o.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:n})=>[e,t,n]),n=i.map(t=>{const n=e.find(([e])=>e===t);return n?n[2]:null});return{name:t,data:n}}),l,r]}function B(t,e=[],n=!1){const[o,r,a]=_(t,n);return o.forEach(t=>{t.type="line",t.symbol="circle",t.symbolSize=6,t.smooth=.1,e.length>0&&(t.color=e.shift())}),[o,a,r]}function R(t,e,n=!1){const[o,r,a]=_(t,n);return o.forEach(t=>{t.type="bar",t.color=e.shift(),t.smooth=!1}),[o,a,r]}function q(t){const{resultset:e,metadata:n}=t,o=[];return e.forEach(t=>{const e={};t.forEach((t,o)=>{e[n[o].colName]=t}),o.push(e)}),o}function J(t,e){const n={...t};return Object.keys(e).forEach(o=>{Object.prototype.hasOwnProperty.call(e,o)&&("series"===o&&Array.isArray(e[o])?n[o]=e[o].map((e,n)=>({...Array.isArray(t[o])&&t[o][n]||{},...e})):"object"!=typeof e[o]||null===e[o]||Array.isArray(e[o])?t[o]!==e[o]&&(n[o]=e[o]):n[o]=J(t[o]||{},e[o]))}),n}function j(t,e){const n=()=>{t.forEach(t=>{t.id in e&&Object.entries(e[t.id]).forEach(n=>{const o=n[0],r=n[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]})})};try{n()}catch(t){document.body.addEventListener("MainContentLoadedCustom",()=>{n()})}}function W(t,e){const n=q(t),o=[];let r=null;return n.forEach(t=>{const n=t[e];"number"!=typeof n||Number.isNaN(n)||o.push(n)}),o.length>0&&(r=Math.max(...o)),r}function G(t,e){const n=document.querySelector(t);n?n.textContent=e:console.warn(`Elemento ${t} no encontrado en el DOM`)}function V(t,e=!0){const n={Cont:[],Mob:[]};return t.forEach(t=>{"is-res-001-kgs-contenidors"===t[0]&&"total"===t[1]&&(e?n.Cont.push([t[3],t[4],t[2]]):n.Cont.push([t[3],t[2]])),"Mobles"===t[1]&&(e?n.Mob.push([t[3],t[4],t[2]]):n.Mob.push([t[3],t[2]]))}),n}const H=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],Y=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],U=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],X=["Dom","Lun","Mar","Mié","Juv","Vie","Sáb"],Z=["Do","Lu","Ma","Mi","Ju","Vi","Sá"];function K(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 tt(t,e,n,o){return Q(e)?(t.queryDefinition.dataAccessId=n,t.dashboard.setParameter(t.parameter,["All"])):t.queryDefinition.dataAccessId=o,!0}function et(t){return t.dashboard.setParameter(t.parameter,["All"]),!0}function nt(t){t.forEach(t=>{Dashboards.fireChange(t,["All"])})}function ot(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 rt(t="Todos"){const e=ot(t);return e.input.indexes.id=1,e.input.indexes.label=0,e}function at(t,e,n,o){const r=Dashboards.getParameterValue(n),a=Dashboards.getParameterValue(o);return Dashboards.fireChange(t,[r]),Dashboards.fireChange(e,[a]),!0}function it(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,[n]),!0}function lt(t,e){Dashboards.fireChange(e,t.resultset[0][0])}function st(t,e){const n=Dashboards.getParameterValue(e),o=t.parameter;""!==n&&t.dashboard.setParameter(o,[n])}function ct(t){t.regional.es={monthNames:H,abbreviatedMonthNames:Y,dayNames:U,abbreviatedDayNames:X,dayNamesMin:Z,weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},t.setDefaults(t.regional.es)}function ut(t,e){const n=Dashboards.getParameterValue(e);return Dashboards.fireChange(t,Array.isArray(n)?n:[n]),!0}function dt(t,e,n,o=0){const r=t.resultset.slice(0,n).map(t=>t[o]);return Dashboards.setParameter(e,r),t}function ft(t,e){return D(t,t=>new Tabulator(t,e))}function mt(t,e){let n=t.getValue();return n.length>e&&(n=`${n.substr(0,e)}<br>${n.substr(e)}`),n}function pt(t,e){const n=t.getValue().split(" ");let o="",r="";return n.forEach(t=>{(r+t).length<=e?r+=`${t} `:(o+=`${r}<br>`,r=`${t} `)}),o+=`${r}<br>`,o}function ht(t,e){"expand"===e?t.treeExpand():t.treeCollapse();const n=t.getTreeChildren();n.length>0&&n.forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function yt(t,e){t.getRows().forEach(t=>{t.getTreeChildren().length>0&&ht(t,e)})}function gt(t,e,n,o){const r=[];return Object.keys(t).forEach(a=>{if(Object.prototype.hasOwnProperty.call(t,a)){const i=t[a],l={[e]:i[0],_children:[]};i.shift(),i.forEach((t,r)=>{const a={[e]:n[r],[o]:t};l._children.push(a)}),r.push(l)}}),r}function bt(t){let e=!0;return t.getGroups().forEach(t=>{t._group.visible&&(e=!1)}),e}function St(t,e,n){const o=document.getElementById(n),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",()=>{t.download("csv",`${e}.csv`,{delimiter:";",bom:!0})})}function vt(t,e,n){const o=document.getElementById(n),r=o.cloneNode(!0);o.parentNode.replaceChild(r,o),r.addEventListener("click",()=>{const n=t.getRows().map(t=>t.getData()),o=t.getColumns(),r={};o.forEach((t,e)=>{const o=t.getField();o&&n.every(t=>{const e=t[o];return null==e||/^-?\d+([.,]\d+)?$/.test(e.toString().trim())})&&(r[e]={halign:"right"})}),t.download("pdf",`${e}.pdf`,{title:e,rowCalcStyles:{fontSize:8,fontStyle:"bold"},autoTable:{styles:{fontSize:8,lineWidth:.1,lineColor:[200,200,200]},headStyles:{halign:"center"},columnStyles:r}})})}function Mt(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!1),t.setData(e)})}function At(t,e,n){const o=document.getElementById(n);o&&o.addEventListener("click",()=>{t.setGroupStartOpen(!0),t.setData(e)})}const xt={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 Dt(t){const e=[],n={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,n)=>{e<=t&&5===o&&(o=n)})),n[o]}(o,e);r.classList.add(t)}return r}return t.forEach(t=>{const n=t;"noData"===n.operationalstatus&&(n.so2value="ND",n.no2value="ND",n.o3value="ND",n.pm10value="ND",n.pm25value="ND");const r=document.createElement("tr"),a=document.createElement("td");a.innerHTML=n.address,r.appendChild(a),r.appendChild(o(`${n.entityid}_so2`,n.so2value,xt.SO2)),r.appendChild(o(`${n.entityid}_no2`,n.no2value,xt.NO2)),r.appendChild(o(`${n.entityid}_o3`,n.o3value,xt.O3)),r.appendChild(o(`${n.entityid}_pm10`,n.pm10value,xt.PM10)),r.appendChild(o(`${n.entityid}_pm25`,n.pm25value,xt.PM25)),e.push(r)}),e}function Et(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 wt(t,e){document.querySelectorAll(`[${t}]`).forEach(n=>{!function(t,e,n){const o=e;if(t){const e=new XMLHttpRequest;e.onreadystatechange=function(){4===this.readyState&&(200===this.status&&(o.innerHTML=this.responseText,n&&n()),404===this.status&&(o.innerHTML="No se ha podido cargar correctamente."))},e.open("GET",t,!0),e.send()}}(n.getAttribute(t),n,e)})}function $t(t){window.realDashboardsInit=Dashboards.init,Dashboards.init=function(){console.warn("Dashboards.init bloqueado temporalmente")},wt("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})`)}()}),wt("include-html-menu"),wt("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()}),wt("include-html-copyright"),function(t="MainContentLoadedCustom"){document.body.addEventListener(t,()=>{try{Dashboards.init=window.realDashboardsInit,Dashboards.init()}catch(t){console.warn("No se pudo restaurar Dashboards.init; la función original no está disponible.")}},{once:!0})}()}function Ft(t,e,n,o,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(n);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(o)[0].style.display="none"}const Lt={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=>`${S(t)}€`}}]},Nt=(t,e)=>{e.sort((t,e)=>parseInt(t.anyo)-parseInt(e.anyo));const n={};e.forEach(e=>{const o=e[1],r=e[0];r!==t.seriesName||n[o]||(n[o]=0),r===t.seriesName&&(n[o]+=e[2])});let o=`<p>${t.seriesName}</p>`;for(const[e,r]of Object.entries(n))o+=`<div>${t.marker} ${e}: <span style="float: right; margin-left:20px;font-weight: 600;">${b(r)}</span></div>`;return o};function Ot(t,e,n=void 0,o=void 0){const r=null===o?void 0:o,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=>Nt(t,e),textStyle:{fontFamily:"Montserrat"},position(t,e,n,o,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=>b(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=>b(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 n=function(t){return t.reduce((t,e)=>{const n=e[0];return t[n]||(t[n]=[]),t[n].push(e),t},{})}(e),o=Object.keys(n);a.forEach(t=>{o.forEach(e=>{void 0===n[e].find(e=>e[1]===t)&&(n[e].push([n[e][0][0],t,void 0]),n[e].sort())})});const l=[];return Object.keys(n).forEach(e=>{i&&(t.itemStyle={borderColor:i.shift()}),t.name=e,t.data=n[e].map(t=>t[2]);let o={};o=void 0!==r?J(t,r):t,l.push({...o})}),l})(),toolbox:{show:!0,feature:{restore:{title:"Restablir"},saveAsImage:{title:"Desar"}},right:50}};let s={};s=void 0!==n?J(l,n):l,E(t,s)}function Tt(t){let e={};return e=J(Lt,t),e}function It(t,e,n={},r={}){let a={};a=J(n,{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:J(r,i),s=e;s.forEach((t,e)=>{s[e][0]=o(t[0])}),Ot(t,s,a,l)}function Pt(t,e=void 0){const n={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=>O(t,!1)},series:[{type:"bar",showBackground:!0}]};let o={};o=void 0!==e?J(n,e):n,E(t,o)}const zt="es_ES",kt={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 _t(t){return Math.max(...t.map(t=>Number(t[0])))}function Bt(t){const e=t.filter(e=>Number(e[0])===_t(t)),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const r=parseInt(e,10)-1;n[r]=o}),n}function Rt(t){const e=t.filter(e=>Number(e[0])===_t(t)-1),n=Array.from({length:12},()=>0);return e.forEach(([t,e,o])=>{const r=parseInt(e,10)-1;n[r]=o}),n}function qt(t,e,n=void 0){const o=_t(e).toString(),r=(_t(e)-1).toString();Pt(t,J({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:p(kt,zt),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:Rt(e)},{name:o,type:"bar",barGap:0,data:Bt(e)}]},n))}function Jt(t,e,n){const o=document.querySelector(e),r=document.querySelector(t);let a=!1;r.addEventListener("click",()=>{!1===a&&(a=!0,o.setAttribute("src","about:blank"),o.setAttribute("src",n),o.onload=()=>{a=!1})}),r.disabled=!1}const jt="id",Wt="fecha",Gt="value";function Vt(t,e,n,o,r="es_ES"){const[a,i]=function(t,e,n){const o=[],r=[];return t.forEach(t=>{e.includes(`${t[jt]}`)?o.push(`${t[Wt]}`):n.includes(`${t[jt]}`)&&r.push(`${t[Wt]}`)}),[o.map(t=>[t,0]),r.map(t=>[t,0])]}(t,n,o);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[Gt]).map(t=>parseInt(`${t[Gt]}`,10)))}]]}}]}function Ht(t,e,n=void 0){E(t,J({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=>$(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},n))}return e})(),t.exports=e()}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.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";n.r(o),n.d(o,{calculatePentahoPath:()=>t.calculatePentahoPath,initialCalls:()=>t.initialCalls});var t=n(2725)})(),o})());