import{r as e}from"./rolldown-runtime-DCMCV6zW.js";import{R as t}from"./vendor-primevue-DxVRNMbC.js";import{D as n,Dt as r,I as i,It as a,K as o,O as s,R as c,Rt as l,Vt as u,et as d,gt as f,k as p,pt as m}from"./vendor-vue-core-X6q-rGJs.js";import"./vendor-other-CyG3qq8S.js";import{o as h,r as g}from"./colorUtil-Cth7eqhK.js";import{t as _}from"./src-Bx0QZVd-.js";import{i as v,o as y}from"./widgetPropFilter-AWF4Ovcm.js";import{t as b}from"./layout-uCC7X9bn.js";import{t as x}from"./WidgetLayoutField-AgGHRP9B.js";var S={class:`text-xs truncate min-w-[4ch]`,"data-testid":`widget-color-text`},C=c({__name:`WidgetColorPicker`,props:{widget:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:c}){let C=e,w=c,T=n(()=>{let e=C.widget.options?.format;return g(e)?e:`hex`}),E=r(h(C.modelValue||`#000000`,g(C.widget.options?.format)?C.widget.options.format:`hex`));m(()=>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(),p(x,{widget:e.widget},{default:f(()=>[s(`label`,{class:l(a(_)(a(b),`flex items-center gap-2 w-full px-4 py-2`))},[i(a(t),o({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,u(a(h)(E.value,T.value)),1)],2)]),_:1},8,[`widget`]))}});export{C as default};
//# sourceMappingURL=WidgetColorPicker-DX0Mlh2f.js.map