@mxtommy/kip 4.5.2 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/package.json +13 -15
  3. package/plugin/history-series.service.js +14 -24
  4. package/plugin/index.js +139 -95
  5. package/plugin/{duckdb-parquet-storage.service.js → sqlite-history-storage.service.js} +330 -503
  6. package/public/assets/help-docs/widget-historical-series.md +5 -5
  7. package/public/{chunk-TVNXBPFF.js → chunk-356CW47X.js} +1 -1
  8. package/public/{chunk-NFJ4RQSE.js → chunk-3JA4CQ7T.js} +1 -1
  9. package/public/{chunk-VXTTEFRP.js → chunk-5SAXWR6Z.js} +8 -8
  10. package/public/{chunk-67V4XHCY.js → chunk-6A4NRSCL.js} +1 -1
  11. package/public/{chunk-P7JKENHI.js → chunk-AC6VD2FN.js} +1 -1
  12. package/public/{chunk-TBNKOU7M.js → chunk-B4NYOD6L.js} +1 -1
  13. package/public/{chunk-WH5CIUSB.js → chunk-BGGO4PGD.js} +1 -1
  14. package/public/{chunk-KQEEYPK3.js → chunk-BMHMHQFO.js} +1 -1
  15. package/public/{chunk-RCYOZLZB.js → chunk-CSIELI2Z.js} +2 -2
  16. package/public/{chunk-R36UY4Q4.js → chunk-CYTLQDGF.js} +1 -1
  17. package/public/{chunk-YI3MZWRZ.js → chunk-HSKVTFFQ.js} +1 -1
  18. package/public/{chunk-IH4CEW4C.js → chunk-MDNGWQNG.js} +8 -8
  19. package/public/{chunk-VPF5756E.js → chunk-MGLD6QDJ.js} +1 -1
  20. package/public/{chunk-P4CRTB7N.js → chunk-NJISHUGY.js} +1 -1
  21. package/public/{chunk-ISF5E3CX.js → chunk-P3M6SJQT.js} +11 -11
  22. package/public/{chunk-WQSJFJLW.js → chunk-POMIQBAL.js} +2 -2
  23. package/public/{chunk-SJFJEOSG.js → chunk-PPF5S5CV.js} +1 -1
  24. package/public/{chunk-OPTBDYBL.js → chunk-PUPM3HUQ.js} +1 -1
  25. package/public/chunk-PZ6I6W3H.js +16 -0
  26. package/public/{chunk-VXCYPAWR.js → chunk-QU3JR4YV.js} +1 -1
  27. package/public/{chunk-Q2ANAJAD.js → chunk-SUWMN3AE.js} +1 -1
  28. package/public/{chunk-CD5TQSCS.js → chunk-UYHRT3PR.js} +1 -1
  29. package/public/{chunk-FZFDGAQO.js → chunk-WJFXI5PQ.js} +1 -1
  30. package/public/{chunk-I4SJ5UNN.js → chunk-ZXO4VMEH.js} +1 -1
  31. package/public/{chunk-XBSU7OGT.js → chunk-ZY3U4H4Z.js} +1 -1
  32. package/public/index.html +1 -1
  33. package/public/{main-B6TXB3EB.js → main-I33LH3HC.js} +1 -1
  34. package/plugin/plugin-auth.service.js +0 -75
  35. package/public/chunk-BTFZS2TW.js +0 -16
@@ -1,4 +1,4 @@
1
- import{$a as p,Ac as $,Bd as Ie,Ca as de,Da as mi,Db as F,De as Vi,Eb as R,F as ci,Fa as J,Fb as bi,Ha as Ee,He as Ei,Ia as Z,Jc as Et,Je as Ii,Ka as rt,Lc as Dr,Ld as wi,M as De,Mb as ot,N as ui,Nd as Ai,Ob as L,Oe as lt,Pc as kr,Pe as Oi,Qb as X,Re as Pi,Se as Fi,U as di,Ub as _i,Va as P,Vb as wr,Vd as Ti,Wb as Ar,Xa as Vt,Xd as Mr,Ya as gi,_a as xr,a as C,ac as at,b as j,cc as Ci,ce as Di,da as fi,dc as Q,ea as pi,ec as st,f as I,fb as it,fc as Tr,gb as nt,ge as It,ha as Mt,hb as m,ja as O,je as Vr,k as G,ka as x,kb as _,ke as Er,la as tt,lb as vi,ld as Si,le as ki,m as v,me as Mi,na as z,pa as f,pb as yi,pe as Ir,r as si,rc as N,s as li,t as Sr,ua as ke,ub as re,va as Me,vd as xi,w as B,wb as Ce,xb as Se,y as Dt,ya as Ve,z as kt,za as hi,zc as ie}from"./chunk-BTFZS2TW.js";var d=(function(t){return t.Disconnected="Disconnected",t.HTTPDiscovering="HTTPDiscovering",t.HTTPConnected="HTTPConnected",t.HTTPError="HTTPError",t.HTTPRetrying="HTTPRetrying",t.WebSocketConnecting="WebSocketConnecting",t.Connected="Connected",t.WebSocketError="WebSocketError",t.WebSocketRetrying="WebSocketRetrying",t.PermanentFailure="PermanentFailure",t})(d||{}),Ri=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new v(d.Disconnected);_status$=new v(this.createStatus(d.Disconnected,"Not connected"));_httpRetryCount=0;_webSocketRetryCount=0;_retryTimeout=null;_notificationTimeout=null;_httpRetryCallback=null;_webSocketRetryCallback=null;_isInitializationMode=!0;constructor(){console.log("[ConnectionStateMachine] Service initialized")}get state$(){return this._currentState$.asObservable()}get status$(){return this._status$.asObservable()}get currentState(){return this._currentState$.getValue()}enableWebSocketMode(){this._isInitializationMode=!1,console.log("[ConnectionStateMachine] WebSocket mode enabled");let e=this._status$.getValue();this._status$.next(e)}setHTTPRetryCallback(e){this._httpRetryCallback=e}setWebSocketRetryCallback(e){this._webSocketRetryCallback=e}startHTTPDiscovery(e="Connection request"){console.log(`[ConnectionStateMachine] Starting HTTP discovery: ${e}`),this._httpRetryCount=0,this.setState(d.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(d.HTTPConnected,"Signal K server discovered"),this._isInitializationMode||this.startWebSocketConnection()}onHTTPDiscoveryError(e){console.log(`[ConnectionStateMachine] HTTP discovery failed: ${e}`),this._httpRetryCount<this.config.httpRetryCount?(this._httpRetryCount++,this.setState(d.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(d.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===d.HTTPConnected||this.currentState===d.WebSocketRetrying||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected))return this.currentState===d.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(d.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(d.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==d.HTTPConnected&&this.currentState!==d.WebSocketConnecting&&this.currentState!==d.Connected&&this.currentState!==d.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(d.WebSocketRetrying,`WebSocket connection failed. Retry attempt ${this._webSocketRetryCount}...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(d.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===d.HTTPConnected||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected||this.currentState===d.WebSocketRetrying}isFullyConnected(){return this.currentState===d.Connected}getHttpRetryWindowMs(e=0){return Array.from({length:this.config.httpRetryCount},(n,o)=>{let a=Math.min(o,this.config.retryIntervals.length-1);return this.config.retryIntervals[a]}).reduce((n,o)=>n+o,0)+e}setState(e,i,n,o){this._currentState$.next(e);let a=this.createStatus(e,i,n,o);e===d.HTTPDiscovering||e===d.WebSocketConnecting?this._status$.next(a):e===d.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(a)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(a))}createStatus(e,i,n,o){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:n||0,maxRetries:o||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case d.Disconnected:return 0;case d.HTTPDiscovering:case d.WebSocketConnecting:return 1;case d.Connected:return 2;case d.HTTPError:case d.WebSocketError:case d.HTTPRetrying:case d.WebSocketRetrying:return 3;case d.HTTPConnected:return 2;case d.PermanentFailure:return 5;default:return 0}}scheduleHTTPRetry(){this.clearRetryTimer();let e=Math.min(this._httpRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling HTTP retry in ${i}ms`),this._retryTimeout=setTimeout(()=>{this._httpRetryCallback?(console.log(`[ConnectionStateMachine] Executing HTTP retry ${this._httpRetryCount}/${this.config.httpRetryCount}`),this._httpRetryCallback()):(console.error("[ConnectionStateMachine] No HTTP retry callback set!"),this.setState(d.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer(),console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${this.config.retryIntervals[1]}ms`),this._retryTimeout=setTimeout(()=>{this._webSocketRetryCallback?(console.log(`[ConnectionStateMachine] Executing WebSocket retry ${this._webSocketRetryCount}/${this.config.webSocketRetryCount}`),this._webSocketRetryCallback()):(console.log("[ConnectionStateMachine] No WebSocket retry callback - using state change method"),this.setState(d.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},this.config.retryIntervals[1])}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}ngOnDestroy(){this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCallback=null,this._webSocketRetryCallback=null,this._currentState$?.complete(),this._status$?.complete()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Oe=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=f(Ri);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new v({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new v(null);serverRoles=[];http=f(Ie);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return I(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let n=new URL(e);if(!["http:","https:"].includes(n.protocol))throw new Error("URL must start with http:// or https://")}catch(n){throw new Error("Invalid URL format - please check for typos and ensure it starts with http:// or https://")}let i=e;i.endsWith("signalk/")||(i+="/signalk/"),console.log(`[Connection Service] Validating Signal K server at: ${e}`);try{if(!(yield B(this.http.get(i,{observe:"response"}).pipe(Dt(5e3),De(o=>{throw console.error("[Connection Service] HTTP Error details:",o),o.name==="TimeoutError"?(console.error("[Connection Service] Validation timed out after 5000ms"),new Error("Server is not responding - check if the URL is correct and the server is running")):o.status===0||o.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):o.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):o.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):o.status>=500?new Error(`Server error (${o.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${o.status}) - ${o.statusText||"please check the server URL"}`)})))).body?.endpoints?.v1)throw new Error("Server responded but doesn't appear to be a Signal K server - missing required endpoints");console.log(`[Connection Service] Validation successful for: ${e}`)}catch(n){throw console.error(`[Connection Service] Validation failed for ${e}:`,n.message),n}})}initializeConnection(e,i,n){return I(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection initialization called with null or empty URL value");return}this.currentProxyEnabled=i,this.currentSubscribeAll=n;let o={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(o),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let a=this.signalKURL.url;a.endsWith("signalk/")||(a+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let s=yield B(this.http.get(a,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(l=>(l.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(l)))));Object.assign(o,this.processEndpointResponse(s,i,n)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){o.operation=3,o.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{o.subscribeAll=!!n,this.serverServiceEndpoint$.next(o)}})}retryCurrentConnection(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] Cannot retry - no current URL stored");return}console.log(`[SignalKConnectionService] Retrying connection to ${this.signalKURL.url}`),this.performHTTPDiscovery()}performHTTPDiscovery(){return I(this,null,function*(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] No URL available for HTTP discovery");return}let e=this.signalKURL.url;e.endsWith("signalk/")||(e+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let i=yield B(this.http.get(e,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(o=>(o.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(o))))),n=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(n)}catch(i){let n={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(n),this.handleError(i)}})}processEndpointResponse(e,i,n){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let o=e.body.endpoints.v1["signalk-http"],a=e.body.endpoints.v1["signalk-ws"],s=e.body.endpoints.v2?.["signalk-http"],l=e.body.endpoints.v2?.["signalk-ws"],c={operation:2,message:e.status?.toString()||"Connected",serverDescription:`${e.body.server.id} ${e.body.server.version}`,httpServiceUrl:null,WsServiceUrl:null};if(i)console.debug("[Connection Service] Proxy Mode Enabled"),c.httpServiceUrl=window.location.origin+new URL(o).pathname,c.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(a).pathname,s&&(c.httpServiceUrlV2=window.location.origin+new URL(s).pathname),l&&(c.WsServiceUrlV2=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(l).pathname);else{c.httpServiceUrl=o;let u=window.location.protocol==="https:";c.WsServiceUrl=u?a.replace("ws://","wss://"):a,s&&(c.httpServiceUrlV2=s),l&&(c.WsServiceUrlV2=u?l.replace("ws://","wss://"):l)}return console.debug("[Connection Service] HTTP URI: "+c.httpServiceUrl),c.httpServiceUrlV2&&console.debug("[Connection Service] HTTP V2 URI: "+c.httpServiceUrlV2),console.debug("[Connection Service] WebSocket URI: "+c.WsServiceUrl),c.WsServiceUrlV2&&console.debug("[Connection Service] WebSocket V2 URI: "+c.WsServiceUrlV2),c.subscribeAll=!!n,c}handleError(e){let i=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(i),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,i,n){this.serverName=e,this.serverRoles=n,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(n)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Ua="/signalk/v1/",Ni="auth/login",ja="auth/logout",Ba="auth/validate",Or=60,La=2147483647,Ui=(()=>{class t{http=f(Ie);conn=f(Oe);_IsLoggedIn$=new v(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new v(null);authToken$=this._authToken$.asObservable();connectionEndpointSubscription=null;authTokenSubscription=null;renewalTimerId=null;isRenewingToken=!1;loginUrl=null;logoutUrl=null;validateTokenUrl=null;constructor(){let e=JSON.parse(localStorage.getItem("authorization_token"));e&&(e.isDeviceAccessToken?e.expiry===null?(console.log("[Authentication Service] Device Access Token found with expiry: NEVER"),this._authToken$.next(e)):this.isTokenExpired(e.expiry)?(console.log("[Authentication Service] Device Access Token expired. Deleting token"),localStorage.removeItem("authorization_token")):(console.log("[Authentication Service] Device Access Token found in Local Storage"),this._authToken$.next(e)):(console.log("[Authentication Service] User session token found in Local Storage"),console.log("[Authentication Service] Deleting user session token"),localStorage.removeItem("authorization_token"))),this.authTokenSubscription=this._authToken$.pipe(di((i,n)=>i?.expiry===n?.expiry)).subscribe(i=>{this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null),!(!i||i.expiry==null)&&this.scheduleRenewalChunk(i)}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let n=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=n+Ni,this.logoutUrl=n+ja,this.validateTokenUrl=n+Ba}})}scheduleRenewalChunk(e){let i=Date.now(),n=(e.expiry-Or)*1e3,o=n-i;if(o<=0){this.handleTokenRenewal();return}let a=Math.min(o,La);console.log(a!==o?`[Authentication Service] Large renewal delay (${o} ms). Scheduling first chunk of ${a} ms.`:`[Authentication Service] Scheduling token renewal in ${a} ms (buffered target: ${new Date(n).toISOString()})`),this.renewalTimerId=setTimeout(()=>{this.renewalTimerId=null;let s=this._authToken$.getValue();!s||s.expiry!==e.expiry||this.scheduleRenewalChunk(e)},a)}handleTokenRenewal(){if(this.isRenewingToken){console.warn("[Authentication Service] Token renewal already in progress.");return}this.isRenewingToken=!0;let e=JSON.parse(localStorage.getItem("authorization_token"));if(!e){console.warn("[Authentication Service] No token found in local storage. Cannot renew."),this.isRenewingToken=!1;return}if(e.isDeviceAccessToken)console.warn("[Authentication Service] Device Access Token expired. Manual renewal required."),this.isRenewingToken=!1;else{let i=Math.floor(Date.now()/1e3),n=e.expiry-i;if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else if(n>Or)console.log(`[Authentication Service] Renewal trigger fired early; ${n}s remaining (> buffer ${Or}s). Rescheduling.`),this.isRenewingToken=!1,this.scheduleRenewalChunk(e);else{console.log(`[Authentication Service] User session Token within renewal window (${n}s remaining). Renewing token...`);let o=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:o.loginName,pwd:o.loginPassword}).then(()=>{console.log("[Authentication Service] Token successfully renewed.")}).catch(a=>{console.error("[Authentication Service] Token renewal failed. Server returned:",a.error)}).finally(()=>{this.isRenewingToken=!1})}}}login(o){return I(this,arguments,function*({usr:e,pwd:i,newUrl:n}){let a;if(n?a=n.replace(/\/+$/,"")+Ua+Ni:a=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!a)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield B(this.http.post(a,{username:e,password:i},{observe:"response"})).then(s=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(s.body.token)}).catch(s=>{this.deleteToken(),this.handleError(s)})})}handleError(e){throw e.status===0&&this.deleteToken(),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,n={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(n.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let n=new Date(0);if(i){let o=new Date(0);o.setUTCSeconds(e-i),n=o}else n.setUTCSeconds(e);return n}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return I(this,null,function*(){localStorage.removeItem("authorization_token"),yield B(this.http.put(this.logoutUrl,null)).then(()=>{this._IsLoggedIn$.next(!1),e||this._authToken$.next(null),console.log("[Authentication Service] User logged out")}).catch(i=>{console.error(i)})})}deleteToken(){this._authToken$&&(console.log("[Authentication Service] Deleting Authorization token"),localStorage.removeItem("authorization_token"),this._IsLoggedIn$.next(!1),this._authToken$.next(null))}setDeviceAccessToken(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,n={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(n.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe(),this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var $a=typeof global=="object"&&global&&global.Object===Object&&global,Ot=$a;var Ha=typeof self=="object"&&self&&self.Object===Object&&self,Wa=Ot||Ha||Function("return this")(),S=Wa;var Ga=S.Symbol,H=Ga;var ji=Object.prototype,qa=ji.hasOwnProperty,Ka=ji.toString,ct=H?H.toStringTag:void 0;function za(t){var r=qa.call(t,ct),e=t[ct];try{t[ct]=void 0;var i=!0}catch(o){}var n=Ka.call(t);return i&&(r?t[ct]=e:delete t[ct]),n}var Bi=za;var Ja=Object.prototype,Za=Ja.toString;function Xa(t){return Za.call(t)}var Li=Xa;var Qa="[object Null]",Ya="[object Undefined]",$i=H?H.toStringTag:void 0;function es(t){return t==null?t===void 0?Ya:Qa:$i&&$i in Object(t)?Bi(t):Li(t)}var q=es;function ts(t){return t!=null&&typeof t=="object"}var T=ts;var rs=Array.isArray,W=rs;function is(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var k=is;function ns(t){return t}var Pt=ns;var os="[object AsyncFunction]",as="[object Function]",ss="[object GeneratorFunction]",ls="[object Proxy]";function cs(t){if(!k(t))return!1;var r=q(t);return r==as||r==ss||r==os||r==ls}var Pe=cs;var us=S["__core-js_shared__"],Ft=us;var Hi=(function(){var t=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ds(t){return!!Hi&&Hi in t}var Wi=ds;var fs=Function.prototype,ps=fs.toString;function hs(t){if(t!=null){try{return ps.call(t)}catch(r){}try{return t+""}catch(r){}}return""}var oe=hs;var ms=/[\\^$.*+?()[\]{}|]/g,gs=/^\[object .+?Constructor\]$/,vs=Function.prototype,ys=Object.prototype,bs=vs.toString,_s=ys.hasOwnProperty,Cs=RegExp("^"+bs.call(_s).replace(ms,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ss(t){if(!k(t)||Wi(t))return!1;var r=Pe(t)?Cs:gs;return r.test(oe(t))}var Gi=Ss;function xs(t,r){return t?.[r]}var qi=xs;function ws(t,r){var e=qi(t,r);return Gi(e)?e:void 0}var U=ws;var As=U(S,"WeakMap"),Rt=As;var Ki=Object.create,Ts=(function(){function t(){}return function(r){if(!k(r))return{};if(Ki)return Ki(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}})(),zi=Ts;function Ds(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var Ji=Ds;function ks(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var Nt=ks;var Ms=800,Vs=16,Es=Date.now;function Is(t){var r=0,e=0;return function(){var i=Es(),n=Vs-(i-e);if(e=i,n>0){if(++r>=Ms)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Zi=Is;function Os(t){return function(){return t}}var Xi=Os;var Ps=(function(){try{var t=U(Object,"defineProperty");return t({},"",{}),t}catch(r){}})(),Fe=Ps;var Fs=Fe?function(t,r){return Fe(t,"toString",{configurable:!0,enumerable:!1,value:Xi(r),writable:!0})}:Pt,Qi=Fs;var Rs=Zi(Qi),Yi=Rs;function Ns(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var en=Ns;var Us=9007199254740991,js=/^(?:0|[1-9]\d*)$/;function Bs(t,r){var e=typeof t;return r=r??Us,!!r&&(e=="number"||e!="symbol"&&js.test(t))&&t>-1&&t%1==0&&t<r}var Ut=Bs;function Ls(t,r,e){r=="__proto__"&&Fe?Fe(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Re=Ls;function $s(t,r){return t===r||t!==t&&r!==r}var Y=$s;var Hs=Object.prototype,Ws=Hs.hasOwnProperty;function Gs(t,r,e){var i=t[r];(!(Ws.call(t,r)&&Y(i,e))||e===void 0&&!(r in t))&&Re(t,r,e)}var jt=Gs;function qs(t,r,e,i){var n=!e;e||(e={});for(var o=-1,a=r.length;++o<a;){var s=r[o],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),n?Re(e,s,l):jt(e,s,l)}return e}var ee=qs;var tn=Math.max;function Ks(t,r,e){return r=tn(r===void 0?t.length-1:r,0),function(){for(var i=arguments,n=-1,o=tn(i.length-r,0),a=Array(o);++n<o;)a[n]=i[r+n];n=-1;for(var s=Array(r+1);++n<r;)s[n]=i[n];return s[r]=e(a),Ji(t,this,s)}}var rn=Ks;function zs(t,r){return Yi(rn(t,r,Pt),t+"")}var nn=zs;var Js=9007199254740991;function Zs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Js}var Bt=Zs;function Xs(t){return t!=null&&Bt(t.length)&&!Pe(t)}var fe=Xs;function Qs(t,r,e){if(!k(e))return!1;var i=typeof r;return(i=="number"?fe(e)&&Ut(r,e.length):i=="string"&&r in e)?Y(e[r],t):!1}var on=Qs;function Ys(t){return nn(function(r,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=t.length>3&&typeof o=="function"?(n--,o):void 0,a&&on(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),r=Object(r);++i<n;){var s=e[i];s&&t(r,s,i,o)}return r})}var an=Ys;var el=Object.prototype;function tl(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||el;return t===e}var Ne=tl;function rl(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var sn=rl;var il="[object Arguments]";function nl(t){return T(t)&&q(t)==il}var Pr=nl;var ln=Object.prototype,ol=ln.hasOwnProperty,al=ln.propertyIsEnumerable,sl=Pr((function(){return arguments})())?Pr:function(t){return T(t)&&ol.call(t,"callee")&&!al.call(t,"callee")},ut=sl;function ll(){return!1}var cn=ll;var fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,un=fn&&typeof module=="object"&&module&&!module.nodeType&&module,cl=un&&un.exports===fn,dn=cl?S.Buffer:void 0,ul=dn?dn.isBuffer:void 0,dl=ul||cn,ae=dl;var fl="[object Arguments]",pl="[object Array]",hl="[object Boolean]",ml="[object Date]",gl="[object Error]",vl="[object Function]",yl="[object Map]",bl="[object Number]",_l="[object Object]",Cl="[object RegExp]",Sl="[object Set]",xl="[object String]",wl="[object WeakMap]",Al="[object ArrayBuffer]",Tl="[object DataView]",Dl="[object Float32Array]",kl="[object Float64Array]",Ml="[object Int8Array]",Vl="[object Int16Array]",El="[object Int32Array]",Il="[object Uint8Array]",Ol="[object Uint8ClampedArray]",Pl="[object Uint16Array]",Fl="[object Uint32Array]",y={};y[Dl]=y[kl]=y[Ml]=y[Vl]=y[El]=y[Il]=y[Ol]=y[Pl]=y[Fl]=!0;y[fl]=y[pl]=y[Al]=y[hl]=y[Tl]=y[ml]=y[gl]=y[vl]=y[yl]=y[bl]=y[_l]=y[Cl]=y[Sl]=y[xl]=y[wl]=!1;function Rl(t){return T(t)&&Bt(t.length)&&!!y[q(t)]}var pn=Rl;function Nl(t){return function(r){return t(r)}}var Ue=Nl;var hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dt=hn&&typeof module=="object"&&module&&!module.nodeType&&module,Ul=dt&&dt.exports===hn,Fr=Ul&&Ot.process,jl=(function(){try{var t=dt&&dt.require&&dt.require("util").types;return t||Fr&&Fr.binding&&Fr.binding("util")}catch(r){}})(),se=jl;var mn=se&&se.isTypedArray,Bl=mn?Ue(mn):pn,je=Bl;var Ll=Object.prototype,$l=Ll.hasOwnProperty;function Hl(t,r){var e=W(t),i=!e&&ut(t),n=!e&&!i&&ae(t),o=!e&&!i&&!n&&je(t),a=e||i||n||o,s=a?sn(t.length,String):[],l=s.length;for(var c in t)(r||$l.call(t,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ut(c,l)))&&s.push(c);return s}var Lt=Hl;function Wl(t,r){return function(e){return t(r(e))}}var $t=Wl;var Gl=$t(Object.keys,Object),gn=Gl;var ql=Object.prototype,Kl=ql.hasOwnProperty;function zl(t){if(!Ne(t))return gn(t);var r=[];for(var e in Object(t))Kl.call(t,e)&&e!="constructor"&&r.push(e);return r}var vn=zl;function Jl(t){return fe(t)?Lt(t):vn(t)}var Be=Jl;function Zl(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var yn=Zl;var Xl=Object.prototype,Ql=Xl.hasOwnProperty;function Yl(t){if(!k(t))return yn(t);var r=Ne(t),e=[];for(var i in t)i=="constructor"&&(r||!Ql.call(t,i))||e.push(i);return e}var bn=Yl;function ec(t){return fe(t)?Lt(t,!0):bn(t)}var te=ec;var tc=U(Object,"create"),le=tc;function rc(){this.__data__=le?le(null):{},this.size=0}var _n=rc;function ic(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Cn=ic;var nc="__lodash_hash_undefined__",oc=Object.prototype,ac=oc.hasOwnProperty;function sc(t){var r=this.__data__;if(le){var e=r[t];return e===nc?void 0:e}return ac.call(r,t)?r[t]:void 0}var Sn=sc;var lc=Object.prototype,cc=lc.hasOwnProperty;function uc(t){var r=this.__data__;return le?r[t]!==void 0:cc.call(r,t)}var xn=uc;var dc="__lodash_hash_undefined__";function fc(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=le&&r===void 0?dc:r,this}var wn=fc;function Le(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Le.prototype.clear=_n;Le.prototype.delete=Cn;Le.prototype.get=Sn;Le.prototype.has=xn;Le.prototype.set=wn;var Rr=Le;function pc(){this.__data__=[],this.size=0}var An=pc;function hc(t,r){for(var e=t.length;e--;)if(Y(t[e][0],r))return e;return-1}var pe=hc;var mc=Array.prototype,gc=mc.splice;function vc(t){var r=this.__data__,e=pe(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():gc.call(r,e,1),--this.size,!0}var Tn=vc;function yc(t){var r=this.__data__,e=pe(r,t);return e<0?void 0:r[e][1]}var Dn=yc;function bc(t){return pe(this.__data__,t)>-1}var kn=bc;function _c(t,r){var e=this.__data__,i=pe(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var Mn=_c;function $e(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}$e.prototype.clear=An;$e.prototype.delete=Tn;$e.prototype.get=Dn;$e.prototype.has=kn;$e.prototype.set=Mn;var he=$e;var Cc=U(S,"Map"),me=Cc;function Sc(){this.size=0,this.__data__={hash:new Rr,map:new(me||he),string:new Rr}}var Vn=Sc;function xc(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var En=xc;function wc(t,r){var e=t.__data__;return En(r)?e[typeof r=="string"?"string":"hash"]:e.map}var ge=wc;function Ac(t){var r=ge(this,t).delete(t);return this.size-=r?1:0,r}var In=Ac;function Tc(t){return ge(this,t).get(t)}var On=Tc;function Dc(t){return ge(this,t).has(t)}var Pn=Dc;function kc(t,r){var e=ge(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Fn=kc;function He(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}He.prototype.clear=Vn;He.prototype.delete=In;He.prototype.get=On;He.prototype.has=Pn;He.prototype.set=Fn;var Ht=He;function Mc(t,r){for(var e=-1,i=r.length,n=t.length;++e<i;)t[n+e]=r[e];return t}var Wt=Mc;var Vc=$t(Object.getPrototypeOf,Object),We=Vc;var Ec="[object Object]",Ic=Function.prototype,Oc=Object.prototype,Rn=Ic.toString,Pc=Oc.hasOwnProperty,Fc=Rn.call(Object);function Rc(t){if(!T(t)||q(t)!=Ec)return!1;var r=We(t);if(r===null)return!0;var e=Pc.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&Rn.call(e)==Fc}var Nn=Rc;function Nc(){this.__data__=new he,this.size=0}var Un=Nc;function Uc(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var jn=Uc;function jc(t){return this.__data__.get(t)}var Bn=jc;function Bc(t){return this.__data__.has(t)}var Ln=Bc;var Lc=200;function $c(t,r){var e=this.__data__;if(e instanceof he){var i=e.__data__;if(!me||i.length<Lc-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new Ht(i)}return e.set(t,r),this.size=e.size,this}var $n=$c;function Ge(t){var r=this.__data__=new he(t);this.size=r.size}Ge.prototype.clear=Un;Ge.prototype.delete=jn;Ge.prototype.get=Bn;Ge.prototype.has=Ln;Ge.prototype.set=$n;var ve=Ge;function Hc(t,r){return t&&ee(r,Be(r),t)}var Hn=Hc;function Wc(t,r){return t&&ee(r,te(r),t)}var Wn=Wc;var zn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,Gc=Gn&&Gn.exports===zn,qn=Gc?S.Buffer:void 0,Kn=qn?qn.allocUnsafe:void 0;function qc(t,r){if(r)return t.slice();var e=t.length,i=Kn?Kn(e):new t.constructor(e);return t.copy(i),i}var Gt=qc;function Kc(t,r){for(var e=-1,i=t==null?0:t.length,n=0,o=[];++e<i;){var a=t[e];r(a,e,t)&&(o[n++]=a)}return o}var Jn=Kc;function zc(){return[]}var qt=zc;var Jc=Object.prototype,Zc=Jc.propertyIsEnumerable,Zn=Object.getOwnPropertySymbols,Xc=Zn?function(t){return t==null?[]:(t=Object(t),Jn(Zn(t),function(r){return Zc.call(t,r)}))}:qt,qe=Xc;function Qc(t,r){return ee(t,qe(t),r)}var Xn=Qc;var Yc=Object.getOwnPropertySymbols,eu=Yc?function(t){for(var r=[];t;)Wt(r,qe(t)),t=We(t);return r}:qt,Kt=eu;function tu(t,r){return ee(t,Kt(t),r)}var Qn=tu;function ru(t,r,e){var i=r(t);return W(t)?i:Wt(i,e(t))}var zt=ru;function iu(t){return zt(t,Be,qe)}var ft=iu;function nu(t){return zt(t,te,Kt)}var Yn=nu;var ou=U(S,"DataView"),Jt=ou;var au=U(S,"Promise"),Zt=au;var su=U(S,"Set"),Xt=su;var eo="[object Map]",lu="[object Object]",to="[object Promise]",ro="[object Set]",io="[object WeakMap]",no="[object DataView]",cu=oe(Jt),uu=oe(me),du=oe(Zt),fu=oe(Xt),pu=oe(Rt),xe=q;(Jt&&xe(new Jt(new ArrayBuffer(1)))!=no||me&&xe(new me)!=eo||Zt&&xe(Zt.resolve())!=to||Xt&&xe(new Xt)!=ro||Rt&&xe(new Rt)!=io)&&(xe=function(t){var r=q(t),e=r==lu?t.constructor:void 0,i=e?oe(e):"";if(i)switch(i){case cu:return no;case uu:return eo;case du:return to;case fu:return ro;case pu:return io}return r});var ce=xe;var hu=Object.prototype,mu=hu.hasOwnProperty;function gu(t){var r=t.length,e=new t.constructor(r);return r&&typeof t[0]=="string"&&mu.call(t,"index")&&(e.index=t.index,e.input=t.input),e}var oo=gu;var vu=S.Uint8Array,Ke=vu;function yu(t){var r=new t.constructor(t.byteLength);return new Ke(r).set(new Ke(t)),r}var ze=yu;function bu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var ao=bu;var _u=/\w*$/;function Cu(t){var r=new t.constructor(t.source,_u.exec(t));return r.lastIndex=t.lastIndex,r}var so=Cu;var lo=H?H.prototype:void 0,co=lo?lo.valueOf:void 0;function Su(t){return co?Object(co.call(t)):{}}var uo=Su;function xu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Qt=xu;var wu="[object Boolean]",Au="[object Date]",Tu="[object Map]",Du="[object Number]",ku="[object RegExp]",Mu="[object Set]",Vu="[object String]",Eu="[object Symbol]",Iu="[object ArrayBuffer]",Ou="[object DataView]",Pu="[object Float32Array]",Fu="[object Float64Array]",Ru="[object Int8Array]",Nu="[object Int16Array]",Uu="[object Int32Array]",ju="[object Uint8Array]",Bu="[object Uint8ClampedArray]",Lu="[object Uint16Array]",$u="[object Uint32Array]";function Hu(t,r,e){var i=t.constructor;switch(r){case Iu:return ze(t);case wu:case Au:return new i(+t);case Ou:return ao(t,e);case Pu:case Fu:case Ru:case Nu:case Uu:case ju:case Bu:case Lu:case $u:return Qt(t,e);case Tu:return new i;case Du:case Vu:return new i(t);case ku:return so(t);case Mu:return new i;case Eu:return uo(t)}}var fo=Hu;function Wu(t){return typeof t.constructor=="function"&&!Ne(t)?zi(We(t)):{}}var Yt=Wu;var Gu="[object Map]";function qu(t){return T(t)&&ce(t)==Gu}var po=qu;var ho=se&&se.isMap,Ku=ho?Ue(ho):po,mo=Ku;var zu="[object Set]";function Ju(t){return T(t)&&ce(t)==zu}var go=Ju;var vo=se&&se.isSet,Zu=vo?Ue(vo):go,yo=Zu;var Xu=1,Qu=2,Yu=4,bo="[object Arguments]",ed="[object Array]",td="[object Boolean]",rd="[object Date]",id="[object Error]",_o="[object Function]",nd="[object GeneratorFunction]",od="[object Map]",ad="[object Number]",Co="[object Object]",sd="[object RegExp]",ld="[object Set]",cd="[object String]",ud="[object Symbol]",dd="[object WeakMap]",fd="[object ArrayBuffer]",pd="[object DataView]",hd="[object Float32Array]",md="[object Float64Array]",gd="[object Int8Array]",vd="[object Int16Array]",yd="[object Int32Array]",bd="[object Uint8Array]",_d="[object Uint8ClampedArray]",Cd="[object Uint16Array]",Sd="[object Uint32Array]",g={};g[bo]=g[ed]=g[fd]=g[pd]=g[td]=g[rd]=g[hd]=g[md]=g[gd]=g[vd]=g[yd]=g[od]=g[ad]=g[Co]=g[sd]=g[ld]=g[cd]=g[ud]=g[bd]=g[_d]=g[Cd]=g[Sd]=!0;g[id]=g[_o]=g[dd]=!1;function er(t,r,e,i,n,o){var a,s=r&Xu,l=r&Qu,c=r&Yu;if(e&&(a=n?e(t,i,n,o):e(t)),a!==void 0)return a;if(!k(t))return t;var u=W(t);if(u){if(a=oo(t),!s)return Nt(t,a)}else{var h=ce(t),b=h==_o||h==nd;if(ae(t))return Gt(t,s);if(h==Co||h==bo||b&&!n){if(a=l||b?{}:Yt(t),!s)return l?Qn(t,Wn(a,t)):Xn(t,Hn(a,t))}else{if(!g[h])return n?t:{};a=fo(t,h,s)}}o||(o=new ve);var D=o.get(t);if(D)return D;o.set(t,a),yo(t)?t.forEach(function(A){a.add(er(A,r,e,A,t,o))}):mo(t)&&t.forEach(function(A,M){a.set(M,er(A,r,e,M,t,o))});var w=c?l?Yn:ft:l?te:Be,E=u?void 0:w(t);return en(E||t,function(A,M){E&&(M=A,A=t[M]),jt(a,M,er(A,r,e,M,t,o))}),a}var So=er;var xd=1,wd=4;function Ad(t){return So(t,xd|wd)}var tr=Ad;var Td="__lodash_hash_undefined__";function Dd(t){return this.__data__.set(t,Td),this}var xo=Dd;function kd(t){return this.__data__.has(t)}var wo=kd;function rr(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new Ht;++r<e;)this.add(t[r])}rr.prototype.add=rr.prototype.push=xo;rr.prototype.has=wo;var Ao=rr;function Md(t,r){for(var e=-1,i=t==null?0:t.length;++e<i;)if(r(t[e],e,t))return!0;return!1}var To=Md;function Vd(t,r){return t.has(r)}var Do=Vd;var Ed=1,Id=2;function Od(t,r,e,i,n,o){var a=e&Ed,s=t.length,l=r.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(r);if(c&&u)return c==r&&u==t;var h=-1,b=!0,D=e&Id?new Ao:void 0;for(o.set(t,r),o.set(r,t);++h<s;){var w=t[h],E=r[h];if(i)var A=a?i(E,w,h,r,t,o):i(w,E,h,t,r,o);if(A!==void 0){if(A)continue;b=!1;break}if(D){if(!To(r,function(M,_e){if(!Do(D,_e)&&(w===M||n(w,M,e,i,o)))return D.push(_e)})){b=!1;break}}else if(!(w===E||n(w,E,e,i,o))){b=!1;break}}return o.delete(t),o.delete(r),b}var ir=Od;function Pd(t){var r=-1,e=Array(t.size);return t.forEach(function(i,n){e[++r]=[n,i]}),e}var ko=Pd;function Fd(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var Mo=Fd;var Rd=1,Nd=2,Ud="[object Boolean]",jd="[object Date]",Bd="[object Error]",Ld="[object Map]",$d="[object Number]",Hd="[object RegExp]",Wd="[object Set]",Gd="[object String]",qd="[object Symbol]",Kd="[object ArrayBuffer]",zd="[object DataView]",Vo=H?H.prototype:void 0,Nr=Vo?Vo.valueOf:void 0;function Jd(t,r,e,i,n,o,a){switch(e){case zd:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case Kd:return!(t.byteLength!=r.byteLength||!o(new Ke(t),new Ke(r)));case Ud:case jd:case $d:return Y(+t,+r);case Bd:return t.name==r.name&&t.message==r.message;case Hd:case Gd:return t==r+"";case Ld:var s=ko;case Wd:var l=i&Rd;if(s||(s=Mo),t.size!=r.size&&!l)return!1;var c=a.get(t);if(c)return c==r;i|=Nd,a.set(t,r);var u=ir(s(t),s(r),i,n,o,a);return a.delete(t),u;case qd:if(Nr)return Nr.call(t)==Nr.call(r)}return!1}var Eo=Jd;var Zd=1,Xd=Object.prototype,Qd=Xd.hasOwnProperty;function Yd(t,r,e,i,n,o){var a=e&Zd,s=ft(t),l=s.length,c=ft(r),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var b=s[h];if(!(a?b in r:Qd.call(r,b)))return!1}var D=o.get(t),w=o.get(r);if(D&&w)return D==r&&w==t;var E=!0;o.set(t,r),o.set(r,t);for(var A=a;++h<l;){b=s[h];var M=t[b],_e=r[b];if(i)var ai=a?i(_e,M,b,r,t,o):i(M,_e,b,t,r,o);if(!(ai===void 0?M===_e||n(M,_e,e,i,o):ai)){E=!1;break}A||(A=b=="constructor")}if(E&&!A){var At=t.constructor,Tt=r.constructor;At!=Tt&&"constructor"in t&&"constructor"in r&&!(typeof At=="function"&&At instanceof At&&typeof Tt=="function"&&Tt instanceof Tt)&&(E=!1)}return o.delete(t),o.delete(r),E}var Io=Yd;var ef=1,Oo="[object Arguments]",Po="[object Array]",nr="[object Object]",tf=Object.prototype,Fo=tf.hasOwnProperty;function rf(t,r,e,i,n,o){var a=W(t),s=W(r),l=a?Po:ce(t),c=s?Po:ce(r);l=l==Oo?nr:l,c=c==Oo?nr:c;var u=l==nr,h=c==nr,b=l==c;if(b&&ae(t)){if(!ae(r))return!1;a=!0,u=!1}if(b&&!u)return o||(o=new ve),a||je(t)?ir(t,r,e,i,n,o):Eo(t,r,l,e,i,n,o);if(!(e&ef)){var D=u&&Fo.call(t,"__wrapped__"),w=h&&Fo.call(r,"__wrapped__");if(D||w){var E=D?t.value():t,A=w?r.value():r;return o||(o=new ve),n(E,A,e,i,o)}}return b?(o||(o=new ve),Io(t,r,e,i,n,o)):!1}var Ro=rf;function No(t,r,e,i,n){return t===r?!0:t==null||r==null||!T(t)&&!T(r)?t!==t&&r!==r:Ro(t,r,e,i,No,n)}var Uo=No;function nf(t){return function(r,e,i){for(var n=-1,o=Object(r),a=i(r),s=a.length;s--;){var l=a[t?s:++n];if(e(o[l],l,o)===!1)break}return r}}var jo=nf;var of=jo(),Bo=of;function af(t,r,e){(e!==void 0&&!Y(t[r],e)||e===void 0&&!(r in t))&&Re(t,r,e)}var pt=af;function sf(t){return T(t)&&fe(t)}var Lo=sf;function lf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var ht=lf;function cf(t){return ee(t,te(t))}var $o=cf;function uf(t,r,e,i,n,o,a){var s=ht(t,e),l=ht(r,e),c=a.get(l);if(c){pt(t,e,c);return}var u=o?o(s,l,e+"",t,r,a):void 0,h=u===void 0;if(h){var b=W(l),D=!b&&ae(l),w=!b&&!D&&je(l);u=l,b||D||w?W(s)?u=s:Lo(s)?u=Nt(s):D?(h=!1,u=Gt(l,!0)):w?(h=!1,u=Qt(l,!0)):u=[]:Nn(l)||ut(l)?(u=s,ut(s)?u=$o(s):(!k(s)||Pe(s))&&(u=Yt(l))):h=!1}h&&(a.set(l,u),n(u,l,i,o,a),a.delete(l)),pt(t,e,u)}var Ho=uf;function Wo(t,r,e,i,n){t!==r&&Bo(r,function(o,a){if(n||(n=new ve),k(o))Ho(t,r,a,e,Wo,i,n);else{var s=i?i(ht(t,a),o,a+"",t,r,n):void 0;s===void 0&&(s=o),pt(t,a,s)}},te)}var Go=Wo;function df(t,r){return Uo(t,r)}var ff=df;var pf=an(function(t,r,e){Go(t,r,e)}),hf=pf;var mf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ur=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let r=t.match(mf);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},qo=t=>t==="*"||t==="x"||t==="X",Ko=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},gf=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],vf=(t,r)=>{if(qo(t)||qo(r))return 0;let[e,i]=gf(Ko(t),Ko(r));return e>i?1:e<i?-1:0},jr=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=vf(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var zo=(t,r)=>{let e=Ur(t),i=Ur(r),n=e.pop(),o=i.pop(),a=jr(e,i);return a!==0?a:n&&o?jr(n.split("."),o.split(".")):n||o?n?-1:1:0};var mt=(t,r,e)=>{yf(e);let i=zo(t,r);return Zo[e].includes(i)},Zo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Jo=Object.keys(Zo),yf=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Jo.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Jo.join("|")}`)};var Xo=(()=>{class t{server=f(Oe);http=f(Ie);_auth=f(Ui);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;_isRemoteContextBootstrapped=!1;storageServiceReady$=new v(!1);_isLoggedIn=!1;_networkStatus=void 0;_logIO=!1;patchQueue$=new G;patch=function(e){return this.http.post(e.url,e.document).pipe(pi(()=>console.log("[Storage Service] Remote config patch request completed successfully")),De(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe(lt()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe(lt()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe(lt()).subscribe(i=>{i&&(this.isAppDataSupported=mt(i,"1.27.0",">="))}),this.patchQueue$.pipe(ui(i=>this.patch(i)),lt()).subscribe(()=>{})}isStorageServiceReady(){this._networkStatus?.httpServiceUrl&&(this.serverEndpoint=this._networkStatus.httpServiceUrl.substring(0,this._networkStatus.httpServiceUrl.length-4)+"applicationData/"),this._networkStatus?.operation===2&&this._isLoggedIn&&this.serverEndpoint?(this.storageServiceReady$.next(!0),console.log(`[Remote Storage Service] Authenticated ${this._isLoggedIn}, AppData API: ${this.serverEndpoint}`)):this.storageServiceReady$.next(!1)}waitUntilReady(e=1e4){return I(this,null,function*(){return this.storageServiceReady$.getValue()?!0:new Promise(i=>{let n=!1,o=this.storageServiceReady$.subscribe(s=>{n||!s||(n=!0,clearTimeout(a),o.unsubscribe(),i(!0))}),a=window.setTimeout(()=>{n||(n=!0,o.unsubscribe(),i(!1))},e)})})}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return I(this,null,function*(){this.ensureReady();let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let n=this.serverEndpoint,o=e??this.configFileVersion,a=`${n}global/kip/${o}/?keys=true`,s=`${n}user/kip/${o}/?keys=true`;try{let l=yield B(this.http.get(a));for(let c of l)i.push({scope:"global",name:c});console.log("[Storage Service] Retrieved Global config list")}catch(l){this.handleError(l)}try{let l=yield B(this.http.get(s));for(let c of l)i.push({scope:"user",name:c});console.log("[Storage Service] Retrieved User config list")}catch(l){this.handleError(l)}return i})}getConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=n??this.configFileVersion,l=a+s+"/"+i;this._logIO&&console.debug("[StorageService.getConfig]",{scope:e,configName:i,ver:s,url:l,isInitLoad:!!o});try{let c=yield B(this.http.get(l));if(this._logIO){let u=c&&typeof c=="object"?c?.app?.configVersion:void 0;console.debug("[StorageService.getConfig Response]",{scope:e,configName:i,ver:s,appConfigVersion:u})}else console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`);return o&&(this.InitConfig=c),tr(c)}catch(c){return this.handleError(c),null}})}setConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=o??this.configFileVersion,l=a+s+"/"+i;if(this._logIO){let c=n?.app?.configVersion;console.debug("[StorageService.setConfig]",{scope:e,configName:i,ver:s,url:l,appConfigVersion:c})}try{return yield B(this.http.post(l,n)),this._logIO?console.debug("[StorageService.setConfig Response]",{scope:e,configName:i,ver:s,url:l,status:"ok"}):console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),null}catch(c){return this.handleError(c),null}})}patchConfig(e,i,n){this.ensureReady();let o=n??this.configFileVersion,a=this.serverEndpoint+"user/kip/"+o,s,l=i?.configVersion;switch(this._logIO&&console.warn("[StorageService.patchConfig] Suppressing app.configVersion write into v11 file",{targetFileVersion:o,incomingAppConfigVersion:l}),e){case"IAppConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:i}];break;case"IThemeConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:i.themeName}];break;case"IWidgetConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:i}];break;case"ILayoutConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:i}];break;case"Dashboards":s=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:i}];break;case"Array<IUnitDefaults>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:i}];break;case"Array<IDatasetDef>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:i}];break;case"INotificationConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:i}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let c={url:a,document:s};if(this._logIO){let u=e==="IAppConfig"?i?.configVersion:void 0;console.debug("[StorageService.patchConfig]",{ObjType:e,ver:o,url:a,appConfigVersionInValue:u,touchesConfigVersion:e==="IAppConfig"&&typeof u<"u"})}this.patchQueue$.next(c)}patchGlobal(e,i,n,o,a){this.ensureReady();let s=a??this.configFileVersion,l=this.serverEndpoint+i+"/kip/"+s,c;switch(o){case"add":c=[{op:"add",path:`/${e}`,value:n}];break;case"replace":c=[{op:"replace",path:`/${e}`,value:n}];break;case"remove":c=[{op:"remove",path:`/${e}`,value:n}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let u={url:l,document:c};if(this._logIO){let h=n?.app?.configVersion;console.debug("[StorageService.patchGlobal]",{scope:i,configName:e,operation:o,ver:s,url:l,appConfigVersionInValue:h})}this.patchQueue$.next(u)}removeItem(e,i,n){this.ensureReady();let o=this.serverEndpoint+e+"/kip/"+this.configFileVersion;n&&(o=this.serverEndpoint+e+"/kip/"+n);let a=[{op:"remove",path:`/${i}`}],s={url:o,document:a};this.patchQueue$.next(s)}clear(){this.ensureReady()}set activeConfigFileVersion(e){this.configFileVersion=e}bootstrapRemoteContext(e){if(!e?.sharedConfigName||e.configFileVersion==null||!e.initConfig)throw new Error("[StorageService] Invalid remote bootstrap context");this.sharedConfigName=e.sharedConfigName,this.configFileVersion=e.configFileVersion,this.InitConfig=tr(e.initConfig),this._isRemoteContextBootstrapped=!0,console.log(`[Storage Service] Bootstrap handoff applied (sharedConfig=${this.sharedConfigName}, fileVersion=${this.configFileVersion})`)}isRemoteContextBootstrapped(){return this._isRemoteContextBootstrapped}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ye=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}};var gt={disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}};var or={Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"};var Qo={configVersion:12,autoNightMode:!0,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",dataSets:[],unitDefaults:or,notificationConfig:gt,splitShellEnabled:!1,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.5},Yo={themeName:""};var ea={configVersion:12,kipUUID:ye.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Br={configVersion:12,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",splitShellEnabled:!0,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.7,dataSets:[{uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",path:"self.environment.depth.belowTransducer",pathSource:"default",baseUnit:"m",timeScaleFormat:"minute",period:.2,label:"simple-chart-339698a7-2cff-4ab9-9b50-d8056f971471",editable:!1}],unitDefaults:{Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"},notificationConfig:{disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!1,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}}},Lr=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",icon:"dashboard-sailing",configuration:[{w:6,h:8,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,showMiniChart:!0,yScaleMin:0,yScaleMax:100,inverseYAxis:!1,verticalChart:!1,color:"blue",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:0},{w:10,h:20,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-host2",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!1,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,driftEnable:!0,awsEnable:!0,twsEnable:!0,twaEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:6,y:0},{w:8,h:12,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,enableNeedle:!0,enableProgressbar:!0,highlightsWidth:5,scaleStart:180,barStartPosition:"left"},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5,ignoreZones:!1}}},x:16,y:0},{w:6,h:8,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,showMiniChart:!1,yScaleMin:0,yScaleMax:10,inverseYAxis:!1,verticalChart:!1,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:8},{w:8,h:12,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-host2",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,datachartPath:"self.environment.wind.speedApparent",datachartSource:"default",period:1,timeScale:"minute",convertUnitTo:"knots",timeScaleFormat:"minute",inverseYAxis:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalChart:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"orange",invertData:!1,verticalGraph:!1}}},x:16,y:12},{x:0,y:16,w:6,h:8,minW:1,minH:1,id:"5289a84d-18fd-4ee7-9724-72249af403f2",selector:"widget-host2",input:{widgetProperties:{type:"widget-position",uuid:"5289a84d-18fd-4ee7-9724-72249af403f2",config:{displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"grey",enableTimeout:!1,dataTimeout:5}}}},{w:10,h:4,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-host2",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.1.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:!1,color:"green",enableTimeout:!1,dataTimeout:5}}},x:6,y:20}],collapseSplitShell:!0},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",icon:"dashboard-map",configuration:[{x:0,y:0,w:12,h:6,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500}},gauge:{type:"ngRadial",subType:"marineCompass",enableTicks:!0,compassUseNumbers:!0,showValueBox:!1},enableTimeout:!1,color:"purple",dataTimeout:5}}}},{x:12,y:0,w:12,h:6,id:"caf9ca47-fcf6-4736-a314-2b5210edaf03",selector:"widget-host2",input:{widgetProperties:{type:"widget-datetime",uuid:"caf9ca47-fcf6-4736-a314-2b5210edaf03",config:{displayName:"Next WP Arrival",filterSelfPaths:!0,paths:{gaugePath:{description:"String Data",path:"self.navigation.datetime",source:"default",pathType:"Date",isPathConfigurable:!0,sampleTime:500}},dateFormat:"dd/MM HH:mm",dateTimezone:"America/Toronto",color:"contrast",enableTimeout:!1,dataTimeout:5}}}},{x:0,y:6,w:24,h:18,id:"daa21350-009e-4d99-8209-364f9b99caee",selector:"widget-host2",input:{widgetProperties:{type:"widget-autopilot",uuid:"daa21350-009e-4d99-8209-364f9b99caee",config:{filterSelfPaths:!0,paths:{autopilotState:{description:"Autopilot State",path:"self.steering.autopilot.state",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotMode:{description:"Autopilot Mode",path:"self.steering.autopilot.mode",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotEngaged:{description:"Autopilot Engaged",path:"self.steering.autopilot.engaged",source:"default",pathType:"boolean",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotV2Target:{description:"Autopilot API v2 Target",path:"self.steering.autopilot.target",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetHeading:{description:"Autopilot Target Magnetic Heading",path:"self.steering.autopilot.target.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetWindHeading:{description:"Autopilot Target Apparent Wind Angle",path:"self.steering.autopilot.target.windAngleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},rudderAngle:{description:"Rudder Angle",path:"self.steering.rudderAngle",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},courseXte:{description:"Cross Track Error",path:"self.navigation.course.calcValues.crossTrackError",source:"default",pathType:"number",isPathConfigurable:!1,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathRequired:!1,pathSkUnitsFilter:"m",sampleTime:500},headingMag:{description:"Magnetic Heading",path:"self.navigation.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},headingTrue:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleApparent:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleTrueWater:{description:"Wind Angle True Water",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500}},autopilot:{invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,apiVersion:null,instanceId:null,pluginId:null,modes:null},enableTimeout:!1,dataTimeout:5,invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,autopilotInstance:"_default"}}}}]}],$r={themeName:""};var BC={configVersion:12,kipUUID:ye.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};function bf(t,r){if(t&1){let e=ot();F(0,"div",1)(1,"button",2),L("click",function(){ke(e);let n=X();return Me(n.action())}),Q(2),R()()}if(t&2){let e=X();P(2),Tr(" ",e.data.action," ")}}var _f=["label"];function Cf(t,r){}var Sf=Math.pow(2,31)-1,we=class{_overlayRef;instance;containerInstance;_afterDismissed=new G;_afterOpened=new G;_onAction=new G;_durationTimeoutId;_dismissedByAction=!1;constructor(r,e){this._overlayRef=e,this.containerInstance=r,r._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(r){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(r,Sf))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},ar=new z("MatSnackBarData"),Je=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},xf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return t})(),wf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return t})(),Af=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return t})(),Tf=(()=>{class t{snackBarRef=f(we);data=f(ar);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(F(0,"div",0),Q(1),R(),Ce(2,bf,3,1,"div",1)),i&2&&(P(),Tr(" ",n.data.message,`
1
+ import{$a as p,Ac as $,Bd as Ie,Ca as de,Da as mi,Db as F,De as Vi,Eb as R,F as ci,Fa as J,Fb as bi,Ha as Ee,He as Ei,Ia as Z,Jc as Et,Je as Ii,Ka as rt,Lc as Dr,Ld as wi,M as De,Mb as ot,N as ui,Nd as Ai,Ob as L,Oe as lt,Pc as kr,Pe as Oi,Qb as X,Re as Pi,Se as Fi,U as di,Ub as _i,Va as P,Vb as wr,Vd as Ti,Wb as Ar,Xa as Vt,Xd as Mr,Ya as gi,_a as xr,a as C,ac as at,b as j,cc as Ci,ce as Di,da as fi,dc as Q,ea as pi,ec as st,f as I,fb as it,fc as Tr,gb as nt,ge as It,ha as Mt,hb as m,ja as O,je as Vr,k as G,ka as x,kb as _,ke as Er,la as tt,lb as vi,ld as Si,le as ki,m as v,me as Mi,na as z,pa as f,pb as yi,pe as Ir,r as si,rc as N,s as li,t as Sr,ua as ke,ub as re,va as Me,vd as xi,w as B,wb as Ce,xb as Se,y as Dt,ya as Ve,z as kt,za as hi,zc as ie}from"./chunk-PZ6I6W3H.js";var d=(function(t){return t.Disconnected="Disconnected",t.HTTPDiscovering="HTTPDiscovering",t.HTTPConnected="HTTPConnected",t.HTTPError="HTTPError",t.HTTPRetrying="HTTPRetrying",t.WebSocketConnecting="WebSocketConnecting",t.Connected="Connected",t.WebSocketError="WebSocketError",t.WebSocketRetrying="WebSocketRetrying",t.PermanentFailure="PermanentFailure",t})(d||{}),Ri=(()=>{class t{config={httpRetryCount:3,webSocketRetryCount:5,retryIntervals:[2e3,3e3,5e3],notificationDebounceMs:0};_currentState$=new v(d.Disconnected);_status$=new v(this.createStatus(d.Disconnected,"Not connected"));_httpRetryCount=0;_webSocketRetryCount=0;_retryTimeout=null;_notificationTimeout=null;_httpRetryCallback=null;_webSocketRetryCallback=null;_isInitializationMode=!0;constructor(){console.log("[ConnectionStateMachine] Service initialized")}get state$(){return this._currentState$.asObservable()}get status$(){return this._status$.asObservable()}get currentState(){return this._currentState$.getValue()}enableWebSocketMode(){this._isInitializationMode=!1,console.log("[ConnectionStateMachine] WebSocket mode enabled");let e=this._status$.getValue();this._status$.next(e)}setHTTPRetryCallback(e){this._httpRetryCallback=e}setWebSocketRetryCallback(e){this._webSocketRetryCallback=e}startHTTPDiscovery(e="Connection request"){console.log(`[ConnectionStateMachine] Starting HTTP discovery: ${e}`),this._httpRetryCount=0,this.setState(d.HTTPDiscovering,"Discovering Signal K server...")}onHTTPDiscoverySuccess(){console.log("[ConnectionStateMachine] HTTP discovery successful"),this._httpRetryCount=0,this.setState(d.HTTPConnected,"Signal K server discovered"),this._isInitializationMode||this.startWebSocketConnection()}onHTTPDiscoveryError(e){console.log(`[ConnectionStateMachine] HTTP discovery failed: ${e}`),this._httpRetryCount<this.config.httpRetryCount?(this._httpRetryCount++,this.setState(d.HTTPRetrying,`HTTP connection failed. Retrying (${this._httpRetryCount}/${this.config.httpRetryCount})...`,this._httpRetryCount,this.config.httpRetryCount),this.scheduleHTTPRetry()):this.setState(d.PermanentFailure,`HTTP connection failed after ${this.config.httpRetryCount} attempts. Check server URL.`,this.config.httpRetryCount,this.config.httpRetryCount)}startWebSocketConnection(){if(!(this.currentState===d.HTTPConnected||this.currentState===d.WebSocketRetrying||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected))return this.currentState===d.HTTPDiscovering,void 0;console.log("[ConnectionStateMachine] Starting WebSocket connection"),this._webSocketRetryCount=0,this.setState(d.WebSocketConnecting,"Connecting to Signal K Websocket...")}onWebSocketConnected(){console.log("[ConnectionStateMachine] WebSocket connected"),this._webSocketRetryCount=0,this.setState(d.Connected,"Connected to Signal K server")}onWebSocketError(e){if(console.log(`[ConnectionStateMachine] WebSocket error: ${e}`),this.currentState!==d.HTTPConnected&&this.currentState!==d.WebSocketConnecting&&this.currentState!==d.Connected&&this.currentState!==d.WebSocketRetrying){console.log("[ConnectionStateMachine] HTTP connection lost, restarting HTTP discovery"),this.startHTTPDiscovery("HTTP connection lost during WebSocket operation");return}this._webSocketRetryCount++,this.setState(d.WebSocketRetrying,`WebSocket connection failed. Retry attempt ${this._webSocketRetryCount}...`,this._webSocketRetryCount,this.config.webSocketRetryCount),this.scheduleWebSocketRetry()}shutdown(e="App shutdown"){console.log(`[ConnectionStateMachine] Shutting down all connections: ${e}`),this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCount=0,this._webSocketRetryCount=0,this.setState(d.Disconnected,"Application restarting...")}isHTTPConnected(){return this.currentState===d.HTTPConnected||this.currentState===d.WebSocketConnecting||this.currentState===d.Connected||this.currentState===d.WebSocketRetrying}isFullyConnected(){return this.currentState===d.Connected}getHttpRetryWindowMs(e=0){return Array.from({length:this.config.httpRetryCount},(n,o)=>{let a=Math.min(o,this.config.retryIntervals.length-1);return this.config.retryIntervals[a]}).reduce((n,o)=>n+o,0)+e}setState(e,i,n,o){this._currentState$.next(e);let a=this.createStatus(e,i,n,o);e===d.HTTPDiscovering||e===d.WebSocketConnecting?this._status$.next(a):e===d.Connected?(this.clearNotificationTimeout(),this._notificationTimeout=setTimeout(()=>{this._status$.next(a)},this.config.notificationDebounceMs)):(this.clearNotificationTimeout(),this._status$.next(a))}createStatus(e,i,n,o){return{state:e,operation:this.stateToOperationCode(e),message:i,retryCount:n||0,maxRetries:o||0,timestamp:new Date}}stateToOperationCode(e){switch(e){case d.Disconnected:return 0;case d.HTTPDiscovering:case d.WebSocketConnecting:return 1;case d.Connected:return 2;case d.HTTPError:case d.WebSocketError:case d.HTTPRetrying:case d.WebSocketRetrying:return 3;case d.HTTPConnected:return 2;case d.PermanentFailure:return 5;default:return 0}}scheduleHTTPRetry(){this.clearRetryTimer();let e=Math.min(this._httpRetryCount-1,this.config.retryIntervals.length-1),i=this.config.retryIntervals[e];console.log(`[ConnectionStateMachine] Scheduling HTTP retry in ${i}ms`),this._retryTimeout=setTimeout(()=>{this._httpRetryCallback?(console.log(`[ConnectionStateMachine] Executing HTTP retry ${this._httpRetryCount}/${this.config.httpRetryCount}`),this._httpRetryCallback()):(console.error("[ConnectionStateMachine] No HTTP retry callback set!"),this.setState(d.Disconnected,"HTTP retry callback not configured"))},i)}scheduleWebSocketRetry(){this.clearRetryTimer(),console.log(`[ConnectionStateMachine] Scheduling WebSocket retry in ${this.config.retryIntervals[1]}ms`),this._retryTimeout=setTimeout(()=>{this._webSocketRetryCallback?(console.log(`[ConnectionStateMachine] Executing WebSocket retry ${this._webSocketRetryCount}/${this.config.webSocketRetryCount}`),this._webSocketRetryCallback()):(console.log("[ConnectionStateMachine] No WebSocket retry callback - using state change method"),this.setState(d.WebSocketConnecting,`Retrying WebSocket connection (${this._webSocketRetryCount}/${this.config.webSocketRetryCount})...`,this._webSocketRetryCount,this.config.webSocketRetryCount))},this.config.retryIntervals[1])}clearRetryTimer(){this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}clearNotificationTimeout(){this._notificationTimeout&&(clearTimeout(this._notificationTimeout),this._notificationTimeout=null)}ngOnDestroy(){this.clearRetryTimer(),this.clearNotificationTimeout(),this._httpRetryCallback=null,this._webSocketRetryCallback=null,this._currentState$?.complete(),this._status$?.complete()}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Oe=(()=>{class t{TIMEOUT_DURATION=1e4;connectionStateMachine=f(Ri);constructor(){this.connectionStateMachine.setHTTPRetryCallback(()=>{console.log("[SignalKConnectionService] Executing HTTP retry via callback"),this.retryCurrentConnection()})}serverServiceEndpoint$=new v({operation:0,message:"Not connected",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null});signalKURL;serverName;serverVersion$=new v(null);serverRoles=[];http=f(Ie);currentProxyEnabled;currentSubscribeAll;validateSignalKUrl(e){return I(this,null,function*(){if(!e)throw new Error("Please enter a server URL");try{let n=new URL(e);if(!["http:","https:"].includes(n.protocol))throw new Error("URL must start with http:// or https://")}catch(n){throw new Error("Invalid URL format - please check for typos and ensure it starts with http:// or https://")}let i=e;i.endsWith("signalk/")||(i+="/signalk/"),console.log(`[Connection Service] Validating Signal K server at: ${e}`);try{if(!(yield B(this.http.get(i,{observe:"response"}).pipe(Dt(5e3),De(o=>{throw console.error("[Connection Service] HTTP Error details:",o),o.name==="TimeoutError"?(console.error("[Connection Service] Validation timed out after 5000ms"),new Error("Server is not responding - check if the URL is correct and the server is running")):o.status===0||o.status===void 0?new Error("Cannot connect to server - check the URL format and ensure the server is accessible"):o.status===404?new Error("Server found but no Signal K service detected - verify this is a Signal K server"):o.status===403?new Error("Server refused connection - check if the server allows connections from this browser"):o.status>=500?new Error(`Server error (${o.status}) - the Signal K server may be having issues`):new Error(`Connection failed (${o.status}) - ${o.statusText||"please check the server URL"}`)})))).body?.endpoints?.v1)throw new Error("Server responded but doesn't appear to be a Signal K server - missing required endpoints");console.log(`[Connection Service] Validation successful for: ${e}`)}catch(n){throw console.error(`[Connection Service] Validation failed for ${e}:`,n.message),n}})}initializeConnection(e,i,n){return I(this,null,function*(){if(!e.url){console.log("[Connection Service] Connection initialization called with null or empty URL value");return}this.currentProxyEnabled=i,this.currentSubscribeAll=n;let o={operation:1,message:"Connecting...",serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.signalKURL=e,this.serverServiceEndpoint$.next(o),this.connectionStateMachine.startHTTPDiscovery(`Connecting to ${e.url}`);let a=this.signalKURL.url;a.endsWith("signalk/")||(a+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let s=yield B(this.http.get(a,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(l=>(l.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(l)))));Object.assign(o,this.processEndpointResponse(s,i,n)),this.connectionStateMachine.onHTTPDiscoverySuccess()}catch(s){o.operation=3,o.message=s.message,this.connectionStateMachine.onHTTPDiscoveryError(s.message),this.handleError(s)}finally{o.subscribeAll=!!n,this.serverServiceEndpoint$.next(o)}})}retryCurrentConnection(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] Cannot retry - no current URL stored");return}console.log(`[SignalKConnectionService] Retrying connection to ${this.signalKURL.url}`),this.performHTTPDiscovery()}performHTTPDiscovery(){return I(this,null,function*(){if(!this.signalKURL?.url){console.error("[SignalKConnectionService] No URL available for HTTP discovery");return}let e=this.signalKURL.url;e.endsWith("signalk/")||(e+="/signalk/");try{console.log("[Connection Service] Connecting to: "+this.signalKURL.url);let i=yield B(this.http.get(e,{observe:"response"}).pipe(Dt(this.TIMEOUT_DURATION),De(o=>(o.name==="TimeoutError"&&console.error("[Connection Service] Connection request timed out after "+this.TIMEOUT_DURATION+"ms"),Sr(o))))),n=this.processEndpointResponse(i,this.currentProxyEnabled,this.currentSubscribeAll);this.connectionStateMachine.onHTTPDiscoverySuccess(),this.serverServiceEndpoint$.next(n)}catch(i){let n={operation:3,message:i.message,serverDescription:null,httpServiceUrl:null,WsServiceUrl:null};this.connectionStateMachine.onHTTPDiscoveryError(i.message),this.serverServiceEndpoint$.next(n),this.handleError(i)}})}processEndpointResponse(e,i,n){console.debug("[Connection Service] Signal K HTTP Endpoints retrieved"),this.serverVersion$.next(e.body.server.version);let o=e.body.endpoints.v1["signalk-http"],a=e.body.endpoints.v1["signalk-ws"],s=e.body.endpoints.v2?.["signalk-http"],l=e.body.endpoints.v2?.["signalk-ws"],c={operation:2,message:e.status?.toString()||"Connected",serverDescription:`${e.body.server.id} ${e.body.server.version}`,httpServiceUrl:null,WsServiceUrl:null};if(i)console.debug("[Connection Service] Proxy Mode Enabled"),c.httpServiceUrl=window.location.origin+new URL(o).pathname,c.WsServiceUrl=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(a).pathname,s&&(c.httpServiceUrlV2=window.location.origin+new URL(s).pathname),l&&(c.WsServiceUrlV2=window.location.protocol.replace("http","ws")+"//"+window.location.host+new URL(l).pathname);else{c.httpServiceUrl=o;let u=window.location.protocol==="https:";c.WsServiceUrl=u?a.replace("ws://","wss://"):a,s&&(c.httpServiceUrlV2=s),l&&(c.WsServiceUrlV2=u?l.replace("ws://","wss://"):l)}return console.debug("[Connection Service] HTTP URI: "+c.httpServiceUrl),c.httpServiceUrlV2&&console.debug("[Connection Service] HTTP V2 URI: "+c.httpServiceUrlV2),console.debug("[Connection Service] WebSocket URI: "+c.WsServiceUrl),c.WsServiceUrlV2&&console.debug("[Connection Service] WebSocket V2 URI: "+c.WsServiceUrlV2),c.subscribeAll=!!n,c}handleError(e){let i=e.status===0?`[Connection Service] ${e.name}: ${e.message}`:`[Connection Service] Backend returned code ${e.status}, body was: ${e.error}`;throw console.error(i),e}getServiceEndpointStatusAsO(){return this.serverServiceEndpoint$.asObservable()}setServerInfo(e,i,n){this.serverName=e,this.serverRoles=n,console.log(`[Connection Service] Server Name: ${e}, Version: ${i}, Roles: ${JSON.stringify(n)}`)}get skServerName(){return this.serverName}get skServerVersion(){return this.serverVersion$.getValue()}get skServerRoles(){return this.serverRoles}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Ua="/signalk/v1/",Ni="auth/login",ja="auth/logout",Ba="auth/validate",Or=60,La=2147483647,Ui=(()=>{class t{http=f(Ie);conn=f(Oe);_IsLoggedIn$=new v(!1);isLoggedIn$=this._IsLoggedIn$.asObservable();_authToken$=new v(null);authToken$=this._authToken$.asObservable();connectionEndpointSubscription=null;authTokenSubscription=null;renewalTimerId=null;isRenewingToken=!1;loginUrl=null;logoutUrl=null;validateTokenUrl=null;constructor(){let e=JSON.parse(localStorage.getItem("authorization_token"));e&&(e.isDeviceAccessToken?e.expiry===null?(console.log("[Authentication Service] Device Access Token found with expiry: NEVER"),this._authToken$.next(e)):this.isTokenExpired(e.expiry)?(console.log("[Authentication Service] Device Access Token expired. Deleting token"),localStorage.removeItem("authorization_token")):(console.log("[Authentication Service] Device Access Token found in Local Storage"),this._authToken$.next(e)):(console.log("[Authentication Service] User session token found in Local Storage"),console.log("[Authentication Service] Deleting user session token"),localStorage.removeItem("authorization_token"))),this.authTokenSubscription=this._authToken$.pipe(di((i,n)=>i?.expiry===n?.expiry)).subscribe(i=>{this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null),!(!i||i.expiry==null)&&this.scheduleRenewalChunk(i)}),this.connectionEndpointSubscription=this.conn.serverServiceEndpoint$.subscribe(i=>{if(i.operation===2){let n=i.httpServiceUrl.substring(0,i.httpServiceUrl.length-4);this.loginUrl=n+Ni,this.logoutUrl=n+ja,this.validateTokenUrl=n+Ba}})}scheduleRenewalChunk(e){let i=Date.now(),n=(e.expiry-Or)*1e3,o=n-i;if(o<=0){this.handleTokenRenewal();return}let a=Math.min(o,La);console.log(a!==o?`[Authentication Service] Large renewal delay (${o} ms). Scheduling first chunk of ${a} ms.`:`[Authentication Service] Scheduling token renewal in ${a} ms (buffered target: ${new Date(n).toISOString()})`),this.renewalTimerId=setTimeout(()=>{this.renewalTimerId=null;let s=this._authToken$.getValue();!s||s.expiry!==e.expiry||this.scheduleRenewalChunk(e)},a)}handleTokenRenewal(){if(this.isRenewingToken){console.warn("[Authentication Service] Token renewal already in progress.");return}this.isRenewingToken=!0;let e=JSON.parse(localStorage.getItem("authorization_token"));if(!e){console.warn("[Authentication Service] No token found in local storage. Cannot renew."),this.isRenewingToken=!1;return}if(e.isDeviceAccessToken)console.warn("[Authentication Service] Device Access Token expired. Manual renewal required."),this.isRenewingToken=!1;else{let i=Math.floor(Date.now()/1e3),n=e.expiry-i;if(this.isTokenExpired(e.expiry))console.log("[Authentication Service] User session Token expired. Cannot renew."),this.isRenewingToken=!1;else if(n>Or)console.log(`[Authentication Service] Renewal trigger fired early; ${n}s remaining (> buffer ${Or}s). Rescheduling.`),this.isRenewingToken=!1,this.scheduleRenewalChunk(e);else{console.log(`[Authentication Service] User session Token within renewal window (${n}s remaining). Renewing token...`);let o=JSON.parse(localStorage.getItem("connectionConfig"));this.login({usr:o.loginName,pwd:o.loginPassword}).then(()=>{console.log("[Authentication Service] Token successfully renewed.")}).catch(a=>{console.error("[Authentication Service] Token renewal failed. Server returned:",a.error)}).finally(()=>{this.isRenewingToken=!1})}}}login(o){return I(this,arguments,function*({usr:e,pwd:i,newUrl:n}){let a;if(n?a=n.replace(/\/+$/,"")+Ua+Ni:a=this.loginUrl,this._IsLoggedIn$.getValue()&&(yield this.logout(!0)),!a)throw console.error("[Authentication Service] Login URL is not set. Cannot perform login."),this.deleteToken(),new Error("Login URL is not set.");yield B(this.http.post(a,{username:e,password:i},{observe:"response"})).then(s=>{console.log("[Authentication Service] User "+e+" login successful"),this.setSession(s.body.token)}).catch(s=>{this.deleteToken(),this.handleError(s)})})}handleError(e){throw e.status===0&&this.deleteToken(),e}setSession(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,n={token:null,expiry:null,isDeviceAccessToken:!1};i===void 0?(n.token=e,console.log("[Authentication Service] User Session Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Session Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Session Authorization Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!0),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}isTokenExpired(e){return Math.floor(new Date().getTime()/1e3)>=e}getTokenExpirationDate(e,i){let n=new Date(0);if(i){let o=new Date(0);o.setUTCSeconds(e-i),n=o}else n.setUTCSeconds(e);return n}renewToken(){return this.http.post(this.validateTokenUrl,null,{observe:"response"})}logout(e){return I(this,null,function*(){localStorage.removeItem("authorization_token"),yield B(this.http.put(this.logoutUrl,null)).then(()=>{this._IsLoggedIn$.next(!1),e||this._authToken$.next(null),console.log("[Authentication Service] User logged out")}).catch(i=>{console.error(i)})})}deleteToken(){this._authToken$&&(console.log("[Authentication Service] Deleting Authorization token"),localStorage.removeItem("authorization_token"),this._IsLoggedIn$.next(!1),this._authToken$.next(null))}setDeviceAccessToken(e){if(e){let i=JSON.parse(atob(e.split(".")[1])).exp,n={token:null,expiry:null,isDeviceAccessToken:!0};i===void 0?(n.token=e,console.log("[Authentication Service] Device Access Token received. Token Expiration: NEVER"),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n))):this.isTokenExpired(i)?console.log("[Authentication Service] Received expired Device Access Token from server"):(n.token=e,n.expiry=i,console.log("[Authentication Service] Device Access Token received. Token Expiration: "+this.getTokenExpirationDate(n.expiry)),this._IsLoggedIn$.next(!1),this._authToken$.next(n),localStorage.setItem("authorization_token",JSON.stringify(n)))}}ngOnDestroy(){this.connectionEndpointSubscription?.unsubscribe(),this.authTokenSubscription?.unsubscribe(),this.renewalTimerId&&(clearTimeout(this.renewalTimerId),this.renewalTimerId=null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var $a=typeof global=="object"&&global&&global.Object===Object&&global,Ot=$a;var Ha=typeof self=="object"&&self&&self.Object===Object&&self,Wa=Ot||Ha||Function("return this")(),S=Wa;var Ga=S.Symbol,H=Ga;var ji=Object.prototype,qa=ji.hasOwnProperty,Ka=ji.toString,ct=H?H.toStringTag:void 0;function za(t){var r=qa.call(t,ct),e=t[ct];try{t[ct]=void 0;var i=!0}catch(o){}var n=Ka.call(t);return i&&(r?t[ct]=e:delete t[ct]),n}var Bi=za;var Ja=Object.prototype,Za=Ja.toString;function Xa(t){return Za.call(t)}var Li=Xa;var Qa="[object Null]",Ya="[object Undefined]",$i=H?H.toStringTag:void 0;function es(t){return t==null?t===void 0?Ya:Qa:$i&&$i in Object(t)?Bi(t):Li(t)}var q=es;function ts(t){return t!=null&&typeof t=="object"}var T=ts;var rs=Array.isArray,W=rs;function is(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}var k=is;function ns(t){return t}var Pt=ns;var os="[object AsyncFunction]",as="[object Function]",ss="[object GeneratorFunction]",ls="[object Proxy]";function cs(t){if(!k(t))return!1;var r=q(t);return r==as||r==ss||r==os||r==ls}var Pe=cs;var us=S["__core-js_shared__"],Ft=us;var Hi=(function(){var t=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ds(t){return!!Hi&&Hi in t}var Wi=ds;var fs=Function.prototype,ps=fs.toString;function hs(t){if(t!=null){try{return ps.call(t)}catch(r){}try{return t+""}catch(r){}}return""}var oe=hs;var ms=/[\\^$.*+?()[\]{}|]/g,gs=/^\[object .+?Constructor\]$/,vs=Function.prototype,ys=Object.prototype,bs=vs.toString,_s=ys.hasOwnProperty,Cs=RegExp("^"+bs.call(_s).replace(ms,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ss(t){if(!k(t)||Wi(t))return!1;var r=Pe(t)?Cs:gs;return r.test(oe(t))}var Gi=Ss;function xs(t,r){return t?.[r]}var qi=xs;function ws(t,r){var e=qi(t,r);return Gi(e)?e:void 0}var U=ws;var As=U(S,"WeakMap"),Rt=As;var Ki=Object.create,Ts=(function(){function t(){}return function(r){if(!k(r))return{};if(Ki)return Ki(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}})(),zi=Ts;function Ds(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)}var Ji=Ds;function ks(t,r){var e=-1,i=t.length;for(r||(r=Array(i));++e<i;)r[e]=t[e];return r}var Nt=ks;var Ms=800,Vs=16,Es=Date.now;function Is(t){var r=0,e=0;return function(){var i=Es(),n=Vs-(i-e);if(e=i,n>0){if(++r>=Ms)return arguments[0]}else r=0;return t.apply(void 0,arguments)}}var Zi=Is;function Os(t){return function(){return t}}var Xi=Os;var Ps=(function(){try{var t=U(Object,"defineProperty");return t({},"",{}),t}catch(r){}})(),Fe=Ps;var Fs=Fe?function(t,r){return Fe(t,"toString",{configurable:!0,enumerable:!1,value:Xi(r),writable:!0})}:Pt,Qi=Fs;var Rs=Zi(Qi),Yi=Rs;function Ns(t,r){for(var e=-1,i=t==null?0:t.length;++e<i&&r(t[e],e,t)!==!1;);return t}var en=Ns;var Us=9007199254740991,js=/^(?:0|[1-9]\d*)$/;function Bs(t,r){var e=typeof t;return r=r??Us,!!r&&(e=="number"||e!="symbol"&&js.test(t))&&t>-1&&t%1==0&&t<r}var Ut=Bs;function Ls(t,r,e){r=="__proto__"&&Fe?Fe(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e}var Re=Ls;function $s(t,r){return t===r||t!==t&&r!==r}var Y=$s;var Hs=Object.prototype,Ws=Hs.hasOwnProperty;function Gs(t,r,e){var i=t[r];(!(Ws.call(t,r)&&Y(i,e))||e===void 0&&!(r in t))&&Re(t,r,e)}var jt=Gs;function qs(t,r,e,i){var n=!e;e||(e={});for(var o=-1,a=r.length;++o<a;){var s=r[o],l=i?i(e[s],t[s],s,e,t):void 0;l===void 0&&(l=t[s]),n?Re(e,s,l):jt(e,s,l)}return e}var ee=qs;var tn=Math.max;function Ks(t,r,e){return r=tn(r===void 0?t.length-1:r,0),function(){for(var i=arguments,n=-1,o=tn(i.length-r,0),a=Array(o);++n<o;)a[n]=i[r+n];n=-1;for(var s=Array(r+1);++n<r;)s[n]=i[n];return s[r]=e(a),Ji(t,this,s)}}var rn=Ks;function zs(t,r){return Yi(rn(t,r,Pt),t+"")}var nn=zs;var Js=9007199254740991;function Zs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Js}var Bt=Zs;function Xs(t){return t!=null&&Bt(t.length)&&!Pe(t)}var fe=Xs;function Qs(t,r,e){if(!k(e))return!1;var i=typeof r;return(i=="number"?fe(e)&&Ut(r,e.length):i=="string"&&r in e)?Y(e[r],t):!1}var on=Qs;function Ys(t){return nn(function(r,e){var i=-1,n=e.length,o=n>1?e[n-1]:void 0,a=n>2?e[2]:void 0;for(o=t.length>3&&typeof o=="function"?(n--,o):void 0,a&&on(e[0],e[1],a)&&(o=n<3?void 0:o,n=1),r=Object(r);++i<n;){var s=e[i];s&&t(r,s,i,o)}return r})}var an=Ys;var el=Object.prototype;function tl(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||el;return t===e}var Ne=tl;function rl(t,r){for(var e=-1,i=Array(t);++e<t;)i[e]=r(e);return i}var sn=rl;var il="[object Arguments]";function nl(t){return T(t)&&q(t)==il}var Pr=nl;var ln=Object.prototype,ol=ln.hasOwnProperty,al=ln.propertyIsEnumerable,sl=Pr((function(){return arguments})())?Pr:function(t){return T(t)&&ol.call(t,"callee")&&!al.call(t,"callee")},ut=sl;function ll(){return!1}var cn=ll;var fn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,un=fn&&typeof module=="object"&&module&&!module.nodeType&&module,cl=un&&un.exports===fn,dn=cl?S.Buffer:void 0,ul=dn?dn.isBuffer:void 0,dl=ul||cn,ae=dl;var fl="[object Arguments]",pl="[object Array]",hl="[object Boolean]",ml="[object Date]",gl="[object Error]",vl="[object Function]",yl="[object Map]",bl="[object Number]",_l="[object Object]",Cl="[object RegExp]",Sl="[object Set]",xl="[object String]",wl="[object WeakMap]",Al="[object ArrayBuffer]",Tl="[object DataView]",Dl="[object Float32Array]",kl="[object Float64Array]",Ml="[object Int8Array]",Vl="[object Int16Array]",El="[object Int32Array]",Il="[object Uint8Array]",Ol="[object Uint8ClampedArray]",Pl="[object Uint16Array]",Fl="[object Uint32Array]",y={};y[Dl]=y[kl]=y[Ml]=y[Vl]=y[El]=y[Il]=y[Ol]=y[Pl]=y[Fl]=!0;y[fl]=y[pl]=y[Al]=y[hl]=y[Tl]=y[ml]=y[gl]=y[vl]=y[yl]=y[bl]=y[_l]=y[Cl]=y[Sl]=y[xl]=y[wl]=!1;function Rl(t){return T(t)&&Bt(t.length)&&!!y[q(t)]}var pn=Rl;function Nl(t){return function(r){return t(r)}}var Ue=Nl;var hn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dt=hn&&typeof module=="object"&&module&&!module.nodeType&&module,Ul=dt&&dt.exports===hn,Fr=Ul&&Ot.process,jl=(function(){try{var t=dt&&dt.require&&dt.require("util").types;return t||Fr&&Fr.binding&&Fr.binding("util")}catch(r){}})(),se=jl;var mn=se&&se.isTypedArray,Bl=mn?Ue(mn):pn,je=Bl;var Ll=Object.prototype,$l=Ll.hasOwnProperty;function Hl(t,r){var e=W(t),i=!e&&ut(t),n=!e&&!i&&ae(t),o=!e&&!i&&!n&&je(t),a=e||i||n||o,s=a?sn(t.length,String):[],l=s.length;for(var c in t)(r||$l.call(t,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Ut(c,l)))&&s.push(c);return s}var Lt=Hl;function Wl(t,r){return function(e){return t(r(e))}}var $t=Wl;var Gl=$t(Object.keys,Object),gn=Gl;var ql=Object.prototype,Kl=ql.hasOwnProperty;function zl(t){if(!Ne(t))return gn(t);var r=[];for(var e in Object(t))Kl.call(t,e)&&e!="constructor"&&r.push(e);return r}var vn=zl;function Jl(t){return fe(t)?Lt(t):vn(t)}var Be=Jl;function Zl(t){var r=[];if(t!=null)for(var e in Object(t))r.push(e);return r}var yn=Zl;var Xl=Object.prototype,Ql=Xl.hasOwnProperty;function Yl(t){if(!k(t))return yn(t);var r=Ne(t),e=[];for(var i in t)i=="constructor"&&(r||!Ql.call(t,i))||e.push(i);return e}var bn=Yl;function ec(t){return fe(t)?Lt(t,!0):bn(t)}var te=ec;var tc=U(Object,"create"),le=tc;function rc(){this.__data__=le?le(null):{},this.size=0}var _n=rc;function ic(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}var Cn=ic;var nc="__lodash_hash_undefined__",oc=Object.prototype,ac=oc.hasOwnProperty;function sc(t){var r=this.__data__;if(le){var e=r[t];return e===nc?void 0:e}return ac.call(r,t)?r[t]:void 0}var Sn=sc;var lc=Object.prototype,cc=lc.hasOwnProperty;function uc(t){var r=this.__data__;return le?r[t]!==void 0:cc.call(r,t)}var xn=uc;var dc="__lodash_hash_undefined__";function fc(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=le&&r===void 0?dc:r,this}var wn=fc;function Le(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}Le.prototype.clear=_n;Le.prototype.delete=Cn;Le.prototype.get=Sn;Le.prototype.has=xn;Le.prototype.set=wn;var Rr=Le;function pc(){this.__data__=[],this.size=0}var An=pc;function hc(t,r){for(var e=t.length;e--;)if(Y(t[e][0],r))return e;return-1}var pe=hc;var mc=Array.prototype,gc=mc.splice;function vc(t){var r=this.__data__,e=pe(r,t);if(e<0)return!1;var i=r.length-1;return e==i?r.pop():gc.call(r,e,1),--this.size,!0}var Tn=vc;function yc(t){var r=this.__data__,e=pe(r,t);return e<0?void 0:r[e][1]}var Dn=yc;function bc(t){return pe(this.__data__,t)>-1}var kn=bc;function _c(t,r){var e=this.__data__,i=pe(e,t);return i<0?(++this.size,e.push([t,r])):e[i][1]=r,this}var Mn=_c;function $e(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}$e.prototype.clear=An;$e.prototype.delete=Tn;$e.prototype.get=Dn;$e.prototype.has=kn;$e.prototype.set=Mn;var he=$e;var Cc=U(S,"Map"),me=Cc;function Sc(){this.size=0,this.__data__={hash:new Rr,map:new(me||he),string:new Rr}}var Vn=Sc;function xc(t){var r=typeof t;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?t!=="__proto__":t===null}var En=xc;function wc(t,r){var e=t.__data__;return En(r)?e[typeof r=="string"?"string":"hash"]:e.map}var ge=wc;function Ac(t){var r=ge(this,t).delete(t);return this.size-=r?1:0,r}var In=Ac;function Tc(t){return ge(this,t).get(t)}var On=Tc;function Dc(t){return ge(this,t).has(t)}var Pn=Dc;function kc(t,r){var e=ge(this,t),i=e.size;return e.set(t,r),this.size+=e.size==i?0:1,this}var Fn=kc;function He(t){var r=-1,e=t==null?0:t.length;for(this.clear();++r<e;){var i=t[r];this.set(i[0],i[1])}}He.prototype.clear=Vn;He.prototype.delete=In;He.prototype.get=On;He.prototype.has=Pn;He.prototype.set=Fn;var Ht=He;function Mc(t,r){for(var e=-1,i=r.length,n=t.length;++e<i;)t[n+e]=r[e];return t}var Wt=Mc;var Vc=$t(Object.getPrototypeOf,Object),We=Vc;var Ec="[object Object]",Ic=Function.prototype,Oc=Object.prototype,Rn=Ic.toString,Pc=Oc.hasOwnProperty,Fc=Rn.call(Object);function Rc(t){if(!T(t)||q(t)!=Ec)return!1;var r=We(t);if(r===null)return!0;var e=Pc.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&Rn.call(e)==Fc}var Nn=Rc;function Nc(){this.__data__=new he,this.size=0}var Un=Nc;function Uc(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e}var jn=Uc;function jc(t){return this.__data__.get(t)}var Bn=jc;function Bc(t){return this.__data__.has(t)}var Ln=Bc;var Lc=200;function $c(t,r){var e=this.__data__;if(e instanceof he){var i=e.__data__;if(!me||i.length<Lc-1)return i.push([t,r]),this.size=++e.size,this;e=this.__data__=new Ht(i)}return e.set(t,r),this.size=e.size,this}var $n=$c;function Ge(t){var r=this.__data__=new he(t);this.size=r.size}Ge.prototype.clear=Un;Ge.prototype.delete=jn;Ge.prototype.get=Bn;Ge.prototype.has=Ln;Ge.prototype.set=$n;var ve=Ge;function Hc(t,r){return t&&ee(r,Be(r),t)}var Hn=Hc;function Wc(t,r){return t&&ee(r,te(r),t)}var Wn=Wc;var zn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gn=zn&&typeof module=="object"&&module&&!module.nodeType&&module,Gc=Gn&&Gn.exports===zn,qn=Gc?S.Buffer:void 0,Kn=qn?qn.allocUnsafe:void 0;function qc(t,r){if(r)return t.slice();var e=t.length,i=Kn?Kn(e):new t.constructor(e);return t.copy(i),i}var Gt=qc;function Kc(t,r){for(var e=-1,i=t==null?0:t.length,n=0,o=[];++e<i;){var a=t[e];r(a,e,t)&&(o[n++]=a)}return o}var Jn=Kc;function zc(){return[]}var qt=zc;var Jc=Object.prototype,Zc=Jc.propertyIsEnumerable,Zn=Object.getOwnPropertySymbols,Xc=Zn?function(t){return t==null?[]:(t=Object(t),Jn(Zn(t),function(r){return Zc.call(t,r)}))}:qt,qe=Xc;function Qc(t,r){return ee(t,qe(t),r)}var Xn=Qc;var Yc=Object.getOwnPropertySymbols,eu=Yc?function(t){for(var r=[];t;)Wt(r,qe(t)),t=We(t);return r}:qt,Kt=eu;function tu(t,r){return ee(t,Kt(t),r)}var Qn=tu;function ru(t,r,e){var i=r(t);return W(t)?i:Wt(i,e(t))}var zt=ru;function iu(t){return zt(t,Be,qe)}var ft=iu;function nu(t){return zt(t,te,Kt)}var Yn=nu;var ou=U(S,"DataView"),Jt=ou;var au=U(S,"Promise"),Zt=au;var su=U(S,"Set"),Xt=su;var eo="[object Map]",lu="[object Object]",to="[object Promise]",ro="[object Set]",io="[object WeakMap]",no="[object DataView]",cu=oe(Jt),uu=oe(me),du=oe(Zt),fu=oe(Xt),pu=oe(Rt),xe=q;(Jt&&xe(new Jt(new ArrayBuffer(1)))!=no||me&&xe(new me)!=eo||Zt&&xe(Zt.resolve())!=to||Xt&&xe(new Xt)!=ro||Rt&&xe(new Rt)!=io)&&(xe=function(t){var r=q(t),e=r==lu?t.constructor:void 0,i=e?oe(e):"";if(i)switch(i){case cu:return no;case uu:return eo;case du:return to;case fu:return ro;case pu:return io}return r});var ce=xe;var hu=Object.prototype,mu=hu.hasOwnProperty;function gu(t){var r=t.length,e=new t.constructor(r);return r&&typeof t[0]=="string"&&mu.call(t,"index")&&(e.index=t.index,e.input=t.input),e}var oo=gu;var vu=S.Uint8Array,Ke=vu;function yu(t){var r=new t.constructor(t.byteLength);return new Ke(r).set(new Ke(t)),r}var ze=yu;function bu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}var ao=bu;var _u=/\w*$/;function Cu(t){var r=new t.constructor(t.source,_u.exec(t));return r.lastIndex=t.lastIndex,r}var so=Cu;var lo=H?H.prototype:void 0,co=lo?lo.valueOf:void 0;function Su(t){return co?Object(co.call(t)):{}}var uo=Su;function xu(t,r){var e=r?ze(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}var Qt=xu;var wu="[object Boolean]",Au="[object Date]",Tu="[object Map]",Du="[object Number]",ku="[object RegExp]",Mu="[object Set]",Vu="[object String]",Eu="[object Symbol]",Iu="[object ArrayBuffer]",Ou="[object DataView]",Pu="[object Float32Array]",Fu="[object Float64Array]",Ru="[object Int8Array]",Nu="[object Int16Array]",Uu="[object Int32Array]",ju="[object Uint8Array]",Bu="[object Uint8ClampedArray]",Lu="[object Uint16Array]",$u="[object Uint32Array]";function Hu(t,r,e){var i=t.constructor;switch(r){case Iu:return ze(t);case wu:case Au:return new i(+t);case Ou:return ao(t,e);case Pu:case Fu:case Ru:case Nu:case Uu:case ju:case Bu:case Lu:case $u:return Qt(t,e);case Tu:return new i;case Du:case Vu:return new i(t);case ku:return so(t);case Mu:return new i;case Eu:return uo(t)}}var fo=Hu;function Wu(t){return typeof t.constructor=="function"&&!Ne(t)?zi(We(t)):{}}var Yt=Wu;var Gu="[object Map]";function qu(t){return T(t)&&ce(t)==Gu}var po=qu;var ho=se&&se.isMap,Ku=ho?Ue(ho):po,mo=Ku;var zu="[object Set]";function Ju(t){return T(t)&&ce(t)==zu}var go=Ju;var vo=se&&se.isSet,Zu=vo?Ue(vo):go,yo=Zu;var Xu=1,Qu=2,Yu=4,bo="[object Arguments]",ed="[object Array]",td="[object Boolean]",rd="[object Date]",id="[object Error]",_o="[object Function]",nd="[object GeneratorFunction]",od="[object Map]",ad="[object Number]",Co="[object Object]",sd="[object RegExp]",ld="[object Set]",cd="[object String]",ud="[object Symbol]",dd="[object WeakMap]",fd="[object ArrayBuffer]",pd="[object DataView]",hd="[object Float32Array]",md="[object Float64Array]",gd="[object Int8Array]",vd="[object Int16Array]",yd="[object Int32Array]",bd="[object Uint8Array]",_d="[object Uint8ClampedArray]",Cd="[object Uint16Array]",Sd="[object Uint32Array]",g={};g[bo]=g[ed]=g[fd]=g[pd]=g[td]=g[rd]=g[hd]=g[md]=g[gd]=g[vd]=g[yd]=g[od]=g[ad]=g[Co]=g[sd]=g[ld]=g[cd]=g[ud]=g[bd]=g[_d]=g[Cd]=g[Sd]=!0;g[id]=g[_o]=g[dd]=!1;function er(t,r,e,i,n,o){var a,s=r&Xu,l=r&Qu,c=r&Yu;if(e&&(a=n?e(t,i,n,o):e(t)),a!==void 0)return a;if(!k(t))return t;var u=W(t);if(u){if(a=oo(t),!s)return Nt(t,a)}else{var h=ce(t),b=h==_o||h==nd;if(ae(t))return Gt(t,s);if(h==Co||h==bo||b&&!n){if(a=l||b?{}:Yt(t),!s)return l?Qn(t,Wn(a,t)):Xn(t,Hn(a,t))}else{if(!g[h])return n?t:{};a=fo(t,h,s)}}o||(o=new ve);var D=o.get(t);if(D)return D;o.set(t,a),yo(t)?t.forEach(function(A){a.add(er(A,r,e,A,t,o))}):mo(t)&&t.forEach(function(A,M){a.set(M,er(A,r,e,M,t,o))});var w=c?l?Yn:ft:l?te:Be,E=u?void 0:w(t);return en(E||t,function(A,M){E&&(M=A,A=t[M]),jt(a,M,er(A,r,e,M,t,o))}),a}var So=er;var xd=1,wd=4;function Ad(t){return So(t,xd|wd)}var tr=Ad;var Td="__lodash_hash_undefined__";function Dd(t){return this.__data__.set(t,Td),this}var xo=Dd;function kd(t){return this.__data__.has(t)}var wo=kd;function rr(t){var r=-1,e=t==null?0:t.length;for(this.__data__=new Ht;++r<e;)this.add(t[r])}rr.prototype.add=rr.prototype.push=xo;rr.prototype.has=wo;var Ao=rr;function Md(t,r){for(var e=-1,i=t==null?0:t.length;++e<i;)if(r(t[e],e,t))return!0;return!1}var To=Md;function Vd(t,r){return t.has(r)}var Do=Vd;var Ed=1,Id=2;function Od(t,r,e,i,n,o){var a=e&Ed,s=t.length,l=r.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(t),u=o.get(r);if(c&&u)return c==r&&u==t;var h=-1,b=!0,D=e&Id?new Ao:void 0;for(o.set(t,r),o.set(r,t);++h<s;){var w=t[h],E=r[h];if(i)var A=a?i(E,w,h,r,t,o):i(w,E,h,t,r,o);if(A!==void 0){if(A)continue;b=!1;break}if(D){if(!To(r,function(M,_e){if(!Do(D,_e)&&(w===M||n(w,M,e,i,o)))return D.push(_e)})){b=!1;break}}else if(!(w===E||n(w,E,e,i,o))){b=!1;break}}return o.delete(t),o.delete(r),b}var ir=Od;function Pd(t){var r=-1,e=Array(t.size);return t.forEach(function(i,n){e[++r]=[n,i]}),e}var ko=Pd;function Fd(t){var r=-1,e=Array(t.size);return t.forEach(function(i){e[++r]=i}),e}var Mo=Fd;var Rd=1,Nd=2,Ud="[object Boolean]",jd="[object Date]",Bd="[object Error]",Ld="[object Map]",$d="[object Number]",Hd="[object RegExp]",Wd="[object Set]",Gd="[object String]",qd="[object Symbol]",Kd="[object ArrayBuffer]",zd="[object DataView]",Vo=H?H.prototype:void 0,Nr=Vo?Vo.valueOf:void 0;function Jd(t,r,e,i,n,o,a){switch(e){case zd:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case Kd:return!(t.byteLength!=r.byteLength||!o(new Ke(t),new Ke(r)));case Ud:case jd:case $d:return Y(+t,+r);case Bd:return t.name==r.name&&t.message==r.message;case Hd:case Gd:return t==r+"";case Ld:var s=ko;case Wd:var l=i&Rd;if(s||(s=Mo),t.size!=r.size&&!l)return!1;var c=a.get(t);if(c)return c==r;i|=Nd,a.set(t,r);var u=ir(s(t),s(r),i,n,o,a);return a.delete(t),u;case qd:if(Nr)return Nr.call(t)==Nr.call(r)}return!1}var Eo=Jd;var Zd=1,Xd=Object.prototype,Qd=Xd.hasOwnProperty;function Yd(t,r,e,i,n,o){var a=e&Zd,s=ft(t),l=s.length,c=ft(r),u=c.length;if(l!=u&&!a)return!1;for(var h=l;h--;){var b=s[h];if(!(a?b in r:Qd.call(r,b)))return!1}var D=o.get(t),w=o.get(r);if(D&&w)return D==r&&w==t;var E=!0;o.set(t,r),o.set(r,t);for(var A=a;++h<l;){b=s[h];var M=t[b],_e=r[b];if(i)var ai=a?i(_e,M,b,r,t,o):i(M,_e,b,t,r,o);if(!(ai===void 0?M===_e||n(M,_e,e,i,o):ai)){E=!1;break}A||(A=b=="constructor")}if(E&&!A){var At=t.constructor,Tt=r.constructor;At!=Tt&&"constructor"in t&&"constructor"in r&&!(typeof At=="function"&&At instanceof At&&typeof Tt=="function"&&Tt instanceof Tt)&&(E=!1)}return o.delete(t),o.delete(r),E}var Io=Yd;var ef=1,Oo="[object Arguments]",Po="[object Array]",nr="[object Object]",tf=Object.prototype,Fo=tf.hasOwnProperty;function rf(t,r,e,i,n,o){var a=W(t),s=W(r),l=a?Po:ce(t),c=s?Po:ce(r);l=l==Oo?nr:l,c=c==Oo?nr:c;var u=l==nr,h=c==nr,b=l==c;if(b&&ae(t)){if(!ae(r))return!1;a=!0,u=!1}if(b&&!u)return o||(o=new ve),a||je(t)?ir(t,r,e,i,n,o):Eo(t,r,l,e,i,n,o);if(!(e&ef)){var D=u&&Fo.call(t,"__wrapped__"),w=h&&Fo.call(r,"__wrapped__");if(D||w){var E=D?t.value():t,A=w?r.value():r;return o||(o=new ve),n(E,A,e,i,o)}}return b?(o||(o=new ve),Io(t,r,e,i,n,o)):!1}var Ro=rf;function No(t,r,e,i,n){return t===r?!0:t==null||r==null||!T(t)&&!T(r)?t!==t&&r!==r:Ro(t,r,e,i,No,n)}var Uo=No;function nf(t){return function(r,e,i){for(var n=-1,o=Object(r),a=i(r),s=a.length;s--;){var l=a[t?s:++n];if(e(o[l],l,o)===!1)break}return r}}var jo=nf;var of=jo(),Bo=of;function af(t,r,e){(e!==void 0&&!Y(t[r],e)||e===void 0&&!(r in t))&&Re(t,r,e)}var pt=af;function sf(t){return T(t)&&fe(t)}var Lo=sf;function lf(t,r){if(!(r==="constructor"&&typeof t[r]=="function")&&r!="__proto__")return t[r]}var ht=lf;function cf(t){return ee(t,te(t))}var $o=cf;function uf(t,r,e,i,n,o,a){var s=ht(t,e),l=ht(r,e),c=a.get(l);if(c){pt(t,e,c);return}var u=o?o(s,l,e+"",t,r,a):void 0,h=u===void 0;if(h){var b=W(l),D=!b&&ae(l),w=!b&&!D&&je(l);u=l,b||D||w?W(s)?u=s:Lo(s)?u=Nt(s):D?(h=!1,u=Gt(l,!0)):w?(h=!1,u=Qt(l,!0)):u=[]:Nn(l)||ut(l)?(u=s,ut(s)?u=$o(s):(!k(s)||Pe(s))&&(u=Yt(l))):h=!1}h&&(a.set(l,u),n(u,l,i,o,a),a.delete(l)),pt(t,e,u)}var Ho=uf;function Wo(t,r,e,i,n){t!==r&&Bo(r,function(o,a){if(n||(n=new ve),k(o))Ho(t,r,a,e,Wo,i,n);else{var s=i?i(ht(t,a),o,a+"",t,r,n):void 0;s===void 0&&(s=o),pt(t,a,s)}},te)}var Go=Wo;function df(t,r){return Uo(t,r)}var ff=df;var pf=an(function(t,r,e){Go(t,r,e)}),hf=pf;var mf=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Ur=t=>{if(typeof t!="string")throw new TypeError("Invalid argument expected string");let r=t.match(mf);if(!r)throw new Error(`Invalid argument not valid semver ('${t}' received)`);return r.shift(),r},qo=t=>t==="*"||t==="x"||t==="X",Ko=t=>{let r=parseInt(t,10);return isNaN(r)?t:r},gf=(t,r)=>typeof t!=typeof r?[String(t),String(r)]:[t,r],vf=(t,r)=>{if(qo(t)||qo(r))return 0;let[e,i]=gf(Ko(t),Ko(r));return e>i?1:e<i?-1:0},jr=(t,r)=>{for(let e=0;e<Math.max(t.length,r.length);e++){let i=vf(t[e]||"0",r[e]||"0");if(i!==0)return i}return 0};var zo=(t,r)=>{let e=Ur(t),i=Ur(r),n=e.pop(),o=i.pop(),a=jr(e,i);return a!==0?a:n&&o?jr(n.split("."),o.split(".")):n||o?n?-1:1:0};var mt=(t,r,e)=>{yf(e);let i=zo(t,r);return Zo[e].includes(i)},Zo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Jo=Object.keys(Zo),yf=t=>{if(typeof t!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof t}`);if(Jo.indexOf(t)===-1)throw new Error(`Invalid operator, expected one of ${Jo.join("|")}`)};var Xo=(()=>{class t{server=f(Oe);http=f(Ie);_auth=f(Ui);serverEndpoint=null;isAppDataSupported=!1;configFileVersion=null;sharedConfigName;InitConfig=null;_isRemoteContextBootstrapped=!1;storageServiceReady$=new v(!1);_isLoggedIn=!1;_networkStatus=void 0;_logIO=!1;patchQueue$=new G;patch=function(e){return this.http.post(e.url,e.document).pipe(pi(()=>console.log("[Storage Service] Remote config patch request completed successfully")),De(i=>this.handleError(i)))};constructor(){let e=this.server;this._auth.isLoggedIn$.pipe(lt()).subscribe(i=>{this._isLoggedIn=i,this.isStorageServiceReady()}),e.serverServiceEndpoint$.pipe(lt()).subscribe(i=>{this._networkStatus=i,this.isStorageServiceReady()}),e.serverVersion$.pipe(lt()).subscribe(i=>{i&&(this.isAppDataSupported=mt(i,"1.27.0",">="))}),this.patchQueue$.pipe(ui(i=>this.patch(i)),lt()).subscribe(()=>{})}isStorageServiceReady(){this._networkStatus?.httpServiceUrl&&(this.serverEndpoint=this._networkStatus.httpServiceUrl.substring(0,this._networkStatus.httpServiceUrl.length-4)+"applicationData/"),this._networkStatus?.operation===2&&this._isLoggedIn&&this.serverEndpoint?(this.storageServiceReady$.next(!0),console.log(`[Remote Storage Service] Authenticated ${this._isLoggedIn}, AppData API: ${this.serverEndpoint}`)):this.storageServiceReady$.next(!1)}waitUntilReady(e=1e4){return I(this,null,function*(){return this.storageServiceReady$.getValue()?!0:new Promise(i=>{let n=!1,o=this.storageServiceReady$.subscribe(s=>{n||!s||(n=!0,clearTimeout(a),o.unsubscribe(),i(!0))}),a=window.setTimeout(()=>{n||(n=!0,o.unsubscribe(),i(!1))},e)})})}ensureReady(){if(!this.storageServiceReady$.getValue())throw new Error("[StorageService] Not ready: storageServiceReady is false")}listConfigs(e){return I(this,null,function*(){this.ensureReady();let i=[];if(!this.serverEndpoint)return console.warn("[Storage Service] No server endpoint set. Cannot retrieve config list"),null;let n=this.serverEndpoint,o=e??this.configFileVersion,a=`${n}global/kip/${o}/?keys=true`,s=`${n}user/kip/${o}/?keys=true`;try{let l=yield B(this.http.get(a));for(let c of l)i.push({scope:"global",name:c});console.log("[Storage Service] Retrieved Global config list")}catch(l){this.handleError(l)}try{let l=yield B(this.http.get(s));for(let c of l)i.push({scope:"user",name:c});console.log("[Storage Service] Retrieved User config list")}catch(l){this.handleError(l)}return i})}getConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=n??this.configFileVersion,l=a+s+"/"+i;this._logIO&&console.debug("[StorageService.getConfig]",{scope:e,configName:i,ver:s,url:l,isInitLoad:!!o});try{let c=yield B(this.http.get(l));if(this._logIO){let u=c&&typeof c=="object"?c?.app?.configVersion:void 0;console.debug("[StorageService.getConfig Response]",{scope:e,configName:i,ver:s,appConfigVersion:u})}else console.log(`[Storage Service] Retrieved config [${i}] from [${e}] scope`);return o&&(this.InitConfig=c),tr(c)}catch(c){return this.handleError(c),null}})}setConfig(e,i,n,o){return I(this,null,function*(){this.ensureReady();let a=this.serverEndpoint+e+"/kip/",s=o??this.configFileVersion,l=a+s+"/"+i;if(this._logIO){let c=n?.app?.configVersion;console.debug("[StorageService.setConfig]",{scope:e,configName:i,ver:s,url:l,appConfigVersion:c})}try{return yield B(this.http.post(l,n)),this._logIO?console.debug("[StorageService.setConfig Response]",{scope:e,configName:i,ver:s,url:l,status:"ok"}):console.log(`[Storage Service] Saved config [${i}] to [${e}] scope`),null}catch(c){return this.handleError(c),null}})}patchConfig(e,i,n){this.ensureReady();let o=n??this.configFileVersion,a=this.serverEndpoint+"user/kip/"+o,s,l=i?.configVersion;switch(this._logIO&&console.warn("[StorageService.patchConfig] Suppressing app.configVersion write into v11 file",{targetFileVersion:o,incomingAppConfigVersion:l}),e){case"IAppConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app`,value:i}];break;case"IThemeConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/theme/themeName`,value:i.themeName}];break;case"IWidgetConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/widget`,value:i}];break;case"ILayoutConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/layout`,value:i}];break;case"Dashboards":s=[{op:"replace",path:`/${this.sharedConfigName}/dashboards`,value:i}];break;case"Array<IUnitDefaults>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/unitDefaults`,value:i}];break;case"Array<IDatasetDef>":s=[{op:"replace",path:`/${this.sharedConfigName}/app/dataSets`,value:i}];break;case"INotificationConfig":s=[{op:"replace",path:`/${this.sharedConfigName}/app/notificationConfig`,value:i}];break;default:console.warn("[Storage Service] JSON Patch request type unknown");break}let c={url:a,document:s};if(this._logIO){let u=e==="IAppConfig"?i?.configVersion:void 0;console.debug("[StorageService.patchConfig]",{ObjType:e,ver:o,url:a,appConfigVersionInValue:u,touchesConfigVersion:e==="IAppConfig"&&typeof u<"u"})}this.patchQueue$.next(c)}patchGlobal(e,i,n,o,a){this.ensureReady();let s=a??this.configFileVersion,l=this.serverEndpoint+i+"/kip/"+s,c;switch(o){case"add":c=[{op:"add",path:`/${e}`,value:n}];break;case"replace":c=[{op:"replace",path:`/${e}`,value:n}];break;case"remove":c=[{op:"remove",path:`/${e}`,value:n}];break;default:console.warn("[Storage Service] JSON Patch operation request type unknown");break}let u={url:l,document:c};if(this._logIO){let h=n?.app?.configVersion;console.debug("[StorageService.patchGlobal]",{scope:i,configName:e,operation:o,ver:s,url:l,appConfigVersionInValue:h})}this.patchQueue$.next(u)}removeItem(e,i,n){this.ensureReady();let o=this.serverEndpoint+e+"/kip/"+this.configFileVersion;n&&(o=this.serverEndpoint+e+"/kip/"+n);let a=[{op:"remove",path:`/${i}`}],s={url:o,document:a};this.patchQueue$.next(s)}clear(){this.ensureReady()}set activeConfigFileVersion(e){this.configFileVersion=e}bootstrapRemoteContext(e){if(!e?.sharedConfigName||e.configFileVersion==null||!e.initConfig)throw new Error("[StorageService] Invalid remote bootstrap context");this.sharedConfigName=e.sharedConfigName,this.configFileVersion=e.configFileVersion,this.InitConfig=tr(e.initConfig),this._isRemoteContextBootstrapped=!0,console.log(`[Storage Service] Bootstrap handoff applied (sharedConfig=${this.sharedConfigName}, fileVersion=${this.configFileVersion})`)}isRemoteContextBootstrapped(){return this._isRemoteContextBootstrapped}handleError(e){throw e.status===0?console.error("[Storage Service] An error occurred:",e.error):console.error("[Storage Service] Backend returned error: ",e.message),e}get initConfig(){return this.InitConfig}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var ye=class{static create(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}};var gt={disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!0,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}};var or={Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"};var Qo={configVersion:12,autoNightMode:!0,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",dataSets:[],unitDefaults:or,notificationConfig:gt,splitShellEnabled:!1,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.5},Yo={themeName:""};var ea={configVersion:12,kipUUID:ye.create(),signalKUrl:null,proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};var Br={configVersion:12,autoNightMode:!1,redNightMode:!1,nightModeBrightness:.27,isRemoteControl:!1,instanceName:"",splitShellEnabled:!0,splitShellSide:"left",splitShellSwipeDisabled:!1,splitShellWidth:.7,dataSets:[{uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",path:"self.environment.depth.belowTransducer",pathSource:"default",baseUnit:"m",timeScaleFormat:"minute",period:.2,label:"simple-chart-339698a7-2cff-4ab9-9b50-d8056f971471",editable:!1}],unitDefaults:{Unitless:"unitless",Speed:"knots",Flow:"l/h",Temperature:"celsius",Length:"m",Volume:"liter",Current:"A",Potential:"V",Charge:"C",Power:"W",Energy:"J",Pressure:"mmHg","Fuel Distance":"nm/l","Energy Distance":"nm/kWh",Density:"kg/m3",Time:"Hours","Angular Velocity":"deg/min",Angle:"deg",Frequency:"Hz",Ratio:"ratio",Resistance:"ohm"},notificationConfig:{disableNotifications:!1,menuGrouping:!0,security:{disableSecurity:!0},devices:{disableDevices:!1,showNormalState:!1,showNominalState:!1},sound:{disableSound:!1,muteNormal:!0,muteNominal:!0,muteWarn:!1,muteAlert:!1,muteAlarm:!1,muteEmergency:!1}}},Lr=[{id:"3e0825ee-95fd-4ad4-8802-e0507845b668",name:"Sailing",icon:"dashboard-sailing",configuration:[{w:6,h:8,id:"339698a7-2cff-4ab9-9b50-d8056f971471",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"339698a7-2cff-4ab9-9b50-d8056f971471",config:{displayName:"Depth",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.environment.depth.belowTransducer",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!1,showMin:!1,numDecimal:1,showMiniChart:!0,yScaleMin:0,yScaleMax:100,inverseYAxis:!1,verticalChart:!1,color:"blue",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:0},{w:10,h:20,id:"a44028e0-dfee-4492-895b-2b03a60f3a69",selector:"widget-host2",input:{widgetProperties:{type:"widget-wind-steer",uuid:"a44028e0-dfee-4492-895b-2b03a60f3a69",config:{filterSelfPaths:!0,paths:{headingPath:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindAngle:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},appWindSpeed:{description:"Apparent Wind Speed",path:"self.environment.wind.speedApparent",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},trueWindAngle:{description:"True Wind Angle",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},trueWindSpeed:{description:"True Wind Speed",path:"self.environment.wind.speedTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500},courseOverGround:{description:"True Course Over Ground",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500},nextWaypointBearing:{description:"Next Waypoint True Bearing",path:"self.navigation.course.calcValues.bearingTrue",source:"default",pathType:"number",isPathConfigurable:!1,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},set:{description:"True Drift Set",path:"self.environment.current.setTrue",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",convertUnitTo:"deg",showConvertUnitTo:!1,sampleTime:500},drift:{description:"Drift Speed Impact",path:"self.environment.current.drift",source:"default",pathType:"number",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"m/s",convertUnitTo:"knots",sampleTime:500}},windSectorEnable:!0,windSectorWindowSeconds:5,laylineEnable:!0,laylineAngle:40,waypointEnable:!0,courseOverGroundEnable:!0,driftEnable:!0,awsEnable:!0,twsEnable:!0,twaEnable:!0,sailSetupEnable:!1,enableTimeout:!1,dataTimeout:5}}},x:6,y:0},{w:8,h:12,id:"24406c15-7738-4dc1-a206-7a4862c2931d",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-radial",uuid:"24406c15-7738-4dc1-a206-7a4862c2931d",config:{displayName:"SOG",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.speedOverGround",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,convertUnitTo:"knots",sampleTime:500}},displayScale:{lower:0,upper:10,type:"linear"},gauge:{type:"ngRadial",subType:"measuring",enableTicks:!0,enableNeedle:!0,enableProgressbar:!0,highlightsWidth:5,scaleStart:180,barStartPosition:"left"},numInt:1,numDecimal:1,enableTimeout:!1,color:"yellow",dataTimeout:5,ignoreZones:!1}}},x:16,y:0},{w:6,h:8,id:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",selector:"widget-host2",input:{widgetProperties:{type:"widget-numeric",uuid:"c6bcaa53-afa1-42c7-ad92-d5f7dba14734",config:{displayName:"STW",filterSelfPaths:!0,paths:{numericPath:{description:"Numeric Data",path:"self.navigation.speedThroughWater",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"knots",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},showMax:!0,showMin:!0,numDecimal:1,showMiniChart:!1,yScaleMin:0,yScaleMax:10,inverseYAxis:!1,verticalChart:!1,color:"contrast",enableTimeout:!1,dataTimeout:5,ignoreZones:!1}}},x:0,y:8},{w:8,h:12,id:"973c8804-be09-4923-bb5d-48c13b65db69",selector:"widget-host2",input:{widgetProperties:{type:"widget-data-chart",uuid:"973c8804-be09-4923-bb5d-48c13b65db69",config:{displayName:"Chart Label",filterSelfPaths:!0,datachartPath:"self.environment.wind.speedApparent",datachartSource:"default",period:1,timeScale:"minute",convertUnitTo:"knots",timeScaleFormat:"minute",inverseYAxis:!1,datasetAverageArray:"sma",showAverageData:!0,trackAgainstAverage:!1,showDatasetMinimumValueLine:!1,showDatasetMaximumValueLine:!1,showDatasetAverageValueLine:!0,showDatasetAngleAverageValueLine:!1,showLabel:!1,showTimeScale:!0,startScaleAtZero:!1,verticalChart:!1,showYScale:!0,yScaleSuggestedMin:null,yScaleSuggestedMax:null,enableMinMaxScaleLimit:!1,yScaleMin:null,yScaleMax:null,numDecimal:1,color:"orange",invertData:!1,verticalGraph:!1}}},x:16,y:12},{x:0,y:16,w:6,h:8,minW:1,minH:1,id:"5289a84d-18fd-4ee7-9724-72249af403f2",selector:"widget-host2",input:{widgetProperties:{type:"widget-position",uuid:"5289a84d-18fd-4ee7-9724-72249af403f2",config:{displayName:"Position",filterSelfPaths:!0,paths:{longPath:{description:"Longitude",path:"self.navigation.position.longitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"longitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500},latPath:{description:"Latitude",path:"self.navigation.position.latitude",source:"default",pathType:"number",isPathConfigurable:!0,convertUnitTo:"latitudeMin",showPathSkUnitsFilter:!0,pathSkUnitsFilter:null,sampleTime:500}},color:"grey",enableTimeout:!1,dataTimeout:5}}}},{w:10,h:4,id:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",selector:"widget-host2",input:{widgetProperties:{type:"widget-simple-linear",uuid:"1a7a3f79-2eb4-4092-a0c3-9a61db8a8586",config:{displayName:"House Bank",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.electrical.batteries.1.voltage",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!0,pathSkUnitsFilter:"V",convertUnitTo:"V",sampleTime:500}},displayScale:{lower:0,upper:15,type:"linear"},gauge:{type:"simpleLinear",unitLabelFormat:"full"},numInt:1,numDecimal:2,ignoreZones:!1,color:"green",enableTimeout:!1,dataTimeout:5}}},x:6,y:20}],collapseSplitShell:!0},{id:"7c67c8c5-dc55-4e1d-9fc5-3dd95fd41bea",name:"Charting",icon:"dashboard-map",configuration:[{x:0,y:0,w:12,h:6,id:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",selector:"widget-host2",input:{widgetProperties:{type:"widget-gauge-ng-compass",uuid:"26a2a150-5af8-4f1d-aaab-0cb2a406fc17",config:{displayName:"COG (T)",filterSelfPaths:!0,paths:{gaugePath:{description:"Numeric Data",path:"self.navigation.courseOverGroundTrue",source:"default",pathType:"number",isPathConfigurable:!0,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,convertUnitTo:"deg",sampleTime:500}},gauge:{type:"ngRadial",subType:"marineCompass",enableTicks:!0,compassUseNumbers:!0,showValueBox:!1},enableTimeout:!1,color:"purple",dataTimeout:5}}}},{x:12,y:0,w:12,h:6,id:"caf9ca47-fcf6-4736-a314-2b5210edaf03",selector:"widget-host2",input:{widgetProperties:{type:"widget-datetime",uuid:"caf9ca47-fcf6-4736-a314-2b5210edaf03",config:{displayName:"Next WP Arrival",filterSelfPaths:!0,paths:{gaugePath:{description:"String Data",path:"self.navigation.datetime",source:"default",pathType:"Date",isPathConfigurable:!0,sampleTime:500}},dateFormat:"dd/MM HH:mm",dateTimezone:"America/Toronto",color:"contrast",enableTimeout:!1,dataTimeout:5}}}},{x:0,y:6,w:24,h:18,id:"daa21350-009e-4d99-8209-364f9b99caee",selector:"widget-host2",input:{widgetProperties:{type:"widget-autopilot",uuid:"daa21350-009e-4d99-8209-364f9b99caee",config:{filterSelfPaths:!0,paths:{autopilotState:{description:"Autopilot State",path:"self.steering.autopilot.state",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotMode:{description:"Autopilot Mode",path:"self.steering.autopilot.mode",source:"default",pathType:"string",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotEngaged:{description:"Autopilot Engaged",path:"self.steering.autopilot.engaged",source:"default",pathType:"boolean",isPathConfigurable:!1,showPathSkUnitsFilter:!1,convertUnitTo:"",sampleTime:500},autopilotV2Target:{description:"Autopilot API v2 Target",path:"self.steering.autopilot.target",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetHeading:{description:"Autopilot Target Magnetic Heading",path:"self.steering.autopilot.target.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},autopilotTargetWindHeading:{description:"Autopilot Target Apparent Wind Angle",path:"self.steering.autopilot.target.windAngleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},rudderAngle:{description:"Rudder Angle",path:"self.steering.rudderAngle",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",sampleTime:500},courseXte:{description:"Cross Track Error",path:"self.navigation.course.calcValues.crossTrackError",source:"default",pathType:"number",isPathConfigurable:!1,convertUnitTo:"m",showPathSkUnitsFilter:!0,pathRequired:!1,pathSkUnitsFilter:"m",sampleTime:500},headingMag:{description:"Magnetic Heading",path:"self.navigation.headingMagnetic",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},headingTrue:{description:"True Heading",path:"self.navigation.headingTrue",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleApparent:{description:"Apparent Wind Angle",path:"self.environment.wind.angleApparent",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500},windAngleTrueWater:{description:"Wind Angle True Water",path:"self.environment.wind.angleTrueWater",source:"default",pathType:"number",convertUnitTo:"deg",isPathConfigurable:!0,pathRequired:!1,showPathSkUnitsFilter:!1,pathSkUnitsFilter:"rad",showConvertUnitTo:!1,sampleTime:500}},autopilot:{invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,apiVersion:null,instanceId:null,pluginId:null,modes:null},enableTimeout:!1,dataTimeout:5,invertRudder:!0,headingDirectionTrue:!1,courseDirectionTrue:!1,autopilotInstance:"_default"}}}}]}],$r={themeName:""};var BC={configVersion:12,kipUUID:ye.create(),signalKUrl:"https://demo.signalk.org",proxyEnabled:!1,signalKSubscribeAll:!1,useDeviceToken:!1,loginName:null,loginPassword:null,useSharedConfig:!1,sharedConfigName:"default"};function bf(t,r){if(t&1){let e=ot();F(0,"div",1)(1,"button",2),L("click",function(){ke(e);let n=X();return Me(n.action())}),Q(2),R()()}if(t&2){let e=X();P(2),Tr(" ",e.data.action," ")}}var _f=["label"];function Cf(t,r){}var Sf=Math.pow(2,31)-1,we=class{_overlayRef;instance;containerInstance;_afterDismissed=new G;_afterOpened=new G;_onAction=new G;_durationTimeoutId;_dismissedByAction=!1;constructor(r,e){this._overlayRef=e,this.containerInstance=r,r._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(r){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(r,Sf))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},ar=new z("MatSnackBarData"),Je=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},xf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return t})(),wf=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return t})(),Af=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275dir=m({type:t,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return t})(),Tf=(()=>{class t{snackBarRef=f(we);data=f(ar);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(i,n){i&1&&(F(0,"div",0),Q(1),R(),Ce(2,bf,3,1,"div",1)),i&2&&(P(),Tr(" ",n.data.message,`
2
2
  `),P(),Se(n.hasAction?2:-1))},dependencies:[It,xf,wf,Af],styles:[`.mat-mdc-simple-snack-bar{display:flex}.mat-mdc-simple-snack-bar .mat-mdc-snack-bar-label{max-height:50vh;overflow:auto}
3
3
  `],encapsulation:2,changeDetection:0})}return t})(),Hr="_mat-snack-bar-enter",Wr="_mat-snack-bar-exit",Df=(()=>{class t extends Mi{_ngZone=f(mi);_elementRef=f(rt);_changeDetectorRef=f(Et);_platform=f(Si);_animationsDisabled=Mr();snackBarConfig=f(Je);_document=f(hi);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=f(Ve);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new G;_onExit=new G;_onEnter=new G;_animationState="void";_live;_label;_role;_liveElementId=f(Ai).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let i=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),i}attachTemplatePortal(e){this._assertNotAttached();let i=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),i}attachDomPortal=e=>{this._assertNotAttached();let i=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),i};onAnimationEnd(e){e===Wr?this._completeExit():e===Hr&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Hr)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Hr)},200)))}exit(){return this._destroyed?li(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?Vt(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Wr)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(Wr),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,i=this.snackBarConfig.panelClass;i&&(Array.isArray(i)?i.forEach(a=>e.classList.add(a)):e.classList.add(i)),this._exposeToModals();let n=this._label.nativeElement,o="mdc-snackbar__label";n.classList.toggle(o,!n.querySelector(`.${o}`))}_exposeToModals(){let e=this._liveElementId,i=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let n=0;n<i.length;n++){let o=i[n],a=o.getAttribute("aria-owns");this._trackedModals.add(o),a?a.indexOf(e)===-1&&o.setAttribute("aria-owns",a+" "+e):o.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let i=e.getAttribute("aria-owns");if(i){let n=i.replace(this._liveElementId,"").trim();n.length>0?e.setAttribute("aria-owns",n):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,i=e.querySelector("[aria-hidden]"),n=e.querySelector("[aria-live]");if(i&&n){let o=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&i.contains(document.activeElement)&&(o=document.activeElement),i.removeAttribute("aria-hidden"),n.appendChild(i),o?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=it({type:t,selectors:[["mat-snack-bar-container"]],viewQuery:function(i,n){if(i&1&&_i(Ir,7)(_f,7),i&2){let o;wr(o=Ar())&&(n._portalOutlet=o.first),wr(o=Ar())&&(n._label=o.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(i,n){i&1&&L("animationend",function(a){return n.onAnimationEnd(a.animationName)})("animationcancel",function(a){return n.onAnimationEnd(a.animationName)}),i&2&&at("mat-snack-bar-container-enter",n._animationState==="visible")("mat-snack-bar-container-exit",n._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!n._animationsDisabled)},features:[_],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(i,n){i&1&&(F(0,"div",1)(1,"div",2,0)(3,"div",3),vi(4,Cf,0,0,"ng-template",4),R(),bi(5,"div"),R()()),i&2&&(P(5),re("aria-live",n._live)("role",n._role)("id",n._liveElementId))},dependencies:[Ir],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
4
4
  `],encapsulation:2})}return t})(),kf=new z("mat-snack-bar-default-options",{providedIn:"root",factory:()=>new Je}),sr=(()=>{class t{_live=f(wi);_injector=f(Ve);_breakpointObserver=f(xi);_parentSnackBar=f(t,{optional:!0,skipSelf:!0});_defaultConfig=f(kf);_animationsDisabled=Mr();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Tf;snackBarContainerComponent=Df;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,i){return this._attach(e,i)}openFromTemplate(e,i){return this._attach(e,i)}open(e,i="",n){let o=C(C({},this._defaultConfig),n);return o.data={message:e,action:i},o.announcementMessage===e&&(o.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,o)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,i){let n=i&&i.viewContainerRef&&i.viewContainerRef.injector,o=Ve.create({parent:n||this._injector,providers:[{provide:Je,useValue:i}]}),a=new Er(this.snackBarContainerComponent,i.viewContainerRef,o),s=e.attach(a);return s.instance.snackBarConfig=i,s.instance}_attach(e,i){let n=C(C(C({},new Je),this._defaultConfig),i),o=this._createOverlay(n),a=this._attachSnackBarContainer(o,n),s=new we(a,o);if(e instanceof gi){let l=new ki(e,null,{$implicit:n.data,snackBarRef:s});s.instance=a.attachTemplatePortal(l)}else{let l=this._createInjector(n,s),c=new Er(e,void 0,l),u=a.attachComponentPortal(c);s.instance=u.instance}return this._breakpointObserver.observe(Ti.HandsetPortrait).pipe(fi(o.detachments())).subscribe(l=>{o.overlayElement.classList.toggle(this.handsetCssClass,l.matches)}),n.announcementMessage&&a._onAnnounce.subscribe(()=>{this._live.announce(n.announcementMessage,n.politeness)}),this._animateSnackBar(s,n),this._openedSnackBarRef=s,this._openedSnackBarRef}_animateSnackBar(e,i){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),i.announcementMessage&&this._live.clear()}),i.duration&&i.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(i.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let i=new Vi;i.direction=e.direction;let n=Ei(this._injector),o=e.direction==="rtl",a=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!o||e.horizontalPosition==="end"&&o,s=!a&&e.horizontalPosition!=="center";return a?n.left("0"):s?n.right("0"):n.centerHorizontally(),e.verticalPosition==="top"?n.top("0"):n.bottom("0"),i.positionStrategy=n,i.disableAnimations=this._animationsDisabled,Ii(this._injector,i)}_createInjector(e,i){let n=e&&e.viewContainerRef&&e.viewContainerRef.injector;return Ve.create({parent:n||this._injector,providers:[{provide:we,useValue:i},{provide:ar,useValue:e.data}]})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=x({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Mf="",Vf=11,Gr=12,ta=(()=>{class t{storage=f(Xo);snackBar=f(sr);server=f(Oe);unitDefaults=new v({});themeName=new v(Mf);kipKNotificationConfig=new v(gt);autoNightMode=new v(!1);redNightMode=new v(!1);nightModeBrightness=new v(1);isRemoteControl=new v(!1);instanceName=new v("");splitShellEnabled=new v(!1);splitShellSide=new v("left");splitShellSwipeDisabled=new v(!1);splitShellWidth=new v(.5);widgetHistoryDisabled=new v(!1);proxyEnabled=!1;signalKSubscribeAll=!1;useDeviceToken=!1;loginName;loginPassword;useSharedConfig;sharedConfigName;activeConfig={app:null,theme:null,dashboards:null};kipUUID;signalkUrl;widgets;_dashboards=[];dataSets=[];configUpgrade=J(!1);configVersion=void 0;constructor(){console.log("[AppSettings Service] Service startup..."),this.storage.activeConfigFileVersion=Vf,window.localStorage?(this.loadConnectionConfig(),this.startup()):console.error(`[AppSettings Service] LocalStorage NOT SUPPORTED by browser
@@ -1 +1 @@
1
- import{b as w}from"./chunk-VPF5756E.js";import{$b as f,Cb as u,Db as s,Eb as p,Ec as t,Fb as d,Ob as b,Qb as y,Re as x,Se as O,Va as i,ac as _,ae as h,cc as m,dc as M,ec as C,fb as g,fe as k,ub as v,wb as r,xb as l}from"./chunk-BTFZS2TW.js";function T(n,I){if(n&1&&(s(0,"p"),M(1),p()),n&2){let o=y();m(`large-icon-tile-label${o.compact()?" compact":""}`),i(),C(o.label())}}function D(n,I){n&1&&d(0,"div",3)}var R=(()=>{class n{svgIcon=t.required();iconSize=t.required();label=t.required();iconOnly=t(!1);compact=t(!1);active=t(!1);onKeyboardActivate(o){o instanceof KeyboardEvent,o.preventDefault(),o.currentTarget?.click()}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=g({type:n,selectors:[["tile-large-icon"]],inputs:{svgIcon:[1,"svgIcon"],iconSize:[1,"iconSize"],label:[1,"label"],iconOnly:[1,"iconOnly"],compact:[1,"compact"],active:[1,"active"]},decls:4,vars:13,consts:[["matRipple","","tabindex","0","role","button",3,"keydown.enter","keydown.space"],["aria-hidden","false",3,"svgIcon"],[3,"class"],[1,"active-accent-bar"]],template:function(a,e){a&1&&(s(0,"div",0),b("keydown.enter",function(c){return e.onKeyboardActivate(c)})("keydown.space",function(c){return e.onKeyboardActivate(c)}),d(1,"mat-icon",1),r(2,T,2,3,"p",2),r(3,D,1,0,"div",3),p()),a&2&&(m(`${e.compact()?"icon-container-compact":"icon-container"}`),_("active-container-accent",e.active()),v("aria-pressed",e.active())("aria-label",e.iconOnly()?e.label():null),i(),f("width",e.iconSize(),"px")("height",e.iconSize(),"px"),u("svgIcon",e.svgIcon()),i(),l(e.iconOnly()?-1:2),i(),l(e.active()?3:-1))},dependencies:[O,x,w,k,h],styles:["[_nghost-%COMP%]{display:block;width:100%}.icon-container[_ngcontent-%COMP%]{display:block;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0);padding:10px 5px 15px;border-radius:7px;background-color:var(--mat-sys-surface-container);border-color:.2s ease;border:2px solid transparent}.icon-container[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline-variant);cursor:pointer}.icon-container[_ngcontent-%COMP%]:focus-visible{background-color:var(--mat-sys-surface-container-high);outline:-webkit-focus-ring-color auto 0px}.icon-container-compact[_ngcontent-%COMP%]{display:block;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;padding:5px;border-radius:7px;border:1px solid var(--mat-sys-outline-variant)}.icon-container-compact[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-inverse-on-surface);border:1px solid var(--mat-sys-primary);cursor:pointer}.icon-container-compact[_ngcontent-%COMP%]:focus-visible{background-color:var(--mat-sys-surface-bright);outline:-webkit-focus-ring-color auto 0px}.large-icon-tile-label[_ngcontent-%COMP%]{color:var(--mat-sys-outline);font-size:1.1em;margin:0}.compact[_ngcontent-%COMP%]{font-size:12px;margin:0}.active-container-accent[_ngcontent-%COMP%]{border:1px solid var(--mat-sys-tertiary);pointer-events:none;background-color:var(--mat-sys-on-tertiary)}.active-container-accent[_ngcontent-%COMP%] .large-icon-tile-label[_ngcontent-%COMP%]{font-weight:700}.active-accent-bar[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;right:0;width:7px;background:var(--mat-sys-tertiary);box-shadow:0 0 10px 0 var(--mat-sys-tertiary)}"]})}return n})();export{R as a};
1
+ import{b as w}from"./chunk-MGLD6QDJ.js";import{$b as f,Cb as u,Db as s,Eb as p,Ec as t,Fb as d,Ob as b,Qb as y,Re as x,Se as O,Va as i,ac as _,ae as h,cc as m,dc as M,ec as C,fb as g,fe as k,ub as v,wb as r,xb as l}from"./chunk-PZ6I6W3H.js";function T(n,I){if(n&1&&(s(0,"p"),M(1),p()),n&2){let o=y();m(`large-icon-tile-label${o.compact()?" compact":""}`),i(),C(o.label())}}function D(n,I){n&1&&d(0,"div",3)}var R=(()=>{class n{svgIcon=t.required();iconSize=t.required();label=t.required();iconOnly=t(!1);compact=t(!1);active=t(!1);onKeyboardActivate(o){o instanceof KeyboardEvent,o.preventDefault(),o.currentTarget?.click()}static \u0275fac=function(a){return new(a||n)};static \u0275cmp=g({type:n,selectors:[["tile-large-icon"]],inputs:{svgIcon:[1,"svgIcon"],iconSize:[1,"iconSize"],label:[1,"label"],iconOnly:[1,"iconOnly"],compact:[1,"compact"],active:[1,"active"]},decls:4,vars:13,consts:[["matRipple","","tabindex","0","role","button",3,"keydown.enter","keydown.space"],["aria-hidden","false",3,"svgIcon"],[3,"class"],[1,"active-accent-bar"]],template:function(a,e){a&1&&(s(0,"div",0),b("keydown.enter",function(c){return e.onKeyboardActivate(c)})("keydown.space",function(c){return e.onKeyboardActivate(c)}),d(1,"mat-icon",1),r(2,T,2,3,"p",2),r(3,D,1,0,"div",3),p()),a&2&&(m(`${e.compact()?"icon-container-compact":"icon-container"}`),_("active-container-accent",e.active()),v("aria-pressed",e.active())("aria-label",e.iconOnly()?e.label():null),i(),f("width",e.iconSize(),"px")("height",e.iconSize(),"px"),u("svgIcon",e.svgIcon()),i(),l(e.iconOnly()?-1:2),i(),l(e.active()?3:-1))},dependencies:[O,x,w,k,h],styles:["[_nghost-%COMP%]{display:block;width:100%}.icon-container[_ngcontent-%COMP%]{display:block;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0);padding:10px 5px 15px;border-radius:7px;background-color:var(--mat-sys-surface-container);border-color:.2s ease;border:2px solid transparent}.icon-container[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline-variant);cursor:pointer}.icon-container[_ngcontent-%COMP%]:focus-visible{background-color:var(--mat-sys-surface-container-high);outline:-webkit-focus-ring-color auto 0px}.icon-container-compact[_ngcontent-%COMP%]{display:block;text-align:center;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;padding:5px;border-radius:7px;border:1px solid var(--mat-sys-outline-variant)}.icon-container-compact[_ngcontent-%COMP%]:hover{background-color:var(--mat-sys-inverse-on-surface);border:1px solid var(--mat-sys-primary);cursor:pointer}.icon-container-compact[_ngcontent-%COMP%]:focus-visible{background-color:var(--mat-sys-surface-bright);outline:-webkit-focus-ring-color auto 0px}.large-icon-tile-label[_ngcontent-%COMP%]{color:var(--mat-sys-outline);font-size:1.1em;margin:0}.compact[_ngcontent-%COMP%]{font-size:12px;margin:0}.active-container-accent[_ngcontent-%COMP%]{border:1px solid var(--mat-sys-tertiary);pointer-events:none;background-color:var(--mat-sys-on-tertiary)}.active-container-accent[_ngcontent-%COMP%] .large-icon-tile-label[_ngcontent-%COMP%]{font-weight:700}.active-accent-bar[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;right:0;width:7px;background:var(--mat-sys-tertiary);box-shadow:0 0 10px 0 var(--mat-sys-tertiary)}"]})}return n})();export{R as a};
@@ -1,4 +1,4 @@
1
- import{$b as w,Ca as A,Cb as O,Da as P,Db as o,Eb as d,Fa as he,Fb as Y,Ia as I,J as de,Jc as j,Jd as ke,K as D,Ka as k,Kd as Ce,La as ue,Lb as V,Mb as ee,Mc as W,Ob as te,Od as xe,P as ce,Q as le,Qb as v,R as L,Rb as b,Sb as c,Tb as re,Ub as T,Va as m,Vb as _,Wb as f,Wd as De,Xa as X,Xd as Me,Yd as y,Zc as be,_a as _e,_b as ge,ac as p,ba as q,cc as we,da as l,de as Se,ee as N,fb as h,gb as z,k as g,kb as S,la as R,lb as fe,ld as Q,md as ie,na as M,pa as n,pd as ye,rc as C,ua as U,ub as u,va as $,ve as Ee,wa as K,wb as E,we as x,xa as me,xb as B,xc as ve,xe as Be,ya as J,z as Z,za as pe,ze as ne}from"./chunk-BTFZS2TW.js";var H=["*"],Pe=["content"],Ie=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ze=["mat-drawer","mat-drawer-content","*"];function Oe(i,F){if(i&1){let e=ee();o(0,"div",1),te("click",function(){U(e);let r=v();return $(r._onBackdropClicked())}),d()}if(i&2){let e=v();p("mat-drawer-shown",e._isShowingBackdrop())}}function Ve(i,F){i&1&&(o(0,"mat-drawer-content"),c(1,2),d())}var je=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],We=["mat-sidenav","mat-sidenav-content","*"];function Qe(i,F){if(i&1){let e=ee();o(0,"div",1),te("click",function(){U(e);let r=v();return $(r._onBackdropClicked())}),d()}if(i&2){let e=v();p("mat-drawer-shown",e._isShowingBackdrop())}}function Ne(i,F){i&1&&(o(0,"mat-sidenav-content"),c(1,2),d())}var Ge=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
1
+ import{$b as w,Ca as A,Cb as O,Da as P,Db as o,Eb as d,Fa as he,Fb as Y,Ia as I,J as de,Jc as j,Jd as ke,K as D,Ka as k,Kd as Ce,La as ue,Lb as V,Mb as ee,Mc as W,Ob as te,Od as xe,P as ce,Q as le,Qb as v,R as L,Rb as b,Sb as c,Tb as re,Ub as T,Va as m,Vb as _,Wb as f,Wd as De,Xa as X,Xd as Me,Yd as y,Zc as be,_a as _e,_b as ge,ac as p,ba as q,cc as we,da as l,de as Se,ee as N,fb as h,gb as z,k as g,kb as S,la as R,lb as fe,ld as Q,md as ie,na as M,pa as n,pd as ye,rc as C,ua as U,ub as u,va as $,ve as Ee,wa as K,wb as E,we as x,xa as me,xb as B,xc as ve,xe as Be,ya as J,z as Z,za as pe,ze as ne}from"./chunk-PZ6I6W3H.js";var H=["*"],Pe=["content"],Ie=[[["mat-drawer"]],[["mat-drawer-content"]],"*"],ze=["mat-drawer","mat-drawer-content","*"];function Oe(i,F){if(i&1){let e=ee();o(0,"div",1),te("click",function(){U(e);let r=v();return $(r._onBackdropClicked())}),d()}if(i&2){let e=v();p("mat-drawer-shown",e._isShowingBackdrop())}}function Ve(i,F){i&1&&(o(0,"mat-drawer-content"),c(1,2),d())}var je=[[["mat-sidenav"]],[["mat-sidenav-content"]],"*"],We=["mat-sidenav","mat-sidenav-content","*"];function Qe(i,F){if(i&1){let e=ee();o(0,"div",1),te("click",function(){U(e);let r=v();return $(r._onBackdropClicked())}),d()}if(i&2){let e=v();p("mat-drawer-shown",e._isShowingBackdrop())}}function Ne(i,F){i&1&&(o(0,"mat-sidenav-content"),c(1,2),d())}var Ge=`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
2
2
  `;var He=new M("MAT_DRAWER_DEFAULT_AUTOSIZE",{providedIn:"root",factory:()=>!1}),se=new M("MAT_DRAWER_CONTAINER"),G=(()=>{class i extends x{_platform=n(Q);_changeDetectorRef=n(j);_container=n(oe);constructor(){let e=n(k),t=n(Ee),r=n(P);super(e,t,r)}ngAfterContentInit(){this._container._contentMarginChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})}_shouldBeHidden(){if(this._platform.isBrowser)return!1;let{start:e,end:t}=this._container;return e!=null&&e.mode!=="over"&&e.opened||t!=null&&t.mode!=="over"&&t.opened}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=h({type:i,selectors:[["mat-drawer-content"]],hostAttrs:[1,"mat-drawer-content"],hostVars:6,hostBindings:function(t,r){t&2&&(w("margin-left",r._container._contentMargins.left,"px")("margin-right",r._container._contentMargins.right,"px"),p("mat-drawer-content-hidden",r._shouldBeHidden()))},features:[C([{provide:x,useExisting:i}]),S],ngContentSelectors:H,decls:1,vars:0,template:function(t,r){t&1&&(b(),c(0))},encapsulation:2,changeDetection:0})}return i})(),ae=(()=>{class i{_elementRef=n(k);_focusTrapFactory=n(Ce);_focusMonitor=n(ye);_platform=n(Q);_ngZone=n(P);_renderer=n(_e);_interactivityChecker=n(ke);_doc=n(pe);_container=n(se,{optional:!0});_focusTrap=null;_elementFocusedBeforeDrawerWasOpened=null;_eventCleanups;_isAttached=!1;_anchor=null;get position(){return this._position}set position(e){e=e==="end"?"end":"start",e!==this._position&&(this._isAttached&&this._updatePositionInParent(e),this._position=e,this.onPositionChanged.emit())}_position="start";get mode(){return this._mode}set mode(e){this._mode=e,this._updateFocusTrapState(),this._modeChanged.next()}_mode="over";get disableClose(){return this._disableClose}set disableClose(e){this._disableClose=y(e)}_disableClose=!1;get autoFocus(){let e=this._autoFocus;return e??(this.mode==="side"?"dialog":"first-tabbable")}set autoFocus(e){(e==="true"||e==="false"||e==null)&&(e=y(e)),this._autoFocus=e}_autoFocus;get opened(){return this._opened()}set opened(e){this.toggle(y(e))}_opened=he(!1);_openedVia=null;_animationStarted=new g;_animationEnd=new g;openedChange=new A(!0);_openedStream=this.openedChange.pipe(D(e=>e),Z(()=>{}));openedStart=this._animationStarted.pipe(D(()=>this.opened),L(void 0));_closedStream=this.openedChange.pipe(D(e=>!e),Z(()=>{}));closedStart=this._animationStarted.pipe(D(()=>!this.opened),L(void 0));_destroyed=new g;onPositionChanged=new A;_content;_modeChanged=new g;_injector=n(J);_changeDetectorRef=n(j);constructor(){this.openedChange.pipe(l(this._destroyed)).subscribe(e=>{e?(this._elementFocusedBeforeDrawerWasOpened=this._doc.activeElement,this._takeFocus()):this._isFocusWithinDrawer()&&this._restoreFocus(this._openedVia||"program")}),this._eventCleanups=this._ngZone.runOutsideAngular(()=>{let e=this._renderer,t=this._elementRef.nativeElement;return[e.listen(t,"keydown",r=>{r.keyCode===27&&!this.disableClose&&!xe(r)&&this._ngZone.run(()=>{this.close(),r.stopPropagation(),r.preventDefault()})}),e.listen(t,"transitionrun",this._handleTransitionEvent),e.listen(t,"transitionend",this._handleTransitionEvent),e.listen(t,"transitioncancel",this._handleTransitionEvent)]}),this._animationEnd.subscribe(()=>{this.openedChange.emit(this.opened)})}_forceFocus(e,t){this._interactivityChecker.isFocusable(e)||(e.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let r=()=>{a(),s(),e.removeAttribute("tabindex")},a=this._renderer.listen(e,"blur",r),s=this._renderer.listen(e,"mousedown",r)})),e.focus(t)}_focusByCssSelector(e,t){let r=this._elementRef.nativeElement.querySelector(e);r&&this._forceFocus(r,t)}_takeFocus(){if(!this._focusTrap)return;let e=this._elementRef.nativeElement;switch(this.autoFocus){case!1:case"dialog":return;case!0:case"first-tabbable":X(()=>{!this._focusTrap.focusInitialElement()&&typeof e.focus=="function"&&e.focus()},{injector:this._injector});break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]');break;default:this._focusByCssSelector(this.autoFocus);break}}_restoreFocus(e){this.autoFocus!=="dialog"&&(this._elementFocusedBeforeDrawerWasOpened?this._focusMonitor.focusVia(this._elementFocusedBeforeDrawerWasOpened,e):this._elementRef.nativeElement.blur(),this._elementFocusedBeforeDrawerWasOpened=null)}_isFocusWithinDrawer(){let e=this._doc.activeElement;return!!e&&this._elementRef.nativeElement.contains(e)}ngAfterViewInit(){this._isAttached=!0,this._position==="end"&&this._updatePositionInParent("end"),this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._updateFocusTrapState())}ngOnDestroy(){this._eventCleanups.forEach(e=>e()),this._focusTrap?.destroy(),this._anchor?.remove(),this._anchor=null,this._animationStarted.complete(),this._animationEnd.complete(),this._modeChanged.complete(),this._destroyed.next(),this._destroyed.complete()}open(e){return this.toggle(!0,e)}close(){return this.toggle(!1)}_closeViaBackdropClick(){return this._setOpen(!1,!0,"mouse")}toggle(e=!this.opened,t){e&&t&&(this._openedVia=t);let r=this._setOpen(e,!e&&this._isFocusWithinDrawer(),this._openedVia||"program");return e||(this._openedVia=null),r}_setOpen(e,t,r){return e===this.opened?Promise.resolve(e?"open":"close"):(this._opened.set(e),this._container?._transitionsEnabled?this._setIsAnimating(!0):setTimeout(()=>{this._animationStarted.next(),this._animationEnd.next()}),this._elementRef.nativeElement.classList.toggle("mat-drawer-opened",e),!e&&t&&this._restoreFocus(r),this._changeDetectorRef.markForCheck(),this._updateFocusTrapState(),new Promise(a=>{this.openedChange.pipe(le(1)).subscribe(s=>a(s?"open":"close"))}))}_setIsAnimating(e){this._elementRef.nativeElement.classList.toggle("mat-drawer-animating",e)}_getWidth(){return this._elementRef.nativeElement.offsetWidth||0}_updateFocusTrapState(){this._focusTrap&&(this._focusTrap.enabled=this.opened&&!!this._container?._isShowingBackdrop())}_updatePositionInParent(e){if(!this._platform.isBrowser)return;let t=this._elementRef.nativeElement,r=t.parentNode;e==="end"?(this._anchor||(this._anchor=this._doc.createComment("mat-drawer-anchor"),r.insertBefore(this._anchor,t)),r.appendChild(t)):this._anchor&&this._anchor.parentNode.insertBefore(t,this._anchor)}_handleTransitionEvent=e=>{let t=this._elementRef.nativeElement;e.target===t&&this._ngZone.run(()=>{e.type==="transitionrun"?this._animationStarted.next(e):(e.type==="transitionend"&&this._setIsAnimating(!1),this._animationEnd.next(e))})};static \u0275fac=function(t){return new(t||i)};static \u0275cmp=h({type:i,selectors:[["mat-drawer"]],viewQuery:function(t,r){if(t&1&&T(Pe,5),t&2){let a;_(a=f())&&(r._content=a.first)}},hostAttrs:[1,"mat-drawer"],hostVars:12,hostBindings:function(t,r){t&2&&(u("align",null)("tabIndex",r.mode!=="side"?"-1":null),w("visibility",!r._container&&!r.opened?"hidden":null),p("mat-drawer-end",r.position==="end")("mat-drawer-over",r.mode==="over")("mat-drawer-push",r.mode==="push")("mat-drawer-side",r.mode==="side"))},inputs:{position:"position",mode:"mode",disableClose:"disableClose",autoFocus:"autoFocus",opened:"opened"},outputs:{openedChange:"openedChange",_openedStream:"opened",openedStart:"openedStart",_closedStream:"closed",closedStart:"closedStart",onPositionChanged:"positionChanged"},exportAs:["matDrawer"],ngContentSelectors:H,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(t,r){t&1&&(b(),o(0,"div",1,0),c(2),d())},dependencies:[x],encapsulation:2,changeDetection:0})}return i})(),oe=(()=>{class i{_dir=n(Se,{optional:!0});_element=n(k);_ngZone=n(P);_changeDetectorRef=n(j);_animationDisabled=Me();_transitionsEnabled=!1;_allDrawers;_drawers=new ue;_content;_userContent;get start(){return this._start}get end(){return this._end}get autosize(){return this._autosize}set autosize(e){this._autosize=y(e)}_autosize=n(He);get hasBackdrop(){return this._drawerHasBackdrop(this._start)||this._drawerHasBackdrop(this._end)}set hasBackdrop(e){this._backdropOverride=e==null?null:y(e)}_backdropOverride=null;backdropClick=new A;_start=null;_end=null;_left=null;_right=null;_destroyed=new g;_doCheckSubject=new g;_contentMargins={left:null,right:null};_contentMarginChanges=new g;get scrollable(){return this._userContent||this._content}_injector=n(J);constructor(){let e=n(Q),t=n(Be);this._dir?.change.pipe(l(this._destroyed)).subscribe(()=>{this._validateDrawers(),this.updateContentMargins()}),t.change().pipe(l(this._destroyed)).subscribe(()=>this.updateContentMargins()),!this._animationDisabled&&e.isBrowser&&this._ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._element.nativeElement.classList.add("mat-drawer-transition"),this._transitionsEnabled=!0},200)})}ngAfterContentInit(){this._allDrawers.changes.pipe(q(this._allDrawers),l(this._destroyed)).subscribe(e=>{this._drawers.reset(e.filter(t=>!t._container||t._container===this)),this._drawers.notifyOnChanges()}),this._drawers.changes.pipe(q(null)).subscribe(()=>{this._validateDrawers(),this._drawers.forEach(e=>{this._watchDrawerToggle(e),this._watchDrawerPosition(e),this._watchDrawerMode(e)}),(!this._drawers.length||this._isDrawerOpen(this._start)||this._isDrawerOpen(this._end))&&this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),this._ngZone.runOutsideAngular(()=>{this._doCheckSubject.pipe(ce(10),l(this._destroyed)).subscribe(()=>this.updateContentMargins())})}ngOnDestroy(){this._contentMarginChanges.complete(),this._doCheckSubject.complete(),this._drawers.destroy(),this._destroyed.next(),this._destroyed.complete()}open(){this._drawers.forEach(e=>e.open())}close(){this._drawers.forEach(e=>e.close())}updateContentMargins(){let e=0,t=0;if(this._left&&this._left.opened){if(this._left.mode=="side")e+=this._left._getWidth();else if(this._left.mode=="push"){let r=this._left._getWidth();e+=r,t-=r}}if(this._right&&this._right.opened){if(this._right.mode=="side")t+=this._right._getWidth();else if(this._right.mode=="push"){let r=this._right._getWidth();t+=r,e-=r}}e=e||null,t=t||null,(e!==this._contentMargins.left||t!==this._contentMargins.right)&&(this._contentMargins={left:e,right:t},this._ngZone.run(()=>this._contentMarginChanges.next(this._contentMargins)))}ngDoCheck(){this._autosize&&this._isPushed()&&this._ngZone.runOutsideAngular(()=>this._doCheckSubject.next())}_watchDrawerToggle(e){e._animationStarted.pipe(l(this._drawers.changes)).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()}),e.mode!=="side"&&e.openedChange.pipe(l(this._drawers.changes)).subscribe(()=>this._setContainerClass(e.opened))}_watchDrawerPosition(e){e.onPositionChanged.pipe(l(this._drawers.changes)).subscribe(()=>{X({read:()=>this._validateDrawers()},{injector:this._injector})})}_watchDrawerMode(e){e._modeChanged.pipe(l(de(this._drawers.changes,this._destroyed))).subscribe(()=>{this.updateContentMargins(),this._changeDetectorRef.markForCheck()})}_setContainerClass(e){let t=this._element.nativeElement.classList,r="mat-drawer-container-has-open";e?t.add(r):t.remove(r)}_validateDrawers(){this._start=this._end=null,this._drawers.forEach(e=>{e.position=="end"?(this._end!=null,this._end=e):(this._start!=null,this._start=e)}),this._right=this._left=null,this._dir&&this._dir.value==="rtl"?(this._left=this._end,this._right=this._start):(this._left=this._start,this._right=this._end)}_isPushed(){return this._isDrawerOpen(this._start)&&this._start.mode!="over"||this._isDrawerOpen(this._end)&&this._end.mode!="over"}_onBackdropClicked(){this.backdropClick.emit(),this._closeModalDrawersViaBackdrop()}_closeModalDrawersViaBackdrop(){[this._start,this._end].filter(e=>e&&!e.disableClose&&this._drawerHasBackdrop(e)).forEach(e=>e._closeViaBackdropClick())}_isShowingBackdrop(){return this._isDrawerOpen(this._start)&&this._drawerHasBackdrop(this._start)||this._isDrawerOpen(this._end)&&this._drawerHasBackdrop(this._end)}_isDrawerOpen(e){return e!=null&&e.opened}_drawerHasBackdrop(e){return this._backdropOverride==null?!!e&&e.mode!=="side":this._backdropOverride}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=h({type:i,selectors:[["mat-drawer-container"]],contentQueries:function(t,r,a){if(t&1&&re(a,G,5)(a,ae,5),t&2){let s;_(s=f())&&(r._content=s.first),_(s=f())&&(r._allDrawers=s)}},viewQuery:function(t,r){if(t&1&&T(G,5),t&2){let a;_(a=f())&&(r._userContent=a.first)}},hostAttrs:[1,"mat-drawer-container"],hostVars:2,hostBindings:function(t,r){t&2&&p("mat-drawer-container-explicit-backdrop",r._backdropOverride)},inputs:{autosize:"autosize",hasBackdrop:"hasBackdrop"},outputs:{backdropClick:"backdropClick"},exportAs:["matDrawerContainer"],features:[C([{provide:se,useExisting:i}])],ngContentSelectors:ze,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(t,r){t&1&&(b(Ie),E(0,Oe,1,2,"div",0),c(1),c(2,1),E(3,Ve,2,0,"mat-drawer-content")),t&2&&(B(r.hasBackdrop?0:-1),m(3),B(r._content?-1:3))},dependencies:[G],styles:[`.mat-drawer-container{position:relative;z-index:1;color:var(--mat-sidenav-content-text-color, var(--mat-sys-on-background));background-color:var(--mat-sidenav-content-background-color, var(--mat-sys-background));box-sizing:border-box;display:block;overflow:hidden}.mat-drawer-container[fullscreen]{top:0;left:0;right:0;bottom:0;position:absolute}.mat-drawer-container[fullscreen].mat-drawer-container-has-open{overflow:hidden}.mat-drawer-container.mat-drawer-container-explicit-backdrop .mat-drawer-side{z-index:3}.mat-drawer-container.ng-animate-disabled .mat-drawer-backdrop,.mat-drawer-container.ng-animate-disabled .mat-drawer-content,.ng-animate-disabled .mat-drawer-container .mat-drawer-backdrop,.ng-animate-disabled .mat-drawer-container .mat-drawer-content{transition:none}.mat-drawer-backdrop{top:0;left:0;right:0;bottom:0;position:absolute;display:block;z-index:3;visibility:hidden}.mat-drawer-backdrop.mat-drawer-shown{visibility:visible;background-color:var(--mat-sidenav-scrim-color, color-mix(in srgb, var(--mat-sys-neutral-variant20) 40%, transparent))}.mat-drawer-transition .mat-drawer-backdrop{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:background-color,visibility}@media(forced-colors: active){.mat-drawer-backdrop{opacity:.5}}.mat-drawer-content{position:relative;z-index:1;display:block;height:100%;overflow:auto}.mat-drawer-content.mat-drawer-content-hidden{opacity:0}.mat-drawer-transition .mat-drawer-content{transition-duration:400ms;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1);transition-property:transform,margin-left,margin-right}.mat-drawer{position:relative;z-index:4;color:var(--mat-sidenav-container-text-color, var(--mat-sys-on-surface-variant));box-shadow:var(--mat-sidenav-container-elevation-shadow, none);background-color:var(--mat-sidenav-container-background-color, var(--mat-sys-surface));border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));width:var(--mat-sidenav-container-width, 360px);display:block;position:absolute;top:0;bottom:0;z-index:3;outline:0;box-sizing:border-box;overflow-y:auto;transform:translate3d(-100%, 0, 0)}@media(forced-colors: active){.mat-drawer,[dir=rtl] .mat-drawer.mat-drawer-end{border-right:solid 1px currentColor}}@media(forced-colors: active){[dir=rtl] .mat-drawer,.mat-drawer.mat-drawer-end{border-left:solid 1px currentColor;border-right:none}}.mat-drawer.mat-drawer-side{z-index:2}.mat-drawer.mat-drawer-end{right:0;transform:translate3d(100%, 0, 0);border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0}[dir=rtl] .mat-drawer{border-top-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-left-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-right-radius:0;border-bottom-right-radius:0;transform:translate3d(100%, 0, 0)}[dir=rtl] .mat-drawer.mat-drawer-end{border-top-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large));border-top-left-radius:0;border-bottom-left-radius:0;left:0;right:auto;transform:translate3d(-100%, 0, 0)}.mat-drawer-transition .mat-drawer{transition:transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating){visibility:hidden;box-shadow:none}.mat-drawer:not(.mat-drawer-opened):not(.mat-drawer-animating) .mat-drawer-inner-container{display:none}.mat-drawer.mat-drawer-opened.mat-drawer-opened{transform:none}.mat-drawer-side{box-shadow:none;border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid}.mat-drawer-side.mat-drawer-end{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side{border-left-color:var(--mat-sidenav-container-divider-color, transparent);border-left-width:1px;border-left-style:solid;border-right:none}[dir=rtl] .mat-drawer-side.mat-drawer-end{border-right-color:var(--mat-sidenav-container-divider-color, transparent);border-right-width:1px;border-right-style:solid;border-left:none}.mat-drawer-inner-container{width:100%;height:100%;overflow:auto}.mat-sidenav-fixed{position:fixed}
3
3
  `],encapsulation:2,changeDetection:0})}return i})(),Te=(()=>{class i extends G{static \u0275fac=(()=>{let e;return function(r){return(e||(e=I(i)))(r||i)}})();static \u0275cmp=h({type:i,selectors:[["mat-sidenav-content"]],hostAttrs:[1,"mat-drawer-content","mat-sidenav-content"],features:[C([{provide:x,useExisting:i}]),S],ngContentSelectors:H,decls:1,vars:0,template:function(t,r){t&1&&(b(),c(0))},encapsulation:2,changeDetection:0})}return i})(),Ze=(()=>{class i extends ae{get fixedInViewport(){return this._fixedInViewport}set fixedInViewport(e){this._fixedInViewport=y(e)}_fixedInViewport=!1;get fixedTopGap(){return this._fixedTopGap}set fixedTopGap(e){this._fixedTopGap=ie(e)}_fixedTopGap=0;get fixedBottomGap(){return this._fixedBottomGap}set fixedBottomGap(e){this._fixedBottomGap=ie(e)}_fixedBottomGap=0;static \u0275fac=(()=>{let e;return function(r){return(e||(e=I(i)))(r||i)}})();static \u0275cmp=h({type:i,selectors:[["mat-sidenav"]],hostAttrs:[1,"mat-drawer","mat-sidenav"],hostVars:16,hostBindings:function(t,r){t&2&&(u("tabIndex",r.mode!=="side"?"-1":null)("align",null),w("top",r.fixedInViewport?r.fixedTopGap:null,"px")("bottom",r.fixedInViewport?r.fixedBottomGap:null,"px"),p("mat-drawer-end",r.position==="end")("mat-drawer-over",r.mode==="over")("mat-drawer-push",r.mode==="push")("mat-drawer-side",r.mode==="side")("mat-sidenav-fixed",r.fixedInViewport))},inputs:{fixedInViewport:"fixedInViewport",fixedTopGap:"fixedTopGap",fixedBottomGap:"fixedBottomGap"},exportAs:["matSidenav"],features:[C([{provide:ae,useExisting:i}]),S],ngContentSelectors:H,decls:3,vars:0,consts:[["content",""],["cdkScrollable","",1,"mat-drawer-inner-container"]],template:function(t,r){t&1&&(b(),o(0,"div",1,0),c(2),d())},dependencies:[x],encapsulation:2,changeDetection:0})}return i})(),_t=(()=>{class i extends oe{_allDrawers=void 0;_content=void 0;static \u0275fac=(()=>{let e;return function(r){return(e||(e=I(i)))(r||i)}})();static \u0275cmp=h({type:i,selectors:[["mat-sidenav-container"]],contentQueries:function(t,r,a){if(t&1&&re(a,Te,5)(a,Ze,5),t&2){let s;_(s=f())&&(r._content=s.first),_(s=f())&&(r._allDrawers=s)}},hostAttrs:[1,"mat-drawer-container","mat-sidenav-container"],hostVars:2,hostBindings:function(t,r){t&2&&p("mat-drawer-container-explicit-backdrop",r._backdropOverride)},exportAs:["matSidenavContainer"],features:[C([{provide:se,useExisting:i},{provide:oe,useExisting:i}]),S],ngContentSelectors:We,decls:4,vars:2,consts:[[1,"mat-drawer-backdrop",3,"mat-drawer-shown"],[1,"mat-drawer-backdrop",3,"click"]],template:function(t,r){t&1&&(b(je),E(0,Qe,1,2,"div",0),c(1),c(2,1),E(3,Ne,2,0,"mat-sidenav-content")),t&2&&(B(r.hasBackdrop?0:-1),m(3),B(r._content?-1:3))},dependencies:[Te],styles:[Ge],encapsulation:2,changeDetection:0})}return i})(),ft=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=z({type:i});static \u0275inj=R({imports:[ne,N,ne]})}return i})();var Le=["determinateSpinner"];function qe(i,F){if(i&1&&(K(),o(0,"svg",11),Y(1,"circle",12),d()),i&2){let e=v();u("viewBox",e._viewBox()),m(),w("stroke-dasharray",e._strokeCircumference(),"px")("stroke-dashoffset",e._strokeCircumference()/2,"px")("stroke-width",e._circleStrokeWidth(),"%"),u("r",e._circleRadius())}}var Ue=new M("mat-progress-spinner-default-options",{providedIn:"root",factory:()=>({diameter:Fe})}),Fe=100,$e=10,Et=(()=>{class i{_elementRef=n(k);_noopAnimations;get color(){return this._color||this._defaultColor}set color(e){this._color=e}_color;_defaultColor="primary";_determinateCircle;constructor(){let e=n(Ue),t=De(),r=this._elementRef.nativeElement;this._noopAnimations=t==="di-disabled"&&!!e&&!e._forceAnimations,this.mode=r.nodeName.toLowerCase()==="mat-spinner"?"indeterminate":"determinate",!this._noopAnimations&&t==="reduced-motion"&&r.classList.add("mat-progress-spinner-reduced-motion"),e&&(e.color&&(this.color=this._defaultColor=e.color),e.diameter&&(this.diameter=e.diameter),e.strokeWidth&&(this.strokeWidth=e.strokeWidth))}mode;get value(){return this.mode==="determinate"?this._value:0}set value(e){this._value=Math.max(0,Math.min(100,e||0))}_value=0;get diameter(){return this._diameter}set diameter(e){this._diameter=e||0}_diameter=Fe;get strokeWidth(){return this._strokeWidth??this.diameter/10}set strokeWidth(e){this._strokeWidth=e||0}_strokeWidth;_circleRadius(){return(this.diameter-$e)/2}_viewBox(){let e=this._circleRadius()*2+this.strokeWidth;return`0 0 ${e} ${e}`}_strokeCircumference(){return 2*Math.PI*this._circleRadius()}_strokeDashOffset(){return this.mode==="determinate"?this._strokeCircumference()*(100-this._value)/100:null}_circleStrokeWidth(){return this.strokeWidth/this.diameter*100}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=h({type:i,selectors:[["mat-progress-spinner"],["mat-spinner"]],viewQuery:function(t,r){if(t&1&&T(Le,5),t&2){let a;_(a=f())&&(r._determinateCircle=a.first)}},hostAttrs:["role","progressbar","tabindex","-1",1,"mat-mdc-progress-spinner","mdc-circular-progress"],hostVars:18,hostBindings:function(t,r){t&2&&(u("aria-valuemin",0)("aria-valuemax",100)("aria-valuenow",r.mode==="determinate"?r.value:null)("mode",r.mode),we("mat-"+r.color),w("width",r.diameter,"px")("height",r.diameter,"px")("--mat-progress-spinner-size",r.diameter+"px")("--mat-progress-spinner-active-indicator-width",r.diameter+"px"),p("_mat-animation-noopable",r._noopAnimations)("mdc-circular-progress--indeterminate",r.mode==="indeterminate"))},inputs:{color:"color",mode:"mode",value:[2,"value","value",W],diameter:[2,"diameter","diameter",W],strokeWidth:[2,"strokeWidth","strokeWidth",W]},exportAs:["matProgressSpinner"],decls:14,vars:11,consts:[["circle",""],["determinateSpinner",""],["aria-hidden","true",1,"mdc-circular-progress__determinate-container"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__determinate-circle-graphic"],["cx","50%","cy","50%",1,"mdc-circular-progress__determinate-circle"],["aria-hidden","true",1,"mdc-circular-progress__indeterminate-container"],[1,"mdc-circular-progress__spinner-layer"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-left"],[3,"ngTemplateOutlet"],[1,"mdc-circular-progress__gap-patch"],[1,"mdc-circular-progress__circle-clipper","mdc-circular-progress__circle-right"],["xmlns","http://www.w3.org/2000/svg","focusable","false",1,"mdc-circular-progress__indeterminate-circle-graphic"],["cx","50%","cy","50%"]],template:function(t,r){if(t&1&&(fe(0,qe,2,8,"ng-template",null,0,ve),o(2,"div",2,1),K(),o(4,"svg",3),Y(5,"circle",4),d()(),me(),o(6,"div",5)(7,"div",6)(8,"div",7),V(9,8),d(),o(10,"div",9),V(11,8),d(),o(12,"div",10),V(13,8),d()()()),t&2){let a=ge(1);m(4),u("viewBox",r._viewBox()),m(),w("stroke-dasharray",r._strokeCircumference(),"px")("stroke-dashoffset",r._strokeDashOffset(),"px")("stroke-width",r._circleStrokeWidth(),"%"),u("r",r._circleRadius()),m(4),O("ngTemplateOutlet",a),m(2),O("ngTemplateOutlet",a),m(2),O("ngTemplateOutlet",a)}},dependencies:[be],styles:[`.mat-mdc-progress-spinner{--mat-progress-spinner-animation-multiplier: 1;display:block;overflow:hidden;line-height:0;position:relative;direction:ltr;transition:opacity 250ms cubic-bezier(0.4, 0, 0.6, 1)}.mat-mdc-progress-spinner circle{stroke-width:var(--mat-progress-spinner-active-indicator-width, 4px)}.mat-mdc-progress-spinner._mat-animation-noopable,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__determinate-circle{transition:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__spinner-layer,.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container{animation:none !important}.mat-mdc-progress-spinner._mat-animation-noopable .mdc-circular-progress__indeterminate-container circle{stroke-dasharray:0 !important}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic,.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle{stroke:currentColor;stroke:CanvasText}}.mat-progress-spinner-reduced-motion{--mat-progress-spinner-animation-multiplier: 1.25}.mdc-circular-progress__determinate-container,.mdc-circular-progress__indeterminate-circle-graphic,.mdc-circular-progress__indeterminate-container,.mdc-circular-progress__spinner-layer{position:absolute;width:100%;height:100%}.mdc-circular-progress__determinate-container{transform:rotate(-90deg)}.mdc-circular-progress--indeterminate .mdc-circular-progress__determinate-container{opacity:0}.mdc-circular-progress__indeterminate-container{font-size:0;letter-spacing:0;white-space:nowrap;opacity:0}.mdc-circular-progress--indeterminate .mdc-circular-progress__indeterminate-container{opacity:1;animation:mdc-circular-progress-container-rotate calc(1568.2352941176ms*var(--mat-progress-spinner-animation-multiplier)) linear infinite}.mdc-circular-progress__determinate-circle-graphic,.mdc-circular-progress__indeterminate-circle-graphic{fill:rgba(0,0,0,0)}.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:var(--mat-progress-spinner-active-indicator-color, var(--mat-sys-primary))}@media(forced-colors: active){.mat-mdc-progress-spinner .mdc-circular-progress__determinate-circle,.mat-mdc-progress-spinner .mdc-circular-progress__indeterminate-circle-graphic{stroke:CanvasText}}.mdc-circular-progress__determinate-circle{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1)}.mdc-circular-progress__gap-patch{position:absolute;top:0;left:47.5%;box-sizing:border-box;width:5%;height:100%;overflow:hidden}.mdc-circular-progress__gap-patch .mdc-circular-progress__indeterminate-circle-graphic{left:-900%;width:2000%;transform:rotate(180deg)}.mdc-circular-progress__circle-clipper .mdc-circular-progress__indeterminate-circle-graphic{width:200%}.mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{left:-100%}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-left .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-left-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress--indeterminate .mdc-circular-progress__circle-right .mdc-circular-progress__indeterminate-circle-graphic{animation:mdc-circular-progress-right-spin calc(1333ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}.mdc-circular-progress__circle-clipper{display:inline-flex;position:relative;width:50%;height:100%;overflow:hidden}.mdc-circular-progress--indeterminate .mdc-circular-progress__spinner-layer{animation:mdc-circular-progress-spinner-layer-rotate calc(5332ms*var(--mat-progress-spinner-animation-multiplier)) cubic-bezier(0.4, 0, 0.2, 1) infinite both}@keyframes mdc-circular-progress-container-rotate{to{transform:rotate(360deg)}}@keyframes mdc-circular-progress-spinner-layer-rotate{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes mdc-circular-progress-left-spin{from{transform:rotate(265deg)}50%{transform:rotate(130deg)}to{transform:rotate(265deg)}}@keyframes mdc-circular-progress-right-spin{from{transform:rotate(-265deg)}50%{transform:rotate(-130deg)}to{transform:rotate(-265deg)}}
4
4
  `],encapsulation:2,changeDetection:0})}return i})();var Bt=(()=>{class i{static \u0275fac=function(t){return new(t||i)};static \u0275mod=z({type:i});static \u0275inj=R({imports:[N]})}return i})();export{Te as a,Ze as b,_t as c,ft as d,Et as e,Bt as f};