import{proxyCustomElement,HTMLElement,createEvent,h,Host}from"@stencil/core/internal/client";import{c as classnames}from"./index2.js";import{d as defineCustomElement$4}from"./va-checkbox2.js";import{d as defineCustomElement$3}from"./va-icon2.js";import{d as defineCustomElement$2}from"./va-link2.js";const vaPrivacyAgreementCss='.sr-only{border:0;clip:rect(0, 0, 0, 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}button:not([disabled]):focus,select:not([disabled]):focus,a:not([disabled]):focus,h1:focus,input:not([disabled]):focus,textarea:not([disabled]):focus,#form-question [role=\'option\']:focus,*[tabindex]:focus,a.va-sidenav-submenu__link:focus{outline:2px solid var(--vads-color-action-focus-on-light);outline-offset:2px}.usa-sr-only{position:absolute;left:-999em;right:auto}.usa-label{font-family:Source Sans Pro Web, "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans;font-size:1.06rem;line-height:1.3;display:block;font-weight:normal;margin-top:1.5rem;max-width:30rem}.usa-label--error{font-weight:700;margin-top:0}.usa-label--required{color:#b50909}:host{display:block}va-checkbox::part(checkbox){max-width:100%}a{color:var(--vads-color-link)}.privacy-policy-icon{margin-left:4px;vertical-align:text-top}',VaPrivacyAgreementStyle0=vaPrivacyAgreementCss,VaPrivacyAgreement$1=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.componentLibraryAnalytics=createEvent(this,"component-library-analytics",7),this.vaChange=createEvent(this,"vaChange",7),this.handleCheckboxChange=e=>{this.checked=e.target.checked,this.vaChange.emit({checked:this.checked}),this.enableAnalytics&&this.componentLibraryAnalytics.emit({componentName:"va-privacy-agreement",action:"click",details:{checked:this.checked}})},this.checked=!1,this.showError=!1,this.enableAnalytics=!1}errorMessage(){return this.showError&&!this.checked?"You must accept the privacy policy before continuing.":null}render(){const e=classnames({"usa-label--error":this.showError});return h(Host,{key:"addee93a7c7cabac9016da6e40ff259b502ce823"},h("va-checkbox",{key:"4d1434e0166ebdb9ab7e09fcf9f2b3bd48079b3f",required:!0,error:this.errorMessage(),id:"checkbox",label:"I have read and accept the privacy policy.",checked:this.checked,onVaChange:this.handleCheckboxChange},h("span",{key:"a5fe33437ef915c0cdad4ea9cd0ffd807ba758a3",class:`${e} description`,slot:"description"},"Please read and accept the ",h("va-link",{key:"8ae27a7e2ade8a43b1960bab9de0b69289168ac3",href:"/privacy-policy/",text:"privacy policy",external:!0}),".")))}static get style(){return VaPrivacyAgreementStyle0}},[1,"va-privacy-agreement",{checked:[1028],showError:[4,"show-error"],enableAnalytics:[4,"enable-analytics"]}]);function defineCustomElement$1(){"undefined"!=typeof customElements&&["va-privacy-agreement","va-checkbox","va-icon","va-link"].forEach(e=>{switch(e){case"va-privacy-agreement":customElements.get(e)||customElements.define(e,VaPrivacyAgreement$1);break;case"va-checkbox":customElements.get(e)||defineCustomElement$4();break;case"va-icon":customElements.get(e)||defineCustomElement$3();break;case"va-link":customElements.get(e)||defineCustomElement$2()}})}const VaPrivacyAgreement=VaPrivacyAgreement$1,defineCustomElement=defineCustomElement$1;export{VaPrivacyAgreement,defineCustomElement};