@mxtommy/kip 4.8.1 → 4.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -3
- package/package.json +27 -4
- package/public/{chunk-Bp0MQwPM.js → chunk-07zHjmg-.js} +1 -1
- package/public/{chunk-AANk-NXH.js → chunk-0z3nIRXw.js} +3 -3
- package/public/{chunk-sNakMDHi.js → chunk-B09jfNia.js} +1 -1
- package/public/{chunk-DDqeRiB0.js → chunk-B0D54iJs.js} +1 -1
- package/public/{chunk-BwOIef42.js → chunk-B0eE4udE.js} +1 -1
- package/public/{chunk-BX6skw5k.js → chunk-B9nVBlGj.js} +1 -1
- package/public/{chunk-C2VQxCXa.js → chunk-BFpzxIIT.js} +1 -1
- package/public/{chunk-Dxlia2NE.js → chunk-BIb-xYiS.js} +1 -1
- package/public/{chunk-dgaOX1wC.js → chunk-BJ-wyixK.js} +1 -1
- package/public/chunk-BLEZOsfR.js +1 -0
- package/public/{chunk-CNMFlw_H.js → chunk-BN7A4g6c.js} +1 -1
- package/public/{chunk-By8ZVvDx.js → chunk-BTOTKeBo.js} +1 -1
- package/public/{chunk-BoNDCNGE.js → chunk-BUguZ7cK.js} +1 -1
- package/public/{chunk-DE4ylhpq.js → chunk-BZx964-p.js} +1 -1
- package/public/{chunk-CNNTuNlM.js → chunk-BeM64etA.js} +1 -1
- package/public/chunk-BfiyH3nV.js +1 -0
- package/public/{chunk-Ii9n-oiL.js → chunk-BjINKQ03.js} +1 -1
- package/public/{chunk-MjWuPUhu.js → chunk-BpcNrtxJ.js} +1 -1
- package/public/{chunk-CkXTl3su.js → chunk-BuvyF0y5.js} +1 -1
- package/public/{chunk-BKj60jdq.js → chunk-C6b8CVno.js} +1 -1
- package/public/{chunk-hd2_AKwt.js → chunk-CCfhzpE8.js} +1 -1
- package/public/{chunk-nu4vZg-z.js → chunk-CHAFm_nM.js} +1 -1
- package/public/{chunk-5U8d2Ygo.js → chunk-CIGP2YJm.js} +1 -1
- package/public/{chunk-JbEkcxJm.js → chunk-CLTHuhlN.js} +1 -1
- package/public/{chunk-CwSa_BNV.js → chunk-CLs_NL1y.js} +1 -1
- package/public/{chunk-DNS-qsFC.js → chunk-COI6IBXH.js} +1 -1
- package/public/{chunk-CpuB_ZZz.js → chunk-CQMVIDcp.js} +1 -1
- package/public/{chunk-00hwknVI.js → chunk-CXvWM_vF.js} +1 -1
- package/public/{chunk-BdokyhBM.js → chunk-CYYBxjrc.js} +1 -1
- package/public/{chunk-DzTTqoF_.js → chunk-C_OZJltF.js} +1 -1
- package/public/{chunk-DQnoPLyC.js → chunk-Co2wVrD6.js} +1 -1
- package/public/{chunk-CXvG8mMq.js → chunk-CoCQ3DW2.js} +1 -1
- package/public/{chunk-DchvLV_Y.js → chunk-CxPx4NZv.js} +1 -1
- package/public/{chunk-CA6RRaxd.js → chunk-CyVRpGoJ.js} +1 -1
- package/public/{chunk-CL2xiH57.js → chunk-D-_-GUVr.js} +1 -1
- package/public/{chunk-C6UXF7BI.js → chunk-D1HYfaL_.js} +1 -1
- package/public/{chunk-DjZgzSiH.js → chunk-D2953Rfp.js} +1 -1
- package/public/{chunk-BJz7Ij9E.js → chunk-DIl1k00y.js} +1 -1
- package/public/{chunk-B6bEhzNR.js → chunk-DPnbM-aB.js} +1 -1
- package/public/{chunk-CIlfzV9R.js → chunk-DTN-sa1K.js} +1 -1
- package/public/{chunk-BOAD0N2a.js → chunk-DUEKoZhd.js} +1 -1
- package/public/{chunk-DumLX5k_.js → chunk-DmkAKXR1.js} +1 -1
- package/public/chunk-Do8wqING.js +1 -0
- package/public/{chunk-DXkKj21H.js → chunk-JhFkJS7i.js} +1 -1
- package/public/{chunk-B82ADJSs.js → chunk-OeQDZKFO.js} +1 -1
- package/public/{chunk-PheXEqie.js → chunk-_zRMMvCu.js} +1 -1
- package/public/{chunk-CrBxxZCe.js → chunk-eQ1pa34Q.js} +1 -1
- package/public/{chunk-D4xZ2tGB.js → chunk-ibauGmSP.js} +1 -1
- package/public/{chunk-VgxMqRPk.js → chunk-otzyItXL.js} +1 -1
- package/public/{chunk-BQr-tSkv.js → chunk-q9NoPvcx.js} +1 -1
- package/public/{chunk-DWLISAZi.js → chunk-szQs8fiq.js} +1 -1
- package/public/{chunk-tAiV3ARh.js → chunk-x7L6DXVK.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-BAV5VDOD.js → main-YKDNK5VZ.js} +20 -20
- package/plugin/history-series.service.js +0 -637
- package/plugin/index.js +0 -1322
- package/plugin/kip-series-contract.js +0 -31
- package/plugin/openApi.json +0 -855
- package/plugin/sqlite-history-storage.service.js +0 -1124
- package/plugin/src/history-series.service.js +0 -634
- package/plugin/src/index.js +0 -1322
- package/plugin/src/kip-series-contract.js +0 -31
- package/plugin/src/openApi.json +0 -855
- package/plugin/src/sqlite-history-storage.service.js +0 -1122
- package/public/chunk-Blokg6Ds.js +0 -1
- package/public/chunk-CpMCBDvH.js +0 -1
- package/public/chunk-y1imvaA-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import {u}from'./chunk-
|
|
1
|
+
import {u}from'./chunk-CCfhzpE8.js';import {d1 as Hj,w,du as p,dv as rt,$ as $j,a as G,cu as T,aR as lt,v as vt,D as Dt,cw as z,cv as G$1,ab as te,F as Fa,dn as ge,as as ke,cN as Wl,dB as Gl,J as JD,dC as x,c as $h,P as Pi,k as Qh,cn as wd,u as ul,_ as _w,B as Bh,e as EE,an as Hh,M as Mw,f as eg,K as Kw}from'./main-YKDNK5VZ.js';var H=["svgSlider"];function q(o,e){o&1&&$h(0,"div",10);}var O=class o{id=Hj.required();type=Hj.required();theme=Hj.required();static DEFAULT_CONFIG={supportAutomaticHistoricalSeries:false,displayName:"Slider Label",filterSelfPaths:true,paths:{gaugePath:{description:"PUT Supported Numeric Path. IMPORTANT: Format must be set to (base)",path:null,source:null,pathType:"number",isPathConfigurable:true,showPathSkUnitsFilter:false,pathSkUnitsFilter:null,showConvertUnitTo:false,convertUnitTo:void 0,supportsPut:true,sampleTime:500}},displayScale:{lower:0,upper:1,type:"linear"},enableTimeout:false,dataTimeout:5,color:"contrast"};runtime=w(p);streams=w(rt);svgElement=$j.required("svgSlider");dashboard=w(G);signalkRequestsService=w(T);toast=w(lt);labelColor=vt("");barColor=vt("");lineStartPx=0;lineWidthPx=0;lineEndPx=0;resizeTimeout=null;handlePositionView=vt(20);lineWidthView=Dt(()=>`${Math.max(0,this.handlePositionView()-this.LINE_START)}px`);pathValue=0;lineStart=20;isDragStarted=false;VIEWBOX_WIDTH=200;LINE_START=20;LINE_WIDTH=160;colorMap=null;cfg=Dt(()=>this.runtime.options()??o.DEFAULT_CONFIG);gaugePathConfig=Dt(()=>this.cfg().paths?.gaugePath);displayNameSafe=Dt(()=>this.cfg().displayName??"Slider Label");displayScale=Dt(()=>{let e=this.cfg().displayScale??o.DEFAULT_CONFIG.displayScale;return z(G$1({},e),{lower:e.lower??0,upper:e.upper??1})});valueChange$=new te;constructor(){Fa(()=>{let e=this.theme(),t=this.cfg();!t||!e||ge(()=>{this.ensureColorMap(),this.getColors(t.color??"contrast");});}),Fa(()=>{this.cfg();this.gaugePathConfig()?.path&&ge(()=>{this.calculateLineBounds(),this.streams.observe("gaugePath",i=>{if(!i||!i.data){queueMicrotask(()=>this.updateHandlePosition(this.mapValueToPosition(this.displayScale().lower)));return}queueMicrotask(()=>this.updateHandlePosition(this.mapValueToPosition(i.data.value)));});});});}ngOnInit(){this.getColors(this.cfg().color??"contrast"),this.valueChange$.pipe(ke(e=>{let t=this.displayScale();return this.isWithinMargin(e,t.lower)?t.lower:this.isWithinMargin(e,t.upper)?t.upper:parseFloat(e.toFixed(2))}),Wl(200),Gl()).subscribe(e=>{this.sendValue(e);});}mapValueToPosition(e){let t=this.displayScale(),i=t.upper-t.lower,n=this.LINE_WIDTH;return (e-t.lower)/i*n+this.LINE_START}mapPositionToValue(e){let t=this.displayScale(),i=t.upper-t.lower,n=this.LINE_WIDTH;return (e-this.LINE_START)/n*i+t.lower}isWithinMargin(e,t){let i=this.displayScale(),n=(i.upper-i.lower)*.01;return Math.abs(e-t)<=n}sendValue(e){let t=this.gaugePathConfig()?.path;t&&this.signalkRequestsService.putRequest(t,e,this.id());}onResized(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.calculateLineBounds();},200);}calculateLineBounds(){if(!this.svgElement()?.nativeElement){console.warn("[Slider Widget] SVG element is not initialized yet.");return}let e=this.svgElement().nativeElement.getBoundingClientRect(),t=this.LINE_START/this.VIEWBOX_WIDTH*e.width,i=this.LINE_WIDTH/this.VIEWBOX_WIDTH*e.width;this.lineStartPx=t,this.lineWidthPx=i,this.lineEndPx=this.lineStartPx+this.lineWidthPx;}updateHandlePosition(e){let t=Math.max(this.LINE_START,Math.min(this.LINE_START+this.LINE_WIDTH,e));this.handlePositionView.set(t);}getPointerX(e){return e.clientX-this.svgElement().nativeElement.getBoundingClientRect().left}onPointerDown(e){this.isDragStarted=true,this.onPointerMove(e),e.stopPropagation(),e.preventDefault();}onPointerMove(e){if(this.isDragStarted){let t=this.getPointerX(e);if(t>=this.lineStartPx&&t<=this.lineEndPx){let i=(t-this.lineStartPx)/this.lineWidthPx*this.LINE_WIDTH+this.LINE_START;this.updateHandlePosition(i);let n=this.handlePositionView(),r=this.displayScale();n<=this.LINE_START?this.pathValue=r.lower:n>=this.LINE_START+this.LINE_WIDTH?this.pathValue=r.upper:this.pathValue=this.mapPositionToValue(n),this.valueChange$.next(this.pathValue);}}}onPointerUp(){this.isDragStarted=false,this.valueChange$.next(this.pathValue);}onPointerLeave(){this.isDragStarted&&(this.isDragStarted=false,this.valueChange$.next(this.pathValue));}getColors(e){if(this.ensureColorMap(),!this.colorMap)return;let t=this.colorMap.get(e)||this.colorMap.get("contrast");t&&(this.labelColor.set(t.label),this.barColor.set(t.bar));}ensureColorMap(){let e=this.theme();e&&(this.colorMap=new Map([["contrast",{label:e.contrastDim,bar:e.contrast}],["blue",{label:e.blueDim,bar:e.blue}],["green",{label:e.greenDim,bar:e.green}],["pink",{label:e.pinkDim,bar:e.pink}],["orange",{label:e.orangeDim,bar:e.orange}],["purple",{label:e.purpleDim,bar:e.purple}],["grey",{label:e.greyDim,bar:e.grey}],["yellow",{label:e.yellowDim,bar:e.yellow}]]));}ngOnDestroy(){this.valueChange$.complete(),this.resizeTimeout&&clearTimeout(this.resizeTimeout);}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=JD({type:o,selectors:[["widget-slider"]],viewQuery:function(t,i){t&1&&eg(i.svgElement,H,5),t&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:11,vars:7,consts:[["svgSlider",""],[3,"text","color"],["kipResizeObserver","",1,"widgets-container",3,"resizeChange"],["width","100%","height","100%","viewBox","0 40 200 40"],["width","160","height","8","rx","4.5","id","rect3","x","20","y","56",1,"slider-bg-bar",2,"display","inline","stroke-width","1.57144"],["height","8","rx","4.5","id","rect3","x","20","y","56",2,"display","inline","stroke-width","1.57144"],["id","g22"],["cy","60","fill","#ffffff","id","circle3","r","19.549999",2,"display","inline","fill","#4d4d4d","fill-opacity","1","stroke","#8c8c8c","stroke-width","0.9","stroke-dasharray","none","stroke-opacity","1"],["cy","60","fill","#ffffff","id","circle3-3","r","17.950001",2,"display","inline","fill","#ffffff","fill-opacity","1","stroke","#e6e6e6","stroke-width","1.8","stroke-dasharray","none","stroke-opacity","0.97"],["cursor","pointer","width","200","height","40","x","0","y","40",2,"display","inline","fill","rgba(0, 0, 0, 0)","stroke","none","stroke-width","0.3","stroke-linecap","square","stroke-linejoin","round","stroke-miterlimit","0",3,"pointerdown","pointerup","pointermove","pointerleave"],[1,"widgetOverlay"]],template:function(t,i){t&1&&($h(0,"widget-title",1),Pi(1,"div",2),Qh("resizeChange",function(){return i.onResized()}),wd(),Pi(2,"svg",3),$h(3,"rect",4)(4,"rect",5),Pi(5,"g",6),$h(6,"circle",7)(7,"circle",8),ul(),Pi(8,"rect",9,0),Qh("pointerdown",function(r){return i.onPointerDown(r)})("pointerup",function(){return i.onPointerUp()})("pointermove",function(r){return i.onPointerMove(r)})("pointerleave",function(){return i.onPointerLeave()}),ul()(),_w(10,q,1,0,"div",10),ul()),t&2&&(Bh("text",i.displayNameSafe())("color",i.labelColor()),EE(4),Hh("width",i.lineWidthView())("fill",i.barColor()),EE(2),Hh("cx",i.handlePositionView()),EE(),Hh("cx",i.handlePositionView()),EE(3),Mw(i.dashboard.isDashboardStatic()?-1:10));},dependencies:[u,x],styles:[".widgets-container[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 20px}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent;z-index:21}.slider-bg-bar[_ngcontent-%COMP%]{fill:var(--mat-sys-inverse-on-surface)}"]})};export{O as WidgetSliderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {dx as n$1}from'./main-
|
|
1
|
+
import {dx as n$1}from'./main-YKDNK5VZ.js';function k(g,s,l,m,f,r,b=false){let a=[],c=[...g].sort((o,n)=>(o.lower??-1/0)-(n.lower??-1/0));for(let o of c){let n=f,t=r,i;switch(o.state){case n$1.Emergency:i=s.zoneEmergency;break;case n$1.Alarm:i=s.zoneAlarm;break;case n$1.Warn:i=s.zoneWarn;break;case n$1.Alert:i=s.zoneAlert;break;case n$1.Nominal:i=s.zoneNominal;break;default:i="rgba(0,0,0,0)";}if(o.lower==null?n=f:n=m.convertToUnit(l,o.lower)??f,o.upper==null?t=r:t=m.convertToUnit(l,o.upper)??r,!(!Number.isFinite(n)||!Number.isFinite(t))&&!(t<f||n>r)){if(n=Math.max(n,f),t>r){t=r,a.push({from:n,to:t,color:i});break}a.push({from:n,to:t,color:i});}}return b&&(a=a.map(o=>({from:r-o.to,to:r-o.from,color:o.color}))),a}export{k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-ibauGmSP.js';import {d1 as Hj,w,du as p,a as G,H as Dr,G as Gi,$ as $j,v as vt,F as Fa,dn as ge,J as JD,cp as Uh,b_ as Gh,e as EE,d as ig,f as eg,K as Kw,dP as pp}from'./main-YKDNK5VZ.js';var C=["plainIframe"],j=(()=>{class a{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);_dashboard=w(G);_sanitizer=w(Dr);settings=w(Gi);static DEFAULT_CONFIG={};iframe=$j.required("plainIframe");widgetUrl=null;displayTransparentOverlay=vt("block");constructor(){let e=new URL("/signalk-anchoralarm-plugin/",window.location.origin);this.widgetUrl=this.toSafeResourceUrl(e),Fa(()=>{let i=this.runtime.options(),t=this._dashboard.isDashboardStatic();i&&ge(()=>{t?this.displayTransparentOverlay.set("none"):this.displayTransparentOverlay.set("block");});}),window.addEventListener("message",this.handleIframeGesture);}toSafeResourceUrl(e){return e.origin!==window.location.origin||!e.pathname.startsWith("/signalk-anchoralarm-plugin/")?null:this._sanitizer.bypassSecurityTrustResourceUrl(e.toString())}ngAfterViewInit(){if(this.iframe()){this.iframe().nativeElement.onload=()=>this.injectSwipeScript();try{let e=this.iframe().nativeElement.contentDocument;e&&(e.readyState==="complete"||e.readyState==="interactive")&&this.injectSwipeScript();}catch(e){}}}handleIframeGesture=e=>{if(!e.data)return;let i=e.data?.eventData?.instanceId||e.data?.keyEventData?.instanceId;if(!(!i||i!==this.id())){if(e.data.gesture)switch(e.data.gesture){case "swipeup":this._dashboard.navigateToPreviousDashboard();break;case "swipedown":this._dashboard.navigateToNextDashboard();break;case "swipeleft":{let t=new Event("openLeftSidenav",{bubbles:true,cancelable:true});window.document.dispatchEvent(t);break}case "swiperight":{let t=new Event("openRightSidenav",{bubbles:true,cancelable:true});window.document.dispatchEvent(t);break}}if(e.data.type==="keydown"&&e.data.keyEventData){let{key:t,ctrlKey:s,shiftKey:n}=e.data.keyEventData,I=new KeyboardEvent("keydown",{key:t,ctrlKey:s,shiftKey:n,bubbles:true,cancelable:true});document.dispatchEvent(I);}}};injectSwipeScript(){let e=this.iframe().nativeElement.contentWindow,i=this.iframe().nativeElement.contentDocument;if(!i||!e){console.error("[WidgetIframe] Iframe contentDocument or contentWindow is undefined. Possible cross-origin issue or iframe not fully loaded.");return}try{let t=`kip-gesture-inject-${this.id()}`;if(i.getElementById(t))return;let s=a$1({instanceId:this.id()}),n=i.createElement("script");n.id=t,n.textContent=s,i.body.appendChild(n);}catch(t){console.warn("[WidgetIframe] Failed to inject swipe script into iframe:",t);}}ngOnDestroy(){window.removeEventListener("message",this.handleIframeGesture),this.iframe()&&(this.iframe().nativeElement.onload=null);try{let e=this.iframe()?.nativeElement.contentDocument;if(e){let i=`kip-gesture-inject-${this.id()}`,t=e.getElementById(i);t&&t.parentNode&&t.parentNode.removeChild(t);}}catch(e){}}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=JD({type:a,selectors:[["widget-anchor-alarm"]],viewQuery:function(i,t){i&1&&eg(t.iframe,C,5),i&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:3,vars:3,consts:[["plainIframe",""],["width","100%","height","100%","frameborder","0",1,"widgetIframe",3,"src"],[1,"widgetOverlay"]],template:function(i,t){i&1&&Uh(0,"iframe",1,0)(2,"div",2),i&2&&(Gh("src",t.widgetUrl,pp),EE(2),ig("display",t.displayTransparentOverlay()));},styles:["[_nghost-%COMP%]{overflow:hidden}.widgetIframe[_ngcontent-%COMP%]{background-color:#fff;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;right:0;bottom:0;color:transparent}"]})}return a})();export{j as WidgetAnchorAlarmComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {C,e}from'./chunk-B6bEhzNR.js';import {g as ge$2}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge$1,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-BAV5VDOD.js';import {c}from'./chunk-Dxlia2NE.js';var ge=["chargerSvg"];function me(c,e){c&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K charger paths or select chargers in widget settings."),ul()());}function fe(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var le=class c$1{static CHARGER_DESCRIPTOR=a("widget-charger");static SELF_ROOT_PATH=(()=>{let e=c$1.CHARGER_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${c$1.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${fe(c$1.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static CHARGER_DISPLAY_BASE_WIDTH=145;static CHARGER_DISPLAY_BASE_HEIGHT=37;static CHARGER_DISPLAY_HORIZONTAL_MARGIN=40;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,charger:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("chargerSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredChargerIds=vt([]);trackedDevices=vt([]);chargersByKey=vt({});visibleChargerKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(s=>s.key);let r=this.chargersByKey(),t=new Set(this.discoveredChargerIds()),i=Object.keys(r).filter(s=>{let o=r[s];return !!o&&t.has(o.id)}).sort((s,o)=>s.localeCompare(o)),a=new Map;return i.forEach(s=>{let o=r[s];o&&s!==o.id&&a.set(o.id,true);}),i.filter(s=>{let o=r[s];return o?s!==o.id?true:!a.get(o.id):false})});visibleChargers=Dt(()=>{let e=this.visibleChargerKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasChargers=Dt(()=>this.visibleChargers().length>0);isCompactCardMode=Dt(()=>this.renderMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleChargers();return e.length!==1?"Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e=this.visibleChargers(),r=new Map;e.forEach(a=>r.set(a.id,(r.get(a.id)??0)+1));let t=new Set([...r.entries()].filter(([,a])=>a>1).map(([a])=>a)),i={};for(let a of e){let s=a.deviceKey??a.id,o=!!a.source&&t.has(a.id),[n,m,p,h]=this.buildMetricRows(a);i[s]={id:a.id,source:a.source??null,deviceKey:a.deviceKey,titleText:this.resolveTitleText(a,o),modeText:this.isCompactCardMode()?"":this.resolveModeText(a),voltageText:n,currentText:m,powerText:p,temperatureText:h};}return i});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge$1(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleChargers(),a=this.widgetColors();!this.svg||!a||this.requestRender({chargers:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(c$1.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$2(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${c$1.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Charger View"),this.layer=this.svg.append("g").attr("class","charger-layer");}applyConfig(e){let r=this.normalizeTrackedDevices(e.charger?.trackedDevices);this.trackedDevices.set(r),this.reprojectSnapshotsToDeviceKeys(r);}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),s=this.normalizeOptionalString(i.source);if(!a||!s)return;let o=this.normalizeOptionalString(i.key)??`${a}||${s}`;r.set(o,{id:a,source:s,key:o});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map,t=new Map;e.forEach(i=>{let a=r.get(i.id)??[];a.push(i.key),r.set(i.id,a),t.set(i.key,i);}),this.chargersByKey.update(i=>{let a=i,s=false;return r.forEach((o,n)=>{let m=i[n];if(m){for(let p of o){if(i[p])continue;let h=t.get(p);s||(a=G({},i),s=true),a[p]=z(G({},m),{source:h?.source??null,deviceKey:p});}a[n]&&(a[n].deviceKey===void 0||a[n].deviceKey===n)&&(s||(a=G({},i),s=true),delete a[n]);}}),s?a:i});}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,s=this.extractUpdateSource(e),o=`${t.id}::${s??"*"}::${t.key}`;if(this.pendingPathUpdates.set(o,{id:t.id,key:t.key,source:s,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},c$1.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(c$1.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(a=>a.id)).forEach(a=>this.trackDiscoveredCharger(a));let t=this.buildIdToDeviceKeysMap(),i=new Map;this.trackedDevices().forEach(a=>i.set(a.key,a)),this.chargersByKey.update(a=>{let s=a,o=false;for(let n of e){let m=t.get(n.id),p=!!m?.length,h=[];if(p)if(n.source){let y=`${n.id}||${n.source}`;h=m?.includes(y)?[y]:[];}else h=m??[];else h=[n.source?`${n.id}||${n.source}`:n.id];for(let y of h){let b=p?i.get(y):null,f=s[y]??{id:n.id,source:b?.source??n.source??null,deviceKey:p||n.source?y:void 0},d=G({},f);if(!this.applyValue(d,n.key,n.value,n.state))continue;let M=d.rawPower!=null?d.rawPower:d.voltage!=null&&d.current!=null?d.voltage*d.current:null;M!=null?d.power=Number.isFinite(M)?M:null:d.power=null,d.rawPower==null&&(d.powerState=this.resolveMostSevereState(d.voltageState??null,d.currentState??null)),o||(s=G({},s),o=true),s[y]=d;}}return o?s:a});}extractUpdateSource(e){let r=this.normalizeOptionalString(e.source);return r||(this.normalizeOptionalString(e.update?.data?.source)??null)}trackDiscoveredCharger(e){let r=this.discoveredChargerIds();r.includes(e)||this.discoveredChargerIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "state":return this.setMetricValue(e,"state","stateState",this.toStringValue(t),i);case "offReason":return this.setMetricValue(e,"offReason","offReasonState",this.toStringValue(t),i);case "error":return this.setMetricValue(e,"error","errorState",this.toStringValue(t),i);case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeState":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeNumber":return this.setMetricValue(e,"modeNumber","modeNumberState",this.toNumber(t,""),i);case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "chargingModeNumber":return this.setMetricValue(e,"chargingModeNumber","chargingModeNumberState",this.toNumber(t,""),i);case "output.voltage":{let a=this.toNumber(t,"V"),s=this.setMetricValue(e,"outputVoltage","outputVoltageState",a,i),o=this.setMetricValue(e,"voltage","voltageState",a,i);return s||o}case "input.voltage":return this.setMetricValue(e,"inputVoltage","inputVoltageState",this.toNumber(t,"V"),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "leds.absorption":return this.setMetricValue(e,"ledsAbsorption","ledsAbsorptionState",this.toBoolean(t),i);case "leds.bulk":return this.setMetricValue(e,"ledsBulk","ledsBulkState",this.toBoolean(t),i);case "leds.float":return this.setMetricValue(e,"ledsFloat","ledsFloatState",this.toBoolean(t),i);case "leds.inverter":return this.setMetricValue(e,"ledsInverter","ledsInverterState",this.toBoolean(t),i);case "leds.lowBattery":return this.setMetricValue(e,"ledsLowBattery","ledsLowBatteryState",this.toBoolean(t),i);case "leds.mains":return this.setMetricValue(e,"ledsMains","ledsMainsState",this.toBoolean(t),i);case "leds.overload":return this.setMetricValue(e,"ledsOverload","ledsOverloadState",this.toBoolean(t),i);case "leds.temperature":return this.setMetricValue(e,"ledsTemperature","ledsTemperatureState",this.toBoolean(t),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let s=!Object.is(e[r],i),o=!Object.is(e[t],a);return !s&&!o?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{chargers:this.visibleChargers(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e$1){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e,i=r?c$1.COMPACT_CARD_HEIGHT:c$1.CARD_HEIGHT,a=c$1.VIEWBOX_WIDTH-c$1.CHARGER_DISPLAY_HORIZONTAL_MARGIN,s=a/c$1.CHARGER_DISPLAY_BASE_WIDTH,o=a,n=(c$1.VIEWBOX_WIDTH-o)/2,m=r?8:t.titleY,p=r?33:60,h=e$1.chargers.map((l,P)=>({key:l.deviceKey??l.id,id:l.id,charger:l,y:P*(i+c$1.CARD_GAP)})),y=h.length?h[h.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${y}`);let b=this.layer.selectAll("g.charger-card").data(h,l=>l.key),f=b.enter().append("g").attr("class","charger-card"),d=f.append("g").attr("class","charger-display-group");d.append("path").attr("class","charger-shape-bulk").attr("d","m 39.280608,10.70371 1.604609,-3.7808024 c 0.06926,-0.1631805 0.314475,-0.553581 0.314475,-0.4368876 v 27.475177 c 0,0.116694 -0.142713,0.210638 -0.319983,0.210638 H 9.2681756 c -0.1772706,0 -0.3711555,-0.105758 -0.319983,-0.210638 l 1.2797184,-2.622833 c 1.150699,-2.358403 3.86281,-5.455024 6.286778,-6.406312 3.251217,-1.275942 7.834296,-2.821704 11.746419,-4.103315 4.312764,-1.412861 9.246151,-5.946636 11.0195,-10.125027 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.804611,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("rect").attr("class","charger-shape-absorption").attr("width",19.67485).attr("height",32.383526).attr("x",40.545158).attr("y",1.1331999).attr("rx",.19520389).attr("ry",.24451913).attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-float").attr("d","m 66.03898,6.4101715 4.16646,3.2472635 c 1.876083,1.462185 5.139444,3.529899 7.448846,4.069504 5.055358,1.181215 11.386089,1.251612 11.38595,1.349059 l -0.02667,18.73082 c 0,0.127151 -0.103075,0.230227 -0.230226,0.230227 H 66.03898 c -0.127151,0 -0.230226,-0.103076 -0.230226,-0.230227 V 6.6403978 c 0,-0.1271504 0.103076,-0.2302261 0.230226,-0.2302263 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.7228087,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-storage").attr("d","m 93.39395,15.253553 c 2.347866,2.587905 8.59059,4.802212 13.94479,4.852641 11.92289,0.112298 30.60094,0.205911 30.60096,0.259031 l 0.006,13.361558 c 3e-5,0.07786 -0.19912,0.140548 -0.44645,0.140548 h -44.1053 c -0.247332,0 -0.446448,-0.06269 -0.446448,-0.140548 V 15.394101 c 0,-0.07786 0.280259,-0.323728 0.446448,-0.140548 z").attr("transform","matrix(1.1077284,0,0,1.1178939,-8.9068494,-4.6850995)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),f.append("text").attr("class","charger-title"),f.append("text").attr("class","charger-mode");let E=f.append("text").attr("class","charger-voltage");E.append("tspan").attr("class","voltage-metric-value"),E.append("tspan").attr("class","voltage-metric-unit");let M=f.append("text").attr("class","charger-current");M.append("tspan").attr("class","current-metric-value"),M.append("tspan").attr("class","current-metric-unit");let L=f.append("text").attr("class","charger-power");L.append("tspan").attr("class","power-metric-value"),L.append("tspan").attr("class","power-metric-unit");let z=f.append("text").attr("class","charger-temperature");z.append("tspan").attr("class","temperature-metric-value"),z.append("tspan").attr("class","temperature-metric-unit");let u=f.merge(b);u.attr("transform",l=>`translate(0, ${l.y})`),u.select("g.charger-display-group").attr("transform",`translate(${n}, ${p}) scale(${s})`).each((l,P,ce)=>{let v=this.resolveShapeMode(l.charger),S=this.isShapeMode(v,"power supply"),D=e$1.widgetColors.dim,x="var(--mat-sys-background)",R=this.isShapeMode(v,"sustain")||S?"none":this.isShapeMode(v,"equalization")?"var(--kip-zone-alert-color)":this.isShapeMode(v,"overload")?"var(--kip-zone-alarm-color)":e$1.widgetColors.color,I=ge$2(ce[P]);I.select("path.charger-shape-bulk").attr("fill",this.isShapeMode(v,"bulk")||this.isShapeMode(v,"boost")||S?D:x).attr("stroke",R),I.select("rect.charger-shape-absorption").attr("fill",this.isShapeMode(v,"absorption")||S?D:x).attr("stroke",R),I.select("path.charger-shape-float").attr("fill",this.isShapeMode(v,"float")||S?D:x).attr("stroke",R),I.select("path.charger-shape-storage").attr("fill",this.isShapeMode(v,"storage")||S?D:x).attr("stroke",R);}),e$1.chargers.length>1?u.select("text.charger-title").attr("x",t.titleX).attr("y",m).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.titleText??this.resolveTitleText(l.charger)):u.select("text.charger-title").text(""),u.select("text.charger-voltage").attr("x",197).attr("y",25).attr("text-anchor","end").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("fill","var(--kip-contrast-color)"),u.select("tspan.voltage-metric-value").text(l=>e$1.displayModels[l.key]?.voltageText??""),u.select("tspan.voltage-metric-unit").attr("dx",1).attr("font-size",22).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").text("V"),u.select("text.charger-current").attr("x",197).attr("y",48).attr("text-anchor","end").attr("font-size",t.lineOneFontSize).attr("fill","var(--kip-contrast-color)"),u.select("tspan.current-metric-value").text(l=>e$1.displayModels[l.key]?.currentText??""),u.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),u.select("text.charger-power").attr("x",5).attr("y",22).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.power-metric-value").text(l=>e$1.displayModels[l.key]?.powerText??""),u.select("tspan.power-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text("W"),u.select("text.charger-temperature").attr("x",5).attr("y",34).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.temperature-metric-value").text(l=>e$1.displayModels[l.key]?.temperatureText??""),u.select("tspan.temperature-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text(`${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`),u.select("text.charger-mode").attr("x",5).attr("y",46).attr("font-size",10).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.modeText??""),b.exit().remove();}resolveTitleText(e,r=false){let t=e.name||`Charger ${e.id}`;return !r||!e.source?t:`${t} [${e.source}]`}resolveModeText(e){if(e.chargingMode)return `Mode: ${e.chargingMode.charAt(0).toUpperCase()+e.chargingMode.slice(1)}`;if(e.mode)return `Mode: ${e.mode}`;let t=[{active:e.ledsAbsorption,label:"Absorption"},{active:e.ledsBulk,label:"Bulk"},{active:e.ledsFloat,label:"Float"},{active:e.ledsInverter,label:"Inverter"},{active:e.ledsLowBattery,label:"Low Battery"},{active:e.ledsMains,label:"Mains"},{active:e.ledsOverload,label:"Overload"},{active:e.ledsTemperature,label:"Temperature"}].filter(i=>i.active===true).map(i=>i.label);return t.length?`Mode: ${t.join(" / ")}`:"Mode --"}resolveShapeMode(e){return (e.chargingMode??e.mode??"").trim().toLowerCase()}isShapeMode(e,r){return !e||!r?false:e===r||e.includes(r)}buildMetricRows(e){return this.renderMode()==="full"||this.renderMode()===null?[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`Power: ${this.formatValue(e.power,0)}`,`Temp: ${this.formatTemperature(e.temperature)}`]:[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`P: ${this.formatValue(e.power,0)}`,`T: ${this.formatTemperature(e.temperature)}`]}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(r)}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)}`}toStringValue(e){return typeof e=="string"?e:null}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return true;if(e===0)return false}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="on")return true;if(r==="false"||r==="0"||r==="off")return false}return null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||c$1)};static \u0275cmp=JD({type:c$1,selectors:[["widget-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ge,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["chargerSvg",""],[3,"text","color"],["aria-hidden","false",1,"charger-svg"],[1,"charger-empty"],[1,"charger-empty-title"],[1,"charger-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,me,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.charger-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.charger-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.charger-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.charger-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{le as WidgetChargerComponent};
|
|
1
|
+
import {C,e}from'./chunk-DPnbM-aB.js';import {g as ge$2}from'./chunk-TakPRI3t.js';import {e9 as a,d1 as Hj,w,du as p,aS as De,bu as ut,aY as xe,$ as $j,v as vt,D as Dt,F as Fa,dn as ge$1,a_ as Gp,cv as G,cw as z,dx as n$1,J as JD,dC as x,c as $h,cn as wd,_ as _w,B as Bh,e as EE,M as Mw,f as eg,K as Kw,P as Pi,T as TT,u as ul}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var ge=["chargerSvg"];function me(c,e){c&1&&(Pi(0,"div",3)(1,"div",4),TT(2,"No chargers detected"),ul(),Pi(3,"div",5),TT(4,"Check Signal K charger paths or select chargers in widget settings."),ul()());}function fe(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var le=class c$1{static CHARGER_DESCRIPTOR=a("widget-charger");static SELF_ROOT_PATH=(()=>{let e=c$1.CHARGER_DESCRIPTOR?.selfRootPath;if(!e)throw new Error("[WidgetChargerComponent] Descriptor missing or selfRootPath not set; check widget registration.");return e})();static ROOT_PATTERN=`${c$1.SELF_ROOT_PATH}.*`;static PATH_REGEX=new RegExp(`^${fe(c$1.SELF_ROOT_PATH)}\\.([^.]+)\\.(.+)$`);static VIEWBOX_WIDTH=200;static CARD_HEIGHT=100;static COMPACT_CARD_HEIGHT=100;static CARD_GAP=8;static PATH_BATCH_WINDOW_MS=500;static CHARGER_DISPLAY_BASE_WIDTH=145;static CHARGER_DISPLAY_BASE_HEIGHT=37;static CHARGER_DISPLAY_HORIZONTAL_MARGIN=40;static DEFAULT_CONFIG={color:"contrast",ignoreZones:false,charger:{trackedDevices:[],optionsById:{}}};id=Hj.required();type=Hj.required();theme=Hj.required();renderMode=Hj(null);runtime=w(p);data=w(De);units=w(ut);destroyRef=w(xe);svgRef=$j.required("chargerSvg");svg;layer;pendingPathUpdates=new Map;pathBatchTimerId=null;initialPathPaintDone=false;renderFrameId=null;pendingRenderSnapshot=null;discoveredChargerIds=vt([]);trackedDevices=vt([]);chargersByKey=vt({});visibleChargerKeys=Dt(()=>{let e=this.trackedDevices();if(e.length)return e.map(s=>s.key);let r=this.chargersByKey(),t=new Set(this.discoveredChargerIds()),i=Object.keys(r).filter(s=>{let o=r[s];return !!o&&t.has(o.id)}).sort((s,o)=>s.localeCompare(o)),a=new Map;return i.forEach(s=>{let o=r[s];o&&s!==o.id&&a.set(o.id,true);}),i.filter(s=>{let o=r[s];return o?s!==o.id?true:!a.get(o.id):false})});visibleChargers=Dt(()=>{let e=this.visibleChargerKeys(),r=this.chargersByKey();return e.map(t=>r[t]).filter(t=>!!t)});hasChargers=Dt(()=>this.visibleChargers().length>0);isCompactCardMode=Dt(()=>this.renderMode()==="compact");colorRole=Dt(()=>this.runtime.options()?.color??"contrast");ignoreZones=Dt(()=>this.runtime.options()?.ignoreZones??false);displayLabel=Dt(()=>{let e=this.visibleChargers();return e.length!==1?"Chargers":this.resolveTitleText(e[0])});labelColor=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e).dim:"var(--kip-contrast-dim-color)"});widgetColors=Dt(()=>{let e=this.theme();return e?c(this.colorRole(),e):null});displayModels=Dt(()=>{let e=this.visibleChargers(),r=new Map;e.forEach(a=>r.set(a.id,(r.get(a.id)??0)+1));let t=new Set([...r.entries()].filter(([,a])=>a>1).map(([a])=>a)),i={};for(let a of e){let s=a.deviceKey??a.id,o=!!a.source&&t.has(a.id),[n,m,p,h]=this.buildMetricRows(a);i[s]={id:a.id,source:a.source??null,deviceKey:a.deviceKey,titleText:this.resolveTitleText(a,o),modeText:this.isCompactCardMode()?"":this.resolveModeText(a),voltageText:n,currentText:m,powerText:p,temperatureText:h};}return i});constructor(){Fa(()=>{let t=this.runtime.options();t&&ge$1(()=>this.applyConfig(t));}),Fa(()=>{let t=this.displayModels(),i=this.visibleChargers(),a=this.widgetColors();!this.svg||!a||this.requestRender({chargers:i,displayModels:t,widgetColors:a});});let e=[this.data.subscribePathTreeWithInitial(c$1.ROOT_PATTERN)],r=false;for(let t of e)if(t.initial.length){r=true;for(let i of t.initial)this.enqueuePathUpdate(i,true);}r&&(this.flushPendingPathUpdates(),this.initialPathPaintDone=true);for(let t of e)t.live$.pipe(Gp(this.destroyRef)).subscribe(i=>{this.enqueuePathUpdate(i);});}ngAfterViewInit(){this.initializeSvg(),this.requestRender();}ngOnDestroy(){this.pathBatchTimerId!==null&&(clearTimeout(this.pathBatchTimerId),this.pathBatchTimerId=null),this.renderFrameId!==null&&(cancelAnimationFrame(this.renderFrameId),this.renderFrameId=null),this.pendingRenderSnapshot=null;}initializeSvg(){this.svg=ge$2(this.svgRef().nativeElement),this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${c$1.CARD_HEIGHT}`).attr("preserveAspectRatio","xMidYMid meet").attr("role","img").attr("aria-label","Charger View"),this.layer=this.svg.append("g").attr("class","charger-layer");}applyConfig(e){let r=this.normalizeTrackedDevices(e.charger?.trackedDevices);this.trackedDevices.set(r),this.reprojectSnapshotsToDeviceKeys(r);}normalizeTrackedDevices(e){if(!Array.isArray(e))return [];let r=new Map;return e.forEach(t=>{if(!t||typeof t!="object")return;let i=t,a=this.normalizeOptionalString(i.id),s=this.normalizeOptionalString(i.source);if(!a||!s)return;let o=this.normalizeOptionalString(i.key)??`${a}||${s}`;r.set(o,{id:a,source:s,key:o});}),[...r.values()].sort((t,i)=>t.key.localeCompare(i.key))}buildIdToDeviceKeysMap(){let e=new Map;return this.trackedDevices().forEach(r=>{let t=e.get(r.id)??[];t.push(r.key),e.set(r.id,t);}),e}reprojectSnapshotsToDeviceKeys(e){if(!e.length)return;let r=new Map,t=new Map;e.forEach(i=>{let a=r.get(i.id)??[];a.push(i.key),r.set(i.id,a),t.set(i.key,i);}),this.chargersByKey.update(i=>{let a=i,s=false;return r.forEach((o,n)=>{let m=i[n];if(m){for(let p of o){if(i[p])continue;let h=t.get(p);s||(a=G({},i),s=true),a[p]=z(G({},m),{source:h?.source??null,deviceKey:p});}a[n]&&(a[n].deviceKey===void 0||a[n].deviceKey===n)&&(s||(a=G({},i),s=true),delete a[n]);}}),s?a:i});}normalizeOptionalString(e){if(typeof e!="string")return null;let r=e.trim();return r.length>0?r:null}enqueuePathUpdate(e,r=false){let t=this.parsePath(e.path);if(!t)return;let i=e.update?.data?.value??null,a=e.update?.state??null,s=this.extractUpdateSource(e),o=`${t.id}::${s??"*"}::${t.key}`;if(this.pendingPathUpdates.set(o,{id:t.id,key:t.key,source:s,value:i,state:a}),!r){if(!this.initialPathPaintDone){this.initialPathPaintDone=true,this.flushPendingPathUpdates();return}this.pathBatchTimerId===null&&(this.pathBatchTimerId=window.setTimeout(()=>{this.pathBatchTimerId=null,this.flushPendingPathUpdates();},c$1.PATH_BATCH_WINDOW_MS));}}parsePath(e){let r=e.match(c$1.PATH_REGEX);return r?{id:r[1],key:r[2]}:null}flushPendingPathUpdates(){if(!this.pendingPathUpdates.size)return;let e=Array.from(this.pendingPathUpdates.values());this.pendingPathUpdates.clear(),new Set(e.map(a=>a.id)).forEach(a=>this.trackDiscoveredCharger(a));let t=this.buildIdToDeviceKeysMap(),i=new Map;this.trackedDevices().forEach(a=>i.set(a.key,a)),this.chargersByKey.update(a=>{let s=a,o=false;for(let n of e){let m=t.get(n.id),p=!!m?.length,h=[];if(p)if(n.source){let y=`${n.id}||${n.source}`;h=m?.includes(y)?[y]:[];}else h=m??[];else h=[n.source?`${n.id}||${n.source}`:n.id];for(let y of h){let b=p?i.get(y):null,f=s[y]??{id:n.id,source:b?.source??n.source??null,deviceKey:p||n.source?y:void 0},d=G({},f);if(!this.applyValue(d,n.key,n.value,n.state))continue;let M=d.rawPower!=null?d.rawPower:d.voltage!=null&&d.current!=null?d.voltage*d.current:null;M!=null?d.power=Number.isFinite(M)?M:null:d.power=null,d.rawPower==null&&(d.powerState=this.resolveMostSevereState(d.voltageState??null,d.currentState??null)),o||(s=G({},s),o=true),s[y]=d;}}return o?s:a});}extractUpdateSource(e){let r=this.normalizeOptionalString(e.source);return r||(this.normalizeOptionalString(e.update?.data?.source)??null)}trackDiscoveredCharger(e){let r=this.discoveredChargerIds();r.includes(e)||this.discoveredChargerIds.set([...r,e].sort((t,i)=>t.localeCompare(i)));}applyValue(e,r,t,i){switch(r){case "name":return this.setValue(e,"name",this.toStringValue(t));case "location":return this.setValue(e,"location",this.toStringValue(t));case "associatedBus":return this.setValue(e,"associatedBus",this.toStringValue(t));case "state":return this.setMetricValue(e,"state","stateState",this.toStringValue(t),i);case "offReason":return this.setMetricValue(e,"offReason","offReasonState",this.toStringValue(t),i);case "error":return this.setMetricValue(e,"error","errorState",this.toStringValue(t),i);case "mode":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeState":return this.setMetricValue(e,"mode","modeState",this.toStringValue(t),i);case "modeNumber":return this.setMetricValue(e,"modeNumber","modeNumberState",this.toNumber(t,""),i);case "chargingMode":return this.setMetricValue(e,"chargingMode","chargingModeState",this.toStringValue(t),i);case "chargingModeNumber":return this.setMetricValue(e,"chargingModeNumber","chargingModeNumberState",this.toNumber(t,""),i);case "output.voltage":{let a=this.toNumber(t,"V"),s=this.setMetricValue(e,"outputVoltage","outputVoltageState",a,i),o=this.setMetricValue(e,"voltage","voltageState",a,i);return s||o}case "input.voltage":return this.setMetricValue(e,"inputVoltage","inputVoltageState",this.toNumber(t,"V"),i);case "voltage":return this.setMetricValue(e,"voltage","voltageState",this.toNumber(t,"V"),i);case "current":return this.setMetricValue(e,"current","currentState",this.toNumber(t,"A"),i);case "power":return this.setMetricValue(e,"rawPower","powerState",this.toNumber(t,"W"),i);case "temperature":return this.setMetricValue(e,"temperature","temperatureState",this.toNumber(t,this.units.getDefaults().Temperature),i);case "leds.absorption":return this.setMetricValue(e,"ledsAbsorption","ledsAbsorptionState",this.toBoolean(t),i);case "leds.bulk":return this.setMetricValue(e,"ledsBulk","ledsBulkState",this.toBoolean(t),i);case "leds.float":return this.setMetricValue(e,"ledsFloat","ledsFloatState",this.toBoolean(t),i);case "leds.inverter":return this.setMetricValue(e,"ledsInverter","ledsInverterState",this.toBoolean(t),i);case "leds.lowBattery":return this.setMetricValue(e,"ledsLowBattery","ledsLowBatteryState",this.toBoolean(t),i);case "leds.mains":return this.setMetricValue(e,"ledsMains","ledsMainsState",this.toBoolean(t),i);case "leds.overload":return this.setMetricValue(e,"ledsOverload","ledsOverloadState",this.toBoolean(t),i);case "leds.temperature":return this.setMetricValue(e,"ledsTemperature","ledsTemperatureState",this.toBoolean(t),i);default:return false}}setValue(e,r,t){return Object.is(e[r],t)?false:(e[r]=t,true)}setMetricValue(e,r,t,i,a){let s=!Object.is(e[r],i),o=!Object.is(e[t],a);return !s&&!o?false:(e[r]=i,e[t]=a,true)}requestRender(e){let r=this.widgetColors();!this.svg||!r||(this.pendingRenderSnapshot=e??{chargers:this.visibleChargers(),displayModels:this.displayModels(),widgetColors:r},this.renderFrameId===null&&(this.renderFrameId=requestAnimationFrame(()=>{this.renderFrameId=null;let t=this.pendingRenderSnapshot;this.pendingRenderSnapshot=null,t&&this.render(t);})));}render(e$1){if(!this.layer||!this.svg)return;let r=this.isCompactCardMode(),t=r?C:e,i=r?c$1.COMPACT_CARD_HEIGHT:c$1.CARD_HEIGHT,a=c$1.VIEWBOX_WIDTH-c$1.CHARGER_DISPLAY_HORIZONTAL_MARGIN,s=a/c$1.CHARGER_DISPLAY_BASE_WIDTH,o=a,n=(c$1.VIEWBOX_WIDTH-o)/2,m=r?8:t.titleY,p=r?33:60,h=e$1.chargers.map((l,P)=>({key:l.deviceKey??l.id,id:l.id,charger:l,y:P*(i+c$1.CARD_GAP)})),y=h.length?h[h.length-1].y+i:i;this.svg.attr("viewBox",`0 0 ${c$1.VIEWBOX_WIDTH} ${y}`);let b=this.layer.selectAll("g.charger-card").data(h,l=>l.key),f=b.enter().append("g").attr("class","charger-card"),d=f.append("g").attr("class","charger-display-group");d.append("path").attr("class","charger-shape-bulk").attr("d","m 39.280608,10.70371 1.604609,-3.7808024 c 0.06926,-0.1631805 0.314475,-0.553581 0.314475,-0.4368876 v 27.475177 c 0,0.116694 -0.142713,0.210638 -0.319983,0.210638 H 9.2681756 c -0.1772706,0 -0.3711555,-0.105758 -0.319983,-0.210638 l 1.2797184,-2.622833 c 1.150699,-2.358403 3.86281,-5.455024 6.286778,-6.406312 3.251217,-1.275942 7.834296,-2.821704 11.746419,-4.103315 4.312764,-1.412861 9.246151,-5.946636 11.0195,-10.125027 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.804611,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("rect").attr("class","charger-shape-absorption").attr("width",19.67485).attr("height",32.383526).attr("x",40.545158).attr("y",1.1331999).attr("rx",.19520389).attr("ry",.24451913).attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-float").attr("d","m 66.03898,6.4101715 4.16646,3.2472635 c 1.876083,1.462185 5.139444,3.529899 7.448846,4.069504 5.055358,1.181215 11.386089,1.251612 11.38595,1.349059 l -0.02667,18.73082 c 0,0.127151 -0.103075,0.230227 -0.230226,0.230227 H 66.03898 c -0.127151,0 -0.230226,-0.103076 -0.230226,-0.230227 V 6.6403978 c 0,-0.1271504 0.103076,-0.2302261 0.230226,-0.2302263 z").attr("transform","matrix(1.1068428,0,0,1.1601894,-8.7228087,-6.1382561)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linecap","butt").attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),d.append("path").attr("class","charger-shape-storage").attr("d","m 93.39395,15.253553 c 2.347866,2.587905 8.59059,4.802212 13.94479,4.852641 11.92289,0.112298 30.60094,0.205911 30.60096,0.259031 l 0.006,13.361558 c 3e-5,0.07786 -0.19912,0.140548 -0.44645,0.140548 h -44.1053 c -0.247332,0 -0.446448,-0.06269 -0.446448,-0.140548 V 15.394101 c 0,-0.07786 0.280259,-0.323728 0.446448,-0.140548 z").attr("transform","matrix(1.1077284,0,0,1.1178939,-8.9068494,-4.6850995)").attr("fill","var(--mat-sys-background)").attr("stroke",e$1.widgetColors.color).attr("stroke-width",2).attr("stroke-linejoin","miter").attr("stroke-miterlimit",0).attr("paint-order","markers stroke fill"),f.append("text").attr("class","charger-title"),f.append("text").attr("class","charger-mode");let E=f.append("text").attr("class","charger-voltage");E.append("tspan").attr("class","voltage-metric-value"),E.append("tspan").attr("class","voltage-metric-unit");let M=f.append("text").attr("class","charger-current");M.append("tspan").attr("class","current-metric-value"),M.append("tspan").attr("class","current-metric-unit");let L=f.append("text").attr("class","charger-power");L.append("tspan").attr("class","power-metric-value"),L.append("tspan").attr("class","power-metric-unit");let z=f.append("text").attr("class","charger-temperature");z.append("tspan").attr("class","temperature-metric-value"),z.append("tspan").attr("class","temperature-metric-unit");let u=f.merge(b);u.attr("transform",l=>`translate(0, ${l.y})`),u.select("g.charger-display-group").attr("transform",`translate(${n}, ${p}) scale(${s})`).each((l,P,ce)=>{let v=this.resolveShapeMode(l.charger),S=this.isShapeMode(v,"power supply"),D=e$1.widgetColors.dim,x="var(--mat-sys-background)",R=this.isShapeMode(v,"sustain")||S?"none":this.isShapeMode(v,"equalization")?"var(--kip-zone-alert-color)":this.isShapeMode(v,"overload")?"var(--kip-zone-alarm-color)":e$1.widgetColors.color,I=ge$2(ce[P]);I.select("path.charger-shape-bulk").attr("fill",this.isShapeMode(v,"bulk")||this.isShapeMode(v,"boost")||S?D:x).attr("stroke",R),I.select("rect.charger-shape-absorption").attr("fill",this.isShapeMode(v,"absorption")||S?D:x).attr("stroke",R),I.select("path.charger-shape-float").attr("fill",this.isShapeMode(v,"float")||S?D:x).attr("stroke",R),I.select("path.charger-shape-storage").attr("fill",this.isShapeMode(v,"storage")||S?D:x).attr("stroke",R);}),e$1.chargers.length>1?u.select("text.charger-title").attr("x",t.titleX).attr("y",m).attr("font-size",t.titleFontSize).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.titleText??this.resolveTitleText(l.charger)):u.select("text.charger-title").text(""),u.select("text.charger-voltage").attr("x",197).attr("y",25).attr("text-anchor","end").attr("font-size",t.primaryFontSize).attr("font-weight",t.primaryFontWeight).attr("fill","var(--kip-contrast-color)"),u.select("tspan.voltage-metric-value").text(l=>e$1.displayModels[l.key]?.voltageText??""),u.select("tspan.voltage-metric-unit").attr("dx",1).attr("font-size",22).attr("font-weight",500).attr("fill","var(--kip-contrast-color)").text("V"),u.select("text.charger-current").attr("x",197).attr("y",48).attr("text-anchor","end").attr("font-size",t.lineOneFontSize).attr("fill","var(--kip-contrast-color)"),u.select("tspan.current-metric-value").text(l=>e$1.displayModels[l.key]?.currentText??""),u.select("tspan.current-metric-unit").attr("dx",1).attr("font-size",12).attr("fill","var(--kip-contrast-color)").text("A"),u.select("text.charger-power").attr("x",5).attr("y",22).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.power-metric-value").text(l=>e$1.displayModels[l.key]?.powerText??""),u.select("tspan.power-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text("W"),u.select("text.charger-temperature").attr("x",5).attr("y",34).attr("fill","var(--kip-contrast-dim-color)").attr("font-size",10),u.select("tspan.temperature-metric-value").text(l=>e$1.displayModels[l.key]?.temperatureText??""),u.select("tspan.temperature-metric-unit").attr("dx",1).attr("font-size",6).attr("fill","var(--kip-contrast-dim-color)").text(`${this.units.getDefaults().Temperature==="celsius"?"\xB0C":"\xB0F"}`),u.select("text.charger-mode").attr("x",5).attr("y",46).attr("font-size",10).attr("fill","var(--kip-contrast-dim-color)").text(l=>e$1.displayModels[l.key]?.modeText??""),b.exit().remove();}resolveTitleText(e,r=false){let t=e.name||`Charger ${e.id}`;return !r||!e.source?t:`${t} [${e.source}]`}resolveModeText(e){if(e.chargingMode)return `Mode: ${e.chargingMode.charAt(0).toUpperCase()+e.chargingMode.slice(1)}`;if(e.mode)return `Mode: ${e.mode}`;let t=[{active:e.ledsAbsorption,label:"Absorption"},{active:e.ledsBulk,label:"Bulk"},{active:e.ledsFloat,label:"Float"},{active:e.ledsInverter,label:"Inverter"},{active:e.ledsLowBattery,label:"Low Battery"},{active:e.ledsMains,label:"Mains"},{active:e.ledsOverload,label:"Overload"},{active:e.ledsTemperature,label:"Temperature"}].filter(i=>i.active===true).map(i=>i.label);return t.length?`Mode: ${t.join(" / ")}`:"Mode --"}resolveShapeMode(e){return (e.chargingMode??e.mode??"").trim().toLowerCase()}isShapeMode(e,r){return !e||!r?false:e===r||e.includes(r)}buildMetricRows(e){return this.renderMode()==="full"||this.renderMode()===null?[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`Power: ${this.formatValue(e.power,0)}`,`Temp: ${this.formatTemperature(e.temperature)}`]:[`${this.formatValue(e.voltage,1)}`,`${this.formatValue(e.current,1)}`,`P: ${this.formatValue(e.power,0)}`,`T: ${this.formatTemperature(e.temperature)}`]}formatValue(e,r){return e==null||Number.isNaN(e)?"-":`${e.toFixed(r)}`}formatTemperature(e){return e==null||Number.isNaN(e)?"-":`${e.toFixed(0)}`}toStringValue(e){return typeof e=="string"?e:null}toBoolean(e){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return true;if(e===0)return false}if(typeof e=="string"){let r=e.trim().toLowerCase();if(r==="true"||r==="1"||r==="on")return true;if(r==="false"||r==="0"||r==="off")return false}return null}resolveMostSevereState(...e){return e.some(r=>r===n$1.Alert)?n$1.Alert:e.some(r=>r===n$1.Alarm)?n$1.Alarm:e.some(r=>r===n$1.Warn)?n$1.Warn:e.some(r=>r===n$1.Normal)?n$1.Normal:null}toNumber(e,r){if(e==null||typeof e=="boolean")return null;let t=typeof e=="number"?e:Number(e);if(!Number.isFinite(t))return null;let i=this.units.convertToUnit(r,t);return Number.isFinite(i)?i:t}static \u0275fac=function(r){return new(r||c$1)};static \u0275cmp=JD({type:c$1,selectors:[["widget-charger"]],viewQuery:function(r,t){r&1&&eg(t.svgRef,ge,5),r&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"],renderMode:[1,"renderMode"]},decls:4,vars:3,consts:[["chargerSvg",""],[3,"text","color"],["aria-hidden","false",1,"charger-svg"],[1,"charger-empty"],[1,"charger-empty-title"],[1,"charger-empty-sub"]],template:function(r,t){r&1&&($h(0,"widget-title",1),wd(),$h(1,"svg",2,0),_w(3,me,5,0,"div",3)),r&2&&(Bh("text",t.displayLabel())("color",t.labelColor()),EE(3),Mw(t.hasChargers()?-1:3));},dependencies:[x],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%;position:relative;overflow:hidden}.charger-svg[_ngcontent-%COMP%]{display:block;position:absolute;left:0;right:0;top:15%;height:85%;width:100%;overflow:hidden;z-index:20;padding:0 10px 10px}.charger-empty[_ngcontent-%COMP%]{position:absolute;inset:0;margin:10px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--mat-sys-on-surface);background:color-mix(in srgb,var(--kip-widget-card-background-color) 92%,transparent)}.charger-empty-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600}.charger-empty-sub[_ngcontent-%COMP%]{font-size:14px;opacity:.8}"]})};export{le as WidgetChargerComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {dx as n$1}from'./main-
|
|
1
|
+
import {dx as n$1}from'./main-YKDNK5VZ.js';function c(n,r){let i={contrast:{color:r.contrast,dim:r.contrastDim,dimmer:r.contrastDimmer},blue:{color:r.blue,dim:r.blueDim,dimmer:r.blueDimmer},green:{color:r.green,dim:r.greenDim,dimmer:r.greenDimmer},pink:{color:r.pink,dim:r.pinkDim,dimmer:r.pinkDimmer},orange:{color:r.orange,dim:r.orangeDim,dimmer:r.orangeDimmer},purple:{color:r.purple,dim:r.purpleDim,dimmer:r.purpleDimmer},yellow:{color:r.yellow,dim:r.yellowDim,dimmer:r.yellowDimmer},grey:{color:r.grey,dim:r.greyDim,dimmer:r.greyDimmer}},l=n in i?n:"contrast";return i[l]}function e(n,r,i,l){if(l||!n||!i)return r;switch(n){case n$1.Nominal:return i.zoneNominal;case n$1.Alarm:return i.zoneAlarm;case n$1.Warn:return i.zoneWarn;case n$1.Alert:return i.zoneAlert;default:return r}}export{c,e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {O}from'./chunk-tAiV3ARh.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-BAV5VDOD.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
|
|
1
|
+
import {O}from'./chunk-x7L6DXVK.js';import {w,aS as De,aY as xe$1,a7 as Gj,i as ir,aR as lt$1,ab as te,$ as $j,cN as Wl,a_ as Gp,W as Wp,E as Em,F as Fa,cO as eu,cP as Z,as as ke,J as JD,cQ as ce,bb as rt$1,bc as ae$1,bH as ln$1,bd as an$1,O as Op,o as eu$1,y as yt,b as wt,cR as zt,bg as mt,c as $h,P as Pi$1,T as TT,u as ul,k as Qh,cS as pl,cf as xh,cT as hl,B as Bh,e as EE,f as eg,K as Kw,aB as gr,aF as Pr,ac as Mr,cU as $n,az as Yj,ad as Qe$1,aa as N,bA as Ft,bB as F,al as Zj,_ as _w,cn as wd,cV as Td,M as Mw,bp as gl,an as Hh,cW as Ur,ak as nw,ay as lv,cX as Xt,aq as Bn$1,cY as Io,aj as zm,cZ as Tm,c_ as Fm,c2 as bh,c3 as Qs,c4 as Fn$1,c8 as Sv,c9 as Sh,bV as Gw,bW as zw,am as LT,s as sg,c$ as Wh,bI as Lt,bQ as Dn$1,a6 as Lr,d0 as dh,bR as ot$1,v as vt,aD as Ce,bS as oa,ci as dl,cj as fl,bu as ut,aQ as ee,d1 as Hj,bh as xp,aA as gg,h as Fw,l as ud,g as qw,m as dd,X as xw,Y as Aw,bl as Jw,d2 as wt$1,d3 as ib,a9 as ru,cl as G,aC as L,ae as be,d4 as gi,bT as Lg,ag as bu,d5 as jt,d6 as _,d7 as Ce$1,d8 as Y$1,d9 as Cm,da as Qm,aJ as wm,db as Dm,ca as Kh,c0 as Zw,c1 as Yw,ap as Ki$1,co as Mr$1,dc as O$1,dd as $e$1,de as Nt,df as Vt,dg as pt,dh as zt$1,di as jt$1,bi as Eg,bj as ST,dj as Nw,bm as Ig,dk as Vh,at as Tp,cp as Uh}from'./main-YKDNK5VZ.js';var Vi=[[["caption"]],[["colgroup"],["col"]],"*"],Ui=["caption","colgroup, col","*"];function $i(i,o){i&1&&zw(0,2);}function Qi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",0),Wh(3,2)(4,3),ul(),Pi$1(5,"tfoot",0),Wh(6,4),ul());}function Wi(i,o){i&1&&Wh(0,1)(1,2)(2,3)(3,4);}var A=new N("CDK_TABLE");var Ue=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellDef",""]]})}return i})(),$e=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkHeaderCellDef",""]]})}return i})(),Ci=(()=>{class i{template=w(Mr$1);static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkFooterCellDef",""]]})}return i})(),Y=(()=>{class i{_table=w(A,{optional:true});_hasStickyChanged=false;get name(){return this._name}set name(e){this._setNameInput(e);}_name;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;get stickyEnd(){return this._stickyEnd}set stickyEnd(e){e!==this._stickyEnd&&(this._stickyEnd=e,this._hasStickyChanged=true);}_stickyEnd=false;cell;headerCell;footerCell;cssClassFriendlyName;_columnCssClassName;hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}_updateColumnCssClassName(){this._columnCssClassName=[`cdk-column-${this.cssClassFriendlyName}`];}_setNameInput(e){e&&(this._name=e,this.cssClassFriendlyName=e.replace(/[^a-z0-9_-]/gi,"-"),this._updateColumnCssClassName());}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkColumnDef",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,Ue,5)(a,$e,5)(a,Ci,5),t&2){let r;Zw(r=Yw())&&(n.cell=r.first),Zw(r=Yw())&&(n.headerCell=r.first),Zw(r=Yw())&&(n.footerCell=r.first);}},inputs:{name:[0,"cdkColumnDef","name"],sticky:[2,"sticky","sticky",Zj],stickyEnd:[2,"stickyEnd","stickyEnd",Zj]}})}return i})(),Ve=class{constructor(o,e){e.nativeElement.classList.add(...o._columnCssClassName);}},bi=(()=>{class i extends Ve{constructor(){super(w(Y),w(Lr));}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-header-cell"],["th","cdk-header-cell",""]],hostAttrs:["role","columnheader",1,"cdk-header-cell"],features:[Sh]})}return i})();var Di=(()=>{class i extends Ve{constructor(){let e=w(Y),t=w(Lr);super(e,t);let n=e._table?._getCellRole();n&&t.nativeElement.setAttribute("role",n);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["cdk-cell"],["td","cdk-cell",""]],hostAttrs:[1,"cdk-cell"],features:[Sh]})}return i})();var tt=(()=>{class i{template=w(Mr$1);_differs=w(ib);columns;_columnsDiffer;ngOnChanges(e){if(!this._columnsDiffer){let t=e.columns&&e.columns.currentValue||[];this._columnsDiffer=this._differs.find(t).create(),this._columnsDiffer.diff(t);}}getColumnsDiff(){return this._columnsDiffer.diff(this.columns)}extractCellTemplate(e){return this instanceof Me?e.headerCell.template:this instanceof it?e.footerCell.template:e.cell.template}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,features:[lv]})}return i})(),Me=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkHeaderRowDef",""]],inputs:{columns:[0,"cdkHeaderRowDef","columns"],sticky:[2,"cdkHeaderRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),it=(()=>{class i extends tt{_table=w(A,{optional:true});_hasStickyChanged=false;get sticky(){return this._sticky}set sticky(e){e!==this._sticky&&(this._sticky=e,this._hasStickyChanged=true);}_sticky=false;ngOnChanges(e){super.ngOnChanges(e);}hasStickyChanged(){let e=this._hasStickyChanged;return this.resetStickyChanged(),e}resetStickyChanged(){this._hasStickyChanged=false;}static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkFooterRowDef",""]],inputs:{columns:[0,"cdkFooterRowDef","columns"],sticky:[2,"cdkFooterRowDefSticky","sticky",Zj]},features:[Sh,lv]})}return i})(),Qe=(()=>{class i extends tt{_table=w(A,{optional:true});when;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275dir=nw({type:i,selectors:[["","cdkRowDef",""]],inputs:{columns:[0,"cdkRowDefColumns","columns"],when:[0,"cdkRowDefWhen","when"]},features:[Sh]})}return i})(),ae=(()=>{class i{_viewContainer=w(Ki$1);cells;context;static mostRecentCellOutlet=null;constructor(){i.mostRecentCellOutlet=this;}ngOnDestroy(){i.mostRecentCellOutlet===this&&(i.mostRecentCellOutlet=null);}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","cdkCellOutlet",""]]})}return i})(),nt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-header-row"],["tr","cdk-header-row",""]],hostAttrs:["role","row",1,"cdk-header-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})();var ot=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-row"],["tr","cdk-row",""]],hostAttrs:["role","row",1,"cdk-row"],decls:1,vars:0,consts:[["cdkCellOutlet",""]],template:function(t,n){t&1&&Wh(0,0);},dependencies:[ae],encapsulation:2,changeDetection:1})}return i})(),We=(()=>{class i{templateRef=w(Mr$1);_contentClassNames=["cdk-no-data-row","cdk-row"];_cellClassNames=["cdk-cell","cdk-no-data-cell"];_cellSelector="td, cdk-cell, [cdk-cell], .cdk-cell";static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["ng-template","cdkNoDataRow",""]]})}return i})(),yi=["top","bottom","left","right"],et=class{_isNativeHtmlTable;_stickCellCss;_isBrowser;_needsPositionStickyOnElement;direction;_positionListener;_tableInjector;_elemSizeCache=new WeakMap;_resizeObserver=globalThis?.ResizeObserver?new globalThis.ResizeObserver(o=>this._updateCachedSizes(o)):null;_updatedStickyColumnsParamsToReplay=[];_stickyColumnsReplayTimeout=null;_cachedCellWidths=[];_borderCellCss;_destroyed=false;constructor(o,e,t=true,n=true,a,r,l){this._isNativeHtmlTable=o,this._stickCellCss=e,this._isBrowser=t,this._needsPositionStickyOnElement=n,this.direction=a,this._positionListener=r,this._tableInjector=l,this._borderCellCss={top:`${e}-border-elem-top`,bottom:`${e}-border-elem-bottom`,left:`${e}-border-elem-left`,right:`${e}-border-elem-right`};}clearStickyPositioning(o,e){(e.includes("left")||e.includes("right"))&&this._removeFromStickyColumnReplayQueue(o);let t=[];for(let n of o)n.nodeType===n.ELEMENT_NODE&&t.push(n,...Array.from(n.children));Tp({write:()=>{for(let n of t)this._removeStickyStyle(n,e);}},{injector:this._tableInjector});}updateStickyColumns(o,e,t,n=true,a=true){if(!o.length||!this._isBrowser||!(e.some(P=>P)||t.some(P=>P))){this._positionListener?.stickyColumnsUpdated({sizes:[]}),this._positionListener?.stickyEndColumnsUpdated({sizes:[]});return}let r=o[0],l=r.children.length,u=this.direction==="rtl",p=u?"right":"left",g=u?"left":"right",w=e.lastIndexOf(true),S=t.indexOf(true),R,mt,ut;a&&this._updateStickyColumnReplayQueue({rows:[...o],stickyStartStates:[...e],stickyEndStates:[...t]}),Tp({earlyRead:()=>{R=this._getCellWidths(r,n),mt=this._getStickyStartColumnPositions(R,e),ut=this._getStickyEndColumnPositions(R,t);},write:()=>{for(let P of o)for(let I=0;I<l;I++){let ft=P.children[I];e[I]&&this._addStickyStyle(ft,p,mt[I],I===w),t[I]&&this._addStickyStyle(ft,g,ut[I],I===S);}this._positionListener&&R.some(P=>!!P)&&(this._positionListener.stickyColumnsUpdated({sizes:w===-1?[]:R.slice(0,w+1).map((P,I)=>e[I]?P:null)}),this._positionListener.stickyEndColumnsUpdated({sizes:S===-1?[]:R.slice(S).map((P,I)=>t[I+S]?P:null).reverse()}));}},{injector:this._tableInjector});}stickRows(o,e,t){if(!this._isBrowser)return;let n=t==="bottom"?o.slice().reverse():o,a=t==="bottom"?e.slice().reverse():e,r=[],l=[],u=[];Tp({earlyRead:()=>{for(let p=0,g=0;p<n.length;p++){if(!a[p])continue;r[p]=g;let w=n[p];u[p]=this._isNativeHtmlTable?Array.from(w.children):[w];let S=this._retrieveElementSize(w).height;g+=S,l[p]=S;}},write:()=>{let p=a.lastIndexOf(true);for(let g=0;g<n.length;g++){if(!a[g])continue;let w=r[g],S=g===p;for(let R of u[g])this._addStickyStyle(R,t,w,S);}t==="top"?this._positionListener?.stickyHeaderRowsUpdated({sizes:l,offsets:r,elements:u}):this._positionListener?.stickyFooterRowsUpdated({sizes:l,offsets:r,elements:u});}},{injector:this._tableInjector});}updateStickyFooterContainer(o,e){this._isNativeHtmlTable&&Tp({write:()=>{let t=o.querySelector("tfoot");t&&(e.some(n=>!n)?this._removeStickyStyle(t,["bottom"]):this._addStickyStyle(t,"bottom",0,false));}},{injector:this._tableInjector});}destroy(){this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._resizeObserver?.disconnect(),this._destroyed=true;}_removeStickyStyle(o,e){if(!o.classList.contains(this._stickCellCss))return;for(let n of e)o.style[n]="",o.classList.remove(this._borderCellCss[n]);yi.some(n=>e.indexOf(n)===-1&&o.style[n])?o.style.zIndex=this._getCalculatedZIndex(o):(o.style.zIndex="",this._needsPositionStickyOnElement&&(o.style.position=""),o.classList.remove(this._stickCellCss));}_addStickyStyle(o,e,t,n){o.classList.add(this._stickCellCss),n&&o.classList.add(this._borderCellCss[e]),o.style[e]=`${t}px`,o.style.zIndex=this._getCalculatedZIndex(o),this._needsPositionStickyOnElement&&(o.style.cssText+="position: -webkit-sticky; position: sticky; ");}_getCalculatedZIndex(o){let e={top:100,bottom:10,left:1,right:1},t=0;for(let n of yi)o.style[n]&&(t+=e[n]);return t?`${t}`:""}_getCellWidths(o,e=true){if(!e&&this._cachedCellWidths.length)return this._cachedCellWidths;let t=[],n=o.children;for(let a=0;a<n.length;a++){let r=n[a];t.push(this._retrieveElementSize(r).width);}return this._cachedCellWidths=t,t}_getStickyStartColumnPositions(o,e){let t=[],n=0;for(let a=0;a<o.length;a++)e[a]&&(t[a]=n,n+=o[a]);return t}_getStickyEndColumnPositions(o,e){let t=[],n=0;for(let a=o.length;a>0;a--)e[a]&&(t[a]=n,n+=o[a]);return t}_retrieveElementSize(o){let e=this._elemSizeCache.get(o);if(e)return e;let t=o.getBoundingClientRect(),n={width:t.width,height:t.height};return this._resizeObserver&&(this._elemSizeCache.set(o,n),this._resizeObserver.observe(o,{box:"border-box"})),n}_updateStickyColumnReplayQueue(o){this._removeFromStickyColumnReplayQueue(o.rows),this._stickyColumnsReplayTimeout||this._updatedStickyColumnsParamsToReplay.push(o);}_removeFromStickyColumnReplayQueue(o){let e=new Set(o);for(let t of this._updatedStickyColumnsParamsToReplay)t.rows=t.rows.filter(n=>!e.has(n));this._updatedStickyColumnsParamsToReplay=this._updatedStickyColumnsParamsToReplay.filter(t=>!!t.rows.length);}_updateCachedSizes(o){let e=false;for(let t of o){let n=t.borderBoxSize?.length?{width:t.borderBoxSize[0].inlineSize,height:t.borderBoxSize[0].blockSize}:{width:t.contentRect.width,height:t.contentRect.height};n.width!==this._elemSizeCache.get(t.target)?.width&&qi(t.target)&&(e=true),this._elemSizeCache.set(t.target,n);}e&&this._updatedStickyColumnsParamsToReplay.length&&(this._stickyColumnsReplayTimeout&&clearTimeout(this._stickyColumnsReplayTimeout),this._stickyColumnsReplayTimeout=setTimeout(()=>{if(!this._destroyed){for(let t of this._updatedStickyColumnsParamsToReplay)this.updateStickyColumns(t.rows,t.stickyStartStates,t.stickyEndStates,true,false);this._updatedStickyColumnsParamsToReplay=[],this._stickyColumnsReplayTimeout=null;}},0));}};function qi(i){return ["cdk-cell","cdk-header-cell","cdk-footer-cell"].some(o=>i.classList.contains(o))}var xe=new N("STICKY_POSITIONING_LISTENER");var at=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._rowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","rowOutlet",""]]})}return i})(),rt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._headerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","headerRowOutlet",""]]})}return i})(),st=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._footerRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","footerRowOutlet",""]]})}return i})(),lt=(()=>{class i{viewContainer=w(Ki$1);elementRef=w(Lr);constructor(){let e=w(A);e._noDataRowOutlet=this,e._outletAssigned();}static \u0275fac=function(t){return new(t||i)};static \u0275dir=nw({type:i,selectors:[["","noDataRowOutlet",""]]})}return i})(),ct=(()=>{class i{_differs=w(ib);_changeDetectorRef=w(Gj);_elementRef=w(Lr);_dir=w(ru,{optional:true});_platform=w(G);_viewRepeater;_viewportRuler=w(L);_injector=w(be);_virtualScrollViewport=w(gi,{optional:true,host:true});_positionListener=w(xe,{optional:true})||w(xe,{optional:true,skipSelf:true});_document=w(gr);_data;_renderedRange;_onDestroy=new te;_renderRows;_renderChangeSubscription=null;_columnDefsByName=new Map;_rowDefs;_headerRowDefs;_footerRowDefs;_dataDiffer;_defaultRowDef=null;_customColumnDefs=new Set;_customRowDefs=new Set;_customHeaderRowDefs=new Set;_customFooterRowDefs=new Set;_customNoDataRow=null;_headerRowDefChanged=true;_footerRowDefChanged=true;_stickyColumnStylesNeedReset=true;_forceRecalculateCellWidths=true;_cachedRenderRowsMap=new Map;_isNativeHtmlTable;_stickyStyler;stickyCssClass="cdk-table-sticky";needsPositionStickyOnElement=true;_isServer;_isShowingNoDataRow=false;_hasAllOutlets=false;_hasInitialized=false;_headerRowStickyUpdates=new te;_footerRowStickyUpdates=new te;_disableVirtualScrolling=false;_getCellRole(){if(this._cellRoleInternal===void 0){let e=this._elementRef.nativeElement.getAttribute("role");return e==="grid"||e==="treegrid"?"gridcell":"cell"}return this._cellRoleInternal}_cellRoleInternal=void 0;get trackBy(){return this._trackByFn}set trackBy(e){this._trackByFn=e;}_trackByFn;get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&(this._switchDataSource(e),this._changeDetectorRef.markForCheck());}_dataSource;_dataSourceChanges=new te;_dataStream=new te;get multiTemplateDataRows(){return this._multiTemplateDataRows}set multiTemplateDataRows(e){this._multiTemplateDataRows=e,this._rowOutlet&&this._rowOutlet.viewContainer.length&&(this._forceRenderDataRows(),this.updateStickyColumnStyles());}_multiTemplateDataRows=false;get fixedLayout(){return this._virtualScrollEnabled()?true:this._fixedLayout}set fixedLayout(e){this._fixedLayout=e,this._forceRecalculateCellWidths=true,this._stickyColumnStylesNeedReset=true;}_fixedLayout=false;recycleRows=false;contentChanged=new Qe$1;viewChange=new Bn$1({start:0,end:Number.MAX_VALUE});_rowOutlet;_headerRowOutlet;_footerRowOutlet;_noDataRowOutlet;_contentColumnDefs;_contentRowDefs;_contentHeaderRowDefs;_contentFooterRowDefs;_noDataRow;get renderedRows(){return this._renderRows}constructor(){w(new Lg("role"),{optional:true})||this._elementRef.nativeElement.setAttribute("role","table"),this._isServer=!this._platform.isBrowser,this._isNativeHtmlTable=this._elementRef.nativeElement.nodeName==="TABLE",this._dataDiffer=this._differs.find([]).create((t,n)=>this.trackBy?this.trackBy(n.dataIndex,n.data):n);}ngOnInit(){this._setupStickyStyler(),this._viewportRuler.change().pipe(bu(this._onDestroy)).subscribe(()=>{this._forceRecalculateCellWidths=true;});}ngAfterContentInit(){this._viewRepeater=this.recycleRows||this._virtualScrollEnabled()?new jt:new _,this._virtualScrollEnabled()&&this._setupVirtualScrolling(this._virtualScrollViewport),this._hasInitialized=true;}ngAfterContentChecked(){this._canRender()&&this._render();}ngOnDestroy(){this._stickyStyler?.destroy(),[this._rowOutlet?.viewContainer,this._headerRowOutlet?.viewContainer,this._footerRowOutlet?.viewContainer,this._cachedRenderRowsMap,this._customColumnDefs,this._customRowDefs,this._customHeaderRowDefs,this._customFooterRowDefs,this._columnDefsByName].forEach(e=>{e?.clear();}),this._headerRowDefs=[],this._footerRowDefs=[],this._defaultRowDef=null,this._headerRowStickyUpdates.complete(),this._footerRowStickyUpdates.complete(),this._onDestroy.next(),this._onDestroy.complete(),Ce$1(this.dataSource)&&this.dataSource.disconnect(this);}renderRows(){this._renderRows=this._getAllRenderRows();let e=this._dataDiffer.diff(this._renderRows);if(!e){this._updateNoDataRow(),this.contentChanged.next();return}let t=this._rowOutlet.viewContainer;this._viewRepeater.applyChanges(e,t,(n,a,r)=>this._getEmbeddedViewArgs(n.item,r),n=>n.item.data,n=>{n.operation===Y$1.INSERTED&&n.context&&this._renderCellTemplateForItem(n.record.item.rowDef,n.context);}),this._updateRowIndexContext(),e.forEachIdentityChange(n=>{let a=t.get(n.currentIndex);a.context.$implicit=n.item.data;}),this._updateNoDataRow(),this.contentChanged.next(),this.updateStickyColumnStyles();}addColumnDef(e){this._customColumnDefs.add(e);}removeColumnDef(e){this._customColumnDefs.delete(e);}addRowDef(e){this._customRowDefs.add(e);}removeRowDef(e){this._customRowDefs.delete(e);}addHeaderRowDef(e){this._customHeaderRowDefs.add(e),this._headerRowDefChanged=true;}removeHeaderRowDef(e){this._customHeaderRowDefs.delete(e),this._headerRowDefChanged=true;}addFooterRowDef(e){this._customFooterRowDefs.add(e),this._footerRowDefChanged=true;}removeFooterRowDef(e){this._customFooterRowDefs.delete(e),this._footerRowDefChanged=true;}setNoDataRow(e){this._customNoDataRow=e;}updateStickyHeaderRowStyles(){let e=this._getRenderedRows(this._headerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._headerRowOutlet,"thead");n&&(n.style.display=e.length?"":"none");}let t=this._headerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["top"]),this._stickyStyler.stickRows(e,t,"top"),this._headerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyFooterRowStyles(){let e=this._getRenderedRows(this._footerRowOutlet);if(this._isNativeHtmlTable){let n=wi(this._footerRowOutlet,"tfoot");n&&(n.style.display=e.length?"":"none");}let t=this._footerRowDefs.map(n=>n.sticky);this._stickyStyler.clearStickyPositioning(e,["bottom"]),this._stickyStyler.stickRows(e,t,"bottom"),this._stickyStyler.updateStickyFooterContainer(this._elementRef.nativeElement,t),this._footerRowDefs.forEach(n=>n.resetStickyChanged());}updateStickyColumnStyles(){let e=this._getRenderedRows(this._headerRowOutlet),t=this._getRenderedRows(this._rowOutlet),n=this._getRenderedRows(this._footerRowOutlet);(this._isNativeHtmlTable&&!this.fixedLayout||this._stickyColumnStylesNeedReset)&&(this._stickyStyler.clearStickyPositioning([...e,...t,...n],["left","right"]),this._stickyColumnStylesNeedReset=false),e.forEach((a,r)=>{this._addStickyColumnStyles([a],this._headerRowDefs[r]);}),this._rowDefs.forEach(a=>{let r=[];for(let l=0;l<t.length;l++)this._renderRows[l].rowDef===a&&r.push(t[l]);this._addStickyColumnStyles(r,a);}),n.forEach((a,r)=>{this._addStickyColumnStyles([a],this._footerRowDefs[r]);}),Array.from(this._columnDefsByName.values()).forEach(a=>a.resetStickyChanged());}stickyColumnsUpdated(e){this._positionListener?.stickyColumnsUpdated(e);}stickyEndColumnsUpdated(e){this._positionListener?.stickyEndColumnsUpdated(e);}stickyHeaderRowsUpdated(e){this._headerRowStickyUpdates.next(e),this._positionListener?.stickyHeaderRowsUpdated(e);}stickyFooterRowsUpdated(e){this._footerRowStickyUpdates.next(e),this._positionListener?.stickyFooterRowsUpdated(e);}_outletAssigned(){!this._hasAllOutlets&&this._rowOutlet&&this._headerRowOutlet&&this._footerRowOutlet&&this._noDataRowOutlet&&(this._hasAllOutlets=true,this._canRender()&&this._render());}_canRender(){return this._hasAllOutlets&&this._hasInitialized}_render(){this._cacheRowDefs(),this._cacheColumnDefs(),!this._headerRowDefs.length&&!this._footerRowDefs.length&&this._rowDefs.length;let t=this._renderUpdatedColumns()||this._headerRowDefChanged||this._footerRowDefChanged;this._stickyColumnStylesNeedReset=this._stickyColumnStylesNeedReset||t,this._forceRecalculateCellWidths=t,this._headerRowDefChanged&&(this._forceRenderHeaderRows(),this._headerRowDefChanged=false),this._footerRowDefChanged&&(this._forceRenderFooterRows(),this._footerRowDefChanged=false),this.dataSource&&this._rowDefs.length>0&&!this._renderChangeSubscription?this._observeRenderChanges():this._stickyColumnStylesNeedReset&&this.updateStickyColumnStyles(),this._checkStickyStates();}_getAllRenderRows(){if(!Array.isArray(this._data)||!this._renderedRange)return [];let e=[],t=Math.min(this._data.length,this._renderedRange.end),n=this._cachedRenderRowsMap;this._cachedRenderRowsMap=new Map;for(let a=this._renderedRange.start;a<t;a++){let r=this._data[a],l=this._getRenderRowsForData(r,a,n.get(r));this._cachedRenderRowsMap.has(r)||this._cachedRenderRowsMap.set(r,new WeakMap);for(let u=0;u<l.length;u++){let p=l[u],g=this._cachedRenderRowsMap.get(p.data);g.has(p.rowDef)?g.get(p.rowDef).push(p):g.set(p.rowDef,[p]),e.push(p);}}return e}_getRenderRowsForData(e,t,n){return this._getRowDefs(e,t).map(r=>{let l=n&&n.has(r)?n.get(r):[];if(l.length){let u=l.shift();return u.dataIndex=t,u}else return {data:e,rowDef:r,dataIndex:t}})}_cacheColumnDefs(){this._columnDefsByName.clear(),je(this._getOwnDefs(this._contentColumnDefs),this._customColumnDefs).forEach(t=>{this._columnDefsByName.has(t.name),this._columnDefsByName.set(t.name,t);});}_cacheRowDefs(){this._headerRowDefs=je(this._getOwnDefs(this._contentHeaderRowDefs),this._customHeaderRowDefs),this._footerRowDefs=je(this._getOwnDefs(this._contentFooterRowDefs),this._customFooterRowDefs),this._rowDefs=je(this._getOwnDefs(this._contentRowDefs),this._customRowDefs);let e=this._rowDefs.filter(t=>!t.when);this._defaultRowDef=e[0];}_renderUpdatedColumns(){let e=(r,l)=>{let u=!!l.getColumnsDiff();return r||u},t=this._rowDefs.reduce(e,false);t&&this._forceRenderDataRows();let n=this._headerRowDefs.reduce(e,false);n&&this._forceRenderHeaderRows();let a=this._footerRowDefs.reduce(e,false);return a&&this._forceRenderFooterRows(),t||n||a}_switchDataSource(e){this._data=[],Ce$1(this.dataSource)&&this.dataSource.disconnect(this),this._renderChangeSubscription&&(this._renderChangeSubscription.unsubscribe(),this._renderChangeSubscription=null),e||(this._dataDiffer&&this._dataDiffer.diff([]),this._rowOutlet&&this._rowOutlet.viewContainer.clear()),this._dataSource=e;}_observeRenderChanges(){if(!this.dataSource)return;let e;Ce$1(this.dataSource)?e=this.dataSource.connect(this):Cm(this.dataSource)?e=this.dataSource:Array.isArray(this.dataSource)&&(e=Tm(this.dataSource)),this._renderChangeSubscription=Fm([e,this.viewChange]).pipe(bu(this._onDestroy)).subscribe(([t,n])=>{this._data=t||[],this._renderedRange=n,this._dataStream.next(t),this.renderRows();});}_forceRenderHeaderRows(){this._headerRowOutlet.viewContainer.length>0&&this._headerRowOutlet.viewContainer.clear(),this._headerRowDefs.forEach((e,t)=>this._renderRow(this._headerRowOutlet,e,t)),this.updateStickyHeaderRowStyles();}_forceRenderFooterRows(){this._footerRowOutlet.viewContainer.length>0&&this._footerRowOutlet.viewContainer.clear(),this._footerRowDefs.forEach((e,t)=>this._renderRow(this._footerRowOutlet,e,t)),this.updateStickyFooterRowStyles();}_addStickyColumnStyles(e,t){let n=Array.from(t?.columns||[]).map(l=>{let u=this._columnDefsByName.get(l);return u}),a=n.map(l=>l.sticky),r=n.map(l=>l.stickyEnd);this._stickyStyler.updateStickyColumns(e,a,r,!this.fixedLayout||this._forceRecalculateCellWidths);}_getRenderedRows(e){let t=[];for(let n=0;n<e.viewContainer.length;n++){let a=e.viewContainer.get(n);t.push(a.rootNodes[0]);}return t}_getRowDefs(e,t){if(this._rowDefs.length===1)return [this._rowDefs[0]];let n=[];if(this.multiTemplateDataRows)n=this._rowDefs.filter(a=>!a.when||a.when(t,e));else {let a=this._rowDefs.find(r=>r.when&&r.when(t,e))||this._defaultRowDef;a&&n.push(a);}return n.length,n}_getEmbeddedViewArgs(e,t){let n=e.rowDef,a={$implicit:e.data};return {templateRef:n.template,context:a,index:t}}_renderRow(e,t,n,a={}){let r=e.viewContainer.createEmbeddedView(t.template,a,n);return this._renderCellTemplateForItem(t,a),r}_renderCellTemplateForItem(e,t){for(let n of this._getCellTemplates(e))ae.mostRecentCellOutlet&&ae.mostRecentCellOutlet._viewContainer.createEmbeddedView(n,t);this._changeDetectorRef.markForCheck();}_updateRowIndexContext(){let e=this._rowOutlet.viewContainer;for(let t=0,n=e.length;t<n;t++){let r=e.get(t).context;r.count=n,r.first=t===0,r.last=t===n-1,r.even=t%2===0,r.odd=!r.even,this.multiTemplateDataRows?(r.dataIndex=this._renderRows[t].dataIndex,r.renderIndex=t):r.index=this._renderRows[t].dataIndex;}}_getCellTemplates(e){return !e||!e.columns?[]:Array.from(e.columns,t=>{let n=this._columnDefsByName.get(t);return e.extractCellTemplate(n)})}_forceRenderDataRows(){this._dataDiffer.diff([]),this._rowOutlet.viewContainer.clear(),this.renderRows();}_checkStickyStates(){let e=(t,n)=>t||n.hasStickyChanged();this._headerRowDefs.reduce(e,false)&&this.updateStickyHeaderRowStyles(),this._footerRowDefs.reduce(e,false)&&this.updateStickyFooterRowStyles(),Array.from(this._columnDefsByName.values()).reduce(e,false)&&(this._stickyColumnStylesNeedReset=true,this.updateStickyColumnStyles());}_setupStickyStyler(){let e=this._dir?this._dir.value:"ltr",t=this._injector;this._stickyStyler=new et(this._isNativeHtmlTable,this.stickyCssClass,this._platform.isBrowser,this.needsPositionStickyOnElement,e,this,t),(this._dir?this._dir.change:Tm()).pipe(bu(this._onDestroy)).subscribe(n=>{this._stickyStyler.direction=n,this.updateStickyColumnStyles();});}_setupVirtualScrolling(e){let t=typeof requestAnimationFrame<"u"?wm:Dm;this.viewChange.next({start:0,end:0}),e.renderedRangeStream.pipe(Qm(0,t),bu(this._onDestroy)).subscribe(this.viewChange),e.attach({dataStream:this._dataStream,measureRangeSize:(n,a)=>this._measureRangeSize(n,a)}),Fm([e.renderedContentOffset,this._headerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l){let u=a.offsets[r],p=n!==0?Math.max(n-u,u):-u;for(let g of l)g.style.top=`${-p}px`;}}}),Fm([e.renderedContentOffset,this._footerRowStickyUpdates]).pipe(bu(this._onDestroy)).subscribe(([n,a])=>{if(!(!a.sizes||!a.offsets||!a.elements))for(let r=0;r<a.elements.length;r++){let l=a.elements[r];if(l)for(let u of l)u.style.bottom=`${n+a.offsets[r]}px`;}});}_getOwnDefs(e){return e.filter(t=>!t._table||t._table===this)}_updateNoDataRow(){let e=this._customNoDataRow||this._noDataRow;if(!e)return;let t=this._rowOutlet.viewContainer.length===0;if(t===this._isShowingNoDataRow)return;let n=this._noDataRowOutlet.viewContainer;if(t){let a=n.createEmbeddedView(e.templateRef),r=a.rootNodes[0];if(a.rootNodes.length===1&&r?.nodeType===this._document.ELEMENT_NODE){r.setAttribute("role","row"),r.classList.add(...e._contentClassNames);let l=r.querySelectorAll(e._cellSelector);for(let u=0;u<l.length;u++)l[u].classList.add(...e._cellClassNames);}}else n.clear();this._isShowingNoDataRow=t,this._changeDetectorRef.markForCheck();}_measureRangeSize(e,t){if(e.start>=e.end||t!=="vertical")return 0;let n=this.viewChange.value,a=this._rowOutlet.viewContainer;e.start<n.start||e.end>n.end;let r=e.start-n.start,l=e.end-e.start,u,p;for(let S=0;S<l;S++){let R=a.get(S+r);if(R&&R.rootNodes.length){u=p=R.rootNodes[0];break}}for(let S=l-1;S>-1;S--){let R=a.get(S+r);if(R&&R.rootNodes.length){p=R.rootNodes[R.rootNodes.length-1];break}}let g=u?.getBoundingClientRect?.(),w=p?.getBoundingClientRect?.();return g&&w?w.bottom-g.top:0}_virtualScrollEnabled(){return !this._disableVirtualScrolling&&this._virtualScrollViewport!=null}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=JD({type:i,selectors:[["cdk-table"],["table","cdk-table",""]],contentQueries:function(t,n,a){if(t&1&&Kh(a,We,5)(a,Y,5)(a,Qe,5)(a,Me,5)(a,it,5),t&2){let r;Zw(r=Yw())&&(n._noDataRow=r.first),Zw(r=Yw())&&(n._contentColumnDefs=r),Zw(r=Yw())&&(n._contentRowDefs=r),Zw(r=Yw())&&(n._contentHeaderRowDefs=r),Zw(r=Yw())&&(n._contentFooterRowDefs=r);}},hostAttrs:[1,"cdk-table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("cdk-table-fixed-layout",n.fixedLayout);},inputs:{trackBy:"trackBy",dataSource:"dataSource",multiTemplateDataRows:[2,"multiTemplateDataRows","multiTemplateDataRows",Zj],fixedLayout:[2,"fixedLayout","fixedLayout",Zj],recycleRows:[2,"recycleRows","recycleRows",Zj]},outputs:{contentChanged:"contentChanged"},exportAs:["cdkTable"],features:[LT([{provide:A,useExisting:i},{provide:xe,useValue:null}])],ngContentSelectors:Ui,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Vi),zw(0),zw(1,1),_w(2,$i,1,0),_w(3,Qi,7,0)(4,Wi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.cdk-table-fixed-layout {
|
|
2
2
|
table-layout: fixed;
|
|
3
3
|
}
|
|
4
4
|
`],encapsulation:2,changeDetection:1})}return i})();function je(i,o){return i.concat(Array.from(o))}function wi(i,o){let e=o.toUpperCase(),t=i.viewContainer.element.nativeElement;for(;t;){let n=t.nodeType===1?t.nodeName:null;if(n===e)return t;if(n==="TABLE")break;t=t.parentNode;}return null}var vi=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=bh({type:i});static \u0275inj=Qs({imports:[wt$1]})}return i})();var Gi=[[["caption"]],[["colgroup"],["col"]],"*"],Ki=["caption","colgroup, col","*"];function Yi(i,o){i&1&&zw(0,2);}function Zi(i,o){i&1&&(Pi$1(0,"thead",0),Wh(1,1),ul(),Pi$1(2,"tbody",2),Wh(3,3)(4,4),ul(),Pi$1(5,"tfoot",0),Wh(6,5),ul());}function Xi(i,o){i&1&&Wh(0,1)(1,3)(2,4)(3,5);}var Si=(()=>{class i extends ct{stickyCssClass="mat-mdc-table-sticky";needsPositionStickyOnElement=false;static \u0275fac=(()=>{let e;return function(n){return (e||(e=Sv(i)))(n||i)}})();static \u0275cmp=JD({type:i,selectors:[["mat-table"],["table","mat-table",""]],hostAttrs:[1,"mat-mdc-table","mdc-data-table__table"],hostVars:2,hostBindings:function(t,n){t&2&&sg("mat-table-fixed-layout",n.fixedLayout);},exportAs:["matTable"],features:[LT([{provide:ct,useExisting:i},{provide:A,useExisting:i},{provide:xe,useValue:null}]),Sh],ngContentSelectors:Ki,decls:5,vars:2,consts:[["role","rowgroup"],["headerRowOutlet",""],["role","rowgroup",1,"mdc-data-table__content"],["rowOutlet",""],["noDataRowOutlet",""],["footerRowOutlet",""]],template:function(t,n){t&1&&(Gw(Gi),zw(0),zw(1,1),_w(2,Yi,1,0),_w(3,Zi,7,0)(4,Xi,4,0)),t&2&&(EE(2),Mw(n._isServer?2:-1),EE(),Mw(n._isNativeHtmlTable?3:4));},dependencies:[rt,at,lt,st],styles:[`.mat-mdc-table-sticky {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d1 as Hj,w,du as p,dv as rt,$ as $j,aZ as R$1,v as vt,D as Dt,F as Fa,dn as ge,dS as Da,J as JD,cp as Uh,f as eg,K as Kw}from'./main-YKDNK5VZ.js';import {c}from'./chunk-BIb-xYiS.js';var x=["canvasMainRef"],R=(()=>{class s{id=Hj.required();type=Hj.required();theme=Hj.required();runtime=w(p);streams=w(rt);static DEFAULT_CONFIG={displayName:"Time Label",filterSelfPaths:true,paths:{gaugePath:{description:"Date / Time",path:null,source:null,pathType:"Date",isPathConfigurable:true,sampleTime:1e3}},dateFormat:"dd/MM/yyyy HH:mm:ss",dateTimezone:"Atlantic/Azores",color:"contrast",enableTimeout:false,dataTimeout:5};canvasMainRef=$j.required("canvasMainRef");canvasElement;canvasCtx=null;titleBitmap=null;titleBitmapText=null;titleBitmapColor=null;canvas=w(R$1);cssWidth=0;cssHeight=0;dataValue=vt(null);_timeZoneGTM="";isDestroyed=false;labelColor=vt("");valueColor="";maxTextWidth=0;maxTextHeight=0;displayName=Dt(()=>this.runtime.options()?.displayName??"Time Label");dateFormat=Dt(()=>this.runtime.options()?.dateFormat??"dd/MM/yyyy HH:mm:ss");dateTimezone=Dt(()=>this.runtime.options()?.dateTimezone??"System Timezone -");constructor(){Fa(()=>{let e=this.runtime.options(),t=this.theme();!e||!t||ge(()=>{this.applyColors(),e.paths?.gaugePath?.path&&(this._timeZoneGTM=this.getGMTOffset(this.dateTimezone()),this.streams.observe("gaugePath",a=>{this.dataValue.set(a?.data?.value??null),this.drawWidget();}));});}),Fa(()=>{let e=this.theme(),t=this.runtime.options();!e||!t||ge(()=>{this.applyColors(),this.drawWidget();});});}ngAfterViewInit(){this.canvasElement=this.canvasMainRef().nativeElement,this.canvasCtx=this.canvasElement.getContext("2d"),this.canvas.registerCanvas(this.canvasElement,{autoRelease:true,onResize:(e,t)=>{this.cssWidth=e,this.cssHeight=t,this.maxTextWidth=Math.floor(this.cssWidth*.85),this.maxTextHeight=Math.floor(this.cssHeight*.7),this.drawWidget();}}),!this.isDestroyed&&(this.cssHeight=Math.floor(this.canvasElement.getBoundingClientRect().height),this.cssWidth=Math.floor(this.canvasElement.getBoundingClientRect().width),this.maxTextWidth=Math.floor(this.canvasElement.width*.85),this.maxTextHeight=Math.floor(this.canvasElement.height*.7),this.applyColors(),this.drawWidget());}getGMTOffset(e){try{if(e==="System Timezone -")return "";let a=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short"}).formatToParts(new Date).find(M=>M.type==="timeZoneName");return a?a.value:"GMT"}catch(t){return console.error(`Error getting GMT offset for timezone "${e}":`,t),"GMT"}}applyColors(){let e=this.runtime.options(),t=this.theme();!e||!t||(this.labelColor.set(c(e.color??"contrast",t).dim),this.valueColor=c(e.color??"contrast",t).color);}ngOnDestroy(){this.isDestroyed=true;try{this.canvas.unregisterCanvas(this.canvasElement);}catch(e){}}drawWidget(){if(!this.canvasCtx)return;let e=this.labelColor();(!this.titleBitmap||this.titleBitmap.width!==this.canvasElement.width||this.titleBitmap.height!==this.canvasElement.height||this.titleBitmapText!==`${this.displayName()}-${this.runtime.options()?.color??"contrast"}`||this.titleBitmapColor!==e)&&(this.titleBitmap=this.canvas.createTitleBitmap(this.displayName(),e,"normal",this.cssWidth,this.cssHeight),this.titleBitmapText=`${this.displayName()}-${this.runtime.options()?.color??"contrast"}`,this.titleBitmapColor=e),this.canvas.clearCanvas(this.canvasCtx,this.cssWidth,this.cssHeight),this.titleBitmap&&this.titleBitmap.width>0&&this.titleBitmap.height>0&&this.canvasCtx.drawImage(this.titleBitmap,0,0,this.cssWidth,this.cssHeight);let t,i=this.dataValue();if(!i||isNaN(Date.parse(i)))t="--";else try{t=Da(i,this.dateFormat(),"en-US",this._timeZoneGTM);}catch(a){t=String(a),console.log("[Date Time Widget]: "+String(a));}this.canvas.drawText(this.canvasCtx,t,Math.floor(this.cssWidth/2),Math.floor(this.cssHeight/2*1.15),this.maxTextWidth,this.maxTextHeight,"bold",this.valueColor);}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=JD({type:s,selectors:[["widget-datetime"]],viewQuery:function(t,i){t&1&&eg(i.canvasMainRef,x,5),t&2&&Kw();},inputs:{id:[1,"id"],type:[1,"type"],theme:[1,"theme"]},decls:2,vars:0,consts:[["canvasMainRef",""],[1,"date-canvas"]],template:function(t,i){t&1&&Uh(0,"canvas",1,0);},styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}.date-canvas[_ngcontent-%COMP%]{width:100%!important;height:100%!important;min-height:1px;display:block}"]})}return s})();export{R as WidgetDatetimeComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {m as me}from'./chunk-
|
|
1
|
+
import {m as me}from'./chunk-07zHjmg-.js';import {w as w$1,aQ as ee,aX as He,aR as lt,G as Gi,J as JD}from'./main-YKDNK5VZ.js';var w=(()=>{class o{dialog=w$1(ee);auth=w$1(He);toast=w$1(lt);settings=w$1(Gi);connectionConfig=null;ngOnInit(){this.connectionConfig=this.settings.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option");}openUserCredentialModal(t){let n=this.connectionConfig;if(!n)return;this.dialog.open(me,{disableClose:true,data:{user:n.loginName,password:n.loginPassword,error:t}}).afterClosed().subscribe(s=>{s===void 0||!s||(n.loginName=s.user,n.loginPassword=s.password,this.settings.setConnectionConfig(n),this.serverLogin());});}serverLogin(t){let n=this.connectionConfig;n&&this.auth.login({usr:n.loginName,pwd:n.loginPassword,newUrl:t}).then(()=>{this.settings.reloadApp();}).catch(e=>{e.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+e.error.message)):e.status==404?(this.toast.show("Login API not found at URL. See connection detail status in Configuration/Settings",5e3,false,"error"),console.log("[Setting-SignalK Component] Sign in failed: "+e.error.message)):e.status==0?(this.toast.show("Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,false,"error"),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+e.message)):(this.toast.show("Unknown authentication failure: "+JSON.stringify(e),5e3,false,"error"),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(e)));});}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=JD({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,e){},encapsulation:2})}return o})();export{w as WidgetLoginComponent};
|