import{a as y,C,k as V,b as h,o as B,m as a,g as n,p as t,u as s,D as i,q as T,K as b,F as x,H as D}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{u as F}from"./useOrderFormDropdown-BujpLpDg.js";import{x as S,t as A}from"./widget-BUAABBRb.js";import{u as L}from"./translationsStore-DBJu9sBR.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const M={class:"ccb-order-dropdown"},N={key:0,class:"ccb-dropdown__label"},O={key:1,class:"ccb-order-dropdown__label"},W={class:"ccb-order-dropdown__list"},$=["onClick"],U=y({__name:"Default",props:{field:{}},emits:["toggle"],setup(k,{emit:w}){const g=w,d=k,{field:e}=C(d),p=V(null),{toggleBody:c}=F(d,g,p),u=L(),m=h(()=>S(e.value.value||"")),_=r=>{e.value.value=r,c();const{updateValue:o}=A();o(e.value.id,e.value.value)};return B(()=>{var r;Array.isArray((r=e.value)==null?void 0:r.value)&&(e.value.value=e.value.value[0])}),(r,o)=>{var v;return n(),a("div",{class:"ccb-field__input-wrapper",ref_key:"dropdownWrapper",ref:p},[t("div",M,[t("div",{class:"ccb-order-dropdown__input",onClick:o[0]||(o[0]=(...l)=>s(c)&&s(c)(...l))},[m.value.length?(n(),a("span",O,i(m.value),1)):(n(),a("span",N,i(s(e).placeholder?s(e).placeholder:s(u).getTranslations.selectValue),1)),o[2]||(o[2]=t("span",{class:"ccb-order-dropdown__icon"},[t("i",{class:"ccb-icon-Path-3485"})],-1))]),t("div",W,[t("ul",null,[t("li",{onClick:o[1]||(o[1]=b(()=>_(""),["prevent"]))},i(s(u).getTranslations.selectValue),1),(v=s(e).attributes)!=null&&v.options?(n(!0),a(x,{key:0},D(s(e).attributes.options,(l,f)=>(n(),a("li",{key:f,onClick:b(()=>_(`${l.optionText}_${f}`),["prevent"])},i(l.optionText),9,$))),128)):T("",!0)])])])],512)}}});export{U as default};
//# sourceMappingURL=Default-OejiO6UL.js.map
