@qaecy/cue-ui 0.0.50 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/1138.js +1 -0
  2. package/1153.js +1 -0
  3. package/{247.js → 1247.js} +1 -1
  4. package/1338.js +1 -0
  5. package/1359.js +1 -0
  6. package/1520.js +1 -0
  7. package/1573.js +1 -0
  8. package/1931.js +1 -0
  9. package/1985.js +1 -0
  10. package/2245.js +1 -0
  11. package/2269.js +1 -0
  12. package/2312.js +1 -0
  13. package/2399.js +1 -0
  14. package/2724.js +1 -0
  15. package/2839.js +1 -0
  16. package/29.js +1 -0
  17. package/3036.js +1 -0
  18. package/3039.js +1 -0
  19. package/{418.js → 3418.js} +1 -1
  20. package/3523.js +1 -0
  21. package/4283.js +1 -0
  22. package/4284.js +1 -0
  23. package/4311.js +1 -0
  24. package/4613.js +1 -0
  25. package/4687.js +1 -0
  26. package/4879.js +1 -0
  27. package/503.js +1 -0
  28. package/5137.js +1 -0
  29. package/5187.js +1 -0
  30. package/5500.js +1 -0
  31. package/5559.js +1 -0
  32. package/5649.js +1 -0
  33. package/5738.js +1 -0
  34. package/5740.js +1 -0
  35. package/5872.js +1 -0
  36. package/617.js +1 -0
  37. package/63.js +1 -0
  38. package/6376.js +1 -0
  39. package/640.js +1 -0
  40. package/6419.js +1 -0
  41. package/6423.js +1 -0
  42. package/6586.js +1 -0
  43. package/6911.js +1 -0
  44. package/6947.js +1 -0
  45. package/7056.js +1 -0
  46. package/7247.js +1 -0
  47. package/7284.js +1 -0
  48. package/7441.js +1 -0
  49. package/7598.js +1 -0
  50. package/7719.js +1 -0
  51. package/804.js +1 -0
  52. package/8336.js +1 -0
  53. package/836.js +1 -1
  54. package/8560.js +1 -0
  55. package/8855.js +1 -0
  56. package/8957.js +1 -0
  57. package/9004.js +1 -0
  58. package/928.js +1 -1
  59. package/9396.js +1 -0
  60. package/9417.js +1 -0
  61. package/9443.js +1 -0
  62. package/9495.js +1 -0
  63. package/9695.js +1 -0
  64. package/9769.js +1 -0
  65. package/README.md +183 -0
  66. package/common.js +1 -1
  67. package/index.js +1 -1
  68. package/main.js +1 -1
  69. package/package.json +1 -1
  70. package/runtime.js +1 -1
  71. package/149.js +0 -1
  72. package/153.js +0 -1
  73. package/245.js +0 -1
  74. package/269.js +0 -1
  75. package/284.js +0 -1
  76. package/311.js +0 -1
  77. package/336.js +0 -1
  78. package/36.js +0 -1
  79. package/376.js +0 -1
  80. package/393.js +0 -1
  81. package/396.js +0 -1
  82. package/399.js +0 -1
  83. package/4.js +0 -1
  84. package/41.js +0 -1
  85. package/419.js +0 -1
  86. package/423.js +0 -1
  87. package/494.js +0 -1
  88. package/523.js +0 -1
  89. package/560.js +0 -1
  90. package/586.js +0 -1
  91. package/598.js +0 -1
  92. package/613.js +0 -1
  93. package/628.js +0 -1
  94. package/7.js +0 -1
  95. package/719.js +0 -1
  96. package/724.js +0 -1
  97. package/740.js +0 -1
  98. package/773.js +0 -1
  99. package/791.js +0 -1
  100. package/799.js +0 -1
  101. package/802.js +0 -1
  102. package/839.js +0 -1
  103. package/855.js +0 -1
  104. package/872.js +0 -1
  105. package/879.js +0 -1
  106. package/903.js +0 -1
  107. package/911.js +0 -1
  108. package/931.js +0 -1
package/523.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[523],{3523(d,o,t){t.d(o,{TextViewer:()=>u});var r=t(467),l=t(7705),i=t(5802),c=t(2245),e=t(5547);let u=(()=>{class a{fileURL=l.hFB.required();html=(0,i.vPA)("");onFile=(0,i.QZP)((()=>{var _=this;return(0,r.A)(function*(){const s=yield(yield fetch(_.fileURL())).text();_.html.set(`<div class="page">\n <pre style="font-family: inherit; margin: 0;">${s}</pre>\n</div>`)})})());static \u0275fac=function(n){return new(n||a)};static \u0275cmp=e.VBU({type:a,selectors:[["cue-text-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:1,consts:[[1,"page"],[3,"innerHTML"]],template:function(n,s){1&n&&(e.j41(0,"div",0),e.nrm(1,"cue-typography",1),e.k0s()),2&n&&(e.R7$(),e.Y8G("innerHTML",s.html(),e.npT))},dependencies:[c.Typography],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%}"],changeDetection:0})}return a})()}}]);
package/560.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[560],{5600(W,F,_){_.d(F,{F:()=>B,g:()=>S});var r=_(7705),g=_(2271),T=_(7089),X=_(5381),A=_(5187),L=_(5971),t=_(3319),h=_(5547),D=_(5802);function Z(C,R){if(1&C){const f=h.RV6();h.j41(0,"cue-flexcontainer",3)(1,"cue-button",6),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.activeTool.set("pan"))}),h.nrm(2,"cue-button-icon",7),h.k0s(),h.j41(3,"cue-button",8),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.activeTool.set("select"))}),h.nrm(4,"cue-button-icon",9),h.k0s()()}if(2&C){const f=h.XpG();h.R7$(),h.Y8G("variant","pan"===f.activeTool()?"secondary":"tertiary"),h.R7$(2),h.Y8G("variant","select"===f.activeTool()?"secondary":"tertiary")}}function k(C,R){if(1&C){const f=h.RV6();h.j41(0,"cue-flexcontainer",3)(1,"cue-button",10),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.handleZoomOut())}),h.nrm(2,"cue-button-icon",11),h.k0s(),h.j41(3,"cue-button",12),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.handleZoomIn())}),h.nrm(4,"cue-button-icon",13),h.k0s(),h.j41(5,"cue-button",14),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.handleZoomFit())}),h.nrm(6,"cue-button-icon",15),h.k0s()()}if(2&C){const f=h.XpG();h.AVh("border-left",f.options().displayPanSelectTools),h.R7$(),h.Y8G("disabled",f.zoom()<=f.minZoom())("cueTooltip",f.zoom()<=f.minZoom()?"Minimum zoom reached":"Zoom out")}}function G(C,R){if(1&C){const f=h.RV6();h.j41(0,"cue-button",16),h.bIt("click",function(){D.eBV(f);const b=h.XpG();return D.Njj(b.rotate.emit())}),h.nrm(1,"cue-button-icon",17),h.k0s()}if(2&C){const f=h.XpG();h.AVh("border-left",f.options().displayZoom&&f.options().displayRotate)}}class S{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayRotate=!0;displayPanSelectTools=!1}let B=(()=>{class C{options=(0,r.hFB)(new S);activeTool=(0,r.geq)("pan");panMode=(0,r.geq)(!1);zoom=(0,r.geq)(1);pan=(0,r.geq)({x:0,y:0});minZoom=(0,r.hFB)(1);maxZoom=(0,r.hFB)(10);rotate=(0,r.CGW)();zoomIn=(0,r.CGW)();zoomOut=(0,r.CGW)();zoomFit=(0,r.CGW)();selectMenuPositions=(0,g.EW)(()=>"top"===this.options().position?"bottomleft":"topleft");handleZoomIn(){this.zoomIn.emit()}handleZoomOut(){this.zoomOut.emit()}handleZoomFit(){this.zoomFit.emit()}static \u0275fac=function(z){return new(z||C)};static \u0275cmp=h.VBU({type:C,selectors:[["cue-image-toolbar"]],inputs:{options:[1,"options"],activeTool:[1,"activeTool"],panMode:[1,"panMode"],zoom:[1,"zoom"],pan:[1,"pan"],minZoom:[1,"minZoom"],maxZoom:[1,"maxZoom"]},outputs:{activeTool:"activeToolChange",panMode:"panModeChange",zoom:"zoomChange",pan:"panChange",rotate:"rotate",zoomIn:"zoomIn",zoomOut:"zoomOut",zoomFit:"zoomFit"},decls:6,vars:4,consts:[["justify","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["align","center","gap","s",3,"border-left"],["cueTooltip","Rotate","size","xs","variant","tertiary",3,"border-left"],["size","xs","cueTooltip","Pan mode \u2014 drag to move the view",3,"click","variant"],["icon","move-grab"],["size","xs","cueTooltip","Select mode \u2014 drag to draw a selection window",3,"click","variant"],["icon","move-click"],["size","xs","variant","tertiary",3,"click","disabled","cueTooltip"],["icon","zoom-out"],["cueTooltip","Zoom in","size","xs","variant","tertiary",3,"click"],["icon","zoom-in"],["cueTooltip","Zoom fit","size","xs","variant","tertiary",3,"click"],["icon","zoom-fit"],["cueTooltip","Rotate","size","xs","variant","tertiary",3,"click"],["icon","rotate-2d"]],template:function(z,b){1&z&&(h.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),h.nVh(3,Z,5,2,"cue-flexcontainer",3),h.nVh(4,k,7,4,"cue-flexcontainer",4),h.nVh(5,G,2,2,"cue-button",5),h.k0s()()()),2&z&&(h.R7$(),h.Y8G("padded",!1),h.R7$(2),h.vxM(b.options().displayPanSelectTools?3:-1),h.R7$(),h.vxM(b.options().displayZoom?4:-1),h.R7$(),h.vxM(b.options().displayRotate?5:-1))},dependencies:[X.n,A.Z,L.$,t.a,T.d],styles:["[_nghost-%COMP%]{pointer-events:none}.container[_ngcontent-%COMP%]{width:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return C})()},8560(W,F,_){_.d(F,{ImageViewer:()=>Ue});var r=_(5802),g=_(7705),T=_(2271),X=_(345),A=_(5600),L=_(9769),t=_(5547);let h=(()=>{class s{elementRef=(0,r.WQX)(t.aKT);cdr=(0,r.WQX)(g.gRc);zoom=(0,g.geq)(1);pan=(0,g.geq)({x:0,y:0});minZoom=(0,g.hFB)(1);maxZoom=(0,g.hFB)(10);zoomStep=(0,g.hFB)(.1);panMode=(0,g.hFB)(!0,{transform:e=>{const n=""===e||"false"!==e&&!!e;return!n&&(this.isPanning||this.isWaitingForPan)&&this.onMouseUp(),n}});longPressThreshold=(0,g.hFB)(150);dragThreshold=(0,g.hFB)(3);zoomChange=(0,g.CGW)();panChange=(0,g.CGW)();stateChange=(0,g.CGW)();isPanning=!1;lastPoint={x:0,y:0};isWaitingForPan=!1;downPoint={x:0,y:0};longPressTimer=null;moveListener;upListener;leaveListener;blurListener;visibilityListener;keyListener;contextMenuListener;pointerCancelListener;listenersAttached=!1;isMiddlePanning=!1;_midLastPoint={x:0,y:0};_midMoveListener;_midUpListener;_pinchStartDist=0;_pinchStartZoom=1;_touchStartListener;_touchMoveListener;_touchEndListener;constructor(){this.moveListener=this.onMouseMove.bind(this),this.upListener=this.onMouseUp.bind(this),this.leaveListener=this.onMouseUp.bind(this),this.blurListener=this.onMouseUp.bind(this),this.visibilityListener=()=>{document.hidden&&this.onMouseUp()},this.keyListener=e=>{"Escape"===e.key&&this.onMouseUp()},this.contextMenuListener=this.onMouseUp.bind(this),this.pointerCancelListener=this.onMouseUp.bind(this),this._midMoveListener=this._onMiddlePanMove.bind(this),this._midUpListener=this._onMiddlePanUp.bind(this)}ngOnInit(){this._attachTouchListeners()}ngOnDestroy(){this.removeListeners(),this.clearLongPressTimer(),this._detachTouchListeners(),this._stopMiddlePan()}addListeners(){this.listenersAttached||(this.listenersAttached=!0,window.addEventListener("mousemove",this.moveListener),window.addEventListener("mouseup",this.upListener,!0),window.addEventListener("blur",this.blurListener),document.addEventListener("visibilitychange",this.visibilityListener),document.addEventListener("keydown",this.keyListener),document.addEventListener("contextmenu",this.contextMenuListener),document.addEventListener("pointercancel",this.pointerCancelListener))}removeListeners(){this.listenersAttached=!1,window.removeEventListener("mousemove",this.moveListener),window.removeEventListener("mouseup",this.upListener,!0),window.removeEventListener("blur",this.blurListener),document.removeEventListener("visibilitychange",this.visibilityListener),document.removeEventListener("keydown",this.keyListener),document.removeEventListener("contextmenu",this.contextMenuListener),document.removeEventListener("pointercancel",this.pointerCancelListener)}clearLongPressTimer(){null!==this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressTimer=null)}cursorStyle(){return this.isMiddlePanning?"grabbing":this.panMode()?this.isPanning?"grabbing":"grab":null}onMouseDown(e){if(1===e.button)return e.preventDefault(),this.isMiddlePanning=!0,this._midLastPoint={x:e.clientX,y:e.clientY},this.cdr.markForCheck(),window.addEventListener("mousemove",this._midMoveListener),void window.addEventListener("mouseup",this._midUpListener);!this.panMode()||0!==e.button||(e.composedPath?e.composedPath():[]).some(i=>i.hasAttribute&&i.hasAttribute("data-no-pan"))||((this.isPanning||this.isWaitingForPan)&&(this.clearLongPressTimer(),this.isWaitingForPan=!1,this.isPanning=!1,this.removeListeners()),this.isWaitingForPan=!0,this.downPoint={x:e.clientX,y:e.clientY},this.lastPoint={x:e.clientX,y:e.clientY},this.addListeners())}startPanning(){this.clearLongPressTimer(),this.isWaitingForPan=!1,this.isPanning=!0,this.cdr.markForCheck()}onMouseMove(e){if(!this.isWaitingForPan&&!this.isPanning)return;if(this.isWaitingForPan&&!this.isPanning){const l=e.clientX-this.downPoint.x,d=e.clientY-this.downPoint.y;if(Math.sqrt(l*l+d*d)>=this.dragThreshold()){e.preventDefault(),this.startPanning();const u=this.pan(),p={x:u.x+l,y:u.y+d};this.lastPoint={x:e.clientX,y:e.clientY},this.pan.set(p),this.panChange.emit(p),this.emitStateChange()}return}e.preventDefault();const n=e.clientX-this.lastPoint.x,o=e.clientY-this.lastPoint.y;this.lastPoint={x:e.clientX,y:e.clientY};const i=this.pan(),a={x:i.x+n,y:i.y+o};this.pan.set(a),this.panChange.emit(a),this.emitStateChange()}onMouseUp(e){this.clearLongPressTimer();const n=this.isPanning;if(this.isWaitingForPan=!1,this.isPanning=!1,this.removeListeners(),n){this.cdr.markForCheck();const o=i=>{i.stopImmediatePropagation(),i.preventDefault(),window.removeEventListener("click",o,!0)};window.addEventListener("click",o,!0),setTimeout(()=>window.removeEventListener("click",o,!0),50)}}_onMiddlePanMove(e){if(!this.isMiddlePanning)return;const n=e.clientX-this._midLastPoint.x,o=e.clientY-this._midLastPoint.y;this._midLastPoint={x:e.clientX,y:e.clientY};const i=this.pan(),a={x:i.x+n,y:i.y+o};this.pan.set(a),this.panChange.emit(a),this.emitStateChange()}_onMiddlePanUp(e){1===e.button&&this._stopMiddlePan()}_stopMiddlePan(){window.removeEventListener("mousemove",this._midMoveListener),window.removeEventListener("mouseup",this._midUpListener),this.isMiddlePanning&&(this.isMiddlePanning=!1,this.cdr.markForCheck())}onWheel(e){e.preventDefault();const n=this.zoomStep(),o=e.deltaY<0?1+n:1-n,a=this.elementRef.nativeElement.getBoundingClientRect(),l={x:e.clientX-a.left,y:e.clientY-a.top};this.zoomTo(this.zoom()*o,l)}zoomTo(e,n){const o=this.zoom(),i=this.pan(),a=Math.max(this.minZoom(),Math.min(this.maxZoom(),e));if(a===o)return;const l=a/o,d={x:n.x-(n.x-i.x)*l,y:n.y-(n.y-i.y)*l};this.zoom.set(a),this.pan.set(d),this.zoomChange.emit(a),this.panChange.emit(d),this.emitStateChange()}zoomIn(){this.zoomToCenter(this.zoom()+this.zoomStep())}zoomOut(){this.zoomToCenter(this.zoom()-this.zoomStep())}zoomToCenter(e){const n=this.elementRef.nativeElement;this.zoomTo(e,{x:n.clientWidth/2,y:n.clientHeight/2})}emitStateChange(){this.stateChange.emit({zoom:this.zoom(),pan:this.pan()})}static _touchDist(e,n){const o=n.clientX-e.clientX,i=n.clientY-e.clientY;return Math.sqrt(o*o+i*i)}_attachTouchListeners(){const e=this.elementRef.nativeElement;this._touchStartListener=n=>{2===n.touches.length&&(n.preventDefault(),this._pinchStartDist=s._touchDist(n.touches[0],n.touches[1]),this._pinchStartZoom=this.zoom())},this._touchMoveListener=n=>{if(2!==n.touches.length||(n.preventDefault(),0===this._pinchStartDist))return;const o=s._touchDist(n.touches[0],n.touches[1]),i=this._pinchStartZoom*(o/this._pinchStartDist),a=e.getBoundingClientRect();this.zoomTo(i,{x:(n.touches[0].clientX+n.touches[1].clientX)/2-a.left,y:(n.touches[0].clientY+n.touches[1].clientY)/2-a.top})},this._touchEndListener=n=>{n.touches.length<2&&(this._pinchStartDist=0)},e.addEventListener("touchstart",this._touchStartListener,{passive:!1}),e.addEventListener("touchmove",this._touchMoveListener,{passive:!1}),e.addEventListener("touchend",this._touchEndListener,{passive:!1})}_detachTouchListeners(){const e=this.elementRef.nativeElement;this._touchStartListener&&e.removeEventListener("touchstart",this._touchStartListener),this._touchMoveListener&&e.removeEventListener("touchmove",this._touchMoveListener),this._touchEndListener&&e.removeEventListener("touchend",this._touchEndListener)}static \u0275fac=function(n){return new(n||s)};static \u0275dir=t.FsC({type:s,selectors:[["","cuePanZoom",""]],hostVars:2,hostBindings:function(n,o){1&n&&t.bIt("mousedown",function(a){return o.onMouseDown(a)})("wheel",function(a){return o.onWheel(a)}),2&n&&t.xc7("cursor",o.cursorStyle())},inputs:{zoom:[1,"zoom"],pan:[1,"pan"],minZoom:[1,"minZoom"],maxZoom:[1,"maxZoom"],zoomStep:[1,"zoomStep"],panMode:[1,"panMode"],longPressThreshold:[1,"longPressThreshold"],dragThreshold:[1,"dragThreshold"]},outputs:{zoom:"zoomChange",pan:"panChange",zoomChange:"zoomChange",panChange:"panChange",stateChange:"stateChange"}})}return s})();const D=["container"],Z=["*"];let k=(()=>{class s{panZoomDirective=(0,g.ebz)(h);containerRef=(0,g.ebz)("container");zoom=(0,g.geq)(1);pan=(0,g.geq)({x:0,y:0});minZoom=(0,g.hFB)(.1);maxZoom=(0,g.hFB)(10);zoomStep=(0,g.hFB)(.1);panMode=(0,g.hFB)(!0);modelChange=(0,g.CGW)();get transform(){const{x:e,y:n}=this.pan();return`translate(${e}px, ${n}px) scale(${this.zoom()})`}onZoomChange(e){this.zoom.set(e),this.emitModelChange()}onPanChange(e){this.pan.set(e),this.emitModelChange()}emitModelChange(){this.modelChange.emit({pan:{...this.pan()},zoom:this.zoom()})}zoomFit(){this.zoom.set(this.minZoom()),this.pan.set({x:0,y:0}),this.emitModelChange()}zoomIn(){this.panZoomDirective()?.zoomIn()}zoomOut(){this.panZoomDirective()?.zoomOut()}zoomTo(e,n){this.panZoomDirective()?.zoomTo(e,n)}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=t.VBU({type:s,selectors:[["cue-pan-zoom"]],viewQuery:function(n,o){1&n&&t.wEZ(o.panZoomDirective,h,5)(o.containerRef,D,5),2&n&&t.NyB(2)},hostAttrs:[2,"display","block","width","100%","height","100%"],inputs:{zoom:[1,"zoom"],pan:[1,"pan"],minZoom:[1,"minZoom"],maxZoom:[1,"maxZoom"],zoomStep:[1,"zoomStep"],panMode:[1,"panMode"]},outputs:{zoom:"zoomChange",pan:"panChange",modelChange:"modelChange"},ngContentSelectors:Z,decls:5,vars:8,consts:[["container",""],["content",""],["cuePanZoom","",1,"pan-zoom-container",2,"width","100%","height","100%","overflow","hidden","position","relative","touch-action","none",3,"zoomChange","panChange","zoom","pan","minZoom","maxZoom","zoomStep","panMode"],[2,"position","absolute","left","0","top","0","transform-origin","0 0","backface-visibility","hidden"]],template:function(n,o){1&n&&(t.NAR(),t.j41(0,"div",2,0),t.bIt("zoomChange",function(a){return o.onZoomChange(a)})("panChange",function(a){return o.onPanChange(a)}),t.j41(2,"div",3,1),t.SdG(4),t.k0s()()),2&n&&(t.Y8G("zoom",o.zoom())("pan",o.pan())("minZoom",o.minZoom())("maxZoom",o.maxZoom())("zoomStep",o.zoomStep())("panMode",o.panMode()),t.R7$(2),t.xc7("transform",o.transform))},dependencies:[L.MD,h],encapsulation:2,changeDetection:0})}return s})();var G=_(2036),S=_(7023),B=_(9352),C=_(356),R=_(6279),f=_(5187),z=_(2245);class b{constructor(c=[],e=(n,o)=>n<o?-1:n>o?1:0){if(this.data=c,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(c){this.data.push(c),this._up(this.length++)}pop(){if(0===this.length)return;const c=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),c}peek(){return this.data[0]}_up(c){const{data:e,compare:n}=this,o=e[c];for(;c>0;){const i=c-1>>1,a=e[i];if(n(o,a)>=0)break;e[c]=a,c=i}e[c]=o}_down(c){const{data:e,compare:n}=this,o=this.length>>1,i=e[c];for(;c<o;){let a=1+(c<<1);const l=a+1;if(l<this.length&&n(e[l],e[a])<0&&(a=l),n(e[a],i)>=0)break;e[c]=e[a],c=a}e[c]=i}}function j(s,c,e,n){this.x=s,this.y=c,this.h=e,this.d=function H(s,c,e){let n=!1,o=1/0;for(const i of e)for(let a=0,l=i.length,d=l-1;a<l;d=a++){const m=i[a],u=i[d];m[1]>c!=u[1]>c&&s<(u[0]-m[0])*(c-m[1])/(u[1]-m[1])+m[0]&&(n=!n),o=Math.min(o,Q(s,c,m,u))}return 0===o?0:(n?1:-1)*Math.sqrt(o)}(s,c,n),this.max=this.d+this.h*Math.SQRT2}function Q(s,c,e,n){let o=e[0],i=e[1],a=n[0]-o,l=n[1]-i;if(0!==a||0!==l){const d=((s-o)*a+(c-i)*l)/(a*a+l*l);d>1?(o=n[0],i=n[1]):d>0&&(o+=a*d,i+=l*d)}return a=s-o,l=c-i,a*a+l*l}let K=(()=>{class s{extractPathD(e){const n=e.match(/d="([^"]*)"/);return n?n[1]:null}parsePathToPolygon(e){const n=[],o=e.trim().split(/\s+/);let i=0;for(;i<o.length;){const a=o[i];if("M"===a||"L"===a)i++,i+1<o.length&&(n.push([parseFloat(o[i]),parseFloat(o[i+1])]),i+=2);else{const l=parseFloat(a);!isNaN(l)&&i+1<o.length?(n.push([l,parseFloat(o[i+1])]),i+=2):i++}}return n}getLabelPosition(e){const n=this.extractPathD(e);if(!n)return null;const o=this.parsePathToPolygon(n);if(o.length<3)return null;try{const i=function Y(s,c=1,e=!1){let n=1/0,o=1/0,i=-1/0,a=-1/0;for(const[y,x]of s[0])y<n&&(n=y),x<o&&(o=x),y>i&&(i=y),x>a&&(a=x);const l=i-n,d=a-o,m=Math.max(c,Math.min(l,d));if(m===c){const y=[n,o];return y.distance=0,y}const u=new b([],(y,x)=>x.max-y.max);let p=function U(s){let c=0,e=0,n=0;const o=s[0];for(let a=0,l=o.length,d=l-1;a<l;d=a++){const m=o[a],u=o[d],p=m[0]*u[1]-u[0]*m[1];e+=(m[0]+u[0])*p,n+=(m[1]+u[1])*p,c+=3*p}const i=new j(e/c,n/c,0,s);return 0===c||i.d<0?new j(o[0][0],o[0][1],0,s):i}(s);const v=new j(n+l/2,o+d/2,0,s);v.d>p.d&&(p=v);let M=2;function P(y,x,V){const I=new j(y,x,V,s);M++,I.max>p.d+c&&u.push(I),I.d>p.d&&(p=I,e&&console.log(`found best ${Math.round(1e4*I.d)/1e4} after ${M} probes`))}let w=m/2;for(let y=n;y<i;y+=m)for(let x=o;x<a;x+=m)P(y+w,x+w,w);for(;u.length;){const{max:y,x,y:V,h:I}=u.pop();if(y-p.d<=c)break;w=I/2,P(x-w,V-w,w),P(x+w,V-w,w),P(x-w,V+w,w),P(x+w,V+w,w)}e&&console.log(`num probes: ${M}\nbest distance: ${p.d}`);const E=[p.x,p.y];return E.distance=p.d,E}([o],.01);return{x:i[0],y:i[1]}}catch{return null}}getLabelFontSize(e){const n=this.extractPathD(e);if(!n)return.3;const o=this.parsePathToPolygon(n);if(o.length<3)return.3;const i=o.map(u=>u[0]),a=o.map(u=>u[1]),l=Math.max(...i)-Math.min(...i),d=Math.max(...a)-Math.min(...a),m=Math.min(l,d);return Math.max(m/5,.05)}static \u0275fac=function(n){return new(n||s)};static \u0275prov=r.jDH({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})(),N=(()=>{class s{editingArtefact=(0,r.vPA)(null);isEditing=(0,r.vPA)(!1);editStart=(0,r.vPA)(null);editHandle=(0,r.vPA)("body");hasDragged=!1;hasEdited=!1;originalArtefact=null;drawingArtefacts;mouseToImagePercent;parseXYWH;polygonService;artefactEdited;editMoveListener=this.onEditMouseMove.bind(this);editUpListener=this.onEditMouseUp.bind(this);init(e){this.drawingArtefacts=e.drawingArtefacts,this.mouseToImagePercent=e.mouseToImagePercent,this.parseXYWH=e.parseXYWH,this.polygonService=e.polygonService,this.artefactEdited=e.artefactEdited}startEditArtefact(e,n){this.editingArtefact.set({type:e,index:n});const o=this.drawingArtefacts();let i;"bbox"===e?i=o.xywhs[n]:"circle"===e?i=o.circles[n]:"polygon"===e&&(i=o.polygons[n]),this.originalArtefact=i?{...i}:null}cancelEdit(){const e=this.editingArtefact();if(e&&this.hasEdited&&this.originalArtefact){const n=this.drawingArtefacts();let o;"bbox"===e.type?o=n.xywhs[e.index]:"circle"===e.type?o=n.circles[e.index]:"polygon"===e.type&&(o=n.polygons[e.index]),o&&this.artefactEdited.emit({type:e.type,index:e.index,before:this.originalArtefact,after:o})}this.editingArtefact.set(null),this.isEditing.set(!1),this.editStart.set(null),this.editHandle.set("body"),this.hasEdited=!1,this.originalArtefact=null,window.removeEventListener("mousemove",this.editMoveListener),window.removeEventListener("mouseup",this.editUpListener)}onEditMouseDown(e,n="body"){if(!this.editingArtefact()||0!==e.button)return;e.preventDefault(),e.stopPropagation();const o=this.mouseToImagePercent(e);o&&(this.isEditing.set(!0),this.editStart.set(o),this.editHandle.set(n),this.hasDragged=!1,window.addEventListener("mousemove",this.editMoveListener),window.addEventListener("mouseup",this.editUpListener))}onEditMouseMove(e){if(!this.isEditing())return;e.preventDefault();const n=this.mouseToImagePercent(e),o=this.editStart(),i=this.editingArtefact();if(!n||!o||!i)return;const a=this.editHandle();if("string"==typeof a&&a.startsWith("vertex:")){const m=parseInt(a.split(":")[1],10);return this.polygonService.applyVertexDrag(i.index,m,n,e.shiftKey),this.editStart.set(n),this.hasDragged=!0,void(this.hasEdited=!0)}const l=n.x-o.x,d=n.y-o.y;this.editStart.set(n),this.hasDragged=!0,this.hasEdited=!0,this.applyEditDelta(i,l,d)}onEditMouseUp(e){if(this.isEditing()){if(window.removeEventListener("mousemove",this.editMoveListener),window.removeEventListener("mouseup",this.editUpListener),"body"===this.editHandle()&&!this.hasDragged)return void this.cancelEdit();if(this.isEditing.set(!1),this.editStart.set(null),this.hasEdited){const n=this.editingArtefact();if(n&&this.originalArtefact){const o=this.drawingArtefacts();let i;"bbox"===n.type?i=o.xywhs[n.index]:"circle"===n.type?i=o.circles[n.index]:"polygon"===n.type&&(i=o.polygons[n.index]),i&&(this.artefactEdited.emit({type:n.type,index:n.index,before:this.originalArtefact,after:i}),this.originalArtefact={...i},this.hasEdited=!1)}}}}applyEditDelta(e,n,o){const i=this.editHandle();"body"===i?this.applyMoveDelta(e,n,o):"radius"===i?this.applyCircleRadiusDelta(e.index,n,o):this.applyResizeDelta(e,i,n,o)}applyMoveDelta(e,n,o){this.drawingArtefacts.update(i=>{if("bbox"===e.type){const a=[...i.xywhs],l=a[e.index];if(!l)return i;const d=this.parseXYWH(l.xywhStr);if(!d)return i;const m=Math.max(0,d.x+n),u=Math.max(0,d.y+o);return a[e.index]={...l,xywhStr:`percent:${m.toFixed(2)},${u.toFixed(2)},${d.width.toFixed(2)},${d.height.toFixed(2)}`},{...i,xywhs:a}}if("circle"===e.type){const a=[...i.circles],l=a[e.index];return l?(a[e.index]={...l,cx:l.cx+n,cy:l.cy+o},{...i,circles:a}):i}if("polygon"===e.type){const a=[...i.polygons],l=a[e.index];return l?(a[e.index]={...l,points:l.points.map(([d,m])=>[d+n,m+o])},{...i,polygons:a}):i}return i})}applyResizeDelta(e,n,o,i){"bbox"===e.type&&this.drawingArtefacts.update(a=>{const l=[...a.xywhs],d=l[e.index];if(!d)return a;const m=this.parseXYWH(d.xywhStr);if(!m)return a;let{x:u,y:p,width:v,height:M}=m;return n.includes("w")&&(u+=o,v-=o),n.includes("e")&&(v+=o),n.includes("n")&&(p+=i,M-=i),n.includes("s")&&(M+=i),v<.5&&(v=.5),M<.5&&(M=.5),l[e.index]={...d,xywhStr:`percent:${u.toFixed(2)},${p.toFixed(2)},${v.toFixed(2)},${M.toFixed(2)}`},{...a,xywhs:l}})}applyCircleRadiusDelta(e,n,o){this.drawingArtefacts.update(i=>{const a=[...i.circles],l=a[e];if(!l)return i;const d=Math.sqrt(n*n+o*o)*Math.sign(n||o);return a[e]={...l,r:Math.max(.5,l.r+d)},{...i,circles:a}})}static \u0275fac=function(n){return new(n||s)};static \u0275prov=r.jDH({token:s,factory:s.\u0275fac})}return s})(),$=(()=>{class s{isDrawing=(0,r.vPA)(!1);drawStart=(0,r.vPA)(null);drawCurrent=(0,r.vPA)(null);drawMode;drawColor;drawnArtefactDef;artefactDrawn;mouseToImagePercent;imageDimensions;drawingArtefacts;drawMoveListener=this.onDrawMouseMove.bind(this);drawUpListener=this.onDrawMouseUp.bind(this);initialized=(0,r.vPA)(!1);drawPreview=(0,T.EW)(()=>{if(!this.initialized()||"xywh"!==this.drawMode())return null;const e=this.drawStart(),n=this.drawCurrent();if(!e||!n)return null;const o=Math.min(e.x,n.x),i=Math.min(e.y,n.y),a=Math.abs(n.x-e.x),l=Math.abs(n.y-e.y);return a<.1&&l<.1?null:{x:o,y:i,width:a,height:l,color:this.drawColor()}});circleDrawPreview=(0,T.EW)(()=>{if(!this.initialized()||"circle"!==this.drawMode())return null;const e=this.drawStart(),n=this.drawCurrent();if(!e||!n)return null;const o=Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));return o<.1?null:{cx:e.x,cy:e.y,r:o,color:this.drawColor()}});init(e){this.drawMode=e.drawMode,this.drawColor=e.drawColor,this.drawnArtefactDef=e.drawnArtefactDef,this.artefactDrawn=e.artefactDrawn,this.mouseToImagePercent=e.mouseToImagePercent,this.imageDimensions=e.imageDimensions,this.drawingArtefacts=e.drawingArtefacts,this.initialized.set(!0)}onDrawMouseDown(e){const n=this.drawMode();if("xywh"!==n&&"circle"!==n||0!==e.button)return;e.preventDefault(),e.stopPropagation();const o=this.mouseToImagePercent(e);o&&(this.isDrawing.set(!0),this.drawStart.set(o),this.drawCurrent.set(o),window.addEventListener("mousemove",this.drawMoveListener),window.addEventListener("mouseup",this.drawUpListener))}onDrawMouseMove(e){if(!this.isDrawing())return;e.preventDefault();const n=this.mouseToImagePercent(e);n&&this.drawCurrent.set(n)}onDrawMouseUp(e){if(!this.isDrawing())return;e?.preventDefault(),window.removeEventListener("mousemove",this.drawMoveListener),window.removeEventListener("mouseup",this.drawUpListener);const n=this.drawStart(),o=this.drawCurrent(),i=this.drawMode();if(n&&o)if("xywh"===i){const a=Math.min(n.x,o.x),l=Math.min(n.y,o.y),d=Math.abs(o.x-n.x),m=Math.abs(o.y-n.y);if(d>.5&&m>.5){const p={...this.drawnArtefactDef(),xywhStr:`percent:${a.toFixed(2)},${l.toFixed(2)},${d.toFixed(2)},${m.toFixed(2)}`,color:this.drawColor()},v={x:a,y:l,width:d,height:m};this.artefactDrawn.emit({type:"xywh",def:p,pct:v,abs:this.pctRectToAbs(v)}),this.drawingArtefacts.update(M=>({...M,xywhs:[...M.xywhs,p]}))}}else if("circle"===i){const a=Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2));if(a>.5){const d={...this.drawnArtefactDef(),cx:n.x,cy:n.y,r:a,color:this.drawColor()},m=this.imageDimensions();this.artefactDrawn.emit({type:"circle",def:d,pct:{cx:n.x,cy:n.y,r:a},abs:{cx:m?n.x/100*m.width:n.x,cy:m?n.y/100*m.height:n.y,r:m?a/100*m.width:a}}),this.drawingArtefacts.update(u=>({...u,circles:[...u.circles,d]}))}}this.isDrawing.set(!1),this.drawStart.set(null),this.drawCurrent.set(null)}pctRectToAbs(e){const n=this.imageDimensions();return n?{x:e.x/100*n.width,y:e.y/100*n.height,width:e.width/100*n.width,height:e.height/100*n.height}:e}static \u0275fac=function(n){return new(n||s)};static \u0275prov=r.jDH({token:s,factory:s.\u0275fac})}return s})(),O=(()=>{class s{polygonPoints=(0,r.vPA)([]);polygonCursor=(0,r.vPA)(null);lastPolygonClickTime=0;axisSnapLines=(0,r.vPA)({});drawColor;drawnArtefactDef;artefactDrawn;mouseToImagePercent;imageAspectRatio;zoom;imageDimensions;drawingArtefacts;polygonMoveListener=this.onPolygonMouseMove.bind(this);polygonEscListener=this.onPolygonEsc.bind(this);initialized=(0,r.vPA)(!1);polygonDrawPreview=(0,T.EW)(()=>{if(!this.initialized())return null;const e=this.polygonPoints();if(0===e.length)return null;const n=this.polygonCursor();return{points:e,cursorPoint:n?[n.x,n.y]:null,color:this.drawColor()}});init(e){this.drawColor=e.drawColor,this.drawnArtefactDef=e.drawnArtefactDef,this.artefactDrawn=e.artefactDrawn,this.mouseToImagePercent=e.mouseToImagePercent,this.imageAspectRatio=e.imageAspectRatio,this.zoom=e.zoom,this.imageDimensions=e.imageDimensions,this.drawingArtefacts=e.drawingArtefacts,this.initialized.set(!0)}onPolygonClick(e){if(0!==e.button)return;const n=Date.now();if(n-this.lastPolygonClickTime<300)return;this.lastPolygonClickTime=n,e.preventDefault(),e.stopPropagation();const o=this.mouseToImagePercent(e);if(!o)return;const i=this.polygonPoints(),a=this.applySnapping(o,i,e.shiftKey);if(i.length>=3){const l=i[0],d=a.x-l[0],m=a.y-l[1];if(Math.sqrt(d*d+m*m)<this.closeThreshold)return void this.finishPolygon()}this.polygonPoints.update(l=>[...l,[a.x,a.y]]),this.polygonCursor.set(null),0===i.length&&(window.addEventListener("mousemove",this.polygonMoveListener),window.addEventListener("keydown",this.polygonEscListener))}cancelPolygon(){window.removeEventListener("mousemove",this.polygonMoveListener),window.removeEventListener("keydown",this.polygonEscListener),this.polygonPoints.set([]),this.polygonCursor.set(null),this.axisSnapLines.set({})}applyVertexDrag(e,n,o,i){this.drawingArtefacts.update(a=>{const l=[...a.polygons],d=l[e];if(!d)return a;const m=[...d.points.map(M=>[...M])];if(n<0||n>=m.length)return a;const u=m.filter((M,P)=>P!==n);let p=null;m.length>1&&(p=n>0?m[n-1]:m[n+1]);let v=o;return i&&p&&(v=this.snapTo45({x:p[0],y:p[1]},o)),v=this.snapToAxis(v,u,null,i?"none":"both"),m[n]=[v.x,v.y],l[e]={...d,points:m},{...a,polygons:l}})}snapTo45(e,n){const o=this.imageAspectRatio(),i=n.x-e.x,a=(n.y-e.y)/o,l=Math.atan2(a,i),d=Math.round(l/(Math.PI/4))*(Math.PI/4),m=Math.sqrt(i*i+a*a);return{x:e.x+m*Math.cos(d),y:e.y+m*Math.sin(d)*o}}get closeThreshold(){return 1.5/this.zoom()}get axisSnapThresholdX(){const e=this.imageDimensions?.();return e&&0!==e.width?24/(e.width*this.zoom()/100):1.5}get axisSnapThresholdY(){const e=this.imageDimensions?.();return e&&0!==e.height?24/(e.height*this.zoom()/100):1.5}applySnapping(e,n,o){const i=n.length>0?n[n.length-1]:null,a=n.length>1?n.slice(0,-1):[];if(!o||!i)return this.snapToAxis(e,a,i,"both");const l=this.snapTo45({x:i[0],y:i[1]},e),d=Math.abs(l.x-i[0]),m=Math.abs(l.y-i[1]),u=d+m+.001;let p;return p=d/u<.01?"y":m/u<.01?"x":"none",this.snapToAxis(l,a,i,p)}snapToAxis(e,n,o,i){if("none"===i||0===n.length)return this.axisSnapLines.set({}),e;let u,p,{x:a,y:l}=e,d=this.axisSnapThresholdX,m=this.axisSnapThresholdY;const v="x"===i||"both"===i,M="y"===i||"both"===i;for(const[P,w]of n){const E=o&&Math.abs(P-o[0])<.5,y=o&&Math.abs(w-o[1])<.5;if(v&&!E){const x=Math.abs(a-P);x<d&&(d=x,a=P,u=P)}if(M&&!y){const x=Math.abs(l-w);x<m&&(m=x,l=w,p=w)}}return this.axisSnapLines.set({x:u,y:p}),{x:a,y:l}}onPolygonMouseMove(e){const n=this.mouseToImagePercent(e);if(!n)return;const o=this.polygonPoints();this.polygonCursor.set(this.applySnapping(n,o,e.shiftKey))}finishPolygon(){const e=this.polygonPoints();if(e.length<3)return;window.removeEventListener("mousemove",this.polygonMoveListener),window.removeEventListener("keydown",this.polygonEscListener);const o={...this.drawnArtefactDef(),points:[...e],color:this.drawColor()},i=this.imageDimensions();this.artefactDrawn.emit({type:"polygon",def:o,pct:{points:[...e]},abs:{points:e.map(([a,l])=>[i?a/100*i.width:a,i?l/100*i.height:l])}}),this.polygonPoints.set([]),this.polygonCursor.set(null)}onPolygonEsc(e){"Escape"===e.key&&this.cancelPolygon()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=r.jDH({token:s,factory:s.\u0275fac})}return s})();const q=["imageElement"],J=["*"],ee=(s,c)=>({artefact:s,type:"bbox",index:c}),te=(s,c)=>({artefact:s,type:"circle",index:c}),ne=(s,c)=>({artefact:s,type:"polygon",index:c}),oe=(s,c)=>({artefact:s,type:"svgPath",index:c}),ie=(s,c)=>e=>{const n=r.eBV(c).$implicit;return r.Njj(!e.visible||e.visible(n))},se=(s,c)=>c.label;function ae(s,c){if(1&s&&(t.j41(0,"cue-card",13),t.nrm(1,"cue-typography",14),t.k0s()),2&s){const e=t.XpG().$implicit,n=t.XpG();t.xc7("transform","scale("+1/n.zoom()+")"),t.R7$(),t.Y8G("noWrap",!0)("innerHTML",e.label,t.npT)}}function re(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",11),t.bIt("contextMenuOpen",function(){r.eBV(e);const o=t.XpG();return r.Njj(o.isContextMenuOpen.set(!0))})("contextMenuClose",function(){r.eBV(e);const o=t.XpG();return r.Njj(o.isContextMenuOpen.set(!1))})("click",function(o){const i=r.eBV(e).$implicit,a=t.XpG();return r.Njj(a.handleBboxClick(i,o))}),t.nVh(1,ae,2,4,"cue-card",12),t.k0s()}if(2&s){const e=c.$implicit,n=t.XpG(),o=t.sdS(17);t.xc7("left",e.x,"%")("top",e.y,"%")("width",e.width,"%")("height",e.height,"%")("border-color",e.color||"rgba(255, 0, 0, 0.8)")("border-width",3/n.zoom()+"px")("background-color",!1===e.showFill?"transparent":n.getBgColor(e.color)),t.AVh("clickable",n.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit)("removable",!!e.allowRemove),t.Y8G("title",e.label||"")("cueContextMenu",o)("contextMenuData",t.l_i(23,ee,e,e.sourceIndex))("cueContextEnabled",n.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit),t.R7$(),t.vxM(e.label?1:-1)}}function ce(s,c){if(1&s&&t.nrm(0,"div",15),2&s){const e=c,n=t.XpG();t.xc7("left",e.x,"%")("top",e.y,"%")("width",e.width,"%")("height",e.height,"%")("border-color",e.color)("border-width",3/n.zoom()+"px")("background-color",n.getBgColor(e.color))}}function le(s,c){if(1&s){const e=t.RV6();r.qSk(),t.j41(0,"ellipse",17),t.bIt("contextMenuOpen",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!0))})("contextMenuClose",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!1))}),t.k0s()}if(2&s){const e=c.$implicit,n=c.$index,o=t.XpG(2),i=t.sdS(17);t.xc7("pointer-events",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"all":"none")("cursor",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"pointer":"default"),t.Y8G("cueContextMenu",i)("contextMenuData",t.l_i(14,te,e,n))("cueContextEnabled",o.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit),t.BMQ("cx",e.cx)("cy",e.cy)("rx",e.r)("ry",e.r*o.imageAspectRatio())("stroke",e.color||"rgba(255, 0, 0, 0.8)")("fill",!1===e.showFill?"none":o.getBgColor(e.color))("stroke-width",3/o.zoom())}}function de(s,c){if(1&s&&(t.j41(0,"cue-card",13),t.nrm(1,"cue-typography",14),t.k0s()),2&s){const e=t.XpG().$implicit,n=t.XpG(2);t.xc7("left",e.cx,"%")("top",e.cy-e.r*n.imageAspectRatio(),"%")("transform","scale("+1/n.zoom()+")"),t.R7$(),t.Y8G("noWrap",!0)("innerHTML",e.label,t.npT)}}function me(s,c){1&s&&t.nVh(0,de,2,8,"cue-card",18),2&s&&t.vxM(c.$implicit.label?0:-1)}function he(s,c){if(1&s&&(r.qSk(),t.j41(0,"svg",8),t.Z7z(1,le,1,17,":svg:ellipse",16,t.Vm6),t.k0s(),t.Z7z(3,me,1,1,null,null,t.Vm6)),2&s){const e=t.XpG();t.R7$(),t.Dyx(e.drawingArtefacts().circles),t.R7$(2),t.Dyx(e.drawingArtefacts().circles)}}function ue(s,c){if(1&s&&(r.qSk(),t.j41(0,"svg",8),t.nrm(1,"ellipse",19),t.k0s()),2&s){const e=c,n=t.XpG();t.R7$(),t.BMQ("cx",e.cx)("cy",e.cy)("rx",e.r)("ry",e.r*n.imageAspectRatio())("stroke",e.color)("fill",n.getBgColor(e.color))("stroke-width",3/n.zoom())}}function ge(s,c){if(1&s){const e=t.RV6();r.qSk(),t.j41(0,"polygon",21),t.bIt("contextMenuOpen",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!0))})("contextMenuClose",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!1))}),t.k0s()}if(2&s){const e=c.$implicit,n=c.$index,o=t.XpG(2),i=t.sdS(17);t.xc7("pointer-events",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"all":"none")("cursor",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"pointer":"default"),t.AVh("clickable",o.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit),t.Y8G("cueContextMenu",i)("contextMenuData",t.l_i(13,ne,e,n))("cueContextEnabled",o.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit),t.BMQ("points",o.pointsToAttr(e.points))("stroke",e.color||"rgba(255, 0, 0, 0.8)")("fill",!1===e.showFill?"none":o.getBgColor(e.color))("stroke-width",3/o.zoom())}}function pe(s,c){if(1&s&&(t.j41(0,"cue-card",13),t.nrm(1,"cue-typography",14),t.k0s()),2&s){const e=t.XpG().$implicit,n=t.XpG(2);t.xc7("left",n.polygonCentroid(e.points).x,"%")("top",n.polygonCentroid(e.points).y,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.Y8G("noWrap",!0)("innerHTML",e.label,t.npT)}}function _e(s,c){1&s&&t.nVh(0,pe,2,8,"cue-card",18),2&s&&t.vxM(c.$implicit.label?0:-1)}function fe(s,c){if(1&s&&(r.qSk(),t.j41(0,"svg",8),t.Z7z(1,ge,1,16,":svg:polygon",20,t.Vm6),t.k0s(),t.Z7z(3,_e,1,1,null,null,t.Vm6)),2&s){const e=t.XpG();t.R7$(),t.Dyx(e.drawingArtefacts().polygons),t.R7$(2),t.Dyx(e.drawingArtefacts().polygons)}}function we(s,c){if(1&s&&(r.qSk(),t.nrm(0,"line",25)(1,"line",26)),2&s){const e=t.XpG(),n=t.XpG();t.BMQ("x1",e.points[e.points.length-1][0])("y1",e.points[e.points.length-1][1])("x2",e.cursorPoint[0])("y2",e.cursorPoint[1])("stroke",e.color)("stroke-width",2/n.zoom()),t.R7$(),t.BMQ("x1",e.cursorPoint[0])("y1",e.cursorPoint[1])("x2",e.points[0][0])("y2",e.points[0][1])("stroke",e.color)("stroke-width",1/n.zoom())}}function xe(s,c){if(1&s&&t.nrm(0,"div",27),2&s){const e=c.$implicit,n=t.XpG(),o=t.XpG();t.xc7("left",e[0],"%")("top",e[1],"%")("transform","translate(-50%, -50%) scale("+1/o.zoom()+")")("background",n.color)}}function ve(s,c){if(1&s&&t.nrm(0,"div",28),2&s){const e=t.XpG(),n=t.XpG();t.xc7("left",e.cursorPoint[0],"%")("top",e.cursorPoint[1],"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")")("background",e.color)}}function Me(s,c){if(1&s&&t.nrm(0,"div",31),2&s){const e=t.XpG();t.xc7("left",e.x,"%")}}function ye(s,c){if(1&s&&t.nrm(0,"div",32),2&s){const e=t.XpG();t.xc7("top",e.y,"%")}}function be(s,c){if(1&s&&(t.nVh(0,Me,1,2,"div",29),t.nVh(1,ye,1,2,"div",30)),2&s){const e=c;t.vxM(void 0!==e.x?0:-1),t.R7$(),t.vxM(void 0!==e.y?1:-1)}}function Ce(s,c){if(1&s&&(r.qSk(),t.j41(0,"svg",8),t.nrm(1,"polyline",22),t.nVh(2,we,2,12),t.k0s(),t.Z7z(3,xe,1,8,"div",23,t.Vm6),t.nVh(5,ve,1,8,"div",24),t.nVh(6,be,2,2)),2&s){let e;const n=c,o=t.XpG();t.R7$(),t.BMQ("points",o.pointsToAttr(n.points))("stroke",n.color)("stroke-width",3/o.zoom()),t.R7$(),t.vxM(n.cursorPoint?2:-1),t.R7$(),t.Dyx(n.points),t.R7$(2),t.vxM(n.cursorPoint&&!o.isCursorOnVertex(n.cursorPoint,n.points)?5:-1),t.R7$(),t.vxM((e=o.polygonService.axisSnapLines())?6:-1,e)}}function De(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",33),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG();return r.Njj("polygon"===i.drawMode()?i.polygonService.onPolygonClick(o):i.drawingService.onDrawMouseDown(o))})("keydown.escape",function(){r.eBV(e);const o=t.XpG();return r.Njj(o.polygonService.cancelPolygon())}),t.k0s()}}function Pe(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",35),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"nw"))}),t.k0s(),t.j41(1,"div",36),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"ne"))}),t.k0s(),t.j41(2,"div",37),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"sw"))}),t.k0s(),t.j41(3,"div",38),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"se"))}),t.k0s(),t.j41(4,"div",39),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"n"))}),t.k0s(),t.j41(5,"div",40),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"s"))}),t.k0s(),t.j41(6,"div",41),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"w"))}),t.k0s(),t.j41(7,"div",42),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"e"))}),t.k0s()}if(2&s){const e=t.XpG().$implicit,n=t.XpG(3);t.xc7("left",e.x,"%")("top",e.y,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x+e.width,"%")("top",e.y,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x,"%")("top",e.y+e.height,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x+e.width,"%")("top",e.y+e.height,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x+e.width/2,"%")("top",e.y,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x+e.width/2,"%")("top",e.y+e.height,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x,"%")("top",e.y+e.height/2,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.x+e.width,"%")("top",e.y+e.height/2,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")")}}function ze(s,c){if(1&s&&t.nVh(0,Pe,8,48),2&s){const e=c.$index,n=t.XpG(2);t.vxM(e===n.index?0:-1)}}function Te(s,c){if(1&s&&t.Z7z(0,ze,1,1,null,null,t.Vm6),2&s){const e=t.XpG(2);t.Dyx(e.boundingBoxes())}}function Ie(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",43),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"radius"))}),t.k0s(),t.j41(1,"div",43),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"radius"))}),t.k0s(),t.j41(2,"div",44),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"radius"))}),t.k0s(),t.j41(3,"div",44),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG(4);return r.Njj(i.editService.onEditMouseDown(o,"radius"))}),t.k0s()}if(2&s){const e=t.XpG().$implicit,n=t.XpG(3);t.xc7("left",e.cx+e.r,"%")("top",e.cy,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.cx-e.r,"%")("top",e.cy,"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.cx,"%")("top",e.cy-e.r*n.imageAspectRatio(),"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")"),t.R7$(),t.xc7("left",e.cx,"%")("top",e.cy+e.r*n.imageAspectRatio(),"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")")}}function Ee(s,c){if(1&s&&t.nVh(0,Ie,4,24),2&s){const e=c.$index,n=t.XpG(2);t.vxM(e===n.index?0:-1)}}function Ve(s,c){if(1&s&&t.Z7z(0,Ee,1,1,null,null,t.Vm6),2&s){const e=t.XpG(2);t.Dyx(e.drawingArtefacts().circles)}}function ke(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",46),t.bIt("mousedown",function(o){const i=r.eBV(e).$index,a=t.XpG(5);return r.Njj(a.editService.onEditMouseDown(o,"vertex:"+i))}),t.k0s()}if(2&s){const e=c.$implicit,n=t.XpG(5);t.xc7("left",e[0],"%")("top",e[1],"%")("transform","translate(-50%, -50%) scale("+1/n.zoom()+")")}}function Ae(s,c){if(1&s&&t.Z7z(0,ke,1,6,"div",45,t.Vm6),2&s){const e=t.XpG().$implicit;t.Dyx(e.points)}}function Le(s,c){if(1&s&&t.nVh(0,Ae,2,0),2&s){const e=c.$index,n=t.XpG(2);t.vxM(e===n.index?0:-1)}}function Se(s,c){if(1&s&&t.Z7z(0,Le,1,1,null,null,t.Vm6),2&s){const e=t.XpG(2);t.Dyx(e.drawingArtefacts().polygons)}}function Re(s,c){if(1&s){const e=t.RV6();t.j41(0,"div",34),t.bIt("mousedown",function(o){r.eBV(e);const i=t.XpG();return r.Njj(i.editService.onEditMouseDown(o,"body"))}),t.nVh(1,Te,2,0),t.nVh(2,Ve,2,0),t.nVh(3,Se,2,0),t.k0s()}if(2&s){const e=c;t.R7$(),t.vxM("bbox"===e.type?1:-1),t.R7$(),t.vxM("circle"===e.type?2:-1),t.R7$(),t.vxM("polygon"===e.type?3:-1)}}function je(s,c){if(1&s){const e=t.RV6();r.qSk(),t.j41(0,"g",49),t.bIt("contextMenuOpen",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!0))})("contextMenuClose",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.isContextMenuOpen.set(!1))})("click",function(o){const i=r.eBV(e).$implicit,a=t.XpG(2);return r.Njj(a.handleSvgPathClick(i,o))}),t.k0s()}if(2&s){const e=c.$implicit,n=c.$index,o=t.XpG(2),i=t.sdS(17);t.xc7("pointer-events",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"all":"none")("cursor",o.contextMenuItems().length>0||e.allowRemove||e.allowEdit?"pointer":"default")("--dxf-sw",null!=e.strokeWidth&&o.zoom()?e.strokeWidth/o.zoom():null),t.AVh("clickable",o.contextMenuItems().length>0||!!e.allowRemove||!!e.allowEdit),t.Y8G("cueContextMenu",i)("contextMenuData",t.l_i(18,oe,e,n))("cueContextEnabled",o.contextMenuItems().length>0&&o.contextMenuItems().some(t._m7(17,ie,c))||!!e.allowRemove||!!e.allowEdit)("innerHTML",o.safeSvg(e.svg),t.npT),t.BMQ("title",e.label||"")("transform",e.transform||null)("stroke",e.color||"#ffa8a8")("fill",e.fillColor||"none")("stroke-dasharray",e.strokeDashArray||null)}}function Fe(s,c){if(1&s&&(t.j41(0,"cue-card",13),t.nrm(1,"cue-typography",14),t.k0s()),2&s){const e=c,n=t.XpG().$implicit,o=t.XpG(2);t.xc7("left",e.x,"%")("top",e.y,"%")("transform","translate(-50%, -50%) scale("+1/o.zoom()+")"),t.R7$(),t.Y8G("noWrap",!0)("innerHTML",n.label,t.npT)}}function Xe(s,c){if(1&s&&t.nVh(0,Fe,2,8,"cue-card",18),2&s){let e;const n=c.$implicit,o=t.XpG(2);t.vxM((e=n.label&&o.getSvgLabelPositionPercent(n.svg,n.transform))?0:-1,e)}}function Ze(s,c){if(1&s&&(r.qSk(),t.j41(0,"svg",47),t.Z7z(1,je,1,21,":svg:g",48,t.Vm6),t.k0s(),t.Z7z(3,Xe,1,1,null,null,t.Vm6)),2&s){const e=t.XpG();t.BMQ("viewBox",e.svgViewBox()),t.R7$(),t.Dyx(e.drawingArtefacts().svgPaths),t.R7$(2),t.Dyx(e.drawingArtefacts().svgPaths)}}function Ge(s,c){if(1&s){const e=t.RV6();t.j41(0,"cue-menu-item",50),t.bIt("click",function(){r.eBV(e);const o=t.XpG().$implicit,i=t.XpG(2).$implicit;return r.Njj(o.action(i.artefact))}),t.EFF(1),t.k0s()}if(2&s){const e=t.XpG().$implicit;t.R7$(),t.SpI(" ",e.label," ")}}function Be(s,c){if(1&s&&t.nVh(0,Ge,2,1,"cue-menu-item"),2&s){const e=c.$implicit,n=t.XpG(2).$implicit;t.vxM(!e.visible||e.visible(n.artefact)?0:-1)}}function Ne(s,c){if(1&s){const e=t.RV6();t.j41(0,"cue-menu-item",50),t.bIt("click",function(){r.eBV(e);const o=t.XpG(2).$implicit,i=t.XpG();return r.Njj(i.editService.startEditArtefact(o.type,"bbox"===o.type?o.artefact.sourceIndex:o.index))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}2&s&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"common.buttons.edit")," "))}function $e(s,c){if(1&s){const e=t.RV6();t.j41(0,"cue-menu-item",50),t.bIt("click",function(){r.eBV(e);const o=t.XpG(2).$implicit,i=t.XpG();return r.Njj("bbox"===o.type?i.removeArtefact(o.artefact):"circle"===o.type?i.removeCircleArtefact(o.index):"polygon"===o.type?i.removePolygonArtefact(o.index):i.removeSvgPathArtefact(o.index))}),t.EFF(1),t.nI1(2,"transloco"),t.k0s()}2&s&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"common.buttons.delete")," "))}function Oe(s,c){if(1&s&&(t.j41(0,"cue-menu-wrap"),t.Z7z(1,Be,1,1,null,null,se),t.nVh(3,Ne,3,3,"cue-menu-item"),t.nVh(4,$e,3,3,"cue-menu-item"),t.k0s()),2&s){const e=t.XpG().$implicit,n=t.XpG();t.R7$(),t.Dyx(n.contextMenuItems()),t.R7$(2),t.vxM(!e.artefact.allowEdit||"bbox"!==e.type&&"circle"!==e.type&&"polygon"!==e.type?-1:3),t.R7$(),t.vxM(e.artefact.allowRemove?4:-1)}}function We(s,c){if(1&s&&t.nVh(0,Oe,5,2,"cue-menu-wrap"),2&s){const e=t.XpG();t.vxM(e.contextMenuItems().length>0?0:-1)}}function Ye(s,c){if(1&s){const e=t.RV6();t.j41(0,"cue-image-toolbar",52),t.mxI("zoomChange",function(o){r.eBV(e);const i=t.XpG(2);return t.DH7(i.zoom,o)||(i.zoom=o),r.Njj(o)})("panChange",function(o){r.eBV(e);const i=t.XpG(2);return t.DH7(i.pan,o)||(i.pan=o),r.Njj(o)})("activeToolChange",function(o){r.eBV(e);const i=t.XpG(2);return t.DH7(i.activeTool,o)||(i.activeTool=o),r.Njj(o)}),t.bIt("rotate",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.handleRotate())})("zoomIn",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.handleZoomIn())})("zoomOut",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.handleZoomOut())})("zoomFit",function(){r.eBV(e);const o=t.XpG(2);return r.Njj(o.calculateFitZoom())}),t.k0s()}if(2&s){const e=t.XpG(),n=t.XpG();t.Aen(n.toolbarStyle()),t.Y8G("options",e),t.R50("zoom",n.zoom)("pan",n.pan)("activeTool",n.activeTool),t.Y8G("minZoom",n.minZoom())("maxZoom",n.maxZoom())}}function He(s,c){1&s&&t.nVh(0,Ye,1,8,"cue-image-toolbar",51),2&s&&t.vxM(c.hidden?-1:0)}let Ue=(()=>{class s{svgHelpers=(0,r.WQX)(K);editService=(0,r.WQX)(N);drawingService=(0,r.WQX)($);polygonService=(0,r.WQX)(O);sanitizer=(0,r.WQX)(X.up);onEscape(){this.polygonService.polygonPoints().length>0&&this.polygonService.cancelPolygon(),this.editService.editingArtefact()&&this.editService.cancelEdit()}onEnter(){this.editService.editingArtefact()&&this.editService.cancelEdit()}src=g.hFB.required();alt=(0,g.hFB)("");fitMode=(0,g.hFB)("contain");toolbarOptions=(0,g.hFB)(new A.g);drawMode=(0,g.hFB)("none");panDisabled=(0,g.hFB)(!1);zoomDisabled=(0,g.hFB)(!1);drawnArtefactDef=(0,g.hFB)({allowRemove:!0,allowEdit:!0,color:"rgba(255, 0, 0, 0.9)"});contextMenuItems=(0,g.hFB)([]);activeTool=(0,g.geq)("pan");drawingArtefacts=(0,g.geq)((0,G.x)());artefactSelected=(0,g.CGW)();artefactDrawn=(0,g.CGW)();artefactRemoved=(0,g.CGW)();artefactEdited=(0,g.CGW)();drawColor=(0,T.EW)(()=>this.drawnArtefactDef().color??"rgba(255, 0, 0, 0.9)");panModeActive=(0,T.EW)(()=>!this.panDisabled()&&"none"===this.drawMode()&&!this.editService.editingArtefact()&&!this.isContextMenuOpen()&&"select"!==this.activeTool());boundingBoxes=(0,T.EW)(()=>this.drawingArtefacts().xywhs.map((n,o)=>{const i=this.parseXYWH("string"==typeof n?n:n.xywhStr);return i&&0!==i.width&&0!==i.height?("object"==typeof n&&(i.color=n.color,i.label=n.label,i.showFill=n.showFill,i.allowRemove=n.allowRemove,i.allowEdit=n.allowEdit),i.sourceIndex=o,i):null}).filter(Boolean));panZoom=(0,g.ebz)(k);imageElement=(0,g.ebz)("imageElement");rotationAngle=(0,r.vPA)(0);pan=(0,r.vPA)({x:0,y:0});isContextMenuOpen=(0,r.vPA)(!1);isZooming=(0,r.vPA)(!1);_zoomEndTimer=null;constructor(){(0,r.QZP)(e=>{const n=this.panZoom();if(n){const o=n.containerRef()?.nativeElement;if(o){const i=new ResizeObserver(()=>{this.zoomDisabled()||this.calculateFitZoom()});i.observe(o),e(()=>i.disconnect())}}}),(0,r.QZP)(e=>{this.zoom(),this.isZooming.set(!0),this._zoomEndTimer&&clearTimeout(this._zoomEndTimer),this._zoomEndTimer=setTimeout(()=>this.isZooming.set(!1),150),e(()=>{this._zoomEndTimer&&clearTimeout(this._zoomEndTimer)})}),queueMicrotask(()=>{const e=this.mouseToImagePercent.bind(this),n=this.parseXYWH.bind(this);this.editService.init({drawingArtefacts:this.drawingArtefacts,mouseToImagePercent:e,parseXYWH:n,polygonService:this.polygonService,artefactEdited:this.artefactEdited}),this.drawingService.init({drawMode:this.drawMode,drawColor:this.drawColor,drawnArtefactDef:this.drawnArtefactDef,artefactDrawn:this.artefactDrawn,mouseToImagePercent:e,imageDimensions:this.imageDimensions,drawingArtefacts:this.drawingArtefacts}),this.polygonService.init({drawColor:this.drawColor,drawnArtefactDef:this.drawnArtefactDef,artefactDrawn:this.artefactDrawn,mouseToImagePercent:e,imageAspectRatio:this.imageAspectRatio,zoom:this.zoom,imageDimensions:this.imageDimensions,drawingArtefacts:this.drawingArtefacts})})}zoom=(0,r.vPA)(1);imageDimensions=(0,r.vPA)(null);imageAspectRatio=(0,T.EW)(()=>{const e=this.imageDimensions();return e&&0!==e.height?e.width/e.height:1});minZoom=(0,r.vPA)(1);maxZoom=(0,r.vPA)(10);toolbarStyle=(0,T.EW)(()=>{const e=this.toolbarOptions();return{position:"absolute",left:e.margin,right:e.margin,["top"===e.position?"top":"bottom"]:e.margin,"z-index":"1000",display:"flex","justify-content":"center"}});onImageLoad(){const e=this.imageElement()?.nativeElement;e&&(this.imageDimensions.set({width:e.naturalWidth,height:e.naturalHeight}),this.zoomDisabled()||this.calculateFitZoom())}calculateFitZoom(){const e=this.panZoom(),n=this.imageElement()?.nativeElement;!e||!n||requestAnimationFrame(()=>{const o=e.containerRef()?.nativeElement;if(!o)return;const i=o.getBoundingClientRect(),a=n.naturalWidth,l=n.naturalHeight;if(0===a||0===l)return;const d=i.width/a,m=i.height/l;let u=1;u="contain"===this.fitMode()?Math.min(d,m):"cover"===this.fitMode()?Math.max(d,m):1,this.minZoom.set(Math.min(u,1)),this.zoom.set(u),this.centerImage()})}centerImage(){const e=this.panZoom();e?requestAnimationFrame(()=>{const n=e.containerRef()?.nativeElement;if(!n)return;const o=n.getBoundingClientRect(),i=this.zoom(),a=this.imageDimensions()?.width||0,l=this.imageDimensions()?.height||0;this.pan.set({x:(o.width-a*i)/2,y:(o.height-l*i)/2})}):this.pan.set({x:0,y:0})}handleRotate(){this.rotationAngle.update(e=>(e-90)%360),this.pan.update(()=>({x:0,y:0}))}handleZoomIn(){this.panZoom()?.zoomIn()}handleZoomOut(){this.panZoom()?.zoomOut()}parseXYWH(e){try{const o=e.replace("percent:","").split(",").map(m=>parseFloat(m.trim()));if(4!==o.length||o.some(isNaN))return console.warn(`Invalid XYWH format: ${e}`),null;const[i,a,l,d]=o;return{x:i,y:a,width:l,height:d}}catch(n){return console.error(`Error parsing XYWH: ${e}`,n),null}}getBgColor(e){if(!e)return"rgba(255, 0, 0, 0.1)";const n=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/);if(n)return`rgba(${n[1]}, ${n[2]}, ${n[3]}, 0.1)`;const o=e.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(o){const i=o[1];return`rgba(${parseInt(3===i.length?i[0]+i[0]:i.slice(0,2),16)}, ${parseInt(3===i.length?i[1]+i[1]:i.slice(2,4),16)}, ${parseInt(3===i.length?i[2]+i[2]:i.slice(4,6),16)}, 0.1)`}return e.replace(/rgba?\([^)]+\)/,"rgba(255, 0, 0, 0.1)")}mouseToImagePercent(e){const n=this.imageElement()?.nativeElement;if(!n)return null;const o=n.getBoundingClientRect(),a=(e.clientY-o.top)/o.height*100;return{x:Math.max(0,Math.min(100,(e.clientX-o.left)/o.width*100)),y:Math.max(0,Math.min(100,a))}}handleBboxClick(e,n){n.stopPropagation(),this.artefactSelected.emit(e)}removeArtefact(e){if(null==e.sourceIndex)return;const n=this.drawingArtefacts().xywhs[e.sourceIndex];this.drawingArtefacts.update(o=>({...o,xywhs:o.xywhs.filter((i,a)=>a!==e.sourceIndex)})),n&&this.artefactRemoved.emit(n)}removeCircleArtefact(e){const n=this.drawingArtefacts().circles[e];this.drawingArtefacts.update(o=>({...o,circles:o.circles.filter((i,a)=>a!==e)})),n&&this.artefactRemoved.emit(n)}removePolygonArtefact(e){const n=this.drawingArtefacts().polygons[e];this.drawingArtefacts.update(o=>({...o,polygons:o.polygons.filter((i,a)=>a!==e)})),n&&this.artefactRemoved.emit(n)}handleSvgPathClick(e,n){n.stopPropagation(),this.artefactSelected.emit(e)}removeSvgPathArtefact(e){const n=this.drawingArtefacts().svgPaths[e];this.drawingArtefacts.update(o=>({...o,svgPaths:o.svgPaths.filter((i,a)=>a!==e)})),n&&this.artefactRemoved.emit(n)}svgViewBox=(0,T.EW)(()=>{const e=this.imageDimensions();if(e&&e.width>0&&e.height>0)return`0 0 ${e.width} ${e.height}`;const n=this.drawingArtefacts().svgPaths;if(n.length>0){const i=n[0].svg.match(/viewBox="([^"]+)"/);if(i)return i[1]}return"0 0 100 100"});getSvgLabelPositionPercent(e,n){const o=this.svgHelpers.getLabelPosition(e);if(!o)return null;const i=this.imageDimensions();if(!i||0===i.width||0===i.height)return null;let{x:a,y:l}=o;if(n){const d=n.match(/matrix\(\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*,\s*([-\d.e]+)\s*\)/);if(d){const[,m,u,p,v,M,P]=d.map(Number),E=u*a+v*l+P;a=m*a+p*l+M,l=E}}return{x:a/i.width*100,y:l/i.height*100}}pointsToAttr(e){return e.map(n=>n[0]+","+n[1]).join(" ")}polygonCentroid(e){let n=0,o=0;for(const i of e)n+=i[0],o+=i[1];return{x:n/e.length,y:o/e.length}}isCursorOnVertex(e,n){for(const o of n)if(Math.abs(e[0]-o[0])<.5&&Math.abs(e[1]-o[1])<.5)return!0;return!1}safeSvg(e){let n=e.trim();if(n.startsWith("<svg")){const i=(new DOMParser).parseFromString(n,"image/svg+xml"),a=i.querySelector("parsererror");a&&console.warn("[ImageViewer] safeSvg: SVG parse error",a.textContent),n=i.documentElement.innerHTML}return this.sanitizer.bypassSecurityTrustHtml(n)}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=t.VBU({type:s,selectors:[["cue-image-viewer"]],viewQuery:function(n,o){1&n&&t.wEZ(o.panZoom,k,5)(o.imageElement,q,5),2&n&&t.NyB(2)},hostBindings:function(n,o){1&n&&t.bIt("keydown.escape",function(){return o.onEscape()},t.EBC)("keydown.enter",function(){return o.onEnter()},t.EBC)},inputs:{src:[1,"src"],alt:[1,"alt"],fitMode:[1,"fitMode"],toolbarOptions:[1,"toolbarOptions"],drawMode:[1,"drawMode"],panDisabled:[1,"panDisabled"],zoomDisabled:[1,"zoomDisabled"],drawnArtefactDef:[1,"drawnArtefactDef"],contextMenuItems:[1,"contextMenuItems"],activeTool:[1,"activeTool"],drawingArtefacts:[1,"drawingArtefacts"]},outputs:{activeTool:"activeToolChange",drawingArtefacts:"drawingArtefactsChange",artefactSelected:"artefactSelected",artefactDrawn:"artefactDrawn",artefactRemoved:"artefactRemoved",artefactEdited:"artefactEdited"},features:[t.Jv_([N,$,O])],ngContentSelectors:J,decls:19,vars:19,consts:[["imageElement",""],["artefactContextMenu",""],[1,"container"],[2,"width","100%","height","100%",3,"zoomChange","panChange","minZoom","maxZoom","zoom","pan","zoomStep","panMode"],[1,"image-container"],["draggable","false",2,"max-width","none","height","auto","display","block","user-select","none",3,"load","src","alt"],["trigger","leftclick",1,"bounding-box-overlay",3,"clickable","removable","left","top","width","height","border-color","border-width","background-color","title","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"bounding-box-overlay","draw-preview",3,"left","top","width","height","border-color","border-width","background-color"],["viewBox","0 0 100 100","preserveAspectRatio","none",1,"svg-overlay",2,"position","absolute","top","0","left","0","width","100%","height","100%","pointer-events","none","overflow","visible"],["tabindex","0",1,"draw-overlay"],[1,"draw-overlay","edit-overlay"],["trigger","leftclick",1,"bounding-box-overlay",3,"contextMenuOpen","contextMenuClose","click","title","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"bbox-label",3,"transform"],[1,"bbox-label"],["size","xs","weight","medium",3,"noWrap","innerHTML"],[1,"bounding-box-overlay","draw-preview"],["vector-effect","non-scaling-stroke","trigger","leftclick",1,"clickable",3,"pointer-events","cursor","cueContextMenu","contextMenuData","cueContextEnabled"],["vector-effect","non-scaling-stroke","trigger","leftclick",1,"clickable",3,"contextMenuOpen","contextMenuClose","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"bbox-label",3,"left","top","transform"],["vector-effect","non-scaling-stroke","stroke-dasharray","6 4"],["vector-effect","non-scaling-stroke","trigger","leftclick",3,"pointer-events","cursor","clickable","cueContextMenu","contextMenuData","cueContextEnabled"],["vector-effect","non-scaling-stroke","trigger","leftclick",3,"contextMenuOpen","contextMenuClose","cueContextMenu","contextMenuData","cueContextEnabled"],["fill","none","vector-effect","non-scaling-stroke","stroke-dasharray","6 4"],[1,"polygon-vertex",3,"left","top","transform","background"],[1,"polygon-vertex","cursor-preview",3,"left","top","transform","background"],["vector-effect","non-scaling-stroke","stroke-dasharray","4 4","opacity","0.6"],["vector-effect","non-scaling-stroke","stroke-dasharray","2 4","opacity","0.3"],[1,"polygon-vertex"],[1,"polygon-vertex","cursor-preview"],[1,"snap-guide","vertical",3,"left"],[1,"snap-guide","horizontal",3,"top"],[1,"snap-guide","vertical"],[1,"snap-guide","horizontal"],["tabindex","0",1,"draw-overlay",3,"mousedown","keydown.escape"],[1,"draw-overlay","edit-overlay",3,"mousedown"],[1,"resize-handle","nw",3,"mousedown"],[1,"resize-handle","ne",3,"mousedown"],[1,"resize-handle","sw",3,"mousedown"],[1,"resize-handle","se",3,"mousedown"],[1,"resize-handle","n",3,"mousedown"],[1,"resize-handle","s",3,"mousedown"],[1,"resize-handle","w",3,"mousedown"],[1,"resize-handle","e",3,"mousedown"],[1,"resize-handle","radius",3,"mousedown"],[1,"resize-handle","radius-v",3,"mousedown"],[1,"resize-handle","vertex",3,"left","top","transform"],[1,"resize-handle","vertex",3,"mousedown"],["preserveAspectRatio","none",1,"svg-overlay",2,"position","absolute","top","0","left","0","width","100%","height","100%","pointer-events","none","overflow","visible"],["trigger","leftclick",3,"clickable","pointer-events","cursor","cueContextMenu","contextMenuData","cueContextEnabled","--dxf-sw","innerHTML"],["trigger","leftclick",3,"contextMenuOpen","contextMenuClose","click","cueContextMenu","contextMenuData","cueContextEnabled","innerHTML"],[3,"click"],[3,"options","style","zoom","pan","activeTool","minZoom","maxZoom"],[3,"zoomChange","panChange","activeToolChange","rotate","zoomIn","zoomOut","zoomFit","options","zoom","pan","activeTool","minZoom","maxZoom"]],template:function(n,o){if(1&n){const i=t.RV6();t.NAR(),t.j41(0,"div",2)(1,"cue-pan-zoom",3),t.mxI("zoomChange",function(l){return r.eBV(i),t.DH7(o.zoom,l)||(o.zoom=l),r.Njj(l)})("panChange",function(l){return r.eBV(i),t.DH7(o.pan,l)||(o.pan=l),r.Njj(l)}),t.j41(2,"div",4)(3,"img",5,0),t.bIt("load",function(){return o.onImageLoad()}),t.k0s(),t.Z7z(5,re,2,26,"div",6,t.Vm6),t.nVh(7,ce,1,14,"div",7),t.nVh(8,he,5,0),t.nVh(9,ue,2,7,":svg:svg",8),t.nVh(10,fe,5,0),t.nVh(11,Ce,7,6),t.nVh(12,De,1,0,"div",9),t.nVh(13,Re,4,3,"div",10),t.nVh(14,Ze,5,1),t.SdG(15),t.DNE(16,We,1,1,"ng-template",null,1,t.C5r),t.k0s()(),t.nVh(18,He,1,1),t.k0s()}if(2&n){let i,a,l,d,m;t.R7$(),t.Y8G("minZoom",o.zoomDisabled()?o.zoom():o.minZoom())("maxZoom",o.zoomDisabled()?o.zoom():o.maxZoom()),t.R50("zoom",o.zoom)("pan",o.pan),t.Y8G("zoomStep",.1)("panMode",o.panModeActive()),t.R7$(),t.xc7("transform","rotate("+o.rotationAngle()+"deg)"),t.R7$(),t.Y8G("src",o.src(),t.B4B)("alt",o.alt()),t.R7$(2),t.Dyx(o.boundingBoxes()),t.R7$(2),t.vxM((i=o.drawingService.drawPreview())?7:-1,i),t.R7$(),t.vxM(o.drawingArtefacts().circles.length>0?8:-1),t.R7$(),t.vxM((a=o.drawingService.circleDrawPreview())?9:-1,a),t.R7$(),t.vxM(o.drawingArtefacts().polygons.length>0?10:-1),t.R7$(),t.vxM((l=o.polygonService.polygonDrawPreview())?11:-1,l),t.R7$(),t.vxM("none"!==o.drawMode()?12:-1),t.R7$(),t.vxM((d=o.editService.editingArtefact())?13:-1,d),t.R7$(),t.vxM(o.drawingArtefacts().svgPaths.length>0&&!o.isZooming()?14:-1),t.R7$(4),t.vxM((m=o.toolbarOptions())?18:-1,m)}},dependencies:[L.MD,A.F,k,S.Q,C.M,R.D,f.Z,z.Typography,B.Kj],styles:["[_nghost-%COMP%]{display:contents}.container[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;overflow:hidden;display:flex;flex-direction:column}.image-container[_ngcontent-%COMP%]{position:relative;height:auto}.bounding-box-overlay[_ngcontent-%COMP%]{position:absolute;border:3px solid rgba(255,0,0,.8);background-color:#ff00001a;box-sizing:border-box;pointer-events:none;z-index:5;transition:border-width .2s ease,background-color .2s ease}.bounding-box-overlay.clickable[_ngcontent-%COMP%]{pointer-events:auto;cursor:pointer}.bounding-box-overlay.clickable[_ngcontent-%COMP%]:hover{border-width:3px;background-color:#ff000040}.bbox-label[_ngcontent-%COMP%]{position:absolute;top:-12px;left:-28px;transform-origin:bottom left;pointer-events:none;z-index:6;--cue-card-padding-x: 8px;--cue-card-padding-y: 4px}cue-image-toolbar[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:0;z-index:10;display:flex;justify-content:center}.draw-overlay[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;cursor:crosshair;z-index:6}.edit-overlay[_ngcontent-%COMP%]{cursor:move;z-index:8}.resize-handle[_ngcontent-%COMP%]{position:absolute;width:8px;height:8px;background:#fff;border:2px solid rgba(0,120,215,.9);border-radius:2px;z-index:9;pointer-events:auto}.resize-handle.nw[_ngcontent-%COMP%]{cursor:nw-resize}.resize-handle.ne[_ngcontent-%COMP%]{cursor:ne-resize}.resize-handle.sw[_ngcontent-%COMP%]{cursor:sw-resize}.resize-handle.se[_ngcontent-%COMP%]{cursor:se-resize}.resize-handle.n[_ngcontent-%COMP%]{cursor:n-resize}.resize-handle.s[_ngcontent-%COMP%]{cursor:s-resize}.resize-handle.e[_ngcontent-%COMP%]{cursor:e-resize}.resize-handle.w[_ngcontent-%COMP%]{cursor:w-resize}.resize-handle.radius[_ngcontent-%COMP%]{cursor:ew-resize;border-radius:50%}.resize-handle.radius-v[_ngcontent-%COMP%]{cursor:ns-resize;border-radius:50%}.draw-preview[_ngcontent-%COMP%]{border-style:dashed!important;pointer-events:none;z-index:7}.bounding-box-overlay.removable[_ngcontent-%COMP%]{pointer-events:auto}.polygon-vertex[_ngcontent-%COMP%]{position:absolute;width:8px;height:8px;border-radius:50%;border:2px solid white;pointer-events:none;z-index:7}.polygon-vertex.cursor-preview[_ngcontent-%COMP%]{opacity:.6}.snap-guide[_ngcontent-%COMP%]{position:absolute;pointer-events:none;z-index:6}.snap-guide.vertical[_ngcontent-%COMP%]{top:0;bottom:0;width:0;border-left:1px dashed rgba(0,200,255,.7)}.snap-guide.horizontal[_ngcontent-%COMP%]{left:0;right:0;height:0;border-top:1px dashed rgba(0,200,255,.7)}"],changeDetection:0})}return s})()}}]);
package/586.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[586],{6586(U,V,b){b.d(V,{MarkdownViewer:()=>rt});var A=b(467),d=b(5802),T=b(7705),S=b(5547),H=b(4226),M=b(2771),w=b(7673),E=b(4572),D=b(1397),j=b(8141),m=b(9437);const I=(0,b(1853).L)(c=>function(){c(this),this.name="EmptyError",this.message="no elements in sequence"});var O=b(5964),R=b(6697),W=b(9974),Z=b(4360);function Ie(c=Se){return(0,W.N)((p,e)=>{let t=!1;p.subscribe((0,Z._)(e,n=>{t=!0,e.next(n)},()=>t?e.complete():e.error(c())))})}function Se(){return new I}var Te=b(3669);function ae(c,p){const e=arguments.length>=2;return t=>t.pipe(c?(0,O.p)((n,o)=>c(n,o,t)):Te.D,(0,R.s)(1),e?function $(c){return(0,W.N)((p,e)=>{let t=!1;p.subscribe((0,Z._)(e,n=>{t=!0,e.next(n)},()=>{t||e.next(c),e.complete()}))})}(p):Ie(()=>new I))}var we=b(6354),G=b(177),Ee=b(345);const le=new d.nKC("All of the settings registered in the whole app."),Y=new d.nKC("The settings collected from all ancestor injectors"),ue=new d.nKC("The settings for the currently loaded module."),q="__ngx_dynamic_hooks_content",ee="dynamic-component-anchor",B="__ngx_dynamic_hooks_anchor_id",P="__ngx_dynamic_hooks_anchor_parsetoken",Be=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];var te=function(c){return c[c.All=0]="All",c[c.Linear=1]="Linear",c[c.None=2]="None",c}(te||{});const x={},pe="[a-zA-Z_$]+[a-zA-Z0-9_$]*",ne="[a-zA-Z$\\-_:][a-zA-Z$\\-_:0-9\\.]*";function N(c,p){if(!p.global)throw Error("TypeError: matchAll called with a non-global RegExp argument");const e=[];let t=p.exec(c);for(;null!==t;)e.push(t),t=p.exec(c);return p.lastIndex=0,e}function oe(c){return void 0!==c?.__ngContext__}x.attributeNameNoBracketsRegex="("+ne+")",x.attributeNameBracketsRegex="\\[("+ne+")\\]",x.attributeNameRoundBracketsRegex="\\(("+ne+")\\)",x.attributeNameRegex="(?:"+x.attributeNameNoBracketsRegex+"|"+x.attributeNameBracketsRegex+"|"+x.attributeNameRoundBracketsRegex+")",x.attributeValueDoubleQuotesRegex='"((?:\\\\.|[^"])*?)"',x.attributeValueSingleQuotesRegex="'((?:\\\\.|[^'])*?)'",x.variablePathDotNotation="\\."+pe,x.variableBracketsNotation="\\[[^\\]]*\\]",x.variablePathFunctionCall="\\([^\\)]*\\)",x.variablePathPartRegex="(?:"+x.variablePathDotNotation+"|"+x.variableBracketsNotation+"|"+x.variablePathFunctionCall+")",x.contextVariableRegex="context"+x.variablePathPartRegex+"*",x.placeholderVariablePathDotNotation="\\@@@cxtDot@@@"+pe,x.placeholderVariableBracketsNotation="@@@cxtOpenSquareBracket@@@[^\\]]*@@@cxtCloseSquareBracket@@@",x.placeholderVariablePathFunctionCall="@@@cxtOpenRoundBracket@@@[^\\)]*@@@cxtCloseRoundBracket@@@",x.placeholderVariablePathPartRegex="(?:"+x.placeholderVariablePathDotNotation+"|"+x.placeholderVariableBracketsNotation+"|"+x.placeholderVariablePathFunctionCall+")",x.placeholderContextVariableRegex="__CXT__"+x.placeholderVariablePathPartRegex+"*";class Ae{constructor(p,e,t,n){this.configResolver=e,this.tagHookFinder=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(p),this.name=this.config.name}findHooks(p,e,t){let n=this.config.enclosing?this.tagHookFinder.findEnclosingTags(p,this.config.selector,this.config.bracketStyle,t):this.tagHookFinder.findSingleTags(p,this.config.selector,this.config.bracketStyle,t);return this.config.allowSelfClosing&&(n=[...n,...this.tagHookFinder.findSelfClosingTags(p,this.config.selector,this.config.bracketStyle,t)],n.sort((o,r)=>o.openingTagStartIndex-r.openingTagStartIndex)),n}loadComponent(p,e,t,n,o){return{component:this.config.component,hostElementTag:this.config.hostElementTag||this.config.selector,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(p,e,t,n){let o=this.savedBindings[p];return void 0===o&&(o=this.createBindings(e.openingTag),this.savedBindings[p]=o),this.bindingsValueManager.checkInputBindings(o.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(o.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(o.inputs),outputs:this.getValuesFromSavedBindings(o.outputs)}}createBindings(p){const e=this.collectRawInputs(p),t={};for(const[r,s]of Object.entries(e))t[r]={raw:s,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawOutputs(p),o={};for(const[r,s]of Object.entries(n))o[r]={raw:s,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:o}}collectRawInputs(p){const e=this.getBindingsFromOpeningTag(p,"noBracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t=this.getBindingsFromOpeningTag(p,"bracketInputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null);for(const[n,o]of Object.entries(e))e[n]="'"+o+"'";return{...e,...t}}collectRawOutputs(p){return this.getBindingsFromOpeningTag(p,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null)}getBindingsFromOpeningTag(p,e,t,n){const o={},r="(?:"+x.attributeValueDoubleQuotesRegex+"|"+x.attributeValueSingleQuotesRegex+")";let s;switch(e){case"noBracketInputs":s=x.attributeNameNoBracketsRegex;break;case"bracketInputs":s=x.attributeNameBracketsRegex;break;case"outputs":s=x.attributeNameRoundBracketsRegex}const l=N(p,new RegExp(s+"="+r,"gim"));for(const u of l){let h=u[2]||u[3];void 0===h&&"noBracketInputs"===e&&(h=""),o[u[1]]=h}const g={};for(const[u,h]of Object.entries(o))t&&t.includes(u)||n&&!n.includes(u)||(g[u]=h);return g}getValuesFromSavedBindings(p){const e={};for(const[t,n]of Object.entries(p))e[t]=n.value;return e}}class Ne{constructor(p,e,t,n){this.configResolver=e,this.platformService=t,this.bindingsValueManager=n,this.savedBindings={},this.config=this.configResolver.processConfig(p),this.name=this.config.name}findHookElements(p,e,t){return Array.from(this.platformService.querySelectorAll(p,this.config.selector))}loadComponent(p,e,t,n,o){return this.scrubAngularBindingAttrs(e.element),{component:this.config.component,hostElementTag:this.config.hostElementTag,injector:this.config.injector,environmentInjector:this.config.environmentInjector}}getBindings(p,e,t,n){let o=this.savedBindings[p];return void 0===o&&(o=this.createBindings(e.elementSnapshot),this.savedBindings[p]=o),this.bindingsValueManager.checkInputBindings(o.inputs,t,this.config,n),this.bindingsValueManager.checkOutputBindings(o.outputs,this.config,n),{inputs:this.getValuesFromSavedBindings(o.inputs),outputs:this.getValuesFromSavedBindings(o.outputs)}}scrubAngularBindingAttrs(p){const e=Array.from(p.attributes).map(t=>t.name).filter(t=>t.startsWith("[")&&t.endsWith("]")||t.startsWith("(")&&t.endsWith(")"));for(const t of e)this.platformService.removeAttribute(p,t)}createBindings(p){const e=this.collectRawBindings(p,"inputs",this.config.inputsBlacklist||null,this.config.inputsWhitelist||null),t={};for(const[r,s]of Object.entries(e))t[r]={raw:s,parsed:!1,value:null,boundContextVariables:{}};const n=this.collectRawBindings(p,"outputs",this.config.outputsBlacklist||null,this.config.outputsWhitelist||null),o={};for(const[r,s]of Object.entries(n))o[r]={raw:s,parsed:!1,value:null,boundContextVariables:{}};return{inputs:t,outputs:o}}collectRawBindings(p,e,t,n){const o={},r=this.platformService.getAttributeNames(p);for(let i of r)if("inputs"===e&&(!i.startsWith("(")||!i.endsWith(")"))||"outputs"===e&&i.startsWith("(")&&i.endsWith(")")){let a=this.platformService.getAttribute(p,i);"inputs"===e&&i.startsWith("[")&&i.endsWith("]")&&""===a&&(a=void 0),"inputs"===e&&(!i.startsWith("[")||!i.endsWith("]"))&&(a=`'${a}'`),i=i.replace(/^\[|^\(|\]$|\)$/g,""),o[i]=a}const s={};for(const[i,a]of Object.entries(o))t&&t.includes(i)||n&&!n.includes(i)||(s[i]=a);return s}getValuesFromSavedBindings(p){const e={};for(const[t,n]of Object.entries(p))e[t]=n.value;return e}}const Pe={component:void 0,name:void 0,parseWithRegex:!1,selector:void 0,hostElementTag:void 0,injector:void 0,allowSelfClosing:!0,enclosing:!0,bracketStyle:{opening:"<",closing:">"},parseInputs:!0,unescapeStrings:!0,inputsBlacklist:void 0,inputsWhitelist:void 0,outputsBlacklist:void 0,outputsWhitelist:void 0,allowContextInBindings:!0,allowContextFunctionCalls:!0};let De=(()=>{class c{constructor(){}processConfig(e){const t=JSON.parse(JSON.stringify(Pe));if(!e||!e.hasOwnProperty("component"))throw Error('Missing the required "component" property for the SelectorHookParserConfig. Must be either the component class or a LazyLoadComponentConfig.');if(t.component=e.component,e.component.hasOwnProperty("prototype")){const n=(0,T.HJs)(e.component);t.selector=n.selector}else{if(!e.component.hasOwnProperty("importPromise")||!e.component.hasOwnProperty("importName"))throw Error('The "component" property in the SelectorHookParserConfig must either contain the component class or a LazyLoadComponentConfig.');if(!e.hasOwnProperty("selector"))throw Error('When using lazy-loaded dynamic components, you have to specify the "selector" property in the parser config, as the real selector can\'t be known before the component is loaded.')}if(e.hasOwnProperty("name")){if("string"!=typeof e.name)throw Error('The submitted "name" property in the SelectorHookParserConfig must be of type string, was '+typeof e.name);t.name=e.name}if(e.hasOwnProperty("selector")){if("string"!=typeof e.selector)throw Error('The submitted "selector" property in the SelectorHookParserConfig must be of type string, was '+typeof e.selector);t.selector=e.selector}if(e.hasOwnProperty("hostElementTag")){if("string"!=typeof e.hostElementTag)throw Error('The submitted "hostElementTag" property in the SelectorHookParserConfig must be of type string, was '+typeof e.hostElementTag);t.hostElementTag=e.hostElementTag}if(e.hasOwnProperty("parseWithRegex")){if("boolean"!=typeof e.parseWithRegex)throw Error('The submitted "parseWithRegex" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseWithRegex);t.parseWithRegex=e.parseWithRegex}if(e.hasOwnProperty("allowSelfClosing")){if("boolean"!=typeof e.allowSelfClosing)throw Error('The submitted "allowSelfClosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowSelfClosing);t.allowSelfClosing=e.allowSelfClosing}if(e.hasOwnProperty("enclosing")){if("boolean"!=typeof e.enclosing)throw Error('The submitted "enclosing" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.enclosing);t.enclosing=e.enclosing}if(e.hasOwnProperty("bracketStyle")){if("object"!=typeof e.bracketStyle||"string"!=typeof e.bracketStyle.opening||"string"!=typeof e.bracketStyle.closing)throw Error('The submitted "bracketStyle" property in the SelectorHookParserConfig must have the form {opening: string, closing: string}');t.bracketStyle=e.bracketStyle}if(e.hasOwnProperty("injector")&&(t.injector=e.injector),e.hasOwnProperty("environmentInjector")&&(t.environmentInjector=e.environmentInjector),e.hasOwnProperty("unescapeStrings")){if("boolean"!=typeof e.unescapeStrings)throw Error('The submitted "unescapeStrings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.unescapeStrings);t.unescapeStrings=e.unescapeStrings}if(e.hasOwnProperty("parseInputs")){if("boolean"!=typeof e.parseInputs)throw Error('The submitted "parseInputs" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.parseInputs);t.parseInputs=e.parseInputs}if(e.hasOwnProperty("inputsBlacklist")){if(!Array.isArray(e.inputsBlacklist))throw Error('The submitted "inputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsBlacklist=e.inputsBlacklist}if(e.hasOwnProperty("inputsWhitelist")){if(!Array.isArray(e.inputsWhitelist))throw Error('The submitted "inputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.inputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "inputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.inputsWhitelist=e.inputsWhitelist}if(e.hasOwnProperty("outputsBlacklist")){if(!Array.isArray(e.outputsBlacklist))throw Error('The submitted "outputsBlacklist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsBlacklist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsBlacklist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsBlacklist=e.outputsBlacklist}if(e.hasOwnProperty("outputsWhitelist")){if(!Array.isArray(e.outputsWhitelist))throw Error('The submitted "outputsWhitelist" property in the SelectorHookParserConfig must be an array of strings.');for(const n of e.outputsWhitelist)if("string"!=typeof n)throw Error('All entries of the submitted "outputsWhitelist" property in the SelectorHookParserConfig must be of type string, '+typeof n+" found.");t.outputsWhitelist=e.outputsWhitelist}if(e.hasOwnProperty("allowContextInBindings")){if("boolean"!=typeof e.allowContextInBindings)throw Error('The submitted "allowContextInBindings" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextInBindings);t.allowContextInBindings=e.allowContextInBindings}if(e.hasOwnProperty("allowContextFunctionCalls")){if("boolean"!=typeof e.allowContextFunctionCalls)throw Error('The submitted "allowContextFunctionCalls" property in the SelectorHookParserConfig must be of type boolean, was '+typeof e.allowContextFunctionCalls);t.allowContextFunctionCalls=e.allowContextFunctionCalls}return t}static{this.\u0275fac=function(t){return new(t||c)}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})();const de=new d.nKC("An injection token to retrieve an optionally user-provided PlatformService");let Ve=(()=>{class c{constructor(e,t,n){this.document=e,this.rendererFactory=t,this.sanitizer=n,this.renderer=this.rendererFactory.createRenderer(null,null)}getNgVersion(){if(typeof this.document<"u"){const t=this.querySelectorAll(this.document,"[ng-version]")?.[0]?.getAttribute("ng-version");if(t)return parseInt(t,10)}return null}sanitize(e){return this.sanitizer.sanitize(S.WPN.HTML,e)||""}createElement(e){return this.renderer.createElement(e)}sortElements(e,t){return e===t?0:e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:e.sourceIndex-t.sourceIndex}cloneElement(e){return e.cloneNode(!0)}getTagName(e){return e.tagName}getOpeningTag(e){const n=e.outerHTML.length;return e.outerHTML.slice(0,"/"===e.outerHTML[n-2]?n:n-e.innerHTML.length-e.tagName.length-3)}getClosingTag(e){return e.outerHTML.slice(e.outerHTML.length-e.tagName.length-3)}getAttributeNames(e){return"function"==typeof e.getAttributeNames?e.getAttributeNames():[]}getAttribute(e,t){return"function"==typeof e.getAttribute?e.getAttribute(t):null}setAttribute(e,t,n){this.renderer.setAttribute(e,t,n)}removeAttribute(e,t){this.renderer.removeAttribute(e,t)}getParentNode(e){try{return this.renderer.parentNode(e)}catch{return null}}querySelectorAll(e,t){return Array.from(e.querySelectorAll(t))}getChildNodes(e){return Array.prototype.slice.call(e.childNodes)}appendChild(e,t){this.renderer.appendChild(e,t)}insertBefore(e,t,n){this.renderer.insertBefore(e,t,n)}clearChildNodes(e){if(e)for(;e.firstChild;)this.removeChild(e,e.firstChild)}removeChild(e,t){e.removeChild(t)}getInnerContent(e){return e.innerHTML}setInnerContent(e,t){e&&(e.innerHTML=t)}isTextNode(e){return e.nodeType===Node.TEXT_NODE}createTextNode(e){return document.createTextNode(e)}getTextContent(e){return e.textContent}dispatchEvent(e,t,n){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(d.qQL),d.KVO(S._9s),d.KVO(Ee.up))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),K=(()=>{class c{constructor(e,t){this.userPlatformService=e,this.defaultPlatformService=t}getFor(e){return this.userPlatformService&&"function"==typeof this.userPlatformService[e]?this.userPlatformService:this.defaultPlatformService}getNgVersion(){return this.getFor("getNgVersion").getNgVersion()}sanitize(e){return this.getFor("sanitize").sanitize(e)}createElement(e){return this.getFor("createElement").createElement(e)}sortElements(e,t){return this.getFor("sortElements").sortElements(e,t)}cloneElement(e){return this.getFor("cloneElement").cloneElement(e)}getTagName(e){return this.getFor("getTagName").getTagName(e)}getOpeningTag(e){return this.getFor("getOpeningTag").getOpeningTag(e)}getClosingTag(e){return this.getFor("getClosingTag").getClosingTag(e)}getAttributeNames(e){return this.getFor("getAttributeNames").getAttributeNames(e)}getAttribute(e,t){return this.getFor("getAttribute").getAttribute(e,t)}setAttribute(e,t,n){return this.getFor("setAttribute").setAttribute(e,t,n)}removeAttribute(e,t){return this.getFor("removeAttribute").removeAttribute(e,t)}getParentNode(e){return this.getFor("getParentNode").getParentNode(e)}querySelectorAll(e,t){return this.getFor("querySelectorAll").querySelectorAll(e,t)}getChildNodes(e){return this.getFor("getChildNodes").getChildNodes(e)}appendChild(e,t){return this.getFor("appendChild").appendChild(e,t)}insertBefore(e,t,n){return this.getFor("insertBefore").insertBefore(e,t,n)}clearChildNodes(e){return this.getFor("clearChildNodes").clearChildNodes(e)}removeChild(e,t){return this.getFor("removeChild").removeChild(e,t)}getInnerContent(e){return this.getFor("getInnerContent").getInnerContent(e)}setInnerContent(e,t){return this.getFor("setInnerContent").setInnerContent(e,t)}isTextNode(e){return this.getFor("isTextNode").isTextNode(e)}createTextNode(e){return this.getFor("createTextNode").createTextNode(e)}getTextContent(e){return this.getFor("getTextContent").getTextContent(e)}dispatchEvent(e,t,n){return this.getFor("dispatchEvent").dispatchEvent(e,t,n)}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(de,8),d.KVO(Ve))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),F=(()=>{class c{constructor(e){this.platformId=e}log(e,t){this.handleLog(e,t,"log")}warn(e,t){this.handleLog(e,t,"warn")}error(e,t){this.handleLog(e,t,"error")}handleLog(e,t,n){(t.logOptions?.dev&&this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.prod&&!this.isDevMode()&&(0,G.UE)(this.platformId)||t.logOptions?.ssr&&!(0,G.UE)(this.platformId))&&console[n](...e)}isDevMode(){return(0,T.naY)()}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(S.Agw))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),Me=(()=>{class c{constructor(e){this.logger=e}find(e,t,n,o,r={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){return n?this.findEnclosingHooks(e,t,n,o,r):this.findSingletagHooks(e,t)}findSingletagHooks(e,t){const n=[],o=N(e,t);for(const r of o)n.push({openingTagStartIndex:r.index,openingTagEndIndex:r.index+r[0].length,closingTagStartIndex:null,closingTagEndIndex:null});return n}findEnclosingHooks(e,t,n,o,r={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const s=[],i=[],a=N(e,t);for(const u of a)s.push({isOpening:!0,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});const l=N(e,n);for(const u of l)s.push({isOpening:!1,value:u[0],startIndex:u.index,endIndex:u.index+u[0].length});s.sort((u,h)=>u.startIndex-h.startIndex);const g=[];for(const[u,h]of s.entries())if(u>0&&h.startIndex<s[u-1].endIndex)this.logger.warn(['Syntax error - New tag "'+h.value+'" started at position '+h.startIndex+' before previous tag "'+s[u-1].value+'" ended at position '+s[u-1].endIndex+". Ignoring."],r);else if(h.isOpening)g.push(h);else{if(0===g.length){this.logger.warn(['Syntax error - Closing tag without preceding opening tag found: "'+h.value+'". Ignoring.'],r);continue}if(!1===o&&g.length>1){g.pop();continue}const f=g[g.length-1];i.push({openingTagStartIndex:f.startIndex,openingTagEndIndex:f.startIndex+f.value.length,closingTagStartIndex:h.startIndex,closingTagEndIndex:h.startIndex+h.value.length}),g.pop()}return g.length>0&&this.logger.warn(["Syntax error - Opening tags without corresponding closing tags found."],r),i}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),He=(()=>{class c{constructor(e){this.hookFinder=e}findSingleTags(e,t,n={opening:"<",closing:">"},o){const r=this.generateOpeningTagRegex(t,n);return this.hookFinder.find(e,r,void 0,void 0,o)}findEnclosingTags(e,t,n={opening:"<",closing:">"},o){const r=this.generateOpeningTagRegex(t,n),s=this.generateClosingTagRegex(t,n);return this.hookFinder.find(e,r,s,!0,o)}findSelfClosingTags(e,t,n={opening:"<",closing:">"},o){const r=this.generateOpeningTagRegex(t,n,!0);return this.hookFinder.find(e,r,void 0,void 0,o)}generateOpeningTagRegex(e,t={opening:"<",closing:">"},n=!1){const o=this.escapeRegex(t.opening),r=this.escapeRegex(e),s=(n?"\\/":"")+this.escapeRegex(t.closing);return new RegExp(o+r+"(?:\\s*"+s+"|(?:\\s+"+x.attributeNameRegex+"=(?:"+x.attributeValueDoubleQuotesRegex+"|"+x.attributeValueSingleQuotesRegex+"))+\\s*"+s+")","gim")}generateClosingTagRegex(e,t={opening:"<",closing:">"}){const n=this.escapeRegex(t.opening)+"/",o=this.escapeRegex(e),r=this.escapeRegex(t.closing);return new RegExp(n+o+r,"gim")}escapeRegex(e){return e.replace(new RegExp("[-\\/\\\\^$*+?.()|[\\]{}]","g"),"\\$&")}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(Me))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),Fe=(()=>{class c{encodeSubstrings(e){const r=[...N(e,/'/gm).filter(l=>0===l.index||"\\"!==e[l.index-1]),...N(e,/"/gm).filter(l=>0===l.index||"\\"!==e[l.index-1]),...N(e,/`/gm).filter(l=>0===l.index||"\\"!==e[l.index-1])];r.sort((l,g)=>l.index-g.index);const s=[];let i=null;for(const l of r)i?i[0]===l[0]&&(s.push({startIndex:i.index+1,endIndex:l.index}),i=null):i=l;if(null!==i)throw Error("Input parse error. String was opened, but not closed.");return this.encodeTextSegments(e,s,this.encodeStringSpecialChars)}encodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/'/g,"@@@singlequote@@@")).replace(/"/g,"@@@doublequote@@@")).replace(/`/g,"@@@gravequote@@@")).replace(/:/g,"@@@colon@@@")).replace(/;/g,"@@@semicolon@@@")).replace(/\./g,"@@@dot@@@")).replace(/,/g,"@@@comma@@@")).replace(/\\/g,"@@@backslash@@@")).replace(/\(/g,"@@@openRoundBracket@@@")).replace(/\)/g,"@@@closeRoundBracket@@@")).replace(/\[/g,"@@@openSquareBracket@@@")).replace(/\]/g,"@@@closeSquareBracket@@@")).replace(/\{/g,"@@@openCurlyBracket@@@")).replace(/\}/g,"@@@closeCurlyBracket@@@")}decodeStringSpecialChars(e){return(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/@@@singlequote@@@/g,"'")).replace(/@@@doublequote@@@/g,'"')).replace(/@@@gravequote@@@/g,"`")).replace(/@@@colon@@@/g,":")).replace(/@@@semicolon@@@/g,";")).replace(/@@@dot@@@/g,".")).replace(/@@@comma@@@/g,",")).replace(/@@@backslash@@@/g,"\\")).replace(/@@@openRoundBracket@@@/g,"(")).replace(/@@@closeRoundBracket@@@/g,")")).replace(/@@@openSquareBracket@@@/g,"[")).replace(/@@@closeSquareBracket@@@/g,"]")).replace(/@@@openCurlyBracket@@@/g,"{")).replace(/@@@closeCurlyBracket@@@/g,"}")}encodeSubfunctions(e){const o=[...N(e,/\(/gm),...N(e,/\)/gm)];o.sort((a,l)=>a.index-l.index);const r=[],s=[];for(const a of o)if("("===a[0])s.push(a);else{if(0===s.length)throw Error("Input parse error. Closed function bracket without opening it first.");1===s.length&&r.push({startIndex:s[0].index+1,endIndex:a.index}),s.pop()}if(0!==s.length)throw Error("Input parse error. Opened function bracket without closing it.");return this.encodeTextSegments(e,r,this.encodeFunctionBrackets)}encodeFunctionBrackets(e){return(e=e.replace(/\(/g,"@@@fnOpenBracket@@@")).replace(/\)/g,"@@@fnCloseBracket@@@")}decodeFunctionBrackets(e){return(e=e.replace(/@@@fnOpenBracket@@@/g,"(")).replace(/@@@fnCloseBracket@@@/g,")")}encodeVariableSubbrackets(e){const o=N(e,new RegExp("(?:[a-zA-Z_$\\])])(\\[)","gm")),r=[];for(const a of o){const l=e.substring(a.index+2),h=[...N(l,/\[/gm),...N(l,/\]/gm)];h.sort((v,C)=>v.index-C.index);let f=1;for(const v of h)if(f="]"===v[0]?f-1:f+1,0===f){r.push({startIndex:a.index+2,endIndex:a.index+2+v.index});break}if(0!==f)throw Error("Input parse error. Opened bracket without closing it.")}const s=[];for(const a of r)(0===s.length||s[s.length-1].endIndex<a.startIndex)&&s.push(a);return this.encodeTextSegments(e,s,this.encodeVariableBrackets)}encodeVariableBrackets(e){return(e=e.replace(/\[/g,"@@@variableOpeningBracket@@@")).replace(/\]/g,"@@@variableClosingBracket@@@")}decodeVariableBrackets(e){return(e=e.replace(/@@@variableOpeningBracket@@@/g,"[")).replace(/@@@variableClosingBracket@@@/g,"]")}transformContextVarIntoPlacerholder(e){return(e=(e=(e=(e=(e=(e="__CXT__"+e.substring(7)).replace(/\"/g,"@@@cxtDoubleQuote@@@")).replace(/\./g,"@@@cxtDot@@@")).replace(/\[/g,"@@@cxtOpenSquareBracket@@@")).replace(/\]/g,"@@@cxtCloseSquareBracket@@@")).replace(/\(/g,"@@@cxtOpenRoundBracket@@@")).replace(/\)/g,"@@@cxtCloseRoundBracket@@@")}transformPlaceholderIntoContextVar(e){return(e=(e=(e=(e=(e=(e="context"+e.substring(7)).replace(/@@@cxtDoubleQuote@@@/g,'"')).replace(/@@@cxtDot@@@/g,".")).replace(/@@@cxtOpenSquareBracket@@@/g,"[")).replace(/@@@cxtCloseSquareBracket@@@/g,"]")).replace(/@@@cxtOpenRoundBracket@@@/g,"(")).replace(/@@@cxtCloseRoundBracket@@@/g,")")}encodeTextSegments(e,t,n){const o=[];for(const i of t){const a=0===o.length?0:o[o.length-1].endIndex;o.push({type:"text",startIndex:a,endIndex:i.startIndex,string:e.substring(a,i.startIndex)}),o.push({type:"special",startIndex:i.startIndex,endIndex:i.endIndex,string:e.substring(i.startIndex,i.endIndex)})}const r=0===o.length?0:o[o.length-1].endIndex;o.push({type:"text",startIndex:r,endIndex:e.length-1,string:e.substring(r)});for(const i of o)"special"===i.type&&(i.string=n(i.string));let s="";for(const i of o)s+=i.string;return s}stripSlashes(e){return e.replace(/\\(.)/g,"$1")}escapeDoubleQuotes(e){return e.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}static{this.\u0275fac=function(t){return new(t||c)}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),je=(()=>{class c{constructor(e,t){this.dataTypeEncoder=e,this.logger=t}evaluate(e,t={},n,o=!0,r={},s=!0,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){if("null"===e)return null;if("undefined"!==e){if("true"===e)return!0;if("false"===e)return!1;if(!isNaN(e))return parseInt(e,10);if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")||e.startsWith("`")&&e.endsWith("`")){let a=e.substring(1,e.length-1);return a=o?this.dataTypeEncoder.stripSlashes(a):a,a}if((e=this.encodeDataTypeString(e)).startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")){const a=this.parseAsJSON(e,o);return this.loadJSONVariables(a,t,n,o,r,s,i)}if("$event"===e)return n;if(e.match(new RegExp("^\\s*"+x.contextVariableRegex+"\\s*$","gm")))return this.loadContextVariable(e,t,n,o,r,s,i);throw Error('Data type for following input was not recognized and could not be parsed: "'+e+'"')}}encodeDataTypeString(e){return e=this.dataTypeEncoder.encodeSubstrings(e),e=this.dataTypeEncoder.encodeSubfunctions(e),this.dataTypeEncoder.encodeVariableSubbrackets(e)}decodeDataTypeString(e){return e=this.dataTypeEncoder.decodeStringSpecialChars(e),e=this.dataTypeEncoder.decodeFunctionBrackets(e),(e=this.dataTypeEncoder.decodeVariableBrackets(e)).trim()}parseAsJSON(e,t){if((e=(e=(e=e.replace(/\'(\\.|[^\'])*?\'/gm,i=>'"'+i.slice(1,-1)+'"')).replace(/\`(\\.|[^\`])*?\`/gm,i=>'"'+i.slice(1,-1)+'"')).replace(/"?([a-z0-9A-Z_]+)"?\s*:/g,'"$1": ')).match(/"?__proto__"?\s*:/g))throw Error('Setting the "__proto__" property in a hook input object is not allowed.');if(e.match(/"?prototype"?\s*:/g))throw Error('Setting the "prototype" property in a hook input object is not allowed.');if(e.match(/"?constructor"?\s*:/g))throw Error('Setting the "constructor" property in a hook input object is not allowed.');e=this.replaceValuesInJSONString(e,"undefined",i=>"null"),e=this.replaceValuesInJSONString(e,x.contextVariableRegex,i=>'"'+this.dataTypeEncoder.transformContextVarIntoPlacerholder(i)+'"'),e=this.replaceValuesInJSONString(e,"\\$event",i=>'"__EVENT__"');const s=JSON.parse(e);return this.decodeJSONStrings(s,t),s}replaceValuesInJSONString(e,t,n){return e.replace(new RegExp("(?:(:\\s*)("+t+")(?=\\s*[,}])|([\\[,]\\s*)("+t+")(?=\\s*[\\],]))","gm"),(s,i,a,l,g)=>(i||l)+n(a||g))}decodeJSONStrings(e,t){for(const n in e)if("string"==typeof e[n]){if('__EVENT__"'===e[n]||e[n].match(new RegExp("^\\s*"+x.placeholderContextVariableRegex+"\\s*$","gm")))continue;let o=this.decodeDataTypeString(e[n]);o=t?this.dataTypeEncoder.stripSlashes(o):o,e[n]=o}else"object"==typeof e[n]&&this.decodeJSONStrings(e[n],t)}loadJSONVariables(e,t,n,o,r,s,i){for(const a in e)if("string"==typeof e[a]){if("__EVENT__"===e[a])e[a]=n;else if(e[a].match(new RegExp("^\\s*"+x.placeholderContextVariableRegex+"\\s*$","gm"))){const l=this.dataTypeEncoder.transformPlaceholderIntoContextVar(e[a].trim());e[a]=this.loadContextVariable(l,t,n,o,r,s,i)}}else"object"==typeof e[a]&&this.loadJSONVariables(e[a],t,n,o,r,s,i);return e}loadContextVariable(e,t={},n,o=!0,r={},s=!0,i={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){try{const a=e.substring(7);if(""===a.trim())return t;const l=[],g=N(a,new RegExp(x.variablePathPartRegex,"gm"));for(const u of g){if(u[0].startsWith(".")&&l.push({type:"property",value:u[0].substring(1)}),u[0].startsWith("[")&&u[0].endsWith("]")){let h=u[0].substring(1,u[0].length-1);h=this.decodeDataTypeString(h),h=this.evaluate(h,t,n,o,r,s),l.push({type:"property",value:h})}if(u[0].startsWith("(")&&u[0].endsWith(")")){if(!s)throw Error("Tried to call a function in a context variable. This has been disallowed in the current config.");const h=u[0].substring(1,u[0].length-1),f=[];if(""!==h)for(const v of h.split(",")){let C=this.decodeDataTypeString(v);C=this.evaluate(C,t,n,o,r,s),f.push(C)}l.push({type:"function",value:f})}}try{const u=this.fetchContextVariable(t,l);return r[this.decodeDataTypeString(e)]=u,u}catch{throw Error('The required context variable "'+this.decodeDataTypeString(e)+'" could not be found in the context object. Returning undefined instead.')}}catch(a){return this.logger.warn([a],i),void(r[this.decodeDataTypeString(e)]=void 0)}}fetchContextVariable(e,t){if("__proto__"===t[0].value)throw Error("Accessing the __proto__ property through a context variable is not allowed.");if("prototype"===t[0].value)throw Error("Accessing the prototype property through a context variable is not allowed.");if("constructor"===t[0].value)throw Error("Accessing the constructor property through a context variable is not allowed.");if(void 0===e)throw Error("Context variable path could not be resolved. Trying to access "+("property"===t[0].type?'property "'+t[0].value+'" of undefined.':"undefined function."));let n;return"property"===t[0].type?e.hasOwnProperty(t[0].value)?(n=e[t[0].value],"function"==typeof n&&(n=n.bind(e))):e.__proto__.hasOwnProperty(t[0].value)?(n=e.__proto__[t[0].value],"function"==typeof n&&(n=n.bind(e))):n=void 0:"function"===t[0].type&&(n=e(...t[0].value)),t.shift(),t.length>0&&(n=this.fetchContextVariable(n,t)),n}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(Fe),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),We=(()=>{class c{constructor(e,t){this.dataTypeParser=e,this.logger=t}checkInputBindings(e,t,n,o){for(const[r,s]of Object.entries(e))if(n.parseInputs)if(s.parsed)this.updateInputBindingIfStale(s,t,n);else try{s.value=this.dataTypeParser.evaluate(s.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,s.boundContextVariables,n.allowContextFunctionCalls,o),s.parsed=!0}catch(i){this.logger.error(["Hook input parsing error\nselector: "+n.selector+"\ninput: "+r+'\nvalue: "'+s.value+'"'],o),this.logger.error([i.stack],o),delete e[r]}else s.value=s.raw}updateInputBindingIfStale(e,t,n){if(Object.keys(e.boundContextVariables).length>0){let o=!1;for(const[r,s]of Object.entries(e.boundContextVariables)){const i=this.dataTypeParser.encodeDataTypeString(r);if(this.dataTypeParser.loadContextVariable(i,t,void 0,n.unescapeStrings,{},n.allowContextFunctionCalls)!==s){o=!0;break}}o&&(e.boundContextVariables={},e.value=this.dataTypeParser.evaluate(e.raw,n.allowContextInBindings?t:{},void 0,n.unescapeStrings,e.boundContextVariables,n.allowContextFunctionCalls))}}checkOutputBindings(e,t,n){for(const[o,r]of Object.entries(e))r.parsed||(r.value=(s,i)=>{try{this.dataTypeParser.evaluate(r.raw,t.allowContextInBindings?i:{},s,t.unescapeStrings,r.boundContextVariables,t.allowContextFunctionCalls)}catch(a){this.logger.error(["Hook output parsing error\nselector: "+t.selector+"\noutput: "+o+'\nvalue: "'+r.value+'"'],n),this.logger.error([a.stack],n)}},r.parsed=!0)}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(je),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),$e=(()=>{class c{constructor(e,t,n,o,r,s){this.injector=e,this.parserResolver=t,this.platformService=n,this.tagHookFinder=o,this.bindingsValueManager=r,this.logger=s}resolve(e,t,n,o,r){const s=[];for(const l of e){const g=this.resolveEntry(l,t,r);g&&s.push(g)}const i=this.validateParserFunctions(s,r);if(this.checkParserNames(i,r),!n&&!o)return i;this.checkBlackAndWhitelist(i,n,o,r);const a=[];for(const l of i)l.hasOwnProperty("name")&&"string"==typeof l.name&&(n&&n.includes(l.name)||o&&!o.includes(l.name))||a.push(l);return a}resolveEntry(e,t,n){if(e.hasOwnProperty("prototype")){if((0,T.HJs)(e))return this.createSelectorHookParser({component:e});try{return t.get(e)}catch{return new e}}else if("object"==typeof e){if("Object"!==e.constructor.name)return e;try{return this.createSelectorHookParser(e)}catch(o){return this.logger.error(["Invalid parser config - "+o.message,e],n),null}}return this.logger.error(["Invalid parser config - ",e],n),null}createSelectorHookParser(e){return e.hasOwnProperty("parseWithRegex")&&e.parseWithRegex||e.hasOwnProperty("enclosing")&&!e.enclosing||e.hasOwnProperty("bracketStyle")&&e.bracketStyle?new Ae(e,this.parserResolver,this.tagHookFinder,this.bindingsValueManager):new Ne(e,this.parserResolver,this.platformService,this.bindingsValueManager)}validateParserFunctions(e,t){const n=[];for(const o of e)"function"==typeof o.findHooks||"function"==typeof o.findHookElements?"function"==typeof o.loadComponent?"function"==typeof o.getBindings?n.push(o):this.logger.error(['Submitted parser does not implement "getBindings()". Removing from list of active parsers:',o],t):this.logger.error(['Submitted parser does not implement "loadComponent()". Removing from list of active parsers:',o],t):this.logger.error(['Submitted parser neither implements "findHooks()" nor "findHookElements()". One is required. Removing from list of active parsers:',o],t);return n}checkParserNames(e,t){const n=e.map(s=>s.name).filter(s=>void 0!==s),o=[],r=[];for(const s of n)o.includes(s)&&!r.includes(s)&&(this.logger.warn(['Parser name "'+s+'" is not unique and appears multiple times in the list of active parsers.'],t),r.push(s)),o.push(s)}checkBlackAndWhitelist(e,t,n,o){const r=e.map(s=>s.name).filter(s=>void 0!==s);if(t)for(const s of t)r.includes(s)||this.logger.warn(['Blacklisted parser name "'+s+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],o);if(n)for(const s of n)r.includes(s)||this.logger.warn(['Whitelisted parser name "'+s+'" does not appear in the list of global parsers names. Make sure both spellings are identical.'],o)}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(d.zZn),d.KVO(De),d.KVO(K),d.KVO(He),d.KVO(We),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),Le=(()=>{class c{constructor(e){this.parserEntryResolver=e}resolve(e,t,n,o,r,s=null,i=null,a=null,l=null){let g={};n=n||[],o=o||[];const u={options:{sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}};g=(r=r||{}).hasOwnProperty("inheritance")&&r.inheritance!==te.Linear?this.mergeSettings(r.inheritance===te.All?[u,...n,...o,{options:i||void 0}]:[u,r||{},{options:i||void 0}]):this.mergeSettings([u,...o,{parsers:s||void 0,options:i||void 0}]);const h=g.options;t&&"string"!=typeof t&&(h.sanitize=!1);let f=[];return s?f=this.parserEntryResolver.resolve(s,e,null,null,h):g.parsers&&(f=this.parserEntryResolver.resolve(g.parsers,e,a,l,h)),{parsers:f,options:h}}mergeSettings(e){const t={};for(const n of e){if(void 0!==n.parsers){void 0===t.parsers&&(t.parsers=[]);for(const o of n.parsers)t.parsers.includes(o)||t.parsers.push(o)}void 0!==n.options&&(void 0===t.options&&(t.options={}),t.options=this.recursiveAssign(t.options,n.options))}return t}recursiveAssign(e,t){if(Object(t)!==t)return t;Object(e)!==e&&(e={});for(const n in t)e[n]=this.recursiveAssign(e[n],t[n]);return e}static{this.\u0275fac=function(t){return new(t||c)(d.KVO($e))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})();const he="_ngx_dynamic_hooks_node_placeholder";let ze=(()=>{class c{constructor(e,t){this.platformService=e,this.logger=t}findInElement(e,t,n,o,r,s){for(const i of n)if("function"==typeof i.findHooks){this.checkElement(e,t,n,o,r,s);break}}checkElement(e,t,n,o,r,s,i={counter:0,nodes:{}}){let a=this.platformService.getChildNodes(e),l="";const g={};for(const f of a)if(this.platformService.isTextNode(f))l+=this.platformService.getTextContent(f);else{const v=i.counter++;l+=`${he}__${v}__`,g[v]=f}const u=Object.keys(s).length,h=this.find(l,t,n,o,r,s);if(Object.keys(s).length>u&&(this.platformService.clearChildNodes(e),this.platformService.setInnerContent(e,h.content),a=this.platformService.getChildNodes(e),i.nodes={...i.nodes,...g}),Object.keys(i.nodes).length)for(const f of a)if(this.platformService.isTextNode(f)){let v=this.platformService.getTextContent(f);if(v){const C=N(v,new RegExp(`${he}__(\\d*)__`,"g"));if(C.length){const k=[];let z=0;for(const _ of C){const xe=v.substring(z,_.index),X=parseInt(_[1]);xe&&k.push(this.platformService.createTextNode(xe)),X&&i.nodes[X]&&(k.push(i.nodes[X]),delete i.nodes[X]),z=_.index+_[0].length}const be=v.substring(z);be&&k.push(this.platformService.createTextNode(be));const ie=this.platformService.getParentNode(f);for(const _ of k)this.platformService.insertBefore(ie,_,f);this.platformService.removeChild(ie,f),a=this.platformService.getChildNodes(ie)}}}for(const f of a)f.nodeType!==Node.TEXT_NODE&&this.checkElement(f,t,n,o,r,s,i)}find(e,t,n,o,r,s){if(""===e)return{content:e,hookIndex:s};r.convertHTMLEntities&&(e=this.convertHTMLEntities(e));let i=[];for(const l of n)if("function"==typeof l.findHooks)for(const g of l.findHooks(e,t,r))i.push({parser:l,hookPosition:g});i.sort((l,g)=>l.hookPosition.openingTagStartIndex-g.hookPosition.openingTagStartIndex),i=this.validateHookPositions(i,e,r);const a=[];for(const l of i){const g=Object.keys(s).length+1,u=this.getHookSegments(l.hookPosition,e);if(a.push({startIndex:l.hookPosition.openingTagStartIndex,endIndex:l.hookPosition.openingTagEndIndex,replacement:`<${ee} ${B}="${g}" ${P}="${o}">`}),a.push({startIndex:u.enclosing?l.hookPosition.closingTagStartIndex:l.hookPosition.openingTagEndIndex,endIndex:u.enclosing?l.hookPosition.closingTagEndIndex:l.hookPosition.openingTagEndIndex,replacement:`</${ee}>`}),s[g]={id:g,parser:l.parser,value:{openingTag:u.openingTag,closingTag:u.closingTag,element:null,elementSnapshot:null},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},u.enclosing&&r.fixParagraphTags){const h=this.removeTagArtifacts(u.textBefore,"<p>","</p>",u.innerValue,"</p>","<p>");u.textBefore=h.firstText,u.innerValue=h.secondText;const f=this.removeTagArtifacts(u.innerValue,"<p>","</p>",u.textAfter,"</p>","<p>");u.innerValue=f.firstText,u.textAfter=f.secondText,e=u.textBefore+u.openingTag+u.innerValue+u.closingTag+u.textAfter}}a.sort((l,g)=>{let u=g.startIndex-l.startIndex;return 0===u&&(u=g.endIndex-l.endIndex),u});for(const l of a){const g=e.substring(0,l.startIndex),u=e.substring(l.endIndex);e=g+l.replacement+u}return{content:e,hookIndex:s}}getHookSegments(e,t){const n=Number.isInteger(e.closingTagStartIndex)&&Number.isInteger(e.closingTagEndIndex);return{enclosing:n,textBefore:t.substring(0,e.openingTagStartIndex),openingTag:t.substring(e.openingTagStartIndex,e.openingTagEndIndex),innerValue:n?t.substring(e.openingTagEndIndex,e.closingTagStartIndex):null,closingTag:n?t.substring(e.closingTagStartIndex,e.closingTagEndIndex):null,textAfter:t.substring(n?e.closingTagEndIndex:e.openingTagEndIndex)}}validateHookPositions(e,t,n){const o=[];e:for(const[r,s]of e.entries()){const i=Number.isInteger(s.hookPosition.closingTagStartIndex)&&Number.isInteger(s.hookPosition.closingTagEndIndex),a=s.hookPosition;if(a.openingTagStartIndex>=a.openingTagEndIndex){this.logger.warn(["Text hook error: openingTagEndIndex has to be greater than openingTagStartIndex. Ignoring.",a],n);continue}if(i&&a.openingTagEndIndex>a.closingTagStartIndex){this.logger.warn(["Text hook error: closingTagStartIndex has to be greater than openingTagEndIndex. Ignoring.",a],n);continue}if(i&&a.closingTagStartIndex>=a.closingTagEndIndex){this.logger.warn(["Text hook error: closingTagEndIndex has to be greater than closingTagStartIndex. Ignoring.",a],n);continue}const l=e.slice(0,r);for(const g of l){const u=g.hookPosition,h=Number.isInteger(u.closingTagStartIndex)&&Number.isInteger(u.closingTagEndIndex);if(a.openingTagStartIndex===u.openingTagStartIndex&&a.openingTagEndIndex===u.openingTagEndIndex&&(!i||!h||a.closingTagStartIndex===u.closingTagStartIndex&&a.closingTagEndIndex===u.closingTagEndIndex)){this.generateHookPosWarning("A text hook with the same position as another text hook was found. There may be multiple parsers looking for the same text pattern. Ignoring duplicates.",a,u,t,n);continue e}if(a.openingTagStartIndex<u.openingTagEndIndex){this.generateHookPosWarning("Text hook error: Hook opening tag starts before previous hook opening tag ends. Ignoring.",a,u,t,n);continue e}if(h&&!(a.openingTagEndIndex<=u.closingTagStartIndex||a.openingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Opening tag of hook overlaps with closing tag of previous hook. Ignoring.",a,u,t,n);continue e}if(h&&i&&!(a.closingTagEndIndex<=u.closingTagStartIndex||a.closingTagStartIndex>=u.closingTagEndIndex)){this.generateHookPosWarning("Text hook error: Closing tag of hook overlaps with closing tag of previous hook. Ignoring.",a,u,t,n);continue e}if(i&&h&&a.openingTagEndIndex<=u.closingTagStartIndex&&a.closingTagStartIndex>=u.closingTagEndIndex){this.generateHookPosWarning("Text hook error: The closing tag of a nested hook lies beyond the closing tag of the outer hook. Ignoring.",a,u,t,n);continue e}}o.push(s)}return o}generateHookPosWarning(e,t,n,o,r){const s=this.getHookSegments(n,o),i=this.getHookSegments(t,o);this.logger.warn([e+"\nFirst hook: ",{openingTag:s.openingTag,openingTagStartIndex:n.openingTagStartIndex,openingTagEndIndex:n.openingTagEndIndex,closingTag:s.closingTag,closingTagStartIndex:n.closingTagStartIndex,closingTagEndIndex:n.closingTagEndIndex},"\nSecond hook:",{openingTag:i.openingTag,openingTagStartIndex:t.openingTagStartIndex,openingTagEndIndex:t.openingTagEndIndex,closingTag:i.closingTag,closingTagStartIndex:t.closingTagStartIndex,closingTagEndIndex:t.closingTagEndIndex}],r)}removeTagArtifacts(e,t,n,o,r,s){let i=!1,a=!1;const l=e.lastIndexOf(t),g=e.lastIndexOf(n);(l>=0&&-1===g||l>g)&&(i=!0);const u=o.indexOf(r),h=o.indexOf(s);return(u>=0&&-1===h||u<h)&&(a=!0),i&&a&&(e=e.substring(0,l)+" ".repeat(t.length)+e.substring(l+t.length),o=o.substring(0,u)+" ".repeat(r.length)+o.substring(u+r.length)),{firstText:e,secondText:o}}convertHTMLEntities(e){const t=this.platformService.createElement("div");return e.replace(/&[#A-Za-z0-9]+;/gi,o=>"&nbsp;"===o?" ":(this.platformService.setInnerContent(t,o),this.platformService.getTextContent(t)))}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(K),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),Ke=(()=>{class c{constructor(e,t){this.platformService=e,this.logger=t}find(e,t,n,o,r,s){let i=[];for(const a of n)if("function"==typeof a.findHookElements)for(const l of a.findHookElements(e,t,r))i.push({parser:a,hookElement:l});i=function Re(c,p,e){return[...c].sort(function(n,o){return"function"==typeof e&&(n=e(n),o=e(o)),p(n,o)})}(i,this.platformService.sortElements.bind(this.platformService),a=>a.hookElement),i=this.validateHookElements(i,e,r);for(const a of i){const l=Object.keys(s).length+1;s[l]={id:l,parser:a.parser,value:{openingTag:this.platformService.getOpeningTag(a.hookElement),closingTag:this.platformService.getClosingTag(a.hookElement),element:a.hookElement,elementSnapshot:this.platformService.cloneElement(a.hookElement)},data:null,isLazy:!1,bindings:null,previousBindings:null,componentRef:null,dirtyInputs:new Set,outputSubscriptions:{},htmlEventSubscriptions:{}},this.platformService.setAttribute(a.hookElement,B,l.toString()),this.platformService.setAttribute(a.hookElement,P,o)}return s}validateHookElements(e,t,n){const o=[];for(const[r,s]of e.entries())o.slice(0,r).findIndex(l=>l.hookElement===s.hookElement)>=0||this.platformService.getAttributeNames(s.hookElement).includes(B)||this.platformService.getAttributeNames(s.hookElement).includes(P)?this.logger.warn(["An element hook tried to use an element that was found by another hook before. There may be multiple parsers looking for the same elements. Ignoring duplicates.",s.hookElement],n):oe(s.hookElement)||o.push(s);return o}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(K),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})();const re="dynamic-hooks-sanitization-placeholder",_e=new RegExp(`</?${re}.*?>`,"g");let Ue=(()=>{class c{constructor(e){this.platformService=e,this.attrWhitelist=[B,P,"class","href","src"]}sanitize(e,t,n){const o={};for(const a of Object.values(t)){const l=this.platformService.querySelectorAll(e,`[${B}="${a.id}"][${P}="${n}"]`)?.[0];if(l){o[a.id]=l;const g=this.platformService.getParentNode(l),u=this.platformService.getChildNodes(l),h=this.platformService.createElement(re);this.platformService.setAttribute(h,B,a.id.toString()),this.platformService.setAttribute(h,P,n),this.platformService.insertBefore(g,h,l),this.platformService.removeChild(g,l);for(const f of u)this.platformService.appendChild(h,f)}}let r=this.platformService.getInnerContent(e);r=this.findAndEncodeTags(r,_e);const s=console.warn;console.warn=()=>{};let i=this.platformService.sanitize(r);console.warn=s,i=this.decodeTagString(i),e.innerHTML=i||"";for(const[a,l]of Object.entries(o)){const g=this.platformService.querySelectorAll(e,`${re}[${B}="${a}"]`)?.[0];if(g){const u=this.platformService.getParentNode(g),h=this.platformService.getChildNodes(g);this.platformService.insertBefore(u,l,g),this.platformService.removeChild(u,g);for(const f of h)this.platformService.appendChild(l,f);this.sanitizeElementAttrs(l)}}return e}sanitizeElementAttrs(e){const t=this.platformService.getAttributeNames(e),n=this.platformService.createElement("div"),o=this.platformService.createElement("span");this.platformService.appendChild(n,o);for(const i of t){try{this.platformService.setAttribute(o,i,this.platformService.getAttribute(e,i))}catch{}try{i!==B&&i!==P&&this.platformService.removeAttribute(e,i)}catch{}}n.innerHTML=this.platformService.sanitize(this.platformService.getInnerContent(n));const r=this.platformService.querySelectorAll(n,"span")[0],s=this.platformService.getAttributeNames(r);for(const i of s)try{this.platformService.setAttribute(e,i,this.platformService.getAttribute(r,i))}catch{}return e}findAndEncodeTags(e,t){let n=e;const o=N(e,t);o.sort((r,s)=>s.index-r.index);for(const r of o){const s=r.index,i=r.index+r[0].length,a=n.substring(0,s),l=this.encodeTagString(n.substring(s,i)),g=n.substring(i);n=a+l+g}return n}encodeTagString(e){return(e=(e=e.replace(/</g,"@@@hook-lt@@@")).replace(/>/g,"@@@hook-gt@@@")).replace(/"/g,"@@@hook-dq@@@")}decodeTagString(e){return(e=(e=e.replace(/@@@hook-lt@@@/g,"<")).replace(/@@@hook-gt@@@/g,">")).replace(/@@@hook-dq@@@/g,'"')}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(K))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),qe=(()=>{class c{constructor(e){this.logger=e}isEqual(e,t,n,o={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}}){const r=this.detailedStringify(e,n),s=this.detailedStringify(t,n);return null===r.result||null===s.result?(this.logger.warn(["Objects could not be compared by value as one or both of them could not be stringified. Returning false. \n","Objects:",e,t],o),!1):r.result===s.result}detailedStringify(e,t){try{const n={count:0},o=this.decycle(e,[],t,n);return{result:JSON.stringify(o,(s,i)=>void 0===i?"undefined":"function"==typeof i||"symbol"==typeof i?i.toString():i),depthReachedCount:n.count}}catch{return{result:null,depthReachedCount:0}}}decycle(e,t=[],n=5,o){if(t.length>n)return o.count++,null;if(!e||"object"!=typeof e||e instanceof Date)return e;for(const s of t)if(this.objEqualsProperties(e,s))return null;const r=t.concat([e]);if(Array.isArray(e)){const s=[];for(const i of e)s.push(this.decycle(i,r,n,o));return s}{const s={};for(const i of Object.keys(e))s[i]=this.decycle(e[i],r,n,o);return s}}objEqualsProperties(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),ge=(()=>{class c{constructor(e,t){this.deepComparer=e,this.logger=t}refresh(e,t,n,o){for(const[r,s]of Object.entries(e))this.updateBindings(s,t,n);if(o)for(const r of Object.values(e)){if(!r.componentRef)return;"function"==typeof r.componentRef.instance.onDynamicChanges&&r.componentRef.instance.onDynamicChanges({context:t})}}updateBindings(e,t,n){e.componentRef&&(e.bindings=e.parser.getBindings(e.id,e.value,t,n),this.updateComponentWithNewInputs(e,n),this.updateComponentWithNewOutputs(e,t,n),e.previousBindings={inputs:this.savePreviousBindings(e,"inputs",n.compareInputsByValue,n.compareByValueDepth),outputs:this.savePreviousBindings(e,"outputs",n.compareOutputsByValue,n.compareByValueDepth)})}savePreviousBindings(e,t,n,o){const r={};if(e.bindings.hasOwnProperty(t))for(const[s,i]of Object.entries(e.bindings[t]))r[s]={reference:i,stringified:n?this.deepComparer.detailedStringify(i,o):null};return r}updateComponentWithNewInputs(e,t){const n=e.componentRef.instance,o=this.getChangedBindings(e,"inputs",t),r=[],s=(0,T.HJs)(e.componentRef.componentType);for(const[i,a]of Object.entries(o)){const l=t.ignoreInputAliases?"propName":"templateName",g=s.inputs.find(u=>i===u[l])||s.inputs.find(u=>i.toLowerCase()===u[l].toLowerCase())||s.inputs.find(u=>i.replace(/-/g,"")===u[l])||s.inputs.find(u=>i.replace(/-/g,"").toLowerCase()===u[l].toLowerCase());if(g)r.push({propName:g.propName,templateName:g.templateName,value:a});else if(t.acceptInputsForAnyProperty){const h=Object.getOwnPropertyNames(n).find(f=>i===f)||Object.getOwnPropertyNames(n).find(f=>i.toLowerCase()===f.toLowerCase())||i;if(["__proto__","prototype","constructor"].includes(h)){this.logger.error(['Tried to overwrite a __proto__, prototype or constructor property with input "'+h+'" for hook "'+e.componentRef.componentType.name+'". This is not allowed.'],t);continue}r.push({propName:h,templateName:null,value:a})}}for(const{propName:i,templateName:a,value:l}of r)a?e.componentRef?.setInput(a,l):i&&(e.componentRef.instance[i]=l);r.length&&e.componentRef?.changeDetectorRef.detectChanges()}updateComponentWithNewOutputs(e,t,n){const o=e.componentRef.instance,r=this.getChangedBindings(e,"outputs",n),s=[],i=(0,T.HJs)(e.componentRef.componentType);for(const[a,l]of Object.entries(r)){const g=n.ignoreOutputAliases?"propName":"templateName",u=i.outputs.find(h=>a===h[g])||i.outputs.find(h=>a.toLowerCase()===h[g].toLowerCase())||i.outputs.find(h=>a.replace(/-/g,"")===h[g])||i.outputs.find(h=>a.replace(/-/g,"").toLowerCase()===h[g].toLowerCase());if(u)s.push({propName:u.propName,templateName:u.templateName,value:l});else if(n.acceptOutputsForAnyObservable){let h=Object.getOwnPropertyNames(o).find(f=>o[f]instanceof H.c&&a===f)||Object.getOwnPropertyNames(o).find(f=>o[f]instanceof H.c&&a.toLowerCase()===f.toLowerCase());h&&s.push({propName:h,templateName:null,value:l})}}for(const{propName:a,value:g}of s)e.outputSubscriptions[a]&&e.outputSubscriptions[a].unsubscribe(),e.outputSubscriptions[a]=e.componentRef.instance[a].subscribe(u=>{g(u,t)})}getChangedBindings(e,t,n){const o={};if(e.bindings.hasOwnProperty(t))for(const[r,s]of Object.entries(e.bindings[t]))if(e.previousBindings&&e.previousBindings[t].hasOwnProperty(r))if("inputs"===t?n.compareInputsByValue:n.compareOutputsByValue){const i=this.deepComparer.detailedStringify(s,n.compareByValueDepth);this.checkDetailedStringifyResultPair(r,e.componentRef.componentType.name,n,e.previousBindings[t][r].stringified,i)?i.result!==e.previousBindings[t][r].stringified.result&&(o[r]=s):s!==e.previousBindings[t][r].reference&&(o[r]=s)}else s!==e.previousBindings[t][r].reference&&(o[r]=s);else o[r]=s;return o}checkDetailedStringifyResultPair(e,t,n,o,r){return null===o.result&&null===r.result?(this.logger.warn(['Could stringify neither new nor old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===o.result?(this.logger.warn(['Could not stringify old value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):null===r.result?(this.logger.warn(['Could not stringify new value for hook binding "'+e+'" for component "'+t+'" to compare by value. Defaulting to comparison by reference instead.'],n),!1):(o.depthReachedCount>0&&r.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+r.depthReachedCount+" time(s) for new value and "+o.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):o.depthReachedCount>0?this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+o.depthReachedCount+' time(s) for old value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n):r.depthReachedCount>0&&this.logger.warn(["Maximum compareByValueDepth of "+n.compareByValueDepth+" reached "+r.depthReachedCount+' time(s) for new value while comparing binding "'+e+'" for component "'+t+".\n","If this impacts performance, consider simplifying this binding, reducing comparison depth or setting compareInputsByValue/compareOutputsByValue to false."],n),!0)}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(qe),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),Qe=(()=>{class c{constructor(e,t,n,o,r){this.platformId=e,this.appRef=t,this.componentUpdater=n,this.platformService=o,this.logger=r}init(e,t,n,o,r,s,i){const a=new M.m(1),l=[],g={};if(0===Object.keys(t).length)return a.next(!0),a;for(let h of this.platformService.querySelectorAll(e,`[${B}][${P}]`)){const f=parseInt(this.platformService.getAttribute(h,B));if(0===this.platformService.querySelectorAll(e,`[${B}="${f}"][${P}="${n}"]`).length){delete t[f];continue}const v=t[f];v.data=v.parser.loadComponent(v.id,v.value,o,this.platformService.getChildNodes(h),r),v.isLazy=v.data.component.hasOwnProperty("importPromise")&&v.data.component.hasOwnProperty("importName"),(0,G.UE)(this.platformId)||!v.isLazy?(!v.data.hostElementTag&&Be.includes(this.platformService.getTagName(h).toLowerCase())&&(v.data.hostElementTag=ee),v.data.hostElementTag&&(h=this.useCustomHostElement(h,v.data.hostElementTag),v.value.element=h),this.createContentSlotElements(h,v,n),g[f]=h):delete t[f]}const u=Object.keys(g).map(h=>parseInt(h));for(const[h,f]of Object.entries(t))u.includes(parseInt(h))||(this.logger.warn(["Error when trying to load components - The anchor element for the following hook was found initially, but could not be found again for loading the component. Ignoring.",f],r),delete t[h]);for(const[h,f]of Object.entries(g)){const v=t[h];l.push((0,w.of)(!0).pipe((0,D.Z)(()=>this.loadComponentClass(v.data.component))).pipe((0,j.M)(C=>{const k=this.extractContentSlotElements(f,n);this.createComponent(v,o,f,k,r,C,s,i)})).pipe((0,m.W)(C=>(this.logger.error([C.stack],r),delete t[v.id],(0,w.of)(null)))))}return 0===l.length?(a.next(!0),a):((0,E.z)([...l]).pipe(ae()).subscribe(()=>{for(const h of Object.values(t)){const f=[];("function"==typeof h.componentRef.instance.onDynamicMount||"function"==typeof h.componentRef.instance.onDynamicChanges)&&this.findContentChildren(h.componentRef.location.nativeElement,f,t,n),"function"==typeof h.componentRef.instance.onDynamicChanges&&h.componentRef.instance.onDynamicChanges({contentChildren:f}),"function"==typeof h.componentRef.instance.onDynamicMount&&h.componentRef.instance.onDynamicMount({context:o,contentChildren:f})}for(const h of Object.values(g))this.platformService.removeAttribute(h,B),this.platformService.removeAttribute(h,P),this.platformService.removeAttribute(h,"ng-version");a.next(!0)}),a)}useCustomHostElement(e,t){const n=this.platformService.createElement(t);this.platformService.setAttribute(n,B,this.platformService.getAttribute(e,B)),this.platformService.setAttribute(n,P,this.platformService.getAttribute(e,P)),this.platformService.removeAttribute(e,B),this.platformService.removeAttribute(e,P);const o=this.platformService.getChildNodes(e);for(const r of o)this.platformService.appendChild(n,r);return this.platformService.insertBefore(this.platformService.getParentNode(e),n,e),this.platformService.removeChild(this.platformService.getParentNode(e),e),n}createContentSlotElements(e,t,n){let o;o=t.data.hasOwnProperty("content")&&Array.isArray(t.data.content)?t.data.content:[this.platformService.getChildNodes(e)],this.platformService.clearChildNodes(e);for(const[r,s]of o.entries())if(null!=s){const i=this.platformService.createElement("dynamic-component-contentslot");this.platformService.setAttribute(i,"slotIndex",r.toString()),this.platformService.setAttribute(i,"parsetoken",n);for(const a of s)this.platformService.appendChild(i,a);this.platformService.appendChild(e,i)}}extractContentSlotElements(e,t){const n=[],o=this.platformService.getChildNodes(e).filter(r=>"DYNAMIC-COMPONENT-CONTENTSLOT"===this.platformService.getTagName(r)&&this.platformService.getAttribute(r,"parsetoken")===t);for(const r of o){const s=this.platformService.getAttribute(r,"slotIndex");n[parseInt(s)]=this.platformService.getChildNodes(r)}return this.platformService.clearChildNodes(e),n}loadComponentClass(e){const t=new M.m(1);if(e.hasOwnProperty("prototype"))t.next(e);else if("function"==typeof e)e().then(n=>{t.next(n)});else{if(!e.hasOwnProperty("importPromise")||!e.hasOwnProperty("importName"))throw Error('The "component" property of a returned HookData object must either contain the component class, a function that returns a promise with the component class or an explicit LazyLoadComponentConfig');if(e.importPromise instanceof Promise)throw Error('When lazy-loading a component, the "importPromise"-field must contain a function returning the import-promise, but it contained the promise itself.');e.importPromise().then(n=>{const o=e.importName,r=Object.prototype.hasOwnProperty.call(n,o)?n[o]:n.default;t.next(r)})}return t}createComponent(e,t,n,o,r,s,i,a){const l=(0,T.a0P)(s,{hostElement:n,environmentInjector:e.data.environmentInjector||i,elementInjector:e.data.injector||a,projectableNodes:o});e.componentRef=l,this.mapOutputsToHTMLEvents(e,r),this.componentUpdater.updateBindings(e,t,r),"function"==typeof e.componentRef.instance.onDynamicChanges&&void 0!==t&&e.componentRef.instance.onDynamicChanges({context:t}),this.appRef.attachView(l.hostView),l.changeDetectorRef.detectChanges()}mapOutputsToHTMLEvents(e,t){const n=(0,T.HJs)(e.componentRef.componentType);for(const o of n.outputs){const r=t.ignoreOutputAliases?o.propName:o.templateName;e.htmlEventSubscriptions[r]=e.componentRef.instance[o.propName].subscribe(s=>{t.triggerDOMEvents&&this.platformService.dispatchEvent(e.componentRef?.location.nativeElement,r,s)})}}findContentChildren(e,t=[],n,o){const r=this.platformService.getChildNodes(e);null!=r&&r.length>0&&r.forEach((s,i)=>{let a=!1;const l=this.platformService.getAttribute(s,P);if(null!==l&&l===o&&this.platformService.getAttribute(s,B)){const u=parseInt(this.platformService.getAttribute(s,B),10);n.hasOwnProperty(u)&&(t.push({componentRef:n[u].componentRef,contentChildren:[],hookValue:n[u].value}),a=!0)}this.findContentChildren(s,a?t[t.length-1].contentChildren:t,n,o)})}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(S.Agw),d.KVO(S.o8S),d.KVO(ge),d.KVO(K),d.KVO(F))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),fe=(()=>{class c{constructor(e,t,n,o,r,s,i,a,l,g,u){this.allSettings=e,this.ancestorSettings=t,this.moduleSettings=n,this.settingsResolver=o,this.textHookFinder=r,this.elementHookFinder=s,this.contentSanitizer=i,this.componentCreator=a,this.platformService=l,this.environmentInjector=g,this.injector=u}parse(e=null,t=null,n=null,o=null,r=null,s=null,i=null,a={},l=null,g=null){const u=l||this.environmentInjector,h=g||this.injector,{parsers:f,options:v}=this.settingsResolver.resolve(h,e,this.allSettings,this.ancestorSettings,this.moduleSettings,t,o,r,s);if(!e)return(0,w.of)({element:i||this.platformService.createElement("div"),hookIndex:a,context:n,usedParsers:f,usedOptions:v,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(a)});const C=Math.random().toString(36).substring(2,12);let k="string"==typeof e?this.platformService.createElement("div"):e;if(this.platformService.setAttribute(k,q,"1"),"string"==typeof e){const z=this.textHookFinder.find(e,n,f,C,v,a);this.platformService.setInnerContent(k,z.content)}else this.textHookFinder.findInElement(k,n,f,C,v,a);if(a=this.elementHookFinder.find(k,n,f,C,v,a),v?.sanitize&&this.contentSanitizer.sanitize(k,a,C),i&&i!==k){this.platformService.removeAttribute(k,q),this.platformService.setAttribute(i,q,"1"),this.platformService.clearChildNodes(i);for(const z of this.platformService.getChildNodes(k))this.platformService.appendChild(i,z);k=i}return this.componentCreator.init(k,a,C,n,v,u,h).pipe(ae()).pipe((0,we.T)(z=>(this.platformService.removeAttribute(k,q),{element:k,hookIndex:a,context:n,usedParsers:f,usedOptions:v,usedInjector:h,usedEnvironmentInjector:u,destroy:()=>this.destroy(a)})))}destroy(e){if(e){for(const t of Object.values(e))t.componentRef&&t.componentRef.destroy();for(const t of Object.values(e)){for(const n of Object.values(t.outputSubscriptions))n&&n.unsubscribe();for(const n of Object.values(t.htmlEventSubscriptions))n&&n.unsubscribe()}}}static{this.\u0275fac=function(t){return new(t||c)(d.KVO(le,8),d.KVO(Y,8),d.KVO(ue,8),d.KVO(Le),d.KVO(ze),d.KVO(Ke),d.KVO(Ue),d.KVO(Qe),d.KVO(K),d.KVO(d.uvJ),d.KVO(d.zZn))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})(),tt=(()=>{class c{constructor(e,t,n,o,r,s){this.hostElement=e,this.dynamicHooksService=t,this.componentUpdater=n,this.platformService=o,this.environmentInjector=r,this.injector=s,this.content=null,this.context=null,this.globalParsersBlacklist=null,this.globalParsersWhitelist=null,this.parsers=null,this.options=null,this.componentsLoaded=new d.bkB,this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.token=Math.random().toString(36).substring(2,12),this.initialized=!1}ngDoCheck(){this.activeOptions.updateOnPushOnly||this.refresh(!1)}ngOnChanges(e){e.hasOwnProperty("content")||e.hasOwnProperty("globalParsersBlacklist")||e.hasOwnProperty("globalParsersWhitelist")||e.hasOwnProperty("parsers")||e.hasOwnProperty("options")?(this.reset(),this.parse(this.content)):e.hasOwnProperty("context")&&this.refresh(!0)}ngAfterViewInit(){}ngAfterViewChecked(){}ngOnDestroy(){this.reset()}reset(){this.dynamicHooksService.destroy(this.hookIndex),this.platformService.setInnerContent(this.hostElement.nativeElement,""),this.hookIndex={},this.activeOptions={sanitize:!0,convertHTMLEntities:!0,fixParagraphTags:!0,updateOnPushOnly:!1,compareInputsByValue:!1,compareOutputsByValue:!1,compareByValueDepth:5,triggerDOMEvents:!1,ignoreInputAliases:!1,ignoreOutputAliases:!1,acceptInputsForAnyProperty:!1,acceptOutputsForAnyObservable:!1,logOptions:{dev:!0,prod:!1,ssr:!1}},this.activeParsers=[],this.initialized=!1}parse(e){this.dynamicHooksService.parse(e,this.parsers,this.context,this.options,this.globalParsersBlacklist,this.globalParsersWhitelist,this.hostElement.nativeElement,this.hookIndex,this.environmentInjector,this.injector).subscribe(t=>{this.activeParsers=t.usedParsers,this.activeOptions=t.usedOptions,this.initialized=!0;const n=Object.values(this.hookIndex).map(o=>({hookId:o.id,hookValue:o.value,hookParser:o.parser,componentRef:o.componentRef}));this.componentsLoaded.emit(n)})}refresh(e){this.initialized&&this.componentUpdater.refresh(this.hookIndex,this.context,this.activeOptions,e)}static{this.\u0275fac=function(t){return new(t||c)(S.rXU(S.aKT),S.rXU(fe),S.rXU(ge),S.rXU(K),S.rXU(d.uvJ),S.rXU(d.zZn))}}static{this.\u0275cmp=S.VBU({type:c,selectors:[["ngx-dynamic-hooks"]],inputs:{content:"content",context:"context",globalParsersBlacklist:"globalParsersBlacklist",globalParsersWhitelist:"globalParsersWhitelist",parsers:"parsers",options:"options"},outputs:{componentsLoaded:"componentsLoaded"},features:[S.OA$],decls:0,vars:0,template:function(t,n){},encapsulation:2})}}return c})();var me=b(222),ye=b(58),ve=b(2306),nt=b(140);class ot extends me.A4{baseSize;documentListHandlers;entityListHandlers;_handlers;context={};counters={};getIndex(p){const e=this.counters[p]||0;return this.counters[p]=e+1,e}constructor(p="m",e){super(),this.baseSize=p,this._handlers=e,this.documentListHandlers=e?.documentList,this.entityListHandlers=e?.entityList,this.setupRenderers()}resetContext(){this.context={},this.counters={}}getContext(){return this.context}scaleSize(p){const e=["xs","s","m","l","xl"],t=e.indexOf(this.baseSize),n=e.indexOf(p);return e[Math.max(0,Math.min(e.length-1,n+(t-2)))]}setupRenderers(){this.heading=({tokens:p,depth:e})=>{const r=this.scaleSize({1:"xl",2:"l",3:"l",4:"m",5:"m",6:"s"}[e]),s={1:"bold",2:"semibold",3:"semibold",4:"semibold",5:"medium",6:"medium"}[e],i=this.parser?.parseInline(p)||"";return`<cue-typography size="${r}" weight="${s}"${this.getIndex("heading")>0?' style="margin-top: 24px; display: block;"':' style="display: block;"'}>${i}</cue-typography>\n`},this.paragraph=({tokens:p})=>{const e=this.scaleSize("m"),t=this.parser?.parseInline(p)||"";return/^(?:\s*,?\s*<cue-href-chip\b[^>]*><\/cue-href-chip>)+\s*$/.test(t)?`<div style="display: flex; gap: 6px; flex-wrap: wrap;">${t.replace(/(<\/cue-href-chip>)\s*,?\s*/g,"$1").trim()}</div>\n`:`<div class="cue-md-p"><cue-typography size="${e}" weight="regular">${t}</cue-typography></div>\n`},this.listitem=({tokens:p})=>{const e=this.scaleSize("m");return`<li class="cue-md-li" style="font-size: var(--cue-font-${e}-size);"><cue-typography size="${e}" weight="regular">${this.parser?.parseInline(p)||""}</cue-typography></li>`},this.tablecell=({tokens:p,header:e,align:t})=>{const n=e?"th":"td",r=e?"semibold":"regular";return`<${n}${t?` style="text-align: ${t}"`:""}><cue-typography size="${this.scaleSize("m")}" weight="${r}">${this.parser?.parseInline(p)||""}</cue-typography></${n}>`},this.blockquote=({text:p,tokens:e})=>/^\[!(NOTE|WARNING|IMPORTANT|TIP|CAUTION)\]/i.test(p.trimStart())?"":`<blockquote class="cue-md-blockquote"><cue-typography size="${this.scaleSize("m")}" weight="regular">${this.parser?.parse(e)||""}</cue-typography></blockquote>`,this.link=({href:p,title:e,tokens:t})=>{const n=this.parser?.parseInline(t)||"";if(!p){const r=this.getIndex("hrefchip"),s=`hrefchip_menuitems_${r}`,i=`hrefchip_id_${r}`,a=`hrefchip_click_${r}`,l=n.replace(/<[^>]*>/g,"");return this.context[i]=l,this.context[s]=()=>this._handlers?.hrefChip?.menuItems?.(l)??[],this.context[a]=()=>{this._handlers?.hrefChip?.clicked?.(l)},`<cue-href-chip [label]="context.${i}" [menuItems]="context.${s}()" (clicked)="context.${a}()"></cue-href-chip>`}return`<a href="${p}"${e?` title="${e}"`:""} target="_blank" rel="noopener noreferrer">${n}</a>`},this.codespan=({text:p})=>`<code class="cue-code-inline">${p}</code>`,this.code=p=>{const e="36px";if("document-list"===p.lang){const t=p.documentRefs;if(!t||0===t.length)return"";const o=`doc_refs_${this.getIndex("doc")}`;return this.context[o]=t,this._handlers?.availableContentCategories&&(this.context.availableContentCategories=this._handlers.availableContentCategories),`<cue-document-list [documentRefs]="context.${o}" [documentdata]="context.documentdata" [handlers]="context.documentlisthandlers" [availableContentCategories]="context.availableContentCategories" (clickedDocument)="context.documentclickedrow($event)" style="margin-bottom: ${e};"></cue-document-list>`}if("entity-list"===p.lang){const t=p.iris;if(!t)return"";const o=`entity_iris_${this.getIndex("entity")}`;return this.context[o]=t,this._handlers?.availableEntityCategories&&(this.context.availableEntityCategories=this._handlers.availableEntityCategories),this._handlers?.availableEntityRelationships&&(this.context.availableEntityRelationships=this._handlers.availableEntityRelationships),`<cue-ent-list-inner [entities]="context.${o}" [entitydata]="context.entitydata" [entityLocations]="context.entitylocations" [handlers]="context.entitylisthandlers" [availableEntityCategories]="context.availableEntityCategories" [availableEntityRelationships]="context.availableEntityRelationships" [mapboxToken]="context.mapboxToken" (rowClicked)="context.entityclickedrow($event)" style="margin-bottom: ${e};"></cue-ent-list-inner>`}if("map"===p.lang){const t=p.mapData;if(!t||!t.layers)return"";const n=this.getIndex("map"),o=`map_layers_${n}`,r=`map_settings_${n}`;return this.context[o]=t.layers,this.context[r]=t.settings,`<cue-card style="height: 300px; display: block; margin-bottom: ${e};" [padded]="false"><cue-map [layers]="context.${o}" [settings]="context.${r}"></cue-map></cue-card>`}return`<div style="margin-bottom: ${e};">${super.code(p)}</div>`}}walkTokens(p){return(0,A.A)(function*(){if("code"===p.type&&"document-list"===p.lang){const e=p.text.split("\n").filter(o=>o.trim().length>0),t=new Map,n=[];for(const o of e){const r=o.trim(),s=r.match(/^(.+)\?page=(\d+)$/);if(s){const i=s[1],a=s[2];t.has(i)||(t.set(i,{id:i,pages:[]}),n.push(i));const l=t.get(i);l.pages||(l.pages=[]),l.pages.push({id:r,page:a,relevance:0})}else t.has(r)||(t.set(r,{id:r}),n.push(r))}p.documentRefs=n.map(o=>t.get(o))}if("code"===p.type&&"entity-list"===p.lang){const e=p.text.split("\n").filter(t=>t.trim().length>0);p.iris=e}if("code"===p.type&&"map"===p.lang){const e=p.text.split("\n").filter(i=>i.trim().length>0),t=e[0]?.trim()||"",n=e.slice(1),o={};n.forEach(i=>{const a=i.split(";"),l=a[0]?.trim(),g=a[1]?.trim(),u=a[2]?.trim();if(!l||!g)return;const h=(0,ye.S)(g);if(!h)return;const f=(0,ye.n)(h);let v={};if(u)try{v=JSON.parse(u)}catch{}o[l]||(o[l]=[]),o[l].push({type:"Feature",properties:v,geometry:f})});const r=[];Object.keys(o).forEach(i=>{const a=new ve.ux(i);a.collection=new nt.o(o[i]),r.push(a)});const s=new ve.yY;s.mapboxToken=t,s.contextMenu.showFlyTo=!1,p.mapData={layers:r,settings:s}}})()}}let rt=(()=>{class c{envInjector=(0,d.WQX)(d.uvJ);fileURL=T.hFB.required();html=(0,d.vPA)("");hookOptions={sanitize:!1,globalParsersBlueprint:{environmentInjector:this.envInjector}};parsers=[{component:{importPromise:()=>Promise.resolve().then(b.bind(b,2245)),importName:"Typography"},selector:"cue-typography"}];onFile=(0,d.QZP)((()=>{var e=this;return(0,A.A)(function*(){const n=yield(yield fetch(e.fileURL())).text(),o=new ot("m");o.resetContext();const r=yield me.xI.parse(n,{gfm:!0,breaks:!1,renderer:o,async:!0,walkTokens:o.walkTokens.bind(o)});e.html.set(r)})})());static \u0275fac=function(t){return new(t||c)};static \u0275cmp=S.VBU({type:c,selectors:[["cue-md-viewer"]],inputs:{fileURL:[1,"fileURL"]},decls:2,vars:3,consts:[[1,"page"],[3,"parsers","content","options"]],template:function(t,n){1&t&&(S.j41(0,"div",0),S.nrm(1,"ngx-dynamic-hooks",1),S.k0s()),2&t&&(S.R7$(),S.Y8G("parsers",n.parsers)("content",n.html())("options",n.hookOptions))},dependencies:[tt],styles:[".page[_ngcontent-%COMP%]{overflow-y:auto;height:100%;padding:16px;box-sizing:border-box}[_nghost-%COMP%] cue-typography{display:inline-block}[_nghost-%COMP%] .cue-md-p{margin-bottom:24px;opacity:.9;line-height:1.6;display:block}[_nghost-%COMP%] .cue-md-p:last-child{margin-bottom:0}[_nghost-%COMP%] .cue-md-blockquote{margin-bottom:24px;opacity:.9;border-left:4px solid var(--cue-border-color);padding-left:16px}[_nghost-%COMP%] ul, [_nghost-%COMP%] ol{margin-bottom:24px;padding-left:28px;font-family:var(--cue-font-family);opacity:.9;line-height:1.6}[_nghost-%COMP%] li.cue-md-li{margin-bottom:12px}[_nghost-%COMP%] table{margin-bottom:24px;border-collapse:collapse;width:100%}[_nghost-%COMP%] th, [_nghost-%COMP%] td{padding:8px 12px;border-bottom:1px solid var(--cue-border-color, #eee);text-align:left}[_nghost-%COMP%] th cue-typography{font-weight:var(--cue-font-weight-semibold)}[_nghost-%COMP%] .cue-code-inline{background-color:var(--cue-border-color);padding:0 4px;border-radius:4px;font-family:monospace;font-size:1.1em;font-weight:500;color:var(--cue-main-foreground)}"],changeDetection:0})}return c})()},2306(U,V,b){b.d(V,{AA:()=>S,ux:()=>H,yY:()=>T});var A=b(140),d=b(8402);class T{mapboxToken;contextMenu={showProperties:!0,showFlyTo:!0};toolbar=new S}class S{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayGeofenceDraw=!1;displayLayerToggle=!0;clearGeofenceAfterDraw=!0}class H{label;id;collection=new A.o;color;visible=!0;cluster=!0;zoomToFit=!0;category;constructor(w,E=(0,d.A)()){this.label=w,this.id=E}}},140(U,V,b){b.d(V,{o:()=>A});class A{type="FeatureCollection";features=[];bbox;id;constructor(T=[]){this.features=T}addFeature(T){this.features.push(T)}removeFeature(T){return this.features.splice(T,1)[0]}getFeatureCount(){return this.features.length}clear(){this.features=[]}}},58(U,V,b){function A(m){let y=0,I=-1,O=-1;for(let R=0;R<m.length;R++)if("("===m[R])y++,1===y&&(I=R+1);else if(")"===m[R]&&(y--,0===y)){O=R;break}return-1!==I&&-1!==O?m.substring(I,O):null}b.d(V,{S:()=>D,n:()=>j});class d{x;y;z;constructor(y,I,O){this.x=y,this.y=I,this.z=O}}class T{points;constructor(y){this.points=y}}class S{lines;constructor(y){this.lines=y}}function D(m){if(m){if((m=m.trim().toUpperCase()).startsWith("POINT"))return function M(m){m=m.trim().toUpperCase();const I=A(m)?.split(" ")??[];return m.includes("POINT Z")?new d(parseFloat(I[0]),parseFloat(I[1]),parseFloat(I[2])):new d(parseFloat(I[0]),parseFloat(I[1]))}(m);if(m.startsWith("LINESTRING"))return function H(m){const y=A(m=m.trim().toUpperCase()),I=[];return y?.split(",").map(O=>O.trim().split(" ").map(R=>parseFloat(R))).map(O=>{I.push(new d(O[0],O[1],O[2]))}),new T(I)}(m);if(m.startsWith("POLYGON"))return function w(m){const y=A(m=m.trim().toUpperCase());if(!y)return new S([]);const I=y.match(/\(([^)]+)\)/g);if(!I)return new S([]);const O=I.map(R=>{const W=A(R);return W?W.split(",").map(Z=>{const $=Z.trim().split(" ");return $.length>=3?new d(parseFloat($[0]),parseFloat($[1]),parseFloat($[2])):new d(parseFloat($[0]),parseFloat($[1]))}):[]});return new S(O)}(m)}}function j(m){if(m instanceof d)return{type:"Point",coordinates:void 0!==m.z?[m.x,m.y,m.z]:[m.x,m.y]};if(m instanceof T)return{type:"LineString",coordinates:m.points.map(y=>void 0!==y.z?[y.x,y.y,y.z]:[y.x,y.y])};if(m instanceof S)return{type:"Polygon",coordinates:m.lines.map(y=>y.map(I=>void 0!==I.z?[I.x,I.y,I.z]:[I.x,I.y]))};throw new Error("Unknown WKT type")}},5332(U,V,b){b.d(V,{k:()=>S});for(var d=[],T=0;T<256;++T)d.push((T+256).toString(16).slice(1));function S(w,E=0){return(d[w[E+0]]+d[w[E+1]]+d[w[E+2]]+d[w[E+3]]+"-"+d[w[E+4]]+d[w[E+5]]+"-"+d[w[E+6]]+d[w[E+7]]+"-"+d[w[E+8]]+d[w[E+9]]+"-"+d[w[E+10]]+d[w[E+11]]+d[w[E+12]]+d[w[E+13]]+d[w[E+14]]+d[w[E+15]]).toLowerCase()}},8402(U,V,b){b.d(V,{A:()=>E});const d={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var T,S=new Uint8Array(16);function H(){if(!T&&!(T=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T(S)}var M=b(5332);const E=function w(D,j,m){if(d.randomUUID&&!j&&!D)return d.randomUUID();var y=(D=D||{}).random||(D.rng||H)();if(y[6]=15&y[6]|64,y[8]=63&y[8]|128,j){m=m||0;for(var I=0;I<16;++I)j[m+I]=y[I];return j}return(0,M.k)(y)}}}]);
package/598.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[598],{7598(_e,yt,g){g.d(yt,{T1:()=>Dt,O7:()=>wt,HD:()=>V,eg:()=>ee});var p=g(5547),h=g(5802),D=g(7705),_=g(1413),K=g(4226),N=g(7786),y=g(8359),Rt=g(3236),Et=g(1584),xt=g(536),Ct=g(4412),Tt=g(3293),k=g(6977),kt=g(6354),Ot=g(6697),Lt=g(8141),Nt=g(5558),Mt=g(6365),U=g(9326),Ft=g(6648);function Z(...n){return function At(){return(0,Mt.U)(1)}()((0,Ft.H)(n,(0,U.lI)(n)))}var Bt=g(9974);function $(...n){const e=(0,U.lI)(n);return(0,Bt.N)((t,i)=>{(e?Z(n,t,e):Z(n,t)).subscribe(i)})}var P=g(9867),w=g(7384),M=g(5272),j=g(9752),zt=g(3531),Vt=g(7523);function A(n){const e=n.cloneNode(!0),t=e.querySelectorAll("[id]"),i=n.nodeName.toLowerCase();e.removeAttribute("id");for(let s=0;s<t.length;s++)t[s].removeAttribute("id");return"canvas"===i?q(n,e):("input"===i||"select"===i||"textarea"===i)&&J(n,e),Y("canvas",n,e,q),Y("input, textarea, select",n,e,J),e}function Y(n,e,t,i){const s=e.querySelectorAll(n);if(s.length){const r=t.querySelectorAll(n);for(let o=0;o<s.length;o++)i(s[o],r[o])}}let Qt=0;function J(n,e){"file"!==e.type&&(e.value=n.value),"radio"===e.type&&e.name&&(e.name=`mat-clone-${e.name}-${Qt++}`)}function q(n,e){const t=e.getContext("2d");if(t)try{t.drawImage(n,0,0)}catch{}}function F(n){const e=n.getBoundingClientRect();return{top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height,x:e.x,y:e.y}}function B(n,e,t){const{top:i,bottom:s,left:r,right:o}=n;return t>=i&&t<=s&&e>=r&&e<=o}function R(n,e,t){n.top+=e,n.bottom=n.top+n.height,n.left+=t,n.right=n.left+n.width}function tt(n,e,t,i){const{top:s,right:r,bottom:o,left:a,width:l,height:c}=n,d=l*e,f=c*e;return i>s-f&&i<o+f&&t>a-d&&t<r+d}class et{_document;positions=new Map;constructor(e){this._document=e}clear(){this.positions.clear()}cache(e){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),e.forEach(t=>{this.positions.set(t,{scrollPosition:{top:t.scrollTop,left:t.scrollLeft},clientRect:F(t)})})}handleScroll(e){const t=(0,P.Fb)(e),i=this.positions.get(t);if(!i)return null;const s=i.scrollPosition;let r,o;if(t===this._document){const c=this.getViewportScrollPosition();r=c.top,o=c.left}else r=t.scrollTop,o=t.scrollLeft;const a=s.top-r,l=s.left-o;return this.positions.forEach((c,d)=>{c.clientRect&&t!==d&&t.contains(d)&&R(c.clientRect,a,l)}),s.top=r,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}}function it(n,e){const t=n.rootNodes;if(1===t.length&&t[0].nodeType===e.ELEMENT_NODE)return t[0];const i=e.createElement("div");return t.forEach(s=>i.appendChild(s)),i}function H(n,e,t){for(let i in e)if(e.hasOwnProperty(i)){const s=e[i];s?n.setProperty(i,s,t?.has(i)?"important":""):n.removeProperty(i)}return n}function b(n,e){const t=e?"":"none";H(n.style,{"touch-action":e?"":"none","-webkit-user-drag":e?"":"none","-webkit-tap-highlight-color":e?"":"transparent","user-select":t,"-ms-user-select":t,"-webkit-user-select":t,"-moz-user-select":t})}function st(n,e,t){H(n.style,{position:e?"":"fixed",top:e?"":"0",opacity:e?"":"0",left:e?"":"-999em"},t)}function O(n,e){return e&&"none"!=e?n+" "+e:n}function nt(n,e){n.style.width=`${e.width}px`,n.style.height=`${e.height}px`,n.style.transform=E(e.left,e.top)}function E(n,e){return`translate3d(${Math.round(n)}px, ${Math.round(e)}px, 0)`}const I={capture:!0},W={passive:!1,capture:!0};let Xt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=p.VBU({type:n,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:["@layer cdk-resets {\n .cdk-drag-preview {\n background: none;\n border: none;\n padding: 0;\n color: inherit;\n inset: auto;\n }\n}\n.cdk-drag-placeholder *,\n.cdk-drag-preview * {\n pointer-events: none !important;\n}\n"],encapsulation:2,changeDetection:0})}return n})(),L=(()=>{class n{_ngZone=(0,h.WQX)(h.SKi);_document=(0,h.WQX)(h.qQL);_styleLoader=(0,h.WQX)(Tt.l);_renderer=(0,h.WQX)(p._9s).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _.B;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=(0,h.vPA)([]);_globalListeners;_draggingPredicate=t=>t.isDragging();_domNodesToDirectives=null;pointerMove=new _.B;pointerUp=new _.B;constructor(){}registerDropContainer(t){this._dropInstances.has(t)||this._dropInstances.add(t)}registerDragItem(t){this._dragInstances.add(t),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,W)})}removeDropContainer(t){this._dropInstances.delete(t)}removeDragItem(t){this._dragInstances.delete(t),this.stopDragging(t),0===this._dragInstances.size&&this._cleanupDocumentTouchmove?.()}startDragging(t,i){if(!(this._activeDragInstances().indexOf(t)>-1)&&(this._styleLoader.load(Xt),this._activeDragInstances.update(s=>[...s,t]),1===this._activeDragInstances().length)){const s=i.type.startsWith("touch"),r=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),I],["selectstart",this._preventDefaultWhileDragging,W]];s?o.push(["touchend",r,I],["touchcancel",r,I]):o.push(["mouseup",r,I]),s||o.push(["mousemove",a=>this.pointerMove.next(a),W]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,c])=>this._renderer.listen(this._document,a,l,c))})}}stopDragging(t){this._activeDragInstances.update(i=>{const s=i.indexOf(t);return s>-1?(i.splice(s,1),[...i]):i}),0===this._activeDragInstances().length&&this._clearGlobalListeners()}isDragging(t){return this._activeDragInstances().indexOf(t)>-1}scrolled(t){const i=[this._scroll];return t&&t!==this._document&&i.push(new K.c(s=>this._ngZone.runOutsideAngular(()=>{const r=this._renderer.listen(t,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},I);return()=>{r()}}))),(0,N.h)(...i)}registerDirectiveNode(t,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(t,i)}removeDirectiveNode(t){this._domNodesToDirectives?.delete(t)}getDragDirectiveForNode(t){return this._domNodesToDirectives?.get(t)||null}ngOnDestroy(){this._dragInstances.forEach(t=>this.removeDragItem(t)),this._dropInstances.forEach(t=>this.removeDropContainer(t)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=t=>{this._activeDragInstances().length>0&&t.preventDefault()};_persistentTouchmoveListener=t=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&t.preventDefault(),this.pointerMove.next(t))};_clearGlobalListeners(){this._globalListeners?.forEach(t=>t()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||n)};static \u0275prov=h.jDH({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function rt(n){const e=n.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(n)*e}function z(n,e){return n.getPropertyValue(e).split(",").map(i=>i.trim())}const Ut=new Set(["position"]);class Zt{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(e,t,i,s,r,o,a,l,c,d){this._document=e,this._rootElement=t,this._direction=i,this._initialDomRect=s,this._previewTemplate=r,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=c,this._renderer=d}attach(e){this._preview=this._createPreview(),e.appendChild(this._preview),ot(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(e){this._preview.style.transform=e}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(e){this._preview.classList.add(e)}getTransitionDuration(){return function Kt(n){const e=getComputedStyle(n),t=z(e,"transition-property"),i=t.find(a=>"transform"===a||"all"===a);if(!i)return 0;const s=t.indexOf(i),r=z(e,"transition-duration"),o=z(e,"transition-delay");return rt(r[s])+rt(o[s])}(this._preview)}addEventListener(e,t){return this._renderer.listen(this._preview,e,t)}_createPreview(){const e=this._previewTemplate,t=this._previewClass,i=e?e.template:null;let s;if(i&&e){const r=e.matchSize?this._initialDomRect:null,o=e.viewContainer.createEmbeddedView(i,e.context);o.detectChanges(),s=it(o,this._document),this._previewEmbeddedView=o,e.matchSize?nt(s,r):s.style.transform=E(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=A(this._rootElement),nt(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return H(s.style,{"pointer-events":"none",margin:ot(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},Ut),b(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),t&&(Array.isArray(t)?t.forEach(r=>s.classList.add(r)):s.classList.add(t)),s}}function ot(n){return"showPopover"in n}const $t={passive:!0},at={passive:!1},jt={passive:!1,capture:!0},lt="cdk-drag-placeholder",ht=new Set(["position"]);class qt{_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=(0,h.vPA)(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _.B;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=y.yU.EMPTY;_pointerUpSubscription=y.yU.EMPTY;_scrollSubscription=y.yU.EMPTY;_resizeSubscription=y.yU.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(e){e!==this._disabled&&(this._disabled=e,this._toggleNativeDragInteractions(),this._handles.forEach(t=>b(t,e)))}_disabled=!1;beforeStarted=new _.B;started=new _.B;released=new _.B;ended=new _.B;entered=new _.B;exited=new _.B;dropped=new _.B;moved=this._moveEvents;data;constrainPosition;constructor(e,t,i,s,r,o,a){this._config=t,this._document=i,this._ngZone=s,this._viewportRuler=r,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(e).withParent(t.parentDragRef||null),this._parentPositions=new et(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(e){this._handles=e.map(i=>(0,w.i8)(i)),this._handles.forEach(i=>b(i,this.disabled)),this._toggleNativeDragInteractions();const t=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&t.add(i)}),this._disabledHandles=t,this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=(0,w.i8)(e);if(t!==this._rootElement){this._removeRootElementListeners();const i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(t,"mousedown",this._pointerDown,at),i.listen(t,"touchstart",this._pointerDown,$t),i.listen(t,"dragstart",this._nativeDragStart,at)]),this._initialTransform=void 0,this._rootElement=t}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(e){return this._boundaryElement=e?(0,w.i8)(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(e){return this._parentDragRef=e,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&&function Gt(n,e){return e.left<n.left||e.left+e.width>n.right||e.top<n.top||e.top+e.height>n.bottom}(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){const e=this._boundaryElement.getBoundingClientRect(),t=this._rootElement.getBoundingClientRect();let i=0,s=0;t.left<e.left?i=e.left-t.left:t.right>e.right&&(i=e.right-t.right),t.top<e.top?s=e.top-t.top:t.bottom>e.bottom&&(s=e.bottom-t.bottom);let a=this._activeTransform.x+i,l=this._activeTransform.y+s;this._rootElement.style.transform=E(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(e){!this._disabledHandles.has(e)&&this._handles.indexOf(e)>-1&&(this._disabledHandles.add(e),b(e,!0))}enableHandle(e){this._disabledHandles.has(e)&&(this._disabledHandles.delete(e),b(e,this.disabled))}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}withPreviewContainer(e){return this._previewContainer=e,this}_sortFromLastPointerPosition(){const e=this._lastKnownPointerPosition;e&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(e),e)}_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=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)};_pointerMove=e=>{const t=this._getPointerPositionOnPage(e);if(!this._hasStartedDragging()){if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){const a=Date.now()>=this._dragStartTime+this._getDragStartDelay(e),l=this._dropContainer;if(!a)return void this._endDragSequence(e);(!l||!l.isDragging()&&!l.isReceiving())&&(e.cancelable&&e.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(e)))}return}e.cancelable&&e.preventDefault();const i=this._getConstrainedPointerPosition(t);if(this._hasMoved=!0,this._lastKnownPointerPosition=t,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,t);else{const s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,r=this._activeTransform;r.x=i.x-s.x+this._passiveTransform.x,r.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(r.x,r.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:e,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=e=>{this._endDragSequence(e)};_endDragSequence(e){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:e}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;const t=this._getPointerPositionOnPage(e);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(t),dropPoint:t,event:e})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(e){x(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();const t=this._getShadowRoot(),i=this._dropContainer;if(t&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(t,"selectstart",te,jt)}),i){const s=this._rootElement,r=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");r.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Zt(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(r,t)),st(s,!1,ht),this._document.body.appendChild(r.replaceChild(o,s)),this.started.next({source:this,event:e}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:e}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(e,t){this._parentDragRef&&t.stopPropagation();const i=this.isDragging(),s=x(t),r=!s&&0!==t.button,o=this._rootElement,a=(0,P.Fb)(t),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now(),c=s?function Wt(n){const e=n.touches&&n.touches[0]||n.changedTouches&&n.changedTouches[0];return!(!e||-1!==e.identifier||null!=e.radiusX&&1!==e.radiusX||null!=e.radiusY&&1!==e.radiusY)}(t):function Ht(n){return 0===n.buttons||0===n.detail}(t);if(a&&a.draggable&&"mousedown"===t.type&&t.preventDefault(),i||r||l||c)return;if(this._handles.length){const S=o.style;this._rootElementTapHighlight=S.webkitTapHighlightColor||"",S.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(S=>this._updateOnScroll(S)),this._boundaryElement&&(this._boundaryRect=F(this._boundaryElement));const d=this._previewTemplate;this._pickupPositionInElement=d&&d.template&&!d.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,e,t);const f=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:f.x,y:f.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){st(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(()=>{const t=this._dropContainer,i=t.getItemIndex(this),s=this._getPointerPositionOnPage(e),r=this._getDragDistance(s),o=t._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:r,dropPoint:s,event:e}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:t,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:r,dropPoint:s,event:e}),t.drop(this,i,this._initialIndex,this._initialContainer,o,r,s,e),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t},{x:i,y:s}){let r=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!r&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(r=this._initialContainer),r&&r!==this._dropContainer&&this._ngZone.run(()=>{const o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(r,this._dropContainer,a),this._dropContainer=r,this._dropContainer.enter(this,e,t,r===this._initialContainer&&r.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:r,currentIndex:r.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(e,t):this._applyPreviewTransform(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(e.left,e.top);const t=this._preview.getTransitionDuration();return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{const s=a=>{(!a||this._preview&&(0,P.Fb)(a)===this._preview.element&&"transform"===a.propertyName)&&(o(),i(),clearTimeout(r))},r=setTimeout(s,1.5*t),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let i;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),this._placeholderRef.detectChanges(),i=it(this._placeholderRef,this._document)):i=A(this._rootElement),i.style.pointerEvents="none",i.classList.add(lt),i}_getPointerPositionInElement(e,t,i){const s=t===this._rootElement?null:t,r=s?s.getBoundingClientRect():e,o=x(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition();return{x:r.left-e.left+(o.pageX-r.left-a.left),y:r.top-e.top+(o.pageY-r.top-a.top)}}_getPointerPositionOnPage(e){const t=this._getViewportScrollPosition(),i=x(e)?e.touches[0]||e.changedTouches[0]||{pageX:0,pageY:0}:e,s=i.pageX-t.left,r=i.pageY-t.top;if(this._ownerSVGElement){const o=this._ownerSVGElement.getScreenCTM();if(o){const a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=r,a.matrixTransform(o.inverse())}}return{x:s,y:r}}_getConstrainedPointerPosition(e){const t=this._dropContainer?this._dropContainer.lockAxis:null;let{x:i,y:s}=this.constrainPosition?this.constrainPosition(e,this,this._initialDomRect,this._pickupPositionInElement):e;if("x"===this.lockAxis||"x"===t?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):("y"===this.lockAxis||"y"===t)&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){const{x:r,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:c}=this._getPreviewRect(),d=a.top+o,f=a.bottom-(c-o);i=ct(i,a.left+r,a.right-(l-r)),s=ct(s,d,f)}return{x:i,y:s}}_updatePointerDirectionDelta(e){const{x:t,y:i}=e,s=this._pointerDirectionDelta,r=this._pointerPositionAtLastDirectionChange,o=Math.abs(t-r.x),a=Math.abs(i-r.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=t>r.x?1:-1,r.x=t),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>r.y?1:-1,r.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,b(this._rootElement,e))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(e=>e()),this._rootElementCleanups=void 0}_applyRootElementTransform(e,t){const i=1/this.scale,s=E(e*i,t*i),r=this._rootElement.style;null==this._initialTransform&&(this._initialTransform=r.transform&&"none"!=r.transform?r.transform:""),r.transform=O(s,this._initialTransform)}_applyPreviewTransform(e,t){const i=this._previewTemplate?.template?void 0:this._initialTransform,s=E(e,t);this._preview.setTransform(O(s,i))}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||this.isDragging()||!this._boundaryElement)return;const i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(0===s.width&&0===s.height||0===i.width&&0===i.height)return;const r=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(r>0&&(e+=r),o>0&&(e-=o)):e=0,s.height>i.height?(a>0&&(t+=a),l>0&&(t-=l)):t=0,(e!==this._passiveTransform.x||t!==this._passiveTransform.y)&&this.setFreeDragPosition({y:t,x:e})}_getDragStartDelay(e){const t=this.dragStartDelay;return"number"==typeof t?t:x(e)?t.touch:t?t.mouse:0}_updateOnScroll(e){const t=this._parentPositions.handleScroll(e);if(t){const i=(0,P.Fb)(e);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&R(this._boundaryRect,t.top,t.left),this._pickupPositionOnPage.x+=t.left,this._pickupPositionOnPage.y+=t.top,this._dropContainer||(this._activeTransform.x-=t.left,this._activeTransform.y-=t.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return void 0===this._cachedShadowRoot&&(this._cachedShadowRoot=(0,P.KT)(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(e,t){const i=this._previewContainer||"global";if("parent"===i)return e;if("global"===i){const s=this._document;return t||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return(0,w.i8)(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=e=>{if(this._handles.length){const t=this._getTargetHandle(e);t&&!this._disabledHandles.has(t)&&!this.disabled&&e.preventDefault()}else this.disabled||e.preventDefault()};_getTargetHandle(e){return this._handles.find(t=>e.target&&(e.target===t||t.contains(e.target)))}_conditionallyInsertAnchor(e,t,i){if(e===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(t===this._initialContainer&&t.hasAnchor){const s=this._anchor??=A(this._placeholder);s.classList.remove(lt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):(0,w.i8)(t.element).appendChild(s)}}}function ct(n,e,t){return Math.max(e,Math.min(t,n))}function x(n){return"t"===n.type[0]}function te(n){n.preventDefault()}function V(n,e,t){const i=C(e,n.length-1),s=C(t,n.length-1);if(i===s)return;const r=n[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)n[a]=n[a+o];n[s]=r}function ee(n,e,t,i){const s=C(t,n.length-1),r=C(i,e.length);n.length&&e.splice(r,0,n.splice(s,1)[0])}function C(n,e){return Math.max(0,Math.min(e,n))}class dt{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(e){this._dragDropRegistry=e}_previousSwap={drag:null,delta:0,overlaps:!1};start(e){this.withItems(e)}sort(e,t,i,s){const r=this._itemPositions,o=this._getItemIndexFromPointerPosition(e,t,i,s);if(-1===o&&r.length>0)return null;const a="horizontal"===this.orientation,l=r.findIndex(v=>v.drag===e),c=r[o],f=c.clientRect,S=l>o?1:-1,G=this._getItemOffsetPx(r[l].clientRect,f,S),de=this._getSiblingOffsetPx(l,r,S),ge=r.slice();return V(r,l,o),r.forEach((v,pe)=>{if(ge[pe]===v)return;const St=v.drag===e,X=St?G:de,Pt=St?e.getPlaceholderElement():v.drag.getRootElement();v.offset+=X;const bt=Math.round(v.offset*(1/v.drag.scale));a?(Pt.style.transform=O(`translate3d(${bt}px, 0, 0)`,v.initialTransform),R(v.clientRect,0,X)):(Pt.style.transform=O(`translate3d(0, ${bt}px, 0)`,v.initialTransform),R(v.clientRect,X,0))}),this._previousSwap.overlaps=B(f,t,i),this._previousSwap.drag=c.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(e,t,i,s){const r=this._activeDraggables,o=r.indexOf(e),a=e.getPlaceholderElement();o>-1&&r.splice(o,1);const l=null==s||s<0?this._getItemIndexFromPointerPosition(e,t,i):s;let c=r[l];if(c===e&&(c=r[l+1]),!c&&(null==l||-1===l||l<r.length-1)&&this._shouldEnterAsFirstChild(t,i)&&(c=r[0]),c&&!this._dragDropRegistry.isDragging(c)){const d=c.getRootElement();d.parentElement.insertBefore(a,d),r.splice(l,0,e)}else this._element.appendChild(a),r.push(e);a.style.transform="",this._cacheItemPositions()}withItems(e){this._activeDraggables=e.slice(),this._cacheItemPositions()}withSortPredicate(e){this._sortPredicate=e}reset(){this._activeDraggables?.forEach(e=>{const t=e.getRootElement();if(t){const i=this._itemPositions.find(s=>s.drag===e)?.initialTransform;t.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(e){return this._getVisualItemPositions().findIndex(t=>t.drag===e)}getItemAtIndex(e){return this._getVisualItemPositions()[e]?.drag||null}updateOnScroll(e,t){this._itemPositions.forEach(({clientRect:i})=>{R(i,e,t)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(e){this._element=e}_cacheItemPositions(){const e="horizontal"===this.orientation;this._itemPositions=this._activeDraggables.map(t=>{const i=t.getVisibleElement();return{drag:t,offset:0,initialTransform:i.style.transform||"",clientRect:F(i)}}).sort((t,i)=>e?t.clientRect.left-i.clientRect.left:t.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return"horizontal"===this.orientation&&"rtl"===this.direction?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(e,t,i){const s="horizontal"===this.orientation;let r=s?t.left-e.left:t.top-e.top;return-1===i&&(r+=s?t.width-e.width:t.height-e.height),r}_getSiblingOffsetPx(e,t,i){const s="horizontal"===this.orientation,r=t[e].clientRect,o=t[e+-1*i];let a=r[s?"width":"height"]*i;if(o){const l=s?"left":"top",c=s?"right":"bottom";-1===i?a-=o.clientRect[l]-r[c]:a+=r[l]-o.clientRect[c]}return a}_shouldEnterAsFirstChild(e,t){if(!this._activeDraggables.length)return!1;const i=this._itemPositions,s="horizontal"===this.orientation;if(i[0].drag!==this._activeDraggables[0]){const o=i[i.length-1].clientRect;return s?e>=o.right:t>=o.bottom}{const o=i[0].clientRect;return s?e<=o.left:t<=o.top}}_getItemIndexFromPointerPosition(e,t,i,s){const r="horizontal"===this.orientation,o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>a!==e&&((!s||a!==this._previousSwap.drag||!this._previousSwap.overlaps||(r?s.x:s.y)!==this._previousSwap.delta)&&(r?t>=Math.floor(l.left)&&t<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom))));return-1!==o&&this._sortPredicate(o,e)?o:-1}}class ie{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(e,t){this._document=e,this._dragDropRegistry=t}start(e){const t=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<t.length;i++){const s=t[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(e)}sort(e,t,i,s){const r=this._getItemIndexFromPointerPosition(e,t,i),o=this._previousSwap;if(-1===r||this._activeItems[r]===e)return null;const a=this._activeItems[r];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;const l=this.getItemIndex(e),c=e.getPlaceholderElement(),d=a.getRootElement();r>l?d.after(c):d.before(c),V(this._activeItems,l,r);const f=this._getRootNode().elementFromPoint(t,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=d===f||d.contains(f),{previousIndex:l,currentIndex:r}}enter(e,t,i,s){const r=this._activeItems.indexOf(e);r>-1&&this._activeItems.splice(r,1);let o=null==s||s<0?this._getItemIndexFromPointerPosition(e,t,i):s;-1===o&&(o=this._getClosestItemIndexToPointer(e,t,i));const a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,e),a.getRootElement().before(e.getPlaceholderElement())):(this._activeItems.push(e),this._element.appendChild(e.getPlaceholderElement()))}withItems(e){this._activeItems=e.slice()}withSortPredicate(e){this._sortPredicate=e}reset(){const e=this._element,t=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){const[s,r]=this._relatedNodes[i];s.parentNode===e&&s.nextSibling!==r&&(null===r?e.appendChild(s):r.parentNode===e&&e.insertBefore(s,r))}this._relatedNodes=[],this._activeItems=[],t.drag=null,t.deltaX=t.deltaY=0,t.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(e){return this._activeItems.indexOf(e)}getItemAtIndex(e){return this._activeItems[e]||null}updateOnScroll(){this._activeItems.forEach(e=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()})}withElementContainer(e){e!==this._element&&(this._element=e,this._rootNode=void 0)}_getItemIndexFromPointerPosition(e,t,i){const s=this._getRootNode().elementFromPoint(Math.floor(t),Math.floor(i)),r=s?this._activeItems.findIndex(o=>{const a=o.getRootElement();return s===a||a.contains(s)}):-1;return-1!==r&&this._sortPredicate(r,e)?r:-1}_getRootNode(){return this._rootNode||(this._rootNode=(0,P.KT)(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(e,t,i){if(0===this._activeItems.length)return-1;if(1===this._activeItems.length)return 0;let s=1/0,r=-1;for(let o=0;o<this._activeItems.length;o++){const a=this._activeItems[o];if(a!==e){const{x:l,y:c}=a.getRootElement().getBoundingClientRect(),d=Math.hypot(t-l,i-c);d<s&&(s=d,r=o)}}return r}}var m=function(n){return n[n.NONE=0]="NONE",n[n.UP=1]="UP",n[n.DOWN=2]="DOWN",n}(m||{}),u=function(n){return n[n.NONE=0]="NONE",n[n.LEFT=1]="LEFT",n[n.RIGHT=2]="RIGHT",n}(u||{});class ne{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _.B;entered=new _.B;exited=new _.B;dropped=new _.B;sorted=new _.B;receivingStarted=new _.B;receivingStopped=new _.B;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=y.yU.EMPTY;_verticalScrollDirection=m.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _.B;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(e,t,i,s,r){this._dragDropRegistry=t,this._ngZone=s,this._viewportRuler=r;const o=this.element=(0,w.i8)(e);this._document=i,this.withOrientation("vertical").withElementContainer(o),t.registerDropContainer(this),this._parentPositions=new et(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(e,t,i,s){this._draggingStarted(),null==s&&this.sortingDisabled&&(s=this._draggables.indexOf(e)),this._sortStrategy.enter(e,t,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,i,s,r,o,a,l={}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:r,distance:o,dropPoint:a,event:l})}withItems(e){const t=this._draggables;return this._draggables=e,e.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(t.filter(s=>s.isDragging()).every(s=>-1===e.indexOf(s))?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(e){return this._direction=e,this._sortStrategy instanceof dt&&(this._sortStrategy.direction=e),this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){if("mixed"===e)this._sortStrategy=new ie(this._document,this._dragDropRegistry);else{const t=new dt(this._dragDropRegistry);t.direction=this._direction,t.orientation=e,this._sortStrategy=t}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((t,i)=>this.sortPredicate(t,i,this)),this}withScrollableParents(e){const t=this._container;return this._scrollableElements=-1===e.indexOf(t)?[t,...e]:e.slice(),this}withElementContainer(e){if(e===this._container)return this;(0,w.i8)(this.element);const i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(e);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(e),this._cachedShadowRoot=null,this._scrollableElements.unshift(e),this._container=e,this}getScrollableParents(){return this._scrollableElements}getItemIndex(e){return this._isDragging?this._sortStrategy.getItemIndex(e):this._draggables.indexOf(e)}getItemAtIndex(e){return this._isDragging?this._sortStrategy.getItemAtIndex(e):this._draggables[e]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,i,s){if(this.sortingDisabled||!this._domRect||!tt(this._domRect,.05,t,i))return;const r=this._sortStrategy.sort(e,t,i,s);r&&this.sorted.next({previousIndex:r.previousIndex,currentIndex:r.currentIndex,container:this,item:e})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let i,s=m.NONE,r=u.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||tt(o.clientRect,.05,e,t)&&([s,r]=function re(n,e,t,i,s){const r=_t(e,s),o=ut(e,i);let a=m.NONE,l=u.NONE;if(r){const c=n.scrollTop;r===m.UP?c>0&&(a=m.UP):n.scrollHeight-c>n.clientHeight&&(a=m.DOWN)}if(o){const c=n.scrollLeft;"rtl"===t?o===u.RIGHT?c<0&&(l=u.RIGHT):n.scrollWidth+c>n.clientWidth&&(l=u.LEFT):o===u.LEFT?c>0&&(l=u.LEFT):n.scrollWidth-c>n.clientWidth&&(l=u.RIGHT)}return[a,l]}(a,o.clientRect,this._direction,e,t),(s||r)&&(i=a))}),!s&&!r){const{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=_t(l,t),r=ut(l,e),i=window}i&&(s!==this._verticalScrollDirection||r!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=r,this._scrollNode=i,(s||r)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){const e=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=e.msScrollSnapType||e.scrollSnapType||"",e.scrollSnapType=e.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;const e=this._container.style;e.scrollSnapType=e.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(t=>t._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),function It(n=0,e=Rt.E){return n<0&&(n=0),(0,Et.O)(n,n,e)}(0,xt.X).pipe((0,k.Q)(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode,t=this.autoScrollStep;this._verticalScrollDirection===m.UP?e.scrollBy(0,-t):this._verticalScrollDirection===m.DOWN&&e.scrollBy(0,t),this._horizontalScrollDirection===u.LEFT?e.scrollBy(-t,0):this._horizontalScrollDirection===u.RIGHT&&e.scrollBy(t,0)})};_isOverContainer(e,t){return null!=this._domRect&&B(this._domRect,e,t)}_getSiblingContainerFromPosition(e,t,i){return this._siblings.find(s=>s._canReceive(e,t,i))}_canReceive(e,t,i){if(!this._domRect||!B(this._domRect,t,i)||!this.enterPredicate(e,this))return!1;const s=this._getShadowRoot().elementFromPoint(t,i);return!!s&&(s===this._container||this._container.contains(s))}_startReceiving(e,t){const i=this._activeSiblings;!i.has(e)&&t.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(e),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:e,receiver:this,items:t}))}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:e,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(e=>{if(this.isDragging()){const t=this._parentPositions.handleScroll(e);t&&this._sortStrategy.updateOnScroll(t.top,t.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){const e=(0,P.KT)(this._container);this._cachedShadowRoot=e||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){const e=this._sortStrategy.getActiveItemsSnapshot().filter(t=>t.isDragging());this._siblings.forEach(t=>t._startReceiving(this,e))}}function _t(n,e){const{top:t,bottom:i,height:s}=n,r=.05*s;return e>=t-r&&e<=t+r?m.UP:e>=i-r&&e<=i+r?m.DOWN:m.NONE}function ut(n,e){const{left:t,right:i,width:s}=n,r=.05*s;return e>=t-r&&e<=t+r?u.LEFT:e>=i-r&&e<=i+r?u.RIGHT:u.NONE}const T=new h.nKC("CDK_DRAG_PARENT"),ft=new h.nKC("CdkDragHandle"),mt=new h.nKC("CDK_DRAG_CONFIG"),vt=new h.nKC("CdkDropList");let Dt=(()=>{class n{element=(0,h.WQX)(p.aKT);dropContainer=(0,h.WQX)(vt,{optional:!0,skipSelf:!0});_ngZone=(0,h.WQX)(h.SKi);_viewContainerRef=(0,h.WQX)(p.c1b);_dir=(0,h.WQX)(j.dS,{optional:!0});_changeDetectorRef=(0,h.WQX)(D.gRc);_selfHandle=(0,h.WQX)(ft,{optional:!0,self:!0});_parentDrag=(0,h.WQX)(T,{optional:!0,skipSelf:!0});_dragDropRegistry=(0,h.WQX)(L);_destroyed=new _.B;_handles=new Ct.t([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!(!this.dropContainer||!this.dropContainer.disabled)}set disabled(t){this._disabled=t,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new h.bkB;released=new h.bkB;ended=new h.bkB;entered=new h.bkB;exited=new h.bkB;dropped=new h.bkB;moved=new K.c(t=>{const i=this._dragRef.moved.pipe((0,kt.T)(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(t);return()=>{i.unsubscribe()}});_injector=(0,h.WQX)(h.zZn);constructor(){const t=this.dropContainer,i=(0,h.WQX)(mt,{optional:!0});this._dragRef=function Jt(n,e,t={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){const i=n.get(p.sFG,null,{optional:!0})||n.get(p._9s).createRenderer(null,null);return new qt(e,t,n.get(h.qQL),n.get(h.SKi),n.get(M.Xj),n.get(L),i)}(this._injector,this.element,{dragStartThreshold:i&&null!=i.dragStartThreshold?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&null!=i.pointerDirectionChangeThreshold?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),t&&(t.addItem(this),t._dropListRef.beforeStarted.pipe((0,k.Q)(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(t){this._dragRef.setFreeDragPosition(t)}ngAfterViewInit(){(0,p.mal)(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(t){const i=t.rootElementSelector,s=t.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.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(t){const i=this._handles.getValue();i.push(t),this._handles.next(i)}_removeHandle(t){const i=this._handles.getValue(),s=i.indexOf(t);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(t){this._previewTemplate=t}_resetPreviewTemplate(t){t===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(t){this._placeholderTemplate=t}_resetPlaceholderTemplate(t){t===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){const t=this.element.nativeElement;let i=t;this.rootElementSelector&&(i=void 0!==t.closest?t.closest(this.rootElementSelector):t.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||t)}_getBoundaryElement(){const t=this.boundaryElement;return t?"string"==typeof t?this.element.nativeElement.closest(t):(0,w.i8)(t):null}_syncInputs(t){t.beforeStarted.subscribe(()=>{if(!t.isDragging()){const i=this._dir,s=this.dragStartDelay,r=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.scale=this.scale,t.dragStartDelay="object"==typeof s&&s?s:(0,w.OE)(s),t.constrainPosition=this.constrainPosition,t.previewClass=this.previewClass,t.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(r).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&t.withDirection(i.value)}}),t.beforeStarted.pipe((0,Ot.s)(1)).subscribe(()=>{if(this._parentDrag)return void t.withParent(this._parentDrag._dragRef);let i=this.element.nativeElement.parentElement;for(;i;){const s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){t.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(t){t.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),t.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),t.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),t.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(t){const{lockAxis:i,dragStartDelay:s,constrainPosition:r,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:c,previewContainer:d}=t;this.disabled=l??!1,this.dragStartDelay=s||0,this.lockAxis=i||null,r&&(this.constrainPosition=r),o&&(this.previewClass=o),a&&(this.boundaryElement=a),c&&(this.rootElementSelector=c),d&&(this.previewContainer=d)}_setupHandlesListener(){this._handles.pipe((0,Lt.M)(t=>{const i=t.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),(0,Nt.n)(t=>(0,N.h)(...t.map(i=>i._stateChanges.pipe($(i))))),(0,k.Q)(this._destroyed)).subscribe(t=>{const i=this._dragRef,s=t.element.nativeElement;t.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||n)};static \u0275dir=p.FsC({type:n,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){2&i&&p.AVh("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._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",D.L39],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",D.Udg]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[p.Jv_([{provide:T,useExisting:n}]),p.OA$]})}return n})();const Q=new h.nKC("CdkDropListGroup");let wt=(()=>{class n{element=(0,h.WQX)(p.aKT);_changeDetectorRef=(0,h.WQX)(D.gRc);_scrollDispatcher=(0,h.WQX)(M.R);_dir=(0,h.WQX)(j.dS,{optional:!0});_group=(0,h.WQX)(Q,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _.B;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=(0,h.WQX)(zt.g).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(t){this._dropListRef.disabled=this._disabled=t}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new h.bkB;entered=new h.bkB;exited=new h.bkB;sorted=new h.bkB;_unsortedItems=new Set;constructor(){const t=(0,h.WQX)(mt,{optional:!0}),i=(0,h.WQX)(h.zZn);this._dropListRef=function se(n,e){return new ne(e,n.get(L),n.get(h.qQL),n.get(h.SKi),n.get(M.Xj))}(i,this.element),this._dropListRef.data=this,t&&this._assignDefaults(t),this._dropListRef.enterPredicate=(s,r)=>this.enterPredicate(s.data,r.data),this._dropListRef.sortPredicate=(s,r,o)=>this.sortPredicate(s,r.data,o.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),n._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(t){this._unsortedItems.add(t),t._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(t){if(this._unsortedItems.delete(t),this._latestSortedRefs){const i=this._latestSortedRefs.indexOf(t._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((t,i)=>t._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){const t=n._dropLists.indexOf(this);t>-1&&n._dropLists.splice(t,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(t){this._dir&&this._dir.change.pipe($(this._dir.value),(0,k.Q)(this._destroyed)).subscribe(i=>t.withDirection(i)),t.beforeStarted.subscribe(()=>{const i=(0,Vt.F)(this.connectedTo).map(s=>"string"==typeof s?n._dropLists.find(o=>o.id===s):s);if(this._group&&this._group._items.forEach(s=>{-1===i.indexOf(s)&&i.push(s)}),!this._scrollableParentsResolved){const s=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(r=>r.getElementRef().nativeElement);this._dropListRef.withScrollableParents(s),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){const s=this.element.nativeElement.querySelector(this.elementContainerSelector);t.withElementContainer(s)}t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.autoScrollStep=(0,w.OE)(this.autoScrollStep,2),t.hasAnchor=this.hasAnchor,t.connectedTo(i.filter(s=>s&&s!==this).map(s=>s._dropListRef)).withOrientation(this.orientation)})}_handleEvents(t){t.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),t.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),t.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),t.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),t.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()}),(0,N.h)(t.receivingStarted,t.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(t){const{lockAxis:i,draggingDisabled:s,sortingDisabled:r,listAutoScrollDisabled:o,listOrientation:a}=t;this.disabled=s??!1,this.sortingDisabled=r??!1,this.autoScrollDisabled=o??!1,this.orientation=a||"vertical",this.lockAxis=i||null}_syncItemsWithRef(t){this._latestSortedRefs=t,this._dropListRef.withItems(t)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=p.FsC({type:n,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,s){2&i&&(p.BMQ("id",s.id),p.AVh("cdk-drop-list-disabled",s.disabled)("cdk-drop-list-dragging",s._dropListRef.isDragging())("cdk-drop-list-receiving",s._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",D.L39],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",D.L39],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",D.L39],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",D.L39]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[p.Jv_([{provide:Q,useValue:void 0},{provide:vt,useExisting:n}])]})}return n})()}}]);
package/613.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[613],{4613(y,f,o){o.d(f,{Logo:()=>c});var h=o(7705),a=o(5547),m=o(5802),g=o(2271),M=o(6170);let c=(()=>{class p{size=(0,h.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px",xl:"320px"};active=(0,h.hFB)(!0,{transform:h.L39});continuous=(0,h.hFB)(!1,{transform:h.L39});mode=(0,h.hFB)("default");isDarkMode=(0,h.geq)(!1);handleDarkModeChange(t){this.isDarkMode.set(t),-1===this.raf&&this.animate()}colorA=(0,g.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;playfulPhase="idle";playfulIdleUntil=0;playfulAnimStart=0;playfulAnimDuration=2e3;playfulRetractAmount=.3;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=t=>{if(void 0!==t){const e=5e-4*(t-this.appearTime);"glow"===this.mode()?this.tip=e%1:"playful"!==this.mode()&&(this.tip=Math.min(1,e),this.active()||(this.toe=Math.min(1,6e-4*(t-this.disappearTime))))}if("playful"===this.mode())return void 0!==t&&("idle"===this.playfulPhase?t>=this.playfulIdleUntil&&(this.playfulPhase="animating",this.playfulAnimStart=t,this.playfulRetractAmount=.2+.75*Math.random(),this.playfulAnimDuration=2*this.playfulRetractAmount/5e-4):(t-this.playfulAnimStart)/this.playfulAnimDuration>=1&&(this.playfulPhase="idle",this.playfulIdleUntil=t+1e3+4e3*Math.random())),this.renderPlayful(t),void(void 0!==t&&(this.raf=requestAnimationFrame(this.animate)));if("glow"===this.mode()){const e=.06666666666666667,i=this.rgbToSvg(this.colorA());return this.paths.forEach((r,n)=>{this.norm=1/this.paths.length*n;let s=this.tip-this.norm;if(s<-(1-e)&&(s+=1),s>=0&&s<e){const d=1-s/e;r.setAttribute("stroke",this.rgbToSvg(this.colorB)),r.setAttribute("stroke-opacity",d.toFixed(3))}else r.setAttribute("stroke",i),r.setAttribute("stroke-opacity","0.005")}),void(this.raf=requestAnimationFrame(this.animate))}if(this.paths.forEach((e,i)=>{this.norm=1/this.paths.length*i,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),e.setAttribute("stroke",this.tip*this.paths.length>i&&(this.active()||this.toe*this.paths.length<i)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),"playful"===this.mode()&&(this.playfulPhase="intro",this.playfulAnimStart=this.appearTime),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}renderPlayful(t){if(void 0===t)return void this.renderPlayfulDraw(1);const e=Math.min(1,5e-4*(t-this.playfulAnimStart));if("intro"===this.playfulPhase)this.renderPlayfulDraw(e),e>=1&&(this.playfulPhase="idle",this.playfulIdleUntil=t+1e3+4e3*Math.random());else if("idle"===this.playfulPhase)this.renderPlayfulDraw(1);else{const i=Math.min(1,(t-this.playfulAnimStart)/this.playfulAnimDuration),n=1-this.playfulRetractAmount*(1-Math.cos(2*i*Math.PI))/2;this.renderPlayfulDraw(n)}}renderPlayfulDraw(t){const e=this.paths.length,i=this.colorA();this.paths.forEach((r,n)=>{if(this.norm=n/e,t*e>n){const s=Math.max(0,Math.min(1,15*(t-this.norm)));this.mix=this.mixRgb(i,this.colorB,s),r.setAttribute("stroke",this.rgbToSvg(this.mix)),r.setAttribute("stroke-opacity","1")}else r.setAttribute("stroke","transparent")})}mixChannel(t,e,i){return parseInt((t*i+e*(1-i)).toFixed())}mixRgb(t,e,i){return[this.mixChannel(t[0],e[0],i),this.mixChannel(t[1],e[1],i),this.mixChannel(t[2],e[2],i)]}rgbToSvg(t){return`rgb(${t[0]},${t[1]},${t[2]})`}constructor(){(0,m.QZP)(()=>{"glow"===this.mode()||"playful"===this.mode()||this.active()?this.activate():this.deactivate()}),(0,m.QZP)(()=>{this.isDarkMode(),this.animate()});const t=(0,m.WQX)(a.aKT);(0,a.mal)({read:()=>{if(this.paths.length)return;const e=t.nativeElement.querySelector("svg"),i=t.nativeElement.querySelector("#original-path");if(!i)return;const r=i.getTotalLength(),s=[];for(let d=0;d<400;d++){const l=i.getPointAtLength(r/400*d);s.push({x:parseFloat(l.x.toFixed(2)),y:parseFloat(l.y.toFixed(2))})}s.push(i.getPointAtLength(r)),s.reverse(),s.forEach((d,l)=>{if(0===l||1===l)return;const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d",`M${s[l-2].x},${s[l-2].y}L${s[l-1].x},${s[l-1].y}L${d.x},${d.y}`),u.setAttribute("fill","none"),u.setAttribute("stroke","transparent"),u.setAttribute("stroke-width",i?.getAttribute("stroke-width")||"1"),u.setAttribute("stroke-miterlimit",i?.getAttribute("stroke-miterlimit")||"1"),e.appendChild(u),this.paths.push(u)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(e){return new(e||p)};static \u0275cmp=a.VBU({type:p,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(e,i){2&e&&a.xc7("width",i.sizeMap[i.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],mode:[1,"mode"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(e,i){1&e&&(m.qSk(),a.j41(0,"svg",0),a.bIt("darkModeChange",function(n){return i.handleDarkModeChange(n)}),a.nrm(1,"path",1),a.k0s())},dependencies:[M.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return p})()},6170(y,f,o){o.d(f,{R:()=>M});var h=o(7705),a=o(5802),m=o(2271),g=o(5547);let M=(()=>{class c{destroyRef=(0,a.WQX)(a.abz);_isDarkMode=(0,a.vPA)(this.hasDarkClass());isDarkMode=(0,m.EW)(()=>this._isDarkMode());darkModeChange=(0,h.CGW)();constructor(){const D=new MutationObserver(t=>{t.forEach(e=>{if("attributes"===e.type&&"class"===e.attributeName){const i=this.hasDarkClass();i!==this._isDarkMode()&&this._isDarkMode.set(i)}})});D.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>D.disconnect()),(0,a.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(t){return new(t||c)};static \u0275dir=g.FsC({type:c,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return c})()}}]);