import{r as e}from"./rolldown-runtime-DIIn1E2Q.js";import{I as t}from"./vendor-primevue-DyvCA8Nd.js";import{D as n,Ht as r,I as i,K as a,Lt as o,O as s,Ot as c,R as l,_t as u,et as d,k as f,pt as p,zt as m}from"./vendor-vue-core-IZuWV8u3.js";import"./vendor-other-Q0G0D0d6.js";import{o as h,r as g}from"./colorUtil-Q3kaA72Z.js";import{t as _}from"./src-B0kocU_l.js";import{i as v,o as y}from"./widgetPropFilter-BW8CLrhL.js";import{t as b}from"./layout--1YiVcXi.js";import{t as x}from"./WidgetLayoutField-RcWi6XR8.js";var S={class:`text-xs truncate min-w-[4ch]`,"data-testid":`widget-color-text`},C=l({__name:`WidgetColorPicker`,props:{widget:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:l}){let C=e,w=l,T=n(()=>{let e=C.widget.options?.format;return g(e)?e:`hex`}),E=c(h(C.modelValue||`#000000`,g(C.widget.options?.format)?C.widget.options.format:`hex`));p(()=>C.modelValue,e=>{E.value=h(e||`#000000`,T.value)});function onPickerUpdate(e){E.value=e,w(`update:modelValue`,h(e,T.value))}let D=[...v],O=n(()=>y(C.widget.options,D));return(e,n)=>(d(),f(x,{widget:e.widget},{default:u(()=>[s(`label`,{class:m(o(_)(o(b),`flex items-center gap-2 w-full px-4 py-2`))},[i(o(t),a({modelValue:E.value,"onUpdate:modelValue":n[0]||=e=>E.value=e},O.value,{class:`h-4 w-8 overflow-hidden !rounded-full border-none`,"aria-label":e.widget.name,pt:{preview:`!w-full !h-full !border-none`},"onUpdate:modelValue":onPickerUpdate}),null,16,[`modelValue`,`aria-label`]),s(`span`,S,r(o(h)(E.value,T.value)),1)],2)]),_:1},8,[`widget`]))}});export{C as default};
//# sourceMappingURL=WidgetColorPicker-Xz6jaetX.js.map