"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("lodash-unified"),u=require("vue"),l=require("../../utils/is.js"),o=require("../context.js"),s=e=>{let t=!1;const{internalInstance:a}=o.useInjectForm();u.onMounted(()=>{r()}),u.onBeforeUnmount(()=>{t=!0});async function r(){let i=n.isFunction(e.initialValue)?e.initialValue():e.initialValue;l.isPromise(i)&&(i=await i),!t&&a?.registerField({name:e.name,initialValue:n.cloneDeep(i),transform:e.transform})}};exports.default=s;
