1import{r as y,j as e,S as D,a as K,K as O,L as q,$ as R}from"./app-BbrdVYdX.js";import{R as M,a as H,D as Z}from"./distance-form-Dttb56xm.js";import{B as I}from"./app-logo-icon-CfUOcWWo.js";import{L as W}from"./label-CcZj-J33.js";import{C as J,a as G}from"./city-autocomplete-input-CaIy-s8B.js";import{R as C,W as Q}from"./wrench-BPRLmxJq.js";import{F,a as X,u as Y,f as ee,B as te,A as se}from"./app-layout-BbqyoTZU.js";import{L as re}from"./loader-circle-Dcq5qEiH.js";import{A as u,C as ie,P as ae}from"./plug-zap-DIwhhAkq.js";import{R as oe}from"./tag-C00kh_Hf.js";import{R as de}from"./route-sidebar-t5oQYPsD.js";import{S as ne}from"./sparkles-D9_FRGSG.js";/* empty css */import"./card-D91zl0-u.js";import"./input-CV3214mS.js";import"./index-D3V3MO4I.js";import"./users-CNRXcm-V.js";import"./favorite-routes-DV3_5O_f.js";import"./navigation-B5CVxCpy.js";import"./index-DI_RB9C1.js";import"./map-DjgV-G1K.js";import"./trash-2-MMbS8G9o.js";function le({from:i,via:a="",viaLabel:c=""}){const[m,v]=y.useState(""),[t,o]=y.useState(null),[n,f]=y.useState(null),[l,p]=y.useState(!1),N=async _=>{var h;_.preventDefault();const x=m.trim();if(!(!x||l)){p(!0),f(null),o(null);try{const s=await K.post("/distance/route",{from:i,to:x,...a?{via:a}:{}});if(!s.data.success){f(s.data.error_code==="no_route"?"ÐвÑомобилÑнÑй маÑÑÑÑÑ Ð¼ÐµÐ¶Ð´Ñ Ð²ÑбÑаннÑми пÑнкÑами не найден. Ðозможно, Ð¼ÐµÐ¶Ð´Ñ Ð½Ð¸Ð¼Ð¸ Ð½ÐµÑ Ð½ÐµÐ¿ÑеÑÑвного авÑомобилÑного ÑообÑениÑ. ÐопÑобÑйÑе вÑбÑаÑÑ Ð´ÑÑгой пÑнкÑ.":s.data.error_code==="unknown_location"?"Ðе ÑдалоÑÑ Ð¾Ð¿ÑеделиÑÑ Ð¾Ð´Ð¸Ð½ из вÑбÑаннÑÑ
наÑелÑннÑÑ
пÑнкÑов. ÐÑовеÑÑÑе название и вÑбеÑиÑе пÑÐ½ÐºÑ Ð¸Ð· подÑказок.":s.data.error_code==="internal"?"Ðе ÑдалоÑÑ Ð¿Ð¾ÑÑÑоиÑÑ Ð¼Ð°ÑÑÑÑÑ Ð¸Ð·-за внÑÑÑенней оÑибки VEZOO. ÐопÑобÑйÑе повÑоÑиÑÑ ÑаÑÑÑÑ Ð¿Ð¾Ð·Ð¶Ðµ.":"СеÑÐ²Ð¸Ñ Ð¿Ð¾ÑÑÑÐ¾ÐµÐ½Ð¸Ñ Ð¼Ð°ÑÑÑÑÑа вÑеменно недоÑÑÑпен. ÐопÑобÑйÑе повÑоÑиÑÑ ÑаÑÑÑÑ ÑеÑез неÑколÑко минÑÑ.");return}if(!a&&s.data.route_url){D.visit(s.data.route_url,{replace:!0,preserveScroll:!1});return}o(s.data),window.requestAnimationFrame(()=>{var g;return(g=document.getElementById("route-draft-result"))==null?void 0:g.scrollIntoView({behavior:"smooth",block:"start"})})}catch(s){K.isAxiosError(s)?f(((h=s.response)==null?void 0:h.status)===400?"Ðе ÑдалоÑÑ Ð¾Ð¿ÑеделиÑÑ Ð¾Ð´Ð¸Ð½ из вÑбÑаннÑÑ
наÑелÑннÑÑ
пÑнкÑов. ÐÑовеÑÑÑе название и вÑбеÑиÑе пÑÐ½ÐºÑ Ð¸Ð· подÑказок.":"СеÑÐ²Ð¸Ñ Ð¿Ð¾ÑÑÑÐ¾ÐµÐ½Ð¸Ñ Ð¼Ð°ÑÑÑÑÑа вÑеменно недоÑÑÑпен. ÐопÑобÑйÑе повÑоÑиÑÑ ÑаÑÑÑÑ ÑеÑез неÑколÑко минÑÑ."):f("Ðе ÑдалоÑÑ Ð¿Ð¾ÑÑÑоиÑÑ Ð¼Ð°ÑÑÑÑÑ.")}finally{p(!1)}}};return e.jsxs("div",{className:"mx-auto w-full min-w-0 max-w-3xl py-4",children:[e.jsxs("section",{className:"overflow-hidden rounded-2xl border border-[#ead8b8] bg-card shadow-sm",children:[e.jsxs("div",{className:"border-b bg-gradient-to-br from-[#fff8e9] via-white to-[#fffdf8] p-4 dark:from-[#2a2114] dark:via-card dark:to-card sm:p-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-[#a86500]",children:[e.jsx(C,{className:"size-4"}),"ÐланиÑование поездки"]}),e.jsxs("h1",{className:"mt-1 text-xl font-semibold sm:text-2xl",children:["ÐаÑÑÑÑÑ Ð¸Ð· ",i,c?` ÑеÑез ${c}`:""]}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:a?"ÐÑбÑÐ°Ð½Ð½Ð°Ñ ÐÐС Ñже добавлена как ÑоÑÐ½Ð°Ñ Ð¿ÑомежÑÑоÑÐ½Ð°Ñ ÑоÑка. ÐÑÑалоÑÑ Ð²ÑбÑаÑÑ, кÑда еÑ
аÑÑ Ð´Ð°Ð»ÑÑе.":"ÐоÑод оÑпÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ Ñже вÑбÑан. УкажиÑе пÑÐ½ÐºÑ Ð½Ð°Ð·Ð½Ð°ÑениÑ."})]}),e.jsxs("form",{onSubmit:N,className:"grid gap-4 p-4 sm:p-5",children:[e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border bg-muted/30 p-3",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:"ÐÑкÑда"}),e.jsx("div",{className:"mt-1 font-semibold",children:i})]}),a&&e.jsxs("div",{className:"rounded-xl border border-[#f4b142]/50 bg-[#f4b142]/8 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[e.jsx(F,{className:"size-3.5"}),"ÐÑÑановка по пÑÑи"]}),e.jsx("div",{className:"mt-1 font-semibold",children:c||"ÐÑбÑÐ°Ð½Ð½Ð°Ñ ÐÐС"}),e.jsxs("div",{className:"mt-1 flex items-center gap-1 text-[11px] text-muted-foreground",children:[e.jsx(X,{className:"size-3"}),a]})]})]}),e.jsxs("div",{className:"grid gap-1.5",children:[e.jsx(W,{htmlFor:"route-draft-to",children:"ÐÑда"}),e.jsx(J,{id:"route-draft-to",autoFocus:!0,required:!0,autoComplete:"off",value:m,onChange:v,placeholder:"ÐведиÑе гоÑод наÐ
1·Ð½Ð°ÑениÑ"})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx(I,{type:"submit",disabled:l||!m.trim(),className:"h-11 flex-1 bg-[#f4b142] font-semibold hover:bg-[#e9a52f]",children:l?e.jsxs(e.Fragment,{children:[e.jsx(re,{className:"size-4 animate-spin"}),"СÑÑоим маÑÑÑÑÑ..."]}):e.jsxs(e.Fragment,{children:["РаÑÑÑиÑаÑÑ",e.jsx(u,{className:"size-4"})]})}),e.jsxs(I,{type:"button",variant:"outline",className:"h-11",onClick:()=>D.visit("/",{replace:!0}),disabled:l,children:[e.jsx(oe,{className:"size-4"}),"ÐбÑÑнÑй ÑаÑÑÑÑ"]})]}),n&&e.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-200",children:n})]})]}),t&&e.jsxs("div",{id:"route-draft-result",className:"mt-6",children:[e.jsx(M,{result:t}),e.jsx(H,{result:t})]})]})}const ce=[{titleKey:"distance.fuelTitle",descriptionKey:"distance.fuelDesc",href:"/azs",icon:F},{titleKey:"distance.foodTitle",descriptionKey:"distance.foodDesc",href:"/kafe",icon:ee},{titleKey:"distance.hotelTitle",descriptionKey:"distance.hotelDesc",href:"/gostinitsy",icon:te},{titleKey:"distance.serviceTitle",descriptionKey:"distance.serviceDesc",href:"/sto",icon:Q},{titleKey:"distance.tyresTitle",descriptionKey:"distance.tyresDesc",href:"/shinomontazh",icon:G},{titleKey:"distance.parkingTitle",descriptionKey:"distance.parkingDesc",href:"/parkovki",icon:ie},{titleKey:"distance.chargingTitle",descriptionKey:"distance.chargingDesc",href:"/zaryadki",icon:ae}];function Ke(i){var T,S;const a=O(),{seoSettings:c,siteSettings:m,ziggy:v}=a.props,{t,href:o,locale:n}=Y(),f=ce.map(r=>({...r,title:t(r.titleKey),description:t(r.descriptionKey)})),l=new URLSearchParams(a.url.split("?")[1]??""),p=(l.get("route_from")??"").trim(),N=(l.get("route_via")??"").trim(),_=(l.get("route_via_label")??"").trim(),x=p.length>=2,h=r=>r.replace(/\s*\(.*?\)\s*$/,"").trim(),s=!!(i.initialFrom&&i.initialTo),g=!s&&!x,w=s?h(i.initialFrom):"",k=s?h(i.initialTo):"",d=`${w} â ${k}`,P=s?n==="ru"?`РаÑÑÑоÑние ${d} на маÑине: маÑÑÑÑÑ Ð½Ð° каÑÑе, вÑÐµÐ¼Ñ Ð² пÑÑи, ÑаÑÑ
од Ñоплива`:`${t("route.distance")} ${d}: ${t("form.map")}, ${t("route.duration")}, ${t("form.fuel")}`:n==="ru"?c.home_title:`VEZOO â ${t("form.introTitle")}`,A=s?n==="ru"?`ÐоÑÑÑоиÑÑ Ð¼Ð°ÑÑÑÑÑ ${d} на каÑÑе. РаÑÑÑоÑние Ð¼ÐµÐ¶Ð´Ñ Ð³Ð¾Ñодами, вÑÐµÐ¼Ñ Ð² пÑÑи, ÑаÑÑ
од Ñоплива, ÑÑоимоÑÑÑ Ð¿Ð¾ÐµÐ·Ð´ÐºÐ¸ и подÑÐ¾Ð±Ð½Ð°Ñ ÑÑ
ема доÑоги.`:`${d}. ${t("form.introText")}`:n==="ru"?c.home_description:t("form.introText"),b=s?new URL(o(((T=i.initialResult)==null?void 0:T.route_url)??a.url.split("?")[0]),v.location).toString():new URL(o("/"),v.location).toString(),E=s?[{title:t("common.home"),href:o("/")},{title:d,href:b}]:[],j=(S=i.initialResult)==null?void 0:S.route,B=j&&!Array.isArray(j),L=s&&!i.shouldNoIndex?JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:t("common.home"),item:new URL(o("/"),b).toString()},{"@type":"ListItem",position:2,name:d,item:b}]},...B?[{"@type":"Trip",name:`${t("common.route")} ${d}`,url:b,itinerary:{"@type":"ItemList",itemListElement:[{"@type":"ListItem",position:1,item:{"@type":"Place",name:w}},{"@type":"ListItem",position:2,item:{"@type":"Place",name:k}}]},additionalProperty:[{"@type":"PropertyValue",name:t("route.distance"),value:j.kilometers,unitCode:"KMT",unitText:t("common.km")},{"@type":"PropertyValue",name:t("route.duration"),value:j.minutes,unitCode:"MIN",unitText:"min"}]}]:[]]}).replace(/</g,"\\u003c"):null,U=r=>o(s&&r!=="/azs"?`${r}?from=${encodeURIComponent(w)}&to=${encodeURIComponent(k)}`:r),z=i.sidebar.popular.slice(0,6),V=g?"min-w-0 [&>div:first-child]:px-3 [&>div:first-child>form]:rounded-[24px] [&>div:first-child>form]:border-[#ead8b8] [&>div:first-child>form]:shadow-[0_12px_34px_-26px_rgba(90,60,15,0.55)] [&>div:first-child>section]:rounded-[22px] [&>div:first-child>section]:border-[#ead8b8]/80 [&>div:first-child>section]:shadow-[0_12px_30px_-26px_rgba(90,60,15,0.5)] sm:[&>div:first-child]:px-4 lg:[&>div:first-child>form]:rounded-[28px] lg:[&>div:first-child>form]:border-[#f4b142]/45 lg:[&>div:first-child>form]:bg-gradient-to-br lg:[&>div:first-child>form]:from-white lg:[&>div:first-child>form]:via-white lg:[&>div:first-child>form]:to-[#fff9ed] lg:[&>div:first-child>form]:p-6 lg:[&>div:first-child>form]:shadow-[0_20px_55px_-30px_rgba(120,74,8,0.45)] dark:lg:[&>div:first-child>form]:from-card dark:lg:[&>div:first-child>form]:via-card dark:lg:[&>div:first-child>form]:to-[#2a2114] lg:[&>div:first-child>section]:rounded-[24px] lg:[&>div:first-child>section]:border-[#ead8b8]/80 lg:[&>div:first-child>section]:shadow-[0_16px_40px_-30px_rgba(90,60,15,0.45)]":"min-w-0";return e.jsxs(se,{breadcrumbs:E,children:[e.jsxs(q,{title:P,children:[e.jsx("meta",{"head-key":"robots",name:"robots",content:i.shouldNoIndex||x?"noindex, follow":c.indexing_enabled?"index, follow":"noindex, nofollow"}),e.jsx("meta",{"head-key":"description",name:"description",content:A}),e.jsx("link",{"head-key":"canonical",rel:"canonical",href:b}),L&&e.jsx("script",{"head-key":"route-structured-data",type:"application/ld+json",dangerouslySetInnerHTML:{__html:L}})]}),e.jsxs("div",{className:`site-container grid overflow-x-hidden gap-6 pb-8 ${m.sidebar_enabled?"lg:grid-cols-[minmax(0,1fr)_320px]":""}`,children:[e.jsxs("main",{className:`${x?"":"lg:[&>div:first-child]:max-w-none"} ${V}`,children:[x?e.jsx(le,{from:p,via:N,viaLabel:_}):e.jsx(Z,{initialFrom:i.initialFrom,initialTo:i.initialTo,initialResult:i.initialResult,sharedTrip:i.sharedTrip}),g&&z.length>0&&e.jsxs("section",{className:"mt-6 overflow-hidden rounded-[22px] border border-[#ead8b8] bg-card [content-visibility:auto] [contain-intrinsic-size:auto_520px] shadow-[0_14px_36px_-30px_rgba(90,60,15,0.55)] sm:mx-0 sm:mt-8 lg:rou
1nded-[26px] lg:shadow-[0_18px_50px_-35px_rgba(90,60,15,0.5)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 border-b bg-gradient-to-r from-[#fff7e7] via-white to-white px-4 py-4 dark:from-[#2a2114] dark:via-card dark:to-card sm:px-6 sm:py-5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-[#f4b142]/18 text-[#b36e05] shadow-inner sm:size-11 sm:rounded-2xl",children:e.jsx(C,{className:"size-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"truncate text-base font-semibold tracking-tight sm:text-lg",children:t("distance.popular")}),e.jsx(ne,{className:"size-4 shrink-0 text-[#d78d18]"})]}),e.jsx("p",{className:"mt-0.5 hidden text-sm text-muted-foreground sm:block",children:t("distance.popularText")})]})]}),e.jsxs(R,{href:o("/populyarnye-marshruty"),className:"group inline-flex shrink-0 items-center gap-1 rounded-lg border border-[#f4b142]/45 bg-white px-2.5 py-2 text-xs font-semibold text-[#9a6208] shadow-sm transition active:scale-[0.98] sm:gap-2 sm:rounded-xl sm:px-4 sm:text-sm lg:hover:-translate-y-0.5 lg:hover:border-[#f4b142] lg:hover:shadow-md dark:bg-card",children:[t("distance.all"),e.jsx(u,{className:"size-3.5 sm:size-4"})]})]}),e.jsx("div",{className:`grid gap-3 ${z.length===1?"grid-cols-1":"grid-cols-1 sm:grid-cols-2 xl:grid-cols-3"}`,children:z.map((r,$)=>e.jsxs(R,{href:o(r.url),className:"group relative flex items-center gap-3 rounded-2xl border border-[#ead8b8]/80 bg-card px-4 py-3.5 transition active:bg-[#fff7e7] sm:block sm:px-5 sm:py-5 lg:hover:z-10 lg:hover:-translate-y-0.5 lg:hover:bg-[#fffaf1] lg:hover:shadow-lg dark:active:bg-[#2a2114] dark:lg:hover:bg-[#2a2114]",children:[e.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-[#f4b142]/10 text-[11px] font-bold text-[#a96806] sm:absolute sm:right-4 sm:top-4 sm:size-7",children:$+1}),e.jsxs("div",{className:"min-w-0 flex-1 sm:pr-9",children:[e.jsx("span",{className:"block truncate text-sm font-semibold text-foreground",children:r.from_name}),e.jsxs("div",{className:"my-0.5 flex items-center gap-2 text-[11px] text-muted-foreground sm:my-1.5 sm:text-xs",children:[e.jsx("span",{className:"h-px w-4 bg-[#f4b142] sm:w-5"}),e.jsx("span",{children:t("distance.to")})]}),e.jsx("span",{className:"block truncate text-sm font-medium text-foreground/90",children:r.to_name})]}),e.jsx(u,{className:"size-4 shrink-0 text-muted-foreground sm:hidden"}),e.jsxs("div",{className:"mt-4 hidden items-center justify-between text-xs text-muted-foreground sm:flex",children:[e.jsx("span",{children:r.views?`${r.views.toLocaleString(n)} ${t("distance.views")}`:t("distance.open")}),e.jsx(u,{className:"size-4 transition-all lg:group-hover:translate-x-1 lg:group-hover:text-[#c77c08]"})]})]},r.url))})]}),e.jsxs("section",{className:"mt-6 overflow-hidden rounded-[22px] border border-[#ead8b8]/90 bg-card [content-visibility:auto] [contain-intrinsic-size:auto_760px] shadow-[0_14px_36px_-30px_rgba(90,60,15,0.5)] transition-shadow duration-200 sm:mx-0 sm:mt-8 sm:rounded-2xl lg:rounded-[26px] lg:border-[#ead8b8] lg:shadow-[0_18px_50px_-35px_rgba(90,60,15,0.48)] lg:hover:shadow-[0_22px_60px_-38px_rgba(90,60,15,0.55)]","aria-labelledby":"roadside-tools-title",children:[e.jsxs("div",{className:"border-b bg-gradient-to-br from-[#fff9ed] via-white to-white px-4 py-5 dark:from-[#2a2114] dark:via-card dark:to-card sm:px-6 sm:py-6 lg:px-7 lg:py-7",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.08em] text-[#b36e05] sm:text-sm sm:normal-case sm:tracking-normal",children:s?`${t("common.route")} ${d}`:t("distance.planning")}),e.jsx("h2",{id:"roadside-tools-title",className:"mt-1 text-xl font-semibold tracking-tight sm:text-2xl",children:t("distance.useful")}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:s?`${t("distance.usefulRoute")} ${d}.`:t("distance.usefulIntro")})]}),e.jsx("div",{className:"grid gap-3 bg-transparent sm:grid-cols-2 xl:grid-cols-3",children:f.map(r=>{const $=r.icon;return e.jsxs(R,{href:U(r.href),className:"group relative rounded-2xl border border-[#ead8b8]/80 bg-card px-4 py-4 transition active:bg-[#fff7e7] sm:p-5 lg:p-6 lg:hover:z-10 lg:hover:-translate-y-0.5 lg:hover:bg-[#fffaf0] lg:hover:shadow-lg dark:active:bg-[#2a2114] dark:lg:hover:bg-[#2a2114]",children:[e.jsxs("div",{className:"flex items-center gap-3 sm:items-start",children:[e.jsx("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-xl bg-[#f4b142]/15 text-[#b36e05] transition duration-200 sm:size-10 lg:group-hover:scale-105 lg:group-hover:bg-[#f4b142]/25",children:e.jsx($,{className:"size-4.5 sm:size-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"font-semibold transition-colors group-hover:text-[#8a5500]",children:r.title}),e.jsx("p",{className:"mt-0.5 text-xs leading-5 text-muted-foreground sm:mt-1 sm:text-sm",children:r.description})]}),e.jsx(u,{className:"size-4 shrink-0 text-muted-foreground sm:hidden"})]}),e.jsx(u,{className:"absolute bottom-5 right-5 hidden size-4 text-transparent transition-all sm:block lg:group-hover:translate-x-1 lg:group-hover:text-[#c77c08]"})]},r.href)})}),!s&&e.jsx("div",{className:"border-t bg-muted/20 px-4 py-4 text-xs leading-5 text-muted-foreground sm:px-6 sm:py-5 sm:text-sm sm:leading-6 lg:px-7",children:t("distance.buildFirst")})]})]}),m.sidebar_enabled&&e.jsx(de,{data:i.sidebar,sticky:m.sidebar_sticky_enabled,variant:s?"route":"home"})]})]})}export{Ke as default};
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.