PageSourceSearch

https://thetruesize.com/assets/google-map-Cc58KGn2.js

js thetruesize.com collected 2026-09-24 09:03:13 UTC 13,022 bytes, 3 lines download raw bytes

1import{B as A,L as x,a as k,e as M,t as D,c as w,Z as F,A as u,f as G}from"./index-hyET1C36.js";import{A as K}from"./abstract-polygon-DIKsx5nM.js";const H=s=>`The setOptions() function should only be called once. The options passed to the additional call (${JSON.stringify(s)}) will be ignored.`,U=s=>`The google.maps.importLibrary() function is already defined, and @googlemaps/js-api-loader will use the existing function instead of overwriting it. The options passed to setOptions (${JSON.stringify(s)}) will be ignored.`,j=(s,t)=>`Failed to create Trusted Types policy "${s}": ${t instanceof Error?t.message:String(t)}.
2
3If your Content Security Policy uses "require-trusted-types-for 'script'", allow this policy with "trusted-types ${s} google-maps-api-loader google-maps-api#html lit-html". The "google-maps-api-loader", "lit-html", and "google-maps-api#html" policies are required for full Maps JavaScript API execution. Falling back to a string script URL.`,N=()=>{},W=()=>{},C="@googlemaps/js-api-loader",E={createScriptURL:s=>s};let p;function V(){if(p)return p;const s=globalThis.trustedTypes;if(!s)return p=E,p;try{p=s.createPolicy(C,{createScriptURL:t=>t})}catch(t){N(j(C,t)),p=E}return p}function $(s,t){s.src=V().createScriptURL(t)}const Z=s=>{var t,e,o,n="The Google Maps JavaScript API",i="google",a="importLibrary",l="__ib__",h=document,L=window,P=L[i]||(L[i]={}),c=P.maps||(P.maps={}),T=new Set,d=new URLSearchParams,B=()=>t||(t=new Promise(async(g,m)=>{await(e=h.createElement("script")),d.set("libraries",[...T]+"");for(o in s)d.set(o.replace(/[A-Z]/g,R=>"_"+R[0].toLowerCase()),s[o]);d.set("callback",i+".maps."+l),$(e,"https://maps.googleapis.com/maps/api/js?"+d),c[l]=g,e.onerror=()=>t=m(Error(n+" could not load.")),e.nonce=h.querySelector("script[nonce]")?.nonce||"",h.head.append(e)}));c[a]?console.warn(n+" only loads once. Ignoring:",s):c[a]=(g,...m)=>T.add(g)&&B().then(()=>c[a](g,...m))};let b=!1;function z(s){if(b){N(H(s));return}s.apiKey&&(s.key||(s.key=s.apiKey)),Y(s),b=!0}async function _(s){if(!window?.google?.maps?.importLibrary)throw new Error("google.maps.importLibrary is not installed.");return await google.maps.importLibrary(s)}function Y(s){const t=!!window.google?.maps?.importLibrary;t&&W(U(s)),t||Z(s)}const q=M("google:border-popup");function J(s,t){for(let e in t.prototype)s.prototype[e]=t.prototype[e]}class f{constructor(t,e){this.showing=!1,this.anchor=t,this.color=e.color||"black",this.element=new A(e),J(f,google.maps.OverlayView)}onAdd(){this.showing=new x().isLarge(),k(e=>{this.showing=e.detail.newLayout.screen.isLarge()}),this.element.classList.add("bg-white","absolute","rounded-lg","text-gray-800","text-xs","shadow-lg","z-50"),this.element.style.visibility="hidden",this.element.style.filter=`drop-shadow(0 0 0.10rem ${this.color})`,this.element.style.width="max-content",this.element.style.minWidth="200px",this.element.style.maxWidth="280px",this.element.style.padding="10px",this.getPanes().markerLayer.appendChild(this.element),this.overlayProjection=this.getProjection()}onRemove(){}redraw(t,e){this.element.style.filter=`drop-shadow(0 0 0.10rem ${t})`,e&&(this.anchor=e,this.draw(),this.show())}draw(){if(!this.overlayProjection)return;const t=this.overlayProjection.fromLatLngToDivPixel(this.anchor);if(!t){q("Error determining projection point",t);return}this.element.style.left=t.x+"px",this.element.style.top=t.y+"px"}show(){this.showing&&(this.element.style.visibility="visible")}hide(){this.element.style.visibility="hidden"}}function Q(s,t){for(let e in t.prototype)s.prototype[e]=t.prototype[e]}class y{constructor(t,e){if(this.anchor=t,this.element=this.createLabelContainer(),e.flag&&this.element.appendChild(this.createFlagElement(e.flag)),e.name){const o=this.createLabelElement(e.name);this.element.appendChild(o)}Q(y,google.maps.OverlayView)}createLabelElement(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("text-sm","font-bold","text-slate-800"),e.style.textShadow="0 0 2px white, 0 0 2px white, 0 0 2px white",e}createFlagElement(t){const e=document.createElement("img");return e.src=`/${t}`,e.alt=D("flag"),e.classList.add("h-3","w-auto"),e}createLabelContainer(){const t=document.createElement("div");return t.classList.add("flex","items-center","gap-x-2","whitespace-nowrap"),t.style.position="absolute",t.style.transform="translateY(-50%)",t.style.display="flex",t.style.alignItems="center",t}onAdd(){this.getPanes().markerLayer.appendChild(this.element),this.overlayProjection=this.getProjection()}onRemove(){this.element.parentNode?.removeChild(this.element)}draw(){if(!this.overlayProjection)return;const t=this.overlayProjection.fromLatLngToDivPixel(this.anchor);t&&(this.element.style.left=`${t.x-this.element.offsetWidth/2}px`,this.element.style.top=`${t.y-this.element.offsetHeight/2}px`)}updatePosition(t){this.anchor=t,this.draw()}show(){this.element.style.display="block"}hide(){this.element.style.display="none"}}const I=2,X=3,tt=["mousedown","touchstart"],et=["mouseup","touchend","touchcancel"],r=()=>google.maps.geometry.spherical,O=(s,t)=>s.getArray().map(e=>e.getArray().map(o=>({distance:r().computeDistanceBetween(t,o),heading:r().computeHeading(t,o)}))),S=(s,t,e=0)=>s.map(o=>o.map(n=>
3r().computeOffset(t,n.distance,n.heading+e)));class ot extends K{constructor({id:t,mapProvider:e,data:o,state:n}){super({id:t,mapProvider:e,data:o,state:n});const i=this.color,a={paths:o.paths,strokeColor:i,strokeOpacity:.8,strokeWeight:I,fillColor:i,fillOpacity:.35,draggable:!0,geodesic:!0};this.polygon=new google.maps.Polygon(a);for(const h of tt)this.polygon.addListener(h,()=>{this.polygon.setOptions({strokeWeight:X})});for(const h of et)this.polygon.addListener(h,()=>{this.polygon.setOptions({strokeWeight:I})});const l=this.computeCenterFromBounds();this.originalCenter=new google.maps.LatLng(l),this.offsetsFromCenter=O(this.polygon.getPaths(),l),this.offsetsFromFirstPathPoint=O(this.polygon.getPaths(),this.getFirstPathPoint()),this.firstPathPointToCenter={distance:r().computeDistanceBetween(this.getFirstPathPoint(),l),heading:r().computeHeading(this.getFirstPathPoint(),l)},this.centerToFirstPathPoint=this.offsetsFromCenter[0][0],this.originalPaths=o.paths,this.largestPathIndex=this.findLargestPathIndex(),this.label=new y(new google.maps.LatLng(this.computeCenterFromLargestBonds()),this.data),this.updateMarker(),this.addTo(this.mapProvider),this.redraw(this.rotation,this.offsetDistance,this.offsetHeading)}updateMarker(){this.label?.updatePosition(new google.maps.LatLng(this.computeCenterFromLargestBonds()))}remove(){this.polygon.setMap(null),this.label?.setMap(null)}rotate(t){this.updateState({rotation:t});const e=r().computeOffset(this.originalCenter,this.offsetDistance,this.offsetHeading);this.polygon.setPaths(S(this.offsetsFromCenter,e,t)),this.updateMarker()}redraw(t=0,e,o){this.updateState({offsetDistance:e,offsetHeading:o,rotation:t});const n=r().computeOffset(this.originalCenter,this.offsetDistance,this.offsetHeading);this.polygon.setPaths(S(this.offsetsFromCenter,n,t)),this.updateMarker(),this.borderPopup.redraw(w.getColor(this.colorId),n)}computeCenterFromBounds(){const t=new google.maps.LatLngBounds;return this.polygon.getPaths().forEach(function(e){e.forEach(o=>{t.extend(o)})}),t.getCenter()}findLargestPathIndex(){let t=0,e=new google.maps.LatLngBounds;return this.polygon.getPaths().forEach((o,n)=>{const i=new google.maps.LatLngBounds;o.forEach(a=>{i.extend(a)}),this.isBoundsLarger(i,e)&&(e=i,t=n)}),t}isBoundsLarger(t,e){const o=t.toSpan(),n=o.lat()*o.lng(),i=e.toSpan(),a=i.lat()*i.lng();return n>a}computeCenterFromLargestBonds(){const t=this.polygon.getPaths().getAt(this.largestPathIndex),e=new google.maps.LatLngBounds;return t.forEach(o=>{e.extend(o)}),e.getCenter()}computeCenterFromFirstPathPoint(){const t=this.rotation,e=this.getFirstPathPoint();let o=this.centerToFirstPathPoint,n=r().computeOffsetOrigin(e,o.distance,o.heading+t);return(!n||isNaN(n.lat()))&&(o=this.firstPathPointToCenter,n=r().computeOffset(e,o.distance,o.heading+t)),n}getCenter(){const t=this.computeCenterFromFirstPathPoint();return{lat:t.lat(),lng:t.lng()}}getFirstPathPoint(){return this.polygon.getPaths().getAt(0).getAt(0)}onDragStart(t){this.polygon.addListener("dragstart",()=>{this.updateMarker(),this.borderPopup.hide(),t(this)})}onDrag(t){this.polygon.addListener("drag",()=>{this.borderPopup.hide(),this.updateMarker(),t(this)})}onDragEnd(t){this.polygon.addListener("dragend",()=>{const e=new google.maps.LatLng(this.getCenter()),o=w.getColor(this.colorId);this.borderPopup.redraw(o,e);const n=r().computeDistanceBetween(this.originalCenter,e),i=r().computeHeading(this.originalCenter,e);this.updateState({offsetDistance:n,offsetHeading:i}),this.updateMarker(),t(this)})}onClick(t){this.polygon.addListener("click",()=>{t(this)})}onContextmenu(t){this.polygon.addListener("rightclick",()=>{t(this)})}onDblclick(t){this.polygon.addListener("dblclick",e=>{e.stop(),t(this)})}addTo(t){this.polygon.setMap(t.getMap()),this.label?.setMap(t.getMap()),this.addBorderPopup(t)}addBorderPopup(t){this._addBorderPopup(t)}_addBorderPopup(t){const e={area:this.data.area,color:this.color,flag:this.data.flag,name:this.data.name,note:this.data.note,population:this.data.population};this.borderPopup=new f(new google.maps.LatLng(this.getCenter()),e),this.borderPopup.setMap(t.getMap());for(const o of["mouseover","touchstart"])this.polygon.addListener(o,()=>{this.borderPopup.show()});for(const o of["mouseout","touchend"])this.polygon.addListener(o,()=>{this.borderPopup.hide()})}setColorId(t){super.setColorId(t),this.polygon.setOptions({fillColor:this.color,strokeColor:this.color}),this.borderPopup.redraw(this.color)}showLabel(){this.label?.show()}hideLabel(){this.label?.hide()}}
3const st={"top-left":"TOP_LEFT","top-right":"TOP_RIGHT","bottom-left":"BOTTOM_LEFT","bottom-right":"BOTTOM_RIGHT","left-bottom":"LEFT_BOTTOM","right-bottom":"RIGHT_BOTTOM","left-center":"LEFT_CENTER","right-center":"RIGHT_CENTER","left-top":"LEFT_TOP","right-top":"RIGHT_TOP","top-center":"TOP_CENTER","bottom-center":"BOTTOM_CENTER","inline-start-block-start":"INLINE_START_BLOCK_START","inline-start-block-end":"INLINE_START_BLOCK_END","inline-start-block-center":"INLINE_START_BLOCK_CENTER","inline-end-block-start":"INLINE_END_BLOCK_START","inline-end-block-end":"INLINE_END_BLOCK_END","inline-end-block-center":"INLINE_END_BLOCK_CENTER","block-start-inline-start":"BLOCK_START_INLINE_START","block-start-inline-end":"BLOCK_START_INLINE_END","block-start-inline-center":"BLOCK_START_INLINE_CENTER","block-end-inline-start":"BLOCK_END_INLINE_START","block-end-inline-end":"BLOCK_END_INLINE_END","block-end-inline-center":"BLOCK_END_INLINE_CENTER"},nt=s=>google.maps.ControlPosition[st[s]];class v{constructor(t){this.map=t,this.idCount=-1,this.zoomControl=new F,this.addUIControl(this.zoomControl,"top-right"),this.hasPolygonLabel=!1}isPolygonLabelVisible(){return this.hasPolygonLabel}showPolygonLabel(){return this.hasPolygonLabel=!0}hidePolygonLabel(){return this.hasPolygonLabel=!1}getZoom(){return this.map.getZoom()||0}setZoom(t){this.map.setZoom(t)}on(t,e){this.map.addListener(t,e)}addMapLoadedListener(t){google.maps.event.addListenerOnce(this.map,"idle",t)}showDemo(t){}closeDemo(){}panTo(t){this.map.panTo(t)}getBounds(){const t=this.getMap().getBounds();return{n:t.getNorthEast().lat(),e:t.getNorthEast().lng(),s:t.getSouthWest
3().lat(),w:t.getSouthWest().lng()}}isInViewport(t){return this.map.getBounds()?.contains(t)??!1}setViewportBounds(t){const e=new google.maps.LatLng(t.n,t.e),o=new google.maps.LatLng(t.s,t.w),n=new google.maps.LatLngBounds(o,e);this.map.fitBounds(n,{top:0,right:0,bottom:0,left:0})}getMap(){return this.map}getCenter(){const t=this.map.getCenter();return{lat:t.lat(),lng:t.lng()}}addPolygon(t,e,o){return new ot({id:t,mapProvider:this,data:e,state:o})}addUIControl(t,e){this.map.controls[nt(e)].push(t)}placeAd(t,e){e===u.leaderboardTop?this.addUIControl(t,"top-center"):e===u.outstreamVideoPlayer||e===u.videoPlayer?this.addUIControl(t,"right-bottom"):this.addUIControl(t,"bottom-center")}enableZoomControl(){this.zoomControl&&this.zoomControl.classList.remove("hidden")}disableZoomControl(){this.zoomControl&&this.zoomControl.classList.add("hidden")}static async init(t,e,o){z({key:"AIzaSyD8K7fswPZ21K1-wIphYSujTANG1PY3qwQ",language:G()}),await _("maps"),await _("geometry");const n=window.document.createElement("div");n.classList.add("map-canvas"),t.appendChild(n);const i=[{elementType:"geometry",stylers:[{saturation:-90},{weight:.4}]},{featureType:"poi",stylers:[{visibility:"off"}]},{featureType:"administrative.land_parcel",elementType:"all",stylers:[{visibility:"off"}]}],a=new google.maps.Map(t,{center:e,zoom:o,mapTypeControl:!1,scaleControl:!1,streetViewControl:!1,fullscreenControl:!1,cameraControl:!1,styles:i,gestureHandling:"greedy",zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP}});return new Promise(l=>{google.maps.event.addListenerOnce(a,"idle",()=>{l(new v(a))})})}}export{v as default};

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.