Files
prestashop/modules/psxmarketingwithgoogle/views/js/psxmarketingwithgoogle-ui.js

5 lines
1.0 MiB
JavaScript
Raw Normal View History

(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`@charset "UTF-8";@import"https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700&subset=latin-ext";@import"https://fonts.googleapis.com/icon?family=Material+Icons";:root{--header-height: 100px;--header-height-full: 136px}.nobootstrap{background-color:unset!important;padding:0;min-width:unset!important}.nobootstrap form p{padding-bottom:0}.nobootstrap .form-group{float:none}.nobootstrap .form-group>div{float:unset}.nobootstrap label{color:inherit;float:none;font-weight:inherit;padding:unset;text-align:inherit;text-shadow:none;width:auto}.nobootstrap fieldset{background-color:unset;border:none;color:inherit;margin:unset;padding:unset}.nobootstrap .table{background-color:unset;border:unset;border-radius:unset;padding:unset}.nobootstrap .table tr th{background-color:unset;color:unset;font-size:unset}.nobootstrap .table tr td{border-bottom:unset;color:unset}.nobootstrap.table-hover tbody tr:hover{color:#fff}.nobootstrap.table-hover tbody tr:hover a{color:#fff!important}@media screen and (min-width: 1024px){.nobootstrap{background-color:unset!important;min-width:unset!important}}.page-sidebar.mobile #content.nobootstrap{margin-left:unset}.page-sidebar-closed:not(.mobile) #content.nobootstrap{padding-left:50px}.page-sidebar:not(.page-sidebar-closed) .nobootstrap{margin-left:210px}.material-icons.js-mobile-menu{display:none!important}#psxMktgWithGoogleApp :root{--blue: #174EEF;--indigo: #6610f2;--purple: #6f42c1;--pink: #e83e8c;--red: #BA151A;--orange: #fd7e14;--yellow: #FFA000;--green: #207F4B;--teal: #20c997;--cyan: #25b9d7;--white: #fff;--gray: #6c868e;--gray-dark: #363a41;--primary: #1D1D1B;--secondary: #5E5E5E;--success: #207F4B;--info: #174EEF;--warning: #FFA000;--danger: #BA151A;--light: #fafbfc;--dark: #363a41;--breakpoint-xs: 0;--breakpoint-sm: 544px;--breakpoint-md: 768px;--breakpoint-lg: 1024px;--breakpoint-xl: 1300px;--breakpoint-xxl: 1600px;--font-family-sans-serif: "IBM Plex Sans", "Open Sans", Helvetica, Arial, sans-serif;--font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}#psxMktgWithGoogleApp *,#psxMktgWithGoogleApp *:before,#psxMktgWithGoogleApp *:after{box-sizing:border-box}#psxMktgWithGoogleApp html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0)}#psxMktgWithGoogleApp article,#psxMktgWithGoogleApp aside,#psxMktgWithGoogleApp figcaption,#psxMktgWithGoogleApp figure,#psxMktgWithGoogleApp footer,#psxMktgWithGoogleApp header,#psxMktgWithGoogleApp hgroup,#psxMktgWithGoogleApp main,#psxMktgWithGoogleApp nav,#psxMktgWithGoogleApp section{display:block}#psxMktgWithGoogleApp body{margin:0;font-family:IBM Plex Sans,Open Sans,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:400;line-height:1.5;color:#363a41;text-align:left;background-color:#fff}#psxMktgWithGoogleApp [tabindex="-1"]:focus:not(:focus-visible){outline:0!important}#psxMktgWithGoogleApp hr{box-sizing:content-box;height:0;overflow:visible}#psxMktgWithGoogleApp h1,#psxMktgWithGoogleApp h2,#psxMktgWithGoogleApp .modal-title,#psxMktgWithGoogleApp h3,#psxMktgWithGoogleApp h4,#psxMktgWithGoogleApp h5,#psxMktgWithGoogleApp h6{margin-top:0;margin-bottom:.9375rem}#psxMktgWithGoogleApp p{margin-top:0;margin-bottom:1rem}#psxMktgWithGoogleApp abbr[title],#psxMktgWithGoogleApp abbr[data-original-title]{text-decoration:underline;text-decoration:underline dotted;cursor:help;border-bottom:0;text-decoration-skip-ink:none}#psxMktgWithGoogleApp address{margin-bottom:1rem;font-style:normal;line-height:inherit}#psxMktgWithGoogleApp ol,#psxMktgWithGoogleApp ul,#psxMktgWithGoogleApp dl{margin-top:0;margin-bottom:1rem}#psxMktgWithGoogleApp ol ol,#psxMktgWithGoogleApp ul ul,#psxMktgWithGoogleApp ol ul,#psxMktgWithGoogleApp ul ol{margin-bottom:0}#psxMktgWithGoogleApp dt{font-weight:700}#psxMktgWithGoogleApp dd{margin-bottom:.5rem;margin-left:0}#psxMktgWithGoogleApp blockquote{margin:0 0 1rem}#psxMktgWithGoogleApp b,#
var Ea=Object.defineProperty;var Ca=(e,s,t)=>s in e?Ea(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t;var me=(e,s,t)=>(Ca(e,typeof s!="symbol"?s+"":s,t),t);import{s as Ke,c as Sa,d as ce,l as mr,V as k,a as hr,S as fa,b as Ta,e as u,B as Aa,u as va,t as ba,m as z,C as Qe,r as Ia,f as Oa,v as Na,g as Ra,h as ya,i as nt,j as Ga,k as $a,n as Pa,o as Da,p as Ua,q as Be,w as Fa,x as wa,y as La,_ as le,z as xa,A as Ma,D as ka,E as Er,F as Va,G as Ba,H as Cr,I as Sr,J as Ha,K as Wa,L as za,M as fr,N as rt,O as Ya,P as qa}from"./vendor.js";import Ze from"./translations/en.js";class Y extends Error{constructor(s,t){super(s),this.code=t,this.name=this.constructor.name,this.message=s,this.code=t}}const ja="no-correlation-id-provided",Te={apiUrl:"",token:""},Ka=e=>{Te.apiUrl=e.apiUrl,Te.token=e.token},Qa=async e=>{if(!e.ok)throw new Y(e.statusText,e.status);return e},T=async(e,s,t)=>{if(!Te.apiUrl.length)throw new Error("Cannot call onboarding API, client is not initialized (missing URL)");if(!Te.token.length)throw new Error("Cannot call onboarding API, client is not initialized (missing token)");const n=await fetch(`${Te.apiUrl}/${s}`,{method:e,headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${Te.token}`,"x-correlation-id":(t==null?void 0:t.correlationId)||ja},body:(t==null?void 0:t.body)&&JSON.stringify(t==null?void 0:t.body)});return t!=null&&t.onResponse?t==null?void 0:t.onResponse(n):Qa(n)},Za={psxMktgWithGoogleApiUrl:"",psxMktgWithGoogleActiveCountries:[],psxMktgWithGoogleActiveCurrencies:[],psxMktgWithGoogleLanguages:[],psxMktgWithGoogleAdminUrl:"",psxMktgWithGoogleAdminAjaxUrl:"",psxMktgWithGoogleShopUrl:"",isCountryMemberOfEuropeanUnion:!1,psxMtgWithGoogleDefaultShopCountry:null,psxMktgWithGoogleShopCurrency:{isoCode:""},psxMktgWithGoogleDocumentAndFaq:{faq:{},doc:"",contactUs:""},psVersion:"",phpVersion:"",psxMktgWithGoogleMaintenanceSettingsUrl:"",shopIsOnMaintenanceMode:document.getElementById("maintenance-mode")!==null,psxMktgWithGoogleCarriersUrl:"",psxMktgWithGoogleAttributesUrl:"",psxMktgWithGoogleProductsUrl:"",psxMktgWithGoogleCurrenciesUrl:"",psxMktgWithGoogleLanguagesUrl:"",psxMktgWithGoogleProductDetailUrl:"",psxMktgWithGoogleStoreSettingsUrl:"",psxMktgWithGoogleOnProductionEnvironment:!1,debugData:{typesOfSync:[]},adBlockerExists:!1,psxMktgWithGoogleModuleVersion:"",cloudsyncVersionNeeded:"3.0.12",psxMktgWithGoogleModuleVersionNeeded:"1.74.0",psxMktgWithGoogleModuleIsEnabled:!0,psxMktgWithGoogleEnableLink:"",backOfficeUserIsLoggedIn:!0,featureFlags:{enhancedConversions:!1},billing:{subscription:window.psBillingSubscription}};var A=(e=>(e.GET_IS_COUNTRY_MEMBER_OF_EU="GET_IS_COUNTRY_MEMBER_OF_EU",e.GET_CURRENT_LANGUAGE="GET_CURRENT_LANGUAGE",e.GET_CURRENT_CURRENCY="GET_CURRENT_CURRENCY",e.GET_SHOP_CURRENCIES="GET_SHOP_CURRENCIES",e.GET_DOC_AND_FAQ="GET_DOC_AND_FAQ",e.GET_SUPPORT_URL="GET_SUPPORT_URL",e.GET_DEBUG_DATA="GET_DEBUG_DATA",e.GET_STATUS_SHOP_MAINTENANCE="GET_STATUS_SHOP_MAINTENANCE",e.GET_CARRIERS_URL="GET_CARRIERS_URL",e.GET_ATTRIBUTES_URL="GET_ATTRIBUTES_URL",e.GET_PRODUCT_DETAIL_BASE_URL="GET_PRODUCT_DETAIL_BASE_URL",e.GET_PRODUCTS_CATALOG_URL="GET_PRODUCTS_CATALOG_URL",e.GET_CURRENCIES_URL="GET_CURRENCIES_URL",e.GET_LANGUAGES_URL="GET_LANGUAGES_URL",e.GET_STORE_INFORMATION_URL="GET_STORE_INFORMATION_URL",e.GET_ACTIVE_COUNTRIES="GET_ACTIVE_COUNTRIES",e.GET_ACTIVE_COUNTRIES_FOR_ACTIVE_CURRENCY="GET_ACTIVE_COUNTRIES_FOR_ACTIVE_CURRENCY",e.GET_ADD_BLOCKER_STATUS="GET_ADD_BLOCKER_STATUS",e.GET_SYMBOL_OF_CURRENT_CURRENCY="GET_SYMBOL_OF_CURRENT_CURRENCY",e.GET_FEATURE_FLAG_ENHANCED_CONVERSIONS="GET_FEATURE_FLAG_ENHANCED_CONVERSIONS",e.GET_MODULE_NEED_UPGRADE="GET_MODULE_NEED_UPGRADE",e.GET_BILLING_SUBSCRIPTION_ACTIVE="GET_BILLING_SUBSCRIPTION_ACTIVE",e.GET_BILLING_SUBSCRIPTION_EXPIRING="GET_BILLING_SUBSCRIPTION_EXPIRING",e))(A||{});const ee=[{country:"Algéria",currency:"DZD",shoppingOngletAvailable:!1,onBeta:!0,enterpriseNumberNeeded:!1,shoppingFrAvailable:!1,code:"DZ"},{country:"Angola",currency:"AOA",shoppingOngletAvailable:!1,onBeta:!0,enterp
ps_gs-fz-16 font-weight-500`,"label-for":"campaign-duration-start-date-input"},scopedSlots:e._u([{key:"label",fn:function(){return[e._v(" "+e._s(e.$t("smartShoppingCampaignCreation.inputDurationLabel"))+" "),t("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:psxMktgWithGoogleApp",arg:"psxMktgWithGoogleApp"}],staticClass:"ml-1 p-0 d-flex align-items-center",attrs:{variant:"text-primary",title:e.$t("smartShoppingCampaignCreation.inputDurationTooltip")}},[t("span",{staticClass:"material-icons material-icons-round mb-0 ps_gs-fz-16 text-secondary"},[e._v(" help_outline ")])])]},proxy:!0}])},[t("b-form-row",[t("b-col",{staticClass:"mb-3 mb-md-0",attrs:{cols:"12",md:"6"}},[t("label",{attrs:{for:"campaign-duration-start-date-input"}},[e._v(" "+e._s(e.$t("smartShoppingCampaignCreation.inputDurationLabel1"))+" ")]),t("b-form-datepicker",{ref:"campaign-duration-start-date-input",staticClass:"ps_gs-datepicker",attrs:{id:"campaign-duration-start-date-input","start-weekday":1,min:new Date,"date-format-options":{year:"numeric",month:"numeric",day:"numeric"},"reset-button":"","label-reset-button":e.$t("cta.resetDate"),"reset-value":new Date,"reset-button-variant":"outline-secondary sm","hide-header":!0,"label-help":e.$t("smartShoppingCampaignCreation.inputDatePickerHelper"),required:!0},on:{input:e.openEndDatepicker},model:{value:e.campaignDurationStartDate,callback:function(n){e.campaignDurationStartDate=n},expression:"campaignDurationStartDate"}})],1),t("b-col",{attrs:{cols:"12",md:"6"}},[t("label",{attrs:{for:"campaign-duration-end-date-input"}},[e._v(" "+e._s(e.$t("smartShoppingCampaignCreation.inputDurationLabel2"))+" ")]),t("b-form-datepicker",{ref:"campaignDurationEndDateInput",staticClass:"ps_gs-datepicker",attrs:{id:"campaign-duration-end-date-input","start-weekday":1,"date-format-options":{year:"numeric",month:"numeric",day:"numeric"},min:e.minimunEndDate,"reset-button":"","label-reset-button":e.$t("cta.noEndDate"),"reset-button-variant":"outline-secondary sm","hide-header":!0,"label-help":e.$t("smartShoppingCampaignCreation.inputDatePickerHelper"),required:!1,state:e.campaignEndDateFeedback,"menu-class":"ps_gs-datepicker-end"},model:{value:e.campaignDurationEndDate,callback:function(n){e.campaignDurationEndDate=n},expression:"campaignDurationEndDate"}}),t("b-form-invalid-feedback",{class:{"d-block":e.campaignEndDateFeedback===!1},attrs:{id:"campaign-duration-end-date-input-feedback"}},[e._v(" "+e._s(e.$t("smartShoppingCampaignCreation.inputDurationInvalidFeedback"))+" ")])],1)],1)],1),t("b-form-group",{staticClass:"maxw-sm-420",attrs:{id:"campaign-target-country-fieldset","label-class":"d-flex align-items-center ps_gs-fz-16 font-weight-500","label-for":"campaign-target-country-input",description:e.editMode?e.$t("smartShoppingCampaignCreation.inputCountryImutable"):e.$t("smartShoppingCampaignCreation.inputCountryHelper")},scopedSlots:e._u([{key:"label",fn:function(){return[e._v(" "+e._s(e.$t("smartShoppingCampaignCreation.inputCountryLabel"))+" "),t("b-button",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip:psxMktgWithGoogleApp",arg:"psxMktgWithGoogleApp"}],staticClass:"ml-1 p-0 d-flex align-items-center",attrs:{variant:"text-primary",title:e.$t("smartShoppingCampaignCreation.inputCountryTooltip")}},[t("span",{staticClass:"material-icons material-icons-round mb-0 ps_gs-fz-16 text-secondary"},[e._v(" help_outline ")])])]},proxy:!0}])},[e.editMode?t("span",[e._v(" "+e._s(e.targetCountry)+" ")]):t("SelectCountry",{attrs:{"default-value":e.defaultCountry,"need-filter":!1,"dropdown-options":e.activeCountries},on:{countrySelected:e.saveCountrySelected}})],1),t("b-form-group",{attrs:{label:e.$t("smartShoppingCampaignCreation.inputFiltersLegend"),id:"campaign-products-filter-fieldset","label-class":"font-weight-600 border-0 bg-transparent ps_gs-fz-16 font-weight-500"},scopedSlots:e._u([{key:"description",fn:function(){return[t("VueShowdown",{staticClass:"mb-0",attrs:{tag:"p",markdown:e.$t("smartShoppingCampaignCreation.inputFiltersHelper",[e.$options.googleUrl.shoppingAdsPolicies]),extensions:["extende
${e.formatToDisplay}</span>`,variant:" ","toggle-class":[{"ps-dropdown__placeholder":!e.formatToDisplay},"w-100"],"menu-class":"ps-dropdown",size:"sm"}},[t("b-dropdown-form",{attrs:{"form-class":"dropdown-form-with-checkbox text-dark"}},[t("b-form-checkbox-group",{attrs:{name:`dropdown-attribute-${e.field.label}`,stacked:""},model:{value:e.attributesChecked,callback:function(n){e.attributesChecked=n},expression:"attributesChecked"}},e._l(e.options,function(n,r){return t("b-form-checkbox",{key:r,staticClass:"ps_gs-checkbox",attrs:{value:n}},[t("span",{staticClass:"line-height-15 text-truncate",attrs:{}},[e._v(" "+e._s(e.displayAttributeOption(n))+" ")])])}),1)],1),e.field.name==="description"?t("b-dropdown-item-button",{attrs:{"button-class":"rounded-0 text-dark"},on:{click:function(n){e.attributesChecked=[]}}},[t("span",{staticClass:"px-2"},[e._v(" "+e._s(e.$t("general.notAvailable"))+" ")])]):e._e()],1),e.displayEventuallyRequiredMessage?t("div",{staticClass:"maxw-sm-250 d-flex text-muted ps_gs-fz-12 mt-1 attribute-field__warning"},[t("i",{staticClass:"material-icons material-icons-round ps_gs-fz-16 font-weight-normal mr-1"},[e._v(" warning_amber ")]),t("VueShowdown",{attrs:{markdown:e.markdown,extensions:["extended-link"]}})],1):e._e()],1)},cT=[];const Ln={};var lT=c(iT,oT,cT,!1,dT,null,null,null);function dT(e){for(let s in Ln)this[s]=Ln[s]}const uT=function(){return lT.exports}();var _T=function(){var e=this,s=e.$createElement,t=e._self._c||s;return t("b-form-checkbox",{staticClass:"ps_gs-product-category-checkbox",attrs:{value:e.category.value,plain:""},on:{change:e.changed}},[t("i",{staticClass:"material-icons ps_gs-product-category-checkbox__icon"},[e._v(" "+e._s(e.category.icon)+" ")]),t("div",{staticClass:"ps_gs-product-category-checkbox__text"},[t("p",{staticClass:"ps_gs-product-category-checkbox__title"},[e._v(" "+e._s(e.category.title)+" ")]),e.category.subtitle?t("p",{staticClass:"ps_gs-product-category-checkbox__subtitle"},[e._v(" "+e._s(e.category.subtitle)+" ")]):e._e()])])},pT=[];const gT={props:{category:{type:Object,required:!0}},methods:{changed(e){this.$emit("categoryProductsChanged",this.category.value,e.includes(this.category.value))}}},xn={};var mT=c(gT,_T,pT,!1,hT,null,null,null);function hT(e){for(let s in xn)this[s]=xn[s]}const ET=function(){return mT.exports}(),CT=u({name:"ProductFeedSettingsAttributeMapping",components:{SettingsFooter:Re,ActionsButtons:Ne,AttributeField:uT,CategoryButton:ET},data(){return{loading:!1,selectedProductCategories:[re.NONE],mappingAttributes:[]}},computed:{mappingSectionVisible(){return this.selectedProductCategories.length},attributeToEdit(){return this.$route.hash.substring(1).toUpperCase()},disableContinue(){return this.selectedProductCategories.length===0},previouslySelectedProductCategories(){return N("productFeed-selectedProductCategories")||this.$store.getters["productFeed/GET_PRODUCT_CATEGORIES_SELECTED"]},categories(){return[{title:this.$i18n.t("productFeedSettings.attributeMapping.apparelAndAccessoriesTitle"),subtitle:this.$i18n.t("productFeedSettings.attributeMapping.apparelAndAccessoriesSubtitle"),icon:"checkroom",value:re.APPAREL_AND_ACCESSORIES},{title:this.$i18n.t("productFeedSettings.attributeMapping.electronicsTitle"),subtitle:this.$i18n.t("productFeedSettings.attributeMapping.electronicsSubtitle"),icon:"blender_black",value:re.ELECTRONICS},{title:this.$i18n.t("productFeedSettings.attributeMapping.variantSetsTitle"),subtitle:this.$i18n.t("productFeedSettings.attributeMapping.variantSetsSubtitle"),icon:"filter_3",value:re.VARIANT_SETS},{title:this.$i18n.t("productFeedSettings.attributeMapping.commonsTitle"),icon:"select_all",value:re.NONE}]},existingAttributes(){return Bi(this.$store.getters["productFeed/GET_FREE_LISTING_ATTRIBUTES_TO_MAP"],N("productFeed-attributeMapping"))},attributesToMap(){return this.existingAttributes.filter(e=>this.selectedProductCategories.includes(e.category)||e.category===re.COMMONS)}},methods:{previousStep(){this.$store.getters["productFeed/GET_PRODUCT_FEED_REQUIRED_RECONFIGURATION"]?(this.$store.commit("productFee