'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),system=require("@gem-sdk/system"),dynamic=require("next/dynamic"),classes=require("./common/classes.js"),helpers=require("./common/helpers.js"),styles=require("./common/styles.js"),useShopPayButton=require("../../hooks/useShopPayButton.js");const DynamicCheckoutBlack=dynamic(()=>Promise.resolve().then(function(){return require("./icons/DynamicCheckoutBlack.js")})),DynamicCheckoutPurple=dynamic(()=>Promise.resolve().then(function(){return require("./icons/DynamicCheckoutPurple.js")})),DynamicCheckoutWhite=dynamic(()=>Promise.resolve().then(function(){return require("./icons/DynamicCheckoutWhite.js")})),ExpressCheckoutBlack=dynamic(()=>Promise.resolve().then(function(){return require("./icons/ExpressCheckoutBlack.js")})),ExpressCheckoutPurple=dynamic(()=>Promise.resolve().then(function(){return require("./icons/ExpressCheckoutPurple.js")})),ExpressCheckoutWhite=dynamic(()=>Promise.resolve().then(function(){return require("./icons/ExpressCheckoutWhite.js")})),ShopPayButton=({style:e,styles:s,setting:t,className:r,builderAttrs:n})=>{let{variants:u,storeUrl:o,handleOnPay:i}=useShopPayButton.useShopPayButton(t);if(!o)return jsxRuntime.jsx("div",{...n,children:"URL Not Found"});let c=helpers.getSPButton({styles:s,buttons:{DynamicCheckoutBlack,DynamicCheckoutPurple,DynamicCheckoutWhite,ExpressCheckoutBlack,ExpressCheckoutPurple,ExpressCheckoutWhite}}),a=system.createStyle({...styles.getButtonWrapperStyles(e,s)}),l=system.createClass({...classes.getButtonClasses()}),h=system.createClass({...classes.getButtonWrapperClasses(r)}),m=system.createAttr({disabled:!u?.length,"aria-label":"Buy with Shop Pay"});return jsxRuntime.jsx("div",{...n,style:a,className:h,children:jsxRuntime.jsx("button",{...m,className:l,onClick:()=>i({inputWidth:600,inputHeight:600}),children:jsxRuntime.jsx(c,{})})})};exports.default=ShopPayButton;
