@formatica/vue 0.1.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +280 -24
- package/dist/components/BaseField.d.ts +28 -0
- package/dist/components/BaseField.d.ts.map +1 -0
- package/dist/components/FormBuilder.d.ts +25 -0
- package/dist/components/FormBuilder.d.ts.map +1 -0
- package/dist/components/FormField.d.ts +6 -0
- package/dist/components/FormField.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts +21 -0
- package/dist/components/inputs/CheckboxGroupInput.d.ts.map +1 -0
- package/dist/components/inputs/CheckboxInput.d.ts +16 -0
- package/dist/components/inputs/CheckboxInput.d.ts.map +1 -0
- package/dist/components/inputs/DateInput.d.ts +22 -0
- package/dist/components/inputs/DateInput.d.ts.map +1 -0
- package/dist/components/inputs/FileInput.d.ts +22 -0
- package/dist/components/inputs/FileInput.d.ts.map +1 -0
- package/dist/components/inputs/NumberInput.d.ts +26 -0
- package/dist/components/inputs/NumberInput.d.ts.map +1 -0
- package/dist/components/inputs/PhoneInput.d.ts +23 -0
- package/dist/components/inputs/PhoneInput.d.ts.map +1 -0
- package/dist/components/inputs/RadioInput.d.ts +19 -0
- package/dist/components/inputs/RadioInput.d.ts.map +1 -0
- package/dist/components/inputs/SelectInput.d.ts +29 -0
- package/dist/components/inputs/SelectInput.d.ts.map +1 -0
- package/dist/components/inputs/SliderInput.d.ts +23 -0
- package/dist/components/inputs/SliderInput.d.ts.map +1 -0
- package/dist/components/inputs/SwitchInput.d.ts +17 -0
- package/dist/components/inputs/SwitchInput.d.ts.map +1 -0
- package/dist/components/inputs/TagsInput.d.ts +24 -0
- package/dist/components/inputs/TagsInput.d.ts.map +1 -0
- package/dist/components/inputs/TextInput.d.ts +27 -0
- package/dist/components/inputs/TextInput.d.ts.map +1 -0
- package/dist/components/inputs/TextareaInput.d.ts +28 -0
- package/dist/components/inputs/TextareaInput.d.ts.map +1 -0
- package/dist/components/layout/FormDivider.d.ts +7 -0
- package/dist/components/layout/FormDivider.d.ts.map +1 -0
- package/dist/components/layout/FormGroup.d.ts +15 -0
- package/dist/components/layout/FormGroup.d.ts.map +1 -0
- package/dist/components/layout/FormHtml.d.ts +7 -0
- package/dist/components/layout/FormHtml.d.ts.map +1 -0
- package/dist/components/layout/FormRow.d.ts +12 -0
- package/dist/components/layout/FormRow.d.ts.map +1 -0
- package/dist/components/layout/FormSteps.d.ts +11 -0
- package/dist/components/layout/FormSteps.d.ts.map +1 -0
- package/dist/components/layout/FormTabs.d.ts +8 -0
- package/dist/components/layout/FormTabs.d.ts.map +1 -0
- package/dist/components/layout/LayoutRenderer.d.ts +8 -0
- package/dist/components/layout/LayoutRenderer.d.ts.map +1 -0
- package/dist/core/eventBus.d.ts +9 -0
- package/dist/core/eventBus.d.ts.map +1 -0
- package/dist/core/fieldRegistry.d.ts +24 -0
- package/dist/core/fieldRegistry.d.ts.map +1 -0
- package/dist/core/ruleRegistry.d.ts +2 -0
- package/dist/core/ruleRegistry.d.ts.map +1 -0
- package/dist/core/schemaParser.d.ts +4 -0
- package/dist/core/schemaParser.d.ts.map +1 -0
- package/dist/core/useConditions.d.ts +2 -0
- package/dist/core/useConditions.d.ts.map +1 -0
- package/dist/core/useForm.d.ts +10 -0
- package/dist/core/useForm.d.ts.map +1 -0
- package/dist/core/useFormI18n.d.ts +22 -0
- package/dist/core/useFormI18n.d.ts.map +1 -0
- package/dist/core/useTheme.d.ts +28 -0
- package/dist/core/useTheme.d.ts.map +1 -0
- package/dist/core/useValidation.d.ts +17 -0
- package/dist/core/useValidation.d.ts.map +1 -0
- package/dist/formatica.es.js +1230 -1193
- package/dist/formatica.es.js.map +1 -1
- package/dist/formatica.umd.cjs +1 -1
- package/dist/formatica.umd.cjs.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/plugin.d.ts +11 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/style.css +60 -47
- package/dist/types/form.d.ts +92 -0
- package/dist/types/form.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +18 -0
- package/dist/types/i18n.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/layout.d.ts +76 -0
- package/dist/types/layout.d.ts.map +1 -0
- package/dist/types/schema.d.ts +252 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/theme.d.ts +69 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/types/validation.d.ts +26 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +2 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/extractFields.d.ts +2 -0
- package/dist/utils/extractFields.d.ts.map +1 -0
- package/dist/utils/sanitize.d.ts +2 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/titleCase.d.ts +2 -0
- package/dist/utils/titleCase.d.ts.map +1 -0
- package/package.json +4 -2
package/dist/formatica.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(T,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("@formatica/core"),require("vue"),require("libphonenumber-js")):typeof define=="function"&&define.amd?define(["exports","@formatica/core","vue","libphonenumber-js"],S):(T=typeof globalThis<"u"?globalThis:T||self,S(T.Formatica={},T.FormaticaCore,T.Vue,T.libphonenumber))})(this,function(T,S,e,M){"use strict";const U=Symbol("FormaticaComponents"),j=new Map;function _(t,c){j.set(t,c)}function le(t){j.delete(t)}function Y(t){return j.get(t)}function W(t){return j.has(t)}function oe(){return Array.from(j.keys())}function ne(){const t=new Map;function c(l,s){t.has(l)||t.set(l,new Set);const d=t.get(l);return d?(d.add(s),()=>{d.delete(s)}):()=>{}}function a(l,s){const d=t.get(l);if(d)for(const m of d)m(s)}return{on:c,emit:a}}const P=Symbol("FormaticaI18n"),re={required:"This field is required",email:"Please enter a valid email address",url:"Please enter a valid URL",min:"Must be at least {min}",max:"Must be at most {max}",minLength:"Must be at least {min} characters",maxLength:"Must be at most {max} characters",between:"Must be between {min} and {max}",pattern:"Invalid format",numeric:"Must be a number",integer:"Must be an integer",alpha:"Must contain only letters",alphaNumeric:"Must contain only letters and numbers",confirmed:"Confirmation does not match",date:"Please enter a valid date"};function Q(t){const{locale:c,fallbackLocale:a="en",fieldTranslations:l={},formTranslations:s={}}=t;function d(r,i){const y=l[r];if(y){const x=y[c.value];if(x){const f=x[i];if(typeof f=="string")return f}const w=y[a];if(w){const f=w[i];if(typeof f=="string")return f}}return i==="label"?S.titleCase(r):""}function m(r,i){var x,w;const y=l[r];if(y){const f=y[c.value];if((x=f==null?void 0:f.options)!=null&&x[i])return f.options[i];const p=y[a];if((w=p==null?void 0:p.options)!=null&&w[i])return p.options[i]}return i}function o(r,i){var f,p;const y=(f=s[c.value])==null?void 0:f.messages;if(y!=null&&y[r])return H(y[r],i??{});const x=(p=s[a])==null?void 0:p.messages;if(x!=null&&x[r])return H(x[r],i??{});const w=re[r];return w?H(w,i??{}):`Validation failed: ${r}`}const n={locale:c,fallbackLocale:a,t:d,tOption:m,tValidation:o};return e.provide(P,n),n}function J(){return e.inject(P)}function H(t,c){return t.replace(/\{(\w+)\}/g,(a,l)=>c[l]!==void 0?String(c[l]):`{${l}}`)}function X(t){return t.split("|").map(c=>{const[a,...l]=c.split(":"),s={};if(l.length>0){const m=l.join(":").split(",");a==="between"&&m.length===2?(s.min=m[0],s.max=m[1]):m.length===1?s[a]=m[0]:s.values=m}return{name:a,params:s}})}function se(t){const c=t.rules;if(!c){const l=[];return t.required&&l.push({name:"required"}),l}if(typeof c=="string")return X(c);if(Array.isArray(c))return c.flatMap(l=>typeof l=="string"?X(l):[]);const a=[];for(const[l,s]of Object.entries(c)){if(s===!1)continue;const d={};typeof s=="object"&&s!==null&&!Array.isArray(s)?Object.assign(d,s):s!==!0&&(d[l]=s),a.push({name:l,params:d})}return a}function ie(t,c){let a=null,l=null;return(...s)=>new Promise(d=>{a!==null&&(clearTimeout(a),l&&l([])),l=d,a=setTimeout(async()=>{a=null;const m=await t(...s);d(m),l=null},c)})}function ce(t){const{fields:c,values:a,settings:l}=t,s=e.ref({}),d=new Map;function m(x,w){const f=`${x}:${w}`;d.has(f)||d.set(f,ie(async(...u)=>o(u[0],u[1]),w));const p=d.get(f);if(!p)throw new Error(`Debounced validator not found for ${f}`);return p}async function o(x,w){var V;const f=c.value.find(h=>h.name===x);if(!f)return[];const p=se(f),u=a.value[x],b=[];for(const h of p){if((V=h.params)!=null&&V.when){const k=h.params.when;if(("field"in k||"and"in k||"or"in k)&&!S.evaluateCondition(k,a.value))continue}if(h.optional&&de(u))continue;let B;if(h.validator)B=await h.validator(u,h.params??{},w);else{const k=S.getRule(h.name);if(!k)continue;B=await k(u,h.params??{},w)}if(B!==!0){const k=h.message?me(h.message,h.params??{}):typeof B=="string"?B:`Validation failed for rule: ${h.name}`;if(b.push(k),h.bail)break}}return s.value[x]=b,b}async function n(x,w){const f=l==null?void 0:l.debounce;return f&&f>0?m(x,f)(x,w):o(x,w)}async function r(x){const w={},f=c.value.map(async p=>{const u=await o(p.name,x);u.length>0&&(w[p.name]=u)});return await Promise.all(f),s.value={...w},w}function i(x){delete s.value[x]}function y(){s.value={}}return{errors:s,validateField:n,validateAll:r,clearFieldErrors:i,clearAllErrors:y}}function de(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}function me(t,c){return t.replace(/\{(\w+)\}/g,(a,l)=>c[l]!==void 0?String(c[l]):`{${l}}`)}const R=Symbol("FormaticaContext");function ue(t){switch(t.type){case"tags":return[];case"checkbox-group":return[];case"checkbox":return!1;case"switch":return!1;case"number":case"slider":return null;case"file":return null;default:return""}}function G(t){const c={};for(const a of t)c[a.name]=a.defaultValue??ue(a);return c}function fe(t){const c={};for(const a of t)a.translations&&(c[a.name]=a.translations);return c}function ee(t,c){const a=e.ref((c==null?void 0:c.locale)??"en"),l=(c==null?void 0:c.fallbackLocale)??"en";let s=t;const d=e.ref(S.extractFields(t.fields)),m=e.reactive(G(S.extractFields(t.fields))),o=e.reactive({}),n=e.reactive({}),r=e.reactive({}),i=e.ref(!1),y=e.ref(0),x=e.computed(()=>Object.values(o).every(g=>g.length===0)),w=e.computed(()=>Object.values(r).some(Boolean)),f=ne();function p(){return{values:{...m},getFieldValue:g=>m[g]}}const u=e.computed(()=>({...m})),b=ce({fields:d,values:u,settings:t.settings});Q({locale:a,fallbackLocale:l,fieldTranslations:fe(S.extractFields(t.fields)),formTranslations:t.translations});let V=G(S.extractFields(t.fields));e.watch(()=>({...m}),(g,E)=>{var F;if(E){for(const D of Object.keys(g))g[D]!==E[D]&&(r[D]=!0,f.emit("field:change",{field:D,value:g[D],previousValue:E[D]}),(F=t.settings)!=null&&F.validateOnChange&&$(D));f.emit("change",{values:g})}},{deep:!0});const h=new Map;function B(g){const E=g.name;return{name:E,value:e.computed({get:()=>m[E],set:F=>{m[E]=F}}),errors:e.computed(()=>o[E]??[]),touched:e.computed({get:()=>n[E]??!1,set:F=>{n[E]=F}}),dirty:e.computed({get:()=>r[E]??!1,set:F=>{r[E]=F}}),disabled:e.computed(()=>typeof g.disabled=="function"?g.disabled(p()):g.disabled??!1),visible:e.computed(()=>g.condition?S.evaluateCondition(g.condition,m):typeof g.visible=="function"?g.visible(p()):g.visible??!0),schema:g,validate:()=>$(E),reset:()=>{m[E]=V[E]??null,delete o[E],n[E]=!1,r[E]=!1},clear:()=>{m[E]=null,delete o[E]}}}function k(){h.clear();for(const g of S.extractFields(s.fields))h.set(g.name,B(g))}k();async function $(g){const E=await b.validateField(g,p());return o[g]=E,f.emit("validate:field",{field:g,valid:E.length===0,errors:E}),E}async function C(){const g=await b.validateAll(p());for(const F of Object.keys(o))F in g||delete o[F];for(const[F,D]of Object.entries(g))o[F]=D;const E=Object.values(g).every(F=>F.length===0);return f.emit("validate",{valid:E,errors:{...g}}),E}async function N(g){i.value=!0,y.value+=1;try{for(const F of S.extractFields(s.fields))n[F.name]=!0;if(!await C()){f.emit("submit:error",{values:{...m},error:new Error("Validation failed")});return}f.emit("submit",{values:{...m}}),g&&await g({...m},p()),f.emit("submit:success",{values:{...m},result:void 0})}catch(E){throw f.emit("submit:error",{values:{...m},error:E}),E}finally{i.value=!1}}function z(){for(const g of S.extractFields(s.fields))m[g.name]=V[g.name]??null,delete o[g.name],n[g.name]=!1,r[g.name]=!1;b.clearAllErrors(),f.emit("reset",void 0)}function A(){for(const g of S.extractFields(s.fields))m[g.name]=null,delete o[g.name];b.clearAllErrors()}function K(g){s=g;const E=S.extractFields(g.fields);d.value=E,V=G(E);for(const D of E)D.name in m||(m[D.name]=D.defaultValue??null);const F=new Set(E.map(D=>D.name));for(const D of Object.keys(m))F.has(D)||(delete m[D],delete o[D],delete n[D],delete r[D]);k()}const ae={values:m,errors:o,touched:n,dirty:r,isValid:x,isDirty:w,isSubmitting:i,submitCount:y,validate:C,validateField:$,submit:N,reset:z,clear:A,setError:(g,E)=>{o[g]=E},clearError:g=>{delete o[g],b.clearFieldErrors(g)},clearErrors:()=>{for(const g of Object.keys(o))delete o[g];b.clearAllErrors()},getField:g=>h.get(g),setFieldValue:(g,E)=>{m[g]=E},setFieldDisabled:(g,E)=>{const F=S.extractFields(s.fields).find(D=>D.name===g);F&&(F.disabled=E)},setFieldVisible:(g,E)=>{const F=S.extractFields(s.fields).find(D=>D.name===g);F&&(F.visible=E)},on:f.on,locale:a,setLocale:g=>{a.value=g},schema:s,updateSchema:K};return e.provide(R,ae),ae}const q=Symbol("FormaticaTheme"),Z={name:"default",colors:{primary:"#3b82f6",primaryHover:"#2563eb",error:"#ef4444",errorHover:"#dc2626",success:"#22c55e",warning:"#f59e0b",info:"#3b82f6",text:"#1f2937",textSecondary:"#6b7280",textDisabled:"#9ca3af",background:"#ffffff",backgroundDisabled:"#f3f4f6",border:"#d1d5db",borderFocus:"#3b82f6",borderError:"#ef4444",placeholder:"#9ca3af"},typography:{fontFamily:"inherit",fontSize:"0.875rem",fontSizeSmall:"0.75rem",fontSizeLarge:"1rem",lineHeight:"1.5",labelFontWeight:"500"},spacing:{fieldGap:"1rem",rowGap:"1rem",inputPaddingX:"0.75rem",inputPaddingY:"0.5rem",labelMarginBottom:"0.375rem"},borders:{radius:"0.375rem",radiusSmall:"0.25rem",radiusLarge:"0.5rem",width:"1px",style:"solid"},shadows:{focus:"0 0 0 3px rgba(59, 130, 246, 0.1)",error:"0 0 0 3px rgba(239, 68, 68, 0.1)",dropdown:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},transitions:{duration:"150ms",timingFunction:"ease-in-out"}};function pe(t){const c=e.isRef(t)?e.computed(()=>t.value??Z):e.ref(t??Z),a=e.computed(()=>{const d=c.value.components??{};return{form:d.form??"fc-form",field:d.field??"fc-field",label:d.label??"fc-label",input:d.input??"fc-input",error:d.error??"fc-error",helpText:d.helpText??"fc-help-text",group:d.group??"fc-group",row:d.row??"fc-row",steps:d.steps??"fc-steps",tabs:d.tabs??"fc-tabs",button:d.button??"fc-button"}}),l=e.computed(()=>{const d=c.value,m={};if(d.colors)for(const[o,n]of Object.entries(d.colors))n&&(m[`--fc-color-${I(o)}`]=n);if(d.typography)for(const[o,n]of Object.entries(d.typography))n&&(m[`--fc-${I(o)}`]=n);if(d.spacing)for(const[o,n]of Object.entries(d.spacing))n&&(m[`--fc-${I(o)}`]=n);if(d.borders)for(const[o,n]of Object.entries(d.borders))n&&(m[`--fc-border-${I(o)}`]=n);if(d.shadows)for(const[o,n]of Object.entries(d.shadows))n&&(m[`--fc-shadow-${I(o)}`]=n);if(d.transitions)for(const[o,n]of Object.entries(d.transitions))n&&(m[`--fc-transition-${I(o)}`]=n);return d.cssVars&&Object.assign(m,d.cssVars),m}),s={config:c.value,classes:a,cssVars:l};return e.provide(q,s),s}function L(){const t=e.inject(q);return t||be()}function be(){const t=e.computed(()=>({form:"fc-form",field:"fc-field",label:"fc-label",input:"fc-input",error:"fc-error",helpText:"fc-help-text",group:"fc-group",row:"fc-row",steps:"fc-steps",tabs:"fc-tabs",button:"fc-button"})),c=e.computed(()=>({}));return{config:Z,classes:t,cssVars:c}}function I(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const ye=["checked","disabled","onChange"],ge=["aria-checked","aria-disabled","onClick","onKeydown"],he={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},ke={class:"text-sm text-gray-700"},xe=e.defineComponent({__name:"CheckboxGroupInput",props:{modelValue:{},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minSelect:{},maxSelect:{}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();function s(n){return a.modelValue.includes(n)}function d(n){return!!(a.disabled||n.disabled||a.maxSelect&&!s(n.value)&&a.modelValue.length>=a.maxSelect)}function m(n){if(d(n))return;const r=[...a.modelValue],i=r.indexOf(n.value);if(i>=0){if(a.minSelect&&r.length<=a.minSelect)return;r.splice(i,1)}else r.push(n.value);l("update:modelValue",r)}function o(n,r){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(r))}return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"group",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",d(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"checkbox",checked:s(i.value),disabled:d(i),class:"sr-only",onChange:y=>m(i),onBlur:r[0]||(r[0]=y=>l("blur",y))},null,40,ye),e.createElementVNode("div",{role:"checkbox","aria-checked":s(i.value),"aria-disabled":d(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",s(i.value)?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(s(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>m(i),onKeydown:y=>o(y,i)},[s(i.value)?(e.openBlock(),e.createElementBlock("svg",he,[...r[1]||(r[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,ge),e.createElementVNode("span",ke,e.toDisplayString(i.label),1)],2))),128))],2))}}),Be=["checked","disabled"],we=["aria-checked","aria-disabled"],Ce={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Ve={key:0,class:"text-sm text-gray-700"},Ee=e.defineComponent({__name:"CheckboxInput",props:{modelValue:{type:Boolean},checkboxLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function d(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),d())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(s.value)},[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:d,onBlur:n[0]||(n[0]=r=>l("blur",r))},null,40,Be),e.createElementVNode("div",{role:"checkbox","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",t.modelValue?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(t.modelValue?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:d,onKeydown:m},[t.modelValue?(e.openBlock(),e.createElementBlock("svg",Ce,[...n[1]||(n[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,we),t.checkboxLabel?(e.openBlock(),e.createElementBlock("span",Ve,e.toDisplayString(t.checkboxLabel),1)):e.createCommentVNode("",!0)],2))}}),Ne=["value","min","max","placeholder","disabled","aria-disabled"],$e=e.defineComponent({__name:"DateInput",props:{modelValue:{},format:{},minDate:{},maxDate:{},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",s.classes.value.input].filter(Boolean).join(" "));function m(o){const n=o.target;l("update:modelValue",n.value)}return(o,n)=>(e.openBlock(),e.createElementBlock("input",{type:"date",value:t.modelValue,min:t.minDate,max:t.maxDate,placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(d.value),"aria-disabled":t.disabled||void 0,onInput:m,onBlur:n[0]||(n[0]=r=>l("blur",r)),onFocus:n[1]||(n[1]=r=>l("focus",r))},null,42,Ne))}}),O=(t,c)=>{const a=t.__vccOpts||t;for(const[l,s]of c)a[l]=s;return a},Se=O($e,[["__scopeId","data-v-7d4bc9b7"]]),Fe=["aria-disabled","onKeydown"],De={key:0,class:"mt-1 text-xs text-gray-400"},ze=["accept","multiple"],Te={key:0,class:"mt-3 space-y-2"},Le={class:"flex items-center gap-2 truncate"},Me={class:"truncate"},Ie={class:"shrink-0 text-xs text-gray-400"},Ae=["onClick"],je=e.defineComponent({__name:"FileInput",props:{modelValue:{},accept:{},maxSize:{},multiple:{type:Boolean,default:!1},maxFiles:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.ref(null),d=e.ref(!1),m=e.computed(()=>a.modelValue?Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]:[]);function o(u){return u<1024?`${u} B`:u<1024*1024?`${(u/1024).toFixed(1)} KB`:`${(u/(1024*1024)).toFixed(1)} MB`}function n(u){let b=u;if(a.maxSize){const V=a.maxSize;b=b.filter(h=>h.size<=V)}if(a.multiple&&a.maxFiles){const V=a.maxFiles-m.value.length;b=b.slice(0,Math.max(0,V))}return b}function r(u){const b=n(u);b.length!==0&&(a.multiple?l("update:modelValue",[...m.value,...b]):l("update:modelValue",b[0]))}function i(u){const b=u.target;b.files&&(r(Array.from(b.files)),b.value="")}function y(u){if(a.disabled)return;const b=m.value.filter((V,h)=>h!==u);a.multiple?l("update:modelValue",b.length?b:[]):l("update:modelValue",null)}function x(u){u.preventDefault(),a.disabled||(d.value=!0)}function w(){d.value=!1}function f(u){var b;u.preventDefault(),d.value=!1,!(a.disabled||!((b=u.dataTransfer)!=null&&b.files))&&r(Array.from(u.dataTransfer.files))}function p(){var u;a.disabled||(u=s.value)==null||u.click()}return(u,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.disabled?"opacity-50 cursor-not-allowed":"")},[e.createElementVNode("div",{role:"button",tabindex:"0","aria-disabled":t.disabled||void 0,class:e.normalizeClass(["flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",d.value?"":"border-gray-300 bg-gray-50",t.disabled?"pointer-events-none":"cursor-pointer hover:border-gray-400"]),style:e.normalizeStyle(d.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)"}:{}),onClick:p,onKeydown:[e.withKeys(p,["enter"]),e.withKeys(e.withModifiers(p,["prevent"]),["space"])],onDragover:x,onDragleave:w,onDrop:f,onBlur:b[0]||(b[0]=V=>l("blur",V))},[b[1]||(b[1]=e.createElementVNode("svg",{class:"mb-2 h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"})],-1)),b[2]||(b[2]=e.createElementVNode("p",{class:"text-sm text-gray-600"},[e.createTextVNode(" Drop files here or "),e.createElementVNode("span",{class:"font-medium",style:{color:"var(--fc-color-primary, #3b82f6)"}},"browse")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",De,"Accepted: "+e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0)],46,Fe),e.createElementVNode("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:t.accept,multiple:t.multiple,class:"hidden",onChange:i},null,40,ze),m.value.length>0?(e.openBlock(),e.createElementBlock("ul",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(V,h)=>(e.openBlock(),e.createElementBlock("li",{key:`${V.name}-${h}`,class:"flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"},[e.createElementVNode("div",Le,[b[3]||(b[3]=e.createElementVNode("svg",{class:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),e.createElementVNode("span",Me,e.toDisplayString(V.name),1),e.createElementVNode("span",Ie,"("+e.toDisplayString(o(V.size))+")",1)]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200","aria-label":"Remove file",onClick:e.withModifiers(B=>y(h),["stop"])}," × ",8,Ae))]))),128))])):e.createCommentVNode("",!0)],2))}}),Re={key:0,class:"flex items-stretch"},Oe={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},ve=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ke={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Pe=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ue=O(e.defineComponent({__name:"NumberInput",props:{modelValue:{},min:{},max:{},step:{default:1},precision:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",s.classes.value.input].filter(Boolean).join(" "));function o(n){const i=n.target.value;if(i===""){l("update:modelValue",null);return}let y=parseFloat(i);Number.isNaN(y)||(a.precision!==void 0&&(y=parseFloat(y.toFixed(a.precision))),l("update:modelValue",y))}return(n,r)=>d.value?(e.openBlock(),e.createElementBlock("div",Re,[t.prefix?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[0]||(r[0]=i=>l("blur",i)),onFocus:r[1]||(r[1]=i=>l("focus",i))},null,42,ve),t.suffix?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[2]||(r[2]=i=>l("blur",i)),onFocus:r[3]||(r[3]=i=>l("focus",i))},null,42,Pe))}}),[["__scopeId","data-v-4e51299b"]]),He={class:"relative"},Ge=["disabled"],qe={class:"text-lg leading-none"},Ze={class:"text-xs text-gray-500 dark:text-gray-400 font-medium"},_e=["value","placeholder","disabled"],Ye={key:1,class:"absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"},We={class:"border-b border-gray-200 dark:border-gray-700 p-2"},Qe={class:"max-h-48 overflow-y-auto"},Je=["onMousedown"],Xe={class:"text-lg leading-none"},et={class:"flex-1 truncate text-xs"},tt={class:"text-[11px] text-gray-400 dark:text-gray-500 font-mono"},at={key:0,class:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"},lt=e.defineComponent({__name:"PhoneInput",props:{modelValue:{},defaultCountry:{default:"US"},countries:{},showDialCode:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c,s={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AD:"Andorra",AO:"Angola",AR:"Argentina",AM:"Armenia",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BH:"Bahrain",BD:"Bangladesh",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia",BW:"Botswana",BR:"Brazil",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czechia",DK:"Denmark",DO:"Dominican Rep.",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",EE:"Estonia",ET:"Ethiopia",FI:"Finland",FR:"France",GE:"Georgia",DE:"Germany",GH:"Ghana",GR:"Greece",GT:"Guatemala",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KR:"South Korea",KW:"Kuwait",LV:"Latvia",LB:"Lebanon",LY:"Libya",LT:"Lithuania",LU:"Luxembourg",MO:"Macau",MY:"Malaysia",MX:"Mexico",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NP:"Nepal",NL:"Netherlands",NZ:"New Zealand",NI:"Nicaragua",NG:"Nigeria",NO:"Norway",OM:"Oman",PK:"Pakistan",PA:"Panama",PY:"Paraguay",PE:"Peru",PH:"Philippines",PL:"Poland",PT:"Portugal",QA:"Qatar",RO:"Romania",RU:"Russia",SA:"Saudi Arabia",RS:"Serbia",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",ZA:"South Africa",ES:"Spain",LK:"Sri Lanka",SE:"Sweden",CH:"Switzerland",TW:"Taiwan",TZ:"Tanzania",TH:"Thailand",TR:"Turkey",UA:"Ukraine",AE:"UAE",GB:"United Kingdom",US:"United States",UY:"Uruguay",VE:"Venezuela",VN:"Vietnam",ZW:"Zimbabwe"};function d(B){return B.toUpperCase().split("").map(k=>String.fromCodePoint(127462+k.charCodeAt(0)-65)).join("")}const m=e.computed(()=>{var k;return((k=a.countries)!=null&&k.length?a.countries.filter($=>M.getCountries().includes($)):M.getCountries()).map($=>({code:$,name:s[$]??$,dialCode:`+${M.getCountryCallingCode($)}`,flag:d($)})).sort(($,C)=>$.name.localeCompare(C.name))}),o=e.ref(a.defaultCountry),n=e.ref(""),r=e.ref(!1),i=e.ref(""),y=e.ref(null),x=e.computed(()=>{const B=i.value.toLowerCase();return B?m.value.filter(k=>k.name.toLowerCase().includes(B)||k.code.toLowerCase().includes(B)||k.dialCode.includes(B)):m.value}),w=e.computed(()=>m.value.find(B=>B.code===o.value)??m.value[0]);e.onMounted(()=>{a.modelValue&&f(a.modelValue)}),e.watch(()=>a.modelValue,B=>{B&&f(B)});function f(B){try{const k=M.parsePhoneNumber(B);if(k!=null&&k.country){o.value=k.country,n.value=k.nationalNumber;return}}catch{}n.value=B.replace(/^\+\d+\s*/,"")}function p(){if(!n.value.trim()){l("update:modelValue","");return}const B=new M.AsYouType(o.value);B.input(`+${M.getCountryCallingCode(o.value)}${n.value}`);const k=B.getNumber();l("update:modelValue",(k==null?void 0:k.format("E.164"))??n.value)}function u(B){const k=B.target;n.value=k.value,p()}function b(B){o.value=B,r.value=!1,i.value="",p()}function V(){a.disabled||(r.value=!0,i.value="",e.nextTick(()=>{var B;return(B=y.value)==null?void 0:B.focus()}))}function h(){r.value=!1,i.value=""}return(B,k)=>{var $,C;return e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-stretch rounded-lg border transition-colors",t.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700":"border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"])},[t.showDialCode?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:t.disabled,class:"flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",onMousedown:k[0]||(k[0]=e.withModifiers(N=>r.value?h():V(),["prevent"]))},[e.createElementVNode("span",qe,e.toDisplayString(($=w.value)==null?void 0:$.flag),1),e.createElementVNode("span",Ze,e.toDisplayString((C=w.value)==null?void 0:C.dialCode),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["h-3 w-3 text-gray-400 transition-transform",r.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...k[3]||(k[3]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))],40,Ge)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"tel",value:n.value,placeholder:t.placeholder||"Phone number",disabled:t.disabled,autocomplete:"tel-national",class:e.normalizeClass(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0",t.showDialCode?"rounded-r-lg":"rounded-lg"]),onInput:u,onBlur:k[1]||(k[1]=N=>l("blur",N))},null,42,_e)],2),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-40",onMousedown:h},null,32)):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",We,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:y,"onUpdate:modelValue":k[2]||(k[2]=N=>i.value=N),type:"text",placeholder:"Search country...",class:"w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,N=>(e.openBlock(),e.createElementBlock("button",{key:N.code,type:"button",class:e.normalizeClass(["flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",N.code===o.value?"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300"]),onMousedown:e.withModifiers(z=>b(N.code),["prevent"])},[e.createElementVNode("span",Xe,e.toDisplayString(N.flag),1),e.createElementVNode("span",et,e.toDisplayString(N.name),1),e.createElementVNode("span",tt,e.toDisplayString(N.dialCode),1)],42,Je))),128)),x.value.length===0?(e.openBlock(),e.createElementBlock("p",at," No countries found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])}}}),ot=["checked","disabled","onChange"],nt=["aria-checked","aria-disabled","onClick","onKeydown"],rt={key:0,class:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},st={class:"text-sm text-gray-700"},it=e.defineComponent({__name:"RadioInput",props:{modelValue:{type:[String,Number,Boolean,null]},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();function s(n){return a.modelValue===n}function d(n){return a.disabled||!!n.disabled}function m(n){d(n)||l("update:modelValue",n.value)}function o(n,r){(n.key===" "||n.key==="Enter")&&(n.preventDefault(),m(r))}return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"radiogroup",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",d(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"radio",checked:s(i.value),disabled:d(i),class:"sr-only",onChange:y=>m(i),onBlur:r[0]||(r[0]=y=>l("blur",y))},null,40,ot),e.createElementVNode("div",{role:"radio","aria-checked":s(i.value),"aria-disabled":d(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",s(i.value)?"":"border-gray-300"]),style:e.normalizeStyle(s(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>m(i),onKeydown:y=>o(y,i)},[s(i.value)?(e.openBlock(),e.createElementBlock("div",rt)):e.createCommentVNode("",!0)],46,nt),e.createElementVNode("span",st,e.toDisplayString(i.label),1)],2))),128))],2))}}),ct=["aria-expanded"],dt={class:"flex flex-1 flex-wrap items-center gap-1"},mt=["onClick"],ut={key:1,class:"truncate"},ft={key:2,class:"text-gray-400"},pt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white shadow-lg"},bt={key:0,class:"border-b border-gray-200 p-2"},yt={role:"listbox",class:"max-h-60 overflow-auto py-1"},gt=["aria-selected","onClick","onMouseenter"],ht={key:0,class:"px-3 py-2 text-sm text-gray-400"},kt=O(e.defineComponent({__name:"SelectInput",props:{modelValue:{type:[String,Number,Boolean,Array,null]},options:{},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Select..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.ref(!1),m=e.ref(""),o=e.ref(-1),n=e.ref(null),r=e.ref(null),i=e.computed(()=>a.modelValue===null||a.modelValue===void 0?[]:Array.isArray(a.modelValue)?a.modelValue:[a.modelValue]),y=e.computed(()=>{if(i.value.length===0||a.multiple)return"";const C=a.options.find(N=>N.value===i.value[0]);return(C==null?void 0:C.label)??String(i.value[0])}),x=e.computed(()=>{if(!m.value)return a.options;const C=m.value.toLowerCase();return a.options.filter(N=>N.label.toLowerCase().includes(C))});function w(C){return i.value.includes(C)}function f(){a.disabled||(d.value?u():p())}function p(){d.value=!0,o.value=-1,m.value="",e.nextTick(()=>{var C;return(C=r.value)==null?void 0:C.focus()})}function u(){d.value=!1,m.value=""}function b(C){if(!C.disabled)if(a.multiple){const N=[...i.value],z=N.indexOf(C.value);z>=0?N.splice(z,1):N.push(C.value),l("update:modelValue",N)}else l("update:modelValue",C.value),u()}function V(C){if(a.disabled)return;const N=i.value.filter(z=>z!==C);l("update:modelValue",N.length?N:a.multiple?[]:null)}function h(C){C.stopPropagation(),l("update:modelValue",a.multiple?[]:null)}function B(C){if(!d.value){(C.key==="Enter"||C.key===" "||C.key==="ArrowDown")&&(C.preventDefault(),p());return}switch(C.key){case"ArrowDown":C.preventDefault(),o.value=Math.min(o.value+1,x.value.length-1);break;case"ArrowUp":C.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":C.preventDefault(),o.value>=0&&x.value[o.value]&&b(x.value[o.value]);break;case"Escape":C.preventDefault(),u();break}}function k(C){n.value&&!n.value.contains(C.target)&&u()}function $(C){const N=a.options.find(z=>z.value===C);return(N==null?void 0:N.label)??String(C)}return e.onMounted(()=>document.addEventListener("mousedown",k)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",k)),e.watch(d,C=>{C||l("blur",new FocusEvent("blur"))}),(C,N)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:n,class:e.normalizeClass(["relative w-full",e.unref(s).classes.value.input,t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{role:"combobox","aria-expanded":d.value,"aria-haspopup":"listbox",tabindex:"0",class:e.normalizeClass(["flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm","transition-colors duration-200",d.value?"ring-2 ring-blue-500/20":"",t.disabled?"pointer-events-none bg-gray-100":""]),style:e.normalizeStyle(d.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:f,onKeydown:B},[e.createElementVNode("div",dt,[t.multiple?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(i.value,z=>(e.openBlock(),e.createElementBlock("span",{key:String(z),class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString($(z))+" ",1),e.createElementVNode("button",{type:"button",class:"ml-0.5",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove",onClick:e.withModifiers(A=>V(z),["stop"])}," × ",8,mt)]))),128)):y.value?(e.openBlock(),e.createElementBlock("span",ut,e.toDisplayString(y.value),1)):(e.openBlock(),e.createElementBlock("span",ft,e.toDisplayString(t.placeholder),1))]),t.clearable&&i.value.length>0&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200","aria-label":"Clear selection",onClick:h}," × ")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200",d.value?"rotate-180":""]),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...N[1]||(N[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2))],46,ct),d.value?(e.openBlock(),e.createElementBlock("div",pt,[t.searchable?(e.openBlock(),e.createElementBlock("div",bt,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:r,"onUpdate:modelValue":N[0]||(N[0]=z=>m.value=z),type:"text",class:"w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",placeholder:"Search...",onKeydown:B},null,544),[[e.vModelText,m.value]])])):e.createCommentVNode("",!0),e.createElementVNode("ul",yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(z,A)=>(e.openBlock(),e.createElementBlock("li",{key:String(z.value),role:"option","aria-selected":w(z.value),class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",w(z.value)?"":"text-gray-900",o.value===A?"bg-gray-100":"",z.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"]),style:e.normalizeStyle(w(z.value)?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:K=>b(z),onMouseenter:K=>o.value=A},e.toDisplayString(z.label),47,gt))),128)),x.value.length===0?(e.openBlock(),e.createElementBlock("li",ht," No options found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b34f2a7d"]]),xt=["value","min","max","step","disabled","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled"],Bt={class:"mt-1 flex justify-between text-xs text-gray-400"},wt=e.defineComponent({__name:"SliderInput",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},showTooltip:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.ref(!1),d=e.computed(()=>{const o=a.max-a.min;return o===0?0:(a.modelValue-a.min)/o*100});function m(o){const n=o.target;l("update:modelValue",parseFloat(n.value))}return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full py-2",t.disabled?"opacity-50 cursor-not-allowed":""])},[t.showTooltip&&s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",style:e.normalizeStyle({left:`calc(${d.value}% - 16px)`})},e.toDisplayString(t.modelValue),5)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,"aria-valuenow":t.modelValue,"aria-valuemin":t.min,"aria-valuemax":t.max,"aria-disabled":t.disabled||void 0,class:"h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",style:{accentColor:"var(--fc-color-primary, #3b82f6)"},onInput:m,onMousedown:n[0]||(n[0]=r=>s.value=!0),onMouseup:n[1]||(n[1]=r=>s.value=!1),onTouchstart:n[2]||(n[2]=r=>s.value=!0),onTouchend:n[3]||(n[3]=r=>s.value=!1),onFocus:n[4]||(n[4]=r=>s.value=!0),onBlur:n[5]||(n[5]=r=>{s.value=!1,l("blur",r)})},null,40,xt),e.createElementVNode("div",Bt,[e.createElementVNode("span",null,e.toDisplayString(t.min),1),e.createElementVNode("span",null,e.toDisplayString(t.max),1)])],2))}}),Ct={key:0,class:"text-sm text-gray-600"},Vt=["checked","disabled"],Et=["aria-checked","aria-disabled"],Nt={key:1,class:"text-sm text-gray-600"},$t=e.defineComponent({__name:"SwitchInput",props:{modelValue:{type:Boolean},activeLabel:{},inactiveLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=c;L();const s=e.computed(()=>["inline-flex items-center gap-2 select-none",a.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function d(){a.disabled||l("update:modelValue",!a.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),d())}return(o,n)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(s.value)},[t.inactiveLabel?(e.openBlock(),e.createElementBlock("span",Ct,e.toDisplayString(t.inactiveLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:d,onBlur:n[0]||(n[0]=r=>l("blur",r))},null,40,Vt),e.createElementVNode("button",{type:"button",role:"switch","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"":"bg-gray-300",t.disabled?"pointer-events-none":"focus:outline-none focus:ring-2 focus:ring-blue-500/20"]),style:e.normalizeStyle(t.modelValue?{backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:d,onKeydown:m},[e.createElementVNode("span",{class:e.normalizeClass(["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"translate-x-5":"translate-x-0"]),"aria-hidden":"true"},null,2)],46,Et),t.activeLabel?(e.openBlock(),e.createElementBlock("span",Nt,e.toDisplayString(t.activeLabel),1)):e.createCommentVNode("",!0)],2))}}),St=["onClick"],Ft=["placeholder","disabled"],Dt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg",role:"listbox"},zt=["aria-selected","onMousedown","onMouseenter"],Tt=e.defineComponent({__name:"TagsInput",props:{modelValue:{default:()=>[]},maxTags:{},suggestions:{default:()=>[]},placeholder:{default:"Add a tag..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const a=t,l=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),s=c,d=L(),m=e.ref(""),o=e.ref(!1),n=e.ref(!1),r=e.ref(-1),i=e.ref(null),y=e.ref(null),x=e.computed(()=>!a.maxTags||l.value.length<a.maxTags),w=e.computed(()=>{if(!m.value||a.suggestions.length===0)return[];const h=m.value.toLowerCase();return a.suggestions.filter(B=>B.toLowerCase().includes(h)&&!l.value.includes(B))});function f(h){const B=h.trim();!B||!x.value||l.value.includes(B)||(s("update:modelValue",[...l.value,B]),m.value="",n.value=!1,r.value=-1)}function p(h){if(a.disabled)return;const B=l.value.filter((k,$)=>$!==h);s("update:modelValue",B)}function u(h){if(h.key==="Enter"||h.key===","){h.preventDefault(),r.value>=0&&w.value[r.value]?f(w.value[r.value]):f(m.value);return}if(h.key==="Backspace"&&m.value===""&&l.value.length>0){p(l.value.length-1);return}if(h.key==="ArrowDown"&&n.value){h.preventDefault(),r.value=Math.min(r.value+1,w.value.length-1);return}if(h.key==="ArrowUp"&&n.value){h.preventDefault(),r.value=Math.max(r.value-1,0);return}h.key==="Escape"&&(n.value=!1,r.value=-1)}function b(){n.value=m.value.length>0&&w.value.length>0,r.value=-1}function V(h){i.value&&!i.value.contains(h.target)&&(n.value=!1)}return e.onMounted(()=>document.addEventListener("mousedown",V)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",V)),e.watch(m,()=>{e.nextTick(b)}),(h,B)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:i,class:e.normalizeClass(["relative w-full",t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",o.value?"ring-2 ring-blue-500/20":"border-gray-300",e.unref(d).classes.value.input]),style:e.normalizeStyle(o.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:B[3]||(B[3]=k=>{var $;return($=y.value)==null?void 0:$.focus()})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(k,$)=>(e.openBlock(),e.createElementBlock("span",{key:k,class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(k)+" ",1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-0.5 transition-colors duration-200",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove tag",onClick:e.withModifiers(C=>p($),["stop"])}," × ",8,St))]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:y,"onUpdate:modelValue":B[0]||(B[0]=k=>m.value=k),type:"text",placeholder:l.value.length===0?t.placeholder:"",disabled:t.disabled,class:"min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",onKeydown:u,onFocus:B[1]||(B[1]=k=>o.value=!0),onBlur:B[2]||(B[2]=k=>{o.value=!1,s("blur",k)})},null,40,Ft),[[e.vModelText,m.value]])],6),n.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("ul",Dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(k,$)=>(e.openBlock(),e.createElementBlock("li",{key:k,role:"option","aria-selected":r.value===$,class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",r.value!==$?"text-gray-900 hover:bg-gray-50":""]),style:e.normalizeStyle(r.value===$?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onMousedown:e.withModifiers(C=>f(k),["prevent"]),onMouseenter:C=>r.value=$},e.toDisplayString(k),47,zt))),128))])):e.createCommentVNode("",!0)],2))}}),Lt=["value","rows","maxlength","placeholder","disabled","readonly","aria-disabled","aria-readonly"],Mt=O(e.defineComponent({__name:"TextareaInput",props:{modelValue:{},rows:{default:3},autoResize:{type:Boolean,default:!1},maxLength:{},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.ref(null),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400 resize-y","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.autoResize?"resize-none overflow-hidden":"",s.classes.value.input].filter(Boolean).join(" "));function o(){if(!a.autoResize||!d.value)return;const r=d.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`}function n(r){const i=r.target;l("update:modelValue",i.value),a.autoResize&&e.nextTick(o)}return e.watch(()=>a.modelValue,()=>{a.autoResize&&e.nextTick(o)}),e.onMounted(()=>{a.autoResize&&o()}),(r,i)=>(e.openBlock(),e.createElementBlock("textarea",{ref_key:"textareaRef",ref:d,value:t.modelValue,rows:t.rows,maxlength:t.maxLength,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:n,onBlur:i[0]||(i[0]=y=>l("blur",y)),onFocus:i[1]||(i[1]=y=>l("focus",y))},null,42,Lt))}}),[["__scopeId","data-v-67f80d90"]]),It={key:0,class:"flex items-stretch"},At={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},jt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Rt={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Ot=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],vt=O(e.defineComponent({__name:"TextInput",props:{modelValue:{},inputType:{default:"text"},placeholder:{default:""},maxLength:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},mask:{}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const a=t,l=c,s=L(),d=e.computed(()=>!!a.prefix||!!a.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input","transition-colors duration-200",a.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",a.prefix?"rounded-l-none":"",a.suffix?"rounded-r-none":"",s.classes.value.input].filter(Boolean).join(" "));function o(n){const r=n.target;l("update:modelValue",r.value)}return(n,r)=>d.value?(e.openBlock(),e.createElementBlock("div",It,[t.prefix?(e.openBlock(),e.createElementBlock("span",At,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[0]||(r[0]=i=>l("blur",i)),onFocus:r[1]||(r[1]=i=>l("focus",i))},null,42,jt),t.suffix?(e.openBlock(),e.createElementBlock("span",Rt,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:r[2]||(r[2]=i=>l("blur",i)),onFocus:r[3]||(r[3]=i=>l("focus",i))},null,42,Ot))}}),[["__scopeId","data-v-a42b4343"]]),Kt={key:0,class:"mb-1.5 flex items-center gap-1"},Pt=["for"],Ut={key:0,class:"text-red-500 ml-0.5","aria-hidden":"true"},Ht=["aria-label"],Gt={key:0,role:"tooltip",class:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"},qt=["id"],Zt=["id"],_t=e.defineComponent({__name:"BaseField",props:{fieldSchema:{},fieldName:{},errors:{default:()=>[]},touched:{type:Boolean,default:!1}},setup(t){const c=t,a=e.inject(P),l=e.inject(q),s=e.ref(!1),d=e.computed(()=>{if(a){const x=a.t(c.fieldName,"label");if(x)return x}return c.fieldSchema.label??c.fieldName}),m=e.computed(()=>{if(a){const x=a.t(c.fieldName,"helpText");if(x)return x}return c.fieldSchema.helpText??""}),o=e.computed(()=>{if(a){const x=a.t(c.fieldName,"tooltip");if(x)return x}return c.fieldSchema.tooltip??""}),n=e.computed(()=>c.touched&&c.errors.length>0),r=e.computed(()=>[(l==null?void 0:l.classes.value.field)??"fc-field",c.fieldSchema.className??"",c.fieldSchema.disabled?"opacity-50 cursor-not-allowed":"",c.fieldSchema.readOnly?"fc-readonly":""]),i=e.computed(()=>`fc-field-${c.fieldName}`),y=e.computed(()=>`fc-error-${c.fieldName}`);return(x,w)=>{var f,p;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([r.value,"relative mb-4"]),style:e.normalizeStyle(t.fieldSchema.style)},[t.fieldSchema.type!=="hidden"?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("label",{for:i.value,class:e.normalizeClass([((f=e.unref(l))==null?void 0:f.classes.value.label)??"fc-label","block text-sm font-medium text-gray-700"])},[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.fieldSchema.required?(e.openBlock(),e.createElementBlock("span",Ut,"*")):e.createCommentVNode("",!0)],10,Pt),o.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"relative inline-flex",onMouseenter:w[0]||(w[0]=u=>s.value=!0),onMouseleave:w[1]||(w[1]=u=>s.value=!1),onFocusin:w[2]||(w[2]=u=>s.value=!0),onFocusout:w[3]||(w[3]=u=>s.value=!1)},[e.createElementVNode("button",{type:"button",class:"inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40","aria-label":`Info: ${o.value}`,tabindex:"0"}," i ",8,Ht),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"motion-safe:transition motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Gt,[e.createTextVNode(e.toDisplayString(o.value)+" ",1),w[4]||(w[4]=e.createElementVNode("div",{class:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900"},null,-1))])):e.createCommentVNode("",!0)]),_:1})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{id:i.value},[e.renderSlot(x.$slots,"default")],8,qt),e.createVNode(e.TransitionGroup,{tag:"div","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 -translate-y-1 max-h-0","enter-to-class":"opacity-100 translate-y-0 max-h-8","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0 max-h-8","leave-to-class":"opacity-0 -translate-y-1 max-h-0",class:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value?t.errors:[],(u,b)=>{var V;return e.openBlock(),e.createElementBlock("p",{key:u+b,id:b===0?y.value:void 0,class:e.normalizeClass([((V=e.unref(l))==null?void 0:V.classes.value.error)??"fc-error","mt-1 text-xs text-red-500"]),role:"alert"},e.toDisplayString(u),11,Zt)}),128))]),_:1}),m.value&&!n.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass([((p=e.unref(l))==null?void 0:p.classes.value.helpText)??"fc-help-text","mt-1 text-xs text-gray-400"])},e.toDisplayString(m.value),3)):e.createCommentVNode("",!0)],6)}}}),Yt={key:1,class:"rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"},te=e.defineComponent({__name:"FormField",props:{name:{}},setup(t){const c=t,a=e.inject(R);if(!a)throw new Error("FormField must be used inside a FormBuilder (FormContextKey not provided)");const l=e.inject(U,null),s=e.computed(()=>S.extractFields(a.schema.fields).find(f=>f.name===c.name)),d=e.computed(()=>{var u;const f=s.value;if(!f)return;const p=(u=l==null?void 0:l.value)==null?void 0:u[f.type];return p||Y(f.type)}),m=e.computed(()=>a.values[c.name]),o=e.computed(()=>a.errors[c.name]??[]),n=e.computed(()=>a.touched[c.name]??!1),r=e.computed(()=>{const f=s.value;return f?f.condition?S.evaluateCondition(f.condition,a.values):typeof f.visible=="function"?f.visible({values:{...a.values},getFieldValue:p=>a.values[p]}):f.visible??!0:!1}),i=e.computed(()=>{const f=s.value;return f?typeof f.disabled=="function"?f.disabled({values:{...a.values},getFieldValue:p=>a.values[p]}):f.disabled??!1:!1}),y=e.computed(()=>{const f=s.value;if(!f)return{};const{name:p,label:u,helpText:b,tooltip:V,condition:h,translations:B,meta:k,rules:$,visible:C,className:N,style:z,defaultValue:A,...K}=f;return{...K,modelValue:m.value,disabled:i.value,readonly:f.readOnly??!1,placeholder:f.placeholder??""}});function x(f){a.setFieldValue(c.name,f)}function w(){var f;a.touched[c.name]=!0,((f=a.schema.settings)==null?void 0:f.validateOnBlur)!==!1&&a.validateField(c.name)}return(f,p)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[r.value&&s.value?(e.openBlock(),e.createBlock(_t,{key:0,"field-schema":s.value,"field-name":t.name,errors:o.value,touched:n.value},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value),e.mergeProps({key:0},y.value,{"aria-invalid":n.value&&o.value.length>0?!0:void 0,"aria-describedby":n.value&&o.value.length>0?`fc-error-${t.name}`:void 0,"onUpdate:modelValue":x,onBlur:w}),null,16,["aria-invalid","aria-describedby"])):(e.openBlock(),e.createElementBlock("div",Yt,' No component registered for field type "'+e.toDisplayString(s.value.type)+'" ',1))]),_:1},8,["field-schema","field-name","errors","touched"])):e.createCommentVNode("",!0)]),_:1}))}}),Wt={key:0,class:"relative flex justify-center"},Qt={class:"bg-white px-3 text-xs text-gray-500"},Jt=e.defineComponent({__name:"FormDivider",props:{label:{},className:{}},setup(t){return(c,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","relative my-4"]),role:"separator"},[a[0]||(a[0]=e.createElementVNode("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[e.createElementVNode("div",{class:"w-full border-t border-gray-200"})],-1)),t.label?(e.openBlock(),e.createElementBlock("div",Wt,[e.createElementVNode("span",Qt,e.toDisplayString(t.label),1)])):e.createCommentVNode("",!0)],2))}}),Xt=["aria-labelledby"],ea={key:0,class:"border-b border-gray-100 px-4 py-3"},ta=["id"],aa={key:1,class:"mt-0.5 text-xs text-gray-500"},la=["id"],oa=e.defineComponent({__name:"FormGroup",props:{title:{},description:{},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},children:{},className:{}},setup(t){const c=t,a=e.ref(c.collapsed);function l(){c.collapsible&&(a.value=!a.value)}const s=e.computed(()=>c.title?`fc-group-${c.title.toLowerCase().replace(/\s+/g,"-")}`:void 0);return(d,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass([[t.className??""],"rounded-lg border border-gray-200 bg-white"]),"aria-labelledby":s.value},[t.title||t.description?(e.openBlock(),e.createElementBlock("div",ea,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.collapsible?"button":"div"),{type:t.collapsible?"button":void 0,class:e.normalizeClass(["flex w-full items-center justify-between text-left",t.collapsible?"cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded":""]),"aria-expanded":t.collapsible?!a.value:void 0,"aria-controls":t.collapsible?`fc-group-body-${s.value}`:void 0,onClick:l},{default:e.withCtx(()=>[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("legend",{key:0,id:s.value,class:"text-sm font-semibold text-gray-800"},e.toDisplayString(t.title),9,ta)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",aa,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),t.collapsible?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200",a.value?"":"rotate-180"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...m[0]||(m[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["type","class","aria-expanded","aria-controls"]))])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"max-h-0 opacity-0 overflow-hidden","enter-to-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-to-class":"max-h-0 opacity-0 overflow-hidden"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:t.collapsible?`fc-group-body-${s.value}`:void 0,class:"p-4"},[e.createVNode(v,{nodes:t.children},null,8,["nodes"])],8,la),[[e.vShow,!a.value]])]),_:1})],10,Xt))}}),na=["innerHTML"],ra=e.defineComponent({__name:"FormHtml",props:{content:{},className:{}},setup(t){const c=t,a=e.computed(()=>S.sanitizeHtml(c.content));return(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","fc-html prose prose-sm max-w-none text-gray-700"]),innerHTML:a.value},null,10,na))}}),sa=e.defineComponent({__name:"FormRow",props:{children:{},gap:{},align:{default:"stretch"},className:{}},setup(t){const c=t,a=e.computed(()=>({start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"})[c.align]??"items-stretch"),l=e.computed(()=>c.gap?typeof c.gap=="number"?`${c.gap}px`:c.gap:"");return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid grid-cols-12",[a.value,t.className??""]]),style:e.normalizeStyle(l.value?{gap:l.value}:{gap:"1rem"}),role:"group"},[e.createVNode(v,{nodes:t.children},null,8,["nodes"])],6))}}),ia={"aria-label":"Form steps",class:"flex items-center justify-center"},ca={class:"flex items-center gap-0"},da=["disabled","aria-current","aria-label","onClick"],ma={key:0,class:"h-4 w-4 motion-safe:transition-transform motion-safe:duration-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},ua={key:1},fa={key:0,class:"text-center"},pa={class:"text-base font-semibold text-gray-800"},ba={key:0,class:"mt-1 text-sm text-gray-500"},ya={class:"flex items-center justify-between border-t border-gray-100 pt-4"},ga=["disabled"],ha={class:"text-xs text-gray-400"},ka={key:1,class:"w-[72px]"},xa=e.defineComponent({__name:"FormSteps",props:{steps:{},linear:{type:Boolean,default:!1},className:{}},setup(t){const c=t,a=e.inject(R),l=e.ref(0),s=e.ref(new Set),d=e.computed(()=>c.steps),m=e.computed(()=>d.value.length),o=e.computed(()=>l.value===0),n=e.computed(()=>l.value===m.value-1);function r(f){const p=[];function u(b){for(const V of b)if(S.isFieldNode(V))p.push(V.name);else if(V.type==="row"||V.type==="group")u(V.children);else if(V.type==="steps")for(const h of V.steps)u(h.children);else if(V.type==="tabs")for(const h of V.tabs)u(h.children)}return u(f.children),p}async function i(){if(!a||!c.linear)return!0;const f=d.value[l.value];if(!f)return!0;const p=r(f);let u=!0;for(const b of p){const V=await a.validateField(b);a.touched[b]=!0,V.length>0&&(u=!1)}return u}async function y(){n.value||c.linear&&!await i()||(s.value.add(l.value),l.value++)}function x(){o.value||l.value--}function w(f){c.linear&&f>l.value||(l.value=f)}return(f,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","space-y-6"])},[e.createElementVNode("nav",ia,[e.createElementVNode("ol",ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(u,b)=>(e.openBlock(),e.createElementBlock("li",{key:b,class:"flex items-center"},[e.createElementVNode("button",{type:"button",disabled:t.linear&&b>l.value,"aria-current":b===l.value?"step":void 0,"aria-label":`Step ${b+1}: ${u.title}`,class:e.normalizeClass(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",[s.value.has(b)&&b!==l.value?"border-green-500 bg-green-500 text-white":b!==l.value?"border-gray-300 bg-white text-gray-500":"text-white",t.linear&&b>l.value?"cursor-not-allowed":"cursor-pointer hover:shadow-md"]]),style:e.normalizeStyle(b===l.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:V=>w(b)},[s.value.has(b)&&b!==l.value?(e.openBlock(),e.createElementBlock("svg",ma,[...p[0]||(p[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",ua,e.toDisplayString(b+1),1))],14,da),b<d.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12",s.value.has(b)?"bg-green-500":"bg-gray-200"])},null,2)):e.createCommentVNode("",!0)]))),128))])]),d.value[l.value]?(e.openBlock(),e.createElementBlock("div",fa,[e.createElementVNode("h3",pa,e.toDisplayString(d.value[l.value].title),1),d.value[l.value].description?(e.openBlock(),e.createElementBlock("p",ba,e.toDisplayString(d.value[l.value].description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-2"},{default:e.withCtx(()=>[d.value[l.value]?(e.openBlock(),e.createElementBlock("div",{key:l.value},[e.createVNode(v,{nodes:d.value[l.value].children},null,8,["nodes"])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",disabled:o.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",onClick:x}," Previous ",8,ga),e.createElementVNode("span",ha,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(m.value),1),n.value?(e.openBlock(),e.createElementBlock("div",ka)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"},onClick:y}," Next "))])],2))}}),Ba={class:"relative flex border-b border-gray-200",role:"tablist","aria-orientation":"horizontal"},wa=["id","aria-selected","aria-controls","aria-disabled","tabindex","onClick","onKeydown"],Ca={key:0,class:"absolute inset-x-0 -bottom-px h-0.5 motion-safe:transition-all motion-safe:duration-200",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},Va=["id","aria-labelledby"],Ea=e.defineComponent({__name:"FormTabs",props:{tabs:{},className:{}},setup(t){const c=t,a=e.ref(0),l=e.computed(()=>c.tabs);function s(o){const n=l.value[o];n!=null&&n.disabled||(a.value=o)}function d(o,n){var x;const r=l.value.length;let i=n;if(o.key==="ArrowRight"||o.key==="ArrowDown")o.preventDefault(),i=(n+1)%r;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")o.preventDefault(),i=(n-1+r)%r;else if(o.key==="Home")o.preventDefault(),i=0;else if(o.key==="End")o.preventDefault(),i=r-1;else return;for(;(x=l.value[i])!=null&&x.disabled&&i!==n;)o.key==="ArrowLeft"||o.key==="ArrowUp"?i=(i-1+r)%r:i=(i+1)%r;s(i);const y=document.getElementById(`fc-tab-${i}`);y==null||y.focus()}const m=e.computed(()=>`fc-tabpanel-${a.value}`);return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.className??"")},[e.createElementVNode("div",Ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,i)=>(e.openBlock(),e.createElementBlock("button",{key:i,id:`fc-tab-${i}`,type:"button",role:"tab","aria-selected":i===a.value,"aria-controls":m.value,"aria-disabled":r.disabled||void 0,tabindex:i===a.value?0:-1,class:e.normalizeClass(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40",[i!==a.value?r.disabled?"cursor-not-allowed text-gray-300":"text-gray-500 hover:text-gray-700":""]]),style:e.normalizeStyle(i===a.value?{color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y=>s(i),onKeydown:y=>d(y,i)},[e.createTextVNode(e.toDisplayString(r.title)+" ",1),i===a.value?(e.openBlock(),e.createElementBlock("span",Ca)):e.createCommentVNode("",!0)],46,wa))),128))]),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[l.value[a.value]?(e.openBlock(),e.createElementBlock("div",{key:a.value,id:m.value,role:"tabpanel","aria-labelledby":`fc-tab-${a.value}`,tabindex:"0",class:"pt-4"},[e.createVNode(v,{nodes:l.value[a.value].children},null,8,["nodes"])],8,Va)):e.createCommentVNode("",!0)]),_:1})],2))}}),v=e.defineComponent({__name:"LayoutRenderer",props:{nodes:{}},setup(t){const c=e.inject(R);function a(s){return c?S.evaluateCondition(s.condition,c.values):!0}function l(s){return s==="full"?{gridColumn:"1 / -1"}:s==="auto"?{gridColumn:"auto"}:typeof s=="number"?{gridColumn:`span ${s} / span ${s}`}:{gridColumn:"span 12 / span 12"}}return(s,d)=>{const m=e.resolveComponent("LayoutRenderer",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(o,n)=>{var r;return e.openBlock(),e.createElementBlock(e.Fragment,{key:n},[e.unref(S.isFieldNode)(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(te,{name:o.name},null,8,["name"])],6)):o.type==="field"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(l(o.span))},[e.createVNode(te,{name:o.name},null,8,["name"])],6)):o.type==="row"?(e.openBlock(),e.createBlock(sa,{key:2,children:o.children,gap:o.gap,align:o.align,"class-name":o.className},null,8,["children","gap","align","class-name"])):o.type==="group"?(e.openBlock(),e.createBlock(oa,{key:3,title:o.title,description:o.description,collapsible:o.collapsible,collapsed:o.collapsed,children:o.children,"class-name":o.className},null,8,["title","description","collapsible","collapsed","children","class-name"])):o.type==="steps"?(e.openBlock(),e.createBlock(xa,{key:4,steps:o.steps,linear:o.linear,"class-name":o.className},null,8,["steps","linear","class-name"])):o.type==="tabs"?(e.openBlock(),e.createBlock(Ea,{key:5,tabs:o.tabs,"class-name":o.className},null,8,["tabs","class-name"])):o.type==="divider"?(e.openBlock(),e.createBlock(Jt,{key:6,label:o.label,"class-name":o.className},null,8,["label","class-name"])):o.type==="html"?(e.openBlock(),e.createBlock(ra,{key:7,content:o.content,"class-name":o.className},null,8,["content","class-name"])):o.type==="conditional"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[a(o)?(e.openBlock(),e.createBlock(m,{key:0,nodes:o.children},null,8,["nodes"])):(r=o.elseChildren)!=null&&r.length?(e.openBlock(),e.createBlock(m,{key:1,nodes:o.elseChildren},null,8,["nodes"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}),128)}}}),Na={key:0,class:"mb-6"},$a={key:0,class:"text-lg font-semibold text-gray-900"},Sa={key:1,class:"mt-1 text-sm text-gray-500"},Fa={class:"mt-6 flex items-center gap-3"},Da=["disabled"],za={key:0,class:"mr-2 inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent","aria-hidden":"true"},Ta=["disabled"],La=e.defineComponent({__name:"FormBuilder",props:{schema:{},layout:{},locale:{default:"en"},fallbackLocale:{default:"en"},modelValue:{},theme:{},components:{}},emits:["submit","error","update:modelValue"],setup(t,{expose:c,emit:a}){const l=t,s=a,d=[["text",vt],["number",Ue],["textarea",Mt],["select",kt],["checkbox",Ee],["checkbox-group",xe],["radio",it],["switch",$t],["date",Se],["file",je],["slider",wt],["tags",Tt],["phone",lt]];for(const[p,u]of d)W(p)||_(p,u);e.provide(U,e.computed(()=>l.components??{})),pe(e.toRef(l,"theme"));const m=L(),o=ee(l.schema,{locale:l.locale,fallbackLocale:l.fallbackLocale});if(l.modelValue)for(const[p,u]of Object.entries(l.modelValue))o.setFieldValue(p,u);e.watch(()=>l.modelValue,p=>{if(p)for(const[u,b]of Object.entries(p))o.values[u]!==b&&o.setFieldValue(u,b)},{deep:!0}),e.watch(()=>({...o.values}),p=>{s("update:modelValue",p)},{deep:!0}),e.watch(()=>l.locale,p=>{p&&o.setLocale(p)}),J();const n=e.computed(()=>{var V,h;const p=l.schema.translations;if(!p)return"";const u=p[l.locale];if((V=u==null?void 0:u.messages)!=null&&V.title)return u.messages.title;const b=p[l.fallbackLocale];return((h=b==null?void 0:b.messages)==null?void 0:h.title)??""}),r=e.computed(()=>{var V,h;const p=l.schema.translations;if(!p)return"";const u=p[l.locale];if((V=u==null?void 0:u.messages)!=null&&V.description)return u.messages.description;const b=p[l.fallbackLocale];return((h=b==null?void 0:b.messages)==null?void 0:h.description)??""}),i=e.computed(()=>{const p=l.schema.translations;if(!p)return"Submit";const u=p[l.locale];if(u!=null&&u.submit)return u.submit;const b=p[l.fallbackLocale];return(b==null?void 0:b.submit)??"Submit"}),y=e.computed(()=>{const p=l.schema.translations;if(!p)return"Reset";const u=p[l.locale];if(u!=null&&u.reset)return u.reset;const b=p[l.fallbackLocale];return(b==null?void 0:b.reset)??"Reset"}),x=e.computed(()=>{var p,u;return(u=(p=l.layout)==null?void 0:p.nodes)!=null&&u.length?l.layout.nodes:l.schema.fields});async function w(){try{await o.submit(async p=>{s("submit",p)})}catch(p){s("error",p)}}function f(){o.reset()}return c({form:o}),(p,u)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass([e.unref(m).classes.value.form,"fc-form-builder"]),style:e.normalizeStyle(e.unref(m).cssVars.value),novalidate:"",onSubmit:e.withModifiers(w,["prevent"]),onReset:e.withModifiers(f,["prevent"])},[n.value||r.value?(e.openBlock(),e.createElementBlock("div",Na,[n.value?(e.openBlock(),e.createElementBlock("h2",$a,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("p",Sa,e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(v,{nodes:x.value},null,8,["nodes"]),e.createElementVNode("div",Fa,[e.createElementVNode("button",{type:"submit",disabled:e.unref(o).isSubmitting.value,class:e.normalizeClass([e.unref(m).classes.value.button,"fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),style:{"background-color":"var(--fc-color-primary, #3b82f6)"}},[e.unref(o).isSubmitting.value?(e.openBlock(),e.createElementBlock("span",za)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)],10,Da),e.createElementVNode("button",{type:"reset",disabled:e.unref(o).isSubmitting.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"},e.toDisplayString(y.value),9,Ta)])],38))}});T.FormBuilder=La,T.FormComponentsKey=U,T.FormContextKey=R,T.FormI18nKey=P,T.getFieldComponent=Y,T.getRegisteredFieldTypes=oe,T.hasFieldType=W,T.registerFieldType=_,T.unregisterFieldType=le,T.useForm=ee,T.useFormI18n=Q,T.useFormI18nContext=J,Object.keys(S).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(T,t)&&Object.defineProperty(T,t,{enumerable:!0,get:()=>S[t]})}),Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(T,F){typeof exports=="object"&&typeof module<"u"?F(exports,require("@formatica/core"),require("vue"),require("libphonenumber-js")):typeof define=="function"&&define.amd?define(["exports","@formatica/core","vue","libphonenumber-js"],F):(T=typeof globalThis<"u"?globalThis:T||self,F(T.Formatica={},T.FormaticaCore,T.Vue,T.libphonenumber))})(this,function(T,F,e,I){"use strict";const H=Symbol("FormaticaComponents"),j=new Map;function G(t,c){j.set(t,c)}function oe(t){j.delete(t)}function Q(t){return j.get(t)}function J(t){return j.has(t)}function ne(){return Array.from(j.keys())}function re(){const t=new Map;function c(a,d){t.has(a)||t.set(a,new Set);const n=t.get(a);return n?(n.add(d),()=>{n.delete(d)}):()=>{}}function l(a,d){const n=t.get(a);if(n)for(const m of n)m(d)}return{on:c,emit:l}}const K=Symbol("FormaticaI18n"),se={required:"This field is required",email:"Please enter a valid email address",url:"Please enter a valid URL",min:"Must be at least {min}",max:"Must be at most {max}",minLength:"Must be at least {min} characters",maxLength:"Must be at most {max} characters",between:"Must be between {min} and {max}",pattern:"Invalid format",numeric:"Must be a number",integer:"Must be an integer",alpha:"Must contain only letters",alphaNumeric:"Must contain only letters and numbers",confirmed:"Confirmation does not match",date:"Please enter a valid date"};function X(t){const{locale:c,fallbackLocale:l="en",fieldTranslations:a={},formTranslations:d={}}=t;function n(s,i){const h=a[s];if(h){const C=h[c.value];if(C){const y=C[i];if(typeof y=="string")return y}const E=h[l];if(E){const y=E[i];if(typeof y=="string")return y}}return i==="label"?F.titleCase(s):""}function m(s,i){var C,E;const h=a[s];if(h){const y=h[c.value];if((C=y==null?void 0:y.options)!=null&&C[i])return y.options[i];const p=h[l];if((E=p==null?void 0:p.options)!=null&&E[i])return p.options[i]}return i}function o(s,i){var y,p;const h=(y=d[c.value])==null?void 0:y.messages;if(h!=null&&h[s])return Z(h[s],i??{});const C=(p=d[l])==null?void 0:p.messages;if(C!=null&&C[s])return Z(C[s],i??{});const E=se[s];return E?Z(E,i??{}):`Validation failed: ${s}`}const r={locale:c,fallbackLocale:l,t:n,tOption:m,tValidation:o};return e.provide(K,r),r}function ee(){return e.inject(K)}function Z(t,c){return t.replace(/\{(\w+)\}/g,(l,a)=>c[a]!==void 0?String(c[a]):`{${a}}`)}function te(t){return t.split("|").map(c=>{const[l,...a]=c.split(":"),d=l??"",n={};if(a.length>0){const o=a.join(":").split(",");d==="between"&&o.length===2?(n.min=o[0],n.max=o[1]):o.length===1?n[d]=o[0]:n.values=o}return{name:d,params:n}})}function ie(t){const c=t.rules;if(!c){const a=[];return t.required&&a.push({name:"required"}),a}if(typeof c=="string")return te(c);if(Array.isArray(c))return c.flatMap(a=>typeof a=="string"?te(a):[]);const l=[];for(const[a,d]of Object.entries(c)){if(d===!1)continue;const n={};typeof d=="object"&&d!==null&&!Array.isArray(d)?Object.assign(n,d):d!==!0&&(n[a]=d),l.push({name:a,params:n})}return l}function ce(t,c){let l=null,a=null;return(...d)=>new Promise(n=>{l!==null&&(clearTimeout(l),a&&a([])),a=n,l=setTimeout(async()=>{l=null;const m=await t(...d);n(m),a=null},c)})}function de(t){const{fields:c,values:l,settings:a}=t,d=e.ref({}),n=new Map;function m(C,E){const y=`${C}:${E}`;n.has(y)||n.set(y,ce(async(...g)=>o(g[0],g[1]),E));const p=n.get(y);if(!p)throw new Error(`Debounced validator not found for ${y}`);return p}async function o(C,E){var $;const y=c.value.find(V=>V.name===C);if(!y)return[];const p=ie(y),g=l.value[C],b=[];for(const V of p){if(($=V.params)!=null&&$.when){const w=V.params.when;if(("field"in w||"and"in w||"or"in w)&&!F.evaluateCondition(w,l.value))continue}if(V.optional&&me(g))continue;let B;if(V.validator)B=await V.validator(g,V.params??{},E);else{const w=F.getRule(V.name);if(!w)continue;B=await w(g,V.params??{},E)}if(B!==!0){const w=V.message?ue(V.message,V.params??{}):typeof B=="string"?B:`Validation failed for rule: ${V.name}`;if(b.push(w),V.bail)break}}return d.value[C]=b,b}async function r(C,E){const y=a==null?void 0:a.debounce;return y&&y>0?m(C,y)(C,E):o(C,E)}async function s(C){const E={},y=c.value.map(async p=>{const g=await o(p.name,C);g.length>0&&(E[p.name]=g)});return await Promise.all(y),d.value={...E},E}function i(C){delete d.value[C]}function h(){d.value={}}return{errors:d,validateField:r,validateAll:s,clearFieldErrors:i,clearAllErrors:h}}function me(t){return!!(t==null||t===""||Array.isArray(t)&&t.length===0)}function ue(t,c){return t.replace(/\{(\w+)\}/g,(l,a)=>c[a]!==void 0?String(c[a]):`{${a}}`)}const v=Symbol("FormaticaContext");function fe(t){switch(t.type){case"tags":return[];case"checkbox-group":return[];case"checkbox":return!1;case"switch":return!1;case"number":case"slider":return null;case"file":return null;default:return""}}function q(t){const c={};for(const l of t)c[l.name]=l.defaultValue??fe(l);return c}function pe(t){const c={};for(const l of t)l.translations&&(c[l.name]=l.translations);return c}function ae(t,c){const l=e.ref((c==null?void 0:c.locale)??"en"),a=(c==null?void 0:c.fallbackLocale)??"en";let d=t;const n=e.ref(F.extractFields(t.fields)),m=e.reactive(q(F.extractFields(t.fields))),o=e.reactive({}),r=e.reactive({}),s=e.reactive({}),i=e.ref(!1),h=e.ref(0),C=e.computed(()=>Object.values(o).every(x=>x.length===0)),E=e.computed(()=>Object.values(s).some(Boolean)),y=re();function p(){return{values:{...m},getFieldValue:x=>m[x]}}const g=e.computed(()=>({...m})),b=de({fields:n,values:g,settings:t.settings});X({locale:l,fallbackLocale:a,fieldTranslations:pe(F.extractFields(t.fields)),formTranslations:t.translations});let $=q(F.extractFields(t.fields));e.watch(()=>({...m}),(x,N)=>{var D;if(N){for(const z of Object.keys(x))x[z]!==N[z]&&(s[z]=!0,y.emit("field:change",{field:z,value:x[z],previousValue:N[z]}),(D=t.settings)!=null&&D.validateOnChange&&f(z));y.emit("change",{values:x})}},{deep:!0});const V=new Map;function B(x){const N=x.name;return{name:N,value:e.computed({get:()=>m[N],set:D=>{m[N]=D}}),errors:e.computed(()=>o[N]??[]),touched:e.computed({get:()=>r[N]??!1,set:D=>{r[N]=D}}),dirty:e.computed({get:()=>s[N]??!1,set:D=>{s[N]=D}}),disabled:e.computed(()=>typeof x.disabled=="function"?x.disabled(p()):x.disabled??!1),visible:e.computed(()=>x.condition?F.evaluateCondition(x.condition,m):typeof x.visible=="function"?x.visible(p()):x.visible??!0),schema:x,validate:()=>f(N),reset:()=>{m[N]=$[N]??null,delete o[N],r[N]=!1,s[N]=!1},clear:()=>{m[N]=null,delete o[N]}}}function w(){V.clear();for(const x of F.extractFields(d.fields))V.set(x.name,B(x))}w();async function f(x){const N=await b.validateField(x,p());return o[x]=N,y.emit("validate:field",{field:x,valid:N.length===0,errors:N}),N}async function u(){const x=await b.validateAll(p());for(const D of Object.keys(o))D in x||delete o[D];for(const[D,z]of Object.entries(x))o[D]=z;const N=Object.values(x).every(D=>D.length===0);return y.emit("validate",{valid:N,errors:{...x}}),N}async function k(x){i.value=!0,h.value+=1;try{for(const D of F.extractFields(d.fields))r[D.name]=!0;if(!await u()){y.emit("submit:error",{values:{...m},error:new Error("Validation failed")});return}y.emit("submit",{values:{...m}}),x&&await x({...m},p()),y.emit("submit:success",{values:{...m},result:void 0})}catch(N){throw y.emit("submit:error",{values:{...m},error:N}),N}finally{i.value=!1}}function S(){for(const x of F.extractFields(d.fields))m[x.name]=$[x.name]??null,delete o[x.name],r[x.name]=!1,s[x.name]=!1;b.clearAllErrors(),y.emit("reset",void 0)}function M(){for(const x of F.extractFields(d.fields))m[x.name]=null,delete o[x.name];b.clearAllErrors()}function P(x){d=x;const N=F.extractFields(x.fields);n.value=N,$=q(N);for(const z of N)z.name in m||(m[z.name]=z.defaultValue??null);const D=new Set(N.map(z=>z.name));for(const z of Object.keys(m))D.has(z)||(delete m[z],delete o[z],delete r[z],delete s[z]);w()}const U={values:m,errors:o,touched:r,dirty:s,isValid:C,isDirty:E,isSubmitting:i,submitCount:h,validate:u,validateField:f,submit:k,reset:S,clear:M,setError:(x,N)=>{o[x]=N},clearError:x=>{delete o[x],b.clearFieldErrors(x)},clearErrors:()=>{for(const x of Object.keys(o))delete o[x];b.clearAllErrors()},getField:x=>V.get(x),setFieldValue:(x,N)=>{m[x]=N},setFieldDisabled:(x,N)=>{const D=F.extractFields(d.fields).find(z=>z.name===x);D&&(D.disabled=N)},setFieldVisible:(x,N)=>{const D=F.extractFields(d.fields).find(z=>z.name===x);D&&(D.visible=N)},on:y.on,locale:l,setLocale:x=>{l.value=x},schema:d,updateSchema:P};return e.provide(v,U),U}const _=Symbol("FormaticaTheme"),Y={name:"default",colors:{primary:"#3b82f6",primaryHover:"#2563eb",error:"#ef4444",errorHover:"#dc2626",success:"#22c55e",warning:"#f59e0b",info:"#3b82f6",text:"#1f2937",textSecondary:"#6b7280",textDisabled:"#9ca3af",background:"#ffffff",backgroundDisabled:"#f3f4f6",border:"#d1d5db",borderFocus:"#3b82f6",borderError:"#ef4444",placeholder:"#9ca3af"},typography:{fontFamily:"inherit",fontSize:"0.875rem",fontSizeSmall:"0.75rem",fontSizeLarge:"1rem",lineHeight:"1.5",labelFontWeight:"500"},spacing:{fieldGap:"1rem",rowGap:"1rem",inputPaddingX:"0.75rem",inputPaddingY:"0.5rem",labelMarginBottom:"0.375rem"},borders:{radius:"0.375rem",radiusSmall:"0.25rem",radiusLarge:"0.5rem",width:"1px",style:"solid"},shadows:{focus:"0 0 0 3px rgba(59, 130, 246, 0.1)",error:"0 0 0 3px rgba(239, 68, 68, 0.1)",dropdown:"0 4px 6px -1px rgba(0, 0, 0, 0.1)"},transitions:{duration:"150ms",timingFunction:"ease-in-out"}};function ye(t){const c=e.isRef(t)?e.computed(()=>t.value??Y):e.ref(t??Y),l=e.computed(()=>{const n=c.value.components??{};return{form:n.form??"fc-form",field:n.field??"fc-field",label:n.label??"fc-label",input:n.input??"fc-input",error:n.error??"fc-error",helpText:n.helpText??"fc-help-text",group:n.group??"fc-group",row:n.row??"fc-row",steps:n.steps??"fc-steps",tabs:n.tabs??"fc-tabs",button:n.button??"fc-button"}}),a=e.computed(()=>{const n=c.value,m={};if(n.colors)for(const[o,r]of Object.entries(n.colors))r&&(m[`--fc-color-${A(o)}`]=r);if(n.typography)for(const[o,r]of Object.entries(n.typography))r&&(m[`--fc-${A(o)}`]=r);if(n.spacing)for(const[o,r]of Object.entries(n.spacing))r&&(m[`--fc-${A(o)}`]=r);if(n.borders)for(const[o,r]of Object.entries(n.borders))r&&(m[`--fc-border-${A(o)}`]=r);if(n.shadows)for(const[o,r]of Object.entries(n.shadows))r&&(m[`--fc-shadow-${A(o)}`]=r);if(n.transitions)for(const[o,r]of Object.entries(n.transitions))r&&(m[`--fc-transition-${A(o)}`]=r);return n.cssVars&&Object.assign(m,n.cssVars),m}),d={config:c.value,classes:l,cssVars:a};return e.provide(_,d),d}function L(){const t=e.inject(_);return t||be()}function be(){const t=e.computed(()=>({form:"fc-form",field:"fc-field",label:"fc-label",input:"fc-input",error:"fc-error",helpText:"fc-help-text",group:"fc-group",row:"fc-row",steps:"fc-steps",tabs:"fc-tabs",button:"fc-button"})),c=e.computed(()=>({}));return{config:Y,classes:t,cssVars:c}}function A(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const W=Symbol("Formatica");function ge(t={}){return{install(c){if(c.provide(W,e.reactive(t)),t.components)for(const[l,a]of Object.entries(t.components))G(l,a)}}}const he=["checked","disabled","onChange"],ke=["aria-checked","aria-disabled","onClick","onKeydown"],xe={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Be={class:"text-sm text-gray-700"},we=e.defineComponent({__name:"CheckboxGroupInput",props:{modelValue:{},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minSelect:{},maxSelect:{}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();function d(r){return l.modelValue.includes(r)}function n(r){return!!(l.disabled||r.disabled||l.maxSelect&&!d(r.value)&&l.modelValue.length>=l.maxSelect)}function m(r){if(n(r))return;const s=[...l.modelValue],i=s.indexOf(r.value);if(i>=0){if(l.minSelect&&s.length<=l.minSelect)return;s.splice(i,1)}else s.push(r.value);a("update:modelValue",s)}function o(r,s){(r.key===" "||r.key==="Enter")&&(r.preventDefault(),m(s))}return(r,s)=>(e.openBlock(),e.createElementBlock("div",{role:"group",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",n(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"checkbox",checked:d(i.value),disabled:n(i),class:"sr-only",onChange:h=>m(i),onBlur:s[0]||(s[0]=h=>a("blur",h))},null,40,he),e.createElementVNode("div",{role:"checkbox","aria-checked":d(i.value),"aria-disabled":n(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",d(i.value)?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(d(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>m(i),onKeydown:h=>o(h,i)},[d(i.value)?(e.openBlock(),e.createElementBlock("svg",xe,[...s[1]||(s[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,ke),e.createElementVNode("span",Be,e.toDisplayString(i.label),1)],2))),128))],2))}}),Ce=["checked","disabled"],Ve=["aria-checked","aria-disabled"],Ee={key:0,class:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},Ne={key:0,class:"text-sm text-gray-700"},$e=e.defineComponent({__name:"CheckboxInput",props:{modelValue:{type:Boolean},checkboxLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();const d=e.computed(()=>["inline-flex items-center gap-2 select-none",l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function n(){l.disabled||a("update:modelValue",!l.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),n())}return(o,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(d.value)},[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:n,onBlur:r[0]||(r[0]=s=>a("blur",s))},null,40,Ce),e.createElementVNode("div",{role:"checkbox","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",t.modelValue?"text-white":"border-gray-300 bg-white"]),style:e.normalizeStyle(t.modelValue?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:n,onKeydown:m},[t.modelValue?(e.openBlock(),e.createElementBlock("svg",Ee,[...r[1]||(r[1]=[e.createElementVNode("path",{d:"M2 6l3 3 5-5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])])):e.createCommentVNode("",!0)],46,Ve),t.checkboxLabel?(e.openBlock(),e.createElementBlock("span",Ne,e.toDisplayString(t.checkboxLabel),1)):e.createCommentVNode("",!0)],2))}}),Se=["value","min","max","placeholder","disabled","aria-disabled"],Fe=e.defineComponent({__name:"DateInput",props:{modelValue:{},format:{},minDate:{},maxDate:{},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const l=t,a=c,d=L(),n=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input","transition-colors duration-200",l.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",d.classes.value.input].filter(Boolean).join(" "));function m(o){const r=o.target;a("update:modelValue",r.value)}return(o,r)=>(e.openBlock(),e.createElementBlock("input",{type:"date",value:t.modelValue,min:t.minDate,max:t.maxDate,placeholder:t.placeholder,disabled:t.disabled,class:e.normalizeClass(n.value),"aria-disabled":t.disabled||void 0,onInput:m,onBlur:r[0]||(r[0]=s=>a("blur",s)),onFocus:r[1]||(r[1]=s=>a("focus",s))},null,42,Se))}}),R=(t,c)=>{const l=t.__vccOpts||t;for(const[a,d]of c)l[a]=d;return l},De=R(Fe,[["__scopeId","data-v-7d4bc9b7"]]),ze=["aria-disabled","onKeydown"],Te={key:0,class:"mt-1 text-xs text-gray-400"},Le=["accept","multiple"],Me={key:0,class:"mt-3 space-y-2"},Ie={class:"flex items-center gap-2 truncate"},Ae={class:"truncate"},je={class:"shrink-0 text-xs text-gray-400"},ve=["onClick"],Re=e.defineComponent({__name:"FileInput",props:{modelValue:{},accept:{},maxSize:{},multiple:{type:Boolean,default:!1},maxFiles:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();const d=e.ref(null),n=e.ref(!1),m=e.computed(()=>l.modelValue?Array.isArray(l.modelValue)?l.modelValue:[l.modelValue]:[]);function o(g){return g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KB`:`${(g/(1024*1024)).toFixed(1)} MB`}function r(g){let b=g;if(l.maxSize){const $=l.maxSize;b=b.filter(V=>V.size<=$)}if(l.multiple&&l.maxFiles){const $=l.maxFiles-m.value.length;b=b.slice(0,Math.max(0,$))}return b}function s(g){const b=r(g);b.length!==0&&(l.multiple?a("update:modelValue",[...m.value,...b]):a("update:modelValue",b[0]??null))}function i(g){const b=g.target;b.files&&(s(Array.from(b.files)),b.value="")}function h(g){if(l.disabled)return;const b=m.value.filter(($,V)=>V!==g);l.multiple?a("update:modelValue",b.length?b:[]):a("update:modelValue",null)}function C(g){g.preventDefault(),l.disabled||(n.value=!0)}function E(){n.value=!1}function y(g){var b;g.preventDefault(),n.value=!1,!(l.disabled||!((b=g.dataTransfer)!=null&&b.files))&&s(Array.from(g.dataTransfer.files))}function p(){var g;l.disabled||(g=d.value)==null||g.click()}return(g,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.disabled?"opacity-50 cursor-not-allowed":"")},[e.createElementVNode("div",{role:"button",tabindex:"0","aria-disabled":t.disabled||void 0,class:e.normalizeClass(["flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",n.value?"":"border-gray-300 bg-gray-50",t.disabled?"pointer-events-none":"cursor-pointer hover:border-gray-400"]),style:e.normalizeStyle(n.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)"}:{}),onClick:p,onKeydown:[e.withKeys(p,["enter"]),e.withKeys(e.withModifiers(p,["prevent"]),["space"])],onDragover:C,onDragleave:E,onDrop:y,onBlur:b[0]||(b[0]=$=>a("blur",$))},[b[1]||(b[1]=e.createElementVNode("svg",{class:"mb-2 h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"})],-1)),b[2]||(b[2]=e.createElementVNode("p",{class:"text-sm text-gray-600"},[e.createTextVNode(" Drop files here or "),e.createElementVNode("span",{class:"font-medium",style:{color:"var(--fc-color-primary, #3b82f6)"}},"browse")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",Te,"Accepted: "+e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0)],46,ze),e.createElementVNode("input",{ref_key:"fileInputRef",ref:d,type:"file",accept:t.accept,multiple:t.multiple,class:"hidden",onChange:i},null,40,Le),m.value.length>0?(e.openBlock(),e.createElementBlock("ul",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,($,V)=>(e.openBlock(),e.createElementBlock("li",{key:`${$.name}-${V}`,class:"flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"},[e.createElementVNode("div",Ie,[b[3]||(b[3]=e.createElementVNode("svg",{class:"h-4 w-4 shrink-0 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),e.createElementVNode("span",Ae,e.toDisplayString($.name),1),e.createElementVNode("span",je,"("+e.toDisplayString(o($.size))+")",1)]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200","aria-label":"Remove file",onClick:e.withModifiers(B=>h(V),["stop"])}," × ",8,ve))]))),128))])):e.createCommentVNode("",!0)],2))}}),Oe={key:0,class:"flex items-stretch"},Ke={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Pe=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ue={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},He=["value","min","max","step","disabled","readonly","aria-disabled","aria-readonly"],Ge=R(e.defineComponent({__name:"NumberInput",props:{modelValue:{},min:{},max:{},step:{default:1},precision:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const l=t,a=c,d=L(),n=e.computed(()=>!!l.prefix||!!l.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input","transition-colors duration-200",l.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",l.prefix?"rounded-l-none":"",l.suffix?"rounded-r-none":"",d.classes.value.input].filter(Boolean).join(" "));function o(r){const i=r.target.value;if(i===""){a("update:modelValue",null);return}let h=parseFloat(i);Number.isNaN(h)||(l.precision!==void 0&&(h=parseFloat(h.toFixed(l.precision))),a("update:modelValue",h))}return(r,s)=>n.value?(e.openBlock(),e.createElementBlock("div",Oe,[t.prefix?(e.openBlock(),e.createElementBlock("span",Ke,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[0]||(s[0]=i=>a("blur",i)),onFocus:s[1]||(s[1]=i=>a("focus",i))},null,42,Pe),t.suffix?(e.openBlock(),e.createElementBlock("span",Ue,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"number",value:t.modelValue??"",min:t.min,max:t.max,step:t.step,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[2]||(s[2]=i=>a("blur",i)),onFocus:s[3]||(s[3]=i=>a("focus",i))},null,42,He))}}),[["__scopeId","data-v-4e51299b"]]),Ze={class:"relative"},qe=["disabled"],_e={class:"text-lg leading-none"},Ye={class:"text-xs text-gray-500 dark:text-gray-400 font-medium"},We=["value","placeholder","disabled"],Qe={key:1,class:"absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"},Je={class:"border-b border-gray-200 dark:border-gray-700 p-2"},Xe={class:"max-h-48 overflow-y-auto"},et=["onMousedown"],tt={class:"text-lg leading-none"},at={class:"flex-1 truncate text-xs"},lt={class:"text-[11px] text-gray-400 dark:text-gray-500 font-mono"},ot={key:0,class:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"},nt=e.defineComponent({__name:"PhoneInput",props:{modelValue:{},defaultCountry:{default:"US"},countries:{},showDialCode:{type:Boolean,default:!0},placeholder:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c,d={AF:"Afghanistan",AL:"Albania",DZ:"Algeria",AD:"Andorra",AO:"Angola",AR:"Argentina",AM:"Armenia",AU:"Australia",AT:"Austria",AZ:"Azerbaijan",BH:"Bahrain",BD:"Bangladesh",BY:"Belarus",BE:"Belgium",BZ:"Belize",BJ:"Benin",BT:"Bhutan",BO:"Bolivia",BA:"Bosnia",BW:"Botswana",BR:"Brazil",BN:"Brunei",BG:"Bulgaria",BF:"Burkina Faso",BI:"Burundi",KH:"Cambodia",CM:"Cameroon",CA:"Canada",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",HR:"Croatia",CU:"Cuba",CY:"Cyprus",CZ:"Czechia",DK:"Denmark",DO:"Dominican Rep.",EC:"Ecuador",EG:"Egypt",SV:"El Salvador",EE:"Estonia",ET:"Ethiopia",FI:"Finland",FR:"France",GE:"Georgia",DE:"Germany",GH:"Ghana",GR:"Greece",GT:"Guatemala",HN:"Honduras",HK:"Hong Kong",HU:"Hungary",IS:"Iceland",IN:"India",ID:"Indonesia",IR:"Iran",IQ:"Iraq",IE:"Ireland",IL:"Israel",IT:"Italy",JM:"Jamaica",JP:"Japan",JO:"Jordan",KZ:"Kazakhstan",KE:"Kenya",KR:"South Korea",KW:"Kuwait",LV:"Latvia",LB:"Lebanon",LY:"Libya",LT:"Lithuania",LU:"Luxembourg",MO:"Macau",MY:"Malaysia",MX:"Mexico",MA:"Morocco",MZ:"Mozambique",MM:"Myanmar",NP:"Nepal",NL:"Netherlands",NZ:"New Zealand",NI:"Nicaragua",NG:"Nigeria",NO:"Norway",OM:"Oman",PK:"Pakistan",PA:"Panama",PY:"Paraguay",PE:"Peru",PH:"Philippines",PL:"Poland",PT:"Portugal",QA:"Qatar",RO:"Romania",RU:"Russia",SA:"Saudi Arabia",RS:"Serbia",SG:"Singapore",SK:"Slovakia",SI:"Slovenia",ZA:"South Africa",ES:"Spain",LK:"Sri Lanka",SE:"Sweden",CH:"Switzerland",TW:"Taiwan",TZ:"Tanzania",TH:"Thailand",TR:"Turkey",UA:"Ukraine",AE:"UAE",GB:"United Kingdom",US:"United States",UY:"Uruguay",VE:"Venezuela",VN:"Vietnam",ZW:"Zimbabwe"};function n(B){return B.toUpperCase().split("").map(w=>String.fromCodePoint(127462+w.charCodeAt(0)-65)).join("")}const m=e.computed(()=>{var w;return((w=l.countries)!=null&&w.length?l.countries.filter(f=>I.getCountries().includes(f)):I.getCountries()).map(f=>({code:f,name:d[f]??f,dialCode:`+${I.getCountryCallingCode(f)}`,flag:n(f)})).sort((f,u)=>f.name.localeCompare(u.name))}),o=e.ref(l.defaultCountry),r=e.ref(""),s=e.ref(!1),i=e.ref(""),h=e.ref(null),C=e.computed(()=>{const B=i.value.toLowerCase();return B?m.value.filter(w=>w.name.toLowerCase().includes(B)||w.code.toLowerCase().includes(B)||w.dialCode.includes(B)):m.value}),E=e.computed(()=>m.value.find(B=>B.code===o.value)??m.value[0]);e.onMounted(()=>{l.modelValue&&y(l.modelValue)}),e.watch(()=>l.modelValue,B=>{B&&y(B)});function y(B){try{const w=I.parsePhoneNumber(B);if(w!=null&&w.country){o.value=w.country,r.value=w.nationalNumber;return}}catch{}r.value=B.replace(/^\+\d+\s*/,"")}function p(){if(!r.value.trim()){a("update:modelValue","");return}const B=new I.AsYouType(o.value);B.input(`+${I.getCountryCallingCode(o.value)}${r.value}`);const w=B.getNumber();a("update:modelValue",(w==null?void 0:w.format("E.164"))??r.value)}function g(B){const w=B.target;r.value=w.value,p()}function b(B){o.value=B,s.value=!1,i.value="",p()}function $(){l.disabled||(s.value=!0,i.value="",e.nextTick(()=>{var B;return(B=h.value)==null?void 0:B.focus()}))}function V(){s.value=!1,i.value=""}return(B,w)=>{var f,u;return e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-stretch rounded-lg border transition-colors",t.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700":"border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"])},[t.showDialCode?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:t.disabled,class:"flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",onMousedown:w[0]||(w[0]=e.withModifiers(k=>s.value?V():$(),["prevent"]))},[e.createElementVNode("span",_e,e.toDisplayString((f=E.value)==null?void 0:f.flag),1),e.createElementVNode("span",Ye,e.toDisplayString((u=E.value)==null?void 0:u.dialCode),1),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["h-3 w-3 text-gray-400 transition-transform",s.value?"rotate-180":""]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[...w[3]||(w[3]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))],40,qe)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"tel",value:r.value,placeholder:t.placeholder||"Phone number",disabled:t.disabled,autocomplete:"tel-national",class:e.normalizeClass(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0",t.showDialCode?"rounded-r-lg":"rounded-lg"]),onInput:g,onBlur:w[1]||(w[1]=k=>a("blur",k))},null,42,We)],2),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-40",onMousedown:V},null,32)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",Je,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:h,"onUpdate:modelValue":w[2]||(w[2]=k=>i.value=k),type:"text",placeholder:"Search country...",class:"w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"},null,512),[[e.vModelText,i.value]])]),e.createElementVNode("div",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,k=>(e.openBlock(),e.createElementBlock("button",{key:k.code,type:"button",class:e.normalizeClass(["flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",k.code===o.value?"bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300":"text-gray-700 dark:text-gray-300"]),onMousedown:e.withModifiers(S=>b(k.code),["prevent"])},[e.createElementVNode("span",tt,e.toDisplayString(k.flag),1),e.createElementVNode("span",at,e.toDisplayString(k.name),1),e.createElementVNode("span",lt,e.toDisplayString(k.dialCode),1)],42,et))),128)),C.value.length===0?(e.openBlock(),e.createElementBlock("p",ot," No countries found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])}}}),rt=["checked","disabled","onChange"],st=["aria-checked","aria-disabled","onClick","onKeydown"],it={key:0,class:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},ct={class:"text-sm text-gray-700"},dt=e.defineComponent({__name:"RadioInput",props:{modelValue:{type:[String,Number,Boolean,null]},options:{},inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();function d(r){return l.modelValue===r}function n(r){return l.disabled||!!r.disabled}function m(r){n(r)||a("update:modelValue",r.value)}function o(r,s){(r.key===" "||r.key==="Enter")&&(r.preventDefault(),m(s))}return(r,s)=>(e.openBlock(),e.createElementBlock("div",{role:"radiogroup",class:e.normalizeClass(t.inline?"flex flex-wrap gap-4":"flex flex-col gap-2")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,i=>(e.openBlock(),e.createElementBlock("label",{key:String(i.value),class:e.normalizeClass(["inline-flex items-center gap-2 select-none",n(i)?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("input",{type:"radio",checked:d(i.value),disabled:n(i),class:"sr-only",onChange:h=>m(i),onBlur:s[0]||(s[0]=h=>a("blur",h))},null,40,rt),e.createElementVNode("div",{role:"radio","aria-checked":d(i.value),"aria-disabled":n(i)||void 0,tabindex:"0",class:e.normalizeClass(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",d(i.value)?"":"border-gray-300"]),style:e.normalizeStyle(d(i.value)?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>m(i),onKeydown:h=>o(h,i)},[d(i.value)?(e.openBlock(),e.createElementBlock("div",it)):e.createCommentVNode("",!0)],46,st),e.createElementVNode("span",ct,e.toDisplayString(i.label),1)],2))),128))],2))}}),mt=["aria-expanded"],ut={class:"flex flex-1 flex-wrap items-center gap-1"},ft=["onClick"],pt={key:1,class:"truncate"},yt={key:2,class:"text-gray-400"},bt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white shadow-lg"},gt={key:0,class:"border-b border-gray-200 p-2"},ht={role:"listbox",class:"max-h-60 overflow-auto py-1"},kt=["aria-selected","onClick","onMouseenter"],xt={key:0,class:"px-3 py-2 text-sm text-gray-400"},Bt=R(e.defineComponent({__name:"SelectInput",props:{modelValue:{type:[String,Number,Boolean,Array,null]},options:{},multiple:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Select..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c,d=L(),n=e.ref(!1),m=e.ref(""),o=e.ref(-1),r=e.ref(null),s=e.ref(null),i=e.computed(()=>l.modelValue===null||l.modelValue===void 0?[]:Array.isArray(l.modelValue)?l.modelValue:[l.modelValue]),h=e.computed(()=>{if(i.value.length===0||l.multiple)return"";const u=l.options.find(k=>k.value===i.value[0]);return(u==null?void 0:u.label)??String(i.value[0])}),C=e.computed(()=>{if(!m.value)return l.options;const u=m.value.toLowerCase();return l.options.filter(k=>k.label.toLowerCase().includes(u))});function E(u){return i.value.includes(u)}function y(){l.disabled||(n.value?g():p())}function p(){n.value=!0,o.value=-1,m.value="",e.nextTick(()=>{var u;return(u=s.value)==null?void 0:u.focus()})}function g(){n.value=!1,m.value=""}function b(u){if(!u.disabled)if(l.multiple){const k=[...i.value],S=k.indexOf(u.value);S>=0?k.splice(S,1):k.push(u.value),a("update:modelValue",k)}else a("update:modelValue",u.value),g()}function $(u){if(l.disabled)return;const k=i.value.filter(S=>S!==u);a("update:modelValue",k.length?k:l.multiple?[]:null)}function V(u){u.stopPropagation(),a("update:modelValue",l.multiple?[]:null)}function B(u){if(!n.value){(u.key==="Enter"||u.key===" "||u.key==="ArrowDown")&&(u.preventDefault(),p());return}switch(u.key){case"ArrowDown":u.preventDefault(),o.value=Math.min(o.value+1,C.value.length-1);break;case"ArrowUp":u.preventDefault(),o.value=Math.max(o.value-1,0);break;case"Enter":if(u.preventDefault(),o.value>=0){const k=C.value[o.value];k&&b(k)}break;case"Escape":u.preventDefault(),g();break}}function w(u){r.value&&!r.value.contains(u.target)&&g()}function f(u){const k=l.options.find(S=>S.value===u);return(k==null?void 0:k.label)??String(u)}return e.onMounted(()=>document.addEventListener("mousedown",w)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",w)),e.watch(n,u=>{u||a("blur",new FocusEvent("blur"))}),(u,k)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:r,class:e.normalizeClass(["relative w-full",e.unref(d).classes.value.input,t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{role:"combobox","aria-expanded":n.value,"aria-haspopup":"listbox",tabindex:"0",class:e.normalizeClass(["flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm","transition-colors duration-200",n.value?"ring-2 ring-blue-500/20":"",t.disabled?"pointer-events-none bg-gray-100":""]),style:e.normalizeStyle(n.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:y,onKeydown:B},[e.createElementVNode("div",ut,[t.multiple?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(i.value,S=>(e.openBlock(),e.createElementBlock("span",{key:String(S),class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(f(S))+" ",1),e.createElementVNode("button",{type:"button",class:"ml-0.5",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove",onClick:e.withModifiers(M=>$(S),["stop"])}," × ",8,ft)]))),128)):h.value?(e.openBlock(),e.createElementBlock("span",pt,e.toDisplayString(h.value),1)):(e.openBlock(),e.createElementBlock("span",yt,e.toDisplayString(t.placeholder),1))]),t.clearable&&i.value.length>0&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200","aria-label":"Clear selection",onClick:V}," × ")):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200",n.value?"rotate-180":""]),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...k[1]||(k[1]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2))],46,mt),n.value?(e.openBlock(),e.createElementBlock("div",bt,[t.searchable?(e.openBlock(),e.createElementBlock("div",gt,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:s,"onUpdate:modelValue":k[0]||(k[0]=S=>m.value=S),type:"text",class:"w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",placeholder:"Search...",onKeydown:B},null,544),[[e.vModelText,m.value]])])):e.createCommentVNode("",!0),e.createElementVNode("ul",ht,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(S,M)=>(e.openBlock(),e.createElementBlock("li",{key:String(S.value),role:"option","aria-selected":E(S.value),class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",E(S.value)?"":"text-gray-900",o.value===M?"bg-gray-100":"",S.disabled?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"]),style:e.normalizeStyle(E(S.value)?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:P=>b(S),onMouseenter:P=>o.value=M},e.toDisplayString(S.label),47,kt))),128)),C.value.length===0?(e.openBlock(),e.createElementBlock("li",xt," No options found ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-816d5094"]]),wt=["value","min","max","step","disabled","aria-valuenow","aria-valuemin","aria-valuemax","aria-disabled"],Ct={class:"mt-1 flex justify-between text-xs text-gray-400"},Vt=e.defineComponent({__name:"SliderInput",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},showTooltip:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();const d=e.ref(!1),n=e.computed(()=>{const o=l.max-l.min;return o===0?0:(l.modelValue-l.min)/o*100});function m(o){const r=o.target;a("update:modelValue",parseFloat(r.value))}return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full py-2",t.disabled?"opacity-50 cursor-not-allowed":""])},[t.showTooltip&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",style:e.normalizeStyle({left:`calc(${n.value}% - 16px)`})},e.toDisplayString(t.modelValue),5)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,"aria-valuenow":t.modelValue,"aria-valuemin":t.min,"aria-valuemax":t.max,"aria-disabled":t.disabled||void 0,class:"h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",style:{accentColor:"var(--fc-color-primary, #3b82f6)"},onInput:m,onMousedown:r[0]||(r[0]=s=>d.value=!0),onMouseup:r[1]||(r[1]=s=>d.value=!1),onTouchstart:r[2]||(r[2]=s=>d.value=!0),onTouchend:r[3]||(r[3]=s=>d.value=!1),onFocus:r[4]||(r[4]=s=>d.value=!0),onBlur:r[5]||(r[5]=s=>{d.value=!1,a("blur",s)})},null,40,wt),e.createElementVNode("div",Ct,[e.createElementVNode("span",null,e.toDisplayString(t.min),1),e.createElementVNode("span",null,e.toDisplayString(t.max),1)])],2))}}),Et={key:0,class:"text-sm text-gray-600"},Nt=["checked","disabled"],$t=["aria-checked","aria-disabled"],St={key:1,class:"text-sm text-gray-600"},Ft=e.defineComponent({__name:"SwitchInput",props:{modelValue:{type:Boolean},activeLabel:{},inactiveLabel:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=c;L();const d=e.computed(()=>["inline-flex items-center gap-2 select-none",l.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]);function n(){l.disabled||a("update:modelValue",!l.modelValue)}function m(o){(o.key===" "||o.key==="Enter")&&(o.preventDefault(),n())}return(o,r)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(d.value)},[t.inactiveLabel?(e.openBlock(),e.createElementBlock("span",Et,e.toDisplayString(t.inactiveLabel),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"checkbox",checked:t.modelValue,disabled:t.disabled,class:"sr-only",onChange:n,onBlur:r[0]||(r[0]=s=>a("blur",s))},null,40,Nt),e.createElementVNode("button",{type:"button",role:"switch","aria-checked":t.modelValue,"aria-disabled":t.disabled||void 0,tabindex:"0",class:e.normalizeClass(["relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"":"bg-gray-300",t.disabled?"pointer-events-none":"focus:outline-none focus:ring-2 focus:ring-blue-500/20"]),style:e.normalizeStyle(t.modelValue?{backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:n,onKeydown:m},[e.createElementVNode("span",{class:e.normalizeClass(["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",t.modelValue?"translate-x-5":"translate-x-0"]),"aria-hidden":"true"},null,2)],46,$t),t.activeLabel?(e.openBlock(),e.createElementBlock("span",St,e.toDisplayString(t.activeLabel),1)):e.createCommentVNode("",!0)],2))}}),Dt=["onClick"],zt=["placeholder","disabled"],Tt={key:0,class:"absolute z-50 mt-1 w-full rounded-md border border-gray-200 bg-white py-1 shadow-lg",role:"listbox"},Lt=["aria-selected","onMousedown","onMouseenter"],Mt=e.defineComponent({__name:"TagsInput",props:{modelValue:{default:()=>[]},maxTags:{},suggestions:{default:()=>[]},placeholder:{default:"Add a tag..."},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","blur"],setup(t,{emit:c}){const l=t,a=e.computed(()=>Array.isArray(l.modelValue)?l.modelValue:[]),d=c,n=L(),m=e.ref(""),o=e.ref(!1),r=e.ref(!1),s=e.ref(-1),i=e.ref(null),h=e.ref(null),C=e.computed(()=>!l.maxTags||a.value.length<l.maxTags),E=e.computed(()=>{if(!m.value||l.suggestions.length===0)return[];const V=m.value.toLowerCase();return l.suggestions.filter(B=>B.toLowerCase().includes(V)&&!a.value.includes(B))});function y(V){const B=V.trim();!B||!C.value||a.value.includes(B)||(d("update:modelValue",[...a.value,B]),m.value="",r.value=!1,s.value=-1)}function p(V){if(l.disabled)return;const B=a.value.filter((w,f)=>f!==V);d("update:modelValue",B)}function g(V){if(V.key==="Enter"||V.key===","){V.preventDefault();const B=s.value>=0?E.value[s.value]:void 0;y(B||m.value);return}if(V.key==="Backspace"&&m.value===""&&a.value.length>0){p(a.value.length-1);return}if(V.key==="ArrowDown"&&r.value){V.preventDefault(),s.value=Math.min(s.value+1,E.value.length-1);return}if(V.key==="ArrowUp"&&r.value){V.preventDefault(),s.value=Math.max(s.value-1,0);return}V.key==="Escape"&&(r.value=!1,s.value=-1)}function b(){r.value=m.value.length>0&&E.value.length>0,s.value=-1}function $(V){i.value&&!i.value.contains(V.target)&&(r.value=!1)}return e.onMounted(()=>document.addEventListener("mousedown",$)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",$)),e.watch(m,()=>{e.nextTick(b)}),(V,B)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:i,class:e.normalizeClass(["relative w-full",t.disabled?"opacity-50 cursor-not-allowed":""])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",o.value?"ring-2 ring-blue-500/20":"border-gray-300",e.unref(n).classes.value.input]),style:e.normalizeStyle(o.value?{borderColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:B[3]||(B[3]=w=>{var f;return(f=h.value)==null?void 0:f.focus()})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(w,f)=>(e.openBlock(),e.createElementBlock("span",{key:w,class:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",style:{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)",color:"var(--fc-color-primary, #3b82f6)"}},[e.createTextVNode(e.toDisplayString(w)+" ",1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"ml-0.5 transition-colors duration-200",style:{color:"var(--fc-color-primary, #3b82f6)"},"aria-label":"Remove tag",onClick:e.withModifiers(u=>p(f),["stop"])}," × ",8,Dt))]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":B[0]||(B[0]=w=>m.value=w),type:"text",placeholder:a.value.length===0?t.placeholder:"",disabled:t.disabled,class:"min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",onKeydown:g,onFocus:B[1]||(B[1]=w=>o.value=!0),onBlur:B[2]||(B[2]=w=>{o.value=!1,d("blur",w)})},null,40,zt),[[e.vModelText,m.value]])],6),r.value&&E.value.length>0?(e.openBlock(),e.createElementBlock("ul",Tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(w,f)=>(e.openBlock(),e.createElementBlock("li",{key:w,role:"option","aria-selected":s.value===f,class:e.normalizeClass(["cursor-pointer px-3 py-2 text-sm transition-colors duration-200",s.value!==f?"text-gray-900 hover:bg-gray-50":""]),style:e.normalizeStyle(s.value===f?{backgroundColor:"color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)",color:"var(--fc-color-primary, #3b82f6)"}:{}),onMousedown:e.withModifiers(u=>y(w),["prevent"]),onMouseenter:u=>s.value=f},e.toDisplayString(w),47,Lt))),128))])):e.createCommentVNode("",!0)],2))}}),It=["value","rows","maxlength","placeholder","disabled","readonly","aria-disabled","aria-readonly"],At=R(e.defineComponent({__name:"TextareaInput",props:{modelValue:{},rows:{default:3},autoResize:{type:Boolean,default:!1},maxLength:{},placeholder:{default:""},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const l=t,a=c,d=L(),n=e.ref(null),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400 resize-y","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input","transition-colors duration-200",l.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",l.autoResize?"resize-none overflow-hidden":"",d.classes.value.input].filter(Boolean).join(" "));function o(){if(!l.autoResize||!n.value)return;const s=n.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}function r(s){const i=s.target;a("update:modelValue",i.value),l.autoResize&&e.nextTick(o)}return e.watch(()=>l.modelValue,()=>{l.autoResize&&e.nextTick(o)}),e.onMounted(()=>{l.autoResize&&o()}),(s,i)=>(e.openBlock(),e.createElementBlock("textarea",{ref_key:"textareaRef",ref:n,value:t.modelValue,rows:t.rows,maxlength:t.maxLength,placeholder:t.placeholder,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:r,onBlur:i[0]||(i[0]=h=>a("blur",h)),onFocus:i[1]||(i[1]=h=>a("focus",h))},null,42,It))}}),[["__scopeId","data-v-67f80d90"]]),jt={key:0,class:"flex items-stretch"},vt={key:0,class:"inline-flex items-center rounded-l-md border border-r-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Rt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Ot={key:1,class:"inline-flex items-center rounded-r-md border border-l-0 border-gray-300 bg-gray-50 px-3 text-sm text-gray-500"},Kt=["type","value","placeholder","maxlength","disabled","readonly","aria-disabled","aria-readonly"],Pt=R(e.defineComponent({__name:"TextInput",props:{modelValue:{},inputType:{default:"text"},placeholder:{default:""},maxLength:{},prefix:{},suffix:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},mask:{}},emits:["update:modelValue","blur","focus"],setup(t,{emit:c}){const l=t,a=c,d=L(),n=e.computed(()=>!!l.prefix||!!l.suffix),m=e.computed(()=>["w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm","placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input","transition-colors duration-200",l.disabled?"opacity-50 cursor-not-allowed bg-gray-100":"",l.prefix?"rounded-l-none":"",l.suffix?"rounded-r-none":"",d.classes.value.input].filter(Boolean).join(" "));function o(r){const s=r.target;a("update:modelValue",s.value)}return(r,s)=>n.value?(e.openBlock(),e.createElementBlock("div",jt,[t.prefix?(e.openBlock(),e.createElementBlock("span",vt,e.toDisplayString(t.prefix),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[0]||(s[0]=i=>a("blur",i)),onFocus:s[1]||(s[1]=i=>a("focus",i))},null,42,Rt),t.suffix?(e.openBlock(),e.createElementBlock("span",Ot,e.toDisplayString(t.suffix),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("input",{key:1,type:t.inputType,value:t.modelValue,placeholder:t.placeholder,maxlength:t.maxLength,disabled:t.disabled,readonly:t.readonly,class:e.normalizeClass(m.value),"aria-disabled":t.disabled||void 0,"aria-readonly":t.readonly||void 0,onInput:o,onBlur:s[2]||(s[2]=i=>a("blur",i)),onFocus:s[3]||(s[3]=i=>a("focus",i))},null,42,Kt))}}),[["__scopeId","data-v-a42b4343"]]),Ut={key:0,class:"mb-1.5 flex items-center gap-1"},Ht=["for"],Gt={key:0,class:"text-red-500 ml-0.5","aria-hidden":"true"},Zt=["aria-label"],qt={key:0,role:"tooltip",class:"absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"},_t=["id"],Yt=["id"],Wt=e.defineComponent({__name:"BaseField",props:{fieldSchema:{},fieldName:{},errors:{default:()=>[]},touched:{type:Boolean,default:!1}},setup(t){const c=t,l=e.inject(K),a=e.inject(_),d=e.ref(!1),n=e.computed(()=>{if(l){const C=l.t(c.fieldName,"label");if(C)return C}return c.fieldSchema.label??c.fieldName}),m=e.computed(()=>{if(l){const C=l.t(c.fieldName,"helpText");if(C)return C}return c.fieldSchema.helpText??""}),o=e.computed(()=>{if(l){const C=l.t(c.fieldName,"tooltip");if(C)return C}return c.fieldSchema.tooltip??""}),r=e.computed(()=>c.touched&&c.errors.length>0),s=e.computed(()=>[(a==null?void 0:a.classes.value.field)??"fc-field",c.fieldSchema.className??"",c.fieldSchema.disabled?"opacity-50 cursor-not-allowed":"",c.fieldSchema.readOnly?"fc-readonly":""]),i=e.computed(()=>`fc-field-${c.fieldName}`),h=e.computed(()=>`fc-error-${c.fieldName}`);return(C,E)=>{var y,p;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([s.value,"relative mb-4"]),style:e.normalizeStyle(t.fieldSchema.style)},[t.fieldSchema.type!=="hidden"?(e.openBlock(),e.createElementBlock("div",Ut,[e.createElementVNode("label",{for:i.value,class:e.normalizeClass([((y=e.unref(a))==null?void 0:y.classes.value.label)??"fc-label","block text-sm font-medium text-gray-700"])},[e.createTextVNode(e.toDisplayString(n.value)+" ",1),t.fieldSchema.required?(e.openBlock(),e.createElementBlock("span",Gt,"*")):e.createCommentVNode("",!0)],10,Ht),o.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"relative inline-flex",onMouseenter:E[0]||(E[0]=g=>d.value=!0),onMouseleave:E[1]||(E[1]=g=>d.value=!1),onFocusin:E[2]||(E[2]=g=>d.value=!0),onFocusout:E[3]||(E[3]=g=>d.value=!1)},[e.createElementVNode("button",{type:"button",class:"inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40","aria-label":`Info: ${o.value}`,tabindex:"0"}," i ",8,Zt),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"motion-safe:transition motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",qt,[e.createTextVNode(e.toDisplayString(o.value)+" ",1),E[4]||(E[4]=e.createElementVNode("div",{class:"absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900"},null,-1))])):e.createCommentVNode("",!0)]),_:1})],32)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{id:i.value},[e.renderSlot(C.$slots,"default")],8,_t),e.createVNode(e.TransitionGroup,{tag:"div","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 -translate-y-1 max-h-0","enter-to-class":"opacity-100 translate-y-0 max-h-8","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0 max-h-8","leave-to-class":"opacity-0 -translate-y-1 max-h-0",class:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value?t.errors:[],(g,b)=>{var $;return e.openBlock(),e.createElementBlock("p",{key:g+b,id:b===0?h.value:void 0,class:e.normalizeClass([(($=e.unref(a))==null?void 0:$.classes.value.error)??"fc-error","mt-1 text-xs text-red-500"]),role:"alert"},e.toDisplayString(g),11,Yt)}),128))]),_:1}),m.value&&!r.value?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass([((p=e.unref(a))==null?void 0:p.classes.value.helpText)??"fc-help-text","mt-1 text-xs text-gray-400"])},e.toDisplayString(m.value),3)):e.createCommentVNode("",!0)],6)}}}),Qt={key:1,class:"rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"},le=e.defineComponent({__name:"FormField",props:{name:{}},setup(t){const c=t,l=e.inject(v);if(!l)throw new Error("FormField must be used inside a FormBuilder (FormContextKey not provided)");const a=l,d=e.inject(H,null),n=e.computed(()=>F.extractFields(a.schema.fields).find(p=>p.name===c.name)),m=e.computed(()=>{var b;const p=n.value;if(!p)return;const g=(b=d==null?void 0:d.value)==null?void 0:b[p.type];return g||Q(p.type)}),o=e.computed(()=>a.values[c.name]),r=e.computed(()=>a.errors[c.name]??[]),s=e.computed(()=>a.touched[c.name]??!1),i=e.computed(()=>{const p=n.value;return p?p.condition?F.evaluateCondition(p.condition,a.values):typeof p.visible=="function"?p.visible({values:{...a.values},getFieldValue:g=>a.values[g]}):p.visible??!0:!1}),h=e.computed(()=>{const p=n.value;return p?typeof p.disabled=="function"?p.disabled({values:{...a.values},getFieldValue:g=>a.values[g]}):p.disabled??!1:!1}),C=e.computed(()=>{const p=n.value;if(!p)return{};const{name:g,label:b,helpText:$,tooltip:V,condition:B,translations:w,meta:f,rules:u,visible:k,className:S,style:M,defaultValue:P,...U}=p;return{...U,modelValue:o.value,disabled:h.value,readonly:p.readOnly??!1,placeholder:p.placeholder??""}});function E(p){a.setFieldValue(c.name,p)}function y(){var p;a.touched[c.name]=!0,((p=a.schema.settings)==null?void 0:p.validateOnBlur)!==!1&&a.validateField(c.name)}return(p,g)=>(e.openBlock(),e.createBlock(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[i.value&&n.value?(e.openBlock(),e.createBlock(Wt,{key:0,"field-schema":n.value,"field-name":t.name,errors:r.value,touched:s.value},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(m.value),e.mergeProps({key:0},C.value,{"aria-invalid":s.value&&r.value.length>0?!0:void 0,"aria-describedby":s.value&&r.value.length>0?`fc-error-${t.name}`:void 0,"onUpdate:modelValue":E,onBlur:y}),null,16,["aria-invalid","aria-describedby"])):(e.openBlock(),e.createElementBlock("div",Qt,' No component registered for field type "'+e.toDisplayString(n.value.type)+'" ',1))]),_:1},8,["field-schema","field-name","errors","touched"])):e.createCommentVNode("",!0)]),_:1}))}}),Jt={key:0,class:"relative flex justify-center"},Xt={class:"bg-white px-3 text-xs text-gray-500"},ea=e.defineComponent({__name:"FormDivider",props:{label:{},className:{}},setup(t){return(c,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","relative my-4"]),role:"separator"},[l[0]||(l[0]=e.createElementVNode("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[e.createElementVNode("div",{class:"w-full border-t border-gray-200"})],-1)),t.label?(e.openBlock(),e.createElementBlock("div",Jt,[e.createElementVNode("span",Xt,e.toDisplayString(t.label),1)])):e.createCommentVNode("",!0)],2))}}),ta=["aria-labelledby"],aa={key:0,class:"border-b border-gray-100 px-4 py-3"},la=["id"],oa={key:1,class:"mt-0.5 text-xs text-gray-500"},na=["id"],ra=e.defineComponent({__name:"FormGroup",props:{title:{},description:{},collapsible:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1},children:{},className:{}},setup(t){const c=t,l=e.ref(c.collapsed);function a(){c.collapsible&&(l.value=!l.value)}const d=e.computed(()=>c.title?`fc-group-${c.title.toLowerCase().replace(/\s+/g,"-")}`:void 0);return(n,m)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass([[t.className??""],"rounded-lg border border-gray-200 bg-white"]),"aria-labelledby":d.value},[t.title||t.description?(e.openBlock(),e.createElementBlock("div",aa,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.collapsible?"button":"div"),{type:t.collapsible?"button":void 0,class:e.normalizeClass(["flex w-full items-center justify-between text-left",t.collapsible?"cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded":""]),"aria-expanded":t.collapsible?!l.value:void 0,"aria-controls":t.collapsible?`fc-group-body-${d.value}`:void 0,onClick:a},{default:e.withCtx(()=>[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("legend",{key:0,id:d.value,class:"text-sm font-semibold text-gray-800"},e.toDisplayString(t.title),9,la)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",oa,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),t.collapsible?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200",l.value?"":"rotate-180"]),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[...m[0]||(m[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z","clip-rule":"evenodd"},null,-1)])],2)):e.createCommentVNode("",!0)]),_:1},8,["type","class","aria-expanded","aria-controls"]))])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out","enter-from-class":"max-h-0 opacity-0 overflow-hidden","enter-to-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-in","leave-from-class":"max-h-[2000px] opacity-100 overflow-hidden","leave-to-class":"max-h-0 opacity-0 overflow-hidden"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:t.collapsible?`fc-group-body-${d.value}`:void 0,class:"p-4"},[e.createVNode(O,{nodes:t.children},null,8,["nodes"])],8,na),[[e.vShow,!l.value]])]),_:1})],10,ta))}}),sa=["innerHTML"],ia=e.defineComponent({__name:"FormHtml",props:{content:{},className:{}},setup(t){const c=t,l=e.computed(()=>F.sanitizeHtml(c.content));return(a,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","fc-html prose prose-sm max-w-none text-gray-700"]),innerHTML:l.value},null,10,sa))}}),ca=e.defineComponent({__name:"FormRow",props:{children:{},gap:{},align:{default:"stretch"},className:{}},setup(t){const c=t,l=e.computed(()=>({start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"})[c.align]??"items-stretch"),a=e.computed(()=>c.gap?typeof c.gap=="number"?`${c.gap}px`:c.gap:"");return(d,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid grid-cols-12",[l.value,t.className??""]]),style:e.normalizeStyle(a.value?{gap:a.value}:{gap:"1rem"}),role:"group"},[e.createVNode(O,{nodes:t.children},null,8,["nodes"])],6))}}),da={"aria-label":"Form steps",class:"flex items-center justify-center"},ma={class:"flex items-center gap-0"},ua=["disabled","aria-current","aria-label","onClick"],fa={key:0,class:"h-4 w-4 motion-safe:transition-transform motion-safe:duration-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},pa={key:1},ya={key:0,class:"text-center"},ba={class:"text-base font-semibold text-gray-800"},ga={key:0,class:"mt-1 text-sm text-gray-500"},ha={class:"flex items-center justify-between border-t border-gray-100 pt-4"},ka=["disabled"],xa={class:"text-xs text-gray-400"},Ba={key:1,class:"w-[72px]"},wa=e.defineComponent({__name:"FormSteps",props:{steps:{},linear:{type:Boolean,default:!1},className:{}},setup(t){const c=t,l=e.inject(v),a=e.ref(0),d=e.ref(new Set),n=e.computed(()=>c.steps),m=e.computed(()=>n.value.length),o=e.computed(()=>a.value===0),r=e.computed(()=>a.value===m.value-1);function s(y){const p=[];function g(b){for(const $ of b)if(F.isFieldNode($))p.push($.name);else if($.type==="row"||$.type==="group")g($.children);else if($.type==="steps")for(const V of $.steps)g(V.children);else if($.type==="tabs")for(const V of $.tabs)g(V.children)}return g(y.children),p}async function i(){if(!l||!c.linear)return!0;const y=n.value[a.value];if(!y)return!0;const p=s(y);let g=!0;for(const b of p){const $=await l.validateField(b);l.touched[b]=!0,$.length>0&&(g=!1)}return g}async function h(){r.value||c.linear&&!await i()||(d.value.add(a.value),a.value++)}function C(){o.value||a.value--}function E(y){c.linear&&y>a.value||(a.value=y)}return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.className??"","space-y-6"])},[e.createElementVNode("nav",da,[e.createElementVNode("ol",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(g,b)=>(e.openBlock(),e.createElementBlock("li",{key:b,class:"flex items-center"},[e.createElementVNode("button",{type:"button",disabled:t.linear&&b>a.value,"aria-current":b===a.value?"step":void 0,"aria-label":`Step ${b+1}: ${g.title}`,class:e.normalizeClass(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",[d.value.has(b)&&b!==a.value?"border-green-500 bg-green-500 text-white":b!==a.value?"border-gray-300 bg-white text-gray-500":"text-white",t.linear&&b>a.value?"cursor-not-allowed":"cursor-pointer hover:shadow-md"]]),style:e.normalizeStyle(b===a.value?{borderColor:"var(--fc-color-primary, #3b82f6)",backgroundColor:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:$=>E(b)},[d.value.has(b)&&b!==a.value?(e.openBlock(),e.createElementBlock("svg",fa,[...p[0]||(p[0]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z","clip-rule":"evenodd"},null,-1)])])):(e.openBlock(),e.createElementBlock("span",pa,e.toDisplayString(b+1),1))],14,ua),b<n.value.length-1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12",d.value.has(b)?"bg-green-500":"bg-gray-200"])},null,2)):e.createCommentVNode("",!0)]))),128))])]),n.value[a.value]?(e.openBlock(),e.createElementBlock("div",ya,[e.createElementVNode("h3",ba,e.toDisplayString(n.value[a.value].title),1),n.value[a.value].description?(e.openBlock(),e.createElementBlock("p",ga,e.toDisplayString(n.value[a.value].description),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-x-2","enter-to-class":"opacity-100 translate-x-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-2"},{default:e.withCtx(()=>[n.value[a.value]?(e.openBlock(),e.createElementBlock("div",{key:a.value},[e.createVNode(O,{nodes:n.value[a.value].children},null,8,["nodes"])])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",disabled:o.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",onClick:C}," Previous ",8,ka),e.createElementVNode("span",xa,e.toDisplayString(a.value+1)+" / "+e.toDisplayString(m.value),1),r.value?(e.openBlock(),e.createElementBlock("div",Ba)):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"},onClick:h}," Next "))])],2))}}),Ca={class:"relative flex border-b border-gray-200",role:"tablist","aria-orientation":"horizontal"},Va=["id","aria-selected","aria-controls","aria-disabled","tabindex","onClick","onKeydown"],Ea={key:0,class:"absolute inset-x-0 -bottom-px h-0.5 motion-safe:transition-all motion-safe:duration-200",style:{backgroundColor:"var(--fc-color-primary, #3b82f6)"}},Na=["id","aria-labelledby"],$a=e.defineComponent({__name:"FormTabs",props:{tabs:{},className:{}},setup(t){const c=t,l=e.ref(0),a=e.computed(()=>c.tabs);function d(o){const r=a.value[o];r!=null&&r.disabled||(l.value=o)}function n(o,r){var C;const s=a.value.length;let i=r;if(o.key==="ArrowRight"||o.key==="ArrowDown")o.preventDefault(),i=(r+1)%s;else if(o.key==="ArrowLeft"||o.key==="ArrowUp")o.preventDefault(),i=(r-1+s)%s;else if(o.key==="Home")o.preventDefault(),i=0;else if(o.key==="End")o.preventDefault(),i=s-1;else return;for(;(C=a.value[i])!=null&&C.disabled&&i!==r;)o.key==="ArrowLeft"||o.key==="ArrowUp"?i=(i-1+s)%s:i=(i+1)%s;d(i);const h=document.getElementById(`fc-tab-${i}`);h==null||h.focus()}const m=e.computed(()=>`fc-tabpanel-${l.value}`);return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.className??"")},[e.createElementVNode("div",Ca,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(s,i)=>(e.openBlock(),e.createElementBlock("button",{key:i,id:`fc-tab-${i}`,type:"button",role:"tab","aria-selected":i===l.value,"aria-controls":m.value,"aria-disabled":s.disabled||void 0,tabindex:i===l.value?0:-1,class:e.normalizeClass(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40",[i!==l.value?s.disabled?"cursor-not-allowed text-gray-300":"text-gray-500 hover:text-gray-700":""]]),style:e.normalizeStyle(i===l.value?{color:"var(--fc-color-primary, #3b82f6)"}:{}),onClick:h=>d(i),onKeydown:h=>n(h,i)},[e.createTextVNode(e.toDisplayString(s.title)+" ",1),i===l.value?(e.openBlock(),e.createElementBlock("span",Ea)):e.createCommentVNode("",!0)],46,Va))),128))]),e.createVNode(e.Transition,{mode:"out-in","enter-active-class":"motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:e.withCtx(()=>[a.value[l.value]?(e.openBlock(),e.createElementBlock("div",{key:l.value,id:m.value,role:"tabpanel","aria-labelledby":`fc-tab-${l.value}`,tabindex:"0",class:"pt-4"},[e.createVNode(O,{nodes:a.value[l.value].children},null,8,["nodes"])],8,Na)):e.createCommentVNode("",!0)]),_:1})],2))}}),O=e.defineComponent({__name:"LayoutRenderer",props:{nodes:{}},setup(t){const c=e.inject(v);function l(d){return c?F.evaluateCondition(d.condition,c.values):!0}function a(d){return d==="full"?{gridColumn:"1 / -1"}:d==="auto"?{gridColumn:"auto"}:typeof d=="number"?{gridColumn:`span ${d} / span ${d}`}:{gridColumn:"span 12 / span 12"}}return(d,n)=>{const m=e.resolveComponent("LayoutRenderer",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.nodes,(o,r)=>{var s;return e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[e.unref(F.isFieldNode)(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(a(o.span))},[e.createVNode(le,{name:o.name},null,8,["name"])],6)):o.type==="field"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(o.className??""),style:e.normalizeStyle(a(o.span))},[e.createVNode(le,{name:o.name},null,8,["name"])],6)):o.type==="row"?(e.openBlock(),e.createBlock(ca,{key:2,children:o.children,gap:o.gap,align:o.align,"class-name":o.className},null,8,["children","gap","align","class-name"])):o.type==="group"?(e.openBlock(),e.createBlock(ra,{key:3,title:o.title,description:o.description,collapsible:o.collapsible,collapsed:o.collapsed,children:o.children,"class-name":o.className},null,8,["title","description","collapsible","collapsed","children","class-name"])):o.type==="steps"?(e.openBlock(),e.createBlock(wa,{key:4,steps:o.steps,linear:o.linear,"class-name":o.className},null,8,["steps","linear","class-name"])):o.type==="tabs"?(e.openBlock(),e.createBlock($a,{key:5,tabs:o.tabs,"class-name":o.className},null,8,["tabs","class-name"])):o.type==="divider"?(e.openBlock(),e.createBlock(ea,{key:6,label:o.label,"class-name":o.className},null,8,["label","class-name"])):o.type==="html"?(e.openBlock(),e.createBlock(ia,{key:7,content:o.content,"class-name":o.className},null,8,["content","class-name"])):o.type==="conditional"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:8},[l(o)?(e.openBlock(),e.createBlock(m,{key:0,nodes:o.children},null,8,["nodes"])):(s=o.elseChildren)!=null&&s.length?(e.openBlock(),e.createBlock(m,{key:1,nodes:o.elseChildren},null,8,["nodes"])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)}),128)}}}),Sa={key:0,class:"mb-6"},Fa={key:0,class:"text-lg font-semibold text-gray-900"},Da={key:1,class:"mt-1 text-sm text-gray-500"},za={class:"mt-6 flex items-center gap-3"},Ta=["disabled"],La={key:0,class:"mr-2 inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent","aria-hidden":"true"},Ma=["disabled"],Ia=e.defineComponent({__name:"FormBuilder",props:{schema:{},layout:{},locale:{},fallbackLocale:{},modelValue:{},theme:{},components:{}},emits:["submit","error","update:modelValue"],setup(t,{expose:c,emit:l}){const a=t,d=l,n=e.inject(W,void 0),m=e.computed(()=>a.theme??(n==null?void 0:n.theme)),o=e.computed(()=>a.locale??(n==null?void 0:n.locale)??"en"),r=e.computed(()=>a.fallbackLocale??(n==null?void 0:n.fallbackLocale)??"en"),s=e.computed(()=>a.components??(n==null?void 0:n.components)??{}),i=[["text",Pt],["number",Ge],["textarea",At],["select",Bt],["checkbox",$e],["checkbox-group",we],["radio",dt],["switch",Ft],["date",De],["file",Re],["slider",Vt],["tags",Mt],["phone",nt]];for(const[f,u]of i)J(f)||G(f,u);e.provide(H,s),ye(m);const h=L();function C(f){return f.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const E=e.computed(()=>{const f=m.value;if(!f)return{};const u={};if(f.colors)for(const[k,S]of Object.entries(f.colors))S&&(u[`--fc-color-${C(k)}`]=S);if(f.borders)for(const[k,S]of Object.entries(f.borders))S&&(u[`--fc-border-${C(k)}`]=S);if(f.spacing)for(const[k,S]of Object.entries(f.spacing))S&&(u[`--fc-${C(k)}`]=S);if(f.typography)for(const[k,S]of Object.entries(f.typography))S&&(u[`--fc-${C(k)}`]=S);return f.cssVars&&Object.assign(u,f.cssVars),u}),y=ae(a.schema,{locale:o.value,fallbackLocale:r.value});if(a.modelValue)for(const[f,u]of Object.entries(a.modelValue))y.setFieldValue(f,u);e.watch(()=>a.modelValue,f=>{if(f)for(const[u,k]of Object.entries(f))y.values[u]!==k&&y.setFieldValue(u,k)},{deep:!0}),e.watch(()=>({...y.values}),f=>{d("update:modelValue",f)},{deep:!0}),e.watch(o,f=>{f&&y.setLocale(f)}),ee();const p=e.computed(()=>{var S,M;const f=a.schema.translations;if(!f)return"";const u=f[o.value];if((S=u==null?void 0:u.messages)!=null&&S.title)return u.messages.title;const k=f[r.value];return((M=k==null?void 0:k.messages)==null?void 0:M.title)??""}),g=e.computed(()=>{var S,M;const f=a.schema.translations;if(!f)return"";const u=f[o.value];if((S=u==null?void 0:u.messages)!=null&&S.description)return u.messages.description;const k=f[r.value];return((M=k==null?void 0:k.messages)==null?void 0:M.description)??""}),b=e.computed(()=>{const f=a.schema.translations;if(!f)return"Submit";const u=f[o.value];if(u!=null&&u.submit)return u.submit;const k=f[r.value];return(k==null?void 0:k.submit)??"Submit"}),$=e.computed(()=>{const f=a.schema.translations;if(!f)return"Reset";const u=f[o.value];if(u!=null&&u.reset)return u.reset;const k=f[r.value];return(k==null?void 0:k.reset)??"Reset"}),V=e.computed(()=>{var f,u;return(u=(f=a.layout)==null?void 0:f.nodes)!=null&&u.length?a.layout.nodes:a.schema.fields});async function B(){try{await y.submit(async f=>{d("submit",f)})}catch(f){d("error",f)}}function w(){y.reset()}return c({form:y}),(f,u)=>(e.openBlock(),e.createElementBlock("form",{class:e.normalizeClass([e.unref(h).classes.value.form,"fc-form-builder"]),style:e.normalizeStyle(E.value),novalidate:"",onSubmit:e.withModifiers(B,["prevent"]),onReset:e.withModifiers(w,["prevent"])},[p.value||g.value?(e.openBlock(),e.createElementBlock("div",Sa,[p.value?(e.openBlock(),e.createElementBlock("h2",Fa,e.toDisplayString(p.value),1)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("p",Da,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createVNode(O,{nodes:V.value},null,8,["nodes"]),e.createElementVNode("div",za,[e.createElementVNode("button",{type:"submit",disabled:e.unref(y).isSubmitting.value,class:e.normalizeClass([e.unref(h).classes.value.button,"fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),style:{"background-color":"var(--fc-color-primary, #3b82f6)"}},[e.unref(y).isSubmitting.value?(e.openBlock(),e.createElementBlock("span",La)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(b.value),1)],10,Ta),e.createElementVNode("button",{type:"reset",disabled:e.unref(y).isSubmitting.value,class:"rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"},e.toDisplayString($.value),9,Ma)])],38))}});T.FormBuilder=Ia,T.FormComponentsKey=H,T.FormContextKey=v,T.FormI18nKey=K,T.FormaticaKey=W,T.createFormatica=ge,T.getFieldComponent=Q,T.getRegisteredFieldTypes=ne,T.hasFieldType=J,T.registerFieldType=G,T.unregisterFieldType=oe,T.useForm=ae,T.useFormI18n=X,T.useFormI18nContext=ee,Object.keys(F).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(T,t)&&Object.defineProperty(T,t,{enumerable:!0,get:()=>F[t]})}),Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=formatica.umd.cjs.map
|