import{d as E,s as f,i as v,o as i,a9 as g,w as c,f as o,t as p,u as t,F,z as B,c as S,ao as u,n as D}from"./Bxv1kRJt.js";import{_ as U}from"./BqPTzzaa.js";import h from"./Df-vbHRJ.js";import{_ as z}from"./CDVN_Roy.js";import{u as A}from"./DDOpIcVM.js";import"./Dxmk8VbU.js";import"./06_OkG9_.js";import"./DJ1-1-8O.js";import"./i2E1o2Cl.js";import"./XWxoP7r2.js";import"./Bf7bwUep.js";const N=u(U),O=u(h),P=u(z),j=["id"],I={px1:""},L={mb2:""},M={mr2:""},R={op80:""},et=E({__name:"BindingComponentEditor",props:{contentRef:{type:[String,Object,Function]},view:{},getPos:{type:Function},setAttrs:{type:Function},node:{},selected:{},decorations:{},innerDecorations:{}},setup(x){const V=x,{frontmatter:d,frontmatterDoc:_,getComponentProps:w}=A(),{model:e,mdcAttrs:s}=w(V,{value:{type:String},defaultValue:{type:String}}),l=f(()=>e.value?.replace("$doc.","")),b=f(()=>_.value[l.value]||d.value[l.value]||e.value?.defaultValue);function k(m){s.value=`$doc.${m}`}return(m,n)=>{const C=N,$=O,y=P;return i(),v("span",{id:t(e).id,class:D(["group relative",t(e).class]),contenteditable:"false"},[g(y,{tooltip:`${t(e).value}`,"tooltip-classes":"pt1","bg-active":"",rounded:"","inline-block":""},{menu:c(()=>[o("div",L,[n[1]||(n[1]=o("label",{"text-sm":"","font-mono":"","first-letter:capitalize":"",op50:""},"Frontmatter value",-1)),(i(!0),v(F,null,B({...t(d),...t(_)},(r,a)=>(i(),S(C,{key:a,pressed:l.value===a,classes:"flex items-center text-sm [[data-state='on']]:bg-active",onClick:T=>k(a)},{default:c(()=>[o("span",M,p(a)+":",1),o("span",R,p(r),1)]),_:2},1032,["pressed","onClick"]))),128))]),g($,{modelValue:t(s).defaultValue,"onUpdate:modelValue":n[0]||(n[0]=r=>t(s).defaultValue=r),label:"default value",classes:"flex-col items-start!","input-classes":"w-full max-w-full"},null,8,["modelValue"])]),default:c(()=>[o("span",I,p(b.value||t(e).defaultValue),1)]),_:1},8,["tooltip"])],10,j)}}});export{et as default};
