"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("lodash-unified"),n=require("vue");function v(e,f,a){const r=a?.defaultValuePropName||"defaultValue",t=a?.valuePropName||"value",u=n.ref(c());async function d(l){a?.beforeUpdateValue&&(o(),!await a.beforeUpdateValue(l))||(e[t]===void 0&&(u.value=l),f(`update:${t}`,l))}function o(){u.value===void 0&&(u.value="",n.nextTick(()=>{u.value=void 0}))}function c(){return i.isUndefined(e[t])?i.isUndefined(e[r])?a?.defaultValue:e[r]:e[t]}return n.watch(()=>e[t],l=>{u.value=l},{deep:!0}),{value:u,updateValue:d}}exports.useControllableValue=v;
