import{createElement as e}from"../../../external/preact/dist/preact.js";import t from"../Button/Button.js";import{useCoreContext as r}from"../../../core/Context/CoreProvider.js";import{createButtonLabel as o,createSecondaryLabel as n}from"./utils.js";import c from"./components/SecondaryButtonLabel.js";import{useAmount as l,useSecondaryAmount as i}from"../../../core/Context/AmountProvider.js";import{isAmountValid as s}from"../../../utils/amount-util.js";function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function p(e,t){if(null==e)return{};var r,o,n,c={};if("undefined"!=typeof Reflect&&Reflect.ownKeys){for(r=Reflect.ownKeys(e),n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(c[o]=e[o]);return c}if(c=function(e,t){if(null==e)return{};var r,o,n={},c=Object.getOwnPropertyNames(e);for(o=0;o<c.length;o++)r=c[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r]);return n}(e,t),Object.getOwnPropertySymbols)for(r=Object.getOwnPropertySymbols(e),n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(c[o]=e[o]);return c}const f=f=>{let{customAmount:b,classNameModifiers:m=[],label:y}=f,O=p(f,["customAmount","classNameModifiers","label"]);const{amount:j,isZeroAuth:d}=l(),{secondaryAmount:g}=i(),{i18n:P}=r(),w=o(P,y,j,d,b,g),v=n(P,g,s(j),d,y),h=O.disabled||"loading"===O.status;return e(t,a(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){u(e,t,r[t])})}return e}({},O),{disabled:h,classNameModifiers:[...m,"pay"],label:w}),v&&e(c,{label:v}))};export{f as default};
//# sourceMappingURL=PayButton.js.map
