@mxtommy/kip 4.7.0-beta.2 → 4.7.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugin/history-series.service.js +91 -13
- package/plugin/index.js +110 -8
- package/plugin/kip-plugin/src/history-series.service.js +537 -0
- package/plugin/kip-plugin/src/index.js +1194 -0
- package/plugin/kip-plugin/src/openApi.json +787 -0
- package/plugin/kip-plugin/src/sqlite-history-storage.service.js +1122 -0
- package/plugin/openApi.json +14 -0
- package/plugin/sqlite-history-storage.service.js +13 -19
- package/plugin/src/app/core/contracts/kip-series-contract.js +14 -0
- package/plugin/src/app/core/contracts/kip-series-contract.spec.js +68 -0
- package/public/assets/svg/icons.svg +1 -1
- package/public/{chunk-3MSOVKX6.js → chunk-4YDVZHMH.js} +1 -1
- package/public/{chunk-NK7SNP45.js → chunk-AQROQY2F.js} +1 -1
- package/public/{chunk-CMHH7BXX.js → chunk-BQPPRM7O.js} +1 -1
- package/public/{chunk-FVGLVFWP.js → chunk-ETXVA6Z3.js} +1 -1
- package/public/{chunk-64MHGMIL.js → chunk-GYJAOUYL.js} +2 -2
- package/public/{chunk-Y4DXERRE.js → chunk-H2I7BMAK.js} +12 -12
- package/public/{chunk-7EAIOLCB.js → chunk-IENESD5Q.js} +1 -1
- package/public/{chunk-NFUW7ILE.js → chunk-LWHL6XXC.js} +1 -1
- package/public/{chunk-CHMMSVYD.js → chunk-M37BLWHF.js} +5 -5
- package/public/{chunk-7H5VXIPS.js → chunk-NOZ6S7A5.js} +1 -1
- package/public/{chunk-EZZ4IJBX.js → chunk-TABZLTIT.js} +1 -1
- package/public/{chunk-B3VMWHNV.js → chunk-YY4ZUJFI.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-VB3XIM4H.js → main-IECWDNBW.js} +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as w}from"./chunk-
|
|
1
|
+
import{b as w}from"./chunk-YY4ZUJFI.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,2 +1,2 @@
|
|
|
1
|
-
import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-
|
|
1
|
+
import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-H2I7BMAK.js";import{c as ut}from"./chunk-ETXVA6Z3.js";import{a as Ct}from"./chunk-IENESD5Q.js";import{e as Pt,f as yt,h as xt,j as Et}from"./chunk-YY4ZUJFI.js";import"./chunk-CSIELI2Z.js";import"./chunk-4YDVZHMH.js";import"./chunk-M37BLWHF.js";import{e as _t}from"./chunk-WJFXI5PQ.js";import{b as mt}from"./chunk-HSKVTFFQ.js";import"./chunk-MXUEYEZU.js";import"./chunk-2GOHQZH5.js";import{$b as Je,Ab as Ye,Ac as ge,Bb as Xe,Ca as S,Cb as R,Da as F,Db as p,Eb as g,Fa as re,Fb as j,Gd as rt,Ha as We,I as Be,J as W,Jc as me,Ka as ae,Lc as O,Mb as q,Mc as Qe,Nd as at,Ob as m,Pe as be,Q as ze,Qb as P,Re as M,Se as L,Ua as le,Va as b,Vd as fe,Xa as Ue,Za as de,_a as Ze,ac as he,ae as lt,ba as se,ca as Ve,cb as je,cc as H,ce as dt,da as N,dc as f,de as ve,ea as Ge,ec as pe,fb as I,fe as ct,g as T,gd as tt,hb as ce,hd as it,he as ht,id as K,j as ne,je as Y,k as _,ka as $e,kd as B,m as Ne,md as ue,na as k,od as C,p as Fe,pa as c,rc as _e,rd as nt,td as st,ua as y,ub as Z,va as x,vd as ot,ve as pt,wb as qe,xb as Ke,xe as De,ya as oe,z as He,za as U}from"./chunk-PZ6I6W3H.js";function Pe(o){let t=o.cloneNode(!0),e=t.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return i==="canvas"?Tt(o,t):(i==="input"||i==="select"||i==="textarea")&&Rt(o,t),It("canvas",o,t,Tt),It("input, textarea, select",o,t,Rt),t}function It(o,t,e,i){let n=t.querySelectorAll(o);if(n.length){let s=e.querySelectorAll(o);for(let r=0;r<n.length;r++)i(n[r],s[r])}}var si=0;function Rt(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${si++}`)}function Tt(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch(i){}}function Te(o){let t=o.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function ye(o,t,e){let{top:i,bottom:n,left:s,right:r}=o;return e>=i&&e<=n&&t>=s&&t<=r}function oi(o,t){let e=t.left<o.left,i=t.left+t.width>o.right,n=t.top<o.top,s=t.top+t.height>o.bottom;return e||i||n||s}function G(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function kt(o,t,e,i){let{top:n,right:s,bottom:r,left:a,width:l,height:d}=o,h=l*t,v=d*t;return i>n-v&&i<r+v&&e>a-h&&e<s+h}var X=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Te(e)})})}handleScroll(t){let e=B(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,r;if(e===this._document){let d=this.getViewportScrollPosition();s=d.top,r=d.left}else s=e.scrollTop,r=e.scrollLeft;let a=n.top-s,l=n.left-r;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&G(d.clientRect,a,l)}),n.top=s,n.left=r,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Wt(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function ke(o,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?o.setProperty(i,n,e?.has(i)?"important":""):o.removeProperty(i)}return o}function A(o,t){let e=t?"":"none";ke(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Ot(o,t,e){ke(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function J(o,t){return t&&t!="none"?o+" "+t:o}function Mt(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=$(t.left,t.top)}function $(o,t){return`translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var z={capture:!0},we={passive:!1,capture:!0},ri=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,n){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return o})(),Oe=(()=>{class o{_ngZone=c(F);_document=c(U);_styleLoader=c(nt);_renderer=c(de).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=re([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,we)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(ri),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch"),s=a=>this.pointerUp.next(a),r=[["scroll",a=>this._scroll.next(a),z],["selectstart",this._preventDefaultWhileDragging,we]];n?r.push(["touchend",s,z],["touchcancel",s,z]):r.push(["mouseup",s,z]),n||r.push(["mousemove",a=>this.pointerMove.next(a),we]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=r.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new ne(n=>this._ngZone.runOutsideAngular(()=>{let s=this._renderer.listen(e,"scroll",r=>{this._activeDragInstances().length&&n.next(r)},z);return()=>{s()}}))),W(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||o)};static \u0275prov=$e({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Lt(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function ai(o){let t=getComputedStyle(o),e=Se(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let n=e.indexOf(i),s=Se(t,"transition-duration"),r=Se(t,"transition-delay");return Lt(s[n])+Lt(r[n])}function Se(o,t){return o.getPropertyValue(t).split(",").map(i=>i.trim())}var li=new Set(["position"]),xe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,n,s,r,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=s,this._previewClass=r,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),At(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return ai(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let s=t.matchSize?this._initialDomRect:null,r=t.viewContainer.createEmbeddedView(i,t.context);r.detectChanges(),n=Wt(r,this._document),this._previewEmbeddedView=r,t.matchSize?Mt(n,s):n.style.transform=$(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else n=Pe(this._rootElement),Mt(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return ke(n.style,{"pointer-events":"none",margin:At(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},li),A(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(s=>n.classList.add(s)):n.classList.add(e)),n}};function At(o){return"showPopover"in o}var di={passive:!0},Nt={passive:!1},ci={passive:!1,capture:!0},hi=800,Ft="cdk-drag-placeholder",Ht=new Set(["position"]);function pi(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=o.get(Ze,null,{optional:!0})||o.get(de).createRenderer(null,null);return new Ee(t,e,o.get(U),o.get(F),o.get(De),o.get(Oe),i)}var Ee=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=re(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>A(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,n,s,r,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=s,this._dragDropRegistry=r,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new X(i),r.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>C(i)),this._handles.forEach(i=>A(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=C(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Nt),i.listen(e,"touchstart",this._pointerDown,di),i.listen(e,"dragstart",this._nativeDragStart,Nt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?C(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&oi(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,n=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?n=t.top-e.top:e.bottom>t.bottom&&(n=t.bottom-e.bottom);let s=this._activeTransform.x,r=this._activeTransform.y,a=s+i,l=r+n;this._rootElement.style.transform=$(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),A(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),A(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),s=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+s>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,s=this._activeTransform;s.x=i.x-n.x+this._passiveTransform.x,s.y=i.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(s.x,s.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){V(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",_i,ci)}),i){let n=this._rootElement,s=n.parentNode,r=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");s.insertBefore(a,n),this._initialTransform=n.style.transform||"",this._preview=new xe(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(s,e)),Ot(n,!1,Ht),this._document.body.appendChild(s.replaceChild(r,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=V(e),s=!n&&e.button!==0,r=this._rootElement,a=B(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+hi>Date.now(),d=n?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||s||l||d)return;if(this._handles.length){let E=r.style;this._rootElementTapHighlight=E.webkitTapHighlightColor||"",E.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(E=>this._updateOnScroll(E)),this._boundaryElement&&(this._boundaryRect=Te(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Ot(this._rootElement,!0,Ht),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),s=this._getDragDistance(n),r=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:s,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:r,distance:s,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,r,s,n,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let s=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!s&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(s=this._initialContainer),s&&s!==this._dropContainer&&this._ngZone.run(()=>{let r=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(r+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(s,this._dropContainer,a),this._dropContainer=s,this._dropContainer.enter(this,t,e,s===this._initialContainer&&s.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:s,currentIndex:s.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&B(a)===this._preview.element&&a.propertyName==="transform")&&(r(),i(),clearTimeout(s))},s=setTimeout(n,e*1.5),r=this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Wt(this._placeholderRef,this._document)):i=Pe(this._rootElement),i.style.pointerEvents="none",i.classList.add(Ft),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,s=n?n.getBoundingClientRect():t,r=V(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=r.pageX-s.left-a.left,d=r.pageY-s.top-a.top;return{x:s.left-t.left+l,y:s.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=V(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,s=i.pageY-e.top;if(this._ownerSVGElement){let r=this._ownerSVGElement.getScreenCTM();if(r){let a=this._ownerSVGElement.createSVGPoint();return a.x=n,a.y=s,a.matrixTransform(r.inverse())}}return{x:n,y:s}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:s,y:r}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+r,v=a.bottom-(d-r),E=a.left+s,te=a.right-(l-s);i=Bt(i,E,te),n=Bt(n,h,v)}return{x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,s=this._pointerPositionAtLastDirectionChange,r=Math.abs(e-s.x),a=Math.abs(i-s.y);return r>this._config.pointerDirectionChangeThreshold&&(n.x=e>s.x?1:-1,s.x=e),a>this._config.pointerDirectionChangeThreshold&&(n.y=i>s.y?1:-1,s.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,A(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,n=$(t*i,e*i),s=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=s.transform&&s.transform!="none"?s.transform:""),s.transform=J(n,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=$(t,e);this._preview.setTransform(J(n,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let s=n.left-i.left,r=i.right-n.right,a=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(s>0&&(t+=s),r>0&&(t-=r)):t=0,n.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:V(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=B(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&G(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=K(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return C(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=Pe(this._placeholder);n.classList.remove(Ft),n.classList.add("cdk-drag-anchor"),n.style.transform="",i?i.before(n):C(e.element).appendChild(n)}}};function Bt(o,t,e){return Math.max(t,Math.min(e,o))}function V(o){return o.type[0]==="t"}function _i(o){o.preventDefault()}function ee(o,t,e){let i=zt(t,o.length-1),n=zt(e,o.length-1);if(i===n)return;let s=o[i],r=n<i?-1:1;for(let a=i;a!==n;a+=r)o[a]=o[a+r];o[n]=s}function zt(o,t){return Math.max(0,Math.min(t,o))}var Q=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,n){let s=this._itemPositions,r=this._getItemIndexFromPointerPosition(t,e,i,n);if(r===-1&&s.length>0)return null;let a=this.orientation==="horizontal",l=s.findIndex(D=>D.drag===t),d=s[r],h=s[l].clientRect,v=d.clientRect,E=l>r?1:-1,te=this._getItemOffsetPx(h,v,E),ti=this._getSiblingOffsetPx(l,s,E),ii=s.slice();return ee(s,l,r),s.forEach((D,ni)=>{if(ii[ni]===D)return;let Me=D.drag===t,ie=Me?te:ti,Le=Me?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ie;let Ae=Math.round(D.offset*(1/D.drag.scale));a?(Le.style.transform=J(`translate3d(${Ae}px, 0, 0)`,D.initialTransform),G(D.clientRect,0,ie)):(Le.style.transform=J(`translate3d(0, ${Ae}px, 0)`,D.initialTransform),G(D.clientRect,ie,0))}),this._previousSwap.overlaps=ye(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?n.x:n.y,{previousIndex:l,currentIndex:r}}enter(t,e,i,n){let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,r=this._activeDraggables,a=r.indexOf(t),l=t.getPlaceholderElement(),d=r[s];if(d===t&&(d=r[s+1]),!d&&(s==null||s===-1||s<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=r[0]),a>-1&&r.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),r.splice(s,0,t)}else this._element.appendChild(l),r.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{G(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Te(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=n?e.left-t.left:e.top-t.top;return i===-1&&(s+=n?e.width-t.width:e.height-t.height),s}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=e[t].clientRect,r=e[t+i*-1],a=s[n?"width":"height"]*i;if(r){let l=n?"left":"top",d=n?"right":"bottom";i===-1?a-=r.clientRect[l]-s[d]:a+=s[l]-r.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let r=i[i.length-1].clientRect;return n?t>=r.right:e>=r.bottom}else{let r=i[0].clientRect;return n?t<=r.left:e<=r.top}}_getItemIndexFromPointerPosition(t,e,i,n){let s=this.orientation==="horizontal",r=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(n){let d=s?n.x:n.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return s?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return r===-1||!this._sortPredicate(r,t)?-1:r}},Ce=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let n=e[i];this._relatedNodes.push([n,n.nextSibling])}this.withItems(t)}sort(t,e,i,n){let s=this._getItemIndexFromPointerPosition(t,e,i),r=this._previousSwap;if(s===-1||this._activeItems[s]===t)return null;let a=this._activeItems[s];if(r.drag===a&&r.overlaps&&r.deltaX===n.x&&r.deltaY===n.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();s>l?h.after(d):h.before(d),ee(this._activeItems,l,s);let v=this._getRootNode().elementFromPoint(e,i);return r.deltaX=n.x,r.deltaY=n.y,r.drag=a,r.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let s=this._activeItems.indexOf(t);s>-1&&this._activeItems.splice(s,1);let r=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;r===-1&&(r=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[r];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(r,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,s]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==s&&(s===null?t.appendChild(n):s.parentNode===t&&t.insertBefore(n,s))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),s=n?this._activeItems.findIndex(r=>{let a=r.getRootElement();return n===a||a.contains(n)}):-1;return s===-1||!this._sortPredicate(s,t)?-1:s}_getRootNode(){return this._rootNode||(this._rootNode=K(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,s=-1;for(let r=0;r<this._activeItems.length;r++){let a=this._activeItems[r];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<n&&(n=h,s=r)}}return s}},Vt=.05,Ut=.05,w=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(w||{}),u=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(u||{});function gi(o,t){return new Ie(t,o.get(Oe),o.get(U),o.get(F),o.get(De))}var Ie=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,n,s){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=s;let r=this.element=C(t);this._document=i,this.withOrientation("vertical").withElementContainer(r),e.registerDropContainer(this),this._parentPositions=new X(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,n,s,r,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:s,distance:r,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Q&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new Ce(this._document,this._dragDropRegistry);else{let e=new Q(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=C(this.element),i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!kt(this._domRect,Vt,e,i))return;let s=this._sortStrategy.sort(t,e,i,n);s&&this.sorted.next({previousIndex:s.previousIndex,currentIndex:s.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=w.NONE,s=u.NONE;if(this._parentPositions.positions.forEach((r,a)=>{a===this._document||!r.clientRect||i||kt(r.clientRect,Vt,t,e)&&([n,s]=mi(a,r.clientRect,this._direction,t,e),(n||s)&&(i=a))}),!n&&!s){let{width:r,height:a}=this._viewportRuler.getViewportSize(),l={width:r,height:a,top:0,right:r,bottom:a,left:0};n=Zt(l,e),s=jt(l,t),i=window}i&&(n!==this._verticalScrollDirection||s!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=s,this._scrollNode=i,(n||s)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Be(0,Fe).pipe(N(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&ye(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ye(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=K(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Zt(o,t){let{top:e,bottom:i,height:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?w.UP:t>=i-s&&t<=i+s?w.DOWN:w.NONE}function jt(o,t){let{left:e,right:i,width:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?u.LEFT:t>=i-s&&t<=i+s?u.RIGHT:u.NONE}function mi(o,t,e,i,n){let s=Zt(t,n),r=jt(t,i),a=w.NONE,l=u.NONE;if(s){let d=o.scrollTop;s===w.UP?d>0&&(a=w.UP):o.scrollHeight-d>o.clientHeight&&(a=w.DOWN)}if(r){let d=o.scrollLeft;e==="rtl"?r===u.RIGHT?d<0&&(l=u.RIGHT):o.scrollWidth+d>o.clientWidth&&(l=u.LEFT):r===u.LEFT?d>0&&(l=u.LEFT):o.scrollWidth-d>o.clientWidth&&(l=u.RIGHT)}return[a,l]}var Gt=new k("CDK_DRAG_PARENT");var ui=new k("CdkDragHandle");var qt=new k("CDK_DRAG_CONFIG"),Kt=new k("CdkDropList"),Yt=(()=>{class o{element=c(ae);dropContainer=c(Kt,{optional:!0,skipSelf:!0});_ngZone=c(F);_viewContainerRef=c(je);_dir=c(ve,{optional:!0});_changeDetectorRef=c(me);_selfHandle=c(ui,{optional:!0,self:!0});_parentDrag=c(Gt,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Oe);_destroyed=new _;_handles=new Ne([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new S;released=new S;ended=new S;entered=new S;exited=new S;dropped=new S;moved=new ne(e=>{let i=this._dragRef.moved.pipe(He(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=c(oe);constructor(){let e=this.dropContainer,i=c(qt,{optional:!0});this._dragRef=pi(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(N(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){Ue(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):C(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,s=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,r=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:ue(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(s).withPreviewTemplate(r).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(ze(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let n=this._dragDropRegistry.getDragDirectiveForNode(i);if(n){e.withParent(n._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:s,previewClass:r,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=n||0,this.lockAxis=i||null,s&&(this.constrainPosition=s),r&&(this.previewClass=r),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Ge(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),Ve(e=>W(...e.map(i=>i._stateChanges.pipe(se(i))))),N(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n)})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&he("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",O],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Qe]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[_e([{provide:Gt,useExisting:o}]),We]})}return o})(),$t=new k("CdkDropListGroup");var Xt=(()=>{class o{element=c(ae);_changeDetectorRef=c(me);_scrollDispatcher=c(pt);_dir=c(ve,{optional:!0});_group=c($t,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=c(at).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new S;entered=new S;exited=new S;sorted=new S;_unsortedItems=new Set;constructor(){let e=c(qt,{optional:!0}),i=c(oe);this._dropListRef=gi(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,s)=>this.enterPredicate(n.data,s.data),this._dropListRef.sortPredicate=(n,s,r)=>this.sortPredicate(n,s.data,r.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(se(this._dir.value),N(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=st(this.connectedTo).map(n=>{if(typeof n=="string"){let s=o._dropLists.find(r=>r.id===n);return s}return n});if(this._group&&this._group._items.forEach(n=>{i.indexOf(n)===-1&&i.push(n)}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(s=>s.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ue(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),W(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:n,sortingDisabled:s,listAutoScrollDisabled:r,listOrientation:a}=e;this.disabled=n??!1,this.sortingDisabled=s??!1,this.autoScrollDisabled=r??!1,this.orientation=a||"vertical",this.lockAxis=i||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,n){i&2&&(Z("id",n.id),he("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",O],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",O],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",O],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",O]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[_e([{provide:$t,useValue:void 0},{provide:Kt,useExisting:o}])]})}return o})();function fi(o,t){if(o&1){let e=q();p(0,"button",0),m("click",function(){y(e);let n=P();return x(n.clickAction("cancel"))}),p(1,"mat-icon",1),f(2,"close"),g(),p(3,"span"),f(4,"Close"),g()()}}var Qt=(()=>{class o{_bottomSheetRef=c(Dt);data=c(vt);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,n){i&1&&(p(0,"mat-action-list")(1,"button",0),m("click",function(){return n.clickAction("duplicate")}),p(2,"mat-icon",1),f(3,"content_copy"),g(),p(4,"span"),f(5,"Duplicate"),g()(),p(6,"button",0),m("click",function(){return n.clickAction("delete")}),p(7,"mat-icon",1),f(8,"delete_forever"),g(),p(9,"span"),f(10,"Delete"),g()(),qe(11,fi,5,0,"button",2),g()),i&2&&(b(11),Ke(n.showCancel?11:-1))},dependencies:[Et,yt,xt,Pt,L,M],encapsulation:2})}return o})();var Di=(o,t)=>t.id;function bi(o,t){if(o&1){let e=q();p(0,"div",5),m("cdkDragStarted",function(){y(e);let n=P();return x(n.dragStart())})("cdkDragMoved",function(n){y(e);let s=P();return x(s.onDragMoved(n))})("cdkDragEnded",function(){y(e);let n=P();return x(n.dragEnd())})("press",function(){let n=y(e).$index,s=P();return x(s.onPress(n))})("doubletap",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.enter",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.space",function(){let n=y(e).$index,s=P();return x(s.onPress(n))}),p(1,"div",6),f(2),g(),p(3,"div"),j(4,"mat-icon",7),g(),p(5,"p",8),f(6),g()()}if(o&2){let e=t.$implicit,i=t.$index,n=P();R("mode","editor")("disableGestures",n._sheetOpen||n.suppressDrag)("cdkDragDisabled",n._sheetOpen||n.suppressDrag),Z("aria-label",e.name),b(2),pe(i+1),b(2),Je("width",72,"px")("height",72,"px"),R("svgIcon",e.icon||"dashboard"),b(2),pe(e.name)}}var ei=(()=>{class o{pageTitle="Dashboards";_bottomSheet=c(bt);_dashboard=c(gt);_uiEvent=c(St);_dialog=c(ft);_sanitizer=c(rt);_sheetOpen=!1;suppressDrag=!1;_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openDashboardPageEditorDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,icon:"dashboard-dashboard",confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{e&&this._dashboard.add(e.name,[],e.icon,e.collapseSplitShell)})}openBottomSheet(e){if(this._sheetOpen)return;this._sheetOpen=!0;let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Qt,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,s){case"delete":this.deleteDashboard(e);break;case"duplicate":this.duplicateDashboard(e,`${this._dashboard.dashboards()[e].name}`);break;default:break}})}editDashboard(e){let i=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Dashboard Options",name:i.name,icon:i.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:i.collapseSplitShell??!1}).afterClosed().subscribe(n=>{n&&this._dashboard.update(e,n.name,n.icon,n.collapseSplitShell)})}deleteDashboard(e){this._dashboard.delete(e)}duplicateDashboard(e,i){let n=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Duplicate Dashboard",name:`${i} copy`,icon:n.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:n.collapseSplitShell??!1}).afterClosed().subscribe(s=>{s&&this._dashboard.duplicate(e,s.name,s.icon,s.collapseSplitShell)})}drop(e){this._dashboard.dashboards.update(i=>{let n=[...i];ee(n,e.previousIndex,e.currentIndex);let s=this._dashboard.activeDashboard();return s===e.previousIndex?this._dashboard.activeDashboard.set(e.currentIndex):s>e.previousIndex&&s<=e.currentIndex?this._dashboard.activeDashboard.set(s-1):s<e.previousIndex&&s>=e.currentIndex&&this._dashboard.activeDashboard.set(s+1),n})}dragStart(){this._sheetOpen||this.suppressDrag||(this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1)}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(e){if(!this._dragActive||this._dragMoved)return;Math.hypot(e.distance.x,e.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(e){this._sheetOpen||this._dragMoved||(this.cancelPointerSequence(),this.openBottomSheet(e))}cancelPointerSequence(){this.suppressDrag=!0,this._dragActive=!1,this._dragMoved=!1,["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}onPointerRelease(){this._sheetOpen||(this.suppressDrag=!1)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-editor"]],hostBindings:function(i,n){i&1&&m("mouseup",function(){return n.onPointerRelease()},le)("touchend",function(){return n.onPointerRelease()},le)},decls:10,vars:0,consts:[["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"mode","disableGestures","cdkDragDisabled"],["tabindex","0",1,"dashboard-card","dashboard-item-add","dashboard-add-btn",3,"click","keydown"],["mat-fab",""],[2,"margin-top","10px"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap","keydown.enter","keydown.space","mode","disableGestures","cdkDragDisabled"],[1,"item-index"],["aria-hidden","false",1,"dashboard-icon",3,"svgIcon"],[1,"dashboard-name"]],template:function(i,n){i&1&&(p(0,"div",0),m("cdkDropListDropped",function(r){return n.drop(r)}),Ye(1,bi,7,11,"div",1,Di),p(3,"div",2),m("click",function(){return n.addDashboard()})("keydown",function(){return n.addDashboard()}),p(4,"button",3)(5,"mat-icon"),f(6,"add_box"),g()(),p(7,"p",4)(8,"i"),f(9,"Add Dashboard"),g()()()()),i&2&&(b(),Xe(n._dashboard.dashboards()))},dependencies:[wt,Y,ht,L,M,Xt,Yt,ct,lt,et],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow-y:auto;scroll-behavior:smooth}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center;border:2px solid transparent}@media(max-width:600px)and (orientation:portrait){.dashboard-manage[_ngcontent-%COMP%]{padding:0 70px}.dashboard-card[_ngcontent-%COMP%]{height:175px}}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-highest);cursor:pointer}.dashboard-item[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);cursor:pointer}.dashboard-item-add[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{position:absolute;top:20px;left:20px;display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--kip-contrast-dim-color);color:var(--mat-sys-surface-bright);border-radius:25%;align-content:center;align-items:center;justify-content:center;font-weight:700;font-size:1.25em;z-index:1}.dashboard-icon[_ngcontent-%COMP%]{opacity:.5}.dashboard-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:0;font-size:1.1em}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return o})();var xn=(()=>{class o{_router=c(_t);app=c(ut);_responsive=c(ot);_isPhonePortrait=be(this._responsive.observe(fe.HandsetPortrait));_isPhoneLandscape=be(this._responsive.observe(fe.HandsetLandscape));isPhonePortrait=ge(()=>this._isPhonePortrait().matches);isPhoneLandscape=ge(()=>this._isPhoneLandscape().matches);closePage(){this._router.navigate(["/dashboard"])}onActionItem(e){switch(e){case"help":this._router.navigate(["/help"]);break;case"datainspector":this._router.navigate(["/data"]);break;case"remotecontrol":this._router.navigate(["/remote"]);break;case"options":this._router.navigate(["/options"]);break;default:break}}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["settings"]],decls:11,vars:20,consts:[[1,"home-container"],[1,"actions-header-container"],[1,"actions-buttons-container"],["svgIcon","settings","label","Options",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","troubleshoot","label","Data Inspector",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","remote-control","label","Remote Control",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","help-center","label","Help",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["mat-icon-button","",1,"dialog-close-icon",3,"click"],[1,"dashboards-editor"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"tile-large-icon",3),m("click",function(){return n.onActionItem("options")})("keydown.enter",function(){return n.onActionItem("options")})("keydown.space",function(){return n.onActionItem("options")}),g(),p(4,"tile-large-icon",4),m("click",function(){return n.onActionItem("datainspector")})("keydown.enter",function(){return n.onActionItem("datainspector")})("keydown.space",function(){return n.onActionItem("datainspector")}),g(),p(5,"tile-large-icon",5),m("click",function(){return n.onActionItem("remotecontrol")})("keydown.enter",function(){return n.onActionItem("remotecontrol")})("keydown.space",function(){return n.onActionItem("remotecontrol")}),g(),p(6,"tile-large-icon",6),m("click",function(){return n.onActionItem("help")})("keydown.enter",function(){return n.onActionItem("help")})("keydown.space",function(){return n.onActionItem("help ")}),g()(),p(7,"button",7),m("click",function(){return n.closePage()}),p(8,"mat-icon"),f(9,"close"),g()()(),j(10,"dashboards-editor",8),g()),i&2&&(b(3),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48))},dependencies:[L,M,Y,dt,Ct,mt,ei],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.actions-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;width:100%;padding:5px 0 5px 10px}.with-label[_ngcontent-%COMP%]{height:80px;width:100px}.no-label[_ngcontent-%COMP%]{height:58px;width:63px}.dashboard-editor[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto}.actions-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px;margin-top:6px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return o})();export{xn as SettingsComponent};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{d as O,f as Re,g as v,h as Ae,i as We,k as Ie}from"./chunk-2GOHQZH5.js";import{A as de,Aa as R,Ca as ue,Cb as N,Da as fe,Db as H,Eb as Y,Fa as ge,Fb as F,G as he,Gb as ke,Hb as Se,I as pe,Jc as Ee,K as me,Ka as be,Lc as Q,Nb as q,Nd as Z,Ob as ve,Od as Ce,Oe as u,Qb as P,Rb as C,Sb as k,Ub as ye,Va as T,Vb as xe,Wb as De,Xd as Oe,ac as S,ae as J,be as $e,dc as G,ee as U,fb as _,fc as K,fe as X,g as oe,gb as A,h as ne,j as w,k as d,ka as E,l as re,la as $,m as b,n as M,na as L,ob as _e,pa as p,rc as Me,rd as Te,s as ce,sd as we,te as V,ub as z,wb as W,xb as I,z as le}from"./chunk-PZ6I6W3H.js";var ze={url:"",deserializer:a=>JSON.parse(a.data),serializer:a=>JSON.stringify(a)},He="WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }",j=class a extends re{constructor(o,e){if(super(),this._socket=null,o instanceof w)this.destination=e,this.source=o;else{let t=this._config=Object.assign({},ze);if(this._output=new d,typeof o=="string")t.url=o;else for(let i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);if(!t.WebSocketCtor&&WebSocket)t.WebSocketCtor=WebSocket;else if(!t.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new M}}lift(o){let e=new a(this._config,this.destination);return e.operator=o,e.source=this,e}_resetState(){this._socket=null,this.source||(this.destination=new M),this._output=new d}multiplex(o,e,t){let i=this;return new w(s=>{try{i.next(o())}catch(r){s.error(r)}let n=i.subscribe({next:r=>{try{t(r)&&s.next(r)}catch(c){s.error(c)}},error:r=>s.error(r),complete:()=>s.complete()});return()=>{try{i.next(e())}catch(r){s.error(r)}n.unsubscribe()}})}_connectSocket(){let{WebSocketCtor:o,protocol:e,url:t,binaryType:i}=this._config,s=this._output,n=null;try{n=e?new o(t,e):new o(t),this._socket=n,i&&(this._socket.binaryType=i)}catch(c){s.error(c);return}let r=new oe(()=>{this._socket=null,n&&n.readyState===1&&n.close()});n.onopen=c=>{let{_socket:l}=this;if(!l){n.close(),this._resetState();return}let{openObserver:f}=this._config;f&&f.next(c);let g=this.destination;this.destination=ne.create(h=>{if(n.readyState===1)try{let{serializer:m}=this._config;n.send(m(h))}catch(m){this.destination.error(m)}},h=>{let{closingObserver:m}=this._config;m&&m.next(void 0),h&&h.code?n.close(h.code,h.reason):s.error(new TypeError(He)),this._resetState()},()=>{let{closingObserver:h}=this._config;h&&h.next(void 0),n.close(),this._resetState()}),g&&g instanceof M&&r.add(g.subscribe(this.destination))},n.onerror=c=>{this._resetState(),s.error(c)},n.onclose=c=>{n===this._socket&&this._resetState();let{closeObserver:l}=this._config;l&&l.next(c),c.wasClean?s.complete():s.error(c)},n.onmessage=c=>{try{let{deserializer:l}=this._config;s.next(l(c))}catch(l){s.error(l)}}}_subscribe(o){let{source:e}=this;return e?e.subscribe(o):(this._socket||this._connectSocket(),this._output.subscribe(o),o.add(()=>{let{_socket:t}=this;this._output.observers.length===0&&(t&&(t.readyState===1||t.readyState===0)&&t.close(),this._resetState())}),o)}unsubscribe(){let{_socket:o}=this;o&&(o.readyState===1||o.readyState===0)&&o.close(),this._resetState(),super.unsubscribe()}};function ee(a){return new j(a)}var Ne=(()=>{class a{_destroyRef=p(R);_skRequests$=new d;_skNotificationsMsg$=new d;_skValue$=new d;_skMetadata$=new d;_vesselSelfUrn$=new d;_selfUrn=void 0;streamEndpoint={operation:0,message:"Not connected",hasToken:!1};streamEndpoint$=new b(this.streamEndpoint);endpointWS=null;SubscriptionType="self";WS_CONNECTION_SUBSCRIBE="?subscribe=";WS_CONNECTION_META="&sendMeta=all";socketWS$;socketWSCloseEvent$=new d;socketWSOpenEvent$=new d;authToken=null;server=p(We);auth=p(Ie);connectionStateMachine=p(Ae);zones=p(fe);FLATTEN_CONFIG={maxDepth:3,maxObjectSize:20,enableFlattening:!0};DO_NOT_FLATTEN_PATHS=["displays."];constructor(){this.connectionStateMachine.setWebSocketRetryCallback(()=>{console.log("[Delta Service] Executing WebSocket retry via callback"),this.retryWebSocketConnection()}),this.server.serverServiceEndpoint$.pipe(u(this._destroyRef)).subscribe(e=>{e.operation===2&&(this.endpointWS=e.WsServiceUrl,e.subscribeAll?this.SubscriptionType="all":this.SubscriptionType="self")}),this.connectionStateMachine.state$.pipe(u(this._destroyRef)).subscribe(e=>{switch(e){case v.WebSocketConnecting:this.handleWebSocketConnecting();break;case v.Connected:break;case v.Disconnected:case v.WebSocketError:case v.PermanentFailure:this.handleDisconnection();break}}),this.auth.authToken$.pipe(u(this._destroyRef)).subscribe(e=>{this.authToken!=e&&(this.authToken=e,this.socketWS$&&this.connectionStateMachine.isFullyConnected()&&(this.closeWS("Token changed"),this.connectionStateMachine.startWebSocketConnection()))}),this.socketWSOpenEvent$.pipe(u(this._destroyRef)).subscribe(()=>{this.streamEndpoint.message="Connected",this.streamEndpoint.operation=2,this.authToken?console.log("[Delta Service] WebSocket connected with Authorization Token"):console.log("[Delta Service] WebSocket connected without Authorization Token"),this.streamEndpoint$.next(this.streamEndpoint),this.connectionStateMachine.onWebSocketConnected()}),this.socketWSCloseEvent$.pipe(u(this._destroyRef)).subscribe(e=>{e.wasClean?(console.log("[Delta Service] WebSocket closed cleanly"),this.streamEndpoint.message="WebSocket closed",this.streamEndpoint.operation=0):(console.log("[Delta Service] WebSocket terminated due to socket error"),this.streamEndpoint.message="WebSocket error",this.streamEndpoint.operation=3,this.connectionStateMachine.onWebSocketError("WebSocket connection lost")),this.streamEndpoint$.next(this.streamEndpoint)}),he(document,"visibilitychange").pipe(u(this._destroyRef)).subscribe(()=>{document.visibilityState==="visible"?(console.log("[Delta Service] App resumed, checking WebSocket connection..."),this.checkAndReconnect("App resumed")):document.visibilityState==="hidden"&&console.log("[Delta Service] App suspended")})}connectWS(e){this.streamEndpoint.message="Connecting",this.streamEndpoint.operation=1,console.log(`[Delta Service] ${e}: WebSocket opening...`),this.streamEndpoint$.next(this.streamEndpoint),this.socketWS$=this.getNewWebSocket(),this.zones.runOutsideAngular(()=>{this.socketWS$.pipe(u(this._destroyRef)).subscribe({next:t=>this.processWebsocketMessage(t),error:t=>{console.error("[Delta Service] WebSocket error:",t)}})})}retryWebSocketConnection(){if(console.log("[Delta Service] Retrying WebSocket connection"),!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available for retry"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Retrying connection"),this.connectWS("WebSocket retry attempt")}handleWebSocketConnecting(){if(!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Starting new connection"),this.connectWS("ConnectionStateMachine request")}handleDisconnection(){this.socketWS$&&this.closeWS("ConnectionStateMachine disconnection"),this.streamEndpoint.message="Not connected",this.streamEndpoint.operation=0,this.streamEndpoint$.next(this.streamEndpoint)}getNewWebSocket(){let e=this.WS_CONNECTION_SUBSCRIBE+this.SubscriptionType+this.WS_CONNECTION_META;return this.authToken!=null?(e+="&token="+this.authToken.token,this.streamEndpoint.hasToken=!0):this.streamEndpoint.hasToken=!1,ee({url:this.endpointWS+e,closeObserver:this.socketWSCloseEvent$,openObserver:this.socketWSOpenEvent$})}closeWS(e){this.socketWS$&&(this.streamEndpoint.operation=4,console.log("[Delta Service] "+e+": WebSocket closing..."),this.socketWS$.complete())}publishDelta(e){this.socketWS$?this.socketWS$.next(e):console.log("[Delta Service] No WebSocket present to send message - dropping message")}processWebsocketMessage(e){if(e.updates){this.parseUpdates(e.updates,e.context);return}if(e.requestId){this._skRequests$.next(e);return}if(e.errorMessage){console.warn("[Delta Service] Service received stream error message: "+e.errorMessage);return}if(e.self){this._selfUrn=e.self,this._vesselSelfUrn$.next(e.self),this.server.setServerInfo(e.name,e.version,e.roles);return}console.warn("[Delta Service] Unknown message type. Message content:"+e)}parseUpdates(e,t){e.forEach(i=>{i.meta!==void 0&&i.meta.forEach(s=>this.parseSkMeta(s,t)),i.values!==void 0&&i.values.forEach(s=>{if(s.path.startsWith("notifications."))this._skNotificationsMsg$.next(s);else if(typeof s.value=="object"&&s.value!==null)if(this.DO_NOT_FLATTEN_PATHS.some(n=>s.path.includes(n))){let n={context:t,path:s.path,source:i.$source,timestamp:i.timestamp,value:s.value};this._skValue$.next(n)}else this.FLATTEN_CONFIG.enableFlattening&&this.canFlattenCompletely(s.value,this.FLATTEN_CONFIG.maxDepth,this.FLATTEN_CONFIG.maxObjectSize)?this.flattenObjectValue(s.value,s.path).forEach(r=>{let c={context:t,path:r.path,source:i.$source,timestamp:i.timestamp,value:r.value};this._skValue$.next(c)}):Object.keys(s.value).forEach(n=>{let r={context:t,path:`${s.path}.${n}`,source:i.$source,timestamp:i.timestamp,value:s.value[n]};this._skValue$.next(r)});else{let n={context:t,path:s.path,source:i.$source,timestamp:i.timestamp,value:s.value};this._skValue$.next(n)}})})}canFlattenCompletely(e,t,i,s=0){if(s>=t)return!1;if(typeof e!="object"||e===null)return!0;let n=Object.keys(e);if(n.length>i)return!1;for(let r of n)if(!this.canFlattenCompletely(e[r],t,i,s+1))return!1;return!0}flattenObjectValue(e,t,i=0){let s=[];if(typeof e!="object"||e===null||i>=this.FLATTEN_CONFIG.maxDepth)return[{path:t,value:e}];let n=Object.keys(e);for(let r of n){let c=t?`${t}.${r}`:r,l=this.flattenObjectValue(e[r],c,i+1);s.push(...l)}return s}parseSkMeta(e,t){e.value.properties!==void 0?Object.keys(e.value.properties).forEach(i=>{this._skMetadata$.next({context:t,path:`${e.path}.${i}`,meta:e.value.properties[i]})}):this._skMetadata$.next({context:t,path:e.path,meta:e.value})}getDataStreamStatusAsO(){return this.streamEndpoint$.asObservable()}subscribeRequestUpdates(){return this._skRequests$.asObservable()}subscribeNotificationsUpdates(){return this._skNotificationsMsg$.asObservable()}subscribeDataPathsUpdates(){return this._skValue$.asObservable()}subscribeMetadataUpdates(){return this._skMetadata$.asObservable()}subscribeSelfUpdates(){return this._vesselSelfUrn$.asObservable()}checkAndReconnect(e){this.connectionStateMachine.isFullyConnected()?console.log(`[Delta Service] ${e}: Connection is active.`):this.connectionStateMachine.isHTTPConnected()&&this.connectionStateMachine.currentState!==v.WebSocketRetrying?(console.log(`[Delta Service] ${e}: WebSocket disconnected, requesting reconnection...`),this.connectionStateMachine.startWebSocketConnection()):console.log(`[Delta Service] ${e}: HTTP not connected, cannot start WebSocket`)}ngOnDestroy(){this.closeWS("App terminated"),this._skRequests$.complete(),this._skNotificationsMsg$.complete(),this._skValue$.complete(),this._skMetadata$.complete(),this._vesselSelfUrn$.complete(),this.streamEndpoint$.complete(),this.socketWSOpenEvent$.complete(),this.socketWSCloseEvent$.complete(),this.socketWS$?.complete()}static \u0275fac=function(t){return new(t||a)};static \u0275prov=E({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var x=(function(a){return a.Normal="normal",a.Nominal="nominal",a.Alert="alert",a.Warn="warn",a.Alarm="alarm",a.Emergency="emergency",a})(x||{});var Ye=(function(a){return a.Visual="visual",a.Sound="sound",a})(Ye||{});var qe="self",Fe=a=>isFinite(+(a instanceof Date?a:new Date(a)))?!!new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$").test(a):!1,Pe=a=>{if(a)return a==="RFC 3339 (UTC)"?"Date":"number"},Pt=(()=>{class a{delta=p(Ne);_destroyRef=p(R);_deltaUpdatesCounter=0;_deltaUpdatesSubject=new M(10);_isSkDataFullTreeActive=!1;_skDataSubject$=new b([]);_skDataEmitTimer=null;_skDataEmitIntervalMs=200;_dataServiceMeta=[];_dataServiceMetaByPath=new Map;_isSkMetaFullTreeActive=!1;_dataServiceMetaSubject$=new b([]);_skNotificationMsg$=new d;_skNotificationMeta$=new d;_isReset=new d;_pathUpdates$=new d;_selfUrn="self";_skData=new Map;_skDataArrayCache=[];_skDataIndexByPath=new Map;_pathRegister=[];_pathRegisterByPath=new Map;constructor(){pe(1e3).pipe(u(this._destroyRef)).subscribe(()=>{let e={timestamp:Date.now(),value:this._deltaUpdatesCounter};this._deltaUpdatesSubject.next(e),this._deltaUpdatesCounter=0}),this.delta.subscribeDataPathsUpdates().pipe(u(this._destroyRef)).subscribe(e=>{this.updatePathData(e)}),this.delta.subscribeMetadataUpdates().pipe(u(this._destroyRef)).subscribe(e=>{this.setMeta(e)}),this.delta.subscribeNotificationsUpdates().pipe(u(this._destroyRef)).subscribe(e=>{let t=e.path.replace("notifications.","self."),i=this._skData.get(t);if(i&&i.state!==e.value.state){i.state=e.value.state;let s=this._pathRegisterByPath.get(t);if(s?.length)for(let n of s)n._pathState$.next(i.state)}this._skNotificationMsg$.next(e)}),this.delta.subscribeSelfUpdates().pipe(u(this._destroyRef)).subscribe(e=>{this.setSelfUrn(e)})}getSignalkDeltaUpdateStatistics(){return this._deltaUpdatesSubject.asObservable()}resetSignalKData(){this._skData=new Map,this._skDataArrayCache=[],this._skDataIndexByPath.clear(),this._selfUrn="self",this._isReset.next(!0)}unsubscribePath(e){let t=this._pathRegister.findIndex(i=>i.path===e);if(t!==-1){let i=this._pathRegister[t];i.combinedSub?.unsubscribe(),i._pathData$?.complete(),i._pathState$?.complete(),i.pathDataUpdate$?.complete(),i.pathMeta$?.complete(),this._pathRegister.splice(t,1);let s=this._pathRegisterByPath.get(e);if(s){let n=s.filter(r=>r!==i);n.length?this._pathRegisterByPath.set(e,n):this._pathRegisterByPath.delete(e)}}}subscribePath(e,t){let i=this._pathRegisterByPath.get(e),s=i?.find(D=>D.path===e&&D.source===t);if(s)return s.pathDataUpdate$;let n=null,r=null,c=null,l=x.Normal,f={data:{value:null,timestamp:null},state:l},g=null,h=this._skData.get(e);h&&(n=t==="default"?h.pathValue:h.sources?.[t]?.sourceValue??null,r=t==="default"?h.pathTimestamp:h.sources?.[t]?.sourceTimestamp??null,c=r?new Date(r):null,f={data:{value:n,timestamp:c},state:h.state||l},l=h.state||l,g=h.meta||null);let m={path:e,source:t,_pathData$:new b(f.data),_pathState$:new b(f.state),pathDataUpdate$:new b(f),pathMeta$:new b(g?O(g):null)},Be=de([m._pathData$,m._pathState$]).pipe(le(([D,Le])=>({data:D,state:Le})));return m.combinedSub=Be.subscribe(D=>m.pathDataUpdate$.next(D)),this._pathRegister.push(m),i?i.push(m):this._pathRegisterByPath.set(e,[m]),m.pathDataUpdate$}subscribePathTree(e,t="default"){let i=this.normalizePathPrefix(e);return new w(s=>{for(let r of this._skData.values())r.path.startsWith(i)&&s.next({path:r.path,update:this.buildPathUpdate(r,t)});let n=this._pathUpdates$.pipe(me(r=>r.fullPath.startsWith(i))).subscribe(r=>{let c=this._skData.get(r.fullPath);c&&s.next({path:c.path,update:this.buildPathUpdate(c,t)})});return()=>n.unsubscribe()}).pipe(u(this._destroyRef))}updatePathData(e){this._deltaUpdatesCounter++;let t=this.setPathContext(e.context,e.path),i=this._skData.get(t);if(i)i.defaultSource===void 0&&(i.defaultSource=e.source),i.type===void 0&&e.value!==null&&(i.type=typeof e.value,i.type==="string"&&Fe(e.value)&&(i.type="Date")),i.pathValue=e.value,i.pathTimestamp=e.timestamp,i.sources[e.source]={sourceTimestamp:e.timestamp,sourceValue:e.value};else{let n=e.value===null?void 0:typeof e.value;n==="string"&&Fe(e.value)&&(n="Date"),i={path:t,pathValue:e.value,pathTimestamp:e.timestamp,defaultSource:e.source,type:n,state:x.Normal,sources:{[e.source]:{sourceTimestamp:e.timestamp,sourceValue:e.value}}},this._skData.set(t,i)}let s=this._pathRegisterByPath.get(t)??[];if(s.length){let n={value:i.pathValue,timestamp:i.pathTimestamp?new Date(i.pathTimestamp):null},r=s.find(l=>l.source==="default");r&&r._pathData$.next(n);let c=s.find(l=>l.source===e.source);c&&c._pathData$.next(n)}this._isSkDataFullTreeActive&&(this.upsertSkDataCache(i),this.scheduleSkDataFullTreeEmit()),this._pathUpdates$.next({fullPath:t,update:e})}setMeta(e){if(e.path.startsWith("notifications."))this._skNotificationMeta$.next(e);else{let t=this.setPathContext(e.context,e.path),i=this._skData.get(t);i?(i.type==="object"&&e.meta.units&&(i.type=Pe(e.meta.units)),i.meta=Re({},i.meta,e.meta)):(i={path:t,pathValue:void 0,pathTimestamp:void 0,type:Pe(e.meta.units),state:x.Normal,defaultSource:void 0,sources:{},meta:e.meta?O(e.meta):null},this._skData.set(t,i),this._isSkDataFullTreeActive&&(this.upsertSkDataCache(i),this.scheduleSkDataFullTreeEmit()));let s=this._pathRegisterByPath.get(t);if(s?.length)for(let n of s)n.pathMeta$.next(i.meta?O(i.meta):null);this._isSkMetaFullTreeActive&&(this._dataServiceMetaByPath.set(t,{path:t,meta:i.meta}),this._dataServiceMeta=Array.from(this._dataServiceMetaByPath.values()),this._dataServiceMetaSubject$.next(this._dataServiceMeta))}}startSkMetaFullTree(){this._isSkMetaFullTreeActive=!0,this._dataServiceMetaByPath.clear();for(let e of this.getSkDataArray())e.meta!==void 0&&e.path.startsWith("self.")&&this._dataServiceMetaByPath.set(e.path,{path:e.path,meta:e.meta});return this._dataServiceMeta=Array.from(this._dataServiceMetaByPath.values()),this._dataServiceMetaSubject$.next(this._dataServiceMeta),this._dataServiceMetaSubject$}stopSkMetaFullTree(){this._isSkMetaFullTreeActive=!1,this._dataServiceMetaSubject$.next([]),this._dataServiceMeta=[],this._dataServiceMetaByPath.clear()}startSkDataFullTree(){return this._isSkDataFullTreeActive=!0,this.refreshSkDataCache(),this.emitSkDataFullTree(),this._skDataSubject$}getSkDataArray(){return this._isSkDataFullTreeActive?this._skDataArrayCache:Array.from(this._skData.values())}observePathUpdates(){return this._pathUpdates$.asObservable()}stopSkDataFullTree(){this._isSkDataFullTreeActive=!1,this._skDataEmitTimer&&(clearTimeout(this._skDataEmitTimer),this._skDataEmitTimer=null),this._skDataArrayCache=[],this._skDataIndexByPath.clear()}scheduleSkDataFullTreeEmit(){!this._isSkDataFullTreeActive||this._skDataEmitTimer||(this._skDataEmitTimer=setTimeout(()=>{this._skDataEmitTimer=null,this.emitSkDataFullTree()},this._skDataEmitIntervalMs))}emitSkDataFullTree(){this._isSkDataFullTreeActive&&this._skDataSubject$.next(this._skDataArrayCache)}refreshSkDataCache(){this._skDataArrayCache=Array.from(this._skData.values()),this._skDataIndexByPath.clear(),this._skDataArrayCache.forEach((e,t)=>this._skDataIndexByPath.set(e.path,t))}upsertSkDataCache(e){let t=this._skDataIndexByPath.get(e.path);t===void 0?(this._skDataIndexByPath.set(e.path,this._skDataArrayCache.length),this._skDataArrayCache.push(e)):this._skDataArrayCache[t]=e}setSelfUrn(e){e!==""&&e!==null?(console.debug("[Signal K Data Service] Setting self to: "+e),this._selfUrn=e):console.error("[Signal K Data Service] Invalid self URN: "+e)}setPathContext(e,t){return e!==this._selfUrn?`${e}.${t}`:`${qe}.${t}`}normalizePathPrefix(e){let t=e?.trim()??"";return(t.endsWith(".*")||t.endsWith(":*")||t.endsWith("*"))&&(t=t.slice(0,-1)),t&&!t.endsWith(".")&&!t.endsWith(":")&&(t=`${t}.`),t}buildPathUpdate(e,t){let i=t==="default",s=i?e.pathValue:e.sources?.[t]?.sourceValue??null,n=i?e.pathTimestamp:e.sources?.[t]?.sourceTimestamp??null;return{data:{value:s,timestamp:n?new Date(n):null},state:e.state||x.Normal}}getPathsByType(e,t){return this.getSkDataArray().filter(i=>i.type===e&&(!t||i.path.startsWith("self"))).map(i=>i.path)}getPathsAndMetaByType(e,t=!1,i=!1,s=!0){return this.getSkDataArray().filter(n=>{let c=["string","number","boolean","object","undefined","function","symbol","bigint","Date"].includes(e)?n.type===e:n.meta?.type===e,l=!s||n.path.startsWith("self"),f=t===!0?n.meta?.supportsPut===!0:!0,g=i===!0?Array.isArray(n.meta?.zones)&&n.meta.zones.length>0:!0;return c&&l&&f&&g}).map(n=>({path:n.path,meta:n.meta}))}getPathObject(e){return O(this._skData.get(e))||null}getPathUnitType(e){return this._skData.get(e)?.meta?.units||null}timeoutPathObservable(e,t){let i=this._pathRegister.find(s=>s.path==e);if(i){let s;["string","Date","number","multiple"].includes(t)&&(s={data:{value:null,timestamp:null},state:x.Normal}),i.pathDataUpdate$.next(s)}}getNotificationMsgObservable(){return this._skNotificationMsg$.asObservable()}getNotificationMetaObservable(){return this._skNotificationMeta$.asObservable()}getPathMetaObservable(e){return this._pathRegisterByPath.get(e)?.[0]?.pathMeta$.asObservable()||ce(null)}getPathMeta(e){return this._skData.get(e)?.meta||null}isResetService(){return this._isReset.asObservable()}ngOnDestroy(){this._skDataEmitTimer&&(clearTimeout(this._skDataEmitTimer),this._skDataEmitTimer=null),this._deltaUpdatesSubject?.complete(),this._skNotificationMsg$?.complete(),this._skNotificationMeta$?.complete(),this._isReset?.complete(),this._skDataSubject$?.complete(),this._dataServiceMetaSubject$?.complete(),this._pathUpdates$?.complete()}static \u0275fac=function(t){return new(t||a)};static \u0275prov=E({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();var Ue=(()=>{class a{_animationsDisabled=Oe();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=_({type:a,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(t,i){t&2&&S("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(t,i){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.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{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.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{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
2
|
-
`],encapsulation:2,changeDetection:0})}return
|
|
3
|
-
`],encapsulation:2,changeDetection:0})}return
|
|
4
|
-
`],encapsulation:2,changeDetection:0})}return
|
|
5
|
-
`],encapsulation:2,changeDetection:0})}return
|
|
1
|
+
import{d as O,f as Re,g as v,h as Ae,i as We,k as Ie}from"./chunk-2GOHQZH5.js";import{A as de,Aa as R,Ca as ue,Cb as N,Da as fe,Db as H,Eb as Y,Fa as ge,Fb as P,G as he,Gb as ke,Hb as Se,I as pe,Jc as Ee,K as me,Ka as be,Lc as Q,Nb as q,Nd as Z,Ob as ve,Od as Ce,Oe as f,Qb as F,Rb as C,Sb as k,Ub as ye,Va as T,Vb as xe,Wb as De,Xd as Oe,ac as S,ae as J,be as $e,dc as G,ee as U,fb as _,fc as K,fe as X,g as oe,gb as A,h as ne,j as w,k as d,ka as E,l as re,la as $,m as b,n as M,na as L,ob as _e,pa as m,rc as Me,rd as Te,s as ce,sd as we,te as V,ub as z,wb as W,xb as I,z as le}from"./chunk-PZ6I6W3H.js";var ze={url:"",deserializer:s=>JSON.parse(s.data),serializer:s=>JSON.stringify(s)},He="WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }",j=class s extends re{constructor(o,e){if(super(),this._socket=null,o instanceof w)this.destination=e,this.source=o;else{let t=this._config=Object.assign({},ze);if(this._output=new d,typeof o=="string")t.url=o;else for(let i in o)o.hasOwnProperty(i)&&(t[i]=o[i]);if(!t.WebSocketCtor&&WebSocket)t.WebSocketCtor=WebSocket;else if(!t.WebSocketCtor)throw new Error("no WebSocket constructor can be found");this.destination=new M}}lift(o){let e=new s(this._config,this.destination);return e.operator=o,e.source=this,e}_resetState(){this._socket=null,this.source||(this.destination=new M),this._output=new d}multiplex(o,e,t){let i=this;return new w(a=>{try{i.next(o())}catch(r){a.error(r)}let n=i.subscribe({next:r=>{try{t(r)&&a.next(r)}catch(c){a.error(c)}},error:r=>a.error(r),complete:()=>a.complete()});return()=>{try{i.next(e())}catch(r){a.error(r)}n.unsubscribe()}})}_connectSocket(){let{WebSocketCtor:o,protocol:e,url:t,binaryType:i}=this._config,a=this._output,n=null;try{n=e?new o(t,e):new o(t),this._socket=n,i&&(this._socket.binaryType=i)}catch(c){a.error(c);return}let r=new oe(()=>{this._socket=null,n&&n.readyState===1&&n.close()});n.onopen=c=>{let{_socket:l}=this;if(!l){n.close(),this._resetState();return}let{openObserver:h}=this._config;h&&h.next(c);let g=this.destination;this.destination=ne.create(p=>{if(n.readyState===1)try{let{serializer:u}=this._config;n.send(u(p))}catch(u){this.destination.error(u)}},p=>{let{closingObserver:u}=this._config;u&&u.next(void 0),p&&p.code?n.close(p.code,p.reason):a.error(new TypeError(He)),this._resetState()},()=>{let{closingObserver:p}=this._config;p&&p.next(void 0),n.close(),this._resetState()}),g&&g instanceof M&&r.add(g.subscribe(this.destination))},n.onerror=c=>{this._resetState(),a.error(c)},n.onclose=c=>{n===this._socket&&this._resetState();let{closeObserver:l}=this._config;l&&l.next(c),c.wasClean?a.complete():a.error(c)},n.onmessage=c=>{try{let{deserializer:l}=this._config;a.next(l(c))}catch(l){a.error(l)}}}_subscribe(o){let{source:e}=this;return e?e.subscribe(o):(this._socket||this._connectSocket(),this._output.subscribe(o),o.add(()=>{let{_socket:t}=this;this._output.observers.length===0&&(t&&(t.readyState===1||t.readyState===0)&&t.close(),this._resetState())}),o)}unsubscribe(){let{_socket:o}=this;o&&(o.readyState===1||o.readyState===0)&&o.close(),this._resetState(),super.unsubscribe()}};function ee(s){return new j(s)}var Ne=(()=>{class s{_destroyRef=m(R);_skRequests$=new d;_skNotificationsMsg$=new d;_skValue$=new d;_skMetadata$=new d;_vesselSelfUrn$=new d;_selfUrn=void 0;streamEndpoint={operation:0,message:"Not connected",hasToken:!1};streamEndpoint$=new b(this.streamEndpoint);endpointWS=null;SubscriptionType="self";WS_CONNECTION_SUBSCRIBE="?subscribe=";WS_CONNECTION_META="&sendMeta=all";socketWS$;socketWSCloseEvent$=new d;socketWSOpenEvent$=new d;authToken=null;server=m(We);auth=m(Ie);connectionStateMachine=m(Ae);zones=m(fe);FLATTEN_CONFIG={maxDepth:3,maxObjectSize:20,enableFlattening:!0};DO_NOT_FLATTEN_PATHS=["displays."];constructor(){this.connectionStateMachine.setWebSocketRetryCallback(()=>{console.log("[Delta Service] Executing WebSocket retry via callback"),this.retryWebSocketConnection()}),this.server.serverServiceEndpoint$.pipe(f(this._destroyRef)).subscribe(e=>{e.operation===2&&(this.endpointWS=e.WsServiceUrl,e.subscribeAll?this.SubscriptionType="all":this.SubscriptionType="self")}),this.connectionStateMachine.state$.pipe(f(this._destroyRef)).subscribe(e=>{switch(e){case v.WebSocketConnecting:this.handleWebSocketConnecting();break;case v.Connected:break;case v.Disconnected:case v.WebSocketError:case v.PermanentFailure:this.handleDisconnection();break}}),this.auth.authToken$.pipe(f(this._destroyRef)).subscribe(e=>{this.authToken!=e&&(this.authToken=e,this.socketWS$&&this.connectionStateMachine.isFullyConnected()&&(this.closeWS("Token changed"),this.connectionStateMachine.startWebSocketConnection()))}),this.socketWSOpenEvent$.pipe(f(this._destroyRef)).subscribe(()=>{this.streamEndpoint.message="Connected",this.streamEndpoint.operation=2,this.authToken?console.log("[Delta Service] WebSocket connected with Authorization Token"):console.log("[Delta Service] WebSocket connected without Authorization Token"),this.streamEndpoint$.next(this.streamEndpoint),this.connectionStateMachine.onWebSocketConnected()}),this.socketWSCloseEvent$.pipe(f(this._destroyRef)).subscribe(e=>{e.wasClean?(console.log("[Delta Service] WebSocket closed cleanly"),this.streamEndpoint.message="WebSocket closed",this.streamEndpoint.operation=0):(console.log("[Delta Service] WebSocket terminated due to socket error"),this.streamEndpoint.message="WebSocket error",this.streamEndpoint.operation=3,this.connectionStateMachine.onWebSocketError("WebSocket connection lost")),this.streamEndpoint$.next(this.streamEndpoint)}),he(document,"visibilitychange").pipe(f(this._destroyRef)).subscribe(()=>{document.visibilityState==="visible"?(console.log("[Delta Service] App resumed, checking WebSocket connection..."),this.checkAndReconnect("App resumed")):document.visibilityState==="hidden"&&console.log("[Delta Service] App suspended")})}connectWS(e){this.streamEndpoint.message="Connecting",this.streamEndpoint.operation=1,console.log(`[Delta Service] ${e}: WebSocket opening...`),this.streamEndpoint$.next(this.streamEndpoint),this.socketWS$=this.getNewWebSocket(),this.zones.runOutsideAngular(()=>{this.socketWS$.pipe(f(this._destroyRef)).subscribe({next:t=>this.processWebsocketMessage(t),error:t=>{console.error("[Delta Service] WebSocket error:",t)}})})}retryWebSocketConnection(){if(console.log("[Delta Service] Retrying WebSocket connection"),!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available for retry"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Retrying connection"),this.connectWS("WebSocket retry attempt")}handleWebSocketConnecting(){if(!this.endpointWS){console.warn("[Delta Service] No WebSocket endpoint available"),this.connectionStateMachine.onWebSocketError("No WebSocket endpoint available");return}this.socketWS$&&this.closeWS("Starting new connection"),this.connectWS("ConnectionStateMachine request")}handleDisconnection(){this.socketWS$&&this.closeWS("ConnectionStateMachine disconnection"),this.streamEndpoint.message="Not connected",this.streamEndpoint.operation=0,this.streamEndpoint$.next(this.streamEndpoint)}getNewWebSocket(){let e=this.WS_CONNECTION_SUBSCRIBE+this.SubscriptionType+this.WS_CONNECTION_META;return this.authToken!=null?(e+="&token="+this.authToken.token,this.streamEndpoint.hasToken=!0):this.streamEndpoint.hasToken=!1,ee({url:this.endpointWS+e,closeObserver:this.socketWSCloseEvent$,openObserver:this.socketWSOpenEvent$})}closeWS(e){this.socketWS$&&(this.streamEndpoint.operation=4,console.log("[Delta Service] "+e+": WebSocket closing..."),this.socketWS$.complete())}publishDelta(e){this.socketWS$?this.socketWS$.next(e):console.log("[Delta Service] No WebSocket present to send message - dropping message")}processWebsocketMessage(e){if(e.updates){this.parseUpdates(e.updates,e.context);return}if(e.requestId){this._skRequests$.next(e);return}if(e.errorMessage){console.warn("[Delta Service] Service received stream error message: "+e.errorMessage);return}if(e.self){this._selfUrn=e.self,this._vesselSelfUrn$.next(e.self),this.server.setServerInfo(e.name,e.version,e.roles);return}console.warn("[Delta Service] Unknown message type. Message content:"+e)}parseUpdates(e,t){e.forEach(i=>{i.meta!==void 0&&i.meta.forEach(a=>this.parseSkMeta(a,t)),i.values!==void 0&&i.values.forEach(a=>{if(a.path.startsWith("notifications."))this._skNotificationsMsg$.next(a);else if(typeof a.value=="object"&&a.value!==null)if(this.DO_NOT_FLATTEN_PATHS.some(n=>a.path.includes(n))){let n={context:t,path:a.path,source:i.$source,timestamp:i.timestamp,value:a.value};this._skValue$.next(n)}else this.FLATTEN_CONFIG.enableFlattening&&this.canFlattenCompletely(a.value,this.FLATTEN_CONFIG.maxDepth,this.FLATTEN_CONFIG.maxObjectSize)?this.flattenObjectValue(a.value,a.path).forEach(r=>{let c={context:t,path:r.path,source:i.$source,timestamp:i.timestamp,value:r.value};this._skValue$.next(c)}):Object.keys(a.value).forEach(n=>{let r={context:t,path:`${a.path}.${n}`,source:i.$source,timestamp:i.timestamp,value:a.value[n]};this._skValue$.next(r)});else{let n={context:t,path:a.path,source:i.$source,timestamp:i.timestamp,value:a.value};this._skValue$.next(n)}})})}canFlattenCompletely(e,t,i,a=0){if(a>=t)return!1;if(typeof e!="object"||e===null)return!0;let n=Object.keys(e);if(n.length>i)return!1;for(let r of n)if(!this.canFlattenCompletely(e[r],t,i,a+1))return!1;return!0}flattenObjectValue(e,t,i=0){let a=[];if(typeof e!="object"||e===null||i>=this.FLATTEN_CONFIG.maxDepth)return[{path:t,value:e}];let n=Object.keys(e);for(let r of n){let c=t?`${t}.${r}`:r,l=this.flattenObjectValue(e[r],c,i+1);a.push(...l)}return a}parseSkMeta(e,t){e.value.properties!==void 0?Object.keys(e.value.properties).forEach(i=>{this._skMetadata$.next({context:t,path:`${e.path}.${i}`,meta:e.value.properties[i]})}):this._skMetadata$.next({context:t,path:e.path,meta:e.value})}getDataStreamStatusAsO(){return this.streamEndpoint$.asObservable()}subscribeRequestUpdates(){return this._skRequests$.asObservable()}subscribeNotificationsUpdates(){return this._skNotificationsMsg$.asObservable()}subscribeDataPathsUpdates(){return this._skValue$.asObservable()}subscribeMetadataUpdates(){return this._skMetadata$.asObservable()}subscribeSelfUpdates(){return this._vesselSelfUrn$.asObservable()}checkAndReconnect(e){this.connectionStateMachine.isFullyConnected()?console.log(`[Delta Service] ${e}: Connection is active.`):this.connectionStateMachine.isHTTPConnected()&&this.connectionStateMachine.currentState!==v.WebSocketRetrying?(console.log(`[Delta Service] ${e}: WebSocket disconnected, requesting reconnection...`),this.connectionStateMachine.startWebSocketConnection()):console.log(`[Delta Service] ${e}: HTTP not connected, cannot start WebSocket`)}ngOnDestroy(){this.closeWS("App terminated"),this._skRequests$.complete(),this._skNotificationsMsg$.complete(),this._skValue$.complete(),this._skMetadata$.complete(),this._vesselSelfUrn$.complete(),this.streamEndpoint$.complete(),this.socketWSOpenEvent$.complete(),this.socketWSCloseEvent$.complete(),this.socketWS$?.complete()}static \u0275fac=function(t){return new(t||s)};static \u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var x=(function(s){return s.Normal="normal",s.Nominal="nominal",s.Alert="alert",s.Warn="warn",s.Alarm="alarm",s.Emergency="emergency",s})(x||{});var Ye=(function(s){return s.Visual="visual",s.Sound="sound",s})(Ye||{});var qe="self",Pe=s=>isFinite(+(s instanceof Date?s:new Date(s)))?!!new RegExp("^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$").test(s):!1,Fe=s=>{if(s)return s==="RFC 3339 (UTC)"?"Date":"number"},Ft=(()=>{class s{delta=m(Ne);_destroyRef=m(R);_deltaUpdatesCounter=0;_deltaUpdatesSubject=new M(10);_isSkDataFullTreeActive=!1;_skDataSubject$=new b([]);_skDataEmitTimer=null;_skDataEmitIntervalMs=200;_dataServiceMeta=[];_dataServiceMetaByPath=new Map;_isSkMetaFullTreeActive=!1;_dataServiceMetaSubject$=new b([]);_skNotificationMsg$=new d;_skNotificationMeta$=new d;_isReset=new d;_pathUpdates$=new d;_selfUrn="self";_skData=new Map;_pendingPathStates=new Map;_skDataArrayCache=[];_skDataIndexByPath=new Map;_pathRegister=[];_pathRegisterByPath=new Map;constructor(){pe(1e3).pipe(f(this._destroyRef)).subscribe(()=>{let e={timestamp:Date.now(),value:this._deltaUpdatesCounter};this._deltaUpdatesSubject.next(e),this._deltaUpdatesCounter=0}),this.delta.subscribeDataPathsUpdates().pipe(f(this._destroyRef)).subscribe(e=>{this.updatePathData(e)}),this.delta.subscribeMetadataUpdates().pipe(f(this._destroyRef)).subscribe(e=>{this.setMeta(e)}),this.delta.subscribeNotificationsUpdates().pipe(f(this._destroyRef)).subscribe(e=>{let t=e.path.replace("notifications.","self."),i=e.value.state,a=this._skData.get(t);if(a&&a.state!==i){a.state=i,this._pathUpdates$.next({fullPath:t,kind:"state"});let n=this._pathRegisterByPath.get(t);if(n?.length)for(let r of n)r._pathState$.next(a.state)}else a||this._pendingPathStates.set(t,i);this._skNotificationMsg$.next(e)}),this.delta.subscribeSelfUpdates().pipe(f(this._destroyRef)).subscribe(e=>{this.setSelfUrn(e)})}getSignalkDeltaUpdateStatistics(){return this._deltaUpdatesSubject.asObservable()}resetSignalKData(){this._skData=new Map,this._pendingPathStates.clear(),this._skDataArrayCache=[],this._skDataIndexByPath.clear(),this._selfUrn="self",this._isReset.next(!0)}unsubscribePath(e){let t=this._pathRegister.findIndex(i=>i.path===e);if(t!==-1){let i=this._pathRegister[t];i.combinedSub?.unsubscribe(),i._pathData$?.complete(),i._pathState$?.complete(),i.pathDataUpdate$?.complete(),i.pathMeta$?.complete(),this._pathRegister.splice(t,1);let a=this._pathRegisterByPath.get(e);if(a){let n=a.filter(r=>r!==i);n.length?this._pathRegisterByPath.set(e,n):this._pathRegisterByPath.delete(e)}}}subscribePath(e,t){let i=this._pathRegisterByPath.get(e),a=i?.find(D=>D.path===e&&D.source===t);if(a)return a.pathDataUpdate$;let n=null,r=null,c=null,l=x.Normal,h={data:{value:null,timestamp:null},state:l},g=null,p=this._skData.get(e);p&&(n=t==="default"?p.pathValue:p.sources?.[t]?.sourceValue??null,r=t==="default"?p.pathTimestamp:p.sources?.[t]?.sourceTimestamp??null,c=r?new Date(r):null,h={data:{value:n,timestamp:c},state:p.state||l},l=p.state||l,g=p.meta||null);let u={path:e,source:t,_pathData$:new b(h.data),_pathState$:new b(h.state),pathDataUpdate$:new b(h),pathMeta$:new b(g?O(g):null)},Be=de([u._pathData$,u._pathState$]).pipe(le(([D,Le])=>({data:D,state:Le})));return u.combinedSub=Be.subscribe(D=>u.pathDataUpdate$.next(D)),this._pathRegister.push(u),i?i.push(u):this._pathRegisterByPath.set(e,[u]),u.pathDataUpdate$}subscribePathTree(e,t="default"){let i=this.normalizePathPrefix(e);return new w(a=>{for(let r of this._skData.values())r.path.startsWith(i)&&a.next({path:r.path,update:this.buildPathUpdate(r,t)});let n=this._pathUpdates$.pipe(me(r=>r.fullPath.startsWith(i))).subscribe(r=>{let c=this._skData.get(r.fullPath);c&&a.next({path:c.path,update:this.buildPathUpdate(c,t)})});return()=>n.unsubscribe()}).pipe(f(this._destroyRef))}updatePathData(e){this._deltaUpdatesCounter++;let t=this.setPathContext(e.context,e.path),i=this._pendingPathStates.get(t),a=this._skData.get(t);if(a)a.defaultSource===void 0&&(a.defaultSource=e.source),a.type===void 0&&e.value!==null&&(a.type=typeof e.value,a.type==="string"&&Pe(e.value)&&(a.type="Date")),a.pathValue=e.value,a.pathTimestamp=e.timestamp,a.sources[e.source]={sourceTimestamp:e.timestamp,sourceValue:e.value};else{let r=e.value===null?void 0:typeof e.value;r==="string"&&Pe(e.value)&&(r="Date"),a={path:t,pathValue:e.value,pathTimestamp:e.timestamp,defaultSource:e.source,type:r,state:i??x.Normal,sources:{[e.source]:{sourceTimestamp:e.timestamp,sourceValue:e.value}}},this._skData.set(t,a),i!==void 0&&this._pendingPathStates.delete(t)}let n=this._pathRegisterByPath.get(t)??[];if(n.length){let r={value:a.pathValue,timestamp:a.pathTimestamp?new Date(a.pathTimestamp):null},c=n.find(h=>h.source==="default");c&&c._pathData$.next(r);let l=n.find(h=>h.source===e.source);l&&l._pathData$.next(r)}this._isSkDataFullTreeActive&&(this.upsertSkDataCache(a),this.scheduleSkDataFullTreeEmit()),this._pathUpdates$.next({fullPath:t,kind:"data",update:e})}setMeta(e){if(e.path.startsWith("notifications."))this._skNotificationMeta$.next(e);else{let t=this.setPathContext(e.context,e.path),i=this._pendingPathStates.get(t),a=this._skData.get(t);a?(a.type==="object"&&e.meta.units&&(a.type=Fe(e.meta.units)),a.meta=Re({},a.meta,e.meta)):(a={path:t,pathValue:void 0,pathTimestamp:void 0,type:Fe(e.meta.units),state:i??x.Normal,defaultSource:void 0,sources:{},meta:e.meta?O(e.meta):null},this._skData.set(t,a),i!==void 0&&this._pendingPathStates.delete(t),this._isSkDataFullTreeActive&&(this.upsertSkDataCache(a),this.scheduleSkDataFullTreeEmit()));let n=this._pathRegisterByPath.get(t);if(n?.length)for(let r of n)r.pathMeta$.next(a.meta?O(a.meta):null);this._isSkMetaFullTreeActive&&(this._dataServiceMetaByPath.set(t,{path:t,meta:a.meta}),this._dataServiceMeta=Array.from(this._dataServiceMetaByPath.values()),this._dataServiceMetaSubject$.next(this._dataServiceMeta))}}startSkMetaFullTree(){this._isSkMetaFullTreeActive=!0,this._dataServiceMetaByPath.clear();for(let e of this.getSkDataArray())e.meta!==void 0&&e.path.startsWith("self.")&&this._dataServiceMetaByPath.set(e.path,{path:e.path,meta:e.meta});return this._dataServiceMeta=Array.from(this._dataServiceMetaByPath.values()),this._dataServiceMetaSubject$.next(this._dataServiceMeta),this._dataServiceMetaSubject$}stopSkMetaFullTree(){this._isSkMetaFullTreeActive=!1,this._dataServiceMetaSubject$.next([]),this._dataServiceMeta=[],this._dataServiceMetaByPath.clear()}startSkDataFullTree(){return this._isSkDataFullTreeActive=!0,this.refreshSkDataCache(),this.emitSkDataFullTree(),this._skDataSubject$}getSkDataArray(){return this._isSkDataFullTreeActive?this._skDataArrayCache:Array.from(this._skData.values())}observePathUpdates(){return this._pathUpdates$.asObservable()}stopSkDataFullTree(){this._isSkDataFullTreeActive=!1,this._skDataEmitTimer&&(clearTimeout(this._skDataEmitTimer),this._skDataEmitTimer=null),this._skDataArrayCache=[],this._skDataIndexByPath.clear()}scheduleSkDataFullTreeEmit(){!this._isSkDataFullTreeActive||this._skDataEmitTimer||(this._skDataEmitTimer=setTimeout(()=>{this._skDataEmitTimer=null,this.emitSkDataFullTree()},this._skDataEmitIntervalMs))}emitSkDataFullTree(){this._isSkDataFullTreeActive&&this._skDataSubject$.next(this._skDataArrayCache)}refreshSkDataCache(){this._skDataArrayCache=Array.from(this._skData.values()),this._skDataIndexByPath.clear(),this._skDataArrayCache.forEach((e,t)=>this._skDataIndexByPath.set(e.path,t))}upsertSkDataCache(e){let t=this._skDataIndexByPath.get(e.path);t===void 0?(this._skDataIndexByPath.set(e.path,this._skDataArrayCache.length),this._skDataArrayCache.push(e)):this._skDataArrayCache[t]=e}setSelfUrn(e){e!==""&&e!==null?(console.debug("[Signal K Data Service] Setting self to: "+e),this._selfUrn=e):console.error("[Signal K Data Service] Invalid self URN: "+e)}setPathContext(e,t){return e!==this._selfUrn?`${e}.${t}`:`${qe}.${t}`}normalizePathPrefix(e){let t=e?.trim()??"";return(t.endsWith(".*")||t.endsWith(":*")||t.endsWith("*"))&&(t=t.slice(0,-1)),t&&!t.endsWith(".")&&!t.endsWith(":")&&(t=`${t}.`),t}buildPathUpdate(e,t){let i=t==="default",a=i?e.pathValue:e.sources?.[t]?.sourceValue??null,n=i?e.pathTimestamp:e.sources?.[t]?.sourceTimestamp??null;return{data:{value:a,timestamp:n?new Date(n):null},state:e.state||x.Normal}}getPathsByType(e,t){return this.getSkDataArray().filter(i=>i.type===e&&(!t||i.path.startsWith("self"))).map(i=>i.path)}getCachedPaths(e=!1){return this.getSkDataArray().map(t=>t.path).filter(t=>!e||t.startsWith("self."))}getPathsAndMetaByType(e,t=!1,i=!1,a=!0){return this.getSkDataArray().filter(n=>{let c=["string","number","boolean","object","undefined","function","symbol","bigint","Date"].includes(e)?n.type===e:n.meta?.type===e,l=!a||n.path.startsWith("self"),h=t===!0?n.meta?.supportsPut===!0:!0,g=i===!0?Array.isArray(n.meta?.zones)&&n.meta.zones.length>0:!0;return c&&l&&h&&g}).map(n=>({path:n.path,meta:n.meta}))}getPathObject(e){return O(this._skData.get(e))||null}getPathUnitType(e){return this._skData.get(e)?.meta?.units||null}timeoutPathObservable(e,t){let i=this._pathRegister.find(a=>a.path==e);if(i){let a;["string","Date","number","multiple"].includes(t)&&(a={data:{value:null,timestamp:null},state:x.Normal}),i.pathDataUpdate$.next(a)}}getNotificationMsgObservable(){return this._skNotificationMsg$.asObservable()}getNotificationMetaObservable(){return this._skNotificationMeta$.asObservable()}getPathMetaObservable(e){return this._pathRegisterByPath.get(e)?.[0]?.pathMeta$.asObservable()||ce(null)}getPathMeta(e){return this._skData.get(e)?.meta||null}isResetService(){return this._isReset.asObservable()}ngOnDestroy(){this._skDataEmitTimer&&(clearTimeout(this._skDataEmitTimer),this._skDataEmitTimer=null),this._deltaUpdatesSubject?.complete(),this._skNotificationMsg$?.complete(),this._skNotificationMeta$?.complete(),this._isReset?.complete(),this._skDataSubject$?.complete(),this._dataServiceMetaSubject$?.complete(),this._pathUpdates$?.complete()}static \u0275fac=function(t){return new(t||s)};static \u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Ue=(()=>{class s{_animationsDisabled=Oe();state="unchecked";disabled=!1;appearance="full";constructor(){}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=_({type:s,selectors:[["mat-pseudo-checkbox"]],hostAttrs:[1,"mat-pseudo-checkbox"],hostVars:12,hostBindings:function(t,i){t&2&&S("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(t,i){},styles:[`.mat-pseudo-checkbox{border-radius:2px;cursor:pointer;display:inline-block;vertical-align:middle;box-sizing:border-box;position:relative;flex-shrink:0;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1),background-color 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox::after{position:absolute;opacity:0;content:"";border-bottom:2px solid currentColor;transition:opacity 90ms cubic-bezier(0, 0, 0.2, 0.1)}.mat-pseudo-checkbox._mat-animation-noopable{transition:none !important;animation:none !important}.mat-pseudo-checkbox._mat-animation-noopable::after{transition:none}.mat-pseudo-checkbox-disabled{cursor:default}.mat-pseudo-checkbox-indeterminate::after{left:1px;opacity:1;border-radius:2px}.mat-pseudo-checkbox-checked::after{left:1px;border-left:2px solid currentColor;transform:rotate(-45deg);opacity:1;box-sizing:content-box}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-minimal-selected-checkmark-color, var(--mat-sys-primary))}.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{color:var(--mat-pseudo-checkbox-minimal-disabled-selected-checkmark-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full{border-color:var(--mat-pseudo-checkbox-full-unselected-icon-color, var(--mat-sys-on-surface-variant));border-width:2px;border-style:solid}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-disabled{border-color:var(--mat-pseudo-checkbox-full-disabled-unselected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate{background-color:var(--mat-pseudo-checkbox-full-selected-icon-color, var(--mat-sys-primary));border-color:rgba(0,0,0,0)}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{color:var(--mat-pseudo-checkbox-full-selected-checkmark-color, var(--mat-sys-on-primary))}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked.mat-pseudo-checkbox-disabled,.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate.mat-pseudo-checkbox-disabled{background-color:var(--mat-pseudo-checkbox-full-disabled-selected-icon-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.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{color:var(--mat-pseudo-checkbox-full-disabled-selected-checkmark-color, var(--mat-sys-surface))}.mat-pseudo-checkbox{width:18px;height:18px}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-checked::after{width:14px;height:6px;transform-origin:center;top:-4.2426406871px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-minimal.mat-pseudo-checkbox-indeterminate::after{top:8px;width:16px}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-checked::after{width:10px;height:4px;transform-origin:center;top:-2.8284271247px;left:0;bottom:0;right:0;margin:auto}.mat-pseudo-checkbox-full.mat-pseudo-checkbox-indeterminate::after{top:6px;width:12px}
|
|
2
|
+
`],encapsulation:2,changeDetection:0})}return s})();var Qe=["*",[["mat-option"],["ng-container"]]],Ze=["*","mat-option, ng-container"],Je=["text"],Xe=[[["mat-icon"]],"*"],et=["mat-icon","*"];function tt(s,o){if(s&1&&P(0,"mat-pseudo-checkbox",1),s&2){let e=F();N("disabled",e.disabled)("state",e.selected?"checked":"unchecked")}}function it(s,o){if(s&1&&P(0,"mat-pseudo-checkbox",3),s&2){let e=F();N("disabled",e.disabled)}}function at(s,o){if(s&1&&(H(0,"span",4),G(1),Y()),s&2){let e=F();T(),K("(",e.group.label,")")}}var te=new L("MAT_OPTION_PARENT_COMPONENT"),ie=new L("MatOptgroup"),st=(()=>{class s{label;disabled=!1;_labelId=m(Z).getId("mat-optgroup-label-");_inert;constructor(){let e=m(te,{optional:!0});this._inert=e?.inertGroups??!1}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=_({type:s,selectors:[["mat-optgroup"]],hostAttrs:[1,"mat-mdc-optgroup"],hostVars:3,hostBindings:function(t,i){t&2&&z("role",i._inert?null:"group")("aria-disabled",i._inert?null:i.disabled.toString())("aria-labelledby",i._inert?null:i._labelId)},inputs:{label:"label",disabled:[2,"disabled","disabled",Q]},exportAs:["matOptgroup"],features:[Me([{provide:ie,useExisting:s}])],ngContentSelectors:Ze,decls:5,vars:4,consts:[["role","presentation",1,"mat-mdc-optgroup-label",3,"id"],[1,"mdc-list-item__primary-text"]],template:function(t,i){t&1&&(C(Qe),ke(0,"span",0)(1,"span",1),G(2),k(3),Se()(),k(4,1)),t&2&&(S("mdc-list-item--disabled",i.disabled),q("id",i._labelId),T(2),K("",i.label," "))},styles:[`.mat-mdc-optgroup{color:var(--mat-optgroup-label-text-color, var(--mat-sys-on-surface-variant));font-family:var(--mat-optgroup-label-text-font, var(--mat-sys-title-small-font));line-height:var(--mat-optgroup-label-text-line-height, var(--mat-sys-title-small-line-height));font-size:var(--mat-optgroup-label-text-size, var(--mat-sys-title-small-size));letter-spacing:var(--mat-optgroup-label-text-tracking, var(--mat-sys-title-small-tracking));font-weight:var(--mat-optgroup-label-text-weight, var(--mat-sys-title-small-weight))}.mat-mdc-optgroup-label{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;outline:none}.mat-mdc-optgroup-label.mdc-list-item--disabled{opacity:.38}.mat-mdc-optgroup-label .mdc-list-item__primary-text{font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;white-space:normal;color:inherit}
|
|
3
|
+
`],encapsulation:2,changeDetection:0})}return s})(),B=class{source;isUserInput;constructor(o,e=!1){this.source=o,this.isUserInput=e}},ae=(()=>{class s{_element=m(be);_changeDetectorRef=m(Ee);_parent=m(te,{optional:!0});group=m(ie,{optional:!0});_signalDisableRipple=!1;_selected=!1;_active=!1;_mostRecentViewValue="";get multiple(){return this._parent&&this._parent.multiple}get selected(){return this._selected}value;id=m(Z).getId("mat-option-");get disabled(){return this.group&&this.group.disabled||this._disabled()}set disabled(e){this._disabled.set(e)}_disabled=ge(!1);get disableRipple(){return this._signalDisableRipple?this._parent.disableRipple():!!this._parent?.disableRipple}get hideSingleSelectionIndicator(){return!!(this._parent&&this._parent.hideSingleSelectionIndicator)}onSelectionChange=new ue;_text;_stateChanges=new d;constructor(){let e=m(Te);e.load($e),e.load(we),this._signalDisableRipple=!!this._parent&&_e(this._parent.disableRipple)}get active(){return this._active}get viewValue(){return(this._text?.nativeElement.textContent||"").trim()}select(e=!0){this._selected||(this._selected=!0,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}deselect(e=!0){this._selected&&(this._selected=!1,this._changeDetectorRef.markForCheck(),e&&this._emitSelectionChangeEvent())}focus(e,t){let i=this._getHostElement();typeof i.focus=="function"&&i.focus(t)}setActiveStyles(){this._active||(this._active=!0,this._changeDetectorRef.markForCheck())}setInactiveStyles(){this._active&&(this._active=!1,this._changeDetectorRef.markForCheck())}getLabel(){return this.viewValue}_handleKeydown(e){(e.keyCode===13||e.keyCode===32)&&!Ce(e)&&(this._selectViaInteraction(),e.preventDefault())}_selectViaInteraction(){this.disabled||(this._selected=this.multiple?!this._selected:!0,this._changeDetectorRef.markForCheck(),this._emitSelectionChangeEvent(!0))}_getTabIndex(){return this.disabled?"-1":"0"}_getHostElement(){return this._element.nativeElement}ngAfterViewChecked(){if(this._selected){let e=this.viewValue;e!==this._mostRecentViewValue&&(this._mostRecentViewValue&&this._stateChanges.next(),this._mostRecentViewValue=e)}}ngOnDestroy(){this._stateChanges.complete()}_emitSelectionChangeEvent(e=!1){this.onSelectionChange.emit(new B(this,e))}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=_({type:s,selectors:[["mat-option"]],viewQuery:function(t,i){if(t&1&&ye(Je,7),t&2){let a;xe(a=De())&&(i._text=a.first)}},hostAttrs:["role","option",1,"mat-mdc-option","mdc-list-item"],hostVars:11,hostBindings:function(t,i){t&1&&ve("click",function(){return i._selectViaInteraction()})("keydown",function(n){return i._handleKeydown(n)}),t&2&&(q("id",i.id),z("aria-selected",i.selected)("aria-disabled",i.disabled.toString()),S("mdc-list-item--selected",i.selected)("mat-mdc-option-multiple",i.multiple)("mat-mdc-option-active",i.active)("mdc-list-item--disabled",i.disabled))},inputs:{value:"value",id:"id",disabled:[2,"disabled","disabled",Q]},outputs:{onSelectionChange:"onSelectionChange"},exportAs:["matOption"],ngContentSelectors:et,decls:8,vars:5,consts:[["text",""],["aria-hidden","true",1,"mat-mdc-option-pseudo-checkbox",3,"disabled","state"],[1,"mdc-list-item__primary-text"],["state","checked","aria-hidden","true","appearance","minimal",1,"mat-mdc-option-pseudo-checkbox",3,"disabled"],[1,"cdk-visually-hidden"],["aria-hidden","true","mat-ripple","",1,"mat-mdc-option-ripple","mat-focus-indicator",3,"matRippleTrigger","matRippleDisabled"]],template:function(t,i){t&1&&(C(Xe),W(0,tt,1,2,"mat-pseudo-checkbox",1),k(1),H(2,"span",2,0),k(4,1),Y(),W(5,it,1,1,"mat-pseudo-checkbox",3),W(6,at,2,1,"span",4),P(7,"div",5)),t&2&&(I(i.multiple?0:-1),T(5),I(!i.multiple&&i.selected&&!i.hideSingleSelectionIndicator?5:-1),T(),I(i.group&&i.group._inert?6:-1),T(),N("matRippleTrigger",i._getHostElement())("matRippleDisabled",i.disabled||i.disableRipple))},dependencies:[Ue,J],styles:[`.mat-mdc-option{-webkit-user-select:none;user-select:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;min-height:48px;padding:0 16px;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--mat-option-label-text-color, var(--mat-sys-on-surface));font-family:var(--mat-option-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-option-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-option-label-text-size, var(--mat-sys-body-large-size));letter-spacing:var(--mat-option-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-option-label-text-weight, var(--mat-sys-body-large-weight))}.mat-mdc-option:hover:not(.mdc-list-item--disabled){background-color:var(--mat-option-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-option:focus.mdc-list-item,.mat-mdc-option.mat-mdc-option-active.mdc-list-item{background-color:var(--mat-option-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent));outline:0}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover){background-color:var(--mat-option-selected-state-layer-color, var(--mat-sys-secondary-container))}.mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled):not(.mat-mdc-option-active,.mat-mdc-option-multiple,:focus,:hover) .mdc-list-item__primary-text{color:var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option .mat-pseudo-checkbox{--mat-pseudo-checkbox-minimal-selected-checkmark-color: var(--mat-option-selected-state-label-text-color, var(--mat-sys-on-secondary-container))}.mat-mdc-option.mdc-list-item{align-items:center;background:rgba(0,0,0,0)}.mat-mdc-option.mdc-list-item--disabled{cursor:default;pointer-events:none}.mat-mdc-option.mdc-list-item--disabled .mat-mdc-option-pseudo-checkbox,.mat-mdc-option.mdc-list-item--disabled .mdc-list-item__primary-text,.mat-mdc-option.mdc-list-item--disabled>mat-icon{opacity:.38}.mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:32px}[dir=rtl] .mat-mdc-optgroup .mat-mdc-option:not(.mat-mdc-option-multiple){padding-left:16px;padding-right:32px}.mat-mdc-option .mat-icon,.mat-mdc-option .mat-pseudo-checkbox-full{margin-right:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-icon,[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-full{margin-right:0;margin-left:16px}.mat-mdc-option .mat-pseudo-checkbox-minimal{margin-left:16px;flex-shrink:0}[dir=rtl] .mat-mdc-option .mat-pseudo-checkbox-minimal{margin-right:16px;margin-left:0}.mat-mdc-option .mat-mdc-option-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-mdc-option .mdc-list-item__primary-text{white-space:normal;font-size:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;font-family:inherit;text-decoration:inherit;text-transform:inherit;margin-right:auto}[dir=rtl] .mat-mdc-option .mdc-list-item__primary-text{margin-right:0;margin-left:auto}@media(forced-colors: active){.mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{content:"";position:absolute;top:50%;right:16px;transform:translateY(-50%);width:10px;height:0;border-bottom:solid 10px;border-radius:10px}[dir=rtl] .mat-mdc-option.mdc-list-item--selected:not(:has(.mat-mdc-option-pseudo-checkbox))::after{right:auto;left:16px}}.mat-mdc-option-multiple{--mat-list-list-item-selected-container-color: var(--mat-list-list-item-container-color, transparent)}.mat-mdc-option-active .mat-focus-indicator::before{content:""}
|
|
4
|
+
`],encapsulation:2,changeDetection:0})}return s})();function ot(s,o,e){if(e.length){let t=o.toArray(),i=e.toArray(),a=0;for(let n=0;n<s+1;n++)t[n].group&&t[n].group===i[a]&&a++;return a}return 0}function nt(s,o,e,t){return s<e?s:s+o>e+t?Math.max(0,s-t+o):e}var se=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 d;constructor(o=!1,e,t=!0,i){this._multiple=o,this._emitChanges=t,this.compareWith=i,e&&e.length&&(o?e.forEach(a=>this._markSelected(a)):this._markSelected(e[0]),this._selectedToEmit.length=0)}select(...o){this._verifyValueAssignment(o),o.forEach(t=>this._markSelected(t));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}deselect(...o){this._verifyValueAssignment(o),o.forEach(t=>this._unmarkSelected(t));let e=this._hasQueuedChanges();return this._emitChangeEvent(),e}setSelection(...o){this._verifyValueAssignment(o);let e=this.selected,t=new Set(o.map(a=>this._getConcreteValue(a)));o.forEach(a=>this._markSelected(a)),e.filter(a=>!t.has(this._getConcreteValue(a,t))).forEach(a=>this._unmarkSelected(a));let i=this._hasQueuedChanges();return this._emitChangeEvent(),i}toggle(o){return this.isSelected(o)?this.deselect(o):this.select(o)}clear(o=!0){this._unmarkAll();let e=this._hasQueuedChanges();return o&&this._emitChangeEvent(),e}isSelected(o){return this._selection.has(this._getConcreteValue(o))}isEmpty(){return this._selection.size===0}hasValue(){return!this.isEmpty()}sort(o){this._multiple&&this.selected&&this._selected.sort(o)}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(o){o=this._getConcreteValue(o),this.isSelected(o)||(this._multiple||this._unmarkAll(),this.isSelected(o)||this._selection.add(o),this._emitChanges&&this._selectedToEmit.push(o))}_unmarkSelected(o){o=this._getConcreteValue(o),this.isSelected(o)&&(this._selection.delete(o),this._emitChanges&&this._deselectedToEmit.push(o))}_unmarkAll(){this.isEmpty()||this._selection.forEach(o=>this._unmarkSelected(o))}_verifyValueAssignment(o){o.length>1&&this._multiple}_hasQueuedChanges(){return!!(this._deselectedToEmit.length||this._selectedToEmit.length)}_getConcreteValue(o,e){if(this.compareWith){e=e??this._selection;for(let t of e)if(this.compareWith(o,t))return t;return o}else return o}};var rt=(()=>{class s{_listeners=[];notify(e,t){for(let i of this._listeners)i(e,t)}listen(e){return this._listeners.push(e),()=>{this._listeners=this._listeners.filter(t=>e!==t)}}ngOnDestroy(){this._listeners=[]}static \u0275fac=function(t){return new(t||s)};static \u0275prov=E({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Ve=class{applyChanges(o,e,t,i,a){o.forEachOperation((n,r,c)=>{let l,h;if(n.previousIndex==null){let g=t(n,r,c);l=e.createEmbeddedView(g.templateRef,g.context,g.index),h=V.INSERTED}else c==null?(e.remove(r),h=V.REMOVED):(l=e.get(r),e.move(l,c),h=V.MOVED);a&&a({context:l?.context,operation:h,record:n})})}detach(){}};var je=(()=>{class s{static \u0275fac=function(t){return new(t||s)};static \u0275mod=A({type:s});static \u0275inj=$({imports:[U]})}return s})();var ct=(()=>{class s{static \u0275fac=function(t){return new(t||s)};static \u0275mod=A({type:s});static \u0275inj=$({imports:[X,je,ae,U]})}return s})();var lt=["mat-internal-form-field",""],dt=["*"],xi=(()=>{class s{labelPosition="after";static \u0275fac=function(t){return new(t||s)};static \u0275cmp=_({type:s,selectors:[["div","mat-internal-form-field",""]],hostAttrs:[1,"mdc-form-field","mat-internal-form-field"],hostVars:2,hostBindings:function(t,i){t&2&&S("mdc-form-field--align-end",i.labelPosition==="before")},inputs:{labelPosition:"labelPosition"},attrs:lt,ngContentSelectors:dt,decls:1,vars:0,template:function(t,i){t&1&&(C(),k(0))},styles:[`.mat-internal-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-flex;align-items:center;vertical-align:middle}.mat-internal-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mat-internal-form-field>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end .mdc-form-field--align-end label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0}
|
|
5
|
+
`],encapsulation:2,changeDetection:0})}return s})();export{Ue as a,te as b,ie as c,st as d,B as e,ae as f,ot as g,nt as h,rt as i,Ve as j,se as k,je as l,ct as m,xi as n,x as o,Ye as p,Ne as q,Ft as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B}from"./chunk-
|
|
1
|
+
import{b as B}from"./chunk-GYJAOUYL.js";import{b as U,j as q}from"./chunk-H2I7BMAK.js";import"./chunk-ETXVA6Z3.js";import"./chunk-YY4ZUJFI.js";import"./chunk-CSIELI2Z.js";import"./chunk-4YDVZHMH.js";import"./chunk-M37BLWHF.js";import"./chunk-WJFXI5PQ.js";import"./chunk-HSKVTFFQ.js";import"./chunk-MXUEYEZU.js";import{m as F}from"./chunk-2GOHQZH5.js";import{$b as m,Ac as u,Cb as w,Da as x,Db as s,Eb as c,Fa as r,Fb as h,Fc as D,Ga as l,Mb as y,Ob as O,Pe as S,Qb as g,Re as V,Se as Z,Va as d,Vd as I,Wc as T,Yb as z,Zb as E,ac as R,dd as N,fb as W,ie as X,je as L,pa as a,tc as k,ua as v,va as C,vd as A,wb as b,xb as P}from"./chunk-PZ6I6W3H.js";var G=["panel"],Q=(i,f)=>[i,f];function j(i,f){if(i&1&&h(0,"div",7),i&2){let t=g();m("transform",t.ghostTransform())}}function H(i,f){if(i&1){let t=y();s(0,"div",8),O("pointerdown",function(e){v(t);let o=g();return C(o.startResize(e))}),s(1,"button",9),O("pointerdown",function(e){v(t);let o=g();return C(o.startResize(e))}),h(2,"mat-icon",10),c()()}}var ct=(()=>{class i{panelEl=D.required("panel");_settings=a(F);_dashboard=a(U);breakpointObserver=a(A);ngZone=a(x);side=r(this._settings.getSplitShellSide());panelRatio=r(this._settings.getSplitShellWidth());originalPanelRatio=null;panelWidth=r(0);panelCollapsed=u(()=>!!this._dashboard.dashboards()[this._dashboard.activeDashboard()]?.collapseSplitShell);fskShellSwipeDisabled=S(this._settings.getSplitShellSwipeDisabledAsO());handset$=this.breakpointObserver.observe(I.HandsetPortrait);handset=S(this.handset$,{initialValue:{matches:!1,breakpoints:{}}});freeboardWidgetStub={uuid:"persistent-freeboard-shell",type:"widget-freeboardsk",config:{}};chartplotterModeInPortrait=u(()=>this.handset().matches&&!this.panelCollapsed());canResize=u(()=>!this._dashboard.isDashboardStatic()&&!this.panelCollapsed());resizing=!1;startX=0;startW=0;boundMove=t=>this.onMove(t);boundUp=()=>this.onUp();static MIN_DELTA_PX=1;ghostActive=r(!1);ghostTransform=r("");ghostWidth=0;recomputeWidth=()=>{let t=this.panelEl()?.nativeElement.parentElement;if(!t)return;let n=t.clientWidth;this.panelWidth.set(Math.round(n*this.panelRatio()))};constructor(){window.addEventListener("resize",this.recomputeWidth,{passive:!0}),queueMicrotask(this.recomputeWidth),l(()=>{this.chartplotterModeInPortrait(),this.panelRatio(),this.recomputeWidth(),setTimeout(()=>window.dispatchEvent(new Event("resize")),0)}),l(()=>{let t=this._dashboard.isDashboardStatic();t||this.originalPanelRatio===null&&(this.originalPanelRatio=this.panelRatio()),t&&this.originalPanelRatio}),l(()=>{if(this._dashboard.layoutEditSaved(),this.originalPanelRatio!==null){let t=this.panelRatio();this._settings.setSplitShellWidth(t),this.originalPanelRatio=null}}),l(()=>{if(this._dashboard.layoutEditCanceled(),this.originalPanelRatio!==null){let t=this.originalPanelRatio;this.panelRatio.set(t),queueMicrotask(()=>this.recomputeWidth()),this.originalPanelRatio=null}})}startResize(t){this.canResize()&&(this.resizing=!0,this.startX=t.clientX,this.startW=this.panelWidth(),this.ghostWidth=this.startW,this.ghostActive.set(!0),this.updateGhostTransform(this.startW),t.target.setPointerCapture(t.pointerId),this.ngZone.runOutsideAngular(()=>{window.addEventListener("pointermove",this.boundMove,{passive:!0}),window.addEventListener("pointerup",this.boundUp,{passive:!0})}))}onMove(t){if(!this.resizing)return;let n=this.side()==="left"?t.clientX-this.startX:this.startX-t.clientX,o=this.panelEl()?.nativeElement.parentElement?.clientWidth??1,p=this.startW+n,_=o*.1,$=o*.9,M=Math.min($,Math.max(_,p));Math.abs(M-this.ghostWidth)<i.MIN_DELTA_PX||(this.ghostWidth=M,this.ngZone.runOutsideAngular(()=>this.updateGhostTransform(M)))}onUp(){if(!this.resizing)return;this.resizing=!1,window.removeEventListener("pointermove",this.boundMove),window.removeEventListener("pointerup",this.boundUp);let t=this.ghostWidth;this.ghostActive.set(!1);let n=this.panelEl();n&&!this.panelCollapsed()&&(n.nativeElement.style.width=t+"px"),this.ngZone.run(()=>{this.panelWidth.set(t);let o=this.panelEl()?.nativeElement.parentElement?.clientWidth??t,p=o?t/o:.3,_=this.panelRatio();Math.abs(p-_)>5e-4&&this.panelRatio.set(p)})}updateGhostTransform(t){this.side()==="left"?this.ghostTransform.set(`translateX(${t}px)`):this.ghostTransform.set(`translateX(-${t}px)`)}ngOnDestroy(){window.removeEventListener("resize",this.recomputeWidth),this.resizing&&(window.removeEventListener("pointermove",this.boundMove),window.removeEventListener("pointerup",this.boundUp))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=W({type:i,selectors:[["split-shell"]],viewQuery:function(n,e){n&1&&z(e.panelEl,G,5),n&2&&E()},decls:8,vars:18,consts:[["panel",""],[1,"split-root",3,"ngClass"],[1,"resize-ghost",3,"transform"],[1,"fsk-shell"],["role","separator","aria-label","Resize Freeboard chartplotter panel","aria-orientation","vertical",1,"drag-handle"],[1,"fsk-iframe",3,"type","id","swipeDisabled","disableWidgetShell"],[1,"dash-container"],[1,"resize-ghost"],["role","separator","aria-label","Resize Freeboard chartplotter panel","aria-orientation","vertical",1,"drag-handle",3,"pointerdown"],["mat-mini-fab","","tabindex","-1","aria-hidden","true",1,"drag-fab",3,"pointerdown"],["fontIcon","drag_indicator"]],template:function(n,e){n&1&&(s(0,"div",1),b(1,j,1,2,"div",2),s(2,"div",3,0),b(4,H,3,0,"div",4),h(5,"widget-freeboardsk",5),c(),s(6,"div",6),h(7,"dashboard"),c()()),n&2&&(m("--panel-ratio",e.panelRatio()),w("ngClass",k(15,Q,e.side()==="left"?"side-left":"side-right",e.chartplotterModeInPortrait()?"portrait-column":"")),d(),P(e.ghostActive()?1:-1),d(),m("width",e.chartplotterModeInPortrait()?null:e.panelWidth(),"px"),R("collapsed",e.panelCollapsed())("drag-disabled",!e.canResize()),d(2),P(e.canResize()?4:-1),d(),w("type",e.freeboardWidgetStub.type)("id",e.freeboardWidgetStub.uuid)("swipeDisabled",e.fskShellSwipeDisabled())("disableWidgetShell",!0))},dependencies:[N,T,q,B,L,X,Z,V],styles:[".split-root[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;display:flex;overflow:hidden}.split-root.side-left[_ngcontent-%COMP%]{flex-direction:row}.split-root.side-right[_ngcontent-%COMP%]{flex-direction:row-reverse}.split-root.portrait-column[_ngcontent-%COMP%]{flex-direction:column}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%], .split-root.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{width:100%!important;min-height:0}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{flex:0 0 calc(var(--panel-ratio, .3) * 100%)}.split-root.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:hidden}.split-root.side-left.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{order:2}.split-root.side-left.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{order:1}.split-root.side-right.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{order:2}.split-root.side-right.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{order:1}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell.collapsed[_ngcontent-%COMP%]{flex:0 0 0!important}.split-root.portrait-column[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%], .split-root.portrait-column[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{display:none}.fsk-shell[_ngcontent-%COMP%]{position:relative;height:100%;display:flex;flex-direction:column;background:var(--mat-sys-surface-container, #111);transition:width .2s ease}.fsk-shell.collapsed[_ngcontent-%COMP%]{width:1px!important;visibility:hidden;opacity:0;pointer-events:none}.fsk-iframe[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.dash-container[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:100%}.drag-handle[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;width:3px;cursor:col-resize;background:var(--mat-sys-inverse-primary);z-index:5}.drag-handle[_ngcontent-%COMP%] .drag-fab[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:28px;height:28px;min-width:28px;cursor:col-resize;pointer-events:auto}.drag-handle[_ngcontent-%COMP%] .drag-fab[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;line-height:20px}.side-left[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{right:-2px}.side-right[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{left:-2px}.drag-handle[_ngcontent-%COMP%]:hover{background:var(--mat-sys-error-container)}.side-left[_ngcontent-%COMP%] .collapse-toggle[_ngcontent-%COMP%]{left:.25rem}.side-right[_ngcontent-%COMP%] .collapse-toggle[_ngcontent-%COMP%]{right:.25rem}.fsk-shell.drag-disabled[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.4}.resize-ghost[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;width:2px;background:var(--mat-sys-error-container);opacity:.9;pointer-events:none;z-index:30;will-change:transform;transition:none}.side-left[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{left:0}.side-right[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{right:0}"]})}return i})();export{ct as SplitShellComponent};
|