@maptiler/geocoding-control 2.0.1 → 2.1.0-with-autocomplete-timeout
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/MapLibreBasedGeocodingControl.d.ts +1037 -626
- package/icons/10pin.svg +4 -1
- package/icons/9pin.svg +4 -1
- package/icons/alcohol.svg +1 -1
- package/icons/alpine_hut.svg +1 -1
- package/icons/apartment.svg +4 -1
- package/icons/area.svg +1 -5
- package/icons/artwork.svg +4 -1
- package/icons/beauty.svg +14 -1
- package/icons/bicycle_repair_station.svg +18 -1
- package/icons/biergarten.svg +4 -1
- package/icons/books.svg +14 -1
- package/icons/bowl.svg +4 -1
- package/icons/bowling_alley.svg +4 -1
- package/icons/bus_station.svg +1 -1
- package/icons/camping.svg +1 -1
- package/icons/car_repair.svg +14 -1
- package/icons/car_wash.svg +19 -1
- package/icons/cave_entrance.svg +15 -1
- package/icons/chalet.svg +1 -1
- package/icons/chemist.svg +14 -1
- package/icons/church.svg +4 -1
- package/icons/community_centre.svg +20 -1
- package/icons/firestation.svg +4 -1
- package/icons/guest_house.svg +29 -8
- package/icons/hotel.svg +1 -1
- package/icons/housenumber.svg +19 -14
- package/icons/hut.svg +1 -4
- package/icons/medical_supply.svg +20 -1
- package/icons/memorial.svg +14 -1
- package/icons/motel.svg +19 -1
- package/icons/post.svg +1 -1
- package/icons/post_office.svg +1 -1
- package/icons/postal_code.svg +1 -23
- package/icons/public_bookcase.svg +14 -1
- package/icons/public_building.svg +4 -1
- package/icons/shintoist.svg +1 -1
- package/icons/street.svg +11 -14
- package/icons/vehicle_inspection.svg +18 -1
- package/icons/wilderness_hut.svg +1 -1
- package/leaflet-controller.js +32 -31
- package/leaflet-controller.js.map +1 -1
- package/leaflet-controller.umd.js +1 -1
- package/leaflet-controller.umd.js.map +1 -1
- package/leaflet.d.ts +32 -1
- package/leaflet.js +1611 -1416
- package/leaflet.js.map +1 -1
- package/leaflet.umd.js +3 -3
- package/leaflet.umd.js.map +1 -1
- package/maplibregl-controller.js +5 -5
- package/maplibregl-controller.js.map +1 -1
- package/maplibregl-controller.umd.js +1 -1
- package/maplibregl-controller.umd.js.map +1 -1
- package/maplibregl.d.ts +527 -626
- package/maplibregl.js +1968 -1778
- package/maplibregl.js.map +1 -1
- package/maplibregl.umd.js +3 -3
- package/maplibregl.umd.js.map +1 -1
- package/maptilersdk.d.ts +527 -626
- package/maptilersdk.js +1966 -1776
- package/maptilersdk.js.map +1 -1
- package/maptilersdk.umd.js +3 -3
- package/maptilersdk.umd.js.map +1 -1
- package/openlayers-controller.js +5 -4
- package/openlayers-controller.js.map +1 -1
- package/openlayers-controller.umd.js +1 -1
- package/openlayers-controller.umd.js.map +1 -1
- package/openlayers.d.ts +32 -1
- package/openlayers.js +2082 -1887
- package/openlayers.js.map +1 -1
- package/openlayers.umd.js +3 -3
- package/openlayers.umd.js.map +1 -1
- package/package.json +23 -23
- package/react.d.ts +27 -1
- package/react.js +1320 -1145
- package/react.js.map +1 -1
- package/react.umd.js +1 -1
- package/react.umd.js.map +1 -1
- package/style.css +1 -1
- package/svelte/FeatureItem.svelte +59 -12
- package/svelte/FeatureItem.svelte.d.ts +2 -2
- package/svelte/GeocodingControl.svelte +182 -85
- package/svelte/GeocodingControl.svelte.d.ts +11 -3
- package/svelte/MapLibreBasedGeocodingControl.d.ts +1037 -626
- package/svelte/MapLibreBasedGeocodingControl.js +36 -6
- package/svelte/leaflet-controller.js +3 -3
- package/svelte/leaflet.d.ts +32 -1
- package/svelte/leaflet.js +35 -2
- package/svelte/maplibregl-controller.js +3 -3
- package/svelte/maplibregl.d.ts +527 -626
- package/svelte/maptilersdk.d.ts +527 -626
- package/svelte/openlayers-controller.js +4 -4
- package/svelte/openlayers.d.ts +32 -1
- package/svelte/openlayers.js +36 -3
- package/svelte/react.d.ts +27 -1
- package/svelte/react.js +16 -4
- package/svelte/types.d.ts +24 -1
- package/svelte/vanilla.d.ts +32 -1
- package/svelte/vanilla.js +35 -2
- package/types.d.ts +24 -1
- package/vanilla.d.ts +32 -1
- package/vanilla.js +1184 -990
- package/vanilla.js.map +1 -1
- package/vanilla.umd.js +1 -1
- package/vanilla.umd.js.map +1 -1
- package/icons/aerodrome.12.svg +0 -1
- package/icons/bus_stop.12.svg +0 -1
- package/icons/elevator.12.svg +0 -1
- /package/icons/{helipad.16.svg → helipad.svg} +0 -0
- /package/icons/{traffic_light.13.svg → traffic_light.svg} +0 -0
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
20
20
|
and limitations under the License.
|
|
21
21
|
***************************************************************************** */function fe(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u;return u={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function l(f){return function(p){return c([f,p])}}function c(f){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,i&&(o=f[0]&2?i.return:f[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,f[1])).done)return o;switch(i=0,o&&(f=[f[0]&2,o.value]),f[0]){case 0:case 1:o=f;break;case 4:return e.label++,{value:f[1],done:!1};case 5:e.label++,i=f[1],f=[0];continue;case 7:f=e.ops.pop(),e.trys.pop();continue;default:if(o=e.trys,!(o=o.length>0&&o[o.length-1])&&(f[0]===6||f[0]===2)){e=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]<o[3])){e.label=f[1];break}if(f[0]===6&&e.label<o[1]){e.label=o[1],o=f;break}if(o&&e.label<o[2]){e.label=o[2],e.ops.push(f);break}o[2]&&e.ops.pop(),e.trys.pop();continue}f=t.call(r,e)}catch(p){f=[6,p],i=0}finally{n=o=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}var G=function(){function r(t,e){this.next=null,this.key=t,this.data=e,this.left=null,this.right=null}return r}();function ce(r,t){return r>t?1:r<t?-1:0}function T(r,t,e){for(var n=new G(null,null),i=n,o=n;;){var u=e(r,t.key);if(u<0){if(t.left===null)break;if(e(r,t.left.key)<0){var l=t.left;if(t.left=l.right,l.right=t,t=l,t.left===null)break}o.left=t,o=t,t=t.left}else if(u>0){if(t.right===null)break;if(e(r,t.right.key)>0){var l=t.right;if(t.right=l.left,l.left=t,t=l,t.right===null)break}i.right=t,i=t,t=t.right}else break}return i.right=t.left,o.left=t.right,t.left=n.right,t.right=n.left,t}function ht(r,t,e,n){var i=new G(r,t);if(e===null)return i.left=i.right=null,i;e=T(r,e,n);var o=n(r,e.key);return o<0?(i.left=e.left,i.right=e,e.left=null):o>=0&&(i.right=e.right,i.left=e,e.right=null),i}function It(r,t,e){var n=null,i=null;if(t){t=T(r,t,e);var o=e(t.key,r);o===0?(n=t.left,i=t.right):o<0?(i=t.right,t.right=null,n=t):(n=t.left,t.left=null,i=t)}return{left:n,right:i}}function he(r,t,e){return t===null?r:(r===null||(t=T(r.key,t,e),t.left=r),t)}function at(r,t,e,n,i){if(r){n(""+t+(e?"└── ":"├── ")+i(r)+`
|
|
22
|
-
`);var o=t+(e?" ":"│ ");r.left&&at(r.left,o,!1,n,i),r.right&&at(r.right,o,!0,n,i)}}var pt=function(){function r(t){t===void 0&&(t=ce),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ht(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new G(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=T(t,this._root,i),u=i(t,o.key);return u===0?this._root=o:(u<0?(n.left=o.left,n.right=o,o.left=null):u>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=T(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=T(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=T(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=T(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],u=this._comparator,l=this._root,c;o.length!==0||l;)if(l)o.push(l),l=l.left;else{if(l=o.pop(),c=u(l.key,e),c>0)break;if(u(l.key,t)>=0&&n.call(i,l))return this;l=l.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return pe(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&dt(t,e,0,i-1,o),this._root===null)this._root=gt(t,e,0,i),this._size=i;else{var u=ge(this.toList(),ae(t,e),o);i=this._size+i,this._root=yt({head:u},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return at(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=It(t,this._root,i),u=o.left,l=o.right;i(t,e)<0?l=ht(e,n,l,i):u=ht(e,n,u,i),this._root=he(u,l,i)},r.prototype.split=function(t){return It(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return fe(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function gt(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),u=r[o],l=t[o],c=new G(u,l);return c.left=gt(r,t,e,o),c.right=gt(r,t,o+1,n),c}return null}function ae(r,t){for(var e=new G(null,null),n=e,i=0;i<r.length;i++)n=n.next=new G(r[i],t[i]);return n.next=null,e.next}function pe(r){for(var t=r,e=[],n=!1,i=new G(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function yt(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=yt(r,t,i),u=r.head;return u.left=o,r.head=r.head.next,u.right=yt(r,i+1,e),u}return null}function ge(r,t,e){for(var n=new G(null,null),i=n,o=r,u=t;o!==null&&u!==null;)e(o.key,u.key)<0?(i.next=o,o=o.next):(i.next=u,u=u.next),i=i.next;return o!==null?i.next=o:u!==null&&(i.next=u),n.next}function dt(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],u=e-1,l=n+1;;){do u++;while(i(r[u],o)<0);do l--;while(i(r[l],o)>0);if(u>=l)break;var c=r[u];r[u]=r[l],r[l]=c,c=t[u],t[u]=t[l],t[l]=c}dt(r,t,e,l,i),dt(r,t,l+1,n,i)}}const N=11102230246251565e-32,E=134217729,ye=(3+8*N)*N;function xt(r,t,e,n,i){let o,u,l,c,f=t[0],p=n[0],s=0,a=0;p>f==p>-f?(o=f,f=t[++s]):(o=p,p=n[++a]);let h=0;if(s<r&&a<e)for(p>f==p>-f?(u=f+o,l=o-(u-f),f=t[++s]):(u=p+o,l=o-(u-p),p=n[++a]),o=u,l!==0&&(i[h++]=l);s<r&&a<e;)p>f==p>-f?(u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s]):(u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a]),o=u,l!==0&&(i[h++]=l);for(;s<r;)u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s],o=u,l!==0&&(i[h++]=l);for(;a<e;)u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a],o=u,l!==0&&(i[h++]=l);return(o!==0||h===0)&&(i[h++]=o),h}function de(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function J(r){return new Float64Array(r)}const xe=(3+16*N)*N,me=(2+12*N)*N,ve=(9+64*N)*N*N,U=J(4),$t=J(8),kt=J(12),Ot=J(16),P=J(4);function be(r,t,e,n,i,o,u){let l,c,f,p,s,a,h,g,d,b,y,m,x,v,w,_,R,S;const $=r-i,k=e-i,O=t-o,A=n-o;v=$*A,a=E*$,h=a-(a-$),g=$-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=O*k,a=E*O,h=a-(a-O),g=O-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,U[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,U[1]=x-(y+s)+(s-_),S=m+y,s=S-m,U[2]=m-(S-s)+(y-s),U[3]=S;let B=de(4,U),et=me*u;if(B>=et||-B>=et||(s=r-$,l=r-($+s)+(s-i),s=e-k,f=e-(k+s)+(s-i),s=t-O,c=t-(O+s)+(s-o),s=n-A,p=n-(A+s)+(s-o),l===0&&c===0&&f===0&&p===0)||(et=ve*u+ye*Math.abs(B),B+=$*p+A*l-(O*f+k*c),B>=et||-B>=et))return B;v=l*A,a=E*l,h=a-(a-l),g=l-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=c*k,a=E*c,h=a-(a-c),g=c-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const sn=xt(4,U,4,P,$t);v=$*p,a=E*$,h=a-(a-$),g=$-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=O*f,a=E*O,h=a-(a-O),g=O-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const ln=xt(sn,$t,4,P,kt);v=l*p,a=E*l,h=a-(a-l),g=l-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=c*f,a=E*c,h=a-(a-c),g=c-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const un=xt(ln,kt,4,P,Ot);return Ot[un-1]}function we(r,t,e,n,i,o){const u=(t-o)*(e-i),l=(r-i)*(n-o),c=u-l,f=Math.abs(u+l);return Math.abs(c)>=xe*f?c:-be(r,t,e,n,i,o,f)}const W=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,mt=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,o=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:o}}};let z=Number.EPSILON;z===void 0&&(z=Math.pow(2,-52));const Ee=z*z,At=(r,t)=>{if(-z<r&&r<z&&-z<t&&t<z)return 0;const e=r-t;return e*e<Ee*r*t?0:r<t?-1:1};class _e{constructor(){this.reset()}reset(){this.xRounder=new Nt,this.yRounder=new Nt}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class Nt{constructor(){this.tree=new pt,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&At(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&At(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const K=new _e,nt=(r,t)=>r.x*t.y-r.y*t.x,Bt=(r,t)=>r.x*t.x+r.y*t.y,Gt=(r,t,e)=>{const n=we(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},rt=r=>Math.sqrt(Bt(r,r)),Se=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return nt(i,n)/rt(i)/rt(n)},Pe=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Bt(i,n)/rt(i)/rt(n)},Tt=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},zt=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},Me=(r,t,e,n)=>{if(t.x===0)return zt(e,n,r.x);if(n.x===0)return zt(r,t,e.x);if(t.y===0)return Tt(e,n,r.y);if(n.y===0)return Tt(r,t,e.y);const i=nt(t,n);if(i==0)return null;const o={x:e.x-r.x,y:e.y-r.y},u=nt(o,t)/i,l=nt(o,n)/i,c=r.x+l*t.x,f=e.x+u*n.x,p=r.y+l*t.y,s=e.y+u*n.y,a=(c+f)/2,h=(p+s)/2;return{x:a,y:h}};class C{static compare(t,e){const n=C.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const o=e[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const o=i.otherSE;e.set(i,{sine:Se(this.point,t.point,o.point),cosine:Pe(this.point,t.point,o.point)})};return(i,o)=>{e.has(i)||n(i),e.has(o)||n(o);const{sine:u,cosine:l}=e.get(i),{sine:c,cosine:f}=e.get(o);return u>=0&&c>=0?l<f?1:l>f?-1:0:u<0&&c<0?l<f?-1:l>f?1:0:c<u?-1:c>u?1:0}}}let Le=0;class F{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,o=t.rightSE.point.x,u=e.rightSE.point.x;if(u<n)return 1;if(o<i)return-1;const l=t.leftSE.point.y,c=e.leftSE.point.y,f=t.rightSE.point.y,p=e.rightSE.point.y;if(n<i){if(c<l&&c<f)return 1;if(c>l&&c>f)return-1;const s=t.comparePoint(e.leftSE.point);if(s<0)return 1;if(s>0)return-1;const a=e.comparePoint(t.rightSE.point);return a!==0?a:-1}if(n>i){if(l<c&&l<p)return-1;if(l>c&&l>p)return 1;const s=e.comparePoint(t.leftSE.point);if(s!==0)return s;const a=t.comparePoint(e.rightSE.point);return a<0?1:a>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(o<u){const s=e.comparePoint(t.rightSE.point);if(s!==0)return s}if(o>u){const s=t.comparePoint(e.rightSE.point);if(s<0)return 1;if(s>0)return-1}if(o!==u){const s=f-l,a=o-n,h=p-c,g=u-i;if(s>a&&h<g)return 1;if(s<a&&h>g)return-1}return o>u?1:o<u||f<p?-1:f>p?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++Le,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,o,u;const l=C.comparePoints(t,e);if(l<0)i=t,o=e,u=1;else if(l>0)i=e,o=t,u=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new C(i,!0),f=new C(o,!1);return new F(c,f,[n],[u])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const o=(t.y-e.y)/i.y,u=e.x+o*i.x;if(t.x===u)return 0;const l=(t.x-e.x)/i.x,c=e.y+l*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=mt(e,n);if(i===null)return null;const o=this.leftSE.point,u=this.rightSE.point,l=t.leftSE.point,c=t.rightSE.point,f=W(e,l)&&this.comparePoint(l)===0,p=W(n,o)&&t.comparePoint(o)===0,s=W(e,c)&&this.comparePoint(c)===0,a=W(n,u)&&t.comparePoint(u)===0;if(p&&f)return a&&!s?u:!a&&s?c:null;if(p)return s&&o.x===c.x&&o.y===c.y?null:o;if(f)return a&&u.x===l.x&&u.y===l.y?null:l;if(a&&s)return null;if(a)return u;if(s)return c;const h=Me(o,this.vector(),l,t.vector());return h===null||!W(i,h)?null:K.round(h.x,h.y)}split(t){const e=[],n=t.events!==void 0,i=new C(t,!0),o=new C(t,!1),u=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);const l=new F(i,u,this.rings.slice(),this.windings.slice());return C.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),C.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=F.compare(e,n);if(i!==0){if(i>0){const o=e;e=n,n=o}if(e.prev===n){const o=e;e=n,n=o}for(let o=0,u=n.rings.length;o<u;o++){const l=n.rings[o],c=n.windings[o],f=e.rings.indexOf(l);f===-1?(e.rings.push(l),e.windings.push(c)):e.windings[f]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const f=this.rings[l],p=this.windings[l],s=e.indexOf(f);s===-1?(e.push(f),n.push(p)):n[s]+=p}const o=[],u=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const f=e[l],p=f.poly;if(u.indexOf(p)===-1)if(f.isExterior)o.push(p);else{u.indexOf(p)===-1&&u.push(p);const s=o.indexOf(f.poly);s!==-1&&o.splice(s,1)}}for(let l=0,c=o.length;l<c;l++){const f=o[l].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(I.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===I.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${I.type}`)}return this._isInResult}}class Ft{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=K.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let u=1,l=t.length;u<l;u++){if(typeof t[u][0]!="number"||typeof t[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=K.round(t[u][0],t[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(F.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(F.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class Ce{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ft(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const o=new Ft(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class qt{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const o=new Ce(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class it{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let u=null,l=o.leftSE,c=o.rightSE;const f=[l],p=l.point,s=[];for(;u=l,l=c,f.push(l),l.point!==p;)for(;;){const a=l.getAvailableLinkedEvents();if(a.length===0){const d=f[0].point,b=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(a.length===1){c=a[0].otherSE;break}let h=null;for(let d=0,b=s.length;d<b;d++)if(s[d].point===l.point){h=d;break}if(h!==null){const d=s.splice(h)[0],b=f.splice(d.index);b.unshift(b[0].otherSE),e.push(new it(b.reverse()));continue}s.push({index:f.length,point:l.point});const g=l.getLeftmostComparator(u);c=a.sort(g)[0].otherSE;break}e.push(new it(f))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let f=1,p=this.events.length-1;f<p;f++){const s=this.events[f].point,a=this.events[f+1].point;Gt(s,t,a)!==0&&(e.push(s),t=s)}if(e.length===1)return null;const n=e[0],i=e[1];Gt(n,t,i)===0&&e.shift(),e.push(e[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let f=u;f!=l;f+=o)c.push([e[f].x,e[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const u=this.events[i];C.compare(t,u)>0&&(t=u)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class jt{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class Re{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())e.push(new jt(o));else{const u=o.enclosingRing();u.poly||e.push(new jt(u)),u.poly.addInterior(o)}}return e}}class Ie{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F.compare;this.queue=t,this.tree=new pt(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let o=i,u=i,l,c;for(;l===void 0;)o=this.tree.prev(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(t.isLeft){let f=null;if(l){const s=l.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(f=s),!l.isAnEndpoint(s))){const a=this._splitSafely(l,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}let p=null;if(c){const s=c.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(p=s),!c.isAnEndpoint(s))){const a=this._splitSafely(c,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}if(f!==null||p!==null){let s=null;f===null?s=p:p===null?s=f:s=C.comparePoints(f,p)<=0?f:p,this.queue.remove(e.rightSE),n.push(e.rightSE);const a=e.split(s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const f=l.getIntersection(c);if(f!==null){if(!l.isAnEndpoint(f)){const p=this._splitSafely(l,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}if(!c.isAnEndpoint(f)){const p=this._splitSafely(c,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,$e=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class ke{run(t,e,n){I.type=t,K.reset();const i=[new qt(e,!0)];for(let s=0,a=n.length;s<a;s++)i.push(new qt(n[s],!1));if(I.numMultiPolys=i.length,I.type==="difference"){const s=i[0];let a=1;for(;a<i.length;)mt(i[a].bbox,s.bbox)!==null?a++:i.splice(a,1)}if(I.type==="intersection")for(let s=0,a=i.length;s<a;s++){const h=i[s];for(let g=s+1,d=i.length;g<d;g++)if(mt(h.bbox,i[g].bbox)===null)return[]}const o=new pt(C.compare);for(let s=0,a=i.length;s<a;s++){const h=i[s].getSweepEvents();for(let g=0,d=h.length;g<d;g++)if(o.insert(h[g]),o.size>Qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Ie(o);let l=o.size,c=o.pop();for(;c;){const s=c.key;if(o.size===l){const h=s.segment;throw new Error(`Unable to pop() ${s.isLeft?"left":"right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>$e)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const a=u.process(s);for(let h=0,g=a.length;h<g;h++){const d=a[h];d.consumedBy===void 0&&o.insert(d)}l=o.size,c=o.pop()}K.reset();const f=it.factory(u.segments);return new Re(f).getGeom()}}const I=new ke;var Ut={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("difference",r,e)}};function Oe(r,t={}){const e=[];if(ut(r,i=>{e.push(i.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const n=Ut.union(e[0],...e.slice(1));return n.length===0?null:n.length===1?lt(n[0],t.properties):Pt(n,t.properties)}var Dt=Oe;function vt(r){const t=[...r];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}function H(){}function Yt(r){return r()}function Xt(){return Object.create(null)}function ot(r){r.forEach(Yt)}function Vt(r){return typeof r=="function"}function Ae(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Ne(r){return Object.keys(r).length===0}function Be(r,t){r.appendChild(t)}function Ge(r,t,e){r.insertBefore(t,e||null)}function Zt(r){r.parentNode&&r.parentNode.removeChild(r)}function Jt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function q(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Te(r){return Array.from(r.childNodes)}function st(r,t,e){r.classList.toggle(t,!!e)}let bt;function tt(r){bt=r}const D=[],Wt=[];let Y=[];const Kt=[],ze=Promise.resolve();let wt=!1;function Fe(){wt||(wt=!0,ze.then(Ht))}function Et(r){Y.push(r)}const _t=new Set;let X=0;function Ht(){if(X!==0)return;const r=bt;do{try{for(;X<D.length;){const t=D[X];X++,tt(t),qe(t.$$)}}catch(t){throw D.length=0,X=0,t}for(tt(null),D.length=0,X=0;Wt.length;)Wt.pop()();for(let t=0;t<Y.length;t+=1){const e=Y[t];_t.has(e)||(_t.add(e),e())}Y.length=0}while(D.length);for(;Kt.length;)Kt.pop()();wt=!1,_t.clear(),tt(r)}function qe(r){if(r.fragment!==null){r.update(),ot(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Et)}}function je(r){const t=[],e=[];Y.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Y=t}const Qe=new Set;function Ue(r,t){r&&r.i&&(Qe.delete(r),r.i(t))}function De(r,t,e){const{fragment:n,after_update:i}=r.$$;n&&n.m(t,e),Et(()=>{const o=r.$$.on_mount.map(Yt).filter(Vt);r.$$.on_destroy?r.$$.on_destroy.push(...o):ot(o),r.$$.on_mount=[]}),i.forEach(Et)}function Ye(r,t){const e=r.$$;e.fragment!==null&&(je(e.after_update),ot(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Xe(r,t){r.$$.dirty[0]===-1&&(D.push(r),Fe(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function Ve(r,t,e,n,i,o,u=null,l=[-1]){const c=bt;tt(r);const f=r.$$={fragment:null,ctx:[],props:o,update:H,not_equal:i,bound:Xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Xt(),dirty:l,skip_bound:!1,root:t.target||c.$$.root};u&&u(f.root);let p=!1;if(f.ctx=e?e(r,t.props||{},(s,a,...h)=>{const g=h.length?h[0]:a;return f.ctx&&i(f.ctx[s],f.ctx[s]=g)&&(!f.skip_bound&&f.bound[s]&&f.bound[s](g),p&&Xe(r,s)),a}):[],f.update(),p=!0,ot(f.before_update),f.fragment=n?n(f.ctx):!1,t.target){if(t.hydrate){const s=Te(t.target);f.fragment&&f.fragment.l(s),s.forEach(Zt)}else f.fragment&&f.fragment.c();t.intro&&Ue(r.$$.fragment),De(r,t.target,t.anchor),Ht()}tt(c)}class Ze{constructor(){St(this,"$$");St(this,"$$set")}$destroy(){Ye(this,1),this.$destroy=H}$on(t,e){if(!Vt(e))return H;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Ne(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Je="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Je);function We(r){let t,e,n;return{c(){t=Jt("svg"),e=Jt("path"),q(e,"stroke-width","4"),q(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),q(e,"class","svelte-gzo3ar"),q(t,"width",n=r[0]==="list"?20:void 0),q(t,"viewBox","0 0 70 85"),q(t,"fill","none"),q(t,"class","svelte-gzo3ar"),st(t,"in-map",r[0]!=="list"),st(t,"list-icon",r[0]==="list")},m(i,o){Ge(i,t,o),Be(t,e)},p(i,[o]){o&1&&n!==(n=i[0]==="list"?20:void 0)&&q(t,"width",n),o&1&&st(t,"in-map",i[0]!=="list"),o&1&&st(t,"list-icon",i[0]==="list")},i:H,o:H,d(i){i&&Zt(t)}}}function Ke(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class He extends Ze{constructor(t){super(),Ve(this,t,Ke,We,Ae,{displayIn:0})}}function tn(r){const t=[];if(ut(r,i=>{t.push(i.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=r.features[0].properties||{},n=Ut.difference(t[0],...t.slice(1));return n.length===0?null:n.length===1?lt(n[0],e):Pt(n,e)}var en=tn;function nn(r){if(!r)throw new Error("geojson is required");var t=[];return ie(r,function(e){t.push(e)}),Z(t)}var rn=nn;function te(r,t){const e=en(Z([lt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const n=vt(ft(r)),i=(n[2]-n[0])/360/1e3,o=n[0]<-180,u=n[2]>180,l=rn(r);if(l.features.length>1&&(o||u))for(const c of l.features){const f=vt(ft(c));if(u&&f[0]<-180+i)for(const p of c.geometry.coordinates)for(const s of p)s[0]+=360-i;if(o&&f[2]>180-i)for(const p of c.geometry.coordinates)for(const s of p)s[0]-=360-i}t(Z([l.features.length<2?r:Dt(l)??r,e]))}const ee=r=>{var n,i,o;const t=(n=r==null?void 0:r.geometry)==null?void 0:n.type,e=(i=r==null?void 0:r.properties)!=null&&i.isMask?0:t==="LineString"||t==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=r==null?void 0:r.properties)!=null&&o.isMask?.1:0,weight:e,dashArray:[e,e],lineCap:"butt"}};function on(r,t=!0,e=!0,n={},i={},o=ee){let u;const l=[];let c,f;const p=Q.geoJSON(void 0,{style:o===!0?ee:o===!1?void 0:o??void 0,interactive:!1}).addTo(r),s=h=>{u==null||u({type:"mapClick",coordinates:[h.latlng.lng,h.latlng.lat]})};function a(h,g=!1){const d=document.createElement("div");return new He({props:{displayIn:"leaflet"},target:d}),new Q.Marker(h,{interactive:g,icon:new Q.DivIcon({html:d,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(h){h?(u=h,r.on("click",s)):(u=void 0,r.off("click",s))},flyTo(h,g){r.flyTo([h[1],h[0]],g,{duration:2,...n})},fitBounds(h,g,d){r.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...d?{maxZoom:d}:{},...i})},indicateReverse(h){r.getContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){var d;if(!t)return;const g=h&&[h[1],h[0]];f?g?f.setLatLng(g):(f.remove(),f=void 0):g&&(t instanceof Function?f=t(r)??void 0:(f=(typeof t=="object"?new Q.Marker(g,t):a(g)).addTo(r),(d=f.getElement())==null||d.classList.add("marker-reverse")))},setFeatures(h,g,d){function b(y){p.clearLayers(),y&&p.addData(y)}for(const y of l)y.remove();if(l.length=0,b(),g){let y=!1;if(g.geometry.type==="GeometryCollection"){const m=g.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");t:if(m.length>0){const x=Dt(Z(m.map(v=>V(v))));if(!x)break t;te({...g,geometry:x.geometry},b),y=!0}else{const x=g.geometry.geometries.filter(v=>v.type==="LineString"||v.type==="MultiLineString");x.length>0&&(b({...g,geometry:{type:"GeometryCollection",geometries:x}}),y=!0)}}if(!y){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")te(g,m=>{if(!m)return;const x=[...m.features],v=vt(ft(g)),w=v[2]-v[0];v[0]-w/4<-180&&x.push(...ne(m,-360).features),v[2]+w/4>180&&x.push(...ne(m,360).features),b(Z(x))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){b(g);return}}if(!d&&g.geometry.type!=="Point")return;if(t instanceof Function){const m=t(r,g);m&&l.push(m.addTo(r))}else if(t){const m=[g.center[1],g.center[0]];l.push(typeof t=="object"?new Q.Marker(m,t):a(m).addTo(r))}}if(e)for(const y of h??[]){if(y===g)continue;const m=[y.center[1],y.center[0]];let x;if(e instanceof Function){if(x=e(r,y),!x)continue}else x=(typeof e=="object"?new Q.Marker(m,e):a(m,!0)).addTo(r).bindTooltip(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""),{direction:"top"});const v=x.getElement();v&&(v.addEventListener("click",w=>{w.stopPropagation(),u==null||u({type:"markerClick",id:y.id})}),v.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:y.id})}),v.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:y.id})}),v.classList.toggle("marker-fuzzy",!!y.matching_text)),l.push(x)}},setSelectedMarker(h){var g,d;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=h>-1?l[h]:void 0,(d=c==null?void 0:c.getElement())==null||d.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=r.getCenter();return[r.getZoom(),h.lng,h.lat]}}}function ne(r,t){const e=ue(r);for(const n of e.features)if(n.geometry.type=="MultiPolygon")for(const i of n.geometry.coordinates)re(i,t);else re(n.geometry.coordinates,t);return e}function re(r,t){for(const e of r)for(const n of e)n[0]+=t}M.createLeafletMapController=on,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
22
|
+
`);var o=t+(e?" ":"│ ");r.left&&at(r.left,o,!1,n,i),r.right&&at(r.right,o,!0,n,i)}}var pt=function(){function r(t){t===void 0&&(t=ce),this._root=null,this._size=0,this._comparator=t}return r.prototype.insert=function(t,e){return this._size++,this._root=ht(t,e,this._root,this._comparator)},r.prototype.add=function(t,e){var n=new G(t,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var i=this._comparator,o=T(t,this._root,i),u=i(t,o.key);return u===0?this._root=o:(u<0?(n.left=o.left,n.right=o,o.left=null):u>0&&(n.right=o.right,n.left=o,o.right=null),this._size++,this._root=n),this._root},r.prototype.remove=function(t){this._root=this._remove(t,this._root,this._comparator)},r.prototype._remove=function(t,e,n){var i;if(e===null)return null;e=T(t,e,n);var o=n(t,e.key);return o===0?(e.left===null?i=e.right:(i=T(t,e.left,n),i.right=e.right),this._size--,i):e},r.prototype.pop=function(){var t=this._root;if(t){for(;t.left;)t=t.left;return this._root=T(t.key,this._root,this._comparator),this._root=this._remove(t.key,this._root,this._comparator),{key:t.key,data:t.data}}return null},r.prototype.findStatic=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return e;i<0?e=e.left:e=e.right}return null},r.prototype.find=function(t){return this._root&&(this._root=T(t,this._root,this._comparator),this._comparator(t,this._root.key)!==0)?null:this._root},r.prototype.contains=function(t){for(var e=this._root,n=this._comparator;e;){var i=n(t,e.key);if(i===0)return!0;i<0?e=e.left:e=e.right}return!1},r.prototype.forEach=function(t,e){for(var n=this._root,i=[],o=!1;!o;)n!==null?(i.push(n),n=n.left):i.length!==0?(n=i.pop(),t.call(e,n),n=n.right):o=!0;return this},r.prototype.range=function(t,e,n,i){for(var o=[],u=this._comparator,l=this._root,c;o.length!==0||l;)if(l)o.push(l),l=l.left;else{if(l=o.pop(),c=u(l.key,e),c>0)break;if(u(l.key,t)>=0&&n.call(i,l))return this;l=l.right}return this},r.prototype.keys=function(){var t=[];return this.forEach(function(e){var n=e.key;return t.push(n)}),t},r.prototype.values=function(){var t=[];return this.forEach(function(e){var n=e.data;return t.push(n)}),t},r.prototype.min=function(){return this._root?this.minNode(this._root).key:null},r.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},r.prototype.minNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.left;)t=t.left;return t},r.prototype.maxNode=function(t){if(t===void 0&&(t=this._root),t)for(;t.right;)t=t.right;return t},r.prototype.at=function(t){for(var e=this._root,n=!1,i=0,o=[];!n;)if(e)o.push(e),e=e.left;else if(o.length>0){if(e=o.pop(),i===t)return e;i++,e=e.right}else n=!0;return null},r.prototype.next=function(t){var e=this._root,n=null;if(t.right){for(n=t.right;n.left;)n=n.left;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?(n=e,e=e.left):e=e.right}return n},r.prototype.prev=function(t){var e=this._root,n=null;if(t.left!==null){for(n=t.left;n.right;)n=n.right;return n}for(var i=this._comparator;e;){var o=i(t.key,e.key);if(o===0)break;o<0?e=e.left:(n=e,e=e.right)}return n},r.prototype.clear=function(){return this._root=null,this._size=0,this},r.prototype.toList=function(){return pe(this._root)},r.prototype.load=function(t,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var i=t.length,o=this._comparator;if(n&&dt(t,e,0,i-1,o),this._root===null)this._root=gt(t,e,0,i),this._size=i;else{var u=ge(this.toList(),ae(t,e),o);i=this._size+i,this._root=yt({head:u},0,i)}return this},r.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(r.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),r.prototype.toString=function(t){t===void 0&&(t=function(n){return String(n.key)});var e=[];return at(this._root,"",!0,function(n){return e.push(n)},t),e.join("")},r.prototype.update=function(t,e,n){var i=this._comparator,o=It(t,this._root,i),u=o.left,l=o.right;i(t,e)<0?l=ht(e,n,l,i):u=ht(e,n,u,i),this._root=he(u,l,i)},r.prototype.split=function(t){return It(t,this._root,this._comparator)},r.prototype[Symbol.iterator]=function(){var t,e,n;return fe(this,function(i){switch(i.label){case 0:t=this._root,e=[],n=!1,i.label=1;case 1:return n?[3,6]:t===null?[3,2]:(e.push(t),t=t.left,[3,5]);case 2:return e.length===0?[3,4]:(t=e.pop(),[4,t]);case 3:return i.sent(),t=t.right,[3,5];case 4:n=!0,i.label=5;case 5:return[3,1];case 6:return[2]}})},r}();function gt(r,t,e,n){var i=n-e;if(i>0){var o=e+Math.floor(i/2),u=r[o],l=t[o],c=new G(u,l);return c.left=gt(r,t,e,o),c.right=gt(r,t,o+1,n),c}return null}function ae(r,t){for(var e=new G(null,null),n=e,i=0;i<r.length;i++)n=n.next=new G(r[i],t[i]);return n.next=null,e.next}function pe(r){for(var t=r,e=[],n=!1,i=new G(null,null),o=i;!n;)t?(e.push(t),t=t.left):e.length>0?(t=o=o.next=e.pop(),t=t.right):n=!0;return o.next=null,i.next}function yt(r,t,e){var n=e-t;if(n>0){var i=t+Math.floor(n/2),o=yt(r,t,i),u=r.head;return u.left=o,r.head=r.head.next,u.right=yt(r,i+1,e),u}return null}function ge(r,t,e){for(var n=new G(null,null),i=n,o=r,u=t;o!==null&&u!==null;)e(o.key,u.key)<0?(i.next=o,o=o.next):(i.next=u,u=u.next),i=i.next;return o!==null?i.next=o:u!==null&&(i.next=u),n.next}function dt(r,t,e,n,i){if(!(e>=n)){for(var o=r[e+n>>1],u=e-1,l=n+1;;){do u++;while(i(r[u],o)<0);do l--;while(i(r[l],o)>0);if(u>=l)break;var c=r[u];r[u]=r[l],r[l]=c,c=t[u],t[u]=t[l],t[l]=c}dt(r,t,e,l,i),dt(r,t,l+1,n,i)}}const N=11102230246251565e-32,E=134217729,ye=(3+8*N)*N;function xt(r,t,e,n,i){let o,u,l,c,f=t[0],p=n[0],s=0,a=0;p>f==p>-f?(o=f,f=t[++s]):(o=p,p=n[++a]);let h=0;if(s<r&&a<e)for(p>f==p>-f?(u=f+o,l=o-(u-f),f=t[++s]):(u=p+o,l=o-(u-p),p=n[++a]),o=u,l!==0&&(i[h++]=l);s<r&&a<e;)p>f==p>-f?(u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s]):(u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a]),o=u,l!==0&&(i[h++]=l);for(;s<r;)u=o+f,c=u-o,l=o-(u-c)+(f-c),f=t[++s],o=u,l!==0&&(i[h++]=l);for(;a<e;)u=o+p,c=u-o,l=o-(u-c)+(p-c),p=n[++a],o=u,l!==0&&(i[h++]=l);return(o!==0||h===0)&&(i[h++]=o),h}function de(r,t){let e=t[0];for(let n=1;n<r;n++)e+=t[n];return e}function J(r){return new Float64Array(r)}const xe=(3+16*N)*N,me=(2+12*N)*N,ve=(9+64*N)*N*N,U=J(4),$t=J(8),kt=J(12),Ot=J(16),P=J(4);function be(r,t,e,n,i,o,u){let l,c,f,p,s,a,h,g,d,b,y,m,x,v,w,_,R,S;const $=r-i,k=e-i,O=t-o,A=n-o;v=$*A,a=E*$,h=a-(a-$),g=$-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=O*k,a=E*O,h=a-(a-O),g=O-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,U[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,U[1]=x-(y+s)+(s-_),S=m+y,s=S-m,U[2]=m-(S-s)+(y-s),U[3]=S;let B=de(4,U),et=me*u;if(B>=et||-B>=et||(s=r-$,l=r-($+s)+(s-i),s=e-k,f=e-(k+s)+(s-i),s=t-O,c=t-(O+s)+(s-o),s=n-A,p=n-(A+s)+(s-o),l===0&&c===0&&f===0&&p===0)||(et=ve*u+ye*Math.abs(B),B+=$*p+A*l-(O*f+k*c),B>=et||-B>=et))return B;v=l*A,a=E*l,h=a-(a-l),g=l-h,a=E*A,d=a-(a-A),b=A-d,w=g*b-(v-h*d-g*d-h*b),_=c*k,a=E*c,h=a-(a-c),g=c-h,a=E*k,d=a-(a-k),b=k-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const sn=xt(4,U,4,P,$t);v=$*p,a=E*$,h=a-(a-$),g=$-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=O*f,a=E*O,h=a-(a-O),g=O-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const ln=xt(sn,$t,4,P,kt);v=l*p,a=E*l,h=a-(a-l),g=l-h,a=E*p,d=a-(a-p),b=p-d,w=g*b-(v-h*d-g*d-h*b),_=c*f,a=E*c,h=a-(a-c),g=c-h,a=E*f,d=a-(a-f),b=f-d,R=g*b-(_-h*d-g*d-h*b),y=w-R,s=w-y,P[0]=w-(y+s)+(s-R),m=v+y,s=m-v,x=v-(m-s)+(y-s),y=x-_,s=x-y,P[1]=x-(y+s)+(s-_),S=m+y,s=S-m,P[2]=m-(S-s)+(y-s),P[3]=S;const un=xt(ln,kt,4,P,Ot);return Ot[un-1]}function we(r,t,e,n,i,o){const u=(t-o)*(e-i),l=(r-i)*(n-o),c=u-l,f=Math.abs(u+l);return Math.abs(c)>=xe*f?c:-be(r,t,e,n,i,o,f)}const W=(r,t)=>r.ll.x<=t.x&&t.x<=r.ur.x&&r.ll.y<=t.y&&t.y<=r.ur.y,mt=(r,t)=>{if(t.ur.x<r.ll.x||r.ur.x<t.ll.x||t.ur.y<r.ll.y||r.ur.y<t.ll.y)return null;const e=r.ll.x<t.ll.x?t.ll.x:r.ll.x,n=r.ur.x<t.ur.x?r.ur.x:t.ur.x,i=r.ll.y<t.ll.y?t.ll.y:r.ll.y,o=r.ur.y<t.ur.y?r.ur.y:t.ur.y;return{ll:{x:e,y:i},ur:{x:n,y:o}}};let z=Number.EPSILON;z===void 0&&(z=Math.pow(2,-52));const Ee=z*z,At=(r,t)=>{if(-z<r&&r<z&&-z<t&&t<z)return 0;const e=r-t;return e*e<Ee*r*t?0:r<t?-1:1};class _e{constructor(){this.reset()}reset(){this.xRounder=new Nt,this.yRounder=new Nt}round(t,e){return{x:this.xRounder.round(t),y:this.yRounder.round(e)}}}class Nt{constructor(){this.tree=new pt,this.round(0)}round(t){const e=this.tree.add(t),n=this.tree.prev(e);if(n!==null&&At(e.key,n.key)===0)return this.tree.remove(t),n.key;const i=this.tree.next(e);return i!==null&&At(e.key,i.key)===0?(this.tree.remove(t),i.key):t}}const K=new _e,nt=(r,t)=>r.x*t.y-r.y*t.x,Bt=(r,t)=>r.x*t.x+r.y*t.y,Gt=(r,t,e)=>{const n=we(r.x,r.y,t.x,t.y,e.x,e.y);return n>0?-1:n<0?1:0},rt=r=>Math.sqrt(Bt(r,r)),Se=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return nt(i,n)/rt(i)/rt(n)},Pe=(r,t,e)=>{const n={x:t.x-r.x,y:t.y-r.y},i={x:e.x-r.x,y:e.y-r.y};return Bt(i,n)/rt(i)/rt(n)},Tt=(r,t,e)=>t.y===0?null:{x:r.x+t.x/t.y*(e-r.y),y:e},zt=(r,t,e)=>t.x===0?null:{x:e,y:r.y+t.y/t.x*(e-r.x)},Me=(r,t,e,n)=>{if(t.x===0)return zt(e,n,r.x);if(n.x===0)return zt(r,t,e.x);if(t.y===0)return Tt(e,n,r.y);if(n.y===0)return Tt(r,t,e.y);const i=nt(t,n);if(i==0)return null;const o={x:e.x-r.x,y:e.y-r.y},u=nt(o,t)/i,l=nt(o,n)/i,c=r.x+l*t.x,f=e.x+u*n.x,p=r.y+l*t.y,s=e.y+u*n.y,a=(c+f)/2,h=(p+s)/2;return{x:a,y:h}};class C{static compare(t,e){const n=C.comparePoints(t.point,e.point);return n!==0?n:(t.point!==e.point&&t.link(e),t.isLeft!==e.isLeft?t.isLeft?1:-1:F.compare(t.segment,e.segment))}static comparePoints(t,e){return t.x<e.x?-1:t.x>e.x?1:t.y<e.y?-1:t.y>e.y?1:0}constructor(t,e){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=e}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");const e=t.point.events;for(let n=0,i=e.length;n<i;n++){const o=e[n];this.point.events.push(o),o.point=this.point}this.checkForConsuming()}checkForConsuming(){const t=this.point.events.length;for(let e=0;e<t;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let i=e+1;i<t;i++){const o=this.point.events[i];o.consumedBy===void 0&&n.otherSE.point.events===o.otherSE.point.events&&n.segment.consume(o.segment)}}}getAvailableLinkedEvents(){const t=[];for(let e=0,n=this.point.events.length;e<n;e++){const i=this.point.events[e];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){const e=new Map,n=i=>{const o=i.otherSE;e.set(i,{sine:Se(this.point,t.point,o.point),cosine:Pe(this.point,t.point,o.point)})};return(i,o)=>{e.has(i)||n(i),e.has(o)||n(o);const{sine:u,cosine:l}=e.get(i),{sine:c,cosine:f}=e.get(o);return u>=0&&c>=0?l<f?1:l>f?-1:0:u<0&&c<0?l<f?-1:l>f?1:0:c<u?-1:c>u?1:0}}}let Le=0;class F{static compare(t,e){const n=t.leftSE.point.x,i=e.leftSE.point.x,o=t.rightSE.point.x,u=e.rightSE.point.x;if(u<n)return 1;if(o<i)return-1;const l=t.leftSE.point.y,c=e.leftSE.point.y,f=t.rightSE.point.y,p=e.rightSE.point.y;if(n<i){if(c<l&&c<f)return 1;if(c>l&&c>f)return-1;const s=t.comparePoint(e.leftSE.point);if(s<0)return 1;if(s>0)return-1;const a=e.comparePoint(t.rightSE.point);return a!==0?a:-1}if(n>i){if(l<c&&l<p)return-1;if(l>c&&l>p)return 1;const s=e.comparePoint(t.leftSE.point);if(s!==0)return s;const a=t.comparePoint(e.rightSE.point);return a<0?1:a>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(o<u){const s=e.comparePoint(t.rightSE.point);if(s!==0)return s}if(o>u){const s=t.comparePoint(e.rightSE.point);if(s<0)return 1;if(s>0)return-1}if(o!==u){const s=f-l,a=o-n,h=p-c,g=u-i;if(s>a&&h<g)return 1;if(s<a&&h>g)return-1}return o>u?1:o<u||f<p?-1:f>p?1:t.id<e.id?-1:t.id>e.id?1:0}constructor(t,e,n,i){this.id=++Le,this.leftSE=t,t.segment=this,t.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,e,n){let i,o,u;const l=C.comparePoints(t,e);if(l<0)i=t,o=e,u=1;else if(l>0)i=e,o=t,u=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);const c=new C(i,!0),f=new C(o,!1);return new F(c,f,[n],[u])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const t=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t<e?t:e},ur:{x:this.rightSE.point.x,y:t>e?t:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(t){return t.x===this.leftSE.point.x&&t.y===this.leftSE.point.y||t.x===this.rightSE.point.x&&t.y===this.rightSE.point.y}comparePoint(t){if(this.isAnEndpoint(t))return 0;const e=this.leftSE.point,n=this.rightSE.point,i=this.vector();if(e.x===n.x)return t.x===e.x?0:t.x<e.x?1:-1;const o=(t.y-e.y)/i.y,u=e.x+o*i.x;if(t.x===u)return 0;const l=(t.x-e.x)/i.x,c=e.y+l*i.y;return t.y===c?0:t.y<c?-1:1}getIntersection(t){const e=this.bbox(),n=t.bbox(),i=mt(e,n);if(i===null)return null;const o=this.leftSE.point,u=this.rightSE.point,l=t.leftSE.point,c=t.rightSE.point,f=W(e,l)&&this.comparePoint(l)===0,p=W(n,o)&&t.comparePoint(o)===0,s=W(e,c)&&this.comparePoint(c)===0,a=W(n,u)&&t.comparePoint(u)===0;if(p&&f)return a&&!s?u:!a&&s?c:null;if(p)return s&&o.x===c.x&&o.y===c.y?null:o;if(f)return a&&u.x===l.x&&u.y===l.y?null:l;if(a&&s)return null;if(a)return u;if(s)return c;const h=Me(o,this.vector(),l,t.vector());return h===null||!W(i,h)?null:K.round(h.x,h.y)}split(t){const e=[],n=t.events!==void 0,i=new C(t,!0),o=new C(t,!1),u=this.rightSE;this.replaceRightSE(o),e.push(o),e.push(i);const l=new F(i,u,this.rings.slice(),this.windings.slice());return C.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),C.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),o.checkForConsuming()),e}swapEvents(){const t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(t){let e=this,n=t;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const i=F.compare(e,n);if(i!==0){if(i>0){const o=e;e=n,n=o}if(e.prev===n){const o=e;e=n,n=o}for(let o=0,u=n.rings.length;o<u;o++){const l=n.rings[o],c=n.windings[o],f=e.rings.indexOf(l);f===-1?(e.rings.push(l),e.windings.push(c)):e.windings[f]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const f=this.rings[l],p=this.windings[l],s=e.indexOf(f);s===-1?(e.push(f),n.push(p)):n[s]+=p}const o=[],u=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const f=e[l],p=f.poly;if(u.indexOf(p)===-1)if(f.isExterior)o.push(p);else{u.indexOf(p)===-1&&u.push(p);const s=o.indexOf(f.poly);s!==-1&&o.splice(s,1)}}for(let l=0,c=o.length;l<c;l++){const f=o[l].multiPoly;i.indexOf(f)===-1&&i.push(f)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const t=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(I.type){case"union":{const n=t.length===0,i=e.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<e.length?(n=t.length,i=e.length):(n=e.length,i=t.length),this._isInResult=i===I.numMultiPolys&&n<i;break}case"xor":{const n=Math.abs(t.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${I.type}`)}return this._isInResult}}class Ft{constructor(t,e,n){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const i=K.round(t[0][0],t[0][1]);this.bbox={ll:{x:i.x,y:i.y},ur:{x:i.x,y:i.y}};let o=i;for(let u=1,l=t.length;u<l;u++){if(typeof t[u][0]!="number"||typeof t[u][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=K.round(t[u][0],t[u][1]);c.x===o.x&&c.y===o.y||(this.segments.push(F.fromRing(o,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),o=c)}(i.x!==o.x||i.y!==o.y)&&this.segments.push(F.fromRing(o,i,this))}getSweepEvents(){const t=[];for(let e=0,n=this.segments.length;e<n;e++){const i=this.segments[e];t.push(i.leftSE),t.push(i.rightSE)}return t}}class Ce{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Ft(t[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,i=t.length;n<i;n++){const o=new Ft(t[n],this,!1);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.interiorRings.push(o)}this.multiPoly=e}getSweepEvents(){const t=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class qt{constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,i=t.length;n<i;n++){const o=new Ce(t[n],this);o.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=o.bbox.ll.x),o.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=o.bbox.ll.y),o.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=o.bbox.ur.x),o.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=o.bbox.ur.y),this.polys.push(o)}this.isSubject=e}getSweepEvents(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getSweepEvents();for(let o=0,u=i.length;o<u;o++)t.push(i[o])}return t}}class it{static factory(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.isInResult()||o.ringOut)continue;let u=null,l=o.leftSE,c=o.rightSE;const f=[l],p=l.point,s=[];for(;u=l,l=c,f.push(l),l.point!==p;)for(;;){const a=l.getAvailableLinkedEvents();if(a.length===0){const d=f[0].point,b=f[f.length-1].point;throw new Error(`Unable to complete output ring starting at [${d.x}, ${d.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(a.length===1){c=a[0].otherSE;break}let h=null;for(let d=0,b=s.length;d<b;d++)if(s[d].point===l.point){h=d;break}if(h!==null){const d=s.splice(h)[0],b=f.splice(d.index);b.unshift(b[0].otherSE),e.push(new it(b.reverse()));continue}s.push({index:f.length,point:l.point});const g=l.getLeftmostComparator(u);c=a.sort(g)[0].otherSE;break}e.push(new it(f))}return e}constructor(t){this.events=t;for(let e=0,n=t.length;e<n;e++)t[e].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point;const e=[t];for(let f=1,p=this.events.length-1;f<p;f++){const s=this.events[f].point,a=this.events[f+1].point;Gt(s,t,a)!==0&&(e.push(s),t=s)}if(e.length===1)return null;const n=e[0],i=e[1];Gt(n,t,i)===0&&e.shift(),e.push(e[0]);const o=this.isExteriorRing()?1:-1,u=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let f=u;f!=l;f+=o)c.push([e[f].x,e[f].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,o=this.events.length;i<o;i++){const u=this.events[i];C.compare(t,u)>0&&(t=u)}let e=t.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class jt{constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){const t=[this.exteriorRing.getGeom()];if(t[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const i=this.interiorRings[e].getGeom();i!==null&&t.push(i)}return t}}class Re{constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){const t=[];for(let e=0,n=this.polys.length;e<n;e++){const i=this.polys[e].getGeom();i!==null&&t.push(i)}return t}_composePolys(t){const e=[];for(let n=0,i=t.length;n<i;n++){const o=t[n];if(!o.poly)if(o.isExteriorRing())e.push(new jt(o));else{const u=o.enclosingRing();u.poly||e.push(new jt(u)),u.poly.addInterior(o)}}return e}}class Ie{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:F.compare;this.queue=t,this.tree=new pt(e),this.segments=[]}process(t){const e=t.segment,n=[];if(t.consumedBy)return t.isLeft?this.queue.remove(t.otherSE):this.tree.remove(e),n;const i=t.isLeft?this.tree.add(e):this.tree.find(e);if(!i)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let o=i,u=i,l,c;for(;l===void 0;)o=this.tree.prev(o),o===null?l=null:o.key.consumedBy===void 0&&(l=o.key);for(;c===void 0;)u=this.tree.next(u),u===null?c=null:u.key.consumedBy===void 0&&(c=u.key);if(t.isLeft){let f=null;if(l){const s=l.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(f=s),!l.isAnEndpoint(s))){const a=this._splitSafely(l,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}let p=null;if(c){const s=c.getIntersection(e);if(s!==null&&(e.isAnEndpoint(s)||(p=s),!c.isAnEndpoint(s))){const a=this._splitSafely(c,s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}}if(f!==null||p!==null){let s=null;f===null?s=p:p===null?s=f:s=C.comparePoints(f,p)<=0?f:p,this.queue.remove(e.rightSE),n.push(e.rightSE);const a=e.split(s);for(let h=0,g=a.length;h<g;h++)n.push(a[h])}n.length>0?(this.tree.remove(e),n.push(t)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const f=l.getIntersection(c);if(f!==null){if(!l.isAnEndpoint(f)){const p=this._splitSafely(l,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}if(!c.isAnEndpoint(f)){const p=this._splitSafely(c,f);for(let s=0,a=p.length;s<a;s++)n.push(p[s])}}}this.tree.remove(e)}return n}_splitSafely(t,e){this.tree.remove(t);const n=t.rightSE;this.queue.remove(n);const i=t.split(e);return i.push(n),t.consumedBy===void 0&&this.tree.add(t),i}}const Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,$e=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class ke{run(t,e,n){I.type=t,K.reset();const i=[new qt(e,!0)];for(let s=0,a=n.length;s<a;s++)i.push(new qt(n[s],!1));if(I.numMultiPolys=i.length,I.type==="difference"){const s=i[0];let a=1;for(;a<i.length;)mt(i[a].bbox,s.bbox)!==null?a++:i.splice(a,1)}if(I.type==="intersection")for(let s=0,a=i.length;s<a;s++){const h=i[s];for(let g=s+1,d=i.length;g<d;g++)if(mt(h.bbox,i[g].bbox)===null)return[]}const o=new pt(C.compare);for(let s=0,a=i.length;s<a;s++){const h=i[s].getSweepEvents();for(let g=0,d=h.length;g<d;g++)if(o.insert(h[g]),o.size>Qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const u=new Ie(o);let l=o.size,c=o.pop();for(;c;){const s=c.key;if(o.size===l){const h=s.segment;throw new Error(`Unable to pop() ${s.isLeft?"left":"right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] from queue.`)}if(o.size>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(u.segments.length>$e)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const a=u.process(s);for(let h=0,g=a.length;h<g;h++){const d=a[h];d.consumedBy===void 0&&o.insert(d)}l=o.size,c=o.pop()}K.reset();const f=it.factory(u.segments);return new Re(f).getGeom()}}const I=new ke;var Ut={union:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("union",r,e)},intersection:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("intersection",r,e)},xor:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("xor",r,e)},difference:function(r){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];return I.run("difference",r,e)}};function Oe(r,t={}){const e=[];if(ut(r,i=>{e.push(i.coordinates)}),e.length<2)throw new Error("Must have at least 2 geometries");const n=Ut.union(e[0],...e.slice(1));return n.length===0?null:n.length===1?lt(n[0],t.properties):Pt(n,t.properties)}var Dt=Oe;function vt(r){const t=[...r];return t[2]<t[0]&&(Math.abs((t[0]+t[2]+360)/2)>Math.abs((t[0]-360+t[2])/2)?t[0]-=360:t[2]+=360),t}function H(){}function Yt(r){return r()}function Xt(){return Object.create(null)}function ot(r){r.forEach(Yt)}function Vt(r){return typeof r=="function"}function Ae(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function Ne(r){return Object.keys(r).length===0}function Be(r,t){r.appendChild(t)}function Ge(r,t,e){r.insertBefore(t,e||null)}function Zt(r){r.parentNode&&r.parentNode.removeChild(r)}function Jt(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function q(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function Te(r){return Array.from(r.childNodes)}function st(r,t,e){r.classList.toggle(t,!!e)}let bt;function tt(r){bt=r}const D=[],Wt=[];let Y=[];const Kt=[],ze=Promise.resolve();let wt=!1;function Fe(){wt||(wt=!0,ze.then(Ht))}function Et(r){Y.push(r)}const _t=new Set;let X=0;function Ht(){if(X!==0)return;const r=bt;do{try{for(;X<D.length;){const t=D[X];X++,tt(t),qe(t.$$)}}catch(t){throw D.length=0,X=0,t}for(tt(null),D.length=0,X=0;Wt.length;)Wt.pop()();for(let t=0;t<Y.length;t+=1){const e=Y[t];_t.has(e)||(_t.add(e),e())}Y.length=0}while(D.length);for(;Kt.length;)Kt.pop()();wt=!1,_t.clear(),tt(r)}function qe(r){if(r.fragment!==null){r.update(),ot(r.before_update);const t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Et)}}function je(r){const t=[],e=[];Y.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Y=t}const Qe=new Set;function Ue(r,t){r&&r.i&&(Qe.delete(r),r.i(t))}function De(r,t,e){const{fragment:n,after_update:i}=r.$$;n&&n.m(t,e),Et(()=>{const o=r.$$.on_mount.map(Yt).filter(Vt);r.$$.on_destroy?r.$$.on_destroy.push(...o):ot(o),r.$$.on_mount=[]}),i.forEach(Et)}function Ye(r,t){const e=r.$$;e.fragment!==null&&(je(e.after_update),ot(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Xe(r,t){r.$$.dirty[0]===-1&&(D.push(r),Fe(),r.$$.dirty.fill(0)),r.$$.dirty[t/31|0]|=1<<t%31}function Ve(r,t,e,n,i,o,u=null,l=[-1]){const c=bt;tt(r);const f=r.$$={fragment:null,ctx:[],props:o,update:H,not_equal:i,bound:Xt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Xt(),dirty:l,skip_bound:!1,root:t.target||c.$$.root};u&&u(f.root);let p=!1;if(f.ctx=e?e(r,t.props||{},(s,a,...h)=>{const g=h.length?h[0]:a;return f.ctx&&i(f.ctx[s],f.ctx[s]=g)&&(!f.skip_bound&&f.bound[s]&&f.bound[s](g),p&&Xe(r,s)),a}):[],f.update(),p=!0,ot(f.before_update),f.fragment=n?n(f.ctx):!1,t.target){if(t.hydrate){const s=Te(t.target);f.fragment&&f.fragment.l(s),s.forEach(Zt)}else f.fragment&&f.fragment.c();t.intro&&Ue(r.$$.fragment),De(r,t.target,t.anchor),Ht()}tt(c)}class Ze{constructor(){St(this,"$$");St(this,"$$set")}$destroy(){Ye(this,1),this.$destroy=H}$on(t,e){if(!Vt(e))return H;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const i=n.indexOf(e);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!Ne(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Je="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Je);function We(r){let t,e,n;return{c(){t=Jt("svg"),e=Jt("path"),q(e,"stroke-width","4"),q(e,"d","M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"),q(e,"class","svelte-gzo3ar"),q(t,"width",n=r[0]==="list"?20:void 0),q(t,"viewBox","0 0 70 85"),q(t,"fill","none"),q(t,"class","svelte-gzo3ar"),st(t,"in-map",r[0]!=="list"),st(t,"list-icon",r[0]==="list")},m(i,o){Ge(i,t,o),Be(t,e)},p(i,[o]){o&1&&n!==(n=i[0]==="list"?20:void 0)&&q(t,"width",n),o&1&&st(t,"in-map",i[0]!=="list"),o&1&&st(t,"list-icon",i[0]==="list")},i:H,o:H,d(i){i&&Zt(t)}}}function Ke(r,t,e){let{displayIn:n}=t;return r.$$set=i=>{"displayIn"in i&&e(0,n=i.displayIn)},[n]}class He extends Ze{constructor(t){super(),Ve(this,t,Ke,We,Ae,{displayIn:0})}}function tn(r){const t=[];if(ut(r,i=>{t.push(i.coordinates)}),t.length<2)throw new Error("Must have at least two features");const e=r.features[0].properties||{},n=Ut.difference(t[0],...t.slice(1));return n.length===0?null:n.length===1?lt(n[0],e):Pt(n,e)}var en=tn;function nn(r){if(!r)throw new Error("geojson is required");var t=[];return ie(r,function(e){t.push(e)}),Z(t)}var rn=nn;function te(r,t){const e=en(Z([lt([[[180,90],[-180,90],[-180,-90],[180,-90],[180,90]]]),r]));if(!e)return;e.properties={isMask:!0};const n=vt(ft(r)),i=(n[2]-n[0])/360/1e3,o=n[0]<-180,u=n[2]>180,l=rn(r);if(l.features.length>1&&(o||u))for(const c of l.features){const f=vt(ft(c));if(u&&f[0]<-180+i)for(const p of c.geometry.coordinates)for(const s of p)s[0]+=360-i;if(o&&f[2]>180-i)for(const p of c.geometry.coordinates)for(const s of p)s[0]-=360-i}t(Z([l.features.length<2?r:Dt(l)??r,e]))}const ee=r=>{var n,i,o;const t=(n=r==null?void 0:r.geometry)==null?void 0:n.type,e=(i=r==null?void 0:r.properties)!=null&&i.isMask?0:t==="LineString"||t==="MultiLineString"?3:2;return{color:"#3170fe",fillColor:"#000",fillOpacity:(o=r==null?void 0:r.properties)!=null&&o.isMask?.1:0,weight:e,dashArray:[e,e],lineCap:"butt"}};function on(r,t=!0,e=!0,n={},i={},o=ee){let u;const l=[];let c,f;const p=Q.geoJSON(void 0,{style:o===!0?ee:o===!1?void 0:o??void 0,interactive:!1}).addTo(r),s=h=>{u==null||u({type:"mapClick",coordinates:[h.latlng.lng,h.latlng.lat]})};function a(h,g=!1){const d=document.createElement("div");return new He({props:{displayIn:"leaflet"},target:d}),new Q.Marker(h,{interactive:g,icon:new Q.DivIcon({html:d,className:"",iconAnchor:[12,26],iconSize:[25,30],tooltipAnchor:[1,-24]})})}return{setEventHandler(h){h?(u=h,r.on("click",s)):(u=void 0,r.off("click",s))},flyTo(h,g){r.flyTo([h[1],h[0]],g,{duration:2,...n})},fitBounds(h,g,d){r.flyToBounds([[h[1],h[0]],[h[3],h[2]]],{padding:[g,g],duration:2,...d?{maxZoom:d}:{},...i})},indicateReverse(h){r.getContainer().style.cursor=h?"crosshair":""},setReverseMarker(h){var d;if(!t)return;const g=h&&[h[1],h[0]];f?g?f.setLatLng(g):(f.remove(),f=void 0):g&&(t instanceof Function?f=t(r)??void 0:(f=(typeof t=="object"?new Q.Marker(g,t):a(g)).addTo(r),(d=f.getElement())==null||d.classList.add("marker-reverse")))},setFeatures(h,g,d){function b(y){p.clearLayers(),y&&p.addData(y)}for(const y of l)y.remove();l.length=0,b();t:if(g){let y=!1;if(g.geometry.type==="GeometryCollection"){const m=g.geometry.geometries.filter(x=>x.type==="Polygon"||x.type==="MultiPolygon");e:if(m.length>0){const x=Dt(Z(m.map(v=>V(v))));if(!x)break e;te({...g,geometry:x.geometry},b),y=!0}else{const x=g.geometry.geometries.filter(v=>v.type==="LineString"||v.type==="MultiLineString");x.length>0&&(b({...g,geometry:{type:"GeometryCollection",geometries:x}}),y=!0)}}if(!y){if(g.geometry.type==="Polygon"||g.geometry.type==="MultiPolygon")te(g,m=>{if(!m)return;const x=[...m.features],v=vt(ft(g)),w=v[2]-v[0];v[0]-w/4<-180&&x.push(...ne(m,-360).features),v[2]+w/4>180&&x.push(...ne(m,360).features),b(Z(x))});else if(g.geometry.type==="LineString"||g.geometry.type==="MultiLineString"){b(g);break t}}if(!d&&g.geometry.type!=="Point")break t;if(t instanceof Function){const m=t(r,g);m&&l.push(m.addTo(r))}else if(t){const m=[g.center[1],g.center[0]];l.push(typeof t=="object"?new Q.Marker(m,t):a(m).addTo(r))}}if(e)for(const y of h??[]){if(y===g)continue;const m=[y.center[1],y.center[0]];let x;if(e instanceof Function){if(x=e(r,y),!x)continue}else x=(typeof e=="object"?new Q.Marker(m,e):a(m,!0)).addTo(r).bindTooltip(y.place_type[0]==="reverse"?y.place_name:y.place_name.replace(/,.*/,""),{direction:"top"});const v=x.getElement();v&&(v.addEventListener("click",w=>{w.stopPropagation(),u==null||u({type:"markerClick",id:y.id})}),v.addEventListener("mouseenter",()=>{u==null||u({type:"markerMouseEnter",id:y.id})}),v.addEventListener("mouseleave",()=>{u==null||u({type:"markerMouseLeave",id:y.id})}),v.classList.toggle("marker-fuzzy",!!y.matching_text)),l.push(x)}},setSelectedMarker(h){var g,d;c&&((g=c.getElement())==null||g.classList.toggle("marker-selected",!1)),c=h>-1?l[h]:void 0,(d=c==null?void 0:c.getElement())==null||d.classList.toggle("marker-selected",!0)},getCenterAndZoom(){const h=r.getCenter();return[r.getZoom(),h.lng,h.lat]}}}function ne(r,t){const e=ue(r);for(const n of e.features)if(n.geometry.type=="MultiPolygon")for(const i of n.geometry.coordinates)re(i,t);else re(n.geometry.coordinates,t);return e}function re(r,t){for(const e of r)for(const n of e)n[0]+=t}M.createLeafletMapController=on,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
23
23
|
//# sourceMappingURL=leaflet-controller.umd.js.map
|