1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7967],{44836:function(e,t,n){"use strict";var r,o=n(67294);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},c.apply(this,arguments)}t.Z=function(e){return o.createElement("svg",c({viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),r||(r=o.createElement("path",{d:"m12 4-8 8m0-8 8 8"})))}},28258:function(e,t,n){"use strict";n.d(t,{Z:function(){return M}});var r=n(85893),o=n(67294),c=n(9473),a=n(5152),i=n.n(a),s=n(11163),l=n(21617),u=n(26043),d=n(98451),h=n.n(d);var v,f,p=e=>{let{className:t}=e;const n=(0,s.useRouter)();return"/"===n.pathname?null:(0,r.jsx)("div",{className:(0,l.Z)(h().wrap,t),onClick:()=>{const e="cache"in n.query?"?cache=".concat(n.query.cache):"";window.history.length>2?n.back():n.push("/".concat(e))},children:(0,r.jsx)(u.Z,{fontSize:21})})};function m(){return m=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},m.apply(this,arguments)}var y=function(e){return o.createElement("svg",m({width:18,height:18,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v||(v=o.createElement("path",{d:"M0 9a9 9 0 1 1 18 0A9 9 0 0 1 0 9Z",fill:"#999"})),f||(f=o.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.554 11.845a1.22 1.22 0 0 0-.01 1.713c.465.476 1.224.48 1.694.01l2.765-2.765 2.847 2.846c.47.47 1.23.468 1.697-.006a1.216 1.216 0 0 0-.006-1.71L10.707 9.1l3.027-3.027a1.22 1.22 0 0 0 .009-1.713 1.189 1.189 0 0 0-1.694-.009L9.003 7.396 6.045 4.438a1.194 1.194 0 0 0-1.697.006 1.215 1.215 0 0 0 .007 1.71L7.3 9.099l-2.746 2.746Z",fill:"#fff"})))},g=n(44836),w=n(1640),_=n(54497),S=n(80972),b=n(43570),k=n(22730),E=n(30772),x=n(67171),C=n(66256),Z=n(11575),q=n(29342),I=n(60571),j=n(41714),B=n(57550),D=n(96121),R=n.n(D);var L=e=>(0,r.jsx)(B.Z,{...e,className:R().root,viewBox:"0 0 16 16",fill:"none",width:16,height:16,role:"img","aria-label":"icon search","aria-hidden":"true",children:(0,r.jsx)("path",{className:R().icon,fillRule:"evenodd",clipRule:"evenodd",d:"M15.601 14.2336L11.8041 10.418C16.3666 2.88358 7.17599 -3.20079 1.86036 1.85546C-3.29901 7.66483 3.16036 16.2492 10.4041 11.8242L14.201 15.5367C15.2979 16.743 16.701 15.3367 15.601 14.2336ZM6.44474 1.98671C12.4416 1.98671 12.6354 11.018 6.44474 11.018C0.416615 11.018 0.58849 1.98671 6.44474 1.98671Z"})}),O=n(14108),N=n.n(O),P=n(39332);const z=i()((()=>n.e(1339).then(n.bind(n,61339))),{loadableGenerated:{webpack:()=>[61339]},ssr:!1});var M=e=>{let{placeholder:t,onToggleSearchBlock:n}=e;var a;const i=(0,I.v)((e=>e.regions.current)),u=(0,I.v)((e=>e.searchProducts.suggest)),d=(0,I.v)((e=>e.flags.abTest)),h=(0,c.I0)(),{isDesktop:v,userAgent:f}=(0,_.bp)(),m=(0,s.useRouter)(),B=(0,o.useRef)(null),[D,R]=(0,o.useState)(!1),[O,M]=(0,o.useState)(""),[F,T]=(0,o.useState)(-1),[A,K]=(0,o.useState)(0),U=(0,S.HG)(f),G=[1].includes(d),H=(0,o.useRef)(null),W=(0,o.useRef)(0),J=(0,o.useMemo)((()=>(0,x.lJ)(u,v)),[u,v]);var Q;const V=F>=0&&null!==(Q=null===(a=J[F])||void 0===a?void 0:a.id)&&void 0!==Q?Q:null;(0,q.B)(!v&&D),(0,o.useEffect)((()=>{var e;V&&(null===(e=document.getElementById(V))||void 0===e||e.scrollIntoView({block:"nearest"}))}),[V]),(0,o.useEffect)((()=>{const e=document.querySelector("body"),t=document.querySelector("html");e&&t&&(D?(e.classList.add("".concat(N().noScroll)),t.classList.add("".concat(N().noScroll))):(e.classList.remove("".concat(N().noScroll)),t.classList.remove("".concat(N().noScroll))))}),[D]);const Y=()=>{R(!1),T(-1),null===n||void 0===n||n(!1)},X=async e=>{const t=e||O,n="cache"in m.query?m.query.cache:"",r=n?{query:t,cache:n}:{query:t};Y(),M(t),await m.push({pathname:"/search",query:r}),G&&k.Z.onSearch(t)};(0,Z.D)(B,Y),(0,o.useEffect)((()=>{if(K(A>0?A-1:0),m.query.query!==O&&!A){var e;const t=null===m||void 0===m||null===(e=m.query)||void 0===e?void 0:e.query;M(t||"")}}),[m.query.query]),(0,o.useEffect)((()=>{!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;(0,C.gw)("productSearch",(async()=>{K(A+1),await h((0,j.RB)(e,(null===i||void 0===i?void 0:i.id)||w.Up.msk,(null===i||void 0===i?void 0:i.city)||"")),K(A>0?A-1:0)}),t)}(O,O?500:0)}),[O]);var $;const ee=null!==($=(0,P.useSearchParams)().get("query"))&&void 0!==$?$:"";return(0,o.useEffect)((()=>{!ee||(null===window||void 0===window?void 0:window.checkFirstQuerySend)||(null===window||void 0===window?void 0:window.hintClick)||E.ZP.getUserSearch(ee),window.checkFirstQuerySend=!0}),[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:N().formWrapper,ref:B,children:[(0,r.jsx)(p,{className:N().back}),(0,r.jsxs)("form",{className:(0,l.Z)(N().searchForm,{[N().mobile]:!v}),onSubmit:e=>{var t;const n=null===(t=new FormData(e.currentTarget).get("search"))||void 0===t?void 0:t.toString();n&&X(n),e&&e.preventDefault(),(null===window||void 0===window?void 0:window.checkFirstQuerySend)&&
1(null===n||void 0===n?void 0:n.trim())&&E.ZP.getUserSearch(n)},children:[(0,r.jsxs)("div",{className:N().wrapper,children:[(0,r.jsx)("span",{className:N().searchIcon,"aria-hidden":"true",children:(0,r.jsx)(L,{})}),(0,r.jsx)("input",{className:(0,l.Z)(N().searchInput,{[N().active]:!!O,[N().searchInputIOS]:"iOS"===U&&!v}),type:"text",name:"search",value:O,onChange:e=>{const{value:t}=e.target;M(t),T(-1),R(!0),null===n||void 0===n||n(!0)},onFocus:()=>{R(!0),null===n||void 0===n||n(!0)},onKeyDown:e=>{if("ArrowDown"===e.key&&J.length)return e.preventDefault(),R(!0),null===n||void 0===n||n(!0),void T((e=>e<0?0:e<J.length-1?e+1:0));if("ArrowUp"===e.key&&J.length)return e.preventDefault(),R(!0),null===n||void 0===n||n(!0),void T((e=>e<0?J.length-1:e>0?e-1:J.length-1));if("Enter"===e.key&&F>=0&&J[F]){e.preventDefault();const t=J[F];return(0,b.EB)({option:t,router:m,dispatch:h,onSelect:X,region:(null===i||void 0===i?void 0:i.id)||w.Up.msk,city:(null===i||void 0===i?void 0:i.city)||""}),void("clear-history"!==t.action?Y():T(-1))}if("Escape"===e.key)return e.preventDefault(),void Y();"Tab"===e.key&&Y()},placeholder:t,autoComplete:"off",role:"combobox","aria-expanded":D&&J.length>0,"aria-controls":x.eI,"aria-autocomplete":"list","aria-activedescendant":null!==V&&void 0!==V?V:void 0,"aria-label":t||"\u041f\u043e\u0438\u0441\u043a \u0442\u043e\u0432\u0430\u0440\u043e\u0432",ref:H}),!!O&&(0,r.jsx)("button",{className:N().closeButton,type:"button",onClick:()=>{M(""),T(-1),R(!0),null===n||void 0===n||n(!0),requestAnimationFrame((()=>{var e;null===(e=H.current)||void 0===e||e.focus()}))},"aria-label":"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",children:v?(0,r.jsx)(g.Z,{}):(0,r.jsx)(y,{})}),(0,r.jsx)("button",{className:N().searchButton,children:"\u041d\u0430\u0439\u0442\u0438"})]}),D&&(0,r.jsx)(z,{onTouchStart:e=>{W.current=e.touches[0].clientY},onTouchEnd:e=>{var t;Math.abs(e.changedTouches[0].clientY-W.current)<10&&(null===(t=H.current)||void 0===t||t.blur())},onSelect:X,onClose:Y,activeOptionId:V})]})]}),!v&&D&&(0,r.jsx)("div",{className:N().hideSearchResult,children:"\u041e\u0442\u043c\u0435\u043d\u0430"})]})}},12112:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(67294),o=n(9473),c=n(11163),a=n(54497),i=n(60571),s=n(28226);const l=e=>{let{catalogButtonRef:t,menuRef:n}=e;const l=(0,o.I0)(),u=(0,c.useRouter)(),{isDesktop:d}=(0,a.bp)(),h=(0,i.v)((e=>e.catalogMenu.open)),v=(0,i.v)((e=>e.catalogMenu.items)),f=(0,i.v)((e=>e.catalogMenu.categoriesMap)),[p,m]=(0,r.useState)(null),[y,g]=(0,r.useState)(p),w=(0,r.useRef)(!1),_=(0,r.useCallback)((()=>{var e;null===(e=t.current)||void 0===e||e.focus()}),[t]),S=(0,r.useCallback)((()=>{var e;const t=null===(e=n.current)||void 0===e?void 0:e.querySelector("[data-catalog-main-link]");null===t||void 0===t||t.focus()}),[n]),b=(0,r.useCallback)((e=>{var t,r;null===(t=null===(r=n.current)||void 0===r?void 0:r.querySelector('[data-catalog-main-link][data-category-id="'.concat(e,'"]')))||void 0===t||t.focus()}),[n]),k=(0,r.useCallback)((e=>{g(e),requestAnimationFrame((()=>{var t,r;null===(t=null===(r=n.current)||void 0===r?void 0:r.querySelector('[data-catalog-submenu="'.concat(e,'"] [data-catalog-sub-link]')))||void 0===t||t.focus()}))}),[n]),E=(0,r.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];l((0,s.fh)(!1)),e&&_()}),[l,_]);return(0,r.useEffect)((()=>{(()=>{var e,t;const n=(null===u||void 0===u||null===(e=u.query)||void 0===e?void 0:e.id)||"",r=f[n]||{mainCategoryId:null},o=(null===v||void 0===v?void 0:v.length)>0?null===(t=v[0])||void 0===t?void 0:t.id:null;m((null===r||void 0===r?void 0:r.mainCategoryId)||o)})()}),[v,f]),(0,r.useEffect)((()=>{g(p)}),[p,h]),(0,r.useEffect)((()=>{var e,t;d||(h?null===(e=document.body)||void 0===e||e.classList.add("page_catalogOpened"):null===(t=document.body)||void 0===t||t.classList.remove("page_catalogOpened"))}),[h,d]),(0,r.useEffect)((()=>{d&&h?(w.current||requestAnimationFrame((()=>{S()})),w.current=h):w.current=h}),[S,d,h]),(0,r.useEffect)((()=>{if(!d||!h)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),E(!0))};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[E,d,h]),{items:v,isOpen:h,visibleItemId:y,handleCatalogMenuClose:E,handleHoverCategory:e=>()=>{d&&g(e)},handleFocusCategory:e=>()=>{d&&g(e)},handleMainCategoryKeyDown:(e,t)=>n=>{d&&t&&"ArrowRight"===n.key&&(n.preventDefault(),k(e))},handleSubCategoryKeyDown:(e,t,r)=>o=>{if(!d)return;const c=0===t,a=t===r-1;if("ArrowLeft"===o.key&&c)return o.preventDefault(),void b(e);if("Tab"===o.key&&o.shiftKey&&c)return o.preventDefault(),void b(e);
1if("Tab"===o.key&&!o.shiftKey&&a){var i;const t=Array.from((null===(i=n.current)||void 0===i?void 0:i.querySelectorAll("[data-catalog-main-link]"))||[]),r=t.findIndex((t=>t.dataset.categoryId===String(e)));var s;if(r<t.length-1)return o.preventDefault(),void(null===(s=t[r+1])||void 0===s||s.focus());o.preventDefault(),E(!0)}},handleClickCategory:e=>()=>{m(e),(d||null!==y)&&E(!1)},handleClickMainItemLink:e=>{d||null!==y||e.preventDefault()},handleGoBack:e=>{e.preventDefault(),e.stopPropagation(),m(null)}}}},43570:function(e,t,n){"use strict";n.d(t,{CJ:function(){return s},EB:function(){return l},u0:function(){return i}});var r=n(22730),o=n(30772),c=n(28226),a=n(41714);const i=e=>{let{item:t,router:n,onSelect:c}=e;if(o.ZP.trackEvent("MN_search_hint_click"),"string"===typeof t)return void("function"===typeof c&&(r.Z.onSelectSuggest("/search/?query=".concat(t)),o.ZP.getUserSearch(t),window.hintClick=!0,c(t)));if("type"in t){switch(t.type){case"catalog":{let e="/catalog/".concat(t.url_name);"cache"in n.query&&(e+="?cache=".concat(n.query.cache)),n.push(e);break}case"adv_item":{const e=t.url_name||"";r.Z.onSelectSuggest(e),window.location.href=e;break}default:{let e="/product/".concat(t.url_name);"cache"in n.query&&(e+="?cache=".concat(n.query.cache)),r.Z.onSelectSuggest(e),n.push(e)}}return}const a="/cards/".concat(t.url_name,".html");r.Z.onSelectSuggest(a),window.location.href=a},s=(e,t)=>{e((0,c.vc)()),"function"===typeof t&&t()},l=e=>{let{option:t,router:n,dispatch:r,onSelect:o,region:c,city:l}=e;if("clear-history"===t.action)return r((0,a.Rw)()),void r((0,a.RB)("",c,l));"search-all-categories"!==t.action?t.item&&i({item:t.item,router:n,onSelect:o}):s(r,o)}},67171:function(e,t,n){"use strict";n.d(t,{X$:function(){return a},eI:function(){return o},i7:function(){return c},lJ:function(){return i}});var r=n(66256);const o="search-suggestions-listbox",c=["adv_items","texts","catalog_products","catalog_products_other_category","catalog_items","histories","most_popular"],a=e=>"search-option-".concat(e),i=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=[];let o=0;return c.forEach((c=>{const i=e[c];if(!i)return;const s=(0,r.if)(i);"histories"===c&&s.length&&(n.push({id:a(o),action:"clear-history"}),o+=1),s.forEach((e=>{n.push({id:a(o),item:e}),o+=1})),t&&"catalog_products_other_category"===c&&s.length&&(n.push({id:a(o),action:"search-all-categories"}),o+=1)})),n}},11575:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(67294);function o(e,t){(0,r.useEffect)((()=>{function n(n){e.current&&!e.current.contains(n.target)&&t(n)}return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}}),[e])}},29342:function(e,t,n){"use strict";n.d(t,{B:function(){return i}});var r=n(67294),o=n(54497);let c=0;var a;const i=e=>{const{isDesktop:t}=(0,o.bp)();(0,r.useLayoutEffect)((()=>{if(t||!e)return;const n=null!==(a=document.getElementById("header-container"))&&void 0!==a?a:document.querySelector("header");if(!n)return;c+=1;const r=()=>{n.style.setProperty("--mobile-header-bottom","".concat(n.getBoundingClientRect().bottom,"px"))};r();const o=new ResizeObserver(r);return o.observe(n),window.addEventListener("resize",r),window.addEventListener("scroll",r,{passive:!0}),()=>{o.disconnect(),window.removeEventListener("resize",r),window.removeEventListener("scroll",r),c-=1,c<=0&&(c=0,n.style.removeProperty("--mobile-header-bottom"))}}),[e,t])}},41714:function(e,t,n){"use strict";n.d(t,{Rw:function(){return g},RB:function(){return m},gI:function(){return y}});var r=n(37826),o=n(2568),c=n.n(o),a=n(80972),i=n(14796),s=n(72061);class l extends s.Z{async fetch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.memoization(e)}async memoizeSet(e,t){return new Promise(((n,r)=>{try{const r=c()((0,a.U5)(e).toString());"undefined"===typeof this.memoize[this.storeEntity]&&(this.memoize[this.storeEntity]={}),this.memoize[this.storeEntity][r]=t,n(t)}catch(o){r(o)}}))}async memoizeGet(e){return new Promise(((t,n)=>{try{const r=c()((0,a.U5)(e).toString()),o=this.memoize[this.storeEntity][r];"undefined"===typeof o&&n("Not found"),t(o)}catch(r){n(r)}}))}async memoization(e){try{return await this.memoizeGet(e)}catch(t){const n=await super.search(e);return await this.memoizeSet(e,n)}}constructor(e){super(e),this.memoize={},this.storeEntity="search"}}var u=new l((0,i.Z)()),d=n(86366);class h extends s.Z{constructor(e){super(e,d.T),this.storeEntity="suggest"}}var v=new h((0,i.Z)()),f=n(70245),p=n(66084);const m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;return async c=>{c({payload:e,type:p.aU});const a=(0,f.GK)("fetchSuggest","internal",o);try{const r=await v.fetch({text:e,region:t,city:n});c({payload:(null===r||void 0===r?void 0:r.data)||{},type:p.BZ})}catch(i){(0,r.v)("cannot fetch suggest",{err:i}),c({payload:{},type:p.BZ})}finally{(0,f.n5)(a)}}},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return async t=>{t({payload:e,type:p.vx})}},g=e=>async t=>{t({type:p.Wo});const n=(0,f.GK)("deleteSearchHistory","internal",e);try{await u.delete()}catch(o){(0,r.v)("cannot delete search history",{err:o})}finally{t({type:p.K0}
1),m(),(0,f.n5)(n)}}},96121:function(e){e.exports={icon:"search_icon__13T1f",pulse:"search_pulse__qKsvM"}},98451:function(e){e.exports={wrap:"BackInHistory_wrap__DpH_8"}},14108:function(e){e.exports={formWrapper:"productSearch_formWrapper___yPTw",back:"productSearch_back__NuZu3",searchForm:"productSearch_searchForm__ZmmrZ",mobile:"productSearch_mobile__4bO6X",wrapper:"productSearch_wrapper__8fjiY",hideSearchResult:"productSearch_hideSearchResult__lV0ik",searchIcon:"productSearch_searchIcon__5kZyC",searchInput:"productSearch_searchInput__IBZ1f",rightPad:"productSearch_rightPad__95OmQ",searchInputIOS:"productSearch_searchInputIOS__v_gIK",absolute:"productSearch_absolute___sot_",closeButton:"productSearch_closeButton__uhxE3",searchButton:"productSearch_searchButton__7HWOS",noScroll:"productSearch_noScroll__oD7Jd",pulse:"productSearch_pulse__oCVuC"}}}]);
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.