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AAW,EAAE,GAC/B,GACL,CAEA,WAAA,GACE,OAAO,oBAAoB,UAAW,KAAK,aAC3C,KAAK,cAAc,UACrB,CAEA,YAAA,GACE,OAAO,oBAAoB,WAAY,KAAK,cAC5C,KAAK,cAAc,UACrB,CAEA,eAAA,GACE,IAAI,EAAS,KAAK,WAIlB,OAHI,aAAkB,aACpB,EAAS,EAAO,MAEX,CACT,CAEA,oBAAA,GACE,MAAM,EAAS,KAAK,kBAChB,IACG,KAAK,eACR,EAAO,oBAAoB,aAAc,KAAK,cAAc,YAC5D,EAAO,oBAAoB,aAAc,KAAK,cAAc,UAC5D,EAAO,oBAAoB,QAAS,KAAK,cAAc,YACvD,EAAO,oBAAoB,OAAQ,KAAK,cAAc,YAGvD,SAAW,EAAO,oBAAoB,YAAa,KAAK,eACzD,SAAW,EAAO,oBAAoB,aAAc,KAAK,eAAgB,CAAE,SAAS,KAGtF,SAAW,OAAO,oBAAoB,WAAY,KAAK,eACtD,SAAW,OAAO,oBAAoB,UAAW,KAAK,aAEvD,MAAM,sBACR,EAGF,eAAe,OAAO,YAAa,UAGnC,MAAM,aAAe,KACf,gBACF,aAAa,eACb,cAAgB,KAClB,EAEF,OAAO,iBAAiB,YAAa","file":"/npm/@dreamworld/dw-ripple@3.1.7/dw-ripple.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@dreamworld/dw-ripple@3.1.7/dw-ripple.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { css } from '@dreamworld/pwa-helpers/lit.js';\n\n// These are the mwc element needed by this element.\nimport { Ripple } from \"@material/mwc-ripple\";\nimport { RippleHandlers } from \"@material/mwc-ripple/ripple-handlers\";\nimport DeviceInfo from '@dreamworld/device-info';\n\nlet rippleTimeout;\nconst isTouch = DeviceInfo.info().touch;\n\nexport class DwRipple extends Ripple {\n  static get styles() {\n    return [\n      super.styles,\n      css`\n        :host([disabled]) {\n          --mdc-theme-on-surface: transparent;\n        }\n\n        :host([primary]) {\n          --mdc-theme-on-surface: var(--mdc-theme-primary);\n        }\n\n        :host([secondary]) {\n          --mdc-theme-on-surface: var(--mdc-theme-secondary);\n        }\n\n        .mdc-ripple-surface::before,\n        .mdc-ripple-surface::after {\n          background-color: var(--mdc-theme-on-surface, #000);\n        }\n\n        .mdc-ripple-surface {\n          border-radius: var(--mdc-ripple-border-radius, 0);\n        }\n      `,\n    ];\n  }\n\n  static get properties() {\n    return {\n      /**\n       * Set to `true` when ripple is to be shown in secondary color\n       */\n      secondary: { type: Boolean, reflect: true },\n\n      /**\n       * Set to `true` to disable hover and focus in.\n       */\n      disableHover: { type: Boolean },\n    };\n  }\n\n  constructor() {\n    super();\n    this.primary = false;\n    this.secondary = false;\n    this.disableHover = false;\n  }\n\n  connectedCallback() {\n    super.connectedCallback && super.connectedCallback();\n    this.__init();\n  }\n\n  __init() {\n    this._rippleHander = new RippleHandlers(async () => this);\n    const parent = this.__getParentNode();\n    this.__onMouseDown = this.__onMouseDown.bind(this);\n    this.__onTouchStart = this.__onTouchStart.bind(this);\n    this.__onMouseUp = this.__onMouseUp.bind(this);\n    this.__onTouchEnd = this.__onTouchEnd.bind(this);\n\n    if (!this.disableHover) {\n      parent.addEventListener(\"mouseenter\", this._rippleHander.startHover);\n      parent.addEventListener(\"mouseleave\", this._rippleHander.endHover);\n      parent.addEventListener(\"focus\", this._rippleHander.startFocus);\n      parent.addEventListener(\"blur\", this._rippleHander.endFocus);\n    }\n\n    !isTouch && parent.addEventListener(\"mousedown\", this.__onMouseDown);\n    isTouch && parent.addEventListener(\"touchstart\", this.__onTouchStart, { passive: true });\n  }\n\n  __onMouseDown(e) {\n    rippleTimeout = setTimeout(() => {\n      window.addEventListener(\"mouseup\", this.__onMouseUp);\n      this._rippleHander.startPress(e);\n    }, 50);\n  }\n\n  __onTouchStart(e) {\n    rippleTimeout = setTimeout(() => {\n      window.addEventListener(\"touchend\", this.__onTouchEnd);\n      this._rippleHander.startPress(e);\n    }, 50);\n  }\n\n  __onMouseUp() {\n    window.removeEventListener(\"mouseup\", this.__onMouseUp);\n    this._rippleHander.endPress();\n  }\n\n  __onTouchEnd() {\n    window.removeEventListener(\"touchend\", this.__onTouchEnd);\n    this._rippleHander.endPress();\n  }\n\n  __getParentNode() {\n    let parent = this.parentNode;\n    if (parent instanceof ShadowRoot) {\n      parent = parent.host;\n    }\n    return parent;\n  }\n\n  disconnectedCallback() {\n    const parent = this.__getParentNode();\n    if (parent) {\n      if (!this.disableHover) {\n        parent.removeEventListener(\"mouseenter\", this._rippleHander.startHover);\n        parent.removeEventListener(\"mouseleave\", this._rippleHander.endHover);\n        parent.removeEventListener(\"focus\", this._rippleHander.startFocus);\n        parent.removeEventListener(\"blur\", this._rippleHander.endFocus);\n      }\n\n      !isTouch && parent.removeEventListener(\"mousedown\", this.__onMouseDown);\n      isTouch && parent.removeEventListener(\"touchstart\", this.__onTouchStart, { passive: true });\n    }\n\n    isTouch && window.removeEventListener(\"touchend\", this.__onTouchEnd);\n    !isTouch && window.removeEventListener(\"mouseup\", this.__onMouseUp);\n\n    super.disconnectedCallback();\n  }\n}\n\ncustomElements.define(\"dw-ripple\", DwRipple);\n\n// Its prevent ripple in touch device while user is scrolling list.\nconst _onTouchMove = () => {\n  if (rippleTimeout) {\n    clearTimeout(rippleTimeout);\n    rippleTimeout = null;\n  }\n};\nwindow.addEventListener(\"touchmove\", _onTouchMove);\n"]}