'use client';
import{jsx as t}from"react/jsx-runtime";import{createStyle as e,createClass as o,createAttr as s}from"@gem-sdk/system";import c from"next/dynamic";import{getButtonClasses as i,getButtonWrapperClasses as r}from"./common/classes.js";import{getSPButton as m}from"./common/helpers.js";import{getButtonWrapperStyles as u}from"./common/styles.js";import{useShopPayButton as h}from"../../hooks/useShopPayButton.js";let DynamicCheckoutBlack=c(()=>import("./icons/DynamicCheckoutBlack.js")),DynamicCheckoutPurple=c(()=>import("./icons/DynamicCheckoutPurple.js")),DynamicCheckoutWhite=c(()=>import("./icons/DynamicCheckoutWhite.js")),ExpressCheckoutBlack=c(()=>import("./icons/ExpressCheckoutBlack.js")),ExpressCheckoutPurple=c(()=>import("./icons/ExpressCheckoutPurple.js")),ExpressCheckoutWhite=c(()=>import("./icons/ExpressCheckoutWhite.js")),ShopPayButton=({style:c,styles:n,setting:p,className:a,builderAttrs:l})=>{let{variants:k,storeUrl:C,handleOnPay:y}=h(p);if(!C)return t("div",{...l,children:"URL Not Found"});let d=m({styles:n,buttons:{DynamicCheckoutBlack,DynamicCheckoutPurple,DynamicCheckoutWhite,ExpressCheckoutBlack,ExpressCheckoutPurple,ExpressCheckoutWhite}}),x=e({...u(c,n)}),j=o({...i()}),B=o({...r(a)}),P=s({disabled:!k?.length,"aria-label":"Buy with Shop Pay"});return t("div",{...l,style:x,className:B,children:t("button",{...P,className:j,onClick:()=>y({inputWidth:600,inputHeight:600}),children:t(d,{})})})};export{ShopPayButton as default};
