PageSourceSearch

https://www.bspb.ru/_next/static/chunks/4172.234d56a87215826d.js

js bspb.ru collected 2026-10-09 16:49:00 UTC 6,264 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4172],{27906:function(e,t,n){n.r(t);var o=n(85893),l=n(10738),u=n(11163),i=n(28440),r=n(67294),c=n(55826),s=n(72338),a=n(53325),d=n(84535),f=n(31445),v=n(31795);t.default=e=>{var t;let{places:n,centerPoint:g,zoom:m,showModalwithDataPlace:p,isSelected:y,itemFromList:b,officesSearch:k,atmsSearch:j}=e,{global:{showGeoButton:w}}=(0,i.l)(),{query:h}=(0,u.useRouter)(),C=(0,r.useRef)(null),O=(0,r.useRef)(null),E=(0,r.useRef)(null),[I,S]=(0,r.useState)(null),[P,R]=(0,c.I)("first-map-mount"),[D,L]=(0,r.useState)(),{isActiveGeo:T,position:x}=(0,a.P)(),N=(0,r.useCallback)(async()=>{if(!T)return console.log("denied");if(T){let e=[null==x?void 0:x.latitude,null==x?void 0:x.longitude],t=(0,s.kp)(x,n);if(t){let{lat:n,lng:o}=t.location,l=C.current&&C.current.util.bounds.fromPoints([[n,o],e]);return I.setBounds(l,{zoomMargin:20}),L([null==x?void 0:x.latitude,null==x?void 0:x.longitude])}return I.setCenter([null==x?void 0:x.latitude,null==x?void 0:x.longitude]),I.setZoom(16),L([null==x?void 0:x.latitude,null==x?void 0:x.longitude])}},[x,I,C,T,n]);(0,r.useEffect)(()=>{if(!h.city&&I&&C.current&&x&&T&&!b){if(!n.length)return;let e=setTimeout(()=>N(),100);return()=>clearTimeout(e)}},[I&&C.current,T,x,n,b]),(0,r.useEffect)(()=>{if(b)return;let e=setTimeout(()=>{let e=null==I?void 0:I.geoObjects.getBounds();if((null==n?void 0:n.length)&&(null==e?void 0:e.length)&&(k||j)){if(P){R(!1);return}I.setBounds(e,{checkZoomRange:!0})}},1);return()=>clearTimeout(e)},[I,n,k,j]),(0,r.useEffect)(()=>{g&&I&&(I.setCenter(g.coordinates),I.setZoom(m))},[I,...null!==(t=null==g?void 0:g.coordinates)&&void 0!==t?t:[],m,n]),(0,r.useEffect)(()=>L(void 0),[j,k]);let setActivePin=e=>{if(O.current&&O.current.objects._objectsById[e]){var t,n;E.current&&(null===(t=O.current)||void 0===t||t.objects.setObjectOptions(E.current.id,{iconImageHref:E.current.href})),E.current={href:O.current.objects._objectsById[e].options.iconImageHref,id:e};let[o,l]=O.current.objects._objectsById[e].options.iconImageHref.split(".");null===(n=O.current)||void 0===n||n.objects.setObjectOptions(e,{iconImageHref:"".concat(o,"-active.").concat(l)})}};(0,r.useEffect)(()=>{if(O.current&&E.current&&!y){var e;O.current.objects.setObjectOptions(null===(e=E.current)||void 0===e?void 0:e.id,{iconImageHref:E.current.href})}if(y&&b){let e=setTimeout(()=>y&&setActivePin(b.id),1e3);return()=>clearTimeout(e)}},[y]);let _=(0,r.useMemo)(()=>{var e;return null==n?void 0:null===(e=n.filter(e=>{var t,n;return(null==e?void 0:null===(t=e.location)||void 0===t?void 0:t.lat)&&(null==e?void 0:null===(n=e.location)||void 0===n?void 0:n.lng)}))||void 0===e?void 0:e.map(e=>{var t,n,o;let l=(null==e?void 0:e.loyaltyProgramType)==="YARKO"?"yarko":(null==e?void 0:null===(t=e.atm)||void 0===t?void 0:t.key)||"pin";return{id:null==e?void 0:e.id,type:"Feature",geometry:{type:"Point",coordinates:[(null==e?void 0:null===(n=e.location)||void 0===n?void 0:n.lat)?e.location.lat:0,(null==e?void 0:null===(o=e.location)||void 0===o?void 0:o.lng)?e.location.lng:0]},options:{contentLayout:"",iconLayout:"default#imageWithContent",iconImageHref:"/image/markers/".concat(l,".svg"),iconImageSize:[40,54],iconImageOffset:[-40,-54]}}})},[n]),Z=(0,r.useCallback)(e=>{let t=e.get("objectId"),o=null==n?void 0:n.find(e=>{let{id:n}=e;return n===t});setActivePin(t),(null==o?void 0:o.typeQuery)&&p(null==o?void 0:o.typeQuery,t)},[n]);return(0,o.jsx)(l.Yy,{query:{apikey:"6b62425c-0b11-41ad-819d-67c4f21c4783",lang:"ru_RU"},children:(0,o.jsxs)(l.D5,{instanceRef:S,defaultState:{center:null==g?void 0:g.coordinates,zoom:m},width:"100%",height:"100%",modules:["layout.ImageWithContent","util.bounds","geolocation"],options:{fullscreenZIndex:1200},onLoad:e=>{C.current=e},children:[(0,o.jsx)(v.Z,{getPlaces:_,handlerOnClick:Z,ref:O}),(0,o.jsx)(l.ot,{options:{position:{left:10,top:10}}}),(0,o.jsx)(l.Ly,{options:{position:{right:10,bottom:27}}}),(0,o.jsx)(d.Z,{onClick:N,isActiveGeo:T,show:w}),T&&D&&(0,o.jsx)(f.Z,{coordinates:D})]})})}},55826:function(e,t,n){n.d(t,{I:function(){return useCustomLocalStorage}});var o=n(67294);let useCustomLocalStorage=(e,t)=>
1{let n=localStorage.getItem(e),[l,u]=(0,o.useState)(n?JSON.parse(n):t),i=(0,o.useCallback)(t=>{let n=t instanceof Function?JSON.stringify(t(l)):JSON.stringify(t);window.dispatchEvent(new StorageEvent("storage",{key:e,newValue:n})),localStorage.setItem(e,n)},[e,l]);return(0,o.useEffect)(()=>{let listener=n=>{n.key===e&&u(n.newValue?JSON.parse(n.newValue):t)};return window.addEventListener("storage",listener),()=>window.removeEventListener("storage",listener)},[e,t]),[l,i]}},14803:function(e,t,n){n.d(t,{q:function(){return useDisclosure}});var o=n(21325),l=n(67294),u=n(49739);function useDisclosure(e={}){let{onClose:t,onOpen:n,isOpen:i,id:r}=e,c=(0,u.W)(n),s=(0,u.W)(t),[a,d]=(0,l.useState)(e.defaultIsOpen||!1),[f,v]=function(e,t){let n=void 0!==e;return[n,n&&void 0!==e?e:t]}(i,a),g=(0,o.Me)(r,"disclosure"),m=(0,l.useCallback)(()=>{f||d(!1),null==s||s()},[f,s]),p=(0,l.useCallback)(()=>{f||d(!0),null==c||c()},[f,c]),y=(0,l.useCallback)(()=>{let e=v?m:p;e()},[v,p,m]);return{isOpen:!!v,onOpen:p,onClose:m,onToggle:y,isControlled:f,getButtonProps:(e={})=>({...e,"aria-expanded":v,"aria-controls":g,onClick:function(...e){return function(t){e.some(e=>(null==e||e(t),null==t?void 0:t.defaultPrevented))}}(e.onClick,y)}),getDisclosureProps:(e={})=>({...e,hidden:!v,id:g})}}},49739:function(e,t,n){n.d(t,{W:function(){return useCallbackRef}});var o=n(4063),l=n(67294),u=o.jU?l.useLayoutEffect:l.useEffect;function useCallbackRef(e,t=[]){let n=(0,l.useRef)(e);return u(()=>{n.current=e}),(0,l.useCallback)((...e)=>{var t;return null==(t=n.current)?void 0:t.call(n,...e)},t)}},4063:function(e,t,n){function getOwnerDocument(e){var t;return null!=e&&"object"==typeof e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE&&null!=(t=e.ownerDocument)?t:document}n.d(t,{jU:function(){return o},lZ:function(){return getOwnerDocument}});var o=!!("undefined"!=typeof window&&window.document&&window.document.createElement)},92625:function(e,t,n){n.d(t,{k:function(){return lazyDisclosure}});function lazyDisclosure(e){let{wasSelected:t,enabled:n,isSelected:o,mode:l="unmount"}=e;return!n||!!o||"keepMounted"===l&&!!t}}}]);

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.