var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var i,t=1,s=arguments.length;t<s;t++){i=arguments[t];for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r))e[r]=i[r]}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{g as getProps,a as getMissingProps}from"./utils-334c1e34.js";import"./JSS-67b5cff8.js";import"./mixins-f750863a.js";import{L as LEAD_FORM_STATE_CONTEXT,R as RequiredPropsError}from"./useLeadFormState-dd4e8b08.js";import{L as LeadInputFieldView}from"./sqm-lead-input-field-view-d1b91650.js";function useLeadInputField(){var e=d(LEAD_FORM_STATE_CONTEXT);return{states:{leadFormState:e}}}var LeadInputField=function(){function e(e){registerInstance(this,e);this.ignored=true;this.optionalLabel="(optional)";this.fieldType="text";this.requiredFieldErrorMessage="Please enter a {fieldLabel}";this.fieldOptional=false;h(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=__assign({},getProps(this));var i=getMissingProps([{attribute:"field-name",value:this.fieldName}]);if(!isDemo()&&i){return h$1(RequiredPropsError,{missingProps:i,heading:"An error occured while loading this form",subheading:"A technical problem prevented this input field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"})}var t=(isDemo()?useLeadInputFieldDemo(this):useLeadInputField()).states;return h$1(LeadInputFieldView,{states:t,content:e})};return e}();function useLeadInputFieldDemo(e){return cjs({states:{leadForState:{}},content:{fieldName:e.fieldName,fieldLabel:e.fieldLabel,fieldType:e.fieldType,requiredFieldErrorMessage:e.requiredFieldErrorMessage}},e.demoData||{},{arrayMerge:function(e,i){return i}})}export{LeadInputField as sqm_lead_input_field};