import{r,h as s,H as i}from"./p-dfbe004d.js";import{_ as o}from"./p-8415f806.js";import"./p-fd56940f.js";import{o as t}from"./p-d63f2554.js";import"./p-9a7a47e8.js";const l=class{constructor(s){r(this,s)}getErrorMessage(r){return"order.line_items.price.blank"===r.code?o("This product is no longer purchasable.","surecart"):s("span",{innerHTML:null==r?void 0:r.message})}errorMessage(){var r,s,i,o,t,l;return(null===(i=null===(s=null===(r=this.error)||void 0===r?void 0:r.additional_errors)||void 0===s?void 0:s[0])||void 0===i?void 0:i.message)?this.getErrorMessage(null===(t=null===(o=this.error)||void 0===o?void 0:o.additional_errors)||void 0===t?void 0:t[0]):(null===(l=null==this?void 0:this.error)||void 0===l?void 0:l.message)?this.getErrorMessage(null==this?void 0:this.error):""}render(){return!this.errorMessage()||["finalizing","updating"].includes(this.checkoutState)?s(i,{style:{display:"none"}}):s(i,null,s("sc-alert",{type:"danger",scrollOnOpen:!0,open:!!this.errorMessage()},s("span",{slot:"title"},this.errorMessage())),s("slot",null))}};t(l,["checkoutState","error"],!1);export{l as sc_checkout_form_errors}