{"version":3,"file":"compare-at-price-info-section-xxxxxxxxxxxxxxxxxxxx.min.js","mappings":"yBAOA,MAAMA,2BAA2BC,YAYxBC,WAAAA,GACLC,QAAQ,KAHFC,cAAgBC,KAAKC,gBAAgBC,KAAKF,MAIhDA,KAAKG,aAAa,CAAEC,KAAM,SAC1BJ,KAAKK,WAAWC,UAAY,UAAHC,OCtB7B,qWDsBgD,YAAAA,OErBrC,sYFsBT,CAEOC,iBAAAA,GACUR,KAAKK,WAAWI,cAAc,UACtCC,iBAAiB,QAASV,KAAKD,cACxC,CAEOY,oBAAAA,GACUX,KAAKK,WAAWI,cAAc,UACtCG,oBAAoB,QAASZ,KAAKD,cAC3C,CAEQE,eAAAA,CAAgBY,GAEtB,MAAMC,EAAiB,IAAIC,YAAoB,mCAAoC,CACjFC,OAAQ,CAAEC,QAASjB,KAAKkB,QAAQD,WAElCE,cAAcL,EAChB,EASGM,eAAeC,IAAI,0BACtBD,eAAeE,OAAO,wBAAyB3B,mB","sources":["webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.ts","webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.scss","webpack://lange/./scripts/sections/compare-at-price-info/compare-at-price-info/index.html"],"sourcesContent":["import { CustomElement } from '@integrabeauty/custom-elements';\nimport html from './index.html';\nimport styles from './index.scss';\n\n/**\n * Renders a button which, when clicked, requests showing the compare at price modal.\n */\nclass CompareAtPriceInfo extends HTMLElement implements CustomElement {\n  readonly dataset!: {\n    /**\n     * Content to be displayed in the compare at price modal for a particular variant\n     */\n    content: string;\n  };\n\n  public shadowRoot!: ShadowRoot;\n\n  private onButtonBound = this.onButtonClicked.bind(this);\n\n  public constructor() {\n    super();\n    this.attachShadow({ mode: 'open' });\n    this.shadowRoot.innerHTML = `<style>${styles}</style>${html}`;\n  }\n\n  public connectedCallback() {\n    const anchor = this.shadowRoot.querySelector('button');\n    anchor.addEventListener('click', this.onButtonBound);\n  }\n\n  public disconnectedCallback() {\n    const anchor = this.shadowRoot.querySelector('button');\n    anchor.removeEventListener('click', this.onButtonBound);\n  }\n\n  private onButtonClicked(_event: Event) {\n    type Detail = WindowEventMap['compare-at-price-modal-requested']['detail'];\n    const modalShowEvent = new CustomEvent<Detail>('compare-at-price-modal-requested', {\n      detail: { content: this.dataset.content }\n    });\n    dispatchEvent(modalShowEvent);\n  }\n}\n\ndeclare global {\n  interface HTMLElementTagNameMap {\n    'compare-at-price-info': CompareAtPriceInfo;\n  }\n}\n\nif (!customElements.get('compare-at-price-info')) {\n  customElements.define('compare-at-price-info', CompareAtPriceInfo);\n}\n","export default \":host{display:inline-block}button{appearance:none;background-color:#0000;border:none;color:inherit;cursor:pointer;display:block;padding:0;position:relative}button:after{content:\\\"\\\";height:200%;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:200%}svg{color:inherit;display:block;height:14px;width:14px;stroke:currentColor}\";","// Module\nvar code = \"<button aria-label=\\\"See details about the compare at price\\\"><svg width=\\\"24\\\" height=\\\"24\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\"><path d=\\\"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z\\\" stroke-width=\\\"1.5\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"></path></svg></button>\";\n// Exports\nexport default code;"],"names":["CompareAtPriceInfo","HTMLElement","constructor","super","onButtonBound","this","onButtonClicked","bind","attachShadow","mode","shadowRoot","innerHTML","concat","connectedCallback","querySelector","addEventListener","disconnectedCallback","removeEventListener","_event","modalShowEvent","CustomEvent","detail","content","dataset","dispatchEvent","customElements","get","define"],"sourceRoot":""}