tg-map-vue3 3.9.8 → 3.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/utils/maps-utils/index.d.ts +2 -0
- package/dist/src/utils/maps-utils/math-util.d.ts +59 -0
- package/dist/src/utils/maps-utils/poly-util.d.ts +103 -0
- package/dist/src/utils/maps-utils/spherical-util.d.ts +67 -0
- package/dist/src/utils/spherical-utils.d.ts +8 -1
- package/dist/tg-map.cjs +7 -7
- package/dist/tg-map.cjs.map +1 -1
- package/dist/tg-map.js +2307 -1964
- package/dist/tg-map.js.map +1 -1
- package/package.json +1 -1
package/dist/tg-map.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw;cursor:auto;-webkit-user-select:auto!important;user-select:auto!important}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);background-color:#000}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0;top:0;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.gm-style-iw-c .gm-style-iw-chr{display:block}.gm-style-iw-c .gm-style-iw-chr .gm-style-iw-ch{padding-top:12px}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect{position:absolute!important;right:-6px;top:-6px;width:14px!important;height:14px!important;margin:8px!important}.gm-style-iw-c .gm-style-iw-chr button.gm-ui-hover-effect span{width:14px!important;height:14px!important;margin:0!important}.gm-style-iw-c .gm-style-iw-d::-webkit-scrollbar{width:12px;height:12px}.element-overlay{position:absolute}.baidu-marker-label{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(>div>img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(t)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
"use strict";var Fr=Object.defineProperty;var Ur=(i,t,e)=>t in i?Fr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var g=(i,t,e)=>Ur(i,typeof t!="symbol"?t+"":t,e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("tg-commons"),_=require("vue");function Q(i,t,e){Object.keys(i).forEach(r=>{r.startsWith("update:")||e!=null&&e.includes(r)||t.addEventListener(r,i[r])})}let qr=1;function Yr(){return qr++}function De(i,t){return t.__id__||(t.__id__=Yr()),`${i}::${t.__id__}`}function Fe(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ke={exports:{}},Kr=ke.exports,Ut;function Xr(){return Ut||(Ut=1,function(i){(function(t,e){i.exports?i.exports=e():t.coordtransform=e()})(Kr,function(){var t=52.35987755982988,e=3.141592653589793,r=6378245,n=.006693421622965943;function s(l,h,f,y){this.west=Math.min(l,f),this.north=Math.max(h,y),this.east=Math.max(l,f),this.south=Math.min(h,y)}s.prototype.contain=function(l,h){return this.west<=l&&this.east>=l&&this.north>=h&&this.south<=h};var a=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(l,h,f=!0){for(var y=0;y<a.length;y++)if(a[y].contain(l,h)){for(var w=0;w<d.length;w++)if(d[w].contain(l,h))return!1;if(f){for(var w=0;w<o.length;w++)if(o[w].contain(l,h))return!1}return!0}return!1}function u(l,h){var f=l-.0065,y=h-.006,w=Math.sqrt(f*f+y*y)-2e-5*Math.sin(y*t),E=Math.atan2(y,f)-3e-6*Math.cos(f*t),L=w*Math.cos(E),A=w*Math.sin(E);return[L,A]}function m(l,h){var f=Math.sqrt(l*l+h*h)+2e-5*Math.sin(h*t),y=Math.atan2(h,l)+3e-6*Math.cos(l*t),w=f*Math.cos(y)+.0065,E=f*Math.sin(y)+.006;return[w,E]}function p(l,h){return T(l,h)}function v(l,h){var f=T(l,h);return[l*2-f[0],h*2-f[1]]}function T(l,h){var f=b(l-105,h-35),y=O(l-105,h-35),w=h/180*e,E=Math.sin(w);E=1-n*E*E;var L=Math.sqrt(E);f=f*180/(r*(1-n)/(E*L)*e),y=y*180/(r/L*Math.cos(w)*e);var A=h+f,z=l+y;return[z,A]}function b(l,h){var f=-100+2*l+3*h+.2*h*h+.1*l*h+.2*Math.sqrt(Math.abs(l));return f+=(20*Math.sin(6*l*e)+20*Math.sin(2*l*e))*2/3,f+=(20*Math.sin(h*e)+40*Math.sin(h/3*e))*2/3,f+=(160*Math.sin(h/12*e)+320*Math.sin(h*e/30))*2/3,f}function O(l,h){var f=300+l+2*h+.1*l*l+.1*l*h+.1*Math.sqrt(Math.abs(l));return f+=(20*Math.sin(6*l*e)+20*Math.sin(2*l*e))*2/3,f+=(20*Math.sin(l*e)+40*Math.sin(l/3*e))*2/3,f+=(150*Math.sin(l/12*e)+300*Math.sin(l/30*e))*2/3,f}return{rawBd09ToGcj02:u,rawGcj02ToBd09:m,rawWgs84ToGcj02:p,rawGcj02ToWgs84:v,bd09ToGcj02:u,gcj02ToBd09:m,wgs84ToGcj02:function(l,h){return c(l,h)?p(l,h):[l,h]},gcj02ToWgs84:function(l,h){return c(l,h)?v(l,h):[l,h]},bd09ToWgs84:function(l,h){if(!c(l,h,!1))return[l,h];var f=u(l,h);return v(f[0],f[1])},wgs84ToBd09:function(l,h){if(!c(l,h,!1))return[l,h];var f=p(l,h);return m(f[0],f[1])}}})}(ke)),ke.exports}var Jr=Xr();const se=Fe(Jr);function Qr(i,t){return i instanceof t}function ei(i,t){if(i instanceof t)return i}function $e(i,t){return(i==null?void 0:i.$options.name)===t.name}function kt(i,t){return $e(i,t)?i:void 0}function Ue(i,t,e){let r=t;for(;r;){if($e(r,i))return r;if(e&&$e(r,e))return;r=r.$parent}}function ti(i){return i}var R=(i=>(i.wgs84="wgs84",i.gcj02="gcj02",i.bd09="bd09",i))(R||{});const wt="wgs84",$=class ${constructor(t,e,r){this.lat=t,this.lng=e,this.coord=r,C.noop()}static _normalize(t,e){const r=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,r]}static fromBaidu(t,e){return new $(t.lat,t.lng,e)}static fromGoogle(t,e){return new $(t.lat(),t.lng(),e)}static fromHere(t,e){return new $(t.lat,t.lng,e)}static fromLiteral(t){return new $(t.lat,t.lng,t.coord||wt)}static fromLngLat(t,e,r=wt){return new $(e,t,r)}static create(t,e,r=wt){return new $(t,e,r)}to(t){const e=t;if(this.coord===e)return this;const[r,n]=this._convert(e);return new $(n,r,e)}toBaidu(t,e=!1){let r=this.lat,n=this.lng;return this.coord!==t&&([n,r]=this._convert(t)),e&&([n,r]=$._normalize(n,r)),new BMap.Point(n,r)}toGoogle(t){let e=this.lat,r=this.lng;return this.coord!==t&&([r,e]=this._convert(t)),new google.maps.LatLng(e,r)}toHere(t){let e=this.lat,r=this.lng;return this.coord!==t&&([r,e]=this._convert(t)),new H.geo.Point(e,r)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?se.bd09ToGcj02(this.lng,this.lat):se.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?se.gcj02ToWgs84(this.lng,this.lat):se.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?se.wgs84ToBd09(this.lng,this.lat):se.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=$._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new $(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};g($,"ZERO",$.create(0,0));let x=$;const te=class te{constructor(t,e){g(this,"coord");this.sw=t,this.ne=e,C.assert(t.coord===e.coord,"sw和ne的coord应该相同"),C.assert(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),C.assert(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,r){return t<=e?t<=r&&r<=e:t<=r||r<=e}static fromArray(t){if(t.length===0)return;const e=new te.Builder(t[0]);for(let r=1;r<t.length;r++)e.include(t[r]);return e.build()}static from(...t){return this.fromArray(t)??C.throwError("positions中没有点")}static fromGoogle(t,e){return new te(x.fromGoogle(t.getSouthWest(),e),x.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new te(x.fromBaidu(t.getSouthWest(),e),x.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:r}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&te.isBetweenLng(this.sw.lng,this.ne.lng,r)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return x.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,x.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,x.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};g(te,"EMPTY",new te(x.ZERO,x.ZERO));let U=te;(i=>{class t{constructor(r){g(this,"coord");g(this,"minLat");g(this,"minLng");g(this,"maxLat");g(this,"maxLng");this.coord=r.coord,this.minLat=this.maxLat=r.lat,this.minLng=this.maxLng=r.lng}build(){return new i(x.create(this.minLat,this.minLng,this.coord),x.create(this.maxLat,this.maxLng,this.coord))}include(r){const{lat:n,lng:s}=r.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),i.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(r,n){return(r-n+360)%360}}i.Builder=t})(U||(U={}));exports.Location=void 0;(i=>{function t(r,n){if(r==null)return;if(typeof r=="string")return r;const s=r.to(n);return`${s.lat},${s.lng}`}i.toString=t;function e(r){return typeof r=="string"||r==null?void 0:r.coord}i.getCoordType=e})(exports.Location||(exports.Location={}));function sr(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}function ri(){const i=window.$BAIDU$;"kT"in i||Object.defineProperty(i,"kT",{get:()=>i._instances,enumerable:!0,configurable:!0})}const qt={equals(i,t){return i.lat===t.lat&&i.lng===t.lng}};var Bt;(i=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}i.isScrollable=t})(Bt||(Bt={}));exports.Arrays=void 0;(i=>{function t(n,s){for(const a of n)if(a instanceof s)return a}i.findByType=t;function e(n,s){return n.includes(s)}i.includesTyped=e;function r(n,s,a){const d=s>=0?s:n.length+s;if(a===void 0)return n[d];n[d]=a}i.at=r})(exports.Arrays||(exports.Arrays={}));exports.MVCArrays=void 0;(i=>{function t(n,s){const a=n.getLength();for(let d=0;d<a;d++)if(n.getAt(d)===s)return d;return-1}i.indexOf=t;function e(n,s){const a=t(n,s);if(a!==-1)return n.removeAt(a)}i.remove=e;function r(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}i.listenChanged=r})(exports.MVCArrays||(exports.MVCArrays={}));function or(i,t,e){return i.addListener(t,e).remove}function ii(i,t,e){return i.addEventListener(t,e),()=>i.removeEventListener(t,e)}function ni(i,t,e,r){return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}function Yt(i,t,e){return i.addEventListener(t,e),()=>i.removeEventListener(t,e)}class ar{constructor(t,e){g(this,"eventMap",new Map);g(this,"target",C.lateinit());this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class qe{constructor(t,e){g(this,"eventHub",new lr);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(exports.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(exports.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Ve=class Ve extends ar{addEventListener(t,e){const r=De(t,e);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,e);return}const n=this.inner.addListener(Ve.EVENT_TYPE_MAP[t]||t,s=>{const a={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(a.position=x.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,a)});this.eventMap.set(r,n)}removeEventListener(t,e){const r=De(t,e),n=this.eventMap.get(r);n?(n.remove(),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,e)}};g(Ve,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let le=Ve;const Ce=class Ce extends ar{addEventListener(t,e){const r=De(t,e);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,e);return}const n=s=>{const a={type:t,target:this.target,originalEvent:s};s.point&&(a.position=x.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,a)};this.inner.addEventListener(Ce.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(r,n)}removeEventListener(t,e){const r=De(t,e),n=this.eventMap.get(r);n?(this.inner.removeEventListener(Ce.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,e)}};g(Ce,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let we=Ce;class lr{constructor(){g(this,"typeMap",new Map)}addEventListener(t,e){let r=this.typeMap.get(t);r||(r=[],this.typeMap.set(t,r)),!r.includes(e)&&r.push(e)}removeEventListener(t,e){const r=this.typeMap.get(t);r&&C.Arrays.remove(r,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(r=>r.call(t.target,t))}}class St{constructor(t,e){g(this,"keyToValue",new Map);g(this,"valueToKey",new Map);C.assert(t.length===e.length);for(let r=t.length-1;r>=0;r--)this.keyToValue.set(t[r],e[r]),this.valueToKey.set(e[r],t[r])}toKey(t){return this.valueToKey.get(t)??C.throwError()}toValue(t){return this.keyToValue.get(t)??C.throwError()}}class hr{constructor(t,e=10){g(this,"map",new Map);this.values=t,this.maxSize4Debug=e,C.noop()}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let r=this.values.length-1;r>=0;r--){const n=this.values[r];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??C.throwError(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class ae{constructor(t){g(this,"value");this.creator=t,C.noop()}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(i=>(i.TOP_LEFT="top-left",i.TOP_CENTER="top-center",i.TOP_RIGHT="top-right",i.BOTTOM_LEFT="bottom-left",i.BOTTOM_CENTER="bottom-center",i.BOTTOM_RIGHT="bottom-right",i.LEFT_TOP="left-top",i.LEFT_CENTER="left-center",i.LEFT_BOTTOM="left-bottom",i.RIGHT_TOP="right-top",i.RIGHT_CENTER="right-center",i.RIGHT_BOTTOM="right-bottom",i))(k||{});exports.ControlPositionConverter=void 0;(i=>{let t,e;const r=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new St(r,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}i.getBaidu=n;function s(){return e||(e=new St(r,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),e}i.getGoogle=s})(exports.ControlPositionConverter||(exports.ControlPositionConverter={}));class cr{constructor(t){g(this,"inner");this.position=t,C.noop()}}class Ye{}class dr extends Ye{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Ke extends Ye{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??exports.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(exports.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class Ee extends Ye{constructor(e,r){super();g(this,"visible",!1);g(this,"map");this._type=e,this.position=r}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:exports.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var At=(i=>(i.normal="normal",i.satellite="satellite",i.hybrid="hybrid",i))(At||{});class N{constructor(t,e,r,n){this.id=t,this.baidu=e,this.google=r,this.googleCoordType=n,C.noop()}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){C.throwUnsupported("google的内置地图没有对应的实例")}}class si{constructor(t,e){g(this,"baiduLayerCached",new ae(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,r)=>{const n=Math.pow(2,r-1),s=e.x+n,a=n-1-e.y;return this.options.getTileUrl({x:s,y:a},r)},t}));g(this,"baiduMapTypeCached",new ae(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));g(this,"googleCached",new ae(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,r)=>this.options.getTileUrl(e,r),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e,C.noop()}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){C.throwUnsupported("这个方法不会被调用")}}class ur{constructor(){g(this,"baiduCache",new ae(()=>new BMap.TrafficLayer));g(this,"googleCache",new ae(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}exports.MapType=void 0;(i=>{i.NORMAL=new N("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),i.SATELLITE=new N("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),i.HYBRID=new N("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),i.TERRAIN=new N("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),i.BUILD_IN_MAP_TYPES=new hr([i.NORMAL,i.SATELLITE,i.HYBRID,i.TERRAIN])})(exports.MapType||(exports.MapType={}));var Rt=(i=>(i.DEFAULT="default",i.HORIZONTAL="horizontal",i.DROPDOWN="dropdown",i))(Rt||{});const pr=[exports.MapType.NORMAL,exports.MapType.SATELLITE,exports.MapType.HYBRID];class Xe extends Ke{static create(t){const e=t.mapTypes??pr,r={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&r[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(exports.ControlPositionConverter.getBaidu().toValue(t.position)),new Xe(n,t.position)}}const ne=class ne extends Ee{constructor(t="default",e=k.TOP_LEFT,r=pr){super("mapType",e),this.type=t,this.mapTypes=r,ne.type2google||(ne.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new ne(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=ne.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof N?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof N||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};g(ne,"type2google");let ze=ne;class Je extends Ke{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&exports.ControlPositionConverter.getBaidu().toValue(t.position)});return new Je(e,t.position)}}class Qe extends Ee{static create(t){return new Qe(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class et extends dr{static create(t){return new et(!0,t.position??k.RIGHT_BOTTOM)}}class tt extends Ee{static create(t){return new tt(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class rt extends Ke{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&exports.ControlPositionConverter.getBaidu().toValue(t.position)});return new rt(e,t.position)}}class it extends Ee{static create(t){return new it(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}let oi,ai;const re={get LATLNG_ZERO(){return oi??(oi=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return ai??(ai=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function gr(i,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of i)for(const r of e.types)switch(r){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function mr(i,t){var r;const e=i.address_components&&gr(i.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:i.place_id??"",address:i.formatted_address??"",position:x.fromGoogle(((r=i.geometry)==null?void 0:r.location)??re.LATLNG_ZERO,t.coordType),title:i.name??""}}class Dt{}class fr extends Dt{constructor(e,r){super();g(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(r.input,{fields:["address_components","name"]}),r.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return or(this.inner,"place_changed",()=>{const r=this.inner.getPlace(),n={title:r.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};r.address_components&&gr(r.address_components,n),e(n)})}}class yr extends Dt{constructor(e,r){super();g(this,"inner");g(this,"input");g(this,"removeableArray",[]);if(this.map=e,this.input=r.input,this.inner=new BMap.Autocomplete({input:r.input,location:r.bindToMap?e.innerMap:void 0}),r.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(Yt(this.map,"center-changed",n)),this.removeableArray.push(Yt(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let r=0;const n=ii(this.inner,"confirm",a=>{const d=a.item.value;r=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=ni(this.input,"keyup",a=>{a.key==="Enter"&&Date.now()-r>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var Ae={exports:{}},li=Ae.exports,Kt;function hi(){return Kt||(Kt=1,function(i,t){(function(e,r){i.exports=r()})(li,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},a=function(){var v=function(O){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=O.xField||O.defaultXField,this._yField=O.yField||O.defaultYField,this._valueField=O.valueField||O.defaultValueField,O.radius&&(this._cfgRadius=O.radius)},T=s.defaultRadius;return v.prototype={_organiseData:function(b,O){var l=b[this._xField],h=b[this._yField],f=this._radi,y=this._data,w=this._max,E=this._min,L=b[this._valueField]||1,A=b.radius||this._cfgRadius||T;return y[l]||(y[l]=[],f[l]=[]),y[l][h]?y[l][h]+=L:(y[l][h]=L,f[l][h]=A),y[l][h]>w?(O?this.setDataMax(y[l][h]):this._max=y[l][h],!1):{x:l,y:h,value:L,radius:A,min:E,max:w}},_unOrganizeData:function(){var b=[],O=this._data,l=this._radi;for(var h in O)for(var f in O[h])b.push({x:h,y:f,radius:l[h][f],value:O[h][f]});return{min:this._min,max:this._max,data:b}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var b=arguments[0],O=b.length;O--;)this.addData.call(this,b[O]);else{var l=this._organiseData(arguments[0],!0);l&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[l]})}return this},setData:function(b){var O=b.data,l=O.length;this._data=[],this._radi=[];for(var h=0;h<l;h++)this._organiseData(O[h],!1);return this._max=b.max,this._min=b.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(b){return this._max=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(b){return this._min=b,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(b){this._coordinator=b},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},v}(),d=function(){var v=function(l){var h=l.gradient||l.defaultGradient,f=document.createElement("canvas"),y=f.getContext("2d");f.width=256,f.height=1;var w=y.createLinearGradient(0,0,256,1);for(var E in h)w.addColorStop(E,h[E]);return y.fillStyle=w,y.fillRect(0,0,256,1),y.getImageData(0,0,256,1).data},T=function(l,h){var f=document.createElement("canvas"),y=f.getContext("2d"),w=l,E=l;if(f.width=f.height=l*2,h==1)y.beginPath(),y.arc(w,E,l,0,2*Math.PI,!1),y.fillStyle="rgba(0,0,0,1)",y.fill();else{var L=y.createRadialGradient(w,E,l*h,w,E,l);L.addColorStop(0,"rgba(0,0,0,1)"),L.addColorStop(1,"rgba(0,0,0,0)"),y.fillStyle=L,y.fillRect(0,0,2*l,2*l)}return f},b=function(E){for(var h=[],f=E.min,y=E.max,w=E.radi,E=E.data,L=Object.keys(E),A=L.length;A--;)for(var z=L[A],B=Object.keys(E[z]),X=B.length;X--;){var S=B[X],W=E[z][S],J=w[z][S];h.push({x:z,y:S,value:W,radius:J})}return{min:f,max:y,data:h}};function O(l){var h=l.element,f=this.shadowCanvas=document.createElement("canvas"),y=this.canvas=l.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var w=getComputedStyle(l.element)||{};y.className="heatmap-canvas",this._width=y.width=f.width=+w.width.replace(/px/,""),this._height=y.height=f.height=+w.height.replace(/px/,""),this.shadowCtx=f.getContext("2d"),this.ctx=y.getContext("2d"),y.style.cssText=f.style.cssText="position:absolute;left:0;top:0;",h.style.position="relative",h.appendChild(y),this._palette=v(l),this._templates={},this._setStyles(l)}return O.prototype={renderPartial:function(l){this._drawAlpha(l),this._colorize()},renderAll:function(l){this._clear(),this._drawAlpha(b(l)),this._colorize()},_updateGradient:function(l){this._palette=v(l)},updateConfig:function(l,h){l.gradient!==h.gradient&&this._updateGradient(l),this._setStyles(l)},setDimensions:function(l,h){this._width=l,this._height=h,this.canvas.width=this.shadowCanvas.width=l,this.canvas.height=this.shadowCanvas.height=h},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(l){this._blur=l.blur==0?0:l.blur||l.defaultBlur,l.backgroundColor&&(this.canvas.style.backgroundColor=l.backgroundColor),this._opacity=(l.opacity||0)*255,this._maxOpacity=(l.maxOpacity||l.defaultMaxOpacity)*255,this._minOpacity=(l.minOpacity||l.defaultMinOpacity)*255,this._useGradientOpacity=!!l.useGradientOpacity},_drawAlpha:function(y){for(var h=this._min=y.min,f=this._max=y.max,y=y.data||[],w=y.length,E=1-this._blur;w--;){var L=y[w],A=L.x,z=L.y,B=L.radius,X=Math.min(L.value,f),S=A-B,W=z-B,J=this.shadowCtx,j;this._templates[B]?j=this._templates[B]:this._templates[B]=j=T(B,E),J.globalAlpha=(X-h)/(f-h),J.drawImage(j,S,W),S<this._renderBoundaries[0]&&(this._renderBoundaries[0]=S),W<this._renderBoundaries[1]&&(this._renderBoundaries[1]=W),S+2*B>this._renderBoundaries[2]&&(this._renderBoundaries[2]=S+2*B),W+2*B>this._renderBoundaries[3]&&(this._renderBoundaries[3]=W+2*B)}},_colorize:function(){var l=this._renderBoundaries[0],h=this._renderBoundaries[1],f=this._renderBoundaries[2]-l,y=this._renderBoundaries[3]-h,w=this._width,E=this._height,L=this._opacity,A=this._maxOpacity,z=this._minOpacity,B=this._useGradientOpacity;l<0&&(l=0),h<0&&(h=0),l+f>w&&(f=w-l),h+y>E&&(y=E-h);for(var X=this.shadowCtx.getImageData(l,h,f,y),S=X.data,W=S.length,J=this._palette,j=3;j<W;j+=4){var Se=S[j],ge=Se*4;if(ge){var me;L>0?me=L:Se<A?Se<z?me=z:me=Se:me=A,S[j-3]=J[ge],S[j-2]=J[ge+1],S[j-1]=J[ge+2],S[j]=B?J[ge+3]:me}}this.ctx.putImageData(X,l,h),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(l){var h,f=this.shadowCtx,y=f.getImageData(l.x,l.y,1,1),w=y.data[3],E=this._max,L=this._min;return h=Math.abs(E-L)*(w/255)>>0,h},getDataURL:function(){return this.canvas.toDataURL()}},O}(),o=function(){var v=!1;return s.defaultRenderer==="canvas2d"&&(v=d),v}(),c={merge:function(){for(var p={},v=arguments.length,T=0;T<v;T++){var b=arguments[T];for(var O in b)p[O]=b[O]}return p}},u=function(){var v=function(){function l(){this.cStore={}}return l.prototype={on:function(h,f,y){var w=this.cStore;w[h]||(w[h]=[]),w[h].push(function(E){return f.call(y,E)})},emit:function(h,f){var y=this.cStore;if(y[h])for(var w=y[h].length,E=0;E<w;E++){var L=y[h][E];L(f)}}},l}(),T=function(O){var l=O._renderer,h=O._coordinator,f=O._store;h.on("renderpartial",l.renderPartial,l),h.on("renderall",l.renderAll,l),h.on("extremachange",function(y){O._config.onExtremaChange&&O._config.onExtremaChange({min:y.min,max:y.max,gradient:O._config.gradient||O._config.defaultGradient})}),f.setCoordinator(h)};function b(){var O=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new v,O.plugin){var l=O.plugin;if(s.plugins[l]){var h=s.plugins[l];this._renderer=new h.renderer(O),this._store=new h.store(O)}else throw new Error("Plugin '"+l+"' not found. Maybe it was not registered.")}else this._renderer=new o(O),this._store=new a(O);T(this)}return b.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(O){const l=this._config;return this._config=c.merge(this._config,O),this._renderer.updateConfig(this._config,l),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(O){return this._store.getValueAt?this._store.getValueAt(O):this._renderer.getValueAt?this._renderer.getValueAt(O):null}},b}(),m={create:function(p){return new u(p)},register:function(p,v){s.plugins[p]=v}};return m}();var r=function(s){Reflect.getPrototypeOf(r.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(r.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};r.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),r.prototype.initialize=function(s){this._map=s;var a=document.createElement("div");if(a.style.position="absolute",a.style.top=0,a.style.left=0,a.style.border=0,a.style.width=this._map.getSize().width+"px",a.style.height=this._map.getSize().height+"px",this.conf.element=a,!n())return a;s.getPanes().mapPane.appendChild(a),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var c=o.size;a.style.width=c.width+"px",a.style.height=c.height+"px",d.heatmap._renderer.setDimensions(c.width,c.height),d.draw()}),this._div=a,a},r.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var a=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=a.y,c=d.x,u=d.y-a.y,m=a.x-d.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=m+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var p=this.latlngs.length;const l={max:this.heatmap._store.getData().max,data:[]};for(;p--;){var v=this.latlngs[p].latlng;if(s.containsPoint(v)){var T=this._map.pointToOverlayPixel(v),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,b=new BMap.Pixel(T.x-c,T.y-o),O=this.pixelTransform(b);l.data.push({x:O.x,y:O.y,count:this.latlngs[p].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(l)}}}},r.prototype.pixelTransform=function(s){for(var a=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=a;for(;s.x>a;)s.x-=a;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},r.prototype.setDataSet=function(s){if(this.data=s,!!n()){var a=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var u=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:u,c:o[c].count}),!!a.containsPoint(u)){var m=this._map.pointToOverlayPixel(u),p=this._map.pointToOverlayPixel(a.getSouthWest()).x,v=this._map.pointToOverlayPixel(a.getNorthEast()).y,T=new BMap.Pixel(m.x-p,m.y-v),b=this.pixelTransform(T);d.data.push({x:b.x,y:b.y,count:o[c].count})}}this.heatmap.setData(d)}},r.prototype.addDataPoint=function(s,a,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:a,count:d});var o=new BMap.Point(s,a),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,d),this.latlngs.push({latlng:o,c:d})}},r.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},r.prototype.setOptions=function(s){if(n()){for(var a in s)a=="radius"&&(this.heatmap._store._cfgRadius=s[a]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return r})}(Ae)),Ae.exports}var ci=hi();const di=Fe(ci),Xt=10,Ge={toGoogle:(i,t)=>({opacity:i.opacity,radius:i.radius??Xt,gradient:i.gradient&&Object.entries(i.gradient).sort(([e],[r])=>+e-+r).map(([e,r])=>r),maxIntensity:i.maxIntensity,data:Ne.toGoogle(i.data,t)}),toBaidu:(i,t,e)=>({opacity:i.opacity,radius:i.radius??Xt,gradient:i.gradient,data:Ne.toBaidu(i.data,t,e)})},Ne={toGoogle:(i,t)=>i.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(i,t,e)=>{let r=1;return{data:i.map(s=>{let a,d;return"weight"in s?(a=s.position.to(t),d=s.weight):(a=s.to(t),d=1),r<d&&(r=d),{lng:a.lng,lat:a.lat,count:d}}),max:e??r}}};class $t{}class vr extends $t{constructor(e,r){super();g(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(Ge.toGoogle(r,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(Ne.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(Ge.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class _r extends $t{constructor(e,r){super();g(this,"inner");this.map=e;const n=Ge.toBaidu(r,this.map.coordType,r.maxIntensity);this.inner=new di(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var r;((r=this.inner).data??(r.data={})).max=e}setData(e){this.inner.setDataSet(Ne.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const r=Ge.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(r.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(r)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class zt{constructor(t){this.options=t}}function be(i,t,e){const r=new URL(t,i),n=new URLSearchParams(Object.entries(e).filter($r));return r.search="?"+n.toString(),r}function xt(){const i=window.location.hostname.split(".").filter(t=>!exports.Strings.isInt(t));return i.length===3?i.join("."):[...i,"tg","map","urls"].slice(0,3).join(".")}const Te=class Te extends zt{directions(t,e,r){return be(Te.BASE_URL,"dir/",{api:"1",origin:exports.Location.toString(t,R.gcj02),destination:exports.Location.toString(e,R.gcj02),travelmode:r})}search(t){return be(Te.BASE_URL,"search/",{api:"1",query:exports.Location.toString(t,R.gcj02)})}};g(Te,"BASE_URL","https://www.google.com/maps/");let Ze=Te;const oe=class oe extends zt{directions(t,e,r="driving"){const n=exports.Location.getCoordType(e)??exports.Location.getCoordType(t)??R.bd09,s=exports.Location.toString(e,n);return be(oe.BASE_URL,"direction",{origin:exports.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:r,output:"html",region:"中国",src:xt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,r){return be(oe.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:r,output:"html",src:xt()})}geocoderApi(t){return be(oe.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:xt()})}};g(oe,"BASE_URL","https://api.map.baidu.com/");let We=oe,ui=class br{constructor(t,e,r){this.extend(br,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=r||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var a=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);a=Math.min(Math.max(a,d),o),s.prevZoom_!=a&&(s.prevZoom_=a,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(r){for(var n in r.prototype)this.prototype[n]=r.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,r=0,n;n=t[r];r++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var r=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),r++;return r=Math.min(r,e),{text:n,index:r}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let r=0,n;n=t[r];r++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let r in t)this.pushMarkerTo_(t[r]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r=0,n;n=this.markers_[r];r++)if(n==t){e=r;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var r=this.removeMarker_(t);return!e&&r?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var r=t===this.getMarkers()?t.slice():t,n=!1,s=0,a;a=r[s];s++){var d=this.removeMarker_(a);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(r);s.x+=this.gridSize_,s.y-=this.gridSize_;var a=e.fromLatLngToDivPixel(n);a.x-=this.gridSize_,a.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(a);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,r;r=this.clusters_[e];e++)r.remove();for(let e=0,r;r=this.markers_[e];e++)r.isAdded=!1,t&&r.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,r;r=t[e];e++)r.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var r=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,a=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),o=r*d;return o}addToClosestCluster_(t){for(var e=4e4,r=null,n=0,s;s=this.clusters_[n];n++){var a=s.getCenter();if(a){var d=this.distanceBetweenPoints_(a,t.getPosition());d<e&&(e=d,r=s)}}if(r&&r.isMarkerInClusterBounds(t))r.addMarker(t);else{var o=new pi(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),r=0,n;n=this.markers_[r];r++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},pi=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Gt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,r;r=this.markers_[e];e++)if(r==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,r=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(r,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var a=0;a<s;a++)this.markers_[a].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),r=0,n;n=e[r];r++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var r=0,n;n=this.markers_[r];r++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,a=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(a),this.clusterIcon_.show()}};class Gt{constructor(t,e,r){t.getMarkerClusterer().extend(Gt,google.maps.OverlayView),this.styles_=e,this.padding_=r||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var r=this;google.maps.event.addDomListener(this.div_,"click",function(){r.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var r=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+r+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var Re={exports:{}},gi=Re.exports,Jt;function mi(){return Jt||(Jt=1,function(i,t){(function(e,r){i.exports=r()})(gi,function(){var e,r=e=r||{version:"1.3.8"},n={};r.guid="$BAIDU$",n[r.guid]=n[r.guid]||{},r.dom=r.dom||{},r.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},r.g=r.G=r.dom.g,r.dom.getDocument=function(o){return o=r.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},r.lang=r.lang||{},r.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},r.isString=r.lang.isString,r.dom._g=function(o){return r.lang.isString(o)?document.getElementById(o):o},r._g=r.dom._g,r.browser=r.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.ie=r.ie=document.documentMode||+RegExp.$1),r.dom.getComputedStyle=function(o,c){o=r.dom._g(o);var u=r.dom.getDocument(o),m;return u.defaultView&&u.defaultView.getComputedStyle&&(m=u.defaultView.getComputedStyle(o,null),m)?m[c]||m.getPropertyValue(c):""},r.dom._styleFixer=r.dom._styleFixer||{},r.dom._styleFilter=r.dom._styleFilter||[],r.dom._styleFilter.filter=function(o,c,u){for(var m=0,p=r.dom._styleFilter,v;v=p[m];m++)(v=v[u])&&(c=v(o,c));return c},r.string=r.string||{},r.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},r.dom.getStyle=function(o,c){var u=r.dom;o=u.g(o),c=r.string.toCamelCase(c);var m=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||u.getComputedStyle(o,c);if(!m){var p=u._styleFixer[c];p&&(m=p.get?p.get(o):r.dom.getStyle(o,p))}return(p=u._styleFilter)&&(m=p.filter(c,m,"get")),m},r.getStyle=r.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.opera=+RegExp.$1),r.browser.isWebkit=/webkit/i.test(navigator.userAgent),r.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),r.browser.isStrict=document.compatMode=="CSS1Compat",r.dom.getPosition=function(o){o=r.dom.g(o);var c=r.dom.getDocument(o),u=r.browser,m=r.dom.getStyle;u.isGecko>0&&c.getBoxObjectFor&&m(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var p={left:0,top:0},v=u.ie&&!u.isStrict?c.body:c.documentElement,T,b;if(o==v)return p;if(o.getBoundingClientRect){b=o.getBoundingClientRect(),p.left=Math.floor(b.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),p.top=Math.floor(b.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),p.left-=c.documentElement.clientLeft,p.top-=c.documentElement.clientTop;var O=c.body,l=parseInt(m(O,"borderLeftWidth")),h=parseInt(m(O,"borderTopWidth"));u.ie&&!u.isStrict&&(p.left-=isNaN(l)?2:l,p.top-=isNaN(h)?2:h)}else{T=o;do{if(p.left+=T.offsetLeft,p.top+=T.offsetTop,u.isWebkit>0&&m(T,"position")=="fixed"){p.left+=c.body.scrollLeft,p.top+=c.body.scrollTop;break}T=T.offsetParent}while(T&&T!=o);for((u.opera>0||u.isWebkit>0&&m(o,"position")=="absolute")&&(p.top-=c.body.offsetTop),T=o.offsetParent;T&&T!=c.body;)p.left-=T.scrollLeft,(!u.opera||T.tagName!="TR")&&(p.top-=T.scrollTop),T=T.offsetParent}return p},r.event=r.event||{},r.event._listeners=r.event._listeners||[],r.event.on=function(o,c,u){c=c.replace(/^on/i,""),o=r.dom._g(o);var m=function(O){u.call(o,O)},p=r.event._listeners,v=r.event._eventFilter,T,b=c;return c=c.toLowerCase(),v&&v[c]&&(T=v[c](o,c,m),b=T.type,m=T.listener),o.addEventListener?o.addEventListener(b,m,!1):o.attachEvent&&o.attachEvent("on"+b,m),p[p.length]=[o,c,u,m,b],o},r.on=r.event.on,function(){var o=n[r.guid];r.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[r.guid]._instances=n[r.guid]._instances||{},r.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},r.lang.Class=function(o){this.guid=o||r.lang.guid(),n[r.guid]._instances[this.guid]=this},n[r.guid]._instances=n[r.guid]._instances||{},r.lang.Class.prototype.dispose=function(){delete n[r.guid]._instances[this.guid];for(var o in this)r.lang.isFunction(this[o])||delete this[o];this.disposed=!0},r.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},r.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},r.lang.Class.prototype.addEventListener=function(o,c,u){if(r.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var m=this.__listeners,p;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;c.hashCode=u,p=u}o.indexOf("on")!=0&&(o="on"+o),typeof m[o]!="object"&&(m[o]={}),p=p||r.lang.guid(),c.hashCode=p,m[o][p]=c}},r.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(r.lang.isFunction(c)&&!(c=c.hashCode)||!r.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof c<"u")u[o][c]&&delete u[o][c];else for(var m in u[o])delete u[o][m]}},r.lang.Class.prototype.dispatchEvent=function(o,c){r.lang.isString(o)&&(o=new r.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var u in c)o[u]=c[u];var u,m=this.__listeners,p=o.type;if(o.target=o.target||this,o.currentTarget=this,p.indexOf("on")!=0&&(p="on"+p),r.lang.isFunction(this[p])&&this[p].apply(this,arguments),typeof m[p]=="object")for(u in m[p])m[p][u].apply(this,arguments);return o.returnValue},r.lang.inherits=function(o,c,u){var m,p,v=o.prototype,T=new Function;T.prototype=c.prototype,p=o.prototype=new T;for(m in v)p[m]=v[m];o.prototype.constructor=o,o.superClass=c.prototype,typeof u=="string"&&(p._className=u)},r.inherits=r.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",a="png",d=function(o,c,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,u;u=o[c];c++)this._styles.push({url:s+c+"."+a,size:new BMap.Size(u,u)})},d.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,c){var u=parseInt(o),m=parseInt(u/10);return m=Math.max(0,m),m=Math.min(m,c.length-1),c[m]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},d.prototype._buildCssText=function(o){var c=o.url,u=o.size,m=o.anchor,p=o.offset,v=o.textColor||"black",T=o.textSize||10,b=[];if(this._zIndex&&b.push("z-index:"+this._zIndex+";"),e.browser.ie<7)b.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{b.push("background-image:url("+c+");");var O="0 0";p instanceof BMap.Size&&(O=p.width+"px "+p.height+"px"),b.push("background-position:"+O+";")}return u instanceof BMap.Size&&(m instanceof BMap.Size?(m.height>0&&m.height<u.height&&b.push("height:"+(u.height-m.height)+"px; padding-top:"+m.height+"px;"),m.width>0&&m.width<u.width&&b.push("width:"+(u.width-m.width)+"px; padding-left:"+m.width+"px;")):(b.push("height:"+u.height+"px; line-height:"+u.height+"px;"),b.push("width:"+u.width+"px; text-align:center;"))),b.push("cursor:pointer; color:"+v+"; position:absolute; font-size:"+T+"px; font-family:Arial,sans-serif; font-weight:bold"),b.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,u=e.lang.Event;function m(p,v){var T=p.srcElement||p.target,b=p.clientX||p.pageX,O=p.clientY||p.pageY;if(p&&v&&b&&O&&T){var l=e.dom.getPosition(c.getContainer());v.pixel=new BMap.Pixel(b-l.left,O-l.top),v.point=c.pixelToPoint(v.pixel)}return v}e.event.on(this._domElement,"mouseover",function(p){o.dispatchEvent(m(p,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(p){o.dispatchEvent(m(p,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(p){o.dispatchEvent(m(p,new u("onclick")))})},d})}(Re)),Re.exports}var fi=mi();const Qt=Fe(fi);var Mr=function(i,t,e){t=yi(t);var r=i.pointToPixel(t.getNorthEast()),n=i.pointToPixel(t.getSouthWest());r.x+=e,r.y-=e,n.x-=e,n.y+=e;var s=i.pixelToPoint(r),a=i.pixelToPoint(n);return new BMap.Bounds(a,s)},yi=function(i){var t=Ie(i.getNorthEast().lng,-180,180),e=Ie(i.getSouthWest().lng,-180,180),r=Ie(i.getNorthEast().lat,-74,74),n=Ie(i.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,r))},Ie=function(i,t,e){return t&&(i=Math.max(i,t)),e&&(i=Math.min(i,e)),i},Cr=function(i){return Object.prototype.toString.call(i)==="[object Array]"},Tr=function(i,t){var e=-1;if(Cr(t)){if(t.indexOf)e=t.indexOf(i);else for(var r=0,n;n=t[r];r++)if(n===i){e=r;break}}return e},P=function(i,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(i){this._map=i,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var r=this;this._map.addEventListener("zoomend",function(){r._redraw()}),this._map.addEventListener("moveend",function(){r._redraw()});var n=e.markers;Cr(n)&&this.addMarkers(n)}};P.prototype.addMarkers=function(i){if(i.length){for(var t=0,e=i.length;t<e;t++)this._pushMarkerTo(i[t]);this._createClusters()}};P.prototype._pushMarkerTo=function(i){var t=Tr(i,this._markers);t===-1&&(i.isInCluster=!1,this._markers.push(i))};P.prototype.addMarker=function(i){this._pushMarkerTo(i),this._createClusters()};P.prototype._createClusters=function(){var i=this._map.getBounds();if(i.getCenter()){for(var t=Mr(this._map,i,this._gridSize),e=0,r;r=this._markers[e];e++)!r.isInCluster&&t.containsPoint(r.getPosition())&&this._addToClosestCluster(r);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}};P.prototype._addToClosestCluster=function(i){var t=4e6,e=null;i.getPosition();for(var r=0,n;n=this._clusters[r];r++){var s=n.getCenter();if(s){var a=this._map.getDistance(s,i.getPosition());a<t&&(t=a,e=n)}}if(e&&e.isMarkerInClusterBounds(i))e.addMarker(i);else{var n=new q(this);n.addMarker(i),this._clusters.push(n)}};P.prototype._clearLastClusters=function(){for(var i=0,t;t=this._clusters[i];i++)t.remove();this._clusters=[],this._removeMarkersFromCluster()};P.prototype._removeMarkersFromCluster=function(){for(var i=0,t;t=this._markers[i];i++)t.isInCluster=!1};P.prototype._removeMarkersFromMap=function(){for(var i=0,t;t=this._markers[i];i++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}};P.prototype._removeMarker=function(i){var t=Tr(i,this._markers);return t===-1?!1:(this._map.removeOverlay(i),this._markers.splice(t,1),!0)};P.prototype.removeMarker=function(i){var t=this._removeMarker(i);return t&&(this._clearLastClusters(),this._createClusters()),t};P.prototype.removeMarkers=function(i){for(var t=!1,e=0;e<i.length;e++){var r=this._removeMarker(i[e]);t=t||r}return t&&(this._clearLastClusters(),this._createClusters()),t};P.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]};P.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()};P.prototype.getGridSize=function(){return this._gridSize};P.prototype.setGridSize=function(i){this._gridSize=i,this._redraw()};P.prototype.getMaxZoom=function(){return this._maxZoom};P.prototype.setMaxZoom=function(i){this._maxZoom=i,this._redraw()};P.prototype.getZIndex=function(){return this._zIndex};P.prototype.setZIndex=function(i){this._zIndex!=i&&(this.zIndex=i,this._redraw())};P.prototype.getStyles=function(){return this._styles};P.prototype.setStyles=function(i){this._styles=i,this._redraw()};P.prototype.getMinClusterSize=function(){return this._minClusterSize};P.prototype.setMinClusterSize=function(i){this._minClusterSize=i,this._redraw()};P.prototype.isAverageCenter=function(){return this._isAverageCenter};P.prototype.getMap=function(){return this._map};P.prototype.getMarkers=function(){return this._markers};P.prototype.getClustersCount=function(){for(var i=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&i++;return i};P.prototype._textCalculator=function(i){return i.length.toString()};P.prototype._stylesIndexCalculator=null;P.prototype.setTextCalculator=function(i){this._textCalculator=i};P.prototype.setStylesIndexCalculator=function(i){this._stylesIndexCalculator=i};function q(i){var t=this;this._markerClusterer=i,this._map=i.getMap(),this._minClusterSize=i.getMinClusterSize(),this._isAverageCenter=i.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new Qt(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:i._zIndex}),this._clusterMarker.getStyleByText=function(e,r){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,r.length);return r[n]}return Qt.prototype.getStyleByText.call(this,e,r)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}q.prototype.addMarker=function(i){if(this.isMarkerInCluster(i))return!1;if(!this._center)this._center=i.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+i.getPosition().lat)/t,r=(this._center.lng*(t-1)+i.getPosition().lng)/t;this._center=new BMap.Point(r,e),this.updateGridBounds()}return i.isInCluster=!0,this._markers.push(i),!0};q.prototype.render=function(){var i=this._markers.length;if(i<this._minClusterSize)for(var t=0;t<i;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()};q.prototype.isMarkerInCluster=function(i){if(this._markers.indexOf)return this._markers.indexOf(i)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===i)return!0;return!1};q.prototype.isMarkerInClusterBounds=function(i){return this._gridBounds.containsPoint(i.getPosition())};q.prototype.isReal=function(i){return this._isReal};q.prototype.updateGridBounds=function(){var i=new BMap.Bounds(this._center,this._center);this._gridBounds=Mr(this._map,i,this._markerClusterer.getGridSize())};q.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var i=0,t;t=this._markers[i];i++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))};q.prototype.remove=function(){for(var i=0,t;t=this._markers[i];i++){var e=this._markers[i].getLabel();this._markers[i].getMap()&&this._map.removeOverlay(this._markers[i]),this._markers[i].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers};q.prototype.getBounds=function(){for(var i=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)i.extend(e.getPosition());return i};q.prototype.getCenter=function(){return this._center};var He;(i=>{function t(r){return{url:r.url,size:new BMap.Size(r.size.width,r.size.height),anchor:r.anchor&&new BMap.Size(r.anchor.x,r.anchor.y),offset:r.offset&&new BMap.Size(r.offset.x,r.offset.y),textColor:r.textColor,textSize:r.textSize}}i.toBaidu=t;function e(r){return{url:r.url,width:r.size.width,height:r.size.height,anchor:r.anchor&&[r.anchor.y,r.anchor.x],backgroundPosition:r.offset&&`${r.offset.x} ${r.offset.y}`,textColor:r.textColor,textSize:r.textSize}}i.toGoogle=e})(He||(He={}));class Nt{constructor(t){this.map=t,C.noop()}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Or extends Nt{constructor(e,r){var s;super(e);g(this,"inner");this.inner=new P(e.innerMap,{gridSize:r.gridSize,maxZoom:r.maxZoom,minClusterSize:r.minClusterSize,isAverageCenter:r.averageCenter,styles:(s=r.styles)==null?void 0:s.map(a=>He.toBaidu(a)),zIndex:r.zIndex});const n=r.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((a,d)=>n(a.length,d)),r.markers&&this.addMarkers(r.markers)}recreate(){this.inner._redraw()}}class wr extends Nt{constructor(e,r){var s,a;super(e);g(this,"inner");this.inner=new ui(e.innerMap,(s=r.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:r.gridSize,maxZoom:r.maxZoom,minimumClusterSize:r.minClusterSize,averageCenter:r.averageCenter,styles:(a=r.styles)==null?void 0:a.map(d=>He.toGoogle(d)),zIndex:r.zIndex});const n=r.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Zt{constructor(){C.noop()}}class xr extends Zt{constructor(e,r){super();g(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,r){return this.searchImpl(e,r instanceof x?r.toGoogle(this.map.coordType):r??this.map.innerMap.getCenter())}searchInBounds(e,r){return this.searchImpl(e,r.toGoogle(this.map.coordType))}searchNearBy(e,r,n){return this.searchImpl(e,{center:r.toGoogle(this.map.coordType),radius:n})}searchImpl(e,r){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:r},(a,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(a??[]).map(c=>mr(c,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Er extends Zt{constructor(e,r){super();g(this,"searchRequestMap",new Map);g(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,r){return this.newSearch(r instanceof x?r.toBaidu(this.map.coordType):r??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,r){return this.newSearch(void 0,n=>{n.searchInBounds(e,r.toBaidu(this.map.coordType))})}searchNearBy(e,r,n){return this.newSearch(void 0,s=>{s.searchNearby(e,r.toBaidu(this.map.coordType),n)})}newSearch(e,r){return new Promise((n,s)=>{const a=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&C.throwUnsupported("当前只支持一次搜索一条数据");const o=a.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let u=0;u<d.getCurrentNumPois();u++){const m=d.getPoi(u);c.push({id:m.uid,city:m.city,country:"",position:x.fromBaidu(m.point,this.map.coordType),province:m.province,title:m.title,address:m.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});r(a)})}}class Wt{constructor(t,e){g(this,"onData");g(this,"onError");this.map=t,this.input=e,C.noop()}setSearchListener(t,e){return this.onData&&C.throwError("setSearchListener只能调用一次"),this.onData=t,this.onError=e,C.noop}}class Pr extends Wt{constructor(e,r){super(e,r.input);g(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(r.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,r){return super.setSearchListener(e,r),or(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>mr(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Lr extends Wt{constructor(e,r){super(e,r.input);g(this,"autocomplete");g(this,"placesService");this.autocomplete=e.createAutocomplete({input:r.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,r){return super.setSearchListener(e,r),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Br=(i=>(i[i.WORLD=1]="WORLD",i[i.STATE=5]="STATE",i[i.CITY=10]="CITY",i[i.STREET=15]="STREET",i[i.BUILDING=20]="BUILDING",i))(Br||{});class nt{constructor(t){g(this,"latestInfoWindow");g(this,"delegate",C.lateinit());this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Et,er;function vi(){if(er)return Et;er=1;var i=function(h){return t(h)&&!e(h)};function t(l){return!!l&&typeof l=="object"}function e(l){var h=Object.prototype.toString.call(l);return h==="[object RegExp]"||h==="[object Date]"||s(l)}var r=typeof Symbol=="function"&&Symbol.for,n=r?Symbol.for("react.element"):60103;function s(l){return l.$$typeof===n}function a(l){return Array.isArray(l)?[]:{}}function d(l,h){return h.clone!==!1&&h.isMergeableObject(l)?b(a(l),l,h):l}function o(l,h,f){return l.concat(h).map(function(y){return d(y,f)})}function c(l,h){if(!h.customMerge)return b;var f=h.customMerge(l);return typeof f=="function"?f:b}function u(l){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l).filter(function(h){return Object.propertyIsEnumerable.call(l,h)}):[]}function m(l){return Object.keys(l).concat(u(l))}function p(l,h){try{return h in l}catch{return!1}}function v(l,h){return p(l,h)&&!(Object.hasOwnProperty.call(l,h)&&Object.propertyIsEnumerable.call(l,h))}function T(l,h,f){var y={};return f.isMergeableObject(l)&&m(l).forEach(function(w){y[w]=d(l[w],f)}),m(h).forEach(function(w){v(l,w)||(p(l,w)&&f.isMergeableObject(h[w])?y[w]=c(w,f)(l[w],h[w],f):y[w]=d(h[w],f))}),y}function b(l,h,f){f=f||{},f.arrayMerge=f.arrayMerge||o,f.isMergeableObject=f.isMergeableObject||i,f.cloneUnlessOtherwiseSpecified=d;var y=Array.isArray(h),w=Array.isArray(l),E=y===w;return E?y?f.arrayMerge(l,h,f):T(l,h,f):d(h,f)}b.all=function(h,f){if(!Array.isArray(h))throw new Error("first argument should be an array");return h.reduce(function(y,w){return b(y,w,f)},{})};var O=b;return Et=O,Et}var _i=vi();const Sr=Fe(_i);/*!
|
|
2
|
+
"use strict";var ci=Object.defineProperty;var di=(i,t,e)=>t in i?ci(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var m=(i,t,e)=>di(i,typeof t!="symbol"?t+"":t,e);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("tg-commons"),C=require("vue");function ee(i,t,e){Object.keys(i).forEach(r=>{r.startsWith("update:")||e!=null&&e.includes(r)||t.addEventListener(r,i[r])})}let ui=1;function pi(){return ui++}function je(i,t){return t.__id__||(t.__id__=pi()),`${i}::${t.__id__}`}function et(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ze={exports:{}},gi=Ze.exports,nr;function mi(){return nr||(nr=1,function(i){(function(t,e){i.exports?i.exports=e():t.coordtransform=e()})(gi,function(){var t=52.35987755982988,e=3.141592653589793,r=6378245,n=.006693421622965943;function s(l,d,f,v){this.west=Math.min(l,f),this.north=Math.max(d,v),this.east=Math.max(l,f),this.south=Math.min(d,v)}s.prototype.contain=function(l,d){return this.west<=l&&this.east>=l&&this.north>=d&&this.south<=d};var a=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],h=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(l,d,f=!0){for(var v=0;v<a.length;v++)if(a[v].contain(l,d)){for(var w=0;w<h.length;w++)if(h[w].contain(l,d))return!1;if(f){for(var w=0;w<o.length;w++)if(o[w].contain(l,d))return!1}return!0}return!1}function p(l,d){var f=l-.0065,v=d-.006,w=Math.sqrt(f*f+v*v)-2e-5*Math.sin(v*t),P=Math.atan2(v,f)-3e-6*Math.cos(f*t),E=w*Math.cos(P),S=w*Math.sin(P);return[E,S]}function u(l,d){var f=Math.sqrt(l*l+d*d)+2e-5*Math.sin(d*t),v=Math.atan2(d,l)+3e-6*Math.cos(l*t),w=f*Math.cos(v)+.0065,P=f*Math.sin(v)+.006;return[w,P]}function g(l,d){return _(l,d)}function y(l,d){var f=_(l,d);return[l*2-f[0],d*2-f[1]]}function _(l,d){var f=M(l-105,d-35),v=b(l-105,d-35),w=d/180*e,P=Math.sin(w);P=1-n*P*P;var E=Math.sqrt(P);f=f*180/(r*(1-n)/(P*E)*e),v=v*180/(r/E*Math.cos(w)*e);var S=d+f,D=l+v;return[D,S]}function M(l,d){var f=-100+2*l+3*d+.2*d*d+.1*l*d+.2*Math.sqrt(Math.abs(l));return f+=(20*Math.sin(6*l*e)+20*Math.sin(2*l*e))*2/3,f+=(20*Math.sin(d*e)+40*Math.sin(d/3*e))*2/3,f+=(160*Math.sin(d/12*e)+320*Math.sin(d*e/30))*2/3,f}function b(l,d){var f=300+l+2*d+.1*l*l+.1*l*d+.1*Math.sqrt(Math.abs(l));return f+=(20*Math.sin(6*l*e)+20*Math.sin(2*l*e))*2/3,f+=(20*Math.sin(l*e)+40*Math.sin(l/3*e))*2/3,f+=(150*Math.sin(l/12*e)+300*Math.sin(l/30*e))*2/3,f}return{rawBd09ToGcj02:p,rawGcj02ToBd09:u,rawWgs84ToGcj02:g,rawGcj02ToWgs84:y,bd09ToGcj02:p,gcj02ToBd09:u,wgs84ToGcj02:function(l,d){return c(l,d)?g(l,d):[l,d]},gcj02ToWgs84:function(l,d){return c(l,d)?y(l,d):[l,d]},bd09ToWgs84:function(l,d){if(!c(l,d,!1))return[l,d];var f=p(l,d);return y(f[0],f[1])},wgs84ToBd09:function(l,d){if(!c(l,d,!1))return[l,d];var f=g(l,d);return u(f[0],f[1])}}})}(Ze)),Ze.exports}var fi=mi();const ae=et(fi);function yi(i,t){return i instanceof t}function vi(i,t){if(i instanceof t)return i}function Ve(i,t){return(i==null?void 0:i.$options.name)===t.name}function Zt(i,t){return Ve(i,t)?i:void 0}function tt(i,t,e){let r=t;for(;r;){if(Ve(r,i))return r;if(e&&Ve(r,e))return;r=r.$parent}}function _i(i){return i}var z=(i=>(i.wgs84="wgs84",i.gcj02="gcj02",i.bd09="bd09",i))(z||{});const kt="wgs84",G=class G{constructor(t,e,r){this.lat=t,this.lng=e,this.coord=r,O.noop()}static _normalize(t,e){const r=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,r]}static fromBaidu(t,e){return new G(t.lat,t.lng,e)}static fromGoogle(t,e){return new G(t.lat(),t.lng(),e)}static fromHere(t,e){return new G(t.lat,t.lng,e)}static fromLiteral(t){return new G(t.lat,t.lng,t.coord||kt)}static fromLngLat(t,e,r=kt){return new G(e,t,r)}static create(t,e,r=kt){return new G(t,e,r)}to(t){const e=t;if(this.coord===e)return this;const[r,n]=this._convert(e);return new G(n,r,e)}toBaidu(t,e=!1){let r=this.lat,n=this.lng;return this.coord!==t&&([n,r]=this._convert(t)),e&&([n,r]=G._normalize(n,r)),new BMap.Point(n,r)}toGoogle(t){let e=this.lat,r=this.lng;return this.coord!==t&&([r,e]=this._convert(t)),new google.maps.LatLng(e,r)}toHere(t){let e=this.lat,r=this.lng;return this.coord!==t&&([r,e]=this._convert(t)),new H.geo.Point(e,r)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=G._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new G(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};m(G,"ZERO",G.create(0,0));let x=G;const re=class re{constructor(t,e){m(this,"coord");this.sw=t,this.ne=e,O.assert(t.coord===e.coord,"sw和ne的coord应该相同"),O.assert(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),O.assert(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,r){return t<=e?t<=r&&r<=e:t<=r||r<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let r=1;r<t.length;r++)e.include(t[r]);return e.build()}static from(...t){return this.fromArray(t)??O.throwError("positions中没有点")}static fromGoogle(t,e){return new re(x.fromGoogle(t.getSouthWest(),e),x.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(x.fromBaidu(t.getSouthWest(),e),x.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:r}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,r)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return x.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,x.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,x.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};m(re,"EMPTY",new re(x.ZERO,x.ZERO));let K=re;(i=>{class t{constructor(r){m(this,"coord");m(this,"minLat");m(this,"minLng");m(this,"maxLat");m(this,"maxLng");this.coord=r.coord,this.minLat=this.maxLat=r.lat,this.minLng=this.maxLng=r.lng}build(){return new i(x.create(this.minLat,this.minLng,this.coord),x.create(this.maxLat,this.maxLng,this.coord))}include(r){const{lat:n,lng:s}=r.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),i.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(r,n){return(r-n+360)%360}}i.Builder=t})(K||(K={}));exports.Location=void 0;(i=>{function t(r,n){if(r==null)return;if(typeof r=="string")return r;const s=r.to(n);return`${s.lat},${s.lng}`}i.toString=t;function e(r){return typeof r=="string"||r==null?void 0:r.coord}i.getCoordType=e})(exports.Location||(exports.Location={}));function yr(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}function Mi(){const i=window.$BAIDU$;"kT"in i||Object.defineProperty(i,"kT",{get:()=>i._instances,enumerable:!0,configurable:!0})}const sr={equals(i,t){return i.lat===t.lat&&i.lng===t.lng}};var $t;(i=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}i.isScrollable=t})($t||($t={}));exports.Arrays=void 0;(i=>{function t(n,s){for(const a of n)if(a instanceof s)return a}i.findByType=t;function e(n,s){return n.includes(s)}i.includesTyped=e;function r(n,s,a){const h=s>=0?s:n.length+s;if(a===void 0)return n[h];n[h]=a}i.at=r})(exports.Arrays||(exports.Arrays={}));exports.MVCArrays=void 0;(i=>{function t(n,s){const a=n.getLength();for(let h=0;h<a;h++)if(n.getAt(h)===s)return h;return-1}i.indexOf=t;function e(n,s){const a=t(n,s);if(a!==-1)return n.removeAt(a)}i.remove=e;function r(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}i.listenChanged=r})(exports.MVCArrays||(exports.MVCArrays={}));function vr(i,t,e){return i.addListener(t,e).remove}function bi(i,t,e){return i.addEventListener(t,e),()=>i.removeEventListener(t,e)}function Ci(i,t,e,r){return i.addEventListener(t,e,r),()=>i.removeEventListener(t,e,r)}function or(i,t,e){return i.addEventListener(t,e),()=>i.removeEventListener(t,e)}class _r{constructor(t,e){m(this,"eventMap",new Map);m(this,"target",O.lateinit());this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class rt{constructor(t,e){m(this,"eventHub",new Mr);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(exports.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(exports.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Qe=class Qe extends _r{addEventListener(t,e){const r=je(t,e);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,e);return}const n=this.inner.addListener(Qe.EVENT_TYPE_MAP[t]||t,s=>{const a={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(a.position=x.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,a)});this.eventMap.set(r,n)}removeEventListener(t,e){const r=je(t,e),n=this.eventMap.get(r);n?(n.remove(),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,e)}};m(Qe,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let de=Qe;const Ee=class Ee extends _r{addEventListener(t,e){const r=je(t,e);if(this.eventMap.get(r)){console.warn("listener已经添加过了",r,e);return}const n=s=>{const a={type:t,target:this.target,originalEvent:s};s.point&&(a.position=x.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,a)};this.inner.addEventListener(Ee.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(r,n)}removeEventListener(t,e){const r=je(t,e),n=this.eventMap.get(r);n?(this.inner.removeEventListener(Ee.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(r)):console.warn("移除失败, 不存在该listener",r,e)}};m(Ee,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let Se=Ee;class Mr{constructor(){m(this,"typeMap",new Map)}addEventListener(t,e){let r=this.typeMap.get(t);r||(r=[],this.typeMap.set(t,r)),!r.includes(e)&&r.push(e)}removeEventListener(t,e){const r=this.typeMap.get(t);r&&O.Arrays.remove(r,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(r=>r.call(t.target,t))}}class Gt{constructor(t,e){m(this,"keyToValue",new Map);m(this,"valueToKey",new Map);O.assert(t.length===e.length);for(let r=t.length-1;r>=0;r--)this.keyToValue.set(t[r],e[r]),this.valueToKey.set(e[r],t[r])}toKey(t){return this.valueToKey.get(t)??O.throwError()}toValue(t){return this.keyToValue.get(t)??O.throwError()}}class br{constructor(t,e=10){m(this,"map",new Map);this.values=t,this.maxSize4Debug=e,O.noop()}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let r=this.values.length-1;r>=0;r--){const n=this.values[r];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??O.throwError(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class he{constructor(t){m(this,"value");this.creator=t,O.noop()}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var R=(i=>(i.TOP_LEFT="top-left",i.TOP_CENTER="top-center",i.TOP_RIGHT="top-right",i.BOTTOM_LEFT="bottom-left",i.BOTTOM_CENTER="bottom-center",i.BOTTOM_RIGHT="bottom-right",i.LEFT_TOP="left-top",i.LEFT_CENTER="left-center",i.LEFT_BOTTOM="left-bottom",i.RIGHT_TOP="right-top",i.RIGHT_CENTER="right-center",i.RIGHT_BOTTOM="right-bottom",i))(R||{});exports.ControlPositionConverter=void 0;(i=>{let t,e;const r=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new Gt(r,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}i.getBaidu=n;function s(){return e||(e=new Gt(r,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),e}i.getGoogle=s})(exports.ControlPositionConverter||(exports.ControlPositionConverter={}));class Cr{constructor(t){m(this,"inner");this.position=t,O.noop()}}class it{}class Tr extends it{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class nt extends it{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??exports.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(exports.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class De extends it{constructor(e,r){super();m(this,"visible",!1);m(this,"map");this._type=e,this.position=r}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:exports.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var Wt=(i=>(i.normal="normal",i.satellite="satellite",i.hybrid="hybrid",i))(Wt||{});class V{constructor(t,e,r,n){this.id=t,this.baidu=e,this.google=r,this.googleCoordType=n,O.noop()}getId(){return this.id}getBaiduCoordType(){return z.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){O.throwUnsupported("google的内置地图没有对应的实例")}}class Ti{constructor(t,e){m(this,"baiduLayerCached",new he(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,r)=>{const n=Math.pow(2,r-1),s=e.x+n,a=n-1-e.y;return this.options.getTileUrl({x:s,y:a},r)},t}));m(this,"baiduMapTypeCached",new he(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));m(this,"googleCached",new he(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,r)=>this.options.getTileUrl(e,r),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e,O.noop()}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){O.throwUnsupported("这个方法不会被调用")}}class Or{constructor(){m(this,"baiduCache",new he(()=>new BMap.TrafficLayer));m(this,"googleCache",new he(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}exports.MapType=void 0;(i=>{i.NORMAL=new V("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,z.gcj02),i.SATELLITE=new V("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,z.wgs84),i.HYBRID=new V("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,z.gcj02),i.TERRAIN=new V("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,z.wgs84),i.BUILD_IN_MAP_TYPES=new br([i.NORMAL,i.SATELLITE,i.HYBRID,i.TERRAIN])})(exports.MapType||(exports.MapType={}));var Ht=(i=>(i.DEFAULT="default",i.HORIZONTAL="horizontal",i.DROPDOWN="dropdown",i))(Ht||{});const wr=[exports.MapType.NORMAL,exports.MapType.SATELLITE,exports.MapType.HYBRID];class st extends nt{static create(t){const e=t.mapTypes??wr,r={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&r[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(exports.ControlPositionConverter.getBaidu().toValue(t.position)),new st(n,t.position)}}const se=class se extends De{constructor(t="default",e=R.TOP_LEFT,r=wr){super("mapType",e),this.type=t,this.mapTypes=r,se.type2google||(se.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new se(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=se.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof V?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof V||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};m(se,"type2google");let Fe=se;class ot extends nt{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&exports.ControlPositionConverter.getBaidu().toValue(t.position)});return new ot(e,t.position)}}class at extends De{static create(t){return new at(t.position)}constructor(t=R.BOTTOM_RIGHT){super("scale",t)}}class lt extends Tr{static create(t){return new lt(!0,t.position??R.RIGHT_BOTTOM)}}class ht extends De{static create(t){return new ht(t.position)}constructor(t=R.RIGHT_BOTTOM){super("streetView",t)}}class ct extends nt{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&exports.ControlPositionConverter.getBaidu().toValue(t.position)});return new ct(e,t.position)}}class dt extends De{static create(t){return new dt(t.position)}constructor(t=R.RIGHT_BOTTOM){super("zoom",t)}}let Oi,wi;const ie={get LATLNG_ZERO(){return Oi??(Oi=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return wi??(wi=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function xr(i,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of i)for(const r of e.types)switch(r){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function Pr(i,t){var r;const e=i.address_components&&xr(i.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:i.place_id??"",address:i.formatted_address??"",position:x.fromGoogle(((r=i.geometry)==null?void 0:r.location)??ie.LATLNG_ZERO,t.coordType),title:i.name??""}}class jt{}class Lr extends jt{constructor(e,r){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(r.input,{fields:["address_components","name"]}),r.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return vr(this.inner,"place_changed",()=>{const r=this.inner.getPlace(),n={title:r.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};r.address_components&&xr(r.address_components,n),e(n)})}}class Er extends jt{constructor(e,r){super();m(this,"inner");m(this,"input");m(this,"removeableArray",[]);if(this.map=e,this.input=r.input,this.inner=new BMap.Autocomplete({input:r.input,location:r.bindToMap?e.innerMap:void 0}),r.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(or(this.map,"center-changed",n)),this.removeableArray.push(or(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let r=0;const n=bi(this.inner,"confirm",a=>{const h=a.item.value;r=Date.now(),e(Object.assign({title:h.business,country:""},h))}),s=Ci(this.input,"keyup",a=>{a.key==="Enter"&&Date.now()-r>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var We={exports:{}},xi=We.exports,ar;function Pi(){return ar||(ar=1,function(i,t){(function(e,r){i.exports=r()})(xi,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},a=function(){var y=function(b){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=b.xField||b.defaultXField,this._yField=b.yField||b.defaultYField,this._valueField=b.valueField||b.defaultValueField,b.radius&&(this._cfgRadius=b.radius)},_=s.defaultRadius;return y.prototype={_organiseData:function(M,b){var l=M[this._xField],d=M[this._yField],f=this._radi,v=this._data,w=this._max,P=this._min,E=M[this._valueField]||1,S=M.radius||this._cfgRadius||_;return v[l]||(v[l]=[],f[l]=[]),v[l][d]?v[l][d]+=E:(v[l][d]=E,f[l][d]=S),v[l][d]>w?(b?this.setDataMax(v[l][d]):this._max=v[l][d],!1):{x:l,y:d,value:E,radius:S,min:P,max:w}},_unOrganizeData:function(){var M=[],b=this._data,l=this._radi;for(var d in b)for(var f in b[d])M.push({x:d,y:f,radius:l[d][f],value:b[d][f]});return{min:this._min,max:this._max,data:M}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var M=arguments[0],b=M.length;b--;)this.addData.call(this,M[b]);else{var l=this._organiseData(arguments[0],!0);l&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[l]})}return this},setData:function(M){var b=M.data,l=b.length;this._data=[],this._radi=[];for(var d=0;d<l;d++)this._organiseData(b[d],!1);return this._max=M.max,this._min=M.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(M){return this._max=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(M){return this._min=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(M){this._coordinator=M},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},y}(),h=function(){var y=function(l){var d=l.gradient||l.defaultGradient,f=document.createElement("canvas"),v=f.getContext("2d");f.width=256,f.height=1;var w=v.createLinearGradient(0,0,256,1);for(var P in d)w.addColorStop(P,d[P]);return v.fillStyle=w,v.fillRect(0,0,256,1),v.getImageData(0,0,256,1).data},_=function(l,d){var f=document.createElement("canvas"),v=f.getContext("2d"),w=l,P=l;if(f.width=f.height=l*2,d==1)v.beginPath(),v.arc(w,P,l,0,2*Math.PI,!1),v.fillStyle="rgba(0,0,0,1)",v.fill();else{var E=v.createRadialGradient(w,P,l*d,w,P,l);E.addColorStop(0,"rgba(0,0,0,1)"),E.addColorStop(1,"rgba(0,0,0,0)"),v.fillStyle=E,v.fillRect(0,0,2*l,2*l)}return f},M=function(P){for(var d=[],f=P.min,v=P.max,w=P.radi,P=P.data,E=Object.keys(P),S=E.length;S--;)for(var D=E[S],I=Object.keys(P[D]),j=I.length;j--;){var k=I[j],N=P[D][k],U=w[D][k];d.push({x:D,y:k,value:N,radius:U})}return{min:f,max:v,data:d}};function b(l){var d=l.element,f=this.shadowCanvas=document.createElement("canvas"),v=this.canvas=l.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var w=getComputedStyle(l.element)||{};v.className="heatmap-canvas",this._width=v.width=f.width=+w.width.replace(/px/,""),this._height=v.height=f.height=+w.height.replace(/px/,""),this.shadowCtx=f.getContext("2d"),this.ctx=v.getContext("2d"),v.style.cssText=f.style.cssText="position:absolute;left:0;top:0;",d.style.position="relative",d.appendChild(v),this._palette=y(l),this._templates={},this._setStyles(l)}return b.prototype={renderPartial:function(l){this._drawAlpha(l),this._colorize()},renderAll:function(l){this._clear(),this._drawAlpha(M(l)),this._colorize()},_updateGradient:function(l){this._palette=y(l)},updateConfig:function(l,d){l.gradient!==d.gradient&&this._updateGradient(l),this._setStyles(l)},setDimensions:function(l,d){this._width=l,this._height=d,this.canvas.width=this.shadowCanvas.width=l,this.canvas.height=this.shadowCanvas.height=d},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(l){this._blur=l.blur==0?0:l.blur||l.defaultBlur,l.backgroundColor&&(this.canvas.style.backgroundColor=l.backgroundColor),this._opacity=(l.opacity||0)*255,this._maxOpacity=(l.maxOpacity||l.defaultMaxOpacity)*255,this._minOpacity=(l.minOpacity||l.defaultMinOpacity)*255,this._useGradientOpacity=!!l.useGradientOpacity},_drawAlpha:function(v){for(var d=this._min=v.min,f=this._max=v.max,v=v.data||[],w=v.length,P=1-this._blur;w--;){var E=v[w],S=E.x,D=E.y,I=E.radius,j=Math.min(E.value,f),k=S-I,N=D-I,U=this.shadowCtx,Z;this._templates[I]?Z=this._templates[I]:this._templates[I]=Z=_(I,P),U.globalAlpha=(j-d)/(f-d),U.drawImage(Z,k,N),k<this._renderBoundaries[0]&&(this._renderBoundaries[0]=k),N<this._renderBoundaries[1]&&(this._renderBoundaries[1]=N),k+2*I>this._renderBoundaries[2]&&(this._renderBoundaries[2]=k+2*I),N+2*I>this._renderBoundaries[3]&&(this._renderBoundaries[3]=N+2*I)}},_colorize:function(){var l=this._renderBoundaries[0],d=this._renderBoundaries[1],f=this._renderBoundaries[2]-l,v=this._renderBoundaries[3]-d,w=this._width,P=this._height,E=this._opacity,S=this._maxOpacity,D=this._minOpacity,I=this._useGradientOpacity;l<0&&(l=0),d<0&&(d=0),l+f>w&&(f=w-l),d+v>P&&(v=P-d);for(var j=this.shadowCtx.getImageData(l,d,f,v),k=j.data,N=k.length,U=this._palette,Z=3;Z<N;Z+=4){var ve=k[Z],_e=ve*4;if(_e){var Me;E>0?Me=E:ve<S?ve<D?Me=D:Me=ve:Me=S,k[Z-3]=U[_e],k[Z-2]=U[_e+1],k[Z-1]=U[_e+2],k[Z]=I?U[_e+3]:Me}}this.ctx.putImageData(j,l,d),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(l){var d,f=this.shadowCtx,v=f.getImageData(l.x,l.y,1,1),w=v.data[3],P=this._max,E=this._min;return d=Math.abs(P-E)*(w/255)>>0,d},getDataURL:function(){return this.canvas.toDataURL()}},b}(),o=function(){var y=!1;return s.defaultRenderer==="canvas2d"&&(y=h),y}(),c={merge:function(){for(var g={},y=arguments.length,_=0;_<y;_++){var M=arguments[_];for(var b in M)g[b]=M[b]}return g}},p=function(){var y=function(){function l(){this.cStore={}}return l.prototype={on:function(d,f,v){var w=this.cStore;w[d]||(w[d]=[]),w[d].push(function(P){return f.call(v,P)})},emit:function(d,f){var v=this.cStore;if(v[d])for(var w=v[d].length,P=0;P<w;P++){var E=v[d][P];E(f)}}},l}(),_=function(b){var l=b._renderer,d=b._coordinator,f=b._store;d.on("renderpartial",l.renderPartial,l),d.on("renderall",l.renderAll,l),d.on("extremachange",function(v){b._config.onExtremaChange&&b._config.onExtremaChange({min:v.min,max:v.max,gradient:b._config.gradient||b._config.defaultGradient})}),f.setCoordinator(d)};function M(){var b=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new y,b.plugin){var l=b.plugin;if(s.plugins[l]){var d=s.plugins[l];this._renderer=new d.renderer(b),this._store=new d.store(b)}else throw new Error("Plugin '"+l+"' not found. Maybe it was not registered.")}else this._renderer=new o(b),this._store=new a(b);_(this)}return M.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(b){const l=this._config;return this._config=c.merge(this._config,b),this._renderer.updateConfig(this._config,l),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(b){return this._store.getValueAt?this._store.getValueAt(b):this._renderer.getValueAt?this._renderer.getValueAt(b):null}},M}(),u={create:function(g){return new p(g)},register:function(g,y){s.plugins[g]=y}};return u}();var r=function(s){Reflect.getPrototypeOf(r.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(r.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};r.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),r.prototype.initialize=function(s){this._map=s;var a=document.createElement("div");if(a.style.position="absolute",a.style.top=0,a.style.left=0,a.style.border=0,a.style.width=this._map.getSize().width+"px",a.style.height=this._map.getSize().height+"px",this.conf.element=a,!n())return a;s.getPanes().mapPane.appendChild(a),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var h=this;return s.addEventListener("resize",function(o){var c=o.size;a.style.width=c.width+"px",a.style.height=c.height+"px",h.heatmap._renderer.setDimensions(c.width,c.height),h.draw()}),this._div=a,a},r.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var a=this._map.pointToOverlayPixel(s.getNorthEast()),h=this._map.pointToOverlayPixel(s.getSouthWest()),o=a.y,c=h.x,p=h.y-a.y,u=a.x-h.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=u+"px",this.conf.element.style.height=p+"px",this.latlngs.length>0){this.heatmap.removeData();var g=this.latlngs.length;const l={max:this.heatmap._store.getData().max,data:[]};for(;g--;){var y=this.latlngs[g].latlng;if(s.containsPoint(y)){var _=this._map.pointToOverlayPixel(y),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,M=new BMap.Pixel(_.x-c,_.y-o),b=this.pixelTransform(M);l.data.push({x:b.x,y:b.y,count:this.latlngs[g].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(l)}}}},r.prototype.pixelTransform=function(s){for(var a=this.heatmap.width,h=this.heatmap.height;s.x<0;)s.x+=a;for(;s.x>a;)s.x-=a;for(;s.y<0;)s.y+=h;for(;s.y>h;)s.y-=h;return s.x=s.x>>0,s.y=s.y>>0,s},r.prototype.setDataSet=function(s){if(this.data=s,!!n()){var a=this._map.getBounds(),h={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var p=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:p,c:o[c].count}),!!a.containsPoint(p)){var u=this._map.pointToOverlayPixel(p),g=this._map.pointToOverlayPixel(a.getSouthWest()).x,y=this._map.pointToOverlayPixel(a.getNorthEast()).y,_=new BMap.Pixel(u.x-g,u.y-y),M=this.pixelTransform(_);h.data.push({x:M.x,y:M.y,count:o[c].count})}}this.heatmap.setData(h)}},r.prototype.addDataPoint=function(s,a,h){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:a,count:h});var o=new BMap.Point(s,a),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,h),this.latlngs.push({latlng:o,c:h})}},r.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},r.prototype.setOptions=function(s){if(n()){for(var a in s)a=="radius"&&(this.heatmap._store._cfgRadius=s[a]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return r})}(We)),We.exports}var Li=Pi();const Ei=et(Li),lr=10,Ue={toGoogle:(i,t)=>({opacity:i.opacity,radius:i.radius??lr,gradient:i.gradient&&Object.entries(i.gradient).sort(([e],[r])=>+e-+r).map(([e,r])=>r),maxIntensity:i.maxIntensity,data:qe.toGoogle(i.data,t)}),toBaidu:(i,t,e)=>({opacity:i.opacity,radius:i.radius??lr,gradient:i.gradient,data:qe.toBaidu(i.data,t,e)})},qe={toGoogle:(i,t)=>i.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(i,t,e)=>{let r=1;return{data:i.map(s=>{let a,h;return"weight"in s?(a=s.position.to(t),h=s.weight):(a=s.to(t),h=1),r<h&&(r=h),{lng:a.lng,lat:a.lat,count:h}}),max:e??r}}};class Vt{}class Br extends Vt{constructor(e,r){super();m(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(Ue.toGoogle(r,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(qe.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(Ue.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class Ir extends Vt{constructor(e,r){super();m(this,"inner");this.map=e;const n=Ue.toBaidu(r,this.map.coordType,r.maxIntensity);this.inner=new Ei(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var r;((r=this.inner).data??(r.data={})).max=e}setData(e){this.inner.setDataSet(qe.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const r=Ue.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(r.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(r)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Ft{constructor(t){this.options=t}}function xe(i,t,e){const r=new URL(t,i),n=new URLSearchParams(Object.entries(e).filter(Yr));return r.search="?"+n.toString(),r}function At(){const i=window.location.hostname.split(".").filter(t=>!exports.Strings.isInt(t));return i.length===3?i.join("."):[...i,"tg","map","urls"].slice(0,3).join(".")}const Be=class Be extends Ft{directions(t,e,r){return xe(Be.BASE_URL,"dir/",{api:"1",origin:exports.Location.toString(t,z.gcj02),destination:exports.Location.toString(e,z.gcj02),travelmode:r})}search(t){return xe(Be.BASE_URL,"search/",{api:"1",query:exports.Location.toString(t,z.gcj02)})}};m(Be,"BASE_URL","https://www.google.com/maps/");let Ye=Be;const le=class le extends Ft{directions(t,e,r="driving"){const n=exports.Location.getCoordType(e)??exports.Location.getCoordType(t)??z.bd09,s=exports.Location.toString(e,n);return xe(le.BASE_URL,"direction",{origin:exports.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===z.bd09?void 0:n,mode:r,output:"html",region:"中国",src:At()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(z.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,r){return xe(le.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===z.bd09?void 0:t.coord,title:e,content:r,output:"html",src:At()})}geocoderApi(t){return xe(le.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===z.bd09?void 0:t.coord},output:"html",src:At()})}};m(le,"BASE_URL","https://api.map.baidu.com/");let Ke=le,Bi=class Sr{constructor(t,e,r){this.extend(Sr,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=r||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var a=s.map_.getZoom(),h=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);a=Math.min(Math.max(a,h),o),s.prevZoom_!=a&&(s.prevZoom_=a,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(r){for(var n in r.prototype)this.prototype[n]=r.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,r=0,n;n=t[r];r++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var r=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),r++;return r=Math.min(r,e),{text:n,index:r}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let r=0,n;n=t[r];r++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let r in t)this.pushMarkerTo_(t[r]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var r=0,n;n=this.markers_[r];r++)if(n==t){e=r;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var r=this.removeMarker_(t);return!e&&r?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var r=t===this.getMarkers()?t.slice():t,n=!1,s=0,a;a=r[s];s++){var h=this.removeMarker_(a);n=n||h}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),r=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(r);s.x+=this.gridSize_,s.y-=this.gridSize_;var a=e.fromLatLngToDivPixel(n);a.x-=this.gridSize_,a.y+=this.gridSize_;var h=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(a);return t.extend(h),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,r;r=this.clusters_[e];e++)r.remove();for(let e=0,r;r=this.markers_[e];e++)r.isAdded=!1,t&&r.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,r;r=t[e];e++)r.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var r=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,a=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a)),o=r*h;return o}addToClosestCluster_(t){for(var e=4e4,r=null,n=0,s;s=this.clusters_[n];n++){var a=s.getCenter();if(a){var h=this.distanceBetweenPoints_(a,t.getPosition());h<e&&(e=h,r=s)}}if(r&&r.isMarkerInClusterBounds(t))r.addMarker(t);else{var o=new Ii(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),r=0,n;n=this.markers_[r];r++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},Ii=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Ut(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,r;r=this.markers_[e];e++)if(r==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,r=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(r,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var a=0;a<s;a++)this.markers_[a].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),r=0,n;n=e[r];r++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var r=0,n;n=this.markers_[r];r++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,a=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(a),this.clusterIcon_.show()}};class Ut{constructor(t,e,r){t.getMarkerClusterer().extend(Ut,google.maps.OverlayView),this.styles_=e,this.padding_=r||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var r=this;google.maps.event.addDomListener(this.div_,"click",function(){r.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var r=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+r+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var He={exports:{}},Si=He.exports,hr;function ki(){return hr||(hr=1,function(i,t){(function(e,r){i.exports=r()})(Si,function(){var e,r=e=r||{version:"1.3.8"},n={};r.guid="$BAIDU$",n[r.guid]=n[r.guid]||{},r.dom=r.dom||{},r.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},r.g=r.G=r.dom.g,r.dom.getDocument=function(o){return o=r.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},r.lang=r.lang||{},r.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},r.isString=r.lang.isString,r.dom._g=function(o){return r.lang.isString(o)?document.getElementById(o):o},r._g=r.dom._g,r.browser=r.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.ie=r.ie=document.documentMode||+RegExp.$1),r.dom.getComputedStyle=function(o,c){o=r.dom._g(o);var p=r.dom.getDocument(o),u;return p.defaultView&&p.defaultView.getComputedStyle&&(u=p.defaultView.getComputedStyle(o,null),u)?u[c]||u.getPropertyValue(c):""},r.dom._styleFixer=r.dom._styleFixer||{},r.dom._styleFilter=r.dom._styleFilter||[],r.dom._styleFilter.filter=function(o,c,p){for(var u=0,g=r.dom._styleFilter,y;y=g[u];u++)(y=y[p])&&(c=y(o,c));return c},r.string=r.string||{},r.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},r.dom.getStyle=function(o,c){var p=r.dom;o=p.g(o),c=r.string.toCamelCase(c);var u=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||p.getComputedStyle(o,c);if(!u){var g=p._styleFixer[c];g&&(u=g.get?g.get(o):r.dom.getStyle(o,g))}return(g=p._styleFilter)&&(u=g.filter(c,u,"get")),u},r.getStyle=r.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(r.browser.opera=+RegExp.$1),r.browser.isWebkit=/webkit/i.test(navigator.userAgent),r.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),r.browser.isStrict=document.compatMode=="CSS1Compat",r.dom.getPosition=function(o){o=r.dom.g(o);var c=r.dom.getDocument(o),p=r.browser,u=r.dom.getStyle;p.isGecko>0&&c.getBoxObjectFor&&u(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var g={left:0,top:0},y=p.ie&&!p.isStrict?c.body:c.documentElement,_,M;if(o==y)return g;if(o.getBoundingClientRect){M=o.getBoundingClientRect(),g.left=Math.floor(M.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),g.top=Math.floor(M.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),g.left-=c.documentElement.clientLeft,g.top-=c.documentElement.clientTop;var b=c.body,l=parseInt(u(b,"borderLeftWidth")),d=parseInt(u(b,"borderTopWidth"));p.ie&&!p.isStrict&&(g.left-=isNaN(l)?2:l,g.top-=isNaN(d)?2:d)}else{_=o;do{if(g.left+=_.offsetLeft,g.top+=_.offsetTop,p.isWebkit>0&&u(_,"position")=="fixed"){g.left+=c.body.scrollLeft,g.top+=c.body.scrollTop;break}_=_.offsetParent}while(_&&_!=o);for((p.opera>0||p.isWebkit>0&&u(o,"position")=="absolute")&&(g.top-=c.body.offsetTop),_=o.offsetParent;_&&_!=c.body;)g.left-=_.scrollLeft,(!p.opera||_.tagName!="TR")&&(g.top-=_.scrollTop),_=_.offsetParent}return g},r.event=r.event||{},r.event._listeners=r.event._listeners||[],r.event.on=function(o,c,p){c=c.replace(/^on/i,""),o=r.dom._g(o);var u=function(b){p.call(o,b)},g=r.event._listeners,y=r.event._eventFilter,_,M=c;return c=c.toLowerCase(),y&&y[c]&&(_=y[c](o,c,u),M=_.type,u=_.listener),o.addEventListener?o.addEventListener(M,u,!1):o.attachEvent&&o.attachEvent("on"+M,u),g[g.length]=[o,c,p,u,M],o},r.on=r.event.on,function(){var o=n[r.guid];r.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[r.guid]._instances=n[r.guid]._instances||{},r.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},r.lang.Class=function(o){this.guid=o||r.lang.guid(),n[r.guid]._instances[this.guid]=this},n[r.guid]._instances=n[r.guid]._instances||{},r.lang.Class.prototype.dispose=function(){delete n[r.guid]._instances[this.guid];for(var o in this)r.lang.isFunction(this[o])||delete this[o];this.disposed=!0},r.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},r.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},r.lang.Class.prototype.addEventListener=function(o,c,p){if(r.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var u=this.__listeners,g;if(typeof p=="string"&&p){if(/[^\w\-]/.test(p))throw"nonstandard key:"+p;c.hashCode=p,g=p}o.indexOf("on")!=0&&(o="on"+o),typeof u[o]!="object"&&(u[o]={}),g=g||r.lang.guid(),c.hashCode=g,u[o][g]=c}},r.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(r.lang.isFunction(c)&&!(c=c.hashCode)||!r.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var p=this.__listeners;if(p[o])if(typeof c<"u")p[o][c]&&delete p[o][c];else for(var u in p[o])delete p[o][u]}},r.lang.Class.prototype.dispatchEvent=function(o,c){r.lang.isString(o)&&(o=new r.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var p in c)o[p]=c[p];var p,u=this.__listeners,g=o.type;if(o.target=o.target||this,o.currentTarget=this,g.indexOf("on")!=0&&(g="on"+g),r.lang.isFunction(this[g])&&this[g].apply(this,arguments),typeof u[g]=="object")for(p in u[g])u[g][p].apply(this,arguments);return o.returnValue},r.lang.inherits=function(o,c,p){var u,g,y=o.prototype,_=new Function;_.prototype=c.prototype,g=o.prototype=new _;for(u in y)g[u]=y[u];o.prototype.constructor=o,o.superClass=c.prototype,typeof p=="string"&&(g._className=p)},r.inherits=r.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",a="png",h=function(o,c,p){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(h,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=p||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return h.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,p;p=o[c];c++)this._styles.push({url:s+c+"."+a,size:new BMap.Size(p,p)})},h.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},h.prototype.draw=function(){this._map&&this._updatePosition()},h.prototype.getText=function(){return this._text},h.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},h.prototype.getPosition=function(){return this._position},h.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},h.prototype.getStyleByText=function(o,c){var p=parseInt(o),u=parseInt(p/10);return u=Math.max(0,u),u=Math.min(u,c.length-1),c[u]},h.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},h.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},h.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},h.prototype._buildCssText=function(o){var c=o.url,p=o.size,u=o.anchor,g=o.offset,y=o.textColor||"black",_=o.textSize||10,M=[];if(this._zIndex&&M.push("z-index:"+this._zIndex+";"),e.browser.ie<7)M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{M.push("background-image:url("+c+");");var b="0 0";g instanceof BMap.Size&&(b=g.width+"px "+g.height+"px"),M.push("background-position:"+b+";")}return p instanceof BMap.Size&&(u instanceof BMap.Size?(u.height>0&&u.height<p.height&&M.push("height:"+(p.height-u.height)+"px; padding-top:"+u.height+"px;"),u.width>0&&u.width<p.width&&M.push("width:"+(p.width-u.width)+"px; padding-left:"+u.width+"px;")):(M.push("height:"+p.height+"px; line-height:"+p.height+"px;"),M.push("width:"+p.width+"px; text-align:center;"))),M.push("cursor:pointer; color:"+y+"; position:absolute; font-size:"+_+"px; font-family:Arial,sans-serif; font-weight:bold"),M.join("")},h.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,p=e.lang.Event;function u(g,y){var _=g.srcElement||g.target,M=g.clientX||g.pageX,b=g.clientY||g.pageY;if(g&&y&&M&&b&&_){var l=e.dom.getPosition(c.getContainer());y.pixel=new BMap.Pixel(M-l.left,b-l.top),y.point=c.pixelToPoint(y.pixel)}return y}e.event.on(this._domElement,"mouseover",function(g){o.dispatchEvent(u(g,new p("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(g){o.dispatchEvent(u(g,new p("onmouseout")))}),e.event.on(this._domElement,"click",function(g){o.dispatchEvent(u(g,new p("onclick")))})},h})}(He)),He.exports}var Ai=ki();const cr=et(Ai);var kr=function(i,t,e){t=Ri(t);var r=i.pointToPixel(t.getNorthEast()),n=i.pointToPixel(t.getSouthWest());r.x+=e,r.y-=e,n.x-=e,n.y+=e;var s=i.pixelToPoint(r),a=i.pixelToPoint(n);return new BMap.Bounds(a,s)},Ri=function(i){var t=Ne(i.getNorthEast().lng,-180,180),e=Ne(i.getSouthWest().lng,-180,180),r=Ne(i.getNorthEast().lat,-74,74),n=Ne(i.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,r))},Ne=function(i,t,e){return t&&(i=Math.max(i,t)),e&&(i=Math.min(i,e)),i},Ar=function(i){return Object.prototype.toString.call(i)==="[object Array]"},Rr=function(i,t){var e=-1;if(Ar(t)){if(t.indexOf)e=t.indexOf(i);else for(var r=0,n;n=t[r];r++)if(n===i){e=r;break}}return e},B=function(i,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(i){this._map=i,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var r=this;this._map.addEventListener("zoomend",function(){r._redraw()}),this._map.addEventListener("moveend",function(){r._redraw()});var n=e.markers;Ar(n)&&this.addMarkers(n)}};B.prototype.addMarkers=function(i){if(i.length){for(var t=0,e=i.length;t<e;t++)this._pushMarkerTo(i[t]);this._createClusters()}};B.prototype._pushMarkerTo=function(i){var t=Rr(i,this._markers);t===-1&&(i.isInCluster=!1,this._markers.push(i))};B.prototype.addMarker=function(i){this._pushMarkerTo(i),this._createClusters()};B.prototype._createClusters=function(){var i=this._map.getBounds();if(i.getCenter()){for(var t=kr(this._map,i,this._gridSize),e=0,r;r=this._markers[e];e++)!r.isInCluster&&t.containsPoint(r.getPosition())&&this._addToClosestCluster(r);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}};B.prototype._addToClosestCluster=function(i){var t=4e6,e=null;i.getPosition();for(var r=0,n;n=this._clusters[r];r++){var s=n.getCenter();if(s){var a=this._map.getDistance(s,i.getPosition());a<t&&(t=a,e=n)}}if(e&&e.isMarkerInClusterBounds(i))e.addMarker(i);else{var n=new X(this);n.addMarker(i),this._clusters.push(n)}};B.prototype._clearLastClusters=function(){for(var i=0,t;t=this._clusters[i];i++)t.remove();this._clusters=[],this._removeMarkersFromCluster()};B.prototype._removeMarkersFromCluster=function(){for(var i=0,t;t=this._markers[i];i++)t.isInCluster=!1};B.prototype._removeMarkersFromMap=function(){for(var i=0,t;t=this._markers[i];i++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}};B.prototype._removeMarker=function(i){var t=Rr(i,this._markers);return t===-1?!1:(this._map.removeOverlay(i),this._markers.splice(t,1),!0)};B.prototype.removeMarker=function(i){var t=this._removeMarker(i);return t&&(this._clearLastClusters(),this._createClusters()),t};B.prototype.removeMarkers=function(i){for(var t=!1,e=0;e<i.length;e++){var r=this._removeMarker(i[e]);t=t||r}return t&&(this._clearLastClusters(),this._createClusters()),t};B.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]};B.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()};B.prototype.getGridSize=function(){return this._gridSize};B.prototype.setGridSize=function(i){this._gridSize=i,this._redraw()};B.prototype.getMaxZoom=function(){return this._maxZoom};B.prototype.setMaxZoom=function(i){this._maxZoom=i,this._redraw()};B.prototype.getZIndex=function(){return this._zIndex};B.prototype.setZIndex=function(i){this._zIndex!=i&&(this.zIndex=i,this._redraw())};B.prototype.getStyles=function(){return this._styles};B.prototype.setStyles=function(i){this._styles=i,this._redraw()};B.prototype.getMinClusterSize=function(){return this._minClusterSize};B.prototype.setMinClusterSize=function(i){this._minClusterSize=i,this._redraw()};B.prototype.isAverageCenter=function(){return this._isAverageCenter};B.prototype.getMap=function(){return this._map};B.prototype.getMarkers=function(){return this._markers};B.prototype.getClustersCount=function(){for(var i=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&i++;return i};B.prototype._textCalculator=function(i){return i.length.toString()};B.prototype._stylesIndexCalculator=null;B.prototype.setTextCalculator=function(i){this._textCalculator=i};B.prototype.setStylesIndexCalculator=function(i){this._stylesIndexCalculator=i};function X(i){var t=this;this._markerClusterer=i,this._map=i.getMap(),this._minClusterSize=i.getMinClusterSize(),this._isAverageCenter=i.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new cr(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:i._zIndex}),this._clusterMarker.getStyleByText=function(e,r){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,r.length);return r[n]}return cr.prototype.getStyleByText.call(this,e,r)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}X.prototype.addMarker=function(i){if(this.isMarkerInCluster(i))return!1;if(!this._center)this._center=i.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+i.getPosition().lat)/t,r=(this._center.lng*(t-1)+i.getPosition().lng)/t;this._center=new BMap.Point(r,e),this.updateGridBounds()}return i.isInCluster=!0,this._markers.push(i),!0};X.prototype.render=function(){var i=this._markers.length;if(i<this._minClusterSize)for(var t=0;t<i;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()};X.prototype.isMarkerInCluster=function(i){if(this._markers.indexOf)return this._markers.indexOf(i)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===i)return!0;return!1};X.prototype.isMarkerInClusterBounds=function(i){return this._gridBounds.containsPoint(i.getPosition())};X.prototype.isReal=function(i){return this._isReal};X.prototype.updateGridBounds=function(){var i=new BMap.Bounds(this._center,this._center);this._gridBounds=kr(this._map,i,this._markerClusterer.getGridSize())};X.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var i=0,t;t=this._markers[i];i++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))};X.prototype.remove=function(){for(var i=0,t;t=this._markers[i];i++){var e=this._markers[i].getLabel();this._markers[i].getMap()&&this._map.removeOverlay(this._markers[i]),this._markers[i].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers};X.prototype.getBounds=function(){for(var i=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)i.extend(e.getPosition());return i};X.prototype.getCenter=function(){return this._center};var Xe;(i=>{function t(r){return{url:r.url,size:new BMap.Size(r.size.width,r.size.height),anchor:r.anchor&&new BMap.Size(r.anchor.x,r.anchor.y),offset:r.offset&&new BMap.Size(r.offset.x,r.offset.y),textColor:r.textColor,textSize:r.textSize}}i.toBaidu=t;function e(r){return{url:r.url,width:r.size.width,height:r.size.height,anchor:r.anchor&&[r.anchor.y,r.anchor.x],backgroundPosition:r.offset&&`${r.offset.x} ${r.offset.y}`,textColor:r.textColor,textSize:r.textSize}}i.toGoogle=e})(Xe||(Xe={}));class qt{constructor(t){this.map=t,O.noop()}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Dr extends qt{constructor(e,r){var s;super(e);m(this,"inner");this.inner=new B(e.innerMap,{gridSize:r.gridSize,maxZoom:r.maxZoom,minClusterSize:r.minClusterSize,isAverageCenter:r.averageCenter,styles:(s=r.styles)==null?void 0:s.map(a=>Xe.toBaidu(a)),zIndex:r.zIndex});const n=r.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((a,h)=>n(a.length,h)),r.markers&&this.addMarkers(r.markers)}recreate(){this.inner._redraw()}}class zr extends qt{constructor(e,r){var s,a;super(e);m(this,"inner");this.inner=new Bi(e.innerMap,(s=r.markers)==null?void 0:s.map(h=>h.innerOverlay),{gridSize:r.gridSize,maxZoom:r.maxZoom,minimumClusterSize:r.minClusterSize,averageCenter:r.averageCenter,styles:(a=r.styles)==null?void 0:a.map(h=>Xe.toGoogle(h)),zIndex:r.zIndex});const n=r.stylesIndexCalculator;n&&this.inner.setCalculator((h,o)=>({text:h.length,index:n(h.length,o)+1}))}recreate(){this.inner.repaint()}}class Yt{constructor(){O.noop()}}class $r extends Yt{constructor(e,r){super();m(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,r){return this.searchImpl(e,r instanceof x?r.toGoogle(this.map.coordType):r??this.map.innerMap.getCenter())}searchInBounds(e,r){return this.searchImpl(e,r.toGoogle(this.map.coordType))}searchNearBy(e,r,n){return this.searchImpl(e,{center:r.toGoogle(this.map.coordType),radius:n})}searchImpl(e,r){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:r},(a,h)=>{switch(h){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(a??[]).map(c=>Pr(c,this.map));n(o);break}default:s(new Error(`status: ${h}`));break}})})}}class Gr extends Yt{constructor(e,r){super();m(this,"searchRequestMap",new Map);m(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,r){return this.newSearch(r instanceof x?r.toBaidu(this.map.coordType):r??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,r){return this.newSearch(void 0,n=>{n.searchInBounds(e,r.toBaidu(this.map.coordType))})}searchNearBy(e,r,n){return this.newSearch(void 0,s=>{s.searchNearby(e,r.toBaidu(this.map.coordType),n)})}newSearch(e,r){return new Promise((n,s)=>{const a=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:h=>{Array.isArray(h)&&O.throwUnsupported("当前只支持一次搜索一条数据");const o=a.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let p=0;p<h.getCurrentNumPois();p++){const u=h.getPoi(p);c.push({id:u.uid,city:u.city,country:"",position:x.fromBaidu(u.point,this.map.coordType),province:u.province,title:u.title,address:u.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});r(a)})}}class Kt{constructor(t,e){m(this,"onData");m(this,"onError");this.map=t,this.input=e,O.noop()}setSearchListener(t,e){return this.onData&&O.throwError("setSearchListener只能调用一次"),this.onData=t,this.onError=e,O.noop}}class Nr extends Kt{constructor(e,r){super(e,r.input);m(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(r.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,r){return super.setSearchListener(e,r),vr(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>Pr(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Zr extends Kt{constructor(e,r){super(e,r.input);m(this,"autocomplete");m(this,"placesService");this.autocomplete=e.createAutocomplete({input:r.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,r){return super.setSearchListener(e,r),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Wr=(i=>(i[i.WORLD=1]="WORLD",i[i.STATE=5]="STATE",i[i.CITY=10]="CITY",i[i.STREET=15]="STREET",i[i.BUILDING=20]="BUILDING",i))(Wr||{});class ut{constructor(t){m(this,"latestInfoWindow");m(this,"delegate",O.lateinit());this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Rt,dr;function Di(){if(dr)return Rt;dr=1;var i=function(d){return t(d)&&!e(d)};function t(l){return!!l&&typeof l=="object"}function e(l){var d=Object.prototype.toString.call(l);return d==="[object RegExp]"||d==="[object Date]"||s(l)}var r=typeof Symbol=="function"&&Symbol.for,n=r?Symbol.for("react.element"):60103;function s(l){return l.$$typeof===n}function a(l){return Array.isArray(l)?[]:{}}function h(l,d){return d.clone!==!1&&d.isMergeableObject(l)?M(a(l),l,d):l}function o(l,d,f){return l.concat(d).map(function(v){return h(v,f)})}function c(l,d){if(!d.customMerge)return M;var f=d.customMerge(l);return typeof f=="function"?f:M}function p(l){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(l).filter(function(d){return Object.propertyIsEnumerable.call(l,d)}):[]}function u(l){return Object.keys(l).concat(p(l))}function g(l,d){try{return d in l}catch{return!1}}function y(l,d){return g(l,d)&&!(Object.hasOwnProperty.call(l,d)&&Object.propertyIsEnumerable.call(l,d))}function _(l,d,f){var v={};return f.isMergeableObject(l)&&u(l).forEach(function(w){v[w]=h(l[w],f)}),u(d).forEach(function(w){y(l,w)||(g(l,w)&&f.isMergeableObject(d[w])?v[w]=c(w,f)(l[w],d[w],f):v[w]=h(d[w],f))}),v}function M(l,d,f){f=f||{},f.arrayMerge=f.arrayMerge||o,f.isMergeableObject=f.isMergeableObject||i,f.cloneUnlessOtherwiseSpecified=h;var v=Array.isArray(d),w=Array.isArray(l),P=v===w;return P?v?f.arrayMerge(l,d,f):_(l,d,f):h(d,f)}M.all=function(d,f){if(!Array.isArray(d))throw new Error("first argument should be an array");return d.reduce(function(v,w){return M(v,w,f)},{})};var b=M;return Rt=b,Rt}var zi=Di();const Hr=et(zi);/*!
|
|
3
3
|
* isobject <https://github.com/jonschlinkert/isobject>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
6
|
* Released under the MIT License.
|
|
7
|
-
*/function
|
|
7
|
+
*/function $i(i){return i!=null&&typeof i=="object"&&Array.isArray(i)===!1}/*!
|
|
8
8
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
11
11
|
* Released under the MIT License.
|
|
12
|
-
*/function tr(i){return bi(i)===!0&&Object.prototype.toString.call(i)==="[object Object]"}function Ir(i){var t,e;return!(tr(i)===!1||(t=i.constructor,typeof t!="function")||(e=t.prototype,tr(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}exports.Objects=void 0;(i=>{function t(u,m){return u.reduce((p,v)=>(p[m(v)]=v,p),{})}i.fromArray=t;function e(u){return u.reduce((m,p)=>(m[p[0]]=p[1],m),{})}i.fromEntries=e;function r(u){return JSON.stringify(u,(m,p)=>typeof p=="object"&&Object.getPrototypeOf(p)!==Object.prototype?p.toString!==Object.prototype.toString?p.toString():`[object ${Object.getPrototypeOf(p).constructor.name}]`:p)}i.toJsonSafely=r;function n(u){Ir(u)&&Object.keys(u).forEach(m=>{u[m]===void 0?delete u[m]:n(u[m])})}i.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,m,p){let v=u[m];return v===void 0&&(v=p(),u[m]=v),v}i.putIfAbsent=s;function a(u,...m){const p=rr(m),v={};for(const T in u)p(T)||(v[T]=u[T]);return v}i.omit=a;function d(u,...m){const p=rr(m),v={};for(const T in u)p(T)&&(v[T]=u[T]);return v}i.pick=d;function o(u,m){const p=typeof m=="string"?m.split("."):m;let v=u;for(const T of p){if(v==null)return;v=v[T]}return v}i.get=o;function c(u,m){const p=typeof m=="string"?m.split("."):m,v=o(u,p.slice(0,-1)),T=p[p.length-1];v!=null&&delete v[T]}i.del=c})(exports.Objects||(exports.Objects={}));function rr(i){if(i.length<=4)return i.includes.bind(i);{const t=new Set(i);return t.has.bind(t)}}exports.Objects.toJsonSafely;const kr=["single","multi"];var Y=(i=>(i.auto="auto",i.none="none",i.greedy="greedy",i.cooperative="cooperative",i))(Y||{});exports.MapOptions=void 0;(i=>{function t(e){exports.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const r={center:x.ZERO,zoom:5};return Sr(r,e||{},{isMergeableObject:Ir})}i.create=t})(exports.MapOptions||(exports.MapOptions={}));class Ht{constructor(t,e){g(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class st extends Ht{constructor(t,e,r){super(t,e),this.map=r}createDelegate(){return new le(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class Pe extends Ht{constructor(t,e,r){super(t,e),this.map=r}createDelegate(){return new we(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Oe=class Oe extends Pe{constructor(t,e,r,n){super(t,e,r),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Oe.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Oe.OPACITY_DELTA)}};g(Oe,"OPACITY_DELTA",.001);let F=Oe;class ot extends st{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class at extends F{constructor(){super(...arguments);g(this,"prevCenter");g(this,"prevRadius");g(this,"isDoingSetCenter",!1);g(this,"isDoingSetRadius",!1);g(this,"eventHubDelegate");g(this,"onRadiusChanged",()=>{var r;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(r=this.eventHubDelegate)==null||r.notify({type:"radius-changed",target:this}),this.prevRadius=e)});g(this,"onCenterChanged",()=>{var r;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(r=this.eventHubDelegate)==null||r.notify({type:"center-changed",target:this}),this.prevCenter=e)});g(this,"resetEditableTimeoutId")}static create(e){const r=this.coordType,n=new BMap.Circle(e.center.toBaidu(r),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0}),s=new at(n,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new qe(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return x.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class lt extends ot{static create(t){const e=this.coordType,r=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new lt(r,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return x.fromGoogle(this.innerOverlay.getCenter()??re.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}exports.Point=void 0;(i=>{i.ZERO={x:0,y:0}})(exports.Point||(exports.Point={}));let Pt;function Mi(i,t,e,r,n,s){return Pt||(Pt=Ci()),new Pt(i,t,e,r,n,s)}function Ci(){sr();const i=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(r,n=i,s=exports.Point.ZERO,a,d=654,o=""){super();g(this,"container");g(this,"border");g(this,"inner");g(this,"map");g(this,"marker");this.content=r,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const u=p=>p.stopPropagation();this.container.onclick=u,this.container.ondblclick=u,this.container.oncontextmenu=u,this.container.onmousedown=u,this.container.onmousemove=u,this.container.onmousewheel=u,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const m=document.createElement("span");m.className=c+"__close",m.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(r),this.border.appendChild(this.inner),this.border.appendChild(m),this.container.appendChild(this.border),a&&this.setZIndex(a),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(r){return this.map=r,r.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const r=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(r),s=n.x+this.offset.x,a=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${a}px`}open(r,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||r.addOverlay(this))}attachMarker(r){r.__info_box__=this,r.addEventListener("dragging",this.onMarkerPositionChanged),r.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(r){r.__info_box__=void 0,r.removeEventListener("dragging",this.onMarkerPositionChanged),r.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(r){this.container.style.zIndex=`${r}`}setMaxWidth(r){this.border.style.maxWidth=`${r}px`}setPosition(r){this.marker||(this.position=r,this.draw())}getPosition(){return this.position}setOffset(r){this.offset=r,this.draw()}getOffset(){return this.offset}}}class ht{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class ct extends ht{constructor(t,e,r){super(new we(t,e)),this.inner=t,this.map=e,this.state=r}static create(t){const e=t.position||x.ZERO,r=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new ct(r,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||x.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&x.fromBaidu(t,this.map.coordType)||this.state.position||x.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class dt extends ht{constructor(e,r){super(new le(e,r));g(this,"eventHub",new lr);g(this,"isOpened",!1);this.inner=e,this.map=r,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const r=e.position||x.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:r.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new dt(n,this)}isOpen(){return this.isOpened}addEventListener(e,r){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,r);return}super.addEventListener(e,r)}removeEventListener(e,r){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,r);return}super.removeEventListener(e,r)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const r=this.map.getLatestInfoWindow();r&&r.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return x.fromGoogle(this.inner.getPosition()??re.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class ut extends Pe{constructor(t,e,r){super(t,e,r),this.baiduMap=r}static create(t){var n;const e=this.coordType,r=Mi(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new ut(r,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return x.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class pt extends ht{constructor(t,e,r){super(new le(t,r)),this.inner=t,this.coordType=e,this.map=r}static create(t){var s;const e=this.coordType,r=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&r.addListener("domready",()=>{var d;const a=(d=t.content.parentElement)==null?void 0:d.parentElement;a&&a.className.includes("gm-style-iw-c")&&!a.className.includes(n)&&(a.className+=` ${n}`)}),new pt(r,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return x.fromGoogle(this.inner.getPosition()??re.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),r=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,r)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}exports.Strings=void 0;(i=>{function t(s,a){if(s!==void 0)return Object.values(a).includes(s)?s:void 0}i.toEnumOrNull=t;function e(s){return s.split(`
|
|
12
|
+
*/function ur(i){return $i(i)===!0&&Object.prototype.toString.call(i)==="[object Object]"}function jr(i){var t,e;return!(ur(i)===!1||(t=i.constructor,typeof t!="function")||(e=t.prototype,ur(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}exports.Objects=void 0;(i=>{function t(p,u){return p.reduce((g,y)=>(g[u(y)]=y,g),{})}i.fromArray=t;function e(p){return p.reduce((u,g)=>(u[g[0]]=g[1],u),{})}i.fromEntries=e;function r(p){return JSON.stringify(p,(u,g)=>typeof g=="object"&&Object.getPrototypeOf(g)!==Object.prototype?g.toString!==Object.prototype.toString?g.toString():`[object ${Object.getPrototypeOf(g).constructor.name}]`:g)}i.toJsonSafely=r;function n(p){jr(p)&&Object.keys(p).forEach(u=>{p[u]===void 0?delete p[u]:n(p[u])})}i.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(p,u,g){let y=p[u];return y===void 0&&(y=g(),p[u]=y),y}i.putIfAbsent=s;function a(p,...u){const g=pr(u),y={};for(const _ in p)g(_)||(y[_]=p[_]);return y}i.omit=a;function h(p,...u){const g=pr(u),y={};for(const _ in p)g(_)&&(y[_]=p[_]);return y}i.pick=h;function o(p,u){const g=typeof u=="string"?u.split("."):u;let y=p;for(const _ of g){if(y==null)return;y=y[_]}return y}i.get=o;function c(p,u){const g=typeof u=="string"?u.split("."):u,y=o(p,g.slice(0,-1)),_=g[g.length-1];y!=null&&delete y[_]}i.del=c})(exports.Objects||(exports.Objects={}));function pr(i){if(i.length<=4)return i.includes.bind(i);{const t=new Set(i);return t.has.bind(t)}}exports.Objects.toJsonSafely;const Vr=["single","multi"];var J=(i=>(i.auto="auto",i.none="none",i.greedy="greedy",i.cooperative="cooperative",i))(J||{});exports.MapOptions=void 0;(i=>{function t(e){exports.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const r={center:x.ZERO,zoom:5};return Hr(r,e||{},{isMergeableObject:jr})}i.create=t})(exports.MapOptions||(exports.MapOptions={}));class Xt{constructor(t,e){m(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class pt extends Xt{constructor(t,e,r){super(t,e),this.map=r}createDelegate(){return new de(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class ze extends Xt{constructor(t,e,r){super(t,e),this.map=r}createDelegate(){return new Se(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Ie=class Ie extends ze{constructor(t,e,r,n){super(t,e,r),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Ie.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Ie.OPACITY_DELTA)}};m(Ie,"OPACITY_DELTA",.001);let Y=Ie;class gt extends pt{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class mt extends Y{constructor(){super(...arguments);m(this,"prevCenter");m(this,"prevRadius");m(this,"isDoingSetCenter",!1);m(this,"isDoingSetRadius",!1);m(this,"eventHubDelegate");m(this,"onRadiusChanged",()=>{var r;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(r=this.eventHubDelegate)==null||r.notify({type:"radius-changed",target:this}),this.prevRadius=e)});m(this,"onCenterChanged",()=>{var r;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(r=this.eventHubDelegate)==null||r.notify({type:"center-changed",target:this}),this.prevCenter=e)});m(this,"resetEditableTimeoutId")}static create(e){const r=this.coordType,n=new BMap.Circle(e.center.toBaidu(r),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+Y.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+Y.OPACITY_DELTA:void 0}),s=new mt(n,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new rt(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return x.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class ft extends gt{static create(t){const e=this.coordType,r=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new ft(r,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return x.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}exports.Point=void 0;(i=>{i.ZERO={x:0,y:0}})(exports.Point||(exports.Point={}));let Dt;function Gi(i,t,e,r,n,s){return Dt||(Dt=Ni()),new Dt(i,t,e,r,n,s)}function Ni(){yr();const i=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(r,n=i,s=exports.Point.ZERO,a,h=654,o=""){super();m(this,"container");m(this,"border");m(this,"inner");m(this,"map");m(this,"marker");this.content=r,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const p=g=>g.stopPropagation();this.container.onclick=p,this.container.ondblclick=p,this.container.oncontextmenu=p,this.container.onmousedown=p,this.container.onmousemove=p,this.container.onmousewheel=p,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const u=document.createElement("span");u.className=c+"__close",u.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(r),this.border.appendChild(this.inner),this.border.appendChild(u),this.container.appendChild(this.border),a&&this.setZIndex(a),this.setMaxWidth(h),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(r){return this.map=r,r.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const r=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(r),s=n.x+this.offset.x,a=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${a}px`}open(r,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||r.addOverlay(this))}attachMarker(r){r.__info_box__=this,r.addEventListener("dragging",this.onMarkerPositionChanged),r.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(r){r.__info_box__=void 0,r.removeEventListener("dragging",this.onMarkerPositionChanged),r.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(r){this.container.style.zIndex=`${r}`}setMaxWidth(r){this.border.style.maxWidth=`${r}px`}setPosition(r){this.marker||(this.position=r,this.draw())}getPosition(){return this.position}setOffset(r){this.offset=r,this.draw()}getOffset(){return this.offset}}}class yt{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class vt extends yt{constructor(t,e,r){super(new Se(t,e)),this.inner=t,this.map=e,this.state=r}static create(t){const e=t.position||x.ZERO,r=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new vt(r,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||x.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&x.fromBaidu(t,this.map.coordType)||this.state.position||x.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class _t extends yt{constructor(e,r){super(new de(e,r));m(this,"eventHub",new Mr);m(this,"isOpened",!1);this.inner=e,this.map=r,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const r=e.position||x.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:r.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new _t(n,this)}isOpen(){return this.isOpened}addEventListener(e,r){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,r);return}super.addEventListener(e,r)}removeEventListener(e,r){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,r);return}super.removeEventListener(e,r)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const r=this.map.getLatestInfoWindow();r&&r.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return x.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class Mt extends ze{constructor(t,e,r){super(t,e,r),this.baiduMap=r}static create(t){var n;const e=this.coordType,r=Gi(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new Mt(r,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return x.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class bt extends yt{constructor(t,e,r){super(new de(t,r)),this.inner=t,this.coordType=e,this.map=r}static create(t){var s;const e=this.coordType,r=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&r.addListener("domready",()=>{var h;const a=(h=t.content.parentElement)==null?void 0:h.parentElement;a&&a.className.includes("gm-style-iw-c")&&!a.className.includes(n)&&(a.className+=` ${n}`)}),new bt(r,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return x.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),r=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,r)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}exports.Strings=void 0;(i=>{function t(s,a){if(s!==void 0)return Object.values(a).includes(s)?s:void 0}i.toEnumOrNull=t;function e(s){return s.split(`
|
|
13
13
|
`).map(a=>a.trim()).join(`
|
|
14
|
-
`)}i.trimIndent=e;function r(s){return s.replace(/([^A-Z]?)([A-Z])/g,(a,
|
|
15
|
-
为了保证Label的位置正确, 请将SymbolIcon(${
|
|
16
|
-
${JSON.stringify({x:c,y:
|
|
17
|
-
`))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,a=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,a-=this.iconAnchor.height),r&&(s+=r.width,a+=r.height),this.innerOverlay.setOffset(new BMap.Size(s,a)),this.icon=e,this.iconAnchor=r}}class Vt extends st{static create(t){var n;const e=this.coordType,r=Ti(ce.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new Vt(r,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(ce.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?x.fromGoogle(t,this.coordType):x.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??exports.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const xe={toGoogle:i=>"url"in i?exports.Icon.toGoogle(i):exports.SymbolIcon.toGoogle(i),toBaidu:i=>"url"in i?exports.Icon.toBaidu(i):exports.SymbolIcon.toBaidu(i)};exports.Icon=void 0;(i=>{function t(r){return{url:r.url,size:new google.maps.Size(r.size.width,r.size.height),origin:r.origin&&new google.maps.Point(r.origin.x,r.origin.y),scaledSize:r.scaledSize&&new google.maps.Size(r.scaledSize.width,r.scaledSize.height),anchor:r.anchor&&new google.maps.Point(r.anchor.x,r.anchor.y),labelOrigin:r.labelOrigin&&new google.maps.Point(r.labelOrigin.x,r.labelOrigin.y)}}i.toGoogle=t;function e(r){const n=new BMap.Icon(r.url,new BMap.Size(r.size.width,r.size.height),{imageOffset:r.origin&&new BMap.Size(-r.origin.x,-r.origin.y),imageSize:r.scaledSize&&new BMap.Size(r.scaledSize.width,r.scaledSize.height),anchor:r.anchor?new BMap.Size(r.anchor.x,r.anchor.y):new BMap.Size(r.size.width/2,r.size.height)});return n.__icon__=r,n}i.toBaidu=e})(exports.Icon||(exports.Icon={}));exports.SymbolIcon=void 0;(i=>{function t(r){return{path:typeof r.path=="string"?r.path:r.path.google(),anchor:r.anchor&&new google.maps.Point(r.anchor.x,r.anchor.y),fillColor:r.fillColor,fillOpacity:r.fillOpacity,scale:r.scale,rotation:r.rotation,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight}}i.toGoogle=t;function e(r){const n=new BMap.Symbol(typeof r.path=="string"?r.path:r.path.baidu(),{anchor:r.anchor&&new BMap.Size(r.anchor.x,r.anchor.y),fillColor:r.fillColor,fillOpacity:r.fillOpacity,scale:r.scale,rotation:r.rotation,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight});return n.__icon__=r,n}i.toBaidu=e})(exports.SymbolIcon||(exports.SymbolIcon={}));const wi={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};exports.IconSequence=void 0;(i=>{function t(r){return{icon:exports.SymbolIcon.toGoogle(r.icon),offset:r.offset,repeat:r.repeat,fixedRotation:r.fixedRotation}}i.toGoogle=t;function e(r){return new BMap.IconSequence(exports.SymbolIcon.toBaidu(r.icon),r.offset,r.repeat??"",r.fixedRotation)}i.toBaidu=e})(exports.IconSequence||(exports.IconSequence={}));const It={toBaidu:i=>{const t=["baidu-marker-label"];i.className&&t.push(i.className);const e=new BMap.Label(`<span class="${t.join(" ")}">${i.text}</span>`);return e.setStyle({border:"0px",padding:"0px",backgroundColor:"unset",color:i.color??"black",fontSize:i.fontSize??"14px",fontWeight:i.fontWeight??"",fontFamily:i.fontFamily??"Roboto, Arial, sans-serif"}),e},toGoogle:i=>i};class de extends Pe{constructor(t,e,r,n){super(t,e,r),this.state=n}static create(t){const e=this.coordType,r=t.icon,n={title:t.title,icon:r&&xe.toBaidu(r),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const a=t.clickable===void 0?!0:t.clickable,d=!!t.draggable,o=new de(s,e,this,{clickable:a,draggable:d,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible);return t.label&&o.setLabel(t.label),o}getPosition(){return x.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=xe.toBaidu(t);this.innerOverlay.setIcon(e),this._updateMarkerLabelOffset();const r=this.getLabelOverlay();r&&r.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.innerOverlay.getLabel();e&&this.map.innerMap.removeOverlay(e),this.innerOverlay.setLabel(It.toBaidu(t)),this._updateMarkerLabelOffset()}_updateMarkerLabelOffset(){const t=this.innerOverlay.getIcon(),e=t.__icon__,r=this.innerOverlay.getLabel();if(r&&t&&!e&&t.imageUrl==="https://api.map.baidu.com/images/marker_red_sprite.png"){r.setOffset(new BMap.Size(9,9));return}!r||!e||!("size"in e)||r.setOffset(e.labelOrigin?new BMap.Size(e.labelOrigin.x,e.labelOrigin.y):new BMap.Size(e.size.width/2,e.size.height/2))}attachLabelOverlay(t){const e=this.getLabelOverlay();process.env.NODE_ENV!=="production"&&this.innerOverlay.getLabel()&&!e&&console.warn("当前label不是LabelOverlay, 可能是混用 MarkerLabel/marker.setLabel() 和 LabelOverlay/<tg-label> 导致的, 请不要混用他们两者",this.innerOverlay.getLabel()),e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabelOverlay(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class gt extends st{constructor(){super(...arguments);g(this,"label");g(this,"labelPositionListener");g(this,"labelVisibleListener");g(this,"labelMapChangedListener")}static create(e){const r=this.coordType,n=e.icon,s={position:e.position.toGoogle(r),title:e.title,label:e.label&&It.toGoogle(e.label),zIndex:e.zIndex,visible:e.visible,icon:n&&xe.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new gt(new google.maps.Marker(s),r,this)}getPosition(){return x.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(xe.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){this.innerOverlay.setLabel(It.toGoogle(e))}attachLabelOverlay(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const r=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),r(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",r),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class mt extends F{constructor(){super(...arguments);g(this,"eventHubDelegate");g(this,"prevPath");g(this,"isDoingSetPath",!1);g(this,"onLineUpdate",()=>{var r;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(r=this.eventHubDelegate)==null||r.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new qe(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class ft extends mt{constructor(){super(...arguments);g(this,"pathEditedEventType","path-edited")}static create(e){var s,a;const r=this.coordType,n=new BMap.Polyline(e.path.map(d=>d.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(exports.IconSequence.toBaidu)});return new ft(n,r,this,{editable:!!e.editable,symbolIcons:(a=e.icons)==null?void 0:a.map(d=>d.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>x.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(r=>r.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const a=s.getIcon();if(!(a instanceof BMap.Symbol))return!1;const d=a;return d.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(d.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class yt extends ot{constructor(){super(...arguments);g(this,"pathChangedListeners");g(this,"eventHubDelegate")}static create(e){var s;const r=this.coordType,n=new google.maps.Polyline({path:e.path.map(a=>a.toGoogle(r)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(exports.IconSequence.toGoogle)});return new yt(n,r,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},r=this.innerOverlay.getPath();this.pathChangedListeners=exports.MVCArrays.listenChanged(r,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(r=>r.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new qe(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(r=>{e.push(x.fromGoogle(r,this.coordType))}),e}setPath(e){var r;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(r=this.eventHubDelegate)!=null&&r.hasListener("path-edited")&&this.setupPathChangedListeners()}}class vt extends mt{constructor(){super(...arguments);g(this,"pathEditedEventType","paths-edited")}static create(e){const r=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(a=>a.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0});return new vt(s,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>x.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(r=>r.toBaidu(this.coordType)))}}class _t extends ot{constructor(){super(...arguments);g(this,"pathChangedListeners");g(this,"eventHubDelegate")}static create(e){const r=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(a=>a.toGoogle(r))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new _t(n,r,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},r=this.innerOverlay.getPaths();this.pathChangedListeners=[],r.forEach(n=>{this.pathChangedListeners.push(...exports.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(r=>r.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new qe(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),r=[];return e.forEach(n=>{const s=[];r.push(s),n.forEach(a=>{s.push(x.fromGoogle(a,this.coordType))})}),r}setPaths(e){var r;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(r=this.eventHubDelegate)!=null&&r.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class bt extends mt{constructor(e,r,n,s){super(e,r,n,s);g(this,"pathEditedEventType","bounds-changed");g(this,"isDoingUpdateRectangle",!1);g(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const r=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const a=n.length;if(r.length===4)if(a>r.length){for(let o=0;o<a;o++)if(r[o]==null||!qt.equals(n[o],r[o])){const c=n[(o-2+a)%a],u=n[(o-1+a)%a],m=n[o],p=n[(o+1)%a],v=n[(o+2)%a];let T;u.lat===p.lat?T=new BMap.Point(u.lng,m.lat):u.lng===p.lng?T=new BMap.Point(m.lng,u.lat):T=m,s=[c,v,T];break}}else if(a===r.length){for(let o=0;o<a;o++)if(!qt.equals(n[o],r[o])){s=[n[o],n[(o+2)%4]];break}}else a<r.length;const d=U.fromArray(s.map(o=>x.fromBaidu(o,this.coordType)));d&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(d.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const r=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+F.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+F.OPACITY_DELTA:void 0});return new bt(n,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return U.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const r=e.toRectArray();this.innerOverlay.getPath().length===r.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(r.map(n=>n.toBaidu(this.coordType)))}}class Mt extends ot{static create(t){const e=this.coordType,r=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new Mt(r,e,this)}getBounds(){return U.fromGoogle(this.innerOverlay.getBounds()??re.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const ie=1;class xi extends nt{constructor(e,r){var n;super(e);g(this,"buildInMapTypeId2BIMT");g(this,"baiduMapType2BIMT");g(this,"map");g(this,"createLabel",jt.create);g(this,"createCircle",at.create);g(this,"createPolygon",vt.create);g(this,"createPolyline",ft.create);g(this,"createRectangle",bt.create);g(this,"createInfoWindow",ct.create);g(this,"createInfoBox",ut.create);g(this,"createMarker",de.create);g(this,"createMapTypeControl",Xe.create);g(this,"createZoomControl",rt.create);g(this,"createStreetViewControl",et.create);g(this,"createScaleControl",Je.create);this.buildInMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(N.prototype.getId),this.baiduMapType2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(N.prototype.asBaiduMapType),ri(),this.map=new BMap.Map(e,{minZoom:r.minZoom&&r.minZoom+ie,maxZoom:r.maxZoom&&r.maxZoom+ie,mapType:r.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(r.center.toBaidu(this.coordType),r.zoom+ie),this.setGestureHandling(r.gestureHandling),r.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),r.mapStyle&&this.map.setMapStyleV2(r.mapStyle.baidu),this.setEventTargetDelegate(new we(this.map,this)),this.map.addEventListener("addoverlay",s=>{const a=s.target.__info_box__;a&&(console.debug("add:info-box",a),this.map.addOverlay(a))}),this.map.addEventListener("removeoverlay",s=>{const a=s.target.__info_box__;a&&(console.debug("remove:info-box",a),this.map.removeOverlay(a))})}setGestureHandling(e=Y.auto){switch(e===Y.auto&&(e=this.element.parentElement&&Bt.isScrollable(this.element.parentElement)?Y.cooperative:Y.greedy),e){case Y.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case Y.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case Y.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,r){if(e==="center-changed"){super.addEventListener("movestart",r),super.addEventListener("moving",r),super.addEventListener("moveend",r),super.addEventListener("zoomend",r);return}super.addEventListener(e,r)}removeEventListener(e,r){if(e==="center-changed"){super.removeEventListener("movestart",r),super.removeEventListener("moving",r),super.removeEventListener("moveend",r),super.removeEventListener("zoomend",r);return}super.removeEventListener(e,r)}fromContainerPointToLatLng(e){return x.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return x.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-ie}setZoom(e){return super.setZoom(e+ie)}setMinZoom(e){this.map.setMinZoom(e+ie)}setMaxZoom(e){this.map.setMaxZoom(e+ie)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const r=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(r??C.throwError("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),r=this.baiduMapType2BIMT.get(e);return r||(e.__baidu_map_type__??C.throwError("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:r&&[r.top,r.right,r.bottom,r.left]})}getBounds(){return U.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const r=class extends BMap.Control{constructor(){super(...arguments);g(this,"defaultAnchor",exports.ControlPositionConverter.getBaidu().toValue(e.position));g(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const a=e.onCreateElement();return s.getContainer().appendChild(a),a}};e.inner=new r,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(C.assert(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Or(this,e)}createHeatmap(e){return new _r(this,e)}createAutocomplete(e){return new yr(this,e)}createSearchBox(e){return new Lr(this,e)}createPlacesService(e){return new Er(this,e)}createMapUrls(e){return new We(e)}}class Ei extends nt{constructor(e,r){var s,a;super(e);g(this,"buildInMapTypeId2BIMT");g(this,"googleMapTypeId2BIMT");g(this,"map");g(this,"createLabel",Vt.create);g(this,"createCircle",lt.create);g(this,"createPolygon",_t.create);g(this,"createPolyline",yt.create);g(this,"createRectangle",Mt.create);g(this,"createInfoWindow",dt.create);g(this,"createInfoBox",pt.create);g(this,"createMarker",gt.create);g(this,"createMapTypeControl",ze.create);g(this,"createZoomControl",it.create);g(this,"createStreetViewControl",tt.create);g(this,"createScaleControl",Qe.create);this.mapOptions=r,this.buildInMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(N.prototype.getId),this.googleMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(N.prototype.getGoogleMapTypeId);const n=r.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);this.map=new google.maps.Map(e,{center:r.center.toGoogle((n??exports.MapType.NORMAL).getGoogleCoordType()),zoom:r.zoom,disableDefaultUI:!0,gestureHandling:r.gestureHandling,minZoom:r.minZoom,maxZoom:r.maxZoom,styles:(s=r.mapStyle)==null?void 0:s.google.styles,mapId:(a=r.mapStyle)==null?void 0:a.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new le(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const r=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(r==null||n==null)return x.ZERO;const s=r.fromLatLngToPoint(n.getSouthWest()),a=r.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||a==null||d==null)return x.ZERO;const o=Math.pow(2,d),c=new google.maps.Point(e.x/o+s.x,e.y/o+a.y);return x.fromGoogle(r.fromPointToLatLng(c)??re.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const r=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(r==null||n==null)return exports.Point.ZERO;const s=r.fromLatLngToPoint(n.getSouthWest()),a=r.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||a==null||d==null)return exports.Point.ZERO;const o=Math.pow(2,d),c=r.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?exports.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-a.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return x.fromGoogle(this.map.getCenter()??re.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const r=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(r??C.throwError("理论上来说不可能为空"))}setMapType(e){e instanceof N?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,r=this.googleMapTypeId2BIMT.get(e);return r||(this.map.mapTypes.get(e).__google_map_type__??C.throwError(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){exports.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){this.map.fitBounds(e.toGoogle(this.coordType),r)}getBounds(){const e=this.map.getBounds();return e?U.fromGoogle(e,this.coordType):U.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[exports.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const r=this.map.controls[exports.ControlPositionConverter.getGoogle().toValue(e.position)];exports.MVCArrays.remove(r,e.inner)}}createMarkerClusterer(e){return new wr(this,e)}createHeatmap(e){return new vr(this,e)}createAutocomplete(e){return new fr(this,e)}createSearchBox(e){return new Pr(this,e)}createPlacesService(e){return new xr(this,e)}createMapUrls(e){return new Ze(e)}}const je=["3.0"],Pi={baidu:{version:"3.0",key:""},google:{version:"quarterly",key:"",language:"en-us",libraries:["places","visualization"]},here:{version:je[0],key:""}};let Rr;function Ft(){return Rr||C.throwError("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Dr(i){i!=null&&(Rr=Sr(Pi,i))}class Li extends nt{constructor(e,r){var a;super(e);g(this,"map");g(this,"defaultLayers");this.mapOptions=r;const n=Ft().here;je.includes(n.version)||C.throwError(`不支持${n.version}, HereMap当前只支持如下版本: ${je}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:r.zoom,center:(a=r.center)==null?void 0:a.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return R.wgs84}getCenter(){return x.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,r){throw new Error("Method not implemented.")}fitBounds(e,r){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var V=(i=>(i.google="google",i.baidu="baidu",i.here="here",i))(V||{});exports.TgMapFactory=void 0;(i=>{function t(e,r,n){const s=exports.MapOptions.create(n);switch(e){case"google":return new Ei(r,s);case"baidu":return new xi(r,s);case"here":return new Li(r,s)}}i.createMap=t})(exports.TgMapFactory||(exports.TgMapFactory={}));function Bi(i){throw new Error(`todo: ${i}`)}function Si(i){return i}function $r(i){return i[1]!=null}function zr(i){let t=null;return()=>t??(t=i().catch(e=>(t=null,Promise.reject(e))))}const Ii={};function Gr(i){return exports.Objects.putIfAbsent(Ii,i,()=>zr(()=>ki({type:i,config:Ft()[i]})))()}function ki({type:i,config:t}){const e=window,r=Ai(i);if(exports.Objects.get(e,r))return Promise.resolve();switch(i!==V.here&&!t.key&&C.throwError(`请先配置${i}地图的key`),i){case V.google:return ir(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case V.baidu:return ir(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case V.here:return ye(fe("core",t.version)).then(()=>Promise.all([ye(fe("service",t.version)),ye(fe("mapevents",t.version)),ye(fe("clustering",t.version)),ye(fe("ui",t.version))])).catch(n=>(exports.Objects.del(e,r),Promise.reject(n)));default:C.assertNever(i)}}function fe(i,t=je[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${i}.js`}function Ai(i){switch(i){case V.google:return"google.maps";case V.baidu:return"BMap";case V.here:return"H"}}let Ri=0;function ir(i,t="callback"){return new Promise((e,r)=>{const n=`__callback${Ri++}`;window[n]=e;const s=document.createElement("script");s.src=`${i}&${t}=${n}`,s.onerror=r,document.body.appendChild(s)})}function ye(i){return new Promise((t,e)=>{const r=document.createElement("script");r.src=i,r.onload=t,r.onerror=e,document.body.appendChild(r)})}function Z(i,t){return{type:String,default:t,validator:e=>Object.values(i).includes(e)}}function Nr(i,t){return{type:String,default:t,validator:e=>i.includes(e)}}function G(i){return{type:i,required:!0}}function M(i,t){return{type:i,default:t}}function Di(i){const t={};return Object.entries(i).forEach(([e,r])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?r:s},set(s){this[n]=s}}}),t}const ve={enumerable:!0,configurable:!0,get:C.noop,set:C.noop};function Zr(i){return Object.keys(i).forEach(t=>{const e=i[t];let r=!1;typeof e=="function"?(ve.get=e,ve.set=C.noop,r=!0):typeof e=="object"&&typeof e.get=="function"&&(ve.get=e.get,ve.set=e.set,r=!0),r&&(i[t]=Object.defineProperty(i,t,ve))}),i}function $i(i){return Zr(i)}function Le(){return _.createCommentVNode()}function _e(i,t){const e=i.$options[t];if(e)for(const r of e)r.call(i)}function zi(i,t){for(const e of i)if(e.$options.name===t.name)return e}function Gi(i,t){if(!i.default)return;const e=i.default();for(const r of e)if((r==null?void 0:r.type).name===t.name)return r}function Wr(i,t){const e={},r={},n={};return Object.keys(i).forEach(s=>{s.startsWith("on")?e[exports.Strings.pascal2kebab(s.substring(2))]=i[s]:r[s]=i[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[exports.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:r,listeners:e,listenerProps:n}}function K(i,t){return _.computed(()=>Wr(i,t))}function I(){return Function}const Ni=()=>{let i,t;function e(n){console.log(n),i=n&&n.type,t=Date.now()}function r(n){((n&&n.type)!==i||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:r}},Ct="$map",ue="onCreate",pe="onDestroy",D=_.defineComponent({inject:[Ct],mounted(){_e(this,ue)},beforeUnmount(){_e(this,pe)},methods:{recreate(){_e(this,pe),_e(this,ue)}},render(){return Le()}}),Zi=_.defineComponent({name:"tg-map",provide(){return{[Ct]:_.computed(()=>this.map)}},inheritAttrs:!1,props:{type:Z(V,V.google),center:G(x),centerSyncDelay:M(Number,300),currentCenter:M(x),lastCenter:M(x),zoom:G(Number),infoWindowMode:Nr(kr),gestureHandling:Z(Y),minZoom:M(Number),maxZoom:M(Number),mapStyle:M(Object),mapTypeId:Z(At),mapType:M(Object),hideLogo:M(Boolean),onLoad:I(),"onUpdate:center":I(),"onUpdate:current-center":I(),"onUpdate:last-center":I(),"onUpdate:map-type":I(),"onUpdate:map-type-id":I(),"onUpdate:zoom":I(),onError:I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),centerSyncTimeoutId:void 0}},data(){return{map:C.typed(),isDestroyed:!1}},computed:{propsJson(){return exports.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(i){var t;i&&((t=this.map)==null||t.setGestureHandling(i))},minZoom(i){var t;(t=this.map)==null||t.setMinZoom(i)},maxZoom(i){var t;(t=this.map)==null||t.setMaxZoom(i)},mapStyle(i){var t;(t=this.map)==null||t.setMapStyle(i)},mapTypeId(i){var t;i&&((t=this.map)==null||t.setBuildInMapTypeId(i))},mapType(i){var t;(t=this.map)==null||t.setMapType(i??exports.MapType.NORMAL)}},async mounted(){const i=this.type;try{await Gr(i)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);return}const t=exports.TgMapFactory.createMap(i,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=_.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),Q(this.attrs.listeners,t,["load"]),this.$emit("load",t),_.watch([()=>this.zoom,()=>this.center],([n,s],[a,d])=>{n!==a&&t.setZoom(n),s!==d&&(t.getCenter().equals(s)||t.setCenter(s))}),this.attrs.listenerProps["update:center"]){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),this.attrs.listenerProps["update:zoom"]&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e=this.attrs.listenerProps["update:map-type"],r=this.attrs.listenerProps["update:map-type-id"];(e||r)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),r&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),ee=(i,t)=>{const e=i.__vccOpts||i;for(const[r,n]of t)e[r]=n;return e};function Wi(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",_.mergeProps({class:"tg-map"},i.attrs.binds),[_.createElementVNode("div",{ref:"map",class:_.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${i.type}`]:i.hideLogo})},null,2),_.createCommentVNode("",!0),i.map?_.renderSlot(i.$slots,"default",{key:1}):_.createCommentVNode("",!0),_.renderSlot(i.$slots,"overlay")],16)}const Be=ee(Zi,[["render",Wi]]);function Hi(i){if(i==null)return;let t;if(typeof i=="string"){if(t=+i,Number.isNaN(t))return i}else t=i;return`${t}px`}const ji=_.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:Hi}});function Vi(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(i.$options.name),style:_.normalizeStyle({left:i.dimen(i.left),top:i.dimen(i.topValue),right:i.dimen(i.right),bottom:i.dimen(i.bottom)})},[_.renderSlot(i.$slots,"default")],6)}const Fi=ee(ji,[["render",Vi]]),Ui=_.defineComponent({name:"tg-custom-control",mixins:[D],props:{position:Z(k,k.RIGHT_BOTTOM)},setup(){return{control:C.lateinit()}},watch:{position(){this.recreate()}},onCreate(){kt(this.$parent,Be)||console.warn("请将tg-custom-control放到tg-map中");const{$el:i}=this,t=class extends cr{onCreateElement(){return i}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function qi(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(i.$options.name)},[_.renderSlot(i.$slots,"default")],2)}const Yi=ee(Ui,[["render",qi]]),Ki=_.defineComponent({name:"tg-map-type-control",mixins:[D],props:{position:Z(k,k.TOP_LEFT),type:Z(Rt),mapTypes:M(Array)},setup(){return{control:C.lateinit()}},watch:{position(i){this.control.setPosition(i)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),Xi=_.defineComponent({name:"tg-scale-control",mixins:[D],props:{position:Z(k,k.BOTTOM_RIGHT)},setup(){return{control:C.lateinit()}},watch:{position(i){this.control.setPosition(i)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function Hr(){var e;const i=(e=_.getCurrentInstance())==null?void 0:e.type;let t=(i==null?void 0:i.name)??(i==null?void 0:i.__name);if(!t){const r=i==null?void 0:i.__file;r&&(t=C.path.basename(r,".vue"))}return t}function Tt(){const i=_.inject(Ct);let t,e;return i==null&&C.throwError(`<${Hr()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:i,get map(){return i.value??C.throwError("map尚未初始化")},[ue](r){_.onMounted(r),t&&C.throwError(`${ue}只能调用一次`),t=r},[pe](r){_.onBeforeUnmount(r),e&&C.throwError(`${pe}只能调用一次`),e=r},recreate(){e==null||e(),t==null||t()}}}const Ji=_.defineComponent({name:"tg-street-view-control",props:{position:Z(k,k.RIGHT_BOTTOM)},setup(i){let t=C.lateinit();const{map:e,onCreate:r,onDestroy:n}=Tt();return r(()=>{t=e.createStreetViewControl(i),e.addControl(t)}),n(()=>{e.removeControl(t)}),_.watch(()=>i.position,s=>{t.setPosition(s)}),Le}}),Qi=_.defineComponent({name:"tg-zoom-control",props:{position:Z(k,k.RIGHT_BOTTOM)},setup(i){let t=C.lateinit();const{map:e,onCreate:r,onDestroy:n}=Tt();return r(()=>{t=e.createZoomControl(i),e.addControl(t)}),n(()=>{e.removeControl(t)}),_.watch(()=>i.position,s=>{t.setPosition(s)}),Le}}),en=_.defineComponent({name:"tg-heatmap",props:{maxIntensity:M(Number),gradient:M(Object),opacity:M(Number),radius:M(Number),data:G(Array)},setup(i){const{map:t,onCreate:e,onDestroy:r}=Tt();let n=C.lateinit();return e(()=>{n=t.createHeatmap(i)}),r(()=>{n.remove()}),_.watch(()=>i.data,s=>n.setData(s)),_.watch([()=>i.maxIntensity,()=>i.gradient,()=>i.opacity,()=>i.radius],()=>n.setOptions(i)),Le}}),tn=_.defineComponent({name:"tg-marker-clusterer",mixins:[D],props:{gridSize:M(Number),maxZoom:M(Number),minClusterSize:M(Number),averageCenter:M(Boolean),styles:M(Array),stylesIndexCalculator:M(Function),zIndex:M(Number)},setup(){return{clusterer:C.lateinit(),markers:C.typed([])}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(i){this.markers.push(i),this.isInitiated()&&this.clusterer.addMarker(i)},onRemoveMarker(i){this.isInitiated()&&this.clusterer.removeMarker(i),C.Arrays.remove(this.markers,i)}}});function rn(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",{class:_.normalizeClass(i.$options.name)},[_.renderSlot(i.$slots,"default")],2)}const jr=ee(tn,[["render",rn]]),nn=_.defineComponent({name:"tg-traffic-layer",mixins:[D],setup(){return{layer:C.lateinit()}},watch:{},onCreate(){this.layer=new ur,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),sn=_.defineComponent({name:"tg-circle",mixins:[D],inheritAttrs:!1,props:{center:G(x),radius:G(Number),clickable:M(Boolean),editable:M(Boolean),strokeColor:M(String),strokeOpacity:M(Number),strokeWeight:M(Number),visible:M(Boolean),fillColor:M(String),fillOpacity:M(Number),"onUpdate:center":I(),"onUpdate:radius":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit(),emittedRadius:void 0,emittedCenter:void 0}},watch:{center(i){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===_.toRaw(i))return}this.overlay.setCenter(i)},radius(i){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===i)return}this.overlay.setRadius(i)},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),Q(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class on extends Ar{constructor(t,e,r,n){super(t,e),this.content=r,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const an=_.defineComponent({name:"tg-element-overlay",mixins:[D],props:{mapPane:Z(he,he.overlayMouseTarget),position:G(x)},setup(){return{overlay:C.lateinit()}},watch:{position(i){this.overlay.setPosition(i)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new on(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function ln(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",_.mergeProps({class:i.$options.name},i.$attrs),[_.renderSlot(i.$slots,"default")],16)}const hn=ee(an,[["render",ln]]),cn=_.defineComponent({name:"tg-marker",mixins:[D],inheritAttrs:!1,props:{position:G(x),title:M(String),label:M(Object),icon:M(Object),clickable:M(Boolean),draggable:M(Boolean),crossOnDrag:M(Boolean),cursor:M(String),zIndex:M(Number),visible:M(Boolean),normalizePositionForBaidu:M(Boolean),autoAddToClusterer:M(Boolean,!0),"onUpdate:position":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),marker:C.lateinit(),labelOverlay:C.typed(),info:C.typed(),emittedPosition:void 0,autoAddToClustererWhenCreate:i.autoAddToClusterer}},watch:{position(i){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===_.toRaw(i))return}this.marker.setPosition(i)},title(i){this.marker.setTitle(i)},label(i,t){C.deepEqual(i,t)||(i?this.marker.setLabel(i):this.recreate())},icon(i){i?this.marker.setIcon(i):this.recreate()},clickable(i){this.marker instanceof de?this.recreate():this.marker.setClickable(i)},draggable(i){this.marker.setDraggable(i)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(i){this.marker instanceof de?this.recreate():this.marker.setZIndex(i)},visible(i){this.marker.setVisible(i)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.labelOverlay&&this.marker.attachLabelOverlay(this.labelOverlay.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),Q(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",i=>{this.$emit("update:position",this.emittedPosition=i.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return kt(this.$parent,jr)},onAddLabel(i){this.labelOverlay=i,this.marker&&this.marker.attachLabelOverlay(i.overlay)},onRemoveLabel(i){this.marker.attachLabelOverlay(void 0),this.labelOverlay=void 0},onAddInfo(i){this.info=i,this.marker&&i.show&&i.overlay.open(this.marker)},onRemoveInfo(i){i.overlay.close(),this.info=void 0},onInfoShowChanged(i,t){t?i.overlay.open(this.marker):i.overlay.close()}}});function dn(i,t,e,r,n,s){return _.renderSlot(i.$slots,"default")}const Ot=ee(cn,[["render",dn]]),un=_.defineComponent({name:"tg-info-box",mixins:[D],inheritAttrs:!1,props:{show:G(Boolean),position:M(x),offset:M(Object),maxWidth:M(Number),borderClass:M(String),zIndex:M(Number),"onUpdate:show":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit()}},watch:{show(i){this.$marker()?this.$marker().onInfoShowChanged(this,i):i?this.overlay.open():this.overlay.close()},position(i){this.overlay.setPosition(i)},offset(){this.recreate()},maxWidth(i){this.overlay.setMaxWidth(i)},borderClass(){this.recreate()},zIndex(i){this.overlay.setZIndex(i)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),Q(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return Ue(Ot,this.$parent,Be)},open(i){this.overlay.open(i)},close(){this.overlay.close()}}});function pn(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",_.mergeProps({class:i.$options.name},i.attrs.binds),[_.renderSlot(i.$slots,"default")],16)}const gn=ee(un,[["render",pn]]),mn=_.defineComponent({name:"tg-info-window",mixins:[D],inheritAttrs:!1,props:{show:G(Boolean),position:M(x),maxWidth:M(Number),offset:M(Object),disableAutoPan:M(Boolean),"onUpdate:show":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit()}},watch:{show(i){this.$marker()?this.$marker().onInfoShowChanged(this,i):i?this.overlay.open():this.overlay.close()},position(i){this.overlay.setPosition(i)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return Ue(Ot,this.$parent,Be)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),Q(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function fn(i,t,e,r,n,s){return _.withDirectives((_.openBlock(),_.createElementBlock("div",_.mergeProps({class:i.$options.name},i.attrs.binds),[_.renderSlot(i.$slots,"default")],16)),[[_.vShow,i.show]])}const yn=ee(mn,[["render",fn]]),vn=_.defineComponent({name:"tg-label",mixins:[D],inheritAttrs:!1,props:{position:M(x),offset:M(Object),zIndex:M(Number),mapPane:Z(he)},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t),overlay:C.lateinit()}},watch:{position(i){this.overlay.setPosition(i)},offset(i){this.overlay.setOffset(i)},zIndex(i){this.overlay.setZIndex(i)},visible(i){this.overlay.setVisible(i)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var i;return(i=this.$marker())==null?void 0:i.marker},$marker(){return Ue(Ot,this.$parent,Be)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),Q(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function _n(i,t,e,r,n,s){return _.openBlock(),_.createElementBlock("div",_.mergeProps({class:i.$options.name},i.attrs.binds),[_.renderSlot(i.$slots,"default")],16)}const bn=ee(vn,[["render",_n]]),Mn=_.defineComponent({name:"tg-polygon",mixins:[D],inheritAttrs:!1,props:{paths:G(Array),clickable:M(Boolean),editable:M(Boolean),strokeColor:M(String),strokeOpacity:M(Number),strokeWeight:M(Number),visible:M(Boolean),fillColor:M(String),fillOpacity:M(Number),"onUpdate:paths":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit(),emittedPaths:void 0}},watch:{paths:{handler(i){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===i.length&&t.every((e,r)=>e===_.toRaw(i[r])))return}this.overlay.setPaths(i)},deep:!0},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),Q(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),Cn=_.defineComponent({name:"tg-polyline",mixins:[D],inheritAttrs:!1,props:{path:G(Array),icons:M(Array),clickable:M(Boolean),editable:M(Boolean),strokeColor:M(String),strokeOpacity:M(Number),strokeWeight:M(Number),visible:M(Boolean),"onUpdate:path":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit(),emittedPath:void 0}},watch:{path:{handler(i){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===_.toRaw(i))return}this.overlay.setPath(i)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),Q(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),Tn=_.defineComponent({name:"tg-rectangle",mixins:[D],inheritAttrs:!1,props:{bounds:G(Object),clickable:M(Boolean),editable:M(Boolean),strokeColor:M(String),strokeOpacity:M(Number),strokeWeight:M(Number),visible:M(Boolean),fillColor:M(String),fillOpacity:M(Number),"onUpdate:bounds":I()},emits:void 0,setup(i,{attrs:t}){return{attrs:K(t,i),overlay:C.lateinit(),emittedBounds:void 0}},watch:{bounds(i){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(i))return}this.overlay.setBounds(i)},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),Q(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),On=["beforeUpdate","updated"],wn={install(i,t={}){if(t.enable!==!1){const e=_.defineComponent({beforeCreate(){const r=Hr()??"",s=(t.nameRegex||/^[A-Z]/).test(r)?a=>{t.hookNames?t.hookNames.includes(a)&&console.debug("[lifecycle]",r,a):On.includes(a)||console.debug("[lifecycle]",r,a)}:C.noop;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(r){this.__life_impl(r)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});i.mixin(e)}}},xn=6378137;function Me(i){return i*Math.PI/180}function nr(i){return i*180/Math.PI}function En(i,t){if(i.lat===t.lat&&i.lng===t.lng)return 0;const e=Me((i.lat+t.lat)/2),r=Me((i.lat-t.lat)/2),n=Me((i.lng-t.lng)/2);let s=Math.sin(r),a=Math.sin(n),d=Math.sin(e);const o=xn,c=1/298.257;s=s*s,a=a*a,d=d*d;const u=s*(1-a)+(1-d)*a,m=(1-s)*(1-a)+d*a,p=Math.atan(Math.sqrt(u/m)),v=Math.sqrt(u*m)/p,T=2*p*o,b=(3*v-1)/2/m,O=(3*v+1)/2/u;return T*(1+c*(b*d*(1-s)-O*(1-d)*s))}function Vr(i,t,e){const n=63567523142e-4,s=1/298.257223563,a=Me(t),d=Math.sin(a),o=Math.cos(a),c=(1-s)*Math.tan(Me(i.lat)),u=1/Math.sqrt(1+c*c),m=c*u,p=Math.atan2(c,o),v=u*d,T=1-v*v,b=T*(6378137*6378137-n*n)/(n*n),O=1+b/16384*(4096+b*(-768+b*(320-175*b))),l=b/1024*(256+b*(-128+b*(74-47*b)));let h=0,f=0,y=0,w=e/(n*O),E=2*Math.PI;for(;Math.abs(w-E)>1e-12;){h=Math.cos(2*p+w),f=Math.sin(w),y=Math.cos(w);const W=l*f*(h+l/4*(y*(-1+2*h*h)-l/6*h*(-3+4*f*f)*(-3+4*h*h)));E=w,w=e/(n*O)+W}const L=m*f-u*y*o,A=Math.atan2(m*y+u*f*o,(1-s)*Math.sqrt(v*v+L*L)),z=Math.atan2(f*d,u*y-m*f*o),B=s/16*T*(4+s*(4-3*T)),X=z-(1-B)*s*v*(w+B*f*(h+B*y*(-1+2*h*h)));return{lng:i.lng+nr(X),lat:nr(A)}}const Pn={getDistance:En,getDestination:Vr},Ln={install(i,t){Dr(t);const e=i.config.optionMergeStrategies;e[ue]=e[pe]=(r,n)=>r?[...new Set([].concat(r,n))]:Array.isArray(n)?n:[n]}};exports.AbstractControl=Ye;exports.AbstractMap=nt;exports.Autocomplete=Dt;exports.BaiduAutocomplete=yr;exports.BaiduCircle=at;exports.BaiduControl=Ke;exports.BaiduHeatmap=_r;exports.BaiduInfoBoxOverlay=ut;exports.BaiduInfoWindow=ct;exports.BaiduMapTypeControl=Xe;exports.BaiduMapUrls=We;exports.BaiduMarker=de;exports.BaiduMarkerClusterer=Or;exports.BaiduOverlay=Pe;exports.BaiduPlacesService=Er;exports.BaiduPolyShape=mt;exports.BaiduPolygon=vt;exports.BaiduPolyline=ft;exports.BaiduRectangle=bt;exports.BaiduScaleControl=Je;exports.BaiduSearchBox=Lr;exports.BaiduStreetViewControl=et;exports.BaiduZoomControl=rt;exports.BuildInMapType=N;exports.BuildInMapTypeId=At;exports.CachedValue=ae;exports.ControlPosition=k;exports.CoordType=R;exports.CustomControl=cr;exports.ElementOverlay=Ar;exports.EmptyControl=dr;exports.FastFindValues=hr;exports.GestureHandlingOptions=Y;exports.GoogleAutocomplete=fr;exports.GoogleCircle=lt;exports.GoogleControl=Ee;exports.GoogleHeatmap=vr;exports.GoogleInfoBoxOverlay=pt;exports.GoogleInfoWindow=dt;exports.GoogleMapTypeControl=ze;exports.GoogleMapUrls=Ze;exports.GoogleMarker=gt;exports.GoogleMarkerClusterer=wr;exports.GoogleOverlay=st;exports.GooglePlacesService=xr;exports.GooglePolygon=_t;exports.GooglePolyline=yt;exports.GoogleRectangle=Mt;exports.GoogleScaleControl=Qe;exports.GoogleSearchBox=Pr;exports.GoogleStreetViewControl=tt;exports.GoogleZoomControl=it;exports.Heatmap=$t;exports.ImageMapType=si;exports.InfoWindow=ht;exports.InfoWindowModeValues=kr;exports.KeyValue=St;exports.LatLng=x;exports.LatLngBounds=U;exports.LifecycleLogPlugin=wn;exports.MIXIN_HOOK_CREATE=ue;exports.MIXIN_HOOK_DESTROY=pe;exports.MIXIN_MAP_NAME=Ct;exports.MapMixin=D;exports.MapPane=he;exports.MapTypeControlType=Rt;exports.MapUrls=zt;exports.MapZoom=Br;exports.MarkerClusterer=Nt;exports.Overlay=Ht;exports.PlacesService=Zt;exports.SearchBox=Wt;exports.SphericalUtils=Pn;exports.SymbolPath=wi;exports.TgCircle=sn;exports.TgCustomControl=Yi;exports.TgElementOverlay=hn;exports.TgHeatmap=en;exports.TgInfoBox=gn;exports.TgInfoWindow=yn;exports.TgLabel=bn;exports.TgMap=Be;exports.TgMapType=V;exports.TgMapTypeControl=Ki;exports.TgMapWidget=Fi;exports.TgMarker=Ot;exports.TgMarkerClusterer=jr;exports.TgPolygon=Mn;exports.TgPolyline=Cn;exports.TgRectangle=Tn;exports.TgScaleControl=Xi;exports.TgStreetViewControl=Ji;exports.TgTrafficLayer=nn;exports.TgZoomControl=Qi;exports.TrafficLayer=ur;exports.UnionIcon=xe;exports.callHook=_e;exports.computedSaveOnThis=Di;exports.createAsyncSingleton=zr;exports.createEmptyVNode=Le;exports.createPropertyObject=Zr;exports.createPropertyObjectTyped=$i;exports.debug=Si;exports.default=Ln;exports.eventProp=I;exports.extractVNodeFromSlotsByComponent=Gi;exports.findAncestorComponentByType=Ue;exports.findByComponentType=zi;exports.getDestination=Vr;exports.getTgMapConfig=Ft;exports.isComponentByType=$e;exports.isEntryValueDef=$r;exports.isInstanceOf=Qr;exports.loadCachedMap=Gr;exports.optionalProp=M;exports.requiredProp=G;exports.safeAs=ei;exports.safeAsComponent=kt;exports.setTgMapConfig=Dr;exports.splitAttrs=Wr;exports.stringEnumProp=Z;exports.stringUnionPropFromValues=Nr;exports.todo=Bi;exports.unwrapStringEnumValue=ti;exports.useEventLogMethods=Ni;exports.useSplittedAttrs=K;exports.useTgMapInner=Tt;
|
|
14
|
+
`)}i.trimIndent=e;function r(s){return s.replace(/([^A-Z]?)([A-Z])/g,(a,h,o)=>h?`${h}-${o.toLowerCase()}`:o.toLowerCase())}i.pascal2kebab=r;function n(s){return/^-?\d+$/.test(s)}i.isInt=n})(exports.Strings||(exports.Strings={}));var ue=(i=>(i.map="map",i.overlay="overlay",i.overlayMouseTarget="overlayMouseTarget",i.float="float",i))(ue||{});exports.MapPanes=void 0;(i=>{function t(r,n){switch(r){case"float":return n.floatPane;case"overlayMouseTarget":return n.overlayMouseTarget;case"overlay":return n.overlayLayer;case"map":return n.mapPane;default:O.assertNever(r)}}i.toGoogle=t;function e(r,n){switch(r){case"float":return n.floatPane;case"overlayMouseTarget":return n.markerMouseTarget;case"overlay":return n.markerPane;case"map":return n.mapPane;default:O.assertNever(r)}}i.toBaidu=e})(exports.MapPanes||(exports.MapPanes={}));class Fr{constructor(t,e){m(this,"baidu");m(this,"google");m(this,"projection");m(this,"element",O.lateinit());m(this,"mapPane");this.map=t,this.mapPane=e.mapPane}create(){return this.element=this.onCreate(),this.element.className+=" element-overlay",this.element}draw(){this.projection&&this.onDraw(this.projection)}getProjection(){return this.projection}asBaidu(){if(!this.baidu){const t=this;yr();class e extends BMap.OverlayV3{initialize(s){var o;const a=t.create(),h=s.getPanes();return(o=exports.MapPanes.toBaidu(t.mapPane,h))==null||o.appendChild(a),a}draw(){t.draw()}}this.baidu=new e;const r=t.map.innerMap;this.projection={fromLatLngToOverlayPoint(n){return r.pointToOverlayPixel(n.toBaidu(t.map.coordType))},fromOverlayPointToLatLng(n){return x.fromBaidu(r.overlayPixelToPoint(new BMap.Pixel(n.x,n.y)),t.map.coordType)}}}return this.baidu}asGoogle(){if(!this.google){const t=this;class e extends google.maps.OverlayView{onAdd(){const n=t.create(),s=this.getPanes()??O.throwError("onAdd回调中一定会有panes");exports.MapPanes.toGoogle(t.mapPane,s).appendChild(n)}draw(){t.draw()}onRemove(){var n;(n=t.element.parentNode)==null||n.removeChild(t.element)}}this.google=new e,this.projection={fromLatLngToOverlayPoint(r){return t.google.getProjection().fromLatLngToDivPixel(r.toGoogle(t.map.coordType))??exports.Point.ZERO},fromOverlayPointToLatLng(r){return x.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(r.x,r.y))??ie.LATLNG_ZERO,t.map.coordType)}}}return this.google}}let zt;function Zi(i,t,e,r,n){return zt||(zt=Wi()),new zt(i,t,e,r,n)}function Wi(){return class extends google.maps.OverlayView{constructor(e,r,n,s=ue.overlayMouseTarget,a){super();m(this,"container");this.position=r,this.offset=n,this._mapPane=s,this.container=document.createElement("div"),this.container.className="label-container",this.container.style.position="absolute",a&&this.setZIndex(a),this.container.addEventListener("click",()=>{google.maps.event.trigger(this,"click")}),this.setElement(e)}setZIndex(e){this.container.style.zIndex=`${e}`}setElement(e){const r=this.container.firstChild;r!==e&&(r?this.container.replaceChild(r,e):this.container.appendChild(e))}onAdd(){const e=this.getPanes()??O.throwError("onAdd回调中一定能够获取panes");exports.MapPanes.toGoogle(this._mapPane,e).appendChild(this.container)}draw(){var e,r;if(this.container.style.display=this.position?"block":"none",this.position){const n=this.getProjection();if(n){const s=n.fromLatLngToDivPixel(this.position);s&&(this.container.style.left=`${s.x+(((e=this.offset)==null?void 0:e.x)??0)}px`,this.container.style.top=`${s.y+(((r=this.offset)==null?void 0:r.y)??0)}px`)}}}onRemove(){var e;(e=this.container.parentNode)==null||e.removeChild(this.container)}setPosition(e){this.position=e,this.draw()}getPosition(){return this.position}setOffset(e){this.offset=e,this.draw()}getOffset(){return this.offset}getVisible(){return this.container.style.visibility!=="hidden"}setVisible(e){this.container.style.visibility=e?"visible":"hidden"}}}var pe;(i=>{function t(r){return typeof r=="string"?r:r.outerHTML}i.toString=t;function e(r){if(typeof r=="string"){const n=document.createElement("div");return n.innerHTML=r,n}return r}i.toElement=e})(pe||(pe={}));class Jt extends ze{constructor(e,r,n,s){super(e,r,n);m(this,"icon");m(this,"iconAnchor");m(this,"content",O.lateinit());m(this,"contentObserver");this.setContentInternal(s,!0)}static create(e){var a;const r=this.coordType,n=new BMap.Label(pe.toString(e.content),{position:(a=e.position)==null?void 0:a.toBaidu(r),offset:e.offset&&new BMap.Size(e.offset.x,e.offset.y)});e.zIndex&&n.setZIndex(e.zIndex),n.setStyle({border:"0px",padding:"0px",backgroundColor:"unset"});const s=new Jt(n,r,this,e.content);return n.__label__=s,s}setContentInternal(e,r=!1){this.content!==e&&(this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),typeof e!="string"&&(this.contentObserver=new MutationObserver(()=>{this.innerOverlay.setContent(e.outerHTML)}),this.contentObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),r||this.innerOverlay.setContent(pe.toString(e)),this.content=e)}setZIndex(e){this.innerOverlay.setZIndex(e)}getPosition(){return x.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toBaidu(this.coordType))}getOffset(){const e=this.innerOverlay.getOffset();let r=0,n=0;return this.iconAnchor&&(r=this.iconAnchor.width,n=this.iconAnchor.height),{x:e.width-r,y:e.height-n}}setOffset(e){let r=0,n=0;this.iconAnchor&&(r=this.iconAnchor.width,n=this.iconAnchor.height),this.innerOverlay.setOffset(new BMap.Size(e.x+r,e.y+n))}setContent(e){this.setContentInternal(e)}attachIcon(e){var h;let r;if(e instanceof BMap.Icon)r=e.anchor;else if(e)if(e.anchor)r=e.anchor;else{const o=((h=e.__icon__)==null?void 0:h.baiduLabelOffset)??{x:0,y:0};r={width:e.style.anchor.width+o.x,height:e.style.anchor.height+o.y},process.env.NODE_ENV!=="production"&&setTimeout(()=>{var u,g;if(O.assert(e.__icon__,`${e}必须是由'SymbolIcon.toBaidu()'创建的`),!e.anchor){console.log("BaiduLabelOverlay.attachIcon","Bmap.Symbol.anchor尚未计算完成");return}const c=e.anchor.width-e.style.anchor.width,p=e.anchor.height-e.style.anchor.height;if(o.x!==c||o.y!==p){const y=[(u=e.__icon__.anchor)==null?void 0:u.x,(g=e.__icon__.anchor)==null?void 0:g.y,e.__icon__.rotation,e.__icon__.scale,e.__icon__.strokeWeight].map(_=>_??"").join(",");console.warn("BaiduLabelOverlay.attachIcon",e.__icon__,exports.Strings.trimIndent(`
|
|
15
|
+
为了保证Label的位置正确, 请将SymbolIcon(${y})中baiduLabelOffset的值改写成:
|
|
16
|
+
${JSON.stringify({x:c,y:p})}
|
|
17
|
+
`))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,a=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,a-=this.iconAnchor.height),r&&(s+=r.width,a+=r.height),this.innerOverlay.setOffset(new BMap.Size(s,a)),this.icon=e,this.iconAnchor=r}}class Qt extends pt{static create(t){var n;const e=this.coordType,r=Zi(pe.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new Qt(r,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(pe.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?x.fromGoogle(t,this.coordType):x.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??exports.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const ke={toGoogle:i=>"url"in i?exports.Icon.toGoogle(i):exports.SymbolIcon.toGoogle(i),toBaidu:i=>"url"in i?exports.Icon.toBaidu(i):exports.SymbolIcon.toBaidu(i)};exports.Icon=void 0;(i=>{function t(r){return{url:r.url,size:new google.maps.Size(r.size.width,r.size.height),origin:r.origin&&new google.maps.Point(r.origin.x,r.origin.y),scaledSize:r.scaledSize&&new google.maps.Size(r.scaledSize.width,r.scaledSize.height),anchor:r.anchor&&new google.maps.Point(r.anchor.x,r.anchor.y),labelOrigin:r.labelOrigin&&new google.maps.Point(r.labelOrigin.x,r.labelOrigin.y)}}i.toGoogle=t;function e(r){const n=new BMap.Icon(r.url,new BMap.Size(r.size.width,r.size.height),{imageOffset:r.origin&&new BMap.Size(-r.origin.x,-r.origin.y),imageSize:r.scaledSize&&new BMap.Size(r.scaledSize.width,r.scaledSize.height),anchor:r.anchor?new BMap.Size(r.anchor.x,r.anchor.y):new BMap.Size(r.size.width/2,r.size.height)});return n.__icon__=r,n}i.toBaidu=e})(exports.Icon||(exports.Icon={}));exports.SymbolIcon=void 0;(i=>{function t(r){return{path:typeof r.path=="string"?r.path:r.path.google(),anchor:r.anchor&&new google.maps.Point(r.anchor.x,r.anchor.y),fillColor:r.fillColor,fillOpacity:r.fillOpacity,scale:r.scale,rotation:r.rotation,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight}}i.toGoogle=t;function e(r){const n=new BMap.Symbol(typeof r.path=="string"?r.path:r.path.baidu(),{anchor:r.anchor&&new BMap.Size(r.anchor.x,r.anchor.y),fillColor:r.fillColor,fillOpacity:r.fillOpacity,scale:r.scale,rotation:r.rotation,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeWeight:r.strokeWeight});return n.__icon__=r,n}i.toBaidu=e})(exports.SymbolIcon||(exports.SymbolIcon={}));const Hi={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};exports.IconSequence=void 0;(i=>{function t(r){return{icon:exports.SymbolIcon.toGoogle(r.icon),offset:r.offset,repeat:r.repeat,fixedRotation:r.fixedRotation}}i.toGoogle=t;function e(r){return new BMap.IconSequence(exports.SymbolIcon.toBaidu(r.icon),r.offset,r.repeat??"",r.fixedRotation)}i.toBaidu=e})(exports.IconSequence||(exports.IconSequence={}));const Nt={toBaidu:i=>{const t=["baidu-marker-label"];i.className&&t.push(i.className);const e=new BMap.Label(`<span class="${t.join(" ")}">${i.text}</span>`);return e.setStyle({border:"0px",padding:"0px",backgroundColor:"unset",color:i.color??"black",fontSize:i.fontSize??"14px",fontWeight:i.fontWeight??"",fontFamily:i.fontFamily??"Roboto, Arial, sans-serif"}),e},toGoogle:i=>i};class ge extends ze{constructor(t,e,r,n){super(t,e,r),this.state=n}static create(t){const e=this.coordType,r=t.icon,n={title:t.title,icon:r&&ke.toBaidu(r),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const a=t.clickable===void 0?!0:t.clickable,h=!!t.draggable,o=new ge(s,e,this,{clickable:a,draggable:h,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible);return t.label&&o.setLabel(t.label),o}getPosition(){return x.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=ke.toBaidu(t);this.innerOverlay.setIcon(e),this._updateMarkerLabelOffset();const r=this.getLabelOverlay();r&&r.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.innerOverlay.getLabel();e&&this.map.innerMap.removeOverlay(e),this.innerOverlay.setLabel(Nt.toBaidu(t)),this._updateMarkerLabelOffset()}_updateMarkerLabelOffset(){const t=this.innerOverlay.getIcon(),e=t.__icon__,r=this.innerOverlay.getLabel();if(r&&t&&!e&&t.imageUrl==="https://api.map.baidu.com/images/marker_red_sprite.png"){r.setOffset(new BMap.Size(9,9));return}!r||!e||!("size"in e)||r.setOffset(e.labelOrigin?new BMap.Size(e.labelOrigin.x,e.labelOrigin.y):new BMap.Size(e.size.width/2,e.size.height/2))}attachLabelOverlay(t){const e=this.getLabelOverlay();process.env.NODE_ENV!=="production"&&this.innerOverlay.getLabel()&&!e&&console.warn("当前label不是LabelOverlay, 可能是混用 MarkerLabel/marker.setLabel() 和 LabelOverlay/<tg-label> 导致的, 请不要混用他们两者",this.innerOverlay.getLabel()),e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabelOverlay(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class Ct extends pt{constructor(){super(...arguments);m(this,"label");m(this,"labelPositionListener");m(this,"labelVisibleListener");m(this,"labelMapChangedListener")}static create(e){const r=this.coordType,n=e.icon,s={position:e.position.toGoogle(r),title:e.title,label:e.label&&Nt.toGoogle(e.label),zIndex:e.zIndex,visible:e.visible,icon:n&&ke.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new Ct(new google.maps.Marker(s),r,this)}getPosition(){return x.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(ke.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){this.innerOverlay.setLabel(Nt.toGoogle(e))}attachLabelOverlay(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const r=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),r(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",r),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class Tt extends Y{constructor(){super(...arguments);m(this,"eventHubDelegate");m(this,"prevPath");m(this,"isDoingSetPath",!1);m(this,"onLineUpdate",()=>{var r;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(r=this.eventHubDelegate)==null||r.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new rt(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class Ot extends Tt{constructor(){super(...arguments);m(this,"pathEditedEventType","path-edited")}static create(e){var s,a;const r=this.coordType,n=new BMap.Polyline(e.path.map(h=>h.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+Y.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(exports.IconSequence.toBaidu)});return new Ot(n,r,this,{editable:!!e.editable,symbolIcons:(a=e.icons)==null?void 0:a.map(h=>h.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>x.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(r=>r.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const a=s.getIcon();if(!(a instanceof BMap.Symbol))return!1;const h=a;return h.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(h.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class wt extends gt{constructor(){super(...arguments);m(this,"pathChangedListeners");m(this,"eventHubDelegate")}static create(e){var s;const r=this.coordType,n=new google.maps.Polyline({path:e.path.map(a=>a.toGoogle(r)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(exports.IconSequence.toGoogle)});return new wt(n,r,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},r=this.innerOverlay.getPath();this.pathChangedListeners=exports.MVCArrays.listenChanged(r,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(r=>r.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new rt(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(r=>{e.push(x.fromGoogle(r,this.coordType))}),e}setPath(e){var r;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(r=this.eventHubDelegate)!=null&&r.hasListener("path-edited")&&this.setupPathChangedListeners()}}class xt extends Tt{constructor(){super(...arguments);m(this,"pathEditedEventType","paths-edited")}static create(e){const r=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(a=>a.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+Y.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+Y.OPACITY_DELTA:void 0});return new xt(s,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>x.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(r=>r.toBaidu(this.coordType)))}}class Pt extends gt{constructor(){super(...arguments);m(this,"pathChangedListeners");m(this,"eventHubDelegate")}static create(e){const r=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(a=>a.toGoogle(r))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new Pt(n,r,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},r=this.innerOverlay.getPaths();this.pathChangedListeners=[],r.forEach(n=>{this.pathChangedListeners.push(...exports.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(r=>r.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new rt(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),r=[];return e.forEach(n=>{const s=[];r.push(s),n.forEach(a=>{s.push(x.fromGoogle(a,this.coordType))})}),r}setPaths(e){var r;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(r=this.eventHubDelegate)!=null&&r.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class Lt extends Tt{constructor(e,r,n,s){super(e,r,n,s);m(this,"pathEditedEventType","bounds-changed");m(this,"isDoingUpdateRectangle",!1);m(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const r=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const a=n.length;if(r.length===4)if(a>r.length){for(let o=0;o<a;o++)if(r[o]==null||!sr.equals(n[o],r[o])){const c=n[(o-2+a)%a],p=n[(o-1+a)%a],u=n[o],g=n[(o+1)%a],y=n[(o+2)%a];let _;p.lat===g.lat?_=new BMap.Point(p.lng,u.lat):p.lng===g.lng?_=new BMap.Point(u.lng,p.lat):_=u,s=[c,y,_];break}}else if(a===r.length){for(let o=0;o<a;o++)if(!sr.equals(n[o],r[o])){s=[n[o],n[(o+2)%4]];break}}else a<r.length;const h=K.fromArray(s.map(o=>x.fromBaidu(o,this.coordType)));h&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(h.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const r=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(r)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+Y.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+Y.OPACITY_DELTA:void 0});return new Lt(n,r,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return K.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const r=e.toRectArray();this.innerOverlay.getPath().length===r.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(r.map(n=>n.toBaidu(this.coordType)))}}class Et extends gt{static create(t){const e=this.coordType,r=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new Et(r,e,this)}getBounds(){return K.fromGoogle(this.innerOverlay.getBounds()??ie.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const ne=1;class ji extends ut{constructor(e,r){var n;super(e);m(this,"buildInMapTypeId2BIMT");m(this,"baiduMapType2BIMT");m(this,"map");m(this,"createLabel",Jt.create);m(this,"createCircle",mt.create);m(this,"createPolygon",xt.create);m(this,"createPolyline",Ot.create);m(this,"createRectangle",Lt.create);m(this,"createInfoWindow",vt.create);m(this,"createInfoBox",Mt.create);m(this,"createMarker",ge.create);m(this,"createMapTypeControl",st.create);m(this,"createZoomControl",ct.create);m(this,"createStreetViewControl",lt.create);m(this,"createScaleControl",ot.create);this.buildInMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(V.prototype.getId),this.baiduMapType2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(V.prototype.asBaiduMapType),Mi(),this.map=new BMap.Map(e,{minZoom:r.minZoom&&r.minZoom+ne,maxZoom:r.maxZoom&&r.maxZoom+ne,mapType:r.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(r.center.toBaidu(this.coordType),r.zoom+ne),this.setGestureHandling(r.gestureHandling),r.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),r.mapStyle&&this.map.setMapStyleV2(r.mapStyle.baidu),this.setEventTargetDelegate(new Se(this.map,this)),this.map.addEventListener("addoverlay",s=>{const a=s.target.__info_box__;a&&(console.debug("add:info-box",a),this.map.addOverlay(a))}),this.map.addEventListener("removeoverlay",s=>{const a=s.target.__info_box__;a&&(console.debug("remove:info-box",a),this.map.removeOverlay(a))})}setGestureHandling(e=J.auto){switch(e===J.auto&&(e=this.element.parentElement&&$t.isScrollable(this.element.parentElement)?J.cooperative:J.greedy),e){case J.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case J.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case J.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,r){if(e==="center-changed"){super.addEventListener("movestart",r),super.addEventListener("moving",r),super.addEventListener("moveend",r),super.addEventListener("zoomend",r);return}super.addEventListener(e,r)}removeEventListener(e,r){if(e==="center-changed"){super.removeEventListener("movestart",r),super.removeEventListener("moving",r),super.removeEventListener("moveend",r),super.removeEventListener("zoomend",r);return}super.removeEventListener(e,r)}fromContainerPointToLatLng(e){return x.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return x.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-ne}setZoom(e){return super.setZoom(e+ne)}setMinZoom(e){this.map.setMinZoom(e+ne)}setMaxZoom(e){this.map.setMaxZoom(e+ne)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const r=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(r??O.throwError("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),r=this.baiduMapType2BIMT.get(e);return r||(e.__baidu_map_type__??O.throwError("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:r&&[r.top,r.right,r.bottom,r.left]})}getBounds(){return K.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const r=class extends BMap.Control{constructor(){super(...arguments);m(this,"defaultAnchor",exports.ControlPositionConverter.getBaidu().toValue(e.position));m(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const a=e.onCreateElement();return s.getContainer().appendChild(a),a}};e.inner=new r,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(O.assert(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Dr(this,e)}createHeatmap(e){return new Ir(this,e)}createAutocomplete(e){return new Er(this,e)}createSearchBox(e){return new Zr(this,e)}createPlacesService(e){return new Gr(this,e)}createMapUrls(e){return new Ke(e)}}class Vi extends ut{constructor(e,r){var s,a;super(e);m(this,"buildInMapTypeId2BIMT");m(this,"googleMapTypeId2BIMT");m(this,"map");m(this,"createLabel",Qt.create);m(this,"createCircle",ft.create);m(this,"createPolygon",Pt.create);m(this,"createPolyline",wt.create);m(this,"createRectangle",Et.create);m(this,"createInfoWindow",_t.create);m(this,"createInfoBox",bt.create);m(this,"createMarker",Ct.create);m(this,"createMapTypeControl",Fe.create);m(this,"createZoomControl",dt.create);m(this,"createStreetViewControl",ht.create);m(this,"createScaleControl",at.create);this.mapOptions=r,this.buildInMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(V.prototype.getId),this.googleMapTypeId2BIMT=exports.MapType.BUILD_IN_MAP_TYPES.getValueMap(V.prototype.getGoogleMapTypeId);const n=r.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(r.buildInMapTypeId);this.map=new google.maps.Map(e,{center:r.center.toGoogle((n??exports.MapType.NORMAL).getGoogleCoordType()),zoom:r.zoom,disableDefaultUI:!0,gestureHandling:r.gestureHandling,minZoom:r.minZoom,maxZoom:r.maxZoom,styles:(s=r.mapStyle)==null?void 0:s.google.styles,mapId:(a=r.mapStyle)==null?void 0:a.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new de(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const r=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(r==null||n==null)return x.ZERO;const s=r.fromLatLngToPoint(n.getSouthWest()),a=r.fromLatLngToPoint(n.getNorthEast()),h=this.innerMap.getZoom();if(s==null||a==null||h==null)return x.ZERO;const o=Math.pow(2,h),c=new google.maps.Point(e.x/o+s.x,e.y/o+a.y);return x.fromGoogle(r.fromPointToLatLng(c)??ie.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const r=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(r==null||n==null)return exports.Point.ZERO;const s=r.fromLatLngToPoint(n.getSouthWest()),a=r.fromLatLngToPoint(n.getNorthEast()),h=this.innerMap.getZoom();if(s==null||a==null||h==null)return exports.Point.ZERO;const o=Math.pow(2,h),c=r.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?exports.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-a.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return x.fromGoogle(this.map.getCenter()??ie.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const r=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(r??O.throwError("理论上来说不可能为空"))}setMapType(e){e instanceof V?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,r=this.googleMapTypeId2BIMT.get(e);return r||(this.map.mapTypes.get(e).__google_map_type__??O.throwError(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){exports.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,r){this.map.panBy(e,r)}fitBounds(e,r){this.map.fitBounds(e.toGoogle(this.coordType),r)}getBounds(){const e=this.map.getBounds();return e?K.fromGoogle(e,this.coordType):K.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[exports.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const r=this.map.controls[exports.ControlPositionConverter.getGoogle().toValue(e.position)];exports.MVCArrays.remove(r,e.inner)}}createMarkerClusterer(e){return new zr(this,e)}createHeatmap(e){return new Br(this,e)}createAutocomplete(e){return new Lr(this,e)}createSearchBox(e){return new Nr(this,e)}createPlacesService(e){return new $r(this,e)}createMapUrls(e){return new Ye(e)}}const Je=["3.0"],Fi={baidu:{version:"3.0",key:""},google:{version:"quarterly",key:"",language:"en-us",libraries:["places","visualization"]},here:{version:Je[0],key:""}};let Ur;function er(){return Ur||O.throwError("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function qr(i){i!=null&&(Ur=Hr(Fi,i))}class Ui extends ut{constructor(e,r){var a;super(e);m(this,"map");m(this,"defaultLayers");this.mapOptions=r;const n=er().here;Je.includes(n.version)||O.throwError(`不支持${n.version}, HereMap当前只支持如下版本: ${Je}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:r.zoom,center:(a=r.center)==null?void 0:a.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return z.wgs84}getCenter(){return x.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,r){throw new Error("Method not implemented.")}fitBounds(e,r){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var q=(i=>(i.google="google",i.baidu="baidu",i.here="here",i))(q||{});exports.TgMapFactory=void 0;(i=>{function t(e,r,n){const s=exports.MapOptions.create(n);switch(e){case"google":return new Vi(r,s);case"baidu":return new ji(r,s);case"here":return new Ui(r,s)}}i.createMap=t})(exports.TgMapFactory||(exports.TgMapFactory={}));function qi(i){throw new Error(`todo: ${i}`)}function Yi(i){return i}function Yr(i){return i[1]!=null}function Kr(i){let t=null;return()=>t??(t=i().catch(e=>(t=null,Promise.reject(e))))}const Ki={};function Xr(i){return exports.Objects.putIfAbsent(Ki,i,()=>Kr(()=>Xi({type:i,config:er()[i]})))()}function Xi({type:i,config:t}){const e=window,r=Ji(i);if(exports.Objects.get(e,r))return Promise.resolve();switch(i!==q.here&&!t.key&&O.throwError(`请先配置${i}地图的key`),i){case q.google:return gr(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case q.baidu:return gr(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case q.here:return Ce(be("core",t.version)).then(()=>Promise.all([Ce(be("service",t.version)),Ce(be("mapevents",t.version)),Ce(be("clustering",t.version)),Ce(be("ui",t.version))])).catch(n=>(exports.Objects.del(e,r),Promise.reject(n)));default:O.assertNever(i)}}function be(i,t=Je[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${i}.js`}function Ji(i){switch(i){case q.google:return"google.maps";case q.baidu:return"BMap";case q.here:return"H"}}let Qi=0;function gr(i,t="callback"){return new Promise((e,r)=>{const n=`__callback${Qi++}`;window[n]=e;const s=document.createElement("script");s.src=`${i}&${t}=${n}`,s.onerror=r,document.body.appendChild(s)})}function Ce(i){return new Promise((t,e)=>{const r=document.createElement("script");r.src=i,r.onload=t,r.onerror=e,document.body.appendChild(r)})}function F(i,t){return{type:String,default:t,validator:e=>Object.values(i).includes(e)}}function Jr(i,t){return{type:String,default:t,validator:e=>i.includes(e)}}function W(i){return{type:i,required:!0}}function T(i,t){return{type:i,default:t}}function en(i){const t={};return Object.entries(i).forEach(([e,r])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?r:s},set(s){this[n]=s}}}),t}const Te={enumerable:!0,configurable:!0,get:O.noop,set:O.noop};function Qr(i){return Object.keys(i).forEach(t=>{const e=i[t];let r=!1;typeof e=="function"?(Te.get=e,Te.set=O.noop,r=!0):typeof e=="object"&&typeof e.get=="function"&&(Te.get=e.get,Te.set=e.set,r=!0),r&&(i[t]=Object.defineProperty(i,t,Te))}),i}function tn(i){return Qr(i)}function $e(){return C.createCommentVNode()}function Oe(i,t){const e=i.$options[t];if(e)for(const r of e)r.call(i)}function rn(i,t){for(const e of i)if(e.$options.name===t.name)return e}function nn(i,t){if(!i.default)return;const e=i.default();for(const r of e)if((r==null?void 0:r.type).name===t.name)return r}function ei(i,t){const e={},r={},n={};return Object.keys(i).forEach(s=>{s.startsWith("on")?e[exports.Strings.pascal2kebab(s.substring(2))]=i[s]:r[s]=i[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[exports.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:r,listeners:e,listenerProps:n}}function Q(i,t){return C.computed(()=>ei(i,t))}function A(){return Function}const sn=()=>{let i,t;function e(n){console.log(n),i=n&&n.type,t=Date.now()}function r(n){((n&&n.type)!==i||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:r}},Bt="$map",me="onCreate",fe="onDestroy",$=C.defineComponent({inject:[Bt],mounted(){Oe(this,me)},beforeUnmount(){Oe(this,fe)},methods:{recreate(){Oe(this,fe),Oe(this,me)}},render(){return $e()}}),on=C.defineComponent({name:"tg-map",provide(){return{[Bt]:C.computed(()=>this.map)}},inheritAttrs:!1,props:{type:F(q,q.google),center:W(x),centerSyncDelay:T(Number,300),currentCenter:T(x),lastCenter:T(x),zoom:W(Number),infoWindowMode:Jr(Vr),gestureHandling:F(J),minZoom:T(Number),maxZoom:T(Number),mapStyle:T(Object),mapTypeId:F(Wt),mapType:T(Object),hideLogo:T(Boolean),onLoad:A(),"onUpdate:center":A(),"onUpdate:current-center":A(),"onUpdate:last-center":A(),"onUpdate:map-type":A(),"onUpdate:map-type-id":A(),"onUpdate:zoom":A(),onError:A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),centerSyncTimeoutId:void 0}},data(){return{map:O.typed(),isDestroyed:!1}},computed:{propsJson(){return exports.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(i){var t;i&&((t=this.map)==null||t.setGestureHandling(i))},minZoom(i){var t;(t=this.map)==null||t.setMinZoom(i)},maxZoom(i){var t;(t=this.map)==null||t.setMaxZoom(i)},mapStyle(i){var t;(t=this.map)==null||t.setMapStyle(i)},mapTypeId(i){var t;i&&((t=this.map)==null||t.setBuildInMapTypeId(i))},mapType(i){var t;(t=this.map)==null||t.setMapType(i??exports.MapType.NORMAL)}},async mounted(){const i=this.type;try{await Xr(i)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${i})已销毁, 不需要继续执行`);return}const t=exports.TgMapFactory.createMap(i,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=C.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),ee(this.attrs.listeners,t,["load"]),this.$emit("load",t),C.watch([()=>this.zoom,()=>this.center],([n,s],[a,h])=>{n!==a&&t.setZoom(n),s!==h&&(t.getCenter().equals(s)||t.setCenter(s))}),this.attrs.listenerProps["update:center"]){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),this.attrs.listenerProps["update:zoom"]&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e=this.attrs.listenerProps["update:map-type"],r=this.attrs.listenerProps["update:map-type-id"];(e||r)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),r&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),te=(i,t)=>{const e=i.__vccOpts||i;for(const[r,n]of t)e[r]=n;return e};function an(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",C.mergeProps({class:"tg-map"},i.attrs.binds),[C.createElementVNode("div",{ref:"map",class:C.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${i.type}`]:i.hideLogo})},null,2),C.createCommentVNode("",!0),i.map?C.renderSlot(i.$slots,"default",{key:1}):C.createCommentVNode("",!0),C.renderSlot(i.$slots,"overlay")],16)}const Ge=te(on,[["render",an]]);function ln(i){if(i==null)return;let t;if(typeof i=="string"){if(t=+i,Number.isNaN(t))return i}else t=i;return`${t}px`}const hn=C.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:ln}});function cn(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",{class:C.normalizeClass(i.$options.name),style:C.normalizeStyle({left:i.dimen(i.left),top:i.dimen(i.topValue),right:i.dimen(i.right),bottom:i.dimen(i.bottom)})},[C.renderSlot(i.$slots,"default")],6)}const dn=te(hn,[["render",cn]]),un=C.defineComponent({name:"tg-custom-control",mixins:[$],props:{position:F(R,R.RIGHT_BOTTOM)},setup(){return{control:O.lateinit()}},watch:{position(){this.recreate()}},onCreate(){Zt(this.$parent,Ge)||console.warn("请将tg-custom-control放到tg-map中");const{$el:i}=this,t=class extends Cr{onCreateElement(){return i}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function pn(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",{class:C.normalizeClass(i.$options.name)},[C.renderSlot(i.$slots,"default")],2)}const gn=te(un,[["render",pn]]),mn=C.defineComponent({name:"tg-map-type-control",mixins:[$],props:{position:F(R,R.TOP_LEFT),type:F(Ht),mapTypes:T(Array)},setup(){return{control:O.lateinit()}},watch:{position(i){this.control.setPosition(i)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),fn=C.defineComponent({name:"tg-scale-control",mixins:[$],props:{position:F(R,R.BOTTOM_RIGHT)},setup(){return{control:O.lateinit()}},watch:{position(i){this.control.setPosition(i)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function ti(){var e;const i=(e=C.getCurrentInstance())==null?void 0:e.type;let t=(i==null?void 0:i.name)??(i==null?void 0:i.__name);if(!t){const r=i==null?void 0:i.__file;r&&(t=O.path.basename(r,".vue"))}return t}function It(){const i=C.inject(Bt);let t,e;return i==null&&O.throwError(`<${ti()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:i,get map(){return i.value??O.throwError("map尚未初始化")},[me](r){C.onMounted(r),t&&O.throwError(`${me}只能调用一次`),t=r},[fe](r){C.onBeforeUnmount(r),e&&O.throwError(`${fe}只能调用一次`),e=r},recreate(){e==null||e(),t==null||t()}}}const yn=C.defineComponent({name:"tg-street-view-control",props:{position:F(R,R.RIGHT_BOTTOM)},setup(i){let t=O.lateinit();const{map:e,onCreate:r,onDestroy:n}=It();return r(()=>{t=e.createStreetViewControl(i),e.addControl(t)}),n(()=>{e.removeControl(t)}),C.watch(()=>i.position,s=>{t.setPosition(s)}),$e}}),vn=C.defineComponent({name:"tg-zoom-control",props:{position:F(R,R.RIGHT_BOTTOM)},setup(i){let t=O.lateinit();const{map:e,onCreate:r,onDestroy:n}=It();return r(()=>{t=e.createZoomControl(i),e.addControl(t)}),n(()=>{e.removeControl(t)}),C.watch(()=>i.position,s=>{t.setPosition(s)}),$e}}),_n=C.defineComponent({name:"tg-heatmap",props:{maxIntensity:T(Number),gradient:T(Object),opacity:T(Number),radius:T(Number),data:W(Array)},setup(i){const{map:t,onCreate:e,onDestroy:r}=It();let n=O.lateinit();return e(()=>{n=t.createHeatmap(i)}),r(()=>{n.remove()}),C.watch(()=>i.data,s=>n.setData(s)),C.watch([()=>i.maxIntensity,()=>i.gradient,()=>i.opacity,()=>i.radius],()=>n.setOptions(i)),$e}}),Mn=C.defineComponent({name:"tg-marker-clusterer",mixins:[$],props:{gridSize:T(Number),maxZoom:T(Number),minClusterSize:T(Number),averageCenter:T(Boolean),styles:T(Array),stylesIndexCalculator:T(Function),zIndex:T(Number)},setup(){return{clusterer:O.lateinit(),markers:O.typed([])}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(i){this.markers.push(i),this.isInitiated()&&this.clusterer.addMarker(i)},onRemoveMarker(i){this.isInitiated()&&this.clusterer.removeMarker(i),O.Arrays.remove(this.markers,i)}}});function bn(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",{class:C.normalizeClass(i.$options.name)},[C.renderSlot(i.$slots,"default")],2)}const ri=te(Mn,[["render",bn]]),Cn=C.defineComponent({name:"tg-traffic-layer",mixins:[$],setup(){return{layer:O.lateinit()}},watch:{},onCreate(){this.layer=new Or,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),Tn=C.defineComponent({name:"tg-circle",mixins:[$],inheritAttrs:!1,props:{center:W(x),radius:W(Number),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:center":A(),"onUpdate:radius":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit(),emittedRadius:void 0,emittedCenter:void 0}},watch:{center(i){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===C.toRaw(i))return}this.overlay.setCenter(i)},radius(i){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===i)return}this.overlay.setRadius(i)},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),ee(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class On extends Fr{constructor(t,e,r,n){super(t,e),this.content=r,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const wn=C.defineComponent({name:"tg-element-overlay",mixins:[$],props:{mapPane:F(ue,ue.overlayMouseTarget),position:W(x)},setup(){return{overlay:O.lateinit()}},watch:{position(i){this.overlay.setPosition(i)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new On(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function xn(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",C.mergeProps({class:i.$options.name},i.$attrs),[C.renderSlot(i.$slots,"default")],16)}const Pn=te(wn,[["render",xn]]),Ln=C.defineComponent({name:"tg-marker",mixins:[$],inheritAttrs:!1,props:{position:W(x),title:T(String),label:T(Object),icon:T(Object),clickable:T(Boolean),draggable:T(Boolean),crossOnDrag:T(Boolean),cursor:T(String),zIndex:T(Number),visible:T(Boolean),normalizePositionForBaidu:T(Boolean),autoAddToClusterer:T(Boolean,!0),"onUpdate:position":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),marker:O.lateinit(),labelOverlay:O.typed(),info:O.typed(),emittedPosition:void 0,autoAddToClustererWhenCreate:i.autoAddToClusterer}},watch:{position(i){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===C.toRaw(i))return}this.marker.setPosition(i)},title(i){this.marker.setTitle(i)},label(i,t){O.deepEqual(i,t)||(i?this.marker.setLabel(i):this.recreate())},icon(i){i?this.marker.setIcon(i):this.recreate()},clickable(i){this.marker instanceof ge?this.recreate():this.marker.setClickable(i)},draggable(i){this.marker.setDraggable(i)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(i){this.marker instanceof ge?this.recreate():this.marker.setZIndex(i)},visible(i){this.marker.setVisible(i)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.labelOverlay&&this.marker.attachLabelOverlay(this.labelOverlay.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),ee(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",i=>{this.$emit("update:position",this.emittedPosition=i.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return Zt(this.$parent,ri)},onAddLabel(i){this.labelOverlay=i,this.marker&&this.marker.attachLabelOverlay(i.overlay)},onRemoveLabel(i){this.marker.attachLabelOverlay(void 0),this.labelOverlay=void 0},onAddInfo(i){this.info=i,this.marker&&i.show&&i.overlay.open(this.marker)},onRemoveInfo(i){i.overlay.close(),this.info=void 0},onInfoShowChanged(i,t){t?i.overlay.open(this.marker):i.overlay.close()}}});function En(i,t,e,r,n,s){return C.renderSlot(i.$slots,"default")}const St=te(Ln,[["render",En]]),Bn=C.defineComponent({name:"tg-info-box",mixins:[$],inheritAttrs:!1,props:{show:W(Boolean),position:T(x),offset:T(Object),maxWidth:T(Number),borderClass:T(String),zIndex:T(Number),"onUpdate:show":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit()}},watch:{show(i){this.$marker()?this.$marker().onInfoShowChanged(this,i):i?this.overlay.open():this.overlay.close()},position(i){this.overlay.setPosition(i)},offset(){this.recreate()},maxWidth(i){this.overlay.setMaxWidth(i)},borderClass(){this.recreate()},zIndex(i){this.overlay.setZIndex(i)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),ee(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return tt(St,this.$parent,Ge)},open(i){this.overlay.open(i)},close(){this.overlay.close()}}});function In(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",C.mergeProps({class:i.$options.name},i.attrs.binds),[C.renderSlot(i.$slots,"default")],16)}const Sn=te(Bn,[["render",In]]),kn=C.defineComponent({name:"tg-info-window",mixins:[$],inheritAttrs:!1,props:{show:W(Boolean),position:T(x),maxWidth:T(Number),offset:T(Object),disableAutoPan:T(Boolean),"onUpdate:show":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit()}},watch:{show(i){this.$marker()?this.$marker().onInfoShowChanged(this,i):i?this.overlay.open():this.overlay.close()},position(i){this.overlay.setPosition(i)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return tt(St,this.$parent,Ge)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),ee(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function An(i,t,e,r,n,s){return C.withDirectives((C.openBlock(),C.createElementBlock("div",C.mergeProps({class:i.$options.name},i.attrs.binds),[C.renderSlot(i.$slots,"default")],16)),[[C.vShow,i.show]])}const Rn=te(kn,[["render",An]]),Dn=C.defineComponent({name:"tg-label",mixins:[$],inheritAttrs:!1,props:{position:T(x),offset:T(Object),zIndex:T(Number),mapPane:F(ue)},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t),overlay:O.lateinit()}},watch:{position(i){this.overlay.setPosition(i)},offset(i){this.overlay.setOffset(i)},zIndex(i){this.overlay.setZIndex(i)},visible(i){this.overlay.setVisible(i)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var i;return(i=this.$marker())==null?void 0:i.marker},$marker(){return tt(St,this.$parent,Ge)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),ee(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function zn(i,t,e,r,n,s){return C.openBlock(),C.createElementBlock("div",C.mergeProps({class:i.$options.name},i.attrs.binds),[C.renderSlot(i.$slots,"default")],16)}const $n=te(Dn,[["render",zn]]),Gn=C.defineComponent({name:"tg-polygon",mixins:[$],inheritAttrs:!1,props:{paths:W(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:paths":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit(),emittedPaths:void 0}},watch:{paths:{handler(i){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===i.length&&t.every((e,r)=>e===C.toRaw(i[r])))return}this.overlay.setPaths(i)},deep:!0},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),ee(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),Nn=C.defineComponent({name:"tg-polyline",mixins:[$],inheritAttrs:!1,props:{path:W(Array),icons:T(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),"onUpdate:path":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit(),emittedPath:void 0}},watch:{path:{handler(i){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===C.toRaw(i))return}this.overlay.setPath(i)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),ee(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),Zn=C.defineComponent({name:"tg-rectangle",mixins:[$],inheritAttrs:!1,props:{bounds:W(Object),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:bounds":A()},emits:void 0,setup(i,{attrs:t}){return{attrs:Q(t,i),overlay:O.lateinit(),emittedBounds:void 0}},watch:{bounds(i){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(i))return}this.overlay.setBounds(i)},clickable(){this.recreate()},editable(i){this.overlay.setEditable(i)},strokeColor(i){this.overlay.setStrokeColor(i)},strokeOpacity(i){this.overlay.setStrokeOpacity(i)},strokeWeight(i){this.overlay.setStrokeWeight(i)},fillColor(i){this.overlay.setFillColor(i)},fillOpacity(i){this.overlay.setFillOpacity(i)},visible(i){this.overlay.setVisible(i)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),ee(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),Wn=["beforeUpdate","updated"],Hn={install(i,t={}){if(t.enable!==!1){const e=C.defineComponent({beforeCreate(){const r=ti()??"",s=(t.nameRegex||/^[A-Z]/).test(r)?a=>{t.hookNames?t.hookNames.includes(a)&&console.debug("[lifecycle]",r,a):Wn.includes(a)||console.debug("[lifecycle]",r,a)}:O.noop;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(r){this.__life_impl(r)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});i.mixin(e)}}},ye=6371009;function jn(i,t,e){return i<t?t:i>e?e:i}function Ae(i,t,e){return i>=t&&i<e?i:Vn(i-t,e-t)+t}function Vn(i,t){return(i%t+t)%t}function ce(i){return Math.log(Math.tan(i*.5+Math.PI/4))}function Fn(i){return 2*Math.atan(Math.exp(i))-Math.PI/2}function Re(i){const t=Math.sin(i*.5);return t*t}function Un(i){return 2*Math.asin(Math.sqrt(i))}function qn(i){return 2*Math.sqrt(i*(1-i))}function Yn(i){const t=i*i;return t/(1+Math.sqrt(1-t))*.5}function Kn(i,t){const e=Math.sqrt(i*(1-i)),r=Math.sqrt(t*(1-t));return 2*(e+r-2*(e*t+r*i))}function Pe(i,t,e){return Re(i-t)+Re(e)*Math.cos(i)*Math.cos(t)}function L(i){return i*Math.PI/180}function oe(i){return i*180/Math.PI}function Xn(i,t){const e=L(i.lat),r=L(i.lng),n=L(t.lat),a=L(t.lng)-r,h=Math.atan2(Math.sin(a)*Math.cos(n),Math.cos(e)*Math.sin(n)-Math.sin(e)*Math.cos(n)*Math.cos(a));return Ae(oe(h),-180,180)}function Jn(i,t,e){t/=ye,e=L(e);const r=L(i.lat),n=L(i.lng),s=Math.cos(t),a=Math.sin(t),h=Math.sin(r),o=Math.cos(r),c=s*h+a*o*Math.cos(e),p=Math.atan2(a*o*Math.sin(e),s-h*c);return{lat:oe(Math.asin(c)),lng:oe(n+p)}}function Qn(i,t,e){e=L(e),t/=ye;const r=Math.cos(t),n=Math.sin(t)*Math.cos(e),s=Math.sin(t)*Math.sin(e),a=Math.sin(L(i.lat)),h=r*r,o=n*n*h+h*h-h*a*a;if(o<0)return null;let c=n*a+Math.sqrt(o);c/=r*r+n*n;const p=(a-n*c)/r;let u=Math.atan2(p,c);if((u<-Math.PI/2||u>Math.PI/2)&&(c=n*a-Math.sqrt(o),c/=r*r+n*n,u=Math.atan2(p,c)),u<-Math.PI/2||u>Math.PI/2)return null;const g=L(i.lng)-Math.atan2(s,r*Math.cos(u)-n*Math.sin(u));return{lat:oe(u),lng:oe(g)}}function es(i,t,e){const r=L(i.lat),n=L(i.lng),s=L(t.lat),a=L(t.lng),h=Math.cos(r),o=Math.cos(s),c=tr(i,t),p=Math.sin(c);if(p<1e-6)return{lat:i.lat+e*(t.lat-i.lat),lng:i.lng+e*(t.lng-i.lng)};const u=Math.sin((1-e)*c)/p,g=Math.sin(e*c)/p,y=u*h*Math.cos(n)+g*o*Math.cos(a),_=u*h*Math.sin(n)+g*o*Math.sin(a),M=u*Math.sin(r)+g*Math.sin(s),b=Math.atan2(M,Math.sqrt(y*y+_*_)),l=Math.atan2(_,y);return{lat:oe(b),lng:oe(l)}}function ii(i,t,e,r){return Un(Pe(i,e,t-r))}function tr(i,t){return ii(L(i.lat),L(i.lng),L(t.lat),L(t.lng))}function we(i,t){return tr(i,t)*ye}function ts(i){if(i.length<2)return 0;let t=0,e=null;for(const r of i){if(e){const n=L(e.lat),s=L(e.lng),a=L(r.lat),h=L(r.lng);t+=ii(n,s,a,h)}e=r}return t*ye}function rs(i){return Math.abs(ni(i))}function ni(i,t=ye){const e=i.length;if(e<3)return 0;let r=0;const n=i[e-1];let s=Math.tan((Math.PI/2-L(n.lat))/2),a=L(n.lng);for(const h of i){const o=Math.tan((Math.PI/2-L(h.lat))/2),c=L(h.lng);r+=is(o,c,s,a),s=o,a=c}return r*(t*t)}function is(i,t,e,r){const n=t-r,s=i*e;return 2*Math.atan2(s*Math.sin(n),1+s*Math.cos(n))}const ns=Object.freeze(Object.defineProperty({__proto__:null,computeAngleBetween:tr,computeArea:rs,computeDistanceBetween:we,computeHeading:Xn,computeLength:ts,computeOffset:Jn,computeOffsetOrigin:Qn,computeSignedArea:ni,interpolate:es},Symbol.toStringTag,{value:"Module"}));function ss(i,t,e,r){return(Math.tan(i)*Math.sin(e-r)+Math.tan(t)*Math.sin(r))/Math.sin(e)}function os(i,t,e,r){return(ce(i)*(e-r)+ce(t)*r)/e}function as(i,t,e,r,n,s){if(n>=0&&n>=e||n<0&&n<e||r<=-Math.PI/2||i<=-Math.PI/2||t<=-Math.PI/2||i>=Math.PI/2||t>=Math.PI/2||e<=-Math.PI)return!1;const a=(i*(e-n)+t*n)/e;return i>=0&&t>=0&&r<a?!1:i<=0&&t<=0&&r>=a||r>=Math.PI/2?!0:s?Math.tan(r)>=ss(i,t,e,n):ce(r)>=os(i,t,e,n)}function ls(i,t,e){return si(i.lat,i.lng,t,e)}function si(i,t,e,r){const n=e.length;if(n===0)return!1;const s=L(i),a=L(t),h=e[n-1];let o=L(h.lat),c=L(h.lng),p=0;for(const u of e){const g=Ae(a-c,-Math.PI,Math.PI);if(s===o&&g===0)return!0;const y=L(u.lat),_=L(u.lng);as(o,y,Ae(_-c,-Math.PI,Math.PI),s,g,r)&&++p,o=y,c=_}return(p&1)!==0}const rr=.1;function hs(i,t,e=!0,r=rr){return oi(i,t,!0,e,r)}function cs(i,t,e=!0,r=rr){return oi(i,t,!1,e,r)}function oi(i,t,e,r,n){return ir(i,t,e,r,n)>=0}function ds(i,t,e,r=rr){return ir(i,t,!1,e,r)}function ir(i,t,e,r,n){const s=t.length;if(s===0)return-1;const a=n/ye,h=Re(a),o=L(i.lat),c=L(i.lng),p=t[e?s-1:0];let u=L(p.lat),g=L(p.lng),y=0;if(r)for(const _ of t){const M=L(_.lat),b=L(_.lng);if(ps(u,g,M,b,o,c,h))return Math.max(0,y-1);u=M,g=b,y++}else{const _=o-a,M=o+a;let b=ce(u);const l=ce(o),d=new Array(3);for(const f of t){const v=L(f.lat),w=ce(v),P=L(f.lng);if(Math.max(u,v)>=_&&Math.min(u,v)<=M){const E=Ae(P-g,-Math.PI,Math.PI),S=Ae(c-g,-Math.PI,Math.PI);d[0]=S,d[1]=S+2*Math.PI,d[2]=S-2*Math.PI;for(const D of d){const I=w-b,j=E*E+I*I,k=j<=0?0:jn((D*E+(l-b)*I)/j,0,1),N=k*E,U=b+k*I,Z=Fn(U);if(Pe(o,Z,D-N)<h)return Math.max(0,y-1)}}u=v,g=P,b=w,y++}}return-1}function us(i,t,e,r,n,s){const a=Math.sin(i),h=Math.cos(e),o=Math.cos(n),c=n-i,p=s-t,u=e-i,g=r-t,y=Math.sin(p)*o,_=Math.sin(g)*h,M=Math.sin(c)+2*a*o*Re(p),b=Math.sin(u)+2*a*h*Re(g),l=(y*y+M*M)*(_*_+b*b);return l<=0?1:(y*b-M*_)/Math.sqrt(l)}function ps(i,t,e,r,n,s,a){const h=Pe(i,n,t-s);if(h<=a)return!0;const o=Pe(e,n,r-s);if(o<=a)return!0;const c=us(i,t,e,r,n,s),p=qn(h),u=Yn(p*c);if(u>a)return!1;const g=Pe(i,e,t-r),y=g+u*(1-2*g);if(h>y||o>y)return!1;if(g<.74)return!0;const _=1-2*u,M=(h-u)/_,b=(o-u)/_;return Kn(M,b)>0}function gs(i,t){const e=i.length;if(e<1)throw new Error("Polyline must have at least 1 point");if(t<=0)throw new Error("Tolerance must be greater than zero");const r=ai(i);let n=null;r&&(n=i[i.length-1],i.pop(),i.push({lat:n.lat+1e-11,lng:n.lng+1e-11}));let s,a=0;const h=[],o=new Array(e).fill(0);o[0]=1,o[e-1]=1;let c,p=0,u;if(e>2){const y=[0,e-1];for(h.push(y);h.length>0;){for(u=h.pop(),c=0,s=u[0]+1;s<u[1];++s)p=li(i[s],i[u[0]],i[u[1]]),p>c&&(c=p,a=s);if(c>t){o[a]=c;const _=[u[0],a];h.push(_);const M=[a,u[1]];h.push(M)}}}r&&(i.pop(),i.push(n)),s=0;const g=[];for(const y of i)o[s]!==0&&g.push(y),s++;return g}function ai(i){const t=i[0],e=i[i.length-1];return t.lat===e.lat&&t.lng===e.lng}function li(i,t,e){if(t.lat===e.lat&&t.lng===e.lng)return we(e,i);const r=L(i.lat),n=L(i.lng),s=L(t.lat),a=L(t.lng),h=L(e.lat),o=L(e.lng),c=Math.cos(s),p=h-s,u=(o-a)*c,g=((r-s)*p+(n-a)*c*u)/(p*p+u*u);if(g<=0)return we(i,t);if(g>=1)return we(i,e);const y={lat:t.lat+g*(e.lat-t.lat),lng:t.lng+g*(e.lng-t.lng)};return we(i,y)}function ms(i){const t=i.length,e=[];let r=0,n=0,s=0;for(;r<t;){let a=1,h=0,o;do o=i.charCodeAt(r++)-63-1,a+=o<<h,h+=5;while(o>=31);n+=(a&1)!==0?~(a>>1):a>>1,a=1,h=0;do o=i.charCodeAt(r++)-63-1,a+=o<<h,h+=5;while(o>=31);s+=(a&1)!==0?~(a>>1):a>>1,e.push({lat:n*1e-5,lng:s*1e-5})}return e}function fs(i){let t=0,e=0,r="";for(const n of i){const s=Math.round(n.lat*1e5),a=Math.round(n.lng*1e5),h=s-t,o=a-e;r+=mr(h),r+=mr(o),t=s,e=a}return r}function mr(i){let t=i<0?~(i<<1):i<<1,e="";for(;t>=32;)e+=String.fromCharCode((32|t&31)+63),t>>=5;return e+=String.fromCharCode(t+63),e}const ys=Object.freeze(Object.defineProperty({__proto__:null,containsLocation:ls,containsLocationLatLng:si,decode:ms,distanceToLine:li,encode:fs,isClosedPolygon:ai,isLocationOnEdge:hs,isLocationOnPath:cs,locationIndexOnEdgeOrPath:ir,locationIndexOnPath:ds,simplify:gs},Symbol.toStringTag,{value:"Module"})),vs=6378137;function Le(i){return i*Math.PI/180}function fr(i){return i*180/Math.PI}function _s(i,t){if(i.lat===t.lat&&i.lng===t.lng)return 0;const e=Le((i.lat+t.lat)/2),r=Le((i.lat-t.lat)/2),n=Le((i.lng-t.lng)/2);let s=Math.sin(r),a=Math.sin(n),h=Math.sin(e);const o=vs,c=1/298.257;s=s*s,a=a*a,h=h*h;const p=s*(1-a)+(1-h)*a,u=(1-s)*(1-a)+h*a,g=Math.atan(Math.sqrt(p/u)),y=Math.sqrt(p*u)/g,_=2*g*o,M=(3*y-1)/2/u,b=(3*y+1)/2/p;return _*(1+c*(M*h*(1-s)-b*(1-h)*s))}function hi(i,t,e){const n=63567523142e-4,s=1/298.257223563,a=Le(t),h=Math.sin(a),o=Math.cos(a),c=(1-s)*Math.tan(Le(i.lat)),p=1/Math.sqrt(1+c*c),u=c*p,g=Math.atan2(c,o),y=p*h,_=1-y*y,M=_*(6378137*6378137-n*n)/(n*n),b=1+M/16384*(4096+M*(-768+M*(320-175*M))),l=M/1024*(256+M*(-128+M*(74-47*M)));let d=0,f=0,v=0,w=e/(n*b),P=2*Math.PI;for(;Math.abs(w-P)>1e-12;){d=Math.cos(2*g+w),f=Math.sin(w),v=Math.cos(w);const N=l*f*(d+l/4*(v*(-1+2*d*d)-l/6*d*(-3+4*f*f)*(-3+4*d*d)));P=w,w=e/(n*b)+N}const E=u*f-p*v*o,S=Math.atan2(u*v+p*f*o,(1-s)*Math.sqrt(y*y+E*E)),D=Math.atan2(f*h,p*v-u*f*o),I=s/16*_*(4+s*(4-3*_)),j=D-(1-I)*s*y*(w+I*f*(d+I*v*(-1+2*d*d)));return{lng:i.lng+fr(j),lat:fr(S)}}const Ms={getDistance:_s,getDestination:hi},bs={install(i,t){qr(t);const e=i.config.optionMergeStrategies;e[me]=e[fe]=(r,n)=>r?[...new Set([].concat(r,n))]:Array.isArray(n)?n:[n]}};exports.AbstractControl=it;exports.AbstractMap=ut;exports.Autocomplete=jt;exports.BaiduAutocomplete=Er;exports.BaiduCircle=mt;exports.BaiduControl=nt;exports.BaiduHeatmap=Ir;exports.BaiduInfoBoxOverlay=Mt;exports.BaiduInfoWindow=vt;exports.BaiduMapTypeControl=st;exports.BaiduMapUrls=Ke;exports.BaiduMarker=ge;exports.BaiduMarkerClusterer=Dr;exports.BaiduOverlay=ze;exports.BaiduPlacesService=Gr;exports.BaiduPolyShape=Tt;exports.BaiduPolygon=xt;exports.BaiduPolyline=Ot;exports.BaiduRectangle=Lt;exports.BaiduScaleControl=ot;exports.BaiduSearchBox=Zr;exports.BaiduStreetViewControl=lt;exports.BaiduZoomControl=ct;exports.BuildInMapType=V;exports.BuildInMapTypeId=Wt;exports.CachedValue=he;exports.ControlPosition=R;exports.CoordType=z;exports.CustomControl=Cr;exports.ElementOverlay=Fr;exports.EmptyControl=Tr;exports.FastFindValues=br;exports.GestureHandlingOptions=J;exports.GoogleAutocomplete=Lr;exports.GoogleCircle=ft;exports.GoogleControl=De;exports.GoogleHeatmap=Br;exports.GoogleInfoBoxOverlay=bt;exports.GoogleInfoWindow=_t;exports.GoogleMapTypeControl=Fe;exports.GoogleMapUrls=Ye;exports.GoogleMarker=Ct;exports.GoogleMarkerClusterer=zr;exports.GoogleOverlay=pt;exports.GooglePlacesService=$r;exports.GooglePolygon=Pt;exports.GooglePolyline=wt;exports.GoogleRectangle=Et;exports.GoogleScaleControl=at;exports.GoogleSearchBox=Nr;exports.GoogleStreetViewControl=ht;exports.GoogleZoomControl=dt;exports.Heatmap=Vt;exports.ImageMapType=Ti;exports.InfoWindow=yt;exports.InfoWindowModeValues=Vr;exports.KeyValue=Gt;exports.LatLng=x;exports.LatLngBounds=K;exports.LifecycleLogPlugin=Hn;exports.MIXIN_HOOK_CREATE=me;exports.MIXIN_HOOK_DESTROY=fe;exports.MIXIN_MAP_NAME=Bt;exports.MapMixin=$;exports.MapPane=ue;exports.MapTypeControlType=Ht;exports.MapUrls=Ft;exports.MapZoom=Wr;exports.MarkerClusterer=qt;exports.Overlay=Xt;exports.PlacesService=Yt;exports.PolyUtil=ys;exports.SearchBox=Kt;exports.SphericalUtil=ns;exports.SphericalUtils=Ms;exports.SymbolPath=Hi;exports.TgCircle=Tn;exports.TgCustomControl=gn;exports.TgElementOverlay=Pn;exports.TgHeatmap=_n;exports.TgInfoBox=Sn;exports.TgInfoWindow=Rn;exports.TgLabel=$n;exports.TgMap=Ge;exports.TgMapType=q;exports.TgMapTypeControl=mn;exports.TgMapWidget=dn;exports.TgMarker=St;exports.TgMarkerClusterer=ri;exports.TgPolygon=Gn;exports.TgPolyline=Nn;exports.TgRectangle=Zn;exports.TgScaleControl=fn;exports.TgStreetViewControl=yn;exports.TgTrafficLayer=Cn;exports.TgZoomControl=vn;exports.TrafficLayer=Or;exports.UnionIcon=ke;exports.callHook=Oe;exports.computedSaveOnThis=en;exports.createAsyncSingleton=Kr;exports.createEmptyVNode=$e;exports.createPropertyObject=Qr;exports.createPropertyObjectTyped=tn;exports.debug=Yi;exports.default=bs;exports.eventProp=A;exports.extractVNodeFromSlotsByComponent=nn;exports.findAncestorComponentByType=tt;exports.findByComponentType=rn;exports.getDestination=hi;exports.getTgMapConfig=er;exports.isComponentByType=Ve;exports.isEntryValueDef=Yr;exports.isInstanceOf=yi;exports.loadCachedMap=Xr;exports.optionalProp=T;exports.requiredProp=W;exports.safeAs=vi;exports.safeAsComponent=Zt;exports.setTgMapConfig=qr;exports.splitAttrs=ei;exports.stringEnumProp=F;exports.stringUnionPropFromValues=Jr;exports.todo=qi;exports.unwrapStringEnumValue=_i;exports.useEventLogMethods=sn;exports.useSplittedAttrs=Q;exports.useTgMapInner=It;
|
|
18
18
|
//# sourceMappingURL=tg-map.cjs.map
|