var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var s,t=1,i=arguments.length;t<i;t++){s=arguments[t];for(var o in s)if(Object.prototype.hasOwnProperty.call(s,o))e[o]=s[o]}return e};return __assign.apply(this,arguments)};import{r as registerInstance,h as h$1}from"./index-38ad4957.js";import"./global-96c14d63.js";import{i as d,n as h}from"./dom-context-hooks.module-50442785.js";import{i as isDemo}from"./index.module-b23fdad8.js";import{c as cjs}from"./cjs-bdfb4486.js";import{a as getMissingProps,g as getProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import{L as LEAD_FORM_STATE_CONTEXT,R as RequiredPropsError}from"./useLeadFormState-dd4e8b08.js";import{L as LeadCheckboxFieldView}from"./sqm-lead-checkbox-field-view-7928db07.js";function useLeadCheckboxField(){var e=d(LEAD_FORM_STATE_CONTEXT);return{states:{leadFormState:e}}}var LeadCheckboxField=function(){function e(e){registerInstance(this,e);this.ignored=true;this.checkboxLabel="By signing up you agree to the {labelLink}";this.checkboxLabelLink="https://example.com";this.checkboxLabelLinkText="Terms and Conditions";this.errorMessage="Must be checked";this.checkboxOptional=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=getMissingProps([{attribute:"checkbox-name",value:this.checkboxName}]);if(!isDemo()&&e){return h$1(RequiredPropsError,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"})}var s=__assign({},getProps(this));var t=(isDemo()?useLeadCheckboxFieldDemo(this):useLeadCheckboxField()).states;return h$1(LeadCheckboxFieldView,{states:t,content:s})};return e}();function useLeadCheckboxFieldDemo(e){return cjs({states:{leadFormState:{}}},e.demoData||{},{arrayMerge:function(e,s){return s}})}export{LeadCheckboxField as sqm_lead_checkbox_field};