import{r as s,h as t,F as i}from"./p-dfbe004d.js";import{a as r}from"./p-f56cd460.js";import{a}from"./p-a41f5fb3.js";import{s as e}from"./p-ea78c070.js";import{_ as o}from"./p-8415f806.js";import"./p-fd56940f.js";import{o as c}from"./p-d63f2554.js";import"./p-10aa7556.js";import"./p-35c4916d.js";import"./p-1c2e2695.js";import"./p-6c2a2148.js";import"./p-9a7a47e8.js";const l=class{constructor(t){s(this,t),this.type="primary",this.size="medium",this.full=!0,this.mode="live",this.currencyCode="usd",this.secureNotice=!0}renderPayPalButton(s){const{client_id:i,account_id:e,merchant_initiated_enabled:o}=((s=[],t,i)=>{var r;return(null===(r=(s||[]).find((s=>(null==s?void 0:s.processor_type)===t&&(null==s?void 0:s.live_mode)===!("live"!==i))))||void 0===r?void 0:r.processor_data)||{}})(a(),"paypal",this.mode);return i||e?t("sc-paypal-buttons",{buttons:s,busy:this.busy||r(),mode:this.mode,order:this.order,merchantInitiated:o,"currency-code":this.currencyCode,"client-id":i,"merchant-id":e,label:"checkout",color:"blue"}):null}render(){return t(i,null,"paypal"===e.id&&!(null==e?void 0:e.method)&&this.renderPayPalButton(["paypal"]),"paypal"===e.id&&"card"===(null==e?void 0:e.method)&&this.renderPayPalButton(["card"]),t("sc-button",{hidden:["paypal","paypal-card"].includes(e.id),submit:!0,type:this.type,size:this.size,full:this.full,loading:this.loading||this.paying,disabled:this.loading||this.paying||this.busy||r()},!!this.icon&&t("sc-icon",{name:this.icon,slot:"prefix"}),t("slot",null,o("Purchase","surecart")),this.showTotal&&t("span",null," ",t("sc-total",null))),this.secureNotice&&"https:"===location.protocol&&t("div",{class:"sc-secure-notice"},t("sc-secure-notice",null,this.secureNoticeText||o("This is a secure, encrypted payment.","surecart"))))}};c(l,["busy","loading","paying","processors","processor","mode","currencyCode","order"],!1),l.style="sc-order-submit{display:block;width:auto;display:grid;gap:var(--sc-form-row-spacing)}.sc-secure-notice{display:flex;justify-content:center}";export{l as sc_order_submit}