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