"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[7470],{3393:(t,e,i)=>{i.d(e,{y:()=>s});var a=i(9696),n=i(79365),h=i(81365);const s=(...t)=>(0,a.Zz)(n.XX,n._$,n.yF,n.jd)((0,h.q)(...t))},24011:(t,e,i)=>{i.r(e),i.d(e,{HcaptchaClass:()=>l,componentName:()=>c});var a=i(25964),n=i(79365),h=i(3393),s=i(9696);const c=(0,i(97810).xE)("hcaptcha"),o=["enabled","site-key"],p=(0,h.y)({componentName:c,baseSelector:":host > div"}),l=(0,s.Zz)((0,n.RF)({mappings:{hostWidth:[{selector:()=>":host",property:"width"}],hostDirection:{property:"direction"},verticalPadding:[{property:"padding-top"},{property:"padding-bottom"}],horizontalPadding:[{property:"padding-left"},{property:"padding-right"}],maxHeight:[{selector:">img",property:"height"},{selector:">#hcaptcha",property:"height"}],maxWidth:[{selector:">img",property:"max-width"},{selector:">hcaptcha",property:"max-width"}]}}),n.VO,n.tQ)(class extends p{static get observedAttributes(){return o.concat(p.observedAttributes||[])}attributeChangedCallback(t,e,i){super.attributeChangedCallback?.(t,e,i),e!==i&&"enabled"===t&&this.toggleCaptchaEles("true"===i)}constructor(){super(),this.attachShadow({mode:"open"}).innerHTML='\n    <div class="badge">\n      <span id="hcaptcha"></span>\n      <input id="hcaptcha-input" type="hidden" name="hcaptcha" required />\n      <img src="https://imgs.descope.com/connectors/templates/hcaptcha/hcaptcha-big.png" alt="hcaptcha"/>\n    </div>\n    <slot></slot>\n\t',(0,a.fz)("\n      :host {\n        display: inline-flex;\n      }\n      :host > div:not(.hidden) {\n        display: flex;\n      }\n      :host #hcaptcha-input {\n        display: none;\n      }\n      :host #hcaptcha .hcaptcha-logo {\n        height: 100%;\n      }\n      :host #hcaptcha {\n\t\t\t\twidth: 100%;\n        height: 100%;\n\t\t\t}\n      :host img {\n        max-width: 100%;\n        max-height: 100%;\n        object-fit: contain;\n      }\n      .hidden {\n        display: none;\n      }\n        ",this),this.captchaEle=this.shadowRoot.querySelector("#hcaptcha"),this.mockCaptchaEle=this.shadowRoot.querySelector("img"),this.badge=this.shadowRoot.querySelector(".badge"),this.inputElement=this.shadowRoot.querySelector("input")}init(){super.init?.(),(0,a.Ge)(this,this.updatePreview.bind(this)),this.inputElement.getValidity=null,this.inputElement.checkValidity=null}toggleCaptchaEles(t){t?(this.captchaEle.style.display="",this.mockCaptchaEle.style.display="none"):(this.captchaEle.style.display="none",this.mockCaptchaEle.style.display="")}updatePreview(){this.toggleCaptchaEles(this.enabled)}getValidity(){return this.inputElement.value?{}:{valueMissing:!0}}checkValidity(){return!!this.inputElement.value}get siteKey(){return this.getAttribute("site-key")}get enabled(){return"true"===this.getAttribute("enabled")}});customElements.define(c,l)}}]);
//# sourceMappingURL=descope-hcaptcha-index-js.js.map