(()=>{"use strict";const e=window.wc.blocksCheckout,t=window.React,a=window.wp.element,o=window.wc.wcSettings,{optInEmailsDefaultText:n}=(0,o.getSetting)("wcal-gdpr-email_data",""),{optOutEmailsDefaultText:c}=(0,o.getSetting)("wcal-gdpr-email_data",""),{optOutEmailsConfirmationText:l}=(0,o.getSetting)("wcal-gdpr-email_data",""),{ajaxUrl:r}=(0,o.getSetting)("wcal-gdpr-email_data"),i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"woocommerce-abandoned-cart/wcal-gdpr-email","version":"1.0.0","title":"GDPR Email Compliance","category":"woocommerce","parent":["woocommerce/checkout-contact-information-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"woocommerce-abandoned-cart","editorScript":"file:./build/index.js"}');(0,e.registerCheckoutBlock)({metadata:i,component:({children:e,checkoutExtensionData:o})=>{const[r,i]=(0,a.useState)(!1),d=()=>{m("wcal_gdpr_no_thanks",!0),i(!0)},m=(e,t)=>{const a=localStorage.getItem(e);localStorage.setItem(e,t);const o=new StorageEvent("storage",{key:e,oldValue:a,newValue:t,url:window.location.href,storageArea:localStorage});window.dispatchEvent(o)};return(0,t.createElement)("div",null,r?null:(0,t.createElement)((function(){return(0,t.createElement)("div",{id:"wcal_gdpr_msg"},n," ",(0,t.createElement)("a",{id:"wcal_gdpr_no_thanks",onClick:d},c))}),null),r?(0,t.createElement)((function({display:e}){return(0,t.createElement)("div",{id:"wcal_gdpr_opt_out_confirmation"},l)}),null):null)}})})();