You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
6.3 KiB
2 lines
6.3 KiB
2 weeks ago
|
var v=Object.defineProperty;var D=(e,t,o)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var l=(e,t,o)=>D(e,typeof t!="symbol"?t+"":t,o);/* empty css */import{V as T,f as $,e as m,M as S,C as O,_ as E,g as L,h as u,i as f,j as h,l as g,k as b,w as A,F as V,x as i,p as C}from"./index-BLqts8WY.js";import{m as Z,i as F,u as P,v as z}from"./vue-leaflet.es-D17g3l39.js";import{Q as U}from"./QuickNav-DgCyvgDx.js";var Q=Object.defineProperty,R=Object.getOwnPropertyDescriptor,j=(e,t,o,a)=>{for(var s=a>1?void 0:a?R(t,o):t,p=e.length-1,c;p>=0;p--)(c=e[p])&&(s=(a?c(t,o,s):c(s))||s);return a&&s&&Q(t,o,s),s};const d=.01,k=2,w=2;let y=class extends T{constructor(){super(...arguments);l(this,"$notify");l(this,"isChoosingSearchBox",!1);l(this,"isNewMarkerSet",!1);l(this,"localCenterLat",0);l(this,"localCenterLong",0);l(this,"localLatDiff",d);l(this,"localLongDiff",d);l(this,"localZoom",w);l(this,"searchBox",null)}async mounted(){var a;const o=await $();this.searchBox=((a=o.searchBoxes)==null?void 0:a[0])||null,this.resetLatLong()}setMapPoint(o){var a,s;if(this.isNewMarkerSet)this.localLatDiff=Math.abs(o.latlng.lat-this.localCenterLat),this.localLongDiff=Math.abs(o.latlng.lng-this.localCenterLong);else{this.localCenterLat=o.latlng.lat,this.localCenterLong=o.latlng.lng;let p=d,c=d;const r=(s=(a=o.target.boxZoom)==null?void 0:a._map)==null?void 0:s.getBounds();r&&(p=Math.abs(r.getNorthEast().lat-r.getSouthWest().lat)/8,c=Math.abs(r.getNorthEast().lng-r.getSouthWest().lng)/8),this.localLatDiff=p,this.localLongDiff=c,this.isNewMarkerSet=!0}}resetLatLong(){var o;if((o=this.searchBox)!=null&&o.bbox){const a=this.searchBox.bbox;this.localCenterLat=(a.maxLat+a.minLat)/2,this.localCenterLong=(a.eastLong+a.westLong)/2,this.localLatDiff=(a.maxLat-a.minLat)/2,this.localLongDiff=(a.eastLong-a.westLong)/2,this.localZoom=k,this.isNewMarkerSet=!0}else this.isNewMarkerSet=!1}async storeSearchBox(){if(this.localCenterLong||this.localCenterLat)try{const o={name:"Local",bbox:{eastLong:this.localCenterLong+this.localLongDiff,maxLat:this.localCenterLat+this.localLatDiff,minLat:this.localCenterLat-this.localLatDiff,westLong:this.localCenterLong-this.localLongDiff}};await m.open(),await m.settings.update(S,{searchBoxes:[o]}),this.searchBox=o,this.isChoosingSearchBox=!1,this.$notify({group:"alert",type:"success",title:"Saved",text:"That has been saved in your preferences. You can now filter by it on your home screen feed."},7e3),this.$router.back()}catch(o){this.$notify({group:"alert",type:"danger",title:"Error Updating Search Settings",text:"Try going to a different page and then coming back."},-1),console.error("Telling user to retry the location search setting because:",o)}else this.$notify({group:"alert",type:"warning",title:"No Location Selected",text:"Select a location on the map."},-1)}async forgetSearchBox(){try{await m.open(),await m.settings.update(S,{searchBoxes:[],filterFeedByNearby:!1}),this.searchBox=null,this.localCenterLat=0,this.localCenterLong=0,this.localLatDiff=d,this.localLongDiff=d,this.localZoom=w,this.isChoosingSearchBox=!1,this.isNewMarkerSet=!1}catch(o){this.$notify({group:"alert",type:"danger",title:"Error Updating Search Settings",text:"Try going to a different page and then coming back."},-1),console.error("Telling user to retry the location search setting because:",o)}}cancelSearchBoxSelect(){this.isChoosingSearchBox=!1,this.localZoom=k}};y=j([O({components:{QuickNav:U,LRectangle:Z,LMap:F,LMarker:P,LTileLayer:z}})],y);const I={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},W={class:"mb-8"},G={class:"text-lg text-center font-light relative px-7"},Y={class:"text-center"},H={key:0,class:"m-4 px-4 py-2"},K={key:5},q={class:"aspect-video"};function J(e,t,o,a,s,p){const c=L("QuickNav"),r=L("fa"),x=L("l-tile-layer"),B=L("l-marker"),N=L("l-rectangle"),M=L("l-map");return i(),u(V,null,[f(c),h("section",I,[h("div",W,[h("div",G,[h("h1",{class:"text-lg text-center px-2 py-1 absolute -left-2 -top-1",onClick:t[0]||(t[0]=n=>e.$router.back())},[f(r,{icon:"chevron-left",class:"fa-fw"})])]),t[7]||(t[7]=h("
|