import{n,cb as v,l as R,p as q,w as S,q as T,i as h}from"./index.js";function A(e,o){const a=n({}),p=v(),i=n(null),d=n(!1),c=n(""),f=R().emit,y=()=>h(i).$el.getBoundingClientRect().y;async function g(){const{api:t,prop:r,value:s}=e,{code:u,message:m,data:l}=await t({[r]:Array.isArray(s)?s[0]:s});p({code:u,message:m,handler:()=>{a.value=l,c.value=String(u),o&&o(l)}})}return q(()=>{if(e.api&&!e.noRequeset)return g()}),S(()=>a.value,()=>setTimeout(()=>{const t={top:y()-134,title:e.title};T(()=>f("map-offset-top",t))},1e3)),{defaultRef:i,hidden:d,code:c,data:a}}const x={api:{type:Function},prop:{type:String},value:{type:[String,Array]},title:{type:String},noRequeset:{type:Boolean}};export{x as d,A as u};
