@jfdevelops/react-multi-step-form 1.0.0-alpha.1 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,16 +1,18 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react/jsx-runtime"),I=require("react");function N(o,e,t){const r=[],s=new Set(o),n=t?t.format(o.map(a=>`${a}`)):`[${o.join(", ")}]`;for(let a=0;a<e.length;a++){const c=e[a];s.has(c)||r.push(`Extra element at index ${a}: "${c}" is not in ${n}`)}return e.some(a=>s.has(a))||r.push(`Array must contain at least one valid element from ${n}`),r.length>0?{status:"error",errors:r}:{status:"success"}}function V(o){return o.map((e,t)=>`❌ ${t+1}. ${e}`).join(`
2
- `)}function Se(o,...e){return()=>String.raw({raw:o},...e)}function d(o,e,t=Error){if(!o){const r=typeof e=="function"?e():Se`${e}`();throw new t(r)}}function G(o,e){const t=o["~standard"].validate(e);if(t instanceof Promise)throw new TypeError("Schema validation must be synchronous",{cause:o});if(t.issues)throw new Error(JSON.stringify(t.issues,null,2));return t.value}function C(o){d(o.includes("step"),"Can't extract a valid step number since");const e=o.replace("step","");return d(/^\d+$/.test(e),`Invalid step format: "${o}"`),Number.parseInt(e,10)}function j(o){return function(e){const{step:t}=e,r=`step${t}`,s=o[r];return{step:t,data:s}}}function q(o,e){return e.reduce((t,r)=>{const s=C(r),{data:n}=j(o)({step:s});for(const[a,c]of Object.entries(n))typeof c=="function"&&a!=="update"||(n[a]=c);return t[r]=n,t},{})}function U(o,e){const t=new Intl.ListFormat("en",{style:"long",type:"disjunction"}),r=Object.keys(o),s=()=>`"stepData" must be set to an array of available steps (${t.format(r)})`;if(e==="all"){let n={};for(const a of r)n={...n,[a]:j(o)({step:C(a)})};return Object.fromEntries(r.map(a=>[a,j(o)({step:C(a)})]))}if(Array.isArray(e))return d(e.every(n=>r.includes(n)),()=>{const n=N(e,r.map(a=>C(a)),t);return n.status==="error"?`${s()}. See errors:
3
- ${V(n.errors)}`:s()}),q(o,e);if(typeof e=="object"){const n=Object.keys(e);return d(n.every(a=>r.includes(a)),()=>{const a=N(n,r,t);return a.status==="error"?`${s()}. See errors:
4
- ${V(a.errors)}`:s()}),q(o,n)}throw new Error(`${s()} OR to "all"`)}function J(o,e){return typeof o=="function"?o(e):o}class be{values;stepNumbers;constructor(e,t){this.stepNumbers=t,this.values=e}createCtxHelper(e){return e.reduce((t,r)=>{const s=C(r),{data:n}=j(this.values)({step:s});for(const[a,c]of Object.entries(n))typeof c=="function"&&a!=="update"||(n[a]=c);return t[r]=n,t},{})}createCtx(e){const t=new Intl.ListFormat("en",{style:"long",type:"disjunction"}),r=this.stepNumbers.map(n=>`step${n}`),s=()=>`"stepData" must be set to an array of available steps (${t.format(r)})`;if(e==="all")return this.stepNumbers.reduce((n,a)=>{const c=`step${a}`;return n[c]=j(this.values)({step:a}).data,n},{});if(Array.isArray(e))return d(e.every(n=>r.includes(n)),()=>{const n=N(e,this.stepNumbers,t);return n.status==="error"?`${s()}. See errors:
5
- ${V(n.errors)}`:s()}),this.createCtxHelper(e);if(typeof e=="object"){const n=Object.keys(e);return d(n.every(a=>r.includes(a)),()=>{const a=N(n,r,t);return a.status==="error"?`${s()}. See errors:
6
- ${V(a.errors)}`:s()}),this.createCtxHelper(n)}throw new Error(`${s()} OR to "all"`)}createStepHelperFnImpl(e){return(t,r)=>{const s=this.createCtx(e);if(typeof t=="function")return()=>t({ctx:s});if(typeof t=="object")return n=>"validator"in t?(d(typeof n=="object","An input is expected since you provided a validator"),G(t.validator,n.data),r({ctx:s,...n})):r({ctx:s});throw new Error(`The first argument must be a function or an object, (was ${typeof t})`)}}}class ve{prefix;includeTimestamp;throwOnError;constructor(e){const{includeTimestamp:t,prefix:r,throwOnError:s}=e??{};this.prefix=r??"MultiStepFormSchema",this.includeTimestamp=t??!1,this.throwOnError=s??!1}wrapValue(e,t){if(e==="[]")return`[${t}]`;if(e==="{}")return`{${t}}`;if(e==="none")return t;throw new Error(`The first argument ${e} is not valid. Valid options include: "[]", "{}", and "none"`)}formatPrefix(e){if(!e)return this.prefix;const{action:t,value:r,wrapWith:s}=e;if(t==="replace")return this.wrapValue(s??"[]",r);const{delimiter:n}=e;return t==="append"?`${this.wrapValue(s?.originalPrefix??"[]",this.prefix)}${n}${this.wrapValue(s?.addedPrefix??"[]",r)}`.trim():t==="prepend"?`${this.wrapValue(s?.addedPrefix??"[]",r)}${n}${this.wrapValue(s?.originalPrefix??"[]",this.prefix)}`.trim():this.prefix}formatMessage(e,t,r){const{includeTimestamp:s=this.includeTimestamp,prefix:n,logLevelOptions:a}=r??{},c=this.formatPrefix(n),y=this.wrapValue(a?.wrapWith??"[]",(a?.level??e).toUpperCase()),p=`${c} ${y} ${t}`;return s?`[${new Date().toISOString()}] ${p}`:p}info(e,t){console.info(this.formatMessage("info",e,t))}warn(e,t){console.warn(this.formatMessage("warn",e,t))}error(e,t){const r=this.formatMessage("error",e,t);if(console.error(r),t?.throw??this.throwOnError)throw new Error(r)}}const Y='"window" in undefined. No storage is available',K="MultiStepForm";class ie{key;store;data;log;isWindowUndefined;constructor(e){const{key:t,data:r,store:s}=e;this.log=new ve({prefix:K}),this.key=t,this.data=r,s?(this.store=s,this.isWindowUndefined=!1):typeof window<"u"?(this.store=window.localStorage,this.isWindowUndefined=!1):(this.isWindowUndefined=!0,this.log.warn(Y))}throwOnEmptyStore(){d(this.store,()=>this.isWindowUndefined?Y:"No storage available")}resolveValue(e){if(typeof e=="object")return e;if(typeof e=="function")return e(this.data);this.log.error(`The updater value must be a function or object. Was a ${typeof e}`,{throw:!0})}hasKey(){return this.store.getItem(this.key)!==null}get(){this.throwOnEmptyStore();const e=this.store.getItem(this.key);if(e)return JSON.parse(e)}remove(){this.throwOnEmptyStore(),this.store.removeItem(this.key)}add(e){this.throwOnEmptyStore();const t=JSON.stringify(this.resolveValue(e));this.store.setItem(this.key,t)}}const ge=["sentence","title","camel","lower","upper","pascal","snake","screaming-snake","flat","kebab"],P="title";function we(o,e){const t=o.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim().split(/\s+/).map(r=>r.toLowerCase());switch(e){case"sentence":return t[0].charAt(0).toUpperCase()+t[0].slice(1)+(t.length>1?" "+t.slice(1).join(" "):"");case"title":return t.map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ");case"camel":return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");case"pascal":return t.map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");case"lower":return t.join(" ");case"upper":return t.join(" ").toUpperCase();case"snake":return t.join("_");case"screaming-snake":return t.join("_").toUpperCase();case"kebab":return t.join("-");case"flat":return t.join("");default:return o}}function H(o){return typeof o!="string"?!1:ge.includes(o)}function ue(o,e=P){return H(o)?o:e}const _e=["string","string.phone","string.email","string.time","number","number.counter","date","dateTime","boolean.switch"],Z="string";function Te(o){return typeof o=="string"&&_e.includes(o)}class ce{listeners=new Set;constructor(){this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const $e=["string","number","array.string","array.string.untyped"],le=/^step\d+$/i;function Q(o,e){if(typeof o!="object"||o===null)return!1;for(const t of Object.keys(e)){if(!(t in o))return!1;const r=e[t],s=o[t];if(!r(s))return!1}return!0}function X(o,e,t){return o??we(e,t)}function Ee(o){const e={},{fields:t,defaultCasing:r,validateFields:s}=o;for(const[n,a]of Object.entries(t)){d(typeof n=="string",`Each key for the "fields" option must be a string. Key ${n} was a ${typeof n}`),d(typeof a=="object",`The value for key ${n} must be an object. Was ${typeof a}`);const{defaultValue:c,label:y,nameTransformCasing:p,type:l=Z}=a;if(s)e[n]=c;else{const u=p??r;e[n]={...e[n],nameTransformCasing:u,type:l,defaultValue:c,label:X(y,n,u)}}}if(s){const n=G(s,e);d(typeof n=="object",`The result of the validated fields must be an object, was (${typeof n}). This is probably an internal error, so open up an issue about it`),d(!!n,"The result of the validated fields must be defined. This is probably an internal error, so open up an issue about it");for(const[a,c]of Object.entries(n)){const y=t[a];d(y,`No field found in the fields config for "${a}"`);const{label:p,type:l=Z,nameTransformCasing:u}=y,f=u??r;e[a]={...e[a],nameTransformCasing:f,type:l,defaultValue:c,label:X(p,a,f)}}}return e}function fe(o){const e={};d(!!o,"The steps config must be defined",TypeError),d(typeof o=="object",`The steps config must be an object, was (${typeof o})`,TypeError);for(const[t,r]of Object.entries(o)){d(typeof t=="string",`Each key for the step config must be a string. Key "${t}" was ${typeof t} `,TypeError),d(le.test(t),`The key "${t}" isn't formatted properly. Each key in the step config must be the following format: "step{number}"`);const s=t,{fields:n,title:a,nameTransformCasing:c=P,description:y,validateFields:p}=r,l=s.toString().replace("step","");d(n,`Missing fields for step ${l} (${String(s)})`,TypeError),d(typeof n=="object","Fields must be an object",TypeError),d(Object.keys(n).length>0,`The fields config for step ${l} (${String(s)}) is empty. Please add a field`),d(typeof n=="object",`The "fields" property must be an object. Was ${typeof n}`);const u=Ee({defaultCasing:c,fields:n,validateFields:p});e[s]={...e[s],title:a,nameTransformCasing:c,...typeof y=="string"?{description:y}:{},fields:u}}return e}class B extends ce{original;value;steps;defaultNameTransformationCasing;firstStep;lastStep;stepNumbers;storage;constructor(e){super();const{steps:t,nameTransformCasing:r,storage:s}=e;this.defaultNameTransformationCasing=ue(r),this.original=t,this.value=this.enrichValues(fe(this.original)),this.stepNumbers=Object.keys(this.value).map(n=>Number.parseInt(n.replace("step",""))),this.storage=new ie({data:this.value,key:s?.key??K,store:s?.store}),this.firstStep=this.first(),this.lastStep=this.last(),this.steps={first:this.firstStep.step,last:this.lastStep.step,value:this.stepNumbers,as:n=>{if(d(typeof n=="string",`The type of the target transformation type must be a string, was ${typeof n}`),n==="string")return this.stepNumbers.map(a=>`'${a}'`).join(" | ");if(n==="number")return this.stepNumbers.join(" | ");if(n.includes("array.string"))return this.stepNumbers.map(a=>`${a}`);throw new Error(`Transformation type "${n}" is not supported. Available transformations include: ${$e.map(a=>`"${a}"`).join(", ")}`)},isValidStepNumber:n=>this.stepNumbers.includes(n),isValidStepKey:n=>Object.keys(this.value).includes(n)}}getSnapshot(){return this}notify(){for(const e of this.listeners)e({defaultNameTransformationCasing:this.defaultNameTransformationCasing,original:this.original,steps:this.steps,value:this.value})}enrichValues(e,t){for(const[r,s]of Object.entries(e)){const n=Number.parseInt(r.replace("step",""));e={...e,[r]:{...s,update:this.createStepUpdaterFn(n),createHelperFn:this.createStepHelperFn(n),...t?.(n)}}}return e}get(e){return j(this.value)(e)}first(){const e=Math.min(...this.stepNumbers);return this.get({step:e})}last(){const e=Math.max(...this.stepNumbers);return this.get({step:e})}handlePostUpdate(){this.storage.add(this.value),this.notify()}createStepUpdaterFnImpl(e,t,r){const s=this.stepNumbers;d(typeof e=="number",`Type of step must be a number, was ${typeof e}`,TypeError),d(s.includes(e),`The target step ${e} is not valid. Valid steps include "${s.join(", ")}"`);const n=`step${e}`;if(typeof t=="string"){d(this.value[n],`No data found for step ${e}`),d(typeof this.value[n]=="object",`The values for step ${e} is not an object, was ${typeof this.value[n]}`),d(t in this.value[n],`The field ${t} is not a valid field. Valid fields include ${Object.keys(this.value[n]).join(", ")}`),d(typeof r=="object"||typeof r=="function",()=>{let a="";return typeof r!="object"&&(a="an object"),typeof r!="function"&&(a="a function"),`[${String(n)}-${t}]: The updater must be ${a}, was "${typeof r}"`},TypeError),this.value={...this.value,[n]:{...this.value[n],[t]:J(r,this.value[n][t])}},this.handlePostUpdate();return}if(typeof t=="object"||typeof t=="function"){const a=J(t,this.value[n]);d(typeof a=="object",`The updated data must be an object, was ${typeof a}`),this.value={...this.value,[n]:{...this.value[n],...a}},this.handlePostUpdate();return}throw new TypeError(`The second parameter must be one of the following: a specific field to update (string), an object with the updated data, or a function that returns the updated data. It was ${typeof t}`,{cause:t})}createStepUpdaterFn(e){return(t,r)=>{this.createStepUpdaterFnImpl(e,t,r)}}update(e,t,r){this.createStepUpdaterFnImpl(e,t,r)}createStepHelperFnImpl(e){return(t,r)=>{const s=U(this.value,e);if(typeof t=="function")return()=>t({ctx:s});if(typeof t=="object")return n=>"validator"in t?(d(typeof n=="object","An input is expected since you provided a validator"),G(t.validator,n.data),r({ctx:s,...n})):r({ctx:s});throw new Error(`The first argument must be a function or an object, (was ${typeof t})`)}}createStepHelperFn(e){return this.createStepHelperFnImpl([`step${e}`])}createHelperFn(e,t){const{stepData:r,...s}=e;return this.createStepHelperFnImpl(r)(s,t)}static hasData(e,t){return e===null||typeof e!="object"?!1:Q(e,{title:r=>typeof r=="string",fields:r=>{if(r===null||typeof r!="object")return!1;for(const s of Object.keys(r)){if(typeof s!="string"||!(s in r))return!1;const n=r[s];if(n===null||typeof n!="object"||!Q(n,{defaultValue:a=>a!=="undefined"&&a!==null,label:a=>typeof a=="string"||typeof a=="boolean"&&!a,nameTransformCasing:H,type:Te}))return!1}return!0},createHelperFn:r=>typeof r=="function",update:r=>typeof r=="function",nameTransformCasing:H,...t?.optionalKeysToCheck})}}class Oe extends ce{stepHelper;defaultNameTransformationCasing;stepSchema;storage;mountCount=0;constructor(e){super();const{steps:t,nameTransformCasing:r,storage:s}=e;this.defaultNameTransformationCasing=ue(r),this.stepSchema=new B({steps:t,nameTransformCasing:this.defaultNameTransformationCasing}),this.stepHelper=new be(this.stepSchema.value,this.stepSchema.steps.value),this.storage=new ie({key:s?.key??K,data:this.stepSchema.value,store:s?.store}),this.stepSchema.subscribe(()=>{this.notify()})}getSnapshot(){return this}mount(){return this.mountCount++,this.mountCount===1&&this.onMount(),()=>{this.unmount()}}unmount(){this.mountCount=Math.max(0,this.mountCount-1),this.mountCount===0&&this.onUnmount()}isMounted(){return this.mountCount>0}onMount(){}onUnmount(){}notify(){for(const e of this.listeners)e({nameTransformCasing:this.defaultNameTransformationCasing,storage:{key:this.storage.key,store:this.storage.store},steps:this.stepSchema.original})}}function je(o){function e(t){const{children:r,name:s}=t;return r(o(s))}return e}var O;(o=>{o.DEFAULT_FORM_ALIAS="Form";function e(r,s){if(Array.isArray(r)){if(s==="all")return!0;if(typeof s=="object"&&!Array.isArray(s))return Object.keys(s).some(n=>r.includes(n));if(Array.isArray(s))return s.some(n=>r.includes(n))}return!1}o.isFormAvailable=e;function t(r){return s=>R.jsx("form",{id:r,...s})}o.createDefaultForm=t})(O||(O={}));exports.StepSpecificComponent=void 0;(o=>{o.DEFAULT_FORM_INSTANCE_ALIAS="form"})(exports.StepSpecificComponent||(exports.StepSpecificComponent={}));function pe(o,e){d(e in o,`The target step ${e} is not a valid step key`);const t=o[e];d("fields"in t,`No "fields" were found for ${e}`);let r={};for(const[s,n]of Object.entries(t.fields))r={...r,[s]:n.defaultValue};return r}class de extends B{value;constructor(e){const{form:t,...r}=e;super(r),this.value=this.enrichValues(fe(this.original)),this.value=this.enrichValues(this.value,s=>{const n=`step${s}`,a=t?.id??n;return{createComponent:this.createComponentForStep([`step${s}`],{isStepSpecific:!0,defaultId:a,form:t})}})}createFormComponent(e,t){const{render:r,enabledForSteps:s="all",id:n=t}=e,a={id:n,steps:U(this.value,s)};return c=>r(a,c)}createStepSpecificComponentImpl(e,t,r,s={}){return n=>(a=>{const c={};for(const[l,u]of Object.entries(s))if(typeof u=="function")try{const f=u();c[l]=f,typeof console<"u"&&console.debug&&console.debug(`[multi-step-form] Hook "${l}" called successfully`,{result:f!==void 0?"defined":"undefined"})}catch(f){const i=f instanceof Error?f.message:String(f);throw new Error(`[multi-step-form] Error calling hook "${l}" in useFormInstance.render: ${i}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react/jsx-runtime"),R=require("react");function M(o,e,t){const r=[],s=new Set(o),n=t?t.format(o.map(u=>`${u}`)):`[${o.join(", ")}]`;for(let u=0;u<e.length;u++){const S=e[u];s.has(S)||r.push(`Extra element at index ${u}: "${S}" is not in ${n}`)}return e.some(u=>s.has(u))||r.push(`Array must contain at least one valid element from ${n}`),r.length>0?{status:"error",errors:r}:{status:"success"}}function U(o,e){const t=(r,s)=>`❌ ${s+1}. ${r}`;return o.map((r,s)=>t(r,s)).join(`
2
+ `)}function ie(o){return Object.keys(o)}function Ce(o,...e){return()=>String.raw({raw:o},...e)}function E(o,e,t=Error){if(!o){const r=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),s=typeof e=="function"?e(r):Ce`${e}`();throw new t(s)}}function Y(o){E(o.includes("step"),"Can't extract a valid step number since");const e=o.replace("step","");return E(/^\d+$/.test(e),`Invalid step format: "${o}"`),Number.parseInt(e,10)}function ee(o){return function(e){const{step:t}=e,r=`step${t}`,s=o[r];return{step:t,data:s}}}function K(o,e){return e.reduce((t,r)=>{const s=Y(r),{data:n}=ee(o)({step:s});for(const[a,u]of Object.entries(n))typeof u=="function"&&a!=="update"||(n[a]=u);return t[r]=n,t},{})}function L(o,e){const t=new Intl.ListFormat("en",{style:"long",type:"disjunction"}),r=Object.keys(o),s=()=>`"stepData" must be set to an array of available steps (${t.format(r)})`;if(e==="all"){let n={};for(const a of r)n={...n,[a]:ee(o)({step:Y(a)})};return K(o,r)}if(Array.isArray(e))return E(e.every(n=>r.includes(n)),()=>{const n=M(e,r.map(a=>Y(a)),t);return n.status==="error"?`${s()}. See errors:
3
+ ${U(n.errors)}`:s()}),K(o,e);if(typeof e=="object"){const n=Object.keys(e);return E(n.every(a=>r.includes(a)),()=>{const a=M(n,r,t);return a.status==="error"?`${s()}. See errors:
4
+ ${U(a.errors)}`:s()}),K(o,n)}throw new Error(`${s()} OR to "all"`)}function Fe(o,e){return typeof o=="function"?o(e):o}const G="MultiStepFormSchema";class te{debug;prefix=G;includeTimestamp=!1;throwOnError=!1;constructor(e){if(this.debug=e?.debug??!1,this.debug&&e?.debug){const{includeTimestamp:t=!1,prefix:r=G,throwOnError:s=!1}=e;this.includeTimestamp=t,this.prefix=typeof r=="string"?r:r(G),this.throwOnError=s}}wrapValue(e,t){if(e==="[]")return`[${t}]`;if(e==="{}")return`{${t}}`;if(e==="none")return t;throw new Error(`The first argument ${e} is not valid. Valid options include: "[]", "{}", and "none"`)}formatPrefix(e){if(!e)return this.prefix;const{action:t,value:r,wrapWith:s}=e;if(t==="replace")return this.wrapValue(s??"[]",r);const{delimiter:n}=e;return t==="append"?`${this.wrapValue(s?.originalPrefix??"[]",this.prefix)}${n}${this.wrapValue(s?.addedPrefix??"[]",r)}`.trim():t==="prepend"?`${this.wrapValue(s?.addedPrefix??"[]",r)}${n}${this.wrapValue(s?.originalPrefix??"[]",this.prefix)}`.trim():this.prefix}formatMessage(e,t,r){const{includeTimestamp:s=this.includeTimestamp,prefix:n,logLevelOptions:a}=r??{},u=this.formatPrefix(n),S=this.wrapValue(a?.wrapWith??"[]",(a?.level??e).toUpperCase()),g=`${u} ${S} ${t}`;return s?`[${new Date().toISOString()}] ${g}`:g}info(e,t){this.debug&&console.info(this.formatMessage("info",e,t))}warn(e,t){this.debug&&console.warn(this.formatMessage("warn",e,t))}error(e,t){if(!this.debug)return;const r=this.formatMessage("error",e,t);if(console.error(r),t?.throw??this.throwOnError)throw new Error(r)}}var C;(o=>{function e(i,l){return l.split(".").reduce((d,c)=>d?.[c],i)}function t(i,l,d){const c=l.split(".");let m=i;for(let _=0;_<c.length;_++){const $=c[_];_===c.length-1?m[$]!==void 0&&typeof m[$]=="object"&&typeof d=="object"&&d!==null?Object.assign(m[$],d):m[$]=d:((typeof m[$]!="object"||m[$]===null)&&(m[$]={}),m=m[$])}return m}o.setBy=t;function r(i){return i.filter(l=>!i.some(d=>d!==l&&l.startsWith(d+".")))}function s(i,...l){const d=r(l);if(d.length===1)return e(i,d[0]);const c={};for(const m of d){const _=e(i,m);t(c,m,_)}return c}o.pickBy=s;function n(i){const l=[];function d(c,m=""){if(c==null||typeof c!="object"||Array.isArray(c))return;const _=Object.keys(c);for(const $ of _){const A=m?`${m}.${$}`:$;l.push(A);const T=c[$];T!=null&&typeof T=="object"&&!Array.isArray(T)&&d(T,A)}}return d(i),l}o.createDeep=n;function a(i){if(i===null)return"null";if(Array.isArray(i))return"Array";const l=typeof i;if(l!=="object")return l;const d=i?.constructor?.name;return d&&d!=="Object"?d:"object"}function u(i){if(!i)return[];const l=[],d=/[^.[\]]+|\[(\d+)\]/g;let c;for(;c=d.exec(i);)l.push(c[1]??c[0]);return l}function S(i,l){if(!i)return;if(typeof i=="function")return i;const d=u(l);let c=i,m;for(const _ of d){if(!c)break;if(typeof c=="function"){m=c;break}if(c=c[_],typeof c=="function"){m=c;break}}return m}function g(i,l,d){const c=S(d,l);return c?c(i,l):a(i)}function p(i){return typeof i=="object"&&i!==null}function f(i,l,d,c,m){if(i===l)return c;if(i===null||l===null||typeof i!="object"||typeof l!="object"){const $=d||"(root)";return typeof i!=typeof l?(c.push({path:$,expected:g(i,$,m.transformExpected),actual:l,reason:"type-mismatch"}),c):(m.includeValueMismatch&&c.push({path:$,expected:g(i,$,m.transformExpected),actual:l,reason:"value-mismatch"}),c)}if(Array.isArray(i)||Array.isArray(l)){if(!Array.isArray(i)||!Array.isArray(l)){const A=d||"(root)";return c.push({path:A,expected:g(i,A,m.transformExpected),actual:l,reason:"type-mismatch"}),c}const $=i.length;for(let A=0;A<$;A++){const T=i[A],F=l[A],N=d===""?`[${A}]`:`${d}[${A}]`;f(T,F,N,c,m)}return c}if(p(i)&&p(l)){const $=Object.keys(i),A=Object.keys(l);for(const T of $){const F=i[T],N=l[T],V=d?`${d}.${T}`:T;if(!(T in l)){c.push({path:V,expected:g(F,V,m.transformExpected),actual:void 0,reason:"missing-key"});continue}f(F,N,V,c,m)}for(const T of A)if(!(T in i)){const F=d?`${d}.${T}`:T;c.push({path:F,expected:void 0,actual:l[T],reason:"extra-key"})}return c}const _=d||"(root)";return typeof i!=typeof l?c.push({path:_,expected:g(i,_,m.transformExpected),actual:l,reason:"type-mismatch"}):m.includeValueMismatch&&c.push({path:_,expected:g(i,_,m.transformExpected),actual:l,reason:"value-mismatch"}),c}function v(i,l,d,c){const m=s(i,...l),_=[],$=l.length===1?l[0]:"";return f(m,d,$,_,{transformExpected:c?.transformExpected}),{ok:_.length===0,mismatches:_}}o.equalsAtPaths=v;function y(i){if(i===void 0)return"undefined";if(typeof i=="string")return JSON.stringify(i);try{return JSON.stringify(i,null,2)}catch{return String(i)}}function h(i){switch(i.reason){case"missing-key":return"Missing key";case"extra-key":return"Extra key";case"type-mismatch":return"Type mismatch";case"value-mismatch":return"Value mismatch";default:return i.reason}}function b(i){if(i.ok||i.mismatches.length===0)return"No mismatches.";const l=[];for(const d of i.mismatches)l.push(`
5
+ ${h(d)} at "${d.path}":`,` expected: ${y(d.expected)}`,` actual: ${y(d.actual)}`,"");return l.at(-1)===""&&l.pop(),l.join(`
6
+ `)}o.formatMismatches=b;function O(i){const l=b(i);l!=="No mismatches."&&console.error(l)}o.printMismatches=O;function w(i,l,d){const c=l.split(".");function m(_,$){const A=c[$],T=Array.isArray(_)?[..._]:{..._};if($===c.length-1){let P=_&&typeof _=="object"?T:{};return P={...P,[A]:d},P}const F=_&&typeof _=="object"?_[A]:void 0,N=m(F??{},$+1);let V=_&&typeof _=="object"?T:{};return V={...V,[A]:N},V}return m(i,0)}function j(i,l,d){const c=r(l);if(c.length===0)return i;let m=i;if(c.length===1){const _=c[0];return m=w(m,_,d),m}for(const _ of c){const $=e(d,_);m=w(m,_,$)}return m}o.updateAt=j})(C||(C={}));function ge(o,e){const t=o["~standard"].validate(e);if(t instanceof Promise)throw new TypeError("Schema validation must be synchronous",{cause:o});if(t.issues)throw new Error(JSON.stringify(t.issues,null,2));return t.value}function Se(o,e){return Object.keys(o).includes(e)}class re{#e;#t;get value(){return this.#e()}constructor(e){const{getValue:t,setValue:r}=e;this.#e=t,this.#t=r}handlePostUpdate(e){this.#t(this.enrichValues(e))}createStepUpdaterFnImpl(e){const{targetStep:t,updater:r,ctxData:s,fields:n="all",debug:a}=e,u=new te({debug:a,prefix:h=>`${h}:update${t}`});u.info(`${t} will be updated`),E(Se(this.value,t),`[update]: The target step ${t} isn't a valid step. Please select a valid step`);const{[t]:S,...g}=this.value;let p={...this.value},f=L(p,[t]);if(s){E(typeof s=="function",'[update]: "ctxData" must be a function'),u.info('Custom "ctx" will be used');const h=s({ctx:g});E(typeof h=="object"&&Object.keys(h).length>0,'[update]: "ctxData" must return an object with keys'),u.info(`Custom "ctx" consists of the following keys: ${new Intl.ListFormat("en",{style:"long",type:"conjunction"}).format(Object.keys(h))}`),f={...f,...h}}const v=Fe(r,{ctx:f,update:this.createHelperFnInputUpdate([t])});if(u.info(`The updated data is ${JSON.stringify(v,null,2)}`),!n){E(typeof v=="object",'[update]: "updater" must be an object or a function that returns an object');const h=Object.keys(this.value),b=Object.keys(v);E(b.length===h.length,()=>{const i=h.filter(d=>!b.includes(d));return`[update]: "updater" is missing keys ${new Intl.ListFormat("en",{style:"long",type:"conjunction"}).format(i)}`});const O=C.createDeep(this.value),{mismatches:w,ok:j}=C.equalsAtPaths(this.value,O,v);E(j&&w.length===0,`[update]: found value mismatches in ${C.printMismatches({mismatches:w,ok:j})}`),u.info("The entire step will be updated"),p={...p,[t]:C.updateAt(p,O,v)},this.handlePostUpdate(p),u.info(`The new value is: ${JSON.stringify(p,null,2)}`);return}const y=C.createDeep(S);if(Array.isArray(n)){const h=M(y,n);E(h.status==="success",`[update]: Found errors with the provided fields
7
+ ${h.status==="error"?U(h.errors):""}`);const{mismatches:b,ok:O}=C.equalsAtPaths(S,n,v);E(O&&b.length===0,`[update]: found value mismatches in ${C.printMismatches({ok:O,mismatches:b})}`),u.info(`The following fields will be updated: ${new Intl.ListFormat("en",{type:"conjunction",style:"long"}).format(n)}`),p={...p,[t]:C.updateAt(S,n,v)},this.handlePostUpdate(p),u.info(`The new value is: ${JSON.stringify(p,null,2)}`);return}if(typeof n=="object"&&Object.keys(n).length>0){const h=C.createDeep(n),b=M(y,h);E(b.status==="success",`[update]: Found errors with the provided fields
8
+ ${b.status==="error"?U(b.errors):""}`);const{mismatches:O,ok:w}=C.equalsAtPaths(S,h,v);E(w&&O.length===0,`[update]: found value mismatches in ${C.printMismatches({ok:w,mismatches:O})}`),p={...p,[t]:C.updateAt(S,h,v)},u.info(`The following fields will be updated: ${new Intl.ListFormat("en",{type:"conjunction",style:"long"}).format(Object.keys(n))}`),this.handlePostUpdate(p),u.info(`The new value is: ${JSON.stringify(p,null,2)}`);return}throw u.error('Unsupported value for the "fields" option'),new TypeError(`[update]: property "fields" must be set to one of the following: "all", an array of deep paths to update, or an object of paths. Was ${typeof r}`,{cause:r})}createStepUpdaterFn(e){return t=>{this.createStepUpdaterFnImpl({targetStep:e,...t})}}update(e){return this.createStepUpdaterFnImpl(e)}createHelperFnInputUpdate(e){if(k.isAll(e)){const r=ie(this.value).reduce((n,a)=>(n[a]=this.createStepUpdaterFn(a),n),{});return Object.assign(this.update,r)}const t=Object.keys(this.value);if(k.isTuple(e,t)){const r=e.reduce((n,a)=>(n[a]=this.createStepUpdaterFn(a),n),{});return Object.assign(this.update,r)}if(k.isObject(e,t)){const r=ie(e).reduce((n,a)=>(n[a]=this.createStepUpdaterFn(a),n),{});return Object.assign(this.update,r)}throw new TypeError(`[update]: ${k.CATCH_ALL_MESSAGE}`)}createStepHelperFn(e){return(t,r)=>{const s=L(this.value,e),n=this.createHelperFnInputUpdate(e);if(typeof t=="function")return()=>t({ctx:s,update:n});if(typeof t=="object")return a=>{if("validator"in t){E(typeof a=="object","An input is expected since you provided a validator"),ge(t.validator,a.data);let u=s;if(t.ctxData){const S=e[0],{[S]:g,...p}=this.value;u={...u,...t.ctxData({ctx:p})}}return r({ctx:u,update:n,...a})}return r({ctx:s,update:n})};throw new Error(`The first argument must be a function or an object, (was ${typeof t})`)}}enrichValues(e,t){let r={...e};for(const[s,n]of Object.entries(r)){const[a]=[s],u=Number.parseInt(a.replace("step",""));r[a]={...n,update:this.createStepUpdaterFn(a),createHelperFn:this.createStepHelperFn([a]),...t?.(u)}}return r}}var X;(o=>{function e(t,r,s="defaultValue"){const[n,...a]=t.split("."),u=`${n}.${s}`,S=a.length===0?u:`${u}.${a.join(".")}`;return C.pickBy(r,S)}o.resolvedDeepPath=e})(X||(X={}));var k;(o=>{o.CATCH_ALL_MESSAGE='The chosen steps must either be set to on of the following: "all", an array of steps (["step1", "step2", ...]), or an object containing the steps to chose ({ step1: true, step2: true, ...})';function e(s){return!!(s&&typeof s=="string"&&s==="all")}o.isAll=e;function t(s,n){return Array.isArray(s)?n?s.every(a=>n.includes(a)):!0:!1}o.isTuple=t;function r(s,n){if(!s)return!1;const a=Object.keys(s);return a.length===0||n&&!a.every(u=>n.includes(u))?!1:Object.entries(s).every(([u,S])=>S===!0)}o.isObject=r})(k||(k={}));const Ve=["sentence","title","camel","lower","upper","pascal","snake","screaming-snake","flat","kebab"],ne="title";function ke(o,e){const t=o.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").trim().split(/\s+/).map(r=>r.toLowerCase());switch(e){case"sentence":return t[0].charAt(0).toUpperCase()+t[0].slice(1)+(t.length>1?" "+t.slice(1).join(" "):"");case"title":return t.map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ");case"camel":return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");case"pascal":return t.map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("");case"lower":return t.join(" ");case"upper":return t.join(" ").toUpperCase();case"snake":return t.join("_");case"screaming-snake":return t.join("_").toUpperCase();case"kebab":return t.join("-");case"flat":return t.join("");default:return o}}function Z(o){return typeof o!="string"?!1:Ve.includes(o)}function be(o,e=ne){return Z(o)?o:e}const xe=["string","string.phone","string.email","string.time","number","number.counter","date","dateTime","boolean.switch"],ae="string";function Le(o){return typeof o=="string"&&xe.includes(o)}const W='"window" in undefined. No storage is available',se="MultiStepForm";class ve{key;store;data;log;shouldRunActions;throwWhenUndefined;constructor(e){const{key:t,data:r,store:s,throwWhenUndefined:n=!1}=e;this.log=new te({prefix:se}),this.key=t,this.data=r,this.throwWhenUndefined=n,s?(this.store=s,this.shouldRunActions=!0,typeof window>"u"&&(this.shouldRunActions=!1,this.log.warn(W))):typeof window<"u"?(this.store=window.localStorage,this.shouldRunActions=!0):(this.shouldRunActions=!1,this.log.warn(W))}throwOnEmptyStore(){this.throwWhenUndefined&&E(this.store,()=>this.shouldRunActions?W:"No storage available")}resolveValue(e){if(typeof e=="object")return e;if(typeof e=="function")return e(this.data);this.log.error(`The updater value must be a function or object. Was a ${typeof e}`,{throw:!0})}hasKey(){return this.store.getItem(this.key)!==null}get(){if(this.throwOnEmptyStore(),!this.shouldRunActions)return;const e=this.store.getItem(this.key);if(e)return JSON.parse(e)}remove(){this.throwOnEmptyStore(),this.shouldRunActions&&this.store.removeItem(this.key)}add(e){if(this.throwOnEmptyStore(),!this.shouldRunActions)return;const t=JSON.stringify(this.resolveValue(e));this.store.setItem(this.key,t)}}class Ee{listeners=new Set;constructor(){this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ne=["string","number","array.string","array.string.untyped"],_e=/^step\d+$/i;function ue(o,e){if(typeof o!="object"||o===null)return!1;for(const t of Object.keys(e)){if(!(t in o))return!1;const r=e[t],s=o[t];if(!r(s))return!1}return!0}function ce(o,e,t){return o??ke(e,t)}function De(o){const e={},{fields:t,defaultCasing:r,validateFields:s}=o;for(const[n,a]of Object.entries(t)){E(typeof n=="string",`Each key for the "fields" option must be a string. Key ${n} was a ${typeof n}`),E(typeof a=="object",`The value for key ${n} must be an object. Was ${typeof a}`);const{defaultValue:u,label:S,nameTransformCasing:g,type:p=ae}=a;if(s)e[n]=u;else{const f=g??r;e[n]={...e[n],nameTransformCasing:f,type:p,defaultValue:u,label:ce(S,n,f)}}}if(s){const n=ge(s,e);E(typeof n=="object",`The result of the validated fields must be an object, was (${typeof n}). This is probably an internal error, so open up an issue about it`),E(!!n,"The result of the validated fields must be defined. This is probably an internal error, so open up an issue about it");for(const[a,u]of Object.entries(n)){const S=t[a];E(S,`No field found in the fields config for "${a}"`);const{label:g,type:p=ae,nameTransformCasing:f}=S,v=f??r;e[a]={...e[a],nameTransformCasing:v,type:p,defaultValue:u,label:ce(g,a,v)}}}return e}function we(o){const e={};E(!!o,"The steps config must be defined",TypeError),E(typeof o=="object",`The steps config must be an object, was (${typeof o})`,TypeError);for(const[t,r]of Object.entries(o)){E(typeof t=="string",`Each key for the step config must be a string. Key "${t}" was ${typeof t} `,TypeError),E(_e.test(t),`The key "${t}" isn't formatted properly. Each key in the step config must be the following format: "step{number}"`);const s=t,{fields:n,title:a,nameTransformCasing:u=ne,description:S,validateFields:g}=r,p=s.toString().replace("step","");E(n,`Missing fields for step ${p} (${String(s)})`,TypeError),E(typeof n=="object","Fields must be an object",TypeError),E(Object.keys(n).length>0,`The fields config for step ${p} (${String(s)}) is empty. Please add a field`),E(typeof n=="object",`The "fields" property must be an object. Was ${typeof n}`);const f=De({defaultCasing:u,fields:n,validateFields:g});e[s]={...e[s],title:a,nameTransformCasing:u,...typeof S=="string"?{description:S}:{},fields:f}}return e}let oe=class extends Ee{original;value;steps;defaultNameTransformationCasing;firstStep;lastStep;stepNumbers;storage;#e;constructor(e){super();const{steps:t,nameTransformCasing:r,storage:s}=e;this.defaultNameTransformationCasing=be(r),this.original=t,this.value=we(this.original),this.storage=new ve({data:this.value,key:s?.key??se,store:s?.store,throwWhenUndefined:s?.throwWhenUndefined??!1}),this.#e=new re({getValue:()=>this.value,setValue:n=>this.handlePostUpdate(n)}),this.value=this.#e.enrichValues(this.value),this.stepNumbers=Object.keys(this.value).map(n=>Number.parseInt(n.replace("step",""))),this.firstStep=this.first(),this.lastStep=this.last(),this.steps={first:this.firstStep.step,last:this.lastStep.step,value:this.stepNumbers,as:n=>{if(E(typeof n=="string",`The type of the target transformation type must be a string, was ${typeof n}`),n==="string")return this.stepNumbers.map(a=>`'${a}'`).join(" | ");if(n==="number")return this.stepNumbers.join(" | ");if(n.includes("array.string"))return this.stepNumbers.map(a=>`${a}`);throw new Error(`Transformation type "${n}" is not supported. Available transformations include: ${Ne.map(a=>`"${a}"`).join(", ")}`)},isValidStepNumber:n=>this.stepNumbers.includes(n),isValidStepKey:n=>Se(this.value,n)},this.sync()}__getStorage(){return this.storage}getSnapshot(){return this}sync(){const e=this.__getStorage().get();if(e){const t=this.#e.enrichValues(e);this.value={...t}}}notify(){for(const e of this.listeners)e({defaultNameTransformationCasing:this.defaultNameTransformationCasing,original:this.original,steps:this.steps,value:this.value})}get(e){return ee(this.value)(e)}first(){const e=Math.min(...this.stepNumbers);return this.get({step:e})}last(){const e=Math.max(...this.stepNumbers);return this.get({step:e})}handlePostUpdate(e){this.value={...e},this.__getStorage().add(this.value),this.sync(),this.notify()}update(e){this.#e.update(e)}createHelperFn(e,t){const{stepData:r,...s}=e;return this.#e.createStepHelperFn(r)(s,t)}static hasData(e,t){return e===null||typeof e!="object"?!1:ue(e,{title:r=>typeof r=="string",fields:r=>{if(r===null||typeof r!="object")return!1;for(const s of Object.keys(r)){if(typeof s!="string"||!(s in r))return!1;const n=r[s];if(n===null||typeof n!="object"||!ue(n,{defaultValue:u=>u!=="undefined"&&u!==null,label:u=>typeof u=="string"||typeof u=="boolean"&&!u,nameTransformCasing:Z,type:Le}))return!1}return!0},createHelperFn:r=>typeof r=="function",nameTransformCasing:Z,...t?.optionalKeysToCheck})}getValue(e,t){const r=this.value[e],s=`Unable to get the value for "${String(e)}.fields.${String(t)}"`;E("fields"in r,s),E(typeof r.fields=="object",`${s} because "fields" is not an object. This shouldn't be the case, so please open an issue`);const n=r.fields;return X.resolvedDeepPath(t,n)}},Ie=class extends Ee{defaultNameTransformationCasing;stepSchema;storage;mountCount=0;constructor(e){super();const{steps:t,nameTransformCasing:r,storage:s}=e;this.defaultNameTransformationCasing=be(r),this.stepSchema=new oe({steps:t,nameTransformCasing:this.defaultNameTransformationCasing}),this.storage=new ve({key:s?.key??se,data:this.stepSchema.value,store:s?.store,throwWhenUndefined:s?.throwWhenUndefined??!1}),this.stepSchema.subscribe(()=>{this.notify()})}getSnapshot(){return this}mount(){return this.mountCount++,this.mountCount===1&&this.onMount(),()=>{this.unmount()}}unmount(){this.mountCount=Math.max(0,this.mountCount-1),this.mountCount===0&&this.onUnmount()}isMounted(){return this.mountCount>0}onMount(){}onUnmount(){}notify(){for(const e of this.listeners)e({nameTransformCasing:this.defaultNameTransformationCasing,storage:{key:this.storage.key,store:this.storage.store},steps:this.stepSchema.original})}};function Me(o){return t=>{const{children:r,name:s}=t,n=o(s);return r(n)}}var x;(o=>{o.DEFAULT_FORM_ALIAS="Form";function e(r,s){if(Array.isArray(r)){if(s==="all")return!0;if(typeof s=="object"&&!Array.isArray(s))return Object.keys(s).some(n=>r.includes(n));if(Array.isArray(s))return s.some(n=>r.includes(n))}return!1}o.isFormAvailable=e;function t(r){return s=>z.jsx("form",{id:r,...s})}o.createDefaultForm=t})(x||(x={}));exports.StepSpecificComponent=void 0;(o=>{o.DEFAULT_FORM_INSTANCE_ALIAS="form"})(exports.StepSpecificComponent||(exports.StepSpecificComponent={}));function Oe(o,e){E(e in o,`The target step ${e} is not a valid step key`);const t=o[e];E("fields"in t,`No "fields" were found for ${e}`);let r={};for(const[s,n]of Object.entries(t.fields))r={...r,[s]:n.defaultValue};return r}class $e extends oe{value;#e;constructor(e){const{form:t,...r}=e;super(r),this.value=we(this.original),this.#e=new re({getValue:()=>this.value,setValue:s=>this.handlePostUpdate(s)}),this.sync(),this.value=this.#e.enrichValues(this.value,s=>{const n=`step${s}`,a=[n],u=t?.id??n,S=L(this.value,a);return{createComponent:this.createStepSpecificComponentFactory(a,{isStepSpecific:!0,defaultId:u,form:t},S)}})}createFormComponent(e,t){const{render:r,enabledForSteps:s="all",id:n=t}=e,a={id:n,steps:L(this.value,s)};return u=>r(a,u)}createStepSpecificComponentImpl(e,t,r,s={}){return n=>(a=>{const u={};for(const[w,j]of Object.entries(s))if(typeof j=="function")try{const i=j();u[w]=i}catch(i){const l=i instanceof Error?i.message:String(i);throw new Error(`[multi-step-form] Error calling hook "${w}" in useFormInstance.render: ${l}
7
9
 
8
10
  This usually means:
9
11
  1. The hook is being called outside of a React component
10
12
  2. The hook has invalid dependencies or configuration
11
13
  3. There's an error in your hook implementation
12
14
 
13
- Original error: ${i}`,{cause:f})}else c[l]=u;const{defaultId:y,form:p}=t;if(p){const{alias:l=O.DEFAULT_FORM_ALIAS,...u}=p,f=u.enabledForSteps??"all",[i]=e;d(this.steps.isValidStepKey(i),`[createComponent]: the target step ${i} is invalid. Note, this error shouldn't appear as the target step should always be valid. If you see this error, please open an issue.`);const m=Number.parseInt(i.replace("step",""));d(!Number.isNaN(m),`[${i}:"createComponent"]: an error occurred while extracting the number`);const h=this.value[i];d("fields"in h,`[${i}:createComponent]: unable to find the "fields" for the current step`),d(typeof h.fields=="object",`[${i}:createComponent]: the "fields" property must be an object, was ${typeof h.fields}`);const S=je(g=>{d(typeof g=="string",()=>{const L=new Intl.ListFormat("en",{style:"long",type:"disjunction"});return`[${i}:Field]: the "name" prop must be a string and a valid field for ${i}. Available fields include ${L.format(Object.keys(h.fields))}`}),d(g in h.fields,`[${i}:Field]: the field "${g}" doesn't exist for the current step`);const{fields:_,update:T}=h,{defaultValue:$,label:b,nameTransformCasing:w,type:E}=_[g];return{defaultValue:$,label:b,nameTransformCasing:w,type:E,name:g,onInputChange:L=>T("fields",z=>({...z,[g]:{...z[g],defaultValue:L}}))}});let v={ctx:r,onInputChange:this.createStepUpdaterFn(m),Field:S,...c};return O.isFormAvailable(e,f)&&(v={...v,[l]:this.createFormComponent(u,y)}),n(v,a)}return n({ctx:r,[O.DEFAULT_FORM_ALIAS]:O.createDefaultForm(y)},a)})}createStepSpecificComponentFactory(e,t,r){const s=this.createStepSpecificComponentImpl.bind(this),n=this.createDefaultValues.bind(this);function a(c,y){function p(){return d(typeof c=="function","The first argument must be a function"),s(e,t,r)(c)}if(typeof c=="object"){const{useFormInstance:l}=c;if(l){const{render:u,alias:f=exports.StepSpecificComponent.DEFAULT_FORM_INSTANCE_ALIAS}=l;d(typeof y=="function","The second argument must be a function");const[i]=e,m=n(i),h={ctx:r,defaultValues:m};return s(e,t,r,{[f]:()=>u(h)})(y)}return p()}return p()}return a}createComponentImpl(e,t){const r=U(this.value,e);return t.isStepSpecific?this.createStepSpecificComponentFactory(e,t,r):s=>(n=>s({ctx:r},n))}createComponentForStep(e,t){return this.createComponentImpl(e,t)}createComponent(e,t){return this.createComponentImpl(e.stepData,{isStepSpecific:!1})(t)}createDefaultValues(e){return pe(this.value,e)}}class he extends Oe{stepSchema;constructor(e){const{nameTransformCasing:t=P,storage:r,...s}=e;super({nameTransformCasing:t,storage:r,...s}),this.stepSchema=new de({nameTransformCasing:t,...s})}createComponent(e,t){const{stepData:r}=e,s=this.stepHelper.createCtx(r);return(n=>t({ctx:s},n))}}function Ce(o){return new he(o)}var A={exports:{}},x={},F={exports:{}},D={};/**
15
+ Original error: ${l}`,{cause:i})}else u[w]=j;const{defaultId:S,form:g}=t,{ctx:p}=r,[f]=e;E(this.steps.isValidStepKey(f),`[createComponent]: the target step ${f} is invalid. Note, this error shouldn't appear as the target step should always be valid. If you see this error, please open an issue.`);const v=Number.parseInt(f.replace("step",""));E(!Number.isNaN(v),`[${f}:"createComponent"]: an error occurred while extracting the number`);const y=this.value[f];E("fields"in y,`[${f}:createComponent]: unable to find the "fields" for the current step`),E(typeof y.fields=="object",`[${f}:createComponent]: the "fields" property must be an object, was ${typeof y.fields}`);const h=this.#e.createStepUpdaterFn(f),b=Me(w=>{E(typeof w=="string",()=>{const c=new Intl.ListFormat("en",{style:"long",type:"disjunction"});return`[${f}:Field]: the "name" prop must be a string and a valid field for ${f}. Available fields include ${c.format(Object.keys(y.fields))}`}),E(w in y.fields,`[${f}:Field]: the field "${w}" doesn't exist for the current step`),E("update"in y,`[${f}:Field]: No "update" function was found`);const j=this.getValue(f,w),{label:i,nameTransformCasing:l,type:d}=y.fields[w];return{defaultValue:j,label:i,nameTransformCasing:l,type:d,name:w,onInputChange:c=>{const m=typeof c=="function"?c(j):c;this.update({targetStep:f,updater:m,fields:[`fields.${w}.defaultValue`]})}}});let O={ctx:p,onInputChange:h,Field:b,...u};if(g){const{alias:w=x.DEFAULT_FORM_ALIAS,...j}=g,i=j.enabledForSteps??"all";return x.isFormAvailable(e,i)&&(O={...O,[w]:this.createFormComponent(j,S)}),n(O,a)}return n({...O,[x.DEFAULT_FORM_ALIAS]:x.createDefaultForm(S)},a)})}createStepSpecificComponentFactory(e,t,r){const s=this.createStepSpecificComponentImpl.bind(this),n=this.createDefaultValues.bind(this);debugger;const a=this.value,u=e[0],S=this.#e.createStepUpdaterFn(u).bind(this.#e);function g(p,f){function v(h){return h?{ctx:{...r,...h}}:{ctx:r}}function y(){return E(typeof p=="function","The first argument must be a function"),s(e,t,v(void 0))(p)}if(typeof p=="object"){const{useFormInstance:h,ctxData:b,debug:O}=p,w=new te({debug:O,prefix(l){return`${l}-${u}-createComponent`}});w.info("First argument is an object");const{[u]:j,...i}=a;if(E(typeof f=="function","The second argument must be a function"),h){const{render:l,alias:d=exports.StepSpecificComponent.DEFAULT_FORM_INSTANCE_ALIAS}=h,[c]=e,m=n(c),_=b?{...r,...b({ctx:i})}:r,$={ctx:_,defaultValues:m};return s(e,t,_,{[d]:()=>l($)})(f)}if(b){w.info('Option "ctxData" is defined'),E(typeof b=="function",'Option "ctxData" must be a function');const l=b({ctx:i});w.info(`Addition context is: ${JSON.stringify(l,null,2)}`);const d={...r,...l};return w.info(`Resolved context is: ${JSON.stringify(d,null,2)}`),s(e,t,{ctx:d,update:S})(f)}return y()}return y()}return g}createComponent(e,t){const{stepData:r}=e,s=L(this.value,r);return(n=>t(s,n))}createDefaultValues(e){return Oe(this.value,e)}}class je extends Ie{stepSchema;#e;constructor(e){const{nameTransformCasing:t=ne,storage:r,...s}=e,n={nameTransformCasing:t,storage:r,...s};super(n),this.stepSchema=new $e(n),this.#e=new re({getValue:()=>this.stepSchema.value,setValue:a=>{this.stepSchema.value={...a},this.storage.add(a),this.notify()}})}createComponent(e,t){const{stepData:r}=e,s=L(this.stepSchema.value,r);return(n=>t({ctx:s,update:this.#e.createHelperFnInputUpdate(r)},n))}}function Ue(o){return new je(o)}var D={exports:{}},H={},I={exports:{}},B={};/**
14
16
  * @license React
15
17
  * use-sync-external-store-shim.production.js
16
18
  *
@@ -18,7 +20,7 @@ Original error: ${i}`,{cause:f})}else c[l]=u;const{defaultId:y,form:p}=t;if(p){c
18
20
  *
19
21
  * This source code is licensed under the MIT license found in the
20
22
  * LICENSE file in the root directory of this source tree.
21
- */var ee;function Ae(){if(ee)return D;ee=1;var o=I;function e(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var t=typeof Object.is=="function"?Object.is:e,r=o.useState,s=o.useEffect,n=o.useLayoutEffect,a=o.useDebugValue;function c(u,f){var i=f(),m=r({inst:{value:i,getSnapshot:f}}),h=m[0].inst,S=m[1];return n(function(){h.value=i,h.getSnapshot=f,y(h)&&S({inst:h})},[u,i,f]),s(function(){return y(h)&&S({inst:h}),u(function(){y(h)&&S({inst:h})})},[u]),a(i),i}function y(u){var f=u.getSnapshot;u=u.value;try{var i=f();return!t(u,i)}catch{return!0}}function p(u,f){return f()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return D.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:l,D}var k={};/**
23
+ */var le;function Re(){if(le)return B;le=1;var o=R;function e(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var t=typeof Object.is=="function"?Object.is:e,r=o.useState,s=o.useEffect,n=o.useLayoutEffect,a=o.useDebugValue;function u(f,v){var y=v(),h=r({inst:{value:y,getSnapshot:v}}),b=h[0].inst,O=h[1];return n(function(){b.value=y,b.getSnapshot=v,S(b)&&O({inst:b})},[f,y,v]),s(function(){return S(b)&&O({inst:b}),f(function(){S(b)&&O({inst:b})})},[f]),a(y),y}function S(f){var v=f.getSnapshot;f=f.value;try{var y=v();return!t(f,y)}catch{return!0}}function g(f,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:u;return B.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,B}var q={};/**
22
24
  * @license React
23
25
  * use-sync-external-store-shim.development.js
24
26
  *
@@ -26,7 +28,7 @@ Original error: ${i}`,{cause:f})}else c[l]=u;const{defaultId:y,form:p}=t;if(p){c
26
28
  *
27
29
  * This source code is licensed under the MIT license found in the
28
30
  * LICENSE file in the root directory of this source tree.
29
- */var te;function Fe(){return te||(te=1,process.env.NODE_ENV!=="production"&&(function(){function o(i,m){return i===m&&(i!==0||1/i===1/m)||i!==i&&m!==m}function e(i,m){l||s.startTransition===void 0||(l=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=m();if(!u){var S=m();n(h,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}S=a({inst:{value:h,getSnapshot:m}});var v=S[0].inst,g=S[1];return y(function(){v.value=h,v.getSnapshot=m,t(v)&&g({inst:v})},[i,h,m]),c(function(){return t(v)&&g({inst:v}),i(function(){t(v)&&g({inst:v})})},[i]),p(h),h}function t(i){var m=i.getSnapshot;i=i.value;try{var h=m();return!n(i,h)}catch{return!0}}function r(i,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=I,n=typeof Object.is=="function"?Object.is:o,a=s.useState,c=s.useEffect,y=s.useLayoutEffect,p=s.useDebugValue,l=!1,u=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;k.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),k}var re;function me(){return re||(re=1,process.env.NODE_ENV==="production"?F.exports=Ae():F.exports=Fe()),F.exports}/**
31
+ */var fe;function Pe(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&(function(){function o(y,h){return y===h&&(y!==0||1/y===1/h)||y!==y&&h!==h}function e(y,h){p||s.startTransition===void 0||(p=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=h();if(!f){var O=h();n(b,O)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}O=a({inst:{value:b,getSnapshot:h}});var w=O[0].inst,j=O[1];return S(function(){w.value=b,w.getSnapshot=h,t(w)&&j({inst:w})},[y,b,h]),u(function(){return t(w)&&j({inst:w}),y(function(){t(w)&&j({inst:w})})},[y]),g(b),b}function t(y){var h=y.getSnapshot;y=y.value;try{var b=h();return!n(y,b)}catch{return!0}}function r(y,h){return h()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=R,n=typeof Object.is=="function"?Object.is:o,a=s.useState,u=s.useEffect,S=s.useLayoutEffect,g=s.useDebugValue,p=!1,f=!1,v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;q.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:v,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),q}var pe;function Te(){return pe||(pe=1,process.env.NODE_ENV==="production"?I.exports=Re():I.exports=Pe()),I.exports}/**
30
32
  * @license React
31
33
  * use-sync-external-store-shim/with-selector.production.js
32
34
  *
@@ -34,7 +36,7 @@ Original error: ${i}`,{cause:f})}else c[l]=u;const{defaultId:y,form:p}=t;if(p){c
34
36
  *
35
37
  * This source code is licensed under the MIT license found in the
36
38
  * LICENSE file in the root directory of this source tree.
37
- */var ne;function Ne(){if(ne)return x;ne=1;var o=I,e=me();function t(p,l){return p===l&&(p!==0||1/p===1/l)||p!==p&&l!==l}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,n=o.useRef,a=o.useEffect,c=o.useMemo,y=o.useDebugValue;return x.useSyncExternalStoreWithSelector=function(p,l,u,f,i){var m=n(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=c(function(){function v(b){if(!g){if(g=!0,_=b,b=f(b),i!==void 0&&h.hasValue){var w=h.value;if(i(w,b))return T=w}return T=b}if(w=T,r(_,b))return w;var E=f(b);return i!==void 0&&i(w,E)?(_=b,w):(_=b,T=E)}var g=!1,_,T,$=u===void 0?null:u;return[function(){return v(l())},$===null?void 0:function(){return v($())}]},[l,u,f,i]);var S=s(p,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=S},[S]),y(S),S},x}var M={};/**
39
+ */var de;function Ke(){if(de)return H;de=1;var o=R,e=Te();function t(g,p){return g===p&&(g!==0||1/g===1/p)||g!==g&&p!==p}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,n=o.useRef,a=o.useEffect,u=o.useMemo,S=o.useDebugValue;return H.useSyncExternalStoreWithSelector=function(g,p,f,v,y){var h=n(null);if(h.current===null){var b={hasValue:!1,value:null};h.current=b}else b=h.current;h=u(function(){function w(c){if(!j){if(j=!0,i=c,c=v(c),y!==void 0&&b.hasValue){var m=b.value;if(y(m,c))return l=m}return l=c}if(m=l,r(i,c))return m;var _=v(c);return y!==void 0&&y(m,_)?(i=c,m):(i=c,l=_)}var j=!1,i,l,d=f===void 0?null:f;return[function(){return w(p())},d===null?void 0:function(){return w(d())}]},[p,f,v,y]);var O=s(g,h[0],h[1]);return a(function(){b.hasValue=!0,b.value=O},[O]),S(O),O},H}var J={};/**
38
40
  * @license React
39
41
  * use-sync-external-store-shim/with-selector.development.js
40
42
  *
@@ -42,5 +44,5 @@ Original error: ${i}`,{cause:f})}else c[l]=u;const{defaultId:y,form:p}=t;if(p){c
42
44
  *
43
45
  * This source code is licensed under the MIT license found in the
44
46
  * LICENSE file in the root directory of this source tree.
45
- */var se;function Ve(){return se||(se=1,process.env.NODE_ENV!=="production"&&(function(){function o(p,l){return p===l&&(p!==0||1/p===1/l)||p!==p&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=I,t=me(),r=typeof Object.is=="function"?Object.is:o,s=t.useSyncExternalStore,n=e.useRef,a=e.useEffect,c=e.useMemo,y=e.useDebugValue;M.useSyncExternalStoreWithSelector=function(p,l,u,f,i){var m=n(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=c(function(){function v(b){if(!g){if(g=!0,_=b,b=f(b),i!==void 0&&h.hasValue){var w=h.value;if(i(w,b))return T=w}return T=b}if(w=T,r(_,b))return w;var E=f(b);return i!==void 0&&i(w,E)?(_=b,w):(_=b,T=E)}var g=!1,_,T,$=u===void 0?null:u;return[function(){return v(l())},$===null?void 0:function(){return v($())}]},[l,u,f,i]);var S=s(p,m[0],m[1]);return a(function(){h.hasValue=!0,h.value=S},[S]),y(S),S},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),M}var oe;function Ie(){return oe||(oe=1,process.env.NODE_ENV==="production"?A.exports=Ne():A.exports=Ve()),A.exports}var Le=Ie();function W(o,e){d(typeof e=="string",`The target step must be a string, was ${typeof e}`);const{as:t,isValidStepNumber:r}=o.stepSchema.steps,n=new Intl.ListFormat("en",{type:"disjunction",style:"long"}).format(t("array.string.untyped"));d(le.test(e),`The target step must match the following format: "step{number}". Available steps are ${n}`);const a=Number.parseInt(e.replace("step",""));return d(r(a),`The step number "${a}" is not a valid step number. Valid step numbers include ${n}`,TypeError),a}function ye(o){function e(t){return Le.useSyncExternalStoreWithSelector(o.subscribe,()=>o.getSnapshot(),()=>o.getSnapshot(),r=>{if(typeof t=="object"){const s=W(r,t.targetStep);return r.stepSchema.get({step:s}).data}return typeof t=="function"?t(r):r})}return e}function xe(o,e){const t=ye(o);return typeof e=="object"||typeof e=="function"?t(e):t()}function ae(o){return function(e){return(t=>e(o,t))}}function De(o){const e=ye(o);function t(c){const{targetStep:y,notFoundMessage:p,isDataGuaranteed:l}=c,u=e({targetStep:y}),f=p?a({targetStep:y},p):i=>R.jsxs("div",{...i,children:["No data found for step ",String(y)]});return l?{data:u,NoCurrentData:f}:B.hasData(u)?{data:u,hasData:!0,NoCurrentData:f}:{data:void 0,hasData:!1,NoCurrentData:f}}function r(c){const y=e(S=>S.stepSchema.steps.value.length),{targetStep:p,maxProgressValue:l=100,totalSteps:u=y,progressTextTransformer:f}=c,i=W(o,p),m=i/u*l,h=f?n({targetStep:p,maxProgressValue:l,totalSteps:u},f):S=>R.jsxs("div",{...S,children:["Step ",i,"/",u]});return{value:m,maxProgressValue:l,ProgressText:h}}function s(c){const p=e(u=>u.storage).get(),l=!!(p&&typeof p=="object"&&Object.keys(p).length>0);return c?c(l):l}function n(c,y){const p=o.getSnapshot().stepSchema.steps.value.length,{targetStep:l,maxProgressValue:u=100,totalSteps:f=p}=c;return ae({targetStep:l,maxProgressValue:u,totalSteps:f})(y)}function a(c,y){return W(o,c.targetStep),ae(c)(y)}return{useMultiStepFormData:e,useCurrentStepData:t,useProgress:r,useCanRestartForm:s,withProgressText:n,withNoStepDataFound:a}}exports.MultiStepFormSchema=he;exports.MultiStepFormStepSchema=de;exports.createDefaultValues=pe;exports.createMultiStepFormContext=De;exports.createMultiStepFormSchema=Ce;exports.useMultiStepFormData=xe;
47
+ */var he;function Ge(){return he||(he=1,process.env.NODE_ENV!=="production"&&(function(){function o(g,p){return g===p&&(g!==0||1/g===1/p)||g!==g&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=R,t=Te(),r=typeof Object.is=="function"?Object.is:o,s=t.useSyncExternalStore,n=e.useRef,a=e.useEffect,u=e.useMemo,S=e.useDebugValue;J.useSyncExternalStoreWithSelector=function(g,p,f,v,y){var h=n(null);if(h.current===null){var b={hasValue:!1,value:null};h.current=b}else b=h.current;h=u(function(){function w(c){if(!j){if(j=!0,i=c,c=v(c),y!==void 0&&b.hasValue){var m=b.value;if(y(m,c))return l=m}return l=c}if(m=l,r(i,c))return m;var _=v(c);return y!==void 0&&y(m,_)?(i=c,m):(i=c,l=_)}var j=!1,i,l,d=f===void 0?null:f;return[function(){return w(p())},d===null?void 0:function(){return w(d())}]},[p,f,v,y]);var O=s(g,h[0],h[1]);return a(function(){b.hasValue=!0,b.value=O},[O]),S(O),O},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),J}var me;function We(){return me||(me=1,process.env.NODE_ENV==="production"?D.exports=Ke():D.exports=Ge()),D.exports}var He=We();function Q(o,e){E(typeof e=="string",`The target step must be a string, was ${typeof e}`);const{as:t,isValidStepNumber:r}=o.stepSchema.steps,n=new Intl.ListFormat("en",{type:"disjunction",style:"long"}).format(t("array.string.untyped"));E(_e.test(e),`The target step must match the following format: "step{number}". Available steps are ${n}`);const a=Number.parseInt(e.replace("step",""));return E(r(a),`The step number "${a}" is not a valid step number. Valid step numbers include ${n}`,TypeError),a}function Ae(o){function e(t){return He.useSyncExternalStoreWithSelector(o.subscribe,()=>o.getSnapshot(),()=>o.getSnapshot(),r=>{if(typeof t=="object"){const s=Q(r,t.targetStep);return r.stepSchema.get({step:s}).data}return typeof t=="function"?t(r):r})}return e}function Be(o,e){const t=Ae(o);return typeof e=="object"||typeof e=="function"?t(e):t()}function ye(o){return function(e){return(t=>e(o,t))}}function qe(o){const e=Ae(o);function t(u){const{targetStep:S,notFoundMessage:g,isDataGuaranteed:p}=u,f=e({targetStep:S}),v=g?a({targetStep:S},g):y=>z.jsxs("div",{...y,children:["No data found for step ",String(S)]});return p?{data:f,NoCurrentData:v}:oe.hasData(f)?{data:f,hasData:!0,NoCurrentData:v}:{data:void 0,hasData:!1,NoCurrentData:v}}function r(u){const S=e(O=>O.stepSchema.steps.value.length),{targetStep:g,maxProgressValue:p=100,totalSteps:f=S,progressTextTransformer:v}=u,y=Q(o,g),h=y/f*p,b=v?n({targetStep:g,maxProgressValue:p,totalSteps:f},v):O=>z.jsxs("div",{...O,children:["Step ",y,"/",f]});return{value:h,maxProgressValue:p,ProgressText:b}}function s(u){const g=e(f=>f.storage).get(),p=!!(g&&typeof g=="object"&&Object.keys(g).length>0);return u?u(p):p}function n(u,S){const g=o.getSnapshot().stepSchema.steps.value.length,{targetStep:p,maxProgressValue:f=100,totalSteps:v=g}=u;return ye({targetStep:p,maxProgressValue:f,totalSteps:v})(S)}function a(u,S){return Q(o,u.targetStep),ye(u)(S)}return{useMultiStepFormData:e,useCurrentStepData:t,useProgress:r,useCanRestartForm:s,withProgressText:n,withNoStepDataFound:a}}exports.MultiStepFormSchema=je;exports.MultiStepFormStepSchema=$e;exports.createDefaultValues=Oe;exports.createMultiStepFormContext=qe;exports.createMultiStepFormSchema=Ue;exports.useMultiStepFormData=Be;
46
48
  //# sourceMappingURL=index.cjs.map