PageSourceSearch

https://www.smartcms.ai/_next/static/chunks/9486.14406b6515462e23.js

js smartcms.ai collected 2026-10-05 15:00:26 UTC 19,573 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9486],{31723:()=>{var t=new L.Icon.Default,e={startIcon:t,endIcon:t,wptIcons:{"":t},wptTypeIcons:{"":t},pointMatchers:[]},n={iconSize:[33,45],iconAnchor:[16,45],clickable:!1},i={color:"blue"},o={parseElements:["track","route","waypoint"],joinTrackSegments:!0};L.GPX=L.FeatureGroup.extend({initialize:function(t,i){i.max_point_interval=i.max_point_interval||15e3,i.markers=this._merge_objs(e,i.markers||{}),i.marker_options=this._merge_objs(n,i.marker_options||{}),i.polyline_options=i.polyline_options||[],i.gpx_options=this._merge_objs(o,i.gpx_options||{}),L.Util.setOptions(this,i),L.GPXTrackIcon=L.Icon.extend({options:i.marker_options}),this._gpx=t,this._layers={},this._prepare_markers(i.markers),this._init_info(),t&&this._parse(t,i,this.options.async)},get_duration_string:function(t,e){var n="";t>=864e5&&(n+=Math.floor(t/864e5)+"d ",t%=864e5),t>=36e5&&(n+=Math.floor(t/36e5)+":",t%=36e5);var i=Math.floor(t/6e4);t%=6e4,i<10&&(n+="0"),n+=i+"'";var o=Math.floor(t/1e3);return t%=1e3,o<10&&(n+="0"),n+=o,!e&&t>0?n+="."+Math.round(1e3*Math.floor(t))/1e3:n+='"',n},get_duration_string_iso:function(t,e){return this.get_duration_string(t,e).replace("'",":").replace('"',"")},_toFixed_helper:function(t,e=0){return"number"==typeof t?t.toFixed(e):"?"},to_miles:function(t){return t/1.60934},to_ft:function(t){return 3.28084*t},m_to_km:function(t){return t/1e3},m_to_mi:function(t){return t/1609.34},ms_to_kmh:function(t){return 3.6*t},ms_to_mih:function(t){return t/1609.34*3600},get_name:function(){return this._info.name},get_desc:function(){return this._info.desc},get_author:function(){return this._info.author},get_copyright:function(){return this._info.copyright},get_distance:function(){return this._info.length},get_distance_imp:function(){return this.to_miles(this.m_to_km(this.get_distance()))},get_start_time:function(){return this._info.duration.start},get_end_time:function(){return this._info.duration.end},get_moving_time:function(){return this._info.duration.moving},get_total_time:function(){return this._info.duration.total},get_moving_pace:function(){return this.get_moving_time()/this.m_to_km(this.get_distance())},get_moving_pace_imp:function(){return this.get_moving_time()/this.get_distance_imp()},get_moving_speed:function(){return this.m_to_km(this.get_distance())/(this.get_moving_time()/36e5)},get_moving_speed_imp:function(){return this.to_miles(this.m_to_km(this.get_distance()))/(this.get_moving_time()/36e5)},get_total_speed:function(){return this.m_to_km(this.get_distance())/(this.get_total_time()/36e5)},get_total_speed_imp:function(){return this.to_miles(this.m_to_km(this.get_distance()))/(this.get_total_time()/36e5)},get_elevation_gain:function(){return this._info.elevation.gain},get_elevation_loss:function(){return this._info.elevation.loss},get_elevation_gain_imp:function(){return this.to_ft(this.get_elevation_gain())},get_elevation_loss_imp:function(){return this.to_ft(this.get_elevation_loss())},get_elevation_data:function(){var t=this;return this._info.elevation._points.map(function(e){return t._prepare_data_point(e,t.m_to_km,null,function(e,n){return t._toFixed_helper(e,2)+" km, "+t._toFixed_helper(n,0)+" m"})})},get_elevation_data_imp:function(){var t=this;return this._info.elevation._points.map(function(e){return t._prepare_data_point(e,t.m_to_mi,t.to_ft,function(e,n){return t._toFixed_helper(e,2)+" mi, "+t._toFixed_helper(n,0)+" ft"})})},get_elevation_max:function(){return this._info.elevation.max},get_elevation_min:function(){return this._info.elevation.min},get_elevation_max_imp:function(){return this.to_ft(this.get_elevation_max())},get_elevation_min_imp:function(){return this.to_ft(this.get_elevation_min())},get_speed_data:function(){var t=this;return this._info.speed._points.map(function(e){return t._prepare_data_point(e,t.m_to_km,t.ms_to_kmh,function(e,n){return t._toFixed_helper(e,2)+" km, "+t._toFixed_helper(n,2)+" km/h"})})},get_speed_data_imp:function(){var t=this;return this._info.speed._points.map(function(e){return t._prepare_data_point(e,t.m_to_mi,t.ms_to_mih,function(e,n){return t._toFixed_helper(e,2)+" mi, "+t._toFixed_helper(n,2)+" mi/h"})})},get_speed_max:function(){return 3600*this.m_to_km(this._info.speed.max)},get_speed_max_imp:function(){return this.to_miles(this.get_speed_max())},get_average_hr:function(){return this._info.hr.avg},get_average_temp:function(){return this._info.atemp.avg}
1,get_average_cadence:function(){return this._info.cad.avg},get_heartrate_data:function(){var t=this;return this._info.hr._points.map(function(e){return t._prepare_data_point(e,t.m_to_km,null,function(e,n){return t._toFixed_helper(e,2)+" km, "+t._toFixed_helper(n,0)+" bpm"})})},get_heartrate_data_imp:function(){var t=this;return this._info.hr._points.map(function(e){return t._prepare_data_point(e,t.m_to_mi,null,function(e,n){return t._toFixed_helper(e,2)+" mi, "+t._toFixed_helper(n,0)+" bpm"})})},get_cadence_data:function(){var t=this;return this._info.cad._points.map(function(e){return t._prepare_data_point(e,t.m_to_km,null,function(e,n){return t._toFixed_helper(e,2)+" km, "+t._toFixed_helper(n,0)+" rpm"})})},get_temp_data:function(){var t=this;return this._info.atemp._points.map(function(e){return t._prepare_data_point(e,t.m_to_km,null,function(e,n){return t._toFixed_helper(e,2)+" km, "+t._toFixed_helper(n,0)+" degrees"})})},get_cadence_data_imp:function(){var t=this;return this._info.cad._points.map(function(e){return t._prepare_data_point(e,t.m_to_mi,null,function(e,n){return t._toFixed_helper(e,2)+" mi, "+t._toFixed_helper(n,0)+" rpm"})})},get_temp_data_imp:function(){var t=this;return this._info.atemp._points.map(function(e){return t._prepare_data_point(e,t.m_to_mi,null,function(e,n){return t._toFixed_helper(e,2)+" mi, "+t._toFixed_helper(n,0)+" degrees"})})},reload:function(){this._init_info(),this.clearLayers(),this._parse(this._gpx,this.options,this.options.async)},_merge_objs:function(t,e){var n={};for(var i in t)n[i]=t[i];for(var i in e)n[i]=e[i];return n},_prepare_data_point:function(t,e,n,i){var o=[e&&e(t[0])||t[0],n&&n(t[1])||t[1]];return o.push(i&&i(o[0],o[1])||o[0]+": "+o[1]),o},_prepare_markers:function(t){function e(t){return new L.GPXTrackIcon({iconUrl:t})}return Object.entries(t).forEach(([n,i])=>{"wptIcons"===n||"wptTypeIcons"===n?t[n]=this._prepare_markers(i):"pointMatchers"===n?t[n]=i.map(t=>("string"==typeof t.icon&&(t.icon=e(t.icon)),t)):"string"==typeof i?t[n]=e(i):"object"==typeof i&&null!==i&&(t[n]=i)}),t},_init_info:function(){this._info={name:null,length:0,elevation:{gain:0,loss:0,max:0,min:1/0,_points:[]},speed:{max:0,_points:[]},hr:{avg:0,_total:0,_points:[]},duration:{start:null,end:null,moving:0,total:0},atemp:{avg:0,_total:0,_points:[]},cad:{avg:0,_total:0,_points:[]}}},_load_xml:function(t,e,n,i){void 0==i&&(i=this.options.async),void 0==n&&(n=this.options);var o=this,a=new window.XMLHttpRequest;a.open("GET",t,i);try{a.overrideMimeType("text/xml")}catch(t){}a.onloadend=function(){200==a.status?e(a.responseXML,n):o.fire("error",{err:"Error fetching resource: "+t})},a.send(null)},_parse:function(t,e,n){var i=this,o=function(t,e){var n=i._parse_gpx_data(t,e);if(!n)return void i.fire("error",{err:"No parseable layers of type(s) "+JSON.stringify(e.gpx_options.parseElements)});i.addLayer(n),i.fire("loaded",{layers:n,element:t})};if("<"===t.substr(0,1)){var a=new DOMParser;n?setTimeout(function(){o(a.parseFromString(t,"text/xml"),e)}):o(a.parseFromString(t,"text/xml"),e)}else this._load_xml(t,o,e,n)},_parse_gpx_data:function(t,e){var n,i,o=[],a=t.getElementsByTagName("name");a.length>0&&(this._info.name=a[0].textContent);var r=t.getElementsByTagName("desc");r.length>0&&(this._info.desc=r[0].textContent);var s=t.getElementsByTagName("author");s.length>0&&(this._info.author=s[0].textContent);var l=t.getElementsByTagName("copyright");l.length>0&&(this._info.copyright=l[0].textContent);var _=e.gpx_options.parseElements;if(_.indexOf("route")>-1){var m=t.getElementsByTagName("rte");for(n=0;n<m.length;n++){var p=m[n],c=this._extract_styling(p),h=this._get_polyline_options(e.polyline_options,n);o=o.concat(this._parse_segment(m[n],e,c,h,"rtept"))}}if(_.indexOf("track")>-1){var u=t.getElementsByTagName("trk");for(n=0;n<u.length;n++){var g=u[n],c=this._extract_styling(g),h=this._get_polyline_options(e.polyline_options,n);if(e.gpx_options.joinTrackSegments)o=o.concat(this._parse_segment(g,e,c,h,"trkpt"));else{var d=g.getElementsByTagName("trkseg");for(I=0;I<d.length;I++)o=o.concat(this._parse_segment(d[I],e,c,h,"trkpt"))}}}if(this._info.hr.avg=Math.round(this._info.hr._total/this._info.hr._points.length),this._info.cad.avg=M
1ath.round(this._info.cad._total/this._info.cad._points.length),this._info.atemp.avg=Math.round(this._info.atemp._total/this._info.atemp._points.length),_.indexOf("waypoint")>-1)for(n=0,i=t.getElementsByTagName("wpt");n<i.length;n++){var f,v=new L.LatLng(i[n].getAttribute("lat"),i[n].getAttribute("lon")),y=i[n].getElementsByTagName("name"),a=y.length>0?y[0].textContent:"",k=i[n].getElementsByTagName("desc"),r=k.length>0?k[0].textContent:"",x=i[n].getElementsByTagName("sym"),b=x.length>0?x[0].textContent:null,w=i[n].getElementsByTagName("type"),E=w.length>0?w[0].textContent:null,T=e.markers.wptIcons,M=e.markers.wptTypeIcons,N=e.markers.pointMatchers||[];if(T&&b&&T[b])f=T[b];else if(M&&E&&M[E])f=M[E];else if(N.length>0){for(var I=0;I<N.length;I++)if(N[I].regex.test(a)){f=N[I].icon;break}}else T&&T[""]&&(f=T[""]);if(!f){console.log("No waypoint icon could be matched for symKey=%s,typeKey=%s,name=%s on waypoint %o",b,E,a,i[n]);continue}var B=new L.Marker(v,{clickable:e.marker_options.clickable,title:a,icon:f,type:"waypoint"});B.bindPopup("<b>"+a+"</b>"+(r.length>0?"<br>"+r:"")).openPopup(),this.fire("addpoint",{point:B,point_type:"waypoint",element:i[n]}),o.push(B)}return o.length>1?new L.FeatureGroup(o):1==o.length?o[0]:void 0},_parse_segment:function(t,e,n,i,o){var a=t.getElementsByTagName(o);if(!a.length)return[];for(var r=[],s=[],l=[],_=null,m=0;m<a.length;m++){var p,c=new L.LatLng(a[m].getAttribute("lat"),a[m].getAttribute("lon"));c.meta={time:null,ele:null,hr:null,cad:null,atemp:null,speed:null},(p=a[m].getElementsByTagName("time")).length>0?c.meta.time=new Date(Date.parse(p[0].textContent)):c.meta.time=new Date("1970-01-01T00:00:00");var h=null!=_?Math.abs(c.meta.time-_.meta.time):0;(p=a[m].getElementsByTagName("ele")).length>0?c.meta.ele=parseFloat(p[0].textContent):c.meta.ele=null!=_?_.meta.ele:null;var u=null!=_?c.meta.ele-_.meta.ele:0,g=null!=_?this._dist3d(_,c):0;if((p=a[m].getElementsByTagName("speed")).length>0?c.meta.speed=parseFloat(p[0].textContent):c.meta.speed=h>0?1e3*g/h:0,(p=a[m].getElementsByTagName("name")).length>0){for(var d=p[0].textContent,f=e.markers.pointMatchers||[],v=0;v<f.length;v++)if(f[v].regex.test(d)){s.push({label:d,coords:c,icon:f[v].icon,element:a[m]});break}}this._info.length+=g,(p=a[m].getElementsByTagNameNS("*","hr")).length>0&&(c.meta.hr=parseInt(p[0].textContent),this._info.hr._points.push([this._info.length,c.meta.hr]),this._info.hr._total+=c.meta.hr),(p=a[m].getElementsByTagNameNS("*","cad")).length>0&&(c.meta.cad=parseInt(p[0].textContent),this._info.cad._points.push([this._info.length,c.meta.cad]),this._info.cad._total+=c.meta.cad),(p=a[m].getElementsByTagNameNS("*","atemp")).length>0&&(c.meta.atemp=parseInt(p[0].textContent),this._info.atemp._points.push([this._info.length,c.meta.atemp]),this._info.atemp._total+=c.meta.atemp),c.meta.ele>this._info.elevation.max&&(this._info.elevation.max=c.meta.ele),c.meta.ele<this._info.elevation.min&&(this._info.elevation.min=c.meta.ele),this._info.elevation._points.push([this._info.length,c.meta.ele]),c.meta.speed>this._info.speed.max&&(this._info.speed.max=c.meta.speed),this._info.speed._points.push([this._info.length,c.meta.speed]),null==_&&null==this._info.duration.start&&(this._info.duration.start=c.meta.time),this._info.duration.end=c.meta.time,this._info.duration.total+=h,h<e.max_point_interval&&(this._info.duration.moving+=h),u>0?this._info.elevation.gain+=u:this._info.elevation.loss+=Math.abs(u),_=c,r.push(c)}var y=new L.Polyline(r,this._extract_styling(t,n,i));if(this.fire("addline",{line:y,element:t}),l.push(y),e.markers.startIcon){var k=new L.Marker(r[0],{clickable:e.marker_options.clickable,icon:e.markers.startIcon});this.fire("addpoint",{point:k,point_type:"start",element:a[0],line:t}),l.push(k)}if(e.markers.endIcon){var k=new L.Marker(r[r.length-1],{clickable:e.marker_options.clickable,icon:e.markers.endIcon});this.fire("addpoint",{point:k,point_type:"end",element:a[a.length-1],line:t}),l.push(k)}for(var m=0;m<s.length;m++){var k=new L.Marker(s[m].coords,{clickable:e.marker_options.clickable,title:s[m].label,icon:s[m].icon});this.fire("addpoint",{point:k,point_type:"label",element:s[m].element}),l.push(k)}return l},_get_polyline_options:function(t,e){return Array.isArray(t)?t[e]||{}:t},_extract_styling:function(t,e,n){var o=this._merge_objs(i,e),a=t.getElementsByTagNameNS("http://www.topografix.com/GPX/gpx_style/0/2","line");if(a.length>0){var r=a[0].getElementsByTagName("color");r.length>0&&(o.color="#"+r[0].textContent);var r=a[0].getElementsByTagName("opacity");r.length>0&&(o.opacity=r[0].textContent);var r=a[0].getElementsByTagName("weight");r.length>0&&(o.weight=r[0].textContent);var r=a[0].getElementsByTagName("linecap");r.length>0&&(o.lineCap=r[0].textContent);var r=a[0].getElementsByTagName("linejoin");r.length>0&&(o.lineJoin=r[0].textContent);var r=a[0].getElementsByTagName("dasharray");r.length>0&&(o.dashArray=r[0].textContent);var r=a[0].getElementsByTagName("dashoffset");r.length>0&&(o.dashOffset=r[0].textContent)}return this._merge_objs(o,n)},_dist2d:function(t,e){var n=this._deg2rad(e.lat-t.lat),i=this._deg2rad(e.lng-t.lng),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(this._deg2rad(t.lat))*Math.cos(this._deg2rad(e.lat))*Math.sin(i/2)*Math.sin(i/2);
1return 2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))*6371e3},_dist3d:function(t,e){return Math.sqrt(Math.pow(this._dist2d(t,e),2)+Math.pow(Math.abs(e.meta.ele-t.meta.ele),2))},_deg2rad:function(t){return t*Math.PI/180}})},59486:(t,e,n)=>{n.r(e),n.d(e,{default:()=>l});var i=n(95155),o=n(12115),a=n(55027),r=n.n(a);n(31723);var s=n(41444);let l=t=>{let{url:e,height:n=260}=t,a=(0,o.useRef)(null),l=(0,o.useRef)(null),_=(0,o.useRef)(null),[m,p]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if("undefined"!=typeof document&&!document.getElementById("leaflet-css")){let t=document.createElement("link");t.id="leaflet-css",t.rel="stylesheet",t.href="https://unpkg.com/[email protected]/dist/leaflet.css",t.crossOrigin="",document.head.appendChild(t)}},[]),(0,o.useEffect)(()=>{"undefined"!=typeof document&&((()=>{let t="leaflet-elevation-css";if(!document.getElementById(t)){let e=document.createElement("link");e.id=t,e.rel="stylesheet",e.href="https://unpkg.com/@raruto/leaflet-elevation/dist/leaflet-elevation.min.css",e.crossOrigin="",document.head.appendChild(e)}})(),new Promise(t=>{let e="leaflet-elevation-js";if(document.getElementById(e))return void t();let n=document.createElement("script");n.id=e,n.src="https://unpkg.com/@raruto/leaflet-elevation/dist/leaflet-elevation.min.js",n.async=!0,n.onload=()=>t(),n.onerror=()=>t(),document.body.appendChild(n)}).then(()=>p(!0)))},[]),(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let t="leaflet-tailwind-reset";if(document.getElementById(t))return;let e=document.createElement("style");e.id=t,e.textContent="\n      .leaflet-container img { max-width: none !important; }\n    ",document.head.appendChild(e)},[]),(0,o.useEffect)(()=>{if("undefined"==typeof document)return;let t="leaflet-gpx-marker-fixes";if(document.getElementById(t))return;let e=document.createElement("style");e.id=t,e.textContent='\n      .leaflet-marker-icon.gpx-waypoint-icon { background: none !important; border: none !important; }\n      .leaflet-marker-icon.gpx-start-icon { background: none !important; border: none !important; }\n      .leaflet-marker-icon.gpx-end-icon { background: none !important; border: none !important; }\n      .leaflet-marker-icon[class*="gpx"] { background: none !important; border: none !important; }\n    ',document.head.appendChild(e)},[]),(0,o.useEffect)(()=>{if(!a.current||!e||!m)return;r().Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/[email protected]/dist/images/marker-shadow.png"});let t=r().map(a.current,{zoomControl:!0,attributionControl:!0,scrollWheelZoom:!0});_.current=t,r().tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'\xa9 <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">OpenStreetMap</a> contributors',maxZoom:19}).addTo(t),t.setView([0,0],2);try{var n;let i="function"==typeof(null==(n=r().control)?void 0:n.elevation)?r().control.elevation({position:"bottomleft",theme:"steelblue-theme",useHeightIndicator:!0,collapsed:!1,detached:!0,container:l.current,summary:"inline"}).addTo(t):null,o=r().icon({iconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/[email protected]/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]}),a=new(r()).GPX(e,{async:!0,polyline_options:{color:"#2563eb",weight:3,opacity:.9},marker_options:{startIcon:o,endIcon:o,wptIcon:o,startIconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",startIconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",endIconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",endIconRetinaUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon-2x.png",shadowUrl:"https://unpkg.com/[email protected]/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41],wptIconUrl:"https://unpkg.com/[email protected]/dist/images/marker-icon.png",wptIconUrls:{"":"https://unpkg.com/[email protected]/dist/images/marker-icon.png"}}});a.on("loaded",e=>{try{t.fitBounds(e.target.getBounds(),{padding:[20,20]})}catch(t){}try{e.target.eachLayer(t=>{if(t instanceof r().Marker)try{t.remove()}catch(t){}})}catch(t){}}),a.on("addline",e=>{try{if(i&&(null==e?void 0:e.line)&&i.addData(e.line),(null==e?void 0:e.line)&&"function"==typeof e.line.getLatLngs){let n=e.line.getLatLngs(),i=t=>Array.isArray(t)?t.flat?t.flat(1/0):[].concat(...t.map(i)):[t],s=i(n).filter(t=>t&&"number"==typeof t.lat&&"number"==typeof t.lng);if(s.length>=2){let e=s[0],n=s[s.length-1];try{a.eachLayer(t=>{if(t instanceof r().Marker)try{t.remove()}catch(t){}})}catch(t){}r().marker(e,{icon:o}).addTo(t),r().marker(n,{icon:o}).addTo(t)}}}catch(t){}}),a.on("addpoint",t=>{try{let e=t.point||t.layer;if(e&&e.setIcon){e.setIcon(o);let t=null==e?void 0:e._icon;t&&(t.style.background="none",t.style.border="none")}}catch(t){}}),a.addTo(t)}catch(t){s.v.error("Failed to load GPX:",t)}return()=>{try{t.off(),t.remove()}catch(t){}_.current=null}},[e,m]),(0,i.jsxs)("div",{className:"relative z-0 rounded-md overflow-hidden border border-gray-300 dark:border-gray-700 bg-gray-100 dark:bg-gray-800",children:[(0,i.jsx)("div",{ref:a,className:"w-full",style:{height:"number"==typeof n?"".concat(n,"px"):n}}),(0,i.jsx)("div",{ref:l,className:"bg-white dark:bg-gray-900 border-t border-gray-300 dark:border-gray-700"})]})}}}]);

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.