import{isLocalEnv as s,baseAssetURL as o,template as t}from"@gem-sdk/core";import{createStyle as e,createClass as r,createAttr as i,createStateOrContext as p,If as c}from"@gem-sdk/system";import{getSettingPreloadData as m}from"../../../helpers.js";import{getButtonClasses as l,getButtonWrapperClasses as u}from"./common/classes.js";import{getSPButton as a}from"./common/helpers.js";import{getButtonWrapperStyles as h}from"./common/styles.js";import n from"./icons/DynamicCheckoutBlack.liquid.js";import k from"./icons/DynamicCheckoutPurple.liquid.js";import d from"./icons/DynamicCheckoutWhite.liquid.js";import f from"./icons/ExpressCheckoutBlack.liquid.js";import y from"./icons/ExpressCheckoutPurple.liquid.js";import j from"./icons/ExpressCheckoutWhite.liquid.js";let C=({style:C,styles:g,setting:$,className:E,builderAttrs:b})=>{let S=a({styles:g,buttons:{DynamicCheckoutBlack:n({}),DynamicCheckoutPurple:k({}),DynamicCheckoutWhite:d({}),ExpressCheckoutBlack:f({}),ExpressCheckoutPurple:y({}),ExpressCheckoutWhite:j({})}}),x=e({...h(C,g)}),P=r({...l()}),q=r({...u(E)}),B=i({disabled:!1,"aria-label":"Buy with Shop Pay"}),D=p({setting:JSON.stringify($),shop_url:"{{shop.url}}"});return t`
    <gp-shop-pay-button
      ${{...b}}
      style="${x}"
      class="${q}"
      gp-data='${D}'
    >
      <button
        ${{...B}}
        class="${P}"
      >
        ${S}
      </button>
    </gp-shop-pay-button>
    ${c(s,`<script ${m('class="gps-link" delay',"src")}="{{ 'gp-shop-pay-button-v7-5.js' | asset_url }}" defer="defer"></script>`,`<script ${m('class="gps-link" delay',"src")}="${o}/assets-v2/gp-shop-pay-button-v7-5.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
  `};export{C as default};
