import{r as s,j as h}from"./index.1ec44e23.js";import{u as p}from"./ef11f8a9.js";import{BaseButton as k}from"./ff692d55.js";function x(i){const{createInstantCheckout:r,checkoutUrl:e}=p(),[o,u]=s.exports.useState(!1),{quantity:t,variantId:n,onClick:l,attributes:a,children:d,...c}=i;s.exports.useEffect(()=>{e&&(window.location.href=e)},[e]);const f=s.exports.useCallback(()=>{u(!0),r({lines:[{quantity:t!=null?t:1,merchandiseId:n,attributes:a}]})},[r,t,n,a]);return h(k,{disabled:o!=null?o:c.disabled,...c,onClick:l,defaultOnClick:f,children:d})}export{x as B};
//# sourceMappingURL=3ee3f568.js.map