@aquera/data-visualizer-sdk 0.0.1

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.
Files changed (46) hide show
  1. package/ask-aquera/src/ask-aquera-config.d.ts +182 -0
  2. package/chunk-4PS3OAOS.js +1 -0
  3. package/chunk-5CTM6JVQ.js +1 -0
  4. package/chunk-6B33KNVC.js +13 -0
  5. package/chunk-6JUHOJCQ.js +5 -0
  6. package/chunk-6Q3P5YXE.js +2 -0
  7. package/chunk-7ROJSOMZ.js +1 -0
  8. package/chunk-ATIVRRY6.js +2 -0
  9. package/chunk-AYEY6YSX.js +1 -0
  10. package/chunk-BTDKTIE6.js +2 -0
  11. package/chunk-CFURBIBO.js +1 -0
  12. package/chunk-DPG6F2YZ.js +1 -0
  13. package/chunk-ECNT4X4C.js +8 -0
  14. package/chunk-F6ZDDRJ7.js +21 -0
  15. package/chunk-FK6H3RFT.js +1 -0
  16. package/chunk-FZDVALWH.js +1 -0
  17. package/chunk-GE5TYRBE.js +18 -0
  18. package/chunk-GHVB7A27.js +2 -0
  19. package/chunk-H2YEWK77.js +1 -0
  20. package/chunk-HIPUXYQH.js +18 -0
  21. package/chunk-IWMWQ3LG.js +12 -0
  22. package/chunk-JP5QY5S6.js +2 -0
  23. package/chunk-JXQ2DURN.js +40813 -0
  24. package/chunk-LSC4KQ4U.js +1 -0
  25. package/chunk-MMU63XDX.js +1 -0
  26. package/chunk-ORMWZQE4.js +1 -0
  27. package/chunk-P6Z3OD2O.js +26 -0
  28. package/chunk-QAUTHFGS.js +1 -0
  29. package/chunk-QDERNBJG.js +12 -0
  30. package/chunk-RB5CGMJ7.js +1 -0
  31. package/chunk-REQTBAAZ.js +1 -0
  32. package/chunk-RLJG3U7S.js +23 -0
  33. package/chunk-THFIOYOT.js +1 -0
  34. package/chunk-W25JWAKD.js +1 -0
  35. package/chunk-W7JUPIHD.js +1 -0
  36. package/chunk-XEG2ZCTG.js +1 -0
  37. package/chunk-XRJ2TFI3.js +1 -0
  38. package/chunk-Y42W4DYB.js +4 -0
  39. package/chunk-YOMAZ3ZR.js +1 -0
  40. package/chunk-ZAZ2JO4L.js +1 -0
  41. package/chunk-ZW5NV4UO.js +1 -0
  42. package/dashboards/src/dashboards-config.d.ts +138 -0
  43. package/index.d.ts +49 -0
  44. package/main.js +1 -0
  45. package/package.json +27 -0
  46. package/styles.css +1 -0
@@ -0,0 +1 @@
1
+ import{a as Q,b as Z,e as Ut}from"./chunk-ZW5NV4UO.js";var Rt=Ut((B,$)=>{(function(O,w){typeof B=="object"&&typeof $=="object"?$.exports=w(O._Highcharts,O._Highcharts.Color,O._Highcharts.SeriesRegistry):typeof define=="function"&&define.amd?define("highcharts/modules/venn",["highcharts/highcharts"],function(E){return w(E,E.Color,E.SeriesRegistry)}):typeof B=="object"?B["highcharts/modules/venn"]=w(O._Highcharts,O._Highcharts.Color,O._Highcharts.SeriesRegistry):O.Highcharts=w(O.Highcharts,O.Highcharts.Color,O.Highcharts.SeriesRegistry)})("u"<typeof window?B:window,(O,w,E)=>(()=>{"use strict";var V,F,U,dt={512:r=>{r.exports=E},620:r=>{r.exports=w},944:r=>{r.exports=O}},tt={};function v(r){var t=tt[r];if(t!==void 0)return t.exports;var n=tt[r]={exports:{}};return dt[r](n,n.exports,v),n.exports}v.n=r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return v.d(t,{a:t}),t},v.d=(r,t)=>{for(var n in t)v.o(t,n)&&!v.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},v.o=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);var et={};v.d(et,{default:()=>Ft});var gt=v(944),I=v.n(gt),yt=v(620),xt=v.n(yt);(V=F||(F={})).getCenterOfPoints=function(r){let t=r.reduce((n,a)=>(n.x+=a.x,n.y+=a.y,n),{x:0,y:0});return{x:t.x/r.length,y:t.y/r.length}},V.getDistanceBetweenPoints=function(r,t){return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))},V.getAngleBetweenPoints=function(r,t){return Math.atan2(t.x-r.x,t.y-r.y)},V.pointInPolygon=function({x:r,y:t},n){let a=n.length,c,o,e=!1;for(c=0,o=a-1;c<a;o=c++){let[l,u]=n[c],[i,s]=n[o];u>t!=s>t&&r<(i-l)*(t-u)/(s-u)+l&&(e=!e)}return e};let N=F,{getAngleBetweenPoints:R,getCenterOfPoints:rt,getDistanceBetweenPoints:H}=N,{correctFloat:mt}=I();(function(r){function t(i,s){let f=Math.pow(10,s);return Math.round(i*f)/f}function n(i){if(i<=0)throw Error("radius of circle must be a positive number.");return mt(Math.PI*i*i)}function a(i,s){return i*i*Math.acos(1-s/i)-(i-s)*Math.sqrt(s*(2*i-s))}function c(i,s){let f=H(i,s),h=i.r,p=s.r,C=[];if(f<h+p&&f>Math.abs(h-p)){let x=h*h,g=(x-p*p+f*f)/(2*f),m=Math.sqrt(x-g*g),y=i.x,b=s.x,d=i.y,X=s.y,M=y+g*(b-y)/f,L=d+g*(X-d)/f,T=-(m/f*(X-d)),_=-(m/f*(b-y));C=[{x:t(M+T,14),y:t(L-_,14)},{x:t(M-T,14),y:t(L+_,14)}]}return C}function o(i){return i.reduce((s,f,h,p)=>{let C=p.slice(h+1).reduce((x,g,m)=>{let y=[h,m+h+1];return x.concat(c(f,g).map(b=>(b.indexes=y,b)))},[]);return s.concat(C)},[])}function e(i,s){return H(i,s)<=s.r+1e-10}function l(i,s){return!s.some(function(f){return!e(i,f)})}function u(i){return o(i).filter(function(s){return l(s,i)})}r.round=t,r.getAreaOfCircle=n,r.getCircularSegmentArea=a,r.getOverlapBetweenCircles=function(i,s,f){let h=0;if(f<i+s){if(f<=Math.abs(s-i))h=n(i<s?i:s);else{let p=(i*i-s*s+f*f)/(2*f);h=a(i,i-p)+a(s,s-(f-p))}h=t(h,14)}return h},r.getCircleCircleIntersection=c,r.getCirclesIntersectionPoints=o,r.isCircle1CompletelyOverlappingCircle2=function(i,s){return H(i,s)+s.r<i.r+1e-10},r.isPointInsideCircle=e,r.isPointInsideAllCircles=l,r.isPointOutsideAllCircles=function(i,s){return!s.some(function(f){return e(i,f)})},r.getCirclesIntersectionPolygon=u,r.getAreaOfIntersectionBetweenCircles=function(i){let s=u(i),f;if(s.length>1){let h=rt(s),p=(s=s.map(function(x){return x.angle=R(h,x),x}).sort(function(x,g){return g.angle-x.angle}))[s.length-1],C=s.reduce(function(x,g){let{startPoint:m}=x,y=rt([m,g]),b=g.indexes.filter(function(d){return m.indexes.indexOf(d)>-1}).reduce(function(d,X){let M=i[X],L=R(M,g),T=R(M,m),_=T-L+(T<L?2*Math.PI:0),pt=T-_/2,j=H(y,{x:M.x+M.r*Math.sin(pt),y:M.y+M.r*Math.cos(pt)}),{r:k}=M;return j>2*k&&(j=2*k),(!d||d.width>j)&&(d={r:k,largeArc:+(j>k),width:j,x:g.x,y:g.y}),d},null);if(b){let{r:d}=b;x.arcs.push(["A",d,d,0,b.largeArc,1,b.x,b.y]),x.startPoint=g}return x},{startPoint:p,arcs:[]}).arcs;C.length===0||C.length===1||(C.unshift(["M",p.x,p.y]),f={center:h,d:C})}return f}})(U||(U={}));let W=U,bt=function(r,t){let{animatableAttribs:n,onComplete:a,css:c,renderer:o}=t,e=r.series&&r.series.chart.hasRendered?void 0:r.series&&r.series.options.animation,l=r.graphic;if(t.attribs=Z(Q({},t.attribs),{class:r.getClassName()}),r.shouldDraw())l||(r.graphic=l=t.shapeType==="text"?o.text():t.shapeType==="image"?o.image(t.imageUrl||"").attr(t.shapeArgs||{}):o[t.shapeType](t.shapeArgs||{}),l.add(t.group)),c&&l.css(c),l.attr(t.attribs).animate(n,!t.isNew&&e,a);else if(l){let u=()=>{r.graphic=l=l&&l.destroy(),typeof a=="function"&&a()};Object.keys(n).length?l.animate(n,void 0,()=>u()):u()}};var vt=v(512),q=v.n(vt);let{scatter:{prototype:{pointClass:Ct}}}=q().seriesTypes,{isNumber:Ot}=I(),{getAreaOfCircle:At,getCircleCircleIntersection:Mt,getOverlapBetweenCircles:nt,isPointInsideAllCircles:Pt,isPointInsideCircle:wt,isPointOutsideAllCircles:It}=W,{getDistanceBetweenPoints:Y}=N,{extend:St,isArray:z,isNumber:Tt,isObject:it,isString:Et}=I();function st(r){let t={};return r.filter(n=>n.sets.length===2).forEach(n=>{n.sets.forEach((a,c,o)=>{it(t[a])||(t[a]={totalOverlap:0,overlapping:{}}),t[a]={totalOverlap:(t[a].totalOverlap||0)+n.value,overlapping:Z(Q({},t[a].overlapping||{}),{[o[1-c]]:n.value})}})}),r.filter(D).forEach(n=>{let a=t[n.sets[0]];St(n,a)}),r}function ot(r,t,n,a,c){let o=r(t),e=r(n),l=c||100,u=a||1e-10,i=n-t,s,f,h=1;if(t>=n)throw Error("a must be smaller than b.");if(o*e>0)throw Error("f(a) and f(b) must have opposite signs.");if(o===0)s=t;else if(e===0)s=n;else for(;h++<=l&&f!==0&&i>u;)i=(n-t)/2,o*(f=r(s=t+i))>0?t=s:n=s;return s}function lt(r){let t=r.slice(0,-1),n=t.length,a=[],c=(o,e)=>(o.sum+=e[o.i],o);for(let o=0;o<n;o++)a[o]=t.reduce(c,{sum:0,i:o}).sum/n;return a}function G(r,t,n){let a=r+t;return n<=0?a:At(r<t?r:t)<=n?0:ot(c=>n-nt(r,t,c),0,a)}function D(r){return z(r.sets)&&r.sets.length===1}function at(r){let t={};return it(r)&&Tt(r.value)&&r.value>-1&&z(r.sets)&&r.sets.length>0&&!r.sets.some(function(n){let a=!1;return!t[n]&&Et(n)?t[n]=!0:a=!0,a})}function ct(r,t){return t.reduce(function(n,a){let c=0;if(a.sets.length>1){let o=a.value-(function(e){let l=0;if(e.length===2){let u=e[0],i=e[1];l=nt(u.r,i.r,Y(u,i))}return l})(a.sets.map(function(e){return r[e]}));c=Math.round(o*o*1e11)/1e11}return n+c},0)}function ut(r,t){return t.totalOverlap!==void 0&&r.totalOverlap!==void 0?t.totalOverlap-r.totalOverlap:NaN}let P={geometry:N,geometryCircles:W,addOverlapToSets:st,getCentroid:lt,getDistanceBetweenCirclesByOverlap:G,getLabelWidth:function(r,t,n){let a=t.reduce((e,l)=>Math.min(l.r,e),1/0),c=n.filter(e=>!wt(r,e)),o=function(e,l){return ot(u=>{let i={x:r.x+l*u,y:r.y};return-(e-u)+(Pt(i,t)&&It(i,c)?0:Number.MAX_VALUE)},0,e)};return 2*Math.min(o(a,-1),o(a,1))},getMarginFromCircles:function(r,t,n){let a=t.reduce((c,o)=>{let e=o.r-Y(r,o);return e<=c?e:c},Number.MAX_VALUE);return n.reduce((c,o)=>{let e=Y(r,o)-o.r;return e<=c?e:c},a)},isSet:D,layoutGreedyVenn:function(r){let t=[],n={};r.filter(e=>e.sets.length===1).forEach(e=>{n[e.sets[0]]=e.circle={x:Number.MAX_VALUE,y:Number.MAX_VALUE,r:Math.sqrt(e.value/Math.PI)}});let a=(e,l)=>{let u=e.circle;u&&(u.x=l.x,u.y=l.y),t.push(e)};st(r);let c=r.filter(D).sort(ut);a(c.shift(),{x:0,y:0});let o=r.filter(e=>e.sets.length===2);for(let e of c){let l=e.circle;if(!l)continue;let u=l.r,i=e.overlapping;a(e,t.reduce((s,f,h)=>{let p=f.circle;if(!p||!i)return s;let C=i[f.sets[0]],x=G(u,p.r,C),g=[{x:p.x+x,y:p.y},{x:p.x-x,y:p.y},{x:p.x,y:p.y+x},{x:p.x,y:p.y-x}];for(let m of t.slice(h+1)){let y=m.circle,b=i[m.sets[0]];if(!y)continue;let d=G(u,y.r,b);g=g.concat(Mt({x:p.x,y:p.y,r:x},{x:y.x,y:y.y,r:d}))}for(let m of g){l.x=m.x,l.y=m.y;let y=ct(n,o);y<s.loss&&(s.loss=y,s.coordinates=m)}return s},{loss:Number.MAX_VALUE,coordinates:void 0}).coordinates)}return n},loss:ct,nelderMead:function(r,t){let n=function(u,i){return u.fx-i.fx},a=(u,i,s,f)=>i.map((h,p)=>u*h+s*f[p]),c=(u,i)=>(i.fx=r(i),u[u.length-1]=i,u),o=u=>{let i=u[0];return u.map(s=>{let f=a(.5,i,.5,s);return f.fx=r(f),f})},e=(u,i,s,f)=>{let h=a(s,u,f,i);return h.fx=r(h),h},l=(u=>{let i=u.length,s=Array(i+1);s[0]=u,s[0].fx=r(u);for(let f=0;f<i;++f){let h=u.slice();h[f]=h[f]?1.05*h[f]:.001,h.fx=r(h),s[f+1]=h}return s})(t);for(let u=0;u<100;u++){l.sort(n);let i=l[l.length-1],s=lt(l),f=e(s,i,2,-1);if(f.fx<l[0].fx){let h=e(s,i,3,-2);l=c(l,h.fx<f.fx?h:f)}else if(f.fx>=l[l.length-2].fx){let h;l=f.fx>i.fx?(h=e(s,i,.5,.5)).fx<i.fx?c(l,h):o(l):(h=e(s,i,1.5,-.5)).fx<f.fx?c(l,h):o(l)}else l=c(l,f)}return l[0]},processVennData:function(r,t){let n=z(r)?r:[],a=n.reduce(function(o,e){var l;return e.sets&&at(l=e)&&D(l)&&l.value>0&&o.indexOf(e.sets[0])===-1&&o.push(e.sets[0]),o},[]).sort(),c=n.reduce(function(o,e){return e.sets&&at(e)&&!e.sets.some(function(l){return a.indexOf(l)===-1})&&(o[e.sets.sort().join(t)]={sets:e.sets,value:e.value||0}),o},{});return a.reduce(function(o,e,l,u){return u.slice(l+1).forEach(function(i){o.push(e+t+i)}),o},[]).forEach(function(o){if(!c[o]){let e={sets:o.split(t),value:0};c[o]=e}}),Object.keys(c).map(function(o){return c[o]})},sortByTotalOverlap:ut},{animObject:Lt}=I(),{parse:jt}=xt(),{getAreaOfIntersectionBetweenCircles:Bt,getCirclesIntersectionPolygon:Vt,isCircle1CompletelyOverlappingCircle2:Nt,isPointInsideAllCircles:Ht,isPointOutsideAllCircles:Dt}=W,{getCenterOfPoints:Xt}=N,{scatter:J}=q().seriesTypes,{addEvent:_t,extend:ft,isArray:ht,isNumber:S,isObject:kt,merge:K}=I();class A extends J{static getLabelPosition(t,n){let a=t.reduce((o,e)=>{let l=e.r/2;return[{x:e.x,y:e.y},{x:e.x+l,y:e.y},{x:e.x-l,y:e.y},{x:e.x,y:e.y+l},{x:e.x,y:e.y-l}].reduce((u,i)=>{let s=P.getMarginFromCircles(i,t,n);return u.margin<s&&(u.point=i,u.margin=s),u},o)},{point:void 0,margin:-Number.MAX_VALUE}).point,c=P.nelderMead(o=>-P.getMarginFromCircles({x:o[0],y:o[1]},t,n),[a.x,a.y]);return Ht(a={x:c[0],y:c[1]},t)&&Dt(a,n)||(a=t.length>1?Xt(Vt(t)):{x:t[0].x,y:t[0].y}),a}static getLabelValues(t,n){let a=t.sets,c=n.reduce((l,u)=>{let i=a.indexOf(u.sets[0])>-1;return u.circle&&l[i?"internal":"external"].push(u.circle),l},{internal:[],external:[]});c.external=c.external.filter(l=>c.internal.some(u=>!Nt(l,u)));let o=A.getLabelPosition(c.internal,c.external),e=P.getLabelWidth(o,c.internal,c.external);return{position:o,width:e}}static layout(t){let n={},a={};if(t.length>0){let c=P.layoutGreedyVenn(t),o=t.filter(P.isSet);for(let e of t){let l=e.sets,u=l.join(),i=P.isSet(e)?c[u]:Bt(l.map(s=>c[s]));i&&(n[u]=i,a[u]=A.getLabelValues(e,o))}}return{mapOfIdToShape:n,mapOfIdToLabelValues:a}}static getScale(t,n,a){let c=a.bottom-a.top,o=a.right-a.left,e=(a.right+a.left)/2,l=(a.top+a.bottom)/2,u=Math.min(o>0?1/o*t:1,c>0?1/c*n:1);return{scale:u,centerX:t/2-e*u,centerY:n/2-l*u}}static updateFieldBoundaries(t,n){let a=n.x-n.r,c=n.x+n.r,o=n.y+n.r,e=n.y-n.r;return(!S(t.left)||t.left>a)&&(t.left=a),(!S(t.right)||t.right<c)&&(t.right=c),(!S(t.top)||t.top>e)&&(t.top=e),(!S(t.bottom)||t.bottom<o)&&(t.bottom=o),t}animate(t){if(!t){let n=Lt(this.options.animation);for(let a of this.points){let c=a.shapeArgs;if(a.graphic&&c){let o={},e={};c.d?o.opacity=.001:(o.r=0,e.r=c.r),a.graphic.attr(o).animate(e,n),c.d&&setTimeout(()=>{a?.graphic?.animate({opacity:1})},n.duration)}}}}drawPoints(){let t=this.chart,n=this.group,a=this.points||[],c=t.renderer;for(let o of a){let e={zIndex:ht(o.sets)?o.sets.length:0},l=o.shapeArgs;t.styledMode||ft(e,this.pointAttribs(o,o.state)),bt(o,{isNew:!o.graphic,animatableAttribs:l,attribs:e,group:n,renderer:c,shapeType:l?.d?"path":"circle"})}}init(){J.prototype.init.apply(this,arguments),delete this.opacity}pointAttribs(t,n){let a=this.options||{},c=t?.options||{},o=n&&a.states[n]||{},e=K(a,{color:t?.color},c,o);return{fill:jt(e.color).brighten(e.brightness).get(),opacity:e.opacity,stroke:e.borderColor,"stroke-width":e.borderWidth,dashstyle:e.borderDashStyle}}translate(){let t=this.chart;this.dataTable.modified=this.dataTable,this.generatePoints();let n=P.processVennData(this.options.data,A.splitter),{mapOfIdToShape:a,mapOfIdToLabelValues:c}=A.layout(n),o=Object.keys(a).filter(s=>{let f=a[s];return f&&S(f.r)}).reduce((s,f)=>A.updateFieldBoundaries(s,a[f]),{top:0,bottom:0,left:0,right:0}),e=A.getScale(t.plotWidth,t.plotHeight,o),l=e.scale,u=e.centerX,i=e.centerY;for(let s of this.points){let f=ht(s.sets)?s.sets:[],h=f.join(),p=a[h],C=c[h]||{},x=s.options?.dataLabels,g,m=C.width,y=C.position;if(p){if(p.r)g={x:u+p.x*l,y:i+p.y*l,r:p.r*l};else if(p.d){let b=p.d;b.forEach(d=>{d[0]==="M"?(d[1]=u+d[1]*l,d[2]=i+d[2]*l):d[0]==="A"&&(d[1]=d[1]*l,d[2]=d[2]*l,d[6]=u+d[6]*l,d[7]=i+d[7]*l)}),g={d:b}}y?(y.x=u+y.x*l,y.y=i+y.y*l):y={},S(m)&&(m=Math.round(m*l))}s.shapeArgs=g,y&&g&&(s.plotX=y.x,s.plotY=y.y),m&&g&&(s.dlOptions=K(!0,{style:{width:m}},kt(x,!0)?x:void 0,{zIndex:void 0})),s.name=s.options.name||f.join("\u2229")}}}A.splitter="highcharts-split",A.defaultOptions=K(J.defaultOptions,{borderColor:"#cccccc",borderDashStyle:"solid",borderWidth:1,brighten:0,clip:!1,colorByPoint:!0,dataLabels:{enabled:!0,verticalAlign:"middle",formatter:function(){return this.point.name}},inactiveOtherPoints:!0,marker:!1,opacity:.75,showInLegend:!1,legendType:"point",states:{hover:{opacity:1,borderColor:"#333333"},select:{color:"#cccccc",borderColor:"#000000",animation:!1},inactive:{opacity:.075}},tooltip:{pointFormat:"{point.name}: {point.value}"},legendSymbol:"rectangle"}),ft(A.prototype,{axisTypes:[],directTouch:!0,isCartesian:!1,pointArrayMap:["value"],pointClass:class extends Ct{isValid(){return Ot(this.value)}shouldDraw(){return!!this.shapeArgs}},utils:P}),_t(A,"afterSetOptions",function(r){let t=r.options.states||{};if(this.is("venn"))for(let n of Object.keys(t))t[n].halo=!1}),q().registerSeriesType("venn",A);let Ft=I();return et.default})())});export default Rt();
@@ -0,0 +1,18 @@
1
+ import{a as ve,b as we,e as rr}from"./chunk-ZW5NV4UO.js";var ar=rr((wt,Ce)=>{(function(w,Q){typeof wt=="object"&&typeof Ce=="object"?Ce.exports=Q(w._Highcharts,w._Highcharts.Axis,w._Highcharts.Color,w._Highcharts.LegendSymbol,w._Highcharts.SeriesRegistry,w._Highcharts.SVGElement,w._Highcharts.Series,w._Highcharts.Chart,w._Highcharts.SVGRenderer,w._Highcharts.Templating,w._Highcharts.Series.types.scatter,w._Highcharts.Point):typeof define=="function"&&define.amd?define("highcharts/modules/map",["highcharts/highcharts"],function(E){return Q(E,E.Axis,E.Color,E.LegendSymbol,E.SeriesRegistry,E.SVGElement,E.Series,E.Chart,E.SVGRenderer,E.Templating,E.Series,["types"],["scatter"],E.Point)}):typeof wt=="object"?wt["highcharts/modules/map"]=Q(w._Highcharts,w._Highcharts.Axis,w._Highcharts.Color,w._Highcharts.LegendSymbol,w._Highcharts.SeriesRegistry,w._Highcharts.SVGElement,w._Highcharts.Series,w._Highcharts.Chart,w._Highcharts.SVGRenderer,w._Highcharts.Templating,w._Highcharts.Series.types.scatter,w._Highcharts.Point):w.Highcharts=Q(w.Highcharts,w.Highcharts.Axis,w.Highcharts.Color,w.Highcharts.LegendSymbol,w.Highcharts.SeriesRegistry,w.Highcharts.SVGElement,w.Highcharts.Series,w.Highcharts.Chart,w.Highcharts.SVGRenderer,w.Highcharts.Templating,w.Highcharts.Series.types.scatter,w.Highcharts.Point)})("u"<typeof window?wt:window,(w,Q,E,Ti,Li,Ai,ki,ji,Si,zi,Ii,Bi)=>(()=>{"use strict";let Ct;var Pt,Pe,Tt,Lt,Ut,Zt,_t,Kt,$t,qt,Jt,Ei={28:l=>{l.exports=Ai},260:l=>{l.exports=Bi},500:l=>{l.exports=Ti},512:l=>{l.exports=Li},532:l=>{l.exports=Q},540:l=>{l.exports=Si},620:l=>{l.exports=E},632:l=>{l.exports=Ii},820:l=>{l.exports=ki},944:l=>{l.exports=w},960:l=>{l.exports=ji},984:l=>{l.exports=zi}},Te={};function P(l){var t=Te[l];if(t!==void 0)return t.exports;var e=Te[l]={exports:{}};return Ei[l](e,e.exports,P),e.exports}P.n=l=>{var t=l&&l.__esModule?()=>l.default:()=>l;return P.d(t,{a:t}),t},P.d=(l,t)=>{for(var e in t)P.o(t,e)&&!P.o(l,e)&&Object.defineProperty(l,e,{enumerable:!0,get:t[e]})},P.o=(l,t)=>Object.prototype.hasOwnProperty.call(l,t);var Le={};P.d(Le,{default:()=>sr});var Di=P(944),v=P.n(Di),Oi=P(532),Ae=P.n(Oi),Vi=P(620),Qt=P.n(Vi);let{parse:te}=Qt(),{merge:Ni}=v();(Pt=Ut||(Ut={})).initDataClasses=function(l){let t=this.chart,e=this.legendItem=this.legendItem||{},i=this.options,o=l.dataClasses||[],r,n,s=t.options.chart.colorCount,a=0,h;this.dataClasses=n=[],e.labels=[];for(let p=0,d=o.length;p<d;++p)r=Ni(r=o[p]),n.push(r),(t.styledMode||!r.color)&&(i.dataClassColor==="category"?(t.styledMode||(s=(h=t.options.colors||[]).length,r.color=h[a]),r.colorIndex=a,++a===s&&(a=0)):r.color=te(i.minColor).tweenTo(te(i.maxColor),d<2?.5:p/(d-1)))},Pt.initStops=function(){let l=this.options,t=this.stops=l.stops||[[0,l.minColor||""],[1,l.maxColor||""]];for(let e=0,i=t.length;e<i;++e)t[e].color=te(t[e][1])},Pt.normalizedValue=function(l){let t=this.max||0,e=this.min||0;return this.logarithmic&&(l=this.logarithmic.log2lin(l)),1-(t-l)/(t-e||1)},Pt.toColor=function(l,t){let e,i,o,r,n,s,a=this.dataClasses,h=this.stops;if(a){for(s=a.length;s--;)if(i=(n=a[s]).from,o=n.to,(i===void 0||l>=i)&&(o===void 0||l<=o)){r=n.color,t&&(t.dataClass=s,t.colorIndex=n.colorIndex);break}}else{for(e=this.normalizedValue(l),s=h.length;s--&&!(e>h[s][0]););i=h[s]||h[s+1],e=1-((o=h[s+1]||i)[0]-e)/(o[0]-i[0]||1),r=i.color.tweenTo(o.color,e)}return r};let Xi=Ut,{parse:At}=Qt(),{addEvent:tt,extend:ke,merge:Gi,pick:Ri,splat:Yi}=v();(function(l){let t;function e(){let{userOptions:c}=this;this.colorAxis=[],c.colorAxis&&(c.colorAxis=Yi(c.colorAxis),c.colorAxis.map(m=>new t(this,m)))}function i(c){let m=this.chart.colorAxis||[],y=b=>{let x=c.allItems.indexOf(b);x!==-1&&(this.destroyItem(c.allItems[x]),c.allItems.splice(x,1))},u=[],f,g;for(m.forEach(function(b){f=b.options,f?.showInLegend&&(f.dataClasses&&f.visible?u=u.concat(b.getDataClassLegendSymbols()):f.visible&&u.push(b),b.series.forEach(function(x){(!x.options.showInLegend||f.dataClasses)&&(x.options.legendType==="point"?x.points.forEach(function(M){y(M)}):y(x))}))}),g=u.length;g--;)c.allItems.unshift(u[g])}function o(c){c.visible&&c.item.legendColor&&c.item.legendItem.symbol.attr({fill:c.item.legendColor})}function r(c){this.chart.colorAxis?.forEach(m=>{m.update({},c.redraw)})}function n(){(this.chart.colorAxis?.length||this.colorAttribs)&&this.translateColors()}function s(){let c=this.axisTypes;c?c.indexOf("colorAxis")===-1&&c.push("colorAxis"):this.axisTypes=["colorAxis"]}function a(c){let m=this,y=c?"show":"hide";m.visible=m.options.visible=!!c,["graphic","dataLabel"].forEach(function(u){m[u]&&m[u][y]()}),this.series.buildKDTree()}function h(){let c=this,m=this.getPointsCollection(),y=this.options.nullColor,u=this.colorAxis,f=this.colorKey;m.forEach(g=>{let b=g.getNestedProperty(f),x=g.options.color||(g.isNull||g.value===null?y:u&&b!==void 0?u.toColor(b,g):g.color||c.color);x&&g.color!==x&&(g.color=x,c.options.legendType==="point"&&g.legendItem&&g.legendItem.label&&c.chart.legend.colorizeItem(g,g.visible))})}function p(){this.elem.attr("fill",At(this.start).tweenTo(At(this.end),this.pos),void 0,!0)}function d(){this.elem.attr("stroke",At(this.start).tweenTo(At(this.end),this.pos),void 0,!0)}l.compose=function(c,m,y,u,f){var g;let b,x=m.prototype,M=y.prototype,C=f.prototype;x.collectionsWithUpdate.includes("colorAxis")||(t=c,x.collectionsWithUpdate.push("colorAxis"),x.collectionsWithInit.colorAxis=[x.addColorAxis],tt(m,"afterCreateAxes",e),b=(g=m).prototype.createAxis,g.prototype.createAxis=function(T,k){if(T!=="colorAxis")return b.apply(this,arguments);let D=new t(this,Gi(k.axis,{index:this[T].length,isX:!1}));return this.isDirtyLegend=!0,this.axes.forEach(L=>{L.series=[]}),this.series.forEach(L=>{L.bindAxes(),L.isDirtyData=!0}),Ri(k.redraw,!0)&&this.redraw(k.animation),D},M.fillSetter=p,M.strokeSetter=d,tt(u,"afterGetAllItems",i),tt(u,"afterColorizeItem",o),tt(u,"afterUpdate",r),ke(C,{optionalAxis:"colorAxis",translateColors:h}),ke(C.pointClass.prototype,{setVisible:a}),tt(f,"afterTranslate",n,{order:1}),tt(f,"bindAxes",s))},l.pointSetVisible=a})(Zt||(Zt={}));let Hi=Zt;var Fi=P(500),Wi=P.n(Fi),Ui=P(512),I=P.n(Ui);let{defaultOptions:ee}=v(),{series:je}=I(),{defined:kt,extend:Se,fireEvent:Zi,isArray:_i,isNumber:Ki,merge:ze,pick:Y,relativeLength:Ie}=v();ee.colorAxis=ze(ee.xAxis,{lineWidth:0,minPadding:0,maxPadding:0,gridLineColor:"#ffffff",gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},width:.01,color:"#999999"},labels:{distance:8,overflow:"justify",rotation:0},minColor:"#e6e9ff",maxColor:"#0022ff",tickLength:5,showInLegend:!0});class V extends Ae(){static compose(t,e,i,o){Hi.compose(V,t,e,i,o)}constructor(t,e){super(t,e),this.coll="colorAxis",this.visible=!0,this.init(t,e)}init(t,e){let i=t.options.legend||{},o=e.layout?e.layout!=="vertical":i.layout!=="vertical";this.side=e.side||o?2:1,this.reversed=e.reversed,this.opposite=!o,super.init(t,e,"colorAxis"),this.userOptions=e,_i(t.userOptions.colorAxis)&&(t.userOptions.colorAxis[this.index]=e),e.dataClasses&&this.initDataClasses(e),this.initStops(),this.horiz=o,this.zoomEnabled=!1}hasData(){return!!(this.tickPositions||[]).length}setTickPositions(){if(!this.dataClasses)return super.setTickPositions()}setOptions(t){let e=ze(ee.colorAxis,t,{showEmpty:!1,title:null,visible:this.chart.options.legend.enabled&&t.visible!==!1});super.setOptions(e),this.options.crosshair=this.options.marker}setAxisSize(){let t=this.chart,e=this.legendItem?.symbol,{width:i,height:o}=this.getSize();e&&(this.left=+e.attr("x"),this.top=+e.attr("y"),this.width=i=+e.attr("width"),this.height=o=+e.attr("height"),this.right=t.chartWidth-this.left-i,this.bottom=t.chartHeight-this.top-o,this.pos=this.horiz?this.left:this.top),this.len=(this.horiz?i:o)||V.defaultLegendLength}getOffset(){let t=this.legendItem?.group,e=this.chart.axisOffset[this.side];if(t){this.axisParent=t,super.getOffset();let i=this.chart.legend;i.allItems.forEach(function(o){o instanceof V&&o.drawLegendSymbol(i,o)}),i.render(),this.chart.getMargins(!0),this.chart.series.some(o=>o.isDrilling)||(this.isDirty=!0),this.added||(this.added=!0),this.labelLeft=0,this.labelRight=this.width,this.chart.axisOffset[this.side]=e}}setLegendColor(){let t=this.horiz,e=this.reversed,i=+!!e,o=+!e,r=t?[i,0,o,0]:[0,o,0,i];this.legendColor={linearGradient:{x1:r[0],y1:r[1],x2:r[2],y2:r[3]},stops:this.stops}}drawLegendSymbol(t,e){let i=e.legendItem||{},o=t.padding,r=t.options,n=this.options.labels,s=Y(r.itemDistance,10),a=this.horiz,{width:h,height:p}=this.getSize(),d=Y(r.labelPadding,a?16:30);this.setLegendColor(),i.symbol||(i.symbol=this.chart.renderer.symbol("roundedRect").attr({r:r.symbolRadius??3,zIndex:1}).add(i.group)),i.symbol.attr({x:0,y:(t.baseline||0)-11,width:h,height:p}),i.labelWidth=h+o+(a?s:Y(n.x,n.distance)+(this.maxLabelLength||0)),i.labelHeight=p+o+(a?d:0)}setState(t){this.series.forEach(function(e){e.setState(t)})}setVisible(){}getSeriesExtremes(){let t=this.series,e,i,o,r,n=t.length;for(this.dataMin=1/0,this.dataMax=-1/0;n--;){for(let s of(i=(r=t[n]).colorKey=Y(r.options.colorKey,r.colorKey,r.pointValKey,r.zoneAxis,"y"),o=r[i+"Min"]&&r[i+"Max"],[i,"value","y"]))if((e=r.getColumn(s)).length)break;if(o)r.minColorValue=r[i+"Min"],r.maxColorValue=r[i+"Max"];else{let s=je.prototype.getExtremes.call(r,e);r.minColorValue=s.dataMin,r.maxColorValue=s.dataMax}kt(r.minColorValue)&&kt(r.maxColorValue)&&(this.dataMin=Math.min(this.dataMin,r.minColorValue),this.dataMax=Math.max(this.dataMax,r.maxColorValue)),o||je.prototype.applyExtremes.call(r)}}drawCrosshair(t,e){let i,o=this.legendItem||{},r=e?.plotX,n=e?.plotY,s=this.pos,a=this.len;e&&((i=this.toPixels(e.getNestedProperty(e.series.colorKey)))<s?i=s-2:i>s+a&&(i=s+a+2),e.plotX=i,e.plotY=this.len-i,super.drawCrosshair(t,e),e.plotX=r,e.plotY=n,this.cross&&!this.cross.addedToColorAxis&&o.group&&(this.cross.addClass("highcharts-coloraxis-marker").add(o.group),this.cross.addedToColorAxis=!0,this.chart.styledMode||typeof this.crosshair!="object"||this.cross.attr({fill:this.crosshair.color})))}getPlotLinePath(t){let e=this.left,i=t.translatedValue,o=this.top;return Ki(i)?this.horiz?[["M",i-4,o-6],["L",i+4,o-6],["L",i,o],["Z"]]:[["M",e,i],["L",e-6,i+6],["L",e-6,i-6],["Z"]]:super.getPlotLinePath(t)}update(t,e){let i=this.chart.legend;this.series.forEach(o=>{o.isDirtyData=!0}),(t.dataClasses&&i.allItems||this.dataClasses)&&this.destroyItems(),super.update(t,e),this.legendItem?.label&&(this.setLegendColor(),i.colorizeItem(this,!0))}destroyItems(){let t=this.chart,e=this.legendItem||{};if(e.label)t.legend.destroyItem(this);else if(e.labels)for(let i of e.labels)t.legend.destroyItem(i);t.isDirtyLegend=!0}destroy(){this.chart.isDirtyLegend=!0,this.destroyItems(),super.destroy(...[].slice.call(arguments))}remove(t){this.destroyItems(),super.remove(t)}getDataClassLegendSymbols(){let t,e=this,i=e.chart,o=e.legendItem&&e.legendItem.labels||[],r=i.options.legend,n=Y(r.valueDecimals,-1),s=Y(r.valueSuffix,""),a=h=>e.series.reduce((p,d)=>(p.push(...d.points.filter(c=>c.dataClass===h)),p),[]);return o.length||e.dataClasses.forEach((h,p)=>{let d=h.from,c=h.to,{numberFormatter:m}=i,y=!0;t="",d===void 0?t="< ":c===void 0&&(t="> "),d!==void 0&&(t+=m(d,n)+s),d!==void 0&&c!==void 0&&(t+=" - "),c!==void 0&&(t+=m(c,n)+s),o.push(Se({chart:i,name:t,options:{},drawLegendSymbol:Wi().rectangle,visible:!0,isDataClass:!0,setState:u=>{for(let f of a(p))f.setState(u)},setVisible:function(){this.visible=y=e.visible=!y;let u=[];for(let f of a(p))f.setVisible(y),f.hiddenInDataClass=!y,u.indexOf(f.series)===-1&&u.push(f.series);i.legend.colorizeItem(this,y),u.forEach(f=>{Zi(f,"afterDataClassLegendClick")})}},h))}),o}getSize(){let{chart:t,horiz:e}=this,{height:i,width:o}=this.options,{legend:r}=t.options;return{width:Y(kt(o)?Ie(o,t.chartWidth):void 0,r?.symbolWidth,e?V.defaultLegendLength:12),height:Y(kt(i)?Ie(i,t.chartHeight):void 0,r?.symbolHeight,e?12:V.defaultLegendLength)}}}V.defaultLegendLength=200,V.keepProps=["legendItem"],Se(V.prototype,Xi),Array.prototype.push.apply(Ae().keepProps,V.keepProps);let W=v();W.ColorAxis=W.ColorAxis||V,W.ColorAxis.compose(W.Chart,W.Fx,W.Legend,W.Series);let $i={lang:{zoomIn:"Zoom in",zoomOut:"Zoom out"},mapNavigation:{buttonOptions:{alignTo:"plotBox",align:"left",verticalAlign:"top",x:0,width:18,height:18,padding:5,style:{color:"#666666",fontSize:"1em",fontWeight:"bold"},theme:{fill:"#ffffff",stroke:"#e6e6e6","stroke-width":1,"text-align":"center"}},buttons:{zoomIn:{onclick:function(){this.mapZoom(.5)},text:"+",y:0},zoomOut:{onclick:function(){this.mapZoom(2)},text:"-",y:28}},mouseWheelSensitivity:1.1}},{defined:qi,extend:Be,pick:Ji,wrap:Ee}=v();(function(l){let t,e=0;function i(s){let a=this.chart;s=this.normalize(s),a.options.mapNavigation.enableDoubleClickZoomTo?a.pointer.inClass(s.target,"highcharts-tracker")&&a.hoverPoint&&a.hoverPoint.zoomTo():a.isInsidePlot(s.chartX-a.plotLeft,s.chartY-a.plotTop)&&a.mapZoom(.5,void 0,void 0,s.chartX,s.chartY)}function o(s){let a=this.chart,h=qi((s=this.normalize(s)).wheelDelta)&&-s.wheelDelta/120||s.deltaY||s.detail;Math.abs(h)>=1&&(e+=Math.abs(h),t&&clearTimeout(t),t=setTimeout(()=>{e=0},50)),e<10&&a.isInsidePlot(s.chartX-a.plotLeft,s.chartY-a.plotTop)&&a.mapView&&a.mapView.zoomBy(-((a.options.mapNavigation.mouseWheelSensitivity-1)*h),void 0,[s.chartX,s.chartY],!(1>Math.abs(h))&&void 0)}function r(s,a,h){let p=this.chart;if(a=s.call(this,a,h),p&&p.mapView){let d=p.mapView.pixelsToLonLat({x:a.chartX-p.plotLeft,y:a.chartY-p.plotTop});d&&Be(a,d)}return a}function n(s){let a=this.chart.options.mapNavigation;a&&Ji(a.enableTouchZoom,a.enabled)&&(this.chart.zooming.pinchType="xy"),s.apply(this,[].slice.call(arguments,1))}l.compose=function(s){let a=s.prototype;a.onContainerDblClick||(Be(a,{onContainerDblClick:i,onContainerMouseWheel:o}),Ee(a,"normalize",r),Ee(a,"zoomOption",n))}})(_t||(_t={}));let Qi=_t;function ts(l,t,e,i,o){if(o){let r=o?.r||0;o.brBoxY=t-r,o.brBoxHeight=i+r}return Ct.roundedRect(l,t,e,i,o)}function es(l,t,e,i,o){if(o){let r=o?.r||0;o.brBoxHeight=i+r}return Ct.roundedRect(l,t,e,i,o)}let is=function(l){(Ct=l.prototype.symbols).bottombutton=ts,Ct.topbutton=es},{setOptions:ss}=v(),{composed:os}=v(),{addEvent:et,extend:De,merge:ie,objectEach:rs,pick:se,pushUnique:as}=v();function oe(l){l&&(l.preventDefault?.(),l.stopPropagation?.(),l.cancelBubble=!0)}class jt{static compose(t,e,i){Qi.compose(e),is(i),as(os,"Map.Navigation")&&(et(t,"beforeRender",function(){this.mapNavigation=new jt(this),this.mapNavigation.update()}),ss($i))}constructor(t){this.chart=t,this.navButtons=[]}update(t){let e=this,i=e.chart,o=e.navButtons,r=function(s){this.handler.call(i,s),oe(s)},n=i.options.mapNavigation;for(t&&(n=i.options.mapNavigation=ie(i.options.mapNavigation,t));o.length;)o.pop()?.destroy();!i.renderer.forExport&&se(n.enableButtons,n.enabled)&&(e.navButtonsGroup||(e.navButtonsGroup=i.renderer.g().attr({zIndex:7}).add()),rs(n.buttons,(s,a)=>{let h={padding:(s=ie(n.buttonOptions,s)).padding};!i.styledMode&&s.theme&&(De(h,s.theme),h.style=ie(s.theme.style,s.style));let{text:p,width:d=0,height:c=0,padding:m=0}=s,y=i.renderer.button(p!=="+"&&p!=="-"&&p||"",0,0,r,h,void 0,void 0,void 0,a==="zoomIn"?"topbutton":"bottombutton").addClass("highcharts-map-navigation highcharts-"+{zoomIn:"zoom-in",zoomOut:"zoom-out"}[a]).attr({width:d,height:c,title:i.options.lang[a],zIndex:5}).add(e.navButtonsGroup);if(p==="+"||p==="-"){let u=d+1,f=[["M",m+3,m+c/2],["L",m+u-3,m+c/2]];p==="+"&&f.push(["M",m+u/2,m+3],["L",m+u/2,m+c-3]),i.renderer.path(f).addClass("highcharts-button-symbol").attr(i.styledMode?{}:{stroke:s.style?.color,"stroke-width":3,"stroke-linecap":"round"}).add(y)}if(y.handler=s.onclick,et(y.element,"dblclick",oe),o.push(y),De(s,{width:y.width,height:2*(y.height||0)}),i.hasLoaded)y.align(s,!1,s.alignTo);else{let u=et(i,"load",()=>{y.element&&y.align(s,!1,s.alignTo),u()})}}),i.hasLoaded||et(i,"render",function(){let s=i.exporting?.group?.getBBox();if(s){let a=e.navButtonsGroup.getBBox();if(!(a.x>=s.x+s.width||a.x+a.width<=s.x||a.y>=s.y+s.height||a.y+a.height<=s.y)){let h=-a.y-a.height+s.y-5,p=s.y+s.height-a.y+5,d=n.buttonOptions&&n.buttonOptions.verticalAlign;e.navButtonsGroup.attr({translateY:d==="bottom"?h:p})}}})),this.updateEvents(n)}updateEvents(t){let e=this.chart;se(t.enableDoubleClickZoom,t.enabled)||t.enableDoubleClickZoomTo?this.unbindDblClick=this.unbindDblClick||et(e.container,"dblclick",function(i){e.pointer.onContainerDblClick(i)}):this.unbindDblClick&&(this.unbindDblClick=this.unbindDblClick()),se(t.enableMouseWheelZoom,t.enabled)?this.unbindMouseWheel=this.unbindMouseWheel||et(e.container,"wheel",function(i){if(!e.pointer.inClass(i.target,"highcharts-no-mousewheel")){let o=e.mapView?.zoom;e.pointer.onContainerMouseWheel(i),o!==e.mapView?.zoom&&oe(i)}return!1}):this.unbindMouseWheel&&(this.unbindMouseWheel=this.unbindMouseWheel())}}var ns=P(28),ls=P.n(ns);let{column:{prototype:hs}}=I().seriesTypes,{addEvent:ps,defined:ds}=v();var re=Kt||(Kt={});function cs(l){let t=this.series,e=t.chart.renderer;this.moveToTopOnHover&&this.graphic&&(t.stateMarkerGraphic||(t.stateMarkerGraphic=new(ls())(e,"use").css({pointerEvents:"none"}).add(this.graphic.parentGroup)),l?.state==="hover"?(this.graphic.attr({id:this.id}),t.stateMarkerGraphic.attr({href:`${e.url}#${this.id}`,visibility:"visible"})):t.stateMarkerGraphic.attr({href:""}))}re.pointMembers={dataLabelOnNull:!0,moveToTopOnHover:!0,isValid:function(){return this.value!==null&&this.value!==1/0&&this.value!==-1/0&&(this.value===void 0||!isNaN(this.value))}},re.seriesMembers={colorKey:"value",axisTypes:["xAxis","yAxis","colorAxis"],parallelArrays:["x","y","value"],pointArrayMap:["value"],trackerGroups:["group","markerGroup","dataLabelsGroup"],colorAttribs:function(l){let t={};return ds(l.color)&&(!l.state||l.state==="normal")&&(t[this.colorProp||"fill"]=l.color),t},pointAttribs:hs.pointAttribs},re.compose=function(l){return ps(l.prototype.pointClass,"afterSetState",cs),l};let B=Kt;var us=P(820),ms=P.n(us);let{deg2rad:Oe}=v(),{fireEvent:gs,isNumber:ae,pick:St,relativeLength:fs}=v();(Pe=$t||($t={})).getCenter=function(){let l=this.options,t=this.chart,e=2*(l.slicedOffset||0),i=t.plotWidth-2*e,o=t.plotHeight-2*e,r=l.center,n=Math.min(i,o),s=l.thickness,a,h=l.size,p=l.innerSize||0,d,c;typeof h=="string"&&(h=parseFloat(h)),typeof p=="string"&&(p=parseFloat(p));let m=[St(r?.[0],"50%"),St(r?.[1],"50%"),St(h&&h<0?void 0:l.size,"100%"),St(p&&p<0?void 0:l.innerSize||0,"0%")];for(!t.angular||this instanceof ms()||(m[3]=0),d=0;d<4;++d)c=m[d],a=d<2||d===2&&/%$/.test(c),m[d]=fs(c,[i,o,n,m[2]][d])+(a?e:0);return m[3]>m[2]&&(m[3]=m[2]),ae(s)&&2*s<m[2]&&s>0&&(m[3]=m[2]-2*s),gs(this,"afterGetCenter",{positions:m}),m},Pe.getStartAndEndRadians=function(l,t){let e=ae(l)?l:0,i=ae(t)&&t>e&&t-e<360?t:e+360;return{start:Oe*(e+-90),end:Oe*(i+-90)}};let ys=$t;var bs=P(960),xs=P.n(bs),Ms=P(540),ne=P.n(Ms);let{getOptions:vs}=v(),{isNumber:lt,merge:ws,pick:Ve}=v();class le extends xs(){init(t,e){let i=vs().credits,o=ws({chart:{panning:{enabled:!0,type:"xy"},type:"map"},credits:{mapText:Ve(i.mapText,' \xA9 <a href="{geojson.copyrightUrl}">{geojson.copyrightShort}</a>'),mapTextFull:Ve(i.mapTextFull,"{geojson.copyright}")},mapView:{},tooltip:{followTouchMove:!1}},t);super.init(o,e)}mapZoom(t,e,i,o,r){this.mapView&&(lt(t)&&(t=Math.log(t)/Math.log(.5)),this.mapView.zoomBy(t,lt(e)&&lt(i)?this.mapView.projection.inverse([e,i]):void 0,lt(o)&&lt(r)?[o,r]:void 0))}update(t){t.chart&&"map"in t.chart&&this.mapView?.recommendMapView(this,[t.chart.map,...(this.options.series||[]).map(e=>e.mapData)],!0),super.update.apply(this,arguments)}}(Tt=le||(le={})).maps={},Tt.mapChart=function(l,t,e){return new Tt(l,t,e)},Tt.splitPath=function(l){let t;return t=typeof l=="string"?(l=l.replace(/([A-Z])/gi," $1 ").replace(/^\s*/,"").replace(/\s*$/,"")).split(/[ ,;]+/).map(e=>/[A-Z]/i.test(e)?e:parseFloat(e)):l,ne().prototype.pathToSegments(t)};let zt=le,Ne={boundsFromPath:function(l){let t=-Number.MAX_VALUE,e=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r;if(l.forEach(n=>{let s=n[n.length-2],a=n[n.length-1];typeof s=="number"&&typeof a=="number"&&(e=Math.min(e,s),t=Math.max(t,s),o=Math.min(o,a),i=Math.max(i,a),r=!0)}),r)return{x1:e,y1:o,x2:t,y2:i}}},{boundsFromPath:Cs}=Ne,Ps=I().seriesTypes.scatter.prototype.pointClass,{extend:Xe,isNumber:ht,pick:Ge}=v();class it extends Ps{static getProjectedPath(t,e){return t.projectedPath||(e&&t.geometry?(e.hasCoordinates=!0,t.projectedPath=e.path(t.geometry)):t.projectedPath=t.path),t.projectedPath||[]}applyOptions(t,e){let i=this.series,o=super.applyOptions(t,e),r=i.joinBy;if(i.mapData&&i.mapMap){let n=r[1],s=super.getNestedProperty(n),a=s!==void 0&&i.mapMap[s];a?Xe(o,we(ve({},a),{name:o.name??a.name})):i.pointArrayMap.indexOf("value")!==-1&&(o.value=o.value||null)}return o}getProjectedBounds(t){let e=Cs(it.getProjectedPath(this,t)),i=this.properties,o=this.series.chart.mapView;if(e){let r=i?.["hc-middle-lon"],n=i?.["hc-middle-lat"];if(o&&ht(r)&&ht(n)){let s=t.forward([r,n]);e.midX=s[0],e.midY=s[1]}else{let s=i?.["hc-middle-x"],a=i?.["hc-middle-y"];e.midX=e.x1+(e.x2-e.x1)*Ge(this.middleX,ht(s)?s:.5);let h=Ge(this.middleY,ht(a)?a:.5);this.geometry||(h=1-h),e.midY=e.y2-(e.y2-e.y1)*h}return e}}onMouseOver(t){v().clearTimeout(this.colorInterval),!this.isNull&&this.visible||this.series.options.nullInteraction?super.onMouseOver.call(this,t):this.series.onMouseOut()}setVisible(t){this.visible=this.options.visible=!!t,this.dataLabel&&this.dataLabel[t?"show":"hide"](),this.graphic&&this.graphic.attr(this.series.pointAttribs(this))}zoomTo(t){let e=this.series.chart,i=e.mapView,o=this.bounds;if(i&&o){let r=ht(this.insetIndex)&&i.insets[this.insetIndex];if(r){let n=r.projectedUnitsToPixels({x:o.x1,y:o.y1}),s=r.projectedUnitsToPixels({x:o.x2,y:o.y2}),a=i.pixelsToProjectedUnits({x:n.x,y:n.y}),h=i.pixelsToProjectedUnits({x:s.x,y:s.y});o={x1:a.x,y1:a.y,x2:h.x,y2:h.y}}i.fitToBounds(o,void 0,!1),this.series.isDirty=!0,e.redraw(t)}}}Xe(it.prototype,{dataLabelOnNull:B.pointMembers.dataLabelOnNull,moveToTopOnHover:B.pointMembers.moveToTopOnHover,isValid:B.pointMembers.isValid});let{isNumber:Ts}=v(),Ls={center:[0,0],fitToGeometry:void 0,maxZoom:void 0,padding:0,projection:{name:void 0,parallels:void 0,rotation:void 0},zoom:void 0,insetOptions:{borderColor:"#cccccc",borderWidth:1,padding:"10%",relativeTo:"mapBoundingBox",units:"percent"}};var As=P(984),Re=P.n(As);let{win:Ye}=v(),{format:He}=Re(),{error:Fe,extend:ks,merge:js,wrap:Ss}=v();(function(l){function t(s){return this.mapView?.lonLatToProjectedUnits(s)}function e(s){return this.mapView?.projectedUnitsToLonLat(s)}function i(s,a){let h=this.options.chart.proj4||Ye.proj4;if(!h)return void Fe(21,!1,this);let{jsonmarginX:p=0,jsonmarginY:d=0,jsonres:c=1,scale:m=1,xoffset:y=0,xpan:u=0,yoffset:f=0,ypan:g=0}=a,b=h(a.crs,[s.lon,s.lat]),x=a.cosAngle||a.rotation&&Math.cos(a.rotation),M=a.sinAngle||a.rotation&&Math.sin(a.rotation),C=a.rotation?[b[0]*x+b[1]*M,-b[0]*M+b[1]*x]:b;return{x:((C[0]-y)*m+u)*c+p,y:-(((f-C[1])*m+g)*c-d)}}function o(s,a){let h=this.options.chart.proj4||Ye.proj4;if(!h)return void Fe(21,!1,this);if(s.y===null)return;let{jsonmarginX:p=0,jsonmarginY:d=0,jsonres:c=1,scale:m=1,xoffset:y=0,xpan:u=0,yoffset:f=0,ypan:g=0}=a,b={x:((s.x-p)/c-u)/m+y,y:((s.y-d)/c+g)/m+f},x=a.cosAngle||a.rotation&&Math.cos(a.rotation),M=a.sinAngle||a.rotation&&Math.sin(a.rotation),C=h(a.crs,"WGS84",a.rotation?{x:b.x*x+-(b.y*M),y:b.x*M+b.y*x}:b);return{lat:C.y,lon:C.x}}function r(s,a){a||(a=Object.keys(s.objects)[0]);let h=s.objects[a];if(h["hc-decoded-geojson"]&&h["hc-decoded-geojson"].title===s.title)return h["hc-decoded-geojson"];let p=s.arcs;if(s.transform){let u,f,g,b=s.arcs,{scale:x,translate:M}=s.transform;p=[];for(let C=0,T=b.length;C<T;++C){let k=b[C];p.push(u=[]),f=0,g=0;for(let D=0,L=k.length;D<L;++D)u.push([(f+=k[D][0])*x[0]+M[0],(g+=k[D][1])*x[1]+M[1]])}}let d=u=>typeof u[0]=="number"?u.reduce((f,g,b)=>{let x=g<0?p[~g]:p[g];return g<0?(x=x.slice(0,b===0?x.length:x.length-1)).reverse():b&&(x=x.slice(1)),f.concat(x)},[]):u.map(d),c=h.geometries,m=[];for(let u=0,f=c.length;u<f;++u)m.push({type:"Feature",properties:c[u].properties,geometry:{type:c[u].type,coordinates:c[u].coordinates||d(c[u].arcs)}});let y={type:"FeatureCollection",copyright:s.copyright,copyrightShort:s.copyrightShort,copyrightUrl:s.copyrightUrl,features:m,"hc-recommended-mapview":h["hc-recommended-mapview"],bbox:s.bbox,title:s.title};return h["hc-decoded-geojson"]=y,y}function n(s,a){a=js(!0,this.options.credits,a),s.call(this,a),this.credits&&this.mapCreditsFull&&this.credits.attr({title:this.mapCreditsFull})}l.compose=function(s){let a=s.prototype;a.transformFromLatLon||(a.fromLatLonToPoint=t,a.fromPointToLatLon=e,a.transformFromLatLon=i,a.transformToLatLon=o,Ss(a,"addCredits",n))},l.geojson=function(s,a="map",h){let p=[],d=s.type==="Topology"?r(s):s,c=d.features;for(let m=0,y=c.length;m<y;++m){let u,f=c[m],g=f.geometry||{},b=g.type,x=g.coordinates,M=f.properties;if((a==="map"||a==="mapbubble")&&(b==="Polygon"||b==="MultiPolygon")||a==="mapline"&&(b==="LineString"||b==="MultiLineString")?x.length&&(u={geometry:{coordinates:x,type:b}}):a==="mappoint"&&b==="Point"&&x.length&&(u={geometry:{coordinates:x,type:b}}),u){let C=M&&(M.name||M.NAME),T=M&&M.lon,k=M&&M.lat;p.push(ks(u,{lat:typeof k=="number"?k:void 0,lon:typeof T=="number"?T:void 0,name:typeof C=="string"?C:void 0,properties:M}))}}return h&&d.copyrightShort&&(h.chart.mapCredits=He(h.chart.options.credits?.mapText,{geojson:d}),h.chart.mapCreditsFull=He(h.chart.options.credits?.mapTextFull,{geojson:d})),p},l.topo2geo=r})(qt||(qt={}));let It=qt;(Lt=Jt||(Jt={})).getCenterOfPoints=function(l){let t=l.reduce((e,i)=>(e.x+=i.x,e.y+=i.y,e),{x:0,y:0});return{x:t.x/l.length,y:t.y/l.length}},Lt.getDistanceBetweenPoints=function(l,t){return Math.sqrt(Math.pow(t.x-l.x,2)+Math.pow(t.y-l.y,2))},Lt.getAngleBetweenPoints=function(l,t){return Math.atan2(t.x-l.x,t.y-l.y)},Lt.pointInPolygon=function({x:l,y:t},e){let i=e.length,o,r,n=!1;for(o=0,r=i-1;o<i;r=o++){let[s,a]=e[o],[h,p]=e[r];a>t!=p>t&&l<(h-s)*(t-a)/(p-a)+s&&(n=!n)}return n};let zs=Jt;function We(l,t,e=!0){let i=t[t.length-1],o,r,n,s=l;for(let a=0;a<t.length;a++){let h=s;o=t[a],s=[],r=e?h[h.length-1]:h[0];for(let p=0;p<h.length;p++)he(i,o,n=h[p])?(he(i,o,r)||s.push(Ue(i,o,r,n)),s.push(n)):he(i,o,r)&&s.push(Ue(i,o,r,n)),r=n;i=o}return s}function he(l,t,e){return(t[0]-l[0])*(e[1]-l[1])>(t[1]-l[1])*(e[0]-l[0])}function Ue(l,t,e,i){let o=[l[0]-t[0],l[1]-t[1]],r=[e[0]-i[0],e[1]-i[1]],n=l[0]*t[1]-l[1]*t[0],s=e[0]*i[1]-e[1]*i[0],a=1/(o[0]*r[1]-o[1]*r[0]),h=[(n*r[0]-s*o[0])*a,(n*r[1]-s*o[1])*a];return h.isIntersection=!0,h}let pt=Math.sign||(l=>l===0?0:l>0?1:-1),dt=Math.PI/180,st=Math.PI/2,Bt=l=>Math.tan((st+l)/2),Is=class{constructor(l){let t=(l.parallels||[]).map(n=>n*dt),e=t[0]||0,i=t[1]??e,o=Math.cos(e);typeof l.projectedBounds=="object"&&(this.projectedBounds=l.projectedBounds);let r=e===i?Math.sin(e):Math.log(o/Math.cos(i))/Math.log(Bt(i)/Bt(e));1e-10>Math.abs(r)&&(r=1e-10*(pt(r)||1)),this.n=r,this.c=o*Math.pow(Bt(e),r)/r}forward(l){let{c:t,n:e,projectedBounds:i}=this,o=l[0]*dt,r=l[1]*dt;t>0?r<-st+1e-6&&(r=-st+1e-6):r>st-1e-6&&(r=st-1e-6);let n=t/Math.pow(Bt(r),e),s=n*Math.sin(e*o)*63.78137,a=(t-n*Math.cos(e*o))*63.78137,h=[s,a];return i&&(s<i.x1||s>i.x2||a<i.y1||a>i.y2)&&(h.outside=!0),h}inverse(l){let{c:t,n:e}=this,i=l[0]/63.78137,o=t-l[1]/63.78137,r=pt(e)*Math.sqrt(i*i+o*o),n=Math.atan2(i,Math.abs(o))*pt(o);return o*e<0&&(n-=Math.PI*pt(i)*pt(o)),[n/e/dt,(2*Math.atan(Math.pow(t/r,1/e))-st)/dt]}},Et=Math.sqrt(3)/2,Bs=class{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,y1:-97.52595454902263,y2:97.52595454902263}}forward(l){let t=Math.PI/180,e=Math.asin(Et*Math.sin(l[1]*t)),i=e*e,o=i*i*i;return[l[0]*t*Math.cos(e)*74.03120656864502/(Et*(1.340264+-.24331799999999998*i+o*(.0062510000000000005+.034164*i))),74.03120656864502*e*(1.340264+-.081106*i+o*(893e-6+.003796*i))]}inverse(l){let t=l[0]/74.03120656864502,e=l[1]/74.03120656864502,i=180/Math.PI,o=e,r,n,s,a;for(let d=0;d<12&&(n=(r=o*o)*r*r,s=o*(1.340264+-.081106*r+n*(893e-6+.003796*r))-e,o-=a=s/(1.340264+-.24331799999999998*r+n*(.0062510000000000005+.034164*r)),!(1e-9>Math.abs(a)));++d);n=(r=o*o)*r*r;let h=i*Et*t*(1.340264+-.24331799999999998*r+n*(.0062510000000000005+.034164*r))/Math.cos(o),p=i*Math.asin(Math.sin(o)/Et);return Math.abs(h)>180?[NaN,NaN]:[h,p]}},Ze=Math.PI/4,Dt=Math.PI/180,Es=class{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,y1:-146.91480769173063,y2:146.91480769173063}}forward(l){return[l[0]*Dt*63.78137,79.7267125*Math.log(Math.tan(Ze+.4*l[1]*Dt))]}inverse(l){return[l[0]/63.78137/Dt,2.5*(Math.atan(Math.exp(.8*(l[1]/63.78137)))-Ze)/Dt]}},Ot=Math.PI/180,Ds=class{constructor(){this.antimeridianCutting=!1,this.bounds={x1:-63.78460826781007,x2:63.78460826781007,y1:-63.78460826781007,y2:63.78460826781007}}forward(l){let t=l[0],e=l[1]*Ot,i=[Math.cos(e)*Math.sin(t*Ot)*63.78460826781007,63.78460826781007*Math.sin(e)];return(t<-90||t>90)&&(i.outside=!0),i}inverse(l){let t=l[0]/63.78460826781007,e=l[1]/63.78460826781007,i=Math.sqrt(t*t+e*e),o=Math.asin(i),r=Math.sin(o);return[Math.atan2(t*r,i*Math.cos(o))/Ot,Math.asin(i&&e*r/i)/Ot]}},Vt=Math.PI/180,Os=class{constructor(){this.bounds={x1:-200.37508342789243,x2:200.37508342789243,y1:-200.3750834278071,y2:200.3750834278071},this.maxLatitude=85.0511287798}forward(l){let t=Math.sin(l[1]*Vt),e=[63.78137*l[0]*Vt,63.78137*Math.log((1+t)/(1-t))/2];return Math.abs(l[1])>this.maxLatitude&&(e.outside=!0),e}inverse(l){return[l[0]/(63.78137*Vt),(2*Math.atan(Math.exp(l[1]/63.78137))-Math.PI/2)/Vt]}},{clipLineString:Vs,clipPolygon:Ns}={clipLineString:function(l,t){let e=[],i=We(l,t,!1);for(let o=1;o<i.length;o++)i[o].isIntersection&&i[o-1].isIntersection&&(e.push(i.splice(0,o)),o=0),o===i.length-1&&e.push(i);return e},clipPolygon:We},{clamp:Xs,erase:Gs}=v(),j=2*Math.PI/360,ot=l=>(l<-180&&(l+=360),l>180&&(l-=360),l),_e=l=>(1-Math.cos(l))/2,ct=(()=>{class l{static add(e,i){l.registry[e]=i}static distance(e,i){let o,r,n,s,a,{atan2:h,sqrt:p}=Math,d=(o=Math.cos,r=e[1]*j,n=e[0]*j,s=i[1]*j,a=i[0]*j,_e(s-r)+o(r)*o(s)*_e(a-n));return 6371e3*(2*h(p(d),p(1-d)))}static geodesic(e,i,o,r=5e5){let{atan2:n,cos:s,sin:a,sqrt:h}=Math,p=l.distance,d=e[1]*j,c=e[0]*j,m=i[1]*j,y=i[0]*j,u=s(d)*s(c),f=s(m)*s(y),g=s(d)*a(c),b=s(m)*a(y),x=a(d),M=a(m),C=p(e,i),T=C/6371e3,k=a(T),D=Math.round(C/r),L=[];if(o&&L.push(e),D>1){let z=1/D;for(let S=z;S<.999;S+=z){let N=a((1-S)*T)/k,$=a(S*T)/k,Mt=N*u+$*f,q=N*g+$*b,vt=n(N*x+$*M,h(Mt*Mt+q*q)),be=n(q,Mt);L.push([be/j,vt/j])}}return o&&L.push(i),L}static insertGeodesics(e){let i=e.length-1;for(;i--;)if(Math.max(Math.abs(e[i][0]-e[i+1][0]),Math.abs(e[i][1]-e[i+1][1]))>10){let o=l.geodesic(e[i],e[i+1]);o.length&&e.splice(i+1,0,...o)}}static toString(e){let{name:i,rotation:o}=e||{};return[i,o&&o.join(",")].join(";")}constructor(e={}){this.hasCoordinates=!1,this.hasGeoProjection=!1,this.maxLatitude=90,this.options=e;let{name:i,projectedBounds:o,rotation:r}=e;this.rotator=r?this.getRotator(r):void 0;let n=i?l.registry[i]:void 0;n&&(this.def=new n(e));let{def:s,rotator:a}=this;s&&(this.maxLatitude=s.maxLatitude||90,this.hasGeoProjection=!0),a&&s?(this.forward=h=>s.forward(a.forward(h)),this.inverse=h=>a.inverse(s.inverse(h))):s?(this.forward=h=>s.forward(h),this.inverse=h=>s.inverse(h)):a&&(this.forward=a.forward,this.inverse=a.inverse),this.bounds=o==="world"?s&&s.bounds:o}lineIntersectsBounds(e){let{x1:i,x2:o,y1:r,y2:n}=this.bounds||{},s=(p,d,c)=>{let[m,y]=p,u=+!d;if(typeof c=="number"&&m[d]>=c!=y[d]>=c){let f=(c-m[d])/(y[d]-m[d]),g=m[u]+f*(y[u]-m[u]);return d?[g,c]:[c,g]}},a,h=e[0];return((a=s(e,0,i))||(a=s(e,0,o)))&&(h=a,e[1]=a),((a=s(e,1,r))||(a=s(e,1,n)))&&(h=a),h}getRotator(e){let i=e[0]*j,o=(e[1]||0)*j,r=(e[2]||0)*j,n=Math.cos(o),s=Math.sin(o),a=Math.cos(r),h=Math.sin(r);if(i!==0||o!==0||r!==0)return{forward:p=>{let d=p[0]*j+i,c=p[1]*j,m=Math.cos(c),y=Math.cos(d)*m,u=Math.sin(d)*m,f=Math.sin(c),g=f*n+y*s;return[Math.atan2(u*a-g*h,y*n-f*s)/j,Math.asin(g*a+u*h)/j]},inverse:p=>{let d=p[0]*j,c=p[1]*j,m=Math.cos(c),y=Math.cos(d)*m,u=Math.sin(d)*m,f=Math.sin(c),g=f*a-u*h;return[(Math.atan2(u*a+f*h,y*n+g*s)-i)/j,Math.asin(g*n-y*s)/j]}}}forward(e){return e}inverse(e){return e}cutOnAntimeridian(e,i){let o,r=[],n=[e];for(let s=0,a=e.length;s<a;++s){let h=e[s],p=e[s-1];if(!s){if(!i)continue;p=e[e.length-1]}let d=p[0],c=h[0];if((d<-90||d>90)&&(c<-90||c>90)&&d>0!=c>0){let m=Xs((180-(d+360)%360)/((c+360)%360-(d+360)%360),0,1),y=p[1]+m*(h[1]-p[1]);r.push({i:s,lat:y,direction:d<0?1:-1,previousLonLat:p,lonLat:h})}}if(r.length)if(i){r.length%2==1&&(o=r.slice().sort((a,h)=>Math.abs(h.lat)-Math.abs(a.lat))[0],Gs(r,o));let s=r.length-2;for(;s>=0;){let a=r[s].i,h=ot(180+1e-6*r[s].direction),p=ot(180-1e-6*r[s].direction),d=e.splice(a,r[s+1].i-a,...l.geodesic([h,r[s].lat],[h,r[s+1].lat],!0));d.push(...l.geodesic([p,r[s+1].lat],[p,r[s].lat],!0)),n.push(d),s-=2}if(o)for(let a=0;a<n.length;a++){let{direction:h,lat:p}=o,d=n[a],c=d.indexOf(o.lonLat);if(c>-1){let m=(p<0?-1:1)*this.maxLatitude,y=ot(180+1e-6*h),u=ot(180-1e-6*h),f=l.geodesic([y,p],[y,m],!0);for(let g=y+120*h;g>-180&&g<180;g+=120*h)f.push([g,m]);f.push(...l.geodesic([u,m],[u,o.lat],!0)),d.splice(c,0,...f);break}}}else{let s=r.length;for(;s--;){let a=r[s].i,h=e.splice(a,e.length,[ot(180+1e-6*r[s].direction),r[s].lat]);h.unshift([ot(180-1e-6*r[s].direction),r[s].lat]),n.push(h)}}return n}path(e){let i,{bounds:o,def:r,rotator:n}=this,s=[],a=e.type==="Polygon"||e.type==="MultiPolygon",h=this.hasGeoProjection,p=!r||r.antimeridianCutting!==!1,d=p?n:void 0,c=p&&r||this;o&&(i=[[o.x1,o.y1],[o.x2,o.y1],[o.x2,o.y2],[o.x1,o.y2]]);let m=y=>{let u=y.map(g=>{if(p){d&&(g=d.forward(g));let b=g[0];1e-6>Math.abs(b-180)&&(b=b<180?179.999999:180.000001),g=[b,g[1]]}return g}),f=[u];h&&(l.insertGeodesics(u),p&&(f=this.cutOnAntimeridian(u,a))),f.forEach(g=>{let b,x;if(g.length<2)return;let M=!1,C=!1,T=z=>{M?s.push(["L",z[0],z[1]]):(s.push(["M",z[0],z[1]]),M=!0)},k=!1,D=!1,L=g.map(z=>{let S=c.forward(z);return S.outside?k=!0:D=!0,S[1]===1/0?S[1]=1e10:S[1]===-1/0&&(S[1]=-1e10),S});if(p){if(a&&L.push(L[0]),k){if(!D)return;if(i){if(a)L=Ns(L,i);else if(o)return void Vs(L,i).forEach(z=>{M=!1,z.forEach(T)})}}L.forEach(T)}else for(let z=0;z<L.length;z++){let S=g[z],N=L[z];N.outside?C=!0:(a&&!b&&(b=S,g.push(S),L.push(N)),C&&x&&(a&&h?l.geodesic(x,S).forEach($=>T(c.forward($))):M=!1),T(N),x=S,C=!1)}})};return e.type==="LineString"?m(e.coordinates):e.type==="MultiLineString"?e.coordinates.forEach(y=>m(y)):e.type==="Polygon"?(e.coordinates.forEach(y=>m(y)),s.length&&s.push(["Z"])):e.type==="MultiPolygon"&&(e.coordinates.forEach(y=>{y.forEach(u=>m(u))}),s.length&&s.push(["Z"])),s}}return l.registry={EqualEarth:Bs,LambertConformalConic:Is,Miller:Es,Orthographic:Ds,WebMercator:Os},l})(),{composed:Rs}=v(),{pointInPolygon:ut}=zs,{topo2geo:Ke}=It,{boundsFromPath:$e}=Ne,{addEvent:U,clamp:Ys,crisp:qe,fireEvent:Je,isArray:Hs,isNumber:X,isObject:Fs,isString:Ws,merge:R,pick:Us,pushUnique:Zs,relativeLength:H}=v(),mt={};function Qe(l,t){let{width:e,height:i}=t;return Math.log(400.979322/Math.max((l.x2-l.x1)/(e/256),(l.y2-l.y1)/(i/256)))/Math.log(2)}function ti(l){l.seriesOptions.mapData&&this.mapView?.recommendMapView(this,[this.options.chart.map,l.seriesOptions.mapData],this.options.drilldown?.mapZooming)}class G{static compose(t){Zs(Rs,"MapView")&&(mt=t.maps,U(t,"afterInit",function(){this.mapView=new G(this,this.options.mapView)},{order:0}),U(t,"addSeriesAsDrilldown",ti),U(t,"afterDrillUp",ti))}static compositeBounds(t){if(t.length)return t.slice(1).reduce((e,i)=>(e.x1=Math.min(e.x1,i.x1),e.y1=Math.min(e.y1,i.y1),e.x2=Math.max(e.x2,i.x2),e.y2=Math.max(e.y2,i.y2),e),R(t[0]))}static mergeInsets(t,e){let i=r=>{let n={};return r.forEach((s,a)=>{n[s&&s.id||`i${a}`]=s}),n},o=R(i(t),i(e));return Object.keys(o).map(r=>o[r])}constructor(t,e){this.allowTransformAnimation=!0,this.eventsToUnbind=[],this.insets=[],this.padding=[0,0,0,0],this.recommendedMapView={},this instanceof ei||this.recommendMapView(t,[t.options.chart.map,...(t.options.series||[]).map(n=>n.mapData)]),this.userOptions=e||{};let i=R(Ls,this.recommendedMapView,e),o=this.recommendedMapView?.insets,r=e&&e.insets;o&&r&&(i.insets=G.mergeInsets(o,r)),this.chart=t,this.center=i.center,this.options=i,this.projection=new ct(i.projection),this.playingField=t.plotBox,this.zoom=i.zoom||0,this.minZoom=i.minZoom,this.createInsets(),this.eventsToUnbind.push(U(t,"afterSetChartSize",()=>{this.playingField=this.getField(),(this.minZoom===void 0||this.minZoom===this.zoom)&&(this.fitToBounds(void 0,void 0,!1),!this.chart.hasRendered&&X(this.userOptions.zoom)&&(this.zoom=this.userOptions.zoom),this.userOptions.center&&R(!0,this.center,this.userOptions.center))})),this.setUpEvents()}createInsets(){let t=this.options,e=t.insets;e&&e.forEach(i=>{let o=new ei(this,R(t.insetOptions,i));this.insets.push(o)})}fitToBounds(t,e,i=!0,o){let r=t||this.getProjectedBounds();if(r){let n=Us(e,t?0:this.options.padding),s=this.getField(!1),a=Hs(n)?n:[n,n,n,n];this.padding=[H(a[0],s.height),H(a[1],s.width),H(a[2],s.height),H(a[3],s.width)],this.playingField=this.getField();let h=Qe(r,this.playingField);t||(this.minZoom=h);let p=this.projection.inverse([(r.x2+r.x1)/2,(r.y2+r.y1)/2]);this.setView(p,h,i,o)}}getField(t=!0){let e=t?this.padding:[0,0,0,0];return{x:e[3],y:e[0],width:this.chart.plotWidth-e[1]-e[3],height:this.chart.plotHeight-e[0]-e[2]}}getGeoMap(t){if(Ws(t))return mt[t]&&mt[t].type==="Topology"?Ke(mt[t]):mt[t];if(Fs(t,!0)){if(t.type==="FeatureCollection")return t;if(t.type==="Topology")return Ke(t)}}getMapBBox(){let t=this.getProjectedBounds(),e=this.getScale();if(t){let i=this.padding,o=this.projectedUnitsToPixels({x:t.x1,y:t.y2});return{width:(t.x2-t.x1)*e+i[1]+i[3],height:(t.y2-t.y1)*e+i[0]+i[2],x:o.x-i[3],y:o.y-i[0]}}}getProjectedBounds(){let t=this.projection,e=this.chart.series.reduce((o,r)=>{let n=r.getProjectedBounds&&r.getProjectedBounds();return n&&r.options.affectsMapView!==!1&&o.push(n),o},[]),i=this.options.fitToGeometry;if(i){if(!this.fitToGeometryCache)if(i.type==="MultiPoint"){let o=i.coordinates.map(s=>t.forward(s)),r=o.map(s=>s[0]),n=o.map(s=>s[1]);this.fitToGeometryCache={x1:Math.min.apply(0,r),x2:Math.max.apply(0,r),y1:Math.min.apply(0,n),y2:Math.max.apply(0,n)}}else this.fitToGeometryCache=$e(t.path(i));return this.fitToGeometryCache}return this.projection.bounds||G.compositeBounds(e)}getScale(){return 256/400.979322*Math.pow(2,this.zoom)}getSVGTransform(){let{x:t,y:e,width:i,height:o}=this.playingField,r=this.projection.forward(this.center),n=this.projection.hasCoordinates?-1:1,s=this.getScale(),a=s*n,h=t+i/2-r[0]*s,p=e+o/2-r[1]*a;return{scaleX:s,scaleY:a,translateX:h,translateY:p}}lonLatToPixels(t){let e=this.lonLatToProjectedUnits(t);if(e)return this.projectedUnitsToPixels(e)}lonLatToProjectedUnits(t){let e=this.chart,i=e.mapTransforms;if(i){for(let r in i)if(Object.hasOwnProperty.call(i,r)&&i[r].hitZone){let n=e.transformFromLatLon(t,i[r]);if(n&&ut(n,i[r].hitZone.coordinates[0]))return n}return e.transformFromLatLon(t,i.default)}for(let r of this.insets)if(r.options.geoBounds&&ut({x:t.lon,y:t.lat},r.options.geoBounds.coordinates[0])){let n=r.projection.forward([t.lon,t.lat]),s=r.projectedUnitsToPixels({x:n[0],y:n[1]});return this.pixelsToProjectedUnits(s)}let o=this.projection.forward([t.lon,t.lat]);if(!o.outside)return{x:o[0],y:o[1]}}pixelsToLonLat(t){return this.projectedUnitsToLonLat(this.pixelsToProjectedUnits(t))}pixelsToProjectedUnits(t){let{x:e,y:i}=t,o=this.getScale(),r=this.projection.forward(this.center),n=this.playingField,s=n.x+n.width/2,a=n.y+n.height/2;return{x:r[0]+(e-s)/o,y:r[1]-(i-a)/o}}projectedUnitsToLonLat(t){let e=this.chart,i=e.mapTransforms;if(i){for(let n in i)if(Object.hasOwnProperty.call(i,n)&&i[n].hitZone&&ut(t,i[n].hitZone.coordinates[0]))return e.transformToLatLon(t,i[n]);return e.transformToLatLon(t,i.default)}let o=this.projectedUnitsToPixels(t);for(let n of this.insets)if(n.hitZone&&ut(o,n.hitZone.coordinates[0])){let s=n.pixelsToProjectedUnits(o),a=n.projection.inverse([s.x,s.y]);return{lon:a[0],lat:a[1]}}let r=this.projection.inverse([t.x,t.y]);return{lon:r[0],lat:r[1]}}projectedUnitsToPixels(t){let e=this.getScale(),i=this.projection.forward(this.center),o=this.playingField,r=o.x+o.width/2,n=o.y+o.height/2;return{x:r-e*(i[0]-t.x),y:n+e*(i[1]-t.y)}}recommendMapView(t,e,i=!1){this.recommendedMapView={};let o=e.map(s=>this.getGeoMap(s)),r=[];o.forEach(s=>{if(s&&(Object.keys(this.recommendedMapView).length||(this.recommendedMapView=s["hc-recommended-mapview"]||{}),s.bbox)){let[a,h,p,d]=s.bbox;r.push({x1:a,y1:h,x2:p,y2:d})}});let n=r.length&&G.compositeBounds(r);Je(this,"onRecommendMapView",{geoBounds:n,chart:t},function(){if(n&&this.recommendedMapView){if(!this.recommendedMapView.projection){let{x1:s,y1:a,x2:h,y2:p}=n;this.recommendedMapView.projection=h-s>180&&p-a>90?{name:"EqualEarth",parallels:[0,0],rotation:[0]}:{name:"LambertConformalConic",parallels:[a,p],rotation:[-(s+h)/2]}}this.recommendedMapView.insets||(this.recommendedMapView.insets=void 0)}}),this.geoMap=o[0],i&&t.hasRendered&&!t.userOptions.mapView?.projection&&this.recommendedMapView&&this.update(this.recommendedMapView)}redraw(t){this.chart.series.forEach(e=>{e.useMapGeometry&&(e.isDirty=!0)}),this.chart.redraw(t)}setView(t,e,i=!0,o){t&&(this.center=t),typeof e=="number"&&(typeof this.minZoom=="number"&&(e=Math.max(e,this.minZoom)),typeof this.options.maxZoom=="number"&&(e=Math.min(e,this.options.maxZoom)),X(e)&&(this.zoom=e));let r=this.getProjectedBounds();if(r){let n=this.projection.forward(this.center),{x:s,y:a,width:h,height:p}=this.playingField,d=this.getScale(),c=this.projectedUnitsToPixels({x:r.x1,y:r.y1}),m=this.projectedUnitsToPixels({x:r.x2,y:r.y2}),y=[(r.x1+r.x2)/2,(r.y1+r.y2)/2];if(!this.chart.series.some(u=>u.isDrilling)){let u=c.x,f=m.y,g=m.x,b=c.y;g-u<h?n[0]=y[0]:u<s&&g<s+h?n[0]+=Math.max(u-s,g-h-s)/d:g>s+h&&u>s&&(n[0]+=Math.min(g-h-s,u-s)/d),b-f<p?n[1]=y[1]:f<a&&b<a+p?n[1]-=Math.max(f-a,b-p-a)/d:b>a+p&&f>a&&(n[1]-=Math.min(b-p-a,f-a)/d),this.center=this.projection.inverse(n)}this.insets.forEach(u=>{u.options.field&&(u.hitZone=u.getHitZone(),u.playingField=u.getField())}),this.render()}Je(this,"afterSetView"),i&&this.redraw(o)}setUpEvents(){let t,e,i,{chart:o}=this,r=n=>{let{lastTouches:s,pinchDown:a}=o.pointer,h=this.projection,p=n.touches,{mouseDownX:d,mouseDownY:c}=o,m=0;if(a?.length===1?(d=a[0].chartX,c=a[0].chartY):a?.length===2&&(d=(a[0].chartX+a[1].chartX)/2,c=(a[0].chartY+a[1].chartY)/2),p?.length===2&&s&&(m=Math.log(Math.sqrt(Math.pow(s[0].chartX-s[1].chartX,2)+Math.pow(s[0].chartY-s[1].chartY,2))/Math.sqrt(Math.pow(p[0].chartX-p[1].chartX,2)+Math.pow(p[0].chartY-p[1].chartY,2)))/Math.log(.5)),X(d)&&X(c)){let y=`${d},${c}`,{chartX:u,chartY:f}=n.originalEvent;p?.length===2&&(u=(p[0].chartX+p[1].chartX)/2,f=(p[0].chartY+p[1].chartY)/2),y!==e&&(e=y,t=this.projection.forward(this.center),i=(this.projection.options.rotation||[0,0]).slice());let g=h.def&&h.def.bounds,b=g&&Qe(g,this.playingField)||-1/0;if(h.options.name==="Orthographic"&&2>(p?.length||0)&&(this.minZoom||1/0)<1.3*b){let x=440/(this.getScale()*Math.min(o.plotWidth,o.plotHeight));if(i){let M=(d-u)*x-i[0],C=Ys(-i[1]-(c-f)*x,-80,80),T=this.zoom;this.update({projection:{rotation:[-M,-C]}},!1),this.fitToBounds(void 0,void 0,!1),this.zoom=T,o.redraw(!1)}}else if(X(u)&&X(f)){let x=this.getScale(),M=this.projection.hasCoordinates?1:-1,C=this.projection.inverse([t[0]+(d-u)/x,t[1]-(c-f)/x*M]);isNaN(C[0]+C[1])||this.zoomBy(m,C,void 0,!1)}n.preventDefault()}};U(o,"pan",r),U(o,"touchpan",r),U(o,"selection",n=>{if(n.resetSelection)this.zoomBy();else{let s=n.x-o.plotLeft,a=n.y-o.plotTop,{y:h,x:p}=this.pixelsToProjectedUnits({x:s,y:a}),{y:d,x:c}=this.pixelsToProjectedUnits({x:s+n.width,y:a+n.height});this.fitToBounds({x1:p,y1:h,x2:c,y2:d},void 0,!0,!n.originalEvent.touches&&void 0),/^touch/.test(n.originalEvent.type)||o.showResetZoom(),n.preventDefault()}})}render(){this.group||(this.group=this.chart.renderer.g("map-view").attr({zIndex:4}).add())}update(t,e=!0,i){let o=t.projection,r=o&&ct.toString(o)!==ct.toString(this.options.projection),n=!1;R(!0,this.userOptions,t),R(!0,this.options,t),"insets"in t&&(this.insets.forEach(s=>s.destroy()),this.insets.length=0,n=!0),(r||"fitToGeometry"in t)&&delete this.fitToGeometryCache,(r||n)&&(this.chart.series.forEach(s=>{let a=s.transformGroups;if(s.clearBounds&&s.clearBounds(),s.isDirty=!0,s.isDirtyData=!0,n&&a)for(;a.length>1;){let h=a.pop();h&&h.destroy()}}),r&&(this.projection=new ct(this.options.projection)),n&&this.createInsets(),!t.center&&Object.hasOwnProperty.call(t,"zoom")&&!X(t.zoom)&&this.fitToBounds(void 0,void 0,!1)),t.center||X(t.zoom)?this.setView(this.options.center,t.zoom,!1):"fitToGeometry"in t&&this.fitToBounds(void 0,void 0,!1),e&&this.chart.redraw(i)}zoomBy(t,e,i,o){let r=this.chart,n=this.projection.forward(this.center);if(typeof t=="number"){let s,a,h,p=this.zoom+t;if(i){let[d,c]=i,m=this.getScale(),y=d-r.plotLeft-r.plotWidth/2,u=c-r.plotTop-r.plotHeight/2;a=n[0]+y/m,h=n[1]+u/m}if(typeof a=="number"&&typeof h=="number"){let d=1-Math.pow(2,this.zoom)/Math.pow(2,p),c=n[0]-a,m=n[1]-h;n[0]-=c*d,n[1]+=m*d,s=this.projection.inverse(n)}this.setView(e||s,p,void 0,o)}else this.fitToBounds(void 0,void 0,void 0,o)}}class ei extends G{constructor(t,e){if(super(t.chart,e),this.id=e.id,this.mapView=t,this.options=R({center:[0,0]},t.options.insetOptions,e),this.allBounds=[],this.options.geoBounds){let i=t.projection.path(this.options.geoBounds);this.geoBoundsProjectedBox=$e(i),this.geoBoundsProjectedPolygon=i.map(o=>[o[1]||0,o[2]||0])}}getField(t=!0){let e=this.hitZone;if(e){let i=t?this.padding:[0,0,0,0],o=e.coordinates[0],r=o.map(d=>d[0]),n=o.map(d=>d[1]),s=Math.min.apply(0,r)+i[3],a=Math.max.apply(0,r)-i[1],h=Math.min.apply(0,n)+i[0],p=Math.max.apply(0,n)-i[2];if(X(s)&&X(h))return{x:s,y:h,width:a-s,height:p-h}}return super.getField.call(this,t)}getHitZone(){let{chart:t,mapView:e,options:i}=this,{coordinates:o}=i.field||{};if(o){let r=o[0];if(i.units==="percent"){let n=i.relativeTo==="mapBoundingBox"&&e.getMapBBox()||R(t.plotBox,{x:0,y:0});r=r.map(s=>[H(`${s[0]}%`,n.width,n.x),H(`${s[1]}%`,n.height,n.y)])}return{type:"Polygon",coordinates:[r]}}}getProjectedBounds(){return G.compositeBounds(this.allBounds)}isInside(t){let{geoBoundsProjectedBox:e,geoBoundsProjectedPolygon:i}=this;return!!(e&&t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2&&i&&ut(t,i))}render(){let{chart:t,mapView:e,options:i}=this,o=i.borderPath||i.field;if(o&&e.group){let r=!0;this.border||(this.border=t.renderer.path().addClass("highcharts-mapview-inset-border").add(e.group),r=!1),t.styledMode||this.border.attr({stroke:i.borderColor,"stroke-width":i.borderWidth});let n=this.border.strokeWidth(),s=i.relativeTo==="mapBoundingBox"&&e.getMapBBox()||e.playingField,a=(o.coordinates||[]).reduce((h,p)=>p.reduce((d,c,m)=>{let[y,u]=c;return i.units==="percent"&&(y=t.plotLeft+H(`${y}%`,s.width,s.x),u=t.plotTop+H(`${u}%`,s.height,s.y)),y=qe(y,n),u=qe(u,n),d.push(m===0?["M",y,u]:["L",y,u]),d},h),[]);this.border[r?"animate":"attr"]({d:a})}}destroy(){this.border&&(this.border=this.border.destroy()),this.eventsToUnbind.forEach(t=>t())}setUpEvents(){}}let{animObject:ii,stop:_s}=v(),{noop:Nt}=v(),{splitPath:Ks}=zt,{column:si,scatter:oi}=I().seriesTypes,{extend:$s,find:qs,fireEvent:ri,getNestedProperty:ai,isArray:pe,defined:ni,isNumber:O,isObject:Js,merge:gt,objectEach:Qs,pick:de,splat:to}=v();class ft extends oi{constructor(){super(...arguments),this.processedData=[]}animate(t){let{chart:e,group:i}=this,o=ii(this.options.animation);t?i.attr({translateX:e.plotLeft+e.plotWidth/2,translateY:e.plotTop+e.plotHeight/2,scaleX:.001,scaleY:.001}):i.animate({translateX:e.plotLeft,translateY:e.plotTop,scaleX:1,scaleY:1},o)}clearBounds(){this.points.forEach(t=>{delete t.bounds,delete t.insetIndex,delete t.projectedPath}),delete this.bounds}doFullTranslate(){return!!(this.isDirtyData||this.chart.isResizing||!this.hasRendered)}drawMapDataLabels(){super.drawDataLabels(),this.dataLabelsGroups?.forEach(t=>t?.clip(this.chart.clipRect))}drawPoints(){let t=this,{chart:e,group:i,transformGroups:o=[]}=this,{mapView:r,renderer:n}=e;if(r){this.transformGroups=o,o[0]||(o[0]=n.g().add(i));for(let s=0,a=r.insets.length;s<a;++s)o[s+1]||o.push(n.g().add(i));this.doFullTranslate()&&(this.points.forEach(s=>{let{graphic:a}=s;s.group=o[typeof s.insetIndex=="number"?s.insetIndex+1:0],a&&a.parentGroup!==s.group&&a.add(s.group)}),si.prototype.drawPoints.apply(this),this.points.forEach(s=>{let a=s.graphic;if(a){let h=a.animate,p="";s.name&&(p+="highcharts-name-"+s.name.replace(/ /g,"-").toLowerCase()),s.properties?.["hc-key"]&&(p+=" highcharts-key-"+s.properties["hc-key"].toString().toLowerCase()),p&&a.addClass(p),e.styledMode&&a.css(this.pointAttribs(s,s.selected&&"select"||void 0)),a.attr({visibility:!s.visible&&(s.visible||s.isNull)?"hidden":"inherit"}),a.animate=function(d,c,m){let y=O(d["stroke-width"])&&!O(a["stroke-width"]),u=O(a["stroke-width"])&&!O(d["stroke-width"]);if(y||u){let f=de(t.getStrokeWidth(t.options),1)/(e.mapView?.getScale()||1);y&&(a["stroke-width"]=f),u&&(d["stroke-width"]=f)}return h.call(a,d,c,u?function(){a.element.removeAttribute("stroke-width"),delete a["stroke-width"],m&&m.apply(this,arguments)}:m)}}})),o.forEach((s,a)=>{let h=(a===0?r:r.insets[a-1]).getSVGTransform(),p=de(this.getStrokeWidth(this.options),1),d=h.scaleX,c=h.scaleY>0?1:-1,m=y=>{(t.points||[]).forEach(u=>{let f,g=u.graphic;g?.["stroke-width"]&&(f=this.getStrokeWidth(u.options))&&g.attr({"stroke-width":f/y})})};if(n.globalAnimation&&e.hasRendered&&r.allowTransformAnimation){let y=Number(s.attr("translateX")),u=Number(s.attr("translateY")),f=Number(s.attr("scaleX")),g=(M,C)=>{let T=f+(d-f)*C.pos;s.attr({translateX:y+(h.translateX-y)*C.pos,translateY:u+(h.translateY-u)*C.pos,scaleX:T,scaleY:T*c,"stroke-width":p/T}),m(T)},b=gt(ii(n.globalAnimation)),x=b.step;b.step=function(){x&&x.apply(this,arguments),g.apply(this,arguments)},s.attr({animator:0}).animate({animator:1},b,function(){typeof n.globalAnimation!="boolean"&&n.globalAnimation.complete&&n.globalAnimation.complete({applyDrilldown:!0}),ri(this,"mapZoomComplete")}.bind(this))}else _s(s),s.attr(gt(h,{"stroke-width":p/d})),m(d)}),this.isDrilling||this.drawMapDataLabels()}}getProjectedBounds(){if(!this.bounds&&this.chart.mapView){let{insets:t,projection:e}=this.chart.mapView,i=[];(this.points||[]).forEach(o=>{if(o.path||o.geometry){if(typeof o.path=="string"?o.path=Ks(o.path):pe(o.path)&&o.path[0]==="M"&&(o.path=this.chart.renderer.pathToSegments(o.path)),!o.bounds){let r=o.getProjectedBounds(e);if(r){o.labelrank=de(o.labelrank,(r.x2-r.x1)*(r.y2-r.y1));let{midX:n,midY:s}=r;if(t&&O(n)&&O(s)){let a=qs(t,h=>h.isInside({x:n,y:s}));a&&(delete o.projectedPath,(r=o.getProjectedBounds(a.projection))&&a.allBounds.push(r),o.insetIndex=t.indexOf(a))}o.bounds=r}}o.bounds&&o.insetIndex===void 0&&i.push(o.bounds)}}),this.bounds=G.compositeBounds(i)}return this.bounds}getStrokeWidth(t){let e=this.pointAttrToOptions;return t[e?.["stroke-width"]||"borderWidth"]}hasData(){return!!this.dataTable.rowCount}pointAttribs(t,e){let{mapView:i,styledMode:o}=t.series.chart,r=o?this.colorAttribs(t):si.prototype.pointAttribs.call(this,t,e),n=this.getStrokeWidth(t.options);if(e){let a=gt(this.options.states?.[e],t.options.states?.[e]||{}),h=this.getStrokeWidth(a);ni(h)&&(n=h),r.stroke=a.borderColor??t.color}n&&i&&(n/=i.getScale());let s=this.getStrokeWidth(this.options);return r.dashstyle&&i&&O(s)&&(n=s/i.getScale()),t.visible||(r.fill=this.options.nullColor),t.isNull&&this.options.nullInteraction&&(r.opacity=1),ni(n)?r["stroke-width"]=n:delete r["stroke-width"],r["stroke-linecap"]=r["stroke-linejoin"]=this.options.linecap,r}updateData(){return!this.processedData&&super.updateData.apply(this,arguments)}setData(t,e=!0,i,o){delete this.bounds,super.setData(t,!1,void 0,o),this.processData(),this.generatePoints(),e&&this.chart.redraw(i)}dataColumnKeys(){return this.pointArrayMap}processData(){let t,e,i,o=this.options,r=o.data,n=this.chart,s=n.options.chart,a=this.joinBy,h=o.keys||this.pointArrayMap,p=[],d={},c=this.chart.mapView,m=c&&(Js(o.mapData,!0)?c.getGeoMap(o.mapData):c.geoMap),y=n.mapTransforms=s.mapTransforms||m?.["hc-transform"]||n.mapTransforms;y&&Qs(y,f=>{f.rotation&&(f.cosAngle=Math.cos(f.rotation),f.sinAngle=Math.sin(f.rotation))}),pe(o.mapData)?i=o.mapData:m&&m.type==="FeatureCollection"&&(this.mapTitle=m.title,i=v().geojson(m,this.type,this)),this.processedData=[];let u=this.processedData;if(r){let f;for(let g=0,b=r.length;g<b;++g){if(O(f=r[g]))u[g]={value:f};else if(pe(f)){let x=0;u[g]={},!o.keys&&f.length>h.length&&typeof f[0]=="string"&&(u[g]["hc-key"]=f[0],++x);for(let M=0;M<h.length;++M,++x)h[M]&&f[x]!==void 0&&(h[M].indexOf(".")>0?it.prototype.setNestedProperty(u[g],f[x],h[M]):u[g][h[M]]=f[x])}else u[g]=r[g];a&&a[0]==="_i"&&(u[g]._i=g)}}if(i){this.mapData=i,this.mapMap={};for(let f=0;f<i.length;f++)e=(t=i[f]).properties,t._i=f,a[0]&&e&&e[a[0]]&&(t[a[0]]=e[a[0]]),d[t[a[0]]]=t;if(this.mapMap=d,a[1]){let f=a[1];u.forEach(g=>{let b=ai(f,g);d[b]&&p.push(d[b])})}if(o.allAreas){if(a[1]){let g=a[1];u.forEach(b=>{p.push(ai(g,b))})}let f="|"+p.map(function(g){return g&&g[a[0]]}).join("|")+"|";i.forEach(g=>{a[0]&&f.indexOf("|"+g[a[0]]+"|")!==-1||u.push(gt(g,{value:null}))})}}this.dataTable.rowCount=u.length}setOptions(t){let e=super.setOptions(t),i=e.joinBy;return e.joinBy===null&&(i="_i"),i&&(this.joinBy=to(i),this.joinBy[1]||(this.joinBy[1]=this.joinBy[0])),e}translate(){let t=this.doFullTranslate(),e=this.chart.mapView,i=e?.projection;if(this.chart.hasRendered&&(this.isDirtyData||!this.hasRendered)&&(this.processData(),this.generatePoints(),delete this.bounds,!e||e.userOptions.center||O(e.userOptions.zoom)||e.zoom!==e.minZoom?this.getProjectedBounds():e.fitToBounds(void 0,void 0,!1)),e){let o=e.getSVGTransform();this.points.forEach(r=>{let n=O(r.insetIndex)&&e.insets[r.insetIndex].getSVGTransform()||o;n&&r.bounds&&O(r.bounds.midX)&&O(r.bounds.midY)&&(r.plotX=r.bounds.midX*n.scaleX+n.translateX,r.plotY=r.bounds.midY*n.scaleY+n.translateY),t&&(r.shapeType="path",r.shapeArgs={d:it.getProjectedPath(r,i)}),!r.hiddenInDataClass&&(r.projectedPath&&!r.projectedPath.length?r.setVisible(!1):r.visible||r.setVisible(!0))})}ri(this,"afterTranslate")}update(t){t.mapData&&this.chart.mapView?.recommendMapView(this.chart,[this.chart.options.chart.map,...(this.chart.options.series||[]).map((e,i)=>i===this._i?t.mapData:e.mapData)],!0),super.update.apply(this,arguments)}}ft.defaultOptions=gt(oi.defaultOptions,{affectsMapView:!0,animation:!1,dataLabels:{crop:!1,formatter:function(){let{numberFormatter:l}=this.series.chart,{value:t}=this.point;return Ts(t)?l(t,-1):this.point.name||""},inside:!0,overflow:!1,padding:0,verticalAlign:"middle"},linecap:"round",marker:null,nullColor:"#f7f7f7",stickyTracking:!1,tooltip:{followPointer:!0,pointFormat:"{point.name}: {point.value}<br/>"},turboThreshold:0,allAreas:!0,borderColor:"#e6e6e6",borderWidth:1,joinBy:"hc-key",states:{hover:{halo:void 0,borderColor:"#666666",borderWidth:2},normal:{animation:!0},select:{color:"#cccccc"}},legendSymbol:"rectangle"}),$s(ft.prototype,{type:"map",axisTypes:B.seriesMembers.axisTypes,colorAttribs:B.seriesMembers.colorAttribs,colorKey:B.seriesMembers.colorKey,directTouch:!0,drawDataLabels:Nt,drawGraph:Nt,forceDL:!0,getCenter:ys.getCenter,getExtremesFromAll:!0,getSymbol:Nt,isCartesian:!1,parallelArrays:B.seriesMembers.parallelArrays,pointArrayMap:B.seriesMembers.pointArrayMap,pointClass:it,preserveAspectRatio:!0,searchPoint:Nt,trackerGroups:B.seriesMembers.trackerGroups,useMapGeometry:!0}),B.compose(ft),I().registerSeriesType("map",ft);let li=ft,{extend:eo,merge:io}=v();class ce extends li{pointAttribs(t,e){let i=super.pointAttribs(t,e);return i.fill=this.options.fillColor,i}}ce.defaultOptions=io(li.defaultOptions,{lineWidth:1,fillColor:"none",legendSymbol:"lineMarker"}),eo(ce.prototype,{type:"mapline",colorProp:"stroke",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"}}),I().registerSeriesType("mapline",ce);let{scatter:so}=I().seriesTypes,{isNumber:Xt}=v();class oo extends so.prototype.pointClass{isValid(){return!!(this.options.geometry||Xt(this.x)&&Xt(this.y)||Xt(this.options.lon)&&Xt(this.options.lat))}}P(632);let{noop:ro}=v(),{map:ao,scatter:hi}=I().seriesTypes,{extend:no,fireEvent:lo,isNumber:Z,merge:ho}=v();class ue extends hi{constructor(){super(...arguments),this.clearBounds=ao.prototype.clearBounds}drawDataLabels(){super.drawDataLabels(),this.dataLabelsGroups?.forEach(t=>{t?.clip(this.chart.clipRect)})}projectPoint(t){let e=this.chart.mapView;if(e){let{geometry:i,lon:o,lat:r}=t,n=i&&i.type==="Point"&&i.coordinates;if(Z(o)&&Z(r)&&(n=[o,r]),n)return e.lonLatToProjectedUnits({lon:n[0],lat:n[1]})}}translate(){let t=this.chart.mapView;if(this.generatePoints(),this.getProjectedBounds&&this.isDirtyData&&(delete this.bounds,this.getProjectedBounds()),t){let e=t.getSVGTransform(),{hasCoordinates:i}=t.projection;this.points.forEach(o=>{let r,{x:n,y:s}=o,a=Z(o.insetIndex)&&t.insets[o.insetIndex].getSVGTransform()||e,h=this.projectPoint(o.options)||o.properties&&this.projectPoint(o.properties);if(h?(n=h.x,s=h.y):o.bounds&&(n=o.bounds.midX,s=o.bounds.midY,a&&Z(n)&&Z(s)&&(o.plotX=n*a.scaleX+a.translateX,o.plotY=s*a.scaleY+a.translateY,r=!0)),Z(n)&&Z(s)){if(!r){let p=t.projectedUnitsToPixels({x:n,y:s});o.plotX=p.x,o.plotY=i?p.y:this.chart.plotHeight-p.y}}else o.y=o.plotX=o.plotY=void 0;o.isInside=this.isPointInside(o),o.zone=this.zones.length?o.getZone():void 0})}lo(this,"afterTranslate")}}ue.defaultOptions=ho(hi.defaultOptions,{dataLabels:{crop:!1,defer:!1,enabled:!0,formatter:function(){return this.point.name},overflow:!1,style:{color:"#000000"}},legendSymbol:"lineMarker",stickyTracking:!0,tooltip:{pointFormat:"{#if point.name}{point.name}{else}Lat: {point.lat}, Lon: {point.lon}{/if}"}}),ne().prototype.symbols.mapmarker=(l,t,e,i,o)=>{let r,n,s=o&&o.context==="legend";s?(r=l+e/2,n=t+i):o&&typeof o.anchorX=="number"&&typeof o.anchorY=="number"?(r=o.anchorX,n=o.anchorY):(r=l+e/2,n=t+i/2,t-=i);let a=s?i/3:i/2;return[["M",r,n],["C",r,n,r-a,t+1.5*a,r-a,t+a],["A",a,a,1,1,1,r+a,t+a],["C",r+a,t+1.5*a,r,n,r,n],["Z"]]},no(ue.prototype,{type:"mappoint",axisTypes:["colorAxis"],forceDL:!0,isCartesian:!1,pointClass:oo,searchPoint:ro,useMapGeometry:!0}),I().registerSeriesType("mappoint",ue);let po={borderColor:void 0,borderWidth:2,className:void 0,color:void 0,connectorClassName:void 0,connectorColor:void 0,connectorDistance:60,connectorWidth:1,enabled:!1,labels:{className:void 0,allowOverlap:!1,format:"",formatter:void 0,align:"right",style:{fontSize:"0.9em",color:"#000000"},x:0,y:0},maxSize:60,minSize:10,legendIndex:0,ranges:{value:void 0,borderColor:void 0,color:void 0,connectorColor:void 0},sizeBy:"area",sizeByAbsoluteValue:!1,zIndex:1,zThreshold:0},{noop:co}=v(),{arrayMax:uo,arrayMin:mo,isNumber:pi,merge:yt,pick:bt,stableSort:go}=v(),fo=class{constructor(l,t){this.setState=co,this.init(l,t)}init(l,t){this.options=l,this.visible=!0,this.chart=t.chart,this.legend=t}addToLegend(l){l.splice(this.options.legendIndex,0,this)}drawLegendSymbol(l){let t,e=bt(l.options.itemDistance,20),i=this.legendItem||{},o=this.options,r=o.ranges,n=o.connectorDistance;if(!r||!r.length||!pi(r[0].value)){l.options.bubbleLegend.autoRanges=!0;return}go(r,function(p,d){return d.value-p.value}),this.ranges=r,this.setOptions(),this.render();let s=this.getMaxLabelSize(),a=this.ranges[0].radius,h=2*a;t=(t=n-a+s.width)>0?t:0,this.maxLabel=s,this.movementX=o.labels.align==="left"?t:0,i.labelWidth=h+t+e,i.labelHeight=h+s.height/2}setOptions(){let l=this.ranges,t=this.options,e=this.chart.series[t.seriesIndex],i=this.legend.baseline,o={zIndex:t.zIndex,"stroke-width":t.borderWidth},r={zIndex:t.zIndex,"stroke-width":t.connectorWidth},n={align:this.legend.options.rtl||t.labels.align==="left"?"right":"left",zIndex:t.zIndex},s=e.options.marker.fillOpacity,a=this.chart.styledMode;l.forEach(function(h,p){a||(o.stroke=bt(h.borderColor,t.borderColor,e.color),o.fill=h.color||t.color,o.fill||(o.fill=e.color,o["fill-opacity"]=s??1),r.stroke=bt(h.connectorColor,t.connectorColor,e.color)),l[p].radius=this.getRangeRadius(h.value),l[p]=yt(l[p],{center:l[0].radius-l[p].radius+i}),a||yt(!0,l[p],{bubbleAttribs:yt(o),connectorAttribs:yt(r),labelAttribs:n})},this)}getRangeRadius(l){let t=this.options,e=this.options.seriesIndex,i=this.chart.series[e],o=t.ranges[0].value,r=t.ranges[t.ranges.length-1].value,n=t.minSize,s=t.maxSize;return i.getRadius.call(this,r,o,n,s,l)}render(){let l=this.legendItem||{},t=this.chart.renderer,e=this.options.zThreshold;for(let i of(this.symbols||(this.symbols={connectors:[],bubbleItems:[],labels:[]}),l.symbol=t.g("bubble-legend"),l.label=t.g("bubble-legend-item").css(this.legend.itemStyle||{}),l.symbol.translateX=0,l.symbol.translateY=0,l.symbol.add(l.label),l.label.add(l.group),this.ranges))i.value>=e&&this.renderRange(i);this.hideOverlappingLabels()}renderRange(l){let t=this.ranges[0],e=this.legend,i=this.options,o=i.labels,r=this.chart,n=r.series[i.seriesIndex],s=r.renderer,a=this.symbols,h=a.labels,p=l.center,d=Math.abs(l.radius),c=i.connectorDistance||0,m=o.align,y=e.options.rtl,u=i.borderWidth,f=i.connectorWidth,g=t.radius||0,b=p-d-u/2+f/2,x=(b%1?1:.5)-(f%2?0:.5),M=s.styledMode,C=y||m==="left"?-c:c;m==="center"&&(C=0,i.connectorDistance=0,l.labelAttribs.align="center"),a.bubbleItems.push(s.circle(g,p+x,d).attr(M?{}:l.bubbleAttribs).addClass((M?"highcharts-color-"+n.colorIndex+" ":"")+"highcharts-bubble-legend-symbol "+(i.className||"")).add(this.legendItem.symbol)),a.connectors.push(s.path(s.crispLine([["M",g,b],["L",g+C,b]],i.connectorWidth)).attr(M?{}:l.connectorAttribs).addClass((M?"highcharts-color-"+this.options.seriesIndex+" ":"")+"highcharts-bubble-legend-connectors "+(i.connectorClassName||"")).add(this.legendItem.symbol));let T=s.text(this.formatLabel(l)).attr(M?{}:l.labelAttribs).css(M?{}:o.style).addClass("highcharts-bubble-legend-labels "+(i.labels.className||"")).add(this.legendItem.symbol),k={x:g+C+i.labels.x,y:b+i.labels.y+.4*T.getBBox().height};T.attr(k),h.push(T),T.placed=!0,T.alignAttr=k}getMaxLabelSize(){let l,t;return this.symbols.labels.forEach(function(e){t=e.getBBox(!0),l=l?t.width>l.width?t:l:t}),l||{}}formatLabel(l){let t=this.options,e=t.labels.formatter,i=t.labels.format,{numberFormatter:o}=this.chart;return i?Re().format(i,l,this.chart):e?e.call(l):o(l.value,1)}hideOverlappingLabels(){let l=this.chart,t=this.options.labels.allowOverlap,e=this.symbols;!t&&e&&(l.hideOverlappingLabels(e.labels),e.labels.forEach(function(i,o){i.newOpacity?i.newOpacity!==i.oldOpacity&&e.connectors[o].show():e.connectors[o].hide()}))}getRanges(){let l=this.legend.bubbleLegend,t=l.chart.series,e=l.options.ranges,i,o,r=Number.MAX_VALUE,n=-Number.MAX_VALUE;return t.forEach(function(s){s.isBubble&&!s.ignoreSeries&&(o=s.getColumn("z").filter(pi)).length&&(r=bt(s.options.zMin,Math.min(r,Math.max(mo(o),s.options.displayNegative===!1?s.options.zThreshold:-Number.MAX_VALUE))),n=bt(s.options.zMax,Math.max(n,uo(o))))}),i=r===n?[{value:n}]:[{value:r},{value:(r+n)/2},{value:n,autoRanges:!0}],e.length&&e[0].radius&&i.reverse(),i.forEach(function(s,a){e&&e[a]&&(i[a]=yt(e[a],s))}),i}predictBubbleSizes(){let l=this.chart,t=l.legend.options,e=t.floating,i=t.layout==="horizontal",o=i?l.legend.lastLineHeight:0,r=l.plotSizeX,n=l.plotSizeY,s=l.series[this.options.seriesIndex],a=s.getPxExtremes(),h=Math.ceil(a.minPxSize),p=Math.ceil(a.maxPxSize),d=Math.min(n,r),c,m=s.options.maxSize;return e||!/%$/.test(m)?c=p:(c=(d+o)*(m=parseFloat(m))/100/(m/100+1),(i&&n-c>=r||!i&&r-c>=n)&&(c=p)),[h,Math.ceil(c)]}updateRanges(l,t){let e=this.legend.options.bubbleLegend;e.minSize=l,e.maxSize=t,e.ranges=this.getRanges()}correctSizes(){let l=this.legend,t=this.chart.series[this.options.seriesIndex].getPxExtremes();Math.abs(Math.ceil(t.maxPxSize)-this.options.maxSize)>1&&(this.updateRanges(this.options.minSize,t.maxPxSize),l.render())}},{setOptions:yo}=v(),{composed:bo}=v(),{addEvent:di,objectEach:xo,pushUnique:Mo,wrap:vo}=v();function wo(l,t,e){let i,o,r,n=this.legend,s=me(this)>=0;n&&n.options.enabled&&n.bubbleLegend&&n.options.bubbleLegend.autoRanges&&s?(i=n.bubbleLegend.options,o=n.bubbleLegend.predictBubbleSizes(),n.bubbleLegend.updateRanges(o[0],o[1]),i.placed||(n.group.placed=!1,n.allItems.forEach(a=>{(r=a.legendItem||{}).group&&(r.group.translateY=void 0)})),n.render(),i.placed||(this.getMargins(),this.axes.forEach(a=>{a.setScale(),a.updateNames(),xo(a.ticks,function(h){h.isNew=!0,h.isNewLabel=!0})}),this.getMargins()),i.placed=!0,l.call(this,t,e),n.bubbleLegend.correctSizes(),ui(n,ci(n))):(l.call(this,t,e),n&&n.options.enabled&&n.bubbleLegend&&(n.render(),ui(n,ci(n))))}function me(l){let t=l.series,e=0;for(;e<t.length;){if(t[e]&&t[e].isBubble&&t[e].visible&&t[e].dataTable.rowCount)return e;e++}return-1}function ci(l){let t=l.allItems,e=[],i=t.length,o,r,n,s=0,a=0;for(s=0;s<i;s++)if(r=t[s].legendItem||{},n=(t[s+1]||{}).legendItem||{},r.labelHeight&&(t[s].itemHeight=r.labelHeight),t[s]===t[i-1]||r.y!==n.y){for(e.push({height:0}),o=e[e.length-1];a<=s;a++)t[a].itemHeight>o.height&&(o.height=t[a].itemHeight);o.step=s}return e}function Co(l){let t=this.bubbleLegend,e=this.options,i=e.bubbleLegend,o=me(this.chart);t&&t.ranges&&t.ranges.length&&(i.ranges.length&&(i.autoRanges=!!i.ranges[0].autoRanges),this.destroyItem(t)),o>=0&&e.enabled&&i.enabled&&(i.seriesIndex=o,this.bubbleLegend=new fo(i,this),this.bubbleLegend.addToLegend(l.allItems))}function Po(l){let t;if(l.defaultPrevented)return!1;let e=l.legendItem,i=this.chart,o=e.visible;this&&this.bubbleLegend&&(e.visible=!o,e.ignoreSeries=o,t=me(i)>=0,this.bubbleLegend.visible!==t&&(this.update({bubbleLegend:{enabled:t}}),this.bubbleLegend.visible=t),e.visible=o)}function ui(l,t){let e=l.allItems,i=l.options.rtl,o,r,n,s,a=0;e.forEach((h,p)=>{(s=h.legendItem||{}).group&&(o=s.group.translateX||0,r=s.y||0,((n=h.movementX)||i&&h.ranges)&&(n=i?o-h.options.maxSize/2:o+n,s.group.attr({translateX:n})),p>t[a].step&&a++,s.group.attr({translateY:Math.round(r+t[a].height/2)}),s.y=r+t[a].height/2)})}let To=function(l,t){Mo(bo,"Series.BubbleLegend")&&(yo({legend:{bubbleLegend:po}}),vo(l.prototype,"drawChartBox",wo),di(t,"afterGetAllItems",Co),di(t,"itemClick",Po))};var Lo=P(260),Ao=P.n(Lo);let{seriesTypes:{scatter:{prototype:{pointClass:ko}}}}=I(),{extend:jo}=v();class mi extends ko{haloPath(t){let e=(t&&this.marker&&this.marker.radius||0)+t;if(this.series.chart.inverted){let i=this.pos()||[0,0],{xAxis:o,yAxis:r,chart:n}=this.series,s=2*e;return n.renderer.symbols.circle((o?.len||0)-i[1]-e,(r?.len||0)-i[0]-e,s,s)}return Ao().prototype.haloPath.call(this,e)}}jo(mi.prototype,{ttBelow:!1});let gi=mi,{composed:So,noop:ge}=v(),{series:zo,seriesTypes:{column:{prototype:Io},scatter:fi}}=I(),{addEvent:Gt,arrayMax:Bo,arrayMin:Eo,clamp:Do,extend:fe,isNumber:_,merge:Oo,pick:K,pushUnique:Vo}=v();function No(){let l=this.len,{coll:t,isXAxis:e,min:i}=this,o=(this.max||0)-(i||0),r=0,n=l,s=l/o,a;(t==="xAxis"||t==="yAxis")&&(this.series.forEach(h=>{if(h.bubblePadding&&h.reserveSpace()){this.allowZoomOutside=!0,a=!0;let p=h.getColumn(e?"x":"y");if(e&&((h.onPoint||h).getRadii(0,0,h),h.onPoint&&(h.radii=h.onPoint.radii)),o>0){let d=p.length;for(;d--;)if(_(p[d])&&this.dataMin<=p[d]&&p[d]<=this.max){let c=h.radii&&h.radii[d]||0;r=Math.min((p[d]-i)*s-c,r),n=Math.max((p[d]-i)*s+c,n)}}}}),a&&o>0&&!this.logarithmic&&(n-=l,s*=(l+Math.max(0,r)-Math.min(n,l))/l,[["min","userMin",r],["max","userMax",n]].forEach(h=>{K(this.options[h[0]],this[h[1]])===void 0&&(this[h[0]]+=h[2]/s)})))}function Xo(){let{ticks:l,tickPositions:t,dataMin:e=0,dataMax:i=0,categories:o}=this,r=this.options.type;if((o?.length||r==="category")&&this.series.find(n=>n.bubblePadding)){let n=t.length;for(;n--;){let s=l[t[n]],a=s.pos||0;(a>i||a<e)&&s.label?.hide()}}}class rt extends fi{static compose(t,e,i){To(e,i),Vo(So,"Series.Bubble")&&(Gt(t,"foundExtremes",No),Gt(t,"afterRender",Xo))}animate(t){!t&&this.points.length<this.options.animationLimit&&this.points.forEach(function(e){let{graphic:i,plotX:o=0,plotY:r=0}=e;i&&i.width&&(this.hasRendered||i.attr({x:o,y:r,width:1,height:1}),i.animate(this.markerAttribs(e),this.options.animation))},this)}getRadii(){let t=this.getColumn("z"),e=this.getColumn("y"),i=[],o,r,n,s=this.chart.bubbleZExtremes,{minPxSize:a,maxPxSize:h}=this.getPxExtremes();if(!s){let p,d=Number.MAX_VALUE,c=-Number.MAX_VALUE;this.chart.series.forEach(m=>{if(m.bubblePadding&&m.reserveSpace()){let y=(m.onPoint||m).getZExtremes();y&&(d=Math.min(K(d,y.zMin),y.zMin),c=Math.max(K(c,y.zMax),y.zMax),p=!0)}}),p?(s={zMin:d,zMax:c},this.chart.bubbleZExtremes=s):s={zMin:0,zMax:0}}for(r=0,o=t.length;r<o;r++)n=t[r],i.push(this.getRadius(s.zMin,s.zMax,a,h,n,e&&e[r]));this.radii=i}getRadius(t,e,i,o,r,n){let s=this.options,a=s.sizeBy!=="width",h=s.zThreshold,p=e-t,d=.5;if(n===null||r===null)return null;if(_(r)){if(s.sizeByAbsoluteValue&&(r=Math.abs(r-h),e=p=Math.max(e-h,Math.abs(t-h)),t=0),r<t)return i/2-1;p>0&&(d=(r-t)/p)}return a&&d>=0&&(d=Math.sqrt(d)),Math.ceil(i+d*(o-i))/2}hasData(){return!!this.dataTable.rowCount}markerAttribs(t,e){let i=super.markerAttribs(t,e),{height:o=0,width:r=0}=i;return this.chart.inverted?fe(i,{x:(t.plotX||0)-r/2,y:(t.plotY||0)-o/2}):i}pointAttribs(t,e){let i=this.options.marker,o=i?.fillOpacity,r=zo.prototype.pointAttribs.call(this,t,e);return r["fill-opacity"]=o??1,r}translate(){super.translate.call(this),this.getRadii(),this.translateBubble()}translateBubble(){let{data:t,options:e,radii:i}=this,{minPxSize:o}=this.getPxExtremes(),r=t.length;for(;r--;){let n=t[r],s=i?i[r]:0;this.zoneAxis==="z"&&(n.negative=(n.z||0)<(e.zThreshold||0)),_(s)&&s>=o/2?(n.marker=fe(n.marker,{radius:s,width:2*s,height:2*s}),n.dlBox={x:n.plotX-s,y:n.plotY-s,width:2*s,height:2*s}):(n.shapeArgs=n.plotY=n.dlBox=void 0,n.isInside=!1)}}getPxExtremes(){let t=Math.min(this.chart.plotWidth,this.chart.plotHeight),e=r=>{let n;return typeof r=="string"&&(n=/%$/.test(r),r=parseInt(r,10)),n?t*r/100:r},i=e(K(this.options.minSize,8)),o=Math.max(e(K(this.options.maxSize,"20%")),i);return{minPxSize:i,maxPxSize:o}}getZExtremes(){let t=this.options,e=this.getColumn("z").filter(_);if(e.length){let i=K(t.zMin,Do(Eo(e),t.displayNegative===!1?t.zThreshold||0:-Number.MAX_VALUE,Number.MAX_VALUE)),o=K(t.zMax,Bo(e));if(_(i)&&_(o))return{zMin:i,zMax:o}}}searchKDTree(t,e,i,o=ge,r=ge){return o=(n,s,a)=>{let h=n[a]||0,p=s[a]||0,d,c=!1;return h===p?d=n.index>s.index?n:s:h<0&&p<0?(d=h-(n.marker?.radius||0)>=p-(s.marker?.radius||0)?n:s,c=!0):d=h<p?n:s,[d,c]},r=(n,s,a)=>!a&&n>s||n<s,super.searchKDTree(t,e,i,o,r)}}rt.defaultOptions=Oo(fi.defaultOptions,{dataLabels:{formatter:function(){let{numberFormatter:l}=this.series.chart,{z:t}=this.point;return _(t)?l(t,-1):""},inside:!0,verticalAlign:"middle"},animationLimit:250,marker:{lineColor:null,lineWidth:1,fillOpacity:.5,radius:null,states:{hover:{radiusPlus:0}},symbol:"circle"},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"}),fe(rt.prototype,{alignDataLabel:Io.alignDataLabel,applyZones:ge,bubblePadding:!0,isBubble:!0,keysAffectYAxis:["y"],pointArrayMap:["y","z"],pointClass:gi,parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],specialGroup:"group",zoneAxis:"z"}),Gt(rt,"updatedData",l=>{delete l.target.chart.bubbleZExtremes}),Gt(rt,"remove",l=>{delete l.target.chart.bubbleZExtremes}),I().registerSeriesType("bubble",rt);let yi=rt,{seriesTypes:{map:{prototype:{pointClass:{prototype:bi}}}}}=I(),{extend:Go}=v();class xi extends gi{isValid(){return typeof this.z=="number"}}Go(xi.prototype,{applyOptions:bi.applyOptions,getProjectedBounds:bi.getProjectedBounds});let{seriesTypes:{map:{prototype:at},mappoint:{prototype:Mi}}}=I(),{extend:Ro,merge:Yo}=v();class Rt extends yi{constructor(){super(...arguments),this.clearBounds=at.clearBounds}searchPoint(t,e){return this.searchKDTree({plotX:t.chartX-this.chart.plotLeft,plotY:t.chartY-this.chart.plotTop},e,t)}translate(){Mi.translate.call(this),this.getRadii(),this.translateBubble()}}Rt.defaultOptions=Yo(yi.defaultOptions,{lineWidth:0,animationLimit:500,joinBy:"hc-key",tooltip:{pointFormat:"{point.name}: {point.z}"},stickyTracking:!0}),Ro(Rt.prototype,{type:"mapbubble",axisTypes:["colorAxis"],getProjectedBounds:at.getProjectedBounds,isCartesian:!1,pointArrayMap:["z"],pointClass:xi,processData:at.processData,projectPoint:Mi.projectPoint,kdAxisArray:["plotX","plotY"],setData:at.setData,setOptions:at.setOptions,updateData:at.updateData,useMapGeometry:!0,xyFromShape:!0}),I().registerSeriesType("mapbubble",Rt);let{scatter:{prototype:{pointClass:Ho}}}=I().seriesTypes,{clamp:Yt,defined:Fo,extend:Wo,pick:Uo}=v();class vi extends Ho{applyOptions(t,e){return(this.isNull||this.value===null)&&delete this.color,super.applyOptions(t,e),this.formatPrefix=this.isNull||this.value===null?"null":"point",this}getCellAttributes(){let t=this.series,e=t.options,i=(e.colsize||1)/2,o=(e.rowsize||1)/2,r=t.xAxis,n=t.yAxis,s=this.options.marker||t.options.marker,a=t.pointPlacementToXValue(),h=Uo(this.pointPadding,e.pointPadding,0),p={x1:Yt(Math.round(r.len-r.translate(this.x-i,!1,!0,!1,!0,-a)),-r.len,2*r.len),x2:Yt(Math.round(r.len-r.translate(this.x+i,!1,!0,!1,!0,-a)),-r.len,2*r.len),y1:Yt(Math.round(n.translate(this.y-o,!1,!0,!1,!0)),-n.len,2*n.len),y2:Yt(Math.round(n.translate(this.y+o,!1,!0,!1,!0)),-n.len,2*n.len)};for(let d of[["width","x"],["height","y"]]){let c=d[0],m=d[1],y=m+"1",u=m+"2",f=Math.abs(p[y]-p[u]),g=s&&s.lineWidth||0,b=Math.abs(p[y]+p[u])/2,x=s&&s[c];if(Fo(x)&&x<f){let M=x/2+g/2;p[y]=b-M,p[u]=b+M}h&&((m==="x"&&r.reversed||m==="y"&&!n.reversed)&&(y=u,u=m+"1"),p[y]+=h,p[u]-=h)}return p}haloPath(t){if(!t)return[];let{x:e=0,y:i=0,width:o=0,height:r=0}=this.shapeArgs||{};return[["M",e-t,i-t],["L",e-t,i+r+t],["L",e+o+t,i+r+t],["L",e+o+t,i-t],["Z"]]}isValid(){return this.value!==1/0&&this.value!==-1/0}}Wo(vi.prototype,{dataLabelOnNull:!0,moveToTopOnHover:!0,ttBelow:!1});let{isNumber:Zo}=v(),{doc:_o}=v(),{defined:Ko,pick:wi}=v(),{series:nt,seriesTypes:{column:$o,scatter:Ci}}=I(),{prototype:{symbols:Ht}}=ne(),{addEvent:qo,extend:Jo,fireEvent:Qo,isNumber:Ft,merge:ye,pick:tr}=v(),{colorFromPoint:er,getContext:ir}={colorFromPoint:function(l,t){let e=t.series.colorAxis;if(e){let i=e.toColor(l||0,t).split(")")[0].split("(")[1].split(",").map(o=>wi(parseFloat(o),parseInt(o,10)));return i[3]=255*wi(i[3],1),Ko(l)&&t.visible||(i[3]=0),i}return[0,0,0,0]},getContext:function(l){let{canvas:t,context:e}=l;return t&&e?(e.clearRect(0,0,t.width,t.height),e):(l.canvas=_o.createElement("canvas"),l.context=l.canvas.getContext("2d",{willReadFrequently:!0})||void 0,l.context)}};class xt extends Ci{constructor(){super(...arguments),this.valueMax=NaN,this.valueMin=NaN,this.isDirtyCanvas=!0}drawPoints(){let t=this,e=t.options,i=e.interpolation,o=e.marker||{};if(i){let{image:r,chart:n,xAxis:s,yAxis:a}=t,{reversed:h=!1,len:p}=s,{reversed:d=!1,len:c}=a,m={width:p,height:c};if(!r||t.isDirtyData||t.isDirtyCanvas){let y=ir(t),{canvas:u,options:{colsize:f=1,rowsize:g=1},points:b,points:{length:x}}=t,M=n.colorAxis&&n.colorAxis[0];if(u&&y&&M){let{min:C,max:T}=s.getExtremes(),{min:k,max:D}=a.getExtremes(),L=T-C,z=D-k,S=Math.round(L/f/8*8),N=Math.round(z/g/8*8),[$,Mt]=[[S,S/L,h,"ceil"],[N,N/z,!d,"floor"]].map(([J,F,xe,Wt])=>xe?Me=>Math[Wt](J-F*Me):Me=>Math[Wt](F*Me)),q=u.width=S+1,vt=q*(u.height=N+1),be=(x-1)/vt,Pi=new Uint8ClampedArray(4*vt),or=(J,F)=>4*Math.ceil(q*Mt(F-k)+$(J-C));t.buildKDTree();for(let J=0;J<vt;J++){let F=b[Math.ceil(be*J)],{x:xe,y:Wt}=F;Pi.set(er(F.value,F),or(xe,Wt))}y.putImageData(new ImageData(Pi,q),0,0),r?r.attr(we(ve({},m),{href:u.toDataURL("image/png",1)})):(t.directTouch=!1,t.image=n.renderer.image(u.toDataURL("image/png",1)).attr(m).add(t.group))}t.isDirtyCanvas=!1}else(r.width!==p||r.height!==c)&&r.attr(m)}else(o.enabled||t._hasPointMarkers)&&(nt.prototype.drawPoints.call(t),t.points.forEach(r=>{r.graphic&&(r.graphic[t.chart.styledMode?"css":"animate"](t.colorAttribs(r)),r.value===null&&r.graphic.addClass("highcharts-null-point"))}))}getExtremes(){let{dataMin:t,dataMax:e}=nt.prototype.getExtremes.call(this,this.getColumn("value"));return Ft(t)&&(this.valueMin=t),Ft(e)&&(this.valueMax=e),nt.prototype.getExtremes.call(this)}getValidPoints(t,e){return nt.prototype.getValidPoints.call(this,t,e,!0)}hasData(){return!!this.dataTable.rowCount}init(){super.init.apply(this,arguments);let t=this.options;t.pointRange=tr(t.pointRange,t.colsize||1),this.yAxis.axisPointRange=t.rowsize||1,Ht.ellipse=Ht.circle,t.marker&&Ft(t.borderRadius)&&(t.marker.r=t.borderRadius)}markerAttribs(t,e){let i=t.shapeArgs||{};if(t.hasImage)return{x:t.plotX,y:t.plotY};if(e&&e!=="normal"){let o=t.options.marker||{},r=this.options.marker||{},n=r.states?.[e]||{},s=o.states?.[e]||{},a=(s.width||n.width||i.width||0)+(s.widthPlus||n.widthPlus||0),h=(s.height||n.height||i.height||0)+(s.heightPlus||n.heightPlus||0);return{x:(i.x||0)+((i.width||0)-a)/2,y:(i.y||0)+((i.height||0)-h)/2,width:a,height:h}}return i}pointAttribs(t,e){let i=nt.prototype.pointAttribs.call(this,t,e),o=this.options||{},r=this.chart.options.plotOptions||{},n=r.series||{},s=r.heatmap||{},a=t?.options.borderColor||o.borderColor||s.borderColor||n.borderColor,h=t?.options.borderWidth||o.borderWidth||s.borderWidth||n.borderWidth||i["stroke-width"];if(i.stroke=t?.marker?.lineColor||o.marker?.lineColor||a||this.color,i["stroke-width"]=h,e&&e!=="normal"){let p=ye(o.states?.[e],o.marker?.states?.[e],t?.options.marker?.states?.[e]||{});i.fill=p.color||Qt().parse(i.fill).brighten(p.brightness||0).get(),i.stroke=p.lineColor||i.stroke}return i}translate(){let{borderRadius:t,marker:e}=this.options,i=e?.symbol||"rect",o=Ht[i]?i:"rect",r=["circle","square"].indexOf(o)!==-1;for(let n of(this.generatePoints(),this.points)){let s=n.getCellAttributes(),a=Math.min(s.x1,s.x2),h=Math.min(s.y1,s.y2),p=Math.max(Math.abs(s.x2-s.x1),0),d=Math.max(Math.abs(s.y2-s.y1),0);if(n.hasImage=(n.marker?.symbol||i||"").indexOf("url")===0,r){let c=Math.abs(p-d);a=Math.min(s.x1,s.x2)+(p<d?0:c/2),h=Math.min(s.y1,s.y2)+(p<d?c/2:0),p=d=Math.min(p,d)}n.hasImage&&(n.marker={width:p,height:d}),n.plotX=n.clientX=(s.x1+s.x2)/2,n.plotY=(s.y1+s.y2)/2,n.shapeType="path",n.shapeArgs=ye(!0,{x:a,y:h,width:p,height:d},{d:Ht[o](a,h,p,d,{r:Ft(t)?t:0})})}Qo(this,"afterTranslate")}}xt.defaultOptions=ye(Ci.defaultOptions,{animation:!1,borderRadius:0,borderWidth:0,interpolation:!1,nullColor:"#f7f7f7",dataLabels:{formatter:function(){let{numberFormatter:l}=this.series.chart,{value:t}=this.point;return Zo(t)?l(t,-1):""},inside:!0,verticalAlign:"middle",crop:!1,overflow:"allow",padding:0},marker:{symbol:"rect",radius:0,lineColor:void 0,states:{hover:{lineWidthPlus:0},select:{}}},clip:!0,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{hover:{halo:!1,brightness:.2}},legendSymbol:"rectangle"}),qo(xt,"afterDataClassLegendClick",function(){this.isDirtyCanvas=!0,this.drawPoints(),this.options.enableMouseTracking&&this.drawTracker()}),Jo(xt.prototype,{axisTypes:B.seriesMembers.axisTypes,colorKey:B.seriesMembers.colorKey,directTouch:!0,getExtremesFromAll:!0,keysAffectYAxis:["y"],parallelArrays:B.seriesMembers.parallelArrays,pointArrayMap:["y","value"],pointClass:vi,specialGroup:"group",trackerGroups:B.seriesMembers.trackerGroups,alignDataLabel:$o.prototype.alignDataLabel,colorAttribs:B.seriesMembers.colorAttribs,getSymbol:nt.prototype.getSymbol}),B.compose(xt),I().registerSeriesType("heatmap",xt);let A=v();A.ColorMapComposition=B,A.MapChart=A.MapChart||zt,A.MapNavigation=A.MapNavigation||jt,A.MapView=A.MapView||G,A.Projection=A.Projection||ct,A.mapChart=A.Map=A.MapChart.mapChart,A.maps=A.MapChart.maps,A.geojson=It.geojson,A.topo2geo=It.topo2geo,It.compose(A.Chart),Rt.compose(A.Axis,A.Chart,A.Legend),jt.compose(zt,A.Pointer,A.SVGRenderer),G.compose(zt);let sr=v();return Le.default})())});export default ar();
2
+ /*! Bundled license information:
3
+
4
+ highcharts/modules/map.js:
5
+ (**
6
+ * @license Highcharts JS v12.5.0 (2026-01-12)
7
+ * @module highcharts/modules/color-axis
8
+ * @requires highcharts
9
+ *
10
+ * ColorAxis module
11
+ *
12
+ * (c) 2012-2026 Highsoft AS
13
+ * Author: Pawel Potaczek
14
+ *
15
+ * A commercial license may be required depending on use.
16
+ * See www.highcharts.com/license
17
+ *)
18
+ */
@@ -0,0 +1,2 @@
1
+ import{$ as At,Aa as Vt,B as bt,C as yt,Ca as Wt,D as Ct,Da as qt,E as vt,Ea as Ht,F as xt,Fa as Ae,G as wt,H as Pt,I as Mt,Ia as Lt,J as Dt,Ja as Le,K as St,Ka as Ie,L as De,M as Se,N as ke,T as Oe,U as kt,W as Ot,X as Tt,Y as W,Z as Ft,a as Be,aa as It,b as Ue,c as at,d as Pe,f as Me,g as G,h as Q,i as st,ia as Et,j as lt,ja as Rt,k as dt,l as ct,m as gt,ma as Te,n as pt,na as _e,o as re,oa as zt,p as ht,pa as Fe,q as mt,qa as Nt,sa as ge,v as ut,w as de,x as ft,xa as T,y as ce,z as _t,za as He}from"./chunk-JXQ2DURN.js";import{$b as se,Ab as D,Bb as nt,Eb as b,Ga as Xe,Gb as d,Ha as et,Jb as ae,Kb as ee,La as c,Lb as te,N as j,Ob as V,Pb as it,Qb as ne,R as Ze,S as w,Sb as P,Tb as L,Ub as rt,X as u,Xa as xe,Y as f,Z as Ye,_ as Qe,ab as q,ac as ie,ba as Ke,bc as le,d as je,da as he,ea as Ce,fb as $,fc as ue,ha as Je,ia as _,jc as O,la as J,lb as X,mb as C,mc as fe,nb as v,nc as Y,ob as Z,p as A,pa as ve,pb as tt,pc as ot,qb as I,rb as E,sb as y,tb as a,ub as l,vb as h,wb as oe,xb as we,yb as me,zb as H}from"./chunk-F6ZDDRJ7.js";import{a as x,b as z}from"./chunk-ZW5NV4UO.js";function Yt(){return{dashboardsTitle:"Dashboards",loadingDashboards:"Loading dashboards\u2026",noDashboardsTitle:"No dashboards yet",noDashboardsSub:"Generate one from your data, or create it in the builder.",generateDashboardButton:"Generate dashboard",refreshButton:"Refresh",exportButton:"Export",editButton:"Edit",renamePlaceholder:"Dashboard name",askAqueraButton:"Ask Aquera",errors:{loadFailedFallback:"Could not load dashboards",saveFailedFallback:"Could not save the dashboard",refreshFailedFallback:"Could not refresh the dashboard",exportFailedFallback:"Could not export the dashboard"}}}function Qt(){return{mcpGateway:de.MCP_GATEWAY_ENABLED??!1,aiPrompt:!0,autoGenerate:!0,export:!0,rename:!0,refresh:!0,executiveSummary:!0,edit:!0}}function Gt(){return{baseUrl:de.baseUrl??"",mcpUrl:de.MCP_URL??null,tokenizedOrigins:[de.baseUrl].filter(r=>!!r),headers:{},customerId:null,productId:null,productName:null,authMode:"inherit",authToken:null,getToken:null,resolvedToken:null,onUnauthorized:null,ssoEnabled:de.SSO_ENABLED??!1,features:Qt(),ui:{theme:"light",density:"comfortable",header:!0,locale:"en"},copy:Yt(),hrefs:{askAquera:"/ask-aquera",builder:"/manage-dashboards"},initialDashboardId:null}}var $t=pt("dashboards",Gt);function S(){return $t.read()}function Bt(r){let t=Gt(),e=z(x(x({},t),re(r)),{features:x(x({},t.features),re(r.features??{})),ui:x(x({},t.ui),re(r.ui??{})),hrefs:x(x({},t.hrefs),re(r.hrefs??{})),copy:z(x(x({},t.copy),re(r.copy??{})),{errors:x(x({},t.copy.errors),re(r.copy?.errors??{}))}),headers:x(x({},t.headers),r.headers??{})});return r.tokenizedOrigins||(e.tokenizedOrigins=[e.baseUrl,e.mcpUrl].filter(n=>!!n)),$t.write(e)}var B=class r{requests$=new je;requests=this.requests$.asObservable();toAskAquera(){this.requests$.next({to:S().hrefs.askAquera})}toAskAqueraDashboard(t,e){this.requests$.next({to:`${S().hrefs.askAquera}/dashboard/${t}`,queryParams:e})}toBuilder(t){this.requests$.next({to:`${S().hrefs.builder}/${t}`})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=j({token:r,factory:r.\u0275fac})};var k={get baseUrl(){return S().baseUrl},get MCP_URL(){return S().mcpUrl??""},get MCP_GATEWAY_ENABLED(){return S().features.mcpGateway},get SSO_ENABLED(){return S().ssoEnabled}};function Ut(){return S().customerId??""}function F(){return S().productId??""}var pe=class r{constructor(t){this.http=t}http;tokenStore=w(ce);publishRepo=w(T);lastSentCustomerId=null;lastSentProductId=null;get customerId(){return this.tokenStore.tenantId()??""}mcpGatewayUrl(){return`${k.baseUrl}/dviz-mcp`}async callMcpTool(t,e={}){let n=this.customerId,i=F(),o={};n!==this.lastSentCustomerId&&(o.customerId=n),i!==this.lastSentProductId&&(o.productId=i);let s;try{s=await A(this.http.post(this.mcpGatewayUrl(),{jsonrpc:"2.0",id:Date.now(),method:"tools/call",params:{name:t,arguments:e}},{headers:{Accept:"application/json, text/event-stream"},params:o})),this.lastSentCustomerId=n,this.lastSentProductId=i}catch(p){throw p instanceof G?new Error(p.error?.error?.message||p.error?.message||p.message):p}if(s.error)throw new Error(s.error.message);let g=s.result;if(g?.isError)throw new Error(g.structuredContent?.error?.message??g.content?.[0]?.text??`${t} failed`);return g?.structuredContent??{}}async loadDashboards(){return(await this.publishRepo.listDashboards({published:"true",limit:100})).filter(e=>e.isPublished===!0||e.version==="published").map(e=>({id:e.id,name:e.name??"Untitled",description:e.description,createdAt:e.createdAt??new Date().toISOString(),updatedAt:e.updatedAt,isAutoGenerated:e.isAutoGenerated===!0,category:e.category??null}))}async renameDashboard(t,e){if(!k.MCP_GATEWAY_ENABLED){try{await A(this.http.put(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${t}?published=true`,{name:e}))}catch(n){throw n instanceof G?new Error(n.error?.error||n.message):n}return}await this.callMcpTool("updateDashboard",{dashboardId:t,name:e,published:!0})}async fetchDashboard(t){let e,n=!1;if(k.MCP_GATEWAY_ENABLED){let i=await this.callMcpTool("getDashboard",{dashboardId:t,published:"true"});e=i?.dashboard??{},n=i?.canRefresh===!0}else{let i=await A(this.http.get(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${t}?published=true`));e=i?.data??i,n=i?.canRefresh===!0}return{id:e.id,name:e.name??"Untitled",widgets:await this.mapAndHydrateWidgets(e.widgets),connectionId:e.connectionId,isPipeline:e.isPipeline,adapterType:e.adapterType,category:e.category??null,canRefresh:n}}async refreshDashboard(t){if(!k.MCP_GATEWAY_ENABLED){let n=await A(this.http.post(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${t}/refresh`,{})),i=n?.data??n;return{widgets:await this.mapAndHydrateWidgets(i?.widgets)}}let e=await this.callMcpTool("refreshDashboard",{dashboardId:t});return{widgets:await this.mapAndHydrateWidgets(e?.refresh?.widgets)}}async mapAndHydrateWidgets(t){let e=(t??[]).map(n=>({id:n.id,title:n.title,type:n.widgetType??"chart",layout:n.layout??{x:0,y:0,w:12,h:4},nileConfig:{chart:n.chart??n.config?.chart??{},aq:n.config?.aq??{}},drilldownBy:Array.isArray(n.drilldownBy)?n.drilldownBy:void 0,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null}));return await Promise.all(e.map(n=>_e(n.nileConfig))),e}static \u0275fac=function(e){return new(e||r)(Ze(Q))};static \u0275prov=j({token:r,factory:r.\u0275fac,providedIn:"root"})};var U=class r{http=w(Q);tokenStore=w(ce);get customerId(){return this.tokenStore.tenantId()??""}async fetchGridPage(t,e,n,i,o,s,g,p){let m=`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/data-grid/${t}?pageIndex=${e}&pageSize=${n}`,M=(i??[]).filter(N=>N&&N.value!=null&&String(N.value).trim()!=="");return M.length&&(m+=`&filters=${encodeURIComponent(JSON.stringify(M))}`),o&&Object.keys(o).length&&(m+=`&dashboardFilters=${encodeURIComponent(JSON.stringify(o))}`),g&&g.length&&(m+=`&resolvedFilters=${encodeURIComponent(JSON.stringify(g))}`),s&&(m+=`&dashboardId=${encodeURIComponent(s)}`),p&&(m+=`&conversationId=${encodeURIComponent(p)}`),A(this.http.get(m))}async generateWidget(t,e){let n=bt()?{prompt:t}:{prompt:t,dataSourceId:e},i;try{i=await A(this.http.post(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/widget/generate`,n))}catch(g){if(g instanceof G){let p=g.error?.error||g.message;throw new Error(p)}throw g}if(i?.success===!1)throw new Error(i.error||"Request failed");let o=i?.data??i;if(!o?.config)throw new Error("Invalid response from widget generate API");let s=o;return await _e(s.config),s}async filterSuggest(t,e,n,i){let o=n.filter(p=>!!p.id).map(p=>({widgetId:p.id})),s;try{s=await A(this.http.post(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${t}/filter/suggest?status=${i??"draft"}`,{query:e,refreshCache:!1,widgets:o}))}catch(p){throw p instanceof G?new Error(p.error?.error||p.message):p}if(s?.success===!1)throw new Error(s.error||"Request failed");let g=s?.data??s??{};return{nextToken:g.nextToken,completions:Array.isArray(g.completions)?g.completions:[],suggestions:Array.isArray(g.suggestions)?g.suggestions:[]}}async applyFilters(t,e,n,i,o,s){let g=await new Promise((qe,ye)=>{let $e=this.http.post(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${n}/filter/apply?status=${i??"draft"}`,Nt(t,e,s)).subscribe({next:R=>qe(R),error:R=>{R instanceof G?ye(new Error(R.error?.error||R.message)):ye(R)}});if(o){if(o.aborted){$e.unsubscribe();let R=new Error("Aborted");R.name="AbortError",ye(R);return}o.addEventListener("abort",()=>{$e.unsubscribe();let R=new Error("Aborted");R.name="AbortError",ye(R)},{once:!0})}});if(g?.success===!1)throw new Error(g.error||"Request failed");let p=g?.data??g,m=Array.isArray(p)?p:p?.widgets;if(!Array.isArray(m))throw new Error("Invalid response from apply-filters API");let M=!Array.isArray(p)&&Array.isArray(p?.resolvedFilters)?p.resolvedFilters:[],N=!Array.isArray(p)&&Array.isArray(p?.filterGroups)?p.filterGroups:[];return await Promise.all(m.map(qe=>_e(qe.config))),{widgets:m,resolvedFilters:M,filterGroups:N}}static \u0275fac=function(e){return new(e||r)};static \u0275prov=j({token:r,factory:r.\u0275fac,providedIn:"root"})};var Jt=["grid"];function Xt(r,t){if(r&1){let e=D();a(0,"div",1)(1,"nile-dropdown",4),b("nile-hide",function(){u(e);let i=d();return f(i.widgetCategoryFilterOpen=!1)}),a(2,"nile-lite-tooltip",5)(3,"button",6),b("click",function(){u(e);let i=d();return f(i.widgetCategoryFilterOpen=!i.widgetCategoryFilterOpen)}),h(4,"nile-glyph",7),P(5),l()(),a(6,"div",8),b("mousedown",function(i){return i.stopPropagation()}),a(7,"shared-category-filter-row",9),b("selectionChange",function(i){u(e);let o=d();return f(o.onWidgetCategoryFilterChange(i))}),l()()()()}if(r&2){let e=d();c(),y("open",e.widgetCategoryFilterOpen),c(4),rt(" ",e.selectedWidgetCategory?e.selectedWidgetCategoryLabel??"Category":"All categories"," "),c(2),y("categories",e.presentWidgetCategories)("selected",e.selectedWidgetCategory)}}var be=class r{widgets=[];dashboardId=null;applyingFilters=!1;selectedWidgetCategory=null;widgetCategoryFilterOpen=!1;get presentWidgetCategories(){let t=new Set(this.widgets.map(e=>e.category).filter(e=>!!e));return Le.filter(e=>t.has(e.id))}get selectedWidgetCategoryLabel(){return Le.find(t=>t.id===this.selectedWidgetCategory)?.label}get visibleWidgets(){return this.selectedWidgetCategory?this.widgets.filter(t=>t.category===this.selectedWidgetCategory):this.widgets}onWidgetCategoryFilterChange(t){this.selectedWidgetCategory=t,this.widgetCategoryFilterOpen=!1}currentTimeRange=null;lastMonitoredTotal=null;isRefreshingData=!1;activeDashboardFilters=null;activeResolvedFilters=null;activeFilterGroups=[];applySummary=null;alertDrawerOpen=!1;alertWidget=null;alertFilterPredicates=null;alertFilterHasOr=!1;alertAuthoringMode="widget";alertSource=null;gridRef;http=w(Q);zone=w(Ce);navigator=w(B);openAiService=w(U);dashboardsService=w(pe);forecastService=w(St);cdr=w(ot);sessionMap=new Map;primedFilterWidgets=new Set;filterSuggestCache=new Map;filterSuggestInflight=new Set;applyFiltersSeq=0;applyFiltersAbort;viewInited=!1;openInBuilder(){!this.dashboardId||!S().features.edit||this.navigator.toBuilder(this.dashboardId)}set config(t){let e=t?.id??null,n=e!==this.dashboardId;if(n&&(this.primedFilterWidgets.clear(),this.filterSuggestCache.clear(),this.filterSuggestInflight.clear(),this.activeDashboardFilters=null,this.activeResolvedFilters=null,this.activeFilterGroups=[],this.applySummary=null,this.currentTimeRange=null,this.lastMonitoredTotal=null,this.selectedWidgetCategory=null,this.widgetCategoryFilterOpen=!1),!t){this.widgets=[],this.dashboardId=null,this.alertSource=null;return}this.dashboardId=e,this.alertSource={connectionId:t.connectionId,isPipeline:t.isPipeline,adapterType:t.adapterType},this.widgets=(t.widgets??[]).map(o=>({id:o.id,title:o.title??"",widgetType:o.type??"chart",layout:o.layout,config:o.nileConfig,drilldownBy:o.drilldownBy,dataSourceId:o.dataSourceId,queryMeta:o.queryMeta,category:o.category??null})),this.forecastable=t.forecastable??{};let i=this.collectInitialFilters(this.widgets);i?this.applyInitialFilters(i):n&&t.canRefresh&&this.refreshLoadedDashboardData(e),this.viewInited&&queueMicrotask(()=>this.primeFilterWidgets())}async refreshLoadedDashboardData(t){this.isRefreshingData=!0,W({variant:"info",title:"Refreshing your data",content:"Fetching the latest values for this dashboard\u2026",duration:4e3});try{let{widgets:e}=await this.dashboardsService.refreshDashboard(t);this.dashboardId===t&&!this.activeDashboardFilters&&(this.widgets=e.map(n=>({id:n.id,title:n.title??"",widgetType:n.type??"chart",layout:n.layout,config:n.nileConfig,drilldownBy:n.drilldownBy,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null})))}catch(e){console.error("Failed to refresh dashboard data:",e)}finally{this.isRefreshingData=!1,this.cdr.markForCheck()}}collectInitialFilters(t){let e={};for(let n of t){let i=n.config?.chart;if(i?.type==="filter")for(let o of i.controls??[]){if(!o.id)continue;let s=o.value;s!=null&&(typeof s=="string"&&s.trim()===""||(e[o.id]=s))}}return Object.keys(e).length>0?e:null}async applyInitialFilters(t){let e=this.widgets.filter(o=>!ge(o));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let{widgets:o,resolvedFilters:s,filterGroups:g}=await this.openAiService.applyFilters(e,t,this.dashboardId,"published",n.signal,{timeRange:this.currentTimeRange??void 0});if(i!==this.applyFiltersSeq)return;let p=new Map(o.map(m=>[m.id,m]));this.widgets=this.widgets.map(m=>{let M=p.get(m.id);return M?z(x(x({},m),M),{config:M.config??m.config}):m}),this.activeDashboardFilters=t,this.activeResolvedFilters=s,this.activeFilterGroups=g,this.applySummary=Fe(o,this.buildActiveFilters(t))}catch(o){if(o?.name==="AbortError")return;console.error("Apply initial filters failed:",o)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}ngAfterViewInit(){this.viewInited=!0,queueMicrotask(()=>this.primeFilterWidgets())}alertTargetWidget(){let t=this.widgets.filter(n=>!ge(n)),e=t.filter(n=>!!n.config?.chart?.gridId);return e.length===1?e[0]:t.find(n=>!!n.queryMeta?.sql)??null}onWidgetPatchedByGrid(t){this.widgets=this.widgets.map(e=>e.id===t.id?t:e),this.cdr.markForCheck()}forecastable={};forecastBusy=new Set;forecastingWidgetId=null;async onForecast(t){let e=this.dashboardId,n=String(t.widget.id);if(!(!e||this.forecastBusy.has(n))){this.forecastBusy.add(n),this.forecastingWidgetId=n,this.cdr.markForCheck();try{let i=t.enable?await this.forecastService.addToWidget(e,n,t.settings??{}):await this.forecastService.removeFromWidget(e,n);if(t.enable&&i?.guardrails&&i.guardrails.passed===!1){W({variant:"info",title:i.guardrails.title||"Not forecastable",content:i.guardrails.body||"This widget can\u2019t be forecast."});return}i?.widget&&this.applyForecastedWidget(i.widget),W({variant:"success",title:t.enable?t.settings?"Forecast updated":"Forecast added":"Forecast removed",content:t.enable?"The projection is shown with its confidence range.":"The chart is back to its measured history."})}catch(i){W({variant:"error",title:t.enable?"Couldn\u2019t add the forecast":"Couldn\u2019t remove the forecast",content:i?.error?.error??"Please try again."})}finally{this.forecastBusy.delete(n),this.forecastingWidgetId=null,this.cdr.markForCheck()}}}applyForecastedWidget(t){this.widgets=this.widgets.map(e=>String(e.id)===String(t.id)?z(x({},e),{config:t.config?.chart??t.nileConfig??e.config,queryMeta:t.queryMeta??e.queryMeta}):e)}onSetAlert(t){if(ge(t)){let e=this.alertTargetWidget();if(!e){W({variant:"error",title:"Cannot set alert",content:"This dashboard has no queryable widget to alert on."});return}this.alertWidget=e,this.alertFilterPredicates=this.activeResolvedFilters,this.alertFilterHasOr=this.activeFilterGroups.length>1,this.alertAuthoringMode="filter"}else this.alertWidget=t,this.alertFilterPredicates=null,this.alertFilterHasOr=!1,this.alertAuthoringMode="widget";this.alertDrawerOpen=!0,this.cdr.markForCheck()}onAlertClosed(){this.alertDrawerOpen=!1,this.cdr.markForCheck()}onAlertSaved(){this.alertDrawerOpen=!1,this.cdr.markForCheck()}onFilterChange(t){let e=t.widgetId,n=t.controlId;!e||!n||this.dashboardId&&this.fetchSuggestionsOnce(e,n,this.dashboardId)}fetchSuggestionsOnce(t,e,n){let i=this.filterSuggestCache.get(t);if(i){this.gridRef?.patchFilterSuggestions(t,e,i);return}this.filterSuggestInflight.has(t)||(this.filterSuggestInflight.add(t),(async()=>{try{let o=await this.openAiService.filterSuggest(n,"",this.widgets,"published");this.applyFilterSuggestions(t,e,o)}catch(o){console.warn("Filter suggest failed:",o)}finally{this.filterSuggestInflight.delete(t)}})())}async onFilterSubmit(t){if(this.isEmptyFilters(t.filters)){await this.reloadDashboard();return}let e=this.widgets.filter(o=>!ge(o));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let{widgets:o,resolvedFilters:s,filterGroups:g}=await this.openAiService.applyFilters(e,t.filters,this.dashboardId,"published",n.signal,{mode:t.mode,prompt:t.prompt,timeRange:this.currentTimeRange??void 0});if(i!==this.applyFiltersSeq)return;let p=new Map(o.map(m=>[m.id,m]));this.widgets=this.widgets.map(m=>{let M=p.get(m.id);return M?z(x(x({},m),M),{config:M.config??m.config}):m}),this.activeDashboardFilters=t.filters,this.lastMonitoredTotal=null,this.activeResolvedFilters=s,this.activeFilterGroups=g,this.applySummary=Fe(o,this.buildActiveFilters(t.filters))}catch(o){if(o?.name==="AbortError")return;console.error("Apply filters failed:",o)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}async applyTimeRange(t){this.currentTimeRange=t;let e=this.widgets.filter(o=>!ge(o));if(e.length===0||!this.dashboardId)return;this.applyFiltersAbort?.abort();let n=new AbortController;this.applyFiltersAbort=n;let i=++this.applyFiltersSeq;this.applyingFilters=!0;try{let o=this.activeDashboardFilters??{},{widgets:s,resolvedFilters:g,filterGroups:p}=await this.openAiService.applyFilters(e,o,this.dashboardId,"published",n.signal,{resolvedFilters:this.activeResolvedFilters??[],timeRange:t});if(i!==this.applyFiltersSeq)return;let m=new Map(s.map(M=>[M.id,M]));this.widgets=this.widgets.map(M=>{let N=m.get(M.id);return N?z(x(x({},M),N),{config:N.config??M.config}):M}),this.activeResolvedFilters=g,this.activeFilterGroups=p,this.applySummary=Fe(s,this.buildActiveFilters(o)),this.checkForNewSinceLastCheck(t)}catch(o){if(o?.name==="AbortError")return;console.error("Apply time range failed:",o)}finally{i===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}}checkForNewSinceLastCheck(t){if(!(Math.abs(Date.now()-new Date(t.to).getTime())<6e4))return;let n=this.kpiTotal(this.widgets);if(n!=null&&this.lastMonitoredTotal!=null&&n>this.lastMonitoredTotal){let i=n-this.lastMonitoredTotal;W({variant:"info",content:`+${i} new since last check`,duration:6e3})}n!=null&&(this.lastMonitoredTotal=n)}kpiTotal(t){let e=0,n=!1;for(let i of t){let o=i.config?.chart;if(o?.type!=="kpi")continue;let s=Number(o.value);Number.isFinite(s)&&(e+=s,n=!0)}return n?e:null}buildActiveFilters(t){return Rt(t,e=>this.filterFieldLabel(e))}filterFieldLabel(t){for(let e of this.filterSuggestCache.values()){let n=e.find(i=>i.type==="attribute"&&i.id===t);if(n)return n.label}return t}isEmptyFilters(t){if(!t)return!0;for(let e of Object.values(t))if(e!=null&&!(typeof e=="string"&&e.trim()==="")&&!(typeof e=="object"&&Object.keys(e).length===0))return!1;return!0}async reloadDashboard(){if(!this.dashboardId)return;this.applyFiltersAbort?.abort();let t=++this.applyFiltersSeq;this.applyingFilters=!0,this.activeDashboardFilters=null,this.lastMonitoredTotal=null,this.activeResolvedFilters=null,this.activeFilterGroups=[],this.applySummary=null;try{let e=await this.dashboardsService.fetchDashboard(this.dashboardId);if(t!==this.applyFiltersSeq)return;this.widgets=(e.widgets??[]).map(n=>({id:n.id,title:n.title??"",widgetType:n.type??"chart",layout:n.layout,config:zt(n.nileConfig),drilldownBy:n.drilldownBy,dataSourceId:n.dataSourceId,queryMeta:n.queryMeta,category:n.category??null}))}catch(e){console.error("Reload dashboard failed:",e)}finally{t===this.applyFiltersSeq&&(this.applyingFilters=!1),this.cdr.markForCheck()}this.currentTimeRange&&t===this.applyFiltersSeq&&await this.applyTimeRange(this.currentTimeRange)}primeFilterWidgets(){if(this.dashboardId)for(let t of this.widgets){if(this.primedFilterWidgets.has(t.id))continue;let e=t.config?.chart;if(e?.type!=="filter")continue;let n=e.controls?.find(i=>i.variant==="prompt"||i.variant==="expression"||i.variant==="hybrid")??e.controls?.find(i=>i.id);n?.id&&(this.primedFilterWidgets.add(t.id),this.fetchSuggestionsOnce(t.id,n.id,this.dashboardId))}}applyFilterSuggestions(t,e,n){let i=Array.isArray(n.suggestions)?n.suggestions:[];if(!i.length){n.nextToken&&i.push({id:n.nextToken.value,label:n.nextToken.label,type:"attribute"});for(let o of n.completions)i.push({label:o,type:"suggestion"})}i.length!==0&&(this.filterSuggestCache.set(t,i),this.gridRef?.patchFilterSuggestions(t,e,i))}async onAiSend(t){if(!this.dashboardId)return;let e=this.sessionMap.get(t.widgetId)??t.sessionId;this.sessionMap.set(t.widgetId,e);try{let n=Ut(),i=await A(this.http.post(`${k.baseUrl}/api/customers/${n}/products/${F()}/workforce/dashboards/${this.dashboardId}/widgets/${t.widgetId}/chat`,{message:t.message,sessionId:e})),o=i?.reply?.content;o&&(this.sessionMap.set(t.widgetId,i.sessionId??e),this.zone.run(()=>{t.chartEl?.addAiResponse?.(o)}))}catch(n){console.error("Chat request failed:",n),this.zone.run(()=>{t.chartEl?.addAiResponse?.("Sorry, I couldn't process your request. Please try again.")})}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["app-dashboard-viewer"]],viewQuery:function(e,n){if(e&1&&ae(Jt,5),e&2){let i;ee(i=te())&&(n.gridRef=i.first)}},inputs:{config:"config"},features:[se([{provide:xt,useFactory:t=>t.fetchGridPage.bind(t),deps:[U]},{provide:Pt,useFactory:t=>t.fetchFilterValues.bind(t),deps:[T]},ke(T),De(T),Se(T),Oe(T)])],decls:4,vars:21,consts:[["grid",""],[1,"widget-category-bar"],[3,"forecast","aiSend","openAiBuilder","filterSubmit","filterChange","widgetChartTypeChanged","widgetFiltersChanged","setAlert","widgets","editMode","dashboardId","persistToPublished","widgetsLoading","dashboardFilters","resolvedFilters","applySummary","canSetAlert","canAddToStory","canForecast","forecastable","forecastingWidgetId"],[3,"closed","saved","open","widget","dashboardId","source","filterPredicates","filterHasOr","authoringMode"],["placement","bottom-start",1,"widget-category-filter",3,"nile-hide","open"],["slot","trigger","content","Filter widgets by category"],["type","button","aria-label","Filter widgets by category",1,"widget-category-filter__trigger",3,"click"],["name","ng-filter-lines","method","stroke","size","16"],[1,"widget-category-filter__panel",3,"mousedown"],[3,"selectionChange","categories","selected"]],template:function(e,n){e&1&&(C(0,Xt,8,4,"div",1),a(1,"shared-dashboard-grid",2,0),b("forecast",function(o){return n.onForecast(o)})("aiSend",function(o){return n.onAiSend(o)})("openAiBuilder",function(){return n.openInBuilder()})("filterSubmit",function(o){return n.onFilterSubmit(o)})("filterChange",function(o){return n.onFilterChange(o)})("widgetChartTypeChanged",function(o){return n.onWidgetPatchedByGrid(o)})("widgetFiltersChanged",function(o){return n.onWidgetPatchedByGrid(o)})("setAlert",function(o){return n.onSetAlert(o)}),l(),a(3,"app-alert-drawer",3),b("closed",function(){return n.onAlertClosed()})("saved",function(){return n.onAlertSaved()}),l()),e&2&&(v(n.presentWidgetCategories.length>1?0:-1),c(),y("widgets",n.visibleWidgets)("editMode",!1)("dashboardId",n.dashboardId)("persistToPublished",!0)("widgetsLoading",n.applyingFilters||n.isRefreshingData)("dashboardFilters",n.activeDashboardFilters)("resolvedFilters",n.activeResolvedFilters)("applySummary",n.applySummary)("canSetAlert",!0)("canAddToStory",!1)("canForecast",!0)("forecastable",n.forecastable)("forecastingWidgetId",n.forecastingWidgetId),c(2),y("open",n.alertDrawerOpen)("widget",n.alertWidget)("dashboardId",n.dashboardId)("source",n.alertSource)("filterPredicates",n.alertFilterPredicates)("filterHasOr",n.alertFilterHasOr)("authoringMode",n.alertAuthoringMode))},dependencies:[Me,Te,Ae,Ie],styles:["[_nghost-%COMP%]{display:block}.widget-category-bar[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;padding:0 4px 8px}.widget-category-filter__trigger[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;font-family:inherit;font-size:var(--ng-font-size-text-sm);font-weight:var(--ng-font-weight-medium);color:var(--ng-colors-text-tertiary-600);background:var(--ng-colors-bg-secondary);border:1px solid var(--ng-colors-border-secondary);border-radius:var(--ng-radius-md);cursor:pointer}.widget-category-filter__trigger[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-primary)}.widget-category-filter__panel[_ngcontent-%COMP%]{padding:10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-primary);border-radius:var(--ng-radius-lg);box-shadow:var(--ng-shadow-lg)}"]})};var Re=class r{http=w(Q);tokenStore=w(ce);get customerId(){return this.tokenStore.tenantId()??""}async chat(t,e,n,i){let o=await new Promise((s,g)=>{let p=this.http.post(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${e}/chat`,{message:t,sessionId:n}).subscribe({next:m=>s(m),error:m=>{m instanceof G?g(new Error(m.error?.error||m.message)):g(m)}});if(i){if(i.aborted){p.unsubscribe();let m=new Error("Aborted");m.name="AbortError",g(m);return}i.addEventListener("abort",()=>{p.unsubscribe();let m=new Error("Aborted");m.name="AbortError",g(m)},{once:!0})}});if(!o?.success)throw new Error("Chat request failed");return o}async getSuggestions(t){if(!t)return[];let e;try{e=await A(this.http.get(`${k.baseUrl}/api/customers/${this.customerId}/products/${F()}/workforce/dashboards/${t}/chat/suggestions`))}catch(n){throw n instanceof G?new Error(n.error?.error||n.message):n}if(Array.isArray(e))return e;if(e.success===!1)throw new Error("Suggestions request failed");return e.suggestions??e.data??[]}static \u0275fac=function(e){return new(e||r)};static \u0275prov=j({token:r,factory:r.\u0275fac,providedIn:"root"})};var tn=["sliderGrid"],nn=r=>({"recommend-window":r}),rn=()=>({variant:"welcome"}),on=()=>[1,2,3,4],an=r=>({"mic-listening":r}),sn=r=>({disabled:r}),jt=(r,t)=>t.title;function ln(r,t){r&1&&H(0)}function dn(r,t){r&1&&(a(0,"div",18),h(1,"nile-skeleton-loader",19),l())}function cn(r,t){r&1&&(a(0,"div",17),I(1,dn,2,0,"div",18,Z),l()),r&2&&(c(),E(ie(0,on)))}function gn(r,t){if(r&1){let e=D();a(0,"button",23),b("click",function(){let i=u(e).$implicit,o=d(5);return f(o.runPrompt(i.title))}),a(1,"div",24),h(2,"nile-icon",25),l(),a(3,"span",26),P(4),l()()}if(r&2){let e=t.$implicit;c(4),L(e.title)}}function pn(r,t){if(r&1){let e=D();a(0,"div",17),I(1,gn,5,1,"button",20,jt),l(),a(3,"button",21),b("click",function(){u(e);let i=d(4);return f(i.openPromptGallery())}),h(4,"nile-glyph",22),a(5,"span"),P(6,"View prompt gallery"),l()()}if(r&2){let e=d(4);c(),E(e.topRecommended())}}function hn(r,t){if(r&1&&(a(0,"div",9)(1,"div",12),h(2,"nile-icon",13),l(),a(3,"h2",14),P(4,"What would you like to ask?"),l(),a(5,"p",15),P(6,"Ask anything about your dashboard."),l(),$(7,ln,1,0,"ng-container",16),C(8,cn,3,1,"div",17)(9,pn,7,0),l()),r&2){let e=d(3),n=V(3);c(7),y("ngTemplateOutlet",n)("ngTemplateOutletContext",ie(3,rn)),c(),v(e.loadingSuggestions()?8:e.recommended().length>0?9:-1)}}function mn(r,t){r&1&&(a(0,"div",10),h(1,"nile-icon",27),a(2,"div",28),P(3,"Generating your answer..."),l()()),r&2&&(c(),y("name","loader")("size","20"))}function un(r,t){if(r&1&&(a(0,"div",29)(1,"div",30)(2,"span"),P(3),l()()()),r&2){let e=d().$implicit;c(3),L(e.content)}}function fn(r,t){if(r&1&&(a(0,"div")(1,"div",31),h(2,"nile-glyph",32),l(),a(3,"div",33),h(4,"div",34),l()()),r&2){let e=d().$implicit;c(4),y("innerHTML",e.content,et)}}function _n(r,t){if(r&1&&(C(0,un,4,1,"div",29),C(1,fn,5,1,"div")),r&2){let e=t.$implicit;v(e.role==="user"?0:-1),c(),v(e.role==="assistant"?1:-1)}}function bn(r,t){r&1&&H(0)}function yn(r,t){if(r&1&&$(0,bn,1,0,"ng-container",35),r&2){d(3);let e=V(3);y("ngTemplateOutlet",e)}}function Cn(r,t){if(r&1){let e=D();a(0,"button",23),b("click",function(){let i=u(e).$implicit,o=d(4);return f(o.onGalleryPromptClick(i.title))}),a(1,"div",24),h(2,"nile-icon",25),l(),a(3,"span",26),P(4),l()()}if(r&2){let e=t.$implicit;c(4),L(e.title)}}function vn(r,t){if(r&1){let e=D();a(0,"div",11)(1,"div",36)(2,"span",37),P(3,"Prompt gallery"),l(),a(4,"button",38),b("click",function(){u(e);let i=d(3);return f(i.closePromptGallery())}),h(5,"nile-glyph",39),l()(),a(6,"div",40)(7,"p",41),P(8,"Pick a suggestion to get started."),l(),a(9,"div",42),I(10,Cn,5,1,"button",20,jt),l()()()}if(r&2){let e=d(3);c(10),E(e.recommended())}}function xn(r,t){if(r&1){let e=D();a(0,"div",6)(1,"nile-glyph",7),b("click",function(){u(e);let i=d(2);return f(i.closePanel.emit())}),l()(),a(2,"div",8),C(3,hn,10,4,"div",9),C(4,mn,4,2,"div",10),I(5,_n,2,2,null,null,Z),l(),C(7,yn,1,1,"ng-container"),C(8,vn,12,0,"div",11)}if(r&2){let e,n,i,o,s=d(2);c(2),y("ngClass",le(5,nn,!(!((e=s.chatsDetails())==null||e.message==null)&&e.message.length))),c(),v(!((n=s.chatsDetails())==null||n.message==null)&&n.message.length?-1:3),c(),v(s.isGenerating()?4:-1),c(),E((i=s.chatsDetails())==null?null:i.message),c(2),v(!((o=s.chatsDetails())==null||o.message==null)&&o.message.length?7:-1),c(),v(s.showPromptGallery()?8:-1)}}function wn(r,t){if(r&1){let e=D();a(0,"div",43),b("pointerdown",function(i){u(e);let o=d(2);return f(o.onResizeStart(i))})("pointermove",function(i){u(e);let o=d(2);return f(o.onResizeMove(i))})("pointerup",function(i){u(e);let o=d(2);return f(o.onResizeEnd(i))})("pointercancel",function(i){u(e);let o=d(2);return f(o.onResizeEnd(i))}),l(),a(1,"div",44)(2,"div",45)(3,"shared-dashboard-grid",46,1),b("filterSubmit",function(i){u(e);let o=d(2);return f(o.onSliderFilterSubmit(i))})("filterChange",function(i){u(e);let o=d(2);return f(o.onSliderFilterChange(i))})("widgetChartTypeChanged",function(i){u(e);let o=d(2);return f(o.onSliderWidgetPatched(i))})("widgetFiltersChanged",function(i){u(e);let o=d(2);return f(o.onSliderWidgetPatched(i))})("setAlert",function(i){u(e);let o=d(2);return f(o.onSetAlert(i))}),l(),a(5,"app-alert-drawer",47),b("closed",function(){u(e);let i=d(2);return f(i.onAlertClosed())})("saved",function(){u(e);let i=d(2);return f(i.onAlertClosed())}),l()()()}if(r&2){let e=d(2);c(3),y("widgets",e.sliderWidgets())("editMode",!1)("outerMargin",!1)("dashboardId",e.dashboardId())("persistToPublished",!0)("canSetAlert",!0)("canAddToStory",!1),c(2),y("open",e.alertDrawerOpen())("widget",e.alertWidget())("dashboardId",e.dashboardId())("source",e.alertSource())}}function Pn(r,t){if(r&1&&(a(0,"div",4)(1,"div",5),C(2,xn,9,7),l(),C(3,wn,6,11),l()),r&2){let e=d();ne("chat-layout--resizing",e.isResizing()),c(),it("flex",e.chatColumnWidthPct()!==null?"0 0 "+e.chatColumnWidthPct()+"%":null),ne("chat-column--split",!!e.dashboardConfig()&&!e.chatOnly()),c(),v(e.loadingChat()?-1:2),c(),v(e.dashboardConfig()&&!e.chatOnly()?3:-1)}}function Mn(r,t){if(r&1){let e=D();a(0,"div",48)(1,"label",49)(2,"input",50),b("input",function(i){u(e);let o=d();return f(o.queryString.set(i.target.value))})("keyup.enter",function(){u(e);let i=d();return f(i.postMessage())}),l(),a(3,"div",51)(4,"div",52)(5,"nile-glyph",53),b("click",function(){u(e);let i=d();return f(i.toggleMic())}),l(),a(6,"nile-glyph",54),b("click",function(){u(e);let i=d();return f(i.isGenerating()?i.cancelGenerate():i.postMessage())}),l()()()()()}if(r&2){let e=t.variant,n=d();ne("input-query-container--welcome",e==="welcome"),c(2),y("value",n.queryString()),c(3),y("name",n.isMicListening()?"ng-mic":"ng-mic-off")("ngClass",le(8,an,n.isMicListening())),c(),y("name",n.isGenerating()?"ng-circle-stop":"ng-send")("size",n.isGenerating()?"18":"16")("ngClass",le(10,sn,!n.isGenerating()&&!n.queryString()))}}var ze=class r{constructor(t,e,n){this.chatService=t;this.openAiService=e;this.sanitizer=n;J(()=>{let o=this.dashboardId();o&&this.loadSuggestions(o)});let i=null;J(()=>{let o=this.dashboardConfig(),s=o?.id??null;s!==i&&(this.primedFilterWidgets.clear(),i=s);let g=(o?.widgets??[]).map(p=>({id:p.id,title:p.title??"",widgetType:p.type??"chart",layout:p.layout,config:p.nileConfig,drilldownBy:p.drilldownBy,queryMeta:p.queryMeta,dataSourceId:p.dataSourceId}));this.sliderWidgets.set(g),queueMicrotask(()=>this.primeFilterWidgets())})}chatService;openAiService;sanitizer;closePanel=new he;dashboardId=Y("");dashboardName=Y("");dashboardConfig=Y(null);chatOnly=Y(!1);initialPrompt=Y("");allChats=_([]);chatsDetails=_(null);isGenerating=_(!1);queryString=_("");searchTerm=_("");selectedChatContextId=_("");loadingChat=_(!1);loadingAllChat=_(!1);isDeleting=_(!1);isMicListening=_(!1);recognition=null;micBaseText="";silenceTimer=null;micSilenceMs=5e3;recommended=_([]);topRecommended=O(()=>this.recommended().slice(0,4));loadingSuggestions=_(!1);showPromptGallery=_(!1);chatColumnWidthPct=_(null);isResizing=_(!1);resizeRect=null;resizePointerId=null;resizeRafPending=!1;sliderWidgets=_([]);alertDrawerOpen=_(!1);alertWidget=_(null);onSetAlert(t){this.alertWidget.set(t),this.alertDrawerOpen.set(!0)}onSliderWidgetPatched(t){this.sliderWidgets.update(e=>e.map(n=>n.id===t.id?t:n))}onAlertClosed(){this.alertDrawerOpen.set(!1)}alertSource=O(()=>{let t=this.dashboardConfig();return t?{connectionId:t.connectionId,isPipeline:t.isPipeline,adapterType:t.adapterType}:null});sliderGridRef;applyingFilters=_(!1);filterSuggestTimers=new Map;filterSuggestSeq=new Map;primedFilterWidgets=new Set;applyFiltersSeq=0;applyFiltersAbort;generateAbort;formattedChats=O(()=>this.buildFormattedChats(this.allChats()));filteredFormattedChats=O(()=>{let t=this.formattedChats(),e=this.searchTerm().toLowerCase().trim();if(!e)return t;let n=i=>i.filter(o=>o.displayName.toLowerCase().includes(e));return{today:n(t.today),yesterday:n(t.yesterday),older:n(t.older)}});ngOnInit(){this.createNewChat();let t=this.initialPrompt();t&&(this.queryString.set(t),this.postMessage())}async loadSuggestions(t){this.loadingSuggestions.set(!0);try{let e=await this.chatService.getSuggestions(t);this.recommended.set(e.map(n=>({title:n})))}catch(e){console.error("Failed to load chat suggestions:",e),this.recommended.set([])}finally{this.loadingSuggestions.set(!1)}}runPrompt(t){this.queryString.set(t),this.postMessage()}openPromptGallery(){this.showPromptGallery.set(!0)}closePromptGallery(){this.showPromptGallery.set(!1)}onGalleryPromptClick(t){this.closePromptGallery(),this.runPrompt(t)}isFilterWidget(t){return t?.config?.chart?.type==="filter"}onSliderFilterChange(t){let e=t.widgetId,n=t.controlId;if(!e||!n)return;let i=this.dashboardId();if(!i)return;let o=this.filterSuggestTimers.get(e);o&&clearTimeout(o);let s=(t.query??"").trim();if(!s)return;let g=(this.filterSuggestSeq.get(e)??0)+1;this.filterSuggestSeq.set(e,g);let p=setTimeout(async()=>{try{let m=this.sliderWidgets(),M=await this.openAiService.filterSuggest(i,s,m,"published");if(this.filterSuggestSeq.get(e)!==g)return;this.applyFilterSuggestions(e,n,M)}catch(m){console.warn("Filter suggest failed:",m)}},400);this.filterSuggestTimers.set(e,p)}async onSliderFilterSubmit(t){let e=this.sliderWidgets(),n=e.filter(s=>!this.isFilterWidget(s));if(n.length===0)return;this.applyFiltersAbort?.abort();let i=new AbortController;this.applyFiltersAbort=i;let o=++this.applyFiltersSeq;this.applyingFilters.set(!0);try{let{widgets:s}=await this.openAiService.applyFilters(n,t.filters,this.dashboardId(),"published",i.signal,{mode:t.mode,prompt:t.prompt});if(o!==this.applyFiltersSeq)return;let g=new Map(s.map(p=>[p.id,p]));this.sliderWidgets.set(e.map(p=>{let m=g.get(p.id);return m?z(x(x({},p),m),{config:m.config??p.config}):p}))}catch(s){if(s?.name==="AbortError"||o!==this.applyFiltersSeq)return;let g=s instanceof Error?s.message:"Failed to apply filters.";this.pushSystemMessage("error",`Apply filters failed: ${g}`)}finally{o===this.applyFiltersSeq&&this.applyingFilters.set(!1)}}primeFilterWidgets(){let t=this.dashboardId();if(!t)return;let e=this.sliderWidgets();for(let n of e){if(this.primedFilterWidgets.has(n.id))continue;let i=n.config?.chart;if(i?.type!=="filter")continue;let o=i.controls?.find(g=>g.variant==="expression"||g.variant==="hybrid");if(!o?.id)continue;this.primedFilterWidgets.add(n.id);let s=o.id;(async()=>{try{let g=await this.openAiService.filterSuggest(t,"",e,"published");this.applyFilterSuggestions(n.id,s,g)}catch(g){this.primedFilterWidgets.delete(n.id),console.warn("Filter suggest prime failed:",g)}})()}}applyFilterSuggestions(t,e,n){let i=Array.isArray(n.suggestions)?n.suggestions:[];if(!i.length){n.nextToken&&i.push({id:n.nextToken.value,label:n.nextToken.label,type:"attribute"});for(let o of n.completions)i.push({label:o,type:"suggestion"})}i.length!==0&&this.sliderGridRef?.patchFilterSuggestions(t,e,i)}onResizeStart(t){t.preventDefault();let e=t.currentTarget,n=e.parentElement;n&&(this.resizeRect=n.getBoundingClientRect(),e.setPointerCapture(t.pointerId),this.resizePointerId=t.pointerId,this.isResizing.set(!0))}onResizeMove(t){if(!this.isResizing()||!this.resizeRect)return;let n=(t.clientX-this.resizeRect.left)/this.resizeRect.width*100,i=Math.min(75,Math.max(20,n));this.chatColumnWidthPct.set(i),this.scheduleGridReflow()}onResizeEnd(t){let e=t.currentTarget;this.resizePointerId!==null&&e.hasPointerCapture?.(this.resizePointerId)&&e.releasePointerCapture(this.resizePointerId),this.isResizing.set(!1),this.resizeRect=null,this.resizePointerId=null,this.scheduleGridReflow()}scheduleGridReflow(){this.resizeRafPending||(this.resizeRafPending=!0,requestAnimationFrame(()=>{this.resizeRafPending=!1,window.dispatchEvent(new Event("resize"))}))}createNewChat(){let t={id:crypto.randomUUID(),displayName:"New Chat",createdOn:new Date().toISOString(),sessionId:crypto.randomUUID(),message:[]};this.allChats.update(e=>[t,...e]),this.getChatDetails(t.id)}getChatDetails(t){this.selectedChatContextId.set(t);let e=this.allChats().find(n=>n.id===t);e&&this.chatsDetails.set(e),this.loadingChat.set(!1)}deleteChat(t){if(this.isDeleting.set(!0),this.allChats.update(e=>e.filter(n=>n.id!==t)),this.isDeleting.set(!1),this.chatsDetails()?.id===t){let e=this.allChats();e.length?this.getChatDetails(e[0].id):this.createNewChat()}}onSearchChat(t){this.searchTerm.set(t)}async postMessage(){let t=this.queryString().trim();if(!t||this.isGenerating())return;this.chatsDetails()||this.createNewChat();let e=this.chatsDetails();e.message.unshift({role:"user",content:t}),e.displayName==="New Chat"&&(e.displayName=t.length>20?t.substring(0,20):t,this.allChats.update(i=>[...i])),this.chatsDetails.set(x({},e)),this.queryString.set(""),this.isGenerating.set(!0);let n=new AbortController;this.generateAbort=n;try{let i=await this.chatService.chat(t,this.dashboardId(),e.sessionId,n.signal);e.sessionId=i.sessionId,e.message.unshift({role:"assistant",content:this.sanitizeHtml(i.reply.content)})}catch(i){if(i instanceof Error&&i.name==="AbortError")e.message=e.message.filter((o,s)=>!(s===0&&o.role==="user"));else{let o=i instanceof Error?i.message:"Failed to get response.";this.pushSystemMessage("error",`Chat failed: ${o}`)}}finally{this.generateAbort===n&&(this.generateAbort=void 0),this.chatsDetails.set(x({},e)),this.isGenerating.set(!1)}}cancelGenerate(){this.generateAbort?.abort()}toggleMic(){this.isMicListening()?(this.clearSilenceTimer(),this.recognition?.stop()):this.startListening()}startListening(){let t=window,e=t.SpeechRecognition??t.webkitSpeechRecognition;e&&(this.micBaseText=this.queryString(),this.recognition=new e,this.recognition.continuous=!0,this.recognition.interimResults=!0,this.recognition.lang="en-US",this.recognition.onresult=n=>{let i="";for(let s=0;s<n.results.length;s++)i+=n.results[s][0].transcript;let o=this.micBaseText&&!this.micBaseText.endsWith(" ")?" ":"";this.queryString.set(this.micBaseText+o+i),this.resetSilenceTimer()},this.recognition.onend=()=>{this.clearSilenceTimer(),this.isMicListening.set(!1),this.recognition=null},this.recognition.start(),this.isMicListening.set(!0),this.resetSilenceTimer())}resetSilenceTimer(){this.clearSilenceTimer(),this.silenceTimer=setTimeout(()=>{this.silenceTimer=null,this.recognition?.stop(),this.queryString().trim()&&this.postMessage()},this.micSilenceMs)}clearSilenceTimer(){this.silenceTimer!==null&&(clearTimeout(this.silenceTimer),this.silenceTimer=null)}pushSystemMessage(t,e){let n=this.chatsDetails();if(!n){this.showToast(t==="error"?"error":"success",t==="error"?"Notice":"Done",e);return}let i=String(e).trim().replace(/[.!?]+$/,"").replace(/[<>&]/g,s=>s==="<"?"&lt;":s===">"?"&gt;":"&amp;"),o=t==="error"?`ERROR: ${i}!`:i;n.message.unshift({role:"assistant",content:this.sanitizeHtml(`<p class="chat-system chat-system--${t}">${o}</p>`)}),this.chatsDetails.set(x({},n))}showToast(t,e,n){if(t==="error"){Ot(`${e}: ${n}`.replace(/^:\s*/,""));return}let i=document.createElement("nile-toast");i.variant=t,i.title=e,i.content=n,i.duration=5e3,i.closable=!0,i.toast(),Tt()}sanitizeHtml(t){return this.sanitizer.sanitize(Xe.HTML,t)??""}buildFormattedChats(t){let e=[...t].sort((i,o)=>new Date(o.createdOn).getTime()-new Date(i.createdOn).getTime()),n={today:[],yesterday:[],older:[]};return e.forEach(i=>{this.isToday(i.createdOn)?n.today.push(i):this.isYesterday(i.createdOn)?n.yesterday.push(i):n.older.push(i)}),n}isToday(t){let e=new Date(t),n=new Date;return e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}isYesterday(t){let e=new Date(t),n=new Date;return n.setDate(n.getDate()-1),e.getDate()===n.getDate()&&e.getMonth()===n.getMonth()&&e.getFullYear()===n.getFullYear()}static \u0275fac=function(e){return new(e||r)(xe(Re),xe(U),xe(dt))};static \u0275cmp=q({type:r,selectors:[["db-ai-prompt-panel"]],viewQuery:function(e,n){if(e&1&&ae(tn,5),e&2){let i;ee(i=te())&&(n.sliderGridRef=i.first)}},inputs:{dashboardId:[1,"dashboardId"],dashboardName:[1,"dashboardName"],dashboardConfig:[1,"dashboardConfig"],chatOnly:[1,"chatOnly"],initialPrompt:[1,"initialPrompt"]},outputs:{closePanel:"closePanel"},features:[se([])],decls:4,vars:1,consts:[["promptInput",""],["sliderGrid",""],[1,"qna-panel"],[1,"chat-layout",3,"chat-layout--resizing"],[1,"chat-layout"],[1,"chat-column"],[1,"chat-header"],["name","close","size","16",1,"close-panel-icon",3,"click"],[1,"chat-message-container",3,"ngClass"],[1,"welcome-section"],[1,"generating-loader"],[1,"contained-panel","prompt-gallery-panel"],[1,"ai-badge","ai-badge--md","welcome-icon-wrap"],["color","#2970ff","name","smartcode","size","20"],[1,"welcome-title"],[1,"welcome-subtitle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"recommended"],[1,"recommended-box","skeleton-box"],[2,"width","100%","height","64px","border-radius","12px"],["type","button",1,"recommended-box"],["type","button",1,"browse-more",3,"click"],["name","ng-lightbulb-05","method","stroke","size","14"],["type","button",1,"recommended-box",3,"click"],[1,"ai-badge","ai-badge--sm","rec-icon-wrap"],["color","#2970ff","name","ng-lightbulb-05","size","16","method","stroke"],[1,"rec-title"],[3,"name","size"],[1,"generating-text"],[1,"user-row"],[1,"user"],[1,"ai-badge","ai-badge--sm","assistant-icon"],["name","ng-stars-02","method","stroke","size","16","color","#2970ff"],[1,"assistant"],[1,"assistant-body",3,"innerHTML"],[4,"ngTemplateOutlet"],[1,"contained-panel__header"],[1,"contained-panel__title"],["type","button","aria-label","Close",1,"contained-panel__close",3,"click"],["name","close","size","16"],[1,"contained-panel__body"],[1,"prompt-gallery-subtitle"],[1,"prompt-gallery"],["role","separator","aria-orientation","vertical","aria-label","Resize chat column",1,"chat-layout__resizer",3,"pointerdown","pointermove","pointerup","pointercancel"],[1,"dashboard-slider"],[1,"dashboard-slider__body"],[3,"filterSubmit","filterChange","widgetChartTypeChanged","widgetFiltersChanged","setAlert","widgets","editMode","outerMargin","dashboardId","persistToPublished","canSetAlert","canAddToStory"],[3,"closed","saved","open","widget","dashboardId","source"],[1,"input-query-container"],[1,"chat-input-pill"],["type","text","placeholder","Enter your query",1,"input-query",3,"input","keyup.enter","value"],[1,"pill-toolbar"],[1,"pill-toolbar__right"],["method","stroke",1,"mic-icon",3,"click","name","ngClass"],["method","stroke",1,"send-icon",3,"click","name","size","ngClass"]],template:function(e,n){e&1&&(a(0,"div",2),C(1,Pn,4,8,"div",3),l(),$(2,Mn,7,12,"ng-template",null,0,ue)),e&2&&(c(),v(n.loadingAllChat()?-1:1))},dependencies:[Me,at,Pe,Et,Te,Ae],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;height:100%;min-height:0}.qna-panel[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;background:var(--ng-colors-bg-secondary, #f9fafb);font-family:var(--ng-font-family-body)}.chat-layout[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:row;overflow:hidden;min-height:0;container-type:inline-size}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%]{cursor:col-resize;-webkit-user-select:none;user-select:none}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%] .chat-column[_ngcontent-%COMP%]{transition:none!important}.chat-layout.chat-layout--resizing[_ngcontent-%COMP%] .chat-layout__resizer[_ngcontent-%COMP%]:after{opacity:1}.chat-layout__resizer[_ngcontent-%COMP%]{flex:0 0 1px;align-self:stretch;cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none;position:relative;background:transparent}.chat-layout__resizer[_ngcontent-%COMP%]:before{content:"";position:absolute;top:0;bottom:0;left:50%;transform:translate(-50%);width:1px;background:var(--ng-colors-border-secondary, #e9eaeb);transition:background .15s}.chat-layout__resizer[_ngcontent-%COMP%]:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:4px;height:36px;border-radius:999px;background:#2970ff;opacity:0;transition:opacity .15s;pointer-events:none}.chat-layout__resizer[_ngcontent-%COMP%]:hover:before{background:#2970ff;opacity:0;transition:opacity .15s;pointer-events:none}.chat-layout__resizer[_ngcontent-%COMP%]:hover:after{opacity:1}.dashboard-slider[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden;min-width:0;min-height:0;background:var(--ng-colors-bg-secondary, #f9fafb);animation:_ngcontent-%COMP%_slider-in .25s ease-out}.dashboard-slider__header[_ngcontent-%COMP%]{height:56px;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box}.dashboard-slider__title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27)}.dashboard-slider__body[_ngcontent-%COMP%]{flex:1;min-height:0;min-width:0;overflow:auto;padding:8px}.dashboard-slider__body[_ngcontent-%COMP%] > shared-dashboard-grid[_ngcontent-%COMP%]{display:block;min-width:calc(66.6667cqw - 32px)}@keyframes _ngcontent-%COMP%_slider-in{0%{transform:translate(24px);opacity:0}to{transform:translate(0);opacity:1}}.chat-column[_ngcontent-%COMP%]{flex:1 1 auto;display:flex;flex-direction:column;overflow:hidden;min-width:0;position:relative;background:#fff;container-type:inline-size;transition:flex-basis .3s ease,flex .3s ease}.chat-column.chat-column--split[_ngcontent-%COMP%]{flex:0 0 33.333%}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%]{padding:16px 16px 8px;flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:flex-end}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%] .close-panel-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .chat-header[_ngcontent-%COMP%] .close-panel-icon[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900, #181d27)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%]{flex:1;overflow:auto;padding:20px 24px;display:flex;flex-direction:column-reverse}.chat-column[_ngcontent-%COMP%] .chat-message-container.recommend-window[_ngcontent-%COMP%]{justify-content:center;align-items:center;padding:32px 40px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user-row[_ngcontent-%COMP%]{display:flex;flex-direction:row-reverse;justify-content:flex-start;align-items:flex-start;gap:8px;margin-bottom:20px;margin-top:8px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user[_ngcontent-%COMP%]{flex:0 1 auto;min-width:0}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{background:#eff4ff;color:var(--ng-colors-text-primary-900, #181d27);padding:9px 14px;border-radius:14px 14px 2px;font-size:14px;display:inline-block;max-width:100%;text-align:left}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .user-icon[_ngcontent-%COMP%]{flex-shrink:0;width:28px;height:28px;border-radius:50%;background:#eff4ff;color:#2970ff;display:inline-flex;align-items:center;justify-content:center}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .assistant-icon[_ngcontent-%COMP%]{margin-bottom:6px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .assistant[_ngcontent-%COMP%]{padding:14px 16px;background:var(--ng-colors-bg-secondary, #f9fafb);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:2px 14px 14px;margin-bottom:14px;font-size:14px;line-height:1.65;color:var(--ng-colors-text-primary-900, #181d27)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .generating-loader[_ngcontent-%COMP%]{padding:10px 14px;height:40px;display:flex;gap:8px;align-items:center;background:var(--ng-colors-bg-secondary, #f9fafb);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:8px;font-size:13px;color:var(--ng-colors-text-tertiary-600, #535862);width:fit-content}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;max-width:820px;text-align:center}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-icon-wrap[_ngcontent-%COMP%]{margin-bottom:4px}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-title[_ngcontent-%COMP%]{margin:0;font-size:22px;font-weight:700;color:var(--ng-colors-text-primary-900, #181d27);letter-spacing:-.02em}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .welcome-section[_ngcontent-%COMP%] .welcome-subtitle[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;color:var(--ng-colors-text-tertiary-600, #535862);max-width:440px;line-height:1.6}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .browse-more[_ngcontent-%COMP%]{margin-top:4px;align-self:flex-end;display:inline-flex;align-items:center;gap:6px;padding:6px 4px;background:transparent;border:0;cursor:pointer;font-size:12px;font-weight:500;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .browse-more[_ngcontent-%COMP%]:hover{color:#2970ff}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;width:100%}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;font:inherit;color:inherit;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:14px;padding:18px;cursor:pointer;transition:border-color .18s,box-shadow .18s,transform .15s;background:#fff;text-align:left}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a;transform:translateY(-2px)}.chat-column[_ngcontent-%COMP%] .chat-message-container[_ngcontent-%COMP%] .recommended[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%] .rec-title[_ngcontent-%COMP%]{font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);text-transform:capitalize;line-height:1.4}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%]{padding:14px 24px 18px;display:flex;justify-content:center;flex-shrink:0;background:#fff}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .chat-input-pill[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;width:100%;max-width:760px;padding:14px 16px 12px;background:#fff;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:24px;box-shadow:0 1px 2px #1018280a,0 8px 24px #1018280f;cursor:text;transition:border-color .15s,box-shadow .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .chat-input-pill[_ngcontent-%COMP%]:focus-within{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff1f}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .input-query[_ngcontent-%COMP%]{width:100%;min-width:0;border:0;outline:0;background:transparent;padding:6px 2px;font:inherit;font-size:15px;color:var(--ng-colors-text-primary-900, #181d27);text-overflow:ellipsis}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .input-query[_ngcontent-%COMP%]::placeholder{color:var(--ng-colors-text-tertiary-600, #717680);overflow:hidden;text-overflow:ellipsis}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .pill-toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .pill-toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon[_ngcontent-%COMP%]{cursor:pointer;flex-shrink:0;transition:opacity .15s,transform .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon[_ngcontent-%COMP%]:hover{transform:translate(2px)}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .send-icon.disabled[_ngcontent-%COMP%]{opacity:.2;pointer-events:none}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon[_ngcontent-%COMP%]{cursor:pointer;color:var(--ng-colors-text-tertiary-600, #535862);transition:color .15s}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon[_ngcontent-%COMP%]:hover{color:#2970ff}.chat-column[_ngcontent-%COMP%] .input-query-container[_ngcontent-%COMP%] .mic-icon.mic-listening[_ngcontent-%COMP%]{color:#e53e3e;animation:_ngcontent-%COMP%_mic-pulse 1.2s ease-in-out infinite}.chat-column[_ngcontent-%COMP%] .input-query-container.input-query-container--welcome[_ngcontent-%COMP%]{border-top:0;background:transparent;padding:4px 0 12px;width:100%;max-width:680px}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(1.3)}}.dashboard-slider__body[_ngcontent-%COMP%]{padding:unset}.contained-panel[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;background:#fff;border-left:1px solid var(--ng-colors-border-secondary, #e9eaeb);box-shadow:-8px 0 24px #10182814;z-index:var(--z-floating);animation:_ngcontent-%COMP%_contained-slide .25s ease-out}.contained-panel__header[_ngcontent-%COMP%]{height:56px;padding:0 16px;border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:8px;box-sizing:border-box}.contained-panel__close[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;padding:4px;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;transition:color .15s;flex-shrink:0}.contained-panel__close[_ngcontent-%COMP%]:hover{color:var(--ng-colors-text-primary-900, #181d27)}.contained-panel__title[_ngcontent-%COMP%]{font-size:14px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contained-panel__body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow:auto;padding:16px 20px 20px}.prompt-gallery-subtitle[_ngcontent-%COMP%]{margin:0 0 24px;font-size:13px;color:var(--ng-colors-text-tertiary-600, #535862)}.prompt-gallery[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr;gap:12px;padding:6px 6px 8px}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:10px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;padding:12px 16px;cursor:pointer;background:#fff;text-align:left;font:inherit;color:inherit;transition:border-color .18s,box-shadow .18s,transform .15s}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%]:hover{border-color:#2970ff;box-shadow:0 6px 24px #2970ff1a;transform:translateY(-2px)}.prompt-gallery[_ngcontent-%COMP%] .recommended-box[_ngcontent-%COMP%] .rec-title[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:var(--ng-colors-text-secondary-700, #414651);line-height:1.45}@keyframes _ngcontent-%COMP%_contained-slide{0%{transform:translate(8px);opacity:0}to{transform:translate(0);opacity:1}}.chat-system[_ngcontent-%COMP%]{margin:4px 0;font-size:13px;line-height:1.4;color:var(--ng-colors-text-tertiary-600, #535862)}.chat-system--error[_ngcontent-%COMP%]{color:var(--ng-colors-fg-error-primary, #d92d20);font-weight:500}']})};var Dn=r=>[r];function Sn(r,t){if(r&1&&me(0,"nile-progress-bar",4),r&2){let e=d();nt("value",e.percent())}}var Ne=class r{streamId;done=new he;failed=new he;streamService=w(Ht);totalCharts=_(0);widgetPhases=_([]);phaseLabel=_("Connecting to your data\u2026");dashboardNumber=_(0);barKey=_(0);pendingNewDashboard=!0;readyCount=O(()=>this.widgetPhases().filter(t=>t==="building"||t==="saving").length);percent=O(()=>{let t=this.totalCharts();if(!t)return 0;let e=this.widgetPhases(),n=0;for(let i=0;i<t;i++){let o=e[i];n+=o==="building"||o==="saving"?1:o==="querying"?.66:o==="analyzing"?.33:0}return Math.round(Math.min(1,n/t)*100)});countLabel=O(()=>{let t=this.totalCharts(),e=this.dashboardNumber();return!t||!e?"":`Dashboard ${e} \xB7 ${this.readyCount()} of ${t} charts`});finished=!1;dispose=null;ngOnInit(){if(!this.streamId){this.failed.emit();return}this.dispose=this.streamService.stream(this.streamId,t=>this.onEvent(t))}ngOnDestroy(){this.teardown()}onEvent(t){switch(t.kind){case"progress":{this.pendingNewDashboard&&(this.dashboardNumber.update(e=>e+1),this.pendingNewDashboard=!1),this.totalCharts.set(t.totalWidgets),this.widgetPhases.update(e=>{let n=[...e];return n[t.widgetIndex]=qt(n[t.widgetIndex],t.phase),n}),this.phaseLabel.set(t.label);break}case"dashboard-start":{this.resetForNextDashboard(t.dashboardName?`Setting up ${t.dashboardName}\u2026`:"Preparing the next dashboard\u2026");break}case"saved":{this.resetForNextDashboard("Preparing the next dashboard\u2026");break}case"complete":{t.dashboardIds.length>0?this.finish(()=>this.done.emit(t.dashboardIds)):this.finish(()=>this.failed.emit());break}case"error":{t.dashboardIds.length>0?this.finish(()=>this.done.emit(t.dashboardIds)):this.finish(()=>this.failed.emit());break}}}resetForNextDashboard(t){this.barKey.update(e=>e+1),this.pendingNewDashboard=!0,this.totalCharts.set(0),this.widgetPhases.set([]),this.phaseLabel.set(t)}finish(t){this.finished||(this.finished=!0,this.teardown(),t())}teardown(){this.dispose?.(),this.dispose=null}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["app-dashboard-generating"]],inputs:{streamId:"streamId"},outputs:{done:"done",failed:"failed"},decls:13,vars:4,consts:[["role","status","aria-live","polite",1,"genbar"],["variant","informative","size","medium","pulse","",1,"genbar__light"],[1,"genbar__title"],["aria-hidden","true",1,"genbar__divider"],[1,"genbar__bar",3,"value"],[1,"genbar__count"],[1,"genbar__live"],["aria-hidden","true",1,"genbar__spinner"],[1,"genbar__status"]],template:function(e,n){e&1&&(oe(0,"div",0),me(1,"nile-status-light",1),oe(2,"span",2),P(3,"Generating your dashboards"),we(),me(4,"span",3),I(5,Sn,1,1,"nile-progress-bar",4,tt),oe(7,"span",5),P(8),we(),oe(9,"div",6),me(10,"nile-spinner",7),oe(11,"span",8),P(12),we()()()),e&2&&(c(5),E(le(2,Dn,n.barKey())),c(3),L(n.countLabel()),c(4),L(n.phaseLabel()))},styles:["[_nghost-%COMP%]{display:block;width:100%}.genbar[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--ng-spacing-md, 12px);width:100%;min-width:0;padding-inline-start:var(--ng-spacing-lg, 16px)}.genbar__light[_ngcontent-%COMP%]{flex:none}.genbar__title[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);font-weight:var(--ng-font-weight-semibold, 600);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-primary-900, #181d27);white-space:nowrap}.genbar__divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary, #e9eaeb);flex:none}.genbar__bar[_ngcontent-%COMP%]{width:160px;flex:none}.genbar__count[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-tertiary-600, #535862);white-space:nowrap}.genbar__live[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none;min-width:0}.genbar__spinner[_ngcontent-%COMP%]{font-size:14px;--indicator-color: #2970ff;--track-color: rgba(41, 112, 255, .2);flex:none}.genbar__status[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);line-height:var(--ng-line-height-text-sm, 1.4);color:var(--ng-colors-text-tertiary-600, #535862);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}@media(max-width:760px){.genbar__divider[_ngcontent-%COMP%], .genbar__bar[_ngcontent-%COMP%], .genbar__count[_ngcontent-%COMP%]{display:none}}"]})};var kn=["tabsScroller"],Zt=()=>({subtitle:"Explore your dashboards or ask your data a question"}),On=()=>({subtitle:"Setting up your initial dashboards \u2014 crafting a starter set from your data."}),Tn=(r,t)=>t.id;function Fn(r,t){if(r&1&&(a(0,"header",8),H(1,16),l()),r&2){d(2);let e=V(6);c(),y("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,Zt))}}function An(r,t){if(r&1&&h(0,"nile-skeleton-loader",11),r&2){let e=t.$implicit;X("width",e)}}function In(r,t){r&1&&h(0,"nile-skeleton-loader",14)}function En(r,t){r&1&&H(0)}function Rn(r,t){if(r&1&&(a(0,"div",5)(1,"div",7),C(2,Fn,2,3,"header",8),a(3,"div",9)(4,"div",10),I(5,An,1,1,"nile-skeleton-loader",11,Z),l(),h(7,"span",12)(8,"nile-skeleton-loader",13),I(9,In,1,0,"nile-skeleton-loader",14,Z),l(),$(11,En,1,0,"ng-container",15),l()()),r&2){let e=d(),n=V(8);c(2),v(e.showHeader()?2:-1),c(3),E(e.skeletonTabWidths),c(4),E(e.skeletonActionBtns),c(2),y("ngTemplateOutlet",n)}}function zn(r,t){if(r&1&&(a(0,"header",8),H(1,16),l()),r&2){d(2);let e=V(6);c(),y("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,On))}}function Nn(r,t){if(r&1){let e=D();a(0,"app-dashboard-generating",18),b("done",function(i){u(e);let o=d(2);return f(o.onGenerationDone(i))})("failed",function(){u(e);let i=d(2);return f(i.onGenerationFailed())}),l()}if(r&2){let e=d(2);y("streamId",e.generationStreamId())}}function Vn(r,t){r&1&&H(0)}function Wn(r,t){if(r&1&&(a(0,"div",6)(1,"div",7),C(2,zn,2,3,"header",8),a(3,"div",9),C(4,Nn,1,1,"app-dashboard-generating",17),l()(),$(5,Vn,1,0,"ng-container",15),l()),r&2){let e=d(),n=V(8);c(2),v(e.showHeader()?2:-1),c(2),v(e.features().autoGenerate?4:-1),c(),y("ngTemplateOutlet",n)}}function qn(r,t){if(r&1&&(a(0,"header",8),H(1,16),l()),r&2){d(2);let e=V(6);c(),y("ngTemplateOutlet",e)("ngTemplateOutletContext",ie(2,Zt))}}function Hn(r,t){r&1&&h(0,"nile-glyph",48)}function Ln(r,t){if(r&1){let e=D();a(0,"span",50),b("click",function(i){return i.stopPropagation()}),a(1,"input",51,3),b("input",function(){u(e);let i=V(2),o=d(4);return f(o.onRenameInputChange(i.value))})("keydown",function(i){u(e);let o=d().$implicit,s=d(3);return f(s.onRenameInputKeydown(i,o))})("click",function(i){return i.stopPropagation()}),l(),a(3,"button",52),b("click",function(i){u(e);let o=d().$implicit,s=d(3);return f(s.commitRenameDashboard(o,i))}),h(4,"nile-glyph",53),l()()}if(r&2){let e=d().$implicit,n=d(3);c(),y("value",n.renamingValue())("disabled",n.isRenamingDashboard()),X("data-dashboard-id",e.id),c(2),y("disabled",n.isRenamingDashboard())}}function Gn(r,t){if(r&1){let e=D();a(0,"button",56),b("click",function(i){u(e);let o=d(2).$implicit,s=d(3);return f(s.startRenameDashboard(o,i))}),h(1,"nile-glyph",57),l()}}function $n(r,t){if(r&1&&(a(0,"span",54),P(1),l(),C(2,Gn,2,0,"button",55)),r&2){let e=d().$implicit,n=d(3);c(),L(e.name),c(),v(n.features().rename&&!e.isAutoGenerated?2:-1)}}function Bn(r,t){if(r&1){let e=D();a(0,"nile-nav-tab",47),b("click",function(){let i=u(e).$implicit,o=d(3);return f(o.setActiveTab(i.id))}),C(1,Hn,1,0,"nile-glyph",48),C(2,Ln,5,4,"span",49)(3,$n,3,2),l()}if(r&2){let e=t.$implicit,n=d(3);X("panel",e.id),c(),v(e.isAutoGenerated?1:-1),c(),v(n.renamingDashboardId()===e.id?2:3)}}function Un(r,t){if(r&1){let e=D();a(0,"nile-lite-tooltip",35)(1,"button",58),b("click",function(){u(e);let i=d(3);return f(i.refreshActiveDashboard())}),h(2,"nile-glyph",59),l()()}if(r&2){let e=d(3);c(),y("disabled",!e.activeTabId()||e.refreshingDashboard()),c(),ne("home-refresh-glyph--spinning",e.refreshingDashboard())}}function jn(r,t){if(r&1){let e=D();a(0,"app-time-range-picker",60),b("apply",function(i){u(e);let o=d(3);return f(o.onTimeRangeApply(i))}),l()}if(r&2){let e=d(3);y("resetKey",e.activeTabId())}}function Zn(r,t){r&1&&h(0,"span",41)}function Yn(r,t){if(r&1){let e=D();a(0,"nile-lite-tooltip",45)(1,"button",61),b("click",function(){u(e);let i=d(3);return f(i.selectHomeMenuItem("executiveSummary"))}),h(2,"nile-glyph",62),l()()}}function Qn(r,t){if(r&1){let e=D();a(0,"nile-dropdown",63),b("nile-hide",function(){u(e);let i=d(3);return f(i.downloadMenuOpen.set(!1))}),a(1,"nile-lite-tooltip",64)(2,"button",65),b("click",function(){u(e);let i=d(3);return f(i.downloadMenuOpen.set(!i.downloadMenuOpen()))}),h(3,"nile-glyph",66),l()(),a(4,"nile-menu")(5,"nile-menu-item",67),b("click",function(){u(e);let i=d(3);return i.downloadMenuOpen.set(!1),f(i.selectHomeMenuItem("exportPdf"))}),h(6,"nile-glyph",68),P(7," Download as PDF "),l(),a(8,"nile-menu-item",67),b("click",function(){u(e);let i=d(3);return i.downloadMenuOpen.set(!1),f(i.selectHomeMenuItem("exportPng"))}),h(9,"nile-glyph",69),P(10," Download as PNG "),l()()()}if(r&2){let e=d(3);y("open",e.downloadMenuOpen())}}function Kn(r,t){if(r&1){let e=D();a(0,"div",23)(1,"button",24),b("click",function(){u(e);let i=d(2);return f(i.scrollTabs(-1))}),h(2,"nile-glyph",25),l(),a(3,"div",26,2),b("scroll",function(){u(e);let i=d(2);return f(i.onTabsScroll())}),a(5,"nile-nav-tab-group",27),h(6,"nile-nav-tab",28),I(7,Bn,4,3,"nile-nav-tab",29,Tn),l()(),a(9,"button",30),b("click",function(){u(e);let i=d(2);return f(i.scrollTabs(1))}),h(10,"nile-glyph",31),l(),h(11,"span",12),a(12,"nile-lite-tooltip",32)(13,"button",33),b("click",function(){u(e);let i=d(2);return f(i.goToCreateDashboard())}),h(14,"nile-glyph",34),l()(),C(15,Un,3,3,"nile-lite-tooltip",35),C(16,jn,1,1,"app-time-range-picker",36),a(17,"nile-dropdown",37),b("nile-hide",function(){u(e);let i=d(2);return f(i.categoryFilterOpen.set(!1))}),a(18,"nile-lite-tooltip",38)(19,"button",39),b("click",function(){u(e);let i=d(2);return f(i.categoryFilterOpen.set(!i.categoryFilterOpen()))}),h(20,"nile-glyph",40),C(21,Zn,1,0,"span",41),l()(),a(22,"div",42),b("mousedown",function(i){return i.stopPropagation()}),a(23,"shared-category-filter-row",43),b("selectionChange",function(i){u(e);let o=d(2);return f(o.onCategoryFilterChange(i))}),l()()(),a(24,"div",44),C(25,Yn,3,0,"nile-lite-tooltip",45),C(26,Qn,11,1,"nile-dropdown",46),l()()}if(r&2){let e=d(2);ne("is-scrollable",e.canScrollLeft()||e.canScrollRight()),c(),y("disabled",!e.canScrollLeft()),c(4),X("value",e.activeTabId()||"__sentinel__"),c(2),E(e.visibleDashboards()),c(2),y("disabled",!e.canScrollRight()),c(4),y("disabled",e.creatingDashboard()),c(2),v(e.features().refresh?15:-1),c(),v(e.activeTabId()?16:-1),c(),y("open",e.categoryFilterOpen()),c(4),v(e.selectedCategory()?21:-1),c(2),y("selected",e.selectedCategory()),c(2),v(e.features().executiveSummary?25:-1),c(),v(e.features().export?26:-1)}}function Jn(r,t){if(r&1&&(a(0,"nile-nav-tab-panel",70),h(1,"app-dashboard-viewer",72),l()),r&2){let e=d(3);X("name",e.activeTabId()),c(),y("config",e.loadedDashboards().get(e.activeTabId()))}}function Xn(r,t){r&1&&H(0)}function ei(r,t){if(r&1&&(a(0,"div",71),$(1,Xn,1,0,"ng-container",15),l()),r&2){d(3);let e=V(8);c(),y("ngTemplateOutlet",e)}}function ti(r,t){if(r&1&&C(0,Jn,2,2,"nile-nav-tab-panel",70)(1,ei,2,1,"div",71),r&2){let e=d(2);v(e.loadedDashboards().has(e.activeTabId())?0:e.isTabLoading()||e.refreshingDashboard()?1:-1)}}function ni(r,t){if(r&1){let e=D();a(0,"div",20)(1,"h2",73),P(2,"No dashboards in this category"),l(),a(3,"p",74),P(4,"Try a different category, or clear the filter to see everything."),l(),a(5,"nile-button",75),b("click",function(){u(e);let i=d(2);return f(i.onCategoryFilterChange(null))}),P(6," Clear filter "),l()()}}function ii(r,t){if(r&1){let e=D();a(0,"div",20)(1,"div",76),Ye(),a(2,"svg",77),h(3,"rect",78)(4,"rect",79)(5,"rect",80),a(6,"rect",81),h(7,"animate",82)(8,"animate",83),l(),a(9,"rect",84),h(10,"animate",85)(11,"animate",86),l(),a(12,"rect",87),h(13,"animate",88)(14,"animate",89),l(),a(15,"rect",90),h(16,"animate",91)(17,"animate",92),l(),a(18,"rect",93),h(19,"animate",94)(20,"animate",95),l(),h(21,"rect",96)(22,"rect",97)(23,"circle",98),a(24,"circle",99),h(25,"animate",100),l(),h(26,"rect",101)(27,"rect",102),a(28,"path",103),h(29,"animate",104),l(),a(30,"circle",105),h(31,"animate",106),l()()(),Qe(),a(32,"h2",73),P(33,"Build your dashboard"),l(),a(34,"p",74),P(35," Tap the below button to generate dashboard. "),l(),a(36,"nile-button",107),b("click",function(){u(e);let i=d(2);return f(i.goToCreateDashboard())}),h(37,"nile-glyph",108),P(38," Create dashboard "),l()()}if(r&2){let e=d(2);c(36),X("disabled",e.creatingDashboard()?"":null)}}function ri(r,t){if(r&1){let e=D();a(0,"db-ai-prompt-panel",109),b("closePanel",function(){u(e);let i=d(2);return f(i.showAiPanel.set(!1))}),l()}if(r&2){let e=d(2);y("dashboardId",e.activeTabId())("dashboardName",e.activeDashboardName())("dashboardConfig",e.loadedDashboards().get(e.activeTabId())??null)("chatOnly",e.aiChatOnly())("initialPrompt",e.aiInitialPrompt())}}function oi(r,t){if(r&1){let e=D();a(0,"div",6)(1,"div",7),C(2,qn,2,3,"header",8),C(3,Kn,27,13,"div",19),C(4,ti,2,1)(5,ni,7,0,"div",20)(6,ii,39,1,"div",20),a(7,"nile-drawer",21),b("nile-request-close",function(){u(e);let i=d();return f(i.showAiPanel.set(!1))}),C(8,ri,1,5,"db-ai-prompt-panel",22),l()()()}if(r&2){let e=d();c(2),v(e.showHeader()?2:-1),c(),v(e.allDashboards().length>0?3:-1),c(),v(e.activeTabId()?4:e.allDashboards().length>0?5:e.allDashboards().length===0?6:-1),c(3),y("open",e.showAiPanel()),c(),v(e.features().aiPrompt&&e.showAiPanel()?8:-1)}}function ai(r,t){if(r&1&&(a(0,"div",110)(1,"h1",111),P(2,"Dashboards"),l(),a(3,"p",112),P(4),l()()),r&2){let e=t.subtitle;c(4),L(e)}}function si(r,t){r&1&&(a(0,"div",115)(1,"div",118),h(2,"nile-skeleton-loader",119)(3,"nile-skeleton-loader",120),l(),h(4,"nile-skeleton-loader",121),a(5,"div",122),h(6,"nile-skeleton-loader",123)(7,"nile-skeleton-loader",124),l(),h(8,"nile-skeleton-loader",125),l())}function li(r,t){r&1&&(a(0,"div",117)(1,"div",126)(2,"div",127),h(3,"nile-skeleton-loader",128)(4,"nile-skeleton-loader",129),l(),h(5,"nile-skeleton-loader",130),l(),h(6,"nile-skeleton-loader",131),l())}function di(r,t){if(r&1&&(a(0,"div",113)(1,"div",114),I(2,si,9,0,"div",115,Z),l(),a(4,"div",116),I(5,li,7,0,"div",117,Z),l()()),r&2){let e=d();c(2),E(e.skeletonKpis),c(3),E(e.skeletonWidgets)}}var Ge=4,Ve=class r{MAX_TABS=Ge;tabsScrollerEl;dashboardViewerRef;onTimeRangeApply(t){this.dashboardViewerRef?.applyTimeRange(t)}tabsScrollLeft=_(0);tabsClientWidth=_(0);tabsScrollWidth=_(0);canScrollLeft=O(()=>this.tabsScrollLeft()>0);canScrollRight=O(()=>this.tabsScrollLeft()+this.tabsClientWidth()<this.tabsScrollWidth()-1);onTabsScroll(){this.updateTabsScrollState()}updateTabsScrollState(){let t=this.tabsScrollerEl?.nativeElement;t&&(this.tabsScrollLeft.set(t.scrollLeft),this.tabsClientWidth.set(t.clientWidth),this.tabsScrollWidth.set(t.scrollWidth))}scrollTabs(t){let e=this.tabsScrollerEl?.nativeElement;e&&e.scrollBy({left:t*e.clientWidth*.8,behavior:"smooth"})}scrollActiveTabIntoView(){let t=this.tabsScrollerEl?.nativeElement;if(!t)return;let e=this.activeTabId();if(!e)return;let n=window.CSS&&CSS.escape?CSS.escape(e):e.replace(/"/g,'\\"'),i=t.querySelector(`nile-nav-tab[panel="${n}"]`);if(!i)return;let o=i.getBoundingClientRect(),s=t.getBoundingClientRect(),g=16;o.right>s.right?t.scrollBy({left:o.right-s.right+g,behavior:"smooth"}):o.left<s.left&&t.scrollBy({left:o.left-s.left-g,behavior:"smooth"})}onWindowResize=()=>this.ngZone.run(()=>this.updateTabsScrollState());showAiPanel=_(!1);aiChatOnly=_(!1);aiInitialPrompt=_("");allDashboards=_([]);selectedCategory=_(null);categoryFilterOpen=_(!1);visibleDashboards=O(()=>{let t=this.selectedCategory(),e=this.allDashboards();return t?e.filter(n=>n.category?.includes(t)):e});activeTabs=_([]);activeTabId=_("");loadedDashboards=_(new Map);isLoading=_(!0);isTabLoading=_(!1);skeletonTabWidths=[72,220,140];skeletonKpis=Array.from({length:4});skeletonWidgets=Array.from({length:4});skeletonActionBtns=Array.from({length:4});showMore=O(()=>this.allDashboards().length>0);activeDashboardName=O(()=>this.allDashboards().find(t=>t.id===this.activeTabId())?.name??"");activeConfig=O(()=>this.loadedDashboards().get(this.activeTabId())??null);isExporting=_(!1);showExportDropdown=_(!1);downloadMenuOpen=_(!1);creatingDashboard=_(!1);generationStreamId=_("");isGenerating=O(()=>this.generationStreamId()!=="");generationSettled=!1;showHeader(){return S().ui.header}features(){return S().features}copy(){return S().copy}service=w(pe);ngZone=w(Ce);el=w(ve);navigator=w(B);routeProgress=w(It);autoDashboard=w(Wt);goToCreateDashboard(){this.creatingDashboard()||(this.creatingDashboard.set(!0),this.navigator.toAskAquera())}constructor(){J(()=>{this.activeTabId(),this.allDashboards(),queueMicrotask(()=>this.scrollActiveTabIntoView())})}ngAfterViewChecked(){this.updateTabsScrollState()}onExportTriggerClick(){this.showExportDropdown.set(!this.showExportDropdown())}selectHomeMenuItem(t){if(t==="askAi")this.aiChatOnly.set(!0),this.aiInitialPrompt.set(""),this.showAiPanel.set(!0);else if(t==="executiveSummary"){let e=this.activeTabId();e&&this.navigator.toAskAqueraDashboard(e,{summary:1})}else t==="exportPdf"?this.exportDashboardPdf():t==="exportPng"&&this.exportDashboardPng()}getDashboardTarget(){let t=this.activeTabId();return this.el.nativeElement.querySelector(`nile-nav-tab-panel[name="${t}"] app-dashboard-viewer gridster`)}async exportDashboardPdf(){if(this.isExporting())return;let t=this.getDashboardTarget();if(t){this.showExportDropdown.set(!1),this.isExporting.set(!0),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{let e=t.scrollWidth,n=t.scrollHeight,i=await He(t,{quality:1,width:e,height:n,cacheBust:!0,backgroundColor:"#ffffff",style:{height:`${n}px`,maxHeight:"none",overflow:"visible"}}),o=this.activeDashboardName()||"Dashboard",s=90,g=new Vt({orientation:e>n?"landscape":"portrait",unit:"px",format:[e,n+s]});g.setFillColor(245,245,248),g.rect(0,0,e,s,"F"),g.setFont("helvetica","bold"),g.setFontSize(28),g.setTextColor(50,50,60),g.text(o,e/2,s/2+7,{align:"center"}),g.addImage(i,"JPEG",0,s,e,n),g.save(`${o}.pdf`)}finally{this.isExporting.set(!1)}}}async exportDashboardPng(){if(this.isExporting())return;let t=this.getDashboardTarget();if(t){this.showExportDropdown.set(!1),this.isExporting.set(!0),await new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(e)));try{let e=t.scrollWidth,n=t.scrollHeight,i=await He(t,{quality:1,width:e,height:n,cacheBust:!0,backgroundColor:"#ffffff",style:{height:`${n}px`,maxHeight:"none",overflow:"visible"}}),o=this.activeDashboardName()||"Dashboard",s=90,g=document.createElement("canvas");g.width=e,g.height=n+s;let p=g.getContext("2d");p.fillStyle="#f5f5f8",p.fillRect(0,0,e,s),p.fillStyle="#32323c",p.font="bold 28px helvetica",p.textAlign="center",p.textBaseline="middle",p.fillText(o,e/2,s/2+7);let m=new Image;m.src=i,await new Promise(N=>{m.onload=()=>N()}),p.drawImage(m,0,s,e,n);let M=document.createElement("a");M.href=g.toDataURL("image/png"),M.download=`${o}.png`,M.click()}finally{this.isExporting.set(!1)}}}toggleAiPanel(){this.showAiPanel.update(t=>!t)}onToggleAiPanel=()=>this.ngZone.run(()=>this.showAiPanel.update(t=>!t));ngOnInit(){this.loadList(),window.addEventListener("dv:toggle-ai-panel",this.onToggleAiPanel),window.addEventListener("resize",this.onWindowResize)}ngOnDestroy(){window.removeEventListener("dv:toggle-ai-panel",this.onToggleAiPanel),window.removeEventListener("resize",this.onWindowResize)}async loadList(){this.isLoading.set(!0);try{let t=await this.routeProgress.track(this.service.loadDashboards());this.ngZone.run(()=>{this.allDashboards.set(t);let e=t.slice(0,Ge);this.activeTabs.set(e),e.length>0&&!this.activeTabId()&&(this.activeTabId.set(e[0].id),this.loadTab(e[0].id))}),t.length===0&&await this.checkAutoDashboard()}catch(t){console.error("Failed to load dashboards list:",t)}finally{this.ngZone.run(()=>this.isLoading.set(!1))}}async checkAutoDashboard(){if(!(this.generationSettled||this.isGenerating()))try{let t=await this.autoDashboard.trigger();t?.success&&!t.skipped&&t.streamId&&this.ngZone.run(()=>{this.generationStreamId.set(t.streamId)})}catch{}}onGenerationDone(t){this.generationSettled=!0,this.generationStreamId.set("");let e=t.length;this.loadList().then(()=>{this.showReadyToast(e>1?`${e} dashboards are ready`:"Your dashboard is ready")})}onGenerationFailed(){this.generationSettled=!0,this.generationStreamId.set("")}showReadyToast(t){W({variant:"success",title:"All set",content:t})}async loadTab(t){if(!this.loadedDashboards().has(t)){this.isTabLoading.set(!0);try{let e=await this.routeProgress.track(this.service.fetchDashboard(t));this.ngZone.run(()=>{let n=new Map(this.loadedDashboards());n.set(t,e),this.loadedDashboards.set(n)})}catch(e){console.error(`Failed to load dashboard ${t}:`,e)}finally{this.ngZone.run(()=>this.isTabLoading.set(!1))}}}refreshingDashboard=_(!1);async refreshActiveDashboard(){let t=this.activeTabId();if(!t||this.refreshingDashboard())return;let e=this.loadedDashboards().get(t);this.refreshingDashboard.set(!0),this.ngZone.run(()=>{let n=new Map(this.loadedDashboards());n.delete(t),this.loadedDashboards.set(n)});try{let n=await this.routeProgress.track(this.service.fetchDashboard(t));this.ngZone.run(()=>{let i=new Map(this.loadedDashboards());i.set(t,n),this.loadedDashboards.set(i)})}catch(n){console.error(`Failed to refresh dashboard ${t}:`,n),e&&this.ngZone.run(()=>{let i=new Map(this.loadedDashboards());i.set(t,e),this.loadedDashboards.set(i)})}finally{this.ngZone.run(()=>this.refreshingDashboard.set(!1))}}onTabChange(t){let e=t.detail.value;e!==this.activeTabId()&&this.setActiveTab(e)}onCategoryFilterChange(t){this.selectedCategory.set(t),this.categoryFilterOpen.set(!1);let e=this.visibleDashboards();e.some(n=>n.id===this.activeTabId())||(e.length>0?this.setActiveTab(e[0].id):this.activeTabId.set(""))}setActiveTab(t){this.showAiPanel.set(!1),this.activeTabId.set(t),this.loadTab(t)}isInActiveTabs(t){return this.activeTabs().some(e=>e.id===t)}canAdd(){return this.activeTabs().length<Ge}isLastActiveDashboard(t){return this.activeTabs().length===1&&this.isInActiveTabs(t)}renamingDashboardId=_(null);renamingValue=_("");isRenamingDashboard=_(!1);startRenameDashboard(t,e){e.stopPropagation(),!t.isAutoGenerated&&(this.renamingDashboardId.set(t.id),this.renamingValue.set(t.name),queueMicrotask(()=>{let n=this.el.nativeElement.querySelector(`.tab-rename-input[data-dashboard-id="${t.id}"]`);n?.focus(),n?.select()}))}onRenameInputChange(t){this.renamingValue.set(t)}onRenameInputKeydown(t,e){t.key==="Enter"?(t.preventDefault(),this.commitRenameDashboard(e)):t.key==="Escape"&&(t.preventDefault(),this.cancelRenameDashboard(t))}cancelRenameDashboard(t){t?.stopPropagation(),this.renamingDashboardId.set(null),this.renamingValue.set("")}async commitRenameDashboard(t,e){e?.stopPropagation();let n=this.renamingValue().trim();if(!n||n===t.name){this.cancelRenameDashboard();return}this.isRenamingDashboard.set(!0);try{await this.service.renameDashboard(t.id,n),this.ngZone.run(()=>{let i=o=>o.map(s=>s.id===t.id?z(x({},s),{name:n}):s);this.allDashboards.update(i),this.activeTabs.update(i),this.renamingDashboardId.set(null),this.renamingValue.set("")}),W({variant:"success",title:"Renamed",content:"Dashboard renamed."})}catch(i){let o=i instanceof Error?i.message:"Failed to rename dashboard.";W({variant:"error",title:"Rename failed",content:o})}finally{this.ngZone.run(()=>this.isRenamingDashboard.set(!1))}}onDashboardToggle(t,e){if(e){if(!this.canAdd())return;this.activeTabs.update(n=>[...n,t]),this.setActiveTab(t.id)}else{let n=this.activeTabId()===t.id;if(this.activeTabs.update(i=>i.filter(o=>o.id!==t.id)),n){let i=this.activeTabs();i.length>0?this.setActiveTab(i[0].id):this.activeTabId.set("")}}}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["dvz-dashboards-page"]],viewQuery:function(e,n){if(e&1&&ae(kn,5)(be,5),e&2){let i;ee(i=te())&&(n.tabsScrollerEl=i.first),ee(i=te())&&(n.dashboardViewerRef=i.first)}},decls:9,vars:3,consts:[["pageTitleBlock",""],["dashboardSkeleton",""],["tabsScroller",""],["renameInput",""],[1,"home-page"],["aria-hidden","true",1,"tabs-wrapper","home-skeleton"],[1,"tabs-wrapper"],[1,"tabs-bar"],[1,"home-nav"],[1,"tabs-bar__nav","home-skeleton__tabs-row"],[1,"home-skeleton__tab-pills"],["variant","rounded","height","28",1,"home-skeleton__tab"],["aria-hidden","true",1,"home-menu-divider"],["variant","rounded","width","32","height","28","border-radius","8px"],["variant","circular","width","28","height","28"],[4,"ngTemplateOutlet"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"streamId"],[3,"done","failed","streamId"],[1,"tabs-bar__nav",3,"is-scrollable"],[1,"home-empty-state"],["contained","","no-header","","placement","end","label","Ask",1,"home-ai-drawer",3,"nile-request-close","open"],[3,"dashboardId","dashboardName","dashboardConfig","chatOnly","initialPrompt"],[1,"tabs-bar__nav"],["type","button","aria-label","Scroll tabs left",1,"tabs-scroll-btn","tabs-scroll-btn--left",3,"click","disabled"],["name","ng-chevron-left","method","stroke","size","16"],[1,"tabs-scroller",3,"scroll"],["variant","filled",1,"dashboard-tab-group"],["slot","nav","panel","__sentinel__",1,"tab-sentinel"],["slot","nav"],["type","button","aria-label","Scroll tabs right",1,"tabs-scroll-btn","tabs-scroll-btn--right",3,"click","disabled"],["name","ng-chevron-right","method","stroke","size","16"],["content","Create dashboard"],["type","button","aria-label","Create dashboard",1,"home-action-btn",3,"click","disabled"],["name","ng-plus","method","stroke","size","18"],["content","Refresh dashboard"],[3,"resetKey"],["placement","bottom-end",1,"home-category-filter",3,"nile-hide","open"],["slot","trigger","content","Filter by category"],["type","button","aria-label","Filter by category",1,"home-action-btn",3,"click"],["name","ng-filter-lines","method","stroke","size","18"],["aria-hidden","true",1,"home-category-filter__dot"],[1,"home-category-filter__panel",3,"mousedown"],[3,"selectionChange","selected"],[1,"home-actions"],["content","Executive Summary"],["placement","bottom-end",1,"home-download",3,"open"],["slot","nav",3,"click"],["name","ng-stars-02","method","stroke","size","14","color","#7a5af8","aria-label","Auto-generated dashboard",1,"tab-auto-badge"],[1,"tab-rename"],[1,"tab-rename",3,"click"],["type","text",1,"tab-rename-input",3,"input","keydown","click","value","disabled"],["type","button","aria-label","Save dashboard name",1,"tab-rename-save",3,"click","disabled"],["name","ng-check","method","stroke","size","14","color","#2970ff"],[1,"tab-label"],["type","button","aria-label","Rename dashboard",1,"tab-edit-btn"],["type","button","aria-label","Rename dashboard",1,"tab-edit-btn",3,"click"],["name","ng-edit-02","method","stroke","size","12"],["type","button","aria-label","Refresh dashboard",1,"home-action-btn",3,"click","disabled"],["name","ng-refresh-ccw","method","stroke","size","18",1,"home-refresh-glyph"],[3,"apply","resetKey"],["type","button","aria-label","Executive Summary",1,"home-action-btn",3,"click"],["name","ng-file-02","method","stroke","size","18"],["placement","bottom-end",1,"home-download",3,"nile-hide","open"],["slot","trigger","content","Download"],["type","button","aria-label","Download",1,"home-action-btn",3,"click"],["name","ng-download-01","method","stroke","size","18"],[3,"click"],["slot","prefix","name","ng-file-06","method","stroke","size","14"],["slot","prefix","name","ng-image-03","method","stroke","size","14"],["active","",1,"viewer-scroll-container"],["aria-hidden","true",1,"home-skeleton"],[3,"config"],[1,"home-empty-state__title"],[1,"home-empty-state__desc"],["variant","tertiary",3,"click"],[1,"home-empty-state__graphic"],["viewBox","0 0 380 140","aria-hidden","true","preserveAspectRatio","xMidYMid meet"],["x","40","y","20","width","300","height","100","rx","8","fill","#fff","stroke","#80AED3","stroke-width","1.5","stroke-dasharray","4 4"],["x","56","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","64","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["x","64","y","80","width","6","height","20","rx","1","fill","#005EA6","opacity","0.7"],["attributeName","height","values","20;14;20","dur","2s","repeatCount","indefinite"],["attributeName","y","values","80;86;80","dur","2s","repeatCount","indefinite"],["x","76","y","74","width","6","height","26","rx","1","fill","#005EA6"],["attributeName","height","values","26;18;26","dur","2s","begin","0.2s","repeatCount","indefinite"],["attributeName","y","values","74;82;74","dur","2s","begin","0.2s","repeatCount","indefinite"],["x","88","y","68","width","6","height","32","rx","1","fill","#005EA6","opacity","0.85"],["attributeName","height","values","32;24;32","dur","2s","begin","0.4s","repeatCount","indefinite"],["attributeName","y","values","68;76;68","dur","2s","begin","0.4s","repeatCount","indefinite"],["x","100","y","78","width","6","height","22","rx","1","fill","#005EA6","opacity","0.6"],["attributeName","height","values","22;16;22","dur","2s","begin","0.6s","repeatCount","indefinite"],["attributeName","y","values","78;84;78","dur","2s","begin","0.6s","repeatCount","indefinite"],["x","112","y","66","width","6","height","34","rx","1","fill","#005EA6","opacity","0.85"],["attributeName","height","values","34;26;34","dur","2s","begin","0.8s","repeatCount","indefinite"],["attributeName","y","values","66;74;66","dur","2s","begin","0.8s","repeatCount","indefinite"],["x","148","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","156","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["cx","190","cy","78","r","14","fill","none","stroke","#E6EFF6","stroke-width","5"],["cx","190","cy","78","r","14","fill","none","stroke","#005EA6","stroke-width","5","stroke-linecap","round","stroke-dasharray","88","stroke-dashoffset","88","transform","rotate(-90 190 78)"],["attributeName","stroke-dashoffset","values","88;22;22;88","keyTimes","0;0.5;0.85;1","dur","2.6s","repeatCount","indefinite"],["x","240","y","36","width","84","height","68","rx","6","fill","#F7FAFC","stroke","#E6E9EB"],["x","248","y","44","width","40","height","3","rx","1.5","fill","#80AED3"],["d","M 250 92 L 264 80 L 278 86 L 292 72 L 306 78 L 320 64","fill","none","stroke","#005EA6","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round","stroke-dasharray","200","stroke-dashoffset","200"],["attributeName","stroke-dashoffset","values","200;0;0;200","keyTimes","0;0.5;0.85;1","dur","2.6s","repeatCount","indefinite"],["cx","320","cy","64","r","2.5","fill","#005EA6"],["attributeName","opacity","values","0;0;1;1;0","keyTimes","0;0.45;0.55;0.85;1","dur","2.6s","repeatCount","indefinite"],["variant","primary","aria-label","Create dashboard",1,"home-empty-state__cta",3,"click"],["slot","prefix","name","ng-plus","size","16"],[3,"closePanel","dashboardId","dashboardName","dashboardConfig","chatOnly","initialPrompt"],[1,"home-nav__title-block"],[1,"home-nav__title"],[1,"home-nav__sub"],[1,"home-skeleton__panel"],[1,"home-skeleton__kpis"],[1,"home-skeleton__kpi"],[1,"home-skeleton__widgets"],[1,"home-skeleton__widget"],[1,"home-skeleton__kpi-head"],["variant","text","width","56%","height","14"],["variant","rounded","width","32","height","32","border-radius","8px"],["variant","text","width","48%","height","30"],[1,"home-skeleton__kpi-row"],["variant","rounded","width","72","height","20","border-radius","999px"],["variant","text","width","38%","height","11"],["variant","rounded","width","100%","height","44","border-radius","8px",1,"home-skeleton__kpi-spark"],[1,"home-skeleton__widget-head"],[1,"home-skeleton__widget-titles"],["variant","text","width","42%","height","16"],["variant","text","width","64%","height","11"],["variant","circular","width","20","height","20"],["variant","rounded","width","100%","height","100%","border-radius","10px",1,"home-skeleton__widget-chart"]],template:function(e,n){e&1&&(a(0,"div",4),h(1,"wf-page-error"),C(2,Rn,12,2,"div",5),C(3,Wn,6,3,"div",6),C(4,oi,9,5,"div",6),l(),$(5,ai,5,1,"ng-template",null,0,ue)(7,di,7,0,"ng-template",null,1,ue)),e&2&&(c(2),v(n.isLoading()?2:-1),c(),v(!n.isLoading()&&n.isGenerating()?3:-1),c(),v(!n.isLoading()&&!n.isGenerating()?4:-1))},dependencies:[Pe,be,ze,Ne,Ft,Lt,Ie],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;height:100%;min-height:0}.home-page[_ngcontent-%COMP%]{height:100%;min-height:0;display:flex;flex-direction:column;background:var(--ng-colors-bg-active);overflow:visible;position:relative}.loading-state[_ngcontent-%COMP%], .empty-state[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:200px;color:var(--ng-colors-text-tertiary-600)}.home-empty-state[_ngcontent-%COMP%]{margin:24px;padding:56px 32px;display:flex;flex-direction:column;align-items:center;text-align:center;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px}.home-empty-state__graphic[_ngcontent-%COMP%]{width:380px;max-width:100%;height:140px;margin-bottom:24px;display:block}.home-empty-state__graphic[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{display:block;width:100%;height:100%}.home-empty-state__title[_ngcontent-%COMP%]{margin:0 0 8px;font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);letter-spacing:-.01em}.home-empty-state__desc[_ngcontent-%COMP%]{margin:0;max-width:480px;font-size:14px;line-height:1.5;color:var(--ng-colors-text-tertiary-600, #535862)}.home-empty-state__cta[_ngcontent-%COMP%]{margin-top:24px}.toolbar[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;height:64px;padding:0 38px;background:var(--ng-componentcolors-alpha-white-100);border-bottom:1px solid var(--ng-componentcolors-alpha-black-10);position:fixed;top:var(--nav-height, 56px);left:0;right:0;z-index:var(--z-header)}.toolbar__right[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--ng-spacing-3, 12px)}.tabs-wrapper[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;min-height:0}.tabs-bar[_ngcontent-%COMP%]{position:relative;min-height:0;display:flex;flex-direction:column}.tabs-bar[_ngcontent-%COMP%] .home-nav[_ngcontent-%COMP%]{position:sticky;top:0;z-index:var(--z-sticky-row);display:flex;align-items:center;justify-content:space-between;gap:16px;height:76px;margin:0;padding:0 22px;background:var(--ng-componentcolors-alpha-white-100, #ffffff);border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb);flex-shrink:0}.tabs-bar[_ngcontent-%COMP%] .home-nav__title-block[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;min-width:0}.tabs-bar[_ngcontent-%COMP%] .home-nav__title[_ngcontent-%COMP%]{margin:0;font-size:16px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);line-height:1.2;letter-spacing:-.01em}.tabs-bar[_ngcontent-%COMP%] .home-nav__sub[_ngcontent-%COMP%]{margin:0;font-size:13px;font-weight:400;color:var(--ng-colors-text-tertiary-600, #535862);line-height:1.3}.tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav[_ngcontent-%COMP%]{position:sticky;top:76px;height:56px;display:flex;align-items:center;gap:4px;z-index:var(--z-sticky-row);min-width:0;margin:0 0 8px;padding:22px;background:var(--ng-componentcolors-alpha-white-100, #ffffff);border-bottom:1px solid var(--ng-colors-border-secondary, #e9eaeb)}.tabs-bar[_ngcontent-%COMP%] .home-menu-divider[_ngcontent-%COMP%]{width:1px;height:20px;background:var(--ng-colors-border-secondary, #e9eaeb);margin:0 6px 0 8px;flex-shrink:0}.tabs-bar[_ngcontent-%COMP%] .tabs-scroller[_ngcontent-%COMP%]{flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;position:relative;scrollbar-width:none}.tabs-bar[_ngcontent-%COMP%] .tabs-scroller[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.tabs-bar[_ngcontent-%COMP%] .dashboard-tab-group[_ngcontent-%COMP%]{display:block;width:max-content;min-width:100%}.tabs-bar[_ngcontent-%COMP%] .tab-sentinel[_ngcontent-%COMP%]{display:none!important}.tabs-bar[_ngcontent-%COMP%] .tab-auto-badge[_ngcontent-%COMP%]{display:inline-flex;vertical-align:text-bottom;margin-right:4px;flex:0 0 auto}.tabs-bar[_ngcontent-%COMP%] .tab-label[_ngcontent-%COMP%]{white-space:nowrap}.tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin-left:4px;padding:0;border:0;background:transparent;border-radius:4px;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;opacity:0;pointer-events:none;flex:0 0 auto;transition:background .15s,opacity .15s,color .15s}.tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:hover, .tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:focus-visible{background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.tabs-bar[_ngcontent-%COMP%] nile-nav-tab[_ngcontent-%COMP%]:hover .tab-edit-btn[_ngcontent-%COMP%], .tabs-bar[_ngcontent-%COMP%] .tab-edit-btn[_ngcontent-%COMP%]:focus-visible{opacity:1;pointer-events:auto}.tabs-bar[_ngcontent-%COMP%] .tab-rename[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px}.tabs-bar[_ngcontent-%COMP%] .tab-rename-input[_ngcontent-%COMP%]{width:140px;height:24px;padding:0 6px;font-size:13px;font-weight:600;color:var(--ng-colors-text-primary-900, #181d27);background:#fff;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:6px;outline:none}.tabs-bar[_ngcontent-%COMP%] .tab-rename-input[_ngcontent-%COMP%]:focus{border-color:#2970ff;box-shadow:0 0 0 3px #2970ff29}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;background:transparent;border-radius:4px;cursor:pointer;flex:0 0 auto}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--ng-colors-bg-quaternary, #f2f4f7)}.tabs-bar[_ngcontent-%COMP%] .tab-rename-save[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.5}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0;opacity:0;pointer-events:none;transition:opacity .15s,background .15s,color .15s}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:hover, .tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:focus, .tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.tabs-bar[_ngcontent-%COMP%] .tabs-scroll-btn[disabled][_ngcontent-%COMP%]{cursor:default;color:var(--ng-colors-text-disabled, #a4a7ae);background:transparent}.tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav.is-scrollable[_ngcontent-%COMP%]:hover .tabs-scroll-btn[_ngcontent-%COMP%], .tabs-bar[_ngcontent-%COMP%] .tabs-bar__nav.is-scrollable[_ngcontent-%COMP%]:focus-within .tabs-scroll-btn[_ngcontent-%COMP%]{opacity:1;pointer-events:auto}.more-menu[_ngcontent-%COMP%]{width:260px;max-height:320px;overflow-y:auto;padding:var(--ng-spacing-xs) 0}.more-menu-item[_ngcontent-%COMP%]{padding:var(--ng-spacing-xs) var(--ng-spacing-md);display:flex;align-items:center;cursor:pointer}.more-menu-item[_ngcontent-%COMP%]:hover{background:var(--ng-colors-bg-secondary)}.more-menu-item[_ngcontent-%COMP%] nile-checkbox[_ngcontent-%COMP%]{width:100%}nile-tab-panel[_ngcontent-%COMP%], nile-nav-tab-panel[_ngcontent-%COMP%]{display:block;height:100%}.panel-loading[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;height:200px}.home-skeleton__tabs-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.home-skeleton__tab-pills[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;flex-shrink:0}.home-skeleton__tab[_ngcontent-%COMP%]{flex:0 0 auto}.home-skeleton__panel[_ngcontent-%COMP%]{flex:1;min-height:0;padding:18px 24px 32px;display:flex;flex-direction:column;gap:16px;overflow:auto}.home-skeleton__kpis[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}@media(max-width:1100px){.home-skeleton__kpis[_ngcontent-%COMP%]{grid-template-columns:repeat(2,1fr)}}.home-skeleton__kpi[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:18px 20px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:#fff}.home-skeleton__kpi-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:12px}.home-skeleton__kpi-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;margin-top:4px}.home-skeleton__kpi-spark[_ngcontent-%COMP%]{margin-top:6px}.home-skeleton__widgets[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}@media(max-width:900px){.home-skeleton__widgets[_ngcontent-%COMP%]{grid-template-columns:1fr}}.home-skeleton__widget[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:18px;padding:20px 22px;border:1px solid var(--ng-colors-border-secondary, #e9eaeb);border-radius:12px;background:#fff;min-height:320px}.home-skeleton__widget-head[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.home-skeleton__widget-titles[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:6px;flex:1;min-width:0}.home-skeleton__widget-chart[_ngcontent-%COMP%]{display:block;flex:1;min-height:0}.viewer-scroll-container[_ngcontent-%COMP%]{display:block;flex:1;min-height:0;overflow:auto}.viewer-scroll-container[_ngcontent-%COMP%]::part(base){padding:unset;min-height:100%}app-dashboard-viewer[_ngcontent-%COMP%], nile-dashboard-viewer[_ngcontent-%COMP%]{display:block;width:100%;height:100%}.export-menu[_ngcontent-%COMP%] nile-menu-item[_ngcontent-%COMP%]{font-size:var(--ng-font-size-text-sm, 14px);font-weight:var(--ng-font-weight-medium, 500)}.home-actions[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.home-action-btn[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;outline:0;background:transparent;color:var(--ng-colors-text-tertiary-600, #535862);cursor:pointer;border-radius:6px;flex-shrink:0}.home-action-btn[_ngcontent-%COMP%]:hover, .home-action-btn[_ngcontent-%COMP%]:focus, .home-action-btn[_ngcontent-%COMP%]:focus-visible{outline:0;background:var(--ng-colors-bg-active, #e9eaeb);color:var(--ng-colors-text-primary-900, #181d27)}.home-category-filter[_ngcontent-%COMP%] .home-action-btn[_ngcontent-%COMP%]{position:relative}.home-category-filter__dot[_ngcontent-%COMP%]{position:absolute;top:3px;right:3px;width:6px;height:6px;border-radius:50%;background:var(--ng-colors-fg-brand-primary-600)}.home-category-filter__panel[_ngcontent-%COMP%]{padding:10px;background:var(--ng-colors-bg-primary);border:1px solid var(--ng-colors-border-primary);border-radius:var(--ng-radius-lg);box-shadow:var(--ng-shadow-lg)}.home-refresh-glyph[_ngcontent-%COMP%]{display:inline-flex;transform-origin:50% 50%}.home-refresh-glyph--spinning[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_home-refresh-spin .9s linear infinite}@keyframes _ngcontent-%COMP%_home-refresh-spin{to{transform:rotate(360deg)}}.home-ai-drawer[_ngcontent-%COMP%]::part(base){z-index:var(--z-drawer, 900)}.home-ai-drawer[_ngcontent-%COMP%]::part(panel){width:100%;max-width:100%}.home-ai-drawer[_ngcontent-%COMP%]::part(body){padding:0;overflow:hidden}.home-ai-drawer[_ngcontent-%COMP%] db-ai-prompt-panel[_ngcontent-%COMP%]{display:block;height:100%;min-height:0}']})};function ci(r,t){r&1&&h(0,"dvz-dashboards-page")}var We=class r{config=Y(void 0);ready=fe({alias:"dvz-ready"});error=fe({alias:"dvz-error"});unauthorized=fe({alias:"dvz-unauthorized"});navigate=fe({alias:"dvz-navigate"});host=w(ve);navigator=w(B);destroyRef=w(Ke);stopAdopting=null;stopTokenRefresh=null;stopUi=null;configured=!1;constructor(){J(()=>{let t=this.config();t&&this.apply(t)}),this.navigator.requests.pipe(At(this.destroyRef)).subscribe(t=>this.navigate.emit(t)),queueMicrotask(()=>{let t=this.host.nativeElement.shadowRoot;t&&(this.stopAdopting=Be(t))})}async apply(t){let e=t.auth,n=Bt({baseUrl:t.api.baseUrl,mcpUrl:t.api.mcpUrl,tokenizedOrigins:t.api.tokenizedOrigins,headers:t.api.headers,customerId:t.tenant.customerId??null,productId:t.tenant.productId,productName:t.tenant.productName??null,authMode:e.mode,authToken:e.mode==="token"?e.token:null,getToken:e.mode==="callback"?e.getToken:null,onUnauthorized:()=>this.unauthorized.emit(),features:t.features,ui:t.ui,copy:t.copy,hrefs:t.hrefs,initialDashboardId:t.initial?.dashboardId??null});this.stopUi?.(),this.stopUi=Ue(this.host.nativeElement,t.ui),_t(t.api.baseUrl),yt({productId:t.tenant.productId,name:t.tenant.productName}),ft(()=>this.unauthorized.emit());let i=n;if(await ht(i),this.stopTokenRefresh??=mt(i),!this.configured){this.configured=!0;let o=S();this.ready.emit({customerId:o.customerId??"",productId:o.productId??""})}}ngOnDestroy(){this.stopAdopting?.(),this.stopTokenRefresh?.(),this.stopUi?.()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=q({type:r,selectors:[["dvz-dashboards-root"]],inputs:{config:[1,"config"]},outputs:{ready:"dvz-ready",error:"dvz-error",unauthorized:"dvz-unauthorized",navigate:"dvz-navigate"},features:[se([B])],decls:1,vars:1,template:function(e,n){e&1&&C(0,ci,1,0,"dvz-dashboards-page"),e&2&&v(n.config()?0:-1)},dependencies:[Ve],styles:[`:host{display:block;height:100%;min-height:0}
2
+ `],encapsulation:3,changeDetection:0})};gt();var gi="dvz-dashboards";function pi(r={}){return ct(We,gi,[Je(),ut(),st(lt([Ct])),{provide:vt,useFactory:()=>S().baseUrl},wt(U),Mt(T),Dt(T),ke(T),De(T),Se(T),Oe(T),kt(T)],r)}pi();export{gi as a,pi as b};