import{u as V}from"./appearanceStore-Cp-euDX2.js";import{c as _}from"./color-filter.utils-DukMf1cu.js";import{a as u,r as $}from"./vendor-vue-reactivity-CheHbvBM.js";import{e as s,a as h}from"./vendor-vue-runtime-core-DwK6Ry68.js";function M(n,g){const v=u(()=>n.options),l=u(()=>n.alias),o=u(()=>n.current),a=u(()=>n.repeater),r=$(""),d=()=>{var t;const e=(t=v.value)==null?void 0:t.find(i=>{var p;return i.optionValue===((p=r.value)==null?void 0:p.toString())});g("update",e)},c=()=>Math.random().toString(36).substring(2,15),f=s(()=>typeof(a==null?void 0:a.value)<"u"?`repeater_${a.value}_${l.value}_${c()}`:`${l.value}_${c()}`),m=s(()=>e=>((e==null?void 0:e.optionValue)||"").split("_")[0]||0),S=s(()=>{const e=(r.value||"").split("_")[1];return e?+e:""}),C=s(()=>{const e=V(),t=e.getAppearanceAccentColor;return e.getAppearanceSvgColor&&t?_(t):{}});return h(()=>{var e;o!=null&&o.value&&(r.value=((e=o.value)==null?void 0:e.optionValue)||"")}),{optionValues:r,changeValue:d,getName:f,current:o,getPriceValue:m,getCurrentIndex:S,getImageStyles:C}}export{M as u};
//# sourceMappingURL=useSingleOptionChildShared-C5mC6TrZ.js.map
