var P=Object.defineProperty;var n=(r,l)=>P(r,"name",{value:l,configurable:!0});import{x as V}from"./vendor-primevue-B6rcS73U.js";import{cE as d,cF as a,c as x}from"./index-2-qFLlQP.js";import{P as v,f as C}from"./widgetPropFilter-CygYoMQt.js";import{W as h}from"./index-_AAd9eTu.js";import{_ as E}from"./WidgetLayoutField.vue_vue_type_script_setup_true_lang-Dps42A-g.js";import{bx as b,E as p,r as k,w as D,j as F,d as U,k as B,e as u,s as L,by as s,z as O,m as R,u as W}from"./vendor-other-CSX7WseZ.js";import"./vendor-vue-CXt3ZZQ3.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-BKWXAgVe.js";import"./vendor-tiptap-BkFTmTb3.js";const y={class:"text-xs truncate min-w-[4ch]","data-testid":"widget-color-text"},G=b({__name:"WidgetColorPicker",props:{widget:{},modelValue:{}},emits:["update:modelValue"],setup(r,{emit:l}){const o=r,c=l,i=p(()=>{const e=o.widget.options?.format;return d(e)?e:"hex"}),t=k(a(o.modelValue||"#000000",d(o.widget.options?.format)?o.widget.options.format:"hex"));D(()=>o.modelValue,e=>{t.value=a(e||"#000000",i.value)});function f(e){t.value=e,c("update:modelValue",a(e,i.value))}n(f,"onPickerUpdate");const w=[...v],g=p(()=>C(o.widget.options,w));return(e,m)=>(U(),F(E,{widget:e.widget},{default:B(()=>[u("label",{class:L(s(x)(s(h),"flex items-center gap-2 w-full px-4 py-2"))},[O(s(V),R({modelValue:t.value,"onUpdate:modelValue":m[0]||(m[0]=_=>t.value=_)},g.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":f}),null,16,["modelValue","aria-label"]),u("span",y,W(s(a)(t.value,i.value)),1)],2)]),_:1},8,["widget"]))}});export{G as default};
//# sourceMappingURL=WidgetColorPicker-vRHta_Kz.js.map
