{"version":3,"sources":["webpack:///./src/pages/Integrations/Apps/google_ads.vue?ab59","webpack:///./src/pages/Integrations/Apps/google_ads.vue?2483","webpack:///src/pages/Integrations/Apps/google_ads.vue","webpack:///./src/pages/Integrations/Apps/google_ads.vue?f1a9","webpack:///./src/pages/Integrations/Apps/google_ads.vue"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","on","buttonClick","_m","_v","staticRenderFns","attrs","component"],"mappings":"2IAAA,W,yCCAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,UAAU,CAACF,EAAG,MAAM,CAACE,YAAY,gBAAgBC,GAAG,CAAC,MAAQP,EAAIQ,cAAc,CAACR,EAAIS,GAAG,GAAGL,EAAG,MAAM,CAACE,YAAY,uBAAuB,CAACN,EAAIU,GAAG,8BACjQC,EAAkB,CAAC,WAAa,IAAIX,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,uBAAuB,CAACF,EAAG,MAAM,CAACQ,MAAM,CAAC,IAAM,gDAAgD,IAAM,4BCerO,G,UAAA,CACE,KAAF,SACE,MAAF,CACI,iBAAJ,CACM,KAAN,MACM,UAAN,GAEI,gBAAJ,CACM,KAAN,OACM,QAAN,KAGE,QAAF,CACI,YADJ,WAEM,IAAN,eACA,0CAAQ,OAAR,cACA,KACA,mGACA,iBADA,wCACA,qBADA,qCACA,cADA,gBAEA,wBACA,+BAEA,OACA,0BACA,WACA,GACY,EAAZ,kBACA,sCAGU,GAAV,EACU,cAAV,MAEA,IAEA,gBACA,cACU,GAAV,EACU,EAAV,QACU,EAAV,uCAEQ,OAAR,qCAEM,OAAN,kCC3DkX,I,wBCQ9WC,EAAY,eACd,EACAd,EACAY,GACA,EACA,KACA,WACA,MAIa,aAAAE,E","file":"js/chunk-192cd8c4.dec6843d.js","sourcesContent":["export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./google_ads.vue?vue&type=style&index=0&id=7e241d46&scoped=true&lang=scss&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"google\"},[_c('div',{staticClass:\"google-button\",on:{\"click\":_vm.buttonClick}},[_vm._m(0),_c('div',{staticClass:\"google-button__text\"},[_vm._v(\"Sign in with google\")])])])}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"google-button__icon\"},[_c('img',{attrs:{\"src\":\"/icons/pages/integrations/google_ads/icon.svg\",\"alt\":\"google button-icon\"}})])}]\n\nexport { render, staticRenderFns }","<template>\n    <div class=\"google\">\n        <div\n            class=\"google-button\"\n            @click=\"buttonClick\"\n        >\n            <div class=\"google-button__icon\"><img\n                src=\"/icons/pages/integrations/google_ads/icon.svg\"\n                alt=\"google button-icon\"\n            ></div>\n            <div class=\"google-button__text\">Sign in with google</div>\n        </div>\n    </div>\n</template>\n\n<script>\n    export default {\n        name: 'google',\n        props: {\n            integrationCards: {\n                type: Array,\n                required: true,\n            },\n            currentLocation: {\n                type: String,\n                default: '',\n            },\n        },\n        methods: {\n            buttonClick() {\n                const integrationType = 'google_ads';\n                const integration = this.integrationCards.find((card) => card.type === integrationType);\n                let closedByCode = false;\n                const popup = window.open(\n                    `https://accounts.google.com/o/oauth2/v2/auth?access_type=offline&client_id=${integration.data.client_id}&prompt=consent&redirect_uri=${this.currentLocation}&response_type=code&scope=${integration.data.scopes}&state=state`,\n                    'DescriptiveWindowName',\n                    'resizable,scrollbars,status',\n                );\n                const self = this;\n                const popupTick = setInterval(function () {\n                    if (popup.closed) {\n                        if (!closedByCode) {\n                            self.$toastr.longError(\n                                'Integration failed. Closed by user',\n                            );\n                        }\n                        closedByCode = false;\n                        clearInterval(popupTick);\n                    }\n                }, 50);\n                \n                const getPopupData = function (event) {\n                    if (event.data.code) {\n                        closedByCode = true;\n                        popup.close();\n                        self.$emit('addIntegration', event.data.code, integrationType);\n                    }\n                    window.removeEventListener('message', getPopupData, false);\n                };\n                window.addEventListener('message', getPopupData);\n            },\n        },\n    };\n</script>\n<style\n    scoped\n    lang=\"scss\"\n>\n    \n    .google {\n        align-self: flex-end;\n        &-button {\n            width: 210px;\n            height: 40px;\n            border: 1px solid black;\n            display: flex;\n            align-items: center;\n            border-radius: 10px;\n            justify-content: center;\n            cursor: pointer;\n            \n            &__icon {\n                img {\n                    height: 14px;\n                    padding-right: 8px;\n                }\n            }\n            &__text{\n                font-weight: bold;\n                font-size: 18px;\n            }\n        }\n    }\n</style>","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./google_ads.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./google_ads.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./google_ads.vue?vue&type=template&id=7e241d46&scoped=true&\"\nimport script from \"./google_ads.vue?vue&type=script&lang=js&\"\nexport * from \"./google_ads.vue?vue&type=script&lang=js&\"\nimport style0 from \"./google_ads.vue?vue&type=style&index=0&id=7e241d46&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n  script,\n  render,\n  staticRenderFns,\n  false,\n  null,\n  \"7e241d46\",\n  null\n  \n)\n\nexport default component.exports"],"sourceRoot":""}