import{proxyCustomElement,HTMLElement,createEvent,h}from"@stencil/core/internal/client";import{g as getAdditionalErrorMessages}from"./getters4.js";import{s as state}from"./store2.js";import{d as defineCustomElement$2}from"./sc-alert2.js";import{d as defineCustomElement$1}from"./sc-icon2.js";const ScFormErrorProvider=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.scUpdateError=createEvent(this,"scUpdateError",7),this.error=void 0}handleErrorUpdate(e){this.scUpdateError.emit(e)}render(){return(null==state?void 0:state.message)?h("sc-alert",{exportparts:"base, icon, text, title, message, close",type:"danger",scrollOnOpen:!0,open:!!(null==state?void 0:state.message),closable:!!(null==state?void 0:state.dismissible)},(null==state?void 0:state.message)&&h("span",{slot:"title",innerHTML:state.message}),(getAdditionalErrorMessages()||[]).map(((e,t)=>h("div",{innerHTML:e,key:t})))):null}static get watchers(){return{error:["handleErrorUpdate"]}}},[1,"sc-error",{error:[16]},void 0,{error:["handleErrorUpdate"]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-error","sc-alert","sc-icon"].forEach((e=>{switch(e){case"sc-error":customElements.get(e)||customElements.define(e,ScFormErrorProvider);break;case"sc-alert":customElements.get(e)||defineCustomElement$2();break;case"sc-icon":customElements.get(e)||defineCustomElement$1()}}))}export{ScFormErrorProvider as S,defineCustomElement as d};