@twintag/twintag-form 0.3.0 → 0.3.1

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.
@@ -193,4 +193,4 @@ Check the render method of \``+O+"`."}return""}}function uu(O){{if(O!==void 0){v
193
193
 
194
194
  Check your code at `+oe+":"+ke+"."}return""}}var bs={};function Vc(O){{var oe=ol();if(!oe){var ke=typeof O=="string"?O:O.displayName||O.name;ke&&(oe=`
195
195
 
196
- Check the top-level render call using <`+ke+">.")}return oe}}function ll(O,oe){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var ke=Vc(oe);if(bs[ke])return;bs[ke]=!0;var nt="";O&&O._owner&&O._owner!==sn.current&&(nt=" It was passed a child from "+fe(O._owner.type)+"."),an(O),J('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ke,nt),an(null)}}function su(O,oe){{if(typeof O!="object")return;if($t(O))for(var ke=0;ke<O.length;ke++){var nt=O[ke];lu(nt)&&ll(nt,oe)}else if(lu(O))O._store&&(O._store.validated=!0);else if(O){var Ct=ve(O);if(typeof Ct=="function"&&Ct!==O.entries)for(var Bt=Ct.call(O),Tt;!(Tt=Bt.next()).done;)lu(Tt.value)&&ll(Tt.value,oe)}}}function ul(O){{var oe=O.type;if(oe==null||typeof oe=="string")return;var ke;if(typeof oe=="function")ke=oe.propTypes;else if(typeof oe=="object"&&(oe.$$typeof===E||oe.$$typeof===D))ke=oe.propTypes;else return;if(ke){var nt=fe(oe);le(ke,O.props,"prop",nt,O)}else if(oe.PropTypes!==void 0&&!cn){cn=!0;var Ct=fe(oe);J("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ct||"Unknown")}typeof oe.getDefaultProps=="function"&&!oe.getDefaultProps.isReactClassApproved&&J("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cu(O){{for(var oe=Object.keys(O.props),ke=0;ke<oe.length;ke++){var nt=oe[ke];if(nt!=="children"&&nt!=="key"){an(O),J("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",nt),an(null);break}}O.ref!==null&&(an(O),J("Invalid attribute `ref` supplied to `React.Fragment`."),an(null))}}function bi(O,oe,ke,nt,Ct,Bt){{var Tt=ut(O);if(!Tt){var at="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(at+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ar=uu(Ct);ar?at+=ar:at+=ol();var mn;O===null?mn="null":$t(O)?mn="array":O!==void 0&&O.$$typeof===u?(mn="<"+(fe(O.type)||"Unknown")+" />",at=" Did you accidentally export a JSX literal instead of a component?"):mn=typeof O,J("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",mn,at)}var yn=ta(O,oe,ke,Ct,Bt);if(yn==null)return yn;if(Tt){var Br=oe.children;if(Br!==void 0)if(nt)if($t(Br)){for(var bo=0;bo<Br.length;bo++)su(Br[bo],O);Object.freeze&&Object.freeze(Br)}else J("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else su(Br,O)}return O===p?cu(yn):ul(yn),yn}}function yo(O,oe,ke){return bi(O,oe,ke,!0)}function ba(O,oe,ke){return bi(O,oe,ke,!1)}var ri=ba,go=yo;Vd.Fragment=p,Vd.jsx=ri,Vd.jsxs=go}()),Vd}process.env.NODE_ENV==="production"?R0.exports=DR():R0.exports=OR();var bt=R0.exports,Jt;(function(i){i.assertEqual=v=>v;function u(v){}i.assertIs=u;function c(v){throw new Error}i.assertNever=c,i.arrayToEnum=v=>{const g={};for(const m of v)g[m]=m;return g},i.getValidEnumValues=v=>{const g=i.objectKeys(v).filter(x=>typeof v[v[x]]!="number"),m={};for(const x of g)m[x]=v[x];return i.objectValues(m)},i.objectValues=v=>i.objectKeys(v).map(function(g){return v[g]}),i.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const g=[];for(const m in v)Object.prototype.hasOwnProperty.call(v,m)&&g.push(m);return g},i.find=(v,g)=>{for(const m of v)if(g(m))return m},i.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function p(v,g=" | "){return v.map(m=>typeof m=="string"?`'${m}'`:m).join(g)}i.joinValues=p,i.jsonStringifyReplacer=(v,g)=>typeof g=="bigint"?g.toString():g})(Jt||(Jt={}));const Ae=Jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tu=i=>{switch(typeof i){case"undefined":return Ae.undefined;case"string":return Ae.string;case"number":return isNaN(i)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"symbol":return Ae.symbol;case"object":return Array.isArray(i)?Ae.array:i===null?Ae.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?Ae.promise:typeof Map<"u"&&i instanceof Map?Ae.map:typeof Set<"u"&&i instanceof Set?Ae.set:typeof Date<"u"&&i instanceof Date?Ae.date:Ae.object;default:return Ae.unknown}},we=Jt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MR=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class tl extends Error{constructor(u){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};const c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=u}get errors(){return this.issues}format(u){const c=u||function(g){return g.message},p={_errors:[]},v=g=>{for(const m of g.issues)if(m.code==="invalid_union")m.unionErrors.map(v);else if(m.code==="invalid_return_type")v(m.returnTypeError);else if(m.code==="invalid_arguments")v(m.argumentsError);else if(m.path.length===0)p._errors.push(c(m));else{let x=p,E=0;for(;E<m.path.length;){const T=m.path[E];E===m.path.length-1?(x[T]=x[T]||{_errors:[]},x[T]._errors.push(c(m))):x[T]=x[T]||{_errors:[]},x=x[T],E++}}};return v(this),p}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(u=c=>c.message){const c={},p=[];for(const v of this.issues)v.path.length>0?(c[v.path[0]]=c[v.path[0]]||[],c[v.path[0]].push(u(v))):p.push(u(v));return{formErrors:p,fieldErrors:c}}get formErrors(){return this.flatten()}}tl.create=i=>new tl(i);const Hd=(i,u)=>{let c;switch(i.code){case we.invalid_type:i.received===Ae.undefined?c="Required":c=`Expected ${i.expected}, received ${i.received}`;break;case we.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(i.expected,Jt.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:c=`Unrecognized key(s) in object: ${Jt.joinValues(i.keys,", ")}`;break;case we.invalid_union:c="Invalid input";break;case we.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${Jt.joinValues(i.options)}`;break;case we.invalid_enum_value:c=`Invalid enum value. Expected ${Jt.joinValues(i.options)}, received '${i.received}'`;break;case we.invalid_arguments:c="Invalid function arguments";break;case we.invalid_return_type:c="Invalid function return type";break;case we.invalid_date:c="Invalid date";break;case we.invalid_string:typeof i.validation=="object"?"startsWith"in i.validation?c=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?c=`Invalid input: must end with "${i.validation.endsWith}"`:Jt.assertNever(i.validation):i.validation!=="regex"?c=`Invalid ${i.validation}`:c="Invalid";break;case we.too_small:i.type==="array"?c=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?c=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?c=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?c=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(i.minimum)}`:c="Invalid input";break;case we.too_big:i.type==="array"?c=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?c=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?c=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?c=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(i.maximum)}`:c="Invalid input";break;case we.custom:c="Invalid input";break;case we.invalid_intersection_types:c="Intersection results could not be merged";break;case we.not_multiple_of:c=`Number must be a multiple of ${i.multipleOf}`;break;case we.not_finite:c="Number must be finite";break;default:c=u.defaultError,Jt.assertNever(i)}return{message:c}};let hw=Hd;function NR(i){hw=i}function Ah(){return hw}const Lh=i=>{const{data:u,path:c,errorMaps:p,issueData:v}=i,g=[...c,...v.path||[]],m={...v,path:g};let x="";const E=p.filter(T=>!!T).slice().reverse();for(const T of E)x=T(m,{data:u,defaultError:x}).message;return{...v,path:g,message:v.message||x}},AR=[];function Ye(i,u){const c=Lh({issueData:u,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Ah(),Hd].filter(p=>!!p)});i.common.issues.push(c)}class ma{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(u,c){const p=[];for(const v of c){if(v.status==="aborted")return wt;v.status==="dirty"&&u.dirty(),p.push(v.value)}return{status:u.value,value:p}}static async mergeObjectAsync(u,c){const p=[];for(const v of c)p.push({key:await v.key,value:await v.value});return ma.mergeObjectSync(u,p)}static mergeObjectSync(u,c){const p={};for(const v of c){const{key:g,value:m}=v;if(g.status==="aborted"||m.status==="aborted")return wt;g.status==="dirty"&&u.dirty(),m.status==="dirty"&&u.dirty(),(typeof m.value<"u"||v.alwaysSet)&&(p[g.value]=m.value)}return{status:u.value,value:p}}}const wt=Object.freeze({status:"aborted"}),mw=i=>({status:"dirty",value:i}),qr=i=>({status:"valid",value:i}),D0=i=>i.status==="aborted",O0=i=>i.status==="dirty",zh=i=>i.status==="valid",Uh=i=>typeof Promise<"u"&&i instanceof Promise;var Ut;(function(i){i.errToObj=u=>typeof u=="string"?{message:u}:u||{},i.toString=u=>typeof u=="string"?u:u==null?void 0:u.message})(Ut||(Ut={}));class vo{constructor(u,c,p,v){this.parent=u,this.data=c,this._path=p,this._key=v}get path(){return this._path.concat(this._key)}}const yw=(i,u)=>{if(zh(u))return{success:!0,data:u.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new tl(i.common.issues)}};function kt(i){if(!i)return{};const{errorMap:u,invalid_type_error:c,required_error:p,description:v}=i;if(u&&(c||p))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:v}:{errorMap:(m,x)=>m.code!=="invalid_type"?{message:x.defaultError}:typeof x.data>"u"?{message:p??x.defaultError}:{message:c??x.defaultError},description:v}}class Ot{constructor(u){this.spa=this.safeParseAsync,this._def=u,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(u){return tu(u.data)}_getOrReturnCtx(u,c){return c||{common:u.parent.common,data:u.data,parsedType:tu(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new ma,ctx:{common:u.parent.common,data:u.data,parsedType:tu(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const c=this._parse(u);if(Uh(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(u){const c=this._parse(u);return Promise.resolve(c)}parse(u,c){const p=this.safeParse(u,c);if(p.success)return p.data;throw p.error}safeParse(u,c){var p;const v={common:{issues:[],async:(p=c==null?void 0:c.async)!==null&&p!==void 0?p:!1,contextualErrorMap:c==null?void 0:c.errorMap},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:tu(u)},g=this._parseSync({data:u,path:v.path,parent:v});return yw(v,g)}async parseAsync(u,c){const p=await this.safeParseAsync(u,c);if(p.success)return p.data;throw p.error}async safeParseAsync(u,c){const p={common:{issues:[],contextualErrorMap:c==null?void 0:c.errorMap,async:!0},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:tu(u)},v=this._parse({data:u,path:p.path,parent:p}),g=await(Uh(v)?v:Promise.resolve(v));return yw(p,g)}refine(u,c){const p=v=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(v):c;return this._refinement((v,g)=>{const m=u(v),x=()=>g.addIssue({code:we.custom,...p(v)});return typeof Promise<"u"&&m instanceof Promise?m.then(E=>E?!0:(x(),!1)):m?!0:(x(),!1)})}refinement(u,c){return this._refinement((p,v)=>u(p)?!0:(v.addIssue(typeof c=="function"?c(p,v):c),!1))}_refinement(u){return new Ui({schema:this,typeName:vt.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}optional(){return al.create(this,this._def)}nullable(){return vs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zi.create(this,this._def)}promise(){return Ac.create(this,this._def)}or(u){return Wd.create([this,u],this._def)}and(u){return Yd.create(this,u,this._def)}transform(u){return new Ui({...kt(this._def),schema:this,typeName:vt.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const c=typeof u=="function"?u:()=>u;return new Kd({...kt(this._def),innerType:this,defaultValue:c,typeName:vt.ZodDefault})}brand(){return new bw({typeName:vt.ZodBranded,type:this,...kt(this._def)})}catch(u){const c=typeof u=="function"?u:()=>u;return new Ih({...kt(this._def),innerType:this,catchValue:c,typeName:vt.ZodCatch})}describe(u){const c=this.constructor;return new c({...this._def,description:u})}pipe(u){return Jd.create(this,u)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const LR=/^c[^\s-]{8,}$/i,zR=/^[a-z][a-z0-9]*$/,UR=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,jR=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,FR=i=>i.precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):i.precision===0?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class nl extends Ot{constructor(){super(...arguments),this._regex=(u,c,p)=>this.refinement(v=>u.test(v),{validation:c,code:we.invalid_string,...Ut.errToObj(p)}),this.nonempty=u=>this.min(1,Ut.errToObj(u)),this.trim=()=>new nl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(u){if(this._def.coerce&&(u.data=String(u.data)),this._getType(u)!==Ae.string){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.string,received:g.parsedType}),wt}const p=new ma;let v;for(const g of this._def.checks)if(g.kind==="min")u.data.length<g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),p.dirty());else if(g.kind==="max")u.data.length>g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),p.dirty());else if(g.kind==="length"){const m=u.data.length>g.value,x=u.data.length<g.value;(m||x)&&(v=this._getOrReturnCtx(u,v),m?Ye(v,{code:we.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):x&&Ye(v,{code:we.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),p.dirty())}else if(g.kind==="email")jR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"email",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="uuid")UR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"uuid",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="cuid")LR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"cuid",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="cuid2")zR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"cuid2",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="url")try{new URL(u.data)}catch{v=this._getOrReturnCtx(u,v),Ye(v,{validation:"url",code:we.invalid_string,message:g.message}),p.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"regex",code:we.invalid_string,message:g.message}),p.dirty())):g.kind==="trim"?u.data=u.data.trim():g.kind==="startsWith"?u.data.startsWith(g.value)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:{startsWith:g.value},message:g.message}),p.dirty()):g.kind==="endsWith"?u.data.endsWith(g.value)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:{endsWith:g.value},message:g.message}),p.dirty()):g.kind==="datetime"?FR(g).test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:"datetime",message:g.message}),p.dirty()):Jt.assertNever(g);return{status:p.value,value:u.data}}_addCheck(u){return new nl({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...Ut.errToObj(u)})}url(u){return this._addCheck({kind:"url",...Ut.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...Ut.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...Ut.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...Ut.errToObj(u)})}datetime(u){var c;return typeof u=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:u}):this._addCheck({kind:"datetime",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,offset:(c=u==null?void 0:u.offset)!==null&&c!==void 0?c:!1,...Ut.errToObj(u==null?void 0:u.message)})}regex(u,c){return this._addCheck({kind:"regex",regex:u,...Ut.errToObj(c)})}startsWith(u,c){return this._addCheck({kind:"startsWith",value:u,...Ut.errToObj(c)})}endsWith(u,c){return this._addCheck({kind:"endsWith",value:u,...Ut.errToObj(c)})}min(u,c){return this._addCheck({kind:"min",value:u,...Ut.errToObj(c)})}max(u,c){return this._addCheck({kind:"max",value:u,...Ut.errToObj(c)})}length(u,c){return this._addCheck({kind:"length",value:u,...Ut.errToObj(c)})}get isDatetime(){return!!this._def.checks.find(u=>u.kind==="datetime")}get isEmail(){return!!this._def.checks.find(u=>u.kind==="email")}get isURL(){return!!this._def.checks.find(u=>u.kind==="url")}get isUUID(){return!!this._def.checks.find(u=>u.kind==="uuid")}get isCUID(){return!!this._def.checks.find(u=>u.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(u=>u.kind==="cuid2")}get minLength(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u}get maxLength(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u}}nl.create=i=>{var u;return new nl({checks:[],typeName:vt.ZodString,coerce:(u=i==null?void 0:i.coerce)!==null&&u!==void 0?u:!1,...kt(i)})};function VR(i,u){const c=(i.toString().split(".")[1]||"").length,p=(u.toString().split(".")[1]||"").length,v=c>p?c:p,g=parseInt(i.toFixed(v).replace(".","")),m=parseInt(u.toFixed(v).replace(".",""));return g%m/Math.pow(10,v)}class nu extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){if(this._def.coerce&&(u.data=Number(u.data)),this._getType(u)!==Ae.number){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.number,received:g.parsedType}),wt}let p;const v=new ma;for(const g of this._def.checks)g.kind==="int"?Jt.isInteger(u.data)||(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.invalid_type,expected:"integer",received:"float",message:g.message}),v.dirty()):g.kind==="min"?(g.inclusive?u.data<g.value:u.data<=g.value)&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),v.dirty()):g.kind==="max"?(g.inclusive?u.data>g.value:u.data>=g.value)&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),v.dirty()):g.kind==="multipleOf"?VR(u.data,g.value)!==0&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.not_multiple_of,multipleOf:g.value,message:g.message}),v.dirty()):g.kind==="finite"?Number.isFinite(u.data)||(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.not_finite,message:g.message}),v.dirty()):Jt.assertNever(g);return{status:v.value,value:u.data}}gte(u,c){return this.setLimit("min",u,!0,Ut.toString(c))}gt(u,c){return this.setLimit("min",u,!1,Ut.toString(c))}lte(u,c){return this.setLimit("max",u,!0,Ut.toString(c))}lt(u,c){return this.setLimit("max",u,!1,Ut.toString(c))}setLimit(u,c,p,v){return new nu({...this._def,checks:[...this._def.checks,{kind:u,value:c,inclusive:p,message:Ut.toString(v)}]})}_addCheck(u){return new nu({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:Ut.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ut.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ut.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ut.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ut.toString(u)})}multipleOf(u,c){return this._addCheck({kind:"multipleOf",value:u,message:Ut.toString(c)})}finite(u){return this._addCheck({kind:"finite",message:Ut.toString(u)})}get minValue(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u}get maxValue(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u}get isInt(){return!!this._def.checks.find(u=>u.kind==="int"||u.kind==="multipleOf"&&Jt.isInteger(u.value))}get isFinite(){let u=null,c=null;for(const p of this._def.checks){if(p.kind==="finite"||p.kind==="int"||p.kind==="multipleOf")return!0;p.kind==="min"?(c===null||p.value>c)&&(c=p.value):p.kind==="max"&&(u===null||p.value<u)&&(u=p.value)}return Number.isFinite(c)&&Number.isFinite(u)}}nu.create=i=>new nu({checks:[],typeName:vt.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...kt(i)});class Pd extends Ot{_parse(u){if(this._def.coerce&&(u.data=BigInt(u.data)),this._getType(u)!==Ae.bigint){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.bigint,received:p.parsedType}),wt}return qr(u.data)}}Pd.create=i=>{var u;return new Pd({typeName:vt.ZodBigInt,coerce:(u=i==null?void 0:i.coerce)!==null&&u!==void 0?u:!1,...kt(i)})};class Bd extends Ot{_parse(u){if(this._def.coerce&&(u.data=!!u.data),this._getType(u)!==Ae.boolean){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.boolean,received:p.parsedType}),wt}return qr(u.data)}}Bd.create=i=>new Bd({typeName:vt.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...kt(i)});class fs extends Ot{_parse(u){if(this._def.coerce&&(u.data=new Date(u.data)),this._getType(u)!==Ae.date){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.date,received:g.parsedType}),wt}if(isNaN(u.data.getTime())){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_date}),wt}const p=new ma;let v;for(const g of this._def.checks)g.kind==="min"?u.data.getTime()<g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),p.dirty()):g.kind==="max"?u.data.getTime()>g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),p.dirty()):Jt.assertNever(g);return{status:p.value,value:new Date(u.data.getTime())}}_addCheck(u){return new fs({...this._def,checks:[...this._def.checks,u]})}min(u,c){return this._addCheck({kind:"min",value:u.getTime(),message:Ut.toString(c)})}max(u,c){return this._addCheck({kind:"max",value:u.getTime(),message:Ut.toString(c)})}get minDate(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u!=null?new Date(u):null}get maxDate(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u!=null?new Date(u):null}}fs.create=i=>new fs({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:vt.ZodDate,...kt(i)});class jh extends Ot{_parse(u){if(this._getType(u)!==Ae.symbol){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.symbol,received:p.parsedType}),wt}return qr(u.data)}}jh.create=i=>new jh({typeName:vt.ZodSymbol,...kt(i)});class Id extends Ot{_parse(u){if(this._getType(u)!==Ae.undefined){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.undefined,received:p.parsedType}),wt}return qr(u.data)}}Id.create=i=>new Id({typeName:vt.ZodUndefined,...kt(i)});class $d extends Ot{_parse(u){if(this._getType(u)!==Ae.null){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.null,received:p.parsedType}),wt}return qr(u.data)}}$d.create=i=>new $d({typeName:vt.ZodNull,...kt(i)});class Oc extends Ot{constructor(){super(...arguments),this._any=!0}_parse(u){return qr(u.data)}}Oc.create=i=>new Oc({typeName:vt.ZodAny,...kt(i)});class ds extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(u){return qr(u.data)}}ds.create=i=>new ds({typeName:vt.ZodUnknown,...kt(i)});class rl extends Ot{_parse(u){const c=this._getOrReturnCtx(u);return Ye(c,{code:we.invalid_type,expected:Ae.never,received:c.parsedType}),wt}}rl.create=i=>new rl({typeName:vt.ZodNever,...kt(i)});class Fh extends Ot{_parse(u){if(this._getType(u)!==Ae.undefined){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.void,received:p.parsedType}),wt}return qr(u.data)}}Fh.create=i=>new Fh({typeName:vt.ZodVoid,...kt(i)});class zi extends Ot{_parse(u){const{ctx:c,status:p}=this._processInputParams(u),v=this._def;if(c.parsedType!==Ae.array)return Ye(c,{code:we.invalid_type,expected:Ae.array,received:c.parsedType}),wt;if(v.exactLength!==null){const m=c.data.length>v.exactLength.value,x=c.data.length<v.exactLength.value;(m||x)&&(Ye(c,{code:m?we.too_big:we.too_small,minimum:x?v.exactLength.value:void 0,maximum:m?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),p.dirty())}if(v.minLength!==null&&c.data.length<v.minLength.value&&(Ye(c,{code:we.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),p.dirty()),v.maxLength!==null&&c.data.length>v.maxLength.value&&(Ye(c,{code:we.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),p.dirty()),c.common.async)return Promise.all([...c.data].map((m,x)=>v.type._parseAsync(new vo(c,m,c.path,x)))).then(m=>ma.mergeArray(p,m));const g=[...c.data].map((m,x)=>v.type._parseSync(new vo(c,m,c.path,x)));return ma.mergeArray(p,g)}get element(){return this._def.type}min(u,c){return new zi({...this._def,minLength:{value:u,message:Ut.toString(c)}})}max(u,c){return new zi({...this._def,maxLength:{value:u,message:Ut.toString(c)}})}length(u,c){return new zi({...this._def,exactLength:{value:u,message:Ut.toString(c)}})}nonempty(u){return this.min(1,u)}}zi.create=(i,u)=>new zi({type:i,minLength:null,maxLength:null,exactLength:null,typeName:vt.ZodArray,...kt(u)});var Vh;(function(i){i.mergeShapes=(u,c)=>({...u,...c})})(Vh||(Vh={}));function Mc(i){if(i instanceof Ln){const u={};for(const c in i.shape){const p=i.shape[c];u[c]=al.create(Mc(p))}return new Ln({...i._def,shape:()=>u})}else return i instanceof zi?zi.create(Mc(i.element)):i instanceof al?al.create(Mc(i.unwrap())):i instanceof vs?vs.create(Mc(i.unwrap())):i instanceof ho?ho.create(i.items.map(u=>Mc(u))):i}class Ln extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const u=this._def.shape(),c=Jt.objectKeys(u);return this._cached={shape:u,keys:c}}_parse(u){if(this._getType(u)!==Ae.object){const T=this._getOrReturnCtx(u);return Ye(T,{code:we.invalid_type,expected:Ae.object,received:T.parsedType}),wt}const{status:p,ctx:v}=this._processInputParams(u),{shape:g,keys:m}=this._getCached(),x=[];if(!(this._def.catchall instanceof rl&&this._def.unknownKeys==="strip"))for(const T in v.data)m.includes(T)||x.push(T);const E=[];for(const T of m){const M=g[T],D=v.data[T];E.push({key:{status:"valid",value:T},value:M._parse(new vo(v,D,v.path,T)),alwaysSet:T in v.data})}if(this._def.catchall instanceof rl){const T=this._def.unknownKeys;if(T==="passthrough")for(const M of x)E.push({key:{status:"valid",value:M},value:{status:"valid",value:v.data[M]}});else if(T==="strict")x.length>0&&(Ye(v,{code:we.unrecognized_keys,keys:x}),p.dirty());else if(T!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const T=this._def.catchall;for(const M of x){const D=v.data[M];E.push({key:{status:"valid",value:M},value:T._parse(new vo(v,D,v.path,M)),alwaysSet:M in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const T=[];for(const M of E){const D=await M.key;T.push({key:D,value:await M.value,alwaysSet:M.alwaysSet})}return T}).then(T=>ma.mergeObjectSync(p,T)):ma.mergeObjectSync(p,E)}get shape(){return this._def.shape()}strict(u){return Ut.errToObj,new Ln({...this._def,unknownKeys:"strict",...u!==void 0?{errorMap:(c,p)=>{var v,g,m,x;const E=(m=(g=(v=this._def).errorMap)===null||g===void 0?void 0:g.call(v,c,p).message)!==null&&m!==void 0?m:p.defaultError;return c.code==="unrecognized_keys"?{message:(x=Ut.errToObj(u).message)!==null&&x!==void 0?x:E}:{message:E}}}:{}})}strip(){return new Ln({...this._def,unknownKeys:"strip"})}passthrough(){return new Ln({...this._def,unknownKeys:"passthrough"})}extend(u){return new Ln({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new Ln({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>Vh.mergeShapes(this._def.shape(),u._def.shape()),typeName:vt.ZodObject})}setKey(u,c){return this.augment({[u]:c})}catchall(u){return new Ln({...this._def,catchall:u})}pick(u){const c={};return Jt.objectKeys(u).forEach(p=>{u[p]&&this.shape[p]&&(c[p]=this.shape[p])}),new Ln({...this._def,shape:()=>c})}omit(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{u[p]||(c[p]=this.shape[p])}),new Ln({...this._def,shape:()=>c})}deepPartial(){return Mc(this)}partial(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{const v=this.shape[p];u&&!u[p]?c[p]=v:c[p]=v.optional()}),new Ln({...this._def,shape:()=>c})}required(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{if(u&&!u[p])c[p]=this.shape[p];else{let g=this.shape[p];for(;g instanceof al;)g=g._def.innerType;c[p]=g}}),new Ln({...this._def,shape:()=>c})}keyof(){return gw(Jt.objectKeys(this.shape))}}Ln.create=(i,u)=>new Ln({shape:()=>i,unknownKeys:"strip",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)}),Ln.strictCreate=(i,u)=>new Ln({shape:()=>i,unknownKeys:"strict",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)}),Ln.lazycreate=(i,u)=>new Ln({shape:i,unknownKeys:"strip",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)});class Wd extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=this._def.options;function v(g){for(const x of g)if(x.result.status==="valid")return x.result;for(const x of g)if(x.result.status==="dirty")return c.common.issues.push(...x.ctx.common.issues),x.result;const m=g.map(x=>new tl(x.ctx.common.issues));return Ye(c,{code:we.invalid_union,unionErrors:m}),wt}if(c.common.async)return Promise.all(p.map(async g=>{const m={...c,common:{...c.common,issues:[]},parent:null};return{result:await g._parseAsync({data:c.data,path:c.path,parent:m}),ctx:m}})).then(v);{let g;const m=[];for(const E of p){const T={...c,common:{...c.common,issues:[]},parent:null},M=E._parseSync({data:c.data,path:c.path,parent:T});if(M.status==="valid")return M;M.status==="dirty"&&!g&&(g={result:M,ctx:T}),T.common.issues.length&&m.push(T.common.issues)}if(g)return c.common.issues.push(...g.ctx.common.issues),g.result;const x=m.map(E=>new tl(E));return Ye(c,{code:we.invalid_union,unionErrors:x}),wt}}get options(){return this._def.options}}Wd.create=(i,u)=>new Wd({options:i,typeName:vt.ZodUnion,...kt(u)});const Hh=i=>i instanceof Gd?Hh(i.schema):i instanceof Ui?Hh(i.innerType()):i instanceof Qd?[i.value]:i instanceof ru?i.options:i instanceof Xd?Object.keys(i.enum):i instanceof Kd?Hh(i._def.innerType):i instanceof Id?[void 0]:i instanceof $d?[null]:null;class Ph extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.object)return Ye(c,{code:we.invalid_type,expected:Ae.object,received:c.parsedType}),wt;const p=this.discriminator,v=c.data[p],g=this.optionsMap.get(v);return g?c.common.async?g._parseAsync({data:c.data,path:c.path,parent:c}):g._parseSync({data:c.data,path:c.path,parent:c}):(Ye(c,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[p]}),wt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,c,p){const v=new Map;for(const g of c){const m=Hh(g.shape[u]);if(!m)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const x of m){if(v.has(x))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(x)}`);v.set(x,g)}}return new Ph({typeName:vt.ZodDiscriminatedUnion,discriminator:u,options:c,optionsMap:v,...kt(p)})}}function M0(i,u){const c=tu(i),p=tu(u);if(i===u)return{valid:!0,data:i};if(c===Ae.object&&p===Ae.object){const v=Jt.objectKeys(u),g=Jt.objectKeys(i).filter(x=>v.indexOf(x)!==-1),m={...i,...u};for(const x of g){const E=M0(i[x],u[x]);if(!E.valid)return{valid:!1};m[x]=E.data}return{valid:!0,data:m}}else if(c===Ae.array&&p===Ae.array){if(i.length!==u.length)return{valid:!1};const v=[];for(let g=0;g<i.length;g++){const m=i[g],x=u[g],E=M0(m,x);if(!E.valid)return{valid:!1};v.push(E.data)}return{valid:!0,data:v}}else return c===Ae.date&&p===Ae.date&&+i==+u?{valid:!0,data:i}:{valid:!1}}class Yd extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u),v=(g,m)=>{if(D0(g)||D0(m))return wt;const x=M0(g.value,m.value);return x.valid?((O0(g)||O0(m))&&c.dirty(),{status:c.value,value:x.data}):(Ye(p,{code:we.invalid_intersection_types}),wt)};return p.common.async?Promise.all([this._def.left._parseAsync({data:p.data,path:p.path,parent:p}),this._def.right._parseAsync({data:p.data,path:p.path,parent:p})]).then(([g,m])=>v(g,m)):v(this._def.left._parseSync({data:p.data,path:p.path,parent:p}),this._def.right._parseSync({data:p.data,path:p.path,parent:p}))}}Yd.create=(i,u,c)=>new Yd({left:i,right:u,typeName:vt.ZodIntersection,...kt(c)});class ho extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.array)return Ye(p,{code:we.invalid_type,expected:Ae.array,received:p.parsedType}),wt;if(p.data.length<this._def.items.length)return Ye(p,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wt;!this._def.rest&&p.data.length>this._def.items.length&&(Ye(p,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());const g=[...p.data].map((m,x)=>{const E=this._def.items[x]||this._def.rest;return E?E._parse(new vo(p,m,p.path,x)):null}).filter(m=>!!m);return p.common.async?Promise.all(g).then(m=>ma.mergeArray(c,m)):ma.mergeArray(c,g)}get items(){return this._def.items}rest(u){return new ho({...this._def,rest:u})}}ho.create=(i,u)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ho({items:i,typeName:vt.ZodTuple,rest:null,...kt(u)})};class Zd extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.object)return Ye(p,{code:we.invalid_type,expected:Ae.object,received:p.parsedType}),wt;const v=[],g=this._def.keyType,m=this._def.valueType;for(const x in p.data)v.push({key:g._parse(new vo(p,x,p.path,x)),value:m._parse(new vo(p,p.data[x],p.path,x))});return p.common.async?ma.mergeObjectAsync(c,v):ma.mergeObjectSync(c,v)}get element(){return this._def.valueType}static create(u,c,p){return c instanceof Ot?new Zd({keyType:u,valueType:c,typeName:vt.ZodRecord,...kt(p)}):new Zd({keyType:nl.create(),valueType:u,typeName:vt.ZodRecord,...kt(c)})}}class Bh extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.map)return Ye(p,{code:we.invalid_type,expected:Ae.map,received:p.parsedType}),wt;const v=this._def.keyType,g=this._def.valueType,m=[...p.data.entries()].map(([x,E],T)=>({key:v._parse(new vo(p,x,p.path,[T,"key"])),value:g._parse(new vo(p,E,p.path,[T,"value"]))}));if(p.common.async){const x=new Map;return Promise.resolve().then(async()=>{for(const E of m){const T=await E.key,M=await E.value;if(T.status==="aborted"||M.status==="aborted")return wt;(T.status==="dirty"||M.status==="dirty")&&c.dirty(),x.set(T.value,M.value)}return{status:c.value,value:x}})}else{const x=new Map;for(const E of m){const T=E.key,M=E.value;if(T.status==="aborted"||M.status==="aborted")return wt;(T.status==="dirty"||M.status==="dirty")&&c.dirty(),x.set(T.value,M.value)}return{status:c.value,value:x}}}}Bh.create=(i,u,c)=>new Bh({valueType:u,keyType:i,typeName:vt.ZodMap,...kt(c)});class ps extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.set)return Ye(p,{code:we.invalid_type,expected:Ae.set,received:p.parsedType}),wt;const v=this._def;v.minSize!==null&&p.data.size<v.minSize.value&&(Ye(p,{code:we.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),c.dirty()),v.maxSize!==null&&p.data.size>v.maxSize.value&&(Ye(p,{code:we.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),c.dirty());const g=this._def.valueType;function m(E){const T=new Set;for(const M of E){if(M.status==="aborted")return wt;M.status==="dirty"&&c.dirty(),T.add(M.value)}return{status:c.value,value:T}}const x=[...p.data.values()].map((E,T)=>g._parse(new vo(p,E,p.path,T)));return p.common.async?Promise.all(x).then(E=>m(E)):m(x)}min(u,c){return new ps({...this._def,minSize:{value:u,message:Ut.toString(c)}})}max(u,c){return new ps({...this._def,maxSize:{value:u,message:Ut.toString(c)}})}size(u,c){return this.min(u,c).max(u,c)}nonempty(u){return this.min(1,u)}}ps.create=(i,u)=>new ps({valueType:i,minSize:null,maxSize:null,typeName:vt.ZodSet,...kt(u)});class Nc extends Ot{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.function)return Ye(c,{code:we.invalid_type,expected:Ae.function,received:c.parsedType}),wt;function p(x,E){return Lh({data:x,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Ah(),Hd].filter(T=>!!T),issueData:{code:we.invalid_arguments,argumentsError:E}})}function v(x,E){return Lh({data:x,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Ah(),Hd].filter(T=>!!T),issueData:{code:we.invalid_return_type,returnTypeError:E}})}const g={errorMap:c.common.contextualErrorMap},m=c.data;return this._def.returns instanceof Ac?qr(async(...x)=>{const E=new tl([]),T=await this._def.args.parseAsync(x,g).catch(j=>{throw E.addIssue(p(x,j)),E}),M=await m(...T);return await this._def.returns._def.type.parseAsync(M,g).catch(j=>{throw E.addIssue(v(M,j)),E})}):qr((...x)=>{const E=this._def.args.safeParse(x,g);if(!E.success)throw new tl([p(x,E.error)]);const T=m(...E.data),M=this._def.returns.safeParse(T,g);if(!M.success)throw new tl([v(T,M.error)]);return M.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new Nc({...this._def,args:ho.create(u).rest(ds.create())})}returns(u){return new Nc({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,c,p){return new Nc({args:u||ho.create([]).rest(ds.create()),returns:c||ds.create(),typeName:vt.ZodFunction,...kt(p)})}}class Gd extends Ot{get schema(){return this._def.getter()}_parse(u){const{ctx:c}=this._processInputParams(u);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}}Gd.create=(i,u)=>new Gd({getter:i,typeName:vt.ZodLazy,...kt(u)});class Qd extends Ot{_parse(u){if(u.data!==this._def.value){const c=this._getOrReturnCtx(u);return Ye(c,{received:c.data,code:we.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:u.data}}get value(){return this._def.value}}Qd.create=(i,u)=>new Qd({value:i,typeName:vt.ZodLiteral,...kt(u)});function gw(i,u){return new ru({values:i,typeName:vt.ZodEnum,...kt(u)})}class ru extends Ot{_parse(u){if(typeof u.data!="string"){const c=this._getOrReturnCtx(u),p=this._def.values;return Ye(c,{expected:Jt.joinValues(p),received:c.parsedType,code:we.invalid_type}),wt}if(this._def.values.indexOf(u.data)===-1){const c=this._getOrReturnCtx(u),p=this._def.values;return Ye(c,{received:c.data,code:we.invalid_enum_value,options:p}),wt}return qr(u.data)}get options(){return this._def.values}get enum(){const u={};for(const c of this._def.values)u[c]=c;return u}get Values(){const u={};for(const c of this._def.values)u[c]=c;return u}get Enum(){const u={};for(const c of this._def.values)u[c]=c;return u}extract(u){return ru.create(u)}exclude(u){return ru.create(this.options.filter(c=>!u.includes(c)))}}ru.create=gw;class Xd extends Ot{_parse(u){const c=Jt.getValidEnumValues(this._def.values),p=this._getOrReturnCtx(u);if(p.parsedType!==Ae.string&&p.parsedType!==Ae.number){const v=Jt.objectValues(c);return Ye(p,{expected:Jt.joinValues(v),received:p.parsedType,code:we.invalid_type}),wt}if(c.indexOf(u.data)===-1){const v=Jt.objectValues(c);return Ye(p,{received:p.data,code:we.invalid_enum_value,options:v}),wt}return qr(u.data)}get enum(){return this._def.values}}Xd.create=(i,u)=>new Xd({values:i,typeName:vt.ZodNativeEnum,...kt(u)});class Ac extends Ot{unwrap(){return this._def.type}_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.promise&&c.common.async===!1)return Ye(c,{code:we.invalid_type,expected:Ae.promise,received:c.parsedType}),wt;const p=c.parsedType===Ae.promise?c.data:Promise.resolve(c.data);return qr(p.then(v=>this._def.type.parseAsync(v,{path:c.path,errorMap:c.common.contextualErrorMap})))}}Ac.create=(i,u)=>new Ac({type:i,typeName:vt.ZodPromise,...kt(u)});class Ui extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:c,ctx:p}=this._processInputParams(u),v=this._def.effect||null;if(v.type==="preprocess"){const m=v.transform(p.data);return p.common.async?Promise.resolve(m).then(x=>this._def.schema._parseAsync({data:x,path:p.path,parent:p})):this._def.schema._parseSync({data:m,path:p.path,parent:p})}const g={addIssue:m=>{Ye(p,m),m.fatal?c.abort():c.dirty()},get path(){return p.path}};if(g.addIssue=g.addIssue.bind(g),v.type==="refinement"){const m=x=>{const E=v.refinement(x,g);if(p.common.async)return Promise.resolve(E);if(E instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(p.common.async===!1){const x=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});return x.status==="aborted"?wt:(x.status==="dirty"&&c.dirty(),m(x.value),{status:c.value,value:x.value})}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(x=>x.status==="aborted"?wt:(x.status==="dirty"&&c.dirty(),m(x.value).then(()=>({status:c.value,value:x.value}))))}if(v.type==="transform")if(p.common.async===!1){const m=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(!zh(m))return m;const x=v.transform(m.value,g);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:x}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(m=>zh(m)?Promise.resolve(v.transform(m.value,g)).then(x=>({status:c.value,value:x})):m);Jt.assertNever(v)}}Ui.create=(i,u,c)=>new Ui({schema:i,typeName:vt.ZodEffects,effect:u,...kt(c)}),Ui.createWithPreprocess=(i,u,c)=>new Ui({schema:u,effect:{type:"preprocess",transform:i},typeName:vt.ZodEffects,...kt(c)});class al extends Ot{_parse(u){return this._getType(u)===Ae.undefined?qr(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}al.create=(i,u)=>new al({innerType:i,typeName:vt.ZodOptional,...kt(u)});class vs extends Ot{_parse(u){return this._getType(u)===Ae.null?qr(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}vs.create=(i,u)=>new vs({innerType:i,typeName:vt.ZodNullable,...kt(u)});class Kd extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u);let p=c.data;return c.parsedType===Ae.undefined&&(p=this._def.defaultValue()),this._def.innerType._parse({data:p,path:c.path,parent:c})}removeDefault(){return this._def.innerType}}Kd.create=(i,u)=>new Kd({innerType:i,typeName:vt.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...kt(u)});class Ih extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=this._def.innerType._parse({data:c.data,path:c.path,parent:{...c,common:{...c.common,issues:[]}}});return Uh(p)?p.then(v=>({status:"valid",value:v.status==="valid"?v.value:this._def.catchValue()})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Ih.create=(i,u)=>new Ih({innerType:i,typeName:vt.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...kt(u)});class $h extends Ot{_parse(u){if(this._getType(u)!==Ae.nan){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.nan,received:p.parsedType}),wt}return{status:"valid",value:u.data}}}$h.create=i=>new $h({typeName:vt.ZodNaN,...kt(i)});const HR=Symbol("zod_brand");class bw extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=c.data;return this._def.type._parse({data:p,path:c.path,parent:c})}unwrap(){return this._def.type}}class Jd extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.common.async)return(async()=>{const g=await this._def.in._parseAsync({data:p.data,path:p.path,parent:p});return g.status==="aborted"?wt:g.status==="dirty"?(c.dirty(),mw(g.value)):this._def.out._parseAsync({data:g.value,path:p.path,parent:p})})();{const v=this._def.in._parseSync({data:p.data,path:p.path,parent:p});return v.status==="aborted"?wt:v.status==="dirty"?(c.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:p.path,parent:p})}}static create(u,c){return new Jd({in:u,out:c,typeName:vt.ZodPipeline})}}const Sw=(i,u={},c)=>i?Oc.create().superRefine((p,v)=>{if(!i(p)){const g=typeof u=="function"?u(p):u,m=typeof g=="string"?{message:g}:g;v.addIssue({code:"custom",...m,fatal:c})}}):Oc.create(),PR={object:Ln.lazycreate};var vt;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline"})(vt||(vt={}));const BR=(i,u={message:`Input not instance of ${i.name}`})=>Sw(c=>c instanceof i,u,!0),xw=nl.create,ww=nu.create,IR=$h.create,$R=Pd.create,Cw=Bd.create,WR=fs.create,YR=jh.create,ZR=Id.create,GR=$d.create,QR=Oc.create,XR=ds.create,KR=rl.create,JR=Fh.create,qR=zi.create,eD=Ln.create,tD=Ln.strictCreate,nD=Wd.create,rD=Ph.create,aD=Yd.create,iD=ho.create,oD=Zd.create,lD=Bh.create,uD=ps.create,sD=Nc.create,cD=Gd.create,fD=Qd.create,dD=ru.create,pD=Xd.create,vD=Ac.create,Ew=Ui.create,hD=al.create,mD=vs.create,yD=Ui.createWithPreprocess,gD=Jd.create;var jt=Object.freeze({__proto__:null,defaultErrorMap:Hd,setErrorMap:NR,getErrorMap:Ah,makeIssue:Lh,EMPTY_PATH:AR,addIssueToContext:Ye,ParseStatus:ma,INVALID:wt,DIRTY:mw,OK:qr,isAborted:D0,isDirty:O0,isValid:zh,isAsync:Uh,get util(){return Jt},ZodParsedType:Ae,getParsedType:tu,ZodType:Ot,ZodString:nl,ZodNumber:nu,ZodBigInt:Pd,ZodBoolean:Bd,ZodDate:fs,ZodSymbol:jh,ZodUndefined:Id,ZodNull:$d,ZodAny:Oc,ZodUnknown:ds,ZodNever:rl,ZodVoid:Fh,ZodArray:zi,get objectUtil(){return Vh},ZodObject:Ln,ZodUnion:Wd,ZodDiscriminatedUnion:Ph,ZodIntersection:Yd,ZodTuple:ho,ZodRecord:Zd,ZodMap:Bh,ZodSet:ps,ZodFunction:Nc,ZodLazy:Gd,ZodLiteral:Qd,ZodEnum:ru,ZodNativeEnum:Xd,ZodPromise:Ac,ZodEffects:Ui,ZodTransformer:Ui,ZodOptional:al,ZodNullable:vs,ZodDefault:Kd,ZodCatch:Ih,ZodNaN:$h,BRAND:HR,ZodBranded:bw,ZodPipeline:Jd,custom:Sw,Schema:Ot,ZodSchema:Ot,late:PR,get ZodFirstPartyTypeKind(){return vt},coerce:{string:i=>nl.create({...i,coerce:!0}),number:i=>nu.create({...i,coerce:!0}),boolean:i=>Bd.create({...i,coerce:!0}),bigint:i=>Pd.create({...i,coerce:!0}),date:i=>fs.create({...i,coerce:!0})},any:QR,array:qR,bigint:$R,boolean:Cw,date:WR,discriminatedUnion:rD,effect:Ew,enum:dD,function:sD,instanceof:BR,intersection:aD,lazy:cD,literal:fD,map:lD,nan:IR,nativeEnum:pD,never:KR,null:GR,nullable:mD,number:ww,object:eD,oboolean:()=>Cw().optional(),onumber:()=>ww().optional(),optional:hD,ostring:()=>xw().optional(),pipeline:gD,preprocess:yD,promise:vD,record:oD,set:uD,strictObject:tD,string:xw,symbol:YR,transformer:Ew,tuple:iD,undefined:ZR,union:nD,unknown:XR,void:JR,NEVER:wt,ZodIssueCode:we,quotelessJson:MR,ZodError:tl});const bD=jt.union([jt.string(),jt.number(),jt.date()]).transform(i=>typeof i=="object"&&typeof i.getMonth=="function"?i.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}):i.toString());jt.string().url(),jt.any();const SD=jt.any();jt.object({children:SD}),jt.object({id:jt.string().optional(),className:jt.string().optional(),ariaLabel:jt.string().optional(),dataAttb:jt.record(jt.string(),jt.string()).optional()});const N0=jt.lazy(()=>jt.object({key:jt.number().optional(),type:jt.any(),theme:jt.string().or(jt.record(jt.string(),jt.string())).optional(),bind:jt.string().optional(),label:jt.string().optional(),items:jt.any().array()}));jt.object({header:jt.array(N0),main:jt.array(N0),footer:jt.array(N0)}),jt.object({banner:jt.string().optional(),bannerColor:jt.string().optional(),colorPrimary:jt.string().optional(),colorAccent:jt.string().optional(),fontTitle:jt.string().optional(),fontText:jt.string().optional()});var qd=i=>i.type==="checkbox",Lc=i=>i instanceof Date,ya=i=>i==null;const Tw=i=>typeof i=="object";var vr=i=>!ya(i)&&!Array.isArray(i)&&Tw(i)&&!Lc(i),kw=i=>vr(i)&&i.target?qd(i.target)?i.target.checked:i.target.value:i,xD=i=>i.substring(0,i.search(/\.\d+(\.|$)/))||i,_w=(i,u)=>i.has(xD(u)),ep=i=>Array.isArray(i)?i.filter(Boolean):[],tr=i=>i===void 0,Le=(i,u,c)=>{if(!u||!vr(i))return c;const p=ep(u.split(/[,[\].]+?/)).reduce((v,g)=>ya(v)?v:v[g],i);return tr(p)||p===i?tr(i[u])?c:i[u]:p};const Wh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ji={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},il={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},wD=B.createContext(null),A0=()=>B.useContext(wD);var Rw=(i,u,c,p=!0)=>{const v={defaultValues:u._defaultValues};for(const g in i)Object.defineProperty(v,g,{get:()=>{const m=g;return u._proxyFormState[m]!==ji.all&&(u._proxyFormState[m]=!p||ji.all),c&&(c[m]=!0),i[m]}});return v},mi=i=>vr(i)&&!Object.keys(i).length,Dw=(i,u,c,p)=>{c(i);const{name:v,...g}=i;return mi(g)||Object.keys(g).length>=Object.keys(u).length||Object.keys(g).find(m=>u[m]===(!p||ji.all))},Yh=i=>Array.isArray(i)?i:[i],Ow=(i,u,c)=>c&&u?i===u:!i||!u||i===u||Yh(i).some(p=>p&&(p.startsWith(u)||u.startsWith(p)));function L0(i){const u=B.useRef(i);u.current=i,B.useEffect(()=>{const c=!i.disabled&&u.current.subject.subscribe({next:u.current.next});return()=>{c&&c.unsubscribe()}},[i.disabled])}function CD(i){const u=A0(),{control:c=u.control,disabled:p,name:v,exact:g}=i||{},[m,x]=B.useState(c._formState),E=B.useRef(!0),T=B.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),M=B.useRef(v);return M.current=v,L0({disabled:p,next:D=>E.current&&Ow(M.current,D.name,g)&&Dw(D,T.current,c._updateFormState)&&x({...c._formState,...D}),subject:c._subjects.state}),B.useEffect(()=>{E.current=!0;const D=c._proxyFormState.isDirty&&c._getDirty();return D!==c._formState.isDirty&&c._subjects.state.next({isDirty:D}),T.current.isValid&&c._updateValid(!0),()=>{E.current=!1}},[c]),Rw(m,c,T.current,!1)}var mo=i=>typeof i=="string",Mw=(i,u,c,p,v)=>mo(i)?(p&&u.watch.add(i),Le(c,i,v)):Array.isArray(i)?i.map(g=>(p&&u.watch.add(g),Le(c,g))):(p&&(u.watchAll=!0),c),ED=i=>{const u=i.constructor&&i.constructor.prototype;return vr(u)&&u.hasOwnProperty("isPrototypeOf")},z0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function au(i){let u;const c=Array.isArray(i);if(i instanceof Date)u=new Date(i);else if(i instanceof Set)u=new Set(i);else if(!(z0&&(i instanceof Blob||i instanceof FileList))&&(c||vr(i)))if(u=c?[]:{},!Array.isArray(i)&&!ED(i))u=i;else for(const p in i)u[p]=au(i[p]);else return i;return u}function TD(i){const u=A0(),{control:c=u.control,name:p,defaultValue:v,disabled:g,exact:m}=i||{},x=B.useRef(p);x.current=p,L0({disabled:g,subject:c._subjects.watch,next:M=>{Ow(x.current,M.name,m)&&T(au(Mw(x.current,c._names,M.values||c._formValues,!1,v)))}});const[E,T]=B.useState(c._getWatch(p,v));return B.useEffect(()=>c._removeUnmounted()),E}function U0(i){const u=A0(),{name:c,control:p=u.control,shouldUnregister:v}=i,g=_w(p._names.array,c),m=TD({control:p,name:c,defaultValue:Le(p._formValues,c,Le(p._defaultValues,c,i.defaultValue)),exact:!0}),x=CD({control:p,name:c}),E=B.useRef(p.register(c,{...i.rules,value:m}));return B.useEffect(()=>{const T=(M,D)=>{const j=Le(p._fields,M);j&&(j._f.mount=D)};return T(c,!0),()=>{const M=p._options.shouldUnregister||v;(g?M&&!p._stateFlags.action:M)?p.unregister(c):T(c,!1)}},[c,p,g,v]),{field:{name:c,value:m,onChange:B.useCallback(T=>E.current.onChange({target:{value:kw(T),name:c},type:Wh.CHANGE}),[c]),onBlur:B.useCallback(()=>E.current.onBlur({target:{value:Le(p._formValues,c),name:c},type:Wh.BLUR}),[c,p]),ref:T=>{const M=Le(p._fields,c);M&&T&&(M._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:D=>T.setCustomValidity(D),reportValidity:()=>T.reportValidity()})}},formState:x,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Le(x.errors,c)},isDirty:{enumerable:!0,get:()=>!!Le(x.dirtyFields,c)},isTouched:{enumerable:!0,get:()=>!!Le(x.touchedFields,c)},error:{enumerable:!0,get:()=>Le(x.errors,c)}})}}var kD=(i,u,c,p,v)=>u?{...c[i],types:{...c[i]&&c[i].types?c[i].types:{},[p]:v||!0}}:{},j0=i=>/^\w*$/.test(i),Nw=i=>ep(i.replace(/["|']|\]/g,"").split(/\.|\[/));function Dn(i,u,c){let p=-1;const v=j0(u)?[u]:Nw(u),g=v.length,m=g-1;for(;++p<g;){const x=v[p];let E=c;if(p!==m){const T=i[x];E=vr(T)||Array.isArray(T)?T:isNaN(+v[p+1])?{}:[]}i[x]=E,i=i[x]}return i}const F0=(i,u,c)=>{for(const p of c||Object.keys(i)){const v=Le(i,p);if(v){const{_f:g,...m}=v;if(g&&u(g.name)){if(g.ref.focus){g.ref.focus();break}else if(g.refs&&g.refs[0].focus){g.refs[0].focus();break}}else vr(m)&&F0(m,u)}}};var Aw=i=>({isOnSubmit:!i||i===ji.onSubmit,isOnBlur:i===ji.onBlur,isOnChange:i===ji.onChange,isOnAll:i===ji.all,isOnTouch:i===ji.onTouched}),Lw=(i,u,c)=>!c&&(u.watchAll||u.watch.has(i)||[...u.watch].some(p=>i.startsWith(p)&&/^\.\w+/.test(i.slice(p.length)))),_D=(i,u,c)=>{const p=ep(Le(i,c));return Dn(p,"root",u[c]),Dn(i,c,p),i},zc=i=>typeof i=="boolean",V0=i=>i.type==="file",Uc=i=>typeof i=="function",Zh=i=>{if(!z0)return!1;const u=i?i.ownerDocument:0;return i instanceof(u&&u.defaultView?u.defaultView.HTMLElement:HTMLElement)},Gh=i=>mo(i)||B.isValidElement(i),H0=i=>i.type==="radio",Qh=i=>i instanceof RegExp;const zw={value:!1,isValid:!1},Uw={value:!0,isValid:!0};var jw=i=>{if(Array.isArray(i)){if(i.length>1){const u=i.filter(c=>c&&c.checked&&!c.disabled).map(c=>c.value);return{value:u,isValid:!!u.length}}return i[0].checked&&!i[0].disabled?i[0].attributes&&!tr(i[0].attributes.value)?tr(i[0].value)||i[0].value===""?Uw:{value:i[0].value,isValid:!0}:Uw:zw}return zw};const Fw={isValid:!1,value:null};var Vw=i=>Array.isArray(i)?i.reduce((u,c)=>c&&c.checked&&!c.disabled?{isValid:!0,value:c.value}:u,Fw):Fw;function Hw(i,u,c="validate"){if(Gh(i)||Array.isArray(i)&&i.every(Gh)||zc(i)&&!i)return{type:c,message:Gh(i)?i:"",ref:u}}var jc=i=>vr(i)&&!Qh(i)?i:{value:i,message:""},Pw=async(i,u,c,p,v)=>{const{ref:g,refs:m,required:x,maxLength:E,minLength:T,min:M,max:D,pattern:j,validate:F,name:K,valueAsNumber:ce,mount:ve,disabled:Qe}=i._f,J=Le(u,K);if(!ve||Qe)return{};const de=m?m[0]:g,Se=$e=>{p&&de.reportValidity&&(de.setCustomValidity(zc($e)?"":$e||""),de.reportValidity())},ze={},yt=H0(g),He=qd(g),Xe=yt||He,lt=(ce||V0(g))&&tr(g.value)&&tr(J)||Zh(g)&&g.value===""||J===""||Array.isArray(J)&&!J.length,ut=kD.bind(null,K,c,ze),pt=($e,fe,he,Ke=il.maxLength,Ze=il.minLength)=>{const Dt=$e?fe:he;ze[K]={type:$e?Ke:Ze,message:Dt,ref:g,...ut($e?Ke:Ze,Dt)}};if(v?!Array.isArray(J)||!J.length:x&&(!Xe&&(lt||ya(J))||zc(J)&&!J||He&&!jw(m).isValid||yt&&!Vw(m).isValid)){const{value:$e,message:fe}=Gh(x)?{value:!!x,message:x}:jc(x);if($e&&(ze[K]={type:il.required,message:fe,ref:de,...ut(il.required,fe)},!c))return Se(fe),ze}if(!lt&&(!ya(M)||!ya(D))){let $e,fe;const he=jc(D),Ke=jc(M);if(!ya(J)&&!isNaN(J)){const Ze=g.valueAsNumber||J&&+J;ya(he.value)||($e=Ze>he.value),ya(Ke.value)||(fe=Ze<Ke.value)}else{const Ze=g.valueAsDate||new Date(J),Dt=ee=>new Date(new Date().toDateString()+" "+ee),ae=g.type=="time",ne=g.type=="week";mo(he.value)&&J&&($e=ae?Dt(J)>Dt(he.value):ne?J>he.value:Ze>new Date(he.value)),mo(Ke.value)&&J&&(fe=ae?Dt(J)<Dt(Ke.value):ne?J<Ke.value:Ze<new Date(Ke.value))}if(($e||fe)&&(pt(!!$e,he.message,Ke.message,il.max,il.min),!c))return Se(ze[K].message),ze}if((E||T)&&!lt&&(mo(J)||v&&Array.isArray(J))){const $e=jc(E),fe=jc(T),he=!ya($e.value)&&J.length>$e.value,Ke=!ya(fe.value)&&J.length<fe.value;if((he||Ke)&&(pt(he,$e.message,fe.message),!c))return Se(ze[K].message),ze}if(j&&!lt&&mo(J)){const{value:$e,message:fe}=jc(j);if(Qh($e)&&!J.match($e)&&(ze[K]={type:il.pattern,message:fe,ref:g,...ut(il.pattern,fe)},!c))return Se(fe),ze}if(F){if(Uc(F)){const $e=await F(J,u),fe=Hw($e,de);if(fe&&(ze[K]={...fe,...ut(il.validate,fe.message)},!c))return Se(fe.message),ze}else if(vr(F)){let $e={};for(const fe in F){if(!mi($e)&&!c)break;const he=Hw(await F[fe](J,u),de,fe);he&&($e={...he,...ut(fe,he.message)},Se(he.message),c&&(ze[K]=$e))}if(!mi($e)&&(ze[K]={ref:de,...$e},!c))return ze}}return Se(!0),ze};function RD(i,u){const c=u.slice(0,-1).length;let p=0;for(;p<c;)i=tr(i)?p++:i[u[p++]];return i}function DD(i){for(const u in i)if(!tr(i[u]))return!1;return!0}function Fr(i,u){const c=Array.isArray(u)?u:j0(u)?[u]:Nw(u),p=c.length===1?i:RD(i,c),v=c.length-1,g=c[v];return p&&delete p[g],v!==0&&(vr(p)&&mi(p)||Array.isArray(p)&&DD(p))&&Fr(i,c.slice(0,-1)),i}function P0(){let i=[];return{get observers(){return i},next:v=>{for(const g of i)g.next(v)},subscribe:v=>(i.push(v),{unsubscribe:()=>{i=i.filter(g=>g!==v)}}),unsubscribe:()=>{i=[]}}}var Xh=i=>ya(i)||!Tw(i);function hs(i,u){if(Xh(i)||Xh(u))return i===u;if(Lc(i)&&Lc(u))return i.getTime()===u.getTime();const c=Object.keys(i),p=Object.keys(u);if(c.length!==p.length)return!1;for(const v of c){const g=i[v];if(!p.includes(v))return!1;if(v!=="ref"){const m=u[v];if(Lc(g)&&Lc(m)||vr(g)&&vr(m)||Array.isArray(g)&&Array.isArray(m)?!hs(g,m):g!==m)return!1}}return!0}var Bw=i=>i.type==="select-multiple",OD=i=>H0(i)||qd(i),B0=i=>Zh(i)&&i.isConnected,Iw=i=>{for(const u in i)if(Uc(i[u]))return!0;return!1};function Kh(i,u={}){const c=Array.isArray(i);if(vr(i)||c)for(const p in i)Array.isArray(i[p])||vr(i[p])&&!Iw(i[p])?(u[p]=Array.isArray(i[p])?[]:{},Kh(i[p],u[p])):ya(i[p])||(u[p]=!0);return u}function $w(i,u,c){const p=Array.isArray(i);if(vr(i)||p)for(const v in i)Array.isArray(i[v])||vr(i[v])&&!Iw(i[v])?tr(u)||Xh(c[v])?c[v]=Array.isArray(i[v])?Kh(i[v],[]):{...Kh(i[v])}:$w(i[v],ya(u)?{}:u[v],c[v]):hs(i[v],u[v])?delete c[v]:c[v]=!0;return c}var I0=(i,u)=>$w(i,u,Kh(u)),Ww=(i,{valueAsNumber:u,valueAsDate:c,setValueAs:p})=>tr(i)?i:u?i===""?NaN:i&&+i:c&&mo(i)?new Date(i):p?p(i):i;function $0(i){const u=i.ref;if(!(i.refs?i.refs.every(c=>c.disabled):u.disabled))return V0(u)?u.files:H0(u)?Vw(i.refs).value:Bw(u)?[...u.selectedOptions].map(({value:c})=>c):qd(u)?jw(i.refs).value:Ww(tr(u.value)?i.ref.value:u.value,i)}var MD=(i,u,c,p)=>{const v={};for(const g of i){const m=Le(u,g);m&&Dn(v,g,m._f)}return{criteriaMode:c,names:[...i],fields:v,shouldUseNativeValidation:p}},tp=i=>tr(i)?i:Qh(i)?i.source:vr(i)?Qh(i.value)?i.value.source:i.value:i,ND=i=>i.mount&&(i.required||i.min||i.max||i.maxLength||i.minLength||i.pattern||i.validate);function Yw(i,u,c){const p=Le(i,c);if(p||j0(c))return{error:p,name:c};const v=c.split(".");for(;v.length;){const g=v.join("."),m=Le(u,g),x=Le(i,g);if(m&&!Array.isArray(m)&&c!==g)return{name:c};if(x&&x.type)return{name:g,error:x};v.pop()}return{name:c}}var AD=(i,u,c,p,v)=>v.isOnAll?!1:!c&&v.isOnTouch?!(u||i):(c?p.isOnBlur:v.isOnBlur)?!i:(c?p.isOnChange:v.isOnChange)?i:!0,LD=(i,u)=>!ep(Le(i,u)).length&&Fr(i,u);const zD={mode:ji.onSubmit,reValidateMode:ji.onChange,shouldFocusError:!0};function UD(i={},u){let c={...zD,...i};const p=i.resetOptions&&i.resetOptions.keepDirtyValues;let v={submitCount:0,isDirty:!1,isLoading:!0,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},g={},m=vr(c.defaultValues)||vr(c.values)?au(c.defaultValues||c.values)||{}:{},x=c.shouldUnregister?{}:au(m),E={action:!1,mount:!1,watch:!1},T={mount:new Set,unMount:new Set,array:new Set,watch:new Set},M,D=0;const j={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},F={watch:P0(),array:P0(),state:P0()},K=Aw(c.mode),ce=Aw(c.reValidateMode),ve=c.criteriaMode===ji.all,Qe=A=>Z=>{clearTimeout(D),D=window.setTimeout(A,Z)},J=async A=>{if(j.isValid||A){const Z=c.resolver?mi((await lt()).errors):await pt(g,!0);Z!==v.isValid&&F.state.next({isValid:Z})}},de=A=>j.isValidating&&F.state.next({isValidating:A}),Se=(A,Z=[],G,be,Re=!0,le=!0)=>{if(be&&G){if(E.action=!0,le&&Array.isArray(Le(g,A))){const Pe=G(Le(g,A),be.argA,be.argB);Re&&Dn(g,A,Pe)}if(le&&Array.isArray(Le(v.errors,A))){const Pe=G(Le(v.errors,A),be.argA,be.argB);Re&&Dn(v.errors,A,Pe),LD(v.errors,A)}if(j.touchedFields&&le&&Array.isArray(Le(v.touchedFields,A))){const Pe=G(Le(v.touchedFields,A),be.argA,be.argB);Re&&Dn(v.touchedFields,A,Pe)}j.dirtyFields&&(v.dirtyFields=I0(m,x)),F.state.next({name:A,isDirty:fe(A,Z),dirtyFields:v.dirtyFields,errors:v.errors,isValid:v.isValid})}else Dn(x,A,Z)},ze=(A,Z)=>{Dn(v.errors,A,Z),F.state.next({errors:v.errors})},yt=(A,Z,G,be)=>{const Re=Le(g,A);if(Re){const le=Le(x,A,tr(G)?Le(m,A):G);tr(le)||be&&be.defaultChecked||Z?Dn(x,A,Z?le:$0(Re._f)):Ze(A,le),E.mount&&J()}},He=(A,Z,G,be,Re)=>{let le=!1,Pe=!1;const $t={name:A};if(!G||be){j.isDirty&&(Pe=v.isDirty,v.isDirty=$t.isDirty=fe(),le=Pe!==$t.isDirty);const zt=hs(Le(m,A),Z);Pe=Le(v.dirtyFields,A),zt?Fr(v.dirtyFields,A):Dn(v.dirtyFields,A,!0),$t.dirtyFields=v.dirtyFields,le=le||j.dirtyFields&&Pe!==!zt}if(G){const zt=Le(v.touchedFields,A);zt||(Dn(v.touchedFields,A,G),$t.touchedFields=v.touchedFields,le=le||j.touchedFields&&zt!==G)}return le&&Re&&F.state.next($t),le?$t:{}},Xe=(A,Z,G,be)=>{const Re=Le(v.errors,A),le=j.isValid&&zc(Z)&&v.isValid!==Z;if(i.delayError&&G?(M=Qe(()=>ze(A,G)),M(i.delayError)):(clearTimeout(D),M=null,G?Dn(v.errors,A,G):Fr(v.errors,A)),(G?!hs(Re,G):Re)||!mi(be)||le){const Pe={...be,...le&&zc(Z)?{isValid:Z}:{},errors:v.errors,name:A};v={...v,...Pe},F.state.next(Pe)}de(!1)},lt=async A=>await c.resolver(x,c.context,MD(A||T.mount,g,c.criteriaMode,c.shouldUseNativeValidation)),ut=async A=>{const{errors:Z}=await lt();if(A)for(const G of A){const be=Le(Z,G);be?Dn(v.errors,G,be):Fr(v.errors,G)}else v.errors=Z;return Z},pt=async(A,Z,G={valid:!0})=>{for(const be in A){const Re=A[be];if(Re){const{_f:le,...Pe}=Re;if(le){const $t=T.array.has(le.name),zt=await Pw(Re,x,ve,c.shouldUseNativeValidation,$t);if(zt[le.name]&&(G.valid=!1,Z))break;!Z&&(Le(zt,le.name)?$t?_D(v.errors,zt,le.name):Dn(v.errors,le.name,zt[le.name]):Fr(v.errors,le.name))}Pe&&await pt(Pe,Z,G)}}return G.valid},$e=()=>{for(const A of T.unMount){const Z=Le(g,A);Z&&(Z._f.refs?Z._f.refs.every(G=>!B0(G)):!B0(Z._f.ref))&&Lt(A)}T.unMount=new Set},fe=(A,Z)=>(A&&Z&&Dn(x,A,Z),!hs(ge(),m)),he=(A,Z,G)=>Mw(A,T,{...E.mount?x:tr(Z)?m:mo(A)?{[A]:Z}:Z},G,Z),Ke=A=>ep(Le(E.mount?x:m,A,i.shouldUnregister?Le(m,A,[]):[])),Ze=(A,Z,G={})=>{const be=Le(g,A);let Re=Z;if(be){const le=be._f;le&&(!le.disabled&&Dn(x,A,Ww(Z,le)),Re=Zh(le.ref)&&ya(Z)?"":Z,Bw(le.ref)?[...le.ref.options].forEach(Pe=>Pe.selected=Re.includes(Pe.value)):le.refs?qd(le.ref)?le.refs.length>1?le.refs.forEach(Pe=>(!Pe.defaultChecked||!Pe.disabled)&&(Pe.checked=Array.isArray(Re)?!!Re.find($t=>$t===Pe.value):Re===Pe.value)):le.refs[0]&&(le.refs[0].checked=!!Re):le.refs.forEach(Pe=>Pe.checked=Pe.value===Re):V0(le.ref)?le.ref.value="":(le.ref.value=Re,le.ref.type||F.watch.next({name:A})))}(G.shouldDirty||G.shouldTouch)&&He(A,Re,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&ee(A)},Dt=(A,Z,G)=>{for(const be in Z){const Re=Z[be],le=`${A}.${be}`,Pe=Le(g,le);(T.array.has(A)||!Xh(Re)||Pe&&!Pe._f)&&!Lc(Re)?Dt(le,Re,G):Ze(le,Re,G)}},ae=(A,Z,G={})=>{const be=Le(g,A),Re=T.array.has(A),le=au(Z);Dn(x,A,le),Re?(F.array.next({name:A,values:x}),(j.isDirty||j.dirtyFields)&&G.shouldDirty&&F.state.next({name:A,dirtyFields:I0(m,x),isDirty:fe(A,le)})):be&&!be._f&&!ya(le)?Dt(A,le,G):Ze(A,le,G),Lw(A,T)&&F.state.next({}),F.watch.next({name:A}),!E.mount&&u()},ne=async A=>{const Z=A.target;let G=Z.name;const be=Le(g,G),Re=()=>Z.type?$0(be._f):kw(A);if(be){let le,Pe;const $t=Re(),zt=A.type===Wh.BLUR||A.type===Wh.FOCUS_OUT,za=!ND(be._f)&&!c.resolver&&!Le(v.errors,G)&&!be._f.deps||AD(zt,Le(v.touchedFields,G),v.isSubmitted,ce,K),hr=Lw(G,T,zt);Dn(x,G,$t),zt?(be._f.onBlur&&be._f.onBlur(A),M&&M(0)):be._f.onChange&&be._f.onChange(A);const Pr=He(G,$t,zt,!1),On=!mi(Pr)||hr;if(!zt&&F.watch.next({name:G,type:A.type}),za)return j.isValid&&J(),On&&F.state.next({name:G,...hr?{}:Pr});if(!zt&&hr&&F.state.next({}),de(!0),c.resolver){const{errors:Dr}=await lt([G]),gi=Yw(v.errors,g,G),ea=Yw(Dr,g,gi.name||G);le=ea.error,G=ea.name,Pe=mi(Dr)}else le=(await Pw(be,x,ve,c.shouldUseNativeValidation))[G],le?Pe=!1:j.isValid&&(Pe=await pt(g,!0));be._f.deps&&ee(be._f.deps),Xe(G,Pe,le,Pr)}},ee=async(A,Z={})=>{let G,be;const Re=Yh(A);if(de(!0),c.resolver){const le=await ut(tr(A)?A:Re);G=mi(le),be=A?!Re.some(Pe=>Le(le,Pe)):G}else A?(be=(await Promise.all(Re.map(async le=>{const Pe=Le(g,le);return await pt(Pe&&Pe._f?{[le]:Pe}:Pe)}))).every(Boolean),!(!be&&!v.isValid)&&J()):be=G=await pt(g);return F.state.next({...!mo(A)||j.isValid&&G!==v.isValid?{}:{name:A},...c.resolver||!A?{isValid:G}:{},errors:v.errors,isValidating:!1}),Z.shouldFocus&&!be&&F0(g,le=>le&&Le(v.errors,le),A?Re:T.mount),be},ge=A=>{const Z={...m,...E.mount?x:{}};return tr(A)?Z:mo(A)?Le(Z,A):A.map(G=>Le(Z,G))},me=(A,Z)=>({invalid:!!Le((Z||v).errors,A),isDirty:!!Le((Z||v).dirtyFields,A),isTouched:!!Le((Z||v).touchedFields,A),error:Le((Z||v).errors,A)}),st=A=>{A&&Yh(A).forEach(Z=>Fr(v.errors,Z)),F.state.next({errors:A?v.errors:{}})},Et=(A,Z,G)=>{const be=(Le(g,A,{_f:{}})._f||{}).ref;Dn(v.errors,A,{...Z,ref:be}),F.state.next({name:A,errors:v.errors,isValid:!1}),G&&G.shouldFocus&&be&&be.focus&&be.focus()},Pt=(A,Z)=>Uc(A)?F.watch.subscribe({next:G=>A(he(void 0,Z),G)}):he(A,Z,!0),Lt=(A,Z={})=>{for(const G of A?Yh(A):T.mount)T.mount.delete(G),T.array.delete(G),Le(g,G)&&(Z.keepValue||(Fr(g,G),Fr(x,G)),!Z.keepError&&Fr(v.errors,G),!Z.keepDirty&&Fr(v.dirtyFields,G),!Z.keepTouched&&Fr(v.touchedFields,G),!c.shouldUnregister&&!Z.keepDefaultValue&&Fr(m,G));F.watch.next({}),F.state.next({...v,...Z.keepDirty?{isDirty:fe()}:{}}),!Z.keepIsValid&&J()},wn=(A,Z={})=>{let G=Le(g,A);const be=zc(Z.disabled);return Dn(g,A,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:A}},name:A,mount:!0,...Z}}),T.mount.add(A),G?be&&Dn(x,A,Z.disabled?void 0:Le(x,A,$0(G._f))):yt(A,!0,Z.value),{...be?{disabled:Z.disabled}:{},...c.shouldUseNativeValidation?{required:!!Z.required,min:tp(Z.min),max:tp(Z.max),minLength:tp(Z.minLength),maxLength:tp(Z.maxLength),pattern:tp(Z.pattern)}:{},name:A,onChange:ne,onBlur:ne,ref:Re=>{if(Re){wn(A,Z),G=Le(g,A);const le=tr(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,Pe=OD(le),$t=G._f.refs||[];if(Pe?$t.find(zt=>zt===le):le===G._f.ref)return;Dn(g,A,{_f:{...G._f,...Pe?{refs:[...$t.filter(B0),le,...Array.isArray(Le(m,A))?[{}]:[]],ref:{type:le.type,name:A}}:{ref:le}}}),yt(A,!1,void 0,le)}else G=Le(g,A,{}),G._f&&(G._f.mount=!1),(c.shouldUnregister||Z.shouldUnregister)&&!(_w(T.array,A)&&E.action)&&T.unMount.add(A)}}},Cn=()=>c.shouldFocusError&&F0(g,A=>A&&Le(v.errors,A),T.mount),zn=(A,Z)=>async G=>{G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let be=au(x);if(F.state.next({isSubmitting:!0}),c.resolver){const{errors:Re,values:le}=await lt();v.errors=Re,be=le}else await pt(g);Fr(v.errors,"root"),mi(v.errors)?(F.state.next({errors:{}}),await A(be,G)):(Z&&await Z({...v.errors},G),Cn()),F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mi(v.errors),submitCount:v.submitCount+1,errors:v.errors})},Vr=(A,Z={})=>{Le(g,A)&&(tr(Z.defaultValue)?ae(A,Le(m,A)):(ae(A,Z.defaultValue),Dn(m,A,Z.defaultValue)),Z.keepTouched||Fr(v.touchedFields,A),Z.keepDirty||(Fr(v.dirtyFields,A),v.isDirty=Z.defaultValue?fe(A,Le(m,A)):fe()),Z.keepError||(Fr(v.errors,A),j.isValid&&J()),F.state.next({...v}))},Zn=(A,Z={})=>{const G=A||m,be=au(G),Re=A&&!mi(A)?be:m;if(Z.keepDefaultValues||(m=G),!Z.keepValues){if(Z.keepDirtyValues||p)for(const le of T.mount)Le(v.dirtyFields,le)?Dn(Re,le,Le(x,le)):ae(le,Le(Re,le));else{if(z0&&tr(A))for(const le of T.mount){const Pe=Le(g,le);if(Pe&&Pe._f){const $t=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(Zh($t)){const zt=$t.closest("form");if(zt){zt.reset();break}}}}g={}}x=i.shouldUnregister?Z.keepDefaultValues?au(m):{}:be,F.array.next({values:Re}),F.watch.next({values:Re})}T={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!E.mount&&u(),E.mount=!j.isValid||!!Z.keepIsValid,E.watch=!!i.shouldUnregister,F.state.next({submitCount:Z.keepSubmitCount?v.submitCount:0,isDirty:Z.keepDirty||Z.keepDirtyValues?v.isDirty:!!(Z.keepDefaultValues&&!hs(A,m)),isSubmitted:Z.keepIsSubmitted?v.isSubmitted:!1,dirtyFields:Z.keepDirty||Z.keepDirtyValues?v.dirtyFields:Z.keepDefaultValues&&A?I0(m,A):{},touchedFields:Z.keepTouched?v.touchedFields:{},errors:Z.keepErrors?v.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Hr=(A,Z)=>Zn(Uc(A)?A(x):A,Z),Hn=(A,Z={})=>{const G=Le(g,A),be=G&&G._f;if(be){const Re=be.refs?be.refs[0]:be.ref;Re.focus&&(Re.focus(),Z.shouldSelect&&Re.select())}},nr=A=>{v={...v,...A}};return Uc(c.defaultValues)&&c.defaultValues().then(A=>{Hr(A,c.resetOptions),F.state.next({isLoading:!1})}),{control:{register:wn,unregister:Lt,getFieldState:me,_executeSchema:lt,_focusError:Cn,_getWatch:he,_getDirty:fe,_updateValid:J,_removeUnmounted:$e,_updateFieldArray:Se,_getFieldArray:Ke,_reset:Zn,_updateFormState:nr,_subjects:F,_proxyFormState:j,get _fields(){return g},get _formValues(){return x},get _stateFlags(){return E},set _stateFlags(A){E=A},get _defaultValues(){return m},get _names(){return T},set _names(A){T=A},get _formState(){return v},set _formState(A){v=A},get _options(){return c},set _options(A){c={...c,...A}}},trigger:ee,register:wn,handleSubmit:zn,watch:Pt,setValue:ae,getValues:ge,reset:Hr,resetField:Vr,clearErrors:st,unregister:Lt,setError:Et,setFocus:Hn,getFieldState:me}}function jD(i={}){const u=B.useRef(),[c,p]=B.useState({isDirty:!1,isValidating:!1,isLoading:!0,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Uc(i.defaultValues)?void 0:i.defaultValues});u.current||(u.current={...UD(i,()=>p(g=>({...g}))),formState:c});const v=u.current.control;return v._options=i,L0({subject:v._subjects.state,next:g=>{Dw(g,v._proxyFormState,v._updateFormState,!0)&&p({...v._formState})}}),B.useEffect(()=>{v._stateFlags.mount||(v._updateValid(),v._stateFlags.mount=!0),v._stateFlags.watch&&(v._stateFlags.watch=!1,v._subjects.state.next({})),v._removeUnmounted()}),B.useEffect(()=>{i.values&&!hs(i.values,v._defaultValues)&&v._reset(i.values,v._options.resetOptions)},[i.values,v]),B.useEffect(()=>{c.submitCount&&v._focusError()},[v,c.submitCount]),u.current.formState=Rw(c,v),u.current}const Zw=({children:i,useForm:u})=>B.Children.map(i,c=>{var p,v,g,m,x;return c?(v=(p=c.props)==null?void 0:p.config)!=null&&v.items?B.createElement(c.type,{config:{...c.props.config,items:c.props.config.items.map(E=>E.type==="input"?{...E,useForm:u}:E)}}):(g=c.props)!=null&&g.children?B.createElement(c.type,{...c.props},bt.jsx(Zw,{useForm:u,children:c.props.children})):((x=(m=c.props)==null?void 0:m.config)==null?void 0:x.type)==="input"?B.createElement(c.type,{config:{...c.props.config,useForm:u}}):c.type===RC?B.createElement(c.type,{...c.props,useForm:u}):B.createElement(c.type,{...c.props}):null}),FD=({children:i,options:u})=>{const c=B.useRef(null),{reset:p,register:v,handleSubmit:g,formState:{isSubmitSuccessful:m},control:x}=jD();B.useEffect(()=>{m&&(u!=null&&u.resetOnSubmit)&&p()},[m]);const E=D=>{var F;const j=new CustomEvent("twintag-form-valid",{detail:D,bubbles:!0,cancelable:!1,composed:!0});(F=c.current)==null||F.dispatchEvent(j)},T=D=>{var F;const j=new CustomEvent("twintag-form-invalid",{detail:D,bubbles:!0,cancelable:!1,composed:!0});(F=c.current)==null||F.dispatchEvent(j)},M=()=>{g(E,T)()};return B.useEffect(()=>(c.current&&c.current.addEventListener("twintag-form-validate",M),()=>{c.current&&c.current.removeEventListener("twintag-form-validate",M)}),[]),bt.jsx("form",{ref:c,className:"relative font-fftext",onSubmit:g(E,T),children:bt.jsx("div",{className:"grid w-auto gap-4",children:bt.jsx(Zw,{useForm:{register:v,control:x},children:i})})})};var Gw=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,yi=i=>!i||typeof i!="object"||Object.keys(i).length===0,VD=(...i)=>[...i].flat().filter(Boolean),Qw=(i,u)=>{let c={};for(let p in i)u!=null&&u.hasOwnProperty(p)?c[p]=typeof i[p]=="object"?Qw(i[p],u[p]):u[p]+" "+i[p]:c[p]=i[p];for(let p in u)c.hasOwnProperty(p)||(c[p]=u[p]);return c},Xw=i=>!i||typeof i!="string"?i:i.replace(/\s+/g," ").trim();function HD(){for(var i=0,u,c,p="";i<arguments.length;)(u=arguments[i++])&&(c=Kw(u))&&(p&&(p+=" "),p+=c);return p}function Kw(i){if(typeof i=="string")return i;for(var u,c="",p=0;p<i.length;p++)i[p]&&(u=Kw(i[p]))&&(c&&(c+=" "),c+=u);return c}var W0="-";function PD(i){var u=ID(i),c=i.conflictingClassGroups,p=i.conflictingClassGroupModifiers,v=p===void 0?{}:p;function g(x){var E=x.split(W0);return E[0]===""&&E.length!==1&&E.shift(),Jw(E,u)||BD(x)}function m(x,E){var T=c[x]||[];return E&&v[x]?[].concat(T,v[x]):T}return{getClassGroupId:g,getConflictingClassGroupIds:m}}function Jw(i,u){var m;if(i.length===0)return u.classGroupId;var c=i[0],p=u.nextPart.get(c),v=p?Jw(i.slice(1),p):void 0;if(v)return v;if(u.validators.length!==0){var g=i.join(W0);return(m=u.validators.find(function(x){var E=x.validator;return E(g)}))==null?void 0:m.classGroupId}}var qw=/^\[(.+)\]$/;function BD(i){if(qw.test(i)){var u=qw.exec(i)[1],c=u==null?void 0:u.substring(0,u.indexOf(":"));if(c)return"arbitrary.."+c}}function ID(i){var u=i.theme,c=i.prefix,p={nextPart:new Map,validators:[]},v=WD(Object.entries(i.classGroups),c);return v.forEach(function(g){var m=g[0],x=g[1];Y0(x,p,m,u)}),p}function Y0(i,u,c,p){i.forEach(function(v){if(typeof v=="string"){var g=v===""?u:eC(u,v);g.classGroupId=c;return}if(typeof v=="function"){if($D(v)){Y0(v(p),u,c,p);return}u.validators.push({validator:v,classGroupId:c});return}Object.entries(v).forEach(function(m){var x=m[0],E=m[1];Y0(E,eC(u,x),c,p)})})}function eC(i,u){var c=i;return u.split(W0).forEach(function(p){c.nextPart.has(p)||c.nextPart.set(p,{nextPart:new Map,validators:[]}),c=c.nextPart.get(p)}),c}function $D(i){return i.isThemeGetter}function WD(i,u){return u?i.map(function(c){var p=c[0],v=c[1],g=v.map(function(m){return typeof m=="string"?u+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(function(x){var E=x[0],T=x[1];return[u+E,T]})):m});return[p,g]}):i}function YD(i){if(i<1)return{get:function(){},set:function(){}};var u=0,c=new Map,p=new Map;function v(g,m){c.set(g,m),u++,u>i&&(u=0,p=c,c=new Map)}return{get:function(m){var x=c.get(m);if(x!==void 0)return x;if((x=p.get(m))!==void 0)return v(m,x),x},set:function(m,x){c.has(m)?c.set(m,x):v(m,x)}}}var tC="!";function ZD(i){var u=i.separator||":",c=u.length===1,p=u[0],v=u.length;return function(m){for(var x=[],E=0,T=0,M,D=0;D<m.length;D++){var j=m[D];if(E===0){if(j===p&&(c||m.slice(D,D+v)===u)){x.push(m.slice(T,D)),T=D+v;continue}if(j==="/"){M=D;continue}}j==="["?E++:j==="]"&&E--}var F=x.length===0?m:m.substring(T),K=F.startsWith(tC),ce=K?F.substring(1):F,ve=M&&M>T?M-T:void 0;return{modifiers:x,hasImportantModifier:K,baseClassName:ce,maybePostfixModifierPosition:ve}}}function GD(i){if(i.length<=1)return i;var u=[],c=[];return i.forEach(function(p){var v=p[0]==="[";v?(u.push.apply(u,c.sort().concat([p])),c=[]):c.push(p)}),u.push.apply(u,c.sort()),u}function QD(i){return{cache:YD(i.cacheSize),splitModifiers:ZD(i),...PD(i)}}var XD=/\s+/;function KD(i,u){var c=u.splitModifiers,p=u.getClassGroupId,v=u.getConflictingClassGroupIds,g=new Set;return i.trim().split(XD).map(function(m){var x=c(m),E=x.modifiers,T=x.hasImportantModifier,M=x.baseClassName,D=x.maybePostfixModifierPosition,j=p(D?M.substring(0,D):M),F=!!D;if(!j){if(!D)return{isTailwindClass:!1,originalClassName:m};if(j=p(M),!j)return{isTailwindClass:!1,originalClassName:m};F=!1}var K=GD(E).join(":"),ce=T?K+tC:K;return{isTailwindClass:!0,modifierId:ce,classGroupId:j,originalClassName:m,hasPostfixModifier:F}}).reverse().filter(function(m){if(!m.isTailwindClass)return!0;var x=m.modifierId,E=m.classGroupId,T=m.hasPostfixModifier,M=x+E;return g.has(M)?!1:(g.add(M),v(E,T).forEach(function(D){return g.add(x+D)}),!0)}).reverse().map(function(m){return m.originalClassName}).join(" ")}function Z0(){for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];var p,v,g,m=x;function x(T){var M=u[0],D=u.slice(1),j=D.reduce(function(F,K){return K(F)},M());return p=QD(j),v=p.cache.get,g=p.cache.set,m=E,E(T)}function E(T){var M=v(T);if(M)return M;var D=KD(T,p);return g(T,D),D}return function(){return m(HD.apply(null,arguments))}}function xn(i){var u=function(p){return p[i]||[]};return u.isThemeGetter=!0,u}var nC=/^\[(?:([a-z-]+):)?(.+)\]$/i,JD=/^\d+\/\d+$/,qD=new Set(["px","full","screen"]),e2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))/,n2=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Fi(i){return ms(i)||qD.has(i)||JD.test(i)||iu(i)}function iu(i){return ys(i,"length",u2)}function r2(i){return ys(i,"size",rC)}function a2(i){return ys(i,"position",rC)}function i2(i){return ys(i,"url",s2)}function Jh(i){return ys(i,"number",ms)}function ms(i){return!Number.isNaN(Number(i))}function o2(i){return i.endsWith("%")&&ms(i.slice(0,-1))}function np(i){return aC(i)||ys(i,"number",aC)}function Yn(i){return nC.test(i)}function rp(){return!0}function ou(i){return e2.test(i)}function l2(i){return ys(i,"",c2)}function ys(i,u,c){var p=nC.exec(i);return p?p[1]?p[1]===u:c(p[2]):!1}function u2(i){return t2.test(i)}function rC(){return!1}function s2(i){return i.startsWith("url(")}function aC(i){return Number.isInteger(Number(i))}function c2(i){return n2.test(i)}function G0(){var i=xn("colors"),u=xn("spacing"),c=xn("blur"),p=xn("brightness"),v=xn("borderColor"),g=xn("borderRadius"),m=xn("borderSpacing"),x=xn("borderWidth"),E=xn("contrast"),T=xn("grayscale"),M=xn("hueRotate"),D=xn("invert"),j=xn("gap"),F=xn("gradientColorStops"),K=xn("gradientColorStopPositions"),ce=xn("inset"),ve=xn("margin"),Qe=xn("opacity"),J=xn("padding"),de=xn("saturate"),Se=xn("scale"),ze=xn("sepia"),yt=xn("skew"),He=xn("space"),Xe=xn("translate"),lt=function(){return["auto","contain","none"]},ut=function(){return["auto","hidden","clip","visible","scroll"]},pt=function(){return["auto",u]},$e=function(){return["",Fi]},fe=function(){return["auto",ms,Yn]},he=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},Ke=function(){return["solid","dashed","dotted","double","none"]},Ze=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Dt=function(){return["start","end","center","between","around","evenly","stretch"]},ae=function(){return["","0",Yn]},ne=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},ee=function(){return[ms,Jh]},ge=function(){return[ms,Yn]};return{cacheSize:500,theme:{colors:[rp],spacing:[Fi],blur:["none","",ou,iu],brightness:ee(),borderColor:[i],borderRadius:["none","","full",ou,iu],borderSpacing:[u],borderWidth:$e(),contrast:ee(),grayscale:ae(),hueRotate:ge(),invert:ae(),gap:[u],gradientColorStops:[i],gradientColorStopPositions:[o2,iu],inset:pt(),margin:pt(),opacity:ee(),padding:[u],saturate:ee(),scale:ee(),sepia:ae(),skew:ge(),space:[u],translate:[u]},classGroups:{aspect:[{aspect:["auto","square","video",Yn]}],container:["container"],columns:[{columns:[ou]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(he(),[Yn])}],overflow:[{overflow:ut()}],"overflow-x":[{"overflow-x":ut()}],"overflow-y":[{"overflow-y":ut()}],overscroll:[{overscroll:lt()}],"overscroll-x":[{"overscroll-x":lt()}],"overscroll-y":[{"overscroll-y":lt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[ce]}],"inset-x":[{"inset-x":[ce]}],"inset-y":[{"inset-y":[ce]}],start:[{start:[ce]}],end:[{end:[ce]}],top:[{top:[ce]}],right:[{right:[ce]}],bottom:[{bottom:[ce]}],left:[{left:[ce]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",np]}],basis:[{basis:[u]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Yn]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",np]}],"grid-cols":[{"grid-cols":[rp]}],"col-start-end":[{col:["auto",{span:[np]},Yn]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[rp]}],"row-start-end":[{row:["auto",{span:[np]},Yn]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Yn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Yn]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal"].concat(Dt())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(Dt(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Dt(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[J]}],px:[{px:[J]}],py:[{py:[J]}],ps:[{ps:[J]}],pe:[{pe:[J]}],pt:[{pt:[J]}],pr:[{pr:[J]}],pb:[{pb:[J]}],pl:[{pl:[J]}],m:[{m:[ve]}],mx:[{mx:[ve]}],my:[{my:[ve]}],ms:[{ms:[ve]}],me:[{me:[ve]}],mt:[{mt:[ve]}],mr:[{mr:[ve]}],mb:[{mb:[ve]}],ml:[{ml:[ve]}],"space-x":[{"space-x":[He]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[He]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",u]}],"min-w":[{"min-w":["min","max","fit",Fi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ou]},ou,iu]}],h:[{h:[u,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Fi]}],"max-h":[{"max-h":[u,"min","max","fit"]}],"font-size":[{text:["base",ou,iu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jh]}],"font-family":[{font:[rp]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",iu]}],"line-clamp":[{"line-clamp":["none",ms,Jh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fi]}],"list-image":[{"list-image":["none",Yn]}],"list-style-type":[{list:["none","disc","decimal",Yn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[Qe]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(Ke(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",Fi]}],"underline-offset":[{"underline-offset":["auto",Fi]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[u]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",iu]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Yn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Qe]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(he(),[a2])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},i2]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[K]}],"gradient-via-pos":[{via:[K]}],"gradient-to-pos":[{to:[K]}],"gradient-from":[{from:[F]}],"gradient-via":[{via:[F]}],"gradient-to":[{to:[F]}],rounded:[{rounded:[g]}],"rounded-s":[{"rounded-s":[g]}],"rounded-e":[{"rounded-e":[g]}],"rounded-t":[{"rounded-t":[g]}],"rounded-r":[{"rounded-r":[g]}],"rounded-b":[{"rounded-b":[g]}],"rounded-l":[{"rounded-l":[g]}],"rounded-ss":[{"rounded-ss":[g]}],"rounded-se":[{"rounded-se":[g]}],"rounded-ee":[{"rounded-ee":[g]}],"rounded-es":[{"rounded-es":[g]}],"rounded-tl":[{"rounded-tl":[g]}],"rounded-tr":[{"rounded-tr":[g]}],"rounded-br":[{"rounded-br":[g]}],"rounded-bl":[{"rounded-bl":[g]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[Qe]}],"border-style":[{border:[].concat(Ke(),["hidden"])}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Qe]}],"divide-style":[{divide:Ke()}],"border-color":[{border:[v]}],"border-color-x":[{"border-x":[v]}],"border-color-y":[{"border-y":[v]}],"border-color-t":[{"border-t":[v]}],"border-color-r":[{"border-r":[v]}],"border-color-b":[{"border-b":[v]}],"border-color-l":[{"border-l":[v]}],"divide-color":[{divide:[v]}],"outline-style":[{outline:[""].concat(Ke())}],"outline-offset":[{"outline-offset":[Fi]}],"outline-w":[{outline:[Fi]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:$e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[Qe]}],"ring-offset-w":[{"ring-offset":[Fi]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ou,l2]}],"shadow-color":[{shadow:[rp]}],opacity:[{opacity:[Qe]}],"mix-blend":[{"mix-blend":Ze()}],"bg-blend":[{"bg-blend":Ze()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[p]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",ou,Yn]}],grayscale:[{grayscale:[T]}],"hue-rotate":[{"hue-rotate":[M]}],invert:[{invert:[D]}],saturate:[{saturate:[de]}],sepia:[{sepia:[ze]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[p]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[T]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[M]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[Qe]}],"backdrop-saturate":[{"backdrop-saturate":[de]}],"backdrop-sepia":[{"backdrop-sepia":[ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Yn]}],duration:[{duration:ge()}],ease:[{ease:["linear","in","out","in-out",Yn]}],delay:[{delay:ge()}],animate:[{animate:["none","spin","ping","pulse","bounce",Yn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Se]}],"scale-x":[{"scale-x":[Se]}],"scale-y":[{"scale-y":[Se]}],rotate:[{rotate:[np,Yn]}],"translate-x":[{"translate-x":[Xe]}],"translate-y":[{"translate-y":[Xe]}],"skew-x":[{"skew-x":[yt]}],"skew-y":[{"skew-y":[yt]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Yn]}],accent:[{accent:["auto",i]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Yn]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[u]}],"scroll-mx":[{"scroll-mx":[u]}],"scroll-my":[{"scroll-my":[u]}],"scroll-ms":[{"scroll-ms":[u]}],"scroll-me":[{"scroll-me":[u]}],"scroll-mt":[{"scroll-mt":[u]}],"scroll-mr":[{"scroll-mr":[u]}],"scroll-mb":[{"scroll-mb":[u]}],"scroll-ml":[{"scroll-ml":[u]}],"scroll-p":[{"scroll-p":[u]}],"scroll-px":[{"scroll-px":[u]}],"scroll-py":[{"scroll-py":[u]}],"scroll-ps":[{"scroll-ps":[u]}],"scroll-pe":[{"scroll-pe":[u]}],"scroll-pt":[{"scroll-pt":[u]}],"scroll-pr":[{"scroll-pr":[u]}],"scroll-pb":[{"scroll-pb":[u]}],"scroll-pl":[{"scroll-pl":[u]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Yn]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[Fi,Jh]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var f2=Z0(G0);function d2(i,u){for(var c in u)iC(i,c,u[c]);return i}var p2=Object.prototype.hasOwnProperty,v2=new Set(["string","number","boolean"]);function iC(i,u,c){if(!p2.call(i,u)||v2.has(typeof c)||c===null){i[u]=c;return}if(Array.isArray(c)&&Array.isArray(i[u])){i[u]=i[u].concat(c);return}if(typeof c=="object"&&typeof i[u]=="object"){if(i[u]===null){i[u]=c;return}for(var p in c)iC(i[u],p,c[p])}}function h2(i){for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return typeof i=="function"?Z0.apply(void 0,[G0,i].concat(c)):Z0.apply(void 0,[function(){return d2(G0(),i)}].concat(c))}var oC={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},lC=i=>i||void 0,qh=(...i)=>lC(i.flat(1/0).filter(Boolean).join(" ")),ap=(...i)=>(u=oC)=>{if(!u.twMerge)return qh(i);let c=yi(u.twMergeConfig)?f2:h2(u.twMergeConfig);return lC(c(qh(i)))},uC=(i,u)=>{let c={...i};for(let p in u)c.hasOwnProperty(p)?c[p]=qh(c[p],u[p]):c[p]=u[p];return c},Fc=(i,u=oC)=>{var c,p,v,g,m;let{slots:x={},variants:E={},compoundVariants:T=[],compoundSlots:M=[],defaultVariants:D={}}=i,j=qh((c=i==null?void 0:i.extend)==null?void 0:c.base,i==null?void 0:i.base),F=Qw(E,(p=i==null?void 0:i.extend)==null?void 0:p.variants),K=Object.assign({},(v=i==null?void 0:i.extend)==null?void 0:v.defaultVariants,D),ce=yi(x)?{}:{base:i==null?void 0:i.base,...x},ve=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,Qe=yi((g=i==null?void 0:i.extend)==null?void 0:g.slots)?ce:uC((m=i==null?void 0:i.extend)==null?void 0:m.slots,yi(ce)?{base:i==null?void 0:i.base}:ce),J=Se=>{var ze,yt,He,Xe;if(yi(F)&&yi(x)&&yi((ze=i==null?void 0:i.extend)==null?void 0:ze.slots))return ap(j,Se==null?void 0:Se.class,Se==null?void 0:Se.className)(u);if(T&&!Array.isArray(T))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof T}`);if(M&&!Array.isArray(M))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof M}`);let lt=(ne,ee,ge=[],me)=>{let st=ge;if(typeof ee=="string")st.push(Xw(ee).split(" ").map(Et=>`${ne}:${Et}`));else if(Array.isArray(ee))st.push(ee.flatMap(Et=>`${ne}:${Et}`));else if(typeof ee=="object"&&typeof me=="string"){let Et=ee==null?void 0:ee[me];if(Et&&typeof Et=="string"){let Pt=Xw(Et);st[me]=st[me]?[...st[me],...Pt.split(" ").map(Lt=>`${ne}:${Lt}`)]:Pt.split(" ").map(Lt=>`${ne}:${Lt}`)}else Array.isArray(Et)&&Et.length>0&&(st[me]=Et.flatMap(Pt=>`${ne}:${Pt}`))}return st},ut=(ne,ee=F,ge=null)=>{let me=ee==null?void 0:ee[ne];if(typeof me!="object"||yi(me))return null;let st=Se==null?void 0:Se[ne],Et=K==null?void 0:K[ne],Pt=[];if(st===null)return null;let Lt=Gw(st);typeof Lt=="object"&&ve&&(Pt=Object.keys(Lt).reduce((Cn,zn)=>{let Vr=Lt[zn],Zn=me==null?void 0:me[Vr];return zn==="initial"?(Et=Vr,Cn):Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(zn)?Cn:lt(zn,Zn,Cn,ge)},[]));let wn=me[Lt]||me[Gw(Et)];return typeof Pt=="object"&&typeof ge=="string"&&Pt[ge]?uC(Pt,wn):Pt.length>0?[wn,...Pt]:wn},pt=()=>F?Object.keys(F).map(ne=>ut(ne,F)):null,$e=ne=>!F||typeof F!="object"?null:Object.keys(F).map(ee=>{let ge=ut(ee,F,ne);return ne==="base"&&typeof ge=="string"?ge:ge&&ge[ne]}).filter(Boolean),fe=Se&&Object.fromEntries(Object.entries(Se).filter(([,ne])=>ne!==void 0)),he=ne=>{var ee;let ge=typeof(Se==null?void 0:Se[ne])=="object"?{[ne]:(ee=Se[ne])==null?void 0:ee.initial}:{};return{...K,...fe,...ge}},Ke=(ne=[])=>ne==null?void 0:ne.filter(({class:ee,className:ge,...me})=>Object.entries(me).every(([st,Et])=>{let Pt=he(st);return Array.isArray(Et)?Et.includes(Pt[st]):Pt[st]===Et})).flatMap(({class:ee,className:ge})=>[ee,ge]),Ze=()=>{var ne;let ee=Ke(T),ge=Ke((ne=i==null?void 0:i.extend)==null?void 0:ne.compoundVariants);return VD(ge,ee)},Dt=()=>{let ne=Ze();return Array.isArray(ne)?ne.reduce((ee,ge)=>(typeof ge=="string"&&(ee.base=ap(ee.base,ge)(u)),typeof ge=="object"&&Object.entries(ge).forEach(([me,st])=>{ee[me]=ap(ee[me],st)(u)}),ee),{}):ne},ae=()=>M.length<1?null:M.reduce((ne,ee)=>{let{slots:ge=[],class:me,className:st,...Et}=ee;if(!yi(Et)){let Pt=Object.keys(Et);for(let Lt of Pt){let wn=he(Lt)[Lt];if(!wn||wn!==Et[Lt])return ne}}return ge.forEach(Pt=>{ne[Pt]||(ne[Pt]=[]),ne[Pt].push([me,st])}),ne},{});if(!yi(x)||!yi((yt=i==null?void 0:i.extend)==null?void 0:yt.slots)){let ne=(He=Dt())!=null?He:[],ee=(Xe=ae())!=null?Xe:[];return{...typeof Qe=="object"&&!yi(Qe)?Object.keys(Qe).reduce((ge,me)=>(ge[me]=st=>ap(Qe[me],$e(me),ne==null?void 0:ne[me],ee==null?void 0:ee[me],st==null?void 0:st.class,st==null?void 0:st.className)(u),ge),{}):{}}}return ap(j,pt(),Ze(),Se==null?void 0:Se.class,Se==null?void 0:Se.className)(u)},de=()=>{if(!(!F||typeof F!="object"))return Object.keys(F)};return J.variantKeys=de(),J.base=j,J.slots=Qe,J.variants=F,J.defaultVariants=K,J.compoundSlots=M,J.compoundVariants=T,J};const m2=Fc({base:"font-fftext text-label"}),sC=Fc({slots:{container:"flex gap-4 items-center w-full",checkbox:"flex appearance-none items-center justify-center bg-white outline-none ring-0 border-2 border-primary focus:ring-0 focus:border-accent"},variants:{variant:{alpha:{checkbox:"h-5 w-5 rounded"},beta:{checkbox:"h-5 w-5"}}},defaultVariants:{variant:"alpha"}}),cC=Fc({slots:{container:"w-full block",span:"",input:"w-full cursor-pointer ring-0 focus:ring-0 border-2 border-transparent"},variants:{variant:{alpha:{container:"grid gap-1.5",input:"flex items-center justify-between gap-4 rounded-md px-3 py-2 border-slate-700/10 peer-focus:border-accent"},beta:{container:"grid gap-0",input:"flex items-center justify-between gap-4 py-2 border-b-slate-700/10 peer-focus:border-b-accent"}}},defaultVariants:{variant:"alpha"}}),em=Fc({slots:{container:"w-full",span:"",input:"w-full ring-0 placeholder:text-slate-400 focus:ring-0 border-2 border-transparent text-input"},variants:{variant:{alpha:{container:"grid gap-1.5",input:"rounded-md border-slate-700/10 focus:border-accent"},beta:{container:"grid gap-0",input:"px-0 focus:border-transparent focus:border-b-accent border-b-slate-700/10"}}},defaultVariants:{variant:"alpha"}}),fC=Fc({base:"w-max max-w-full",variants:{variant:{alpha:"bg-primary text-white px-4 py-2 rounded-md",beta:"bg-primary text-white px-4 py-2"}},defaultVariants:{variant:"alpha"}}),dC=Fc({slots:{container:"w-full cursor-pointer",span:"",input:"relative outline-none ring-2 ring-transparent",thumb:"block transition-transform duration-100 will-change-transform"},variants:{variant:{alpha:{container:"flex justify-between",input:"h-6 w-9 rounded-full bg-primary border border-black ring-2 focus:border-transparent focus:ring-accent data-[state=checked]:bg-white",thumb:"h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary"},beta:{container:"flex justify-between",input:"h-6 w-9 rounded-full bg-primary border border-black ring-2 focus:border-transparent focus:ring-accent data-[state=checked]:bg-white",thumb:"h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary"}}},defaultVariants:{variant:"alpha"}}),ip=({className:i,required:u,children:c})=>{const p=m2({className:i});return bt.jsxs("span",{className:p,children:[c," ",u?"*":""]})},y2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?em({variant:p.variant}):em(),[]);return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("input",{type:"text",placeholder:(p==null?void 0:p.placeholder)||"Write here...",className:m(),...i.register(c,{required:p!=null&&p.optionalField?!1:`${u} is required`})})]})},g2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?em({variant:p.variant}):em(),[]);return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("textarea",{className:m(),placeholder:(p==null?void 0:p.placeholder)||"Write here...",...i.register(c,{required:p!=null&&p.optionalField?!1:`${u} is required`})})]})};function La(){return La=Object.assign?Object.assign.bind():function(i){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(i[p]=c[p])}return i},La.apply(this,arguments)}function b2(i,u,{checkForDefaultPrevented:c=!0}={}){return function(v){if(i==null||i(v),c===!1||!v.defaultPrevented)return u==null?void 0:u(v)}}function S2(i,u){typeof i=="function"?i(u):i!=null&&(i.current=u)}function pC(...i){return u=>i.forEach(c=>S2(c,u))}function x2(...i){return B.useCallback(pC(...i),i)}function w2(i,u=[]){let c=[];function p(g,m){const x=B.createContext(m),E=c.length;c=[...c,m];function T(D){const{scope:j,children:F,...K}=D,ce=(j==null?void 0:j[i][E])||x,ve=B.useMemo(()=>K,Object.values(K));return B.createElement(ce.Provider,{value:ve},F)}function M(D,j){const F=(j==null?void 0:j[i][E])||x,K=B.useContext(F);if(K)return K;if(m!==void 0)return m;throw new Error(`\`${D}\` must be used within \`${g}\``)}return T.displayName=g+"Provider",[T,M]}const v=()=>{const g=c.map(m=>B.createContext(m));return function(x){const E=(x==null?void 0:x[i])||g;return B.useMemo(()=>({[`__scope${i}`]:{...x,[i]:E}}),[x,E])}};return v.scopeName=i,[p,C2(v,...u)]}function C2(...i){const u=i[0];if(i.length===1)return u;const c=()=>{const p=i.map(v=>({useScope:v(),scopeName:v.scopeName}));return function(g){const m=p.reduce((x,{useScope:E,scopeName:T})=>{const D=E(g)[`__scope${T}`];return{...x,...D}},{});return B.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return c.scopeName=u.scopeName,c}function vC(i){const u=B.useRef(i);return B.useEffect(()=>{u.current=i}),B.useMemo(()=>(...c)=>{var p;return(p=u.current)===null||p===void 0?void 0:p.call(u,...c)},[])}function E2({prop:i,defaultProp:u,onChange:c=()=>{}}){const[p,v]=T2({defaultProp:u,onChange:c}),g=i!==void 0,m=g?i:p,x=vC(c),E=B.useCallback(T=>{if(g){const D=typeof T=="function"?T(i):T;D!==i&&x(D)}else v(T)},[g,i,v,x]);return[m,E]}function T2({defaultProp:i,onChange:u}){const c=B.useState(i),[p]=c,v=B.useRef(p),g=vC(u);return B.useEffect(()=>{v.current!==p&&(g(p),v.current=p)},[p,v,g]),c}function k2(i){const u=B.useRef({value:i,previous:i});return B.useMemo(()=>(u.current.value!==i&&(u.current.previous=u.current.value,u.current.value=i),u.current.previous),[i])}const _2=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{};function R2(i){const[u,c]=B.useState(void 0);return _2(()=>{if(i){c({width:i.offsetWidth,height:i.offsetHeight});const p=new ResizeObserver(v=>{if(!Array.isArray(v)||!v.length)return;const g=v[0];let m,x;if("borderBoxSize"in g){const E=g.borderBoxSize,T=Array.isArray(E)?E[0]:E;m=T.inlineSize,x=T.blockSize}else m=i.offsetWidth,x=i.offsetHeight;c({width:m,height:x})});return p.observe(i,{box:"border-box"}),()=>p.unobserve(i)}else c(void 0)},[i]),u}const hC=B.forwardRef((i,u)=>{const{children:c,...p}=i,v=B.Children.toArray(c),g=v.find(O2);if(g){const m=g.props.children,x=v.map(E=>E===g?B.Children.count(m)>1?B.Children.only(null):B.isValidElement(m)?m.props.children:null:E);return B.createElement(Q0,La({},p,{ref:u}),B.isValidElement(m)?B.cloneElement(m,void 0,x):null)}return B.createElement(Q0,La({},p,{ref:u}),c)});hC.displayName="Slot";const Q0=B.forwardRef((i,u)=>{const{children:c,...p}=i;return B.isValidElement(c)?B.cloneElement(c,{...M2(p,c.props),ref:pC(u,c.ref)}):B.Children.count(c)>1?B.Children.only(null):null});Q0.displayName="SlotClone";const D2=({children:i})=>B.createElement(B.Fragment,null,i);function O2(i){return B.isValidElement(i)&&i.type===D2}function M2(i,u){const c={...u};for(const p in u){const v=i[p],g=u[p];/^on[A-Z]/.test(p)?v&&g?c[p]=(...x)=>{g(...x),v(...x)}:v&&(c[p]=v):p==="style"?c[p]={...v,...g}:p==="className"&&(c[p]=[v,g].filter(Boolean).join(" "))}return{...i,...c}}const mC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((i,u)=>{const c=B.forwardRef((p,v)=>{const{asChild:g,...m}=p,x=g?hC:u;return B.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),B.createElement(x,La({},m,{ref:v}))});return c.displayName=`Primitive.${u}`,{...i,[u]:c}},{}),yC="Switch",[N2,b4]=w2(yC),[A2,L2]=N2(yC),z2=B.forwardRef((i,u)=>{const{__scopeSwitch:c,name:p,checked:v,defaultChecked:g,required:m,disabled:x,value:E="on",onCheckedChange:T,...M}=i,[D,j]=B.useState(null),F=x2(u,J=>j(J)),K=B.useRef(!1),ce=D?!!D.closest("form"):!0,[ve=!1,Qe]=E2({prop:v,defaultProp:g,onChange:T});return B.createElement(A2,{scope:c,checked:ve,disabled:x},B.createElement(mC.button,La({type:"button",role:"switch","aria-checked":ve,"aria-required":m,"data-state":gC(ve),"data-disabled":x?"":void 0,disabled:x,value:E},M,{ref:F,onClick:b2(i.onClick,J=>{Qe(de=>!de),ce&&(K.current=J.isPropagationStopped(),K.current||J.stopPropagation())})})),ce&&B.createElement(F2,{control:D,bubbles:!K.current,name:p,value:E,checked:ve,required:m,disabled:x,style:{transform:"translateX(-100%)"}}))}),U2="SwitchThumb",j2=B.forwardRef((i,u)=>{const{__scopeSwitch:c,...p}=i,v=L2(U2,c);return B.createElement(mC.span,La({"data-state":gC(v.checked),"data-disabled":v.disabled?"":void 0},p,{ref:u}))}),F2=i=>{const{control:u,checked:c,bubbles:p=!0,...v}=i,g=B.useRef(null),m=k2(c),x=R2(u);return B.useEffect(()=>{const E=g.current,T=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(T,"checked").set;if(m!==c&&D){const j=new Event("click",{bubbles:p});D.call(E,c),E.dispatchEvent(j)}},[m,c,p]),B.createElement("input",La({type:"checkbox","aria-hidden":!0,defaultChecked:c},v,{tabIndex:-1,ref:g,style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function gC(i){return i?"checked":"unchecked"}const V2=z2,H2=j2,P2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m,thumb:x}=B.useMemo(()=>p!=null&&p.variant?dC({variant:p.variant}):dC(),[]),{field:{onChange:E,value:T}}=U0({name:c,control:i?i.control:void 0,defaultValue:!1,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx(V2,{id:c,checked:T,className:m(),onCheckedChange:M=>{E(M)},children:bt.jsx(H2,{className:x()})})]})},tm=B;function B2({title:i,titleId:u,...c},p){return tm.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:p,"aria-labelledby":u},c),i?tm.createElement("title",{id:u},i):null,tm.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"}))}var I2=tm.forwardRef(B2);const nm=B;function $2({title:i,titleId:u,...c},p){return nm.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:p,"aria-labelledby":u},c),i?nm.createElement("title",{id:u},i):null,nm.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"}))}var W2=nm.forwardRef($2),Y2=I2,Z2=W2;const G2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?cC({variant:p==null?void 0:p.variant}):cC(),[]),{field:{onChange:x,value:E}}=U0({name:c,control:i?i.control:void 0,defaultValue:null,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("input",{type:"file",multiple:!0,capture:"environment",onChange:T=>{T.target.files&&x(T.target.files)},className:"peer sr-only"}),bt.jsxs("span",{className:`${m()} ${E&&E.length>0?"border-primary text-input":"border-slate-700/10 text-slate-400"}`,children:[bt.jsx("span",{className:"grid",children:E&&E.length>0?Array.from(E).map((T,M)=>bt.jsx("span",{className:"block max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:T.name},M)):bt.jsx("span",{className:"block max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:(p==null?void 0:p.placeholder)||"No file selected"})}),bt.jsx(Z2,{className:"h-6 w-6 min-w-[1.5rem]"})]})]})},Q2=({label:i,options:u})=>{const c=B.useMemo(()=>u!=null&&u.variant?fC({variant:u.variant}):fC(),[]);return bt.jsx("div",{className:"w-full flex justify-center",children:bt.jsx("button",{type:"submit",className:c,children:i})})};function X2(i,u){typeof i=="function"?i(u):i!=null&&(i.current=u)}function bC(...i){return u=>i.forEach(c=>X2(c,u))}function SC(...i){return B.useCallback(bC(...i),i)}function K2(i,u=[]){let c=[];function p(g,m){const x=B.createContext(m),E=c.length;c=[...c,m];function T(D){const{scope:j,children:F,...K}=D,ce=(j==null?void 0:j[i][E])||x,ve=B.useMemo(()=>K,Object.values(K));return B.createElement(ce.Provider,{value:ve},F)}function M(D,j){const F=(j==null?void 0:j[i][E])||x,K=B.useContext(F);if(K)return K;if(m!==void 0)return m;throw new Error(`\`${D}\` must be used within \`${g}\``)}return T.displayName=g+"Provider",[T,M]}const v=()=>{const g=c.map(m=>B.createContext(m));return function(x){const E=(x==null?void 0:x[i])||g;return B.useMemo(()=>({[`__scope${i}`]:{...x,[i]:E}}),[x,E])}};return v.scopeName=i,[p,J2(v,...u)]}function J2(...i){const u=i[0];if(i.length===1)return u;const c=()=>{const p=i.map(v=>({useScope:v(),scopeName:v.scopeName}));return function(g){const m=p.reduce((x,{useScope:E,scopeName:T})=>{const D=E(g)[`__scope${T}`];return{...x,...D}},{});return B.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return c.scopeName=u.scopeName,c}function xC(i,u,{checkForDefaultPrevented:c=!0}={}){return function(v){if(i==null||i(v),c===!1||!v.defaultPrevented)return u==null?void 0:u(v)}}function wC(i){const u=B.useRef(i);return B.useEffect(()=>{u.current=i}),B.useMemo(()=>(...c)=>{var p;return(p=u.current)===null||p===void 0?void 0:p.call(u,...c)},[])}function q2({prop:i,defaultProp:u,onChange:c=()=>{}}){const[p,v]=eO({defaultProp:u,onChange:c}),g=i!==void 0,m=g?i:p,x=wC(c),E=B.useCallback(T=>{if(g){const D=typeof T=="function"?T(i):T;D!==i&&x(D)}else v(T)},[g,i,v,x]);return[m,E]}function eO({defaultProp:i,onChange:u}){const c=B.useState(i),[p]=c,v=B.useRef(p),g=wC(u);return B.useEffect(()=>{v.current!==p&&(g(p),v.current=p)},[p,v,g]),c}function tO(i){const u=B.useRef({value:i,previous:i});return B.useMemo(()=>(u.current.value!==i&&(u.current.previous=u.current.value,u.current.value=i),u.current.previous),[i])}const X0=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{};function nO(i){const[u,c]=B.useState(void 0);return X0(()=>{if(i){c({width:i.offsetWidth,height:i.offsetHeight});const p=new ResizeObserver(v=>{if(!Array.isArray(v)||!v.length)return;const g=v[0];let m,x;if("borderBoxSize"in g){const E=g.borderBoxSize,T=Array.isArray(E)?E[0]:E;m=T.inlineSize,x=T.blockSize}else m=i.offsetWidth,x=i.offsetHeight;c({width:m,height:x})});return p.observe(i,{box:"border-box"}),()=>p.unobserve(i)}else c(void 0)},[i]),u}function rO(i,u){return B.useReducer((c,p)=>{const v=u[c][p];return v??c},i)}const CC=i=>{const{present:u,children:c}=i,p=aO(u),v=typeof c=="function"?c({present:p.isPresent}):B.Children.only(c),g=SC(p.ref,v.ref);return typeof c=="function"||p.isPresent?B.cloneElement(v,{ref:g}):null};CC.displayName="Presence";function aO(i){const[u,c]=B.useState(),p=B.useRef({}),v=B.useRef(i),g=B.useRef("none"),m=i?"mounted":"unmounted",[x,E]=rO(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B.useEffect(()=>{const T=rm(p.current);g.current=x==="mounted"?T:"none"},[x]),X0(()=>{const T=p.current,M=v.current;if(M!==i){const j=g.current,F=rm(T);i?E("MOUNT"):F==="none"||(T==null?void 0:T.display)==="none"?E("UNMOUNT"):E(M&&j!==F?"ANIMATION_OUT":"UNMOUNT"),v.current=i}},[i,E]),X0(()=>{if(u){const T=D=>{const F=rm(p.current).includes(D.animationName);D.target===u&&F&&Jx.flushSync(()=>E("ANIMATION_END"))},M=D=>{D.target===u&&(g.current=rm(p.current))};return u.addEventListener("animationstart",M),u.addEventListener("animationcancel",T),u.addEventListener("animationend",T),()=>{u.removeEventListener("animationstart",M),u.removeEventListener("animationcancel",T),u.removeEventListener("animationend",T)}}else E("ANIMATION_END")},[u,E]),{isPresent:["mounted","unmountSuspended"].includes(x),ref:B.useCallback(T=>{T&&(p.current=getComputedStyle(T)),c(T)},[])}}function rm(i){return(i==null?void 0:i.animationName)||"none"}const EC=B.forwardRef((i,u)=>{const{children:c,...p}=i,v=B.Children.toArray(c),g=v.find(oO);if(g){const m=g.props.children,x=v.map(E=>E===g?B.Children.count(m)>1?B.Children.only(null):B.isValidElement(m)?m.props.children:null:E);return B.createElement(K0,La({},p,{ref:u}),B.isValidElement(m)?B.cloneElement(m,void 0,x):null)}return B.createElement(K0,La({},p,{ref:u}),c)});EC.displayName="Slot";const K0=B.forwardRef((i,u)=>{const{children:c,...p}=i;return B.isValidElement(c)?B.cloneElement(c,{...lO(p,c.props),ref:u?bC(u,c.ref):c.ref}):B.Children.count(c)>1?B.Children.only(null):null});K0.displayName="SlotClone";const iO=({children:i})=>B.createElement(B.Fragment,null,i);function oO(i){return B.isValidElement(i)&&i.type===iO}function lO(i,u){const c={...u};for(const p in u){const v=i[p],g=u[p];/^on[A-Z]/.test(p)?v&&g?c[p]=(...x)=>{g(...x),v(...x)}:v&&(c[p]=v):p==="style"?c[p]={...v,...g}:p==="className"&&(c[p]=[v,g].filter(Boolean).join(" "))}return{...i,...c}}const TC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((i,u)=>{const c=B.forwardRef((p,v)=>{const{asChild:g,...m}=p,x=g?EC:u;return B.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),B.createElement(x,La({},m,{ref:v}))});return c.displayName=`Primitive.${u}`,{...i,[u]:c}},{}),kC="Checkbox",[uO,C4]=K2(kC),[sO,cO]=uO(kC),fO=B.forwardRef((i,u)=>{const{__scopeCheckbox:c,name:p,checked:v,defaultChecked:g,required:m,disabled:x,value:E="on",onCheckedChange:T,...M}=i,[D,j]=B.useState(null),F=SC(u,de=>j(de)),K=B.useRef(!1),ce=D?!!D.closest("form"):!0,[ve=!1,Qe]=q2({prop:v,defaultProp:g,onChange:T}),J=B.useRef(ve);return B.useEffect(()=>{const de=D==null?void 0:D.form;if(de){const Se=()=>Qe(J.current);return de.addEventListener("reset",Se),()=>de.removeEventListener("reset",Se)}},[D,Qe]),B.createElement(sO,{scope:c,state:ve,disabled:x},B.createElement(TC.button,La({type:"button",role:"checkbox","aria-checked":gs(ve)?"mixed":ve,"aria-required":m,"data-state":_C(ve),"data-disabled":x?"":void 0,disabled:x,value:E},M,{ref:F,onKeyDown:xC(i.onKeyDown,de=>{de.key==="Enter"&&de.preventDefault()}),onClick:xC(i.onClick,de=>{Qe(Se=>gs(Se)?!0:!Se),ce&&(K.current=de.isPropagationStopped(),K.current||de.stopPropagation())})})),ce&&B.createElement(vO,{control:D,bubbles:!K.current,name:p,value:E,checked:ve,required:m,disabled:x,style:{transform:"translateX(-100%)"}}))}),dO="CheckboxIndicator",pO=B.forwardRef((i,u)=>{const{__scopeCheckbox:c,forceMount:p,...v}=i,g=cO(dO,c);return B.createElement(CC,{present:p||gs(g.state)||g.state===!0},B.createElement(TC.span,La({"data-state":_C(g.state),"data-disabled":g.disabled?"":void 0},v,{ref:u,style:{pointerEvents:"none",...i.style}})))}),vO=i=>{const{control:u,checked:c,bubbles:p=!0,...v}=i,g=B.useRef(null),m=tO(c),x=nO(u);return B.useEffect(()=>{const E=g.current,T=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(T,"checked").set;if(m!==c&&D){const j=new Event("click",{bubbles:p});E.indeterminate=gs(c),D.call(E,gs(c)?!1:c),E.dispatchEvent(j)}},[m,c,p]),B.createElement("input",La({type:"checkbox","aria-hidden":!0,defaultChecked:gs(c)?!1:c},v,{tabIndex:-1,ref:g,style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function gs(i){return i==="indeterminate"}function _C(i){return gs(i)?"indeterminate":i?"checked":"unchecked"}const hO=fO,mO=pO,yO=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,checkbox:g}=B.useMemo(()=>p!=null&&p.variant?sC({variant:p.variant}):sC(),[]),{field:{onChange:m,value:x}}=U0({name:c,control:i?i.control:void 0,defaultValue:!1,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[bt.jsx(hO,{className:g(),defaultChecked:x,onCheckedChange:E=>{m(E)},children:bt.jsx(mO,{className:"text-input",children:bt.jsx(Y2,{className:"w-4"})})}),bt.jsx(ip,{className:"text-label",required:!(p!=null&&p.optionalField),children:u})]})},gO=new Map().set("simple",y2).set("textarea",g2).set("toggle",P2).set("file",G2).set("submit",Q2).set("checkbox",yO),RC=({subtype:i="simple",...u})=>{const c=gO.get(i);return c?bt.jsx(c,{...u}):bt.jsx(bt.Fragment,{})},DC=({$config:i,$blocks:u,$containers:c,$available:p})=>{const v={...i},g=v.type.length,m=v.type.indexOf(":"),x=v.type.substring(0,m>0?v.type.lastIndexOf(":"):g+1),E=m>0&&m+1!==g?v.type.substring(m+1,g+1):void 0;if(p==null?void 0:p.has(x)){const M=u==null?void 0:u.get(x),D=c==null?void 0:c.get(x);v.type=x,v.subtype=v.subtype?v.subtype:E,v.block=M,v.container=D}return v.label&&(v.label=bD.parse(v.label)),v.items&&Array.isArray(v.items)&&(v.items=v.items.map(M=>DC({$config:M,$available:p,$blocks:u,$containers:c}))),v},bO=i=>{const u=new Map([...new Map(i.$blocks),...new Map(i.$containers)]);return DC({...i,$available:u})},SO=new Map().set("input",RC),xO=new Map().set("form",FD),OC=({config:i})=>{const{key:u,type:c,subtype:p,label:v,bind:g,items:m,block:x,container:E,...T}=i;if(!c)return null;if(E&&m&&Array.isArray(m)){const M=E;return bt.jsx(M,{subtype:p,label:v,...T,children:m.map((D,j)=>{var F;return bt.jsx(OC,{config:{...T,...D,options:{...D.options,variant:(F=T.options)==null?void 0:F.variant}}},j)})},u)}if(x){const M=x;return bt.jsx(M,{subtype:p,label:v,bind:g,...T},u)}return null},wO=({config:i,options:u})=>{const c=bO({$blocks:SO,$containers:xO,$config:{type:"form",items:i||[],options:u}});return bt.jsx(OC,{config:c})},CO=T_(RR),EO=W_(wO,{props:{config:"json",options:"json"},shadow:"open"});class TO extends CO(EO){}customElements.define("twintag-form",TO)});
196
+ Check the top-level render call using <`+ke+">.")}return oe}}function ll(O,oe){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var ke=Vc(oe);if(bs[ke])return;bs[ke]=!0;var nt="";O&&O._owner&&O._owner!==sn.current&&(nt=" It was passed a child from "+fe(O._owner.type)+"."),an(O),J('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ke,nt),an(null)}}function su(O,oe){{if(typeof O!="object")return;if($t(O))for(var ke=0;ke<O.length;ke++){var nt=O[ke];lu(nt)&&ll(nt,oe)}else if(lu(O))O._store&&(O._store.validated=!0);else if(O){var Ct=ve(O);if(typeof Ct=="function"&&Ct!==O.entries)for(var Bt=Ct.call(O),Tt;!(Tt=Bt.next()).done;)lu(Tt.value)&&ll(Tt.value,oe)}}}function ul(O){{var oe=O.type;if(oe==null||typeof oe=="string")return;var ke;if(typeof oe=="function")ke=oe.propTypes;else if(typeof oe=="object"&&(oe.$$typeof===E||oe.$$typeof===D))ke=oe.propTypes;else return;if(ke){var nt=fe(oe);le(ke,O.props,"prop",nt,O)}else if(oe.PropTypes!==void 0&&!cn){cn=!0;var Ct=fe(oe);J("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ct||"Unknown")}typeof oe.getDefaultProps=="function"&&!oe.getDefaultProps.isReactClassApproved&&J("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function cu(O){{for(var oe=Object.keys(O.props),ke=0;ke<oe.length;ke++){var nt=oe[ke];if(nt!=="children"&&nt!=="key"){an(O),J("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",nt),an(null);break}}O.ref!==null&&(an(O),J("Invalid attribute `ref` supplied to `React.Fragment`."),an(null))}}function bi(O,oe,ke,nt,Ct,Bt){{var Tt=ut(O);if(!Tt){var at="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(at+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ar=uu(Ct);ar?at+=ar:at+=ol();var mn;O===null?mn="null":$t(O)?mn="array":O!==void 0&&O.$$typeof===u?(mn="<"+(fe(O.type)||"Unknown")+" />",at=" Did you accidentally export a JSX literal instead of a component?"):mn=typeof O,J("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",mn,at)}var yn=ta(O,oe,ke,Ct,Bt);if(yn==null)return yn;if(Tt){var Br=oe.children;if(Br!==void 0)if(nt)if($t(Br)){for(var bo=0;bo<Br.length;bo++)su(Br[bo],O);Object.freeze&&Object.freeze(Br)}else J("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else su(Br,O)}return O===p?cu(yn):ul(yn),yn}}function yo(O,oe,ke){return bi(O,oe,ke,!0)}function ba(O,oe,ke){return bi(O,oe,ke,!1)}var ri=ba,go=yo;Vd.Fragment=p,Vd.jsx=ri,Vd.jsxs=go}()),Vd}process.env.NODE_ENV==="production"?R0.exports=DR():R0.exports=OR();var bt=R0.exports,Jt;(function(i){i.assertEqual=v=>v;function u(v){}i.assertIs=u;function c(v){throw new Error}i.assertNever=c,i.arrayToEnum=v=>{const g={};for(const m of v)g[m]=m;return g},i.getValidEnumValues=v=>{const g=i.objectKeys(v).filter(x=>typeof v[v[x]]!="number"),m={};for(const x of g)m[x]=v[x];return i.objectValues(m)},i.objectValues=v=>i.objectKeys(v).map(function(g){return v[g]}),i.objectKeys=typeof Object.keys=="function"?v=>Object.keys(v):v=>{const g=[];for(const m in v)Object.prototype.hasOwnProperty.call(v,m)&&g.push(m);return g},i.find=(v,g)=>{for(const m of v)if(g(m))return m},i.isInteger=typeof Number.isInteger=="function"?v=>Number.isInteger(v):v=>typeof v=="number"&&isFinite(v)&&Math.floor(v)===v;function p(v,g=" | "){return v.map(m=>typeof m=="string"?`'${m}'`:m).join(g)}i.joinValues=p,i.jsonStringifyReplacer=(v,g)=>typeof g=="bigint"?g.toString():g})(Jt||(Jt={}));const Ae=Jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tu=i=>{switch(typeof i){case"undefined":return Ae.undefined;case"string":return Ae.string;case"number":return isNaN(i)?Ae.nan:Ae.number;case"boolean":return Ae.boolean;case"function":return Ae.function;case"bigint":return Ae.bigint;case"symbol":return Ae.symbol;case"object":return Array.isArray(i)?Ae.array:i===null?Ae.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?Ae.promise:typeof Map<"u"&&i instanceof Map?Ae.map:typeof Set<"u"&&i instanceof Set?Ae.set:typeof Date<"u"&&i instanceof Date?Ae.date:Ae.object;default:return Ae.unknown}},we=Jt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MR=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:");class tl extends Error{constructor(u){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};const c=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,c):this.__proto__=c,this.name="ZodError",this.issues=u}get errors(){return this.issues}format(u){const c=u||function(g){return g.message},p={_errors:[]},v=g=>{for(const m of g.issues)if(m.code==="invalid_union")m.unionErrors.map(v);else if(m.code==="invalid_return_type")v(m.returnTypeError);else if(m.code==="invalid_arguments")v(m.argumentsError);else if(m.path.length===0)p._errors.push(c(m));else{let x=p,E=0;for(;E<m.path.length;){const T=m.path[E];E===m.path.length-1?(x[T]=x[T]||{_errors:[]},x[T]._errors.push(c(m))):x[T]=x[T]||{_errors:[]},x=x[T],E++}}};return v(this),p}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(u=c=>c.message){const c={},p=[];for(const v of this.issues)v.path.length>0?(c[v.path[0]]=c[v.path[0]]||[],c[v.path[0]].push(u(v))):p.push(u(v));return{formErrors:p,fieldErrors:c}}get formErrors(){return this.flatten()}}tl.create=i=>new tl(i);const Hd=(i,u)=>{let c;switch(i.code){case we.invalid_type:i.received===Ae.undefined?c="Required":c=`Expected ${i.expected}, received ${i.received}`;break;case we.invalid_literal:c=`Invalid literal value, expected ${JSON.stringify(i.expected,Jt.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:c=`Unrecognized key(s) in object: ${Jt.joinValues(i.keys,", ")}`;break;case we.invalid_union:c="Invalid input";break;case we.invalid_union_discriminator:c=`Invalid discriminator value. Expected ${Jt.joinValues(i.options)}`;break;case we.invalid_enum_value:c=`Invalid enum value. Expected ${Jt.joinValues(i.options)}, received '${i.received}'`;break;case we.invalid_arguments:c="Invalid function arguments";break;case we.invalid_return_type:c="Invalid function return type";break;case we.invalid_date:c="Invalid date";break;case we.invalid_string:typeof i.validation=="object"?"startsWith"in i.validation?c=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?c=`Invalid input: must end with "${i.validation.endsWith}"`:Jt.assertNever(i.validation):i.validation!=="regex"?c=`Invalid ${i.validation}`:c="Invalid";break;case we.too_small:i.type==="array"?c=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?c=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?c=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?c=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(i.minimum)}`:c="Invalid input";break;case we.too_big:i.type==="array"?c=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?c=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?c=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?c=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(i.maximum)}`:c="Invalid input";break;case we.custom:c="Invalid input";break;case we.invalid_intersection_types:c="Intersection results could not be merged";break;case we.not_multiple_of:c=`Number must be a multiple of ${i.multipleOf}`;break;case we.not_finite:c="Number must be finite";break;default:c=u.defaultError,Jt.assertNever(i)}return{message:c}};let hw=Hd;function NR(i){hw=i}function Ah(){return hw}const Lh=i=>{const{data:u,path:c,errorMaps:p,issueData:v}=i,g=[...c,...v.path||[]],m={...v,path:g};let x="";const E=p.filter(T=>!!T).slice().reverse();for(const T of E)x=T(m,{data:u,defaultError:x}).message;return{...v,path:g,message:v.message||x}},AR=[];function Ye(i,u){const c=Lh({issueData:u,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Ah(),Hd].filter(p=>!!p)});i.common.issues.push(c)}class ma{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(u,c){const p=[];for(const v of c){if(v.status==="aborted")return wt;v.status==="dirty"&&u.dirty(),p.push(v.value)}return{status:u.value,value:p}}static async mergeObjectAsync(u,c){const p=[];for(const v of c)p.push({key:await v.key,value:await v.value});return ma.mergeObjectSync(u,p)}static mergeObjectSync(u,c){const p={};for(const v of c){const{key:g,value:m}=v;if(g.status==="aborted"||m.status==="aborted")return wt;g.status==="dirty"&&u.dirty(),m.status==="dirty"&&u.dirty(),(typeof m.value<"u"||v.alwaysSet)&&(p[g.value]=m.value)}return{status:u.value,value:p}}}const wt=Object.freeze({status:"aborted"}),mw=i=>({status:"dirty",value:i}),qr=i=>({status:"valid",value:i}),D0=i=>i.status==="aborted",O0=i=>i.status==="dirty",zh=i=>i.status==="valid",Uh=i=>typeof Promise<"u"&&i instanceof Promise;var Ut;(function(i){i.errToObj=u=>typeof u=="string"?{message:u}:u||{},i.toString=u=>typeof u=="string"?u:u==null?void 0:u.message})(Ut||(Ut={}));class vo{constructor(u,c,p,v){this.parent=u,this.data=c,this._path=p,this._key=v}get path(){return this._path.concat(this._key)}}const yw=(i,u)=>{if(zh(u))return{success:!0,data:u.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,error:new tl(i.common.issues)}};function kt(i){if(!i)return{};const{errorMap:u,invalid_type_error:c,required_error:p,description:v}=i;if(u&&(c||p))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return u?{errorMap:u,description:v}:{errorMap:(m,x)=>m.code!=="invalid_type"?{message:x.defaultError}:typeof x.data>"u"?{message:p??x.defaultError}:{message:c??x.defaultError},description:v}}class Ot{constructor(u){this.spa=this.safeParseAsync,this._def=u,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(u){return tu(u.data)}_getOrReturnCtx(u,c){return c||{common:u.parent.common,data:u.data,parsedType:tu(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new ma,ctx:{common:u.parent.common,data:u.data,parsedType:tu(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const c=this._parse(u);if(Uh(c))throw new Error("Synchronous parse encountered promise.");return c}_parseAsync(u){const c=this._parse(u);return Promise.resolve(c)}parse(u,c){const p=this.safeParse(u,c);if(p.success)return p.data;throw p.error}safeParse(u,c){var p;const v={common:{issues:[],async:(p=c==null?void 0:c.async)!==null&&p!==void 0?p:!1,contextualErrorMap:c==null?void 0:c.errorMap},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:tu(u)},g=this._parseSync({data:u,path:v.path,parent:v});return yw(v,g)}async parseAsync(u,c){const p=await this.safeParseAsync(u,c);if(p.success)return p.data;throw p.error}async safeParseAsync(u,c){const p={common:{issues:[],contextualErrorMap:c==null?void 0:c.errorMap,async:!0},path:(c==null?void 0:c.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:tu(u)},v=this._parse({data:u,path:p.path,parent:p}),g=await(Uh(v)?v:Promise.resolve(v));return yw(p,g)}refine(u,c){const p=v=>typeof c=="string"||typeof c>"u"?{message:c}:typeof c=="function"?c(v):c;return this._refinement((v,g)=>{const m=u(v),x=()=>g.addIssue({code:we.custom,...p(v)});return typeof Promise<"u"&&m instanceof Promise?m.then(E=>E?!0:(x(),!1)):m?!0:(x(),!1)})}refinement(u,c){return this._refinement((p,v)=>u(p)?!0:(v.addIssue(typeof c=="function"?c(p,v):c),!1))}_refinement(u){return new Ui({schema:this,typeName:vt.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}optional(){return al.create(this,this._def)}nullable(){return vs.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zi.create(this,this._def)}promise(){return Ac.create(this,this._def)}or(u){return Wd.create([this,u],this._def)}and(u){return Yd.create(this,u,this._def)}transform(u){return new Ui({...kt(this._def),schema:this,typeName:vt.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const c=typeof u=="function"?u:()=>u;return new Kd({...kt(this._def),innerType:this,defaultValue:c,typeName:vt.ZodDefault})}brand(){return new bw({typeName:vt.ZodBranded,type:this,...kt(this._def)})}catch(u){const c=typeof u=="function"?u:()=>u;return new Ih({...kt(this._def),innerType:this,catchValue:c,typeName:vt.ZodCatch})}describe(u){const c=this.constructor;return new c({...this._def,description:u})}pipe(u){return Jd.create(this,u)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const LR=/^c[^\s-]{8,}$/i,zR=/^[a-z][a-z0-9]*$/,UR=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,jR=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,FR=i=>i.precision?i.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${i.precision}}Z$`):i.precision===0?i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):i.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");class nl extends Ot{constructor(){super(...arguments),this._regex=(u,c,p)=>this.refinement(v=>u.test(v),{validation:c,code:we.invalid_string,...Ut.errToObj(p)}),this.nonempty=u=>this.min(1,Ut.errToObj(u)),this.trim=()=>new nl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(u){if(this._def.coerce&&(u.data=String(u.data)),this._getType(u)!==Ae.string){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.string,received:g.parsedType}),wt}const p=new ma;let v;for(const g of this._def.checks)if(g.kind==="min")u.data.length<g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),p.dirty());else if(g.kind==="max")u.data.length>g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!1,message:g.message}),p.dirty());else if(g.kind==="length"){const m=u.data.length>g.value,x=u.data.length<g.value;(m||x)&&(v=this._getOrReturnCtx(u,v),m?Ye(v,{code:we.too_big,maximum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}):x&&Ye(v,{code:we.too_small,minimum:g.value,type:"string",inclusive:!0,exact:!0,message:g.message}),p.dirty())}else if(g.kind==="email")jR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"email",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="uuid")UR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"uuid",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="cuid")LR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"cuid",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="cuid2")zR.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"cuid2",code:we.invalid_string,message:g.message}),p.dirty());else if(g.kind==="url")try{new URL(u.data)}catch{v=this._getOrReturnCtx(u,v),Ye(v,{validation:"url",code:we.invalid_string,message:g.message}),p.dirty()}else g.kind==="regex"?(g.regex.lastIndex=0,g.regex.test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{validation:"regex",code:we.invalid_string,message:g.message}),p.dirty())):g.kind==="trim"?u.data=u.data.trim():g.kind==="startsWith"?u.data.startsWith(g.value)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:{startsWith:g.value},message:g.message}),p.dirty()):g.kind==="endsWith"?u.data.endsWith(g.value)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:{endsWith:g.value},message:g.message}),p.dirty()):g.kind==="datetime"?FR(g).test(u.data)||(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.invalid_string,validation:"datetime",message:g.message}),p.dirty()):Jt.assertNever(g);return{status:p.value,value:u.data}}_addCheck(u){return new nl({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...Ut.errToObj(u)})}url(u){return this._addCheck({kind:"url",...Ut.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...Ut.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...Ut.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...Ut.errToObj(u)})}datetime(u){var c;return typeof u=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:u}):this._addCheck({kind:"datetime",precision:typeof(u==null?void 0:u.precision)>"u"?null:u==null?void 0:u.precision,offset:(c=u==null?void 0:u.offset)!==null&&c!==void 0?c:!1,...Ut.errToObj(u==null?void 0:u.message)})}regex(u,c){return this._addCheck({kind:"regex",regex:u,...Ut.errToObj(c)})}startsWith(u,c){return this._addCheck({kind:"startsWith",value:u,...Ut.errToObj(c)})}endsWith(u,c){return this._addCheck({kind:"endsWith",value:u,...Ut.errToObj(c)})}min(u,c){return this._addCheck({kind:"min",value:u,...Ut.errToObj(c)})}max(u,c){return this._addCheck({kind:"max",value:u,...Ut.errToObj(c)})}length(u,c){return this._addCheck({kind:"length",value:u,...Ut.errToObj(c)})}get isDatetime(){return!!this._def.checks.find(u=>u.kind==="datetime")}get isEmail(){return!!this._def.checks.find(u=>u.kind==="email")}get isURL(){return!!this._def.checks.find(u=>u.kind==="url")}get isUUID(){return!!this._def.checks.find(u=>u.kind==="uuid")}get isCUID(){return!!this._def.checks.find(u=>u.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(u=>u.kind==="cuid2")}get minLength(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u}get maxLength(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u}}nl.create=i=>{var u;return new nl({checks:[],typeName:vt.ZodString,coerce:(u=i==null?void 0:i.coerce)!==null&&u!==void 0?u:!1,...kt(i)})};function VR(i,u){const c=(i.toString().split(".")[1]||"").length,p=(u.toString().split(".")[1]||"").length,v=c>p?c:p,g=parseInt(i.toFixed(v).replace(".","")),m=parseInt(u.toFixed(v).replace(".",""));return g%m/Math.pow(10,v)}class nu extends Ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){if(this._def.coerce&&(u.data=Number(u.data)),this._getType(u)!==Ae.number){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.number,received:g.parsedType}),wt}let p;const v=new ma;for(const g of this._def.checks)g.kind==="int"?Jt.isInteger(u.data)||(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.invalid_type,expected:"integer",received:"float",message:g.message}),v.dirty()):g.kind==="min"?(g.inclusive?u.data<g.value:u.data<=g.value)&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.too_small,minimum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),v.dirty()):g.kind==="max"?(g.inclusive?u.data>g.value:u.data>=g.value)&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.too_big,maximum:g.value,type:"number",inclusive:g.inclusive,exact:!1,message:g.message}),v.dirty()):g.kind==="multipleOf"?VR(u.data,g.value)!==0&&(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.not_multiple_of,multipleOf:g.value,message:g.message}),v.dirty()):g.kind==="finite"?Number.isFinite(u.data)||(p=this._getOrReturnCtx(u,p),Ye(p,{code:we.not_finite,message:g.message}),v.dirty()):Jt.assertNever(g);return{status:v.value,value:u.data}}gte(u,c){return this.setLimit("min",u,!0,Ut.toString(c))}gt(u,c){return this.setLimit("min",u,!1,Ut.toString(c))}lte(u,c){return this.setLimit("max",u,!0,Ut.toString(c))}lt(u,c){return this.setLimit("max",u,!1,Ut.toString(c))}setLimit(u,c,p,v){return new nu({...this._def,checks:[...this._def.checks,{kind:u,value:c,inclusive:p,message:Ut.toString(v)}]})}_addCheck(u){return new nu({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:Ut.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ut.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ut.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ut.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ut.toString(u)})}multipleOf(u,c){return this._addCheck({kind:"multipleOf",value:u,message:Ut.toString(c)})}finite(u){return this._addCheck({kind:"finite",message:Ut.toString(u)})}get minValue(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u}get maxValue(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u}get isInt(){return!!this._def.checks.find(u=>u.kind==="int"||u.kind==="multipleOf"&&Jt.isInteger(u.value))}get isFinite(){let u=null,c=null;for(const p of this._def.checks){if(p.kind==="finite"||p.kind==="int"||p.kind==="multipleOf")return!0;p.kind==="min"?(c===null||p.value>c)&&(c=p.value):p.kind==="max"&&(u===null||p.value<u)&&(u=p.value)}return Number.isFinite(c)&&Number.isFinite(u)}}nu.create=i=>new nu({checks:[],typeName:vt.ZodNumber,coerce:(i==null?void 0:i.coerce)||!1,...kt(i)});class Pd extends Ot{_parse(u){if(this._def.coerce&&(u.data=BigInt(u.data)),this._getType(u)!==Ae.bigint){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.bigint,received:p.parsedType}),wt}return qr(u.data)}}Pd.create=i=>{var u;return new Pd({typeName:vt.ZodBigInt,coerce:(u=i==null?void 0:i.coerce)!==null&&u!==void 0?u:!1,...kt(i)})};class Bd extends Ot{_parse(u){if(this._def.coerce&&(u.data=!!u.data),this._getType(u)!==Ae.boolean){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.boolean,received:p.parsedType}),wt}return qr(u.data)}}Bd.create=i=>new Bd({typeName:vt.ZodBoolean,coerce:(i==null?void 0:i.coerce)||!1,...kt(i)});class fs extends Ot{_parse(u){if(this._def.coerce&&(u.data=new Date(u.data)),this._getType(u)!==Ae.date){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_type,expected:Ae.date,received:g.parsedType}),wt}if(isNaN(u.data.getTime())){const g=this._getOrReturnCtx(u);return Ye(g,{code:we.invalid_date}),wt}const p=new ma;let v;for(const g of this._def.checks)g.kind==="min"?u.data.getTime()<g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_small,message:g.message,inclusive:!0,exact:!1,minimum:g.value,type:"date"}),p.dirty()):g.kind==="max"?u.data.getTime()>g.value&&(v=this._getOrReturnCtx(u,v),Ye(v,{code:we.too_big,message:g.message,inclusive:!0,exact:!1,maximum:g.value,type:"date"}),p.dirty()):Jt.assertNever(g);return{status:p.value,value:new Date(u.data.getTime())}}_addCheck(u){return new fs({...this._def,checks:[...this._def.checks,u]})}min(u,c){return this._addCheck({kind:"min",value:u.getTime(),message:Ut.toString(c)})}max(u,c){return this._addCheck({kind:"max",value:u.getTime(),message:Ut.toString(c)})}get minDate(){let u=null;for(const c of this._def.checks)c.kind==="min"&&(u===null||c.value>u)&&(u=c.value);return u!=null?new Date(u):null}get maxDate(){let u=null;for(const c of this._def.checks)c.kind==="max"&&(u===null||c.value<u)&&(u=c.value);return u!=null?new Date(u):null}}fs.create=i=>new fs({checks:[],coerce:(i==null?void 0:i.coerce)||!1,typeName:vt.ZodDate,...kt(i)});class jh extends Ot{_parse(u){if(this._getType(u)!==Ae.symbol){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.symbol,received:p.parsedType}),wt}return qr(u.data)}}jh.create=i=>new jh({typeName:vt.ZodSymbol,...kt(i)});class Id extends Ot{_parse(u){if(this._getType(u)!==Ae.undefined){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.undefined,received:p.parsedType}),wt}return qr(u.data)}}Id.create=i=>new Id({typeName:vt.ZodUndefined,...kt(i)});class $d extends Ot{_parse(u){if(this._getType(u)!==Ae.null){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.null,received:p.parsedType}),wt}return qr(u.data)}}$d.create=i=>new $d({typeName:vt.ZodNull,...kt(i)});class Oc extends Ot{constructor(){super(...arguments),this._any=!0}_parse(u){return qr(u.data)}}Oc.create=i=>new Oc({typeName:vt.ZodAny,...kt(i)});class ds extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(u){return qr(u.data)}}ds.create=i=>new ds({typeName:vt.ZodUnknown,...kt(i)});class rl extends Ot{_parse(u){const c=this._getOrReturnCtx(u);return Ye(c,{code:we.invalid_type,expected:Ae.never,received:c.parsedType}),wt}}rl.create=i=>new rl({typeName:vt.ZodNever,...kt(i)});class Fh extends Ot{_parse(u){if(this._getType(u)!==Ae.undefined){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.void,received:p.parsedType}),wt}return qr(u.data)}}Fh.create=i=>new Fh({typeName:vt.ZodVoid,...kt(i)});class zi extends Ot{_parse(u){const{ctx:c,status:p}=this._processInputParams(u),v=this._def;if(c.parsedType!==Ae.array)return Ye(c,{code:we.invalid_type,expected:Ae.array,received:c.parsedType}),wt;if(v.exactLength!==null){const m=c.data.length>v.exactLength.value,x=c.data.length<v.exactLength.value;(m||x)&&(Ye(c,{code:m?we.too_big:we.too_small,minimum:x?v.exactLength.value:void 0,maximum:m?v.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:v.exactLength.message}),p.dirty())}if(v.minLength!==null&&c.data.length<v.minLength.value&&(Ye(c,{code:we.too_small,minimum:v.minLength.value,type:"array",inclusive:!0,exact:!1,message:v.minLength.message}),p.dirty()),v.maxLength!==null&&c.data.length>v.maxLength.value&&(Ye(c,{code:we.too_big,maximum:v.maxLength.value,type:"array",inclusive:!0,exact:!1,message:v.maxLength.message}),p.dirty()),c.common.async)return Promise.all([...c.data].map((m,x)=>v.type._parseAsync(new vo(c,m,c.path,x)))).then(m=>ma.mergeArray(p,m));const g=[...c.data].map((m,x)=>v.type._parseSync(new vo(c,m,c.path,x)));return ma.mergeArray(p,g)}get element(){return this._def.type}min(u,c){return new zi({...this._def,minLength:{value:u,message:Ut.toString(c)}})}max(u,c){return new zi({...this._def,maxLength:{value:u,message:Ut.toString(c)}})}length(u,c){return new zi({...this._def,exactLength:{value:u,message:Ut.toString(c)}})}nonempty(u){return this.min(1,u)}}zi.create=(i,u)=>new zi({type:i,minLength:null,maxLength:null,exactLength:null,typeName:vt.ZodArray,...kt(u)});var Vh;(function(i){i.mergeShapes=(u,c)=>({...u,...c})})(Vh||(Vh={}));function Mc(i){if(i instanceof Ln){const u={};for(const c in i.shape){const p=i.shape[c];u[c]=al.create(Mc(p))}return new Ln({...i._def,shape:()=>u})}else return i instanceof zi?zi.create(Mc(i.element)):i instanceof al?al.create(Mc(i.unwrap())):i instanceof vs?vs.create(Mc(i.unwrap())):i instanceof ho?ho.create(i.items.map(u=>Mc(u))):i}class Ln extends Ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const u=this._def.shape(),c=Jt.objectKeys(u);return this._cached={shape:u,keys:c}}_parse(u){if(this._getType(u)!==Ae.object){const T=this._getOrReturnCtx(u);return Ye(T,{code:we.invalid_type,expected:Ae.object,received:T.parsedType}),wt}const{status:p,ctx:v}=this._processInputParams(u),{shape:g,keys:m}=this._getCached(),x=[];if(!(this._def.catchall instanceof rl&&this._def.unknownKeys==="strip"))for(const T in v.data)m.includes(T)||x.push(T);const E=[];for(const T of m){const M=g[T],D=v.data[T];E.push({key:{status:"valid",value:T},value:M._parse(new vo(v,D,v.path,T)),alwaysSet:T in v.data})}if(this._def.catchall instanceof rl){const T=this._def.unknownKeys;if(T==="passthrough")for(const M of x)E.push({key:{status:"valid",value:M},value:{status:"valid",value:v.data[M]}});else if(T==="strict")x.length>0&&(Ye(v,{code:we.unrecognized_keys,keys:x}),p.dirty());else if(T!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const T=this._def.catchall;for(const M of x){const D=v.data[M];E.push({key:{status:"valid",value:M},value:T._parse(new vo(v,D,v.path,M)),alwaysSet:M in v.data})}}return v.common.async?Promise.resolve().then(async()=>{const T=[];for(const M of E){const D=await M.key;T.push({key:D,value:await M.value,alwaysSet:M.alwaysSet})}return T}).then(T=>ma.mergeObjectSync(p,T)):ma.mergeObjectSync(p,E)}get shape(){return this._def.shape()}strict(u){return Ut.errToObj,new Ln({...this._def,unknownKeys:"strict",...u!==void 0?{errorMap:(c,p)=>{var v,g,m,x;const E=(m=(g=(v=this._def).errorMap)===null||g===void 0?void 0:g.call(v,c,p).message)!==null&&m!==void 0?m:p.defaultError;return c.code==="unrecognized_keys"?{message:(x=Ut.errToObj(u).message)!==null&&x!==void 0?x:E}:{message:E}}}:{}})}strip(){return new Ln({...this._def,unknownKeys:"strip"})}passthrough(){return new Ln({...this._def,unknownKeys:"passthrough"})}extend(u){return new Ln({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new Ln({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>Vh.mergeShapes(this._def.shape(),u._def.shape()),typeName:vt.ZodObject})}setKey(u,c){return this.augment({[u]:c})}catchall(u){return new Ln({...this._def,catchall:u})}pick(u){const c={};return Jt.objectKeys(u).forEach(p=>{u[p]&&this.shape[p]&&(c[p]=this.shape[p])}),new Ln({...this._def,shape:()=>c})}omit(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{u[p]||(c[p]=this.shape[p])}),new Ln({...this._def,shape:()=>c})}deepPartial(){return Mc(this)}partial(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{const v=this.shape[p];u&&!u[p]?c[p]=v:c[p]=v.optional()}),new Ln({...this._def,shape:()=>c})}required(u){const c={};return Jt.objectKeys(this.shape).forEach(p=>{if(u&&!u[p])c[p]=this.shape[p];else{let g=this.shape[p];for(;g instanceof al;)g=g._def.innerType;c[p]=g}}),new Ln({...this._def,shape:()=>c})}keyof(){return gw(Jt.objectKeys(this.shape))}}Ln.create=(i,u)=>new Ln({shape:()=>i,unknownKeys:"strip",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)}),Ln.strictCreate=(i,u)=>new Ln({shape:()=>i,unknownKeys:"strict",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)}),Ln.lazycreate=(i,u)=>new Ln({shape:i,unknownKeys:"strip",catchall:rl.create(),typeName:vt.ZodObject,...kt(u)});class Wd extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=this._def.options;function v(g){for(const x of g)if(x.result.status==="valid")return x.result;for(const x of g)if(x.result.status==="dirty")return c.common.issues.push(...x.ctx.common.issues),x.result;const m=g.map(x=>new tl(x.ctx.common.issues));return Ye(c,{code:we.invalid_union,unionErrors:m}),wt}if(c.common.async)return Promise.all(p.map(async g=>{const m={...c,common:{...c.common,issues:[]},parent:null};return{result:await g._parseAsync({data:c.data,path:c.path,parent:m}),ctx:m}})).then(v);{let g;const m=[];for(const E of p){const T={...c,common:{...c.common,issues:[]},parent:null},M=E._parseSync({data:c.data,path:c.path,parent:T});if(M.status==="valid")return M;M.status==="dirty"&&!g&&(g={result:M,ctx:T}),T.common.issues.length&&m.push(T.common.issues)}if(g)return c.common.issues.push(...g.ctx.common.issues),g.result;const x=m.map(E=>new tl(E));return Ye(c,{code:we.invalid_union,unionErrors:x}),wt}}get options(){return this._def.options}}Wd.create=(i,u)=>new Wd({options:i,typeName:vt.ZodUnion,...kt(u)});const Hh=i=>i instanceof Gd?Hh(i.schema):i instanceof Ui?Hh(i.innerType()):i instanceof Qd?[i.value]:i instanceof ru?i.options:i instanceof Xd?Object.keys(i.enum):i instanceof Kd?Hh(i._def.innerType):i instanceof Id?[void 0]:i instanceof $d?[null]:null;class Ph extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.object)return Ye(c,{code:we.invalid_type,expected:Ae.object,received:c.parsedType}),wt;const p=this.discriminator,v=c.data[p],g=this.optionsMap.get(v);return g?c.common.async?g._parseAsync({data:c.data,path:c.path,parent:c}):g._parseSync({data:c.data,path:c.path,parent:c}):(Ye(c,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[p]}),wt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,c,p){const v=new Map;for(const g of c){const m=Hh(g.shape[u]);if(!m)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const x of m){if(v.has(x))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(x)}`);v.set(x,g)}}return new Ph({typeName:vt.ZodDiscriminatedUnion,discriminator:u,options:c,optionsMap:v,...kt(p)})}}function M0(i,u){const c=tu(i),p=tu(u);if(i===u)return{valid:!0,data:i};if(c===Ae.object&&p===Ae.object){const v=Jt.objectKeys(u),g=Jt.objectKeys(i).filter(x=>v.indexOf(x)!==-1),m={...i,...u};for(const x of g){const E=M0(i[x],u[x]);if(!E.valid)return{valid:!1};m[x]=E.data}return{valid:!0,data:m}}else if(c===Ae.array&&p===Ae.array){if(i.length!==u.length)return{valid:!1};const v=[];for(let g=0;g<i.length;g++){const m=i[g],x=u[g],E=M0(m,x);if(!E.valid)return{valid:!1};v.push(E.data)}return{valid:!0,data:v}}else return c===Ae.date&&p===Ae.date&&+i==+u?{valid:!0,data:i}:{valid:!1}}class Yd extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u),v=(g,m)=>{if(D0(g)||D0(m))return wt;const x=M0(g.value,m.value);return x.valid?((O0(g)||O0(m))&&c.dirty(),{status:c.value,value:x.data}):(Ye(p,{code:we.invalid_intersection_types}),wt)};return p.common.async?Promise.all([this._def.left._parseAsync({data:p.data,path:p.path,parent:p}),this._def.right._parseAsync({data:p.data,path:p.path,parent:p})]).then(([g,m])=>v(g,m)):v(this._def.left._parseSync({data:p.data,path:p.path,parent:p}),this._def.right._parseSync({data:p.data,path:p.path,parent:p}))}}Yd.create=(i,u,c)=>new Yd({left:i,right:u,typeName:vt.ZodIntersection,...kt(c)});class ho extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.array)return Ye(p,{code:we.invalid_type,expected:Ae.array,received:p.parsedType}),wt;if(p.data.length<this._def.items.length)return Ye(p,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wt;!this._def.rest&&p.data.length>this._def.items.length&&(Ye(p,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),c.dirty());const g=[...p.data].map((m,x)=>{const E=this._def.items[x]||this._def.rest;return E?E._parse(new vo(p,m,p.path,x)):null}).filter(m=>!!m);return p.common.async?Promise.all(g).then(m=>ma.mergeArray(c,m)):ma.mergeArray(c,g)}get items(){return this._def.items}rest(u){return new ho({...this._def,rest:u})}}ho.create=(i,u)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ho({items:i,typeName:vt.ZodTuple,rest:null,...kt(u)})};class Zd extends Ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.object)return Ye(p,{code:we.invalid_type,expected:Ae.object,received:p.parsedType}),wt;const v=[],g=this._def.keyType,m=this._def.valueType;for(const x in p.data)v.push({key:g._parse(new vo(p,x,p.path,x)),value:m._parse(new vo(p,p.data[x],p.path,x))});return p.common.async?ma.mergeObjectAsync(c,v):ma.mergeObjectSync(c,v)}get element(){return this._def.valueType}static create(u,c,p){return c instanceof Ot?new Zd({keyType:u,valueType:c,typeName:vt.ZodRecord,...kt(p)}):new Zd({keyType:nl.create(),valueType:u,typeName:vt.ZodRecord,...kt(c)})}}class Bh extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.map)return Ye(p,{code:we.invalid_type,expected:Ae.map,received:p.parsedType}),wt;const v=this._def.keyType,g=this._def.valueType,m=[...p.data.entries()].map(([x,E],T)=>({key:v._parse(new vo(p,x,p.path,[T,"key"])),value:g._parse(new vo(p,E,p.path,[T,"value"]))}));if(p.common.async){const x=new Map;return Promise.resolve().then(async()=>{for(const E of m){const T=await E.key,M=await E.value;if(T.status==="aborted"||M.status==="aborted")return wt;(T.status==="dirty"||M.status==="dirty")&&c.dirty(),x.set(T.value,M.value)}return{status:c.value,value:x}})}else{const x=new Map;for(const E of m){const T=E.key,M=E.value;if(T.status==="aborted"||M.status==="aborted")return wt;(T.status==="dirty"||M.status==="dirty")&&c.dirty(),x.set(T.value,M.value)}return{status:c.value,value:x}}}}Bh.create=(i,u,c)=>new Bh({valueType:u,keyType:i,typeName:vt.ZodMap,...kt(c)});class ps extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.parsedType!==Ae.set)return Ye(p,{code:we.invalid_type,expected:Ae.set,received:p.parsedType}),wt;const v=this._def;v.minSize!==null&&p.data.size<v.minSize.value&&(Ye(p,{code:we.too_small,minimum:v.minSize.value,type:"set",inclusive:!0,exact:!1,message:v.minSize.message}),c.dirty()),v.maxSize!==null&&p.data.size>v.maxSize.value&&(Ye(p,{code:we.too_big,maximum:v.maxSize.value,type:"set",inclusive:!0,exact:!1,message:v.maxSize.message}),c.dirty());const g=this._def.valueType;function m(E){const T=new Set;for(const M of E){if(M.status==="aborted")return wt;M.status==="dirty"&&c.dirty(),T.add(M.value)}return{status:c.value,value:T}}const x=[...p.data.values()].map((E,T)=>g._parse(new vo(p,E,p.path,T)));return p.common.async?Promise.all(x).then(E=>m(E)):m(x)}min(u,c){return new ps({...this._def,minSize:{value:u,message:Ut.toString(c)}})}max(u,c){return new ps({...this._def,maxSize:{value:u,message:Ut.toString(c)}})}size(u,c){return this.min(u,c).max(u,c)}nonempty(u){return this.min(1,u)}}ps.create=(i,u)=>new ps({valueType:i,minSize:null,maxSize:null,typeName:vt.ZodSet,...kt(u)});class Nc extends Ot{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.function)return Ye(c,{code:we.invalid_type,expected:Ae.function,received:c.parsedType}),wt;function p(x,E){return Lh({data:x,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Ah(),Hd].filter(T=>!!T),issueData:{code:we.invalid_arguments,argumentsError:E}})}function v(x,E){return Lh({data:x,path:c.path,errorMaps:[c.common.contextualErrorMap,c.schemaErrorMap,Ah(),Hd].filter(T=>!!T),issueData:{code:we.invalid_return_type,returnTypeError:E}})}const g={errorMap:c.common.contextualErrorMap},m=c.data;return this._def.returns instanceof Ac?qr(async(...x)=>{const E=new tl([]),T=await this._def.args.parseAsync(x,g).catch(j=>{throw E.addIssue(p(x,j)),E}),M=await m(...T);return await this._def.returns._def.type.parseAsync(M,g).catch(j=>{throw E.addIssue(v(M,j)),E})}):qr((...x)=>{const E=this._def.args.safeParse(x,g);if(!E.success)throw new tl([p(x,E.error)]);const T=m(...E.data),M=this._def.returns.safeParse(T,g);if(!M.success)throw new tl([v(T,M.error)]);return M.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new Nc({...this._def,args:ho.create(u).rest(ds.create())})}returns(u){return new Nc({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,c,p){return new Nc({args:u||ho.create([]).rest(ds.create()),returns:c||ds.create(),typeName:vt.ZodFunction,...kt(p)})}}class Gd extends Ot{get schema(){return this._def.getter()}_parse(u){const{ctx:c}=this._processInputParams(u);return this._def.getter()._parse({data:c.data,path:c.path,parent:c})}}Gd.create=(i,u)=>new Gd({getter:i,typeName:vt.ZodLazy,...kt(u)});class Qd extends Ot{_parse(u){if(u.data!==this._def.value){const c=this._getOrReturnCtx(u);return Ye(c,{received:c.data,code:we.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:u.data}}get value(){return this._def.value}}Qd.create=(i,u)=>new Qd({value:i,typeName:vt.ZodLiteral,...kt(u)});function gw(i,u){return new ru({values:i,typeName:vt.ZodEnum,...kt(u)})}class ru extends Ot{_parse(u){if(typeof u.data!="string"){const c=this._getOrReturnCtx(u),p=this._def.values;return Ye(c,{expected:Jt.joinValues(p),received:c.parsedType,code:we.invalid_type}),wt}if(this._def.values.indexOf(u.data)===-1){const c=this._getOrReturnCtx(u),p=this._def.values;return Ye(c,{received:c.data,code:we.invalid_enum_value,options:p}),wt}return qr(u.data)}get options(){return this._def.values}get enum(){const u={};for(const c of this._def.values)u[c]=c;return u}get Values(){const u={};for(const c of this._def.values)u[c]=c;return u}get Enum(){const u={};for(const c of this._def.values)u[c]=c;return u}extract(u){return ru.create(u)}exclude(u){return ru.create(this.options.filter(c=>!u.includes(c)))}}ru.create=gw;class Xd extends Ot{_parse(u){const c=Jt.getValidEnumValues(this._def.values),p=this._getOrReturnCtx(u);if(p.parsedType!==Ae.string&&p.parsedType!==Ae.number){const v=Jt.objectValues(c);return Ye(p,{expected:Jt.joinValues(v),received:p.parsedType,code:we.invalid_type}),wt}if(c.indexOf(u.data)===-1){const v=Jt.objectValues(c);return Ye(p,{received:p.data,code:we.invalid_enum_value,options:v}),wt}return qr(u.data)}get enum(){return this._def.values}}Xd.create=(i,u)=>new Xd({values:i,typeName:vt.ZodNativeEnum,...kt(u)});class Ac extends Ot{unwrap(){return this._def.type}_parse(u){const{ctx:c}=this._processInputParams(u);if(c.parsedType!==Ae.promise&&c.common.async===!1)return Ye(c,{code:we.invalid_type,expected:Ae.promise,received:c.parsedType}),wt;const p=c.parsedType===Ae.promise?c.data:Promise.resolve(c.data);return qr(p.then(v=>this._def.type.parseAsync(v,{path:c.path,errorMap:c.common.contextualErrorMap})))}}Ac.create=(i,u)=>new Ac({type:i,typeName:vt.ZodPromise,...kt(u)});class Ui extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===vt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:c,ctx:p}=this._processInputParams(u),v=this._def.effect||null;if(v.type==="preprocess"){const m=v.transform(p.data);return p.common.async?Promise.resolve(m).then(x=>this._def.schema._parseAsync({data:x,path:p.path,parent:p})):this._def.schema._parseSync({data:m,path:p.path,parent:p})}const g={addIssue:m=>{Ye(p,m),m.fatal?c.abort():c.dirty()},get path(){return p.path}};if(g.addIssue=g.addIssue.bind(g),v.type==="refinement"){const m=x=>{const E=v.refinement(x,g);if(p.common.async)return Promise.resolve(E);if(E instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return x};if(p.common.async===!1){const x=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});return x.status==="aborted"?wt:(x.status==="dirty"&&c.dirty(),m(x.value),{status:c.value,value:x.value})}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(x=>x.status==="aborted"?wt:(x.status==="dirty"&&c.dirty(),m(x.value).then(()=>({status:c.value,value:x.value}))))}if(v.type==="transform")if(p.common.async===!1){const m=this._def.schema._parseSync({data:p.data,path:p.path,parent:p});if(!zh(m))return m;const x=v.transform(m.value,g);if(x instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:c.value,value:x}}else return this._def.schema._parseAsync({data:p.data,path:p.path,parent:p}).then(m=>zh(m)?Promise.resolve(v.transform(m.value,g)).then(x=>({status:c.value,value:x})):m);Jt.assertNever(v)}}Ui.create=(i,u,c)=>new Ui({schema:i,typeName:vt.ZodEffects,effect:u,...kt(c)}),Ui.createWithPreprocess=(i,u,c)=>new Ui({schema:u,effect:{type:"preprocess",transform:i},typeName:vt.ZodEffects,...kt(c)});class al extends Ot{_parse(u){return this._getType(u)===Ae.undefined?qr(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}al.create=(i,u)=>new al({innerType:i,typeName:vt.ZodOptional,...kt(u)});class vs extends Ot{_parse(u){return this._getType(u)===Ae.null?qr(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}vs.create=(i,u)=>new vs({innerType:i,typeName:vt.ZodNullable,...kt(u)});class Kd extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u);let p=c.data;return c.parsedType===Ae.undefined&&(p=this._def.defaultValue()),this._def.innerType._parse({data:p,path:c.path,parent:c})}removeDefault(){return this._def.innerType}}Kd.create=(i,u)=>new Kd({innerType:i,typeName:vt.ZodDefault,defaultValue:typeof u.default=="function"?u.default:()=>u.default,...kt(u)});class Ih extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=this._def.innerType._parse({data:c.data,path:c.path,parent:{...c,common:{...c.common,issues:[]}}});return Uh(p)?p.then(v=>({status:"valid",value:v.status==="valid"?v.value:this._def.catchValue()})):{status:"valid",value:p.status==="valid"?p.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}}Ih.create=(i,u)=>new Ih({innerType:i,typeName:vt.ZodCatch,catchValue:typeof u.catch=="function"?u.catch:()=>u.catch,...kt(u)});class $h extends Ot{_parse(u){if(this._getType(u)!==Ae.nan){const p=this._getOrReturnCtx(u);return Ye(p,{code:we.invalid_type,expected:Ae.nan,received:p.parsedType}),wt}return{status:"valid",value:u.data}}}$h.create=i=>new $h({typeName:vt.ZodNaN,...kt(i)});const HR=Symbol("zod_brand");class bw extends Ot{_parse(u){const{ctx:c}=this._processInputParams(u),p=c.data;return this._def.type._parse({data:p,path:c.path,parent:c})}unwrap(){return this._def.type}}class Jd extends Ot{_parse(u){const{status:c,ctx:p}=this._processInputParams(u);if(p.common.async)return(async()=>{const g=await this._def.in._parseAsync({data:p.data,path:p.path,parent:p});return g.status==="aborted"?wt:g.status==="dirty"?(c.dirty(),mw(g.value)):this._def.out._parseAsync({data:g.value,path:p.path,parent:p})})();{const v=this._def.in._parseSync({data:p.data,path:p.path,parent:p});return v.status==="aborted"?wt:v.status==="dirty"?(c.dirty(),{status:"dirty",value:v.value}):this._def.out._parseSync({data:v.value,path:p.path,parent:p})}}static create(u,c){return new Jd({in:u,out:c,typeName:vt.ZodPipeline})}}const Sw=(i,u={},c)=>i?Oc.create().superRefine((p,v)=>{if(!i(p)){const g=typeof u=="function"?u(p):u,m=typeof g=="string"?{message:g}:g;v.addIssue({code:"custom",...m,fatal:c})}}):Oc.create(),PR={object:Ln.lazycreate};var vt;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline"})(vt||(vt={}));const BR=(i,u={message:`Input not instance of ${i.name}`})=>Sw(c=>c instanceof i,u,!0),xw=nl.create,ww=nu.create,IR=$h.create,$R=Pd.create,Cw=Bd.create,WR=fs.create,YR=jh.create,ZR=Id.create,GR=$d.create,QR=Oc.create,XR=ds.create,KR=rl.create,JR=Fh.create,qR=zi.create,eD=Ln.create,tD=Ln.strictCreate,nD=Wd.create,rD=Ph.create,aD=Yd.create,iD=ho.create,oD=Zd.create,lD=Bh.create,uD=ps.create,sD=Nc.create,cD=Gd.create,fD=Qd.create,dD=ru.create,pD=Xd.create,vD=Ac.create,Ew=Ui.create,hD=al.create,mD=vs.create,yD=Ui.createWithPreprocess,gD=Jd.create;var jt=Object.freeze({__proto__:null,defaultErrorMap:Hd,setErrorMap:NR,getErrorMap:Ah,makeIssue:Lh,EMPTY_PATH:AR,addIssueToContext:Ye,ParseStatus:ma,INVALID:wt,DIRTY:mw,OK:qr,isAborted:D0,isDirty:O0,isValid:zh,isAsync:Uh,get util(){return Jt},ZodParsedType:Ae,getParsedType:tu,ZodType:Ot,ZodString:nl,ZodNumber:nu,ZodBigInt:Pd,ZodBoolean:Bd,ZodDate:fs,ZodSymbol:jh,ZodUndefined:Id,ZodNull:$d,ZodAny:Oc,ZodUnknown:ds,ZodNever:rl,ZodVoid:Fh,ZodArray:zi,get objectUtil(){return Vh},ZodObject:Ln,ZodUnion:Wd,ZodDiscriminatedUnion:Ph,ZodIntersection:Yd,ZodTuple:ho,ZodRecord:Zd,ZodMap:Bh,ZodSet:ps,ZodFunction:Nc,ZodLazy:Gd,ZodLiteral:Qd,ZodEnum:ru,ZodNativeEnum:Xd,ZodPromise:Ac,ZodEffects:Ui,ZodTransformer:Ui,ZodOptional:al,ZodNullable:vs,ZodDefault:Kd,ZodCatch:Ih,ZodNaN:$h,BRAND:HR,ZodBranded:bw,ZodPipeline:Jd,custom:Sw,Schema:Ot,ZodSchema:Ot,late:PR,get ZodFirstPartyTypeKind(){return vt},coerce:{string:i=>nl.create({...i,coerce:!0}),number:i=>nu.create({...i,coerce:!0}),boolean:i=>Bd.create({...i,coerce:!0}),bigint:i=>Pd.create({...i,coerce:!0}),date:i=>fs.create({...i,coerce:!0})},any:QR,array:qR,bigint:$R,boolean:Cw,date:WR,discriminatedUnion:rD,effect:Ew,enum:dD,function:sD,instanceof:BR,intersection:aD,lazy:cD,literal:fD,map:lD,nan:IR,nativeEnum:pD,never:KR,null:GR,nullable:mD,number:ww,object:eD,oboolean:()=>Cw().optional(),onumber:()=>ww().optional(),optional:hD,ostring:()=>xw().optional(),pipeline:gD,preprocess:yD,promise:vD,record:oD,set:uD,strictObject:tD,string:xw,symbol:YR,transformer:Ew,tuple:iD,undefined:ZR,union:nD,unknown:XR,void:JR,NEVER:wt,ZodIssueCode:we,quotelessJson:MR,ZodError:tl});const bD=jt.union([jt.string(),jt.number(),jt.date()]).transform(i=>typeof i=="object"&&typeof i.getMonth=="function"?i.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric"}):i.toString());jt.string().url(),jt.any();const SD=jt.any();jt.object({children:SD}),jt.object({id:jt.string().optional(),className:jt.string().optional(),ariaLabel:jt.string().optional(),dataAttb:jt.record(jt.string(),jt.string()).optional()});const N0=jt.lazy(()=>jt.object({key:jt.number().optional(),type:jt.any(),theme:jt.string().or(jt.record(jt.string(),jt.string())).optional(),bind:jt.string().optional(),label:jt.string().optional(),items:jt.any().array()}));jt.object({header:jt.array(N0),main:jt.array(N0),footer:jt.array(N0)}),jt.object({banner:jt.string().optional(),bannerColor:jt.string().optional(),colorPrimary:jt.string().optional(),colorAccent:jt.string().optional(),fontTitle:jt.string().optional(),fontText:jt.string().optional()});var qd=i=>i.type==="checkbox",Lc=i=>i instanceof Date,ya=i=>i==null;const Tw=i=>typeof i=="object";var vr=i=>!ya(i)&&!Array.isArray(i)&&Tw(i)&&!Lc(i),kw=i=>vr(i)&&i.target?qd(i.target)?i.target.checked:i.target.value:i,xD=i=>i.substring(0,i.search(/\.\d+(\.|$)/))||i,_w=(i,u)=>i.has(xD(u)),ep=i=>Array.isArray(i)?i.filter(Boolean):[],tr=i=>i===void 0,Le=(i,u,c)=>{if(!u||!vr(i))return c;const p=ep(u.split(/[,[\].]+?/)).reduce((v,g)=>ya(v)?v:v[g],i);return tr(p)||p===i?tr(i[u])?c:i[u]:p};const Wh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ji={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},il={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},wD=B.createContext(null),A0=()=>B.useContext(wD);var Rw=(i,u,c,p=!0)=>{const v={defaultValues:u._defaultValues};for(const g in i)Object.defineProperty(v,g,{get:()=>{const m=g;return u._proxyFormState[m]!==ji.all&&(u._proxyFormState[m]=!p||ji.all),c&&(c[m]=!0),i[m]}});return v},mi=i=>vr(i)&&!Object.keys(i).length,Dw=(i,u,c,p)=>{c(i);const{name:v,...g}=i;return mi(g)||Object.keys(g).length>=Object.keys(u).length||Object.keys(g).find(m=>u[m]===(!p||ji.all))},Yh=i=>Array.isArray(i)?i:[i],Ow=(i,u,c)=>c&&u?i===u:!i||!u||i===u||Yh(i).some(p=>p&&(p.startsWith(u)||u.startsWith(p)));function L0(i){const u=B.useRef(i);u.current=i,B.useEffect(()=>{const c=!i.disabled&&u.current.subject.subscribe({next:u.current.next});return()=>{c&&c.unsubscribe()}},[i.disabled])}function CD(i){const u=A0(),{control:c=u.control,disabled:p,name:v,exact:g}=i||{},[m,x]=B.useState(c._formState),E=B.useRef(!0),T=B.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),M=B.useRef(v);return M.current=v,L0({disabled:p,next:D=>E.current&&Ow(M.current,D.name,g)&&Dw(D,T.current,c._updateFormState)&&x({...c._formState,...D}),subject:c._subjects.state}),B.useEffect(()=>{E.current=!0;const D=c._proxyFormState.isDirty&&c._getDirty();return D!==c._formState.isDirty&&c._subjects.state.next({isDirty:D}),T.current.isValid&&c._updateValid(!0),()=>{E.current=!1}},[c]),Rw(m,c,T.current,!1)}var mo=i=>typeof i=="string",Mw=(i,u,c,p,v)=>mo(i)?(p&&u.watch.add(i),Le(c,i,v)):Array.isArray(i)?i.map(g=>(p&&u.watch.add(g),Le(c,g))):(p&&(u.watchAll=!0),c),ED=i=>{const u=i.constructor&&i.constructor.prototype;return vr(u)&&u.hasOwnProperty("isPrototypeOf")},z0=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function au(i){let u;const c=Array.isArray(i);if(i instanceof Date)u=new Date(i);else if(i instanceof Set)u=new Set(i);else if(!(z0&&(i instanceof Blob||i instanceof FileList))&&(c||vr(i)))if(u=c?[]:{},!Array.isArray(i)&&!ED(i))u=i;else for(const p in i)u[p]=au(i[p]);else return i;return u}function TD(i){const u=A0(),{control:c=u.control,name:p,defaultValue:v,disabled:g,exact:m}=i||{},x=B.useRef(p);x.current=p,L0({disabled:g,subject:c._subjects.watch,next:M=>{Ow(x.current,M.name,m)&&T(au(Mw(x.current,c._names,M.values||c._formValues,!1,v)))}});const[E,T]=B.useState(c._getWatch(p,v));return B.useEffect(()=>c._removeUnmounted()),E}function U0(i){const u=A0(),{name:c,control:p=u.control,shouldUnregister:v}=i,g=_w(p._names.array,c),m=TD({control:p,name:c,defaultValue:Le(p._formValues,c,Le(p._defaultValues,c,i.defaultValue)),exact:!0}),x=CD({control:p,name:c}),E=B.useRef(p.register(c,{...i.rules,value:m}));return B.useEffect(()=>{const T=(M,D)=>{const j=Le(p._fields,M);j&&(j._f.mount=D)};return T(c,!0),()=>{const M=p._options.shouldUnregister||v;(g?M&&!p._stateFlags.action:M)?p.unregister(c):T(c,!1)}},[c,p,g,v]),{field:{name:c,value:m,onChange:B.useCallback(T=>E.current.onChange({target:{value:kw(T),name:c},type:Wh.CHANGE}),[c]),onBlur:B.useCallback(()=>E.current.onBlur({target:{value:Le(p._formValues,c),name:c},type:Wh.BLUR}),[c,p]),ref:T=>{const M=Le(p._fields,c);M&&T&&(M._f.ref={focus:()=>T.focus(),select:()=>T.select(),setCustomValidity:D=>T.setCustomValidity(D),reportValidity:()=>T.reportValidity()})}},formState:x,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Le(x.errors,c)},isDirty:{enumerable:!0,get:()=>!!Le(x.dirtyFields,c)},isTouched:{enumerable:!0,get:()=>!!Le(x.touchedFields,c)},error:{enumerable:!0,get:()=>Le(x.errors,c)}})}}var kD=(i,u,c,p,v)=>u?{...c[i],types:{...c[i]&&c[i].types?c[i].types:{},[p]:v||!0}}:{},j0=i=>/^\w*$/.test(i),Nw=i=>ep(i.replace(/["|']|\]/g,"").split(/\.|\[/));function Dn(i,u,c){let p=-1;const v=j0(u)?[u]:Nw(u),g=v.length,m=g-1;for(;++p<g;){const x=v[p];let E=c;if(p!==m){const T=i[x];E=vr(T)||Array.isArray(T)?T:isNaN(+v[p+1])?{}:[]}i[x]=E,i=i[x]}return i}const F0=(i,u,c)=>{for(const p of c||Object.keys(i)){const v=Le(i,p);if(v){const{_f:g,...m}=v;if(g&&u(g.name)){if(g.ref.focus){g.ref.focus();break}else if(g.refs&&g.refs[0].focus){g.refs[0].focus();break}}else vr(m)&&F0(m,u)}}};var Aw=i=>({isOnSubmit:!i||i===ji.onSubmit,isOnBlur:i===ji.onBlur,isOnChange:i===ji.onChange,isOnAll:i===ji.all,isOnTouch:i===ji.onTouched}),Lw=(i,u,c)=>!c&&(u.watchAll||u.watch.has(i)||[...u.watch].some(p=>i.startsWith(p)&&/^\.\w+/.test(i.slice(p.length)))),_D=(i,u,c)=>{const p=ep(Le(i,c));return Dn(p,"root",u[c]),Dn(i,c,p),i},zc=i=>typeof i=="boolean",V0=i=>i.type==="file",Uc=i=>typeof i=="function",Zh=i=>{if(!z0)return!1;const u=i?i.ownerDocument:0;return i instanceof(u&&u.defaultView?u.defaultView.HTMLElement:HTMLElement)},Gh=i=>mo(i)||B.isValidElement(i),H0=i=>i.type==="radio",Qh=i=>i instanceof RegExp;const zw={value:!1,isValid:!1},Uw={value:!0,isValid:!0};var jw=i=>{if(Array.isArray(i)){if(i.length>1){const u=i.filter(c=>c&&c.checked&&!c.disabled).map(c=>c.value);return{value:u,isValid:!!u.length}}return i[0].checked&&!i[0].disabled?i[0].attributes&&!tr(i[0].attributes.value)?tr(i[0].value)||i[0].value===""?Uw:{value:i[0].value,isValid:!0}:Uw:zw}return zw};const Fw={isValid:!1,value:null};var Vw=i=>Array.isArray(i)?i.reduce((u,c)=>c&&c.checked&&!c.disabled?{isValid:!0,value:c.value}:u,Fw):Fw;function Hw(i,u,c="validate"){if(Gh(i)||Array.isArray(i)&&i.every(Gh)||zc(i)&&!i)return{type:c,message:Gh(i)?i:"",ref:u}}var jc=i=>vr(i)&&!Qh(i)?i:{value:i,message:""},Pw=async(i,u,c,p,v)=>{const{ref:g,refs:m,required:x,maxLength:E,minLength:T,min:M,max:D,pattern:j,validate:F,name:K,valueAsNumber:ce,mount:ve,disabled:Qe}=i._f,J=Le(u,K);if(!ve||Qe)return{};const de=m?m[0]:g,Se=$e=>{p&&de.reportValidity&&(de.setCustomValidity(zc($e)?"":$e||""),de.reportValidity())},ze={},yt=H0(g),He=qd(g),Xe=yt||He,lt=(ce||V0(g))&&tr(g.value)&&tr(J)||Zh(g)&&g.value===""||J===""||Array.isArray(J)&&!J.length,ut=kD.bind(null,K,c,ze),pt=($e,fe,he,Ke=il.maxLength,Ze=il.minLength)=>{const Dt=$e?fe:he;ze[K]={type:$e?Ke:Ze,message:Dt,ref:g,...ut($e?Ke:Ze,Dt)}};if(v?!Array.isArray(J)||!J.length:x&&(!Xe&&(lt||ya(J))||zc(J)&&!J||He&&!jw(m).isValid||yt&&!Vw(m).isValid)){const{value:$e,message:fe}=Gh(x)?{value:!!x,message:x}:jc(x);if($e&&(ze[K]={type:il.required,message:fe,ref:de,...ut(il.required,fe)},!c))return Se(fe),ze}if(!lt&&(!ya(M)||!ya(D))){let $e,fe;const he=jc(D),Ke=jc(M);if(!ya(J)&&!isNaN(J)){const Ze=g.valueAsNumber||J&&+J;ya(he.value)||($e=Ze>he.value),ya(Ke.value)||(fe=Ze<Ke.value)}else{const Ze=g.valueAsDate||new Date(J),Dt=ee=>new Date(new Date().toDateString()+" "+ee),ae=g.type=="time",ne=g.type=="week";mo(he.value)&&J&&($e=ae?Dt(J)>Dt(he.value):ne?J>he.value:Ze>new Date(he.value)),mo(Ke.value)&&J&&(fe=ae?Dt(J)<Dt(Ke.value):ne?J<Ke.value:Ze<new Date(Ke.value))}if(($e||fe)&&(pt(!!$e,he.message,Ke.message,il.max,il.min),!c))return Se(ze[K].message),ze}if((E||T)&&!lt&&(mo(J)||v&&Array.isArray(J))){const $e=jc(E),fe=jc(T),he=!ya($e.value)&&J.length>$e.value,Ke=!ya(fe.value)&&J.length<fe.value;if((he||Ke)&&(pt(he,$e.message,fe.message),!c))return Se(ze[K].message),ze}if(j&&!lt&&mo(J)){const{value:$e,message:fe}=jc(j);if(Qh($e)&&!J.match($e)&&(ze[K]={type:il.pattern,message:fe,ref:g,...ut(il.pattern,fe)},!c))return Se(fe),ze}if(F){if(Uc(F)){const $e=await F(J,u),fe=Hw($e,de);if(fe&&(ze[K]={...fe,...ut(il.validate,fe.message)},!c))return Se(fe.message),ze}else if(vr(F)){let $e={};for(const fe in F){if(!mi($e)&&!c)break;const he=Hw(await F[fe](J,u),de,fe);he&&($e={...he,...ut(fe,he.message)},Se(he.message),c&&(ze[K]=$e))}if(!mi($e)&&(ze[K]={ref:de,...$e},!c))return ze}}return Se(!0),ze};function RD(i,u){const c=u.slice(0,-1).length;let p=0;for(;p<c;)i=tr(i)?p++:i[u[p++]];return i}function DD(i){for(const u in i)if(!tr(i[u]))return!1;return!0}function Fr(i,u){const c=Array.isArray(u)?u:j0(u)?[u]:Nw(u),p=c.length===1?i:RD(i,c),v=c.length-1,g=c[v];return p&&delete p[g],v!==0&&(vr(p)&&mi(p)||Array.isArray(p)&&DD(p))&&Fr(i,c.slice(0,-1)),i}function P0(){let i=[];return{get observers(){return i},next:v=>{for(const g of i)g.next(v)},subscribe:v=>(i.push(v),{unsubscribe:()=>{i=i.filter(g=>g!==v)}}),unsubscribe:()=>{i=[]}}}var Xh=i=>ya(i)||!Tw(i);function hs(i,u){if(Xh(i)||Xh(u))return i===u;if(Lc(i)&&Lc(u))return i.getTime()===u.getTime();const c=Object.keys(i),p=Object.keys(u);if(c.length!==p.length)return!1;for(const v of c){const g=i[v];if(!p.includes(v))return!1;if(v!=="ref"){const m=u[v];if(Lc(g)&&Lc(m)||vr(g)&&vr(m)||Array.isArray(g)&&Array.isArray(m)?!hs(g,m):g!==m)return!1}}return!0}var Bw=i=>i.type==="select-multiple",OD=i=>H0(i)||qd(i),B0=i=>Zh(i)&&i.isConnected,Iw=i=>{for(const u in i)if(Uc(i[u]))return!0;return!1};function Kh(i,u={}){const c=Array.isArray(i);if(vr(i)||c)for(const p in i)Array.isArray(i[p])||vr(i[p])&&!Iw(i[p])?(u[p]=Array.isArray(i[p])?[]:{},Kh(i[p],u[p])):ya(i[p])||(u[p]=!0);return u}function $w(i,u,c){const p=Array.isArray(i);if(vr(i)||p)for(const v in i)Array.isArray(i[v])||vr(i[v])&&!Iw(i[v])?tr(u)||Xh(c[v])?c[v]=Array.isArray(i[v])?Kh(i[v],[]):{...Kh(i[v])}:$w(i[v],ya(u)?{}:u[v],c[v]):hs(i[v],u[v])?delete c[v]:c[v]=!0;return c}var I0=(i,u)=>$w(i,u,Kh(u)),Ww=(i,{valueAsNumber:u,valueAsDate:c,setValueAs:p})=>tr(i)?i:u?i===""?NaN:i&&+i:c&&mo(i)?new Date(i):p?p(i):i;function $0(i){const u=i.ref;if(!(i.refs?i.refs.every(c=>c.disabled):u.disabled))return V0(u)?u.files:H0(u)?Vw(i.refs).value:Bw(u)?[...u.selectedOptions].map(({value:c})=>c):qd(u)?jw(i.refs).value:Ww(tr(u.value)?i.ref.value:u.value,i)}var MD=(i,u,c,p)=>{const v={};for(const g of i){const m=Le(u,g);m&&Dn(v,g,m._f)}return{criteriaMode:c,names:[...i],fields:v,shouldUseNativeValidation:p}},tp=i=>tr(i)?i:Qh(i)?i.source:vr(i)?Qh(i.value)?i.value.source:i.value:i,ND=i=>i.mount&&(i.required||i.min||i.max||i.maxLength||i.minLength||i.pattern||i.validate);function Yw(i,u,c){const p=Le(i,c);if(p||j0(c))return{error:p,name:c};const v=c.split(".");for(;v.length;){const g=v.join("."),m=Le(u,g),x=Le(i,g);if(m&&!Array.isArray(m)&&c!==g)return{name:c};if(x&&x.type)return{name:g,error:x};v.pop()}return{name:c}}var AD=(i,u,c,p,v)=>v.isOnAll?!1:!c&&v.isOnTouch?!(u||i):(c?p.isOnBlur:v.isOnBlur)?!i:(c?p.isOnChange:v.isOnChange)?i:!0,LD=(i,u)=>!ep(Le(i,u)).length&&Fr(i,u);const zD={mode:ji.onSubmit,reValidateMode:ji.onChange,shouldFocusError:!0};function UD(i={},u){let c={...zD,...i};const p=i.resetOptions&&i.resetOptions.keepDirtyValues;let v={submitCount:0,isDirty:!1,isLoading:!0,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},g={},m=vr(c.defaultValues)||vr(c.values)?au(c.defaultValues||c.values)||{}:{},x=c.shouldUnregister?{}:au(m),E={action:!1,mount:!1,watch:!1},T={mount:new Set,unMount:new Set,array:new Set,watch:new Set},M,D=0;const j={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},F={watch:P0(),array:P0(),state:P0()},K=Aw(c.mode),ce=Aw(c.reValidateMode),ve=c.criteriaMode===ji.all,Qe=A=>Z=>{clearTimeout(D),D=window.setTimeout(A,Z)},J=async A=>{if(j.isValid||A){const Z=c.resolver?mi((await lt()).errors):await pt(g,!0);Z!==v.isValid&&F.state.next({isValid:Z})}},de=A=>j.isValidating&&F.state.next({isValidating:A}),Se=(A,Z=[],G,be,Re=!0,le=!0)=>{if(be&&G){if(E.action=!0,le&&Array.isArray(Le(g,A))){const Pe=G(Le(g,A),be.argA,be.argB);Re&&Dn(g,A,Pe)}if(le&&Array.isArray(Le(v.errors,A))){const Pe=G(Le(v.errors,A),be.argA,be.argB);Re&&Dn(v.errors,A,Pe),LD(v.errors,A)}if(j.touchedFields&&le&&Array.isArray(Le(v.touchedFields,A))){const Pe=G(Le(v.touchedFields,A),be.argA,be.argB);Re&&Dn(v.touchedFields,A,Pe)}j.dirtyFields&&(v.dirtyFields=I0(m,x)),F.state.next({name:A,isDirty:fe(A,Z),dirtyFields:v.dirtyFields,errors:v.errors,isValid:v.isValid})}else Dn(x,A,Z)},ze=(A,Z)=>{Dn(v.errors,A,Z),F.state.next({errors:v.errors})},yt=(A,Z,G,be)=>{const Re=Le(g,A);if(Re){const le=Le(x,A,tr(G)?Le(m,A):G);tr(le)||be&&be.defaultChecked||Z?Dn(x,A,Z?le:$0(Re._f)):Ze(A,le),E.mount&&J()}},He=(A,Z,G,be,Re)=>{let le=!1,Pe=!1;const $t={name:A};if(!G||be){j.isDirty&&(Pe=v.isDirty,v.isDirty=$t.isDirty=fe(),le=Pe!==$t.isDirty);const zt=hs(Le(m,A),Z);Pe=Le(v.dirtyFields,A),zt?Fr(v.dirtyFields,A):Dn(v.dirtyFields,A,!0),$t.dirtyFields=v.dirtyFields,le=le||j.dirtyFields&&Pe!==!zt}if(G){const zt=Le(v.touchedFields,A);zt||(Dn(v.touchedFields,A,G),$t.touchedFields=v.touchedFields,le=le||j.touchedFields&&zt!==G)}return le&&Re&&F.state.next($t),le?$t:{}},Xe=(A,Z,G,be)=>{const Re=Le(v.errors,A),le=j.isValid&&zc(Z)&&v.isValid!==Z;if(i.delayError&&G?(M=Qe(()=>ze(A,G)),M(i.delayError)):(clearTimeout(D),M=null,G?Dn(v.errors,A,G):Fr(v.errors,A)),(G?!hs(Re,G):Re)||!mi(be)||le){const Pe={...be,...le&&zc(Z)?{isValid:Z}:{},errors:v.errors,name:A};v={...v,...Pe},F.state.next(Pe)}de(!1)},lt=async A=>await c.resolver(x,c.context,MD(A||T.mount,g,c.criteriaMode,c.shouldUseNativeValidation)),ut=async A=>{const{errors:Z}=await lt();if(A)for(const G of A){const be=Le(Z,G);be?Dn(v.errors,G,be):Fr(v.errors,G)}else v.errors=Z;return Z},pt=async(A,Z,G={valid:!0})=>{for(const be in A){const Re=A[be];if(Re){const{_f:le,...Pe}=Re;if(le){const $t=T.array.has(le.name),zt=await Pw(Re,x,ve,c.shouldUseNativeValidation,$t);if(zt[le.name]&&(G.valid=!1,Z))break;!Z&&(Le(zt,le.name)?$t?_D(v.errors,zt,le.name):Dn(v.errors,le.name,zt[le.name]):Fr(v.errors,le.name))}Pe&&await pt(Pe,Z,G)}}return G.valid},$e=()=>{for(const A of T.unMount){const Z=Le(g,A);Z&&(Z._f.refs?Z._f.refs.every(G=>!B0(G)):!B0(Z._f.ref))&&Lt(A)}T.unMount=new Set},fe=(A,Z)=>(A&&Z&&Dn(x,A,Z),!hs(ge(),m)),he=(A,Z,G)=>Mw(A,T,{...E.mount?x:tr(Z)?m:mo(A)?{[A]:Z}:Z},G,Z),Ke=A=>ep(Le(E.mount?x:m,A,i.shouldUnregister?Le(m,A,[]):[])),Ze=(A,Z,G={})=>{const be=Le(g,A);let Re=Z;if(be){const le=be._f;le&&(!le.disabled&&Dn(x,A,Ww(Z,le)),Re=Zh(le.ref)&&ya(Z)?"":Z,Bw(le.ref)?[...le.ref.options].forEach(Pe=>Pe.selected=Re.includes(Pe.value)):le.refs?qd(le.ref)?le.refs.length>1?le.refs.forEach(Pe=>(!Pe.defaultChecked||!Pe.disabled)&&(Pe.checked=Array.isArray(Re)?!!Re.find($t=>$t===Pe.value):Re===Pe.value)):le.refs[0]&&(le.refs[0].checked=!!Re):le.refs.forEach(Pe=>Pe.checked=Pe.value===Re):V0(le.ref)?le.ref.value="":(le.ref.value=Re,le.ref.type||F.watch.next({name:A})))}(G.shouldDirty||G.shouldTouch)&&He(A,Re,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&ee(A)},Dt=(A,Z,G)=>{for(const be in Z){const Re=Z[be],le=`${A}.${be}`,Pe=Le(g,le);(T.array.has(A)||!Xh(Re)||Pe&&!Pe._f)&&!Lc(Re)?Dt(le,Re,G):Ze(le,Re,G)}},ae=(A,Z,G={})=>{const be=Le(g,A),Re=T.array.has(A),le=au(Z);Dn(x,A,le),Re?(F.array.next({name:A,values:x}),(j.isDirty||j.dirtyFields)&&G.shouldDirty&&F.state.next({name:A,dirtyFields:I0(m,x),isDirty:fe(A,le)})):be&&!be._f&&!ya(le)?Dt(A,le,G):Ze(A,le,G),Lw(A,T)&&F.state.next({}),F.watch.next({name:A}),!E.mount&&u()},ne=async A=>{const Z=A.target;let G=Z.name;const be=Le(g,G),Re=()=>Z.type?$0(be._f):kw(A);if(be){let le,Pe;const $t=Re(),zt=A.type===Wh.BLUR||A.type===Wh.FOCUS_OUT,za=!ND(be._f)&&!c.resolver&&!Le(v.errors,G)&&!be._f.deps||AD(zt,Le(v.touchedFields,G),v.isSubmitted,ce,K),hr=Lw(G,T,zt);Dn(x,G,$t),zt?(be._f.onBlur&&be._f.onBlur(A),M&&M(0)):be._f.onChange&&be._f.onChange(A);const Pr=He(G,$t,zt,!1),On=!mi(Pr)||hr;if(!zt&&F.watch.next({name:G,type:A.type}),za)return j.isValid&&J(),On&&F.state.next({name:G,...hr?{}:Pr});if(!zt&&hr&&F.state.next({}),de(!0),c.resolver){const{errors:Dr}=await lt([G]),gi=Yw(v.errors,g,G),ea=Yw(Dr,g,gi.name||G);le=ea.error,G=ea.name,Pe=mi(Dr)}else le=(await Pw(be,x,ve,c.shouldUseNativeValidation))[G],le?Pe=!1:j.isValid&&(Pe=await pt(g,!0));be._f.deps&&ee(be._f.deps),Xe(G,Pe,le,Pr)}},ee=async(A,Z={})=>{let G,be;const Re=Yh(A);if(de(!0),c.resolver){const le=await ut(tr(A)?A:Re);G=mi(le),be=A?!Re.some(Pe=>Le(le,Pe)):G}else A?(be=(await Promise.all(Re.map(async le=>{const Pe=Le(g,le);return await pt(Pe&&Pe._f?{[le]:Pe}:Pe)}))).every(Boolean),!(!be&&!v.isValid)&&J()):be=G=await pt(g);return F.state.next({...!mo(A)||j.isValid&&G!==v.isValid?{}:{name:A},...c.resolver||!A?{isValid:G}:{},errors:v.errors,isValidating:!1}),Z.shouldFocus&&!be&&F0(g,le=>le&&Le(v.errors,le),A?Re:T.mount),be},ge=A=>{const Z={...m,...E.mount?x:{}};return tr(A)?Z:mo(A)?Le(Z,A):A.map(G=>Le(Z,G))},me=(A,Z)=>({invalid:!!Le((Z||v).errors,A),isDirty:!!Le((Z||v).dirtyFields,A),isTouched:!!Le((Z||v).touchedFields,A),error:Le((Z||v).errors,A)}),st=A=>{A&&Yh(A).forEach(Z=>Fr(v.errors,Z)),F.state.next({errors:A?v.errors:{}})},Et=(A,Z,G)=>{const be=(Le(g,A,{_f:{}})._f||{}).ref;Dn(v.errors,A,{...Z,ref:be}),F.state.next({name:A,errors:v.errors,isValid:!1}),G&&G.shouldFocus&&be&&be.focus&&be.focus()},Pt=(A,Z)=>Uc(A)?F.watch.subscribe({next:G=>A(he(void 0,Z),G)}):he(A,Z,!0),Lt=(A,Z={})=>{for(const G of A?Yh(A):T.mount)T.mount.delete(G),T.array.delete(G),Le(g,G)&&(Z.keepValue||(Fr(g,G),Fr(x,G)),!Z.keepError&&Fr(v.errors,G),!Z.keepDirty&&Fr(v.dirtyFields,G),!Z.keepTouched&&Fr(v.touchedFields,G),!c.shouldUnregister&&!Z.keepDefaultValue&&Fr(m,G));F.watch.next({}),F.state.next({...v,...Z.keepDirty?{isDirty:fe()}:{}}),!Z.keepIsValid&&J()},wn=(A,Z={})=>{let G=Le(g,A);const be=zc(Z.disabled);return Dn(g,A,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:A}},name:A,mount:!0,...Z}}),T.mount.add(A),G?be&&Dn(x,A,Z.disabled?void 0:Le(x,A,$0(G._f))):yt(A,!0,Z.value),{...be?{disabled:Z.disabled}:{},...c.shouldUseNativeValidation?{required:!!Z.required,min:tp(Z.min),max:tp(Z.max),minLength:tp(Z.minLength),maxLength:tp(Z.maxLength),pattern:tp(Z.pattern)}:{},name:A,onChange:ne,onBlur:ne,ref:Re=>{if(Re){wn(A,Z),G=Le(g,A);const le=tr(Re.value)&&Re.querySelectorAll&&Re.querySelectorAll("input,select,textarea")[0]||Re,Pe=OD(le),$t=G._f.refs||[];if(Pe?$t.find(zt=>zt===le):le===G._f.ref)return;Dn(g,A,{_f:{...G._f,...Pe?{refs:[...$t.filter(B0),le,...Array.isArray(Le(m,A))?[{}]:[]],ref:{type:le.type,name:A}}:{ref:le}}}),yt(A,!1,void 0,le)}else G=Le(g,A,{}),G._f&&(G._f.mount=!1),(c.shouldUnregister||Z.shouldUnregister)&&!(_w(T.array,A)&&E.action)&&T.unMount.add(A)}}},Cn=()=>c.shouldFocusError&&F0(g,A=>A&&Le(v.errors,A),T.mount),zn=(A,Z)=>async G=>{G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let be=au(x);if(F.state.next({isSubmitting:!0}),c.resolver){const{errors:Re,values:le}=await lt();v.errors=Re,be=le}else await pt(g);Fr(v.errors,"root"),mi(v.errors)?(F.state.next({errors:{}}),await A(be,G)):(Z&&await Z({...v.errors},G),Cn()),F.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:mi(v.errors),submitCount:v.submitCount+1,errors:v.errors})},Vr=(A,Z={})=>{Le(g,A)&&(tr(Z.defaultValue)?ae(A,Le(m,A)):(ae(A,Z.defaultValue),Dn(m,A,Z.defaultValue)),Z.keepTouched||Fr(v.touchedFields,A),Z.keepDirty||(Fr(v.dirtyFields,A),v.isDirty=Z.defaultValue?fe(A,Le(m,A)):fe()),Z.keepError||(Fr(v.errors,A),j.isValid&&J()),F.state.next({...v}))},Zn=(A,Z={})=>{const G=A||m,be=au(G),Re=A&&!mi(A)?be:m;if(Z.keepDefaultValues||(m=G),!Z.keepValues){if(Z.keepDirtyValues||p)for(const le of T.mount)Le(v.dirtyFields,le)?Dn(Re,le,Le(x,le)):ae(le,Le(Re,le));else{if(z0&&tr(A))for(const le of T.mount){const Pe=Le(g,le);if(Pe&&Pe._f){const $t=Array.isArray(Pe._f.refs)?Pe._f.refs[0]:Pe._f.ref;if(Zh($t)){const zt=$t.closest("form");if(zt){zt.reset();break}}}}g={}}x=i.shouldUnregister?Z.keepDefaultValues?au(m):{}:be,F.array.next({values:Re}),F.watch.next({values:Re})}T={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!E.mount&&u(),E.mount=!j.isValid||!!Z.keepIsValid,E.watch=!!i.shouldUnregister,F.state.next({submitCount:Z.keepSubmitCount?v.submitCount:0,isDirty:Z.keepDirty||Z.keepDirtyValues?v.isDirty:!!(Z.keepDefaultValues&&!hs(A,m)),isSubmitted:Z.keepIsSubmitted?v.isSubmitted:!1,dirtyFields:Z.keepDirty||Z.keepDirtyValues?v.dirtyFields:Z.keepDefaultValues&&A?I0(m,A):{},touchedFields:Z.keepTouched?v.touchedFields:{},errors:Z.keepErrors?v.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},Hr=(A,Z)=>Zn(Uc(A)?A(x):A,Z),Hn=(A,Z={})=>{const G=Le(g,A),be=G&&G._f;if(be){const Re=be.refs?be.refs[0]:be.ref;Re.focus&&(Re.focus(),Z.shouldSelect&&Re.select())}},nr=A=>{v={...v,...A}};return Uc(c.defaultValues)&&c.defaultValues().then(A=>{Hr(A,c.resetOptions),F.state.next({isLoading:!1})}),{control:{register:wn,unregister:Lt,getFieldState:me,_executeSchema:lt,_focusError:Cn,_getWatch:he,_getDirty:fe,_updateValid:J,_removeUnmounted:$e,_updateFieldArray:Se,_getFieldArray:Ke,_reset:Zn,_updateFormState:nr,_subjects:F,_proxyFormState:j,get _fields(){return g},get _formValues(){return x},get _stateFlags(){return E},set _stateFlags(A){E=A},get _defaultValues(){return m},get _names(){return T},set _names(A){T=A},get _formState(){return v},set _formState(A){v=A},get _options(){return c},set _options(A){c={...c,...A}}},trigger:ee,register:wn,handleSubmit:zn,watch:Pt,setValue:ae,getValues:ge,reset:Hr,resetField:Vr,clearErrors:st,unregister:Lt,setError:Et,setFocus:Hn,getFieldState:me}}function jD(i={}){const u=B.useRef(),[c,p]=B.useState({isDirty:!1,isValidating:!1,isLoading:!0,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:Uc(i.defaultValues)?void 0:i.defaultValues});u.current||(u.current={...UD(i,()=>p(g=>({...g}))),formState:c});const v=u.current.control;return v._options=i,L0({subject:v._subjects.state,next:g=>{Dw(g,v._proxyFormState,v._updateFormState,!0)&&p({...v._formState})}}),B.useEffect(()=>{v._stateFlags.mount||(v._updateValid(),v._stateFlags.mount=!0),v._stateFlags.watch&&(v._stateFlags.watch=!1,v._subjects.state.next({})),v._removeUnmounted()}),B.useEffect(()=>{i.values&&!hs(i.values,v._defaultValues)&&v._reset(i.values,v._options.resetOptions)},[i.values,v]),B.useEffect(()=>{c.submitCount&&v._focusError()},[v,c.submitCount]),u.current.formState=Rw(c,v),u.current}const Zw=({children:i,useForm:u})=>B.Children.map(i,c=>{var p,v,g,m,x;return c?(v=(p=c.props)==null?void 0:p.config)!=null&&v.items?B.createElement(c.type,{config:{...c.props.config,items:c.props.config.items.map(E=>E.type==="input"?{...E,useForm:u}:E)}}):(g=c.props)!=null&&g.children?B.createElement(c.type,{...c.props},bt.jsx(Zw,{useForm:u,children:c.props.children})):((x=(m=c.props)==null?void 0:m.config)==null?void 0:x.type)==="input"?B.createElement(c.type,{config:{...c.props.config,useForm:u}}):c.type===RC?B.createElement(c.type,{...c.props,useForm:u}):B.createElement(c.type,{...c.props}):null}),FD=({children:i,options:u})=>{const c=B.useRef(null),{reset:p,register:v,handleSubmit:g,formState:{isSubmitSuccessful:m},control:x}=jD();B.useEffect(()=>{m&&(u!=null&&u.resetOnSubmit)&&p()},[m]);const E=D=>{var F;const j=new CustomEvent("twintag-form-valid",{detail:D,bubbles:!0,cancelable:!1,composed:!0});(F=c.current)==null||F.dispatchEvent(j)},T=D=>{var F;const j=new CustomEvent("twintag-form-invalid",{detail:D,bubbles:!0,cancelable:!1,composed:!0});(F=c.current)==null||F.dispatchEvent(j)},M=()=>{g(E,T)()};return B.useEffect(()=>(c.current&&c.current.addEventListener("twintag-form-validate",M),()=>{c.current&&c.current.removeEventListener("twintag-form-validate",M)}),[]),bt.jsx("form",{ref:c,className:"font-fftext relative",onSubmit:g(E,T),children:bt.jsx("div",{className:"grid w-auto gap-4",children:bt.jsx(Zw,{useForm:{register:v,control:x},children:i})})})};var Gw=i=>typeof i=="boolean"?`${i}`:i===0?"0":i,yi=i=>!i||typeof i!="object"||Object.keys(i).length===0,VD=(...i)=>[...i].flat().filter(Boolean),Qw=(i,u)=>{let c={};for(let p in i)u!=null&&u.hasOwnProperty(p)?c[p]=typeof i[p]=="object"?Qw(i[p],u[p]):u[p]+" "+i[p]:c[p]=i[p];for(let p in u)c.hasOwnProperty(p)||(c[p]=u[p]);return c},Xw=i=>!i||typeof i!="string"?i:i.replace(/\s+/g," ").trim();function HD(){for(var i=0,u,c,p="";i<arguments.length;)(u=arguments[i++])&&(c=Kw(u))&&(p&&(p+=" "),p+=c);return p}function Kw(i){if(typeof i=="string")return i;for(var u,c="",p=0;p<i.length;p++)i[p]&&(u=Kw(i[p]))&&(c&&(c+=" "),c+=u);return c}var W0="-";function PD(i){var u=ID(i),c=i.conflictingClassGroups,p=i.conflictingClassGroupModifiers,v=p===void 0?{}:p;function g(x){var E=x.split(W0);return E[0]===""&&E.length!==1&&E.shift(),Jw(E,u)||BD(x)}function m(x,E){var T=c[x]||[];return E&&v[x]?[].concat(T,v[x]):T}return{getClassGroupId:g,getConflictingClassGroupIds:m}}function Jw(i,u){var m;if(i.length===0)return u.classGroupId;var c=i[0],p=u.nextPart.get(c),v=p?Jw(i.slice(1),p):void 0;if(v)return v;if(u.validators.length!==0){var g=i.join(W0);return(m=u.validators.find(function(x){var E=x.validator;return E(g)}))==null?void 0:m.classGroupId}}var qw=/^\[(.+)\]$/;function BD(i){if(qw.test(i)){var u=qw.exec(i)[1],c=u==null?void 0:u.substring(0,u.indexOf(":"));if(c)return"arbitrary.."+c}}function ID(i){var u=i.theme,c=i.prefix,p={nextPart:new Map,validators:[]},v=WD(Object.entries(i.classGroups),c);return v.forEach(function(g){var m=g[0],x=g[1];Y0(x,p,m,u)}),p}function Y0(i,u,c,p){i.forEach(function(v){if(typeof v=="string"){var g=v===""?u:eC(u,v);g.classGroupId=c;return}if(typeof v=="function"){if($D(v)){Y0(v(p),u,c,p);return}u.validators.push({validator:v,classGroupId:c});return}Object.entries(v).forEach(function(m){var x=m[0],E=m[1];Y0(E,eC(u,x),c,p)})})}function eC(i,u){var c=i;return u.split(W0).forEach(function(p){c.nextPart.has(p)||c.nextPart.set(p,{nextPart:new Map,validators:[]}),c=c.nextPart.get(p)}),c}function $D(i){return i.isThemeGetter}function WD(i,u){return u?i.map(function(c){var p=c[0],v=c[1],g=v.map(function(m){return typeof m=="string"?u+m:typeof m=="object"?Object.fromEntries(Object.entries(m).map(function(x){var E=x[0],T=x[1];return[u+E,T]})):m});return[p,g]}):i}function YD(i){if(i<1)return{get:function(){},set:function(){}};var u=0,c=new Map,p=new Map;function v(g,m){c.set(g,m),u++,u>i&&(u=0,p=c,c=new Map)}return{get:function(m){var x=c.get(m);if(x!==void 0)return x;if((x=p.get(m))!==void 0)return v(m,x),x},set:function(m,x){c.has(m)?c.set(m,x):v(m,x)}}}var tC="!";function ZD(i){var u=i.separator||":",c=u.length===1,p=u[0],v=u.length;return function(m){for(var x=[],E=0,T=0,M,D=0;D<m.length;D++){var j=m[D];if(E===0){if(j===p&&(c||m.slice(D,D+v)===u)){x.push(m.slice(T,D)),T=D+v;continue}if(j==="/"){M=D;continue}}j==="["?E++:j==="]"&&E--}var F=x.length===0?m:m.substring(T),K=F.startsWith(tC),ce=K?F.substring(1):F,ve=M&&M>T?M-T:void 0;return{modifiers:x,hasImportantModifier:K,baseClassName:ce,maybePostfixModifierPosition:ve}}}function GD(i){if(i.length<=1)return i;var u=[],c=[];return i.forEach(function(p){var v=p[0]==="[";v?(u.push.apply(u,c.sort().concat([p])),c=[]):c.push(p)}),u.push.apply(u,c.sort()),u}function QD(i){return{cache:YD(i.cacheSize),splitModifiers:ZD(i),...PD(i)}}var XD=/\s+/;function KD(i,u){var c=u.splitModifiers,p=u.getClassGroupId,v=u.getConflictingClassGroupIds,g=new Set;return i.trim().split(XD).map(function(m){var x=c(m),E=x.modifiers,T=x.hasImportantModifier,M=x.baseClassName,D=x.maybePostfixModifierPosition,j=p(D?M.substring(0,D):M),F=!!D;if(!j){if(!D)return{isTailwindClass:!1,originalClassName:m};if(j=p(M),!j)return{isTailwindClass:!1,originalClassName:m};F=!1}var K=GD(E).join(":"),ce=T?K+tC:K;return{isTailwindClass:!0,modifierId:ce,classGroupId:j,originalClassName:m,hasPostfixModifier:F}}).reverse().filter(function(m){if(!m.isTailwindClass)return!0;var x=m.modifierId,E=m.classGroupId,T=m.hasPostfixModifier,M=x+E;return g.has(M)?!1:(g.add(M),v(E,T).forEach(function(D){return g.add(x+D)}),!0)}).reverse().map(function(m){return m.originalClassName}).join(" ")}function Z0(){for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];var p,v,g,m=x;function x(T){var M=u[0],D=u.slice(1),j=D.reduce(function(F,K){return K(F)},M());return p=QD(j),v=p.cache.get,g=p.cache.set,m=E,E(T)}function E(T){var M=v(T);if(M)return M;var D=KD(T,p);return g(T,D),D}return function(){return m(HD.apply(null,arguments))}}function xn(i){var u=function(p){return p[i]||[]};return u.isThemeGetter=!0,u}var nC=/^\[(?:([a-z-]+):)?(.+)\]$/i,JD=/^\d+\/\d+$/,qD=new Set(["px","full","screen"]),e2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,t2=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))/,n2=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;function Fi(i){return ms(i)||qD.has(i)||JD.test(i)||iu(i)}function iu(i){return ys(i,"length",u2)}function r2(i){return ys(i,"size",rC)}function a2(i){return ys(i,"position",rC)}function i2(i){return ys(i,"url",s2)}function Jh(i){return ys(i,"number",ms)}function ms(i){return!Number.isNaN(Number(i))}function o2(i){return i.endsWith("%")&&ms(i.slice(0,-1))}function np(i){return aC(i)||ys(i,"number",aC)}function Yn(i){return nC.test(i)}function rp(){return!0}function ou(i){return e2.test(i)}function l2(i){return ys(i,"",c2)}function ys(i,u,c){var p=nC.exec(i);return p?p[1]?p[1]===u:c(p[2]):!1}function u2(i){return t2.test(i)}function rC(){return!1}function s2(i){return i.startsWith("url(")}function aC(i){return Number.isInteger(Number(i))}function c2(i){return n2.test(i)}function G0(){var i=xn("colors"),u=xn("spacing"),c=xn("blur"),p=xn("brightness"),v=xn("borderColor"),g=xn("borderRadius"),m=xn("borderSpacing"),x=xn("borderWidth"),E=xn("contrast"),T=xn("grayscale"),M=xn("hueRotate"),D=xn("invert"),j=xn("gap"),F=xn("gradientColorStops"),K=xn("gradientColorStopPositions"),ce=xn("inset"),ve=xn("margin"),Qe=xn("opacity"),J=xn("padding"),de=xn("saturate"),Se=xn("scale"),ze=xn("sepia"),yt=xn("skew"),He=xn("space"),Xe=xn("translate"),lt=function(){return["auto","contain","none"]},ut=function(){return["auto","hidden","clip","visible","scroll"]},pt=function(){return["auto",u]},$e=function(){return["",Fi]},fe=function(){return["auto",ms,Yn]},he=function(){return["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"]},Ke=function(){return["solid","dashed","dotted","double","none"]},Ze=function(){return["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"]},Dt=function(){return["start","end","center","between","around","evenly","stretch"]},ae=function(){return["","0",Yn]},ne=function(){return["auto","avoid","all","avoid-page","page","left","right","column"]},ee=function(){return[ms,Jh]},ge=function(){return[ms,Yn]};return{cacheSize:500,theme:{colors:[rp],spacing:[Fi],blur:["none","",ou,iu],brightness:ee(),borderColor:[i],borderRadius:["none","","full",ou,iu],borderSpacing:[u],borderWidth:$e(),contrast:ee(),grayscale:ae(),hueRotate:ge(),invert:ae(),gap:[u],gradientColorStops:[i],gradientColorStopPositions:[o2,iu],inset:pt(),margin:pt(),opacity:ee(),padding:[u],saturate:ee(),scale:ee(),sepia:ae(),skew:ge(),space:[u],translate:[u]},classGroups:{aspect:[{aspect:["auto","square","video",Yn]}],container:["container"],columns:[{columns:[ou]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[].concat(he(),[Yn])}],overflow:[{overflow:ut()}],"overflow-x":[{"overflow-x":ut()}],"overflow-y":[{"overflow-y":ut()}],overscroll:[{overscroll:lt()}],"overscroll-x":[{"overscroll-x":lt()}],"overscroll-y":[{"overscroll-y":lt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[ce]}],"inset-x":[{"inset-x":[ce]}],"inset-y":[{"inset-y":[ce]}],start:[{start:[ce]}],end:[{end:[ce]}],top:[{top:[ce]}],right:[{right:[ce]}],bottom:[{bottom:[ce]}],left:[{left:[ce]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",np]}],basis:[{basis:[u]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Yn]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",np]}],"grid-cols":[{"grid-cols":[rp]}],"col-start-end":[{col:["auto",{span:[np]},Yn]}],"col-start":[{"col-start":fe()}],"col-end":[{"col-end":fe()}],"grid-rows":[{"grid-rows":[rp]}],"row-start-end":[{row:["auto",{span:[np]},Yn]}],"row-start":[{"row-start":fe()}],"row-end":[{"row-end":fe()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Yn]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Yn]}],gap:[{gap:[j]}],"gap-x":[{"gap-x":[j]}],"gap-y":[{"gap-y":[j]}],"justify-content":[{justify:["normal"].concat(Dt())}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal"].concat(Dt(),["baseline"])}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[].concat(Dt(),["baseline"])}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[J]}],px:[{px:[J]}],py:[{py:[J]}],ps:[{ps:[J]}],pe:[{pe:[J]}],pt:[{pt:[J]}],pr:[{pr:[J]}],pb:[{pb:[J]}],pl:[{pl:[J]}],m:[{m:[ve]}],mx:[{mx:[ve]}],my:[{my:[ve]}],ms:[{ms:[ve]}],me:[{me:[ve]}],mt:[{mt:[ve]}],mr:[{mr:[ve]}],mb:[{mb:[ve]}],ml:[{ml:[ve]}],"space-x":[{"space-x":[He]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[He]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",u]}],"min-w":[{"min-w":["min","max","fit",Fi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ou]},ou,iu]}],h:[{h:[u,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Fi]}],"max-h":[{"max-h":[u,"min","max","fit"]}],"font-size":[{text:["base",ou,iu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Jh]}],"font-family":[{font:[rp]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",iu]}],"line-clamp":[{"line-clamp":["none",ms,Jh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Fi]}],"list-image":[{"list-image":["none",Yn]}],"list-style-type":[{list:["none","disc","decimal",Yn]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[i]}],"placeholder-opacity":[{"placeholder-opacity":[Qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[i]}],"text-opacity":[{"text-opacity":[Qe]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[].concat(Ke(),["wavy"])}],"text-decoration-thickness":[{decoration:["auto","from-font",Fi]}],"underline-offset":[{"underline-offset":["auto",Fi]}],"text-decoration-color":[{decoration:[i]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:[u]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",iu]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Yn]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Qe]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[].concat(he(),[a2])}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",r2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},i2]}],"bg-color":[{bg:[i]}],"gradient-from-pos":[{from:[K]}],"gradient-via-pos":[{via:[K]}],"gradient-to-pos":[{to:[K]}],"gradient-from":[{from:[F]}],"gradient-via":[{via:[F]}],"gradient-to":[{to:[F]}],rounded:[{rounded:[g]}],"rounded-s":[{"rounded-s":[g]}],"rounded-e":[{"rounded-e":[g]}],"rounded-t":[{"rounded-t":[g]}],"rounded-r":[{"rounded-r":[g]}],"rounded-b":[{"rounded-b":[g]}],"rounded-l":[{"rounded-l":[g]}],"rounded-ss":[{"rounded-ss":[g]}],"rounded-se":[{"rounded-se":[g]}],"rounded-ee":[{"rounded-ee":[g]}],"rounded-es":[{"rounded-es":[g]}],"rounded-tl":[{"rounded-tl":[g]}],"rounded-tr":[{"rounded-tr":[g]}],"rounded-br":[{"rounded-br":[g]}],"rounded-bl":[{"rounded-bl":[g]}],"border-w":[{border:[x]}],"border-w-x":[{"border-x":[x]}],"border-w-y":[{"border-y":[x]}],"border-w-s":[{"border-s":[x]}],"border-w-e":[{"border-e":[x]}],"border-w-t":[{"border-t":[x]}],"border-w-r":[{"border-r":[x]}],"border-w-b":[{"border-b":[x]}],"border-w-l":[{"border-l":[x]}],"border-opacity":[{"border-opacity":[Qe]}],"border-style":[{border:[].concat(Ke(),["hidden"])}],"divide-x":[{"divide-x":[x]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[x]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Qe]}],"divide-style":[{divide:Ke()}],"border-color":[{border:[v]}],"border-color-x":[{"border-x":[v]}],"border-color-y":[{"border-y":[v]}],"border-color-t":[{"border-t":[v]}],"border-color-r":[{"border-r":[v]}],"border-color-b":[{"border-b":[v]}],"border-color-l":[{"border-l":[v]}],"divide-color":[{divide:[v]}],"outline-style":[{outline:[""].concat(Ke())}],"outline-offset":[{"outline-offset":[Fi]}],"outline-w":[{outline:[Fi]}],"outline-color":[{outline:[i]}],"ring-w":[{ring:$e()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[i]}],"ring-opacity":[{"ring-opacity":[Qe]}],"ring-offset-w":[{"ring-offset":[Fi]}],"ring-offset-color":[{"ring-offset":[i]}],shadow:[{shadow:["","inner","none",ou,l2]}],"shadow-color":[{shadow:[rp]}],opacity:[{opacity:[Qe]}],"mix-blend":[{"mix-blend":Ze()}],"bg-blend":[{"bg-blend":Ze()}],filter:[{filter:["","none"]}],blur:[{blur:[c]}],brightness:[{brightness:[p]}],contrast:[{contrast:[E]}],"drop-shadow":[{"drop-shadow":["","none",ou,Yn]}],grayscale:[{grayscale:[T]}],"hue-rotate":[{"hue-rotate":[M]}],invert:[{invert:[D]}],saturate:[{saturate:[de]}],sepia:[{sepia:[ze]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[c]}],"backdrop-brightness":[{"backdrop-brightness":[p]}],"backdrop-contrast":[{"backdrop-contrast":[E]}],"backdrop-grayscale":[{"backdrop-grayscale":[T]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[M]}],"backdrop-invert":[{"backdrop-invert":[D]}],"backdrop-opacity":[{"backdrop-opacity":[Qe]}],"backdrop-saturate":[{"backdrop-saturate":[de]}],"backdrop-sepia":[{"backdrop-sepia":[ze]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Yn]}],duration:[{duration:ge()}],ease:[{ease:["linear","in","out","in-out",Yn]}],delay:[{delay:ge()}],animate:[{animate:["none","spin","ping","pulse","bounce",Yn]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Se]}],"scale-x":[{"scale-x":[Se]}],"scale-y":[{"scale-y":[Se]}],rotate:[{rotate:[np,Yn]}],"translate-x":[{"translate-x":[Xe]}],"translate-y":[{"translate-y":[Xe]}],"skew-x":[{"skew-x":[yt]}],"skew-y":[{"skew-y":[yt]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Yn]}],accent:[{accent:["auto",i]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Yn]}],"caret-color":[{caret:[i]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":[u]}],"scroll-mx":[{"scroll-mx":[u]}],"scroll-my":[{"scroll-my":[u]}],"scroll-ms":[{"scroll-ms":[u]}],"scroll-me":[{"scroll-me":[u]}],"scroll-mt":[{"scroll-mt":[u]}],"scroll-mr":[{"scroll-mr":[u]}],"scroll-mb":[{"scroll-mb":[u]}],"scroll-ml":[{"scroll-ml":[u]}],"scroll-p":[{"scroll-p":[u]}],"scroll-px":[{"scroll-px":[u]}],"scroll-py":[{"scroll-py":[u]}],"scroll-ps":[{"scroll-ps":[u]}],"scroll-pe":[{"scroll-pe":[u]}],"scroll-pt":[{"scroll-pt":[u]}],"scroll-pr":[{"scroll-pr":[u]}],"scroll-pb":[{"scroll-pb":[u]}],"scroll-pl":[{"scroll-pl":[u]}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","pinch-zoom","manipulation",{pan:["x","left","right","y","up","down"]}]}],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Yn]}],fill:[{fill:[i,"none"]}],"stroke-w":[{stroke:[Fi,Jh]}],stroke:[{stroke:[i,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}var f2=Z0(G0);function d2(i,u){for(var c in u)iC(i,c,u[c]);return i}var p2=Object.prototype.hasOwnProperty,v2=new Set(["string","number","boolean"]);function iC(i,u,c){if(!p2.call(i,u)||v2.has(typeof c)||c===null){i[u]=c;return}if(Array.isArray(c)&&Array.isArray(i[u])){i[u]=i[u].concat(c);return}if(typeof c=="object"&&typeof i[u]=="object"){if(i[u]===null){i[u]=c;return}for(var p in c)iC(i[u],p,c[p])}}function h2(i){for(var u=arguments.length,c=new Array(u>1?u-1:0),p=1;p<u;p++)c[p-1]=arguments[p];return typeof i=="function"?Z0.apply(void 0,[G0,i].concat(c)):Z0.apply(void 0,[function(){return d2(G0(),i)}].concat(c))}var oC={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},lC=i=>i||void 0,qh=(...i)=>lC(i.flat(1/0).filter(Boolean).join(" ")),ap=(...i)=>(u=oC)=>{if(!u.twMerge)return qh(i);let c=yi(u.twMergeConfig)?f2:h2(u.twMergeConfig);return lC(c(qh(i)))},uC=(i,u)=>{let c={...i};for(let p in u)c.hasOwnProperty(p)?c[p]=qh(c[p],u[p]):c[p]=u[p];return c},Fc=(i,u=oC)=>{var c,p,v,g,m;let{slots:x={},variants:E={},compoundVariants:T=[],compoundSlots:M=[],defaultVariants:D={}}=i,j=qh((c=i==null?void 0:i.extend)==null?void 0:c.base,i==null?void 0:i.base),F=Qw(E,(p=i==null?void 0:i.extend)==null?void 0:p.variants),K=Object.assign({},(v=i==null?void 0:i.extend)==null?void 0:v.defaultVariants,D),ce=yi(x)?{}:{base:i==null?void 0:i.base,...x},ve=Array.isArray(u.responsiveVariants)&&u.responsiveVariants.length>0||u.responsiveVariants===!0,Qe=yi((g=i==null?void 0:i.extend)==null?void 0:g.slots)?ce:uC((m=i==null?void 0:i.extend)==null?void 0:m.slots,yi(ce)?{base:i==null?void 0:i.base}:ce),J=Se=>{var ze,yt,He,Xe;if(yi(F)&&yi(x)&&yi((ze=i==null?void 0:i.extend)==null?void 0:ze.slots))return ap(j,Se==null?void 0:Se.class,Se==null?void 0:Se.className)(u);if(T&&!Array.isArray(T))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof T}`);if(M&&!Array.isArray(M))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof M}`);let lt=(ne,ee,ge=[],me)=>{let st=ge;if(typeof ee=="string")st.push(Xw(ee).split(" ").map(Et=>`${ne}:${Et}`));else if(Array.isArray(ee))st.push(ee.flatMap(Et=>`${ne}:${Et}`));else if(typeof ee=="object"&&typeof me=="string"){let Et=ee==null?void 0:ee[me];if(Et&&typeof Et=="string"){let Pt=Xw(Et);st[me]=st[me]?[...st[me],...Pt.split(" ").map(Lt=>`${ne}:${Lt}`)]:Pt.split(" ").map(Lt=>`${ne}:${Lt}`)}else Array.isArray(Et)&&Et.length>0&&(st[me]=Et.flatMap(Pt=>`${ne}:${Pt}`))}return st},ut=(ne,ee=F,ge=null)=>{let me=ee==null?void 0:ee[ne];if(typeof me!="object"||yi(me))return null;let st=Se==null?void 0:Se[ne],Et=K==null?void 0:K[ne],Pt=[];if(st===null)return null;let Lt=Gw(st);typeof Lt=="object"&&ve&&(Pt=Object.keys(Lt).reduce((Cn,zn)=>{let Vr=Lt[zn],Zn=me==null?void 0:me[Vr];return zn==="initial"?(Et=Vr,Cn):Array.isArray(u.responsiveVariants)&&!u.responsiveVariants.includes(zn)?Cn:lt(zn,Zn,Cn,ge)},[]));let wn=me[Lt]||me[Gw(Et)];return typeof Pt=="object"&&typeof ge=="string"&&Pt[ge]?uC(Pt,wn):Pt.length>0?[wn,...Pt]:wn},pt=()=>F?Object.keys(F).map(ne=>ut(ne,F)):null,$e=ne=>!F||typeof F!="object"?null:Object.keys(F).map(ee=>{let ge=ut(ee,F,ne);return ne==="base"&&typeof ge=="string"?ge:ge&&ge[ne]}).filter(Boolean),fe=Se&&Object.fromEntries(Object.entries(Se).filter(([,ne])=>ne!==void 0)),he=ne=>{var ee;let ge=typeof(Se==null?void 0:Se[ne])=="object"?{[ne]:(ee=Se[ne])==null?void 0:ee.initial}:{};return{...K,...fe,...ge}},Ke=(ne=[])=>ne==null?void 0:ne.filter(({class:ee,className:ge,...me})=>Object.entries(me).every(([st,Et])=>{let Pt=he(st);return Array.isArray(Et)?Et.includes(Pt[st]):Pt[st]===Et})).flatMap(({class:ee,className:ge})=>[ee,ge]),Ze=()=>{var ne;let ee=Ke(T),ge=Ke((ne=i==null?void 0:i.extend)==null?void 0:ne.compoundVariants);return VD(ge,ee)},Dt=()=>{let ne=Ze();return Array.isArray(ne)?ne.reduce((ee,ge)=>(typeof ge=="string"&&(ee.base=ap(ee.base,ge)(u)),typeof ge=="object"&&Object.entries(ge).forEach(([me,st])=>{ee[me]=ap(ee[me],st)(u)}),ee),{}):ne},ae=()=>M.length<1?null:M.reduce((ne,ee)=>{let{slots:ge=[],class:me,className:st,...Et}=ee;if(!yi(Et)){let Pt=Object.keys(Et);for(let Lt of Pt){let wn=he(Lt)[Lt];if(!wn||wn!==Et[Lt])return ne}}return ge.forEach(Pt=>{ne[Pt]||(ne[Pt]=[]),ne[Pt].push([me,st])}),ne},{});if(!yi(x)||!yi((yt=i==null?void 0:i.extend)==null?void 0:yt.slots)){let ne=(He=Dt())!=null?He:[],ee=(Xe=ae())!=null?Xe:[];return{...typeof Qe=="object"&&!yi(Qe)?Object.keys(Qe).reduce((ge,me)=>(ge[me]=st=>ap(Qe[me],$e(me),ne==null?void 0:ne[me],ee==null?void 0:ee[me],st==null?void 0:st.class,st==null?void 0:st.className)(u),ge),{}):{}}}return ap(j,pt(),Ze(),Se==null?void 0:Se.class,Se==null?void 0:Se.className)(u)},de=()=>{if(!(!F||typeof F!="object"))return Object.keys(F)};return J.variantKeys=de(),J.base=j,J.slots=Qe,J.variants=F,J.defaultVariants=K,J.compoundSlots=M,J.compoundVariants=T,J};const m2=Fc({base:"font-fftext text-label"}),sC=Fc({slots:{container:"flex gap-4 items-center w-full",checkbox:"flex appearance-none items-center justify-center bg-white outline-none ring-0 border-2 border-primary focus:ring-0 focus:border-accent"},variants:{variant:{alpha:{checkbox:"h-5 w-5 rounded"},beta:{checkbox:"h-5 w-5"}}},defaultVariants:{variant:"alpha"}}),cC=Fc({slots:{container:"w-full block",span:"",input:"w-full cursor-pointer ring-0 focus:ring-0 border-2 border-transparent"},variants:{variant:{alpha:{container:"grid gap-1.5",input:"flex items-center justify-between gap-4 rounded-md px-3 py-2 border-slate-700/10 peer-focus:border-accent"},beta:{container:"grid gap-0",input:"flex items-center justify-between gap-4 py-2 border-b-slate-700/10 peer-focus:border-b-accent"}}},defaultVariants:{variant:"alpha"}}),em=Fc({slots:{container:"w-full",span:"",input:"w-full ring-0 placeholder:text-slate-400 focus:ring-0 border-2 border-transparent text-input"},variants:{variant:{alpha:{container:"grid gap-1.5",input:"rounded-md border-slate-700/10 focus:border-accent"},beta:{container:"grid gap-0",input:"px-0 focus:border-transparent focus:border-b-accent border-b-slate-700/10"}}},defaultVariants:{variant:"alpha"}}),fC=Fc({base:"w-max max-w-full",variants:{variant:{alpha:"bg-primary text-white px-4 py-2 rounded-md",beta:"bg-primary text-white px-4 py-2"}},defaultVariants:{variant:"alpha"}}),dC=Fc({slots:{container:"w-full cursor-pointer",span:"",input:"relative outline-none ring-2 ring-transparent",thumb:"block transition-transform duration-100 will-change-transform"},variants:{variant:{alpha:{container:"flex justify-between",input:"h-6 w-9 rounded-full bg-primary border border-black ring-2 focus:border-transparent focus:ring-accent data-[state=checked]:bg-white",thumb:"h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary"},beta:{container:"flex justify-between",input:"h-6 w-9 rounded-full bg-primary border border-black ring-2 focus:border-transparent focus:ring-accent data-[state=checked]:bg-white",thumb:"h-4 w-4 translate-x-0.5 rounded-full bg-white data-[state=checked]:translate-x-4 data-[state=checked]:bg-primary"}}},defaultVariants:{variant:"alpha"}}),ip=({className:i,required:u,children:c})=>{const p=m2({className:i});return bt.jsxs("span",{className:p,children:[c," ",u?"*":""]})},y2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?em({variant:p.variant}):em(),[]);return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("input",{type:"text",placeholder:(p==null?void 0:p.placeholder)||"Write here...",className:m(),...i.register(c,{required:p!=null&&p.optionalField?!1:`${u} is required`})})]})},g2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?em({variant:p.variant}):em(),[]);return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("textarea",{className:m(),placeholder:(p==null?void 0:p.placeholder)||"Write here...",...i.register(c,{required:p!=null&&p.optionalField?!1:`${u} is required`})})]})};function La(){return La=Object.assign?Object.assign.bind():function(i){for(var u=1;u<arguments.length;u++){var c=arguments[u];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(i[p]=c[p])}return i},La.apply(this,arguments)}function b2(i,u,{checkForDefaultPrevented:c=!0}={}){return function(v){if(i==null||i(v),c===!1||!v.defaultPrevented)return u==null?void 0:u(v)}}function S2(i,u){typeof i=="function"?i(u):i!=null&&(i.current=u)}function pC(...i){return u=>i.forEach(c=>S2(c,u))}function x2(...i){return B.useCallback(pC(...i),i)}function w2(i,u=[]){let c=[];function p(g,m){const x=B.createContext(m),E=c.length;c=[...c,m];function T(D){const{scope:j,children:F,...K}=D,ce=(j==null?void 0:j[i][E])||x,ve=B.useMemo(()=>K,Object.values(K));return B.createElement(ce.Provider,{value:ve},F)}function M(D,j){const F=(j==null?void 0:j[i][E])||x,K=B.useContext(F);if(K)return K;if(m!==void 0)return m;throw new Error(`\`${D}\` must be used within \`${g}\``)}return T.displayName=g+"Provider",[T,M]}const v=()=>{const g=c.map(m=>B.createContext(m));return function(x){const E=(x==null?void 0:x[i])||g;return B.useMemo(()=>({[`__scope${i}`]:{...x,[i]:E}}),[x,E])}};return v.scopeName=i,[p,C2(v,...u)]}function C2(...i){const u=i[0];if(i.length===1)return u;const c=()=>{const p=i.map(v=>({useScope:v(),scopeName:v.scopeName}));return function(g){const m=p.reduce((x,{useScope:E,scopeName:T})=>{const D=E(g)[`__scope${T}`];return{...x,...D}},{});return B.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return c.scopeName=u.scopeName,c}function vC(i){const u=B.useRef(i);return B.useEffect(()=>{u.current=i}),B.useMemo(()=>(...c)=>{var p;return(p=u.current)===null||p===void 0?void 0:p.call(u,...c)},[])}function E2({prop:i,defaultProp:u,onChange:c=()=>{}}){const[p,v]=T2({defaultProp:u,onChange:c}),g=i!==void 0,m=g?i:p,x=vC(c),E=B.useCallback(T=>{if(g){const D=typeof T=="function"?T(i):T;D!==i&&x(D)}else v(T)},[g,i,v,x]);return[m,E]}function T2({defaultProp:i,onChange:u}){const c=B.useState(i),[p]=c,v=B.useRef(p),g=vC(u);return B.useEffect(()=>{v.current!==p&&(g(p),v.current=p)},[p,v,g]),c}function k2(i){const u=B.useRef({value:i,previous:i});return B.useMemo(()=>(u.current.value!==i&&(u.current.previous=u.current.value,u.current.value=i),u.current.previous),[i])}const _2=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{};function R2(i){const[u,c]=B.useState(void 0);return _2(()=>{if(i){c({width:i.offsetWidth,height:i.offsetHeight});const p=new ResizeObserver(v=>{if(!Array.isArray(v)||!v.length)return;const g=v[0];let m,x;if("borderBoxSize"in g){const E=g.borderBoxSize,T=Array.isArray(E)?E[0]:E;m=T.inlineSize,x=T.blockSize}else m=i.offsetWidth,x=i.offsetHeight;c({width:m,height:x})});return p.observe(i,{box:"border-box"}),()=>p.unobserve(i)}else c(void 0)},[i]),u}const hC=B.forwardRef((i,u)=>{const{children:c,...p}=i,v=B.Children.toArray(c),g=v.find(O2);if(g){const m=g.props.children,x=v.map(E=>E===g?B.Children.count(m)>1?B.Children.only(null):B.isValidElement(m)?m.props.children:null:E);return B.createElement(Q0,La({},p,{ref:u}),B.isValidElement(m)?B.cloneElement(m,void 0,x):null)}return B.createElement(Q0,La({},p,{ref:u}),c)});hC.displayName="Slot";const Q0=B.forwardRef((i,u)=>{const{children:c,...p}=i;return B.isValidElement(c)?B.cloneElement(c,{...M2(p,c.props),ref:pC(u,c.ref)}):B.Children.count(c)>1?B.Children.only(null):null});Q0.displayName="SlotClone";const D2=({children:i})=>B.createElement(B.Fragment,null,i);function O2(i){return B.isValidElement(i)&&i.type===D2}function M2(i,u){const c={...u};for(const p in u){const v=i[p],g=u[p];/^on[A-Z]/.test(p)?v&&g?c[p]=(...x)=>{g(...x),v(...x)}:v&&(c[p]=v):p==="style"?c[p]={...v,...g}:p==="className"&&(c[p]=[v,g].filter(Boolean).join(" "))}return{...i,...c}}const mC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((i,u)=>{const c=B.forwardRef((p,v)=>{const{asChild:g,...m}=p,x=g?hC:u;return B.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),B.createElement(x,La({},m,{ref:v}))});return c.displayName=`Primitive.${u}`,{...i,[u]:c}},{}),yC="Switch",[N2,b4]=w2(yC),[A2,L2]=N2(yC),z2=B.forwardRef((i,u)=>{const{__scopeSwitch:c,name:p,checked:v,defaultChecked:g,required:m,disabled:x,value:E="on",onCheckedChange:T,...M}=i,[D,j]=B.useState(null),F=x2(u,J=>j(J)),K=B.useRef(!1),ce=D?!!D.closest("form"):!0,[ve=!1,Qe]=E2({prop:v,defaultProp:g,onChange:T});return B.createElement(A2,{scope:c,checked:ve,disabled:x},B.createElement(mC.button,La({type:"button",role:"switch","aria-checked":ve,"aria-required":m,"data-state":gC(ve),"data-disabled":x?"":void 0,disabled:x,value:E},M,{ref:F,onClick:b2(i.onClick,J=>{Qe(de=>!de),ce&&(K.current=J.isPropagationStopped(),K.current||J.stopPropagation())})})),ce&&B.createElement(F2,{control:D,bubbles:!K.current,name:p,value:E,checked:ve,required:m,disabled:x,style:{transform:"translateX(-100%)"}}))}),U2="SwitchThumb",j2=B.forwardRef((i,u)=>{const{__scopeSwitch:c,...p}=i,v=L2(U2,c);return B.createElement(mC.span,La({"data-state":gC(v.checked),"data-disabled":v.disabled?"":void 0},p,{ref:u}))}),F2=i=>{const{control:u,checked:c,bubbles:p=!0,...v}=i,g=B.useRef(null),m=k2(c),x=R2(u);return B.useEffect(()=>{const E=g.current,T=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(T,"checked").set;if(m!==c&&D){const j=new Event("click",{bubbles:p});D.call(E,c),E.dispatchEvent(j)}},[m,c,p]),B.createElement("input",La({type:"checkbox","aria-hidden":!0,defaultChecked:c},v,{tabIndex:-1,ref:g,style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function gC(i){return i?"checked":"unchecked"}const V2=z2,H2=j2,P2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m,thumb:x}=B.useMemo(()=>p!=null&&p.variant?dC({variant:p.variant}):dC(),[]),{field:{onChange:E,value:T}}=U0({name:c,control:i?i.control:void 0,defaultValue:!1,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx(V2,{id:c,checked:T,className:m(),onCheckedChange:M=>{E(M)},children:bt.jsx(H2,{className:x()})})]})},tm=B;function B2({title:i,titleId:u,...c},p){return tm.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:p,"aria-labelledby":u},c),i?tm.createElement("title",{id:u},i):null,tm.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"}))}var I2=tm.forwardRef(B2);const nm=B;function $2({title:i,titleId:u,...c},p){return nm.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:p,"aria-labelledby":u},c),i?nm.createElement("title",{id:u},i):null,nm.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"}))}var W2=nm.forwardRef($2),Y2=I2,Z2=W2;const G2=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,span:g,input:m}=B.useMemo(()=>p!=null&&p.variant?cC({variant:p==null?void 0:p.variant}):cC(),[]),{field:{onChange:x,value:E}}=U0({name:c,control:i?i.control:void 0,defaultValue:null,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[u?bt.jsx(ip,{className:g(),required:!(p!=null&&p.optionalField),children:u}):bt.jsx(bt.Fragment,{}),bt.jsx("input",{type:"file",multiple:!0,capture:"environment",onChange:T=>{T.target.files&&x(T.target.files)},className:"peer sr-only"}),bt.jsxs("span",{className:`${m()} ${E&&E.length>0?"border-primary text-input":"border-slate-700/10 text-slate-400"}`,children:[bt.jsx("span",{className:"grid",children:E&&E.length>0?Array.from(E).map((T,M)=>bt.jsx("span",{className:"block max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:T.name},M)):bt.jsx("span",{className:"block max-w-full overflow-hidden text-ellipsis whitespace-nowrap",children:(p==null?void 0:p.placeholder)||"No file selected"})}),bt.jsx(Z2,{className:"h-6 w-6 min-w-[1.5rem]"})]})]})},Q2=({label:i,options:u})=>{const c=B.useMemo(()=>u!=null&&u.variant?fC({variant:u.variant}):fC(),[]);return bt.jsx("div",{className:"flex w-full justify-center",children:bt.jsx("button",{type:"submit",className:c,children:i})})};function X2(i,u){typeof i=="function"?i(u):i!=null&&(i.current=u)}function bC(...i){return u=>i.forEach(c=>X2(c,u))}function SC(...i){return B.useCallback(bC(...i),i)}function K2(i,u=[]){let c=[];function p(g,m){const x=B.createContext(m),E=c.length;c=[...c,m];function T(D){const{scope:j,children:F,...K}=D,ce=(j==null?void 0:j[i][E])||x,ve=B.useMemo(()=>K,Object.values(K));return B.createElement(ce.Provider,{value:ve},F)}function M(D,j){const F=(j==null?void 0:j[i][E])||x,K=B.useContext(F);if(K)return K;if(m!==void 0)return m;throw new Error(`\`${D}\` must be used within \`${g}\``)}return T.displayName=g+"Provider",[T,M]}const v=()=>{const g=c.map(m=>B.createContext(m));return function(x){const E=(x==null?void 0:x[i])||g;return B.useMemo(()=>({[`__scope${i}`]:{...x,[i]:E}}),[x,E])}};return v.scopeName=i,[p,J2(v,...u)]}function J2(...i){const u=i[0];if(i.length===1)return u;const c=()=>{const p=i.map(v=>({useScope:v(),scopeName:v.scopeName}));return function(g){const m=p.reduce((x,{useScope:E,scopeName:T})=>{const D=E(g)[`__scope${T}`];return{...x,...D}},{});return B.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return c.scopeName=u.scopeName,c}function xC(i,u,{checkForDefaultPrevented:c=!0}={}){return function(v){if(i==null||i(v),c===!1||!v.defaultPrevented)return u==null?void 0:u(v)}}function wC(i){const u=B.useRef(i);return B.useEffect(()=>{u.current=i}),B.useMemo(()=>(...c)=>{var p;return(p=u.current)===null||p===void 0?void 0:p.call(u,...c)},[])}function q2({prop:i,defaultProp:u,onChange:c=()=>{}}){const[p,v]=eO({defaultProp:u,onChange:c}),g=i!==void 0,m=g?i:p,x=wC(c),E=B.useCallback(T=>{if(g){const D=typeof T=="function"?T(i):T;D!==i&&x(D)}else v(T)},[g,i,v,x]);return[m,E]}function eO({defaultProp:i,onChange:u}){const c=B.useState(i),[p]=c,v=B.useRef(p),g=wC(u);return B.useEffect(()=>{v.current!==p&&(g(p),v.current=p)},[p,v,g]),c}function tO(i){const u=B.useRef({value:i,previous:i});return B.useMemo(()=>(u.current.value!==i&&(u.current.previous=u.current.value,u.current.value=i),u.current.previous),[i])}const X0=globalThis!=null&&globalThis.document?B.useLayoutEffect:()=>{};function nO(i){const[u,c]=B.useState(void 0);return X0(()=>{if(i){c({width:i.offsetWidth,height:i.offsetHeight});const p=new ResizeObserver(v=>{if(!Array.isArray(v)||!v.length)return;const g=v[0];let m,x;if("borderBoxSize"in g){const E=g.borderBoxSize,T=Array.isArray(E)?E[0]:E;m=T.inlineSize,x=T.blockSize}else m=i.offsetWidth,x=i.offsetHeight;c({width:m,height:x})});return p.observe(i,{box:"border-box"}),()=>p.unobserve(i)}else c(void 0)},[i]),u}function rO(i,u){return B.useReducer((c,p)=>{const v=u[c][p];return v??c},i)}const CC=i=>{const{present:u,children:c}=i,p=aO(u),v=typeof c=="function"?c({present:p.isPresent}):B.Children.only(c),g=SC(p.ref,v.ref);return typeof c=="function"||p.isPresent?B.cloneElement(v,{ref:g}):null};CC.displayName="Presence";function aO(i){const[u,c]=B.useState(),p=B.useRef({}),v=B.useRef(i),g=B.useRef("none"),m=i?"mounted":"unmounted",[x,E]=rO(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return B.useEffect(()=>{const T=rm(p.current);g.current=x==="mounted"?T:"none"},[x]),X0(()=>{const T=p.current,M=v.current;if(M!==i){const j=g.current,F=rm(T);i?E("MOUNT"):F==="none"||(T==null?void 0:T.display)==="none"?E("UNMOUNT"):E(M&&j!==F?"ANIMATION_OUT":"UNMOUNT"),v.current=i}},[i,E]),X0(()=>{if(u){const T=D=>{const F=rm(p.current).includes(D.animationName);D.target===u&&F&&Jx.flushSync(()=>E("ANIMATION_END"))},M=D=>{D.target===u&&(g.current=rm(p.current))};return u.addEventListener("animationstart",M),u.addEventListener("animationcancel",T),u.addEventListener("animationend",T),()=>{u.removeEventListener("animationstart",M),u.removeEventListener("animationcancel",T),u.removeEventListener("animationend",T)}}else E("ANIMATION_END")},[u,E]),{isPresent:["mounted","unmountSuspended"].includes(x),ref:B.useCallback(T=>{T&&(p.current=getComputedStyle(T)),c(T)},[])}}function rm(i){return(i==null?void 0:i.animationName)||"none"}const EC=B.forwardRef((i,u)=>{const{children:c,...p}=i,v=B.Children.toArray(c),g=v.find(oO);if(g){const m=g.props.children,x=v.map(E=>E===g?B.Children.count(m)>1?B.Children.only(null):B.isValidElement(m)?m.props.children:null:E);return B.createElement(K0,La({},p,{ref:u}),B.isValidElement(m)?B.cloneElement(m,void 0,x):null)}return B.createElement(K0,La({},p,{ref:u}),c)});EC.displayName="Slot";const K0=B.forwardRef((i,u)=>{const{children:c,...p}=i;return B.isValidElement(c)?B.cloneElement(c,{...lO(p,c.props),ref:u?bC(u,c.ref):c.ref}):B.Children.count(c)>1?B.Children.only(null):null});K0.displayName="SlotClone";const iO=({children:i})=>B.createElement(B.Fragment,null,i);function oO(i){return B.isValidElement(i)&&i.type===iO}function lO(i,u){const c={...u};for(const p in u){const v=i[p],g=u[p];/^on[A-Z]/.test(p)?v&&g?c[p]=(...x)=>{g(...x),v(...x)}:v&&(c[p]=v):p==="style"?c[p]={...v,...g}:p==="className"&&(c[p]=[v,g].filter(Boolean).join(" "))}return{...i,...c}}const TC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((i,u)=>{const c=B.forwardRef((p,v)=>{const{asChild:g,...m}=p,x=g?EC:u;return B.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),B.createElement(x,La({},m,{ref:v}))});return c.displayName=`Primitive.${u}`,{...i,[u]:c}},{}),kC="Checkbox",[uO,C4]=K2(kC),[sO,cO]=uO(kC),fO=B.forwardRef((i,u)=>{const{__scopeCheckbox:c,name:p,checked:v,defaultChecked:g,required:m,disabled:x,value:E="on",onCheckedChange:T,...M}=i,[D,j]=B.useState(null),F=SC(u,de=>j(de)),K=B.useRef(!1),ce=D?!!D.closest("form"):!0,[ve=!1,Qe]=q2({prop:v,defaultProp:g,onChange:T}),J=B.useRef(ve);return B.useEffect(()=>{const de=D==null?void 0:D.form;if(de){const Se=()=>Qe(J.current);return de.addEventListener("reset",Se),()=>de.removeEventListener("reset",Se)}},[D,Qe]),B.createElement(sO,{scope:c,state:ve,disabled:x},B.createElement(TC.button,La({type:"button",role:"checkbox","aria-checked":gs(ve)?"mixed":ve,"aria-required":m,"data-state":_C(ve),"data-disabled":x?"":void 0,disabled:x,value:E},M,{ref:F,onKeyDown:xC(i.onKeyDown,de=>{de.key==="Enter"&&de.preventDefault()}),onClick:xC(i.onClick,de=>{Qe(Se=>gs(Se)?!0:!Se),ce&&(K.current=de.isPropagationStopped(),K.current||de.stopPropagation())})})),ce&&B.createElement(vO,{control:D,bubbles:!K.current,name:p,value:E,checked:ve,required:m,disabled:x,style:{transform:"translateX(-100%)"}}))}),dO="CheckboxIndicator",pO=B.forwardRef((i,u)=>{const{__scopeCheckbox:c,forceMount:p,...v}=i,g=cO(dO,c);return B.createElement(CC,{present:p||gs(g.state)||g.state===!0},B.createElement(TC.span,La({"data-state":_C(g.state),"data-disabled":g.disabled?"":void 0},v,{ref:u,style:{pointerEvents:"none",...i.style}})))}),vO=i=>{const{control:u,checked:c,bubbles:p=!0,...v}=i,g=B.useRef(null),m=tO(c),x=nO(u);return B.useEffect(()=>{const E=g.current,T=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(T,"checked").set;if(m!==c&&D){const j=new Event("click",{bubbles:p});E.indeterminate=gs(c),D.call(E,gs(c)?!1:c),E.dispatchEvent(j)}},[m,c,p]),B.createElement("input",La({type:"checkbox","aria-hidden":!0,defaultChecked:gs(c)?!1:c},v,{tabIndex:-1,ref:g,style:{...i.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function gs(i){return i==="indeterminate"}function _C(i){return gs(i)?"indeterminate":i?"checked":"unchecked"}const hO=fO,mO=pO,yO=({useForm:i,label:u,bind:c,options:p})=>{const{container:v,checkbox:g}=B.useMemo(()=>p!=null&&p.variant?sC({variant:p.variant}):sC(),[]),{field:{onChange:m,value:x}}=U0({name:c,control:i?i.control:void 0,defaultValue:!1,rules:{required:p!=null&&p.optionalField?!1:`${u} is required`}});return bt.jsxs("label",{className:v(),children:[bt.jsx(hO,{className:g(),defaultChecked:x,onCheckedChange:E=>{m(E)},children:bt.jsx(mO,{className:"text-input",children:bt.jsx(Y2,{className:"w-4"})})}),bt.jsx(ip,{className:"text-label",required:!(p!=null&&p.optionalField),children:u})]})},gO=new Map().set("simple",y2).set("textarea",g2).set("toggle",P2).set("file",G2).set("submit",Q2).set("checkbox",yO),RC=({subtype:i="simple",...u})=>{const c=gO.get(i);return c?bt.jsx(c,{...u}):bt.jsx(bt.Fragment,{})},DC=({$config:i,$blocks:u,$containers:c,$available:p})=>{const v={...i},g=v.type.length,m=v.type.indexOf(":"),x=v.type.substring(0,m>0?v.type.lastIndexOf(":"):g+1),E=m>0&&m+1!==g?v.type.substring(m+1,g+1):void 0;if(p==null?void 0:p.has(x)){const M=u==null?void 0:u.get(x),D=c==null?void 0:c.get(x);v.type=x,v.subtype=v.subtype?v.subtype:E,v.block=M,v.container=D}return v.label&&(v.label=bD.parse(v.label)),v.items&&Array.isArray(v.items)&&(v.items=v.items.map(M=>DC({$config:M,$available:p,$blocks:u,$containers:c}))),v},bO=i=>{const u=new Map([...new Map(i.$blocks),...new Map(i.$containers)]);return DC({...i,$available:u})},SO=new Map().set("input",RC),xO=new Map().set("form",FD),OC=({config:i})=>{const{key:u,type:c,subtype:p,label:v,bind:g,items:m,block:x,container:E,...T}=i;if(!c)return null;if(E&&m&&Array.isArray(m)){const M=E;return bt.jsx(M,{subtype:p,label:v,...T,children:m.map((D,j)=>{var F;return bt.jsx(OC,{config:{...T,...D,options:{...D.options,variant:(F=T.options)==null?void 0:F.variant}}},j)})},u)}if(x){const M=x;return bt.jsx(M,{subtype:p,label:v,bind:g,...T},u)}return null},wO=({config:i,options:u})=>{const c=bO({$blocks:SO,$containers:xO,$config:{type:"form",items:i||[],options:u}});return bt.jsx(OC,{config:c})},CO=T_(RR),EO=W_(wO,{props:{config:"json",options:"json"},shadow:"open"});class TO extends CO(EO){}customElements.define("twintag-form",TO)});