/*! For license information please see 2488.BSKRLImaphU.js.LICENSE.txt */ "use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[2488],{86477:function(t,e,r){var n=r(33368),i=r(71650),o=r(68308),a=r(69205),s=r(43204),c=r(95260),u=r(82390),l=r(34541),h=r(47838),d=(r(94738),r(98214),r(46798),r(5095)),p=r(25550),f=["focusin","focusout","pointerdown"],v=function(t){function e(){var t;return(0,i.Z)(this,e),(t=(0,o.Z)(this,e,arguments)).visible=!1,t.inward=!1,t.attachableController=new p.J((0,u.Z)(t),t.onControlChange.bind((0,u.Z)(t))),t}return(0,a.Z)(e,t),(0,n.Z)(e,[{key:"htmlFor",get:function(){return this.attachableController.htmlFor},set:function(t){this.attachableController.htmlFor=t}},{key:"control",get:function(){return this.attachableController.control},set:function(t){this.attachableController.control=t}},{key:"attach",value:function(t){this.attachableController.attach(t)}},{key:"detach",value:function(){this.attachableController.detach()}},{key:"connectedCallback",value:function(){(0,l.Z)((0,h.Z)(e.prototype),"connectedCallback",this).call(this),this.setAttribute("aria-hidden","true")}},{key:"handleEvent",value:function(t){var e,r;if(!t[b]){switch(t.type){default:return;case"focusin":this.visible=null!==(e=null===(r=this.control)||void 0===r?void 0:r.matches(":focus-visible"))&&void 0!==e&&e;break;case"focusout":case"pointerdown":this.visible=!1}t[b]=!0}}},{key:"onControlChange",value:function(t,e){if(!d.sk)for(var r=0,n=f;r'])),(0,b.$)(t))}},{key:"update",value:function(t){t.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),(0,f.Z)((0,v.Z)(e.prototype),"update",this).call(this,t)}},{key:"handlePointerenter",value:function(t){this.shouldReactToEvent(t)&&(this.hovered=!0)}},{key:"handlePointerleave",value:function(t){this.shouldReactToEvent(t)&&(this.hovered=!1,this.state!==g.INACTIVE&&this.endPressAnimation())}},{key:"handlePointerup",value:function(t){if(this.shouldReactToEvent(t)){if(this.state!==g.HOLDING)return this.state===g.TOUCH_DELAY?(this.state=g.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=g.WAITING_FOR_CLICK}}},{key:"handlePointerdown",value:(u=(0,h.Z)((0,l.Z)().mark((function t(e){return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.shouldReactToEvent(e)){t.next=2;break}return t.abrupt("return");case 2:if(this.rippleStartEvent=e,this.isTouch(e)){t.next=7;break}return this.state=g.WAITING_FOR_CLICK,this.startPressAnimation(e),t.abrupt("return");case 7:if(!this.checkBoundsAfterContextMenu||this.inBounds(e)){t.next=9;break}return t.abrupt("return");case 9:return this.checkBoundsAfterContextMenu=!1,this.state=g.TOUCH_DELAY,t.next=13,new Promise((function(t){setTimeout(t,150)}));case 13:if(this.state===g.TOUCH_DELAY){t.next=15;break}return t.abrupt("return");case 15:this.state=g.HOLDING,this.startPressAnimation(e);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return u.apply(this,arguments)})},{key:"handleClick",value:function(){this.disabled||(this.state!==g.WAITING_FOR_CLICK?this.state===g.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}},{key:"handlePointercancel",value:function(t){this.shouldReactToEvent(t)&&this.endPressAnimation()}},{key:"handleContextmenu",value:function(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}},{key:"determineRippleSize",value:function(){var t=this.getBoundingClientRect(),e=t.height,r=t.width,n=Math.max(e,r),i=Math.max(.35*n,75),o=Math.floor(.2*n),a=Math.sqrt(Math.pow(r,2)+Math.pow(e,2))+10;this.initialSize=o,this.rippleScale="".concat((a+i)/o),this.rippleSize="".concat(o,"px")}},{key:"getNormalizedPointerEventCoords",value:function(t){var e=window,r=e.scrollX,n=e.scrollY,i=this.getBoundingClientRect(),o=r+i.left,a=n+i.top;return{x:t.pageX-o,y:t.pageY-a}}},{key:"getTranslationCoordinates",value:function(t){var e,r=this.getBoundingClientRect(),n=r.height,i=r.width,o={x:(i-this.initialSize)/2,y:(n-this.initialSize)/2};return{startPoint:e={x:(e=t instanceof PointerEvent?this.getNormalizedPointerEventCoords(t):{x:i/2,y:n/2}).x-this.initialSize/2,y:e.y-this.initialSize/2},endPoint:o}}},{key:"startPressAnimation",value:function(t){var e;if(this.mdRoot){this.pressed=!0,null===(e=this.growAnimation)||void 0===e||e.cancel(),this.determineRippleSize();var r=this.getTranslationCoordinates(t),n=r.startPoint,i=r.endPoint,o="".concat(n.x,"px, ").concat(n.y,"px"),a="".concat(i.x,"px, ").concat(i.y,"px");this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:["translate(".concat(o,") scale(1)"),"translate(".concat(a,") scale(").concat(this.rippleScale,")")]},{pseudoElement:"::after",duration:450,easing:C,fill:"forwards"})}}},{key:"endPressAnimation",value:(c=(0,h.Z)((0,l.Z)().mark((function t(){var e,r;return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.state=g.INACTIVE,e=this.growAnimation,r=1/0,"number"==typeof(null==e?void 0:e.currentTime)?r=e.currentTime:null!=e&&e.currentTime&&(r=e.currentTime.to("ms").value),!(r>=225)){t.next=7;break}return this.pressed=!1,t.abrupt("return");case 7:return t.next=9,new Promise((function(t){setTimeout(t,225-r)}));case 9:if(this.growAnimation===e){t.next=11;break}return t.abrupt("return");case 11:this.pressed=!1;case 12:case"end":return t.stop()}}),t,this)}))),function(){return c.apply(this,arguments)})},{key:"shouldReactToEvent",value:function(t){if(this.disabled||!t.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==t.pointerId)return!1;if("pointerenter"===t.type||"pointerleave"===t.type)return!this.isTouch(t);var e=1===t.buttons;return this.isTouch(t)||e}},{key:"inBounds",value:function(t){var e=t.x,r=t.y,n=this.getBoundingClientRect(),i=n.top,o=n.left,a=n.bottom,s=n.right;return e>=o&&e<=s&&r>=i&&r<=a}},{key:"isTouch",value:function(t){return"touch"===t.pointerType}},{key:"handleEvent",value:(r=(0,h.Z)((0,l.Z)().mark((function t(e){return(0,l.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.type,t.next="click"===t.t0?3:"contextmenu"===t.t0?5:"pointercancel"===t.t0?7:"pointerdown"===t.t0?9:"pointerenter"===t.t0?12:"pointerleave"===t.t0?14:"pointerup"===t.t0?16:18;break;case 3:return this.handleClick(),t.abrupt("break",19);case 5:return this.handleContextmenu(),t.abrupt("break",19);case 7:return this.handlePointercancel(e),t.abrupt("break",19);case 9:return t.next=11,this.handlePointerdown(e);case 11:case 18:return t.abrupt("break",19);case 12:return this.handlePointerenter(e),t.abrupt("break",19);case 14:return this.handlePointerleave(e),t.abrupt("break",19);case 16:return this.handlePointerup(e),t.abrupt("break",19);case 19:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"onControlChange",value:function(t,e){if(!m.sk)for(var r=0,n=w;r