1import{a as R,b as U,c as B,d as O,e as q,f as j}from"./chunk-2COL7SN6.js";import"./chunk-B5B42CLF.js";import{a as P,b as k}from"./chunk-HQNDO5KE.js";import{a as A}from"./chunk-MXXE73D3.js";import"./chunk-IVCEBP44.js";import{r as w,u as N,v as M}from"./chunk-J5IIX55P.js";import"./chunk-OYJ2GKKX.js";import"./chunk-YZKGASF4.js";import"./chunk-U5CNGY5Q.js";import"./chunk-KSJITMUJ.js";import"./chunk-3A47HUKH.js";import{e as E}from"./chunk-MWR3WBAN.js";import"./chunk-S75ZCO3X.js";import"./chunk-3RR5RCHM.js";import"./chunk-UYZZW7MY.js";import"./chunk-WZXLMGQU.js";import"./chunk-JXX46AET.js";import"./chunk-SX6ERPNW.js";import"./chunk-IHASTXEB.js";import"./chunk-4WFVMWDK.js";import"./chunk-7V3N352X.js";import"./chunk-ENYQGSUB.js";import"./chunk-773YA7SS.js";import{ja as D}from"./chunk-U7XSJIRQ.js";import{$b as r,Ba as y,Hc as g,Ic as u,Tb as h,Ub as L,Wb as v,Xb as l,Yb as s,Zb as p,_b as a,ac as f,cb as T,fd as I,gb as o,gd as $,ja as _,pd as F,qc as S,sc as c,wb as x}from"./chunk-LTJHT5NU.js";import"./chunk-N4DEZSRD.js";import"./chunk-JKU7I2FD.js";import"./chunk-4TNENQGS.js";import"./chunk-GTKUA5DM.js";import"./chunk-6UNJVD3U.js";import"./chunk-XDPEVTHG.js";import"./chunk-5IKJBXWF.js";import"./chunk-BL6GPBAP.js";import"./chunk-SV7S5NYR.js";import"./chunk-PVMEIX5M.js";import{a as b,b as C}from"./chunk-KTBBAXUL.js";var z=(t,e)=>e.id,H=(t,e)=>e.name;function J(t,e){if(t&1&&(a(0,"p-tab",1),g(1),r()),t&2){let n=e.$implicit,i=e.$index;p("value",i),o(),u(n.shortName)}}function K(t,e){t&1&&f(0,"wat-loading")}function Q(t,e){if(t&1&&(a(0,"p-tab",1),g(1),I(2,"titlecase"),r()),t&2){let n=e.$implicit,i=e.$index;p("value",i),o(),u($(2,2,n))}}function V(t,e){if(t&1&&(a(0,"ion-item"),f(1,"img",3),a(2,"ion-label"),g(3),r()()),t&2){let n=e.$implicit,i=c(4);o(),p("alt",n.name)("src",i.apiUrl+n.icon,T),o(2),u(n.name)}}function W(t,e){if(t&1&&(a(0,"p-tabpanel",1)(1,"ion-list"),l(2,V,4,3,"ion-item",null,H),r()()),t&2){let n=e.$implicit,i=e.$index,m=c(2).$implicit,d=c();p("value",i),o(2),s(d.legends()[m.id][n])}}function X(t,e){if(t&1&&(a(0,"p-tabs",2)(1,"p-tablist"),l(2,Q,3,4,"p-tab",1,v),r(),a(4,"p-tabpanels"),l(5,W,4,1,"p-tabpanel",1,v),r()()),t&2){let n=c(2);p("value",0),o(2),s(n.tables),o(3),s(n.tables)}}function Y(t,e){if(t&1&&(a(0,"p-tabpanel",1),h(1,K,1,0,"wat-loading")(2,X,7,1,"p-tabs",2),r()),t&2){let n=e.$index,i=c();p("value",n),o(),L(i.loading()?1:2)}}var G=class t{deviceTypesService=_(k);deviceTypesApiService=_(P);deviceTypes=F(()=>this.deviceTypesService.entities().filter(e=>e.id!=="Default"));loading=y(!0);legends=y({});apiUrl=_(E).replace("/api","");tables=["inputs","outputs","statuses"];ngOnInit(){this.deviceTypes().length&&this.fetchLegend(this.deviceTypes()[0].id)}onChange(e){let n=this.deviceTypes()[Number(e)]?.id;n&&!this.legends()[n]&&this.fetchLegend(n)}fetchLegend(e){this.loading.set(!0),this.deviceTypesApiService.getLegend(e).then(m=>{this.legends.update(d=>C(b({},d),{[e]:m}))}).catch(console.error).finally(()=>this.loading.set(!1))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=x({type:t,selectors:[["app-legend"]],decls:7,vars:1,consts:[[1,"sm-tabview-no-x-padding",3,"valueChange","value"],[3,"value"],[1,"sm-tabview-no-x-padding",3,"value"],["slot","start",1,"pr-1","max-h-6","max-w-6",3,"alt","src"]],template:function(n,i){n&1&&(a(0,"p-tabs",0),S("valueChange",function(d){return d!=null&&i.onChange(d)}),a(1,"p-tablist"),l(2,J,2,2,"p-tab",1,z),r(),a(4,"p-tabpanels"),l(5,Y,3,2,"p-tabpanel",1,z),r()()),n&2&&(p("value",0),o(2),s(i.deviceTypes()),o(3),s(i.deviceTypes()))},dependencies:[j,R,q,O,U,B,A,M,w,N,D],encapsulation:2})};export{G as LegendComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.