@letscooee/web-sdk 10.2.0 → 11.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ {
2
+ "$schema": "https://unpkg.com/release-it/schema/release-it.json",
3
+ "npm": {
4
+ "publish": false
5
+ },
6
+ "gitlab": {
7
+ "release": true
8
+ },
9
+ "plugins": {
10
+ "@release-it/conventional-changelog": {
11
+ "infile": "CHANGELOG.md",
12
+ "writerOpts": {
13
+ "groupBy": "type"
14
+ },
15
+ "preset": {
16
+ "name": "conventionalcommits",
17
+ "types": [
18
+ {
19
+ "type": "feat",
20
+ "section": "Features"
21
+ },
22
+ {
23
+ "type": "fix",
24
+ "section": "Bug Fixes"
25
+ },
26
+ {
27
+ "type": "style",
28
+ "section": "Styles"
29
+ },
30
+ {
31
+ "type": "perf",
32
+ "section": "Performance Improvements"
33
+ },
34
+ {
35
+ "type": "refactor",
36
+ "section": "Refactoring"
37
+ },
38
+ {
39
+ "type": "chore",
40
+ "section": "Chores"
41
+ }
42
+ ]
43
+ }
44
+ }
45
+ },
46
+ "hooks": {
47
+ "after:bump": "npm run asset-sizes"
48
+ }
49
+ }
@@ -0,0 +1,2 @@
1
+ import{B as P,C as d,Db as bt,Eb as Pt,Fb as T,Hb as S,I as ht,J as z,Jb as St,Kb as v,L as V,Lb as yt,N as ct,Nb as Rt,P as dt,Pb as Et,Sa as ft,Y as B,_ as _t,aa as pt,ca as gt,db as mt,h as w,ha as D,i as A,ia as C,j as _,ja as ut,k as et,m as it,o as st,q as nt,r as F,rb as vt,s as rt,sb as Dt,tb as wt,v as ot,w as at,x,y as lt,z as H}from"./chunk-S6UU36F3.js";function W(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Ct(r,t):(i==="input"||i==="select"||i==="textarea")&&xt(r,t),It("canvas",r,t,Ct),It("input, textarea, select",r,t,xt),t}function It(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var Xt=0;function xt(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${Xt++}`)}function Ct(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function Y(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function Z(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function Jt(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function E(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function Tt(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:h}=r,c=l*t,g=h*t;return i>s-g&&i<o+g&&e>a-c&&e<n+c}var k=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Y(e)})})}handleScroll(t){let e=S(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let h=this.getViewportScrollPosition();n=h.top,o=h.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((h,c)=>{h.clientRect&&e!==c&&e.contains(c)&&E(h.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Gt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function X(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function b(r,t){let e=t?"":"none";X(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function kt(r,t,e){X(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function O(r,t){return t&&t!="none"?r+" "+t:r}function Ot(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=I(t.left,t.top)}function I(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Lt(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function Qt(r){let t=getComputedStyle(r),e=G(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=G(t,"transition-duration"),o=G(t,"transition-delay");return Lt(n[s])+Lt(o[s])}function G(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var te=new Set(["position"]),j=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,h,c){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),Nt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return Qt(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=Gt(o,this._document),this._previewEmbeddedView=o,t.matchSize?Ot(s,n):s.style.transform=I(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=W(this._rootElement),Ot(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return X(s.style,{"pointer-events":"none",margin:Nt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},te),b(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function Nt(r){return"showPopover"in r}var ee={passive:!0},Mt={passive:!1},ie={passive:!1,capture:!0},se=800,At="cdk-drag-placeholder",Ft=new Set(["position"]),q=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=V(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=w.EMPTY;_pointerUpSubscription=w.EMPTY;_scrollSubscription=w.EMPTY;_resizeSubscription=w.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>b(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new k(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>v(i)),this._handles.forEach(i=>b(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=v(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Mt),i.listen(e,"touchstart",this._pointerDown,ee),i.listen(e,"dragstart",this._nativeDragStart,Mt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?v(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&Jt(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=I(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),b(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),b(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){y(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",ne,ie)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new j(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(n,e)),kt(s,!1,Ft),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=y(e),n=!s&&e.button!==0,o=this._rootElement,a=S(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+se>Date.now(),h=s?Pt(e):bt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||h)return;if(this._handles.length){let m=o.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.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(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=Y(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){kt(this._rootElement,!0,Ft),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let 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(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&S(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Gt(this._placeholderRef,this._document)):i=W(this._rootElement),i.style.pointerEvents="none",i.classList.add(At),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=y(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+h}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=y(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),m=a.left+n,N=a.right-(l-n);i=Ht(i,m,N),s=Ht(s,c,g)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,b(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=I(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=O(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=I(t,e);this._preview.setTransform(O(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:y(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=S(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&E(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return v(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=W(this._placeholder);s.classList.remove(At),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):v(e.element).appendChild(s)}}};function Ht(r,t,e){return Math.max(t,Math.min(e,r))}function y(r){return r.type[0]==="t"}function ne(r){r.preventDefault()}function Ut(r,t,e){let i=zt(t,r.length-1),s=zt(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function zt(r,t){return Math.max(0,Math.min(t,r))}var L=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===t),h=n[o],c=n[l].clientRect,g=h.clientRect,m=l>o?1:-1,N=this._getItemOffsetPx(c,g,m),$t=this._getSiblingOffsetPx(l,n,m),Kt=n.slice();return Ut(n,l,o),n.forEach((u,Yt)=>{if(Kt[Yt]===u)return;let J=u.drag===t,M=J?N:$t,Q=J?t.getPlaceholderElement():u.drag.getRootElement();u.offset+=M;let tt=Math.round(u.offset*(1/u.drag.scale));a?(Q.style.transform=O(`translate3d(${tt}px, 0, 0)`,u.initialTransform),E(u.clientRect,0,M)):(Q.style.transform=O(`translate3d(0, ${tt}px, 0)`,u.initialTransform),E(u.clientRect,M,0))}),this._previousSwap.overlaps=Z(g,e,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),h=o[n];if(h===t&&(h=o[n+1]),!h&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(h=o[0]),a>-1&&o.splice(a,1),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(l,c),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{E(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Y(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},$=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),h=t.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),Ut(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=T(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(e-l,i-h);c<s&&(s=c,n=o)}}return n}},Vt=.05,Wt=.05,f=function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r}(f||{}),p=function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r}(p||{}),K=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=w.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=v(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new k(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof L&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new $(this._document,this._dragDropRegistry);else{let e=new L(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=v(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!Tt(this._domRect,Vt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Tt(o.clientRect,Vt,t,e)&&([s,n]=re(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Zt(l,e),n=jt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),nt(0,it).pipe(x(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===f.UP?t.scrollBy(0,-e):this._verticalScrollDirection===f.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===p.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===p.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&Z(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!Z(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=T(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Zt(r,t){let{top:e,bottom:i,height:s}=r,n=s*Wt;return t>=e-n&&t<=e+n?f.UP:t>=i-n&&t<=i+n?f.DOWN:f.NONE}function jt(r,t){let{left:e,right:i,width:s}=r,n=s*Wt;return t>=e-n&&t<=e+n?p.LEFT:t>=i-n&&t<=i+n?p.RIGHT:p.NONE}function re(r,t,e,i,s){let n=Zt(t,s),o=jt(t,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN)}if(o){let h=r.scrollLeft;e==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT)}return[a,l]}var R={capture:!0},U={passive:!1,capture:!0},oe=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=pt({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
2
+ `],encapsulation:2,changeDetection:0})}return r})(),qt=(()=>{class r{_ngZone=d(C);_document=d(z);_styleLoader=d(yt);_renderer=d(B).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=V([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,U)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(oe),this._activeDragInstances.update(s=>[...s,e]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),R],["selectstart",this._preventDefaultWhileDragging,U]];s?o.push(["touchend",n,R],["touchcancel",n,R]):o.push(["mouseup",n,R]),s||o.push(["mousemove",a=>this.pointerMove.next(a),U]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,h])=>this._renderer.listen(this._document,a,l,h))})}}stopDragging(e){this._activeDragInstances.update(i=>{let s=i.indexOf(e);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new A(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(e,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},R);return()=>{n()}}))),F(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),ae={dragStartThreshold:5,pointerDirectionChangeThreshold:5},le=(()=>{class r{_document=d(z);_ngZone=d(C);_viewportRuler=d(Et);_dragDropRegistry=d(qt);_renderer=d(B).createRenderer(null,null);constructor(){}createDrag(e,i=ae){return new q(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(e){return new K(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),Bt=new P("CDK_DRAG_PARENT");var he=new P("CdkDragHandle");var ce=new P("CDK_DRAG_CONFIG"),de=new P("CdkDropList"),Ae=(()=>{class r{element=d(dt);dropContainer=d(de,{optional:!0,skipSelf:!0});_ngZone=d(C);_viewContainerRef=d(_t);_dir=d(Rt,{optional:!0});_changeDetectorRef=d(vt);_selfHandle=d(he,{optional:!0,self:!0});_parentDrag=d(Bt,{optional:!0,skipSelf:!0});_dragDropRegistry=d(qt);_destroyed=new _;_handles=new et([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new D;released=new D;ended=new D;entered=new D;exited=new D;dropped=new D;moved=new A(e=>{let i=this._dragRef.moved.pipe(st(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=d(ht);constructor(){let e=this.dropContainer,i=d(ce,{optional:!0}),s=d(le);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(x(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){ut(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,s=e.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(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),s=i.indexOf(e);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):v(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,s=this.dragStartDelay,n=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;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof s=="object"&&s?s:St(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(rt(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){e.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:h,previewContainer:c}=e;this.disabled=l??!1,this.dragStartDelay=s||0,i&&(this.lockAxis=i),n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),h&&(this.rootElementSelector=h),c&&(this.previewContainer=c)}_setupHandlesListener(){this._handles.pipe(lt(e=>{let i=e.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),at(e=>F(...e.map(i=>i._stateChanges.pipe(ot(i))))),x(this._destroyed)).subscribe(e=>{let i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=gt({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&ft("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",Dt],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",wt]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[mt([{provide:Bt,useExisting:r}]),ct]})}return r})();export{Ae as a};
@@ -0,0 +1,3 @@
1
+ import{a as I,b as ye,d as Te,f as H,h as De,j as E,l as X,m as Z,q as be,s as Ee,t as ke,u as Me,w as Pe,x as Oe,y as Se,z as Ae}from"./chunk-W76YVDW6.js";import{$a as Ce,Aa as q,C as y,Cb as Ie,E as p,Ea as C,F as m,G as M,Ga as u,H as ie,Ia as a,K as oe,L as P,La as K,Ma as W,Na as G,Oa as ce,P as O,Pa as se,Qa as k,R as S,Ra as pe,S as T,T as r,Ua as h,Va as me,Xa as ue,Ya as ge,Za as _e,_a as ve,aa as f,ab as R,bb as he,eb as fe,ga as A,gb as D,ha as Q,hb as b,jb as we,la as F,ma as _,mb as L,na as v,nb as Y,oa as N,ob as z,pa as w,pb as xe,qa as x,qb as J,ra as s,sa as c,ta as d,ua as g,va as ne,wa as re,wb as B,xa as le,ya as ae,yb as Ve,za as de}from"./chunk-S6UU36F3.js";var Ne=i=>({active:i}),Re=(i,t)=>t.mID;function Le(i,t){if(i&1&&g(0,"img",9),i&2){let e=t.$implicit,n=a();s("src",e.url,T)("alt",n.item().name)}}function ze(i,t){if(i&1&&(g(0,"span",18),D(1,"cooeeCurrency"),D(2,"safeHtml")),i&2){a(2);let e=R(15);s("innerHTML",b(2,3,b(1,1,e.d)),S)}}function Be(i,t){if(i&1&&(g(0,"span",19),D(1,"cooeeCurrency"),D(2,"safeHtml")),i&2){a(2);let e=R(15);s("innerHTML",b(2,3,b(1,1,e.cmp)),S)}}function He(i,t){if(i&1&&(c(0,"div",12),_(1,ze,3,5,"span",18),_(2,Be,3,5,"span",19),d()),i&2){a();let e=R(15);r(),v(e.d?1:-1),r(),v(e.cmp?2:-1)}}function je(i,t){if(i&1){let e=C();c(0,"a",22),u("click",function(o){let l=p(e).$implicit,V=a(2);return m(V.changeItem(o,l))}),g(1,"img",23),d()}if(i&2){let e=t.$implicit,n=a(2);r(),s("src",e.firstImageURL,T)("alt",n.item().name)("ngClass",fe(3,Ne,e.mID===n.item().mID+""))}}function $e(i,t){if(i&1&&(c(0,"span",20),h(1,"Select product"),d(),c(2,"div",8),w(3,je,2,5,"a",21,Re),d()),i&2){let e=a();r(3),x(e.similarItems())}}function Ue(i,t){if(i&1&&(c(0,"span",24),h(1,"Select variant"),d(),g(2,"cooee-item-options-picker",25)),i&2){let e=a();r(2),s("item",e.item())}}function Qe(i,t){if(i&1&&(c(0,"div",26),h(1,"Description"),d(),g(2,"div",27),D(3,"safeHtml")),i&2){let e=a();r(2),s("innerHTML",b(3,1,e.item().desc),S)}}function qe(i,t){i&1&&h(0," Add To Cart ")}function Ke(i,t){i&1&&h(0," Out of stock ")}var j=class i{closeModel=new Q;performCTA=new Q;item=J.required();similarItems=J.required();closeDialog(){this.closeModel.emit()}clickAddToCart(){this.performCTA.emit({item:this.item(),cta:E.ADD_TO_CART})}openCart(){this.performCTA.emit({item:this.item(),cta:E.OPEN_CART})}changeItem(t,e){t.stopPropagation(),t.preventDefault(),this.item.set(e)}goToPDP(){this.performCTA.emit({item:this.item(),cta:E.GO_TO_PRODUCT})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["cooee-item-detail"]],hostAttrs:[1,"letscooee-widget"],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{closeModel:"closeModel",performCTA:"performCTA",item:"itemChange",similarItems:"similarItemsChange"},decls:28,vars:8,consts:[[1,"lc-card-wrapper"],[1,"lc-card-header"],[1,"lc-header"],["type","button",1,"lc-close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","fill","#000"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"lc-card-content"],[1,"lc-image-strip"],[1,"w-28","h-28","object-contain",3,"src","alt"],[1,"lc-inner-body"],[1,"lc-item-name"],[1,"lc-prices"],[1,"lc-card-footer"],["type","button",1,"lc-cta-button",3,"click","disabled"],["type","button",1,"lc-more-info-button",3,"click"],["type","button","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],[1,"lc-item-price",3,"innerHTML"],[1,"lc-item-cmp-price",3,"innerHTML"],[1,"lc-selected-product-title"],["href","#"],["href","#",3,"click"],[1,"product-selector",3,"src","alt","ngClass"],[1,"lc-selected-variant-title"],[3,"item"],[1,"lc-description-title"],[1,"lc-description",3,"innerHTML"]],template:function(e,n){if(e&1){let o=C();c(0,"div",0)(1,"div",1)(2,"div",2),h(3,"Shop Now"),d(),c(4,"button",3),u("click",function(){return p(o),m(n.closeDialog())}),M(),c(5,"svg",4),g(6,"path",5)(7,"path",6),d()()(),ie(),c(8,"div",7)(9,"div",8),w(10,Le,1,2,"img",9,N),d(),c(12,"div",10)(13,"div",11),h(14),d(),ve(15),_(16,He,3,2,"div",12),_(17,$e,5,0),_(18,Ue,3,1),_(19,Qe,4,3),d()(),c(20,"div",13)(21,"button",14),u("click",function(){return p(o),m(n.clickAddToCart())}),_(22,qe,1,0)(23,Ke,1,0),d(),c(24,"button",15),u("click",function(){return p(o),m(n.goToPDP())}),h(25," More Info "),d(),c(26,"button",16),u("click",function(){return p(o),m(n.openCart())}),g(27,"img",17),d()()()}if(e&2){let o=n.item().selectedOrFirstVariant.value;r(10),x(n.item().imgs),r(4),me(n.item().name),r();let l=Ce(o==null?null:o.price);r(),v(l?16:-1),r(),v(n.similarItems().length>1?17:-1),r(),v(n.item().hasVariants()?18:-1),r(),v(n.item().desc?19:-1),r(2),s("disabled",!o.isAvailable),r(),v(o.isAvailable?22:23)}},dependencies:[B,De,Ie,be],styles:["[_nghost-%COMP%]{display:block;background:#fff}.lc-card-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;overflow:auto}.lc-card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.lc-header[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:#000}.lc-close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px}.lc-close-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#000000b3}.lc-card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain}.lc-inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.lc-image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:.5rem;flex-wrap:nowrap}.lc-image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.lc-image-strip[_ngcontent-%COMP%] .product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;padding:2px}.lc-image-strip[_ngcontent-%COMP%] .product-selector.active[_ngcontent-%COMP%]{border:red solid 1px}.lc-item-name[_ngcontent-%COMP%]{font-size:20px;font-weight:600;line-height:normal;color:rgb(var(--lc-color-text))}.lc-item-price[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:rgb(var(--lc-color-text))}.lc-item-cmp-price[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:rgba(var(--lc-color-text),.75);margin-left:10px;text-decoration:line-through;display:none}.lc-description-title[_ngcontent-%COMP%], .lc-selected-product-title[_ngcontent-%COMP%], .lc-selected-variant-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin-top:8px;line-height:normal;color:#000}.lc-description[_ngcontent-%COMP%]{line-height:normal;color:#000}.lc-card-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:12px;background-color:#0000004d;box-shadow:0 4px 6px #52525b4d;gap:12px}.lc-cta-button[_ngcontent-%COMP%], .lc-more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;border:none;border-radius:.5rem;font-weight:600;display:flex;justify-content:center;align-items:center;font-size:16px}.lc-cta-button[_ngcontent-%COMP%]{background-color:#000;color:#fff}.lc-cta-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.lc-more-info-button[_ngcontent-%COMP%]{background-color:#fff;color:#000}.view-cart-button[_ngcontent-%COMP%]{background:transparent;border:none}"]})};var $=class i{video=z.required();progress=P(0);constructor(){L(t=>{let e=this.video(),n=()=>{this.progress.set(e.currentTime/e.duration*100)};e.addEventListener("timeupdate",n),t(()=>{e.removeEventListener("timeupdate",n)})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(e,n){e&1&&(ne(0,"div",0)(1,"div",1),le(2,"div"),re()()),e&2&&(r(),pe("width",n.progress(),"%"),F("aria-valuenow",n.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%]{height:4px;background-color:#374151;width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{height:4px;background-color:rgba(var(--lc-color-primary),.1);transition:width .5s ease-in-out}"]})};var We=["swiperContainer"],Ge=(i,t)=>t.id;function Ye(i,t){if(i&1){let e=C();c(0,"div",3)(1,"cooee-item-card",4),u("buttonClick",function(o){p(e);let l=a();return m(l.onButtonClick(o))})("click",function(){let o=p(e).$implicit,l=a();return m(l.cardClick.emit(o))}),d()()}if(i&2){let e=t.$implicit;r(),s("item",e)}}var U=class i{items=z.required();cardClick=Y();buttonClick=Y();destroyRef=y(oe);elementRef=y(O);swiperContainerRef=xe.required("swiperContainer");swiperInstance;constructor(){L(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){H(this.elementRef.nativeElement.shadowRoot)}onButtonClick(t){let e=Te.get().website?.canChangeVariantInCart;if(this.items()?.length>1||t.hasVariants()&&!e){this.cardClick.emit(t);return}this.buttonClick.emit(t)}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["cooee-video-promoted-items"]],viewQuery:function(e,n){e&1&&ce(n.swiperContainerRef,We,5),e&2&&se()},inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick",buttonClick:"buttonClick"},decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(e,n){e&1&&(c(0,"div",1,0)(2,"div",2),w(3,Ye,2,1,"div",3,Ge),d()()),e&2&&(r(3),x(n.items()))},dependencies:[Ae],styles:[`:host{display:block;width:100%}cooee-item-card{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:#ffffff80;border-radius:7px;cursor:pointer}
2
+ `],encapsulation:3})};var Je=["swiperComp"],Xe=["videoEl"],Ze=(i,t)=>t.url;function et(i,t){if(i&1&&g(0,"source",12),i&2){let e=t.$implicit;s("type",he(e.mimeType))("src",e.url,T)}}function tt(i,t){i&1&&q(0)}function it(i,t){if(i&1){let e=C();c(0,"cooee-video-promoted-items",20),u("buttonClick",function(o){p(e);let l=a(2).$implicit,V=a();return m(V.itemButtonClicked(o,l))})("cardClick",function(o){p(e);let l=a(2).$implicit,V=a();return m(V.productCardClicked(o,l))}),d()}if(i&2){let e=a(2).$implicit;s("items",e.items)}}function ot(i,t){if(i&1&&g(0,"cooee-video-card",19),i&2){let e=a(2).$implicit;s("card",e.card)}}function nt(i,t){if(i&1){let e=C();g(0,"cooee-video-progress-bar",14),c(1,"div",15)(2,"cooee-mute-toggle",16),_e("mutedChange",function(o){p(e);let l=a(2);return ge(l.muted,o)||(l.muted=o),m(o)}),u("toggled",function(){p(e);let o=a(2);return m(o.muteToggled())}),d(),A(3,tt,1,0,"ng-container",8),d(),c(4,"div",17),_(5,it,1,1,"cooee-video-promoted-items",18)(6,ot,1,1,"cooee-video-card",19),d()}if(i&2){let e=a().$implicit,n=k(4),o=a(),l=k(9);s("video",n),r(2),ue("muted",o.muted),s("videoEl",n),r(),s("ngTemplateOutlet",l),r(2),v(e.items.length&&o.footerContent===o.VideoConfigFooterContent.FIRST_ITEM?5:e.card&&o.footerContent===o.VideoConfigFooterContent.CARD?6:-1)}}function rt(i,t){if(i&1){let e=C();c(0,"cooee-item-detail",21),u("performCTA",function(o){p(e);let l=a(2);return m(l.performClickToAction(o,l.selectedVideo))})("closeModel",function(){p(e);let o=a(2);return m(o.productModalClosed())}),d()}if(i&2){let e=a(2);s("item",e.selectedItem)("similarItems",e.selectedVideo.items)}}function lt(i,t){if(i&1){let e=C();c(0,"div",6)(1,"div",9)(2,"div",10)(3,"video",11,2),u("click",function(){let o=p(e).$index,l=a();return m(l.currentIndex===o&&l.toggleMute())})("ended",function(){p(e);let o=k(4),l=a();return m(l.onVideoEnded(o))}),w(5,et,1,3,"source",12,Ze),d(),_(7,nt,7,5),d(),_(8,rt,1,2,"cooee-item-detail",13),d()()}if(i&2){let e=t.$implicit,n=t.$index,o=a();r(3),s("ngClass",o.viewTemplateClassName)("poster",e.thumbnail,T),F("data-video-id",e.id)("autoplay",o.currentIndex===n||null)("muted",o.muted||null),r(2),x(e.sources),r(2),v(o.currentIndex===n?7:-1),r(),v(o.selectedItem&&o.currentIndex===n?8:-1)}}function at(i,t){i&1&&q(0)}function dt(i,t){if(i&1){let e=C();c(0,"button",22),u("click",function(){p(e);let o=a();return m(o.close())}),M(),c(1,"svg",23),g(2,"path",24)(3,"path",25),d()()}}var Fe=class i{swiperComponent;videoElements;data=y(Me);VideoConfigFooterContent=Ee;currentIndex=0;muted=P(!1);selectedItem=null;selectedVideo;swiperOptions;detailPopupTemplate;footerContent;viewTemplateClassName="lc-video-only-view";videos=[];elementRef=y(O);dialogRef=y(ke);triggerContext;engagementTrigger;isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData}async ngOnInit(){this.muted.set(await Z.get(X.MUTED,!1));let t=this.engagementTrigger?.content?.videoConfig;switch(this.detailPopupTemplate=t?.detailPopup.template??"VIDEO_ONLY_VIEW",this.footerContent=t?.footerContent??"FIRST_ITEM",H(this.elementRef.nativeElement.shadowRoot),this.detailPopupTemplate){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initSwiperOptions(),queueMicrotask(()=>this.playActiveVideo())}close(t=this.videos[this.currentIndex],e=this.currentIndex){let n=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:t,lastVideoIndex:e,lastVideoDuration:n?.currentTime})}itemButtonClicked(t,e){this.performClickToAction({cta:E.ADD_TO_CART,item:t},e)}performClickToAction(t,e){this.data.onCTAPerformed({cta:t.cta,item:t.item,video:e})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null,this.selectedVideo=void 0}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause())}toggleMute(){this.muted.update(t=>!t)}async muteToggled(){await Z.set(X.MUTED,this.muted());let e=[this.muted()?I.EVENT_VIDEO_MUTED:I.EVENT_VIDEO_UNMUTED,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e)}playActiveVideo(){this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(t){t.currentTime=1,t.play().catch(e=>ye.error(e))}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem?this.playVideo(t):this.moveToNextVideo();else{let e=this.getPreviousVideoDataForEvent(),n=[I.EVENT_LAST_VIDEO_ENDED,{previous:e},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(n),this.playVideo(t)}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.playActiveVideo(),this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"?this.selectItemForDetailView():(this.selectedItem=null,delete this.selectedVideo);let n=this.currentVideoProps(),o={previous:e,current:n},l=[I.EVENT_VIDEO_CHANGE,o,{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(l)}productCardClicked(t,e){let n={videoID:e.id,videoIndex:this.currentIndex},o=[I.EVENT_MORE_ITEM_INFO_CLICKED,{current:n},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(o),this.selectedItem=t,this.selectedVideo=e}initSwiperOptions(){let t=this.isMobile?1:"auto",e=0;this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"&&(t="auto",e=10),this.swiperOptions={direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}}}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let n=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/n).toFixed(4),t}selectItemForDetailView(){this.selectedVideo=this.videos[this.currentIndex],this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=f({type:i,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(e,n){if(e&1&&(K(Je,7),K(Xe,5)),e&2){let o;W(o=G())&&(n.swiperComponent=o.first),W(o=G())&&(n.videoElements=o)}},hostAttrs:[1,"letscooee-widget"],decls:10,vars:3,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],["playsinline","","preload","metadata",1,"lc-video-el",3,"click","ended","ngClass","poster"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"buttonClick","cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"performCTA","closeModel","item","similarItems"],["type","button",1,"lc-close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","#fff"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(e,n){if(e&1){let o=C();c(0,"div",3)(1,"cooee-swiper",4,0),u("slideChange",function(V){return p(o),m(n.onSlideChange(V))}),ae(3,5),w(4,lt,9,7,"div",6,N),de(),d(),c(6,"div",7),A(7,at,1,0,"ng-container",8),d()(),A(8,dt,4,0,"ng-template",null,1,we)}if(e&2){let o=k(9);s("ngClass",n.viewTemplateClassName),r(),s("options",n.swiperOptions),r(3),x(n.videos),r(3),s("ngTemplateOutlet",o)}},dependencies:[U,j,Se,$,Ve,B,Oe,Pe],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev,.video-swiper>.swiper-button-next{display:none!important}}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:12px;overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover}.lc-product-detail-view video{width:100%;object-fit:cover;z-index:-1}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}.lc-video-controls .lc-close-button{display:block}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.lc-close-button{border:none;display:flex;justify-content:center;align-items:center;width:40px;height:40px;background:#00000080;border-radius:100%;cursor:pointer}.lc-close-button svg{width:100%;height:100%}@media (min-width: 768px){.lc-close-button{width:48px;height:48px}}.lc-product-detail-view .lc-video-container{height:100%;position:relative}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}.lc-video-only-view .lc-video-container{height:100%}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute}
3
+ `],encapsulation:3})};export{Fe as VideoDetailDialogComponent};