1let reika_selector=new Vue({el:".beak-reika",data:{title:"VerSumHeima",countryGroups:countryGroups,countryList:countryList,countryColor:"#ee9b00",countryColors:{},mapObject:null,searchValue:"",selectedHitIndex:0,showSearchResults:!1,countryChosen:!0,showVerCountries:!0,selectedCountry:{group_id:countryGroups[1].id},activePrices:countryGroups[1].ver_sum_heima,showVerPrices:!0},mounted(){this.addColors();this.generateMap(this.countryColors)},computed:{searchResults(){const value=this.searchValue.toLowerCase();let results=this.countryList.filter(country=>country.cname.toLowerCase().includes(value));const matchedValue=results.find(country=>country.cname.toLowerCase()===value);if(matchedValue){const index=results.findIndex(country=>country.cname.toLowerCase()===value);results.splice(index,1);results.splice(0,0,matchedValue)} 2return results}},watch:{showVerCountries:function(val){if(val){if(this.showVerPrices){this.activePrices=this.countryGroups[1].ver_sum_heima}else{this.activePrices=this.countryGroups[1].without_ver_sum_heima} 3this.selectedCountry={group_id:countryGroups[1].id};this.countryChosen=!0;this.generateMap(this.countryColors)}else{this.countryChosen=!1;this.generateMap({})}},showVerPrices:function(val){this.handlePrices(val,this.selectedCountry)},selectedCountry:function(val){this.handlePrices(this.showVerPrices,val)},searchValue:function(val){this.showSearchResults=val.length>0&&this.searchResults.length>0}},methods:{generateMap(colors){let that=this;if(this.mapObject){$("#ver-world-map").vectorMap('get','mapObject').remove()} 4$("#ver-world-map").vectorMap({map:"world_mill",zoomMax:8,countryData:that.countryList,backgroundColor:"transparent",regionsSelectable:!0,regionsSelectableOne:!0,zoomOnScroll:!1,series:{regions:[{values:colors,},],},regionStyle:{initial:{fill:"#c6c5c1",},hover:{"fill-opacity":0.6,fill:that.countryColor,cursor:"",},selected:{fill:"#38B376",strole:"#38B376",},selectedHover:{fill:"#38B376",},},onRegionSelected:function(e,code,isSelected,selectedRegions){const activeCountry=that.countryList.find(element=>element.cc===code);that.countryChosen=!0;that.selectedCountry=activeCountry;$('html').animate({scrollTop:$(".price-container").offset().top-100},600)},onRegionTipShow:function(e,el,code){countryList.forEach(country=>{if(country.cc===code){if(Array.isArray(country.cname)){el.html(country.cname[0])}else{el.html(country.cname)}}})}});this.mapObject=$("#ver-world-map").vectorMap('get','mapObject')},addColors(){let currentColor="#000000";let regionTitle="VerSumHeima";if(regionType==="vinna"){currentColor="#ac003c";regionTitle="ReikaSumHeima"} 5if(use_black==='1'){currentColor="#000000"} 6const countryColors={};const filteredCountryList=this.countryList.filter(element=>element.group_id===87);filteredCountryList.forEach((country)=>(countryColors[""+country.cc]=currentColor));this.title=regionTitle;this.countryColor=currentColor;this.countryColors=countryColors},handlePrices(showVer,country){let activeGroup=this.countryGroups[this.countryGroups.length-1];if(country&&country.hasOwnProperty("group_id")){activeGroup=this.countryGroups.find(group=>group.id===country.group_id)} 7const field=showVer?"ver_sum_heima":"without_ver_sum_heima";this.activePrices=activeGroup[field]},changeSelectedHitIndex(e){if(e.code=="ArrowDown"){this.selectedHitIndex++} 8if(e.code=="ArrowUp"){this.selectedHitIndex--} 9if(this.selectedHitIndex>this.searchResults.length){this.selectedHitIndex=0} 10if(this.selectedHitIndex<0){this.selectedHitIndex=this.searchResults.length} 11if(this.selectedHitIndex===this.searchResults.length){this.selectedHitIndex=this.selectedHitIndex-1}},setSelectedCountry(val){if(val===null&&this.searchResults.length>0){console.log(this.selectedHitIndex) 12this.handleSetCountry(this.searchResults[this.selectedHitIndex].cc)}else if(val!==null){this.handleSetCountry(val.cc)}},handleSetCountry(region){this.countryChosen=!0;this.showSearchResults=!1;this.mapObject.clearSelectedRegions();this.mapObject.setSelectedRegions(region);this.mapObject.setFocus({region:region,animate:!0})},handleOnSearchFocus(){this.showSearchResults=this.searchValue.length>0&&this.searchResults.length>0},clearSearchField(){this.searchValue=""}},})
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.