@signalk/freeboard-sk 2.24.2 → 3.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +16 -0
  2. package/docs/screenshots/2_freeboard-sk.jpg +0 -0
  3. package/docs/screenshots/3_freeboard-sk.jpg +0 -0
  4. package/package.json +13 -8
  5. package/public/3rdpartylicenses.txt +70 -19
  6. package/public/assets/img/no-such-symbol.svg +4 -0
  7. package/public/chunk-2GXI757Z.js +1 -0
  8. package/public/chunk-7OJ7YZPE.js +1010 -0
  9. package/public/chunk-A626ZBXE.js +3871 -0
  10. package/public/chunk-CSNMIJA3.js +1612 -0
  11. package/public/chunk-EU3YXT24.js +929 -0
  12. package/public/chunk-ILSUTX3X.js +1 -0
  13. package/public/chunk-JJ245XTQ.js +1 -0
  14. package/public/chunk-NM5IDVR6.js +107 -0
  15. package/public/chunk-NMXQ543J.js +1 -0
  16. package/public/chunk-P5D5HOAL.js +1709 -0
  17. package/public/{chunk-LXUTMJYP.js → chunk-QNWLXTD7.js} +1 -1
  18. package/public/chunk-RS6VYSOP.js +1 -0
  19. package/public/chunk-VUZVHRKQ.js +1 -0
  20. package/public/chunk-WPZCQDE4.js +1 -0
  21. package/public/chunk-WRR2LL5R.js +1 -0
  22. package/public/chunk-WWDDTAFW.js +2 -0
  23. package/public/chunk-XP3I253N.js +1 -0
  24. package/public/index.html +1 -1
  25. package/public/main-IKMWD43W.js +466 -0
  26. package/public/worker-5T47RUMR.js +3 -0
  27. package/public/chunk-2AF4T5IB.js +0 -1
  28. package/public/chunk-3GHIRJ3C.js +0 -2
  29. package/public/chunk-A4TULHTL.js +0 -1
  30. package/public/chunk-AFVK3UQJ.js +0 -5482
  31. package/public/chunk-AX3UMUXB.js +0 -1
  32. package/public/chunk-EFVTFEXB.js +0 -1
  33. package/public/chunk-FALIRPMH.js +0 -1035
  34. package/public/chunk-G4GM24WE.js +0 -1
  35. package/public/chunk-NTIQMWPW.js +0 -2718
  36. package/public/chunk-QIOZNURQ.js +0 -1
  37. package/public/chunk-SBFXQ3G7.js +0 -1
  38. package/public/main-AZEF35BN.js +0 -466
  39. package/public/worker-AUTVLQL7.js +0 -3
@@ -0,0 +1 @@
1
+ import{wa as z}from"./chunk-A626ZBXE.js";import"./chunk-CSNMIJA3.js";import"./chunk-QNWLXTD7.js";import"./chunk-EU3YXT24.js";import"./chunk-NM5IDVR6.js";import"./chunk-7OJ7YZPE.js";import{$a as x,Ad as S,Bd as R,Ca as m,Cd as E,Da as d,Dd as O,Ia as _,Ja as a,Ka as o,La as v,Ld as T,Nd as A,O as f,P as u,Qd as k,Sa as D,Sd as j,Td as V,Ua as p,Wa as g,_a as b,ab as y,fa as h,ha as s,hc as I,jb as r,kb as M,ma as c,pa as P,xd as C,yd as w}from"./chunk-P5D5HOAL.js";import"./chunk-EQVTEUXC.js";var U=["frame"];function Q(n,e){if(n&1&&(a(0,"mat-dialog-content",3),v(1,"iframe",6,0),o()),n&2){let t=g();s(),_("src",t.url,h)("title",t.data.panel.title)}}function B(n,e){n&1&&(a(0,"mat-dialog-content",4),r(1," This widget has no settings. "),o())}function F(n,e){if(n&1){let t=D();a(0,"mat-dialog-actions",5)(1,"button",7),p("click",function(){f(t);let l=g();return u(l.removeWidget())}),a(2,"mat-icon"),r(3,"delete"),o(),r(4," Remove widget "),o()()}}var W=class n{constructor(e,t,i,l){this.dialogRef=e;this.data=t;this.service=i;this.sanitizer=l}frame;url;detach=null;ngOnInit(){let e=this.data.panel;e&&(this.url=this.sanitizer.bypassSecurityTrustResourceUrl(e.url?this.service.resolveAssetUrl(e.url):"about:blank"))}ngAfterViewInit(){let e=this.data.panel;!e||!this.frame||(this.detach=this.service.attachPanel(this.frame.nativeElement,{extension:this.data.extension,panel:e,targetInstance:this.data.targetInstance,targetWidget:this.data.targetWidget,close:()=>this.dialogRef.close()}))}removeWidget(){this.data.targetInstance&&this.service.removeWidget(this.data.targetInstance),this.dialogRef.close()}ngOnDestroy(){this.detach?.(),this.detach=null}static \u0275fac=function(t){return new(t||n)(c(C),c(w),c(z),c(I))};static \u0275cmp=P({type:n,selectors:[["fb-plotterext-panel-dialog"]],viewQuery:function(t,i){if(t&1&&b(U,5),t&2){let l;x(l=y())&&(i.frame=l.first)}},decls:9,vars:3,consts:[["frame",""],["mat-dialog-title","",1,"pe-panel-header"],["mat-icon-button","","aria-label","Close",3,"click"],[1,"pe-panel-content"],[1,"pe-panel-noconfig"],[1,"pe-panel-actions"],["sandbox","allow-scripts allow-same-origin allow-forms",3,"src","title"],["mat-button","",1,"pe-remove",3,"click"]],template:function(t,i){t&1&&(a(0,"div",1)(1,"span"),r(2),o(),a(3,"button",2),p("click",function(){return i.dialogRef.close()}),a(4,"mat-icon"),r(5,"close"),o()()(),m(6,Q,3,2,"mat-dialog-content",3)(7,B,2,0,"mat-dialog-content",4),m(8,F,5,0,"mat-dialog-actions",5)),t&2&&(s(2),M(i.data.panel?i.data.panel.title:i.data.title),s(4),d(i.data.panel?6:7),s(2),d(i.data.targetInstance?8:-1))},dependencies:[O,S,E,R,k,A,T,V,j],styles:[".pe-panel-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding-right:8px}.pe-panel-content[_ngcontent-%COMP%]{padding:0;height:60vh}.pe-panel-noconfig[_ngcontent-%COMP%]{padding:16px 24px;color:#0009}iframe[_ngcontent-%COMP%]{display:block;width:100%;height:100%;border:none}.pe-panel-actions[_ngcontent-%COMP%]{justify-content:flex-start}.pe-remove[_ngcontent-%COMP%]{color:#d32f2f}"]})};export{W as PlotterPanelDialog};
@@ -0,0 +1 @@
1
+ import{Da as a}from"./chunk-A626ZBXE.js";import"./chunk-CSNMIJA3.js";import"./chunk-QNWLXTD7.js";import"./chunk-EU3YXT24.js";import"./chunk-NM5IDVR6.js";import"./chunk-7OJ7YZPE.js";import"./chunk-P5D5HOAL.js";import"./chunk-EQVTEUXC.js";export{a as GeoJSONImportDialog};
@@ -0,0 +1,107 @@
1
+ import{J as r,K as d,c as a,gb as m,pa as l,pd as p,qa as h,sc as u}from"./chunk-P5D5HOAL.js";var c=class{_multiple;_emitChanges;compareWith;_selection=new Set;_deselectedToEmit=[];_selectedToEmit=[];_selected=null;get selected(){return this._selected||(this._selected=Array.from(this._selection.values())),this._selected}changed=new a;constructor(e=!1,t,o=!0,i){this._multiple=e,this._emitChanges=o,this.compareWith=i,t&&t.length&&(e?t.forEach(s=>this._markSelected(s)):this._markSelected(t[0]),this._selectedToEmit.length=0)}select(...e){this._verifyValueAssignment(e),e.forEach(o=>this._markSelected(o));let t=this._hasQueuedChanges();return this._emitChangeEvent(),t}deselect(...e){this._verifyValueAssignment(e),e.forEach(o=>this._unmarkSelected(o));let t=this._hasQueuedChanges();return this._emitChangeEvent(),t}setSelection(...e){this._verifyValueAssignment(e);let t=this.selected,o=new Set(e.map(s=>this._getConcreteValue(s)));e.forEach(s=>this._markSelected(s)),t.filter(s=>!o.has(this._getConcreteValue(s,o))).forEach(s=>this._unmarkSelected(s));let i=this._hasQueuedChanges();return this._emitChangeEvent(),i}toggle(e){return this.isSelected(e)?this.deselect(e):this.select(e)}clear(e=!0){this._unmarkAll();let t=this._hasQueuedChanges();return e&&this._emitChangeEvent(),t}isSelected(e){return this._selection.has(this._getConcreteValue(e))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(e){this._multiple&&this.selected&&this._selected.sort(e)}isMultipleSelection(){return this._multiple}_emitChangeEvent(){this._selected=null,(this._selectedToEmit.length||this._deselectedToEmit.length)&&(this.changed.next({source:this,added:this._selectedToEmit,removed:this._deselectedToEmit}),this._deselectedToEmit=[],this._selectedToEmit=[])}_markSelected(e){e=this._getConcreteValue(e),this.isSelected(e)||(this._multiple||this._unmarkAll(),this.isSelected(e)||this._selection.add(e),this._emitChanges&&this._selectedToEmit.push(e))}_unmarkSelected(e){e=this._getConcreteValue(e),this.isSelected(e)&&(this._selection.delete(e),this._emitChanges&&this._deselectedToEmit.push(e))}_unmarkAll(){this.isEmpty()||this._selection.forEach(e=>this._unmarkSelected(e))}_verifyValueAssignment(e){e.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(e,t){if(this.compareWith){t=t??this._selection;for(let o of t)if(this.compareWith(e,o))return o;return e}else return e}};var b=(()=>{class n{_listeners=[];notify(t,o){for(let i of this._listeners)i(t,o)}listen(t){return this._listeners.push(t),()=>{this._listeners=this._listeners.filter(o=>t!==o)}}ngOnDestroy(){this._listeners=[]}static \u0275fac=function(o){return new(o||n)};static \u0275prov=r({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var C=(()=>{class n{_animationsDisabled=p();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(o){return new(o||n)};static \u0275cmp=l({type:n,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(o,i){o&2&&m("mat-pseudo-checkbox-indeterminate",i.state==="indeterminate")("mat-pseudo-checkbox-checked",i.state==="checked")("mat-pseudo-checkbox-disabled",i.disabled)("mat-pseudo-checkbox-minimal",i.appearance==="minimal")("mat-pseudo-checkbox-full",i.appearance==="full")("_mat-animation-noopable",i._animationsDisabled)},inputs:{state:"state",disabled:"disabled",appearance:"appearance"},decls:0,vars:0,template:function(o,i){},styles:[`.mat-pseudo-checkbox {
2
+ border-radius: 2px;
3
+ cursor: pointer;
4
+ display: inline-block;
5
+ vertical-align: middle;
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ flex-shrink: 0;
9
+ transition: border-color 90ms cubic-bezier(0, 0, 0.2, 0.1), background-color 90ms cubic-bezier(0, 0, 0.2, 0.1);
10
+ }
11
+ .mat-pseudo-checkbox::after {
12
+ position: absolute;
13
+ opacity: 0;
14
+ content: "";
15
+ border-bottom: 2px solid currentColor;
16
+ transition: opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);
17
+ }
18
+ .mat-pseudo-checkbox._mat-animation-noopable {
19
+ transition: none !important;
20
+ animation: none !important;
21
+ }
22
+ .mat-pseudo-checkbox._mat-animation-noopable::after {
23
+ transition: none;
24
+ }
25
+
26
+ .mat-pseudo-checkbox-disabled {
27
+ cursor: default;
28
+ }
29
+
30
+ .mat-pseudo-checkbox-indeterminate::after {
31
+ left: 1px;
32
+ opacity: 1;
33
+ border-radius: 2px;
34
+ }
35
+
36
+ .mat-pseudo-checkbox-checked::after {
37
+ left: 1px;
38
+ border-left: 2px solid currentColor;
39
+ transform: rotate(-45deg);
40
+ opacity: 1;
41
+ box-sizing: content-box;
42
+ }
43
+
44
+ .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after, .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after {
45
+ color: var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary));
46
+ }
47
+ .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after, .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after {
48
+ color: var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
49
+ }
50
+
51
+ .mat-pseudo-checkbox-full {
52
+ border-color: var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));
53
+ border-width: 2px;
54
+ border-style: solid;
55
+ }
56
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled {
57
+ border-color: var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
58
+ }
59
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate {
60
+ background-color: var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));
61
+ border-color: transparent;
62
+ }
63
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after {
64
+ color: var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary));
65
+ }
66
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled {
67
+ background-color: var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));
68
+ }
69
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled::after, .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled::after {
70
+ color: var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface));
71
+ }
72
+
73
+ .mat-pseudo-checkbox {
74
+ width: 18px;
75
+ height: 18px;
76
+ }
77
+
78
+ .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after {
79
+ width: 14px;
80
+ height: 6px;
81
+ transform-origin: center;
82
+ top: -4.2426406871px;
83
+ left: 0;
84
+ bottom: 0;
85
+ right: 0;
86
+ margin: auto;
87
+ }
88
+ .mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after {
89
+ top: 8px;
90
+ width: 16px;
91
+ }
92
+
93
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after {
94
+ width: 10px;
95
+ height: 4px;
96
+ transform-origin: center;
97
+ top: -2.8284271247px;
98
+ left: 0;
99
+ bottom: 0;
100
+ right: 0;
101
+ margin: auto;
102
+ }
103
+ .mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after {
104
+ top: 6px;
105
+ width: 12px;
106
+ }
107
+ `],encapsulation:2,changeDetection:0})}return n})();var D=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=h({type:n});static \u0275inj=d({imports:[u]})}return n})();export{c as a,b,C as c,D as d};
@@ -0,0 +1 @@
1
+ import{a as ue,b as w,c as me,d as he,e as fe}from"./chunk-FEIJMPL7.js";import{A as pe,C as ce,D as de,f as N,h as z,i as ee,j as te,k as ie,l as ae,m as ne,n as se,o as oe,r as re,v as le}from"./chunk-A626ZBXE.js";import{b as H}from"./chunk-CSNMIJA3.js";import{i as q,j as J,k as Q}from"./chunk-QNWLXTD7.js";import{a as U}from"./chunk-EU3YXT24.js";import"./chunk-NM5IDVR6.js";import{j as Y,o as Z}from"./chunk-7OJ7YZPE.js";import{Bd as V,Ca as _,Da as k,Dd as I,Fa as v,Ga as b,Ha as C,Ia as f,J as R,Ja as s,Ka as r,Ld as K,N as D,Nd as B,O as m,P as h,Qd as $,Sa as x,Sd as A,Td as j,Ua as g,Wa as d,c as E,eb as T,ha as p,jb as c,je as L,kb as W,lb as G,ma as y,pa as O,xd as X,yd as F}from"./chunk-P5D5HOAL.js";import{f as M}from"./chunk-EQVTEUXC.js";var P=class{gpx;constructor(){this.init()}init(){this.gpx=new ue,this.gpx.metadata.name="Signal K Resource Export",this.gpx.metadata.desc="Freeboard export of Signal K resources"}toXML(){return this.gpx.toXML()}setRoutes(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.rte.push(this.packageRoute(e,i[e]))});else for(let e in i)this.gpx.rte.push(this.packageRoute(e,i[e]))}packageRoute(i,t){let e=new me;e.extensions=e.extensions??{},e.extensions.signalk={},e.extensions.signalk.uuid=i,t.distance&&(e.extensions.signalk.distance=t.distance),e.name=t.name||null,e.desc=t.description||null,e.cmt=t.feature.properties.cmt||null,e.src=t.feature.properties.src||null,e.number=t.feature.properties.number||null,e.type=t.feature.properties.type||null;for(let a of t.feature.geometry.coordinates){let n=new w;n.lon=a[0],n.lat=a[1],n.ele=a[2]||null,e.rtept.push(n),this.gpx.updateBounds(n)}return e}setWaypoints(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.wpt.push(this.packageWaypoint(e,i[e]))});else for(let e in i)this.gpx.wpt.push(this.packageWaypoint(e,i[e]))}packageWaypoint(i,t){let e=new w;if(e.extensions=e.extensions||{},e.extensions.signalk={},e.extensions.signalk.uuid=i,e.name=t.name||"",e.desc=t.description||"",e.cmt=t.feature.properties.cmt||null,e.geoidHeight=t.feature.properties.geoidHeight||null,e.src=t.feature.properties.src||null,e.sym=t.feature.properties.sym||null,e.type=t.feature.properties.type||null,t.type==="waypoint"){let a=le(t.feature.properties.skIcon);a?.gpxType&&(e.type=a.gpxType),a?.gpxSym&&(e.sym=a.gpxSym)}return e.fix=t.feature.properties.fix||null,e.sat=t.feature.properties.sat||null,e.hdop=t.feature.properties.hdop||null,e.vdop=t.feature.properties.vdop||null,e.pdop=t.feature.properties.pdop||null,e.ageOfGpsData=t.feature.properties.ageOfGpsData||null,e.dgpsid=t.feature.properties.dgpsid||null,e.lat=t.feature.geometry.coordinates[1],e.lon=t.feature.geometry.coordinates[0],e.ele=t.feature.geometry.coordinates[2]||null,this.gpx.updateBounds(e),e}setTracks(i,t){if(t)t.forEach(e=>{i[e]&&this.gpx.trk.push(this.packageTrack(e,i[e]))});else for(let e in i)this.gpx.trk.push(this.packageTrack(e,i[e]))}packageTrack(i,t){let e=new he;e.extensions=e.extensions||{},e.extensions.signalk={},e.extensions.signalk.uuid=i,e.name=t.feature.properties.name||null,e.desc=t.feature.properties.description||null,e.cmt=t.feature.properties.cmt||null,e.src=t.feature.properties.src||null,e.number=t.feature.properties.number||null,e.type=t.feature.properties.type||null;for(let a of t.feature.geometry.coordinates){let n=new fe;for(let o of a){let u=new w;u.lon=o[0],u.lat=o[1],u.ele=o[2]||null,n.trkpt.push(u),this.gpx.updateBounds(u)}e.trkseg.push(n)}return e}};var S=class l{resultSource;result$;sk2gpx;hasFSA;signalk=D(re);constructor(){this.resultSource=new E,this.result$=this.resultSource.asObservable(),this.hasFSA="showOpenFilePicker"in window}clear(){this.sk2gpx=null}prepData(i){let t={routes:[],waypoints:[],tracks:[]},e=1;return t.routes=i.routes.map(a=>{let n=a[1];return n.feature.id=a[0],n}),e=1,t.waypoints=i.waypoints.map(a=>{let n=a[1];return n.feature.id=a[0],n.name=n.name??`Wpt: ${e}`,e++,n}),t.tracks=i.tracks,t}saveToFile(i,t){this.sk2gpx=new P;let e={},a={},n={};for(let o=0;o<t.rte.selected.length;o++)t.rte.selected[o]&&(e[i.routes[o].feature.id]=i.routes[o]);this.sk2gpx.setRoutes(e);for(let o=0;o<t.wpt.selected.length;o++)t.wpt.selected[o]&&(a[i.waypoints[o].feature.id]=i.waypoints[o]);this.sk2gpx.setWaypoints(a);for(let o=0;o<t.trk.selected.length;o++)if(t.trk.selected[o]){let u=this.signalk.uuid;n[u]=new ce,n[u].feature.id=u,n[u].feature.properties.name=`Vessel trail: ${Date().toString()}`,n[u].feature.geometry.coordinates.push(i.tracks[o])}this.sk2gpx.setTracks(n),this.hasFSA?this.fsaSaveFile():this.legacySaveToFile()}legacySaveToFile(){let i=new Blob([this.sk2gpx.toXML()],{type:"text/xml"}),t=document.createElement("a");t.href=URL.createObjectURL(i),t.download="fb_export.gpx",t.click(),URL.revokeObjectURL(t.href),t.remove(),this.resultSource.next(-1)}fsaSaveFile(){window.showSaveFilePicker({types:[{description:"GPX file",accept:{"text/xml":[".gpx"]}}]}).then(i=>{i.createWritable().then(t=>{let e=new Blob([this.sk2gpx.toXML()]);t.write(e).then(()=>{t.close(),this.resultSource.next(0)})}).catch(t=>{console.warn(t),this.resultSource.next(1)})}).catch(()=>{this.resultSource.next(-1)})}static \u0275fac=function(t){return new(t||l)};static \u0275prov=R({token:l,factory:l.\u0275fac,providedIn:"root"})};function _e(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19),c(2),r(),s(3,"div",20)(4,"mat-checkbox",21,0),g("change",function(){let a=m(t).$index,n=T(5),o=d(2);return h(o.checkWpt(n.checked,a))}),r()()()}if(l&2){let t=i.$implicit,e=i.$index,a=d(2);p(2),W(t.name),p(2),f("checked",a.selWaypoints[e])}}function ke(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",12),g("opened",function(){m(t);let a=d();return h(a.display.expand.waypoints=!0)})("closed",function(){m(t);let a=d();return h(a.display.expand.waypoints=!1)}),s(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",14),c(5,"place"),r(),c(6," \xA0"),s(7,"b"),c(8,"Waypoints:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",16),g("change",function(a){m(t);let n=d();return h(n.checkWpt(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,_e,6,2,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",t.display.expand.waypoints),p(10),f("indeterminate",t.display.someWptChecked)("checked",t.display.allWaypointsChecked)("disabled",t.resData.waypoints.length===0),p(2),C(t.resData.waypoints)}}function ve(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19)(2,"mat-icon",22),c(3,"directions"),r(),c(4),r(),s(5,"div",20)(6,"mat-checkbox",24,1),g("change",function(){let a=m(t).$index,n=T(7),o=d(2);return h(o.checkRte(n.checked,a))}),r()()()}if(l&2){let t=i.$implicit,e=i.$index,a=d(2);p(4),G(" ",t.name," "),p(2),f("checked",a.selRoutes[e])}}function be(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",12),g("opened",function(){m(t);let a=d();return h(a.display.expand.routes=!0)})("closed",function(){m(t);let a=d();return h(a.display.expand.routes=!1)}),s(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",22),c(5,"directions"),r(),c(6," \xA0"),s(7,"b"),c(8,"Routes:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",23),g("change",function(a){m(t);let n=d();return h(n.checkRte(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,ve,8,2,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",t.display.expand.routes),p(10),f("indeterminate",t.display.someRteChecked)("checked",t.display.allRoutesChecked)("disabled",t.resData.routes.length==0),p(2),C(t.resData.routes)}}function Ce(l,i){if(l&1){let t=x();s(0,"div",18)(1,"div",19)(2,"mat-icon",26),c(3,"directions_boat"),r(),c(4," Vessel Trail "),r(),s(5,"div",20)(6,"mat-checkbox",28,2),g("change",function(){let a=m(t).$index,n=T(7),o=d(2);return h(o.checkTrk(n.checked,a))}),r()()()}if(l&2){let t=i.$index,e=d(2);p(6),f("checked",e.selTracks[t])}}function Te(l,i){if(l&1){let t=x();s(0,"div",11)(1,"mat-expansion-panel",25)(2,"mat-expansion-panel-header",13)(3,"mat-panel-title")(4,"mat-icon",26),c(5,"show_chart"),r(),c(6," \xA0"),s(7,"b"),c(8,"Tracks:"),r()(),s(9,"mat-panel-description")(10,"div",15)(11,"mat-checkbox",27),g("change",function(a){m(t);let n=d();return h(n.checkTrk(a.checked,-1))})("click",function(a){return a.cancelBubble=!0}),r()()()(),s(12,"div",17),b(13,Ce,8,1,"div",18,v),r()()()}if(l&2){let t=d();p(),f("expanded",!1),p(10),f("indeterminate",!1)("checked",t.display.allTracksChecked)("disabled",t.resData.tracks.length==0),p(2),C(t.resData.tracks)}}var ge=class l{constructor(i,t,e,a,n){this.app=i;this.skres=t;this.facade=e;this.dialogRef=a;this.data=n}resData={routes:[],waypoints:[],tracks:[]};selRoutes=[];selectedRoute=null;selWaypoints=[];selTracks=[];display={notValid:!1,allRoutesChecked:!1,allWaypointsChecked:!1,allTracksChecked:!1,someWptChecked:!1,someRteChecked:!1,someTrkChecked:!1,saveRoutesOK:!1,saveWaypointsOK:!1,saveTracksOK:!1,routeViewer:!1,selCount:{routes:0,waypoints:0,tracks:0},expand:{routes:!1,waypoints:!1,tracks:!1}};unsubscribe=[];ngOnInit(){this.loadResources(),this.unsubscribe.push(this.facade.result$.subscribe(i=>{this.dialogRef.close(i)}))}ngOnDestroy(){this.unsubscribe.forEach(i=>i.unsubscribe()),this.facade.clear()}loadResources(){return M(this,null,function*(){this.data.routes.sort((i,t)=>i[1].name.localeCompare(t[1].name));try{this.app.sIsFetching.set(!0);let i=yield this.skres.listFromServer("waypoints");i.sort((t,e)=>t[1].name.localeCompare(e[1].name)),this.data.waypoints=i,this.app.sIsFetching.set(!1)}catch(i){this.app.sIsFetching.set(!1),this.resData.waypoints=[]}this.parseResourceData()})}save(){this.facade.saveToFile(this.resData,{rte:{selected:this.selRoutes},wpt:{selected:this.selWaypoints},trk:{selected:this.selTracks}})}parseResourceData(){this.display.allRoutesChecked=!1,this.display.saveRoutesOK=!1,this.selRoutes=[],this.display.allWaypointsChecked=!1,this.display.saveWaypointsOK=!1,this.selWaypoints=[],this.display.allTracksChecked=!1,this.display.saveTracksOK=!1,this.selTracks=[],this.display.selCount={routes:0,waypoints:0,tracks:0},this.display.expand={routes:!1,waypoints:!1,tracks:!1},this.display.notValid=!1,this.resData=this.facade.prepData(this.data),this.resData.routes.forEach(()=>{this.selRoutes.push(!1)}),this.selRoutes.length===1&&(this.selRoutes[0]=!0,this.display.allRoutesChecked=!0,this.display.expand.routes=!0,this.display.saveRoutesOK=!0),this.resData.waypoints.forEach(()=>{this.selWaypoints.push(!1)}),this.selTracks.push(!1)}checkRte(i,t=-1){let e=0;if(t!==-1){this.selRoutes[t]=i,this.display.saveRoutesOK=i;for(let a of this.selRoutes)a&&e++;this.display.saveRoutesOK=e!==0,this.display.selCount.routes=e,this.display.allRoutesChecked=e===this.selRoutes.length}else{for(let a=0;a<this.selRoutes.length;a++)this.selRoutes[a]=i,this.display.saveRoutesOK=i,this.display.allRoutesChecked=i;this.display.selCount.routes=i?this.selRoutes.length:0}this.display.someRteChecked=!(this.display.allRoutesChecked||e===0)}checkWpt(i,t=-1){let e=0;if(t!==-1){this.selWaypoints[t]=i,this.display.saveWaypointsOK=i;for(let a of this.selWaypoints)a&&e++;this.display.saveWaypointsOK=e!==0,this.display.selCount.waypoints=e,this.display.allWaypointsChecked=e===this.selWaypoints.length}else{for(let a=0;a<this.selWaypoints.length;a++)this.selWaypoints[a]=i,this.display.saveWaypointsOK=i,this.display.allWaypointsChecked=i;this.display.selCount.waypoints=i?this.selWaypoints.length:0}this.display.someWptChecked=!(this.display.allWaypointsChecked||e===0)}checkTrk(i,t=-1){let e=0;if(t!==-1){this.selTracks[t]=i,this.display.saveTracksOK=i;for(let a of this.selTracks)a&&e++;this.display.saveTracksOK=e!==0,this.display.selCount.tracks=e,this.display.allTracksChecked=e===this.selTracks.length}else{for(let a=0;a<this.selTracks.length;a++)this.selTracks[a]=i,this.display.saveTracksOK=i,this.display.allTracksChecked=i;this.display.selCount.tracks=i?this.selTracks.length:0}this.display.someTrkChecked=!(this.display.allTracksChecked||e===0)}static \u0275fac=function(t){return new(t||l)(y(pe),y(de),y(S),y(X),y(F))};static \u0275cmp=O({type:l,selectors:[["gpxsave-dialog"]],decls:18,vars:4,consts:[["wval",""],["rval",""],["tval",""],[1,"gpxsave-dialog"],[2,"background-color","transparent"],[2,"display","flex","width","100%"],["mat-raised-button","","matTooltip","Save selected resources","matTooltipPosition","right",2,"width","85px",3,"click","disabled"],[2,"flex","1 1 auto","text-align","center"],[2,"text-align","right"],["mat-icon-button","",3,"click"],["mat-dialog-content","",2,"padding","2px"],[1,"card-group"],[3,"opened","closed","expanded"],[1,"panel-header"],[1,"icon-waypoint"],[1,"panel-description"],["matTooltip","Select all Waypoints","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],[1,"list-container-scrollable"],[1,"item-row"],[1,"name"],[1,"check"],["matTooltip","Select Waypoint","matTooltipPosition","below",3,"change","checked"],[1,"icon-route"],["matTooltip","Select all Routes","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Route","matTooltipPosition","below",3,"change","checked"],[3,"expanded"],[1,"icon-track"],["matTooltip","Vessel Trail to Track","matTooltipPosition","before",3,"change","click","indeterminate","checked","disabled"],["matTooltip","Select this Track","matTooltipPosition","below",3,"change","checked"]],template:function(t,e){t&1&&(s(0,"div",3)(1,"mat-toolbar",4)(2,"div",5)(3,"div")(4,"button",6),g("click",function(){return e.save()}),s(5,"mat-icon"),c(6,"save"),r(),c(7,"\xA0Save\xA0 "),r()(),s(8,"div",7),c(9,"Export to GPX"),r(),s(10,"div",8)(11,"button",9),g("click",function(){return e.dialogRef.close(-1)}),s(12,"mat-icon"),c(13,"close"),r()()()()(),s(14,"div",10),_(15,ke,15,4,"div",11),_(16,be,15,4,"div",11),_(17,Te,15,4,"div",11),r()()),t&2&&(p(4),f("disabled",!e.display.saveRoutesOK&&!e.display.saveWaypointsOK&&!e.display.saveTracksOK),p(11),k(e.resData.waypoints.length!==0?15:-1),p(),k(e.resData.routes.length!==0?16:-1),p(),k(!e.app.data.serverTrail&&e.resData.tracks.length!==0?17:-1))},dependencies:[oe,se,z,I,V,j,A,$,B,K,q,Y,Z,H,ne,ee,te,ae,ie,Q,J,N,U,L],styles:[".gpxsave-dialog[_ngcontent-%COMP%]{font-family:roboto;position:relative}.dialog-content[_ngcontent-%COMP%]{position:relative;min-height:300px;max-height:400px;width:100%;min-width:240px;overflow-y:auto}.dialog-icon[_ngcontent-%COMP%]{display:none}.card-group[_ngcontent-%COMP%]{padding:5px 5%}.card-group[_ngcontent-%COMP%] .panel-header[_ngcontent-%COMP%]{padding:0 5px}.card-group[_ngcontent-%COMP%] .panel-description[_ngcontent-%COMP%]{text-align:right;width:100%;padding-right:10px}.card-group-title[_ngcontent-%COMP%]{font-weight:700;font-size:10pt;font-family:Arial,Helvetica,sans-serif;padding:10px 0}button[_ngcontent-%COMP%]{min-width:unset;padding:unset}.item-row[_ngcontent-%COMP%]{display:flex;width:100%;padding:2px 0}.item-row[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{flex:1 1 auto;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-overflow:ellipsis;line-height:2.5em}.item-row[_ngcontent-%COMP%] .check[_ngcontent-%COMP%]{text-align:right;padding-right:15px}@media only screen and (min-width:475px){button[_ngcontent-%COMP%]{min-width:inherit;padding:inherit}.dialog-content[_ngcontent-%COMP%]{min-width:400px}.dialog-icon[_ngcontent-%COMP%]{display:inline}}@media only screen and (min-width:800px){.card-group[_ngcontent-%COMP%]{padding:5px 5%}}"]})};export{ge as GPXExportDialog};