PageSourceSearch

https://www.ausl.pc.it/static/js/volto-venue-components-Widgets-Ge…nWidget-GeoLocationWidget.30b38e6e.chunk.js

js ausl.pc.it collected 2026-10-02 04:25:34 UTC 3,713 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[56945],{39746:(e,t,o)=>{o.r(t),o.d(t,{default:()=>m});var a=o(51272),l=o(73463),n=o(23279),i=o.n(n),d=o(67294),r=o(88640),c=o(67100),s=o(43409),u=o(16739),g=o(48237),v=o(53536),f=o(32951),p=d.createElement,h=(0,r.v)({geolocation:{id:"geolocation",defaultMessage:"Geolocation"},geolocationPlaceholder:{id:"geolocation_placeholder",defaultMessage:"Search a venue..."},geolocationSelected:{id:"geolocation_selected",defaultMessage:"Selected"},geolocationClear:{id:"geolocationClear",defaultMessage:"Clear"},searchOnMap:{id:"searchOnMap",defaultMessage:"Search address on map"},latitude:{id:"latitude",defaultMessage:"Latitude"},longitude:{id:"longitude",defaultMessage:"Longitude"}});const m=function(e){var t,o,n,r,m,_,M=e.value,Z=e.id,C=e.onChange,L=e.required,w=e.title,y=e.description,S=e.formData,b=(0,c.Z)(),A=(0,d.useState)({latitude:null!==(t=null!==(o=null===M||void 0===M?void 0:M.latitude)&&void 0!==o?o:null===(n=f.Z.settings.defaultVenueLocation)||void 0===n?void 0:n.latitude)&&void 0!==t?t:0,longitude:null!==(r=null!==(m=null===M||void 0===M?void 0:M.longitude)&&void 0!==m?m:null===(_=f.Z.settings.defaultVenueLocation)||void 0===_?void 0:_.longitude)&&void 0!==r?r:0}),D=A[0],N=A[1],k=function(){var e=(0,l.Z)((0,a.Z)().mark((function e(){var t,o,l,n,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=[null===S||void 0===S?void 0:S.street,null===S||void 0===S?void 0:S.city,null===S||void 0===S||null===(t=S.country)||void 0===t?void 0:t.title,null===S||void 0===S?void 0:S.zip_code].filter(Boolean).join(", "),e.prev=1,e.next=4,fetch("https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?f=json&singleLine=".concat(o,"&outFields=Match_addr,Addr_type"));case 4:return l=e.sent,e.next=7,l.json();case 7:n=e.sent,i=null===n||void 0===n?void 0:n.candidates[0],N({latitude:i.location.y,longitude:i.location.x}),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),console.error(e.t0);case 15:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){C(Z,D)}),[D]);var x=function(e,t){var o=(0,d.useRef)();return o.current=e,(0,d.useCallback)(i()((function(){return o.current.apply(o,arguments)}),t),[])}((function(e){var t=e.target;return N({latitude:t._latlng.lat,longitude:t._latlng.lng})}),600);return p(d.Fragment,null,p(s.Z.Field,{inline:!0,required:L,id:Z},p(u.Z,null,p(u.Z.Row,{stretched:!0},p(u.Z.Column,{width:"4"},p("div",{className:"wrapper"},p("label",{htmlFor:"geolocation-search"},null!==w&&void 0!==w?w:b.formatMessage(h.geolocation)))),p(u.Z.Column,{width:"8",className:"geolocation-widget"},p(g.Z,{onClick:k,type:"button",disabled:!(S.country||S.city||S.zip_code||S.street)},b.formatMessage(h.searchOnMap)),p(v.bN,{markers:[{latitude:D.latitude,longitude:D.longitude}],onMarkerDragEnd:x,draggable:!0}),p("div",{className:"geolocation-selected-wrapper"},p("span",{className:"geolocation-selected"},p("small",null,"".concat(b.formatMessage(h.geolocationSelected),"\n                    ").concat(b.formatMessage(h.latitude),":\n                    ").concat(D.latitude.toFixed(5),",\n                    ").concat(b.formatMessage(h.longitude),":\n                    ").concat(D.longitude.toFixed(5)))),p(g.Z,{type:"button",icon:"trash",size:"mini",title:b.formatMessage(h.geolocationClear),onClick:function(){N({latitude:0,longitude:0})}})))),y&&p(u.Z.Row,{stretched:!0},p(u.Z.Column,{stretched:!0,width:"12"},p("p",{className:"help"},y))))))}}}]);
2//# sourceMappingURL=volto-venue-components-Widgets-GeoLocationWidget-GeoLocationWidget.30b38e6e.chunk.js.map

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.