1import{u as M}from"./useTranslations.c22cd7a7.js";import{c as Z,u as W}from"./entry.1ffe6d42.js";import{D as X,r as b,d as y,w as Y,X as o,a8 as h,ak as q,a6 as C,a3 as d,a7 as $,a4 as m,z as u,E as G,Z as k,W as J,F as x,a9 as S,Y as B,a5 as V,ab as K,ac as Q}from"./vendor-forms.dc4a930e.js";import{o as R}from"./index.1e76a479.js";import{C as L}from"./index.31b8c4a9.js";import{_ as ee}from"./_plugin-vue_export-helper.c27b6911.js";const le=_=>(K("data-v-0bbdb79c"),_=_(),Q(),_),te={class:"multiselect-wrapper"},se={key:0,class:"multiselect-label"},ae=le(()=>d("svg",{class:"multiselect__carrot",width:"12",height:"7",viewBox:"0 0 12 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[d("path",{d:"M10.5 1.5L6 6L1.5 1.5",fill:"#27334D"}),d("path",{d:"M10.5 1.5L6 6L1.5 1.5H10.5Z",stroke:"#27334D","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),ce={key:0,class:"multiselect__body"},ue={class:"multiselect__body-content"},ie={class:"multiselect__childs"},ne={key:0,class:"multiselect__buttons-container"},de=X({__name:"index",props:{value:null,options:null,placeholder:{default:"ÐÑбеÑиÑе опÑиÑ"},updateOnApply:{type:Boolean,default:!0},appendParent:{type:Boolean,default:!1},toggleAllTitle:null},emits:["update:value"],setup(_,{emit:g}){const l=_,f=M(),{locale:N}=Z(),v=b(!1),w=y(()=>f.value.selected||""),A=b(null);R(A,()=>v.value=!1);const D=()=>v.value=!v.value,{$services:O}=W(),r=b([...l.value]),T=O.debounce.debounce((a,s,t)=>{var p;let e=[...r.value];if(s){const i=l.options.find(n=>n.id===a),c=((p=i==null?void 0:i.childOptions)==null?void 0:p.map(n=>n.id))??[];t?(e=e.filter(n=>!c.includes(n)),e.push(...c)):e=e.filter(n=>!c.includes(n))}else t?e.push(a):e=e.filter(i=>i!==a);r.value=e,l.updateOnApply||g("update:value",e)},100),U=y(()=>
1{if(!l.value.length)return l.placeholder;const a=l.options.find(s=>O.objectHelper.isSame([...l.value].sort(),s.childOptions.map(t=>t.id).sort()));if(l.value.length===1){const s=l.options.map(e=>e.childOptions).flat().find(e=>(e==null?void 0:e.id)===l.value[0]);if(!s)return l.placeholder;const t=l.options.find(e=>{var p;return(p=e.childOptions)==null?void 0:p.find(i=>i.id===(s==null?void 0:s.id))});return l.appendParent?`${s==null?void 0:s.title} \\ ${t==null?void 0:t.title}`:s==null?void 0:s.title}else if(a)return a.title;return N.value==="ru"?`${w.value} ${l.value.length}`:`${l.value.length} ${w.value.toLowerCase()}`}),E=()=>{g("update:value",[]),r.value=[...l.value],v.value=!1},I=()=>{g("update:value",[...r.value]),v.value=!1},P=()=>{const a=[];l.value.length||l.options.forEach(s=>{var t;a.push(...((t=s==null?void 0:s.childOptions)==null?void 0:t.map(e=>e.id))??[])}),g("update:value",a)};Y(()=>l.value,a=>{r.value=[...a]});const j=f.value.reset,z=f.value.apply,F=y(()=>l.toggleAllTitle?l.toggleAllTitle:l.value.length?f.value.reset:f.value.selectAll);return(a,s)=>(o(),h("div",te,[a.$slots.label?(o(),h("div",se,[q(a.$slots,"label",{},void 0,!0)])):C("",!0),d("div",{ref_key:"multiselect",ref:A,class:$(["multiselect",!l.options.length&&"multiselect--empty",u(v)&&"multiselect--open"])},[d("div",{class:$(["multiselect__head",l.value.length&&"multiselect__head--filled"]),onClick:D},[d("span",null,m(u(U)),1),ae],2),G(J,{name:"fade"},{default:k(()=>[u(v)?(o(),h("div",ce,[d("div",ue,[(o(!0),h(x,null,S(_.options,(t,e)=>{var p,i;return o(),B(L,{id:`checkbox-${e}`,key:e,value:(p=t==null?void 0:t.childOptions)==null?void 0:p.every(c=>u(r).includes(c.id)),multiple:"",partial:!!((i=t==null?void 0:t.childOptions)!=null&&i.find(c=>u(r).includes(c.id))),"onUpdate:checked":c=>u(T)(t==null?void 0:t.id,!0,c)},{childs:k(()=>[d("div",ie,[t.childOptions?(o(!0),h(x,{key:0},S(t.childOptions,(c,n)=>(o(),B(L,{id:`child-checkbox-${e+(n+e)}__${c.id}`,key:n,value:u(r).includes(c.id),"onUpdate:checked":H=>u(T)(c.id,!1,H)},{default:k(()=>[V(m(c.title),1)]),_:2},1032,["id","value","onUpdate:checked"]))),128)):C("",!0)])]),default:k(()=>[V(m(t.title)+" ",1)]),_:2},1032,["id","value","partial","onUpdate:checked"])}),128))]),_.updateOnApply?(o(),h("div",ne,[d("div",{class:"multiselect__btn multiselect__btn__apply",onClick:I},m(u(z)),1),d("div",{class:"multiselect__btn",onClick:E},m(u(j)),1)])):(o(),h("div",{key:1,class:"multiselect__btn",onClick:P},m(u(F)),1))])):C("",!0)]),_:1})],2)]))}});const me=ee(de,[["__scopeId","data-v-0bbdb79c"]]);export{me as _};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.