import{a as $,L as U,H as E,_ as F}from"./ebt3cj6n.js";import{_ as j}from"./nmarkdown.vue-jpbjhala.js";import{_ as L}from"./filepath-item.vue-ci7z8yh9.js";import{k as S}from"./index-obsucz0g.js";import{C as y}from"./constants-b32h69zq.js";import{p as W,q as r,V as q,U as s,P as i,a2 as m,X as a,Z as p,a3 as b,u as k,a9 as c,W as l,F as x,a8 as v,ae as z,a0 as H}from"./vendor/json-editor-vue-kcahofzr.js";const M={rounded:"","font-mono":""},O={key:0,"text-primary":""},P={key:0},T={title:"Vue Directive"},X={"max-w-100":""},Z={px4:"",py3:"","text-sm":""},A={flex:"~ gap2",n:"primary xs"},G={border:"t base","max-h-60":"","of-auto":"",px4:"",py3:""},J={"text-sm":""},K={"text-primary":""},Q={flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},R={key:1,"text-sm":"",op50:""},ne=W({__name:"ComposableItem",props:{item:{},isDirective:{type:Boolean,default:!1},metadata:{},filepath:{},counter:{type:Boolean,default:!0},classes:{default:"px2 py1 text-sm bg-gray:5 "}},setup(g){const o=g,C=$(),h=U(),u=r(()=>o.item.as||o.item.name),D=r(()=>{let e=u.value;return o.isDirective&&(e[0]!=="v"&&(e=`v${e}`),e=S(e)),e}),n=r(()=>o.metadata?.injectionUsage?.[u.value]?.count||0),N=r(()=>(o.metadata?.injectionUsage?.[u.value]?.moduleIds||[]).filter(e=>!e.endsWith("?macro=true"))),_=r(()=>o.item.meta?.docsUrl?o.item.meta.docsUrl:["nuxt","#app","nuxt3"].includes(o.item.from)?y.nuxt[o.item.name]:o.item.from==="vue"?y.vue[o.item.name]:null);return(e,t)=>{const V=E,w=j,f=F,B=L,I=q("VDropdown");return s(),i(I,{disabled:!o.metadata},{popper:m(()=>[a("div",X,[a("div",Z,[e.item.meta?.description?(s(),i(w,{key:0,tag:"div",pb3:"","text-sm":"",markdown:e.item.meta.description},null,8,["markdown"])):p("",!0),a("div",A,[b(f,{icon:"carbon-copy",onClick:t[0]||(t[0]=d=>k(C)(D.value,"imports-name"))},{default:m(()=>t[2]||(t[2]=[c(" Copy ")])),_:1}),e.filepath?(s(),i(f,{key:0,icon:"carbon-code",onClick:t[1]||(t[1]=d=>e.filepath&&k(h)(e.filepath))},{default:m(()=>t[3]||(t[3]=[c(" Source ")])),_:1})):p("",!0),_.value?(s(),i(f,{key:1,icon:"carbon-catalog",to:_.value,target:"_blank"},{default:m(()=>t[4]||(t[4]=[c(" Docs ")])),_:1},8,["to"])):p("",!0)])]),a("div",G,[n.value?(s(),l(x,{key:0},[a("div",J,[t[5]||(t[5]=a("span",{op50:""},"It has been referenced ",-1)),a("strong",K,v(n.value),1),t[6]||(t[6]=a("span",{op50:""}," times by:",-1))]),a("div",Q,[(s(!0),l(x,null,z(N.value,d=>(s(),i(B,{key:d,filepath:d},null,8,["filepath"]))),128))])],64)):(s(),l("div",R," Not in use via auto import. "))])])]),default:m(()=>[a("button",{"hover:text-primary":"",class:H([e.metadata&&!n.value?"op30 hover:op100":"",e.classes])},[a("code",M,[c(v(u.value)+" ",1),n.value&&e.counter?(s(),l("sup",O,"x"+v(n.value),1)):p("",!0)]),e.isDirective?(s(),l("sup",P,[a("abbr",T,[b(V,{icon:"tabler:hexagon-letter-d"})])])):p("",!0)],2)]),_:1},8,["disabled"])}}});export{ne as _};
