"use strict";var o=require("@gem-sdk/core");const t=(o,t,n=!0)=>`
    ${o?`width: ${o}${n?"!important;":""};`:""}
    ${t?`height: ${t}${n?"!important;":""};`:""}
  `,n=(o,t)=>{let n=o&&"desktop"!==o?`-${o}`:"",e={top:t[`--pt${n}`],bottom:t[`--pb${n}`],left:t[`--pl${n}`],right:t[`--pr${n}`]};return`
    padding-top: ${e.top?`${e.top} !important;`:""};
    padding-bottom: ${e.bottom?`${e.bottom} !important;`:""};
    padding-left: ${e.left?`${e.left} !important;`:""};
    padding-right: ${e.right?`${e.right} !important;`:""};
  `},e=o=>o?`font-size: ${o} !important;`:"",a=o=>o?`line-height: ${o} !important;`:"",r=o=>o?`letter-spacing: ${o} !important;`:"",d=o=>`${o?`text-align: ${o} !important;`:""}`,i=(t,n)=>!t||n?.forceIgnore?"":"string"==typeof t&&t.includes("linear-gradient")?`background-image: ${t};`:`background-color: ${o.getSingleColorVariable(t)};`,p=({uid:p,device:s,styles:b,composeGlobalSize:h})=>{let{backgroundColorV2:u,backgroundImage:m}=b||{},_={...m,hover:m?.hover?.image?m?.hover:m?.normal},l={hover:u?.hover||u?.normal};return`
    .wrap__button--unbranded__${p} {
      ${d(b?.align?.[s])}
    }

    .wrap__button--unbranded__${p} .shopify-payment-button {
      width: 100%;
    }

    .wrap__button--unbranded__${p} .shopify-payment-button .shopify-payment-button__button--unbranded {
      width: 100%;
      text-transform: unset;
      ${"desktop"!==s?`
        ${a(b?.typo?.custom?.lineHeight?.[s])}
        ${e(b?.typo?.custom?.fontSize?.[s])}
        ${r(b?.typo?.custom?.letterSpacing?.[s])}
      `:""}
      ${n(s,h.padding)}
      ${t(h.width[s]||"auto",h.height[s]||"auto",!1)}
      ${o.composeShadowCss({boxShadowValue:b?.boxShadowBtn?.normal,hasBoxShadow:b?.hasBoxShadowBtn?.normal})||""}
      ${o.composeCornerCss(b?.roundedBtnV2?.normal,!0)}
      ${"desktop"===s?o.composeTypographyV2Css(b?.typo,!0):""}
    }

    .wrap__button--unbranded__${p} .shopify-payment-button .shopify-payment-button__button--unbranded:hover {
      ${o.composeShadowCss({boxShadowValue:b?.boxShadowBtn?.hover,hasBoxShadow:b?.boxShadowBtn?.hover?.type!=="none",important:!0})||""}
      ${o.composeTextHoverColorCss(b?.textColor,!0)};
      ${o.composeCornerCss(b?.roundedBtnV2?.hover,!0)}
    }

    .wrap__button--unbranded__${p} .shopify-payment-button .shopify-payment-button__button--unbranded::before {
      ${o.composeBorderCss(b?.borderBtnV2?.normal)}
      ${o.composeCornerCss(b?.roundedBtnV2?.normal)}
      ${i(b?.backgroundColorV2?.normal,{forceIgnore:!!b?.backgroundImage?.normal?.image})}
      ${o.composeBackgroundImageCss(b?.backgroundImage,{device:s,state:"normal"})}
      ${o.composeShadowCss({boxShadowValue:b?.boxShadowBtn?.normal,hasBoxShadow:b?.hasBoxShadowBtn?.normal})||""}


    }

    .wrap__button--unbranded__${p} .shopify-payment-button .shopify-payment-button__button--unbranded:hover::before {
      ${b?.backgroundImage?.hover||b?.backgroundColorV2?.hover?"background-image : unset;":""}
      ${b?.borderBtnV2?.hover?.borderType!=="none"?o.composeBorderCss(b?.borderBtnV2?.hover):""}
      ${b?.roundedBtnV2?.hover?.radiusType!=="none"?o.composeCornerCss(b?.roundedBtnV2?.hover):""}
      ${l?.hover?i(l?.hover,{forceIgnore:!!_?.hover?.image?.src}):""}
      ${_?.hover?.image?.src?o.composeBackgroundImageCss(_,{device:s,state:"hover"}):""}
      ${o.composeShadowCss({boxShadowValue:b?.boxShadowBtn?.hover,hasBoxShadow:b?.boxShadowBtn?.hover?.type!=="none",important:!0})||""}
    }
  `};exports.getButtonStyles=({styles:t,uid:n})=>{let e={width:o.getWidthHeightGlobalSize("width",t?.globalSize),height:o.getWidthHeightGlobalSize("height",t?.globalSize),padding:o.getPaddingGlobalSize(t?.globalSize)},a=`
    .wrap__button--unbranded__${n} .shopify-payment-button {
      display: inline-block;
      min-height: unset !important;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button div {
      width: 100%;
      margin-top: 0px !important;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button .shopify-payment-button__more-options {
      display: none;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button .shopify-payment-button__button--unbranded {
      max-width: 100%;
      min-width: unset;
      min-height: unset !important;
      background-color: unset !important;
      position: relative;
      border: none !important;
      margin: 0;
      z-index: 0;
      border-radius: unset;
      width: 100%;
      display: inline-flex;
      justify-content: center;
      align-items: center;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button .shopify-payment-button__button--unbranded::before {
      content: "";
      height: 100%;
      width: 100%;
      position: absolute;
      top: 0;
      left: 0;
      pointer-events: none;
      z-index: -1;
      transition-duration: 0.2s;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button .shopify-payment-button__button--unbranded::after {
      border-radius: 0;
      box-shadow: none;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button .shopify-payment-button__button--unbranded::after:hover {
      border-radius: 0;
      box-shadow: none;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button > div {
      max-width: 100%;
    }

    .wrap__button--unbranded__${n} .shopify-payment-button > div > div {
      max-width: 100%;
    }

    ${p({device:"desktop",uid:n,styles:t,composeGlobalSize:e})}

    @media only screen and (max-width: 1024px) and (min-width: 768px) {
      ${p({device:"tablet",uid:n,styles:t,composeGlobalSize:e})}
    }

    @media only screen and (max-width: 767px) {
      ${p({device:"mobile",uid:n,styles:t,composeGlobalSize:e})}
    }
  `;return a};
