var goodgbaseUrl="https://gdpr.good-apps.co/";var goodgApiUrl="https://gdpr.good-apps.co/";var goodgShop="superdulcesmexico.myshopify.com";var goodgTriggerEvents={};var goodgPageIds=[];var goodgCertainBtns=[];var goodgCurrencyCode="MXN";var goodgCurrencySymbol="$ {{amount}}";var goodgVersion="21";var goodgartWidget={"widget_name":"Widget name","widget_type":"1","widget_themes":"style_1","design_type":{"position":"full","animation":"animate__slideInDown","cart_icon":"cart_right_center"},"top":{"top_show":true,"background_top":"#fff","close_show":true,"close_bg_color":"#F8F5F5","close_bg_color_hover":"#F8F5F5CC","close_color":"#c0deed","close_color_hover":"#c0deed","close_border_radius":"10"},"main":{"background_main":"transparent","background_heading":"transparent","button_redirect_event":"1","texts_show":true,"timer_show":false,"upsell_show":false,"timer_template":"1","timer_min":"11","timer_sec":"45","timer_hour":"2","timer_days":"1","timer_bg":"#222831","display_bg":"transparent","title_bg":"transparent","timer_border_radius":"0","timer_border_color":"#fff","timer_border_width":"0","title_border_radius":"0","title_padding":"3","timer_font_size":"15","timer_color":"#c0deed","timer_title_color":"#c0deed","timer_number_color":"#7fffd4","timer_number_text_color":"#7fffd4","timer_number_background":"transparent","timer_number_border":"0","timer_number_border_color":"transparent","timer_number_fs":"25","timer_font_weight":"400","timer_font_style":"normal","timer_line_height":"19","timer_padding_l":"30","timer_padding_r":"30","timer_padding_t":"15","timer_padding_b":"15","wallpaper":"wallpaper_0","title_show":true,"title_font_size":"20","title_color":"#7200A0","title_font_weight":"700","title_font_style":"normal","title_line_height":"22","border_width":"0","border_color":"#fff","border_radius":"0","cart_icon_show":true,"cart_icon_bg":"#191919","cart_icon_color":"#ffffff","cart_icon_number_c":"#000000","cart_icon_number_bg":"#F7F3F3"},"discount_code":{"discount_code_show":false,"code_background":"#fcfafa","code_background_input":"#fff","code_border_in_width":"1","code_border_in_color":"#EEEEEE","code_in_color":"#191919","code_border_in_radius":"5","code_border_width":"2","code_border_color":"#EEEEEE","code_text_color":"#191919","code_text_font_size":"18","code_text_font_weight":"700","code_text_font_style":"normal","code_text_line_height":"20","code_btn_bg":"#191919","code_btn_bg_h":"#191919cc","code_btn_color":"#fff","code_btn_color_h":"#fff","code_btn_font_size":"18","code_btn_font_weight":"700","code_btn_font_style":"normal","code_btn_line_height":"20"},"rewards":{"rewards_show":true,"rewards_background":"#222831","rewards_background_pro":"#E9E9E9","rewards_background_pro_f":"#13cad2","rewards_border_width":"2","rewards_border_color":"#222831","rewards_text_color":"#c0deed","rewards_text_font_size":"18","rewards_text_font_weight":"700","rewards_text_font_style":"normal","rewards_text_line_height":"20","rewards_cart_total_show":true,"rewards_item_count_show":false,"rewards_cart_total":"70","rewards_item_count":"5"},"bottom":{"background_bottom":"#FBF3FE","reject_btn_show":true,"reject_btn_bg":"transparent","reject_btn_bg_hover":"transparent","reject_btn_font_color":"#5C5B5B","reject_btn_font_color_hover":"#5C5B5B","reject_btn_border_radius":"0","reject_btn_font_size":"18","reject_btn_font_weight":"700","reject_btn_font_style":"normal","reject_btn_line_height":"19","reject_btn_padding_t_b":"0","reject_btn_padding_l_r":"0","checkout_btn_show":true,"checkout_btn_border_color":"#fff","checkout_btn_border_color_h":"#fffcc","checkout_btn_border_width":"0","checkout_btn_bg":"#c0deed","checkout_btn_bg_hover":"#c0deedcc","checkout_btn_font_color":"#222831","checkout_btn_font_color_hover":"#222831","checkout_btn_border_radius":"5","checkout_btn_font_size":"16","checkout_btn_font_weight":"700","checkout_btn_font_style":"normal","checkout_btn_line_height":"22","checkout_btn_padding_t_b":"6","checkout_btn_padding_l_r":"30","total_show":true,"total_color":"#191919","total_font_size":"24","total_font_weight":"500","total_font_style":"normal","total_line_height":"26","total_price_color":"#000000","total_price_font_size":"24","total_price_font_weight":"700","total_price_font_style":"normal","total_price_line_height":"28","discounts_color":"#191919","discounts_font_size":"18","discounts_font_weight":"500","discounts_font_style":"normal","discounts_line_height":"20","discounts_price_color":"#777777","discounts_price_font_size":"18","discounts_price_font_weight":"700","discounts_price_font_style":"normal","discounts_price_line_height":"21","discounts_show":false},"product":{"background_img":"#fff","background":"#fff","cart_btn_bg":"#c0deed","cart_btn_bg_hover":"#c0deedcc","cart_btn_font_color":"#222831","cart_btn_font_color_hover":"#222831","cart_btn_border_radius":"5","cart_btn_font_size":"18","cart_btn_font_weight":"700","cart_btn_font_style":"normal","cart_btn_line_height":"19","remove_btn_bg":"transparent","remove_btn_bg_hover":"transparent","delete_btn_font_color":"#F1CAFF","delete_btn_font_color_hover":"#F1CAFFaa","remove_btn_border_radius":"3","remove_btn_font_size":"15","remove_btn_font_weight":"700","remove_btn_font_style":"normal","remove_btn_line_height":"15","remove_btn_padding_t_b":"10","remove_btn_padding_l_r":"16","prod_border_width":"0","prod_border_color":"#E6E6E6","prod_border_radius":"0","prod_title_show":true,"prod_title_color":"#28313a","prod_title_font_size":"14","prod_title_font_weight":"700","prod_title_font_style":"normal","prod_title_line_height":"21","prod_desc_show":true,"prod_desc_show_full":true,"prod_desc_color":"#444F65","prod_desc_font_size":"16","prod_desc_font_weight":"400","prod_desc_font_style":"normal","prod_desc_line_height":"18","price_show":true,"price_color":"#7400A3","price_font_size":"15","price_font_weight":"700","price_font_style":"normal","price_line_height":"22","compare_price_show":true,"compare_price_color":"#777777","compare_price_font_size":"18","compare_price_font_weight":"700","compare_price_font_style":"normal","compare_price_line_height":"20","save_show":true,"save_bg":"#A74FCB","save_border_radius":"3","save_color":"#fff","save_font_size":"12","save_font_weight":"700","save_font_style":"normal","save_line_height":"13","save_padding":"5","qty_show":true,"qty_background":"transparent","qty_font_color":"#999999","qty_btn_bg":"#999999","qty_btn_bg_hover":"#999999","qty_btn_color":"#000000","qty_btn_color_hover":"#999999","qty_border_radius":"5","variations_show":true,"variations_background":"#fff","variations_font_color":"#444F65","variations_border_width":"1","variations_border_color":"#EEEEEE","variations_border_radius":"0"},"offer_product":{"background_o":"#fff","background_img_o":"#fff","prod_border_width_o":"1","prod_border_color_o":"#E6E6E6","prod_border_radius_o":"0","offer_title_show":true,"offer_font_size":"20","offer_color":"#7200A0","offer_font_weight":"700","offer_font_style":"normal","offer_line_height":"22","prod_title_show_o":true,"prod_title_color_o":"#28313a","prod_title_font_size_o":"18","prod_title_font_weight_o":"700","prod_title_font_style_o":"normal","prod_title_line_height_o":"21","prod_desc_show_o":true,"prod_desc_show_full_o":true,"prod_desc_color_o":"#444F65","prod_desc_font_size_o":"16","prod_desc_font_weight_o":"400","prod_desc_font_style_o":"normal","prod_desc_line_height_o":"18","price_show_o":true,"price_color_o":"#7400A3","price_font_size_o":"20","price_font_weight_o":"700","price_font_style_o":"normal","price_line_height_o":"22","compare_price_show_o":true,"compare_price_color_o":"#777777","compare_price_font_size_o":"18","compare_price_font_weight_o":"700","compare_price_font_style_o":"normal","compare_price_line_height_o":"20","qty_show_o":true,"qty_background_o":"transparent","qty_font_color_o":"#999999","qty_btn_bg_o":"#999999","qty_btn_bg_hover_o":"transparent","qty_btn_color_o":"#000000","qty_btn_color_hover_o":"#fff","qty_border_radius_o":"5"},"translation":{"title":"Your Cart","description":"My description","add_to_cart_btn":"add","remove_btn":"Remove","reject_btn":"Or continue shopping","checkout_btn":"Button","save_text":"Save","total_btn":"Total:","shipping_btn":"Shipping","discounts_btn":"Discounts","timer_msg":"We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience and analyze website traffic. Learn more<\/a>.","timer_title":"Hurry up!","discount_code":"Discount Code","discount_apply_btn":"Apply","discount_applied":"Your Discount Code Applied","discount_not_exist":"No Such Discount Code","rewards_preunlock":"Spend {{amount}} more and receive free shipping!","rewards_postunlock":"Free shipping available!","empty_cart":"Your cart is currently empty","button_title":"Got it!","timer_title_days":"Days","timer_title_hours":"Hours","timer_title_min":"Minutes","timer_title_sec":"Seconds"},"custom_css":"","widget_active_img":"https:\/\/gdpr.good-apps.co\/assets\\\/images\\\/widgets\\\/preview\\\/cart\\\/style_1.png"};var goodgActiveApp=1;var goodgartSubtotal="";var goodgAppName="GAGDPR";var goodgartSubtotalContainer="";if(!goodgApp){var goodgApp=function(){if(!(goodgActiveApp||sessionStorage.getItem('goodgPreviewMode')))return;if(sessionStorage.getItem('goodgPreviewMode')){showPreviewMessage()};function showPreviewMessage(){let html=`
Preview Mode
`;document.body.insertAdjacentHTML('afterbegin',html)} let cartBuilded=false;let cartIsOpen=false;let cartToAnimate=null;let blockPopup;const url=location.href;const storeUrl=new URL(url).origin;styleLoader();if(Shopify.designMode){buildPreviewContainer();} function checkCookie(name){const cookies=document.cookie.split(';');for(let i=0;i{openPopup();},0) popupEvents();} function buildPreviewMessage(){const html=`

Hi, I’m your assistant from Good Apps GDPR. If you can’t see the Widget, click ‘Fix for ME’ and we’ll resolve it immediately.

`;const element=document.createElement("div");element.classList.add('goodg_minipopup','goodg_minipopup_hide');element.innerHTML=html;const rootDiv=document.body;rootDiv.append(element);} function addPreviewMessageStyles(){const styles=` .goodg_minipopup { position: fixed; left: 30px; bottom: 17%; width: 300px; height: 350px; padding: 30px; background: #fff; box-shadow: 0px 3px 16px 0px rgba(0,0,0,0.08); border: 1px solid #f1f1f2; border-radius: 8px; z-index: 999; transition: 0.7s; } @media (max-width: 480px){ .goodg_minipopup { width: 80%; } } @media (max-width: 380px){ .goodg_minipopup { padding: 15px; } } .goodg_minipopup_hide { transform: translateY(120%); opacity: 0; } .goodg_minipopup_content { position: relative; display: flex; height: 100%; flex-direction: column; justify-content: space-between; align-items: center; } .goodg_minipopup__close { position: absolute; width: 10px; top: -25px; right: -17px; transition: 0.3s; cursor: pointer; } @media (max-width: 380px){ .goodg_minipopup__close { width: 8px; top: -16px; right: -7px; } } .goodg_minipopup__close:hover { transform: scale(1.2); } .goodg_minipopup__message { text-align: center; margin: 0px; font-size: 16px; font-weight: 400; text-transform: none; } @media (max-width: 380px){ .goodg_minipopup__message { font-size: 14px; } } .goodg_minipopup__btns { display: flex; justify-content: center; gap: 10px; } @media (max-width: 480px){ .goodg_minipopup__btns { flex-direction: column; } } .goodg_minipopup__btn { padding: 10px 25px; border-radius: 6px; font-size: 12px; transition: 0.5s; cursor: pointer; border: none; color: white; } .goodg_minipopup__btn--yellow { background: #FFB73E; } .goodg_minipopup__btn--yellow:hover { background: #b09059; } .goodg_minipopup__btn--gray { background: #f9f9f9; color: #78829d } .goodg_minipopup__btn--gray:hover { background: #f1f1f2; } `;const element=document.createElement("style");element.innerHTML=styles;const rootDiv=document.head;rootDiv.append(element);};function openPopup(){const popup=document.querySelector('.goodg_minipopup');popup.classList.remove('goodg_minipopup_hide');};function closePopup(){const popup=document.querySelector('.goodg_minipopup');popup.classList.add('goodg_minipopup_hide');};function popupEvents(){const closeBtn=document.querySelector('.goodg_minipopup__btn--gray');const closeIcon=document.querySelector('.goodg_minipopup__close');closeBtn.addEventListener('click',()=>{closePopup();}) closeIcon.addEventListener('click',()=>{closePopup();}) const opener=document.querySelector('.goodg_minipopup__btn--yellow');opener.addEventListener('click',(e)=>{e.preventDefault();$crisp.push(["do","chat:open"]) $crisp.push(["do","message:send",["text","Hi, I’m using GA GDPR and can’t see the widget. Please assist."]]);})} function setCrisp(){const scriptTag=document.createElement('script');scriptTag.setAttribute('type','text/javascript');scriptTag.innerHTML=` window.$crisp=[]; window.CRISP_WEBSITE_ID="4e50b386-fde3-4da7-97f2-80e38503c5ab"; $crisp.push(["set", "user:email", "{{ $userEmail }}"]); $crisp.push(["set", "user:name", "{{ $storeOwnerName }}"]); $crisp.push(["set", "session:segments", [["GDPR"]]]); $crisp.push(["set", "session:event", ["user:welcome"]]); $crisp.push(["set", "session:data", [ [ ["myshopifyurl", "${storeUrl}"], ["totalsales", "{{ $allAmount }}"], ["totalOffers", "{{ $countOffers }}"] ] ]]); (function(){ d=document; s=d.createElement("script"); s.src="https://client.crisp.chat/l.js"; s.async=1; d.getElementsByTagName("head")[0].appendChild(s); })();`;const rootDiv=document.head;rootDiv.append(scriptTag);$crisp.push(["do","chat:close"]);} function buildPreviewContainer(){const rootDiv=document.querySelector('.goodg-app-container');if(!rootDiv)return;const html='The Good APP will be displayed here!';const element=document.createElement("div");element.classList.add('goodg-app-preview');element.style.padding='20px';element.style.border='1px solid #e4e4e4';element.style.borderRadius='8px';element.style.textAlign='center';element.innerHTML=html;rootDiv.append(element);} function clearPreviewContainer(){const previewContainer=document.querySelector('.goodg-app-container');if(previewContainer){previewContainer.innerHTML='';}} function buildWidget(goodgartWidgetObj){if(!goodgartWidgetObj){return} if(Shopify.designMode){clearPreviewContainer();} buildIframe(goodgartWidgetObj);build(goodgartWidgetObj)} function build(goodgartWidgetObj){iframe=document.getElementById('goodg-widget');buildCart(goodgartWidgetObj);addStyling(goodgartWidgetObj);if(!cartBuilded)return;cartToAnimate=getAppSelector('.goodg-cart__body');productsWrapper=getAppSelector('.goodg-cart__products');setOpenCartEvent(goodgartWidgetObj);setCloseCartEvent(goodgartWidgetObj);openCart(goodgartWidgetObj);} function buildIframe(goodgartWidgetObj){let position=goodgartWidgetObj.design_type.position;const html=`
`;const element=document.createElement("div");element.setAttribute("id","goodg-app");element.innerHTML=html;element.style.zIndex='99999999999999999';function applyStyles(position,element){const mediaQuery=window.matchMedia('(max-width: 480px)');if(position=="left_bottom"||position=="right_bottom"){if(mediaQuery.matches){element.style.bottom='0px';}else{element.style.bottom='5px';}}if(position=="left_top"||position=="right_top"){if(mediaQuery.matches){element.style.top='0px';}else{element.style.top='5px';}}} if(position=="full_bottom"){element.style.bottom='0' element.style.left='0';element.style.width='100%';document.querySelector('body').append(element);}if(position=="full"){element.style.top='0';element.style.width='100%';document.querySelector('body').prepend(element);}if(position=="left_bottom"){addCommonStyle();element.style.bottom='5px';element.style.left='5px';applyStyles(position,element)}if(position=="right_bottom"){addCommonStyle();element.style.bottom='5px';element.style.right='5px';applyStyles(position,element)}if(position=="right_top"){addCommonStyle();element.style.top='5px';element.style.right='5px';applyStyles(position,element)}if(position=="left_top"){addCommonStyle();element.style.top='5px';element.style.left='5px';applyStyles(position,element)} window.addEventListener('resize',function(){applyStyles(position,element);});function addCommonStyle(){document.querySelector('body').append(element);element.style.position='fixed';element.style.width='400px';} if(position=="full"||position=="full_bottom"){let fixed_position=goodgartWidgetObj.design_type.fixed_position;if(fixed_position){element.style.position='fixed' element.style.zIndex='99999999999999999';} let embeded=goodgartWidgetObj.design_type.embeded;if(embeded){element.style.position='inherit'} if(embeded&&fixed_position){element.style.position='sticky';}}} function styleLoader(){const headID=document.getElementsByTagName('head')[0];const link=document.createElement('link');link.type='text/css';link.id='goodhlundlesCss' link.rel='stylesheet';headID.appendChild(link);link.href=goodgbaseUrl+`css/gdpr.css?v=${goodgVersion}`;};function openCart(goodgartWidgetObj){const cartEl=document.querySelector('#goodg-widget');cartWrapper=cartEl.closest('div') if(!cartWrapper)return;cartWrapper.style.display="block";cartToAnimate.classList.add('spinner');cartToAnimate.setAttribute('class','goodg-cart__body');cartToAnimate.classList.add('animate__animated',`${goodgartWidgetObj.design_type ? goodgartWidgetObj.design_type.animation : 'slideInRight'}`);cartIsOpen=true;} function setOpenCartEvent(goodgartWidgetObj){if(!cartIsOpen){openCart(goodgartWidgetObj);}} function setCloseCartEvent(goodgartWidgetObj){const rootEl=document.querySelector('#goodg-root');const cartInWrapper=rootEl.querySelector('.goodg-cart__close');const cartCheckout=rootEl.querySelector('.goodg-cart__checkout');cartInWrapper.addEventListener('click',function(e){closeCart(goodgartWidgetObj,cartInWrapper);}) cartCheckout.addEventListener('click',function(e){SetCookie();closeCart(goodgartWidgetObj,cartCheckout);if(goodgartWidgetObj.main.button_redirect_event=="1"){e.stopPropagation();e.preventDefault();}})} function SetCookie(){const now=new Date();const expirationDate=new Date(now.getTime()+30*24*60*60*1000);document.cookie="goodg_block_popup=; expires="+expirationDate.toUTCString()+"; path=/";} function closeCart(goodgartWidgetObj,cartInWrapper){const cartToAnimate=cartInWrapper.closest(".goodg-cart__body");let animationClass=goodgartWidgetObj.design_type?goodgartWidgetObj.design_type.animation:'animate__slideOutRight';switch(animationClass){case'animate__slideInLeft':cartToAnimate.classList.add('animate__animated','animate__slideOutLeft');break;case'animate__slideInRight':cartToAnimate.classList.add('animate__animated','animate__slideOutRight');break;case'animate__fadeIn':cartToAnimate.classList.add('animate__animated','animate__fadeOut');break;case'animate__slideInUp':cartToAnimate.classList.add('animate__animated','animate__slideOutDown');break;case'animate__slideInDown':cartToAnimate.classList.add('animate__animated','animate__slideOutUp');break;case'animate__zoomIn':cartToAnimate.classList.add('animate__animated','animate__zoomOut');break;case'animate__fadeInTopLeft':cartToAnimate.classList.add('animate__animated','animate__fadeOutTopLeft');break;case'animate__fadeInTopRight':cartToAnimate.classList.add('animate__animated','animate__fadeOutTopRight');break;default:break;} setTimeout(()=>{let cartWrapper=cartInWrapper.closest("#goodg-app");cartWrapper.style.display="none";const OfferProducts=getAppSelector('.goodg-cart__offer-products-wrap');if(OfferProducts){if(OfferProducts.querySelector('.goodg-cart__offer-products')){OfferProducts.querySelector('.goodg-cart__offer-products').remove();} if(OfferProducts.querySelector('h2')){OfferProducts.querySelector('h2').remove();}}},1000)} async function offerFetch(offerParams){const options={headers:{'Content-Type':'application/json',"Accept":"application/json"}};const domain=goodgShop;const product_id=offerParams.productId?`&product_id=${offerParams.productId}`:'';const variants_id=offerParams.variantsId?`&variants_id=${offerParams.variantsId}`:'';const trigger_event=offerParams.triggerType;const display_on_device=window.innerWidth>991?'3':'2';const cart_value=0;let logged_user;if(Shopify.designMode){logged_user='1';}else{logged_user=ShopifyAnalytics.meta.page.customerId?'1':'0';} const cart=0;let url=goodgApiUrl+`api/front/offers?domain=${domain}${product_id}${variants_id}&cart=${cart}&display_on_device=${display_on_device}&cart_value=${cart_value}&logged_user=${logged_user}&trigger_event=${trigger_event}`;const resp=await fetch(url,options);if(!resp.ok){throw new Error(`HTTP error, status = ${resp.status}`);} return await resp.json();} function getAppSelector(element){return document.querySelector(element);} function addStyling(goodgartWidgetObj){const rootEl='goodg-root';let head=getAppSelector('head');let goodgartEl=getAppSelector('.goodg-cart');goodgartEl.classList.add(`goodg-popup__position--${goodgartWidgetObj.design_type ? goodgartWidgetObj.design_type.position : 'sidebar_right'}`);if(!goodgartWidgetObj.offer_product)return;let style=` `;head.insertAdjacentHTML('beforeend',style);} function buildCart(goodgartWidgetObj){let template=goodgartWidgetObj.main.timer_template;let link_redirect=goodgartWidgetObj.translation.button_url;const appWrapper=getAppSelector('#goodg-root');let redirect='';if(link_redirect===null){redirect=window.location.href;}else{redirect=link_redirect;} if(!appWrapper)return;let timerTxt1=goodgartWidgetObj.translation.timer_msg;let closeBtnShow=goodgartWidgetObj.top.close_show===true?'':'hide';let btn_title='';const title=goodgartWidgetObj.translation.button_title;if(title){btn_title=title;}else{btn_title='Default Title';} let title_button=btn_title;const cartHtml=`
`;appWrapper.insertAdjacentHTML('beforeend',cartHtml);cartBuilded=true;}};goodgApp();}