import{r as a,cj as u}from"./index-gATdONBG.js";function o(t){var n;if(t.type)return t.type;let r=(n=t.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function i(t,n){let[r,e]=a.useState(()=>o(t));return u(()=>{e(o(t))},[t.type,t.as]),u(()=>{r||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&e("button")},[r,n]),r}export{i as T};