import{c as h}from"./color-filter.utils-DukMf1cu.js";import{u as A}from"./widget-BUAABBRb.js";import{C,k as s,O,b as n,o as V}from"./convert-case-to-camel-case.utils-DDUpNI96.js";function I(r,i){const{field:o,values:u}=C(r),a=s([]);O(()=>r.values,e=>{a.value=e});const l=s(o.value.repeaterIdx),c=s(o.value.alias),p=n(()=>typeof(l==null?void 0:l.value)<"u"?`repeater_${l.value}_${c.value}`:c.value),v=()=>{const e=a.value.length;+o.value.maxAllowedOptions<e&&a.value.shift();const t=Object.values(a.value).join(",");i("update",t)},f=n(()=>e=>((e==null?void 0:e.optionValue)||"").split("_")[0]||0),d=n(()=>{var e;return((e=o.value.selectedOption)==null?void 0:e.map(t=>t.optionValue))||[]}),g=n(()=>{const e=A(),t=e.getAppearanceAccentColor;return e.getAppearanceSvgColor&&t?h(t):{}}),m=n(()=>o.value.showValueInOption||!1);return V(()=>{Array.isArray(u.value)&&(a.value=u.value)}),{optionValues:a,changeValue:v,getName:p,getPriceValue:f,selectedOptions:d,getImageStyles:g,showPrice:m}}export{I as u};
//# sourceMappingURL=useMultiOptionChildShared-DVKrDZdt.js.map
