{"version":3,"sources":["webpack://fair-labour/./assets/components/complains/js/complains.component.js","webpack://fair-labour/./assets/components/complains/js/documents.component.js","webpack://fair-labour/./assets/components/complains/index.js"],"names":["ComplainsComponent","_DcBaseComponent","_inherits","_super","_classCallCheck","apply","arguments","key","value","tooltip","this","element","getAttribute","tippy","content","theme","DcBaseComponent","DocumentsComponent","_this","_len","length","args","Array","_key","call","concat","_isActive","isClickInside","_onClickTrigger","bind","_assertThisInitialized","_onClickOutside","open","hide","_this2","eventBus","addListener","document","event","refs","btn","contains","target","which","isExperienceEditor","dropdown","classList","add","remove","dcFactory"],"mappings":"spCAG0C,IAErBA,EAAkB,SAAAC,I,qRAAAC,CAAAF,EAAAC,GAAA,I,UAAAE,G,EAAAH,E,qrBAAA,SAAAA,IAAA,O,4FAAAI,CAAA,KAAAJ,GAAAG,EAAAE,MAAA,KAAAC,UAAA,CAGlC,O,EAHkCN,E,EAalC,EAAAO,IAAA,eAAAC,MAZD,WACI,MAAO,UACX,K,EAHmC,EAAAD,IAAA,SAAAC,MAKnC,WACI,IAAMC,EAAUC,KAAKC,QAAQC,aAAa,eAC1B,OAAZH,GAAgC,KAAZA,IACpBI,QAAMH,KAAKC,QAAS,CAChBG,QAASJ,KAAKC,QAAQC,aAAa,eACnCG,MAAO,gBAGnB,M,8EAVCf,CAAA,CAHkC,CAASgB,M,8iCCJM,IAEjCC,EAAkB,SAAAhB,I,qRAAAC,CAAAe,EAAAhB,GAAA,I,UAAAE,G,EAAAc,E,6jBACnC,SAAAA,IAAqB,IAAAC,G,4FAAAd,CAAA,KAAAa,GAAA,QAAAE,EAAAb,UAAAc,OAANC,EAAI,IAAAC,MAAAH,GAAAI,EAAA,EAAAA,EAAAJ,EAAAI,IAAJF,EAAIE,GAAAjB,UAAAiB,GAOkB,OANjCL,EAAAf,EAAAqB,KAAAnB,MAAAF,EAAA,OAAAsB,OAASJ,KACJK,WAAY,EACjBR,EAAKS,eAAgB,EACrBT,EAAKU,gBAAkBV,EAAKU,gB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"complains.ab3f04ed4a9eaef10899.js","sourcesContent":["import { DcBaseComponent } from '@deleteagency/dc';\nimport tippy from 'tippy.js';\nimport 'tippy.js/dist/tippy.css';\nimport 'tippy.js/themes/light-border.css';\n\nexport default class ComplainsComponent extends DcBaseComponent {\n static getNamespace() {\n return 'complain';\n }\n\n onInit() {\n const tooltip = this.element.getAttribute('data-status');\n if (tooltip !== null && tooltip !== '') {\n tippy(this.element, {\n content: this.element.getAttribute('data-status'),\n theme: 'light-border',\n });\n }\n }\n}\n","import { DcBaseComponent } from '@deleteagency/dc';\nimport { eventBus } from '../../../project/event-bus';\n\nexport default class DocumentsComponent extends DcBaseComponent {\n constructor(...args) {\n super(...args);\n this._isActive = false;\n this.isClickInside = false;\n this._onClickTrigger = this._onClickTrigger.bind(this);\n this._onClickOutside = this._onClickOutside.bind(this);\n this.open = this.open.bind(this);\n this.hide = this.hide.bind(this);\n }\n\n static getNamespace() {\n return 'document';\n }\n\n static getRequiredRefs() {\n return ['btn', 'dropdown'];\n }\n\n onInit() {\n eventBus.addListener('closeAllDropdowns', () => {\n this.hide();\n });\n this.addListener(document, 'click', (event) => this._onClickOutside(event));\n }\n\n _onClickOutside(event) {\n this.isClickInside = this.refs.btn.contains(event.target);\n if (this.isClickInside) {\n if (this._isActive) {\n this.hide();\n } else {\n eventBus.emit('closeAllDropdowns');\n this.open();\n }\n } else {\n this.hide();\n }\n }\n\n _onClickTrigger() {\n if (this._isActive) {\n this.hide();\n } else {\n eventBus.emit('closeAllDropdowns');\n this.open();\n }\n }\n\n _onKeydownTrigger(event) {\n const keyCode = event.which;\n\n switch (keyCode) {\n case 13:\n case 32:\n if (!this.isExperienceEditor) {\n this._onClickTrigger(event);\n }\n break;\n default:\n break;\n }\n }\n\n open() {\n this.refs.dropdown.classList.add('is-visible');\n this._isActive = true;\n }\n\n hide() {\n this.refs.dropdown.classList.remove('is-visible');\n this._isActive = false;\n }\n}\n","import './scss/index.scss';\n\nimport { dcFactory } from '@deleteagency/dc';\nimport ComplainsComponent from './js/complains.component';\nimport DocumentsComponent from './js/documents.component';\n\ndcFactory.register(ComplainsComponent);\ndcFactory.register(DocumentsComponent);\n"],"sourceRoot":""}