"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),m=require("dayjs");require("../config-provider/index.js");const f=require("./style/index.js"),d=require("./useTimeAgo.js"),p=require("./utils.js"),g=require("../config-provider/hooks/use-locale.js"),v=require("../config-provider/hooks/use-namespace.js"),_=["title"],q=e.defineComponent({name:"TimeAgo",__name:"index",props:{value:{default:Date.now()},title:{type:[String,Object,Boolean],default:!0},interval:{type:[Boolean,Number],default:1e4},customFormat:{}},setup(s){const o=s,{locale:u}=g.useLocale(),{b:a}=v.useNamespace("time-ago"),n=f.default("time-ago"),l=d.default(e.toRef(o,"value"),Date.now(),e.toRef(o,"interval")),c=e.computed(()=>{const t=l.value;return o.customFormat?o.customFormat(t):p.getTimeAgoStr(t,u.value)}),i=e.computed(()=>{const t=o.title;if(t===!1)return;if(typeof t=="string")return t;const r=t===!0?"YYYY-MM-DD HH:mm:ss":t.format;return m(o.value).format(r)});return(t,r)=>(e.openBlock(),e.createElementBlock("span",{title:i.value,class:e.normalizeClass([e.unref(a)(),e.unref(n)])},e.toDisplayString(c.value),11,_))}});exports.default=q;
