(()=>{"use strict";var e,t={898:(e,t,o)=>{o.d(t,{g:()=>s});const i=window.React,n=window.wp.hooks,l=window.wp.element,r=window.ReactDOM,c=(window.wp.apiFetch,window.lodash),a=({pageType:e})=>{const[t,o]=(0,l.useState)([]),r=(0,i.useCallback)((0,c.debounce)((()=>{wp.apiFetch({path:"flexible-shipping/v1/free-shipping-notice",method:"GET"}).then((e=>{o(e)})).catch((e=>{console.log(e)}))}),2e3),[]);return(0,l.useEffect)((()=>{document.body.addEventListener("wc-blocks_added_to_cart",(e=>{r()})),(0,n.addAction)("flexible-shipping-cart-updated","flexible-shipping",r),r()}),[]),(0,i.createElement)(i.Fragment,null,t.map(((t,o)=>null==e||t.blocks.includes(e)?(0,i.createElement)("div",{key:o,className:"woocommerce-info",dangerouslySetInnerHTML:{__html:t.content}}):null)))},s=({checkoutExtensionData:e,cart:t,extensions:o})=>{const{setExtensionData:c}=e||{};return(0,l.useEffect)((()=>{0===document.querySelectorAll(".flexible-shipping-free-shipping-root").length&&void 0!==o["flexible-shipping-free-shipping-notice-block-integration"]&&(e=>{let t=document.getElementsByClassName("wp-block-woocommerce-cart");if(0===t.length&&(t=document.getElementsByClassName("wp-block-woocommerce-checkout")),t.length>0){const o=document.createElement("div");t[0].parentNode.insertBefore(o,t[0]),(0,r.createRoot)(o).render((0,i.createElement)(a,{pageType:e}))}})(o["flexible-shipping-free-shipping-notice-block-integration"].page_type)}),[]),(0,l.useEffect)((()=>{c&&c("flexible-shipping-free-shipping-notice-block-integration","fakeField","")}),[]),(0,l.useEffect)((()=>{(0,n.doAction)("flexible-shipping-cart-updated","flexible-shipping",{})}),[t]),(0,i.createElement)(i.Fragment,null)}},701:(e,t,o)=>{const i=window.wc.blocksCheckout;var n=o(898);const l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"flexible-shipping/free-shipping-notice-block-integration","version":"1.0.0","title":"Free Shipping Notice Block Integration","category":"woocommerce","description":"Adds a notice to the checkout and cart when free shipping is available.","supports":{"html":false,"align":false,"multiple":false,"reusable":false},"parent":["woocommerce/checkout-shipping-methods-block","woocommerce/cart-totals-block"],"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"textdomain":"flexible-shipping","editorScript":"file:./index.js","style":"file:./style-index.css","viewScript":"file:./frontend.js"}');(0,i.registerCheckoutBlock)({metadata:l,component:n.g})}},o={};function i(e){var n=o[e];if(void 0!==n)return n.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,i),l.exports}i.m=t,e=[],i.O=(t,o,n,l)=>{if(!o){var r=1/0;for(p=0;p=l)&&Object.keys(i.O).every((e=>i.O[e](o[a])))?o.splice(a--,1):(c=!1,l0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[o,n,l]},i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={979:0,765:0,786:0};i.O.j=t=>0===e[t];var t=(t,o)=>{var n,l,[r,c,a]=o,s=0;if(r.some((t=>0!==e[t]))){for(n in c)i.o(c,n)&&(i.m[n]=c[n]);if(a)var p=a(i)}for(t&&t(o);si(701)));n=i.O(n)})();