1 line
34 KiB
JavaScript
1 line
34 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["settingsOnBoarding"],{"0986":function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,'li[data-v-1057e962]:not(:last-child):after{content:"";position:absolute;border-right-width:2px;border-style:dashed;--tw-border-opacity:1;border-color:rgba(209,213,219,var(--tw-border-opacity));top:6rem;left:2.1rem;height:calc(100% - 70px)}',""]),t.exports=e},"0ff7":function(t,e,s){"use strict";s.r(e);var o=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"pt-2"},[s("ConfigurationBanner",{staticClass:"mb-4",attrs:{app:t.app}}),s("section",[s("div",{staticClass:"tw-container m-auto p-0"},[s("PsAccounts",{attrs:{"force-show-plans":!0},scopedSlots:t._u([{key:"body",fn:function(){return[s("div",{staticClass:"mt-4"},[s("DataSource",{attrs:{"google-linked":t.googleLinked,"google-linked-url":t.googleLinkedUrl,"shop-url":t.shopUrl,"google-account-selected":t.googleAccountSelected,"google-accounts-list":t.googleAccountsList,"loading-list-property":t.loadingPropertyList}})],1)]},proxy:!0}])})],1)])],1)},a=[],n=s("5530"),i=(s("b64b"),function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ErrorBoundary",[o("DataSteps",[o("DataStep",{attrs:{state:this.$store.getters.psAccountsIsOnboarded}},[o("b-card",{attrs:{"no-body":""}},[o("b-card-body",[o("div",{staticClass:"d-flex tw-items-center"},[o("span",{staticClass:"material-icons tw-text-gray-500 tw-text-4xl tw-pr-4"},[t._v("store")]),o("div",{staticClass:"sourceTitle"},[t._v(t._s(t.shopUrl))])]),o("div",{staticClass:"description tw-pt-2"},[t._v(" "+t._s(t.$t("configure.dataSources.shop.description"))+" ")]),o("div",{staticClass:"tw-flex tw-items-center tw-pt-4 tw-text-gray-400"},[o("div",[t._v(t._s(t.$t("configure.dataSources.syncStatus"))+" :")]),o("div",{staticClass:"tw-bg-transparent tw-uppercase tw-text-xs tw-border tw-border-pspink tw-text-pspink tw-font-bold tw-py-1 tw-px-2 tw-mx-4 tw-rounded-full"},[t._v(" "+t._s(t.$t("configure.dataSources.comingSoon"))+" ")])]),o("div",[o("b-button",{staticClass:"tw-p-0 tw-text-sm",attrs:{variant:"link"},on:{click:function(e){return t.$router.push("/settings/help")}}},[t._v(" "+t._s(t.$t("configure.dataSources.knowMore"))+" "),o("i",{staticClass:"material-icons"},[t._v("arrow_forward")])])],1)])],1)],1),o("DataStep",{attrs:{state:this.$store.getters.gaIsOnboarded}},[o("b-card",{attrs:{"no-body":""}},[o("b-card-body",[o("div",{staticClass:"tw-flex tw-items-end tw-mb-6"},[o("div",{staticClass:"tw-pr-4"},[o("img",{attrs:{width:"32",src:s("88ca")}})]),o("div",{staticClass:"sourceTitle"},[t._v("Google Analytics")])]),t.googleLinked&&!t.loadingListProperty||t.errorConnectGoogle&&!t.loadingListProperty?o("GoogleTagAlert",{attrs:{status:t.googleAccountStatus}}):t._e(),o("div",{staticClass:"tw-flex",class:{"tw-flex-col":t.googleLinked,"tw-items-center":!t.googleLinked}},[o("div",{staticClass:"tw-flex-grow description"},[t._v(" "+t._s(t.$t("configure.dataSources.subTitle"))+" ")]),t.googleLinked?o("div",{staticClass:"account-data tw-mt-4"},[this.$store.state.settings.state.loadingAvailableGoogleTag||this.$store.state.settings.state.loadingLogout||this.$store.state.settings.state.loadingSelectAccountAnalytics||this.$store.state.settings.state.loadingRefreshGA||this.loadingListProperty?o("section",[o("SettingsGoogleAnalyticsSkeleton")],1):o("p",{staticClass:"d-flex"},[o("b-col",{staticClass:"email",attrs:{sm:4,md:4,lg:4}},[Object.keys(t.googleAccountsList).length>0&&t.googleAccountSelected.hasOwnProperty("webPropertyId")||Object.keys(this.googleAccountsList).length>0&&!t.googleAccountSelected.hasOwnProperty("webPropertyId")?o("div",[t._v(" "+t._s(t.googleAccountSelected.username)+" "),o("span",{staticClass:"chevron"},[t._v(">")])]):t._e(),o("div",{staticClass:"pt-3"},[o("b-button",{staticClass:"p-0",attrs:{variant:"link"},on:{click:function(e){return e.preventDefault(),t.trackChangeAccountGoogle(e)}}},[t._v(t._s(t.$t("configure.dataSources.googleAnalytics.useAnotherAccount")))])],1),o("div",[o("b-button",{staticClass:"p-0",attrs:{variant:"link","data-toggle":"modal","data-target":"#confirm-modal"}},[t._v(t._s(t.$t("configure.dataSources.googleAnalytics.logOut")))]),o("div",{ref:"confirm-modal",staticClass:"modal",attrs:{id:"confirm-modal","aria-hidden":"true"}},[o("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[o("div",{staticClass:"modal-content tw-rounded-none"},[o("div",{staticClass:"modal-header"},[o("img",{staticClass:"tw-w-48",attrs:{src:s("3875")}}),o("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[o("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])]),o("div",{staticClass:"modal-body"},[o("span",{staticClass:"title tw-text-center"},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.logOutModal.title"))+" ")])]),o("div",{staticClass:"modal-footer"},[o("b-button",{attrs:{"data-dismiss":"modal",variant:"outline-secondary"}},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.logOutModal.cancel")))]),o("b-button",{attrs:{"data-dismiss":"modal",variant:"primary"},on:{click:t.getLogOutHandler}},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.logOutModal.confirm")))])],1)])])])],1)]),o("b-col",{staticClass:"account",attrs:{sm:3,md:8,lg:8}},[Object.keys(t.googleAccountsList).length>0&&t.googleAccountSelected.hasOwnProperty("webPropertyId")?o("div",[t._v(" "+t._s(t.googleAccountSelected.webPropertyName)+" "),o("span",{staticClass:"tag"},[t._v(t._s(t.googleAccountSelected.webPropertyId))])]):Object.keys(t.googleAccountsList).length>0&&!t.googleAccountSelected.hasOwnProperty("webPropertyId")?o("div",[t._v(" No tag property selected ")]):o("div",[t._v(" No tag property on your google analytics accounts ")]),o("div",{staticClass:"pt-3"},[Object.keys(t.googleAccountsList).length>0&&t.googleAccountSelected.hasOwnProperty("webPropertyId")||Object.keys(t.googleAccountsList).length>0&&!t.googleAccountSelected.hasOwnProperty("webPropertyId")?o("ModalAccountList",{attrs:{"google-account":t.googleAccountSelected,"google-accounts-list":t.googleAccountsList},on:{accountSelected:function(e){return t.checkIfSelectedTagIsPresent(e)}}}):o("b-button",{attrs:{variant:"link"},on:{click:function(e){return e.preventDefault(),t.refreshAccountGoogle()}}},[t._v(" Refresh Account ")])],1)])],1)]):t._e(),!t.googleLinked&&t.accountConnected?o("div",[o("b-button",{attrs:{variant:"primary"},on:{click:function(e){return e.preventDefault(),t.onTrackConnectGoogleAnalytics()}}},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.connectGoogleAnalytics"))+" ")])],1):t._e()])],1)],1)],1)],1)],1)}),r=[],c=s("cebc"),l=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{attrs:{id:"settings-modal"}},[s("b-button",{staticClass:"p-0",attrs:{variant:"link","data-toggle":"modal","data-target":"#metrics-modal"},on:{click:function(e){return e.preventDefault(),t.trackAndShowModal()}}},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.changeGaProperties"))+" ")]),s("div",{ref:"metrics-modal",staticClass:"modal",attrs:{id:"metrics-modal","aria-hidden":"true"}},[s("div",{staticClass:"modal-dialog",attrs:{role:"document"}},[s("div",{staticClass:"modal-content tw-rounded-none"},[t._m(0),s("div",{staticClass:"modal-body"},[s("div",{staticClass:"tw-text-center"},[s("h1",{},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.modal.title"))+" ")]),s("h3",[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.modal.subTitle"))+" ")]),s("b-button",{staticClass:"tw-no-underline tw-cursor-default tw-pb-6",attrs:{variant:"link"}},[t._v(" "+t._s(this.$store.state.settings.googleUserName)+" ")])],1),s("b-input-group",{scopedSlots:t._u([{key:"prepend",fn:function(){return[s("b-input-group-text",[s("i",{staticClass:"material-icons tw-text-gray-700 tw-text-lg"},[t._v("search")])])]},proxy:!0}])},[s("b-form-input",{attrs:{placeholder:"Search your Google Analytics property"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleSubmit(e)}},model:{value:t.input,callback:function(e){t.input=e},expression:"input"}})],1),0!==t.googleAccountsListCopy.length?s("div",{staticClass:"tw-flex tw-py-4",attrs:{id:"accounts-list"}},[s("b-form",{staticClass:"tw-m-auto"},t._l(t.googleAccountsListCopy,(function(e){return s("b-form-group",{key:e.webPropertyId,staticClass:"tw-boder tw-border-blue-700",class:t.selected.webPropertyId===e.webPropertyId?"checked":""},[s("b-form-radio",{attrs:{name:"account-check",value:{webPropertyId:e.webPropertyId,viewId:e.view_id,webPropertyName:e.webPropertyName,username:e.username},model:t.selected,checked:e.selected?e.webPropertyId:""},model:{value:t.selected,callback:function(e){t.selected=e},expression:"selected"}},[s("div",{staticClass:"tw-py-6 tw-px-16 tw-cursor-pointer"},[s("div",{staticClass:"tw-text-base tw-font-semibold"},[t._v(" "+t._s(e.webPropertyName.length>25?e.webPropertyName.substr(0,20)+"...":e.webPropertyName)+" ")]),s("div",{staticClass:"tw-text-sm tw-text-gray-600"},[t._v(" "+t._s(e.webPropertyId)+" ")])])])],1)})),1)],1):s("b-alert",{staticClass:"tw-mt-6",attrs:{variant:"info",show:""}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.modal.notFoundedTag"))+" ")])])],1),s("div",{staticClass:"modal-footer"},[t._t("footer",[s("b-button",{attrs:{variant:"primary","data-dismiss":"modal",disabled:0===t.googleAccountsListCopy.length},on:{click:function(e){return t.selectAccountAnalyticsHandler()}}},[t._v(" "+t._s(t.$t("configure.dataSources.googleAnalytics.modal.selectTag"))+" ")])])],2)])])])],1)},d=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"modal-header"},[o("img",{staticClass:"tw-w-48",attrs:{src:s("3875")}}),o("button",{staticClass:"close",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"}},[o("span",{attrs:{"aria-hidden":"true"}},[t._v("×")])])])}],u=(s("4de4"),s("caad"),s("2532"),s("5319"),s("ac1f"),s("99af"),s("841c"),s("2ef0")),g={name:"Modal",props:{googleAccountsList:{type:Object,default:function(){return[]}},googleAccount:{type:Object,default:function(){}}},data:function(){return{input:"",selected:{},googleAccountsListCopy:[]}},created:function(){this.googleAccount!=={}&&(this.selected={webPropertyId:this.googleAccount.webPropertyId,viewId:this.googleAccount.view_id,webPropertyName:this.googleAccount.webPropertyName,username:this.googleAccount.username}),this.googleAccountsListCopy=this.googleAccountsListFiltered},methods:Object(n["a"])(Object(n["a"])({},Object(c["c"])({selectAccountAnalytics:"selectAccountAnalytics"})),{},{trackAndShowModal:function(){this.$segment.track("show modal webproperty",{module:"ps_metrics"})},selectAccountAnalyticsHandler:function(){document.body.classList.remove("modal-open"),this.googleAccount!=={}&&this.selected.webPropertyId!==this.googleAccount.webPropertyId&&this.$segment.track("manual change property",{module:"ps_metrics"}),this.selectAccountAnalytics(this.selected),this.$emit("accountSelected",this.selected)},search:function(t){if(t.length<1)this.googleAccountsListCopy=this.googleAccountsListFiltered;else{var e=this.googleAccountsListFiltered.filter((function(e){return e.webPropertyName.toLowerCase().replace(" ","").includes(t.toLowerCase().replace(" ",""))}));this.googleAccountsListCopy=e}},getResultValue:function(t){return"".concat(t.webPropertyName," > ").concat(t.webPropertyId)},handleSubmit:function(){0!==this.googleAccountsListCopy[0].length&&(this.selected={webPropertyId:this.googleAccountsListCopy[0].webPropertyId,viewId:this.googleAccountsListCopy[0].view_id,webPropertyName:this.googleAccountsListCopy[0].webPropertyName,username:this.googleAccountsListCopy[0].username})}}),computed:{googleAccountsListFiltered:{get:function(){return Object(u["filter"])(this.googleAccountsList,(function(t,e){if(""!==e)return Object.assign(t,{webPropertyId:e})}))}}},watch:{input:function(t){this.search(t)}}},p=g,h=(s("8b59"),s("2877")),f=Object(h["a"])(p,l,d,!1,null,null,null),m=f.exports,b=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"tw-container m-auto p-0",attrs:{id:"data-source"}},[s("b-card",{staticClass:"tw-mb-1",attrs:{id:"data-source-card","no-body":""},scopedSlots:t._u([{key:"header",fn:function(){return[s("span",{staticClass:"tw-flex tw-items-center tw-text-lg"},[t.psAccountsIsOnboarded&&t.gaIsOnboarded?[s("Bullet",{staticClass:"tw-mr-4",attrs:{checked:!0}})]:[t._v(" 2. ")],t._v(" "+t._s(t.$t("configure.dataSources.title"))+" ")],2)]},proxy:!0}])},[s("b-card-body",[s("div",{staticClass:"tw-flex tw-items-center"},[s("div",{staticClass:"tw-flex-grow"},[t.gaIsOnboarded?[t._v(" "+t._s(t.$t("configure.dataSources.allSourcesConnected"))+" ")]:[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.firstSourceConnected1"))+" "),s("b-link",{attrs:{href:t.linkDashboard}},[t._v(" "+t._s(t.$t("configure.dataSources.firstSourceConnected2"))+", ")]),t._v(" "+t._s(t.$t("configure.dataSources.firstSourceConnected3"))+" ")],1)]],2),t.psAccountsIsOnboarded&&t.gaIsOnboarded?s("div",[s("b-button",{attrs:{variant:"primary",href:t.linkDashboard}},[t._v(" Open dashboard ")])],1):t._e()])])],1)],1),s("ul",{staticClass:"tw-flex tw-flex-col tw-justify-between stepper-vertical"},[t._t("default")],2)])},w=[],y=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"bullet",class:{checked:t.checked}},[s("span",{staticClass:"material-icons tw-text-base tw-text-white tw-font-bold"},[t.checked?[t._v(" done ")]:[t._v(" subdirectory_arrow_right ")]],2)])},v=[],_={name:"Bullet",props:{checked:{type:Boolean,required:!1,default:!1}}},A=_,k=(s("28be"),Object(h["a"])(A,y,v,!1,null,"45124460",null)),x=k.exports,S={name:"DataSteps",components:{Bullet:x},computed:{psAccountsIsOnboarded:function(){return this.$store.getters.psAccountsIsOnboarded},gaIsOnboarded:function(){return this.$store.getters.gaIsOnboarded},linkDashboard:function(){return this.$store.state.settings.linkDashboard}}},C=S,O=Object(h["a"])(C,b,w,!1,null,null,null),L=O.exports,$=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("li",{staticClass:"tw-relative"},[s("a",{staticClass:"tw-flex tw-self-start tw-px-6 tw-py-1 tw-pr-0"},[s("Bullet",{staticClass:"tw-mr-3 tw-mt-10",attrs:{checked:this.state}}),s("div",{staticClass:"tw-flex-grow tw-ml-6"},[t._t("default")],2)],1)])},I=[],P={name:"DataStep",components:{Bullet:x},props:{state:{type:Boolean,required:!0}}},G=P,T=(s("98cc"),Object(h["a"])(G,$,I,!1,null,"1057e962",null)),M=T.exports,D=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentLoader",{attrs:{width:"400",height:"80"}},[s("rect",{attrs:{x:"48",y:"8",rx:"3",ry:"3",width:"88",height:"6"}}),s("rect",{attrs:{x:"49",y:"21",rx:"3",ry:"3",width:"63",height:"5"}}),s("rect",{attrs:{x:"144",y:"9",rx:"3",ry:"3",width:"60",height:"4"}}),s("rect",{attrs:{x:"48",y:"32",rx:"3",ry:"3",width:"63",height:"5"}}),s("rect",{attrs:{x:"145",y:"24",rx:"3",ry:"3",width:"63",height:"5"}})])},N=[],j=s("e330"),E={name:"SettingsGoogleAnalyticsSkeleton",components:{ContentLoader:j["a"]}},B=E,R=Object(h["a"])(B,D,N,!1,null,"1a6cf44a",null),F=R.exports,U=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",["NO_TAG_AVAILABLE"===t.status?s("b-alert",{attrs:{variant:"info",show:"show"}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.noTagAvailable.message"))+" "),s("InstallSkeleton",{attrs:{loading:this.$store.state.settings.state.loadingInstallModuleGA}}),this.$store.state.settings.state.loadingInstallModuleGA?t._e():[this.$store.state.app.isShop17&&!t.gaModuleIsConfigurable?s("b-link",{attrs:{target:"_blank"},on:{click:function(e){return e.preventDefault(),t.installModule()}}},[t._v(" "+t._s(t.textInstallModule)+" ")]):s("b-link",{attrs:{href:t.linkModuleGA,target:"_blank"}},[t._v(" "+t._s(t.textInstallModule)+" ")])]],2)]):t._e(),"NOT_LINKED"===t.status?s("b-alert",{attrs:{variant:"danger",show:"show"}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.notLinked.message"))+" "),s("router-link",{attrs:{to:"/settings/help"}},[t._v(t._s(t.$t("configure.dataSources.alert.notLinked.link"))+" ")])],1)]):t._e(),"NO_CORRESPONDING_TAG_FOUND"===t.status?s("b-alert",{attrs:{variant:"danger",show:"show"}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.noCorrespondingTag.message"))+" "),s("router-link",{attrs:{to:"/settings/help"}},[t._v(t._s(t.$t("configure.dataSources.alert.noCorrespondingTag.link"))+" ")])],1)]):t._e(),"ERROR_GOOGLE"===t.status?s("b-alert",{attrs:{variant:"danger",show:"show"}},["NO_ACCOUNT"===t.codeGoogle?s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.errorGoogle.message"))+" "),s("router-link",{attrs:{to:"/settings/help"}},[t._v(" "+t._s(t.$t("configure.dataSources.alert.errorGoogle.link"))+" ")])],1):s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.errorGoogle.messageError")+" (code: "+t.codeGoogle+")")+" "),s("router-link",{attrs:{to:"/settings/help"}},[t._v(" "+t._s(t.$t("configure.dataSources.alert.errorGoogle.link"))+" ")])],1)]):t._e(),"NO_TAG_GOOGLE"===t.status?s("b-alert",{attrs:{variant:"danger",show:"show"}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.noTag.message"))+" "),s("router-link",{attrs:{to:"/settings/help"}},[t._v(" "+t._s(t.$t("configure.dataSources.alert.noTag.link"))+" ")])],1)]):t._e(),"LINKED"===t.status?s("b-alert",{attrs:{variant:"success",show:"show",dismissible:""}},[s("p",[t._v(" "+t._s(t.$t("configure.dataSources.alert.linked.message"))+" "),s("b-link",{attrs:{href:this.$store.state.settings.linkDashboard}},[t._v(" "+t._s(t.$t("configure.dataSources.alert.linked.link"))+" ")])],1)]):t._e()],1)},z=[],K=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],staticClass:"v-spinner",style:{position:"relative",fontSize:0}},[s("div",{staticClass:"v-pacman v-pacman1",style:t.spinnerStyle1}),s("div",{staticClass:"v-pacman v-pacman2",style:[t.spinnerStyle,t.animationStyle,t.spinnerDelay2]}),s("div",{staticClass:"v-pacman v-pacman3",style:[t.spinnerStyle,t.animationStyle,t.spinnerDelay3]}),s("div",{staticClass:"v-pacman v-pacman4",style:[t.spinnerStyle,t.animationStyle,t.spinnerDelay4]}),s("div",{staticClass:"v-pacman v-pacman5",style:[t.spinnerStyle,t.animationStyle,t.spinnerDelay5]})])},V=[],H={name:"InstallSkeleton",props:{loading:{type:Boolean,default:!0},color:{type:String,default:"#25b9d7"},size:{type:String,default:"10px"},margin:{type:String,default:"2px"},radius:{type:String,default:"100%"}},data:function(){return{spinnerDelay2:{animationDelay:"0.25s"},spinnerDelay3:{animationDelay:"0.50s"},spinnerDelay4:{animationDelay:"0.75s"},spinnerDelay5:{animationDelay:"1s"}}},computed:{spinnerStyle:function(){return{backgroundColor:this.color,width:this.size,height:this.size,margin:this.margin,borderRadius:this.radius}},border1:function(){return"".concat(this.size," solid transparent")},border2:function(){return"".concat(this.size," solid ").concat(this.color)},spinnerStyle1:function(){return{width:0,height:0,borderTop:this.border2,borderRight:this.border1,borderBottom:this.border2,borderLeft:this.border2,borderRadius:this.size}},animationStyle:function(){return{width:"5px",height:"5px",transform:"translate(0, ".concat(-parseFloat(this.size)/4,"px)"),position:"absolute",top:"10px",left:"100px",animationName:"v-pacmanStretchDelay",animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationFillMode:"both"}}}},J=H,q=(s("686e"),Object(h["a"])(J,K,V,!1,null,null,null)),Q=q.exports,W={name:"GoogleTagAlert",components:{InstallSkeleton:Q},props:{status:{type:String,required:!0},codeGoogle:{type:String,default:""}},created:function(){switch(this.status){case"LINKED":this.$segment.track("config auto success",{module:"ps_metrics"});break;case"NO_TAG_AVAILABLE":this.$segment.track("no property in shop",{module:"ps_metrics"});break;case"NOT_LINKED":this.$segment.track("config auto impossible, wrong ga accounts",{module:"ps_metrics"});break;case"NO_CORRESPONDING_TAG_FOUND":this.$segment.track("wrong webproperty",{module:"ps_metrics"});break;case"ERROR_GOOGLE":this.$segment.track("no analytics account or error google",{module:"ps_metrics"});break;case"NO_TAG_GOOGLE":this.$segment.track("no property in account",{module:"ps_metrics"});break;default:break}},methods:Object(n["a"])(Object(n["a"])({},Object(c["c"])({installModuleGA:"installModuleGA"})),{},{installModule:function(){this.installModuleGA(this.linkModuleGA)}}),computed:{linkModuleGA:function(){return this.$store.state.settings.gaModule.isInstalled?this.$store.state.settings.gaModule.isEnabled?this.$store.state.settings.gaModule.configLink:this.$store.state.settings.gaModule.enableLink:this.$store.state.settings.gaModule.installLink},textInstallModule:function(){return this.$store.state.settings.gaModule.isInstalled?this.$store.state.settings.gaModule.isEnabled?this.$t("configure.dataSources.alert.noTagAvailable.linkConfigure"):this.$t("configure.dataSources.alert.noTagAvailable.linkEnable"):this.$t("configure.dataSources.alert.noTagAvailable.linkInstall")},gaModuleIsConfigurable:function(){return this.$store.state.settings.gaModule.isInstalled&&this.$store.state.settings.gaModule.isEnabled}}},X=W,Y=Object(h["a"])(X,U,z,!1,null,null,null),Z=Y.exports,tt={name:"DataSource",components:{ModalAccountList:m,GoogleTagAlert:Z,SettingsGoogleAnalyticsSkeleton:F,DataSteps:L,DataStep:M},data:function(){return{googleAccountStatus:""}},props:{connectedAccount:{type:Boolean,default:!1},googleLinked:{type:Boolean,default:!1},googleLinkedUrl:{type:String,default:""},shopUrl:{type:String,default:""},googleAccountSelected:{type:Object,default:function(){}},logoutLink:{type:String,default:""},googleAccountsList:{type:Object,default:function(){}},loadingListProperty:{type:Boolean,default:!0}},created:function(){this.loadingListProperty||this.firstAccess(),this.accountConnected&&!this.googleLinked&&this.initBillingFree()},computed:{googleTagLinked:function(){return this.googleLinked&&this.googleAccountSelected.hasOwnProperty("webPropertyId")},accountConnected:function(){return this.$store.getters.psAccountsIsOnboarded},errorConnectGoogle:function(){return""!==this.$store.state.settings.oAuthGoogleErrorMessage&&"null"!==this.$store.state.settings.oAuthGoogleErrorMessage}},watch:{googleAccountsList:function(t){this.googleAccountsList=t,this.firstAccess()},loadingListProperty:function(t){this.loadingListProperty=t}},methods:Object(n["a"])(Object(n["a"])({},Object(c["c"])({getLogOut:"getLogOut",selectAccountAnalytics:"selectAccountAnalytics",getAvailableGoogleTags:"getAvailableGoogleTags",refreshAccount:"refreshAnalyticsAccount",initBillingFree:"initBillingFree"})),{},{firstAccess:function(){window.analytics&&(this.accountConnected&&!this.googleLinked&&this.$segment.track("Step 2 available",{module:"ps_metrics"}),Object.keys(this.googleAccountsList).length>1?this.$segment.track("several google properties",{module:"ps_metrics"}):1===Object.keys(this.googleAccountsList).length&&this.$segment.track("one google properties",{module:"ps_metrics"})),this.errorConnectGoogle&&(this.googleAccountStatus="ERROR_GOOGLE"),Object.keys(this.googleAccountsList).length>0&&this.googleAccountSelected.hasOwnProperty("webPropertyId")||Object.keys(this.googleAccountsList).length>0&&!this.googleAccountSelected.hasOwnProperty("webPropertyId")?this.linkGoogleTag():this.googleLinked&&(this.googleAccountStatus="NO_TAG_GOOGLE")},checkIfSelectedTagIsPresent:function(t){if(this.getAvailableGoogleTags(),0===this.$store.state.settings.GTAAvailable.length&&0===this.$store.state.settings.GTMAvailable.length&&this.googleLinked)this.googleAccountStatus="NO_TAG_AVAILABLE";else{var e=this.$store.state.settings.GTAAvailable.indexOf(t.webPropertyId),s=Object(u["intersection"])(this.$store.state.settings.GTAAvailable,Object.keys(this.googleAccountsList));-1!==e?this.googleAccountStatus="LINKED":s.length>0?this.googleAccountStatus="NO_CORRESPONDING_TAG_FOUND":this.googleAccountStatus="NOT_LINKED"}},linkGoogleTag:function(){if(0===this.$store.state.settings.GTAAvailable.length&&0===this.$store.state.settings.GTMAvailable.length&&this.googleLinked)this.googleAccountStatus="NO_TAG_AVAILABLE";else if(0===Object.keys(this.googleAccountSelected).length)if(this.$store.state.settings.GTMAvailable.length>0)this.googleAccountStatus="NOT_LINKED";else{var t=Object(u["intersection"])(this.$store.state.settings.GTAAvailable,Object.keys(this.googleAccountsList));t.length>1?this.googleAccountStatus="NOT_LINKED":1===t.length&&(this.selectAccountAnalytics({webPropertyId:t,viewId:this.googleAccountsList[t].view_id,username:this.googleAccountsList[t].username,webPropertyName:this.googleAccountsList[t].webPropertyName}),this.googleAccountStatus="LINKED")}else this.checkIfSelectedTagIsPresent(this.googleAccountSelected)},getLogOutHandler:function(){document.body.classList.remove("modal-open"),this.$segment.track("Logout",{module:"ps_metrics"}),this.getLogOut()},onTrackConnectGoogleAnalytics:function(){this.$segment.track("Connect Google analytics",{module:"ps_metrics"}),window.location.href=this.googleLinkedUrl},trackChangeAccountGoogle:function(){this.$segment.track("Change account google analytics",{module:"ps_metrics"});var t=this.getLogOut();t&&(window.location.href=this.googleLinkedUrl)},refreshAccountGoogle:function(){this.refreshAccount()}})},et=tt,st=(s("fb07"),Object(h["a"])(et,i,r,!1,null,"1311ac8f",null)),ot=st.exports,at=function(){var t=this,e=t.$createElement,s=t._self._c||e;return t.display?s("div",{staticClass:"tw-container tw-mx-auto tw-flex tw-rounded-md tw-bg-gradient-to-r tw-from-psorange tw-to-pspink tw-h-56"},[t._m(0),s("div",{staticClass:"tw-flex tw-flex-grow tw-p-6 tw-relative"},[t.isFullyOnboarded?s("div",{staticClass:"tw-absolute tw-right-6"},[s("b-button",{attrs:{variant:"link"},on:{click:function(e){return t.setDisplay(!1)}}},[s("span",{staticClass:"material-icons tw-text-white tw-text-lg tw-font-semibold"},[t._v(" close ")])])],1):t._e(),s("div",{staticClass:"tw-m-auto tw-text-white"},[s("h1",{staticClass:"tw-text-white"},[t.isFullyOnboarded?[t._v(" "+t._s(t.$t("configure.incentivePanel.congrats"))+" ")]:[t._v(" "+t._s(t.$t("configure.incentivePanel.howTo"))+" ")]],2),s("div",{staticClass:"tw-flex tw-ml-8 tw-mb-4"},[s("Bullet",{staticClass:"tw-mr-4",attrs:{checked:this.$store.getters.psAccountsIsOnboarded}}),s("div",[t._v(" "+t._s(t.$t("configure.incentivePanel.connectToPs"))+" ")])],1),s("div",{staticClass:"tw-flex tw-ml-8"},[s("Bullet",{staticClass:"tw-mr-4",attrs:{checked:t.isFullyOnboarded}}),s("div",[t._v(" "+t._s(t.$t("configure.incentivePanel.addSources"))+" ")])],1)])])]):t._e()},nt=[function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"tw-hidden tw-items-center tw-bg-white tw-shadow-md tw-rounded-md sm:tw-hidden md:tw-flex lg:tw-flex xl:tw-flex 2xl:tw-flex"},[o("div",{staticClass:"tw-m-auto sm:tw-px-4 md:tw-px-4 lg:tw-px-16 xl:tw-px-16 2xl:tw-px-16"},[o("img",{staticClass:"tw-hidden sm:tw-hidden md:tw-hidden lg:tw-block xl:tw-block 2xl:tw-block",attrs:{src:s("d4d3"),width:"250"}}),o("img",{staticClass:"sm:tw-block md:tw-block lg:tw-hidden xl:tw-hidden 2xl:tw-hidden",attrs:{src:s("9173"),width:"50"}})])])}],it={name:"ConfigurationBanner",props:["app","configurationPage"],components:{Bullet:x},data:function(){return{display:!0,watchUser:""}},methods:{setDisplay:function(t){this.display=t,localStorage.setItem("metricsSettingsBanner",JSON.stringify(t))},startSetup:function(){this.$segment.track("start setup",{module:"ps_metrics"}),window.open(this.configurationPage)}},computed:{isFullyOnboarded:function(){return this.$store.getters.psAccountsIsOnboarded&&this.$store.getters.gaIsOnboarded}},created:function(){var t=this,e=JSON.parse(localStorage.getItem("metricsSettingsBanner"));"boolean"!==typeof e&&null===e||(this.display=e),this.watchUser=this.$store.watch((function(t,e){return{psAccountsIsOnboarded:e.psAccountsIsOnboarded,gaIsOnboarded:e.gaIsOnboarded}}),(function(e){e.psAccountsIsOnboarded&&e.gaIsOnboarded||t.setDisplay(!0)}),{immediate:!0})},beforeDestroy:function(){this.watchUser()}},rt=it,ct=Object(h["a"])(rt,at,nt,!1,null,null,null),lt=ct.exports,dt=s("a85d"),ut={components:{DataSource:ot,ConfigurationBanner:lt,PsAccounts:dt["PsAccounts"]},methods:Object(n["a"])({},Object(c["c"])({getListProperty:"getListProperty"})),data:function(){return{loading:!0,unwatch:""}},created:function(){var t=this;this.googleLinked&&(this.loading=!0,this.getListProperty()),this.unwatch=this.$store.watch((function(t,e){return{googleLinked:t.settings.googleLinked,countProperty:t.settings.countProperty,listProperty:t.settings.state.listPropertySuccess}}),(function(e){e.googleLinked&&Object.keys(e.listProperty).length<e.countProperty&&t.getListProperty(),Object.keys(e.listProperty).length>=e.countProperty&&(t.loading=!1)}),{immediate:!0})},beforeDestroy:function(){this.unwatch()},computed:{app:function(){return this.$store.state.app.app},connectedAccount:function(){return this.$store.state.settings.connectedAccount},googleLinked:function(){return this.$store.state.settings.googleLinked},googleLinkedUrl:function(){return this.$store.state.settings.googleLinkedUrl},shopUrl:function(){return this.$store.state.app.shop.domain},googleAccountSelected:function(){return this.$store.state.settings.googleAccount},googleAccountsList:function(){return this.$store.state.settings.state.listPropertySuccess},loadingPropertyList:function(){return this.loading&&this.$store.state.settings.state.loadingListProperty}}},gt=ut,pt=(s("e0a8"),Object(h["a"])(gt,o,a,!1,null,"0e0e1f7c",null));e["default"]=pt.exports},"1d5a":function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,'#metrics-modal .custom-control-label:after,#metrics-modal .custom-control-label:before{top:40px!important;left:25px!important;cursor:pointer}#metrics-modal #accounts-list{max-width:350px;overflow-y:scroll;margin:20px auto;max-height:350px}#metrics-modal #accounts-list .form-group{border:0}#metrics-modal #accounts-list .checked .custom-radio{border-color:#25b9d7}#metrics-modal #accounts-list .custom-radio{border:2px solid #6c868e;border-radius:3px;padding-left:0!important}#metrics-modal #accounts-list .custom-radio:active,#metrics-modal #accounts-list .custom-radio:focus{border-color:#6c868e}#metrics-modal #accounts-list .custom-radio input{float:left;margin-right:50px;margin-top:12px;margin-left:25px}#metrics-modal #accounts-list .custom-radio label{float:left;text-align:left}#metrics-modal #accounts-list .custom-radio label p{margin:0;padding:0}#metrics-modal #accounts-list .custom-radio label p.tag{color:#363a41;font-weight:600}#metrics-modal #accounts-list .custom-radio label p.view{color:#799098;font-size:12px}#metrics-modal #accounts-list .custom-radio:after{content:"";display:block;clear:both}',""]),t.exports=e},"28be":function(t,e,s){"use strict";s("ae9a")},"35ce":function(t,e,s){var o=s("e2a1");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("16bf4d46",o,!0,{sourceMap:!1,shadowMode:!1})},3686:function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,".card-header .material-icons[data-v-1311ac8f]{color:#4cbb6c}.psaccount-not-connected[data-v-1311ac8f]{border-bottom:0;color:#6c868e}.card-header[data-v-1311ac8f]{font-size:16px;font-weight:600;background-color:#fafbfc}.icon .material-icons[data-v-1311ac8f]{font-size:50px;color:#6c868e}.sourceTitle[data-v-1311ac8f]{font-size:1.125rem;line-height:1.75rem;font-weight:600}.description[data-v-1311ac8f]{color:#6c868e}section[data-v-1311ac8f]{padding:20px 0}section[data-v-1311ac8f]:last-child{border-top:1px solid #e1e7e9}.account-data[data-v-1311ac8f]{background:#fafbfc;padding:15px;font-size:14px}.account-data span[data-v-1311ac8f]{margin:0 10px}.account-data .email[data-v-1311ac8f]{font-weight:600}.account-data .account[data-v-1311ac8f]{color:#363a41}.account-data .chevron[data-v-1311ac8f]{float:right}.account-data .tag[data-v-1311ac8f]{color:#6c868e;font-size:10px}.account-data .warning-tag[data-v-1311ac8f]{color:#cd9321}.account-data a[data-v-1311ac8f]{padding:0}",""]),t.exports=e},3875:function(t,e,s){t.exports=s.p+"img/prestashop-logo.png"},"686e":function(t,e,s){"use strict";s("35ce")},"6e4a":function(t,e,s){var o=s("1d5a");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("1f5d169d",o,!0,{sourceMap:!1,shadowMode:!1})},7474:function(t,e,s){var o=s("3686");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("71cc8b27",o,!0,{sourceMap:!1,shadowMode:!1})},"88ca":function(t,e,s){t.exports=s.p+"img/google-analytics.png"},"8b59":function(t,e,s){"use strict";s("6e4a")},"98cc":function(t,e,s){"use strict";s("a340")},a340:function(t,e,s){var o=s("0986");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("80402e8e",o,!0,{sourceMap:!1,shadowMode:!1})},ae9a:function(t,e,s){var o=s("f05b");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("6bc59b64",o,!0,{sourceMap:!1,shadowMode:!1})},e0a8:function(t,e,s){"use strict";s("fcce")},e2a1:function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,".v-spinner{text-align:center}@-webkit-keyframes v-pacmanStretchDelay{75%{-webkit-opacity:.7;opacity:.7}to{transform:translate(-100px,-6.25px)}}@keyframes v-pacmanStretchDelay{75%{-webkit-opacity:.7;opacity:.7}to{transform:translate(-100px,-6.25px)}}",""]),t.exports=e},f05b:function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,".bullet[data-v-45124460]{display:flex;align-items:center;justify-content:center;background-color:rgba(0,0,0,var(--tw-bg-opacity));border-radius:9999px;height:1.5rem;width:1.5rem;min-width:1.5rem}.bullet[data-v-45124460],.checked[data-v-45124460]{--tw-bg-opacity:1}.checked[data-v-45124460]{background-color:rgba(16,185,129,var(--tw-bg-opacity))}",""]),t.exports=e},fb07:function(t,e,s){"use strict";s("7474")},fb9e:function(t,e,s){var o=s("24fb");e=o(!1),e.push([t.i,"section[data-v-0e0e1f7c]{margin-bottom:35px}",""]),t.exports=e},fcce:function(t,e,s){var o=s("fb9e");o.__esModule&&(o=o.default),"string"===typeof o&&(o=[[t.i,o,""]]),o.locals&&(t.exports=o.locals);var a=s("499e").default;a("7ec3f9f4",o,!0,{sourceMap:!1,shadowMode:!1})}}]); |