import{openBlock as r,createElementBlock as c,Fragment as m,createElementVNode as n,normalizeClass as g,toDisplayString as d,createCommentVNode as a,withDirectives as _,vModelText as q,vModelCheckbox as h,renderList as v}from "/js/vue.esm-browser.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))p(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&p(s)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function p(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();const b=(t,e)=>{const l=t.__vccOpts||t;for(const[p,i]of e)l[p]=i;return l},R={props:{app:null,version:"big"},data(){return{search:"",rendering:0,selectedId:0,opened:!1,isLoadCalled:!1,loading:!0,bigAirports:!1,checkedAll:!1,itemsIds:[],items:[],itemsPop:[]}},watch:{opened(t,e){this.search=""},rendering(t,e){},loading(t,e){},itemsToRender(t,e){},"app.req.geo"(t,e){this.filterItems()},"app.isGeoLoaded"(t,e){t&&(this.loading=!1,this.filterItems())},"app.getReqGeoRegions"(t,e){this.loading||this.filterItems()},"app.getReqGeoCities"(t,e){this.loading||this.filterItems()}},created:function(){let t=this;t.app.req.geo||(t.app.req.geo=[],t.filterItems())},computed:{countryId:function(){return this.app.req.co},itemsToRender(){return this.items},isEmpty:function(){return this.app.getReqGeoDistrict.length<1}},methods:{filterItems(){let t=this,e=t.search.trim().toLocaleLowerCase(),l=ReverseLocale.convertEnToRu(e),p=e.length>0,i=t.app.dictGeo.district,o=t.app.getReqGeoRegions[0],s=t.app.getReqGeoCities;t.itemsIds=[],t.items=[],t.itemsPop=[];for(let f in i){if(!i.hasOwnProperty(f))continue;let u=i[f].cityId,w=t.app.dictGeo.city[i[f].cityId],y=w?w.regionId:null;if(!(s.length&&s.indexOf(u)<0)&&!(o>0&&(!t.app.relRegionCityIds[y]||o!==y))){if(p){if(e.length<5){if(i[f].nameIndex.indexOf(e)!==0&&i[f].nameIndex.indexOf(l)!==0)continue}else if(i[f].nameIndex.indexOf(e)<0&&i[f].nameIndex.indexOf(l)<0)continue}i[f].isPopular?(t.itemsIds.push(i[f].id),t.itemsPop.push(i[f])):(t.itemsIds.push(i[f].id),t.items.push(i[f]))}}t.itemsPop.sort(function(f,u){return f.name.localeCompare(u.name)}),t.items.sort(function(f,u){return f.name.localeCompare(u.name)}),t.rendering++},searchItemsByText:invDebounce(function(){this.filterItems()},150),getCountryNameGen(){return window.app.forms.country.getCountryNameGen()},filteredRegion(){return window.app.forms.region?window.app.forms.region.getSelectedGeoId():null},filteredRegionName(){return window.app.forms.region.getSelectedGeoName()},checkAllCity(t){let e=this;e.checkedAll?e.app.req.geo=[].concat(e.itemsIds,e.app.getReqGeoCities,e.app.getReqGeoRegions).unique():e.app.req.geo=e.app.req.geo.diffNotIn(e.app.getReqGeoDistrict).unique()},getLabel(){let t=this;return t.app.getReqGeoDistrict.length<1?"ВСЕ ВАРИАНТЫ":t.app.getReqGeoDistrict.length==1&&t.app.dictGeo.district[t.app.getReqGeoDistrict[0]]?t.app.dictGeo.district[t.app.getReqGeoDistrict[0]].name:"ВЫБРАНО "+t.app.getReqGeoDistrict.length},getLabelTi(){let t=this;return t.app.getReqGeoDistrict.length<1?"РАЙОНЫ":t.app.getReqGeoDistrict.length==1&&t.app.dictGeo.district[t.app.getReqGeoDistrict[0]]?t.app.dictGeo.district[t.app.getReqGeoDistrict[0]].name:"РАЙОНЫ - "+t.app.getReqGeoDistrict.length},open(){let t=this;t.isInitialized=!0,t.opened=!0},apply(){let t=[];this.app.getReqGeoRegions>0&&t.push(this.app.getReqGeoRegions[0]);for(let e in this.app.getReqGeoCities)this.app.getReqGeoCities.hasOwnProperty(e)&&t.push(this.app.getReqGeoCities[e]);for(let e in this.app.req.geo)this.app.req.geo.hasOwnProperty(e)&&t.push(this.app.req.geo[e]);this.app.req.geo=t.unique(),this.opened=!1,this.search="",this.filterItems()},cancel(t){let e=this;e.app.req.geo=e.app.req.geo.diffNotIn(e.app.getReqGeoDistrict),e.checkedAll=!1,t&&(this.opened=!1,this.search="",this.filterItems())}}},k={class:"bth__inp-block"},G=n("span",{class:"bth__inp-lbl"},"Районы",-1),C={key:0,class:"bth__inp"},I={key:1,class:"bth__inp"},x={class:"bth__inp-block"},N=n("span",{class:"bth__inp-lbl"},"Районы",-1),P={key:0,class:"bth__inp"},D={key:1,class:"bth__inp"},L={key:2,class:"lsfw-form-control-wrap lsfw-form-control-wrap--right"},O={class:"lsfw-form-control"},A={class:"lsfw-form-control__head lsfw-form-control__head-flex"},T=n("div",{class:"lsfw-form-control__ttl"},"Выберите район",-1),E={key:0,class:"lsfw-form-control__tags"},S={class:"lsfw-form-control__filter"},V={class:"lsfw-form-control__search"},F={class:"lsfw-form-control__body lsfw-form-control__body--scroll p0"},z={key:0,class:"lsfw-form-control__fill-line"},B={key:1,class:"lsfw-form-control__ul bold"},U={class:"lsfw-form-control__ul-li pt10 pb10"},M={class:"lsfw-cbx lsfw-cbx--green-check"},K=n("label",{class:"bold",for:"district1"}," выбрать все районы",-1),j={key:2,class:"lsfw-form-control__fill-line"},H={class:"lsfw-cbx lsfw-cbx--green-check"},J=["id","value"],Q=["for"],W={class:"fz10 grey lsfw-form-control__cut70"},X={key:4,class:"lsfw-form-control__fill-line"},Y={key:0},Z={key:1},$={class:"lsfw-cbx lsfw-cbx--green-check"},ee=["id","value"],te=["for"],ie={class:"fz10 grey lsfw-form-control__cut70"},se={key:6,class:"lsfw-form-control__fill-line grey"},oe={class:"lsfw-form-control__footer"};function le(t,e,l,p,i,o){return r(),c(m,null,[l.version=="big"?(r(),c("div",{key:0,onClick:e[0]||(e[0]=s=>o.open()),class:"pointer relative"},[n("i",{class:g(["tour-selection-field__icon40 fas fa-map-marker-alt",{active:!o.isEmpty}])},null,2),n("div",k,[G,i.loading?(r(),c("span",C,"...")):(r(),c("span",I,d(o.getLabel()),1))])])):a("",!0),l.version=="small-ti"?(r(),c("div",{key:1,onClick:e[1]||(e[1]=s=>o.open()),class:"pointer relative"},[n("i",{class:g(["tour-selection-field__icon40 fas fa-map-marker-alt",{active:!o.isEmpty}])},null,2),n("div",x,[N,i.loading?(r(),c("span",P,"...")):(r(),c("span",D,d(o.getLabelTi()),1))])])):a("",!0),i.opened?(r(),c("div",L,[n("div",O,[n("div",A,[T,n("i",{onClick:e[2]||(e[2]=s=>o.apply()),class:"lsfw-form-control__close-square fas fa-times-circle"})]),o.filteredRegion()>0||l.app.getReqGeoCities.length>0?(r(),c("div",E,[o.filteredRegion()>0?(r(),c("div",{key:0,onClick:e[3]||(e[3]=s=>l.app.req.geo=l.app.req.geo.diffNotIn([o.filteredRegion()]).unique()),class:"lsfw-form-control__tag"},d(o.filteredRegionName()),1)):a("",!0),l.app.getReqGeoCities.length===1?(r(),c("div",{key:1,onClick:e[4]||(e[4]=s=>l.app.req.geo=l.app.req.geo.diffNotIn(l.app.getReqGeoCities)),class:"lsfw-form-control__tag"},d(l.app.dictGeo.city[l.app.getReqGeoCities[0]].name),1)):a("",!0),l.app.getReqGeoCities.length>1?(r(),c("div",{key:2,onClick:e[5]||(e[5]=s=>l.app.req.geo=l.app.req.geo.diffNotIn(l.app.getReqGeoCities)),class:"lsfw-form-control__tag"},"города - "+d(l.app.getReqGeoCities.length),1)):a("",!0)])):a("",!0),n("div",S,[n("div",V,[n("i",{onClick:e[6]||(e[6]=s=>i.search=""),class:"pointer lsfw-form-control__search-cross"}),_(n("input",{class:"red uppercase","onUpdate:modelValue":e[7]||(e[7]=s=>i.search=s),onKeyup:e[8]||(e[8]=s=>o.searchItemsByText()),type:"text",placeholder:"Введите название района "},null,544),[[q,i.search]])])]),n("div",F,[i.search&&i.search.length>0?(r(),c("div",z," результаты поиска ")):a("",!0),!i.search||!i.search.length?(r(),c("ul",B,[n("li",U,[n("div",M,[_(n("input",{"onUpdate:modelValue":e[9]||(e[9]=s=>i.checkedAll=s),onChange:e[10]||(e[10]=s=>o.checkAllCity()),type:"checkbox",id:"district1"},null,544),[[h,i.checkedAll]]),K])])])):a("",!0),(!i.search||!i.search.length)&&i.itemsPop.length>0?(r(),c("div",j," популярные туристические районы")):a("",!0),i.itemsPop.length>0?(r(),c("ul",{key:3,class:g(["lsfw-form-control__ul lsfw-form-control__ul--lower pt10 bold",{pb10:!i.search}])},[(r(!0),c(m,null,v(i.itemsPop,s=>(r(),c("li",{key:s.id,class:"lsfw-form-control__ul-li lsfw-form-control__ul-li--flex"},[n("div",H,[_(n("input",{id:"lsfwdist_"+s.id,"onUpdate:modelValue":e[11]||(e[11]=f=>l.app.req.geo=f),type:"checkbox",value:s.id},null,8,J),[[h,l.app.req.geo]]),n("label",{for:"lsfwdist_"+s.id,class:"lsfw-form-control__cut200"},d(s.name),9,Q)]),n("div",W,d(s.cityName),1)]))),128))],2)):a("",!0),(!i.search||!i.search.length)&&i.items.length>0?(r(),c("div",X,[o.filteredRegion()<1?(r(),c("span",Y,"районы городов "+d(o.getCountryNameGen()),1)):(r(),c("span",Z,"районы в "+d(o.filteredRegionName()),1))])):a("",!0),i.items.length>0?(r(),c("ul",{key:5,class:g(["lsfw-form-control__ul lsfw-form-control__ul--lower pb10",{pt10:!i.search}])},[(r(!0),c(m,null,v(i.items,s=>(r(),c("li",{key:s.id,class:"lsfw-form-control__ul-li lsfw-form-control__ul-li--flex"},[n("div",$,[_(n("input",{id:"lsfwdist_"+s.id,"onUpdate:modelValue":e[12]||(e[12]=f=>l.app.req.geo=f),type:"checkbox",value:s.id},null,8,ee),[[h,l.app.req.geo]]),n("label",{for:"lsfwdist_"+s.id,class:"lsfw-form-control__cut200"},d(s.name),9,te)]),n("div",ie,d(s.cityName),1)]))),128))],2)):a("",!0),i.items.length==0&&i.itemsPop.length==0?(r(),c("div",se," По вашему запросу ничего не найдено ")):a("",!0)]),n("div",oe,[n("button",{onClick:e[13]||(e[13]=s=>o.apply()),class:"lsfw-form-control__btn"},"Применить"),l.app.req.geo.length>0?(r(),c("button",{key:0,onClick:e[14]||(e[14]=s=>o.cancel()),class:"lsfw-form-control__btn lsfw-form-control__btn--grey"},"сбросить")):a("",!0)])])])):a("",!0)],64)}const ne=b(R,[["render",le]]);window.lsfw||(window.lsfw={});window.form3District=ne;
