1import{_ as b}from"./SwitchButton.YGt_ij0p.js";import{_ as v}from"./InputText.FcHS6AOL.js";import{_ as x,a as l,c as m,e as y,d as p,N as k,h as d,K as g,bF as S,n as O,m as h,f as C,b as n,F as w,p as c,A as V,B as $}from"./entry.LLImgy_-.js";import{c as L}from"./index.TLPxyOJe.js";const R={"extra-options":"_extra-options_1wqdb_1"},q={__name:"ExtraOptions",props:{modelValue:{type:Object,default:()=>({sku:"",ids:""})}},emits:["extra-search"],setup(e){return(t,s)=>{const r=v;return l(),m("div",{class:p(t.$style["extra-options"]),onKeyup:s[1]||(s[1]=k(o=>t.$emit("extra-search"),["enter"]))},[y(r,{modelValue:e.modelValue.ids,"onUpdate:modelValue":s[0]||(s[0]=o=>e.modelValue.ids=o),label:"Ðод ÑоваÑа или ÑоваÑов ÑеÑез запÑÑÑÑ",name:"ids",maxlength:"1000"},null,8,["modelValue"])],34)}}},U={$style:R},B=x(q,[["__cssModules",U]]),I={name:"CommonSearchPanel",props:{placeholder:{type:String,default:"ЧÑо бÑдем иÑкаÑÑ?"},autofocus:{type:Boolean,default:!1},autoclear:{type:Boolean,default:!1}},data(){return{checkbox:!1,in_orders:!1,extra:!1,label:"",value:"",searchTextUrl:"",extraOptions:{sku:"",ids:"",text:"",select:null},searchResult:[],autocompleteObserver:null}},setup(){return{main:d()}},computed:{...g(d,["isLogin","windowWidth"]),isSearchResults(){return this.searchResult.length>0}},watch:{windowWidth(e){e&&this.setCSSVariable()},$route(){this.$route.name!=="prod-list-search"&&(this.extraOptions={sku:"",ids:"",text:"",select:null},this.extra=!1),this.$route.query.f14_6&&(this.searchTextUrl=S(this.$route.query.f14_6)),this.checkRoute()}},mounted(){this.checkRoute(),this.setCSSVariable()},methods:{doSearch(e){let t={},s="z";const r=(e==null?void 0:e.select)!==null?e==null?void 0:e.select.value.trim():this.extraOptions.text.trim();if(r||this.extraOptions.ids||this.extraOptions.sku)return t={f14_6:this.limitSearch(r),f14_39:this.checkbox?this.value:0},this.isLogin&&this.in_orders&&(t={...t,in_orders:!0}),this.extra&&(this.extraOptions.sku||this.extraOptions.ids)?(s="a",t={...t,sku:this.extraOptions.sku,ids:this.extraOptions.ids}):t={...t,f14_16:4,next:1},O({name:"prod-list-search",params:{sort:s,page:1},query:t}).finally(()=>this.$emit("search-close",!0))},limitSearch(e=""){return e.length<=255?e:e.slice(0,255)},checkRoute(){this.in_orders=this.isLogin&&this.$route.query.hasOwnProperty("in_orders")?this.$route.query.in_orders:!1,this.label="Ð ÑÑой каÑегоÑии";const e=this.$route.query.f14_39!=="0"?this.$route.query.f14_39:!1;if(e)this.checkbox=!0,this.value=e,e.startsWith("promo")?this.label="Ð ÑÑой акÑии":e.startsWith("set")?this.label="Ð ÑÑом комплекÑе":e.startsWith("series")&&(this.label="Ð ÑÑой ÑеÑии");else{const{subtype:t,id:s}=this.$route.params;if(this.checkbox=!1,this.value="",t&&s)switch(t){case"article":this.value=t+s;break;case"promo":this.value=t+s,this.label="Ð ÑÑой акÑии";break;case"set":this.value=t+s,this.label="Ð ÑÑом комплекÑе";break;case"series":this.value="s"+s,this.label="Ð ÑÑой ÑеÑии";break;case"catalogue":this.value="c"+s;break;case"producer":this.value="p"+s;break}}},searchTextHandle(e){this.extraOptions.text=e,e.length>0?this.searchResult=this.$refs.ac.searchOptions:this.searchResult=[]},runObserve(){if(!this.autocompleteObserver&&this.main.isMobile){this.autocompleteObserver=new MutationObserver(t=>{for(const s of t)if(s.type==="attributes"){const r=document.querySelector("[data-target-js]"),o=Number(s.target.style.height.replace("px","")),a=Number(getComputedStyle(s.target).maxHeight.replace("px",""));o<a?r.style.top=`${o/2}px`:r.style.top=`${a/2}px`}});const e=()=>setTimeout(()=>{var t,s,r;if((t=this.$refs.ac)!=null&&t.$el){const o=(r=(s=this.$refs.ac)==null?void 0:s.$el)==null?void 0:r.querySelector(".autocomplete__input textarea");this.autocompleteObserver.observe(o,{attributes:!0,attributeFilter:["style"]})}else e()},200);e()}},setCSSVariable(){var t,s,r,o,a,u;const e=(s=(t=this.$refs.ac)==null?void 0:t.$el)==null?void 0:s.getBoundingClientRect();(o=(r=this.$refs.ac)==null?void 0:r.$el)==null||o.style.setProperty("--searchdrop-width-container",`${e==null?void 0:e.width}px`),(u=(a=this.$refs.ac)==null?void 0:a.$el)==null||u.style.setProperty("--searchdrop-left-container",`${e==null?void 0:e.left}px`)}}},T=e=>(V("data-v-0460804a"),e=e(),$(),e),M={class:"options"},H=T(()=>n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[n("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.8047 3.13807C14.0651 2.87772 14.0651 2.45561 13.8047 2.19526C13.5444 1.93491 13.1223 1.93491 12.8619 2.19526L8 7.05719L3.13807 2.19526C2.87772 1.93491 2.45561 1.93491 2.19526 2.19526C1.93491 2.45561 1.93491 2.87772 2.19526 3.13807L7.05719 8L2.19526 12.8619C1.93491 13.1223 1.93491 13.5444 2.19526 13.8047C2.45561 14.0651 2.87772 14.0651 3.13807 13.8047L8 8.94281L12.8619 13.8047C13.1223 14.0651 13.5444 14.0651 13.8047 13.8047C14.0651 13.5444 14.0651 13.1223 13.8047 12.8619L8.94281 8L13.8047 3.13807Z",fill:"#616161"})],-1)),N=[H];function E(e,t,s,r,o,a){const u=b,f=B,_=L;
1return l(),h(_,{ref:"ac",class:p(["search-panel-autocomplete",{"autocomplete--is-hide":a.isSearchResults}]),api:"/cgi-bin/ajax/search.pl",query:{keypresses:1,flags:0},placeholder:s.placeholder,autoselect:"",autofocus:s.autofocus,autoclear:s.autoclear,"search-value":o.searchTextUrl,onSearchInput:a.doSearch,onSearchText:a.searchTextHandle,onInputFocus:t[5]||(t[5]=i=>e.$emit("input-focus")),onSearchClose:t[6]||(t[6]=i=>e.$emit("search-close",i)),"onHook:mounted":a.runObserve},{default:C(()=>[n("div",{class:p({"options--desktop":!r.main.isMobile})},[!a.isSearchResults||!r.main.isMobile?(l(),m(w,{key:0},[n("div",M,[n("div",null,[o.value?(l(),h(u,{key:0,modelValue:o.checkbox,"onUpdate:modelValue":t[0]||(t[0]=i=>o.checkbox=i),label:o.label,style:{"margin-right":"10px"}},null,8,["modelValue","label"])):c("",!0),e.isLogin?(l(),h(u,{key:1,modelValue:o.in_orders,"onUpdate:modelValue":t[1]||(t[1]=i=>o.in_orders=i),label:"РзаказаÑ
"},null,8,["modelValue"])):c("",!0)]),n("div",{class:p(["extra__options",{"extra__options--active":o.extra}])},[n("div",{class:"extra__options-descript",onClick:t[2]||(t[2]=i=>o.extra=!o.extra)},"ÐополниÑелÑнÑе паÑамеÑÑÑ"),o.extra?(l(),m("div",{key:0,class:"extra__options__close",onClick:t[3]||(t[3]=i=>o.extra=!1)},N)):c("",!0)],2)]),o.extra?(l(),h(f,{key:0,modelValue:o.extraOptions,"onUpdate:modelValue":t[4]||(t[4]=i=>o.extraOptions=i),onExtraSearch:a.doSearch},null,8,["modelValue","onExtraSearch"])):c("",!0)],64)):c("",!0)],2)]),_:1},8,["class","placeholder","autofocus","autoclear","search-value","onSearchInput","onSearchText","onHook:mounted"])}const K=x(I,[["render",E],["__scopeId","data-v-0460804a"]]);export{K 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.