PageSourceSearch

https://www.acaitasty.com/mk/5.x.x/mapkit.js

js acaitasty.com collected 2026-10-08 20:05:24 UTC 791,374 bytes, 2 lines download raw bytes

1/*! Copyright © Apple Inc. All rights reserved. See LICENSE for additional license information. */
2(()=>{"use strict";const t={version:"5.80.128",build:"25.49-24",cdnBase:"https://cdn.apple-mapkit.com",cdnVersion:"5.80.128"};class e{_listeners=void 0;addEventListener(t,e,i){i=i??null,this._listeners||(this._listeners={});const s=this._listeners[t]??[];this._listeners[t]=s;for(const{listener:t,thisObject:o}of s)if(t===e&&o===i)return!1;return s.push({thisObject:i,listener:e}),!0}removeEventListener(t,e,i){if(i=i??null,!this._listeners)return!1;if("string"!=typeof t){for(const t in this._listeners)this.removeEventListener(t,e,i);return!1}const s=this._listeners[t];if(!s)return!1;const o=s.findIndex((({listener:t,thisObject:s})=>e===t&&i===s||!e&&i&&i===s));return o>-1&&s.splice(o,1),0===s.length&&delete this._listeners[t],o>-1}dispatchEvent(t){if(t.target=this,!this._listeners)return!0;const e=this._listeners[t.type];if(!e||t._stoppedPropagation)return!0;const i=e.slice(0);for(const{listener:e,thisObject:s}of i)if("function"==typeof e?e.call(s,t):s||e.handleEvent.call(e,t),t._stoppedPropagation)break;return!t.defaultPrevented}}class i{target;type;defaultPrevented=!1;_stoppedPropagation=!1;constructor(t){this.target=null,this.type=t,this._stoppedPropagation=!1}stopPropagation(){this._stoppedPropagation=!0}preventDefault(){this.defaultPrevented=!0}}const s=e,o=i,n={EventTarget:e,Event:i};function a(t){return Object.keys(t)}function r(t,e){const i={};for(const s of a(t))e.includes(s)||void 0===t[s]||(i[s]=t[s]);return i}function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const h=Object.freeze({LOAD:"load",LOADEND:"loadend",LOAD_ERROR:"load-error"});class d extends i{constructor(t){super(u.Events.LOAD),l(this,"jsModules",void 0),this.jsModules=t}}class c extends i{constructor(t){super(u.Events.LOADEND),l(this,"libraryNames",void 0),this.libraryNames=t}}const u=new class extends e{constructor(...t){super(...t),l(this,"Libraries",[]),l(this,"loadedLibraries",[]),l(this,"IS_CHUNKED",!1),l(this,"Events",h),l(this,"jsModules",{mapkit:{}}),l(this,"load",void 0),l(this,"loadAll",void 0)}_chunkLoaded(t,e){if(Object.assign(this.jsModules,r(t,["mapkit"])),t.mapkit){a(t.mapkit).forEach((e=>{const i=Object.getOwnPropertyDescriptor(t.mapkit,e);Object.defineProperty(this.jsModules.mapkit,e,i)}))}const i=new d(t);this.dispatchEvent(i),e?.()}_dispatchLoadEndEvent(t){const e=new c(t);this.dispatchEvent(e)}},p=27,m=32,g=37,_=38,f=39,y=40,v=()=>{},b=(t,e)=>t-e*Math.floor(t/e),w=(t,e,i)=>Math.max(e,Math.min(t,i)),C=(t,e)=>Object.keys(e).some((i=>e[i]===t)),k=(t,e,i)=>{if(void 0===t||(i?.checkNull??!0)&&null===t)throw new Error(e||"Missing parameter")},S=(t,e,i)=>{if(typeof t!==e)throw new TypeError(i||`Expected \`${e}\` but got \`${typeof t}\``);if("number"===e&&Number.isNaN(t))throw new TypeError(i||`Expected \`${e}\` but got \`NaN\``);if("object"===e&&t instanceof Array)throw new TypeError(i||"Expected a non-array object but got an array")},L=(t,e,i)=>{if(!(t instanceof e))throw new Error(i||"Unexpected object instance")},M=(t,e)=>{if(!Array.isArray(t))throw new Error(e||"Expected an array")},A=(t,e)=>null==t?{}:(S(t,"object",e||"[MapKit] The `options` parameter is not a valid object."),t),T=(t,e,i)=>t.replace(/{{(.*?)}}/g,((t,s)=>{const o=e[s];if(i&&null==o)throw new Error("fillTemplate: Missing value for parameter: "+s);return o??""})),x=()=>Math.floor(1e15*(9*Math.random()+1));function E(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const I=Math.PI/180,O=Math.PI/4,P=2*Math.PI,R=12,z=256,D=Math.PI/3,N=Math.tan(D/2);function F(t){const e=w(t,1e-8-90,90-1e-8)*I;return.5+Math.log(Math.tan(O-e/2))/P}function U(t){const e=Math.pow(Math.E,2*Math.PI*(t-.5));return-2*(Math.atan(e)-Math.PI/4)/Math.PI*180}function W(t){return b(t/360+.5,1)}function G(t){return 360*(b(t,1)-.5)}function B(t){return b(180+t,360)-180}function Z(t,e){let i=1.5,s=t;for(let o=-1;o<=1;++o){const n=Math.abs(t+o-e);n<i&&(i=n,s=t+o)}return s}function j(t,e,i){const s=e.width/(i*t.size.width),o=e.height/(i*t.size.height);return Math.log2(Math.min(s,o))}function K(t){return Math.pow(2,t)*z}function H(t){const e=t*I,i=111132.92+-559.82*Math.cos(2*e)+1.175*Math.cos(4*e)+-.0023*Math.cos(6*e),s=F(t-.5),o=F(t+.5);return Math.abs(s-o)/i}const q=1e-8,V=U(0),Y=U(1);function X(t,e){const i=t.toCoordinate(),s=e.toCoordinate();return o=i.latitude,n=i.longitude,a=s.latitude,r=s.longitude,function(t,e,
2i,s,o){const n=(i-t)*I,a=(s-e)*I,r=Math.pow(Math.sin(n/2),2)+Math.cos(t*I)*Math.cos(i*I)*Math.pow(Math.sin(a/2),2),l=2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r));return o*l}(o,n,a,r,6378160-21e3*Math.sin(o*I));var o,n,a,r}function $(t,e,i){const s=2*(N*t)*H(e);return Math.log2(i/s/z)}class J{constructor(t,e){if(E(this,"center",void 0),E(this,"span",void 0),void 0===t&&(t=new tt),void 0===e&&(e=new Q),!(t instanceof tt))throw Error("[MapKit] `center` is not a Coordinate.");if(!(e instanceof Q))throw Error("[MapKit] `span` is not a CoordinateSpan.");this.center=new tt(t.latitude,t.longitude),this.span=new Q(e.latitudeDelta,e.longitudeDelta)}copy(){return new J(this.center.copy(),this.span.copy())}toString(){return["CoordinateRegion(","\tlatitude: "+this.center.latitude,"\tlongitude: "+this.center.longitude,"\tlatitudeDelta: "+this.span.latitudeDelta,"\tlongitudeDelta: "+this.span.longitudeDelta,")"].join("\n")}equals(t){return this.center.equals(t.center)&&this.span.equals(t.span)}toBoundingRegion(){const t=this.span.latitudeDelta/2,e=this.span.longitudeDelta/2;return new et(this.center.latitude+t,B(this.center.longitude+e),this.center.latitude-t,B(this.center.longitude-e))}toMapRect(){if(this.span.latitudeDelta<0)this.span.latitudeDelta=0;else{const t=F(Math.abs(this.center.latitude)),e=V-U(2*t);this.span.latitudeDelta>e&&(this.span.latitudeDelta=e)}const t=B(this.center.longitude),e=this.span.longitudeDelta/2;let i=t-e,s=t+e,o=!1;i<-180&&(i+=360,o=!0);let n=!1;s>180&&(s-=360,n=!0);const a=new tt(this.center.latitude,i),r=new tt(this.center.latitude,s),l=a.toMapPoint(),h=r.toMapPoint();o&&(l.x-=1),n&&(h.x+=1);const d=new ot;let c,u;if(0===this.center.latitude)return c=new tt(this.center.latitude+this.span.latitudeDelta/2,this.center.longitude),u=new tt(this.center.latitude-this.span.latitudeDelta/2,this.center.longitude),d.origin.x=l.x,d.size.width=h.x-d.origin.x,d.origin.y=c.toMapPoint().y,d.size.height=u.toMapPoint().y-d.origin.y,d;const p=this.copy();p.center.latitude=Y+this.span.latitudeDelta/2;let m=10,g=new tt;const _=new it;c=new tt,u=new tt,c.longitude=this.center.longitude,u.longitude=this.center.longitude;let f=0;do{if(p.center.latitude>V&&p.center.latitude>this.center.latitude||p.center.latitude<Y&&p.center.latitude<this.center.latitude)p.center.latitude-=m,m*=.1;else if(p.center.latitude>V||p.center.latitude<Y)return new ot(0,0,1,1);if(f>500)return new ot(0,0,1,1);c.latitude=p.center.latitude+p.span.latitudeDelta/2,u.latitude=p.center.latitude-p.span.latitudeDelta/2,d.origin.x=l.x,d.size.width=h.x-d.origin.x,d.origin.y=c.toMapPoint().y,d.size.height=u.toMapPoint().y-d.origin.y,_.x=d.midX(),_.y=d.midY(),g=_.toCoordinate(),(m>0&&g.latitude>this.center.latitude||m<0&&g.latitude<this.center.latitude)&&(m*=-.1),p.center.latitude+=m,f++}while(Math.abs(g.latitude-this.center.latitude)>=q);return d}get radius(){const t=this.toMapRect();let e,i;return t.size.width>t.size.height?(e=new it(t.minX(),t.midY()),i=new it(t.maxX(),t.midY())):(e=new it(t.midX(),t.minY()),i=new it(t.midX(),t.maxY())),X(e,i)/2}}class Q{constructor(t,e){if(E(this,"latitudeDelta",void 0),E(this,"longitudeDelta",void 0),void 0===t&&(t=0),void 0===e&&(e=0),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] `latitudeDelta` is not a number.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] `longitudeDelta` is not a number.");this.latitudeDelta=Math.max(t,0),this.longitudeDelta=Math.max(e,0)}copy(){return new Q(this.latitudeDelta,this.longitudeDelta)}equals(t){return Math.abs(this.latitudeDelta-t.latitudeDelta)<q&&Math.abs(this.longitudeDelta-t.longitudeDelta)<q}toString(){return["CoordinateSpan(","\tlatitudeDelta: "+this.latitudeDelta,"\tlongitudeDelta: "+this.longitudeDelta,")"].join("\n")}}class tt{constructor(t,e){if(E(this,"latitude",void 0),E(this,"longitude",void 0),void 0===t&&(t=0),void 0===e&&(e=0),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] `latitude` is not a number.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] `longitude` is not a number.");this.latitude=t,this.longitude=e}copy(){return new tt(this.latitude,this.longitude)}equals(t){return Math.abs(this.latitude-t.latitude)<q&&Math.abs(this.longitude-t.longitude)<q}toMapPoint(){return new it(W(this.longitude),F(this.latitude))}toUnwrappedMapPoint(){return new it(this.longitude/360+.5,F(this.latitude))}toString(){return["Coordinate(","latitude:"+this.latitude.toFixed(R),",longitude:"+this.longitude.toFixed(R),")"].join("")}}class et{constructor(t,e,i,s){if(E(this,"northLatitude",void 0),E(this,"eastLongitude",void 0),E(this,"southLatitude",void 0),E(this,"westLongitude",void 0),arguments.length<4&&(s=0,arguments.length<3&&(i=0,arguments.length<2&&(e=0,arguments.length<1&&(t=0)))),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] Expected a number for `northLatitude` in BoundingRegion constructor but got `"+t+"` instead.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] Expected a number for `eastLongitude` in BoundingRegion constructor but got `"+e+"` instead.");if("number"!=typeof i||isNaN(i))throw new TypeError("[MapKit] Expected a number for `southLatitude` in BoundingRegion constructor but got `"+i+"` instead.");if("number"!=typeof s||isNaN(s))throw new TypeError("[MapKit] Expected a number for `westLongitude` in BoundingRegion constructor but got `"+s+"` instead.");this.northLatitude=t,this.eastLongitude=e,this.southLatitude=i,this.westLongitude=s}copy(){return new et(this.northLatitude,this.eastLongitude,this.southLatitude,this.westLongitude)}toString(){return["BoundingRegion(","\tnorthLatitude: "+this.northLatitude,"\teastLongitude: "+this.eastLongitude,"\tsouthLatitude: "+this.southLatitude,"\twestLongitude: "+this.westLongitude,")"].join("\n")}toCoordinateRegion(){let t=B(this.eastLongitude);const e=B(this.westLongitude);t<e&&(t+=360);const i=this.northLatitude-this.southLatitude,s=t-e;
2return new J(new tt(this.southLatitude+i/2,B(e+s/2)),new Q(i,s))}}class it{constructor(t,e){if(E(this,"x",void 0),E(this,"y",void 0),E(this,"z",void 0),E(this,"w",void 0),arguments.length<2&&(e=0,arguments.length<1&&(t=0)),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] Expected a number for `x` in MapPoint constructor but got `"+t+"` instead.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] Expected a number for `y` in MapPoint constructor but got `"+e+"` instead.");this.x=t,this.y=e,this.z=0,this.w=1}toString(){return"MapPoint("+this.x+", "+this.y+")"}copy(){return new it(this.x,this.y)}equals(t){return this.x===t.x&&this.y===t.y}toCoordinate(){return new tt(U(this.y),B(G(this.x)))}}class st{constructor(t,e){if(E(this,"width",void 0),E(this,"height",void 0),arguments.length<2&&(e=0,arguments.length<1&&(t=0)),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] Expected a number for `width` in MapSize constructor but got `"+t+"` instead.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] Expected a number for `height` in MapSize constructor but got `"+e+"` instead.");this.width=t,this.height=e}toString(){return"MapSize("+this.width+", "+this.height+")"}copy(){return new st(this.width,this.height)}equals(t){return this.width===t.width&&this.height===t.height}}class ot{constructor(t,e,i,s){if(E(this,"origin",void 0),E(this,"size",void 0),arguments.length<4&&(s=0,arguments.length<3&&(i=0,arguments.length<2&&(e=0,arguments.length<1&&(t=0)))),"number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] Expected a number for `x` in MapRect constructor but got `"+t+"` instead.");if("number"!=typeof e||isNaN(e))throw new TypeError("[MapKit] Expected a number for `y` in MapRect constructor but got `"+e+"` instead.");if("number"!=typeof i||isNaN(i))throw new TypeError("[MapKit] Expected a number for `width` in MapRect constructor but got `"+i+"` instead.");if("number"!=typeof s||isNaN(s))throw new TypeError("[MapKit] Expected a number for `height` in MapRect constructor but got `"+s+"` instead.");this.origin=new it(t,e),this.size=new st(i,s)}toString(){return"MapRect("+[this.origin.x.toFixed(R),this.origin.y.toFixed(R),this.size.width.toFixed(R),this.size.height.toFixed(R)].join(", ")+")"}copy(){return new ot(this.origin.x,this.origin.y,this.size.width,this.size.height)}equals(t){return this.origin.equals(t.origin)&&this.size.equals(t.size)}minX(){return this.origin.x}minY(){return this.origin.y}midX(){return this.origin.x+this.size.width/2}midY(){return this.origin.y+this.size.height/2}maxX(){return this.origin.x+this.size.width}maxY(){return this.origin.y+this.size.height}scale(t,e){if("number"!=typeof t||isNaN(t))throw new TypeError("[MapKit] The `scaleFactor` parameter passed to `MapRect.scale()` is not a number.");const i=this.size.width*t,s=this.size.height*t;if(!e)return new ot(this.midX()-i/2,this.midY()-s/2,i,s);if(!(e instanceof it))throw Error("[MapKit] The `scaleCenter` parameter passed to `MapRect.scale()` is not a MapPoint.");return new ot(e.x-t*(e.x-this.origin.x),e.y-t*(e.y-this.origin.y),i,s)}toCoordinateRegion(){const t=this.origin.toCoordinate(),e=new it(this.maxX(),this.maxY()).toCoordinate(),i=Math.abs(e.latitude-t.latitude);let s=e.longitude-t.longitude;return e.longitude<t.longitude&&(s+=360),new J(new it(this.midX(),this.midY()).toCoordinate(),new Q(i,s))}}class nt{constructor(t,e){if(E(this,"_minCameraDistance",void 0),E(this,"_maxCameraDistance",void 0),null==e)if("number"==typeof t)e=1/0;else{const i=null==t?{}:t;t="minCameraDistance"in i?i.minCameraDistance:0,e="maxCameraDistance"in i?i.maxCameraDistance:1/0}if("number"!=typeof t||t<0)throw new Error("[MapKit] The `minCameraDistance` property of CameraZoomRange must be a number >= 0");if("number"!=typeof e||e<0)throw new Error("[MapKit] The `maxCameraDistance` property of CameraZoomRange must be a number >= 0");if(e<t)throw new Error("[MapKit] The `maxCameraDistance` property of CameraZoomRange must be greater than the `minCameraDistance` property.");this._minCameraDistance=t,this._maxCameraDistance=e}get minCameraDistance(){return this._minCameraDistance}get maxCameraDistance(){return this._maxCameraDistance}copy(){return new nt(this._minCameraDistance,this._maxCameraDistance)}}class at{static Zero=new at;width;height;constructor(t,e){this.width=t??0,this.height=e??0}toString(){return`Size[${this.width}, ${this.height}]`}copy(){return new at(this.width,this.height)}equals(t){return this.width===t.width&&this.height===t.height}}function rt(t){return Object.freeze(t)}const lt=rt({blue:[0,122,255],green:[52,199,89],indigo:[88,86,214],orange:[255,149,0],pink:[255,45,85],purple:[175,82,222],red:[255,59,48],teal:[90,200,250],yellow:[255,204,0],gray:[142,142,147],gray2:[174,174,178],gray3:[199,199,204],gray4:[209,209,214],gray5:[229,229,234],gray6:[242,242,247]}),ht=rt({blue:[10,132,255],green:[48,209,88],indigo:[94,92,230],orange:[255,159,10],pink:[255,55,95],purple:[191,90,242],red:[255,69,58],teal:[100,210,255],yellow:[255,214,10],gray:[142,142,147],gray2:[99,99,102],gray3:[72,72,74],gray4:[58,58,60],gray5:[44,44,46],gray6:[28,28,30]}),dt=rt({Satellite:"satellite",Hybrid:"hybrid",MutedStandard:"mutedStandard",Standard:"standard"}),ct=rt({Hybrid:"46",Standard:"1"}),ut=(rt({WebGL:"webgl",WebGL2:"webgl2"}),rt({Adaptive:"adaptive",Metric:"metric",Imperial:"imperial"})),pt=rt({BaseMap:"basemap",Roads:"roads",Borders:"borders",Buildings:"buildings",Icons:"icons",Labels:"labels"}),mt=rt({Normal:"normal",Multiply:"multiply",HardLight:"hard-light",SoftLight:"soft-light"}),gt=rt({Normal:"normal",Grayscale:"grayscale"}),_t=rt({LandCover:"LandCover",PointsOfInterest:"PointsOfInterest",None:null}),ft=rt({Muted:"muted",Standard:"standard"}),yt=rt({Adaptive:"adaptive",Hidden:"hidden",Visible:"visible"}),vt=rt({default:lt,light:lt,dark:ht}),bt='"SFProRegular", "-apple-system", "BlinkMacSystemFont", "Helvetica Neue", Helvetica, Arial, sans-serif',wt=rt({Button:"BUTTON",Scroll:"SCROLL",DoubleTap:"DOUBLE_TAP",Pinch:"PINCH"}),Ct={minimumSizeToShowControls:new at(306,220),minimumSizeToShowLogo:new at(200,100),minimumSizeToShowLogoWithReducedMargin:new at(100,100),maximumSizeControlsNormal:new at(1024,0)},kt=Object.freeze({Highest:0,High:1,Medium:2,Low:3}),St=kt,Lt={[St.Highest]:12,[St.High]:12,[St.Medium]:4,[St.Low]:1}
2,Mt={[St.Highest]:[],[St.High]:[],[St.Medium]:[],[St.Low]:[]},At={[St.Highest]:0,[St.High]:0,[St.Medium]:0,[St.Low]:0},Tt=()=>{for(const t of Object.values(St)){if(Mt[t].length>0){const e=Lt[t];return At[t]===e?null:Mt[t][0]}if(At[t]>0)return null}return null},xt=()=>{for(const t of Object.values(St))if(Mt[t].length>0)return Mt[t].shift(),!0;return!1},Et=t=>{for(const e of Object.values(St)){const i=Mt[e].indexOf(t);if(-1!==i)return Mt[e].splice(i,1),!0}return!1},It=()=>{let t=Tt();for(;t;)At[t.priority]+=1,xt(),t._loaderWillStart.call(t),t=Tt()},Ot=t=>{Mt[t.priority].push(t),It()},Pt=t=>Et(t),Rt=t=>{At[t.priority]-=1,It()},zt=((()=>{if(/iP(hone|od|ad)/.test(navigator.platform)){const t=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(t?.[1]??"0",10),parseInt(t?.[2]??"0",10),parseInt(t?.[3]??"0",10)]}})(),(t,e)=>{if(!Dt(t))throw new Error(e||"Expected an Element")}),Dt=t=>t instanceof window.Node&&t.nodeType===window.Node.ELEMENT_NODE,Nt=(window.XMLHttpRequest,t=>{const e=new window.XMLHttpRequest;return e.addEventListener("load",t),e.addEventListener("error",t),e.addEventListener("timeout",t),e}),Ft=()=>document.createElement("canvas"),Ut=Object.freeze({Unscheduled:0,Waiting:1,Loading:2,Canceled:3,Succeeded:4,Failed:5});Object.freeze(Object.values(Ut));const Wt=class{constructor(t,e){this._state=Ut.Unscheduled,this._retries=0,this._unscheduled=!1,this._delay=null,this._timeoutId=void 0,this.priority=t,this._delegate=e,this._init(t,e)}_getDelegate(){return this._delegate}_isUnscheduled(){return this._unscheduled}get state(){return this._state}schedule(){this._state===Ut.Unscheduled&&(this._state=Ut.Waiting,Ot(this))}unschedule(){let t=!1;if(this._state===Ut.Waiting)t=Pt(this);else{if(this._state!==Ut.Loading)return!1;Rt(this),t=!0}return this._unscheduled=t,this._state=Ut.Canceled,"function"==typeof this._delegate.loaderDidCancel&&this._delegate.loaderDidCancel(this),this._reset(),t}_loaderWillStart(){this._state=Ut.Loading,"function"==typeof this._delegate.loaderWillStart&&this._delegate.loaderWillStart(this)}_loaderDidSucceed(t){this._state=Ut.Succeeded,Rt(this),"function"==typeof this._delegate.loaderDidSucceed&&this._delegate.loaderDidSucceed(this,t),this._reset()}_loaderDidFail(t){this._state=Ut.Failed,Rt(this),"function"==typeof this._delegate.loaderDidFail&&this._delegate.loaderDidFail(this,t),this._reset()}_init(t,e){this.priority=t,this._state=Ut.Unscheduled,this._delegate=e,this._retries=0,this._timeoutId=void 0,this._delay=null,this._unscheduled=!1}_reload(t){if(this._retries++,this._retries<3){const t=this._delay??1e4;this._timeoutId=setTimeout((()=>this._loaderWillStart()),t)}else this._loaderDidFail(t)}_reset(){clearTimeout(this._timeoutId)}};class Gt extends Wt{constructor(t,e,i){super(i?.priority??kt.Highest,e),this._origin=null,this._xhr=null,this._xhrData=void 0,this._headers=i?.headers??null,this._method=i?.method??"GET",this._retry=i?.retry??!1,this._timeout=i?.timeout??0,this._withCredentials=i?.withCredentials??!1,this._responseType=i?.responseType??void 0,this._url=t,this._delay=i?.delay??null}get xhr(){return this._xhr}get url(){return this._url}get xhrData(){return this._xhrData}unschedule(){return this._xhr?.abort(),super.unschedule()}_loaderWillStart(){if(super._loaderWillStart(),this._xhr=Nt(this),this._xhr.open(this._method,this.url,!0),this._xhr.timeout=this._timeout,this._xhr.withCredentials=this._withCredentials,this._origin&&(this._xhr.setDisableHeaderCheck(!0),this._xhr.setRequestHeader("Origin",this._origin)),this._headers)for(const[t,e]of Object.entries(this._headers))this._xhr.setRequestHeader(t,e);if(this._responseType&&(this._xhr.responseType=this._responseType),"POST"===this._method&&!this._xhrData){const t=this._getDelegate(),e=t.getDataToSend?.(this._xhr);if(!e)return;this._xhrData=e}this._xhr.send(this._xhrData)}handleEvent(t){const e=t.target,i=t.type;if("error"===i||"timeout"===i||200!==e.status)this._retry?this._reload(e):this._loaderDidFail(e);else if("load"===i)this._loaderDidSucceed(e);else{const t=e.status??-1;console.log(`Unhandled XHR event type: ${i} status: ${t}`)}}}function Bt(t){return String.fromCharCode.apply(String,t.split("").map((t=>(t.codePointAt(0)+242)%255)))}const Zt="function"==typeof ErrorEvent;function jt(t,e,i,s){if(!Zt)return i?t.apply(e,i):t.call(e);try{return i?t.apply(e,i):t.call(e)}catch(t){console.error(t);const e=new ErrorEvent("error",{message:t instanceof Error?t.message:t instanceof Object?t.toString():"(Unknown error)",filename:t instanceof Error?t.fileName||t.stack:"(Unknown filename)",lineno:t instanceof Error?t.lineNumber:void 0,colno:t instanceof Error?t.columnNumber:void 0,error:t});return window.dispatchEvent(e),s}}class Kt{constructor(t,e,i){var s;this.language=t.toLowerCase(),this.region=e?e.toUpperCase():null,this.script=i?(s=i)?s[0].toUpperCase()+s.substr(1).toLowerCase():s:null}get tag(){return this.region?`${this.language}-${this.region}`:this.script?`${this.language}-${this.script}`:this.language}toString(){return`{ ${`language: ${this.language}`}${this.region?`, region: ${this.region}`:""}${this.script?`, script: ${this.script}`:""} }`}static parse(t){let e,i;if(t&&"string"==typeof t){if(-1!==t.indexOf("_"))return console.warn("Invalid character: '_'"),null;const s=t.split("-"),o=s[0];if(o.length<2||o.length>4)return console.warn("Invalid language:",t),null;if(!(s.length<4))return console.warn("Don't know how to parse language tags with more than 3 parts:",t),null;for(let o=1;o<s.length;o+=1){const n=s[o];if(4===n.length)i=n;else{if(!(n.length>1&&n.length<4))return console.warn("Don't know how to parse:",t),null;e=n}}return new Kt(o,e,i)}return null}}const Ht=(t,e)=>{if(!t)return;const{language:i,region:s,script:o}=t;e[i]=e[i]||{regions:[],scripts:[]},s&&e[i].regions.push(s),o&&e[i].scripts.push(o)};const qt={"en-AU":"en-GB","en-IE":"en-GB","en-IN":"en-GB","en-NZ":"en-GB","en-SG":"en-GB","en-ZA":"en-GB","es-LA":"es-MX","es-XL":"es-MX","nn-NO":"nb-NO","no-NO":"nb-NO","vi-VI":"vi-VN",iw:"he-IL"},Vt={zh:{CN:"Hans",HK:"Hant",TW:"Hant"}},Yt=["bn-BD","gu-IN","kn-IN","ml-IN","mr-IN","or-IN","pa-IN","ta-IN","te-IN","ur-PK"],Xt=Yt.map((t=>t.split("-")[0]));function $t(t,e,i,s){for(const o of t){const t=e.indexOf(o);e.splice(t,1);const n=o.split("-")[0];s[n]=i[n],delete i[n]}}function Jt(t,e,i,s){e.splice(0,0,...t),e.sort();for(const[t,e]of Object.entries(s))i[t]=e}const Qt=new class{constructor(t){this.supportMap={},this.delegate=t;for(const t of this.delegate.supportedLocales)Ht(Kt.parse(t),this.supportMap)}bestMatch(t,e){let i=Kt.parse(t),s=null;if(i&&this.delegate.localesMap){const t=this.delegate.localesMap;t[i.tag]?i=Kt.parse(t[i.tag]):t[i.language]&&(i=Kt.parse(t[i.language]))}return e=e||null,i&&(s=((t,e,i)=>{const{language:s,region:o,script:n}=t;let a=n;const r=i[s];if(!r)return null;if(o){const i=r.regions.find((e=>e.toUpperCase()===t.region?.toUpperCase()));if(i)return new Kt(s,i);const n=e[s];n&&n[o.toUpperCase()]&&(t.script=a=n[o.toUpperCase()])}if(a){const e=r.scripts.find((e=>e.toUpperCase()===t.script?.toUpperCase()));return new Kt(s,null,e)}return new Kt(s)}
2)(i,this.delegate.regionToScriptMap,this.supportMap)),s?s.tag:e}}({supportedLocales:["ar","bn","ca","cs","da","de","el","en-AU","en-GB","en","es-MX","es-US","es","fi","fr-CA","fr","gu","he","hi","hr","hu","id","it","ja","kn","ko","ml","mr","ms","nb","nl","or","pa","pl","pt-PT","pt","ro","ru","sk","sl","sv","ta","te","th","tr","uk","ur","vi","zh-Hans","zh-Hant","zh-HK"],regionToScriptMap:Vt,localesMap:qt}),te=Object.create(null);$t(Xt,Qt.delegate.supportedLocales,Qt.supportMap,te);const ee=function(){Jt(Xt,Qt.delegate.supportedLocales,Qt.supportMap,te)};function ie(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class se{constructor(){ie(this,"loggers",[])}appendLogger(t){this.loggers.push(t)}_invoke(t,e){if(this.loggers.length)for(const i of this.loggers)i[t]?.(...e);else"error"!==t&&"warn"!==t||console[t](...e)}error(...t){this._invoke("error",t)}warn(...t){this._invoke("warn",t)}log(...t){this._invoke("log",t)}info(...t){this._invoke("info",t)}debug(...t){this._invoke("debug",t)}}ie(se,"sharedLogger",new se);const oe=se.sharedLogger,ne=Symbol();function ae(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function re(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,le(t,e,"set"),i),i}function le(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function he(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}Lt[St.Highest]*=10,Lt[St.High]*=10,Lt[St.Medium]*=10,Lt[St.Low]*=10;const de="https:",ce={url:`${de}${t.cdnBase}/ma/bootstrap`,apiVersion:"2",accessKeyExpirationBiasMS:3e4},ue={OK:200,MULTIPLE_CHOICES:300,BAD_REQUEST:400,UNAUTHORIZED:401,TOO_MANY_REQUESTS:429},pe=["language","countryCode","madabaBaseUrl","authorizationCallback","libraries","logger","_showMapsLogo","_showLegalLink","bootstrapTimeout","_shadowDOMMode","_showsTileInfo","_distUrl","_syrupUrl","_uiBaseUrl","_mmanBaseUrl","_teamId","_previewLoCSR","_forcedRenderingMode","_proxyPrefixes","_shouldLogin","_enableExperimentalLanguages"],me="R`ha\\aHe_";pe.push(me);const ge=rt({READY:0,PENDING:1,ERROR:2,UNINITIALIZED:3}),_e=rt({Initialized:"Initialized",Refreshed:"Refreshed"}),fe=rt({Initialized:"configuration-init",Changed:"configuration-change",Error:"error"}),ye=rt({BadRequest:"Bad Request",Unauthorized:"Unauthorized",TooManyRequests:"Too Many Requests",MalformedResponse:"Malformed Response",Timeout:"Timeout",NetworkError:"Network Error",Unknown:"Unknown"}),ve="Bearer {{token}}",be=rt({Apple:"Apple",AutoNavi:"AutoNavi"});let we=!1;const Ce=new WeakMap,ke=window.location.hostname,Se=window.location.href;class Le{constructor(t){he(this,"bootstrap",void 0),he(this,"countryCode",null),this.bootstrap=t}setForcedCountryCode(t){return!t||ke.endsWith(".apple.com")||ke.endsWith(".autonavi.com")||console.error("[MapKit] Not allowed."),this.setForcedCountryCodeUnrestricted(t)}setForcedCountryCodeUnrestricted(t){if(t!==this.countryCode&&(t&&(S(t,"string","[MapKit] `countryCode` must be a string or `null`."),t=t.toUpperCase()),this.countryCode=t,t&&this.bootstrap._setLocaleWithCountryCode&&(delete this.bootstrap._setLocaleWithCountryCode,this.bootstrap.language="zh-"+this.countryCode),this.bootstrap.ready)){for(const t of this.bootstrap.resetHooks)t();this.bootstrap._loadFromServer()}}}class Me extends i{constructor(t,e){super(fe.Changed),this.status=t,this.responseIdentifier=e}}class Ae extends i{constructor(t,e,i){super(fe.Error),this.status=t,this.message=e,this.responseIdentifier=i}}var Te=new WeakMap;class xe extends e{constructor(){super(),he(this,"_jwtTokensToCheck",[]),he(this,"componentVersions",new Map),he(this,"performanceMarkers",{}),he(this,"HTTP",ue),he(this,"ErrorStatus",ye),he(this,"TileProviders",be),he(this,"Events",fe),he(this,"States",ge),he(this,"state",ge.UNINITIALIZED),he(this,"enableSourceMap",!1),he(this,"authorizationCallback",null),he(this,"tileProvider",null),he(this,"_showMapsLogo",!0),he(this,"_showLegalLink",!0),he(this,"shadowDOMMode",void 0),he(this,"_madabaBaseUrl",null),he(this,"customMadabaUrl",!1),he(this,"_madabaDomains",null),he(this,"_disableCsr",void 0),he(this,"_proxyPrefixMap",[]),he(this,"_proxyPrefixes",{}),he(this,"_accessKey",null),he(this,"_accessToken",null),he(this,"_distUrl",null),he(this,"_syrupUrl",null),he(this,"apiBaseUrl",null),he(this,"mmanBaseUrl",null),he(this,"customMmanBaseUrl",!1),he(this,"environment",void 0),he(this,"analytics",void 0),he(this,"apiBaseUrlOverride",null),he(this,"_showsTileInfo",!1),he(this,"_messagePrefix","[MapKit] "),he(this,"nonce",""),he(this,"scriptBaseUrl",void 0),he(this,"expires
2InSeconds",void 0),he(this,"expiresAt",void 0),he(this,"expiresIn",void 0),he(this,"_forcedRenderingMode",void 0),he(this,"_shouldLogin",void 0),he(this,"_loginPromise",void 0),he(this,"_userInitializedInit",void 0),he(this,"masMat",void 0),he(this,me,void 0),he(this,"origin",void 0),he(this,"_bootstrapTimeout",void 0),he(this,"uiBaseUrl",void 0),he(this,"customUiBaseUrl",void 0),he(this,"teamId",void 0),he(this,"analyticsTeamId",void 0),he(this,"locationShiftUrl",void 0),he(this,"_data",void 0),ae(this,Te,{writable:!0,value:!1}),he(this,"_language",null),he(this,"_setLocaleWithCountryCode",void 0),he(this,"_l10n",void 0),he(this,"_l10nEnableExperimentalLocales",void 0),he(this,"_xhrLoader",void 0),he(this,"_reloadTimerId",void 0),he(this,"resetHooks",[]),he(this,"_syrupRequestedFallback",!1),he(this,"_syrupRequestedFallbackType",void 0),he(this,"tileGroup",void 0),he(this,"types",{}),he(this,"rasterTilesForSyrup",void 0),this.language=null,Ce.set(this,new Le(this))}_c(t){if(t!==ne)throw new Error("Invalid key.");return Ce.get(this)}get showMapsLogo(){return this._showMapsLogo}get showLegalLink(){return this._showLegalLink}get showsTileInfo(){return this._showsTileInfo}get forcedRenderingMode(){return this._forcedRenderingMode}get distUrl(){return this._distUrl}isUrlTrusted(t){const e=new URL(t,Se);if(window.location.origin&&e.origin===window.location.origin)return!0;if(this.scriptBaseUrl){const t=new URL(this.scriptBaseUrl,Se);if(t.origin&&e.origin===t.origin)return!0}return!1}get buildTags(){let t="";return[...this.componentVersions.entries()].forEach((([e,i])=>t+=" ("+e+": "+i+")")),t}get _initMessagePrefix(){return this._messagePrefix+"mapkit.init(): "}get proxyPrefixes(){return this._proxyPrefixes}getProxyPrefix(t=ce.url){const e=this._proxyPrefixMap.find((e=>e[0].test(t)));return e?.[1]}applyProxyPrefix(t){if(null==t)return t;const e=t.startsWith("//")?de+t:t,i=this.getProxyPrefix(e);return i?i+t:e}urlWithCredentials(t){return!!t&&/\bproxy\b.*\.geo\.apple\.com\b/.test(t)}get loginPromise(){if(!this._loginPromise)if(this._shouldLogin){const t=this.getProxyPrefix();this._loginPromise=t&&this.urlWithCredentials(t)?(async t=>(t&&await fetch(t,{mode:"no-cors",credentials:"include"}),Promise.resolve()))(t):Promise.resolve()}else this._loginPromise=Promise.resolve();return this._loginPromise}init(t,e=!1){we&&performance.mark("mapkit-init-start"),k(t,this._initMessagePrefix+"`options` object is required.",{checkNull:!0}),S(t,"object",this._initMessagePrefix+"`options` object is invalid.");const s={};if(t.logger&&oe.appendLogger(t.logger),Object.keys(t).forEach((t=>{const e=pe.includes(Bt(t));e||pe.includes(t)||console.warn(this._initMessagePrefix+"ignoring invalid option: `"+t+"`."),e&&(s[Bt(t)]=t)})),e||this.authorizationCallback&&void 0===t.authorizationCallback||(k(t.authorizationCallback,this._initMessagePrefix+"`options` is missing `authorizationCallback`.",{checkNull:!0}),S(t.authorizationCallback,"function",this._initMessagePrefix+"`authorizationCallback` in `options` must be a function.")),t.language&&S(t.language,"string",this._initMessagePrefix+"`language` in `options` must be a string."),this._userInitializedInit)return void console.warn(this._initMessagePrefix+"already initialized; ignoring.");e||(this._userInitializedInit=!0),void 0!==t._previewLoCSR&&t._previewLoCSR&&(this._forcedRenderingMode="HYBRID"),void 0!==t._forcedRenderingMode&&(this._forcedRenderingMode=t._forcedRenderingMode);const o=t._proxyPrefixes;if(void 0!==o)if("object"!=typeof o)console.warn("mapkit.init() is getting a _proxyPrefixes that is not an object or array.");else{this._proxyPrefixes=Array.isArray(o)?{"*":o[0]}:o;const t=Object.entries(this._proxyPrefixes).map((([t,e])=>[new RegExp("^https?:\\/\\/"+t.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,"[^/]*")+"(\\/|$)"),e]));0,this._proxyPrefixMap=t}void 0!==t._distUrl&&(this._distUrl=t._distUrl??null),void 0!==t._syrupUrl&&(this._syrupUrl=t._syrupUrl),this._shouldLogin=this.urlWithCredentials(this.getProxyPrefix()),void 0===t._shouldLogin||t._shouldLogin||(this._shouldLogin=!!t._shouldLogin),s[me]&&void 0!==t[s[me]]&&
2(this[me]=t[s[me]]);const n=!(this.state!==ge.UNINITIALIZED&&this.state!==ge.ERROR||!t.authorizationCallback);n&&(this.state=ge.PENDING),t.authorizationCallback&&(this.authorizationCallback=t.authorizationCallback);const a=Ce.get(this);void 0!==t.countryCode&&null===a.countryCode&&a.setForcedCountryCodeUnrestricted(t.countryCode),t._enableExperimentalLanguages&&(re(this,Te,!0),ee(),this._language=null,this.language=null,this._l10nEnableExperimentalLocales?.()),void 0!==t.language?this.language=t.language:this._l10n&&(this._l10n.localeId=this.language),void 0!==t._showMapsLogo&&(this._showMapsLogo=!!t._showMapsLogo),void 0!==t._showLegalLink&&(this._showLegalLink=!!t._showLegalLink),void 0!==t._shadowDOMMode&&(this.shadowDOMMode=t._shadowDOMMode),t.bootstrapTimeout&&(this._bootstrapTimeout=t.bootstrapTimeout),t.madabaBaseUrl&&(this._madabaBaseUrl=t.madabaBaseUrl,this.customMadabaUrl=!0),t._uiBaseUrl&&(this.uiBaseUrl=t._uiBaseUrl,this.customUiBaseUrl=!0),t._mmanBaseUrl&&(this.mmanBaseUrl=t._mmanBaseUrl,this.customMmanBaseUrl=!0),t._showsTileInfo&&(this._showsTileInfo=t._showsTileInfo),t._teamId&&(this.analyticsTeamId=t._teamId),n&&(this._shouldLogin?this.loginPromise.then((()=>{this._loadFromServer()}),(()=>{this._loadFailed(ye.NetworkError,"Initialization failed because of network error connecting to proxy.")})):this._loadFromServer()),t.libraries;const r=new i(this.Events.Initialized);this.dispatchEvent(r)}login(){const t=this.getProxyPrefix();t&&this.urlWithCredentials(t)&&(t=>{if(!t)return Promise.resolve();const e=window.open((t=>t.replace(/\/proxy\?$/,"/login"))(t),"_blank","popup=yes,width=700,height=700");return new Promise(((t,i)=>{e||i(new Error);const s=o=>{o.source===e&&(window.removeEventListener("message",s),o.data&&o.data.login?t(void 0):i(new Error))};window.addEventListener("message",s)}))})(t).then((()=>{this.reloadFromServer()}),(()=>console.error("[MapKit] There is a problem triggering login popup.")))}reloadFromServer(){this._loadFromServer()}get accessKey(){return this._accessKey}get accessToken(){return this._accessToken}accessKeyMayBeExpired(){(!this.expiresAt||Date.now()>this.expiresAt)&&this.accessKeyHasExpired()}accessKeyHasExpired(){this._loadFromServer(St.Highest)}get ready(){return this.state===ge.READY}get error(){return this.state===ge.ERROR}get language(){return this._language}set language(t){t===this._language&&null!==this._language||(delete this._setLocaleWithCountryCode,t?(S(t,"string","[MapKit] `language` must be a string or `null`."),t.startsWith("x-")&&(t=t.substring(2),re(this,Te,!0),ee(),this._l10nEnableExperimentalLocales?.()),"zh"===t.toLowerCase()&&(console.warn("[MapKit] `zh` is an ambiguous language ID. Please specify a script or reginal variant: `zh-Hans`, `zh-Hant`, or `zh-HK`."),Ce.get(this)?.countryCode?t="zh-"+Ce.get(this)?.countryCode:this._setLocaleWithCountryCode=!0)):t=this._getClientLanguage(),this._language=Qt.bestMatch(t,"en"),this.state!==ge.UNINITIALIZED&&this._l10n&&(this._l10n.localeId=t))}get countryCode(){return Ce.get(this).countryCode}get isAutoNavi(){const t=Ce.get(this);return this.tileProvider===be.AutoNavi||this.state===ge.PENDING&&"CN"===t.countryCode}appendAuthOptions(t,e){const i=e||(this.accessToken&&!this.isAutoNavi?this.accessToken:null);return i&&(t.headers=t.headers||{},t.headers.Authorization=T(ve,{token:i})),t}setL10n(t,e){var i;this._l10n=t,this._l10nEnableExperimentalLocales=e,function(t,e){return e.get?e.get.call(t):e.value}(i=this,le(i,Te,"get"))&&e(),this.state!==ge.UNINITIALIZED&&(this._l10n.localeId=this.language)}setPerformanceMarkers(t){if(!t)return;const e=t.split(",").map((t=>t.trim()));for(const t of e)this.performanceMarkers[t]=!0;we=!!this.performanceMarkers.loading}handleEvent(t){switch(t.type){case"visibilitychange":"visible"===document.visibilityState&&this.ready&&this.accessKeyMayBeExpired();break;case"online":this.ready?this.accessKeyMayBeExpired():this.error&&this.reloadFromServer()}}loaderWillStart(t){this._xhrLoader===t&&(this.state=ge.PENDING)}loaderDidSucceed(t,e){this._xhrLoader===t&&(this._requestDidLoad(e),we&&this.state===ge.PENDING&&performance.measure("mapkit-init","mapkit-init-start"),this._xhrLoader=void 0)}loaderDidFail(t,e){this._xhrLoader===t&&(this._parseError(t.xhr),this._xhrLoader=void 0)}_loadFromServer(e){let i=new URL(ce.url,Se);i.searchParams.append("apiVersion",ce.apiVersion);const s=Ce.get(this).countryCode;s&&i.searchParams.append("countryCode",s),i.searchParams.append("mkjsVersion",t.version),i.searchParams.append("poi","1"),i=new URL(this.applyProxyPrefix(i.toString()),Se);const o=this.getProxyPrefix(),n=this.urlWithCredentials(o),a={retry:!0,delay:0,priority:e,timeout:this._bootstrapTimeout,withCredentials:n};n&&!/\bapple\.com$/.test(window.location.hostname)&&o&&/\bapple\.com\b/.test(o)&&console.warn("[MapKit] Request with credentials may fail if the page is not hosted on the same domain as the proxy."),jt(this.authorizationCallback,null,[t=>{t&&(this._checkJwtToken?this._checkJwtToken(t):this._jwtTokensToCheck.push(t)),this.appendAuthOptions(a,t),this.accessToken&&(a.headers=a.headers??{},a.headers["X-Maps-Access-Token"]=T(ve,{token:this.accessToken}));const e=new Gt(i.toString(),this,a);this._xhrLoader&&this._xhrLoader.unschedule(),e.schedule(),this._xhrLoader=e}])}_requestDidLoad(t){const e=t.getResponseHeader("x-rid")??void 0;if(!this._parseError(t,e))if(t.responseText)try{const i=JSON.parse(t.responseText);this._processLoadedData(i,e)}catch(t){if(!(t instanceof SyntaxError))throw t;this._loadFailed(ye.MalformedResponse,"Initialization failed because of incorrect server response.")}else this._loadFailed(ye.MalformedResponse,"Initialization failed because of incorrect server response.")}_resetReloadTimer(t){clearTimeout(this._reloadTimerId),this._reloadTimerId=setTimeout((()=>{delete this._reloadTimerId,this.accessKeyHasExpired()}),t),"object"==typeof this._reloadTimerId&&this._reloadTimerId.unref()}_loadSucceeded(t,e){setTimeout((()=>{this.state=ge.READY;const i=new Me(t?_e.Refreshed:_e.Initialized,e);this.dispatchEvent(i)}),0)}
2_loadFailed(t,e,i){console.error(this._messagePrefix+e),setTimeout((()=>{this.state=ge.ERROR,clearTimeout(this._reloadTimerId),delete this._reloadTimerId,this.expiresInSeconds=void 0,this.expiresAt=void 0,this.expiresIn=void 0;const s=new Ae(t,this._messagePrefix+e,i);this.dispatchEvent(s)}),0)}_processLoadedData(t,e){const i=!!this._accessToken;this._parseData(t),this.expiresIn&&this._resetReloadTimer(this.expiresIn);const s=Ce.get(this);s.countryCode&&this._setLocaleWithCountryCode&&(delete this._setLocaleWithCountryCode,this.language="zh-"+s.countryCode),document.addEventListener("visibilitychange",this),window.addEventListener("online",this),this._loadSucceeded(i,e)}_parseData(e){e.apiBaseUrl;const i=Ce.get(this);if(i.countryCode=e.countryCode&&"unknown"!==e.countryCode?e.countryCode:null,i.countryCode&&"zh"===this.language&&(this.language="zh-"+i.countryCode),this.environment=e.environment,this.apiBaseUrl=this.applyProxyPrefix(this.apiBaseUrlOverride??e.apiBaseUrl??null),e.analytics){const t=e.analytics;this.analytics={...t,analyticsUrl:this.applyProxyPrefix(t.analyticsUrl),errorUrl:this.applyProxyPrefix(t.errorUrl)}}e.authInfo&&e.authInfo.team_id&&(this.teamId=e.authInfo.team_id),e.locationShiftUrl&&(this.locationShiftUrl=this.applyProxyPrefix(e.locationShiftUrl)),this.expiresInSeconds=e.expiresInSeconds,this.expiresIn=1e3*this.expiresInSeconds-ce.accessKeyExpirationBiasMS,this.expiresAt=Date.now()+this.expiresIn;const s=e.tileSources.some((t=>t.needsLocationShift));e.accessKey&&(this._accessKey=e.accessKey),e.authInfo&&e.authInfo.access_token&&(this._accessToken=e.authInfo.access_token),this.tileProvider=s?xe.TileProviders.AutoNavi:xe.TileProviders.Apple,this._data=e,this.customUiBaseUrl||(this.uiBaseUrl=e.uiBaseUrl),this.customMmanBaseUrl||(this.mmanBaseUrl=e.mmanPath?t.cdnBase+e.mmanPath:null),this._parseMapData?.()}_parseError(t,e){const i=t.status;let s,o;if(i>=ue.OK&&i<ue.MULTIPLE_CHOICES)return!1;if(this._userInitializedInit=!1,t.readyState!==t.DONE)o=ye.Timeout,s="Initialization failed because the request timed out after "+this._bootstrapTimeout+" ms.";else if(i===ue.UNAUTHORIZED){o=ye.Unauthorized,s="Initialization failed because the authorization token is invalid.";try{const e=t.responseText?JSON.parse(t.responseText):void 0;e&&e.error&&e.error.details&&Array.isArray(e.error.details)&&e.error.details.forEach((t=>{t&&"ORIGIN_CHECK_FAILURE"===t.errorType&&t.message&&(s+=" "+t.message)}))}catch(t){if(!(t instanceof SyntaxError))throw t}}else i===ue.TOO_MANY_REQUESTS?(o=ye.TooManyRequests,s="Initialization failed because the daily usage limit has exceeded."):0===i?(o=ye.NetworkError,s="Initialization failed because of network error."):(o=ye.Unknown,s="Initialization failed because the server returned error "+i+" ("+t.statusText+").");return this._loadFailed(o,s,e),!0}_getClientLanguage(){return window.navigator.languages?window.navigator.languages[0]:window.navigator.language}_restore(){this._syrupUrl&&console.warn("[MapKit] mapkit.restore() cannot unset _syrupUrl."),this[me]&&console.warn("[MapKit] mapkit.restore() cannot unset "+me);for(const t of this.resetHooks)t();this._proxyPrefixMap=[],this._proxyPrefixes={},delete this._forcedRenderingMode,delete this._userInitializedInit,delete this._loginPromise,this._distUrl=null,this.authorizationCallback=null,this.apiBaseUrl=null,this.apiBaseUrlOverride=null,this.mmanBaseUrl=null,this.state=ge.UNINITIALIZED,this._listeners={},clearTimeout(this._reloadTimerId),delete this._reloadTimerId,document.removeEventListener("visibilitychange",this),window.removeEventListener("online",this)}_debugInfo(){return{ready:this.ready,state:this.state,_countryCode:this.countryCode,tileProvider:this.tileProvider,apiBaseUrl:this.apiBaseUrl,language:this.language,_getClientLanguage:this._getClientLanguage(),types:this.types}}get didFallback(){return this._syrupRequestedFallback}get fallbackType(){return this._syrupRequestedFallbackType}}he(xe,"ChangeStatus",_e),he(xe,"PROTOCOL",de),he(xe,"TileProviders",be);let Ee=Math.random().toString(36);function Ie(t){if(t===Ee)return;Ee=t;
2const e="[MapKit] Authorization token is invalid.";if("string"!=typeof t)return void console.warn(e);const i=t.split(".");if(3!==i.length)return void console.warn(e);let s;try{i.pop(),s=i.map((t=>{return JSON.parse((e=t,window.atob(e)));var e}))}catch{return void console.warn(e)}const[o,n]=s;"alg"in o?"ES256"!==o.alg&&console.warn('[MapKit] Authorization token has incorrect "alg" value.'):console.warn('[MapKit] Authorization token has no "alg" value.'),"typ"in o?"JWT"!==o.typ&&console.warn('[MapKit] Authorization token has incorrect "typ" value.'):console.warn('[MapKit] Authorization token has no "typ" value.'),"kid"in o||console.warn('[MapKit] Authorization token has no "kid" value.');const a=Date.now(),r=1e3*parseInt(String(n.iat));if(!("iat"in n)||isNaN(r)?console.warn('[MapKit] Authorization token has no "iat" value.'):r>a+36e5&&console.warn('[MapKit] Authorization token may have an "iat" value that is in the future ('+String(new Date(r))+")."),"exp"in n){const t=1e3*parseInt(String(n.exp));(t<a||isNaN(t))&&console.warn('[MapKit] Authorization token may be expired according to its "exp" value.')}"origin"in n||console.warn("[MapKit] Authorization token without origin restriction is not recommended in production environments.")}const Oe=new class extends xe{};for(Object.defineProperties(xe.prototype,{canRunCSR:{get:function(){const t="CLIENT"===this.forcedRenderingMode||"HYBRID"===this.forcedRenderingMode,e="SERVER"===this.forcedRenderingMode;return!(!this.ready||e||this._disableCsr&&!t||this._syrupRequestedFallback)}},madabaDomains:{get:function(){return this.customMadabaUrl||!this._madabaDomains&&this._madabaBaseUrl?[this._madabaBaseUrl]:this._madabaDomains?this._madabaDomains:null}}}),xe.prototype.syrupRequestedFallback=function(t){this._syrupRequestedFallback=!0,this._syrupRequestedFallbackType=t,setTimeout((()=>{const t=new Me(xe.ChangeStatus.Refreshed);this.dispatchEvent(t)}),0)},xe.prototype.getMadabaDomainFromStringHash=function(t){if(1===this.madabaDomains.length)return this.madabaDomains[0];const e=function(t){let e=0,i=t.length;for(;i--;)e+=t.charCodeAt(i);return e}(t);return this.madabaDomains[e%this.madabaDomains.length]},xe.prototype._parseMapData=function(){const t=this._data;this.customMadabaUrl||!t.madabaBaseUrl&&!t.madabaDomains||(this._madabaBaseUrl=t.madabaBaseUrl??null,this._madabaDomains=t.madabaDomains&&t.madabaDomains.length?t.madabaDomains.map((t=>/^(https?:)?\/\//.exec(t)?t:t.includes(":")&&this.getProxyPrefix(t)?"http://"+t:xe.PROTOCOL+"//"+t)):null),this._disableCsr=!!t.disableCsr;const e={};t.attributions&&t.attributions.forEach((t=>{e[t.attributionId]=t,this.tileGroup=t.attributionId}));const i={};t.tileSources.forEach((t=>{const s=t.tileSource,o=this.getProxyPrefix();i[s]={name:s,path:t.path,domains:t.domains,withCredentials:this.urlWithCredentials(o),crossOrigin:!0,protocol:t.protocol??"https:",attribution:e[t.attributionId],minZoomLevel:t.minZoomLevel,maxZoomLevel:t.maxZoomLevel,supportedSizes:t.supportedSizes,supportedResolutions:t.supportedResolutions,showPrivacyLink:t.showPrivacyLink,showTermsOfUseLink:t.showTermsOfUseLink},i[s].attribution?.global?.[0]&&(i[s].attribution.name=i[s].attribution.global[0].name,i[s].attribution.url=i[s].attribution.global[0].url)})),this.types={},this.rasterTilesForSyrup={};for(const e in t.modes){const s=t.modes[e].layers;this.types[e]={name:e,provider:this.tileProvider,countryCode:this.countryCode,lowResolutionTileSource:s[0].lowResTileSource?i[s[0].lowResTileSource]:void 0,tileSources:s.map((t=>i[t.tileSource]))},this.rasterTilesForSyrup[e]={name:e,provider:this.tileProvider,countryCode:this.countryCode,tileSources:s.map((t=>i[t.tileSource]))}}},Oe._data&&Oe._parseMapData?.(),xe.prototype._checkJwtToken=Ie;Oe._jwtTokensToCheck.length;){const t=Oe._jwtTokensToCheck.shift();Oe._checkJwtToken?.(t)}class Pe{static Zero=new Pe;x;y;z;constructor(t,e,i){this.x=t??0,this.y=e??0,this.z=i??0}toString(){return`Point[${this.x}, ${this.y}, ${this.z}]`}copy(){return new Pe(this.x,this.y,this.z)}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}distanceToPoint(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2)+Math.pow(this.z-t.z,2))}}const Re=Pe;class ze{static Zero=new ze;origin;size;
2constructor(t,e,i,s){this.origin=new Pe(t,e),this.size=new at(i,s)}static rectFromClientRect(t){const{left:e,top:i,width:s,height:o}=t;return new ze(e,i,s,o)}static unionOfRects(t){return t.reduce(((t,e)=>t._updateToUnion(e)),t[0].copy())}_update(t,e,i,s){return this.origin.x=t,this.origin.y=e,this.size.width=i,this.size.height=s,this}_updateToIntersect(t){const e=Math.max(this.minX(),t.minX()),i=Math.min(this.maxX(),t.maxX());if(e>i)return this._update(0,0,0,0);const s=Math.max(this.minY(),t.minY()),o=Math.min(this.maxY(),t.maxY());return s>o?this._update(0,0,0,0):this._update(e,s,i-e,o-s)}_updateToUnion(t){const e=Math.min(this.minX(),t.minX()),i=Math.min(this.minY(),t.minY()),s=Math.max(this.maxX(),t.maxX())-e,o=Math.max(this.maxY(),t.maxY())-i;return this._update(e,i,s,o)}toString(){const{x:t,y:e}=this.origin,{width:i,height:s}=this.size;return`Rect[${t}, ${e}, ${i}, ${s}]`}copy(){return new ze(this.origin.x,this.origin.y,this.size.width,this.size.height)}equals(t){return this.origin.equals(t.origin)&&this.size.equals(t.size)}inset(t,e,i,s){return new ze(this.origin.x+t,this.origin.y+e,this.size.width-t-i,this.size.height-e-s)}pad(t){return new ze(this.origin.x-t,this.origin.y-t,this.size.width+2*t,this.size.height+2*t)}minX(){return this.origin.x}minY(){return this.origin.y}midX(){return this.origin.x+this.size.width/2}midY(){return this.origin.y+this.size.height/2}maxX(){return this.origin.x+this.size.width}maxY(){return this.origin.y+this.size.height}intersectionWithRect(t){return this.copy()._updateToIntersect(t)}unionWithRect(t){return this.copy()._updateToUnion(t)}round(){return new ze(Math.floor(this.origin.x),Math.floor(this.origin.y),Math.ceil(this.size.width),Math.ceil(this.size.height))}}class De{constructor(){this._startTime=Date.now(),this._budget=10,this.didTimeout=!1}timeRemaining(){return Math.max(0,this._budget-(Date.now()-this._startTime))}}const Ne=function(t,e){return"undefined"!=typeof requestIdleCallback?requestIdleCallback(t,e):function(t){return setTimeout((function(){const e=new De;t(e)}))}(t)},Fe=function(t){return"undefined"!=typeof cancelIdleCallback?cancelIdleCallback(t):clearTimeout(t)},Ue=Object.freeze({Highest:0,High:1,Medium:2,Low:3}),We=Ue,Ge=Object.freeze([{timeout:600},{timeout:1e3},{timeout:3e3},{}]),Be=[function(t){Ke(t,We.Highest)},function(t){Ke(t,We.High)},function(t){Ke(t,We.Medium)},function(t){Ke(t,We.Low)}],Ze=[-1,-1,-1,-1],je=[];for(const t of Object.values(We))je[t]=[];function Ke(t,e){for(;(t.timeRemaining()>0||t.didTimeout)&&je[e].length;){const t=je[e].shift();"function"==typeof t?t():t&&"object"==typeof t&&"function"==typeof t.performScheduledTask&&t.performScheduledTask()}je[e].length?Ze[e]=Ne(Be[e],Ge[e]):-1!==Ze[e]&&(Fe(Ze[e]),Ze[e]=-1)}const He={schedule:function(t,e){je[e].push(t),-1===Ze[e]&&(Ze[e]=Ne(Be[e],Ge[e]))}};let qe=-1,Ve=[],Ye=[],Xe=[];const $e=Object.freeze({Idle:0,Updating:1,Drawing:2,Flushing:3});let Je=$e.Idle;function Qe(t){-1!==qe&&(Je===$e.Flushing&&("undefined"!=typeof cancelAnimationFrame?cancelAnimationFrame(qe):clearTimeout(qe)),qe=-1),function(t){Je=$e.Updating;for(;Ve.length>0;){const e=Ve;Ve=[];for(let i=0,s=e.length;i<s;++i){const s=e[i];"function"==typeof s?s():s&&"object"==typeof s&&"function"==typeof s.performScheduledUpdate&&s.performScheduledUpdate(t)}}Ve=Ye,Ye=[]}(t),function(t){Je=$e.Drawing;const e=Xe;Xe=[];for(let i=0,s=e.length;i<s;++i){const s=e[i];"function"==typeof s?s():s&&"object"==typeof s&&"function"==typeof s.performScheduledDraw&&s.performScheduledDraw(t)}}(t),Je=$e.Idle}function ti(t,e){return-1===t.indexOf(e)&&(t.push(e),!0)}function ei(){qe="undefined"!=typeof requestAnimationFrame?requestAnimationFrame(Qe):setTimeout(Qe)}const ii=function(t){ti(Ve,t)&&-1===qe&&Je!==$e.Updating&&ei()},si=function(t){ti(Je===$e.Updating?Ye:Ve,t)&&-1===qe&&ei()},oi=function(t){ti(Xe,t)&&-1===qe&&ei()},ni=function(){Je>$e.Idle||(Je=$e.Flushing,Qe())},ai=function(t,e){He.schedule(t,void 0!==e?e:Ue.Low)},ri=rt({Dark:"dark",Light:"light"}),li=rt({NETWORK_ERROR:"NETWORK_ERROR",BROWSER_SUPPORT_ERROR:"BROWSER_SUPPORT_ERROR",FEATURE_ERROR:"FEATURE_ERROR",UNKNOWN_ERROR:"UNKNOWN_ERROR",CONFIG_
2CHANGE:"CONFIGURATION_CHANGE_FALLBACK",CONFIG_MISSING:"CONFIGURATION_MISSING_FALLBACK"});class hi{_operations;constructor(){this._operations=[]}translate(t=0,e=0,i=0){return this._operations.push(new di(t,e,i)),this}scale(t=1,e=t,i=1){return this._operations.push(new ci(t,e,i)),this}rotate(t=0){return this._operations.push(new ui(t)),this}rotate3d(t=0,e=0,i=0,s=0){return this._operations.push(new mi(t,e,i,s)),this}skew(t=0,e=0){return this._operations.push(new pi(t,e)),this}transform(t){return Array.isArray(t)?this._operations.push(...t):this._operations.push(t),this}toString(){return this._operations.map((t=>t.toString())).join(" ")}}class di{x;y;z;constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}toString(){const{x:t,y:e,z:i}=this;return!t||e||i?!e||t||i?!i||t||e?i?`translate3d(${t}px, ${e}px, ${i}px)`:`translate(${t}px, ${e}px)`:`translateZ(${i}px)`:`translateY(${e}px)`:`translateX(${t}px)`}}class ci{x;y;z;constructor(t=1,e=t,i=1){this.x=t,this.y=e,this.z=i}toString(){const{x:t,y:e,z:i}=this;return 1!==t&&1===e&&1===i?`scaleX(${t})`:1!==e&&1===t&&1===i?`scaleY(${e})`:1!==i&&1===t&&1===e?`scaleZ(${i})`:1===i&&t===e?`scale(${t})`:1===i?`scale(${t}, ${e})`:`scale3d(${t}, ${e}, ${i})`}}class ui{angle;constructor(t=0){this.angle=t}toString(){return`rotate(${this.angle}deg)`}}class pi{x;y;constructor(t=0,e=0){this.x=t,this.y=e}toString(){const{x:t,y:e}=this;return 0!==t&&0===e?`skewX(${t}deg)`:0!==e&&0===t?`skewY(${e}deg)`:`skew(${t}deg, ${e}deg)`}}class mi{x;y;z;angle;constructor(t=0,e=0,i=0,s=0){this.x=t,this.y=e,this.z=i,this.angle=s}toString(){return`rotate3d(${this.x}, ${this.y}, ${this.z}, ${this.angle}deg)`}}class gi{_data;constructor(t,e,i,s,o,n,a,r,l,h,d,c,u,p,m,g){this._data=_i();const _="string"==typeof t,f=Array.isArray(t);if(_||f){const e="none"===t?[]:f?t:(t.match(/\bmatrix(?:3d)?\(([^)]+)\)/)?.[1]??"").split(",").map((t=>parseFloat(t)));16===e.length?(this.m11=e[0],this.m12=e[1],this.m13=e[2],this.m14=e[3],this.m21=e[4],this.m22=e[5],this.m23=e[6],this.m24=e[7],this.m31=e[8],this.m32=e[9],this.m33=e[10],this.m34=e[11],this.m41=e[12],this.m42=e[13],this.m43=e[14],this.m44=e[15]):6===e.length&&(this.a=e[0],this.b=e[1],this.c=e[2],this.d=e[3],this.e=e[4],this.f=e[5])}else{const _=void 0!==o&&void 0!==n,f=void 0!==t&&void 0!==e&&void 0!==i&&void 0!==s;f&&(_&&void 0!==a&&void 0!==r)&&(void 0!==l&&void 0!==h&&void 0!==d&&void 0!==c)&&(void 0!==u&&void 0!==p&&void 0!==m&&void 0!==g)?(this.m11=t,this.m12=e,this.m13=i,this.m14=s,this.m21=o,this.m22=n,this.m23=a,this.m24=r,this.m31=l,this.m32=h,this.m33=d,this.m34=c,this.m41=u,this.m42=p,this.m43=m,this.m44=g):f&&_&&(this.a=t,this.b=e,this.c=i,this.d=s,this.e=o,this.f=n)}}get a(){return this._data[0][0]}get b(){return this._data[0][1]}get c(){return this._data[1][0]}get d(){return this._data[1][1]}get e(){return this._data[3][0]}get f(){return this._data[3][1]}get m11(){return this._data[0][0]}get m12(){return this._data[0][1]}get m13(){return this._data[0][2]}get m14(){return this._data[0][3]}get m21(){return this._data[1][0]}get m22(){return this._data[1][1]}get m23(){return this._data[1][2]}get m24(){return this._data[1][3]}get m31(){return this._data[2][0]}get m32(){return this._data[2][1]}get m33(){return this._data[2][2]}get m34(){return this._data[2][3]}get m41(){return this._data[3][0]}get m42(){return this._data[3][1]}get m43(){return this._data[3][2]}get m44(){return this._data[3][3]}set a(t){this._data[0][0]=t}set b(t){this._data[0][1]=t}set c(t){this._data[1][0]=t}set d(t){this._data[1][1]=t}set e(t){this._data[3][0]=t}set f(t){this._data[3][1]=t}set m11(t){this._data[0][0]=t}set m12(t){this._data[0][1]=t}set m13(t){this._data[0][2]=t}set m14(t){this._data[0][3]=t}set m21(t){this._data[1][0]=t}set m22(t){this._data[1][1]=t}set m23(t){this._data[1][2]=t}set m24(t){this._data[1][3]=t}set m31(t){this._data[2][0]=t}set m32(t){this._data[2][1]=t}set m33(t){this._data[2][2]=t}set m34(t){this._data[2][3]=t}set m41(t){this._data[3][0]=t}set m42(t){this._data[3][1]=t}set m43(t){this._data[3][2]=t}set m44(t){this._data[3][3]=t}translate(t,e,i){t=t||0,e=e||0,i=i||0;const[s,o,n,a]=this._data[0],[r,l,h,d]=this._data[1],[c,u,p,m]=this._data[2];return this._data[3][0]+=t*s+e*r+i*c,this._data[3][1]+=t*o+e*l+i*u,this._data[3][2]+=t*n+e*h+i*p,this._data[3][3]+=t*a+e*d+i*m,this}scale(t,e,i){return t=t||1,e=e||t,i=i||1,this._data[0][0]*=t,this._data[0][1]*=t,this._data[0][2]*=t,this._data[0][3]*=t,this._data[1][0]*=e,this._data[1][1]*=e,this._data[1][2]*=e,this._data[1][3]*=e,this._data[2][0]*=i,this._data[2][1]*=i,this._data[2][2]*=i,this._data[2][3]*=i,this}rotate(t){return this.rotateAxisAngle(0,0,1,t)}rotateAxisAngle(t,e,i,s){0===t&&0===e&&0===i&&(i=1);const o=Math.sqrt(t*t+e*e+i*i);1!==o&&(t/=o,e/=o,i/=o),s=fi(s);const n=Math.sin(s),a=Math.cos(s),r=new gi;if(1===t&&0===e&&0===i)r._data[0][0]=1,r._data[0][1]=0,r._data[0][2]=0,r._data[1][0]=0,r._data[1][1]=a,r._data[1][2]=n,r._data[2][0]=0,r._data[2][1]=-n,r._data[2][2]=a,r._data[0][3]=r._data[1][3]=r._data[2][3]=0,r._data[3][0]=r._data[3][1]=r._data[3][2]=0,r._data[3][3]=1;else if(0===t&&1===e&&0===i)r._data[0][0]=a,r._data[0][1]=0,r._data[0][2]=-n,r._data[1][0]=0,r._data[1][1]=1,r._data[1][2]=0,r._data[2][0]=n,r._data[2][1]=0,r._data[2][2]=a,r._data[0][3]=r._data[1][3]=r._data[2][3]=0,r._data[3][0]=r._data[3][1]=r._data[3][2]=0,r._data[3][3]=1;else if(0===t&&0===e&&1===i)r._data[0][0]=a,r._data[0][1]=n,r._data[0][2]=0,r._data[1][0]=-n,r._data[1][1]=a,r._data[1][2]=0,r._data[2][0]=0,r._data[2][1]=0,r._data[2][2]=1,r._data[0][3]=r._data[1][3]=r._data[2][3]=0,r._data[3][0]=r._data[3][1]=r._data[3][2]=0,r._data[3][3]=1;else{const s=1-a;r._data[0][0]=a+t*t*s,r._data[0][1]=e*t*s+i*n,r._data[0][2]=i*t*s-e*n,r._data[1][0]=t*e*s-i*n,r._data[1][1]=a+e*e*s,r._data[1][2]=i*e*s+t*n,r._data[2][0]=t*i*s+e*n,r._data[2][1]=e*i*s-t*n,r._data[2][2]=a+i*i*s,r._data[0][3]=r._data[1][3]=r._data[2][3]=0,r._data[3][0]=r._data[3][1]=r._data[3][2]=0,r._data[3][3]=1}return this.multiply(r)}multiply(t){const[e,i,s,o]=t._data[0],[n,a,r,l]=t._data[1],[h,d,c,u]=t._data[2],[p,m,g,_]=t._data[3],[f,y,v,b]=this._data[0],[w,C,k,S]=this._data[1],[L,M,A,T]=this._data[2],[x,E,I,O]=this._data[3];return this._data[0][0]=e*f+i*w+s*L+o*x,this._data[0][1]=e*y+i*C+s*M+o*E,this._data[0][2]=e*v+i*k+s*A+o*I,this._data[0][3]=e*b+i*S+s*T+o*O,this._data[1][0]=n*f+a*w+r*L+l*x,this._data[1][1]=n*y+a*C+r*M+l*E,this._data[1][2]=n*v+a*k+r*A+l*I,this._data[1][3]=n*b+a*S+r*T+l*O,this._data[2][0]=h*f+d*w+c*L+u*x,this._data[2][1]=h*y+d*C+c*M+u*E,this._data[2][2]=h*v+d*k+c*A+u*I,this._data[2][3]=h*b+d*S+c*T+u*O,this._data[3][0]=p*f+m*w+g*L+_*x,this._data[3][1]=p*y+m*C+g*M+_*E,this._data[3][2]=p*v+m*k+g*A+_*I,this._data[3][3]=p*b+m*S+g*T+_*O,this}skewX(t){return this._skew(t,0)}skewY(t){return this._skew(0,t)}isAffine(){return 0===this._data[0][2]&&0===this._data[0][3]&&0===this._data[1][2]&&0===this._data[1][3]&&0===this._data[2][0]&&0===this._data[2][1]&&1===this._data[2][2]&&0===this._data[2][3]&&0===this._data[3][2]&&1===this._data[3][3]}inverse(){if(this._isIdentityOrTranslation())return 0===this._data[3][0]&&0===this._data[3][1]&&0===this._data[3][2]||(this._data[3][0]*=-1,this._data[3][1]*=-1,this._data[3][2]*=-1),this;const t=new gi;return gi._inverse(this,t)?t:new gi}transformPoint(t){const[e,i,s]=this._data[0],[o,n,a]=this._data[1],[r,l,h]=this._data[2],[d,c,u]=this._data[3],{x:p,y:m,z:g}=t;
2return new Pe(e*p+o*m+r*g+d,i*p+n*m+l*g+c,s*p+a*m+h*g+u)}toString(){if(this.isAffine()){const[t,e]=this._data[0],[i,s]=this._data[1],[o,n]=this._data[3];return`matrix(${t}, ${e}, ${i}, ${s}, ${o}, ${n})`}return`matrix3d(${this._data.map((t=>t.join(", "))).join(", ")})`}_isIdentityOrTranslation(){return 1===this._data[0][0]&&0===this._data[0][1]&&0===this._data[0][2]&&0===this._data[0][3]&&0===this._data[1][0]&&1===this._data[1][1]&&0===this._data[1][2]&&0===this._data[1][3]&&0===this._data[2][0]&&0===this._data[2][1]&&1===this._data[2][2]&&0===this._data[2][3]&&1===this._data[3][3]}_skew(t,e){const i=new gi;return i._data[0][1]=Math.tan(fi(e)),i._data[1][0]=Math.tan(fi(t)),this.multiply(i)}_determinant(){const[t,e,i,s]=this._data[0],[o,n,a,r]=this._data[1],[l,h,d,c]=this._data[2],[u,p,m,g]=this._data[3];return t*vi(n,h,p,a,d,m,r,c,g)-e*vi(o,l,u,a,d,m,r,c,g)+i*vi(o,l,u,n,h,p,r,c,g)-s*vi(o,l,u,n,h,p,a,d,m)}static _inverse(t,e){gi._adjoint(t,e);const i=t._determinant();if(Math.abs(i)<1e-8)return!1;for(let t=0;t<4;t+=1)for(let s=0;s<4;s+=1)e._data[t][s]=e._data[t][s]/i;return!0}static _adjoint(t,e){const[i,s,o,n]=t._data[0],[a,r,l,h]=t._data[1],[d,c,u,p]=t._data[2],[m,g,_,f]=t._data[3];e._data[0][0]=+vi(r,c,g,l,u,_,h,p,f),e._data[1][0]=-vi(a,d,m,l,u,_,h,p,f),e._data[2][0]=+vi(a,d,m,r,c,g,h,p,f),e._data[3][0]=-vi(a,d,m,r,c,g,l,u,_),e._data[0][1]=-vi(s,c,g,o,u,_,n,p,f),e._data[1][1]=+vi(i,d,m,o,u,_,n,p,f),e._data[2][1]=-vi(i,d,m,s,c,g,n,p,f),e._data[3][1]=+vi(i,d,m,s,c,g,o,u,_),e._data[0][2]=+vi(s,r,g,o,l,_,n,h,f),e._data[1][2]=-vi(i,a,m,o,l,_,n,h,f),e._data[2][2]=+vi(i,a,m,s,r,g,n,h,f),e._data[3][2]=-vi(i,a,m,s,r,g,o,l,_),e._data[0][3]=-vi(s,r,c,o,l,u,n,h,p),e._data[1][3]=+vi(i,a,d,o,l,u,n,h,p),e._data[2][3]=-vi(i,a,d,s,r,c,n,h,p),e._data[3][3]=+vi(i,a,d,s,r,c,o,l,u)}}const _i=()=>[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],fi=t=>t/180*Math.PI,yi=(t,e,i,s)=>t*s-e*i,vi=(t,e,i,s,o,n,a,r,l)=>t*yi(o,n,r,l)-s*yi(e,i,r,l)+a*yi(e,i,o,n);function bi(t){const e=t.getBoundingClientRect(),i=t.offsetWidth,s=t.offsetHeight,o=[new Pe(0,0),new Pe(i,0),new Pe(i,s),new Pe(0,s)];let n=new gi;const a=t.ownerDocument.defaultView;let r,l=t;for(;a&&l.nodeType===Node.ELEMENT_NODE&&(r=a.getComputedStyle(t),n=new gi(r.transform).multiply(n),l.parentNode);)l=l.parentNode;let h=1/0,d=1/0;o.forEach((function(t){const e=n.transformPoint(t);h=Math.min(h,e.x),d=Math.min(d,e.y)}));const c=window.pageXOffset+e.left-h,u=window.pageYOffset+e.top-d;return(new gi).translate(c,u).multiply(n)}function wi(t,e){return bi(t).inverse().transformPoint(e)}function Ci(t,e){return bi(t).transformPoint(e)}const ki={fromPageToElement:wi,fromElementToPage:Ci};function Si(...t){if(1===t.length){const[e]=t;return t=>Si(t,e)}const[e,i]=t;return e instanceof i}function Li(t,e){return!!t&&e in t&&"function"==typeof t[e]}function Mi(...t){if(1===t.length){const[e]=t;return t=>Mi(t,e)}const[e,i]=t;return function(t){return"number"==typeof t||"string"==typeof t||"symbol"==typeof t}(e)&&e in i}function Ai(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let Ti=[],xi=[];const Ei=rt({None:0,Removal:1,Addition:2,AttachAsShadowRoot:3});let Ii;class Oi{constructor(){Ai(this,"_parent",null),Ai(this,"_children",[]),Ai(this,"_dirtyAttributes",{}),Ai(this,"_dirtyProperties",[]),Ai(this,"_doNotNotifyParentChange",!1),Ai(this,"domNode",null),Ai(this,"_pendingDOMManipulation",Ei.None)}get parent(){return this._parent}get children(){return this._children}set children(t){const e=this._children;for(;e.length;)this.removeChild(e[0]);t.forEach((t=>{this.addChild(t)}))}get childCount(){return this._children.length}get firstChild(){return this._children[0]||null}get lastChild(){return this._children[this._children.length-1]||null}get previousSibling(){if(!this._parent)return null;const t=this._parent._children,e=t.indexOf(this);if(e>0){return t[e-1]}return null}get nextSibling(){if(!this._parent)return null;const t=this._parent._children,e=t.indexOf(this);if(-1!==e&&e<t.length-1){return t[e+1]}return null}addChild(t,e){if(0===e&&this._children[0]&&Si(this._children[0],Pi))throw new TypeError("");return t.willMoveToParent?.(this),t._doNotNotifyParentChange=!0,t.remove(),delete t._doNotNotifyParentChange,(void 0===e||e<0||e>this._children.length)&&(e=this._children.length),this._children.splice(e,0,t),t._parent=this,t.didMoveToParent?.(this),this.didAddChild?.(t),t._markNodeManipulation(Ei.Addition),t}insertBefore(t,e){return this.addChild(t,e?this._children.indexOf(e):-1)}insertAfter(t,e){const i=e?this._children.indexOf(e):-1;return this.addChild(t,-1!==i?i+1:0)}removeChild(t){if(t._parent!==this)return;const e=this._children.indexOf(t);return-1!==e?(this.willRemoveChild?.(t),t._doNotNotifyParentChange||t.willMoveToParent?.(null),this._children.splice(e,1),t._parent=null,t._doNotNotifyParentChange||t.didMoveToParent?.(null),t._markNodeManipulation(Ei.Removal),t):void 0}remove(){if(this._parent instanceof Oi)return this._parent.removeChild(this)}dump(t){return Gi(this,"",-1,t)}_markNodeManipulation(t){this._pendingDOMManipulation=t,this._updateNodeDirtiness()}_updateNodeDirtiness(){var t;t=this,this._pendingDOMManipulation!==Ei.None||this._dirtyProperties.length>0||Object.getOwnPropertyNames(this._dirtyAttributes).length>0?(Ui(Ti,t),oi(zi)):Wi(Ti,t)}}class Pi extends Oi{constructor(t="closed"){super(),Ai(this,"shadowRootMode",void 0),Ai(this,"domNode",null),Ai(this,"_pendingDOMManipulation",Ei.None),this.shadowRootMode=t}toString(){return this.stringInfo()+" ["+this.shadowRootMode+"]"}stringInfo(){return"#shadow-root"}}class Ri extends Oi{constructor(t){let e;super(),Ai(this,"domNode",void 0),Ai(this,"_opacity",1),Ai(this,"_color",""),Ai(this,"_size",new at),Ai(this,"_position",new Pe),Ai(this,"_transform",new hi),Ai(this,"_backgroundImages",[]),Ai(this,"_classList",new Bi(this)),Ai(this,"_wantsHardwareCompositing",!1),Ai(this,"_pendingDOMManipulation",Ei.None),e=t instanceof HTMLElement||t instanceof SVGElement?t:document.createElement("div"),this.domNode=e}
2get element(){return this.domNode}set element(t){this.domNode=t}get classList(){return this._classList}get wantsHardwareCompositing(){return this._wantsHardwareCompositing}set wantsHardwareCompositing(t){t!==this._wantsHardwareCompositing&&(this._wantsHardwareCompositing=t,this._markDirtyProperty("will-change"))}get opacity(){return this._opacity}set opacity(t){(t=Math.min(Math.max(0,t),1))!==this._opacity&&(this._opacity=t,this._markDirtyProperty("opacity"))}get color(){return this._color}set color(t){t!==this._color&&(this._color=t,this._markDirtyProperty("color"))}get position(){return this._position}set position(t){this._position=t,this._markDirtyProperty("position")}get transform(){return this._transform}set transform(t){this._transform=t,this._markDirtyProperty("transform")}get backgroundImages(){return this._backgroundImages}set backgroundImages(t){this._backgroundImages=t||[],this._markDirtyProperty("backgroundImages")}get size(){return this._size}set size(t){this._size=t||new at,this._markDirtyProperty("size")}setAttribute(t,e){this._dirtyAttributes[t]=e,this._updateNodeDirtiness()}removeAttribute(t){this._dirtyAttributes[t]=null,this._updateNodeDirtiness()}createAndAddShadowRootChild(t){if(this._children[0]&&Si(this._children[0],Pi))throw new Error("");const e=new Pi(t);return this._children.unshift(e),e._parent=this,this.didAddChild?.(e),e._markNodeManipulation(Ei.AttachAsShadowRoot),e}convertPointFromPage(t){return wi(this.domNode,t)}convertPointToPage(t){return Ci(this.domNode,t)}toString(){let t="";return this._wantsHardwareCompositing&&(t+="🏁 "),t+=this.stringInfo(),this.classList.toString()&&(t+=this.classList._classes().map((t=>"."+t)).join(", ")),0===this.position.x&&0===this.position.y||(t+=" ("+this.position.x+", "+this.position.y+")"),0===this.size.width&&0===this.size.height||(t+=" "+this.size.width+"x"+this.size.height),1!==this.opacity&&(t+=" [opacity:"+this.opacity+"]"),this.transform.toString()&&(t+=" ["+this.transform.toString()+"]"),t}stringInfo(){return"<"+this.domNode.tagName.toLowerCase()+">"}_markDirtyProperty(t,e){let i;i=void 0===e||e?Ui(this._dirtyProperties,t):Wi(this._dirtyProperties,t),i&&this._updateNodeDirtiness()}}function zi(){const t=Ii?performance.now():void 0;Ti.forEach(Di),Ti=[],xi.forEach(Ni),xi=[],Ri.updates++,Zi.dispatchEvent(new i("update")),Ii&&performance.measure(Ii,{start:t})}function Di(t){if(t._pendingDOMManipulation===Ei.Removal){const e=t.domNode?.parentNode;e&&t.domNode&&e.removeChild(t.domNode)}if(t._dirtyProperties.length&&(t._dirtyProperties.forEach((e=>{!function(t,e){const i=t.domNode;if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const s=i.style;switch(e){case"opacity":s.opacity=t._opacity.toString();break;case"color":s.color=t._color;break;case"size":s.width=t._size.width+"px",s.height=t._size.height+"px";break;case"will-change":s.willChange=t._wantsHardwareCompositing?"transform":"";break;case"position":case"transform":{const e=(new hi).translate(Fi(t._position.x),Fi(t._position.y)).transform(t._transform.toString());s.transform=e.toString();break}case"backgroundImages":!function(t){if(!(t.domNode instanceof HTMLElement||t.domNode instanceof SVGElement))return;const e=t.domNode.style;if(!t._backgroundImages.length)return e.removeProperty("background-image"),e.removeProperty("background-position"),void e.removeProperty("background-size");const i=[],s=[],o=[],n=t._backgroundImages;for(let t=n.length-1;t>=0;--t){const e=n[t];i.push("url("+e.url+")"),s.push(e.position.x+"px "+e.position.y+"px"),o.push(e.size.width+"px "+e.size.height+"px")}e.backgroundImage=i.join(","),e.backgroundPosition=s.join(","),e.backgroundSize=o.join(",")}(t);break;case"classList":i.setAttribute("class",t._classList.toString()),t._classList.reset();break;default:;}}(t,e)})),t._dirtyProperties=[]),Object.keys(t._dirtyAttributes).length){const e=t.domNode;Object.getOwnPropertyNames(t._dirtyAttributes).forEach((i=>{const s=t._dirtyAttributes[i];null===s?e.removeAttribute(i):e.setAttribute(i,s)})),t._dirtyAttributes={}}t._pendingDOMManipulation!==Ei.Addition&&t._pendingDOMManipulation!==Ei.AttachAsShadowRoot||Ui(xi,t.parent)}function Ni(t){let e=null;const i=t.domNode;for(let s=t.children.length-1;s>=0;
2--s){const o=t.children[s],n=o.domNode;switch(o._pendingDOMManipulation){case Ei.Addition:i.insertBefore(o.domNode,e),o._pendingDOMManipulation=Ei.None;break;case Ei.AttachAsShadowRoot:{const t=i.attachShadow({mode:o.shadowRootMode});o.domNode=t,o._pendingDOMManipulation=Ei.None;break}}e=n}}function Fi(t){const e=Math.max(Math.round(window.devicePixelRatio),1);return Math.round(t*e)/e}function Ui(t,e){return!t.includes(e)&&(t.push(e),!0)}function Wi(t,e){const i=t.indexOf(e);return-1!==i&&(t.splice(i,1),!0)}function Gi(t,e,i,s){let o="";o+=e,s&&(o+=function(t){return t<0?"":t+":"}(i)),o+=t.toString(),o+=function(t){return t.childCount<1?"":" ⤵︎ "+t.childCount}(t);const n=t.children;for(let i=0,a=n.length;i<a;++i){o+="\n",o+=Gi(n[i],e+"    ",t.childCount<1?-1:i,s)}return o}Ai(Ri,"updates",0);class Bi{constructor(t){Ai(this,"_node",void 0),Ai(this,"_additions",[]),Ai(this,"_removals",[]),Ai(this,"__classes",[]),Ai(this,"_populateClasses",!0),this._node=t}add(t){this._add(t)}remove(t){this._remove(t)}contains(t){return this._classes().includes(t)}toggle(t,e){if(arguments.length>1)return e?this._add(t):this._remove(t),!!e;this._add(t)||this._remove(t)}toString(){return this._classes().join(" ")}_classes(){if(this._populateClasses){const t=this._node.domNode;let e="";t instanceof HTMLElement?e=t.className:t instanceof SVGElement&&t.className instanceof SVGAnimatedString&&(e=t.className.baseVal),this.__classes=e.split(/[ ]+/).filter(Boolean),delete this._populateClasses}return this.__classes}reset(){this._additions=[],this._removals=[],this.__classes=[],this._populateClasses=!0}_add(t){if(!t)return!1;const e=Ui(this._classes(),t);return e&&(Wi(this._removals,t)||Ui(this._additions,t),this._updateNodeDirtiness()),e}_remove(t){if(!t)return!1;const e=Wi(this._classes(),t);return e&&(Wi(this._additions,t)||Ui(this._removals,t),this._updateNodeDirtiness()),e}_updateNodeDirtiness(){this._node._markDirtyProperty("classList",this._additions.length>0||this._removals.length>0)}}const Zi=new class extends e{constructor(){super()}setPerformanceMeasureName(t){Ii=t}};let ji=[],Ki=!1;function Hi(){const t=ji;ji=[];const e=[];for(const i of t){const t=i.scene;if(t&&qi(e,t)){const e=t.performanceMeasureName?performance.now():void 0;
2t.renderer.update(),t.performanceMeasureName&&performance.measure(t.performanceMeasureName,{start:e}),t.sceneDidUpdate&&t.sceneDidUpdate(t,Ki)}}}function qi(t,e){return!t.includes(e)&&(t.push(e),!0)}const Vi={scheduleNode(t){qi(ji,t)&&1===ji.length&&oi(Hi)},flush(t){Ki=!0;const e=ji;ji=[];const i=[];for(const s of e)s.scene===t?ji.push(s):i.push(s);Hi(),Ki=!1,ji=i}};function Yi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xi(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function $i(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const Ji=(new gi).toString();var Qi=new WeakSet;class ts{constructor(){Yi(this,Qi),Xi(this,"_parent",null),Xi(this,"_children",[]),Xi(this,"_renderer",null),Xi(this,"_opacity",1),Xi(this,"_size",new at),Xi(this,"_position",new Pe),Xi(this,"_transform",new gi),Xi(this,"_frozen",!1),Xi(this,"_keyForFrozenLayer",""),Xi(this,"_wantsLayerBacking",!1),Xi(this,"animators",void 0),Xi(this,"repeatOffset",void 0),Xi(this,"isScene",!1),Xi(this,"_element",void 0)}get element(){return this._element}set element(t){this._element=t}extraInfo(){return[]}get scene(){let t;for(t=this;t;t=t._parent)if(t.isScene)return t}get renderer(){return this._renderer}get wantsLayerBacking(){return!!this.keyForFrozenLayer||this._frozen||this._wantsLayerBacking||this._needsLayerBacking()}set wantsLayerBacking(t){t!==this._wantsLayerBacking&&(this._wantsLayerBacking=t,this.needsDisplay=!0)}get frozen(){return!!this.keyForFrozenLayer||this._frozen}set frozen(t){t!==this._frozen&&(this._frozen=t,this.needsDisplay=!0)}get keyForFrozenLayer(){return this._keyForFrozenLayer}set keyForFrozenLayer(t){t!==this._keyForFrozenLayer&&(this._keyForFrozenLayer=t,this.needsDisplay=!0)}get opacity(){return this._opacity}set opacity(t){(t=Math.min(Math.max(0,t),1))!==this._opacity&&(this._opacity=t,this.needsDisplay=!0)}get position(){return this._position}set position(t){t.equals(this._position)||(this._position=t.copy(),this.needsDisplay=!0)}get transform(){return this._transform}set transform(t){this._transform=t,this.needsDisplay=!0}get size(){return this._size}set size(t){this._size=t||new at,this.needsDisplay=!0}get bounds(){return new ze(this._position.x,this._position.y,this.size.width,this.size.height)}get layerBounds(){let t=new ze(0,0,this.size.width,this.size.height);const e=this._children;for(let i=0,s=e.length;i<s;++i){const s=e[i],o=s.layerBounds;o.origin.x+=s._position.x,o.origin.y+=s._position.y;const n=s.transform,a=[n.transformPoint(new Pe(o.minX(),o.minY())),n.transformPoint(new Pe(o.maxX(),o.minY())),n.transformPoint(new Pe(o.maxX(),o.maxY())),n.transformPoint(new Pe(o.minX(),o.maxY()))];let r=a[0].x,l=a[0].y,h=a[0].x,d=a[0].y;for(const t of a)t.x<r&&(r=t.x),t.x>h&&(h=t.x),t.y<l&&(l=t.y),t.y>d&&(d=t.y);t=t.unionWithRect(new ze(r,l,h-r,d-l))}return t}set needsDisplay(t){t&&Vi.scheduleNode(this)}get parent(){return this._parent}get children(){return this._children}set children(t){let e=0,i=0;const s=[...this._children];for(;e<t.length;){const o=t[e],n=s[i];n!==o?!n||t.includes(n)?(o._parent===this&&s.splice(s.indexOf(o),1),this.addChild(o,e),e++):(this.removeChild(n),i++):(e++,i++)}for(;i<s.length;){const t=s[i];this.removeChild(t),i++}}get childCount(){return this._children.length}get firstChild(){return this._children[0]??null}get lastChild(){return this._children[this._children.length-1]??null}get previousSibling(){if(!this._parent)return null;const t=this._parent._children,e=t.indexOf(this);if(e>0){return t[e-1]}return null}get nextSibling(){if(!this._parent)return null;const t=this._parent._children,e=t.indexOf(this);if(-1!==e&&e<t.length-1){return t[e+1]}return null}isTainted(){return this._children.some((t=>t.isTainted()))}hasPixels(){return!(null===this.renderer||!this.renderer.hasPixels)||this._children.some((t=>t.hasPixels()))}toString(){let t="";return this.element&&(t+="🏷 "),this.wantsLayerBacking&&(t+="🏁 "),this.frozen&&(t+="❄️ ",this.keyForFrozenLayer&&(t+="<"+this.keyForFrozenLayer+">")),this.stringInfo&&"function"==typeof this.stringInfo?t+=this.stringInfo():t+="UnknownNode",0===this.position.x&&0===this.position.y||(t+=" ("+this.position.x+", "+this.position.y+")"),"number"==typeof this.repeatOffset&&(t+=(this.repeatOffset>0?"+":"")+this.repeatOffset+" "),0===this.size.width&&0===this.size.height||(t+=" "+this.size.width+"x"+this.size.height),1!==this.opacity&&(t+=" [opacity:"+this.opacity+"]"),this.transform.toString()!==Ji&&(t+=" ["+this.transform.toString()+"]"),this.animators&&this.animators.forEac
2h((e=>{t+=" "+e.stringInfo()})),t}dump(t,e){return void 0===t&&(t=1/0),ss(this,"",-1,t,!!e)}addChild(t,e){return t.remove(),(void 0===e||e<0||e>this._children.length)&&(e=this._children.length),this._children.splice(e,0,t),t._parent=this,this.needsDisplay=!0,t}insertBefore(t,e){return this.addChild(t,this._children.indexOf(e))}insertAfter(t,e){return this.addChild(t,e?this._children.indexOf(e)+1:0)}removeChild(t){if(t._parent!==this)return;const e=this._children.indexOf(t);return-1!==e?(this._children.splice(e,1),$i(this,Qi,es).call(this,t),this.needsDisplay=!0,t):void 0}replaceChild(t,e){if(!e||e._parent!==this)return;const i=this._children.indexOf(e);return t.remove(),this._children.splice(i,1,t),$i(this,Qi,es).call(this,e),t._parent=this,this.needsDisplay=!0,e}remove(){if(this._parent instanceof ts)return this._parent.removeChild(this)}wasRemoved(){}convertPointFromPage(t){if(this.element)return wi(this.element,t);const e=is(this),i=wi(e.element,t);return new Pe(i.x+e.offsetX,i.y+e.offsetY)}convertPointToPage(t){if(this.element)return Ci(this.element,t);const e=is(this),i=Ci(e.element,t);return new Pe(i.x-e.offsetX,i.y-e.offsetY)}_needsLayerBacking(){return!!(this.opacity<1&&(this._children.length>1||1===this._children.length&&this._children[0]&&this._children[0]._children.length>0))}}function es(t){t._parent=null;const e=[t];for(;e.length>0;){const t=e.pop();t&&(t.wasRemoved(),t._renderer&&"function"==typeof t._renderer.nodeWasRemoved&&t._renderer.nodeWasRemoved(),e.push(...t.children))}}function is(t){let e,i=0,s=0,o=t;for(;o&&!e;){const t=o.transform.transformPoint(o.position);i-=t.x,s-=t.y,o=o.parent,e=o?.element}if(!e)throw new Error("Couldn't find nodes element. Expected that at least scene will have one.");return{element:e,offsetX:i,offsetY:s}}
2function ss(t,e,i,s,o){let n="";if(n+=e,o&&(n+=function(t){return t<0?"":t+":"}(i)),n+=t.toString(),n+=function(t){return t.childCount<1?"":" ⤵︎ "+t.childCount}(t),t.extraInfo&&"function"==typeof t.extraInfo&&t.extraInfo().forEach((t=>{n+="\n"+e+"| "+t})),0===s)return n;const a=t.children;for(let i=0,r=a.length;i<r;++i){const r=t.childCount<1?-1:i,l=a[i];n+="\n",n+=ss(l,e+"    ",r,s-1,o)}return n}class os extends s{constructor(){super(),this.modifierKeys={alt:!1,ctrl:!1,meta:!1,shift:!1},this.useGestures=!1,this._targetTouches=[],this._lastKnownEventLocation=null,this._shouldHandleTrackingEvents=!1,this._domEvents=[],this.events=void 0,this._mode=void 0,this.mode=os.Modes.Adaptive,this._enabled=!0,this._target=null,this.state=os.States.Possible,this.delegate=null,this.allowsRightMouseButton=!1}get mode(){return this._mode}set mode(t){if(this._mode!==t){if(this._targetTouches.length)throw new Error("");switch(this._removeBaseListeners(),t){case os.Modes.Adaptive:os.SupportsPointerEvents?this.events=cs.Pointer:os.SupportsTouches?this.events=cs.Touch:this.events=cs.Mouse;break;case os.Modes.Pointer:this.events=cs.Pointer;break;case os.Modes.Touch:this.events=cs.Touch;break;case os.Modes.Mouse:this.events=cs.Mouse}this._mode=t,this._updateBaseListeners()}}get currentMode(){if(this._mode===os.Modes.Adaptive)switch(this.events){case cs.Pointer:return os.Modes.Pointer;case cs.Touch:return os.Modes.Touch;case cs.Mouse:return os.Modes.Mouse}return this._mode}get target(){return this._target}set target(t){this._target!==t&&(this._removeBaseListeners(),t&&(this._target=t,this._initRecognizer()))}get numberOfTouches(){return this._targetTouches.length}get enabled(){return this._enabled}set enabled(t){this._enabled!==t&&(this._enabled=t,t||(0===this.numberOfTouches?(this._removeTrackingListeners(),this.reset()):this.enterCancelledState()),this._updateBaseListeners())}get domEvents(){return this._domEvents}reset(){}preventDefault(t){"touchmove"!==t.type&&"pointer"!==t.type.substr(0,7)&&t.preventDefault()}locationInElement(t){const e=new Re,i=this._targetTouches;if(this._lastKnownEventLocation)e.x=this._lastKnownEventLocation.pageX,e.y=this._lastKnownEventLocation.pageY;else{const t=i.length;for(let s=0;s<t;++s){const t=i[s];e.x+=t.pageX,e.y+=t.pageY}e.x/=t,e.y/=t}return t?ki.fromPageToElement(t,e):e}locationInClient(){const t=new Re,e=this._targetTouches;if(this._lastKnownEventLocation)t.x=this._lastKnownEventLocation.clientX,t.y=this._lastKnownEventLocation.clientY;else{const i=e.length;for(let s=0;s<i;++s){const i=e[s];t.x+=i.clientX,t.y+=i.clientY}t.x/=i,t.y/=i}return t}locationOfTouchInElement(t,e){const i=this._targetTouches[t];if(!i)return new Re;const s=new Re(i.pageX,i.pageY);return e?ki.fromPageToElement(e,s):s}touchesBegan(t){t.currentTarget===this._target&&(this._shouldHandleTrackingEvents=!0,window.addEventListener(this.events.Move,this,!0),window.addEventListener(this.events.End,this,!0),this.events.Cancel&&window.addEventListener(this.events.Cancel,this,!0),this.enterPossibleState())}touchesMoved(t){}touchesEnded(t){}touchesCancelled(t){}gestureBegan(t){t.currentTarget===this._target&&(window.addEventListener(this.events.GestureChange,this,!0),window.addEventListener(this.events.GestureEnd,this,!0),this.enterPossibleState())}gestureChanged(t){}gestureEnded(t){}enterPossibleState(){this._setStateAndNotifyOfChange(os.States.Possible)}enterBeganState(){!this.delegate||"function"!=typeof this.delegate.gestureRecognizerShouldBegin||this.delegate.gestureRecognizerShouldBegin(this)?this._setStateAndNotifyOfChange(os.States.Began):this.enterFailedState()}enterEndedState(){this._setStateAndNotifyOfChange(os.States.Ended),this._removeTrackingListeners(),this.reset()}enterCancelledState(){this._setStateAndNotifyOfChange(os.States.Cancelled),this._removeTrackingListeners(),this.reset()}enterFailedState(){this._setStateAndNotifyOfChange(os.States.Failed),this._removeTrackingListeners(),this.reset()}enterChangedState(){this._setStateAndNotifyOfChange(os.States.Changed)}enterRecognizedState(){this._setStateAndNotifyOfChange(os.States.Recognized)}handleEvent(t){this._shouldCountAndHandleTouch(t)&&(this.lastEventTimeStamp=t.timeStamp,this._updateTargetTouches(t),this._updateKeyboardModifiers(t),this._handleTouches(t))}_handleTouches(t){if(this._shouldHandleTouch(t))switch(t.type){case this.events.Start:this.touchesBegan(t);break;case this.events.Move:this.touchesMoved(t);break;case this.events.End:this.touchesEnded(t);break;case this.events.Cancel:this.touchesCancelled(t);break;case this.events.GestureStart:this.gestureBegan(t);break;case this.events.GestureChange:this.gestureChanged(t);break;case this.events.GestureEnd:this.gestureEnded(t)}}_shouldCountAndHandleTouch(t){if(this.events!==cs.Pointer)return!0;
2if(!(t instanceof PointerEvent))return!0;if("mouse"===t.pointerType&&t.button>0&&!this.allowsRightMouseButton)return!1;const e=this._targetTouches[0];return!(e&&e instanceof PointerEvent&&t.pointerType!==e.pointerType&&e.pointerId!==t.pointerId)}_shouldHandleTouch(t){return this.events!==cs.Pointer||(t.type===this.events.Start||t.type===this.events.GestureStart||t.type===this.events.GestureChange||t.type===this.events.GestureEnd||this._shouldHandleTrackingEvents)}_initRecognizer(){this.reset(),this.state=os.States.Possible,this._updateBaseListeners()}_removeBaseListeners(){this._target&&(this._target.removeEventListener(this.events.Start,this),this.useGestures&&this._target.removeEventListener(this.events.GestureStart,this),this.events===cs.Pointer&&(this._targetTouches=[],window.removeEventListener(this.events.End,this,!0),window.removeEventListener(this.events.Cancel,this,!0)))}_updateBaseListeners(){this._target&&(this._enabled?(this._target.addEventListener(this.events.Start,this),this.useGestures&&this._target.addEventListener(this.events.GestureStart,this),this.events===cs.Pointer&&(window.addEventListener(this.events.End,this,!0),window.addEventListener(this.events.Cancel,this,!0))):this._removeBaseListeners())}_removeTrackingListeners(){this._shouldHandleTrackingEvents=!1,window.removeEventListener(this.events.Move,this,!0),this.events!==cs.Pointer&&(window.removeEventListener(this.events.End,this,!0),this.events.Cancel&&window.removeEventListener(this.events.Cancel,this,!0)),window.removeEventListener(this.events.GestureChange,this,!0),window.removeEventListener(this.events.GestureEnd,this,!0)}_setStateAndNotifyOfChange(t){this.state=t,this.dispatchEvent(new o(this.events.StateChange))}_setLastKnownSinglePointLocation(t){this._lastKnownEventLocation={clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}_updateTargetTouches(t){if(t.type===this.events.GestureStart||t.type===this.events.GestureChange||t.type===this.events.GestureEnd){const e=t;return void this._setLastKnownSinglePointLocation(e)}if(this.events===cs.Mouse){const e=t;return void(t.type===this.events.End?(this._targetTouches=[],this._setLastKnownSinglePointLocation(e)):(this._targetTouches=[e],this._lastKnownEventLocation=null))}let e,i,s;
2if(this.events===cs.Touch){const o=t,n=this._targetTouches;if(o.type===this.events.Start){for(this._targetTouches=[],e=o.targetTouches,i=0,s=e.length;i<s;++i)this._targetTouches.push(e[i]);return void(this._lastKnownEventLocation=null)}if(o.type===this.events.Move){const t=n.map((t=>t.identifier));for(this._targetTouches=[],e=o.touches,i=0,s=e.length;i<s;++i){const s=e[i];-1!==t.indexOf(s.identifier)&&this._targetTouches.push(s)}return void(this._lastKnownEventLocation=null)}const a=o.touches,r=[];for(i=0,s=a.length;i<s;++i)r.push(a[i].identifier);return this._targetTouches=n.filter((t=>-1!==r.indexOf(t.identifier))),void(0===this._targetTouches.length?this._setLastKnownSinglePointLocation(a[0]):this._lastKnownEventLocation=null)}if(this.events===cs.Pointer){const e=t,i=this._targetTouches;return t.type===this.events.Start?(this._targetTouches.push(e),void(this._lastKnownEventLocation=null)):t.type===this.events.Move?(this._targetTouches=i.map((t=>t.pointerId!==e.pointerId?t:e)),void(this._lastKnownEventLocation=null)):(this._targetTouches=i.filter((t=>t.pointerId!==e.pointerId)),void(0===this._targetTouches.length?this._setLastKnownSinglePointLocation(e):this._lastKnownEventLocation=null))}throw new Error("")}_updateKeyboardModifiers(t){this.modifierKeys.alt=t.altKey,this.modifierKeys.ctrl=t.ctrlKey,this.modifierKeys.meta=t.metaKey,this.modifierKeys.shift=t.shiftKey}_distance(){if(2!==this.numberOfTouches)return 0;const t=this._targetTouches[0],e=new Re(t.pageX,t.pageY),i=this._targetTouches[1],s=new Re(i.pageX,i.pageY);return e.distanceToPoint(s)}}os.Modes=Object.freeze({Adaptive:"adaptive",Pointer:"pointer",Touch:"touch",Mouse:"mouse"});const ns="PointerEvent"in window;os.SupportsPointerEvents=ns;const as="ontouchmove"in document;os.SupportsTouches=as;const rs=!!window.GestureEvent;let ls,hs;os.SupportsGestures=rs,os.SupportsGestures?os.SupportsPointerEvents?ls=hs=!os.SupportsTouches:(ls=!os.SupportsTouches,hs=!0):(ls=!1,hs=!1),os.UseGesturesForRotation=ls,os.UseGesturesForPinch=hs;const ds=Object.freeze({Possible:"possible",Began:"began",Changed:"changed",Ended:"ended",Cancelled:"cancelled",Failed:"failed",Recognized:"ended"});os.States=ds;const cs=Object.freeze({Pointer:{Start:"pointerdown",Move:"pointermove",End:"pointerup",Cancel:"pointercancel",GestureStart:"gesturestart",GestureChange:"gesturechange",GestureEnd:"gestureend",StateChange:"statechange"},Touch:{Start:"touchstart",Move:"touchmove",End:"touchend",Cancel:"touchcancel",GestureStart:"gesturestart",GestureChange:"gesturechange",GestureEnd:"gestureend",StateChange:"statechange"},Mouse:{Start:"mousedown",Move:"mousemove",End:"mouseup",Cancel:void 0,GestureStart:"gesturestart",GestureChange:"gesturechange",GestureEnd:"gestureend",StateChange:"statechange"}}),us=os.SupportsTouches,ps=os.SupportsPointerEvents,ms=os.SupportsGestures,gs="ShadowRoot"in window,_s="rgb(0, 122, 255)";let fs=us;function ys(){return fs}let vs=ps;function bs(){return vs}let ws=ms;function Cs(){return ws}const ks=gs;let Ss=window.top!==window;function Ls(){return Ss}const Ms=!us&&"webkitForce"in MouseEvent.prototype;let As=ps?"pointerdown":us?"touchstart":"mousedown";function Ts(){return As}let xs=ps?"pointermove":us?"touchmove":"mousemove";function Es(){return xs}let Is=ps?"pointerup":us?"touchend":"mouseup";function Os(){return Is}let Ps=ps?"pointercancel":us?"touchcancel":void 0;function Rs(){return Ps}function zs(){return window.devicePixelRatio||1}function Ds(){return Math.max(Math.round(window.devicePixelRatio),1)||1}function Ns(t,e){const i=e||zs();return Math.round(t*i)/i}const Fs=(t,...e)=>to("http://www.w3.org/1999/xhtml",t,...e),Us=(t,...e)=>to("http://www.w3.org/2000/svg",t,...e);function Ws(t,e){const i=Gs(t);if(i===document)return e.target;const s="changedTouches"in e?e.changedTouches[0]:e,o=i.elementFromPoint(s.clientX,s.clientY);return o||document.body}function Gs(t){return ks?t.getRootNode():document}function Bs(t,e,i,s){let o;ks?o=t.createAndAddShadowRootChild(e):(o=t.addChild(new Ri),i=function(t){let e,i="";for(;e=/:host\(/.exec(t);){i+=t.substr(0,e.index),t=t.substr(e.index+e[0].length);let s=1;for(;e=/^([^()]*)([()])?/.exec(t);){if(t=t.substr(e[0].length),"("===e[2])s+=1;else if(")"===e[2]&&(s-=1,0===s)){i+=e[1];break}if(i+=e[0],!e[2])break}}return i+t}(i));const n=Fs("style",i);return s&&(n.nonce=s),o.addChild(new Ri(n)),o}function Zs(t){return t.tagName&&"div"!==t.tagName.toLowerCase()?Zs(t.parentNode):t}
2function js(t,e,i){const s=Math.floor(zs());let o;const n=t[t.length-1],a=t[0];return o=t.includes(s)?s:s>n?n:a,e+(o>1?"_"+o+"x":"")+(i=i||".png")}function Ks(t,e){let i="mk-icon";e.class&&(i+=" "+e.class,delete e.class);const s=Us("svg",e);return s.setAttribute("class",i),s.setAttribute("focusable","false"),s.appendChild(Us("g")).appendChild(t),s}function Hs(t){const e=document.createElement("div");return e.style.setProperty("color",t),e.style.color}function qs(t){return""!==Hs(t)}function Vs(t,e){t.setAttribute("title",e),t.setAttribute("aria-label",e)}function Ys(t){const e=Math.pow(t,2);return e/(e+Math.pow(1-t,2))}function Xs(t,e,i){return(1-t)*e+t*i}function $s(t){return t===ri.Dark}function Js(t){return t<180?Math.min(t,30):Math.max(t,330)}function Qs(t){return Math.floor(t+1e-6)}function to(t,e,...i){const s=window.document.createElementNS(t,e);let o=0;if("object"==typeof i[0]&&null!=i[0]&&!(i[0]instanceof window.Node)){++o;for(const[t,e]of Object.entries(i[0]))"nonce"===t&&(s.nonce=e.toString()),s.setAttribute(t,e.toString())}for(let t=o,e=i.length;t<e;++t){const e=i[t];e instanceof window.Node?s.appendChild(e):"string"==typeof e&&s.appendChild(document.createTextNode(e))}return s}var eo;function io(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function so(t,e,i,s){return ao(t,e),no(i,"set"),function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,i,s),s}function oo(t,e,i){return ao(t,e),no(i,"get"),function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}function no(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function ao(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}let ro={};class lo{constructor(t){io(this,"_node",void 0),io(this,"_layer",void 0),io(this,"_frozenLayer",void 0),io(this,"_sharedLayer",void 0),this._node=t}get hasPixels(){return this.draw!==lo.prototype.draw}get node(){return this._node}get shouldDraw(){const t=this._node.keyForFrozenLayer;return!(this._frozenLayer&&(!this._sharedLayer||this._sharedLayer.key===t)||t&&ro[t])}get layer(){const t=this._node,e=t.frozen,i=t.keyForFrozenLayer;if(e){if(this._frozenLayer){if(!i||!this._sharedLayer||this._sharedLayer.key===i)return this._frozenLayer;this.releaseLayer()}if(i){const t=ro[i];if(t&&t.key===i)return this._sharedLayer=t,this._layer=this._frozenLayer=t.canvas,++t.count,t.canvas}}delete this._frozenLayer,this._layer||(this._layer=this.createCanvas(),this._layer.hidden=!0,i&&(this._sharedLayer=ro[i]={canvas:this._layer,count:1,key:i}));const s=zs(),o=t.layerBounds;this._layer.width=Math.ceil(o.size.width*s),this._layer.height=Math.ceil(o.size.height*s);const n=this._layer.getContext("2d");return n&&(n.scale(s,s),n.translate(-o.origin.x,-o.origin.y)),e&&(this._frozenLayer=this._layer),this._layer}releaseLayer(t){this._layer&&(this._sharedLayer?t||(--this._sharedLayer.count,0===this._sharedLayer.count&&(delete ro[this._sharedLayer.key],this._layer.width=0,this._layer.parentNode&&this._layer.parentNode.removeChild(this._layer))):(this._layer.width=0,this._layer.parentNode&&this._layer.parentNode.removeChild(this._layer)),delete this._sharedLayer,delete this._frozenLayer,delete this._layer)}nodeWasRemoved(){var t,e,i;this._layer&&(t=lo,e=lo,i=ho,ao(t,e),i).call(lo,this)}createCanvas(){return Ft()}draw(t){}static releaseSharedLayers(){Object.keys(ro).forEach((t=>{const e=ro[t];e&&(e.canvas.width=0,delete e.key,delete e.canvas)})),ro={}}}function ho(t){0===oo(eo,eo,co).length&&setTimeout((()=>{oo(eo,eo,co).forEach((t=>{t._node.scene||t.releaseLayer()})),so(eo,eo,co,[])}),0),oo(eo,eo,co).push(t)}eo=lo;var co={writable:!0,value:[]};class uo extends ts{constructor(){super();const t=new lo(this);this._renderer=t}stringInfo(){return"GroupNode"}}class po extends lo{draw(t){this._node.image&&t.drawImage(this._node.image,0,0,this._node.size.width,this._node.size.height)}}function mo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class go extends ts{constructor(){super(),mo(this,"_image",void 0),mo(this,"_url",void 0),this._image=null,this._url=null,this._renderer=new po(this)}get image(){return this._image}get url(){return this._url}setImage(t,e){this._image=t,this._url=e,null!=t&&this.size.equals(at.Zero)&&(this.size=new at(this._image.width,this._image.height)),this.needsDisplay=!0}isTainted(){return this._image instanceof Image&&null===this._image.crossOrigin}stringInfo(){let t=this._url;return t?(t=new URL(t,window.location.href).href,"ImageNode<src:"+t+">"):"ImageNode"}}
2function _o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class fo extends lo{constructor(t){super(t),_o(this,"_canvas",void 0),_o(this,"_ctx",void 0),_o(this,"_previousSize",void 0),_o(this,"_previousScale",void 0),this._canvas=this.createCanvas();const e=this._canvas.getContext("2d");if(!e)throw new Error("Failed to obtain 2D context from canvas");this._ctx=e}get ctx(){return this._ctx}get element(){return this._canvas}set element(t){this._canvas=t}update(){if(!this._ctx)return;const t=this._node,e=t.size,i=zs(),s=!this._previousScale||this._previousScale!==i;s&&lo.releaseSharedLayers(),!s&&this._previousSize&&this._previousSize.equals(e)?this._ctx.clearRect(0,0,e.width*i,e.height*i):(this._canvas.style.width=e.width+"px",this._canvas.style.height=e.height+"px",this._canvas.width=Math.round(e.width*i),this._canvas.height=Math.round(e.height*i),this._previousSize=e.copy(),this._previousScale=i),this._ctx.scale(i,i),yo(this.node,this._ctx,new ze(-t.position.x,-t.position.y,e.width,e.height),i,s,1),this._ctx.scale(1/i,1/i)}destroy(){this._ctx=null,this._canvas.width=this._canvas.height=0}}function yo(t,e,i,s,o,n){if(!e||0===t.opacity)return;const a=t.renderer;o&&a.releaseLayer(!0);const r=a.shouldDraw,l=t.wantsLayerBacking?a.layer:null;if(l||t.frozen||a.releaseLayer(),t.wantsLayerBacking&&!l)return;const h=function(h){if(e.save(),e.translate(h,c),e.transform(u.a,u.b,u.c,u.d,u.e,u.f),e.globalAlpha=n,r||!t.frozen){const r=l?l.getContext("2d"):e;l&&e.canvas&&"appendChild"in e.canvas&&e.canvas.appendChild(l),a.draw(r);const h=t.children;for(let t=0,e=h.length;t<e;++t){yo(h[t],r,i,s,o,l?1:n)}}l&&0!==l.width&&0!==l.height&&e.drawImage(l,t.layerBounds.origin.x,t.layerBounds.origin.y,l.width/s,l.height/s),e.restore()},d=t.position.x,c=t.position.y,u=t.transform;n*=t.opacity,h(d),t.repeatOffset&&h(d+t.repeatOffset)}function vo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class bo extends ts{constructor(){super(),vo(this,"_renderer",void 0),vo(this,"sceneDidUpdate",void 0),vo(this,"isScene",!0),vo(this,"performanceMeasureName",void 0),vo(this,"_isTainted",!1),this._renderer=new fo(this)}get element(){return this._renderer.element}set element(t){this._renderer.element=t}get contextForMeasurement(){return this._renderer.ctx}get renderer(){return this._renderer}isTainted(){if(this._isTainted)return this._isTainted;const t=super.isTainted();return t&&(this._isTainted=!0),t}destroy(){this.children=[],this._renderer.destroy()}flush(){Vi.flush(this)}stringInfo(){return"Scene"}}var wo;function Co(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ko{constructor(t){Co(this,"node",void 0),Co(this,"duration",void 0),Co(this,"from",void 0),Co(this,"to",void 0),Co(this,"done",void 0),Co(this,"startTime",null),Co(this,"beginDate",void 0),Co(this,"ended",void 0),Co(this,"_p",void 0),this.node=t.node,this.node.animators||(this.node.animators=[]),this.node.animators.push(this),this.duration=t.duration,this.from=t.from??0,this.to=t.to??1,this.done=t.done??v}begin(){return this.startTime=null,this._p=0,ii(this),this}end(){if(this.ended=!0,this.node.animators){const t=this.node.animators.indexOf(this);t>=0&&(this.node.animators.splice(t,1),0===this.node.animators.length&&delete this.node.animators)}this.done(this)}performScheduledUpdate(t){this.ended||(null!=t&&(this.beginDate||(this.beginDate=t),this._p=Math.min((t-this.beginDate)/this.duration,1),this.update(this._p)),"number"==typeof this._p&&this._p<1?si(this):this.end())}update(t){}valueAt(t){const e=this.from;return e+t*(this.to-e)}stringInfo(t,e){let i="🏇"+t+"<"+this.duration+"ms; "+this.from.toString()+"→"+this.to.toString();return"number"==typeof this._p&&this._p>=0&&(i+="/"+Math.round(100*this._p)+"%"),this.done!==v&&(i+="*"),i+(e||"")+">"}}class So extends ko{update(t){this.node.opacity=this.valueAt(t)}stringInfo(){return super.stringInfo("opacity")}}class Lo extends ko{constructor(t){super({...t,from:t.from??new Pe(0,0),to:t.to??new Pe(0,0)}),Co(this,"springSolver",void 0),t.pop&&(this.springSolver=new Ao(1,Lo.STIFFNESS,Lo.DAMPING,0))}update(t){this.springSolver&&(t=this.springSolver.solve(t)),this.node.transform=(new gi).translate(this.from.x+t*(this.to.x-this.from.x),this.from.y+t*(this.to.y-this.from.y))}end(){this.node.transform=(new gi).translate(this.to.x,this.to.y),super.end()}stringInfo(){return super.stringInfo("translation")}}Co(Lo,"STIFFNESS",100),Co(Lo,"DAMPING",10);class Mo extends ko{constructor(t){const e=t.done||v;t.duration*=Mo.FLOAT_DURATION_SCALE,delete t.done,super(t),Co(this,"center",void 0),Co(this,"floatCenter",void 0),Co(this,"swayAmplitude",0),Co(this,"popAnimationDone",void 0),Co(this,"popSpringSolver",void 0),Co(this,"rotateSpringSolver",void 0),Co(this,"popAnimationDoneCalled",void 0),this.popAnimationDone=e,this.center=t.center??new Pe(0,0),t.floatCenter&&(this.floatCenter=t.floatCenter),this.popSpringSolver=new Ao(1,Mo.SCALE_STIFFNESS,Mo.SCALE_DAMPING,0),t.to>t.from&&(this.swayAmplitude=(Math.random()<.5?-1:1)*(3+3*Math.random()),this.rotateSpringSolver=new Ao(1,Mo.ROTATE_STIFFNESS,Mo.ROTATE_DAMPING,0))}scaleAndRotate(t,e){const i=this.center.x,s=this.center.y;this.floatCenter?this.node.transform=(new gi).translate(this.floatCenter.x,this.floatCenter.y).rotate(e).translate(-this.floatCenter.x,-this.floatCenter.y).translate(i,s).scale(t).translate(-i,-s):this.node.transform=(new gi).translate(i,s).scale(t).rotate(e).translate(-i,-s)}update(t){const e=t*Mo.FLOAT_DURATION_SCALE,i=this.valueAt(this.popSpringSolver.solve(e));let s=0;this.rotateSpringSolver&&(s=(this.rotateSpringSolver.solve(t)-1)*this.swayAmplitude),this.scaleAndRotate(i,s),e>1&&!this.popAnimationDoneCalled&&(this.popAnimationDoneCalled=!0,this.popAnimationDone(this))}end(){this.scaleAndRotate(this.to,0),super.end(),this.popAnimationDoneCalled||this.popAnimationDone(this)}stringInfo(){let t="";0===this.center.x&&0===this.center.y||(t+=" ("+this.center.x+", "+this.center.y+")");let e="float";return this.popAnimationDoneCalled&&(e+=" (swing)"),super.stringInfo(e,t)}}wo=Mo,Co(Mo,"SCALE_STIFFNESS",100),Co(Mo,"SCALE_DAMPING",10),Co(Mo,"FLOAT_DURATION_SCALE",4.2),Co(Mo,"ROTATE_DAMPING",5),Co(Mo,"ROTATE_STIFFNESS",.25*(wo.ROTATE_DAMPING*wo.ROTATE_DAMPING+483.611));class Ao{constructor(t,e,i,s){Co(this,"w0",void 0),Co(this,"zeta",void 0),Co(this,"wd",void 0),Co(this,"A",void 0),Co(this,"B",void 0),this.w0=Math.sqrt(e/t),this.zeta=i/(2*Math.sqrt(e*t)),this.zeta<1?(this.wd=this.w0*Math.sqrt(1-this.zeta*this.zeta),this.A=1,this.B=(this.zeta*this.w0-s)/this.wd):(this.wd=0,this.A=1,this.B=-s+this.w0)}solve(t){return 1-(t=this.zeta<1?Math.exp(-t*this.zeta*this.w0)*(this.A*Math.cos(this.wd*t)+this.B*Math.sin(this.wd*t)):(this.A+this.B*t)*Math.exp(-t*this.w0))}}const To={Basic:ko,Opacity:So,Translation:Lo,Scale:class extends ko{constructor(t){super(t),Co(this,"center",void 0),this.center=t.center??new Pe(0,0)}scale(t){const e=this.center.x,i=this.center.y;this.node.transform=(new gi).translate(e,i).scale(t).translate(-e,-i)}update(t){this.scale(this.valueAt(t))}stringInfo(){let t="";return 0===this.center.x&&0===this.center.y||(t+=" ("+this.center.x+", "+this.center.y+")"),super.stringInfo("scale",t)}},Float:Mo};function xo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Eo{constructor(t){xo(this,"element",void 0),xo(this,"fontSizeDidChange",void 0),xo(this,"observer",null),xo(this,"defaultFontSize",void 0),xo(this,"currentFontSize",void 0),xo(this,"ratio",void 0);const{container:e,fontSizeDidChange:i}=t,s=document.createElement("div");this.element=s,e.appendChild(s),s.className="mk-font-size-detector",s.textContent="A",s.ariaHidden="true",this.fontSizeDidChange=i,CSS.supports("(font: -apple-system-body) and (-webkit-touch-callout: default)")?(this.defaultFontSize=this.currentFontSize=17,s.style.font="-apple-system-body"):(this.defaultFontSize=this.currentFontSize=16,s.style.fontSize="initial",s.style.fontFamily="sans-serif"),this.ratio=1,"undefined"!=typeof ResizeObserver&&(this.observer=new ResizeObserver((()=>this._sizeChanged())),this.observer.observe(s))}_sizeChanged(){const t=parseInt(window.getComputedStyle(this.element).fontSize);if(isNaN(t)||t===this.currentFontSize)return;const e=Math.min(t/this.defaultFontSize,2);this.currentFontSize=this.defaultFontSize*e,this.ratio=e,this.fontSizeDidChange(this)}destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.element&&this.element.parentNode&&(this.element.parentNode.removeChild(this.element),this.element=null)}}const Io=new WeakMap;function Oo(t,e,i){const s=function(...o){const n=o;clearTimeout(Io.get(s));const a=setTimeout((function(){Io.delete(s),t.apply(i,n)}),e||0);Io.set(s,a)};return s}const Po=["ac.com","aws.sagemaker","biz.orx","cloud.jele","com.amazonaws","com.amazoncognito","com.est-a-la-masion","com.onthewifi","dev.curv","host.freesite","it.barletta-trani-andria","it.trento","jp.chiba","jp.fukushima","jp.hokkaido","jp.hyogo","jp.kanagawa","jp.miyazaki","jp.niigata","jp.saga","jp.tochigi","jp.xn--7t0a264c","lv.mil","net.homeunix","no.fuossko","no.smola","no.xn--sandy-yua","pa.ac","py.org","tj.ac","us.mi","zm.edu"],Ro=/^.*(?=\/mapkit([.a-z-]*)\.js)/;function zo(t){const e=Ro.exec(t.src);return e?e[0]:null}const Do={_baseUrl:void 0,_versionSuffix:"",scriptBaseUrl:void 0,getBaseUrl(){return Oe.distUrl?Oe.distUrl:t.useLocalResources&&(void 0===this.scriptBaseUrl&&this.findScriptAndSetBasePath(),void 0!==this.scriptBaseUrl)?this.scriptBaseUrl:Oe.applyProxyPrefix([t.cdnBase,"mk",t.cdnVersion].join("/"))},getVersionSuffix:()=>Oe.distUrl||t.useLocalResources?"?mkjsVersion="+t.cdnVersion:"",createUrl(t,e){void 0!==this._baseUrl&&void 0!==this._versionSuffix||(this._baseUrl=this.getBaseUrl(),this._versionSuffix=this.getVersionSuffix()),t=t&&t.replace(/^\//,"")||"";let i=this._versionSuffix;return("__mapkitSourceMap"in window||Oe.enableSourceMap)&&(i+=(i?"&":"?")+"sourcemap=1"),[this._baseUrl,t].join("/")+i},isUrlTrusted(){return Oe.isUrlTrusted(this.getBaseUrl())},createImageUrl(t){return this.createUrl("images/"+t)},findScriptAndSetBasePath(){if(document.currentScript){const t=zo(document.currentScript);if(t)return Do.scriptBaseUrl=t,document.currentScript}for(let t=document.scripts,e=0,i=t.length;e<i;++e){const i=t[e],s=zo(i);if(null!==s)return this.scriptBaseUrl=s,i}return null},createSyrupUrl(){let e;return e=Oe._syrupUrl?Oe._syrupUrl:Oe.applyProxyPrefix(t.cdnBase+"/ti/csr/1.x.x"),[e,"mk-csr.js?mapkitVersion="+t.version+(Oe.enableSourceMap?"&sourcemap=1":"")].join("/")},isSyrupUrlTrusted:t=>!Oe._syrupUrl&&Oe.isUrlTrusted(t)};t.useLocalResources&&"undefined"!=typeof window&&void 0!==window.document&&Do.findScriptAndSetBasePath(),Oe.addEventListener(Oe.Events.Initialized,(()=>{Do._baseUrl=void 0,Do._versionSuffix=""}));
2const No=St,Fo=["alt","arpa","example","invalid","local","localhost","onion","test"],Uo=[];function Wo(t,e){const i=e.length,s=t.length;if(i>s)return!1;for(let o=0;o<i;o++)if("*"!==e[i-1-o]&&e[i-1-o]!==t[s-1-o])return!1;return!0}function Go(t){let e=t[0];for(const i of t)i.length>e.length&&(e=i);return e}const Bo={getRegisterableDomain:async function(t){if(!t||t.includes(":")||/^[\d.]+$/.test(t))return null;const e=t.endsWith(".")?".":"";e&&(t=t.substring(0,t.length-1));const i=t.split("."),s=i.slice(-1)[0],o=1===i.length?null:i.slice(-2)[0];if(!o||Fo.includes(s))return null;const n=Po.slice(),a=`${s}.${o}`;n.push(a),n.sort();const r=n.lastIndexOf(a);if(0===r)return`${o}.${s}${e}`;const l=await(h=r-1,Uo[h]||(Uo[h]=new Promise((t=>{const e=Do.createUrl("psl/"+h+".txt"),i=new Gt(e,{loaderDidSucceed(e,i){if(i.status<200||i.status>=300)return void t(null);const s=i.responseText.split("\n").map((t=>t.trim())).filter((t=>!!t));t(s)},loaderDidFail(){t(null)}},{priority:No.Low,withCredentials:Oe.urlWithCredentials(e)});i.schedule()}))),Uo[h]);var h;return l?function(t,e){let i="";const s=[],o=[];for(const i of e)if(i.startsWith("!")){const e=i.substring(1).split(".");Wo(t,e)&&o.push(e)}else{const e=i.split(".");Wo(t,e)&&s.push(e)}let n=["*"];0!==o.length?(n=Go(o),n=n.slice(1)):0!==s.length&&(n=Go(s));return i=t.slice(-n.length-1).join("."),i}(i,l)+e:`${o}.${s}${e}`}};function Zo(e){const i={mkjs_version:t.version};return e._isInternalClient&&window.placecard&&window.placecard.version&&(i.placecard_version=window.placecard.version),i.team_id=e._teamId,e._isInternalClient?i.host=location.host:i.host=e.getReduceHostPlaceholder("Host"),i.tile_provider=e.tileProvider,null!==e._serverEnvironment&&(i.server_environment=e._serverEnvironment),i}function jo(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Ko=rt({Dark:"dark",Light:"light",Adaptive:"adaptive"});class Ho extends e{}const qo=new class{constructor(){jo(this,"_queryList",void 0),jo(this,"_handles",void 0),jo(this,"_boundQueryListDidChange",void 0),this._queryList=window.matchMedia("(prefers-color-scheme: dark)"),this._handles=new Set,this._boundQueryListDidChange=()=>this._queryListDidChange()}addHandle(){const t=new Ho;return this._handles.add(t),1===this._handles.size&&this._addListener(),t}removeHandle(t){this._handles.delete(t),0===this._handles.size&&this._removeListener()}get currentColorScheme(){return this._queryList.matches?Ko.Dark:Ko.Light}get isDarkMode(){return this._queryList.matches}_addListener(){this._queryList.addListener(this._boundQueryListDidChange)}_removeListener(){this._queryList.removeListener(this._boundQueryListDidChange)}_queryListDidChange(){for(const t of this._handles.values()){const e=new i("change");t.dispatchEvent(e)}}};function Vo(t,e){let i;return i={browser_language:navigator.language,prefers_color_scheme:qo.isDarkMode?"DARK":"LIGHT",browser_name:e.uaParserInfo.browserInfo.name,browser_version:e.uaParserInfo.browserInfo.version},t._isInternalClient?i.browser_origin=location.protocol+"//"+location.host:i.browser_origin=t.getReduceHostPlaceholder("ProtocolPlusHost"),t._isInternalClient&&(i.browser_referer=t.getReduceHostPlaceholder("ReferrerHost")),e.browserDefaultFontSize&&(i.browser_default_font_size=e.browserDefaultFontSize),e.browserInfoValues&&Object.assign(i,e.browserInfoValues),i}function Yo(t){if(!t._isInternalClient)return;return{width:window.innerWidth,height:window.innerHeight}}function Xo(t,e){const i={device_platform:e.uaParserInfo.deviceInfo.platform,device_os_version:e.uaParserInfo.deviceInfo.os};return void 0!==t._isInternalServer&&(i.is_internal_server=t._isInternalServer),i}function $o(t,e){const i=e.map.region.toBoundingRegion(),s=e.map.ensureRenderingFrame().size;return{display_map_region:{eastLng:Math.round(i.eastLongitude),northLat:Math.round(i.northLatitude),southLat:Math.round(i.southLatitude),westLng:Math.round(i.westLongitude)},zoom_level:e.map.zoomLevel,map_type:`MAP_TYPE_${e.map.mapType.toUpperCase()}`,size:{width:s.width,height:s.height},color_scheme:e.map.colorScheme.toUpperCase()}}function Jo(t){const e={device_pixel_ratio:window.devicePixelRatio};return t._isInternalClient?(e.width=screen.width,e.height=screen.height,e):e}function Qo(t,e){return{rendering:e.map._mapNodeController&&e.map._mapNodeController.renderingMode}}function tn(t){const e={};return t._isInternalClient&&(e.path=location.pathname),e}function en(t){return{session_id:t._sessionId,sequence_number:t._sequenceNumber,relative_timestamp:t._relativeTimestamp}}const sn=Object.freeze({SCREEN_SIZE:Jo,DEVICE_IDENTIFIER:Xo,BROWSER_INFO:Vo,APPLICATION_IDENTIFIER:Zo,BROWSER_WINDOW_SIZE:Yo,URL:tn,MAP_VIEW:$o,USER_SESSION:en,TILES:Qo}),on="other";function nn(t){t=t.toLowerCase();const e={name:on,version:on};try{if(t.includes("sogou"))e.name="Sogou",e.version=(/SogouMSE\/(\d+(\.?\d)*)/i.exec(t)??[])[1];else if(t.includes("ucbrowser"))e.name="UCBrowser",e.version=(/UCBrowser\/(\d+(\.?\d)*)/i.exec(t)??[])[1];else if(t.includes("qqbrowser"))e.name="QQBrowser",e.version=(/QQBrowser\/(\d+(\.?\d)*)/i.exec(t)??[])[1];else if(t.includes("metasr"))e.name="Sogou",e.version=(/MetaSr\s(\d+(\.?\d)*)/i.exec(t)??[])[1];else if(t.includes("edg")&&!t.includes("edgios")){e.name="Edge";const i=/edg(?:e|ios|a|i)?\/(\d+\.?\d*)/gi;e.version=(i.exec(t)??[])[1]}else!t.includes("safari")||t.includes("chrome")||t.includes("crios")||t.includes("gsa")||t.includes("fxios")||t.includes("duckduckgo")||t.includes("edg")?!t.includes("chrome")&&!t.includes("crios")||t.includes("chromium")||t.includes("edg")||t.includes("samsungbrowser")?!t.includes("firefox")&&!t.includes("fxios")||t.includes("seamonkey")?t.includes("msie")||t.includes("trident")&&t.includes("rv")?(e.name="Internet Explorer",e.version=t.includes("msie")?(/msie\s(\d+\.?\d*)/gi.exec(t)??[])[1]:(/rv:(\d+\.?\d*)/gi.exec(t)??[])[1]):t.includes("gsa")&&(e.name="Google Search App",e.version=(/gsa\/(\d+\.?\d*)/i.exec(t)??[])[1]):(e.name="Firefox",e.version=t.includes("firefox")?(/firefox\/(\d+\.?\d*)/gi.exec(t)??[])[1]:(/fxios\/(\d+\.?\d*)/gi.exec(t)??[])[1]):(e.name="Chrome",e.version=t.includes("chrome")?(/chrome\/([\d.]+)/gi.exec(t)??[])[1]:(/crios\/([\d.]+)/gi.exec(t)??[])[1]):(e.name="Safari",e.version=(/version\/(\d+(\.\d+)*)/i.exec(t)??[])[1]);return e}catch{return e}}function an(t){let e,i;t=t.toLowerCase();let s=null;try{if(t.includes("ipad")){e="iPad";const o=(/os\s+(.*?)[^_.\d]/i.exec(t)??[])[1];i="iOS "+o,s=o.replace(/_/g,".")}else if(t.includes("iphone")&&!t.includes("ipad")){e="iPhone";const o=(/os\s+(.*?)[^_.\d]+/i.exec(t)??[])[1];i="iOS "+o,s=o.replace(/_/g,".")}else if(t.includes("macintosh")){e="Macintosh";const o=(/mac os x (.*?)[^_.\d]/i.exec(t)??[])[1];i="Mac OS X "+o,s=o.replace(/_/g,".")}else if(t.includes("windows")){e="Windows";const o=(/windows nt (.*?)[^._\d]/i.exec(t)??[])[1];i="Windows NT "+o,s=o}else if(t.includes("android")){e="Android";const o=(/android (.*?)[^._\d]/i.exec(t)??[])[1];i="Android "+o,s=o.replace(/_/g,".")}else t.includes("linux")&&!t.includes("android")?(e="Linux",i="Linux"):t.includes("cros")?(e="Chrome OS",i="Chrome OS"):(e=on,i=on);return{platform:e,os:i,version:s}}catch{return{platform:on,os:on,version:null}}}function rn(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ln(t,e,i){return function(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e),function(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}(i,"get"),function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}const hn=St,dn=rt({ScreenSize:"SCREEN_SIZE",DeviceIdentifier:"DEVICE_IDENTIFIER",BrowserInfo:"BROWSER_INFO",ApplicationIdentifier:"APP
2LICATION_IDENTIFIER",BrowserWindowSize:"BROWSER_WINDOW_SIZE",Url:"URL",MapView:"MAP_VIEW",UserSession:"USER_SESSION",Tiles:"TILES"}),cn={MapUserActionStates:[dn.ScreenSize,dn.DeviceIdentifier,dn.BrowserInfo,dn.ApplicationIdentifier,dn.BrowserWindowSize,dn.Url,dn.MapView,dn.UserSession,dn.Tiles],SessionLessMapUserActionStates:[dn.ScreenSize,dn.DeviceIdentifier,dn.BrowserInfo,dn.ApplicationIdentifier,dn.BrowserWindowSize,dn.Url,dn.MapView,dn.Tiles],GeneralUserActionStates:[dn.ScreenSize,dn.DeviceIdentifier,dn.BrowserInfo,dn.ApplicationIdentifier,dn.BrowserWindowSize,dn.Url,dn.UserSession],SessionLessGeneralUserActionStates:[dn.ScreenSize,dn.DeviceIdentifier,dn.BrowserInfo,dn.ApplicationIdentifier,dn.BrowserWindowSize,dn.Url],NetworkStates:[dn.DeviceIdentifier,dn.BrowserInfo,dn.ApplicationIdentifier,dn.UserSession]},un=rt({UserAction:"USER_ACTION",Network:"NETWORK"}),pn=["OPEN_APPLE_MAPS"],mn={Zoom:{name:"ZOOM",states:cn.MapUserActionStates,type:un.UserAction},MapsLoad:{name:"MAPS_LOAD",states:cn.MapUserActionStates,type:un.UserAction},AnnotationClick:{name:"ANNOTATION_CLICK",states:cn.MapUserActionStates,type:un.UserAction},MapFeatureSelect:{name:"TAP_POI",states:cn.MapUserActionStates,type:un.UserAction,valueMap:{Poi:"POINT_OF_INTEREST",Territory:"TERRITORY",PhysicalFeature:"PHYSICAL_FEATURE"}},MapTypeChange:{name:"MAP_TYPE_CHANGE",states:cn.MapUserActionStates,type:un.UserAction},MapNodeReady:{name:"MAP_NODE_READY",states:cn.MapUserActionStates,type:un.UserAction},Pan:{name:"PAN",states:cn.MapUserActionStates,type:un.UserAction},PlaceAccessoryReveal:{name:"REVEAL",states:cn.MapUserActionStates,type:un.UserAction},PlaceAccessoryOpenAppleMaps:{name:"OPEN_APPLE_MAPS",states:cn.SessionLessMapUserActionStates,type:un.UserAction},PlaceDetailReveal:{name:"REVEAL",states:cn.GeneralUserActionStates,type:un.UserAction},PlaceDetailOpenAppleMaps:{name:"OPEN_APPLE_MAPS",states:cn.SessionLessGeneralUserActionStates,type:un.UserAction}
2,Search:{name:"SEARCH",states:cn.NetworkStates,type:un.Network},SearchAC:{name:"SEARCH_AC",states:cn.NetworkStates,type:un.Network},PlaceLookup:{name:"PLACE_LOOKUP",states:cn.NetworkStates,type:un.Network},ForwardGeocoder:{name:"FORWARD_GEOCODER",states:cn.NetworkStates,type:un.Network},ReverseGeocoder:{name:"REVERSE_GEOCODER",states:cn.NetworkStates,type:un.Network},Directions:{name:"DIRECTIONS",states:cn.NetworkStates,type:un.Network},PointsOfInterestSearch:{name:"POINTS_OF_INTEREST_SEARCH",states:cn.NetworkStates,type:un.Network}};class gn{constructor(){var t;rn(this,"_queuedMessages",[]),rn(this,"_queuedSessionLessMessages",[]),rn(this,"_shortSessionLoader",null),rn(this,"_sessionLessLoader",null),rn(this,"_analyticsUrl",null),rn(this,"_errorUrl",null),rn(this,"_sessionId",null),rn(this,"_sessionTimerStart",null),rn(this,"_sessionTimeToExpire",null),rn(this,"_sequenceNumber",null),rn(this,"_relativeTimestamp",null),rn(this,"_isCustomSession",!1),rn(this,"_refreshCustomSession",null),rn(this,"_enableServerAnalytics",!1),rn(this,"_serverEnvironment",null),rn(this,"_isInternalServer",void 0),rn(this,"_trackPanEvent",!1),rn(this,"_handleAnalyticsTrackingResponse",null),rn(this,"_registerableHostDomain",""),rn(this,"_registerableReferrerDomain",""),rn(this,"_reducedHostPlaceholders",{ProtocolPlusHost:null,Host:null,ReferrerHost:null}),rn(this,"_isInternalClient",void 0),rn(this,"_withCredentials",void 0),rn(this,"uaParserInfo",void 0),rn(this,"_debouncedQueueAsBackgroundTask",void 0),rn(this,"States",dn),rn(this,"Events",mn),rn(this,"EventTarget","UI_TARGET_UNKNOWN"),rn(this,"tileProvider",ln(gn,gn,_n)),rn(this,"_teamId",ln(gn,gn,fn)),this._isInternalClient=window.origin.endsWith(".apple.com")||window.origin.endsWith(".icloud.com")||window.origin.endsWith(".filemaker.com")||window.origin.endsWith(".apple-mapkit.com")||window.origin.endsWith(".tryrating.com"),Oe.addEventListener(Oe.Events.Changed,this),Oe.ready&&this._configurationBecameAvailable(),this.uaParserInfo={browserInfo:nn(t=navigator.userAgent),deviceInfo:an(t)},this._debouncedQueueAsBackgroundTask=Oo(this._queueAsBackgroundTask,5e3,this),window.addEventListener("pagehide",this),document.addEventListener("visibilitychange",this)}log(t,e={}){this._enableServerAnalytics;const i=(new Date).getTime();(!this._sessionId||!this._sessionTimeToExpire||i>this._sessionTimeToExpire)&&(this._isCustomSession&&this._refreshCustomSession?this._refreshCustomSession():this._initSession()),this._relativeTimestamp=((new Date).getTime()-this._sessionTimerStart)/1e3,this._sequenceNumber=Math.ceil(1e4*this._relativeTimestamp),this.uaParserInfo&&(e.uaParserInfo=this.uaParserInfo),pn.includes(t.name)||e?.isEventSessionLess?this._queuedSessionLessMessages.push(this._createMessage(t,e)):this._queuedMessages.push(this._createMessage(t,e)),Oe.analytics&&this._debouncedQueueAsBackgroundTask()}initCustomSession(t){this._isCustomSession=!0,this._sessionId=t.sessionId,this._sessionTimerStart=t.sessionStartTime,this._sessionTimeToExpire=this._sessionTimerStart+t.sessionDurationMs}manageAnalyticsTrackingResponse(t,e,i=!1){if(!this._handleAnalyticsTrackingResponse)return;let s;if(i)s={eventCount:e,sentViaSendBeacon:i};else{const e=t.xhr?.status,o=(t.xhrData?JSON.parse(t.xhrData):{}).analytics_event;s={eventCount:o&&Array.isArray(o)?o.length:0,responseCode:e,sentViaSendBeacon:i}}this._handleAnalyticsTrackingResponse(s),i&&(0!==this._queuedMessages.length&&this._queuedMessages.forEach((t=>{t.sent_via_send_beacon=!0})),0!==this._queuedSessionLessMessages.length&&this._queuedSessionLessMessages.forEach((t=>{t.sent_via_send_beacon=!0})))}setEventTarget(t){this.EventTarget=t}getDataToSend(t){return 0===this._queuedMessages.length?(this._shortSessionLoader.unschedule(),!1):(t.setRequestHeader("Content-Type","text/plain"),this._createShortSessionJson())}loaderDidSucceed(t){this.manageAnalyticsTrackingResponse(t),this._shortSessionLoader=null}loaderDidFail(t){this._queuedMessages=this._queuedMessages.concat(JSON.parse(t.xhrData).analytics_event),this.manageAnalyticsTrackingResponse(t),this._shortSessionLoader=null}getSessionLessDataToSend(t){return 0===this._queuedSessionLessMessages.length?(this._sessionLessLoader.unschedule(),!1):(t.setRequestHeader("Content-Type","text/plain"),this._createSessionLessJson())}sessionLessLoaderDidSucceed(t){this.manageAnalyticsTrackingResponse(t),this._sessionLessLoader=null}sessionLessLoaderDidFail(t){this._queuedSessionLessMessages=this._queuedSessionLessMessages.concat(JSON.parse(t.xhrData).analytics_event),this.manageAnalyticsTrackingResponse(t),this._sessionLessLoader=null}handleEvent(t){switch(t.type){case Oe.Events.Changed:this._configurationBecameAvailable();break;case"pagehide":this._sendPendingData();break;case"visibilitychange":"hidden"===document.visibilityState&&this._sendPendingData()}}getReduceHostPlaceholder(t){return this._reducedHostPlaceholders[t]||(this._reducedHostPlaceholders[t]=Symbol()),this._reducedHostPlaceholders[t]}_createMessage(t,e){let i;switch(t.type){case un.UserAction:i=this._createUserActionMessage(t,e);break;case un.Network:i=this._createNetworkMessage(t,e)}const s=[...t.states?t.states:[],...e.states?Object.keys(e.states):[]];return i.analytic_tag={high:x(),low:x()},i.analytics_state=this._createStateMessages(s,e),i.sent_via_send_beacon=!1,i}_createUserActionMessage(t,e){const i={event_type:un.UserAction,user_action_event:{user_action_event_key:t.name}};if(e.eventValue||0===e.eventValue){const s=t.valueMap?t.valueMap[e.eventValue]:e.eventValue;i.user_action_event.user_action_event_value=s}return e.eventTarget&&(i.user_action_event.user_action_event_target=e.eventTarget),e.eventModule&&(i.user_action_event.user_action_event_module=e.eventModule),i}_createNetworkMessage(t,e){const i={event_type:un.Network,network_event:{network_service:t.name}},s="number"==typeof e.responseCode?e.responseCode:"string"==typeof e.responseCode?parseInt(e.responseCode):void 0;return s&&!isNaN(s)&&(i.network_event.http_response_code=s),i}_initSession(){this._isCustomSession=!1,this._sessionId={high:x(),low:x()},this._sessionTimerStart=(new Date).getTime(),this._sessionTimeToExpire=this._sessionTimerStart+9e5}_createStateMessages(t,e){return t.map((t=>{const i={state_type:t};if(sn[t])i[t.toLowerCase()]=sn[t](this,e);else{const s=e.states[t];if(s){i[t.toLowerCase()]=s(e)}}return i}))}_createShortSessionJson(){const t=this._createJson({analytics_message_type:"SHORT_SESSION_USAGE",analytics_event:this._queuedMessages});return this._queuedMessages=[],t}_createSessionLessJson(){const t=this._createJson({analytics_message_type:"SESSIONLESS_USAGE",analytics_event:this._queuedSessionLessMessages});return this._queuedSessionLessMessages=[],t}_createJson(t){return JSON.stringify(t,((t,e)=>{switch(e){case ln(gn,gn,_n):return this.tileProvider;case ln(gn,gn,fn):return this._teamId;case this._reducedHostPlaceholders.Host:return this._registerableHostDomain;case this._reducedHostPlaceholders.ProtocolPlusHost:return this._registerableHostDomain?window.location.protocol+"//"+this._registerableHostDomain:"";case this._reducedHostPlaceholders.ReferrerHost:return this._registerableReferrerDomain;default:return e}}))}_configurationBecameAvailable(){Oe.analytics&&(this._analyticsUrl=Oe.analytics.analyticsUrl,this._withCredentials=Oe.urlWithCredentials(this._analyticsUrl)),this._teamId=Oe.analyticsTeamId??Oe.teamId??void 0,Oe.tileProvider===Oe.TileProviders.Apple?this.tileProvider=0:Oe.tileProvider===Oe.TileProviders.AutoNavi?this.tileProvider=1:this.tileProvider=void 0}
2_scheduleLoaderRequest(){this._shortSessionLoader||0===this._queuedMessages.length||(this._shortSessionLoader=new Gt(this._analyticsUrl,this,{method:"POST",priority:hn.Low,retry:!0,withCredentials:this._withCredentials}),this._shortSessionLoader.schedule()),this._sessionLessLoader||0===this._queuedSessionLessMessages.length||(this._sessionLessLoader=new Gt(this._analyticsUrl,{getDataToSend:t=>this.getSessionLessDataToSend(t),loaderDidSucceed:t=>{this.sessionLessLoaderDidSucceed(t)},loaderDidFail:t=>{this.sessionLessLoaderDidFail(t)}},{method:"POST",priority:hn.Low,retry:!0,withCredentials:this._withCredentials}),this._sessionLessLoader.schedule())}_scheduleLoader(){this._resolveRegisterableDomains().then((()=>{this._scheduleLoaderRequest()}))}_queueAsBackgroundTask(){ai((()=>this._scheduleLoader()),Ue.Medium)}_resolveRegisterableDomains(){const t=!!this._reducedHostPlaceholders.ProtocolPlusHost||!!this._reducedHostPlaceholders.Host,e=!!this._reducedHostPlaceholders.ReferrerHost&&document.referrer?new URL(document.referrer):null,i=e?e.hostname:null;return Promise.all([t?Bo.getRegisterableDomain(window.location.hostname):"",Bo.getRegisterableDomain(i)]).then((([t,i])=>{this._registerableHostDomain=t?window.location.port?`${t}:${window.location.port}`:t:"",this._registerableReferrerDomain=i?e&&e.port?`${i}:${e.port}`:i:""}))}_sendPendingData(){if(0!==this._queuedMessages.length){const t=this._queuedMessages.length;if(this.manageAnalyticsTrackingResponse(null,t,!0),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(this._analyticsUrl,this._createShortSessionJson());else{const t=new XMLHttpRequest;t.open("POST",this._analyticsUrl,!1),t.send(this._createShortSessionJson())}}if(0!==this._queuedSessionLessMessages.length){const t=this._queuedSessionLessMessages.length;if(this.manageAnalyticsTrackingResponse(null,t,!0),"function"==typeof navigator.sendBeacon)navigator.sendBeacon(this._analyticsUrl,this._createSessionLessJson());else{const t=new XMLHttpRequest;t.open("POST",this._analyticsUrl,!1),t.send(this._createSessionLessJson())}}}}var _n={writable:!0,value:Symbol()},fn={writable:!0,value:Symbol()};const yn=new gn;class vn{constructor(t,e,i,s){this.localeId=t,this._dict=e||{},this.ready=!!e,this.delegate=i,this.rtl=i.rtlLocales.indexOf(t)>-1,this.dow=s}get(t,e){const i=this._dict[t];return i?T(i,e??{},!0):`[${t}]`}load(t){const e=this.localeId,i=this.delegate.localeUrl.replace(/{{(.*?)}}/,e),s=new Gt(i,{loaderDidSucceed:(i,s)=>{if(s.status<200||s.status>=300){const i=new Error(`HTTP error ${s.status} loading strings for locale: ${e}`);t(i,this)}else{try{this._dict=JSON.parse(s.responseText??"")}catch(i){const s=new Error(`Failed to parse response for locale: ${e}`);return void t(s,this)}this.ready=!0,t(null,this)}},loaderDidFail:(i,s)=>{const o=new Error(`Network error loading strings for locale: ${e}`);t(o,this)}},{withCredentials:this.delegate.withCredentials});s.schedule()}}const bn=Object.freeze({"ar-SA":6,"ca-ES":1,"cs-CZ":1,"da-DK":1,"de-DE":1,"el-GR":1,"en-AU":1,"en-GB":1,"en-US":0,"en-ZA":0,"es-ES":1,"es-MX":1,"fi-FI":1,"fr-CA":0,"fr-FR":1,"he-IL":0,"hi-IN":0,"hr-HR":1,"hu-HU":1,"id-ID":1,"it-IT":1,"ja-JP":0,"ko-KR":0,"ms-MY":1,"nb-NO":1,"nl-NL":1,"pl-PL":1,"pt-BR":0,"pt-PT":1,"ro-RO":1,"ru-RU":1,"sk-SK":1,"sv-SE":1,"th-TH":0,"tr-TR":1,"uk-UA":1,"vi-VN":1,"zh-CN":1,"zh-HK":0,"zh-TW":0}),wn=["0","1","2","3","4","5","6","7","8","9"],Cn={"ar-SA":["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],"hi-IN":["०","१","२","३","४","५","६","७","८","९"]},kn=",",Sn={"ca-ES":kn,"ca-CZ":kn,"da-DK":kn,"da-DE":kn,"el-GR":kn,"en-ZA":kn,"es-ES":kn,"fi-FI":kn,"fr-CA":kn,"fr-FR":kn,"hr-HR":kn,"hu-HU":kn,"it-IT":kn,"nb-NO":kn,"nl-NL":kn,"pl-PL":kn,"pt-BR":kn,"pt-PT":kn,"ro-RO":kn,"ru-RU":kn,"sk-SK":kn,"sv-SE":kn,"tr-TR":kn,"uk-UA":kn};const Ln="en-US",Mn=new WeakSet,An=new WeakSet,Tn=(t,e)=>{const{language:i,region:s}=e;t.supportMap[i]=t.supportMap[i]||[],s&&-1!==t.delegate.primaryLocales.indexOf(e.tag)?t.supportMap[i].splice(0,0,s):s&&t.supportMap[i].push(s)},xn=(t,e,i)=>new vn(e,i??null,t.delegate,t.dowForBestMatch(e)),En=(t,e)=>{t.locales[e.localeId]||(t.locales[e.localeId]=e),t.activeLocale=e,t.dispatchEvent(new On(e))},In=(t,e)=>-1!==t.delegate.supportedLocales.indexOf(e);class On extends o{constructor(t){super(Pn.Events.LocaleChanged),this.locale=t}}class Pn extends s{constructor(t){super(),this.delegate=t,this._requestedLocaleId="",this.locales=t.localesCache||Object.create(null),this.supportMap=t.supportCache||Object.create(null),this.scriptMap=t.scriptCache||Object.create(null),this.Events=Pn.Events,(t=>{if(!Mn.has(t.supportMap)){Mn.add(t.supportMap);for(const e of t.delegate.supportedLocales){const i=Kt.parse(e);i&&Tn(t,i)}}})(this);const e=this.locales[Ln]||xn(this,Ln,this.delegate.enUSDictionary);this.locales[e.localeId]||(this.locales[e.localeId]=e),this.activeLocale=e,(t=>{if(An.has(t.scriptMap))return;An.add(t.scriptMap);
2const e=t.delegate.regionToScriptMap;for(const[i,s]of Object.entries(e)){t.scriptMap[i]={};for(const[e,o]of Object.entries(s))t.scriptMap[i][o.toLowerCase()]=e}})(this)}get(t,e){return this.activeLocale.get(t,e)??`[${t}]`}get localeId(){return this.activeLocale.localeId??""}set localeId(t){this._requestedLocaleId!==t&&((t,e)=>{t._requestedLocaleId=e;let i=e;if(In(t,e)||(i=t.bestMatch(e,Ln)),t.activeLocale.localeId===i)return;let s=i?t.locales[i]:null;s||!i||(s=xn(t,i),s.ready)?s&&En(t,s):s.load(((i,s)=>{if(t._requestedLocaleId===e)return i?(t._requestedLocaleId=Ln,void En(t,t.locales[Ln])):void En(t,s)}))})(this,t)}get loaded(){return!!this._requestedLocaleId&&this.bestMatch(this._requestedLocaleId,Ln)===this.localeId}get requestedLocaleId(){return this._requestedLocaleId}set requestedLocaleId(t){console.warn("l10n: requestedLocaleId can't be set, use localeId.")}get localeIds(){return Object.keys(this.locales)}get supportedLocaleIds(){return this.delegate.supportedLocales}bestMatch(t,e){let i="string"==typeof t?Kt.parse(t):null,s=null;if(i&&this.delegate.localesMap){const t=this.delegate.localesMap;t[i.tag]?i=Kt.parse(t[i.tag]):t[i.language]&&(i=Kt.parse(t[i.language]))}return e=e||null,i&&(s=((t,e)=>{const{language:i,region:s,script:o}=e;let n;const a=t.supportMap[i];if(!a)return null;if(s&&(n=a.find((t=>t.toUpperCase()===e.region?.toUpperCase()))),!n&&o){const e=t.scriptMap[i]?.[o.toLowerCase()];n=e??n}return n||(n=a[0]),new Kt(i,n)})(this,i)),s?s.tag:e}dowForBestMatch(t,e){const i=this.bestMatch(t,e);return i&&i in bn?bn[i]:0}digits(t){return function(t,e){const i=Cn[e]||wn,s=Sn[e]||".";let o="";const n=t.toString();for(let t=0,e=n.length;t<e;++t){const e=n.charAt(t);o+="."===e?s:i[parseInt(e,10)]||e}return o}(t,this.localeId)}}Pn.Events=Object.freeze({LocaleChanged:"locale-changed"}),Pn.Days=Object.freeze({Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6}),Pn.LocaleChangedEvent=On;const Rn=["AS","BS","BZ","DM","FK","GB","GD","GU","KN","KY","LC","LR","MM","MP","SH","TC","US","VC","VG","VI","WS"],zn=t=>{const e=t.region;return e?Rn.indexOf(e)<0:"en"!==t.language&&"my"!==t.language},Dn={supportedLocales:["ar-SA","bn-BD","ca-ES","cs-CZ","da-DK","de-DE","el-GR","en-GB","en-US","es-ES","es-MX","fi-FI","fr-CA","fr-FR","gu-IN","he-IL","hi-IN","hr-HR","hu-HU","id-ID","it-IT","ja-JP","kn-IN","ko-KR","ml-IN","mr-IN","ms-MY","nb-NO","nl-NL","or-IN","pa-IN","pl-PL","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sv-SE","ta-IN","te-IN","th-TH","tr-TR","uk-UA","ur-PK","vi-VN","zh-CN","zh-HK","zh-TW"],primaryLocales:["en-US","fr-FR","pt-BR","zh-CN"],localesMap:qt,regionToScriptMap:Vt,rtlLocales:["ar-SA","he-IL","ur-PK"],enUSDictionary:{"Annotation.Clustering.AccessibilityLabel":"{{n}} locations, {{title}}, {{subtitle}}","Annotation.Clustering.More":"+{{n}} more","Annotation.Clustering.More.Plural":"+{{n}} more","Annotation.Clustering.NoTitle.AccessibilityLabel":"{{n}} locations, {{subtitle}}","Annotation.Generic.AccessibilityLabel":"{{title}}, {{subtitle}}","Annotation.Marker.AccessibilityLabel":"Marker","Annotation.Pin.AccessibilityLabel":"Pin","Annotation.Pin.Green.AccessibilityLabel":"Green Pin","Annotation.Pin.Purple.AccessibilityLabel":"Purple Pin","Annotation.Pin.Red.AccessibilityLabel":"Red Pin",Compass:"Compass","Compass.Degrees.Plural":"{{n}} degrees","Compass.Degrees.Single":"{{n}} degree","Compass.EastIndicator":"E","Compass.Heading":"Heading: {{heading}}","Compass.NorthIndicator":"N","Compass.SouthIndicator":"S","Compass.Tooltip":"Rotate the map","Compass.Tooltip.Reset":"Reset heading","Compass.WestIndicator":"W",Done:"Done","Legal.Apple.URL":"https://www.apple.com/legal/internet-services/maps/legal-en.html","Legal.Label":"Legal","Legal.Label.Imagery":"Imagery","Legal.Label.Report":"Report","Location.Error.Message":"Your location can only be shown when location services are enabled and you are connected to the Internet.","Location.Error.Support.Label":"Learn more","Location.Subtitle":"Unknown Address","Location.Title":"Current Location","Logo.Apple.Tooltip":"Apple Maps","Logo.AutoNavi.Tooltip":"AutoNavi Maps","LookAround.Error.Unavailable":"Imagery is not available","LookAround.Label":"Look Around","MapType.Tooltip":"Change the map type","Mode.Hybrid":"Hybrid","Mode.Satellite":"Satellite","Mode.Standard":"Standard","OpenDialog.Enter":"Enter Fullscreen Mode","OpenDialog.Exit":"Exit Fullscreen Mode","OpenInAppleMaps.Label":"Open in Apple Maps","Place.Error.Message":"Could not load place details.","Place.Error.Title":"Place Unavailable","Scale.Feet.Short":"ft","Scale.Kilometer.Short":"km","Scale.Meter.Short":"m","Scale.Mile.Short":"mi","Track.User.Location.Tooltip":"Show your current location","Zoom.In.Tooltip":"Zoom In","Zoom.Out.Tooltip":"Zoom Out"},get localeUrl(){return Do.createUrl("locales/{{locale}}/strings.json")},get withCredentials(){return Oe.urlWithCredentials(this.localeUrl)}},Nn=new Pn(Dn),Fn=Object.create(null);$t(Yt,Dn.supportedLocales,Nn.supportMap,Fn);let Un=!1;Nn.addEventListener(Pn.Events.LocaleChanged,(()=>{const t=Kt.parse(Nn.requestedLocaleId);Un=zn(t)}));const Wn=function(){return Un};Oe.setL10n(Nn,(function(){Jt(Yt,Dn.supportedLocales,Nn.supportMap,Fn)}));function Gn(t,e){Zn(t,e),e.add(t)}function Bn(t,e,i){Zn(t,e),e.set(t,i)}function Zn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}
2function jn(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Kn(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function Hn(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Vn(t,e,"get"))}function qn(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Vn(t,e,"set"),i),i}function Vn(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var Yn=new WeakMap,Xn=new WeakMap,$n=new WeakMap,Jn=new WeakMap,Qn=new WeakMap,ta=new WeakSet,ea=new WeakMap,ia=new WeakSet;class sa extends Ri{constructor(t={}){const{enableContainerQuery:e=!1,showsImageryLink:i=!1,showsReportLink:s=!1,detectSizeChange:o=!1}=t;if(super(i||s?Fs("div",{class:e?"mk-legal mk-cq-legal":"mk-legal"}):Fs("a",{target:"_blank",tabindex:0,class:e?"mk-legal mk-cq-legal":"mk-legal"})),Gn(this,ia),Gn(this,ta),jn(this,"_labelNode",void 0),jn(this,"mapType",void 0),Bn(this,Yn,{writable:!0,value:void 0}),Bn(this,Xn,{writable:!0,value:void 0}),Bn(this,$n,{writable:!0,value:void 0}),Bn(this,Jn,{writable:!0,value:void 0}),jn(this,"anchorNode",void 0),Bn(this,Qn,{writable:!0,value:()=>Kn(this,ta,oa).call(this)}),Bn(this,ea,{writable:!0,value:void 0}),qn(this,Yn,t),i||s){const t=Fs("a",{target:"_blank",tabindex:0,class:"mk-legal-link"});this.anchorNode=new Ri(t),this.element.appendChild(t);const e=Fs("span",{class:"mk-legal-label"},Nn.get("Legal.Label"));this._labelNode=new Ri(e),t.appendChild(this._labelNode.element)}else{this.anchorNode=this;const t=Fs("span",{class:"mk-legal-label"},Nn.get("Legal.Label"));this._labelNode=new Ri(t),this.element.appendChild(this._labelNode.element)}if(i){const t=Fs("span",{class:"mk-legal-label"}," | ");this.element.appendChild(t);const e=Fs("a",{target:"_blank",tabindex:0,class:"mk-legal-link",href:"https://maps.apple.com/imagecollection/"});this.element.appendChild(e);const i=Fs("span",{class:"mk-legal-label mk-legal-imagery"},Nn.get("Legal.Label.Imagery"));qn(this,Xn,new Ri(i)),e.appendChild(Hn(this,Xn).element)}if(s){const t=Fs("span",{class:"mk-legal-label"}," | ");this.element.appendChild(t);const e=Fs("a",{target:"_blank",tabindex:0,class:"mk-legal-link"});qn(this,$n,new Ri(e)),this.element.appendChild(e);const i=Fs("span",{class:"mk-legal-label mk-legal-report"},Nn.get("Legal.Label.Report"));qn(this,Jn,new Ri(i)),e.appendChild(Hn(this,Jn).element)}Nn.addEventListener(Nn.Events.LocaleChanged,Hn(this,Qn)),o&&(qn(this,ea,new ResizeObserver((t=>Kn(this,ia,na).call(this,t)))),Hn(this,ea).observe(this.element))}updateWithMapType(t){if(this.mapType=t,this._labelNode.element.textContent=Nn.get("Legal.Label"),Hn(this,Xn)&&(Hn(this,Xn).element.textContent=Nn.get("Legal.Label.Imagery")),Hn(this,Jn)&&(Hn(this,Jn).element.textContent=Nn.get("Legal.Label.Report")),Oe.isAutoNavi)if(Oe.ready){const t=Oe.types[this.mapType]?.tileSources[0];t.attribution&&t.attribution.url&&this.anchorNode.setAttribute("href",t.attribution.url)}else this.anchorNode.removeAttribute("href");else this.anchorNode.setAttribute("href",Nn.get("Legal.Apple.URL"))}updateReportLink(t){t?(Hn(this,$n)?.setAttribute("href",t),Hn(this,$n)?.removeAttribute("data-error")):(Hn(this,$n)?.removeAttribute("href"),Hn(this,$n)?.setAttribute("data-error",""))}destroy(){Nn.removeEventListener(Nn.Events.LocaleChanged,Hn(this,Qn)),Hn(this,ea)?.disconnect(),qn(this,Yn,void 0)}}function oa(){this.mapType&&this.updateWithMapType(this.mapType)}function na([t]){const{contentRect:{width:e,height:i}}=t;0!==e&&0!==i&&Hn(this,Yn).sizeDidUpdate.call(Hn(this,Yn),{width:e,height:i})}const aa=["ca-ES","en-GB","en-US","es-ES","es-MX","hi-IN","id-ID","ja-JP","ko-KR","ms-MY","nb-NO","pt-BR","pt-PT","ro-RO","zh-CN","zh-HK","zh-TW"];function ra(t){return t?"use-credentials":"anonymous"}const la={"logo-autonavi":{xMin:.132,xMax:.828},"logo-autonavi-rtl":{xMin:.127,xMax:.833},"logo-wordmark-ca-ES":{xMin:.042,xMax:.62},"logo-wordmark-ar-SA":{xMin:.371,xMax:.956},"logo-wordmark-el-GR":{xMin:.042,xMax:.666},"logo-wordmark-de-DE":{xMin:.042,xMax:.606},"logo-wordmark-cs-CZ":{xMin:.042,xMax:.541},"logo-wordmark-da-DK":{xMin:.042,xMax:.438},"logo-wordmark-en-US":{xMin:.042,xMax:.535},"logo-wordmark-en-GB":{xMin:.042,xMax:.535},"logo-wordmark-es-ES":{xMin:.042,xMax:.618},"logo-wordmark-es-MX":{xMin:.042,xMax:.618},"logo-wordmark-fr-FR":{xMin:.042,xMax:.53},"logo-wordmark-fi-FI":{xMin:.042,xMax:.57},"logo-wordmark-fr-CA":{xMin:.042,xMax:.53},"logo-wordmark-he-IL":{xMin:.49,xMax:.955},"logo-wordmark-id-ID":{xMin:.042,xMax:.457},"logo-wordmark-hi-IN":{xMin:.042,xMax:.52},"logo-wordmark-it-IT":{xMin:.042,xMax:.632},"logo-wordmark-hr-HR":{xMin:.042,xMax:.52},"logo-wordmark-hu-HU":{xMin:.042,xMax:.782},"logo-wordmark-ja-JP":{xMin:.042,xMax:.505},"logo-wordmark-ko-KR":{xMin:.042,xMax:.413},"logo-wordmark-nl-NL":{xMin:.042,xMax:.686},"logo-wordmark-ms-MY":{xMin:.042,xMax:.457},"logo-wordmark-pl-PL":{xMin:.042,xMax:.541},"logo-wordmark-nb-NO":{xMin:.042,xMax:.436},"logo-wordmark-ro-RO":{xMin:.042,xMax:.488},"logo-wordmark-pt-BR":{xMin:.042,xMax:.618},"logo-wordmark-pt-PT":{xMin:.042,xMax:.618},"logo-wordmark-ru-RU":{xMin:.042,xMax:.595},"logo-wordmark-sv-SE":{xMin:.042,xMax:.577},"logo-wordmark-sl-SI":{xMin:.042,xMax:.852},"logo-wordmark-sk-SK":{xMin:.042,xMax:.541},"logo-wordmark-tr-TR":{xMin:.042,xMax:.564},"logo-wordmark-vi-VN":{xMin:.042,xMax:.621},"logo-wordmark-th-TH":{xMin:.042,xMax:.535},"logo-wordmark-zh-CN":{xMin:.042,xMax:.41},"logo-wordmark-uk-UA":{xMin:.042,xMax:.577},"logo-wordmark-zh-HK":{xMin:.042,xMax:.41},"logo-wordmark-zh-TW":{xMin:.042,xMax:.41}};function ha(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class da extends Ri{constructor(t){const e=Fs("img");super(Fs("div",{class:t.logoEnablesContainerQuery?"mk-cq-logo-control":"mk-logo-control"},e)),ha(this,"_delegate",void 0),ha(this,"_logoElement",void 0),ha(this,"_logoElementNode",void 0),ha(this,"tint",void 0),ha(this,"rtl",void 0),this._delegate=t,this._logoElement=e,this._logoElementNode=new Ri(this._logoElement),this._logoElementNode.classList.add("mk-logo"),this.tint=void 0,Nn.addEventListener(Nn.Events.LocaleChanged,this),Oe.addEventListener(Oe.Events.Changed,this),this.rtl=Nn.activeLocale.rtl}updateWithMapNodeTint(t){this.tint=t;const e=$s(t),i=this._logoElementNode;if(Oe.state===Oe.States.UNINITIALIZED){const t=()=>{Oe.removeEventListener(Oe.Events.Initialized,t),ca(this,i,e,Oe.isAutoNavi&&!this._delegate.alwaysShowAppleMapsLogo)};Oe.addEventListener(Oe.Events.Initialized,t)}else ca(this,i,e,Oe.isAutoNavi&&!this._delegate.alwaysShowAppleMapsLogo);const s=Oe.tileProvider?Oe.tileProvider:Oe.TileProviders.Apple;i.setAttribute("alt",Nn.get("Logo."+s+".Tooltip"))}handleEvent(t){switch(t.type){case Nn.Events.LocaleChanged:this.rtl=t.locale.rtl,this._handleLocaleChange();break;case Oe.Events.Changed:if(!this.tint)return;this.updateWithMapNodeTint(this.tint)}}destroy(){Nn.removeEventListener(Nn.Events.LocaleChanged,this),Oe.removeEventListener(Oe.Events.Changed,this)}_handleLocaleChange(){this.tint&&this.updateWithMapNodeTint(this.tint)}}function ca(t,e,i,s){const o=t._delegate,n="logos/"+ua(i,t.rtl,s);e.classList.toggle("mk-logo-autonavi",s);const a=Do.createImageUrl(js([1],n,".png")),r=s?`${a}, ${Do.createImageUrl(js([2],n,".png"))} 2x, ${Do.createImageUrl(js([3],n,".png"))} 3x`:`${a}, ${Do.createImageUrl(js([1],n,".svg"))} 2x`,l=la[ua(!1,t.rtl,s)];l&&o.logoUpdated(l),e.element.crossOrigin=ra(Oe.urlWithCredentials(a)),e.setAttribute("src",a),e.setAttribute("srcset",r)}
2function ua(t,e,i){let s=["logo-wordmark"];return i&&(s=["logo","autonavi"]),t&&s.push("satellite"),i&&e&&s.push("rtl"),i||s.push(Nn.localeId),s.join("-")}function pa(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function ma(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ga(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}var _a=new WeakMap;class fa extends Ri{constructor(t){super(t),ma(this,"_enabled",!1),ma(this,"hasFocus",!1),ma(this,"pageHasFocus",!1),ma(this,"_endEventProps",void 0),ma(this,"_eventListener",void 0),ma(this,"_windowEventListener",void 0),ma(this,"_cancelFocusEventListener",void 0),pa(this,_a,{writable:!0,value:new e}),this.classList.add(ya.CONTROL)}addEventListener(...t){return ga(this,_a).addEventListener(...t)}removeEventListener(...t){return ga(this,_a).removeEventListener(...t)}dispatchEvent(...t){return ga(this,_a).dispatchEvent(...t)}get enabled(){return this._enabled}set enabled(t){const e=!!t;this._enabled!==e&&(e?this.enable():this.disable(),this._enabled=e,this.reset())}set canShowTooltips(t){t?this._updateLabels():this._clearLabels()}willMoveToParent(t){t?this.parent||(this._createListeners(),Nn.addEventListener(Nn.Events.LocaleChanged,this._eventListener),this.enabled&&(this._addFocusAndBlurListeners(),this._addKeyboardListeners(),this.addEventListeners?.())):(Nn.removeEventListener(Nn.Events.LocaleChanged,this._eventListener),this.removeEventListeners?.(),this._removeFocusAndBlurListeners(),this._removeKeyboardListeners(),this._destroyListeners())}enable(){this.classList.remove(ya.DISABLED),this._createListeners(),this.element.addEventListener(Ts(),this._eventListener),this.element.addEventListener("click",this._eventListener),this.parent&&(this._addFocusAndBlurListeners(),this._addKeyboardListeners(),this.addEventListeners?.())}disable(){this.classList.add(ya.DISABLED),this.element.removeEventListener(Ts(),this._eventListener),this.element.removeEventListener("click",this._eventListener),this.removeEventListeners?.(),this._removeFocusAndBlurListeners(),this._removeKeyboardListeners()}blurFocusedElement(t){const e=Ws(this.element,t);if(!this.element.contains(e)){const t=Gs(this.element);"activeElement"in t&&t.activeElement&&this.element.contains(t.activeElement)&&t.activeElement.blur()}}reset(){}saveEndEventProps(t){if(t&&t.type===Os()){const e="changedTouches"in t?t.changedTouches[0]:t;this._endEventProps=[e.clientX,e.clientY,e.screenX,e.screenY]}}checkClickEventProps(t){if(!this._endEventProps)return!1;const e=[t.clientX,t.clientY,t.screenX,t.screenY];let i=!0;for(let t=0;t<e.length;t++){const s=this._endEventProps[t],o=e[t];if(Math.abs(s-o)>1){i=!1;break}}return delete this._endEventProps,i}_clearLabels(){Vs(this.element,"")}_createListeners(){this._eventListener||(this._eventListener=new va(this)),this._windowEventListener||(this._windowEventListener=new wa(this)),this._cancelFocusEventListener||(this._cancelFocusEventListener=new ba(this))}_destroyListeners(){this._eventListener&&(this.element.removeEventListener(Ts(),this._eventListener),this.element.removeEventListener("click",this._eventListener),this._eventListener.destroy(),delete this._eventListener),this._windowEventListener&&(this._windowEventListener.destroy(),delete this._windowEventListener),this._cancelFocusEventListener&&(this._cancelFocusEventListener.destroy(),delete this._cancelFocusEventListener)}_addFocusAndBlurListeners(){this.element.addEventListener("focus",this._eventListener,!0),this.element.addEventListener("blur",this._eventListener,!0),window.addEventListener("focus",this._windowEventListener),window.addEventListener("blur",this._windowEventListener);const t=Gs(this.element);this.hasFocus="activeElement"in t&&t.activeElement===this.element}_removeFocusAndBlurListeners(){this.element.removeEventListener("focus",this._eventListener,!0),this.element.removeEventListener("blur",this._eventListener,!0),window.removeEventListener(Ts(),this._cancelFocusEventListener,!0),window.removeEventListener("focus",this._windowEventListener),window.removeEventListener("blur",this._windowEventListener)}_addKeyboardListeners(){this.element.addEventListener("keydown",this._eventListener),this.element.addEventListener("keyup",this._eventListener)}_removeKeyboardListeners(){this.element.removeEventListener("keydown",this._eventListener),this.element.removeEventListener("keyup",this._eventListener)}}const ya={CONTROL:"mk-control",DISABLED:"mk-disabled",FOCUS:"mk-focus"};class va{constructor(t){ma(this,"_control",void 0),this._control=t}destroy(){window.removeEventListener(Ts(),this._control._cancelFocusEventListener,!0),this._removeEventListeners(),delete this._control}handleEvent(t){switch(t.type){case"click":this._click(t);break;case Ts():this._touchesBegan(t);break;case Es():this._control.touchesMoved?.(t);break;case Os():this._removeEventListeners(),this._control.touchesEnded?.(t);break;case Rs():this._removeEventListeners(),this._control.touchesCanceled?.(t);break;case"keydown":this._keyDown(t);break;case"keyup":this._keyUp(t);break;case"focus":this._focus(t);break;case"blur":this._blur(t);break;case Nn.Events.LocaleChanged:this._control.localeChanged?.(t)}}_click(t){this._swallowEvent(t),this._control.clicked?.(t)}_touchesBegan(t){this._swallowEvent(t);("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(0!==t.button||t.ctrlKey)||(window.addEventListener(Es(),this,!0),window.addEventListener(Os(),this,!0),Rs()&&window.addEventListener(Rs(),this,!0),this._control.touchesBegan?.(t))}_keyDown(t){switch(t.keyCode){case p:this._control.escapeKeyDown?.(t);break;case m:t.preventDefault(),this._control.spaceBarKeyDown?.(t);break;case y:t.preventDefault(),this._control.downArrowKeyDown?.(t);break;case _:t.preventDefault(),this._control.upArrowKeyDown?.(t);break;case f:t.preventDefault(),this._control.rightArrowKeyDown?.(t);break;case g:t.preventDefault(),this._control.leftArrowKeyDown?.(t)}}_keyUp(t){switch(t.keyCode){case p:this._control.escapeKeyUp?.(t);break;case y:t.preventDefault(),this._control.downArrowKeyUp?.(t);break;case _:t.preventDefault(),this._control.upArrowKeyUp?.(t);break;case f:t.preventDefault(),this._control.rightArrowKeyUp?.(t);break;case g:t.preventDefault(),this._control.leftArrowKeyUp?.(t);break;case m:t.preventDefault(),this._control.spaceBarKeyUp?.(t)}}_focus(t){if(this._control.hasFocus)return void 0;const e=Gs(this._control.element);"activeElement"in e&&e.activeElement!==t.target||(this._control.hasFocus=!0,this._control.classList.add(ya.FOCUS),window.addEventListener(Ts(),this._control._cancelFocusEventListener,!0),this._control.focused?.(t))}_blur(t){this._control.hasFocus&&(this._control.hasFocus=!1,window.removeEventListener(Ts(),this._control._cancelFocusEventListener,!0),this._control.classList.remove(ya.FOCUS),this._control.blurred?.(t))}_removeEventListeners(){window.removeEventListener(Es(),this,!0),window.removeEventListener(Os(),this,!0),Rs()&&window.removeEventListener(Rs(),this,!0)}_swallowEvent(t){t.preventDefault(),t.stopPropagation()}}class ba{constructor(t){ma(this,"_control",void 0),this._control=t}destroy(){delete this._control}handleEvent(t){this._control.blurFocusedElement(t)}}class wa{constructor(t){ma(this,"_control",void 0),this._control=t}destroy(){delete this._control}handleEvent(t){switch(t.type){case"focus":this._control.pageHasFocus||(this._control.pageHasFocus=!0,this._control.pageDidFocus?.(t));break;case"blur":this._control.pageHasFocus=!1,this._control.pageDidBlur?.(t)}}}function Ca(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ka extends Ri{constructor(t,e,i){super(Fs("label",{class:Sa.CONTROL})),Ca(this,"delegate",void 0),Ca(this,"mapType",void 0),Ca(this,"enabled",void 0),Ca(this,"radioElement",void 0),Ca(this,"_handleChangeEventListener",void 0),this.delegate=i,this.mapType=t,this.enabled=!1,this._handleChangeEventListener=()=>this._handleChangeEvent();const s=i.mapTypes[t]===i.mapType,o=Nn.get("Mode."+t),n=Fs("input",{type:"radio",name:e,"aria-label":o,tabindex:"0"});n.checked=s,this.radioElement=n,this.element.appendChild(n);const a=function(t,e){const i=[];if(e[t]===e.Standard){const{src:e,srcset:s}=La(t,!1);
2i.push(Fs("img",{class:Sa.LIGHT_ICON,"aria-hidden":!0,crossOrigin:ra(Oe.urlWithCredentials(e)),src:e,srcset:s}));const{src:o,srcset:n}=La(t,!0);i.push(Fs("img",{class:Sa.DARK_ICON,"aria-hidden":!0,crossOrigin:ra(Oe.urlWithCredentials(o)),src:o,srcset:n}))}else{const{src:e,srcset:s}=La(t,!1);i.push(Fs("img",{"aria-hidden":!0,crossOrigin:ra(Oe.urlWithCredentials(e)),src:e,srcset:s}))}return i}(t,i.mapTypes);a.forEach((t=>this.element.appendChild(t)))}focus(){this.radioElement.focus()}setSelected(){this.radioElement.checked=!0}updateLabels(){const t=Nn.get("Mode."+this.mapType);this.radioElement.setAttribute("aria-label",t)}activate(){this.radioElement.addEventListener("change",this._handleChangeEventListener),this._handleChangeEvent()}deactivate(){this.radioElement.removeEventListener("change",this._handleChangeEventListener)}_handleChangeEvent(){this.radioElement.checked&&this._handleSelected()}_handleSelected(){this.delegate.mapType=this.delegate.mapTypes[this.mapType]}}const Sa={CONTROL:"mk-map-type-button",LIGHT_ICON:"mk-light-icon",DARK_ICON:"mk-dark-icon"};function La(t,e){const i=["icons/map-type"];i.push(t.toLowerCase()),e&&i.push("dark");const s=Do.createImageUrl(js([1],i.join("-"),".png"));return{src:s,srcset:`${s}, ${Do.createImageUrl(js([2],i.join("-"),".png"))} 2x`}}class Ma extends Ri{constructor(){super(Fs("div",{class:Aa.CONTROL,role:"dialog",tabindex:"-1"})),this.element.appendChild(Ks(Us("g",Us("rect",{y:12,x:0,height:2,width:30}),Us("path",{d:"M0 13v-.5c4.038 0 8.305-3.53 12.835-10.477.454-.71 1.005-1.137 1.564-1.326h.001a2.07 2.07 0 011.814.225c.273.175.505.407.68.68C21.525 8.829 25.881 12.5 30 12.5v.5"})),{class:Aa.ARROW,"aria-hidden":"true",width:"30",height:"14"}))}open(){this.classList.add(Aa.SHOWN)}handleEvent(){this.classList.contains(Aa.SHOWN)&&this.focus()}focus(){this.element.focus()}close(){this.classList.remove(Aa.SHOWN)}didMoveToParent(t){t?this.element.addEventListener("transitionend",this):this.element.removeEventListener("transitionend",this)}}const Aa={CONTROL:"mk-popover",ARROW:"mk-popover-arrow",SHOWN:"mk-shown"};
2function Ta(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const xa=["Standard","Hybrid","Satellite"];class Ea extends Ma{constructor(t){super(),Ta(this,"delegate",void 0),Ta(this,"buttons",void 0),Ta(this,"selectedButton",void 0),Ta(this,"labels",void 0),this.classList.add(Ia.POPOVER),this.setAttribute("aria-label",Nn.get("MapType.Tooltip")),this.delegate=t;const e={},i={},s=`mk-map-type-button-${Math.random().toString(32).substring(2)}`;let o;for(const n of xa){const a=new Ri,r=new ka(n,s,t);a.addChild(r);const l=new Ri(Fs("div",{"aria-hidden":"true",class:Ia.MAP_TYPE_LABEL}));l.element.textContent=Nn.get("Mode."+n),a.addChild(l),this.addChild(a),e[n]=r,i[n]=l,t.mapTypes[n]===t.mapType&&(o=r)}this.selectedButton=o,this.buttons=e,this.labels=i}focus(){this.selectedButton.focus()}updateSelected(){const t=xa.find((t=>this.delegate.mapTypes[t]===this.delegate.mapType));this.selectedButton=this.buttons[t],this.selectedButton.setSelected()}updateLabels(){this.setAttribute("aria-label",Nn.get("MapType.Tooltip")),xa.forEach((t=>{this.labels[t].element.textContent=Nn.get("Mode."+t),this.buttons[t].updateLabels()}))}didMoveToParent(t){super.didMoveToParent(t),t?xa.forEach((t=>this.buttons[t].activate())):xa.forEach((t=>this.buttons[t].deactivate()))}}const Ia={POPOVER:"mk-map-type-popover",MAP_TYPE_LABEL:"mk-map-type-label"};function Oa(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Pa{constructor(t){Oa(this,"_control",void 0),this._control=t}get mapTypes(){return this._control.mapTypes}get mapType(){return this._control.mapType}set mapType(t){this._control.mapType=t}}const Ra="mk-map-type-control",za="mk-pressed";class Da extends fa{constructor(t,e,i){super(Fs("div",{role:"button",tabindex:"0"})),Oa(this,"_delegate",void 0),Oa(this,"_focusDelegate",void 0),Oa(this,"_iconElement",void 0),Oa(this,"_mapType",void 0),Oa(this,"_mapTypes",void 0),Oa(this,"_isOpen",void 0),Oa(this,"popover",null),Oa(this,"tintColor",""),this.classList.add(Ra),this._delegate=new Pa(this),this._focusDelegate=i;const s=function(){const t=Us("path"),e=Ks(t,{});return e.setAttribute("viewBox","0 0 45 24"),[e,t]}();this.element.appendChild(s[0]),this._iconElement=s[1],this._mapType=e,this._mapTypes=t,this._updateIcon(),this._updateLabels(),this.enabled=!0,this._isOpen=!1}get mapType(){return this._mapType}set mapType(t){t!==this._mapType&&(this._mapType=t,this._updateIcon(),this.popover.updateSelected(),this.dispatchEvent(new n.Event(Da.EVENTS.MAP_TYPE_CHANGE)))}get mapTypes(){return this._mapTypes}localeChanged(){this._updateLabels(),this.popover.updateLabels()}touchesBegan(){this._pressed()}touchesEnded(){this.reset()}clicked(){this._toggle()}touchesCanceled(){this.reset()}spaceBarKeyDown(){this._pressed()}spaceBarKeyUp(){this.reset(),this._open()}updateTintColor(t){this.tintColor=t,this._iconElement.style.fill=t}reset(){this.classList.remove(za),this._focusDelegate.controlWasReleased(this)}handleEvent(t){switch(t.type){case Ts():{const e=Ws(this.element,t);this.popover.element.contains(e)||this.element.contains(e)||this._close();break}case"keydown":if(27===t.keyCode){this._close();const t=Gs(this.element),e="activeElement"in t&&t.activeElement;e&&this.popover.element.contains(e)&&this.element.focus()}break;case"blur":this.popover.element.contains(t.relatedTarget)||this._close()}}didMoveToParent(t){t?(this.popover=new Ea(this._delegate),this.parent.insertAfter(this.popover,this)):(window.removeEventListener(Ts(),this,!0),window.removeEventListener("keydown",this,!0),this.popover.element.removeEventListener("blur",this,!0),this.popover.remove(),this.popover=null)}focused(){this._focusDelegate.controlDidGetFocus(this)}blurred(){this._focusDelegate.controlDidLoseFocus(this)}_updateLabels(){Vs(this,Nn.get("MapType.Tooltip"))}_toggle(){this._isOpen?this._close():this._open()}_pressed(){this.classList.add(za),this._focusDelegate.controlWasPressed(this)}_open(){this._isOpen||(this._isOpen=!0,this.popover.open(),window.addEventListener(Ts(),this,!0),window.addEventListener("keydown",this,
2!0),this.popover.element.addEventListener("blur",this,!0))}_close(){this._isOpen&&(this._isOpen=!1,this.popover.close(),window.removeEventListener(Ts(),this,!0),window.removeEventListener("keydown",this,!0),this.popover.element.removeEventListener("blur",this,!0))}_updateIcon(){this._iconElement.setAttribute("d",Na[this._mapType])}}Oa(Da,"EVENTS",{MAP_TYPE_CHANGE:"map-type-change"});const Na={standard:"M24.597 18.663V8.233L21.53 6.369a1.83 1.83 0 00-.413-.178v10.569l3.136 1.764c.06.03.116.058.171.083a.815.815 0 00.172.057zm-7.548-.178c.17 0 .356-.057.559-.171l2.615-1.416V6.285c-.06.026-.125.055-.197.089-.072.034-.14.07-.203.108l-2.958 1.695c-.199.11-.346.246-.44.41a1.118 1.118 0 00-.144.574v8.544c0 .25.07.442.207.577.137.136.324.203.561.203zm8.436.153a.641.641 0 00.204-.09l3.269-1.853c.203-.114.352-.251.447-.412.095-.161.143-.354.143-.578V7.18c0-.254-.07-.447-.21-.58-.14-.134-.332-.2-.577-.2-.17 0-.358.057-.565.17l-2.71 1.505v10.563z",hybrid:"M22.918 13.579c.13 0 .262-.023.393-.067.131-.044.275-.111.432-.2l4.951-2.875c.267-.157.456-.303.568-.438a.741.741 0 00.168-.49.724.724 0 00-.168-.475c-.112-.136-.301-.282-.568-.438L23.743 5.72a2.539 2.539 0 00-.432-.2 1.22 1.22 0 00-.79 0c-.129.045-.274.111-.435.2l-4.951 2.876c-.267.156-.456.302-.568.438a.724.724 0 00-.168.476c0 .19.056.353.168.489.112.135.301.28.568.438l4.951 2.875c.161.089.306.156.435.2.13.044.261.067.397.067zm0 3.135a.81.81 0 00.343-.076c.11-.05.237-.116.38-.197l5.409-3.192a.775.775 0 00.292-.28.656.656 0 00.095-.33.601.601 0 00-.12-.374.81.81 0 00-.267-.235l-5.847 3.377c-.055.034-.105.06-.152.08a.352.352 0 01-.133.028.366.366 0 01-.14-.029 1.063 1.063 0 01-.152-.08L16.78 12.03a.81.81 0 00-.267.235.601.601 0 00-.12.374c0 .11.032.22.098.33.065.11.164.203.295.28l5.402 3.192c.144.08.27.146.38.197.11.051.227.076.35.076zm0 2.94a.81.81 0 00.343-.077c.11-.05.237-.118.38-.203l5.409-3.186a.825.825 0 00.288-.277.644.644 0 00.099-.34.582.582 0 00-.12-.361.887.887 0 00-.267-.241l-5.847 3.383a2.55 2.55 0 01-.152.076.322.322 0 01-.133.032.335.335 0 01-.14-.032 2.55 2.55 0 01-.152-.076L16.78 14.97a.887.887 0 00-.267.241.582.582 0 00-.12.362c0 .118.032.231.098.34.065.107.164.2.295.275l5.402 3.187c.144.085.27.152.38.203.11.05.227.076.35.076z",satellite:"M22.915 18.923c.888 0 1.725-.169 2.51-.507a6.62 6.62 0 002.079-1.41 6.62 6.62 0 001.41-2.079 6.271 6.271 0 00.507-2.51c0-.889-.17-1.726-.508-2.51a6.583 6.583 0 00-1.41-2.076 6.682 6.682 0 00-2.081-1.41 6.26 6.26 0 00-2.514-.51c-.888 0-1.725.17-2.51.51a6.654 6.654 0 00-3.482 3.485 6.271 6.271 0 00-.508 2.511c0 .889.17 1.725.508 2.51a6.62 6.62 0 001.41 2.08c.6.6 1.293 1.07 2.078 1.409a6.271 6.271 0 002.51.507zm0-.92c-.762 0-1.48-.147-2.155-.441a5.732 5.732 0 01-1.781-1.21 5.687 5.687 0 01-1.206-1.78 5.37 5.37 0 01-.438-2.155c0-.762.146-1.479.438-2.152.209-.48.473-.92.794-1.32l.188-.222-.068.254a4.38 4.38 0 00-.127 1.04c0 .695.23 1.23.689 1.607.459.376 1.114.564 1.964.564.115 0 .196.04.245.121.048.08.041.171-.022.273a2.875 2.875 0 00-.311.584c-.055.157-.083.32-.083.489 0 .283.069.525.206.723.138.2.304.361.499.486a3.2 3.2 0 00.57.295l-.247.997c-.076.296-.039.53.111.704.15.174.348.26.594.26.245 0 .478-.114.698-.342l1.543-1.67c.258-.275.443-.524.555-.749.112-.224.168-.448.168-.672a1.11 1.11 0 00-.11-.426 3.165 3.165 0 00-.664-.958 1.378 1.378 0 00-.594-.337 3.345 3.345 0 00-.784-.076h-.342l-.35-.685.965-.362c.271.178.487.313.648.406.16.093.317.14.47.14.194 0 .347-.06.457-.178a.582.582 0 00.155-.435.742.742 0 00-.225-.485l-.99-1.048c-.064-.063-.096-.124-.096-.18 0-.058.028-.118.083-.182a4.83 4.83 0 00.431-.552c.144-.211.216-.442.216-.692a.813.813 0 00-.084-.357l-.045-.078.183.073c.675.292 1.27.695 1.784 1.21a5.709 5.709 0 011.21 1.78c.291.673.437 1.39.437 2.152a5.37 5.37 0 01-.438 2.155 5.687 5.687 0 01-1.206 1.78 5.732 5.732 0 01-1.78 1.21 5.336 5.336 0 01-2.155.44z"};class Fa extends os{constructor(){super(),this.numberOfTapsRequired=1,this.numberOfTouchesRequired=1,this._taps=0}touchesBegan(t){t.currentTarget===this.target&&("button"in t&&2===t.button&&!this.allowsRightMouseButton||(super.touchesBegan(t),this.numberOfTouches===this.numberOfTouchesRequired?(this._domEvents.push(t),this._startPoint=super.locationInElement(),this._startClientPoint=super.locationInClient(),this._rewindTimer(750)):this.enterFailedState()))}touchesMoved(t){let e;switch(this.preventDefault(t),this.currentMode){case os.Modes.Pointer:e="touch"===t.pointerType?40:2;break;case os.Modes.Touch:e=40;break;case os.Modes.Mouse:e=2}void 0!==e&&(!this._startPoint||this._startPoint.distanceToPoint(super.locationInElement())>e)&&this.enterFailedState()}touchesEnded(t){this._taps++,this._domEvents.push(t),this._taps===this.numberOfTapsRequired&&(this.preventDefault(t),this.enterRecognizedState(),this.reset()),this._rewindTimer(350)}reset(){this._taps=0,this._clearTimer(),this._domEvents=[]}locationInElement(t){const e=this._startPoint||new Re;return t?ki.fromPageToElement(t,e):e}locationInClient(){return this._startClientPoint||new Re}_clearTimer(){window.clearTimeout(this._timerId),delete this._timerId}_rewindTimer(t){this._clearTimer(),this._timerId=window.setTimeout(this._timerFired.bind(this),t)}_timerFired(){this.enterFailedState()}}const Ua=.75;function Wa(){return{start:new Re,end:new Re,dt:0}}function Ga(t){return t.dt<1?new Re:new Re((t.end.x-t.start.x)/t.dt*1e3,(t.end.y-t.start.y)/t.dt*1e3)}class Ba extends os{constructor(){super(),this.minimumNumberOfTouches=1,this.maximumNumberOfTouches=1e5,this.translationThreshold=10,this._traveledMinimumDistance=!1,this._previousVelocitySample=Wa(),this._velocitySample=Wa(),this.translation=new Re}get velocity(){if(void 0===this._lastTouchTime)return new Re;if(performance.now()-this._lastTouchTime>100)return new Re;const t=Ga(this._velocitySample);if(os.SupportsTouches&&this._previousVelocitySample.dt>0){const e=Ga(this._previousVelocitySample);t.x=.25*t.x+Ua*e.x,t.y=.25*t.y+Ua*e.y}return t}touchesBegan(t){t.currentTarget===this.target&&(t instanceof MouseEvent&&0!==t.button||(super.touchesBegan(t),this._numberOfTouchesIsAllowed()?(this._lastTouchTime=t.timeStamp,this._resetTrackedLocations(),1===this.numberOfTouches&&(this._traveledMinimumDistance=!1)):this.enterFailedState()))}touchesMoved(t){this.preventDefault(t);const e=t.timeStamp,i=this.locationInElement();if(void 0===this._lastTouchTime||void 0===this._lastTouchLocation||void 0===this._translationOrigin)return;const s=e-this._lastTouchTime;s>8&&(this._previousVelocitySample.start=this._velocitySample.start.copy(),this._previousVelocitySample.end=this._velocitySample.end.copy(),this._previousVelocitySample.dt=this._velocitySample.dt,this._velocitySample.start=this._lastTouchLocation.copy(),this._velocitySample.end=i,this._velocitySample.dt=s),this._traveledMinimumDistance?(this.translation.x+=i.x-this._lastTouchLocation.x,this.translation.y+=i.y-this._lastTouchLocation.y,this.enterChangedState()):this._canBeginWithTraveledDistance(new Re(i.x-this._translationOrigin.x,i.y-this._translationOrigin.y))&&(this._traveledMinimumDistance=!0,this.enterBeganState()),this._lastTouchTime=e,this._lastTouchLocation=i}touchesEnded(t){this._numberOfTouchesIsAllowed()?this._resetTrackedLocations():this._traveledMinimumDistance?this.enterEndedState():this.enterFailedState()}reset(){this._velocitySample=Wa(),this._previousVelocitySample=Wa(),this.translation=new Re,this._traveledMinimumDistance=!1}_canBeginWithTraveledDistance(t){return Math.abs(t.x)>=this.translationThreshold||Math.abs(t.y)>=this.translationThreshold}_numberOfTouchesIsAllowed(){return this.numberOfTouches>=this.minimumNumberOfTouches&&this.numberOfTouches<=this.maximumNumberOfTouches}_resetTrackedLocations(){const t=this.locationInElement();this._lastTouchLocation=t,this._translationOrigin=t}}function Za(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const ja="mk-rotation-control",Ka="mk-pressed",Ha="mk-heading",qa="mk-rotation-wrapper",Va="mk-rotation-sli
2der";class Ya extends fa{constructor(t){const e=Fs("div");super(e),Za(this,"_isDragging",void 0),Za(this,"_isDraggingPrevented",void 0),Za(this,"_slider",void 0),Za(this,"_sliderNode",void 0),Za(this,"_compassNode",void 0),Za(this,"_heading",void 0),Za(this,"_headingNode",void 0),Za(this,"_map",void 0),Za(this,"_rotation",void 0),Za(this,"_activeKeyRightAt",void 0),Za(this,"_activeKeyLeftAt",void 0),Za(this,"tintColor",""),Za(this,"_dprValue",void 0),Za(this,"_darkColorScheme",void 0),Za(this,"_tapRecognizer",void 0),Za(this,"_center",void 0),Za(this,"_angleOffset",void 0),Za(this,"_panRecognizer",void 0),Za(this,"_timeAtLastFrame",void 0),this.element=e,this._isDragging=!1,this._isDraggingPrevented=!1,this.classList.add(ja);const i=Fs("input",{class:Va,type:"range",min:0,max:360,value:0,"aria-label":Nn.get("Compass.Degrees.Plural",{n:"0"})});i.addEventListener("change",this),this._slider=i,this._sliderNode=new Ri(i),this.element.appendChild(i),this._compassNode=new Ri(Fs("div",{class:qa},Fs("img",{role:"presentation"}))),this.element.appendChild(this._compassNode.element);const s=Fs("div");if(this._heading=s,this._headingNode=new Ri(s),this._headingNode.classList.add(Ha),this.element.appendChild(s),Oe.state===Oe.States.UNINITIALIZED){const t=()=>{Oe.removeEventListener(Oe.Events.Initialized,t),Ja(this._compassNode.element.firstChild)};Oe.addEventListener(Oe.Events.Initialized,t)}else Ja(this._compassNode.element.firstChild);this._map=t,this._rotation=0,this._activeKeyRightAt=void 0,this._activeKeyLeftAt=void 0,this._updateLabels()}enable(){super.enable(),this._setupGestureRecognizers(),this._sliderNode.removeAttribute("aria-disabled"),this._sliderNode.setAttribute("tabindex","0")}disable(){super.disable(),this._sliderNode.setAttribute("aria-disabled","true"),this._sliderNode.setAttribute("tabindex","-1")}set rotation(t){t===this._rotation||360===this._rotation&&0===t||(this._rotation=t,this._updateHeading(),this._updateSlider(),this._rotateTo(t))}localeChanged(){this._updateLabels()}mapWasDestroyed(){delete this._map}updateTintColor(t){this.tintColor!==t&&(this.tintColor=t,this._heading.style.color=t)}updateImage(t,e){this._dprValue===t&&this._darkColorScheme===e||(this._dprValue=t,this._darkColorScheme=e,Oe.state!==Oe.States.UNINITIALIZED&&Ja(this._compassNode.element))}touchesEnded(t){this.saveEndEventProps(t)}clicked(t){this.checkClickEventProps(t)||this.reset(t)}reset(t){const e=t&&(t.target===this._tapRecognizer||"click"===t.type||"keyCode"in t&&(t.keyCode===_||t.keyCode===m));this._map&&this._center&&!e&&this._isDragging&&(this._map.mapDidStopRotating(),this._map.compassRotationDidEnd()),this.classList.remove(Ka),e&&this._map.setRotationAnimated(0,!0),this._isDragging=!1,this._isDraggingPrevented=!1,delete this._angleOffset}spaceBarKeyDown(t){this.reset(t)}upArrowKeyUp(t){this.reset(t)}rightArrowKeyDown(t){this._beginKeyboardRotate(t)}rightArrowKeyUp(t){this._endKeyboardRotate(t)}leftArrowKeyDown(t){this._beginKeyboardRotate(t)}leftArrowKeyUp(t){this._endKeyboardRotate(t)}performScheduledUpdate(){if(!this._activeKeyRightAt&&!this._activeKeyLeftAt)return!1;this._keyboardRotate(),si(this)}handleEvent(t){switch(t.target){case this._tapRecognizer:t.target.state===ds.Recognized&&this.reset(t);break;case this._panRecognizer:t.target.state===ds.Possible?this._beginDrag(t):t.target.state===ds.Changed?this._drag(t):t.target.state!==ds.Recognized&&t.target.state!==ds.Failed||this.reset(t);break;case this._slider:this._handleSliderChange(t)}}fadeIn(){this.element.style.opacity="1"}fadeOut(){this.element.style.opacity="0"}_updateHeading(){const t=360-this._rotation,e=Math.round(t/360*4)%4;this._heading.textContent=Nn.get("Compass."+["NorthIndicator","EastIndicator","SouthIndicator","WestIndicator"][e])}_updateLabels(){this._updateHeading(),Vs(this.element,Nn.get("Compass.Tooltip"))}_rotateTo(t){this._compassNode.transform="rotate("+t+"deg)"}_setupGestureRecognizers(){const t=new Fa;t.numberOfTapsRequired=1,t.addEventListener("statechange",this),t.target=this.element,this._tapRecognizer=t;const e=new Ba;e.addEventListener("statechange",this),e.target=this.element,this._panRecognizer=e}removeEventListeners(){this._tapRecognizer.removeEventListener("statechange",this),this._tapRecognizer.enabled=!1,this._tapRecognizer.target=null,this._panRecognizer.removeEventListener("statechange",this),this._panRecognizer.enabled=!1,this._panRecognizer.target=null,this._slider.removeEventListener("change",this)}_beginDrag(t){this.classList.add(Ka);const e=this.element.getBoundingClientRect();this._center={x:e.right-e.width/2,y:e.bottom-e.height/2};const i=Xa(t.target.locationInClient().x,t.target.locationInClient().y,this._center.x,this._center.y);this._angleOffset=i-this._map.rotation}_drag(t){if(!this._center||void 0===this._angleOffset||isNaN(this._angleOffset))return;if(this._isDraggingPrevented)return;if(!this._isDragging){if(!this._map.mapCanStartRotating())return void(this._isDraggingPrevented=!0);this._isDragging=!0}this._map.compassRotationWillStart(!0);let e=Xa(t.target.locationInClient().x,t.target.locationInClient().y,this._center.x,this._center.y)-this._angleOffset;e=this._map.compassRotate(e,!0),this._rotateTo(e)}_beginKeyboardRotate(t){const e=this._activeKeyRightAt&&t.keyCode===f,i=this._activeKeyLeftAt&&t.keyCode===g;if(e||i)return;const s=Date.now();t.keyCode===f?this._activeKeyRightAt=s:this._activeKeyLeftAt=s,this._map.mapCanStartRotating()&&(this._timeAtLastFrame=s,ii(this),this._map.compassRotationWillStart(!1))}
2_keyboardRotate(){const t=Math.max(this._activeKeyRightAt||0,this._activeKeyLeftAt||0);if(!t||!this._timeAtLastFrame)return;const e=Date.now();let i=this._rotation;const s=e-this._timeAtLastFrame;i+=4*(t===this._activeKeyLeftAt?-1:1)*(60*s)/1e3,this._map.compassRotate(i,!1),this._timeAtLastFrame=Date.now()}_endKeyboardRotate(t){t.keyCode===f?this._activeKeyRightAt=void 0:this._activeKeyLeftAt=void 0,this._activeKeyRightAt||this._activeKeyLeftAt||(this._timeAtLastFrame=void 0),this._map.mapDidStopRotating(),this._map.compassRotationDidEnd()}_handleSliderChange(t){const e=parseInt(t.target.value);if(e===this._rotation)return;let i=e;0===e?i=360:360===e&&(i=0),this.rotation=i,this._map.setRotationAnimated(i,!1,!0)}_updateSlider(){const t=Math.round(this._rotation);this._slider.value=t.toString();const e=Nn.get(1===t?"Compass.Degrees.Single":"Compass.Degrees.Plural",{n:t.toString()});this._sliderNode.setAttribute("aria-label",e)}}function Xa(t,e,i,s){let o;const n=e-s,a=t-i;return o=t>i?e<s?90+$a(Math.atan(n/a)):180-$a(Math.atan(a/n)):e<s?360-$a(Math.atan(a/n)):0!==a?270+$a(Math.atan(n/a)):180,o}function $a(t){return 180*t/Math.PI}function Ja(t){const e=Do.createImageUrl("icons/compass-sheet.svg");t.crossOrigin=ra(Oe.urlWithCredentials(e)),t.src=e}function Qa(t,e){const i=t;return i._targetOpacity=null,i._startOpacity=null,i._startTime=null,i._totalDurationMs=e||300,i.setOpacityAnimated=tr,i.performScheduledUpdate=er,i}function tr(t,e){if(!e)return this._targetOpacity=t,void(this.opacity=t);t!==this._targetOpacity&&(t!==this.opacity?(this._targetOpacity=t,this._startTime=null,this._startOpacity=this._opacity,si(this)):this._targetOpacity=t)}function er(t){null==this._startTime&&(this._startTime=t??null);const e=this.constructor.prototype.performScheduledUpdate;if("function"==typeof e&&e.call(this,t),null===this._targetOpacity)return;if(null==t&&(this.opacity=this._targetOpacity),this._targetOpacity===this.opacity)return this._startTime=null,this._startOpacity=null,void(this._targetOpacity=null);const i=t-this._startTime,s=this._targetOpacity-this._startOpacity,o=Math.abs(s*this._totalDurationMs),n=Ys(Math.min(i/o,1))*s+this._startOpacity;this.opacity=w(n,0,1),si(this)}const ir=Object.freeze({GlobalFadeDuration:700,InnerTransitionDuration:200,MinimumNumberOfSegments:2,MaximumNumberOfSegments:5,MagicNumbers:[1.25,2.5,5],FirstMagicExponent:-3,LastMagicExponent:7,MaximumNumberOfDisplayedSegments:3,SegmentThickness:3,LegendHorizontalMargin:6,LegendMarginBottom:8,LegendSpacing:1,OutlineWidth:1,LightSegmentColorRegular:"rgba(255, 255, 255, 0.7)",DarkSegmentColorRegular:"rgba(0, 0, 0, 0.73)",OutlineColorRegular:"rgba(255, 255, 255, 0.5)",LightSegmentColorSatellite:"rgba(255, 255, 255, 0.8)",DarkSegmentColorSatellite:"rgba(178, 178, 178, 0.8)",OutlineColorSatellite:"rgba(0, 0, 0, 1)",SegmentInnerStrokeColor:"rgba(0, 0, 0, 0.2)",SegmentInnerStrokeWidth:.5,LegendFontSize:9,LegendFontFamily:"'-apple-system-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'",LegendColorRegular:"rgba(72, 69, 65, 1)",LegendOuterStrokeColorRegular:"rgba(255, 255, 255, 0.5)",LegendColorSatellite:"rgba(255, 255, 255, 1)",LegendOuterStrokeColorSatellite:"rgba(0, 0, 0, 1)",LegendOuterStrokeWidth:1,MetersThreshold:500,FeetThreshold:.25,MilesToMeters:1609.344,MetersToMiles:1/1609.344,MilesToFeet:5280});class sr extends lo{measureTextOverflow(t,e){const i=this._node;if(!i.legend)return 0;const s=ir.LegendFontSize*this.node.fontSizeRatio;t.font=`${s}px ${ir.LegendFontFamily}`;const o=e?i.legend.labels[0]:i.legend.labels[i.numberOfSegments],n=t.measureText(o).width/2;let a;return a=e?0:t.measureText(" "+i.legend.unit).width,n+a}draw(t){const e=this._node;if(!e.legend)return;const i=ir.LegendFontSize*this.node.fontSizeRatio;t.font=`${i}px ${ir.LegendFontFamily}`,t.textAlign="center",t.textBaseline="bottom",t.lineWidth=ir.LegendOuterStrokeWidth,t.fillStyle=e.fillColor,t.strokeStyle=e.strokeColor;const s=e.size.height-ir.LegendMarginBottom-ir.LegendSpacing;let o=e.segmentStart;for(let i=0;i<=e.numberOfSegments;i++){const n=e.legend.labels[i];t.strokeText(n,o,s),t.fillText(n,o,s),this.node.leftAligned?i===e.numberOfSegments?o+=t.measureText(n).width/2:o+=e.segmentWidth:i===e.numberOfSegments?o-=t.measureText(n).width/2:o-=e.segmentWidth}const n=" "+e.legend.unit;t.textAlign=this.node.leftAligned?"left":"right",t.strokeText(n,o,s),t.fillText(n,o,s)}}function or(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class nr extends ts{constructor(...t){super(...t),or(this,"fontSizeRatio",1),or(this,"_legend",null),or(this,"_segmentWidth",0),or(this,"_segmentStart",0),or(this,"_numberOfSegments",0),or(this,"_fillColor",null),or(this,"_strokeColor",null),or(this,"_renderer",new sr(this)),or(this,"_leftAligned",void 0)}get leftAligned(){return this._leftAligned}set leftAligned(t){this._leftAligned=t,this.needsDisplay=!0}get legend(){return this._legend}set legend(t){this._legend=t,this.needsDisplay=!0}get segmentStart(){return this._segmentStart}set segmentStart(t){this._segmentStart=t,this.needsDisplay=!0}get segmentWidth(){return this._segmentWidth}set segmentWidth(t){this._segmentWidth=t,this.needsDisplay=!0}get numberOfSegments(){return this._numberOfSegments}set numberOfSegments(t){this._numberOfSegments=t,this.needsDisplay=!0}get fillColor(){return this._fillColor}set fillColor(t){this._fillColor=t,this.needsDisplay=!0}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t,this.needsDisplay=!0}stringInfo(){const t="~"+this.fillColor+"/"+this.strokeColor+"~ ",e=this.leftAligned?"":", rtl";if(!this._legend)return"LegendNode "+t;return"LegendNode<labels:["+this._legend.labels.slice(0,this.numberOfSegments+1).join(", ")+"], unit:"+this._legend.unit+e+")> "+t}measureTextOverflow(t,e=!1){return this._renderer.measureTextOverflow(t,e)}}
2class ar extends lo{draw(t){const e=this._node,i=e.fillColor,s=e.strokeColor,o=e.lineWidth;i&&(t.fillStyle=i,t.fillRect(0,0,e.size.width,e.size.height));s&&o&&(o>=1||zs()>1)&&(t.lineWidth=o,t.strokeStyle=s,e.innerStroke?t.strokeRect(o/2,o/2,e.size.width-o,e.size.height-o):t.strokeRect(-o/2,-o/2,e.size.width+o,e.size.height+o))}}function rr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class lr extends ts{constructor(...t){super(...t),rr(this,"_fillColor",null),rr(this,"_strokeColor",null),rr(this,"_lineWidth",null),rr(this,"_innerStroke",!1),rr(this,"_renderer",new ar(this))}get fillColor(){return this._fillColor}set fillColor(t){this._fillColor=t,this.needsDisplay=!0}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t,this.needsDisplay=!0}get innerStroke(){return this._innerStroke}set innerStroke(t){this._innerStroke=t,this.needsDisplay=!0}get lineWidth(){return this._lineWidth}set lineWidth(t){this._lineWidth=t,this.needsDisplay=!0}stringInfo(){return"RectNode"}}function hr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class dr extends lr{constructor(){super(),hr(this,"setOpacityAnimated",(()=>{})),hr(this,"performScheduledUpdate",(()=>{})),Qa(this,ir.InnerTransitionDuration),this.lineWidth=ir.OutlineWidth}stringInfo(){return"OutlineNode "+("~"+this.strokeColor+"~ ")}}function cr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ur extends lr{constructor(){super(),cr(this,"setOpacityAnimated",(()=>{})),cr(this,"performScheduledUpdate",(()=>{})),Qa(this,ir.InnerTransitionDuration),this.lineWidth=ir.SegmentInnerStrokeWidth,this.innerStroke=!0}stringInfo(){return"SegmentNode "+("~"+this.fillColor+"~ ")}}var pr;function mr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class gr extends uo{constructor(){super(),mr(this,"_needsLayout",!1),mr(this,"_distance",0),mr(this,"_mapWidth",0),mr(this,"_theme",gr.Themes.light),mr(this,"_leftAligned",!1),mr(this,"_l10n",null),mr(this,"_legendNode",this.addChild(new nr)),mr(this,"_segmentWidth",0),mr(this,"_oldNumberOfSegments",0),mr(this,"_legend",{labels:[],unit:""}),mr(this,"_outlineNodes",[new dr,new dr]),mr(this,"_activeOutlineNode",this._outlineNodes[0]),mr(this,"_segmentNodes",[new ur,new ur,new ur]),mr(this,"_useMetric",!1),mr(this,"setOpacityAnimated",(()=>{}));for(const t of this._outlineNodes)this.addChild(t);this.addChild(this._outlineNodes[1]),this._outlineNodes[1].opacity=0;for(const t of this._segmentNodes)this.addChild(t);this._updateColors(),Qa(this,ir.GlobalFadeDuration)}get layerBounds(){return new ze(0,0,this.size.width,Math.max(this.size.height,48))}get fontSizeRatio(){return this._legendNode.fontSizeRatio}set fontSizeRatio(t){this._legendNode.fontSizeRatio=t,this._computeSegments()}get distance(){return this._distance}set distance(t){Math.abs(t-this._distance)/this._distance<.01||(this._distance=t,this._computeSegments())}get mapWidth(){return this._mapWidth}set mapWidth(t){t!==this._mapWidth&&(this._mapWidth=t,this._computeSegments())}get theme(){return this._theme}set theme(t){this._theme=t,this._updateColors()}get l10n(){return this._l10n}set l10n(t){this._l10n&&this._l10n.removeEventListener(this._l10n.Events.LocaleChanged,this),this._l10n=t,t&&t.addEventListener(t.Events.LocaleChanged,this)}get useMetric(){return this._useMetric}set useMetric(t){this._useMetric!==t&&(this._useMetric=t,this._computeSegments())}get leftAligned(){return this._leftAligned}set leftAligned(t){this._leftAligned=t,this.needsLayout=!0}stringInfo(){return"ScaleNode<distance:"+Math.round(100*this.distance)/100+"m>"}get needsLayout(){return this._needsLayout}set needsLayout(t){this._needsLayout!==t&&(this._needsLayout=t,t&&ii(this))}performScheduledUpdate(){this.needsLayout&&this.parent&&(this.layoutSubNodes(),this.needsLayout=!1)}layoutSubNodes(){const t=this._computeSegmentsRects();for(let e=0;
2e<ir.MaximumNumberOfDisplayedSegments;e++){const i=t[e],s=this._segmentNodes[e];i?(s.position=i.origin,s.size=i.size,s.setOpacityAnimated(1,!0)):s.setOpacityAnimated(0,!0)}const e=ze.unionOfRects(t).round();if(t.length!==this._oldNumberOfSegments){this._activeOutlineNode.setOpacityAnimated(0,!0);const t=0===this._outlineNodes.indexOf(this._activeOutlineNode)?1:0;this._activeOutlineNode=this._outlineNodes[t],this._activeOutlineNode.setOpacityAnimated(1,!0)}this._activeOutlineNode.position=e.origin,this._activeOutlineNode.size=e.size;const i=t[0];this._legendNode.segmentStart=this.leftAligned?i.origin.x:i.origin.x+i.size.width,this._legendNode.leftAligned=this.leftAligned,this._legendNode.segmentWidth=i.size.width,this._legendNode.size=this.size.copy(),this._oldNumberOfSegments=t.length}handleEvent(){this._computeSegments()}_updateColors(){const t=this.theme===gr.Themes.dark;this._legendNode.fillColor=t?ir.LegendColorSatellite:ir.LegendColorRegular,this._legendNode.strokeColor=t?ir.LegendOuterStrokeColorSatellite:ir.LegendOuterStrokeColorRegular;const e=t?[ir.LightSegmentColorSatellite,ir.DarkSegmentColorSatellite]:[ir.DarkSegmentColorRegular,ir.LightSegmentColorRegular];this._segmentNodes.forEach(((i,s)=>{const o=e[s%2];i.fillColor=o,i.strokeColor=t?null:ir.SegmentInnerStrokeColor}),this);const i=t?ir.OutlineColorSatellite:ir.OutlineColorRegular;this._outlineNodes.forEach((t=>{t.strokeColor=i}))}_computeSegments(){if(0===this.size.width||0===this.mapWidth||!this._l10n)return;const t=this.size.width,e=this.mapWidth;let i=this.distance*t/e;const s=!this._useMetric;let o=!1,n=1,a=0;function r(t,e){return a=t*Math.pow(10,e),n=i/a,n>=ir.MinimumNumberOfSegments&&n<ir.MaximumNumberOfSegments}s&&(i*=ir.MetersToMiles,i<ir.FeetThreshold&&(o=!0,i*=ir.MilesToFeet));let l=!1;for(let t=ir.FirstMagicExponent;!l&&t<ir.LastMagicExponent;t++)l=ir.MagicNumbers.some((e=>r(e,t)));this._segmentWidth=n?t/n:0;const h=a;s&&(o&&(a/=ir.MilesToFeet),a*=ir.MilesToMeters),this._computeLegend(a,h,o)}_computeLegend(t,e,i){let s=0;const o=this._l10n;this._useMetric?t>ir.MetersThreshold?(this._legend.unit=o.get("Scale.Kilometer.Short"),s=t/1e3):(this._legend.unit=o.get("Scale.Meter.Short"),s=t):(this._legend.unit=i?o.get("Scale.Feet.Short"):o.get("Scale.Mile.Short"),s=e);const n=[];let a;"object"==typeof Intl&&Intl&&Intl.NumberFormat&&(a=new Intl.NumberFormat(o.activeLocale.localeId));for(let t=0;t<ir.MaximumNumberOfSegments;t++){const e=t*s,i=a?a.format(e):e.toString();n.push(i)}this._legend.labels=n,this._legendNode.legend=this._legend,this.needsLayout=!0}_computeSegmentsRects(){const t=this.scene.contextForMeasurement;let e=0,i=this.leftAligned?ir.LegendHorizontalMargin+this._legendNode.measureTextOverflow(t,!0):this.size.width-ir.LegendHorizontalMargin-this._legendNode.measureTextOverflow(t,!0);const s=this.size.height-ir.LegendMarginBottom+ir.LegendSpacing,o=this._segmentWidth,n=[];for(let a=0;a<ir.MaximumNumberOfDisplayedSegments;a++){const a=new ze(this.leftAligned?i:i-o,s,o,ir.SegmentThickness).round();n.push(a),i=this.leftAligned?a.origin.x+a.size.width:a.origin.x,this._legendNode.numberOfSegments=n.length,e=this._legendNode.measureTextOverflow(t);const r=o+e+ir.LegendHorizontalMargin;if(this.leftAligned&&i+r>this.size.width)break;if(!this.leftAligned&&i-r<0)break}return 0===this._oldNumberOfSegments&&(this._oldNumberOfSegments=n.length),n}}pr=gr,mr(gr,"Themes",rt({light:"Light",dark:"Dark"})),mr(gr,"ScaleNode",pr);const _r=gr.Themes;function fr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const yr=new at(170,20),vr="mk-scale";class br extends Ri{constructor(t){const e=new bo;super(e.element),fr(this,"scene",void 0),fr(this,"_map",void 0),fr(this,"node",void 0),this.scene=e,this._map=t;const i=yr.copy();i.height=this._getHeight(),this.scene.size=i,this.node=this.scene.addChild(new gr),this.node.size=i,this.node.position=new Pe(0,0),this.node.opacity=0,this.node.l10n=Nn,this.node.fontSizeRatio=t.fontSizeRatio,this.node.useMetric=t.useMetric,Nn.addEventListener(Nn.Events.LocaleChanged,this),this.classList.add(vr),this.element.setAttribute("aria-hidden","true"),this.size=yr}get shouldDisplayScale(){return this._map._showsScale===yt.Visible||this._map._showsScale===yt.Adaptive&&this._map.cameraIsZooming}updateTheme(t){this.node.theme=_r[t]}update(){const t=this._map;if(!this.node||!this.shouldDisplayScale)return;const e=t.renderingMapRect.origin.toCoordinate().latitude,i=t.renderingMapRect.size.width/H(e);if(i/t._visibleFrame.size.width*zs()>=7500)return void this.hideIfNeeded(!0);const s=this._getHeight();if(s!==this.node.size.height){const t=yr.copy();t.height=s,this.scene.size=t,this.node.size=t}this.node.fontSizeRatio=t.fontSizeRatio,this.node.distance=i,this.node.useMetric=this._map.useMetric,this.node.setOpacityAnimated(1,!1)}hideIfNeeded(t){!this.node||this.shouldDisplayScale&&!t||this.node.setOpacityAnimated(0,!0)}handleEvent(t){this.node.useMetric=this._map.useMetric}mapWasDestroyed(){this.node.l10n=null,this.node.remove(),this.scene.destroy(),Nn.removeEventListener(Nn.Events.LocaleChanged,this)}_getHeight(){const t=ir.LegendFontSize*this._map.fontSizeRatio;return yr.height-ir.LegendFontSize+t}}function wr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Cr extends Ma{constructor(){super(),wr(this,"_errorMessageElement",Fs("div",{class:kr.E
2RROR})),wr(this,"_errorMessageNode",new Ri(this._errorMessageElement)),wr(this,"_errorText",Fs("span",{class:kr.ERROR_TEXT})),wr(this,"_supportLink",Fs("a",{class:kr.ERROR_SUPPORT,target:"_blank"})),this.classList.add(kr.POP_OVER),this._errorMessageElement.appendChild(this._errorText),this._errorMessageElement.appendChild(this._supportLink),this.update(),this.addChild(this._errorMessageNode)}get errorMessageElement(){return this._errorMessageElement}update(){this._errorText.textContent=Nn.get("Location.Error.Message")+" ",this._supportLink.textContent=Nn.get("Location.Error.Support.Label"),ys()?this._supportLink.href="https://support.apple.com/HT203033":this._supportLink.href="https://support.apple.com/guide/mac-help/allow-apps-to-detect-the-location-of-your-mac-mh35873/mac"}}const kr={POP_OVER:"mk-user-location-error-popover",ERROR:"mk-error-message",ERROR_TEXT:"mk-error-text",ERROR_SUPPORT:"mk-error-support"};function Sr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Lr={CONTROL:"mk-user-location-control",WRAPPER:"mk-user-location-control-wrapper",PRESSED:"mk-pressed",TRACKING:"mk-tracking",WAITING:"mk-waiting",DISABLED:"mk-disabled",WAITING_ICON:"mk-icon-waiting",ARROW_ICON:"mk-icon-arrow",SCALED_OUT:"mk-scaled-out"},Mr=rt({Default:"default",Waiting:"waiting",Tracking:"tracking",Disabled:"disabled"});class Ar extends fa{constructor(t,e,i){super(Fs("div",{class:Lr.CONTROL,role:"button",tabindex:"0"})),Sr(this,"_state",void 0),Sr(this,"_tintColor",void 0),Sr(this,"_wrapper",void 0),Sr(this,"_arrowIconNode",void 0),Sr(this,"_waitingIconNode",void 0),Sr(this,"_errorPopover",void 0),Sr(this,"_waitingIconBlades",void 0),Sr(this,"_map",void 0),Sr(this,"_rtl",void 0),Sr(this,"_focusDelegate",void 0),this._state=Ar.States.Default,this._tintColor="",this._wrapper=Fs("div",{class:Lr.WRAPPER}),this.element.appendChild(this._wrapper),this._arrowIconNode=new Ri(Ks(Us("path"),{class:Lr.ARROW_ICON,viewBox:xr})),this._waitingIconNode=new Ri(function(){const t=[];for(let e=0;e<Or;++e)t.push(Us("rect",{x:Dr,y:Nr,width:Pr,height:Rr,rx:zr,transform:"rotate("+45*e+")"}));return Ks(Us("g",{transform:"scale("+Ir+", "+-Ir+")"},...t),{class:[Lr.WAITING_ICON,Lr.SCALED_OUT].join(" "),viewBox:Er})}()),this._wrapper.appendChild(this._arrowIconNode.element),this._wrapper.appendChild(this._waitingIconNode.element),this._errorPopover=new Cr,this._updateLabels(),this._updateArrowIcon();const s=this._waitingIconNode.element.querySelectorAll("rect");this._waitingIconBlades=s,this._map=t,this._rtl=e,this._focusDelegate=i}get state(){return this._state}set state(t){this._state!==t&&(this._state=t,this.classList.toggle(Lr.TRACKING,this.isTrackingState()),this.classList.toggle(Lr.WAITING,this.isWaitingState()),this.classList.toggle(Lr.DISABLED,this.isDisabledState()),this.updateTintColor(this._tintColor),this.isWaitingState()?this._animateArrowIconOut():this._animateWaitingIconOut())}isDefaultState(){return this.state===Ar.States.Default}toDefaultState(){this.state=Ar.States.Default,this._updateArrowIcon(),this._closeErrorPopover()}isTrackingState(){return this.state===Ar.States.Tracking}toTrackingState(){this.state=Ar.States.Tracking,this._updateArrowIcon(),this._closeErrorPopover()}isWaitingState(){return this.state===Ar.States.Waiting}toWaitingState(){this.state=Ar.States.Waiting}isDisabledState(){return this.state===Ar.States.Disabled}toDisabledState(){this._map.tracksUserLocation&&this._map.userLocationAnnotation||(this.state=Ar.States.Disabled,this._updateArrowIcon(),this._openErrorPopover())}handleEvent(t){switch(t.type){case Ts():{const e=Ws(this.element,t);this._errorPopover.errorMessageElement.contains(e)||(this._closeErrorPopover(),window.removeEventListener(Ts(),this,!0));break}case"keydown":27===t.keyCode&&this._closeErrorPopover();break;case"blur":this._errorPopover.element.contains(t.relatedTarget)||this._closeErrorPopover()}}touchesBegan(){this._pressed()}touchesEnded(){this.reset()}clicked(){this.dispatchEvent(new n.Event(Ar.EVENTS.PRESSED))}touchesCanceled(){this.reset()}spaceBarKeyDown(){this._pressed()}spaceBarKeyUp(){this.reset(),this.dispatchEvent(new n.Event(Ar.EVENTS.PRESSED))}updateTintColor(t){this._tintColor=t;this._arrowIconNode.element.querySelector("g").style.fill=this.isTrackingState()?"":t;this._waitingIconNode.element.querySelector("g").style.fill=t,this.element.style.backgroundColor=this.isTrackingState()?t:""}reset(){this.classList.contains(Lr.PRESSED)&&(this.classList.remove(Lr.PRESSED),this._focusDelegate.controlWasReleased(this),this.isDefaultState()||this.isDisabledState()?this.toWaitingState():this.toDefaultState()),window.removeEventListener(Os(),this),bs()?window.removeEventListener("pointercancel",this):ys()&&window.removeEventListener("touchcancel",this)}localeChanged(t){this._updateLabels(),this._rtl=t.locale.rtl,this._errorPopover.update(
2)}mapWasDestroyed(){delete this._map}focused(){this._focusDelegate.controlDidGetFocus(this)}blurred(){this._focusDelegate.controlDidLoseFocus(this)}didMoveToParent(t){t?this.parent.insertAfter(this._errorPopover,this):(this._closeErrorPopover(),this._errorPopover.remove())}_updateLabels(){Vs(this.element,Nn.get("Track.User.Location.Tooltip"))}_pressed(){this.classList.add(Lr.PRESSED),this._focusDelegate.controlWasPressed(this)}_animateArrowIconOut(){this._arrowIconNode.classList.add(Lr.SCALED_OUT),this._waitingIconNode.classList.remove(Lr.SCALED_OUT)}_animateWaitingIconOut(){this._waitingIconNode.classList.add(Lr.SCALED_OUT),this._arrowIconNode.classList.remove(Lr.SCALED_OUT)}_openErrorPopover(){this._errorPopover.open(),window.addEventListener(Ts(),this,!0),window.addEventListener("keydown",this,!0),this._errorPopover.element.addEventListener("blur",this,!0)}_closeErrorPopover(){this._errorPopover.close(),window.removeEventListener(Ts(),this,!0),window.removeEventListener("keydown",this,!0),this._errorPopover.element.removeEventListener("blur",this,!0)}_updateArrowIcon(){this._arrowIconNode.element.querySelector("path").setAttribute("d",Tr[this.state])}}Sr(Ar,"States",Mr),Sr(Ar,"EVENTS",{PRESSED:"pressed"});const Tr={default:"M24.675 17.91L29.48 7.512c.514-1.11-.349-1.847-1.409-1.358l-10.448 4.818c-.971.444-.768 1.802.342 1.809l4.723.019c.095 0 .127.038.127.133l.013 4.691c0 1.092 1.365 1.34 1.847.286zm-.711-1.448l.025-4.272c0-.387-.184-.577-.584-.577l-4.272.025c-.05 0-.07-.057-.012-.089l8.95-4.094c.076-.032.12.013.082.089l-4.1 8.925c-.025.063-.089.05-.089-.007z",disabled:"M27.112 12.641l2.368-5.129c.514-1.11-.349-1.847-1.409-1.358l-5.097 2.348.882.883 4.215-1.93c.076-.032.12.013.082.089l-1.93 4.208.89.89zm2.4 4.196a.51.51 0 000-.717l-9.934-9.934a.517.517 0 00-.724 0 .522.522 0 000 .717l9.947 9.934c.197.197.52.197.71 0zm-4.837 1.073l1.301-2.812-.882-.883-1.041 2.254c-.025.063-.089.05-.089-.007l.02-3.351-1.493-1.492-3.358.02c-.05 0-.07-.058-.012-.09l2.266-1.034-.876-.876-2.888 1.333c-.971.444-.768 1.802.342 1.809l4.723.019c.095 0 .127.038.127.133l.013 4.691c0 1.092 1.365 1.34 1.847.286z",tracking:"M24.675 17.91L29.48 7.512c.514-1.11-.349-1.847-1.409-1.358l-10.448 4.818c-.971.444-.768 1.802.342 1.809l4.723.019c.095 0 .127.038.127.133l.013 4.691c0 1.092 1.365 1.34 1.847.286z"},xr="0 0 45 24",Er="-22.5 -12 45 24",Ir=2/3,Or=8,Pr=2.5,Rr=6,zr=1.25,Dr=-Pr/2,Nr=5;function Fr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Ur="mk-zoom-controls",Wr="mk-divider",Gr="mk-zoom-in",Br="mk-zoom-out",Zr="mk-pressed",jr="mk-pill-pressed",Kr="mk-disabled";class Hr extends fa{constructor(){const t=Fs("div");super(t),Fr(this,"_zoomInEnabled",void 0),Fr(this,"_zoomOutEnabled",void 0),Fr(this,"_zoomInButton",void 0),Fr(this,"_zoomInButtonNode",void 0),Fr(this,"_zoomOutButton",void 0),Fr(this,"_zoomOutButtonNode",void 0),Fr(this,"tintColor",""),this.classList.add(Ur),this._zoomInEnabled=!0,this._zoomOutEnabled=!0,this._zoomInButton=Fs("div",{role:"button",tabindex:"0"}),this._zoomInButtonNode=new Ri(this._zoomInButton),this._zoomInButtonNode.classList.add(Gr),this._zoomInButton.appendChild(function(){const t=Ks(Us("path",{d:"M11.813 17.404c.4 0 .724-.33.724-.705v-3.974h3.872a.726.726 0 00.717-.723.73.73 0 00-.717-.724h-3.872V7.305a.72.72 0 00-.724-.705.724.724 0 00-.724.705v3.973H7.217a.739.739 0 00-.717.724c0 .4.343.723.717.723h3.872V16.7c0 .375.33.705.724.705z"}),{width:"100%",height:"100%"});return t.setAttribute("viewBox","0 0 24 24"),t}()),t.appendChild(this._zoomInButton),t.appendChild(Fs("div",{class:Wr})),this._zoomOutButton=Fs("div",{role:"button",tabindex:"0"}),this._zoomOutButtonNode=new Ri(this._zoomOutButton),this._zoomOutButtonNode.classList.add(Br),this._zoomOutButton.appendChild(function(){const t=Ks(Us("path",{d:"M16.325 12.75c.364 0 .675-.336.675-.75 0-.408-.31-.75-.675-.75h-8.65c-.352 0-.675.342-.675.75 0 .414.323.75.675.75h8.65z"}),{width:"100%",height:"100%"});return t.setAttribute("viewBox","0 0 24 24"),t}()),t.appendChild(this._zoomOutButton),this._updateLabels()}get zoomInEnabled(){return this._zoomInEnabled}set zoomInEnabled(t){this._enabled&&t===this._zoomInEnabled||(this._zoomInEnabled=this._enabled&&t,Vr(this._zoomInButtonNode,this._zoomInEnabled))}get zoomOutEnabled(){return this._zoomOutEnabled}set zoomOutEnabled(t){this._enabled&&t===this._zoomOutEnabled||(this._zoomOutEnabled=this._enabled&&t,Vr(this._zoomOutButtonNode,this._zoomOutEnabled))}localeChanged(){this._updateLabels()}touchesBegan(t){this._pressed(t)}touchesEnded(t){this.saveEndEventProps(t),this.reset()}clicked(t){this.checkClickEventProps(t)||(this._pressed(t),this.reset())}touchesCanceled(){this.reset()}focused(t){this.updateTintColor(this.tintColor),t.target.style.fill=_s}blurred(){this.updateTintColor(this.tintColor)}spaceBarKeyDown(t){this._pressed(t)}spaceBarKeyUp(){this.reset()}updateTintColor(t){this.tintColor=t,this._zoomInButton.firstChild.style.fill=t,this._zoomOutButton.firstChild.style.fill=t}reset(){let t;if(this._zoomInButtonNode.classList.contains(Zr)?t=this._zoomInButtonNode:this._zoomOutButtonNode.classList.contains(Zr)&&(t=this._zoomOutButtonNode),t){t.classList.remove(Zr),this.classList.remove(jr);const e=new n.Event(Hr.EVENTS.ZOOM_END);this.dispatchEvent(e)}}_clearLabels(){Vs(this._zoomInButtonNode,""),Vs(this._zoomOutButtonNode,"")}_updateLabels(){Vs(this._zoomInButtonNode,Nn.get("Zoom.In.Tooltip")),Vs(this._zoomOutButtonNode,Nn.get("Zoom.Out.Tooltip"))}_pressed(t){const e=this._findButtonNodeFromButtonDOMElement(Zs(t.target));if(!e||e.classList.contains(Kr))return;if(this.hasFocus){const t=Gs(this.element),i="activeElement"in t?t.activeElement:null;i!==e.element&&i.blur()}e.classList.add(Zr),this.classList.add(jr);const i=new qr(Hr.EVENTS.ZOOM_START);i.zoomIn=e===this._zoomInButtonNode,this.dispatchEvent(i)}_findButtonNodeFromButtonDOMElement(t){return t===this._zoomOutButton?this._zoomOutButtonNode:t===this._zoomInButton?this._zoomInButtonNode:null}}Fr(Hr,"EVENTS",{ZOOM_START:"zoom-start",ZOOM_END:"zoom-end"});class qr extends n.Event{constructor(...t){super(...t),Fr(this,"zoomIn",!1)}}function Vr(t,e){e?(t.classList.remove(Kr),t.removeAttribute("aria-disabled"),t.setAttribute("tabindex","0")):(t.classList.add(Kr),t.setAttribute("aria-disabled","true"),t.setAttribute("tabindex","-1"))}function Yr(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}
2const Xr="mk-rtl",$r="mk-autonavi",Jr="mk-controls-container-controls-normal",Qr="mk-controls-container-controls-larger",tl="mk-text-zoom",el=["mk-top-right-controls-container-children-none","mk-top-right-controls-container-children-one","mk-top-right-controls-container-children-two"],il="mk-with-zoom-control",sl="mk-pill-focus",ol="mk-pill-pressed",nl=new Pe(7,11);class al extends Ri{constructor(t){super(Fs("div",{class:"mk-controls-container"})),Yr(this,"_rtl",void 0),Yr(this,"_map",void 0),Yr(this,"_topRightControlsNode",void 0),Yr(this,"_bottomRightControlsNode",void 0),Yr(this,"_bottomLeftControlsNode",void 0),Yr(this,"_shadowRootNode",void 0),Yr(this,"_logo",void 0),Yr(this,"_legalNode",void 0),Yr(this,"_controlsPending",void 0),Yr(this,"_userLocationControl",void 0),Yr(this,"_zoomControl",void 0),Yr(this,"_mapTypeControl",void 0),Yr(this,"_rotationControl",void 0),Yr(this,"_scale",void 0),Yr(this,"_rtlChanged",void 0),this._rtl=!1,this._map=t,this._topRightControlsNode=new Ri(Fs("div",{class:this._getTopRightControlsClass()})),this._bottomRightControlsNode=new Ri(Fs("div",{class:"mk-bottom-right-controls-container"})),this._bottomLeftControlsNode=new Ri(Fs("div",{class:"mk-bottom-left-control
2s-container"})),this._setPendingControls(),this._shadowRootNode=Bs(this,Oe.shadowDOMMode,'@media (inverted-colors){:host(.mk-controls) img,:host(.mk-controls-container) img{filter:initial}}:host(.mk-controls-container) *{box-sizing:content-box}:host(.mk-controls-container) ::selection{background:0 0}.mk-error-message{font-family:-apple-system-font,"Helvetica Neue",Helvetica,Arial,sans-serif;--font-size:13;font-size:calc(100% * var(--font-size) / var(--font-size-default));width:calc(1em / var(--font-size) * 200);padding:10px;pointer-events:auto}.mk-error-support{white-space:nowrap}:host(.mk-controls) :focus,:host(.mk-controls-container) :focus{outline:0}:host(.mk-controls){container-name:controls-container;container-type:size;--logo-xmin:0;--logo-xmax:1;display:flex;flex-direction:row;justify-content:flex-end}.mk-logo-control .mk-logo{vertical-align:bottom;width:auto}:host(.mk-controls-container) .mk-bottom-left-controls-container{--logo-width:calc(1em / var(--font-size-default) * 109);--logo-height:calc(1em / var(--font-size-default) * 24);--logo-start-x:calc(1em / var(--font-size-default) * 4);--logo-xmin:1;--logo-xmax:0;font:16px sans-serif;--font-size-default:16}.mk-cq-logo-control .mk-logo{display:block;--logo-width:calc(1em / var(--font-size-default) * 109);--logo-height:calc(1em / var(--font-size-default) * 24);--logo-start-x:calc(1em / var(--font-size-default) * 4);width:var(--logo-width);height:var(--logo-height);margin:0 calc(var(--logo-start-x) * -1);transition:width .3s ease-in-out,height .3s ease-in-out}@container controls-container (min-width:77.5em){.mk-cq-logo-control .mk-logo{--logo-width:calc(1em / var(--font-size-default) * 136.25);--logo-height:calc(1em / var(--font-size-default) * 30);--logo-start-x:calc(1em / var(--font-size-default) * 5)}}:host(.mk-controls-container.mk-text-zoom) .mk-bottom-left-control
2s-container{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-controls-container.mk-text-zoom) .mk-bottom-left-controls-container{font:-apple-system-body;--font-size-default:17}}:host(.mk-controls-container) .mk-bottom-left-controls-container.mk-controls-container-controls-larger{--logo-width:calc(1em / var(--font-size-default) * 136.25);--logo-height:calc(1em / var(--font-size-default) * 30);--logo-start-x:calc(1em / var(--font-size-default) * 5)}:host(.mk-controls-container) .mk-bottom-left-controls-container.mk-autonavi{--logo-width:calc(1em / var(--font-size-default) * 68);--logo-height:calc(1em / var(--font-size-default) * 45);--logo-start-x:0}:host(.mk-controls-container) .mk-bottom-left-controls-container.mk-autonavi.mk-controls-container-controls-larger{--logo-width:calc(1em / var(--font-size-default) * 85);--logo-height:calc(1em / var(--font-size-default) * 56.25)}:host(.mk-controls-container) div.mk-logo-control img.mk-logo{width:var(--logo-width);height:var(--logo-height);margin:0 calc(var(--logo-start-x) * -1);transition:width .3s ease-in-out,height .3s ease-in-out}.mk-legal{height:calc(1em * 16 / var(--font-size-default));padding:0 6px;margin:2px 4px;border-radius:5px;pointer-events:auto;z-index:1;text-align:center;vertical-align:middle;line-height:calc(100% * 12 / var(--font-size-default));cursor:pointer;white-space:nowrap}.mk-legal .mk-legal-label{display:inline-block;font-size:calc(100% * 9 / var(--font-size-default));font-family:-apple-system-font,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;white-space:nowrap}.mk-legal .mk-legal-link{display:inline-block;height:calc(1em * 16 / var(--font-size-default));padding:0 6px;margin:0 -6px;border-radius:5px}.mk-legal .mk-legal-label:has(+ .mk-legal-link:last-child),.mk-legal .mk-legal-link:last-child{transition-property:opacity,display;transition-duration:.5s;transition-behavior:allow-discrete}.mk-legal .mk-legal-label:has(+ .mk-legal-link:last-child[data-error]),.mk-legal .mk-legal-link:last-child[data-error]{display:none;opacity:0}.mk-legal .mk-legal-label:has(+ .mk-legal-link:last-child:not([data-error])),.mk-legal .mk-legal-link:last-child:not([data-error]){display:inline-block;opacity:1}.mk-cq-legal{--logo-width:calc(1em / var(--font-size-default) * 109);--logo-height:calc(1em / var(--font-size-default) * 24);--logo-start-x:calc(1em / var(--font-size-default) * 4)}@container controls-container (min-width:77.5em){.mk-cq-legal{--logo-width:calc(1em / var(--font-size-default) * 136.25);--logo-height:calc(1em / var(--font-size-default) * 30);--logo-start-x:calc(1em / var(--font-size-default) * 5)}}:host(.mk-controls-container) .mk-bottom-right-controls-container{font:16px sans-serif;--font-size-default:16}:host(.mk-controls-container.mk-text-zoom) .mk-bottom-right-controls-container{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-controls-container.mk-text-zoom) .mk-bottom-right-controls-container{font:-apple-system-body;--font-size-default:17}}.mk-zoom-controls{--font-size:13.5;font-size:calc(100% * var(--font-size) / var(--font-size-default));width:calc(1em / var(--font-size) * 48);height:calc(1em / var(--font-size) * 24);border-radius:25%/50%;pointer-events:auto;transition:width .3s ease-in-out,height .3s ease-in-out}.mk-controls-container-controls-larger .mk-zoom-controls{width:calc(1em / var(--font-size) * 60);height:calc(1em / var(--font-size) * 30)}.mk-zoom-controls .mk-zoom-in .mk-icon,.mk-zoom-controls .mk-zoom-out .mk-icon{pointer-events:none;display:block;opacity:.55}.mk-zoom-controls .mk-zoom-in.mk-pressed .mk-icon,.mk-zoom-controls .mk-zoom-in:focus .mk-icon,.mk-zoom-controls .mk-zoom-out.mk-pressed .mk-icon,.mk-zoom-controls .mk-zoom-out:focus .mk-icon{opacity:.85}@media not all and (hover:none){.mk-zoom-controls .mk-zoom-in:hover .mk-icon,.mk-zoom-controls .mk-zoom-out:hover .mk-icon{opacity:.85}}.mk-zoom-controls .mk-zoom-in.mk-disabled .mk-icon,.mk-zoom-controls .mk-zoom-out.mk-disabled .mk-icon{opacity:.2}
2.mk-zoom-controls .mk-zoom-in,.mk-zoom-controls .mk-zoom-out{position:absolute;z-index:2;width:50%;height:100%;cursor:pointer}.mk-zoom-controls .mk-divider{position:absolute;left:calc(50% - 1px);width:2px;height:100%;box-sizing:border-box;z-index:100}:host(.mk-controls-container) .mk-top-left-controls-container{font:16px sans-serif;--font-size-default:16}:host(.mk-controls-container.mk-text-zoom) .mk-top-left-controls-container{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-controls-container.mk-text-zoom) .mk-top-left-controls-container{font:-apple-system-body;--font-size-default:17}}.mk-top-right-controls-container{position:relative;width:0;--button-width:calc(1em / var(--font-size-default) * 45);--button-height:calc(1em / var(--font-size-default) * 24);height:var(--button-height);transition:width .3s ease-in-out,height .3s ease-in-out}:host(.mk-controls-container) .mk-top-right-controls-container{font:16px sans-serif;--font-size-default:16}:host(.mk-controls-container.mk-text-zoom) .mk-top-right-controls-container{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-controls-container.mk-text-zoom) .mk-top-right-controls-container{font:-apple-system-body;--font-size-default:17}}.mk-controls-container-controls-larger.mk-top-right-controls-container{--button-width:calc(1em / var(--font-size-default) * 56.25);--button-height:calc(1em / var(--font-size-default) * 30)}.mk-top-right-controls-container-children-one{width:var(--button-width);border-radius:20%/37.5%}.mk-top-right-controls-container-children-two{width:calc(var(--button-width) * 2);border-radius:10%/37.5%}:host(.mk-controls-container) .mk-map-type-control,:host(.mk-controls-container) .mk-user-location-control{display:inline-block;position:absolute;width:var(--button-width);height:var(--button-height);cursor:pointer;pointer-events:auto;transition:width .3s ease-in-out,height .3s ease-in-out}:host(.mk-controls-container) .mk-user-location-control{left:0}:host(.mk-controls-container.mk-rtl) .mk-user-location-control{left:auto;right:0}:host(.mk-controls-container) .mk-map-type-control{right:0}:host(.mk-controls-container.mk-rtl) .mk-map-type-control{left:0;right:auto}:host(.mk-controls-container) .mk-user-location-control .mk-icon{position:absolute;left:0;height:100%;width:100%;display:block;transition:transform .2s ease-in-out}:host(.mk-controls-container) .mk-user-location-control .mk-scaled-out{transform:scale(0)}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect{animation:.8s infinite mk-spinner}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(2){animation-delay:-.1s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(3){animation-delay:-.2s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(4){animation-delay:-.3s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(5){animation-delay:-.4s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(6){animation-delay:-.5s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(7){animation-delay:-.6s}:host(.mk-controls-container) .mk-user-location-control .mk-icon.mk-icon-waiting rect:nth-child(8){animation-delay:-.7s}@keyframes mk-spinner{0%{opacity:1}88%{opacity:.15}}:host(.mk-controls-container) .mk-map-type-control .mk-icon,:host(.mk-controls-container) .mk-user-location-control .mk-icon{pointer-events:none;display:block;opacity:.55}:host(.mk-controls-container) .mk-map-type-control.mk-pressed .mk-icon,:host(.mk-controls-container) .mk-map-type-control:focus .mk-icon,:host(.mk-controls-container) .mk-map-type-control:hover .mk-icon,:host(.mk-controls-container) .mk-user-location-control.mk-pressed .mk-icon,:host(.mk-controls-container) .mk-user-location-control:focus .mk-icon,:host(.mk-controls-container) .mk-user-location-control:hover .mk-icon{opacity:.85}@media (hover:none){:host(.mk-controls-container) .mk-map-type-control:hover:not(.mk-pressed,:focus) .mk-icon,:host(.mk-controls-container) .mk-u
2ser-location-control:hover:not(.mk-pressed,:focus) .mk-icon{opacity:.55}}:host(.mk-controls-container) .mk-popover{visibility:hidden;transform:scale(.5);opacity:0;border-radius:10px;transition:.2s opacity cubic-bezier(.25, .1, .25, 1),.2s visibility step-end,.2s transform step-end;will-change:transform,opacity,visibility;border-width:1px;border-style:solid;cursor:default}:host(.mk-controls-container) .mk-popover.mk-shown{visibility:visible;pointer-events:auto;transform:none;opacity:1;transition:.2s transform cubic-bezier(.25, .1, .25, 1.3),.2s opacity cubic-bezier(.25, .1, .25, 1.3)}:host(.mk-controls-container) .mk-popover-arrow path{stroke-width:1px}:host(.mk-controls-container) .mk-map-type-popover{--type-button-width:calc(1em / var(--font-size-default) * 65);--type-button-height:calc(1em / var(--font-size-default) * 52);display:flex;padding:20px 20px 0;gap:20px}:host(.mk-controls-container) .mk-map-type-label{margin-top:10px;margin-bottom:17px;text-align:center;font-size:calc(100% * 13 / var(--font-size-default));line-height:calc(16 / 13 * 100%);font-family:-apple-system-font,HelveticaNeue-Medium,Helvetica,Arial,sans-serif}.mk-map-type-button{position:relative;display:block;cursor:pointer;width:var(--type-button-width);height:var(--type-button-height)}.mk-map-type-button input{appearance:none;padding:0;margin:0}.mk-map-type-button img,.mk-map-type-button input,.mk-map-type-button::after{position:absolute;top:0;left:0;font-size:inherit;width:var(--type-button-width);height:var(--type-button-height);border-radius:8px}.mk-map-type-button::after{content:""}:host(.mk-controls-container) .mk-map-type-button img.mk-dark-icon,:host(.mk-controls-container.mk-color-scheme-dark) .mk-map-type-button img.mk-light-icon{display:none}:host(.mk-controls-container.mk-color-scheme-dark) .mk-map-type-button img.mk-dark-icon{display:block}.mk-badge{position:absolute;--font-size:13.5;font:calc(                 100% * var(--font-size) / var(--font-size-default)             ) -apple-system-font,HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-weight:500;pointer-events:auto;height:calc(1em / var(--font-size) * 36);appearance:none;border:none;border-radius:10px;padding:6px 10px;display:flex;align-items:center;gap:5px;max-width:calc(100% - 18px)}:host(.mk-controls) .mk-badge svg.mk-icon{pointer-events:none;display:inline-block;margin:auto;width:calc(1em / var(--font-size) * 15);height:calc(1em / var(--font-size) * 15);opacity:.55}.mk-badge .mk-badge-label{opacity:.55;pointer-events:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mk-badge:active .mk-badge-label,.mk-badge:focus-visible .mk-badge-label{opacity:.85}.mk-open-dialog{pointer-events:auto;--font-size:13.5;font-size:calc(100% * var(--font-size) / var(--font-size-default));width:calc(1em / var(--font-size) * 36);height:calc(1em / var(--font-size) * 36);appearance:none;border:none;border-radius:10px}:host(.mk-controls) .mk-open-dialog svg.mk-icon{pointer-events:none;display:block;margin:auto;width:calc(1em / var(--font-size) * 15);height:calc(1em / var(--font-size) * 15);opacity:.55}:host(.mk-controls.mk-rtl) .mk-open-dialog svg.mk-icon{transform:scale(-1,1)}.mk-transition-path{transition:.5s fill ease-in-out}.mk-transition-path.mk-path-hidden{fill:transparent}:host(.mk-controls) .mk-open-dialog:active svg.mk-icon,:host(.mk-controls) .mk-open-dialog:focus-visible svg.mk-icon{opacity:.85}.mk-close{--font-size:13.5;font:calc(100% * var(--font-size) / var(--font-size-default)) HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-weight:500;pointer-events:auto;height:calc(1em / var(--font-size) * 36);appearance:none;border:none;border-radius:10px;padding:6px 10px}.mk-close .mk-close-label{opacity:.55;pointer-events:none}.mk-close:active .mk-close-label,.mk-close:focus-visible .mk-close-label{opacity:.85}@media not all and (hover:none){:host(.mk-controls) .mk-badge:hover svg.mk-icon,:host(.mk-controls) .mk-open-dialog:hover svg.mk-icon{opacity:.85}.mk-badge:hover .mk-badge-label,.mk-close:hover .mk-close-label{opacity:.85}}.mk-style-helper{opacity:0;pointer-events:none}.mk-compass,.mk-rotation-control{--font-size:15.5;font-size:calc(100% * var(--font-size) / var(--font-size-default));width:calc(1em / var(--font-size) * 48);height:calc(1em / var(--font-size) * 48);pointer-events:auto;border-radius:50%;overflow:hidden;line-height:0;transition:opacity .1s cubic-bezier(.19, 1, .22, 1),width .3s ease-in-out,height .3s ease-in-out}.mk-compass.mk-compass-small{transform:scale(.75)}.mk-rotation-control{cursor:grab}
2.mk-rotation-control.mk-pressed{cursor:grabbing}@supports ((backdrop-filter:blur(30px)) or (-webkit-backdrop-filter:blur(30px))){.mk-badge,.mk-close,.mk-compass,.mk-focus .mk-zoom-in,.mk-focus .mk-zoom-out,.mk-legal-link:focus-visible,.mk-legal:focus-visible,.mk-open-dialog,.mk-pill-focus .mk-map-type-control,.mk-pill-focus .mk-user-location-control,.mk-pill-pressed .mk-map-type-control,.mk-pill-pressed .mk-user-location-control,.mk-pill-pressed .mk-zoom-in,.mk-pill-pressed .mk-zoom-out,.mk-rotation-control,.mk-top-right-controls-container:not( .mk-pill-pressed,.mk-pill-focus,:empty ),.mk-zoom-controls:not(.mk-pill-pressed,.mk-focus){-webkit-backdrop-filter:blur(30px);backdrop-filter:blur(30px)}}.mk-compass>.mk-compass-wrapper,.mk-rotation-control>.mk-rotation-wrapper{width:100%;height:100%;position:absolute;will-change:transform;overflow:hidden;pointer-events:none}.mk-compass>.mk-compass-wrapper>svg{display:block;width:100%;height:100%}.mk-rotation-control>.mk-rotation-wrapper>img{position:absolute;left:0;top:0;width:200%;height:200%;pointer-events:none}.mk-rotation-control.mk-focus>.mk-rotation-wrapper>img,.mk-rotation-control.mk-pressed>.mk-rotation-wrapper>img,.mk-rotation-control:hover>.mk-rotation-wrapper>img{left:-100%}.mk-compass .mk-compass-part-dial{fill-opacity:0.12}.mk-compass .mk-compass-part-dial-ews{fill-opacity:0.64}.mk-compass:is(:hover,:active) .mk-compass-part-dial-ews{fill-opacity:1}@media (hover:none){.mk-rotation-control:hover:not(.mk-focus,.mk-pressed)>.mk-rotation-wrapper>img{left:0}}:host(.mk-dark-mode) .mk-rotation-control>.mk-rotation-wrapper>img{top:-100%}.mk-compass .mk-compass-heading,.mk-rotation-control .mk-heading{font-family:-apple-system-font,HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-weight:500;line-height:calc(100% / var(--font-size) * 48);position:absolute;top:0;left:0;width:100%;overflow:hidden;text-overflow:clip;text-align:center;opacity:.55;pointer-events:none;transition:font-size .3s ease-in-out,line-height .3s ease-in-out}.mk-compass:active .mk-compass-heading,.mk-compass:hover .mk-compass-heading,.mk-rotation-control.mk-focus .mk-heading,.mk-rotation-control.mk-pressed .mk-heading,.mk-rotation-control:hover .mk-heading{opacity:.85}.mk-compass:has(:focus-visible) .mk-compass-heading{opacity:.85}@media (hover:none){.mk-rotation-control:not(.mk-focus,.mk-pressed):hover .mk-heading{opacity:.55}.mk-compass:not(:has(:focus-visible),:active):hover .mk-compass-heading{opacity:.55}}.mk-rotation-control .mk-rotation-slider{position:absolute;left:0;width:100%;height:15px;top:-30px}.mk-compass-slider{all:initial;opacity:0;position:absolute;display:block;width:100%;height:100%;top:0;left:0;border-radius:24px;margin:0;padding:0}.mk-compass.mk-compass-reset-only .mk-compass-slider{cursor:pointer}.mk-compass:not(.mk-compass-reset-only) .mk-compass-slider{cursor:grab}.mk-compass:not(.mk-compass-reset-only) .mk-compass-slider:active{cursor:grabbing}.mk-compass-slider::-webkit-slider-runnable-track,.mk-compass-slider::-webkit-slider-thumb{all:initial;appearance:none;display:block;width:100%;height:100%;top:0;left:0}.mk-compass-slider::-moz-range-progress,.mk-compass-slider::-moz-range-thumb,.mk-compass-slider::-moz-range-track{all:initial;appearance:none;display:block;width:100%;height:100%}:host(.mk-controls-container.mk-dragging-annotation) .mk-legal,:host(.mk-controls-container.mk-dragging-annotation) .mk-map-type-control,:host(.mk-controls-container.mk-dragging-annotation) .mk-rotation-control,:host(.mk-controls-container.mk-dragging-annotation) .mk-rotation-control input,:host(.mk-controls-container.mk-dragging-annotation) .mk-user-location-control,:host(.mk-controls-container.mk-dragging-annotation) .mk-zoom-in,:host(.mk-controls-container.mk-dragging-annotation) .mk-zoom-out{cursor:none}.mk-compass,.mk-rotation-control,.mk-top-right-controls-container:not(.mk-pill-pressed,.mk-pill-focus,:empty),.mk-zoom-controls{box-shadow:0 0 0 .5px rgb(0 0 0 / 5%)}.mk-compass,.mk-focus .mk-zoom-in,.mk-focus .mk-zoom-out,.mk-pill-focus .mk-map-type-control,.mk-pill-focus .mk-user-location-control,.mk-pill-pressed .mk-map-type-control,.mk-pill-pressed .mk-u
2ser-location-control,.mk-pill-pressed .mk-zoom-in,.mk-pill-pressed .mk-zoom-out,.mk-rotation-control,.mk-top-right-controls-container:not(.mk-pill-pressed,.mk-pill-focus,:empty),.mk-zoom-controls:not(.mk-pill-pressed,.mk-focus){background-color:rgb(255 255 255)}.mk-compass:active,.mk-map-type-control.mk-pressed,.mk-rotation-control.mk-pressed,.mk-user-location-control.mk-pressed,.mk-zoom-controls .mk-zoom-in.mk-pressed:not(.mk-disabled),.mk-zoom-controls .mk-zoom-out.mk-pressed:not(.mk-disabled){background-color:rgb(229 229 229)}.mk-legal-link:focus-visible,.mk-legal:focus-visible,.mk-map-type-control:focus,.mk-rotation-control.mk-focus,.mk-user-location-control:focus,.mk-zoom-controls.mk-focus .mk-zoom-in:focus,.mk-zoom-controls.mk-focus .mk-zoom-out:focus{background-color:rgb(204 229 255)}.mk-legal-link:focus-visible,.mk-legal:focus-visible,.mk-map-type-control:focus,.mk-pill-focus .mk-map-type-control,.mk-pill-focus .mk-user-location-control,.mk-rotation-control.mk-focus,.mk-user-location-control:focus,.mk-zoom-controls.mk-focus{box-shadow:0 0 0 2px rgb(0 124 255)}.mk-compass:has(:focus-visible){background-color:rgb(204 229 255);box-shadow:0 0 0 2px rgb(0 124 255)}.mk-map-type-control.mk-focus.mk-pressed,.mk-rotation-control.mk-focus.mk-pressed,.mk-user-location-control.mk-focus.mk-pressed,.mk-zoom-controls.mk-focus .mk-zoom-in.mk-pressed:focus,.mk-zoom-controls.mk-focus .mk-zoom-out.mk-pressed:focus{background-color:rgb(127 189 255)}.mk-compass:has(:focus-visible):active{background-color:rgb(127 189 255)}.mk-zoom-controls.mk-focus .mk-divider{border-left:2px solid rgb(0 124 255)}.mk-map-type-control .mk-icon,.mk-user-location-control .mk-icon,.mk-zoom-controls .mk-icon{fill:#000}:host(.mk-controls-container) .mk-popover{background-color:rgb(239 239 239);color:#000;border-color:transparent;box-shadow:0 5px 10px 0 rgb(0 0 0 / 30%)}:host(.mk-controls-container) .mk-popover-arrow{fill:rgb(239 239 239)}.mk-error-message{color:#333}.mk-error-message a{color:#007aff}.mk-error-message a:visited{color:#af52de}.mk-legal .mk-legal-label{color:rgb(0 0 0 / 70%);text-shadow:0 0 1px rgb(255 255 255 / 85%)}.mk-compass .mk-compass-heading,.mk-rotation-control .mk-heading{color:#000}.mk-popover .mk-map-type-button input{box-shadow:0 0 0 .5px rgb(0 0 0 / 14%)}.mk-popover .mk-map-type-button input:checked{box-shadow:0 0 0 2px rgb(0 124 255)}.mk-popover .mk-map-type-button input:focus-visible{box-shadow:0 0 0 4px rgb(0 124 255 / 40%)}.mk-popover .mk-map-type-button input:checked:focus-visible{box-shadow:0 0 0 2px rgb(0 124 255),0 0 0 4px rgb(0 124 255 / 40%)}.mk-map-type-button:active::after{background-color:rgb(0 0 0 / 25%)}.mk-compass :is(.mk-compass-part-dial,.mk-compass-part-dial-ews){fill:#000}.mk-compass .mk-compass-part-dial-n{fill:#ff3b30}@supports ((backdrop-filter:blur(30px)) or (-webkit-backdrop-filter:blur(30px))){.mk-compass,.mk-focus .mk-zoom-in,.mk-focus .mk-zoom-out,.mk-pill-focus .mk-map-type-control,.mk-pill-focus .mk-user-location-control,.mk-pill-pressed .mk-map-type-control,.mk-pill-pressed .mk-user-location-control,.mk-pill-pressed .mk-zoom-in,.mk-pill-pressed .mk-zoom-out,.mk-rotation-control,.mk-top-right-controls-container:not( .mk-pill-pressed,.mk-pill-focus,:empty ),.mk-zoom-controls:not(.mk-pill-pressed,.mk-focus){background-color:rgb(255 255 255 / 75%)}.mk-compass:active,.mk-map-type-control.mk-pressed,.mk-rotation-control.mk-pressed,.mk-user-location-control.mk-pressed,.mk-zoom-controls .mk-zoom-in.mk-pressed:not(.mk-disabled),.mk-zoom-controls .mk-zoom-out.mk-pressed:not(.mk-disabled){background-color:rgb(229 229 229 / 60%)}.mk-legal-link:focus-visible,.mk-legal:focus-visible,.mk-map-type-control.mk-focus,.mk-rotation-control.mk-focus,.mk-user-location-control.mk-focus,.mk-zoom-controls.mk-focus .mk-zoom-in:focus,.mk-zoom-controls.mk-focus .mk-zoom-out:focus{background-color:rgb(204 229 255 / 60%)}.mk-compass:has(:focus-visible){background-color:rgb(204 229 255 / 60%)}.mk-map-type-control.mk-focus.mk-pressed,.mk-rotation-control.mk-focus.mk-pressed,.mk-user-location-control.mk-focus.mk-pressed,.mk-zoom-control
2s.mk-focus .mk-zoom-in.mk-pressed:focus,.mk-zoom-controls.mk-focus .mk-zoom-out.mk-pressed:focus{background-color:rgb(127 189 255 / 60%)}.mk-compass:has(:focus-visible):active{background-color:rgb(127 189 255 / 60%)}}:host(.mk-dark-mode) .mk-compass,:host(.mk-dark-mode) .mk-rotation-control,:host(.mk-dark-mode) .mk-top-right-controls-container:not( .mk-pill-pressed,.mk-pill-focus,:empty ),:host(.mk-dark-mode) .mk-zoom-controls{box-shadow:0 0 0 .5px rgb(255 255 255 / 5%)}:host(.mk-dark-mode) .mk-badge,:host(.mk-dark-mode) .mk-close,:host(.mk-dark-mode) .mk-compass,:host(.mk-dark-mode) .mk-focus .mk-zoom-in,:host(.mk-dark-mode) .mk-focus .mk-zoom-out,:host(.mk-dark-mode) .mk-open-dialog,:host(.mk-dark-mode) .mk-pill-focus .mk-map-type-control,:host(.mk-dark-mode) .mk-pill-focus .mk-user-location-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-map-type-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-user-location-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-zoom-in,:host(.mk-dark-mode) .mk-pill-pressed .mk-zoom-out,:host(.mk-dark-mode) .mk-rotation-control,:host(.mk-dark-mode) .mk-top-right-controls-container:not( .mk-pill-pressed,.mk-pill-focus,:empty ),:host(.mk-dark-mode) .mk-zoom-controls:not(.mk-pill-pressed,.mk-focus){background-color:rgb(18 18 18)}:host(.mk-dark-mode) .mk-badge:active,:host(.mk-dark-mode) .mk-close:active,:host(.mk-dark-mode) .mk-map-type-control.mk-pressed,:host(.mk-dark-mode) .mk-open-dialog:active,:host(.mk-dark-mode) .mk-user-location-control.mk-pressed,:host(.mk-dark-mode) .mk-zoom-controls .mk-zoom-in.mk-pressed:not(.mk-disabled),:host(.mk-dark-mode) .mk-zoom-controls .mk-zoom-out.mk-pressed:not(.mk-disabled){background-color:rgb(42 42 42)}:host(.mk-dark-mode) .mk-badge:focus-visible,:host(.mk-dark-mode) .mk-close:focus-visible,:host(.mk-dark-mode) .mk-legal-link:focus-visible,:host(.mk-dark-mode) .mk-legal:focus-visible,:host(.mk-dark-mode) .mk-map-type-control.mk-focus,:host(.mk-dark-mode) .mk-open-dialog:focus-visible,:host(.mk-dark-mode) .mk-rotation-control.mk-focus,:host(.mk-dark-mode) .mk-user-location-control.mk-focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-in:focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-out:focus{background-color:rgb(12 49 89)}:host(.mk-dark-mode) .mk-badge:focus-visible,:host(.mk-dark-mode) .mk-close:focus-visible,:host(.mk-dark-mode) .mk-legal-link:focus-visible,:host(.mk-dark-mode) .mk-legal:focus-visible,:host(.mk-dark-mode) .mk-map-type-control:focus,:host(.mk-dark-mode) .mk-open-dialog:focus-visible,:host(.mk-dark-mode) .mk-pill-focus .mk-map-type-control,:host(.mk-dark-mode) .mk-pill-focus .mk-user-location-control,:host(.mk-dark-mode) .mk-rotation-control.mk-focus,:host(.mk-dark-mode) .mk-user-location-control:focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus{box-shadow:0 0 0 2px rgb(0 124 255)}:host(.mk-dark-mode) .mk-compass:has(:focus-visible){background-color:rgb(12 49 89);box-shadow:0 0 0 2px rgb(0 124 255)}:host(.mk-dark-mode) .mk-badge:focus-visible:active,:host(.mk-dark-mode) .mk-close:focus-visible:active,:host(.mk-dark-mode) .mk-map-type-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-open-dialog:focus-visible:active,:host(.mk-dark-mode) .mk-rotation-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-user-location-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-in.mk-pressed:focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-out.mk-pressed:focus{background-color:rgb(3 102 207)}:host(.mk-dark-mode) .mk-compass:has(:focus-visible):active{background-color:rgb(3 102 207)}:host(.mk-dark-mode) .mk-badge .mk-icon,:host(.mk-dark-mode) .mk-map-type-control .mk-icon,:host(.mk-dark-mode) .mk-open-dialog .mk-icon,:host(.mk-dark-mode) .mk-user-location-control .mk-icon,:host(.mk-dark-mode) .mk-zoom-controls .mk-icon{fill:#fff}:host(.mk-dark-mode) .mk-badge-label,:host(.mk-dark-mode) .mk-close-label{color:#fff}:host(.mk-controls-container.mk-dark-mode) .mk-popover{background-color:rgb(54 54 54);color:#fff;border-color:rgb(90 92 100)}:host(.mk-controls-container.mk-dark-mode) .mk-popover-arrow{fill:rgb(54 54 54)}:host(.mk-controls-container.mk-dark-mode) .mk-popover-arrow path{stroke:rgb(90 92 100)}:host(.mk-dark-mode) .mk-error-message{color:rgb(255 255 255 / 85%)}:host(.mk-dark-mode) .mk-error-message a{color:#0a84ff}:host(.mk-dark-mode) .mk-error-message a:visited{color:#bf5af2}:host(.mk-dark-mode) .mk-legal .mk-legal-label{color:rgb(255 255 255 / 90%);text-shadow:0 0 1px rgb(0 0 0 / 50%),0 0 6px rgb(0 0 0 / 50%)}:host(.mk-dark-mode) .mk-compass .mk-compass-heading,:host(.mk-dark-mode) .mk-rotation-control .mk-heading{color:#fff}:host(.mk-dark-mode) .mk-popover .mk-map-type-button input:not(:checked,:focus-visible){box-shadow:0 0 0 .5px rgb(255 255 255 / 30%)}:host(.mk-dark-mode) .mk-compass :is(.mk-compass-part-dial,.mk-compass-part-dial-ews){fill:#fff}:host(.mk-dark-mode) .mk-compass .mk-compass-part-dial-n{fill:#ff453a}@supports ((backdrop-filter:blur(30px)) or (-webkit-backdrop-filter:blur(30px))){:host(.mk-dark-mode) .mk-badge,:host(.mk-dark-mode) .mk-close,:host(.mk-dark-mode) .mk-compass,:host(.mk-dark-mode) .mk-focus .mk-zoom-in,:host(.mk-dark-mode) .mk-focus .mk-zoom-out,:host(.mk-dark-mode) .mk-open-dialog,:host(.mk-dark-mode) .mk-pill-focus .mk-map-type-control,:host(.mk-dark-mode) .mk-pill-focus .mk-user-location-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-map-type-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-u
2ser-location-control,:host(.mk-dark-mode) .mk-pill-pressed .mk-zoom-in,:host(.mk-dark-mode) .mk-pill-pressed .mk-zoom-out,:host(.mk-dark-mode) .mk-rotation-control,:host(.mk-dark-mode) .mk-top-right-controls-container:not( .mk-pill-pressed,.mk-pill-focus,:empty ),:host(.mk-dark-mode) .mk-zoom-controls:not(.mk-pill-pressed,.mk-focus){background-color:rgb(18 18 18 / 60%)}:host(.mk-dark-mode) .mk-badge:active,:host(.mk-dark-mode) .mk-close:active,:host(.mk-dark-mode) .mk-compass:active,:host(.mk-dark-mode) .mk-map-type-control.mk-pressed,:host(.mk-dark-mode) .mk-open-dialog:active,:host(.mk-dark-mode) .mk-rotation-control.mk-pressed,:host(.mk-dark-mode) .mk-type-control.mk-pressed,:host(.mk-dark-mode) .mk-user-location-control.mk-pressed,:host(.mk-dark-mode) .mk-zoom-controls .mk-zoom-in.mk-pressed:not(.mk-disabled),:host(.mk-dark-mode) .mk-zoom-controls .mk-zoom-out.mk-pressed:not(.mk-disabled){background-color:rgb(42 42 42 / 60%)}:host(.mk-dark-mode) .mk-badge:focus-visible,:host(.mk-dark-mode) .mk-close:focus-visible,:host(.mk-dark-mode) .mk-legal-link:focus-visible,:host(.mk-dark-mode) .mk-legal:focus-visible,:host(.mk-dark-mode) .mk-map-type-control.mk-focus,:host(.mk-dark-mode) .mk-open-dialog:focus-visible,:host(.mk-dark-mode) .mk-rotation-control.mk-focus,:host(.mk-dark-mode) .mk-user-location-control.mk-focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-in:focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-out:focus{background-color:rgb(12 49 89 / 60%)}:host(.mk-dark-mode) .mk-compass:has(:focus-visible){background-color:rgb(12 49 89 / 60%)}:host(.mk-dark-mode) .mk-badge:focus-visible:active,:host(.mk-dark-mode) .mk-close:focus-visible:active,:host(.mk-dark-mode) .mk-map-type-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-open-dialog:focus-visible:active,:host(.mk-dark-mode) .mk-rotation-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-user-location-control.mk-focus.mk-pressed,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-in.mk-pressed:focus,:host(.mk-dark-mode) .mk-zoom-controls.mk-focus .mk-zoom-out.mk-pressed:focus{background-color:rgb(3 102 207 / 60%)}:host(.mk-dark-mode) .mk-compass:has(:focus-visible):active{background-color:rgb(3 102 207 / 60%)}}.mk-scale{position:absolute;top:0;left:0;vertical-align:top}:host(.mk-rtl) .mk-scale{direction:rtl}:host(.mk-controls-container) .mk-popover{position:absolute;top:calc(var(--button-height) + 13px + 1px);right:-1px;transform-origin:calc(100% - var(--arrow-center-x-from-trailing)) -12.416px}:host(.mk-controls-container) .mk-popover-arrow{position:absolute;top:-13px}.mk-top-right-controls-container{position:absolute;top:9px;right:9px;direction:ltr}:host(.mk-controls-container:not(.mk-rtl)) .mk-top-right-controls-container>.mk-control:first-child{border-top-left-radius:20% 37.5%;border-bottom-left-radius:20% 37.5%}:host(.mk-controls-container:not(.mk-rtl)) .mk-top-right-controls-container>.mk-control:nth-last-child(2){border-top-right-radius:20% 37.5%;border-bottom-right-radius:20% 37.5%}:host(.mk-controls-container) .mk-popover>.mk-popover-arrow{right:calc(var(--arrow-center-x-from-trailing) - 15px)}:host(.mk-controls-container) .mk-popover.mk-user-location-error-popover{--arrow-center-x-from-trailing:calc(var(--button-width) * 1.5)}:host(.mk-controls-container) .mk-popover.mk-map-type-popover,:host(.mk-controls-container) .mk-popover.mk-user-location-error-popover:last-child{--arrow-center-x-from-trailing:calc(var(--button-width) * 0.5)}:host(.mk-rtl) .mk-top-right-controls-container{left:9px;right:auto;direction:rtl}:host(.mk-controls-container.mk-rtl) .mk-top-right-controls-container>.mk-control:first-child{border-top-right-radius:20% 37.5%;border-bottom-right-radius:20% 37.5%}:host(.mk-controls-container.mk-rtl) .mk-top-right-controls-container>.mk-control:nth-last-child(2){border-top-left-radius:20% 37.5%;border-bottom-left-radius:20% 37.5%}:host(.mk-controls-container.mk-rtl) .mk-popover{right:auto;left:-1px;transform-origin:var(--arrow-center-x-from-trailing) -12.416px}:host(.mk-controls-container.mk-rtl) .mk-popover>.mk-popover-arrow{right:auto;left:calc(var(--arrow-center-x-from-trailing) - 15px)}
2.mk-bottom-left-controls-container,.mk-bottom-right-controls-container{position:absolute;bottom:9px}.mk-rotation-control,.mk-zoom-controls{position:absolute;bottom:0}.mk-compass{position:absolute;top:9px}.mk-close,.mk-open-dialog{margin-block-start:9px;margin-inline-end:9px}.mk-close~.mk-compass,.mk-open-dialog~.mk-compass{top:calc(9px + 9px + 1em / var(--font-size) * 36)}@container controls-container (max-width:6.25em) or (max-height:6.25em){:host(.mk-controls) .mk-close,:host(.mk-controls) .mk-compass{display:none}}@container controls-container (max-width:12.5em) or (max-height:6.25em){:host(.mk-controls.mk-long-legal) .mk-close,:host(.mk-controls.mk-long-legal) .mk-compass{display:none}}.mk-badge.mk-badge-top{top:9px}.mk-badge.mk-badge-bottom{bottom:9px}@container controls-container (max-width:12.5em) or (max-height:6.25em){.mk-badge>.mk-badge-label{display:none}}@container controls-container (max-width:25em){.mk-badge>.mk-badge.mk-badge-bottom{display:none}}:host(.mk-rtl)>.mk-badge.mk-badge-trailing,:host(:not(.mk-rtl))>.mk-badge.mk-badge-leading{left:9px}:host(.mk-rtl)>.mk-badge.mk-badge-leading,:host(:not(.mk-rtl))>.mk-badge.mk-badge-trailing{right:9px}.mk-legal,.mk-logo-control{position:absolute}.mk-cq-logo-control{position:absolute;--control-margin:9px;bottom:5px}@container controls-container (max-width:6.25em) or (max-height:6.25em){:host(.mk-controls) .mk-cq-logo-control{display:none}}@container controls-container (max-width:12.5em) or (max-height:6.25em){:host(.mk-controls.mk-long-legal) .mk-cq-logo-control{display:none}}.mk-logo-control,:host(.mk-controls-container) .mk-legal{bottom:-4px}.mk-cq-legal{bottom:5px;--control-margin:9px}@container controls-container (max-width:6.25em) or (max-height:6.25em){.mk-cq-legal{--control-margin:4px}}@container controls-container (max-width:12.5em) or (max-height:6.25em){:host(.mk-long-legal) .mk-cq-legal{--control-margin:4px}}.mk-bottom-right-controls-container{right:9px}
2.mk-bottom-left-controls-container{left:9px}:host(.mk-reduce-margin) .mk-bottom-right-controls-container{right:0}:host(.mk-reduce-margin) .mk-bottom-left-controls-container{left:4px}.mk-logo-control{left:0}:host(.mk-controls:not(.mk-rtl)) .mk-cq-logo-control{left:var(--control-margin)}:host(.mk-controls-container) div.mk-logo-control img.mk-logo.mk-logo-autonavi.mk-logo-autonavi{margin:0 0 -6px -9px}.mk-rotation-control,.mk-zoom-controls,:host(.mk-controls-container) .mk-legal{right:0;left:auto}:host(:not(.mk-rtl))>.mk-compass{right:9px}:host(:not(.mk-rtl))>.mk-compass.mk-compass-small{transform-origin:top right}:host(.mk-controls-container) .mk-legal{right:auto;left:0}:host(:not(.mk-rtl))>:not(.mk-cq-logo-control)+.mk-cq-legal{left:var(--control-margin)}:host(:not(.mk-rtl))>.mk-cq-logo-control+.mk-cq-legal{left:calc(var(--logo-width) * var(--logo-xmax) - var(--logo-start-x) + var(--control-margin))}@container controls-container (max-width:6.25em) or (max-height:6.25em){:host(:not(.mk-rtl))>.mk-cq-logo-control+.mk-cq-legal{left:var(--control-margin)}}@container controls-container (max-width:12.5em) or (max-height:6.25em){:host(.mk-long-legal:not(.mk-rtl))>.mk-cq-logo-control+.mk-cq-legal{left:var(--control-margin)}}.mk-zoom-controls .mk-zoom-in{border-top-right-radius:50%;border-bottom-right-radius:50%;right:0}.mk-zoom-controls .mk-zoom-out{border-top-left-radius:50%;border-bottom-left-radius:50%;left:0}.mk-rotation-control~.mk-zoom-controls{right:calc(9px + 1em / var(--font-size) * 48);left:auto}:host(.mk-controls-container) .mk-legal:nth-child(2){left:calc(var(--logo-width) * var(--logo-xmax) - var(--logo-start-x))}:host(.mk-rtl) .mk-bottom-right-controls-container{left:9px;right:auto}
2:host(.mk-rtl) .mk-bottom-left-controls-container{left:auto;right:9px}:host(.mk-rtl.mk-reduce-margin) .mk-bottom-right-controls-container{left:0;right:auto}:host(.mk-rtl.mk-reduce-margin) .mk-bottom-left-controls-container{left:auto;right:4px}:host(.mk-rtl) .mk-logo-control{left:auto;right:0}:host(.mk-controls.mk-rtl) .mk-cq-logo-control{right:var(--control-margin)}:host(.mk-rtl.mk-controls-container) div.mk-logo-control img.mk-logo.mk-logo-autonavi.mk-logo-autonavi{margin:0 -9px -6px 0}:host(.mk-rtl) .mk-zoom-controls .mk-zoom-in{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:50%;border-bottom-left-radius:50%;right:auto;left:0}:host(.mk-rtl) .mk-zoom-controls .mk-zoom-out{border-top-right-radius:50%;border-bottom-right-radius:50%;border-top-left-radius:0;border-bottom-left-radius:0;right:0;left:auto}:host(.mk-controls-container.mk-rtl) .mk-legal,:host(.mk-rtl) .mk-rotation-control,:host(.mk-rtl) .mk-zoom-controls{left:0;right:auto}:host(.mk-rtl)>.mk-compass{left:9px}:host(.mk-rtl)>.mk-compass.mk-compass-small{transform-origin:top left}:host(.mk-rtl)>:not(.mk-cq-logo-control)+.mk-cq-legal{right:var(--control-margin)}:host(.mk-rtl)>.mk-cq-logo-control+.mk-cq-legal{right:calc(var(--logo-width) * (1 - var(--logo-xmin)) - var(--logo-start-x) + var(--control-margin))}@container controls-container (max-width:6.25em) or (max-height:6.25em){:host(.mk-rtl)>.mk-cq-logo-control+.mk-cq-legal{right:var(--control-margin)}}@container controls-container (max-width:12.5em) or (max-height:6.25em){:host(.mk-long-legal.mk-rtl)>.mk-cq-logo-control+.mk-cq-legal{right:var(--control-margin)}}:host(.mk-controls-container.mk-rtl) .mk-legal{left:auto;right:0}:host(.mk-rtl) .mk-rotation-control~.mk-zoom-controls{left:calc(9px + 1em / var(--font-size) * 48);right:auto}:host(.mk-controls-container) .mk-autonavi .mk-legal:nth-child(2){left:calc(var(--logo-width) * var(--logo-xmax) - 9px)}:host(.mk-controls-container.mk-rtl) .mk-legal:nth-child(2){right:calc(var(--logo-width) * (1 - var(--logo-xmin)) - var(--logo-start-x))}:host(.mk-controls-container.mk-rtl) .mk-autonavi .mk-legal:nth-child(2){left:auto;right:calc(var(--logo-width) * (1 - var(--logo-xmin)) - 9px)}',Oe.nonce),this._shadowRootNode.addChild(this._topRightControlsNode),this._shadowRootNode.addChild(this._bottomRightControlsNode),this._shadowRootNode.addChild(this._bottomLeftControlsNode),this._logo=new da({logoUpdated:t=>this.logoUpdated(t)}),this._legalNode=new sa,Oe.addEventListener(Oe.Events.Changed,this),this._updateAutoNaviClass(),this.textZoom=t.textZoom,Nn.activeLocale&&(this._rtl=Nn.activeLocale.rtl,this.setAttribute("lang",Nn.localeId),this.classList.toggle(Xr,this._rtl)),Nn.addEventListener(Nn.Events.LocaleChanged,this)}get textZoom(){return this.classList.contains(tl)}set textZoom(t){this.classList.toggle(tl,t)}get controlsPending(){return this._controlsPending}set canShowTooltips(t){this._userLocationControl&&(this._userLocationControl.canShowTooltips=t),this._zoomControl&&(this._zoomControl.canShowTooltips=t),this._mapTypeControl&&(this._mapTypeControl.canShowTooltips=t),this._rotationControl&&(this._rotationControl.canShowTooltips=t)}mapPaddingDidChange(t){const e=this.element.style;e.top=t.top+"px",e.left=t.left+"px",e.bottom=t.bottom+"px",e.right=t.right+"px",this.sizeDidChange()}sizeDidChange(){const t=this._shouldHideControls();this._toggleControl(this._map.showsZoomControl&&!t,this._zoomControl,(()=>this.updateZoomControl())),this._toggleControl(this._map.showsMapTypeControl&&!t,this._mapTypeControl,(()=>this.updateMapTypeControl())),this._toggleControl(this._map.showsUserLocationControl&&!t,this._userLocationControl,(()=>this.updateUserLocationControl())),this.updateLogo(),this.updateLegalNode(),this.updateRotationControl(),this.updateScale(),this.zoomLevelDidChange();const e=this._getSizeClass();this._updateTopRightControlsContainer(!1),this._setSizeClass(this._bottomRightControlsNode,e),this._setSizeClass(this._bottomLeftControlsNode,e),this._setReduceMargin()}logoUpdated(t){const e=this._bottomLeftControlsNode.domNode;e.style.setProperty("--logo-xmin",t.xMin.toString()),e.style.setProperty("--logo-xmax",t.xMax.toString())}zoomLevelDidChange(){this._zoomControl&&(this._zoomControl.zoomOutEnabled=this._map.canZoomOut,this._zoomControl.zoomInEnabled=this._map.canZoomIn)}
2update(){this._map&&(this.classList.toggle("mk-color-scheme-dark",$s(this._map.currentColorScheme)),this.classList.toggle("mk-dark-mode",$s(this._map.tint)),this._shouldHideControls()?(this._removeZoomControl(),this._removeMapTypeControl(),this._removeUserLocationControl(),this._removeRotationControl(),this._removeScale()):(this.updateZoomControl(),this.updateMapTypeControl(),this.updateUserLocationControl(),this.updateRotationControl(),this.updateScale()),this.updateLogo(),this.updateLegalNode(),this._setReduceMargin())}scaleDidChange(){this._scale&&(this._scale.update(),this._scale.hideIfNeeded())}updateScale(){this._map.showsScale===yt.Hidden||this._shouldHideControls()?this._removeScale():(this._addScale(),this._scale.node.mapWidth=this._map._mapNode.size.width,this._scale.updateTheme(this._map.mapNodeTint),this._positionScale(),this._scale.update())}updateZoomControl(){this._map.showsZoomControl&&!this._shouldHideControls()?(this._addZoomControl(),this._zoomControl.enabled=this._map.isZoomEnabled,this.zoomLevelDidChange(),this._zoomControl.updateTintColor(this._map.tintColorForControls)):this._removeZoomControl()}updateMapTypeControl(){this._map.showsMapTypeControl&&!this._shouldHideControls()?(this._addMapTypeControl(),this._mapTypeControl.mapType=this._map.mapType,this._mapTypeControl.enabled=!0,this._mapTypeControl.updateTintColor(this._map.tintColorForControls)):this._removeMapTypeControl()}updateUserLocationControl(){if(this._map.showsUserLocationControl&&!this._shouldHideControls()){switch(this._addUserLocationControl(),this._userLocationControl.enabled=!0,this._userLocationControl.state){case Ar.States.Default:al.userLocation.isAvailable?this._map.tracksUserLocation&&al.userLocation.location?this._userLocationControl.toTrackingState():(this._map.tracksUserLocation||this._map.showsUserLocation&&!this._map.userLocationAnnotation)&&this._userLocationControl.toWaitingState():this._userLocationControl.toDisabledState();break;case Ar.States.Waiting:al.userLocation.location&&this.userLocationDidChange(al.userLocation),this._map.showsUserLocation||this._userLocationControl.toDefaultState();break;case Ar.States.Tracking:this._map.tracksUserLocation||this._userLocationControl.toDefaultState()}this._userLocationControl.updateTintColor(this._map.tintColorForControls)}else this._removeUserLocationControl()}updateRotationControl(){this._shouldHideControls()||this._map.isCompassHidden?this._removeRotationControl():(this._addRotationControl(),this._rotationControl.rotation=this._map.rotation,this._rotationControl.updateImage(zs(),$s(this._map.mapNodeTint)),this._rotationControl.updateTintColor(this._map.tintColorForControls))}updateLegalNode(){this._addAndUpdateLegalNode()}updateLogo(){!this._shouldHideLogo()&&rl()?this._addAndUpdateLogo():this._logo.remove(),this._legalNode.updateWithMapType(this._map.mapType)}devicePixelRatioDidChange(){this._rotationControl&&this._rotationControl.updateImage(zs(),$s(this._map.mapNodeTint)),this._scale&&this._scale.update()}fontSizeDidChange(){this._scale&&this._scale.update()}handleEvent(t){if(this._map)switch(t.type){case Da.EVENTS.MAP_TYPE_CHANGE:this._mapTypeControl&&(this._map.mapType=this._mapTypeControl.mapType);break;case Ar.EVENTS.PRESSED:this._userLocationControl.state===Ar.States.Waiting?this._map.tracksUserLocation=!0:this._userLocationControl.state!==Ar.States.Tracking&&(this._map.tracksUserLocation=!1);break;case Nn.Events.LocaleChanged:this._handleLocaleChanged(t);break;case"update":this._unsetPendingControls(),this._map.addWaitingAnnotations();break;case Oe.Events.Changed:this._updateAutoNaviClass(),this.updateLogo(),this.updateLegalNode()}}mapWasDestroyed(){this._unsetPendingControls(),Nn.removeEventListener(Nn.Events.LocaleChanged,this),Oe.removeEventListener(Oe.Events.Changed,this),this._destroyZoomControl(),this._destroyMapTypeControl(),this._destroyUserLocationControl(),this._destroyRotationControl(!0),this._legalNode.destroy(),this._legalNode.remove(),delete this._legalNode,this._logo.destroy(),this._logo.remove(),delete this._logo,this._removeScale(),this.remove(),delete this._map}userLocationDidChange(){this._userLocationControl&&(this._map.tracksUserLocation?this._userLocationControl.toTrackingState():this._userLocationControl.toDefaultState())}userLocationDidError(t){this._userLocationControl&&this._userLocationControl.toDisabledState(),this._map.userLocationAnnotation||3===t.errorCode||(this._map.showsUserLocation=!1)}_handleLocaleChanged(t){this.classList.toggle(Xr,t.locale.rtl),this.setAttribute("lang",Nn.localeId),this._rtl!==t.locale.rtl?(this._rtl=t.locale.rtl,this._rtlChanged=!0,this.update(),this._rtlChanged=!1):this.updateLogo()}_addScale(){this._scale||(this._setPendingControls(),this._scale=new br(this._map),this._shadowRootNode.addChild(this._scale,0))}_positionScale(){const t=this._map.ensureVisibleFrame().size,e=!this._rtl;
2this._scale.node.leftAligned=e,this._scale.position=new Pe(e?nl.x:t.width-this._scale.size.width-nl.x,nl.y),this._scale.shouldDisplayScale||this._scale.node.setOpacityAnimated(0,!1)}_removeScale(){this._scale&&(this._setPendingControls(),this._scale.mapWasDestroyed(),this._scale.remove(),delete this._scale)}_addZoomControl(){!this._map.showsZoomControl||this._zoomControl||this._shouldHideControls()||(this._setPendingControls(),this._zoomControl=new Hr,this._zoomControl.enabled=this._map.isZoomEnabled,this._zoomControl.addEventListener(Hr.EVENTS.ZOOM_START,this._map),this._zoomControl.addEventListener(Hr.EVENTS.ZOOM_END,this._map),this._bottomRightControlsNode.insertBefore(this._zoomControl,this._legalNode),this._rotationControl&&this._rotationControl.classList.add(il))}_removeZoomControl(){!this._shouldHideControls()&&this._map.showsZoomControl||!this._zoomControl||(this._setPendingControls(),this._zoomControl.enabled=!1,this._destroyZoomControl())}_destroyZoomControl(){this._zoomControl&&(this._zoomControl.removeEventListener(Hr.EVENTS.ZOOM_START,this._map),this._zoomControl.removeEventListener(Hr.EVENTS.ZOOM_END,this._map),this._zoomControl.remove(),this._rotationControl&&this._rotationControl.classList.remove(il),delete this._zoomControl)}_addMapTypeControl(){!this._map.showsMapTypeControl||this._mapTypeControl||this._shouldHideControls()||(this._setPendingControls(),this._mapTypeControl=new Da(dt,this._map.mapType,this),this._mapTypeControl.addEventListener(Da.EVENTS.MAP_TYPE_CHANGE,this),this._topRightControlsNode.addChild(this._mapTypeControl),this._updateTopRightControlsContainer(!0))}_removeMapTypeControl(){this._mapTypeControl&&(this._setPendingControls(),this._mapTypeControl.enabled=!1,this._destroyMapTypeControl(),this._updateTopRightControlsContainer(!0))}_destroyMapTypeControl(){this._mapTypeControl&&(this._mapTypeControl.removeEventListener(Da.EVENTS.MAP_TYPE_CHANGE,this),this._mapTypeControl.remove(),delete this._mapTypeControl)}_toggleControl(t,e,i){(e&&!t||!e&&t)&&i.call(this)}_shouldHideControls(){if(!Oe.ready)return!0;const t=this._map.ensureVisibleFrame().size;return t.width<Ct.minimumSizeToShowControls.width||t.height<Ct.minimumSizeToShowControls.height}_shouldHideLogo(){if(!Oe.ready)return!0;const t=aa.includes(Nn.localeId)?Ct.minimumSizeToShowLogoWithReducedMargin:Ct.minimumSizeToShowLogo,e=this._map.ensureVisibleFrame().size;return e.width<t.width||e.height<t.height}_addRotationControl(){this._shouldHideControls()||this._rotationControl||(this._setPendingControls(),this._rotationControl=new Ya(this._map),this._rotationControl.enabled=!0,this._bottomRightControlsNode.insertBefore(this._rotationControl,this._zoomControl||this._legalNode),this._zoomControl&&this._rotationControl.classList.add(il))}_removeRotationControl(){this._rotationControl&&(this._setPendingControls(),this._destroyRotationControl())}_destroyRotationControl(t){if(this._rotationControl){if(t)this._rotationControl.mapWasDestroyed(),this._rotationControl.remove();else{const t=this._rotationControl,e=()=>{clearTimeout(i),t.element.removeEventListener("transitionend",e),t.mapWasDestroyed(),t.remove()};t.opacity=0;const i=setTimeout(e,300);t.element.addEventListener("transitionend",e)}delete this._rotationControl}}_addUserLocationControl(){!this._map.showsUserLocationControl||this._userLocationControl||this._shouldHideControls()||(this._setPendingControls(),this._userLocationControl=new Ar(this._map,this._rtl,this),this._userLocationControl.addEventListener(Ar.EVENTS.PRESSED,this),this._topRightControlsNode.insertBefore(this._userLocationControl,this._mapTypeControl),this._updateTopRightControlsContainer(!0))}controlDidGetFocus(t){this._toggleParentClass(t,sl,!0)}controlDidLoseFocus(t){this._toggleParentClass(t,sl,!1)}controlWasPressed(t){this._toggleParentClass(t,ol,!0)}controlWasReleased(t){this._toggleParentClass(t,ol,!1)}_setSizeClass(t,e){t.classList.toggle(Jr,Jr===e),t.classList.toggle(Qr,Qr===e)}_updateAutoNaviClass(){const t=this._bottomRightControlsNode,e=this._bottomLeftControlsNode;t.classList.toggle($r,Oe.isAutoNavi),e.classList.toggle($r,Oe.isAutoNavi)}_toggleParentClass(t,e,i){const s=t.parent;s===this._topRightControlsNode&&s.classList.toggle(e,i)}_removeUserLocationControl(){!this._shouldHideControls()&&this._map.showsUserLocationControl||!this._userLocationControl||(this._setPendingControls(),this._destroyUserLocationControl(),this._updateTopRightControlsContainer(!0))}_destroyUserLocationControl(){this._userLocationControl&&(this._userLocationControl.removeEventListener(Ar.EVENTS.PRESSED,this._map),this._userLocationControl.mapWasDestroyed(),this._userLocationControl.remove(),delete this._userLocationControl)}_addAndUpdateLegalNode(){this._setPendingControls(),Oe.showLegalLink&&(this._bottomLeftControlsNode.addChild(this._legalNode),this._legalNode.updateWithMapType(this._map.mapType))}_addAndUpdateLogo(){this._logo.parent||(this._setPendingControls(),this._bottomLeftControlsNode.insertBefore(this._logo,this._legalNode)),this._logo.updateWithMapNodeTint(this._map.mapNodeTint)}_setPendingControls(){this._controlsPending=!0,Zi.addEventListener("update",this)}_unsetPendingControls(){this._controlsPending=!1,Zi.removeEventListener("update",this)}_setReduceMargin(){const t=this._map.ensureVisibleFrame().size.width,e=Ct,i=e.minimumSizeToShowLogo.width,s=e.minimumSizeToShowControls.width;this.classList.toggle("mk-reduce-margin",t<i&&rl()),this.classList.toggle("mk-reduced-vertical-margin",t<s)}_updateTopRightControlsContainer(t){const e=this._topRightControlsNode,i=e.element,s=i?.parentNode;if(s&&t){const t=Fs("div",{class:i.className});for(;i.children.length>0;){const e=i.children[0];t.appendChild(e)}s.insertBefore(t,i),s.removeChild(i),e.element=t}e.element&&(e.element.className=this._getTopRightControlsClass(),e.classList.reset())}_getSizeClass(){const t=this._map.ensureVisibleFrame().size,e=Ct.maximumSizeControlsNormal;return t.width>e.width&&t.height>e.height?Qr:Jr}_getTopRightControlsClass(){const t=(this._userLocationControl?1:0)+(this._mapTypeControl?1:0);
2return"mk-top-right-controls-container "+el[t]+" "+this._getSizeClass()}controlBounds(){const t=[];return[this._topRightControlsNode,this._bottomLeftControlsNode,this._bottomRightControlsNode].forEach((e=>{0!==e.children.length&&(e===this._bottomRightControlsNode?t.push(...e.children):t.push(e))})),t.map((t=>{try{const e=t.element.getBoundingClientRect();if("none"===window.getComputedStyle(this._map.element).transform){const t=this._map.element.getBoundingClientRect();return new ze(e.left-t.left,e.top-t.top,e.width,e.height)}return ze.rectFromClientRect(e)}catch{return new ze}}))}}function rl(){return Oe.isAutoNavi||Oe.showMapsLogo}Yr(al,"userLocation",void 0),Yr(al,"ZoomControl",Hr),u.jsModules.userLocation?al.userLocation=u.jsModules.userLocation:u.addEventListener("load",(function t(e){e.jsModules.userLocation&&(al.userLocation=e.jsModules.userLocation,u.removeEventListener("load",t))}));function ll(t){t(al)}function hl(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class dl{constructor(t,e){hl(this,"_delegate",void 0),hl(this,"_snapsToIntegralZoomLevels",void 0),hl(this,"_gasPedalValue",void 0),hl(this,"zoomsIn",void 0),hl(this,"_zoomLevel",void 0),hl(this,"_timeAtLastFrame",void 0),hl(this,"_zoomLevelAtWhichToStop",void 0),hl(this,"_speed",.03),hl(this,"_startTime",0),hl(this,"_shouldStop",!1),hl(this,"_animating",!1),this._delegate=e,this._snapsToIntegralZoomLevels=t}start(t,e){const i=Date.now();return this._gasPedalValue=0,this._startTime=i,this._shouldStop&&this._cleanUp(),this._shouldStop=!1,this.zoomsIn=!!e,Ms&&window.addEventListener("webkitmouseforcechanged",this),!this._animating&&(this._animating=!0,this._zoomLevel=t,this._timeAtLastFrame=i,si(this),!0)}stop(){this._shouldStop=!0,Ms&&(window.removeEventListener("webkitmouseforcechanged",this),this._speed=.03)}set snapsToIntegralZoomLevels(t){this._snapsToIntegralZoomLevels=!!t}performScheduledUpdate(){let t=!0;const e=Date.now(),i=e-this._timeAtLastFrame,s=this._speed*(this.zoomsIn?1:-1);this._zoomLevel+=60*i*Math.log2(1+s)/1e3,this._timeAtLastFrame=e,this._shouldStop&&e-this._startTime>=250&&(this._zoomLevelAtWhichToStop?(t=this.zoomsIn&&this._zoomLevel<this._zoomLevelAtWhichToStop||!this.zoomsIn&&this._zoomLevel>this._zoomLevelAtWhichToStop,t||(this._zoomLevel=this._zoomLevelAtWhichToStop)):this._snapsToIntegralZoomLevels?this._zoomLevelAtWhichToStop=this.zoomsIn?Math.ceil(this._zoomLevel):Math.floor(this._zoomLevel):t=!1),this._delegate&&this._delegate.linearZoomControllerDidZoom(this._zoomLevel),t?si(this):this._cleanUp()}handleEvent(t){this._handleForceChangedEvent(t)}_handleForceChangedEvent(t){const e=MouseEvent,i=w(t.webkitForce,e.WEBKIT_FORCE_AT_MOUSE_DOWN,e.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN)-e.WEBKIT_FORCE_AT_MOUSE_DOWN;Math.abs(i-this._gasPedalValue)>.01&&(this._gasPedalValue=i),this._speed=.01+this._gasPedalValue*(.06-.01)}_cleanUp(){this._animating=!1,this._shouldStop=!1,delete this._zoomLevelAtWhichToStop,this._delegate&&this._delegate.linearZoomControllerDidStop()}mapWasDestroyed(){this._delegate=null}}class cl extends os{constructor(){super(),this.allowableMovement=10,this.minimumPressDuration=500,this.numberOfTouchesRequired=1,this._startPoint=void 0}touchesBegan(t){t.currentTarget===this.target&&("button"in t&&t.button>0&&!this.allowsRightMouseButton||(super.touchesBegan(t),this.numberOfTouches===this.numberOfTouchesRequired?(this._startPoint=this.locationInElement(),this._timerId=window.setTimeout(this.enterRecognizedState.bind(this),this.minimumPressDuration)):this.enterFailedState()))}touchesMoved(t){this.preventDefault(t),void 0!==this._startPoint&&this._startPoint.distanceToPoint(this.locationInElement())>this.allowableMovement&&this.enterFailedState()}touchesCancelled(t){this.touchesEnded(t)}touchesEnded(t){this.state===os.States.Recognized?(this.preventDefault(t),this.numberOfTouches!==this.numberOfTouchesRequired&&this.enterFailedState()):this.enterFailedState()}reset(){window.clearTimeout(this._timerId),delete this._timerId}}class ul extends os{constructor(){super(),this.scaleThreshold=0,this.useGestures=os.UseGesturesForPinch,this._scaledMinimumAmount=!1,this.scale=1,this._velocity=0,this._gestures=[],this._startDistance=0}get velocity(){const t=this._gestures[this._gestures.length-1];if(!t)return this._velocity;const e=performance.now()-(t.timeStamp+100);if(e<=0)return this._velocity;const i=Math.max((500-e)/500,0);
2return this._velocity*i}touchesBegan(t){if(t.currentTarget===this.target){if(this.useGestures){if(2!==this.numberOfTouches)return}else{if(this.numberOfTouches>2)return void this.enterFailedState();if(2!==this.numberOfTouches)return;this._startDistance=this._distance(),this._recordGesture(t.timeStamp,1),this._scaledMinimumAmount=!1,this._updateStateWithEvent(t)}super.touchesBegan(t)}}touchesMoved(t){this.useGestures||2===this.numberOfTouches&&this._updateStateWithEvent(t)}touchesEnded(t){this.useGestures||this.numberOfTouches>=2||!this._startDistance||(this._scaledMinimumAmount?this.enterEndedState():this.enterFailedState())}gestureBegan(t){super.gestureBegan(t),this._recordGesture(t.timeStamp,t.scale),this._scaledMinimumAmount=!1,this._updateStateWithEvent(t),this.preventDefault(t)}gestureChanged(t){this.preventDefault(t),this._updateStateWithEvent(t)}gestureEnded(t){this._scaledMinimumAmount?this.enterEndedState():this.enterFailedState()}reset(){this.scale=1,this._velocity=0,this._gestures=[],this._startDistance=0}_recordGesture(t,e){const i=t,s=this._gestures.push({scale:e,timeStamp:i});if(s<=2)return;const o=this._gestures[s-1].scale>=this._gestures[s-2].scale;let n;for(n=s-3;n>=0;--n){const t=this._gestures[n];if(i-t.timeStamp>100||this._gestures[n+1].scale>=t.scale!==o)break}n>0&&(this._gestures=this._gestures.slice(n+1))}_updateStateWithEvent(t){const e=this.useGestures?t.scale:0!==this._startDistance?this._distance()/this._startDistance:1;if(!isFinite(e)||e<=0)return void this.enterFailedState();if(!this._scaledMinimumAmount)return void(Math.abs(1-e)>=this.scaleThreshold&&(this._scaledMinimumAmount=!0,this.scale=1,this.enterBeganState()));this._recordGesture(t.timeStamp,e);const i=this._gestures[0],s=e-i.scale,o=t.timeStamp-i.timeStamp;this._velocity=0===o?0:s/o*1e3,this.scale*=e/this._gestures[this._gestures.length-2].scale,this.enterChangedState()}}class pl extends os{constructor(){super(),this._rotation=0,this.rotation=0,this._velocity=0,this._lastEventData=null,this._startAngle=null,this.useGestures=os.UseGesturesForRotation}get velocity(){return this._velocity}get rotation(){return this._rotation}set rotation(t){this._rotation=function(t){for(;t>180;)t-=360;for(;t<-180;)t+=360;return t}(t)}touchesBegan(t){this.useGestures||t.currentTarget===this.target&&2===this.numberOfTouches&&(super.touchesBegan(t),this.numberOfTouches>2?this.enterFailedState():(this._startAngle=this._angle(),this._startDistance=this._distance(),this.rotation=0,this._lastEventData={rotation:0,scale:1,timeStamp:t.timeStamp}))}touchesMoved(t){this.useGestures||2===this.numberOfTouches&&null!==this._startAngle&&void 0!==this._startDistance&&this._handleEvent(t,{rotation:this._angle()-this._startAngle,scale:0===this._startDistance?1:this._distance()/this._startDistance})}touchesEnded(t){this.useGestures||this.numberOfTouches>=2||null===this._startAngle||(this.state===os.States.Changed?this.enterEndedState():this.enterFailedState())}gestureBegan(t){this.useGestures&&(super.gestureBegan(t),this.preventDefault(t),this.rotation=0,this._lastEventData={rotation:0,scale:1,timeStamp:t.timeStamp})}gestureChanged(t){this.useGestures&&(this.preventDefault(t),this._handleEvent(t))}gestureEnded(t){this.useGestures&&this.enterEndedState()}reset(){this.rotation=0,this._velocity=0,this._lastEventData=null,this._startAngle=null}_handleEvent(t,e){const i="rotation"in t?t.rotation:e?e.rotation:NaN,s="scale"in t?t.scale:e?e.scale:NaN,o=this._lastEventData;if(!o||isNaN(i)||isNaN(s))throw new Error("");const n=i-o.rotation,a=s-o.scale,r=t.timeStamp-o.timeStamp;if(this._lastEventData={rotation:i,scale:s,timeStamp:t.timeStamp},this.state!==os.States.Possible)r>0&&(this._velocity=n/r*1e3),this.rotation+=n,this.enterChangedState();else{const t=Math.abs(i)<8,e=Math.abs(n/90)<Math.abs(a),s=Math.abs(n)>=135;if(t||e||s)return;this.enterBeganState()}}_angle(){if(2!==this.numberOfTouches)return 0;const t=this._targetTouches[0],e=new Re(t.pageX,t.pageY),i=this._targetTouches[1],s=new Re(i.pageX,i.pageY);return 180*Math.atan2(e.y-s.y,e.x-s.x)/Math.PI}}const ml=100;class gl extends os{constructor(){super(),this.numberOfTouchesRequired=1,this.direction=gl.Directions.Right}touchesBegan(t){t.currentTarget===this.target&&(this.numberOfTouchesRequired===this.numberOfTouches?(super.touchesBegan(t),this._translationOrigin=this.locationInElement()):this.enterFailedState())}touchesMoved(t){if(this.numberOfTouchesRequired!==this.numberOfTouches)return void this.enterFailedState();if(this.preventDefault(t),void 0===this._translationOrigin)return;const e=this.locationInElement(),i=new Re(e.x-this._translationOrigin.x,e.y-this._translationOrigin.y);this.state!==os.States.Recognized&&this.direction===gl.Directions.Right&&i.x>ml&&Math.abs(i.x)>Math.abs(i.y)&&this.enterRecognizedState(),this.state!==os.States.Recognized&&this.direction===gl.Directions.Left&&i.x<-100&&Math.abs(i.x)>Math.abs(i.y)&&this.enterRecognizedState(),this.state!==os.States.Recognized&&this.direction===gl.Directions.Up&&i.y<-100&&Math.abs(i.y)>Math.abs(i.x)&&this.enterRecognizedState(),this.state!==os.States.Recognized&&this.direction===gl.Directions.Down&&i.y>ml&&Math.abs(i.y)>Math.abs(i.x)&&this.enterRecognizedState()}touchesEnded(t){this.enterFailedState()}}gl.Directions=Object.freeze({Right:1,Left:2,Up:4,Down:8});os.SupportsTouches,os.SupportsPointerEvents;const _l=os.States;function fl(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class yl extends cl{constructor(){super(),fl(this,"translation",void 0),fl(this,"_translationOrigin",void 0),fl(this,"_lastTouchLocation",void 0),this.minimumPressDuration=500}touchesBegan(t){super.touchesBegan(t),this._domEvents.push(t),this.translation=new Pe,this._translationOrigin=this._lastTouchLocation=this.locationInElement()}enterRecognizedState(){super.enterBeganState()}touchesMoved(t){this.preventDefault(t);const e=this.locationInElement();if(this.state===ds.Possible)super.touchesMoved(t);else if(this.state===ds.Began||this.state===ds.Changed){const t=this.translation;t.x+=e.x-this._lastTouchLocation.x,t.y+=e.y-this._lastTouchLocation.y,this.enterChangedState()}this._lastTouchLocation=e}touchesCanceled(){this.interruptGesture()}touchesEnded(t){this.state===ds.Changed?(this.preventDefault(t),this.enterEndedState()):this.enterFailedState()}interruptGesture(){this.state===ds.Changed?this.enterEndedState():this.state===ds.Began&&this.enterFailedState()}reset(){super.reset(),delete this._translationOrigin,delete this._lastTouchLocation,this._domEvents=[]}}function vl(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const bl="mk-disable-all-gestures",wl="mk-disable-pan-gestures",Cl="mk-disable-pinch-gestures",kl="mk-disable-zoom-gestures";class Sl{constructor(t,e){vl(this,"_target",void 0),vl(this,"_delegate",void 0),vl(this,"_touchCount",void 0),vl(this,"initialEventTargetForCurrentInteraction",void 0),vl(this,"_doubleTapWithOneFingerRecognizer",void 0),vl(this,"_singleTapWithOneFingerRecognizer",void 0),vl(this,"_longPressAndPanRecognizer",void 0),vl(this,"_delayedSingleTapRecognizerTimeoutID",void 0),this._target=t,this._delegate=e,this._touchCount=0,this.initialEventTargetForCurrentInteraction=null,this._doubleTapWithOneFingerRecognizer=this._addGestureRecognizer(Fa),this._doubleTapWithOneFingerRecognizer.numberOfTouchesRequired=1,this._doubleTapWithOneFingerRecognizer.numberOfTapsRequired=2,this._singleTapWithOneFingerRecognizer=this._addGestureRecognizer(Fa),this._longPressAndPanRecognizer=this._addGestureRecognizer(yl),this._longPressAndPanRecognizer.delegate=this,t.addEventListener(Ts(),this),t.addEventListener("dragstart",this),t.addEventListener("selectstart",this),this.updateGestureEnableState()}handleEvent(t){const e=this._delegate;switch(t.type){case"pointerdown":this._installEndListeners(),this._touchCount++,this.initialEventTargetForCurrentInteraction=e.getEventTargetFromSubShadowDOM(t);break;case"pointerup":case"pointercancel":this._touchCount--,0===this._touchCount&&(this._removeEndListeners(),this.initialEventTargetForCurrentInteraction=null);break;case"dragstart":e.elementShouldPreventDragstart(t.target)&&t.preventDefault();break;case"mousedown":this._installEndListeners(),this.initialEventTargetForCurrentInteraction=e.getEventTargetFromSubShadowDOM(t);break;case"mouseup":this._removeEndListeners(),this.initialEventTargetForCurrentInteraction=null;break;case"touchstart":t.touches.length===t.changedTouches.length&&(this._installEndListeners(),this.initialEventTargetForCurrentInteraction=e.getEventTargetFromSubShadowDOM(t),e.elementWantsDefaultBrowserBehaviorForTouchEvent(this.initialEventTargetForCurrentInteraction,t,t.touches.length)||t.preventDefault());break;case"touchend":case"touchcancel":0===t.touches.length&&(this._removeEndListeners(),this.initialEventTargetForCurrentInteraction=null);break;case"statechange":this._handleStatechange(t);break;case"selectstart":e.elementWantsTextSelection(t.target)||t.preventDefault()}}_handleStatechange(t){switch(t.target){case this._doubleTapWithOneFingerRecognizer:this._handleDoubleTapWithOneFingerChange(t);break;case this._singleTapWithOneFingerRecognizer:this._handleSingleTapWithOneFingerChange(t);break;case this._longPressAndPanRecognizer:this._handleLongPressAndPanChange(t)}
2}gestureRecognizerShouldBegin(t){return this._singleTapWithOneFingerRecognizer.enabled=!1,this._singleTapWithOneFingerRecognizer.enabled=!0,this._delegate.userDidLongPress(t)}updateGestureEnableState(){const t=this._delegate,e=(t.isScrollEnabled?1:0)|(t.isRotationEnabled?2:0)|(t.isZoomEnabled?4:0),i=[void 0,wl,Cl,bl,kl,bl,Cl,bl];t.rootNode.classList.remove(bl),t.rootNode.classList.remove(wl),t.rootNode.classList.remove(Cl),t.rootNode.classList.remove(kl),i[e]&&t.rootNode.classList.add(i[e])}mapWasDestroyed(){this._removeEndListeners(),this._target.removeEventListener(Ts(),this),this._target.removeEventListener("dragstart",this),this._target.removeEventListener("selectstart",this),this._doubleTapWithOneFingerRecognizer.removeEventListener("statechange",this),this._doubleTapWithOneFingerRecognizer.enabled=!1,this._doubleTapWithOneFingerRecognizer=null,this._singleTapWithOneFingerRecognizer.removeEventListener("statechange",this),this._singleTapWithOneFingerRecognizer.enabled=!1,this._singleTapWithOneFingerRecognizer=null,this._longPressAndPanRecognizer.removeEventListener("statechange",this),this._longPressAndPanRecognizer.enabled=!1,this._longPressAndPanRecognizer.delegate=null,this._longPressAndPanRecognizer=null,window.clearTimeout(this._delayedSingleTapRecognizerTimeoutID),this.initialEventTargetForCurrentInteraction=null,this._target=null,this._delegate=null}_addGestureRecognizer(t){const e=new t;return e.target=this._target,e.addEventListener("statechange",this),e}_handleDoubleTapWithOneFingerChange(t){const e=t.target,i=this._delegate;e.state===_l.Recognized&&(this._delayedSingleTapRecognizerTimeoutID&&(i.userCanceledTap(),window.clearTimeout(this._delayedSingleTapRecognizerTimeoutID),delete this._delayedSingleTapRecognizerTimeoutID),this._singleTapWithOneFingerRecognizer.enabled=!1,i.userDidDoubleTap(e))}_handleSingleTapWithOneFingerChange(t){const e=t.target,i=this._delegate;if(this._singleTapWithOneFingerRecognizer.enabled&&e.state===_l.Recognized){i.userWillTap(e);const t=i.shouldDelaySingleTap()?350:0;this._delayedSingleTapRecognizerTimeoutID=setTimeout((()=>{delete this._delayedSingleTapRecognizerTimeoutID,i.userDidTap()}),t)}}_handleLongPressAndPanChange(t){const e=t.target,i=this._delegate;switch(e.state){case _l.Possible:i.userMayStartPanningAfterLongPress();break;case _l.Began:this._singleTapWithOneFingerRecognizer.enabled=!1,this._doubleTapWithOneFingerRecognizer.enabled=!1,this._doubleTapWithOneFingerRecognizer.enabled=!0;break;case _l.Changed:i.userDidPanAfterLongPress(e.translation);break;case _l.Ended:case _l.Failed:this._singleTapWithOneFingerRecognizer.enabled=!0,i.userDidStopPanningAfterLongPress(e.state!==_l.Failed)}}_stopDraggingAnnotation(){this._longPressAndPanRecognizer.interruptGesture()}_installEndListeners(){window.addEventListener(Os(),this),Rs()&&window.addEventListener(Rs(),this)}_removeEndListeners(){window.removeEventListener(Os(),this),Rs()&&window.removeEventListener(Rs(),this)}}let Ll;const Ml=()=>{if(window.Syrup)return Promise.resolve();if(!Ll){const t=Oe.performanceMarkers.loading;t&&performance.mark("mapkit-syrup-load-start");const e=()=>new Promise(((t,e)=>{const i=Do.createSyrupUrl(),s=document.head.appendChild(document.createElement("script"));s.addEventListener("error",(()=>e(new Error)),{once:!0}),s.addEventListener("load",(()=>t()),{once:!0}),Oe.nonce&&Do.isSyrupUrlTrusted(i)&&(s.nonce=Oe.nonce),s.crossOrigin=ra(Oe.urlWithCredentials(i)),s.src=i})).then((()=>{const e=window.Syrup;e&&(t&&performance.measure("mapkit-syrup-load","mapkit-syrup-load-start"),Oe.componentVersions.set("s",e.Version))}),(t=>{console.error(t)}));Ll=Oe._syrupUrl?e():Oe.loginPromise.then(e)}return Ll};function Al(t,e,i){Tl(t,e),e.set(t,i)}function Tl(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function xl(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function El(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ol(t,e,"get"))}function Il(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Ol(t,e,"set"),i),i}function Ol(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const Pl={antialias:!1,stencil:!0};
2var Rl=new WeakSet,zl=new WeakMap,Dl=new WeakMap,Nl=new WeakMap,Fl=new WeakMap,Ul=new WeakMap;class Wl{constructor(t,e){var i,s;Tl(i=this,s=Rl),s.add(i),Al(this,zl,{writable:!0,value:void 0}),Al(this,Dl,{writable:!0,value:void 0}),Al(this,Nl,{writable:!0,value:void 0}),Al(this,Fl,{writable:!0,value:void 0}),Al(this,Ul,{writable:!0,value:!1});const o=document.createElement("canvas");o.setAttribute("aria-hidden","true"),Il(this,zl,t),Il(this,Dl,o),this.resize(),t.insertBefore(o,t.firstChild);const n=e?[e]:["webgl2","webgl"];for(const t of n){const e=o.getContext(t,Pl);if(e){Il(this,Nl,e),Il(this,Fl,t);break}}El(this,Nl)||xl(this,Rl,Gl).call(this)}destroy(){xl(this,Rl,Gl).call(this),Il(this,Ul,!0)}resize(){const t=El(this,Dl);if(t){const e=El(this,zl).getBoundingClientRect();t.style.width=e.width+"px",t.style.height=e.height+"px",t.width=e.width*zs(),t.height=e.height*zs()}}get element(){return El(this,Dl)}get context(){return El(this,Nl)}get type(){return El(this,Fl)}get destroyed(){return El(this,Ul)}}function Gl(){El(this,zl)&&El(this,zl).removeChild(El(this,Dl)),Il(this,zl,void 0),Il(this,Dl,void 0),Il(this,Nl,void 0),Il(this,Fl,void 0)}const Bl=100,Zl=Math.log(10)/Math.log(2);class jl extends lo{draw(t){const e=this.node,i=e.zoom,s=Math.pow(2,i%Zl),o=Bl*s,n=o/10,a=Math.min(n,Bl),r=n<10?0:(a-10)/90,l=e.origin,h=K(i),d=new Pe(-l.x*h,-l.y*h),c=b(d.x,o)-o,u=b(d.y,o)-o,p=this.node.theme;if(t.fillStyle=Hl(p.fillColor),t.fillRect(0,0,e.size.width,e.size.height),e.initialRendering)return;const m=1-Math.pow(1-r,2);m>0&&(t.fillStyle=Hl(function(t,e,i){if(0===i)return t;if(1===i)return e;return[ql(t[0],e[0],i),ql(t[1],e[1],i),ql(t[2],e[2],i)]}(p.fillColor,p.lineColor,m)),Kl(t,n,c,u,e.size.width,e.size.height)),t.fillStyle=Hl(p.lineColor),Kl(t,o,c,u,e.size.width,e.size.height)}}function Kl(t,e,i,s,o,n){i=b(i,e),s=b(s,e),o=Math.ceil(o),n=Math.ceil(n);const a=Math.ceil(o/e),r=Math.ceil(n/e);for(let s=0;s<a;++s)t.fillRect(i+s*e,0,1,n);for(let i=0;i<r;++i)t.fillRect(0,s+i*e,o,1)}function Hl(t){return"rgb("+t.join(",")+")"}function ql(t,e,i){return Math.round(e*i+t*(1-i))}const Vl=rt({Airport:"Airport",AmusementPark:"AmusementPark",AnimalService:"AnimalService",Aquarium:"Aquarium",ATM:"ATM",AutomotiveRepair:"AutomotiveRepair",Bakery:"Bakery",Bank:"Bank",Baseball:"Baseball",Basketball:"Basketball",Beach:"Beach",Beauty:"Beauty",Bowling:"Bowling",Brewery:"Brewery",Cafe:"Cafe",Campground:"Campground",CarRental:"CarRental",Castle:"Castle",ConventionCenter:"ConventionCenter",Distillery:"Distillery",EVCharger:"EVCharger",Fairground:"Fairground",FireStation:"FireStation",Fishing:"Fishing",FitnessCenter:"FitnessCenter",FoodMarket:"FoodMarket",Fortress:"Fortress",GasStation:"GasStation",GoKart:"GoKart",Golf:"Golf",Hiking:"Hiking",Hospital:"Hospital",Hotel:"Hotel",Kayaking:"Kayaking",Landmark:"Landmark",Laundry:"Laundry",Library:"Library",Mailbox:"Mailbox",Marina:"Marina",MiniGolf:"MiniGolf",MovieTheater:"MovieTheater",Museum:"Museum",MusicVenue:"MusicVenue",NationalMonument:"NationalMonument",NationalPark:"NationalPark",Nightlife:"Nightlife",Park:"Park",Parking:"Parking",Pharmacy:"Pharmacy",Planetarium:"Planetarium",Police:"Police",PostOffice:"PostOffice",PublicTransport:"PublicTransport",Restaurant:"Restaurant",Restroom:"Restroom",RockClimbing:"RockClimbing",RVPark:"RVPark",School:"School",SkatePark:"SkatePark",Skating:"Skating",Skiing:"Skiing",Soccer:"Soccer",Spa:"Spa",Stadium:"Stadium",Store:"Store",Surfing:"Surfing",Swimming:"Swimming",Tennis:"Tennis",Theater:"Theater",University:"University",Volleyball:"Volleyball",Winery:"Winery",Zoo:"Zoo"});function Yl(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Xl(t){return t.map((t=>{if(!C(t,Vl))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.PointOfInterestCategory.");return t}))}class $l{constructor(t={}){if(Yl(this,"_includes",null),Yl(this,"_excludes",null),void 0!==(t=A(t)).includes&&void 0!==t.excludes)throw new Error("[MapKit] `includes` and `excludes` may not be specified at the same time.");if(void 0===t.includes&&void 0===t.excludes)throw new Error("[MapKit] Either `includes` or `excludes` should be specified.");void 0!==t.includes&&(this._includes=Xl(t.includes)),void 0!==t.excludes&&(this._excludes=Xl(t.excludes))}includesCategory(t){if(!C(t,Vl))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.PointOfInterestCategory.");return this._includes?this._includes.includes(t):this._excludes?!this._excludes.includes(t):void 0}excludesCategory(t){if(!C(t,Vl))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.PointOfInterestCategory.");return this._includes?!this._includes.includes(t):this._excludes?this._excludes.includes(t):void 0}static including(t){return M(t,"[MapKit] PointOfInterestFilter.including expected an array of categories."),new $l({includes:t})}static excluding(t){return M(t,"[MapKit] PointOfInterestFilter.excluding expected an array of categories."),new $l({excludes:t})}}Yl($l,"excludingAllCategories",void 0),Yl($l,"includingAllCategories",void 0);const Jl=$l.excluding([]),Ql=$l.including([]),th=function(){throw new Error("[MapKit] `PointOfInterestFilter` may not be constructed directly. Use the mapkit.PointOfInterestFilter.including or the mapkit.PointOfInterestFilter.excluding methods.")};$l.prototype.constructor=th,th.prototype=$l.prototype,Object.defineProperties(th,{including:{get:function(){return $l.including.bind($l)},configurable:!0},excluding:{get:function(){return $l.excluding.bind($l)},configurable:!0},includingAllCategories:{get:()=>Jl},excludingAllCategories:{get:()=>Ql}});const eh=Symbol(),ih=Symbol();function sh(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function oh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}
2function nh(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}var ah=new WeakMap;class rh extends uo{constructor(...t){super(...t),oh(this,"delegate",null),oh(this,"_impl",void 0),sh(this,ah,{writable:!0,value:new e})}addEventListener(...t){return nh(this,ah).addEventListener(...t)}removeEventListener(...t){return nh(this,ah).removeEventListener(...t)}dispatchEvent(...t){return nh(this,ah).dispatchEvent(...t)}deactivate(){this._impl.deactivate()}destroy(t){this._impl.destroy(t)}get element(){return this._impl.element}get camera(){return this._impl.camera}get minZoomLevel(){return this._impl.currentMinZoomLevel}get maxZoomLevel(){return this._impl.currentMaxZoomLevel}get usesInteractionCenter(){return this._impl.usesInteractionCenter}set usesInteractionCenter(t){this._impl.usesInteractionCenter=t}get currentGestureType(){return this._impl.currentGestureType}set currentGestureType(t){this._impl.currentGestureType=t}get configuration(){return this._impl.configuration}set configuration(t){this._impl.configuration=t}get tint(){return this._impl.tint}get tileTint(){return this._impl.tileTint}get emphasis(){return this._impl.emphasis}get language(){return this._impl.language}set language(t){this._impl.language=t}get allowWheelToZoom(){return this._impl.allowWheelToZoom}set allowWheelToZoom(t){this._impl.allowWheelToZoom=t}get allowWheelToZoom2(){return this._impl.allowWheelToZoom2}set allowWheelToZoom2(t){this._impl.allowWheelToZoom2=t}get pointOfInterestFilter(){return this._impl.pointOfInterestFilter}set pointOfInterestFilter(t){this._impl.pointOfInterestFilter=t}setPoiFiltered(t,e){this._impl.setPoiFiltered&&this._impl.setPoiFiltered(t,e)}get backgroundGridTheme(){return this._impl.backgroundGridTheme}set backgroundGridTheme(t){this._impl.backgroundGridTheme=t}get size(){return this._impl.size}set size(t){this._impl.size=t}get rotation(){return this._impl.rotation}set rotation(t){this._impl.rotation=t}getRotation(){return this._impl.rotation}get isRotationEnabled(){return this._impl.isRotationEnabled}set isRotationEnabled(t){this._impl.isRotationEnabled=t}get isRotationLocked(){return this._impl.isRotationLocked}get cameraIsPanning(){return this._impl.cameraIsPanning}get pannable(){return this._impl.pannable}set pannable(t){this._impl.pannable=t}get cameraIsZooming(){return this._impl.cameraIsZooming}get zoomable(){return this._impl.zoomable}set zoomable(t){this._impl.zoomable=t}get cameraIsRotating(){return this._impl.cameraIsRotating}get cameraIsAnimating(){return!!this._impl.cameraAnimation}get zoomLevel(){return this._impl.zoomLevel}set zoomLevel(t){this._impl.setZoomLevelAnimated(t)}set fontSizeRatio(t){this._impl.fontSizeRatio=t}setZoomLevelAnimated(t,e){this._impl.setZoomLevelAnimated(t,e)}setCameraDistanceAnimated(t,e){this._impl.setCameraDistanceAnimated(t,e)}getCurrentCameraDistance(){return this._impl.getCurrentCameraDistance()}get cameraZoomRange(){return this._impl.cameraZoomRange}setCameraZoomRangeAnimated(t,e){this._impl.setCameraZoomRangeAnimated(t,e)}setCameraZoomLevelLimitAnimated(t,e){this._impl.setCameraZoomLevelLimitAnimated(t,e)}zoomLevelForCameraDistanceAtY(t,e){return this._impl.zoomLevelForCameraDistanceAtY(t,e)}get visibleMapRect(){return this._impl.visibleMapRect}set visibleMapRect(t){this._impl.setVisibleMapRectAnimated(t)}setVisibleMapRectAnimated(t,e){this._impl.setVisibleMapRectAnimated(t,e)}setCenterAnimated(t,e){this._impl.setCenterAnimated(t,e)}setCameraBoundaryAnimated(t,e){this._impl.setCameraBoundaryAnimated(t,e)}isMapPointWithinBounds(t){return this._impl.isMapPointWithinBounds(t)}get showsDefaultTiles(){return this._impl.showsDefaultTiles}set showsDefaultTiles(t){this._impl.showsDefaultTiles=t}get tileOverlays(){return this._impl.tileOverlays}set tileOverlays(t){this._impl.tileOverlays=t}addTileOverlay(t){return this._impl.addTileOverlay(t)}addTileOverlays(t){return this._impl.addTileOverlays(t)}removeTileOverlay(t){return this._impl.removeTileOverlay(t)}removeTileOverlays(t){return this._impl.removeTileOverlays(t)}adjustMapItemPoint(t){return this._impl.adjustMapItemPoint(t)}cameraWillStartZooming(t,e,i){return this._impl.cameraWillStartZooming(t,e,i)}cameraDidStopZooming(){this._impl.cameraDidStopZooming()}get fullyRendered(){return this._impl.fullyRendered}devicePixelRatioDidChange(){return this._impl.devicePixelRatioDidChange()}stringInfo(){return this._impl.stringInfo()}get snapsToIntegralZoomLevels(){return this._impl.snapsToIntegralZoomLevels}set snapsToIntegralZoomLevels(t){this._impl.snapsToIntegralZoomLevels=t}migrateStateTo(t){return this._impl.migrateStateTo(t)}createLabelRegion(){return this._impl.createLabelRegion()}updatedLabelRegion(){this._impl.updatedLabelRegion()}unregisterLabelRegion(t){this._impl.unregisterLabelRegion(t)}setCameraAnimated(t,e,i){this._impl.setCameraAnimated(t,e,i)}setTintAndEmphasis(t,e,i){this._impl.setTintAndEmphasis(t,e,i)}compassRotationWillStart(){return this._impl.compassRotationWillStart()}compassRotationDidEnd(){this._impl.compassRotationDidEnd()}forceRerender(){}forceDraw(){}requireRender(){}getMemoryStatistics(){return{}}get[eh](){return this._impl[eh]}set[eh](t){this._impl[eh]=t}[ih](t){return this._impl[ih](t)}}function lh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class hh{constructor(t,e,i,s){lh(this,"center",void 0),lh(this,"_zoom",void 0),lh(this,"_pointsPerAxis",void 0),lh(this,"viewportSize",void 0),lh(this,"_rotation",void 0),this.center=t||new it(.5,.5),this._zoom=e||3,this._pointsPerAxis=K(this._zoom),this.zoom=e||3,this.viewportSize=i||new at,this._rotation=s||0}get zoom(){return this._zoom}set zoom(t){this._zoom!==t&&(this._zoom=t||3,this._pointsPerAxis=K(this._zoom))}get worldSize(){return this._pointsPerAxis}get rotation(){return this._rotation}set rotation(t){const e=b(t,360);this._rotation=e}minX(){if(0===this._pointsPerAxis)return 0;const t=this.viewportSize.width/this._pointsPerAxis;return this.center.x-t/2}
2minY(){if(0===this._pointsPerAxis)return 0;const t=this.viewportSize.height/this._pointsPerAxis;return this.center.y-t/2}maxX(){if(0===this._pointsPerAxis)return 0;const t=this.viewportSize.width/this._pointsPerAxis;return this.center.x+t/2}maxY(){if(0===this._pointsPerAxis)return 0;const t=this.viewportSize.height/this._pointsPerAxis;return this.center.y+t/2}equals(t){return this.zoom===t.zoom&&this.center.equals(t.center)&&this.viewportSize.equals(t.viewportSize)&&this.rotation===t.rotation}copy(){return new hh(this.center,this.zoom,this.viewportSize,this.rotation)}toString(){return"Camera("+["center: ["+this.center.x+", "+this.center.y+"]","zoom: "+this.zoom,"viewportSize: "+this.viewportSize.toString(),"rotation: "+this.rotation].join(", ")+")"}toMapRect(){if(0===this._pointsPerAxis)return new ot(this.center.x,this.center.y,0,0);const t=this.viewportSize.width/this._pointsPerAxis,e=this.viewportSize.height/this._pointsPerAxis,i=Object.create(it.prototype);i.x=this.center.x-t/2,i.y=this.center.y-e/2;const s=Object.create(st.prototype);s.width=t,s.height=e;const o=Object.create(ot.prototype);return o.origin=i,o.size=s,o}toRenderingMapRect(){let t=[new Pe(this.minX(),this.minY()),new Pe(this.maxX(),this.minY()),new Pe(this.maxX(),this.maxY()),new Pe(this.minX(),this.maxY())];if(0!==this.rotation){const e=(new gi).rotate(this.rotation);t=t.map((t=>e.transformPoint(t)))}let e=t[0].x,i=t[0].y,s=t[0].x,o=t[0].y;for(let n=1;n<t.length;++n){const a=t[n];a.x<e&&(e=a.x),a.x>s&&(s=a.x),a.y<i&&(i=a.y),a.y>o&&(o=a.y)}const n=s-e,a=o-i;return new ot(this.center.x-n/2,this.center.y-a/2,n,a)}translate(t){if(0===this._pointsPerAxis)return this.copy();if(0!==this.rotation){t=(new gi).rotate(-this.rotation).transformPoint(t)}const e=Math.round(t.x)/this._pointsPerAxis,i=Math.round(t.y)/this._pointsPerAxis,s=Object.create(it.prototype);s.x=b(this.center.x-e,1),s.y=b(this.center.y-i,1);const o=Object.create(hh.prototype);return o.center=s,o._zoom=this._zoom,o._pointsPerAxis=this._pointsPerAxis,o.viewportSize=this.viewportSize,o._rotation=this._rotation,o}transformMapPoint(t){const e=this.viewportSize.width,i=this.viewportSize.height,s=this._pointsPerAxis,o=(new gi).translate(-this.minX()*s,-this.minY()*s).scale(s).transformPoint(t),n=(new gi).translate(e/2,i/2).rotate(this.rotation).translate(e/-2,i/-2).transformPoint(o);return new it(n.x,n.y)}transformGestureCenter(t){if(0===this.rotation)return t;const e=this.viewportSize.width,i=this.viewportSize.height;return(new gi).translate(e/2,i/2).rotate(-this.rotation).translate(-e/2,-i/2).transformPoint(t)}rotateAroundCenter(t,e){const i=(new gi).translate(t.x,t.y).rotate(-e).translate(-t.x,-t.y).transformPoint(new Pe(this.center.x,this.center.y));this.center=new it(i.x,i.y),this.rotation+=e}withNewMapRect(t,e,i){const s=j(t,i=i||this.viewportSize,z);return new hh(new it(t.midX(),t.midY()),e?Math.floor(s):s,i,this.rotation)}}function dh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ch{constructor(t,e,i,s){dh(this,"map",void 0),dh(this,"_startCamera",void 0),dh(this,"_endCamera",void 0),dh(this,"_duration",void 0),dh(this,"_rotationCenter",void 0),dh(this,"_startTime",void 0),dh(this,"_canceled",!1),dh(this,"unconstrained",!1),dh(this,"_zoomIsAdditive",!1),dh(this,"_rotationDelta",void 0),dh(this,"_startRect",void 0),dh(this,"_animatedEndRect",void 0),this.map=t,this._startCamera=e,this._endCamera=i,this._duration=250,this._rotationCenter=s,t.snapsToIntegralZoomLevels&&(i.zoom=Math.round(i.zoom)),this._updateAnimationRects(),this._startTime=null,this._schedule()}cancel(){this._canceled=!0}get zooming(){return this._startCamera.zoom!==this._endCamera.zoom}set additiveZoom(t){this._zoomIsAdditive=!0,this._endCamera.zoom=t,this._updateAnimationRects()}get zoomIsAdditive(){return this._zoomIsAdditive}get rotating(){return this._startCamera.rotation!==this._endCamera.rotation}adjustRotation(t,e){this._startCamera.rotateAroundCenter(t,e),this._endCamera.rotateAroundCenter(t,e),this._updateAnimationRects()}updateViewportSize(t){this._startCamera=new hh(this._startCamera.center,this._startCamera.zoom,t,this._startCamera.rotation),this._endCamera=new hh(this._endCamera.center,this._endCamera.zoom,t,this._endCamera.rotation),this._updateAnimationRects()}performScheduledUpdate(t){this._canceled||(null==t?this._animationDidProgress(1):null==this._startTime?(this._startTime=t,this._schedule()):this._animationDidProgress(Math.min((t-this._startTime)/this._duration,1)))}_updateAnimationRects(){if(this._rotationDelta=this._endCamera.rotation-this._startCamera.rotation,Math.abs(this._rotationDelta)>180&&(this._rotationDelta=this._endCamera.rotation+360-this._startCamera.rotation),this._rotationCenter)return;this._startRect=this._startCamera.toMapRect(),this._animatedEndRect=this._endCamera.toMapRect();const t=this._startCamera.center.x-this._endCamera.center.x;Math.abs(t)>.5&&(t<0?this._startRect.origin.x+=1:this._animatedEndRect.origin.x+=1)}
2_schedule(){si(this)}_animationDidProgress(t){if(1===t)return this.map.snapsToIntegralZoomLevels&&(this._endCamera.zoom=Math.round(this._endCamera.zoom)),this.map.cameraAnimationDidProgress(this._endCamera),void this.map.cameraAnimationDidEnd();this._rotationCenter?this._animateAroundCenter(t):this._animateRects(t),this._schedule()}_animateAroundCenter(t){const e=this._startCamera.copy();e.rotateAroundCenter(this._rotationCenter,t*this._rotationDelta),this.map.cameraAnimationDidProgress(e)}_animateRects(t){const e=this._startRect,i=this._animatedEndRect,s=e.origin.x,o=e.origin.y,n=e.size.width,a=e.size.height,r=i.origin.x-e.origin.x,l=i.origin.y-e.origin.y,h=i.size.width-e.size.width,d=i.size.height-e.size.height;let c=this._endCamera.rotation-this._startCamera.rotation;Math.abs(c)>180&&(c=this._endCamera.rotation+360-this._startCamera.rotation);const u=new ot(s+r*t,o+l*t,n+h*t,a+d*t),p=this._startCamera.withNewMapRect(u);this.map.cameraAnimationDidProgress(p,this.unconstrained),this.map.rotation=this._startCamera.rotation+this._rotationDelta*t}}function uh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class ph{constructor(t){uh(this,"_map",void 0),uh(this,"_startEventType",void 0),this._map=t,this._startEventType=ns?"pointerdown":as?"touchstart":"mousedown",this._map.element.addEventListener(this._startEventType,this)}handleEvent(t){("mousedown"===t.type||"touchstart"===t.type&&t.touches.length===t.changedTouches.length||"pointerdown"===t.type&&t.isPrimary)&&this._map.interactionDidStart()}destroy(){this._map.element.removeEventListener(this._startEventType,this)}}function mh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class gh{constructor(t){mh(this,"_map",void 0),mh(this,"_recognizers",void 0),this._map=t,this._recognizers=[]}get map(){return this._map}canTrustGestureCenter(t){return"numberOfTouchesRequired"in t&&1===t.numberOfTouchesRequired||!(Cs()&&!ys()&&Ls())}addRecognizer(t){return this._recognizers.push(t),t.target=this.map.node.element,t.addEventListener("statechange",this),t}interrupt(){this._recognizers.forEach((t=>{t.enabled=!1,t.enabled=!0}))}centerForGesture(t){const e=this.map;return e.usesInteractionCenter||!this.canTrustGestureCenter(t)?e.interactionCenter:this._centerWithRecognizer(t)}_centerWithRecognizer(t){const e=this.map,i=t.locationInElement();let s=e.node.convertPointFromPage(i);s=e.camera.transformGestureCenter(s);const o=e.visibleMapRect,n=e.camera.viewportSize;return new it(o.minX()+s.x/n.width*o.size.width,o.minY()+s.y/n.height*o.size.height)}destroy(){for(;this._recognizers.length;){const t=this._recognizers.pop();t.enabled=!1,t.target=null,t.removeEventListener("statechange",this)}}}function _h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const fh=1e8,yh=.995,vh=Oe.performanceMarkers.interactions;class bh extends gh{constructor(t){super(t),_h(this,"decelerating",!1),_h(this,"_timeAtPreviousFrame",void 0),_h(this,"_velocity",void 0);this.addRecognizer(new Ba).maximumNumberOfTouches=2}stopDecelerating(){this.decelerating&&this._decelerationEnded()}destroy(){super.destroy(),this.stopDecelerating()}handleEvent(t){const e=t.target,i=this.map;i.usesInteractionCenter&&i.cameraIsZooming||(e.state===ds.Began?(this.map.currentGestureType="drag",i.cameraWillStartPanning()):e.state!==ds.Ended&&e.state!==ds.Changed||(this._panMapCameraBy(e.translation),e.translation=new Pe),e.state===ds.Ended&&(this._startDeceleratingWithVelocity(e),this.decelerating||i.cameraDidStopPanning()),vh&&performance.measure("mapkit-map-pan-interaction",{start:e.lastEventTimeStamp,detail:e.state}))}performScheduledUpdate(t){const e=vh?performance.now():void 0;if(!this.decelerating)return;if(null==t)return void this._decelerationEnded();const i=t-this._timeAtPreviousFrame;if(i>300)return void this._decelerationEnded();const s=Math.exp(Math.log(yh)*i),o=yh*((1-s)/.0050000000000000044);if(this._panMapCameraBy(new Pe(this._velocity.x/1e3*o,this._velocity.y/1e3*o)),this._velocity.x*=s,this._velocity.y*=s,Math.abs(this._velocity.x)<=10&&Math.abs(this._velocity.y)<=10)return this._decelerationEnded(),void(vh&&performance.measure("mapkit-map-pan-deceleration",{start:e}));this._timeAtPreviousFrame=t,this._schedule(),vh&&performance.measure("mapkit-map-pan-deceleration",{start:e})}_panMapCameraBy(t){const e=this.map;e.setCameraAnimated(e.camera.translate(t))}_startDeceleratingWithVelocity(t){const e=t.velocity;this._velocity=e,this.map.cameraWillStopPanning();const i=Math.pow(e.x,2)+Math.pow(e.y,2);
2if(!(i<62500)){if(i>fh){const t=Math.sqrt(fh/i);this._velocity={x:e.x*t,y:e.y*t}}this.decelerating=!0,this._timeAtPreviousFrame=t.lastEventTimeStamp,this._schedule()}}_schedule(){si(this)}_decelerationEnded(){this.decelerating=!1,this.map.cameraDidStopPanning()}}const wh=Object.freeze({None:"None",CORS:"CORS",Unsupported:"Unsupported"}),Ch="function"==typeof ImageBitmap;const kh=class extends Wt{constructor(t,e,i){super(t,e),this.crossOrigin=null,this._request=null,this._options=i??{}}get image(){return this._request?.imageBitmap??null}get url(){return this._request?.url??null}get fallbackType(){return this._request?.fallbackType??wh.None}reuse(t,e){this._init(t,e)}async _loaderWillStart(){super._loaderWillStart();const t=this._getDelegate().urlForImageLoader;if(!t)return void this._loaderDidFail(null);const e={imageBitmap:null,url:t,abortController:"function"==typeof AbortController?new AbortController:null,fallbackType:wh.None},i=()=>{e===this._request&&this._loaderDidFail(null)};if(this._request=e,!Ch)return e.fallbackType=wh.Unsupported,void i();let s;try{const i={signal:e.abortController?.signal};this._options.withCredentials&&(i.credentials="include"),s=await fetch(t,i)}catch{return void i()}if(s.ok){if("opaque"===s.type)return e.fallbackType=wh.CORS,void i();try{const t=await s.blob();e.imageBitmap=await createImageBitmap(t)}catch{return void i()}(()=>{e===this._request&&this._loaderDidSucceed(e.imageBitmap)})()}else i()}_reset(){const t=this._request;this._request=null,t?.abortController?.abort(),super._reset()}static get FallbackType(){return wh}static get isSupported(){return Ch}};const Sh=class extends Wt{constructor(t,e){super(t,e),this._image=null,this.crossOrigin=null}get image(){return this._image}get url(){return this._image?.src??null}reuse(t,e){this._init(t,e)}_loaderWillStart(){super._loaderWillStart(),this._image||(this._image=document.createElement("img"));const t=this._getDelegate().urlForImageLoader;this._image.crossOrigin=this.crossOrigin,this._image.src=t,this._image.addEventListener("load",this),this._image.addEventListener("error",this)}handleEvent(t){switch(t.type){case"error":this._loaderDidFail(this._image);break;case"load":this._loaderDidSucceed(null)}}_reset(){this._image&&(this._image.removeEventListener("load",this),this._image.removeEventListener("error",this)),super._reset()}};function Lh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Mh{constructor(t){Lh(this,"target",void 0),Lh(this,"type",void 0),Lh(this,"defaultPrevented",!1),Lh(this,"_stoppedPropagation",!1),this.target=null,this.type=t,this._stoppedPropagation=!1}stopPropagation(){this._stoppedPropagation=!0}preventDefault(){this.defaultPrevented=!0}}class Ah{constructor(){Lh(this,"_listeners",void 0)}addEventListener(t,e,i){i=i??null,this._listeners||(this._listeners={});const s=this._listeners[t]??[];this._listeners[t]=s;for(const{listener:t,thisObject:o}of s)if(t===e&&o===i)return!1;return s.push({thisObject:i,listener:e}),!0}removeEventListener(t,e,i){if(i=i??null,!this._listeners)return!1;if("string"!=typeof t){for(const t in this._listeners)this.removeEventListener(t,e,i);return!1}const s=this._listeners[t];if(!s)return!1;const o=s.findIndex((({listener:t,thisObject:s})=>e===t&&i===s||!e&&i&&i===s));return o>-1&&s.splice(o,1),0===s.length&&delete this._listeners[t],o>-1}dispatchEvent(t){if(t.target=this,!this._listeners)return!0;const e=this._listeners[t.type];if(!e||t._stoppedPropagation)return!0;const i=e.slice(0);for(const{listener:e,thisObject:s}of i)if("function"==typeof e?jt(e,s??null,[t]):s||jt(e.handleEvent.bind(e),e,[t]),t._stoppedPropagation)break;return!t.defaultPrevented}}function Th(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const xh=["minimumZ","maximumZ","opacity","data"];class Eh{constructor(t,e,i){Th(this,"_public",void 0),Th(this,"stale",void 0),Th(this,"_minimumZ",null),Th(this,"_maximumZ",null),Th(this,"_urlTemplate",void 0),Th(this,"_opacity",void 0),Th(this,"_data",{}),Th(this,"withCredentials",!1),Th(this,"crossOrigin",!1),this._public=t,void 0!==(i=A(i)).minimumZ&&(this.minimumZ=i.minimumZ),void 0!==i.maximumZ&&(this.maximumZ=i.maximumZ),void 0!==i.opacity&&(this.opacity=i.opacity),void 0!==i.data&&(this.data=i.data),Object.keys(i).forEac
2h((t=>{xh.includes(t)||console.warn("[MapKit] Unknown option: "+t+". Use the data property to store custom data.")})),this._urlTemplate=e,this.urlTemplate=e,void 0===this._opacity&&(this.opacity=1),this.stale=!1}get urlTemplate(){return this._urlTemplate}set urlTemplate(t){const e=typeof t;if("function"!==e&&"string"!==e){const e="[MapKit] TileOverlay.urlTemplate expected a function or a string, but got `"+t.toString()+"` instead.";throw new TypeError(e)}this._urlTemplate=t}keyForTile(t,e,i){return this._minimumZ+"-"+this._maximumZ+"-"+this.urlForImageLoader(t,e,i,1)}get minimumZ(){return this._minimumZ}get minZoomLevel(){return this._minimumZ}set minimumZ(t){S(t,"number","[MapKit] TileOverlay.minimumZ expected a number, but got `"+t+"` instead."),this._minimumZ=Math.floor(t)}get maximumZ(){return this._maximumZ}get maxZoomLevel(){return this._maximumZ}set maximumZ(t){S(t,"number","[MapKit] TileOverlay.maximumZ expected a number, but got `"+t+"` instead."),this._maximumZ=Math.ceil(t)}get opacity(){return this._opacity}set opacity(t){S(t,"number","[MapKit] TileOverlay.opacity expected a number, but got `"+t+"` instead."),this._opacity=w(t,0,1);const e=new Oh(this._public,this._opacity);this._public.dispatchEvent(e)}get data(){return this._data}set data(t){S(t,"object","[MapKit] TileOverlay.data expected an Object, but got `"+t+"` instead."),this._data=t}reload(){this.stale=!0;const t=new Ih(this._public);this._public.dispatchEvent(t)}reloadComplete(){this.stale=!1}urlForImageLoader(t,e,i,s){if("function"==typeof this._urlTemplate)return jt(this._urlTemplate,null,[t,e,i,s,this._data],"");const o=this._urlTemplate.replace(/\{/g,"{{").replace(/\}/g,"}}");const n={};return this._data&&Object.keys(this._data).forEach((t=>{n[t]=this._data[t]})),n.x=t.toString(),n.y=e.toString(),n.z=i.toString(),n.scale=s.toString(),T(o,n)}dispatchErrorForURL(t){const e=new Ph(this._public,t);this._public.dispatchEvent(e)}}Th(Eh,"RELOAD_EVENT","tile-overlay-reload"),Th(Eh,"OPACITY_EVENT","tile-overlay-opacity-changed"),Th(Eh,"ERROR_EVENT","tile-error");class Ih extends Mh{constructor(t){super(Eh.RELOAD_EVENT),this.tileOverlay=t}}class Oh extends Mh{constructor(t,e){super(Eh.OPACITY_EVENT),this.tileOverlay=t,this.opacity=e}}class Ph extends Mh{constructor(t,e){super(Eh.ERROR_EVENT),this.tileOverlay=t,this.tileUrl=e}}function Rh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const zh={},Dh=kh.isSupported?kh:Sh;let Nh=Dh,Fh=!1;class Uh{constructor(t,e,i,s,o,n,a,r,l,h,d){Rh(this,"x",void 0),Rh(this,"y",void 0),Rh(this,"z",void 0),Rh(this,"tileSource",void 0),Rh(this,"tint",void 0),Rh(this,"emphasis",void 0),Rh(this,"language",void 0),Rh(this,"poi",void 0),Rh(this,"labels",void 0),Rh(this,"resolution",void 0),Rh(this,"_priority",void 0),Rh(this,"_loader",void 0),Rh(this,"_doneLoadingCallback",void 0),Rh(this,"image",null),Rh(this,"url",null),this.x=t,this.y=e,this.z=i,this.tileSource=s,this.tint=o,this.emphasis=n,this.language=a,this.poi=r?1:0,this.labels=l?1:0,this.resolution=h,this._priority=d,this._loader=null}get preferredOpacity(){return"opacity"in this.tileSource&&"number"==typeof this.tileSource.opacity?this.tileSource.opacity:1}get loaderState(){return this._loader?this._loader.state:Ut.Unscheduled}schedule(){this._loader||(this._loader=function(t,e){const i={withCredentials:e.tileSource.withCredentials};return e.tileSource.crossOrigin?new Nh(t,e,i):new Dh(t,e,i)}(this._priority,this),this._setLoaderCrossOriginMode()),this._loader.state>Ut.Unscheduled||this._loader.schedule()}unschedule(){if(!this._loader)return;this._loader.unschedule()&&(this._loader=null)}whenDoneLoading(t){this._doneLoadingCallback=t}get urlForImageLoader(){const t=this.tileSource;if("urlForImageLoader"in t&&"function"==typeof t.urlForImageLoader)return t.urlForImageLoader(this.x,this.y,this.z,this.resolution);const e=t.domains,i=t.protocol,s=t.supportedResolutions[0],o=t.supportedResolutions[t.supportedResolutions.length-1],n=w(this.resolution,s,o);let a=1;if("satellite"===t.name){const e=t.supportedSizes.length-1,i=t.supportedSizes[0],s=t.supportedSizes[e];a=w(this.resolution,i,s)}let r=T(t.path,{x:this.x.toString(),y:this.y.toString(),z:this.z.toString(),resolution:n.toString(),tileSizeIndex:a.toString(),lang:this.language,poi:this.poi.toString()});"satellite"!==t.name&&(0===this.labels?r+="&labels=0&tint="+this.tint+"&emphasis="+this.emphasis:r+="&emphasis="+this.emphasis+"&tint="+this.tint);let l=zh[r];if(l)return l;const h=e[Math.floor(76731.36742*(this.x+this.y))%e.length];return l=Oe.applyProxyPrefix(i+"//"+h+r),zh[r]=l,l}loaderDidSucceed(){this._loaderDidComplete()}loaderDidFail(t){t instanceof kh&&t.fallbackType===kh.FallbackType.CORS?(Fh||(Fh=!0,console.warn(`Opaque response detected when loading image from ${t.url}. This may occur if the resource does not support CORS. Loading images this way will not be supported in future releases of MapKit JS.`)),Nh=Sh,this._loader=null,this.schedule()):this._loaderDidComplete()}_setLoaderCrossOriginMode(){this.tileSource.crossOrigin&&(this._loader.crossOrigin=ra(this.tileSource.withCredentials))}_loaderDidComplete(){this.image=this._loader.image,this.url=this._loader.url,"function"==typeof this._doneLoadingCallback&&(this._doneLoadingCallback(this),delete this._doneLoadingCallback)}}
2function Wh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Gh extends e{constructor(t,e,i,s,o,n,a){super(),Wh(this,"key",void 0),Wh(this,"x",void 0),Wh(this,"y",void 0),Wh(this,"z",void 0),Wh(this,"resolution",void 0),Wh(this,"priority",void 0),Wh(this,"settings",void 0),Wh(this,"tileImages",[]),Wh(this,"_refCount",0),Wh(this,"loading",!1),Wh(this,"loaded",!1),Wh(this,"_pendingTileImageLoads",0),this.key=t,this.x=e,this.y=i,this.z=s,this.settings=o,this.resolution=n,this.priority=a}get tileSources(){return(this.settings.showsDefaultTiles?this.settings.configuration.tileSources:[]).concat(this.settings.tileOverlays.map((t=>t._impl)).filter((t=>!!t.urlForImageLoader(this.x,this.y,this.z,this.resolution)))).filter((t=>("number"!=typeof t.minZoomLevel||this.z>=t.minZoomLevel)&&("number"!=typeof t.maxZoomLevel||this.z<=t.maxZoomLevel)))}schedule(){this.loaded||(this.tileImages.forEach((t=>{t.schedule()})),this.loading=!0)}unschedule(){this.tileImages.forEach((t=>{t.unschedule()})),this.loading=!1}_loadTileImages(){if(this.loading)return;if(this.loaded){if(!this._containsCanceledTileImages())return;this.tileImages=[],this.loaded=!1}this.loading=!0;const t=this.tileSources;0!==t.length?(this._pendingTileImageLoads=t.length,t.forEach((t=>this._loadTileImage(t)))):this._allTileImagesDoneLoading()}_loadTileImage(t){const e=this.settings,i=new Uh(this.x,this.y,this.z,t,e.tint,e.emphasis,e.language,e.showsPOI,e.showsLabels,this.resolution,this.priority);i.schedule(),this.tileImages.push(i),i.whenDoneLoading((()=>this._tileImageDoneLoading(t,i)))}_requestTileImageLoadStatus(t,e){const i=Nt(e);i.open("GET",t.url,!0),i.send()}_tileImageDoneLoading(t,e){if(e._loader.state===Ut.Failed)if("dispatchErrorForURL"in t&&"function"==typeof t.dispatchErrorForURL)t.dispatchErrorForURL(e._loader.url);else{const t=new Bh(e);this.dispatchEvent(t)}this._pendingTileImageLoads--,0===this._pendingTileImageLoads&&this._allTileImagesDoneLoading()}_allTileImagesDoneLoading(){this.loading=!1,this.loaded=!0,this._containsCanceledTileImages()||this.dispatchEvent(new i(Gh.Events.LoadSuccess))}_containsCanceledTileImages(){return this.tileImages.some((t=>t.loaderState===Ut.Canceled))}}Wh(Gh,"Events",{LoadSuccess:"tile-load-success",LoadFail:"tile-load-fail"});class Bh extends i{constructor(t){super(Gh.Events.LoadFail),Wh(this,"tileImage",void 0),this.tileImage=t}}const Zh={},jh={tilesForTileData(t){const e=t.range,i=e.min.z,s=Math.pow(2,i),o=e.min,n=e.denormalize().max,a=new Pe((o.x+n.x)/2,(o.y+n.y)/2),r=[],l=Math.min(n.x,o.x+s-1);for(let t=o.x;t<=l;++t)for(let e=o.y;e<=n.y;++e)r.push(new Pe(t,e));return r.sort(((t,e)=>{const i=t.distanceToPoint(a)-e.distanceToPoint(a);return 0===i?t.x-e.x==0?t.y-e.y:t.x-e.x:i})),r.map((e=>function(t,e,i,s,o){const n=Kh(t,e,i,s);let a=Zh[n];a?a.schedule():(a=new Gh(n,t,e,i,s.settings,s.resolution,o),a.addEventListener(Gh.Events.LoadSuccess,Hh),a.addEventListener(Gh.Events.LoadFail,qh),Zh[n]=a,a._refCount=0,a._loadTileImages());return a._refCount++,a}(b(e.x,s),e.y,i,t,St.High)))},releaseTile(t,e){if(t._refCount--,0===t._refCount){t.unschedule();const i=Kh(t.x,t.y,t.z,e);delete Zh[i]}}};function Kh(t,e,i,s){return s.settings.configuration.provider+s.settings.configuration.countryCode+s.settings.configuration.name+t+"-"+e+"-"+i+s.settings.tint+s.settings.emphasis+s.settings.language+s.settings.showsPOI+s.settings.showsLabels+s.settings.showsDefaultTiles+s.settings.showsTileInfo+s.resolution+s.settings.tileOverlays.map((s=>s._impl.keyForTile(t,e,i))).join("-")}function Hh(t){const e=t.target;e.removeEventListener(Gh.Events.LoadSuccess,Hh),e.removeEventListener(Gh.Events.LoadFail,qh)}function qh(t){const e=t.target;delete Zh[e.key],e.removeEventListener(Gh.Events.LoadSuccess,Hh),e.removeEventListener(Gh.Events.LoadFail,qh)}function Vh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Yh{constructor(t,e){Vh(this,"min",void 0),Vh(this,"max",void 0),this.min=t,this.max=e}denormalize(){const t=this.min.copy(),e=this.max.copy();return e.x<t.x&&(e.x+=Math.pow(2,t.z)),new Yh(t,e)}toString(){return this.min.toString()+" -> "+this.max.toString()}equals(t){const e=this.denormalize(),i=t.denormalize();return i.min.x===e.min.x&&i.min.y===e.min.y&&i.max.x===e.max.x&&i.max.y===e.max.y&&i.min.z===e.min.z&&i.max.z===e.max.z}}function Xh(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class $h{constructor(t,e){Xh(this,"range",void 0),Xh(this,"settings",void 0),Xh(this,"resolution",void 0),Xh(this,"zoom",void 0),Xh(this,"mapRect",void 0),Xh(this,"_canceled",!1),Xh(this,"_tiles",void 0);const i=Qs(t.zoom),s=Math.pow(2,i),o=Math.pow(2,t.zoom)*z,n=t.viewportSize.width/o/2,a=t.viewportSize.height/o/2,r=new it(t.center.x-n,t.center.y-a),l=new it(t.center.x+n,t.center.y+a),h=s-1,d=Math.floor(r.x*s),c=Math.floor(l.x*s),u=w(Math.floor(r.y*s),0,h),p=w(Math.floor(l.y*s),0,h);this.range=new Yh(new Pe(d,u,i),new Pe(c,p,i)),this.settings=e,this.resolution=Ds(),this.zoom=i,this.mapRect=ne
2w ot(d/s,u/s,(c-d)/s,(p-u)/s),this.mapRect.size.width<0&&this.mapRect.size.width++}equals(t){return this.sameSettings(t)&&this.resolution===t.resolution&&this.range.equals(t.range)}sameSettings(t){const e=this.settings,i=t.settings;return e.configuration===i.configuration&&e.tint===i.tint&&e.emphasis===i.emphasis&&e.showsPOI===i.showsPOI&&e.showsLabels===i.showsLabels&&e.language===i.language&&e.showsDefaultTiles===i.showsDefaultTiles&&e.showsTileInfo===i.showsTileInfo&&this.sameTileOverlays(t)}sameTileOverlays(t){return this.settings.tileOverlays.length===t.settings.tileOverlays.length&&this.settings.tileOverlays.every(((e,i)=>e===t.settings.tileOverlays[i]&&!e._impl.stale),this)}sharesTileSourcesWithTileData(t){if(this.settings.tint!==t.settings.tint||this.settings.emphasis!==t.settings.emphasis)return!1;const e=this.settings.configuration.tileSources,i=t.settings.configuration.tileSources;return!("AutoNavi"!==this.settings.configuration.provider||"AutoNavi"!==t.settings.configuration.provider||1!==e.length||1!==i.length||!e[0]||"satellite"!==e[0].name&&"hybrid"!==e[0].name||!i[0]||"satellite"!==i[0].name&&"hybrid"!==i[0].name)||i.some((t=>e.includes(t)))}load(){this._tiles||(this._tiles=jh.tilesForTileData(this))}cancel(){if(!this._canceled&&(this._canceled=!0,this._tiles))for(let t=0,e=this._tiles,i=e.length;t<i;++t){e[t].unschedule()}}releaseTiles(){if(this._tiles)for(let t=0,e=this._tiles,i=e.length;t<i;++t){const i=e[t];jh.releaseTile(i,this)}}get tiles(){return this.load(),this._tiles}}class Jh extends Ah{constructor(t,e){var i,s,o;super(),o=void 0,(s="_impl")in(i=this)?Object.defineProperty(i,s,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[s]=o,this._impl=new Eh(this,t,e)}get urlTemplate(){return this._impl.urlTemplate}set urlTemplate(t){this._impl.urlTemplate=t}get minimumZ(){return this._impl.minimumZ}set minimumZ(t){this._impl.minimumZ=t}get maximumZ(){return this._impl.maximumZ}set maximumZ(t){this._impl.maximumZ=t}get opacity(){return this._impl.opacity}set opacity(t){this._impl.opacity=t}get data(){return this._impl.data}set data(t){this._impl.data=t}reload(){this._impl.reload()}}const Qh=(t,e)=>{let i=t;for(;i.parentNode!==document.body;){i=i.parentNode,window.ShadowRoot&&i instanceof window.ShadowRoot&&(i=i.host);const t=window.getComputedStyle(i);switch(e){case"x":if(["auto","scroll"].includes(t.overflowX)&&i.scrollWidth-1>i.clientWidth)return!0;break;case"y":if(["auto","scroll"].includes(t.overflowY)&&i.scrollHeight-1>i.clientHeight)return!0}if("fixed"===t.position)return!1}switch(e){case"x":{const t=window.getComputedStyle(document.body).overflowX,e=window.getComputedStyle(document.documentElement).overflowX;if(["auto","scroll","visible"].includes(t)&&["auto","scroll","visible"].includes(e)&&("CSS1Compat"===document.compatMode?document.documentElement.scrollWidth-1>document.documentElement.clientWidth:document.body.scrollWidth-1>document.body.clientWidth))return!0;break}case"y":{const t=window.getComputedStyle(document.body).overflowY,e=window.getComputedStyle(document.documentElement).overflowY;if(["auto","scroll","visible"].includes(t)&&["auto","scroll","visible"].includes(e)&&("CSS1Compat"===document.compatMode?document.documentElement.scrollHeight-1>document.documentElement.clientHeight:document.body.scrollHeight-1>document.body.clientHeight))return!0;break}}return!1};function td(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ed(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function id(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,od(t,e,"set"),i),i}function sd(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,od(t,e,"get"))}function od(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const nd=.0075,ad=100;function rd(t,e){switch(e){case WheelEvent.DOM_DELTA_LINE:t*=100/3*window.devicePixelRatio;break;case WheelEvent.DOM_DELTA_PAGE:t*=100*window.devicePixelRatio;case WheelEvent.DOM_DELTA_PIXEL:}return t}var ld=new WeakMap,hd=new WeakMap,dd=new WeakMap,cd=new WeakMap;class ud{constructor(){ed(this,ld,{writable:!0,value:!1}),ed(this,hd,{writable:!0,value:!1}),td(this,"allowWheelToZoom",!1),td(this,"allowWheelToZoom2",!0),td(this,"pannable",!1),td(this,"zoomable",!1),td(this,"element",void 0),ed(this,dd,{writable:!0,value:void 0}),ed(this,cd,{writable:!0,value:void 0})}classifyWheelEvent(t){if(!sd(this,ld)&&!sd(this,hd)&&!t.ctrlKey&&!t.shiftKey&&this.allowWheelToZoom2){const e=t.target;if(t.deltaX&&Qh(e,"x"))return;if(t.deltaY&&Qh(e,"y"))return}const e=!sd(this,ld)&&!sd(this,hd),i=function(t){return t.ctrlKey}(t),s=this.allowWheelToZoom||this.allowWheelToZoom2;if(!i&&!t.shiftKey&&!s)return;const o=function(t){const e=t.shiftKey&&!!t.deltaX&&!t.deltaY;let i=e?t.deltaX:t.deltaY;return i=rd(i,t.deltaMode),(t.ctrlKey||!t.shiftKey||e)&&(i*=-1),t.ctrlKey&&t.deltaMode===t.DOM_DELTA_PIXEL&&(i*=10),1+(i>0?Math.sqrt(i):-Math.sqrt(-i))*nd}(t),n=3*Math.abs(t.deltaX)>2*Math.abs(t.deltaY),a=this.allowWheelToZoom2&&!sd(this,hd)&&(sd(this,ld)||1===o||!t.shiftKey&&n);if((!a||this.pannable)&&(a||this.zoomable)){if(a?(clearTimeout(sd(this,dd)),id(this,dd,setTimeout((()=>{id(this,ld,!1)}),ad)),id(this,ld,!0)):(clearTimeout(sd(this,cd)),id(this,cd,setTimeout((()=>{id(this,hd,!1)}),ad)),id(this,hd,!0)),t.preventDefault(),a){const i=-rd(t.deltaX,t.deltaMode),s=-rd(t.deltaY,t.deltaMode);
2if(0===i&&0===s)return;return{is:"pan",translation:new Pe(i,s),isFirstEvent:e}}return{is:"zoom",scale:o,isFirstEvent:e}}}resetGesture(){clearTimeout(sd(this,dd)),clearTimeout(sd(this,cd)),id(this,ld,!1),id(this,hd,!1)}destroy(){clearTimeout(sd(this,dd)),clearTimeout(sd(this,cd))}}function pd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function md(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function gd(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}const _d=Oe.performanceMarkers.interactions,fd=Math.log2(1.03)/(1e3/60),yd=Math.log2(.97)/(1e3/60),vd=Math.log2(1.06)/(1e3/60),bd=Math.log2(.94)/(1e3/60),wd=Math.log2(1.0075),Cd=Math.log2(.9925);var kd=new WeakMap;class Sd{constructor(t){md(this,"map",void 0),md(this,"_previousZoomLevelDelta",[]),md(this,"pannable",!1),md(this,"zoomable",!1),md(this,"_cancelledWheelGestureTimeoutId",void 0),md(this,"_animating",!1),md(this,"_animationEndingTimeoutId",void 0),md(this,"_wheelEndTimeoutId",void 0),md(this,"zoomsIn",void 0),pd(this,kd,{writable:!0,value:new ud}),md(this,"_wheelPanning",!1),md(this,"_lastScaleCenter",void 0),md(this,"_lastUpdateTime",void 0),md(this,"_accumulatedZoomLevelDelta",void 0),md(this,"_accumulatedDesiredZoomLevelDelta",void 0),md(this,"_timeAtLastFrame",void 0),md(this,"_previousEstimatedSpeedPerMS",void 0),md(this,"_wheelZooming",!1),this.map=t,this.map.node.element.addEventListener("wheel",this)}destroy(){this.map.node.element.removeEventListener("wheel",this),clearTimeout(this._wheelEndTimeoutId),gd(this,kd).destroy(),this.map=null,this._animationEndingTimeoutId&&clearTimeout(this._animationEndingTimeoutId)}handleEvent(t){this._handleWheelZoom(t)}performScheduledUpdate(t=performance.now()){if(!this.map)return;const e=this.zoomsIn?Math.ceil(this._accumulatedDesiredZoomLevelDelta):Math.floor(this._accumulatedDesiredZoomLevelDelta),i=t-this._timeAtLastFrame,s=this._getEstimatedSpeedPerMS()*i;this._accumulatedZoomLevelDelta=this._accumulatedZoomLevelDelta+s,this._timeAtLastFrame=t;if(!(this.zoomsIn&&this._accumulatedZoomLevelDelta<e||!this.zoomsIn&&this._accumulatedZoomLevelDelta>e)){const t=this.map.zoomLevel,e=Math.round(this.map.zoomLevel);return this.map.scaleCameraAroundMapPoint(Math.pow(2,e-t),this._lastScaleCenter),this._animating=!1,this._previousEstimatedSpeedPerMS=void 0,void(this._animationEndingTimeoutId=setTimeout((()=>{this._animationEndingTimeoutId=void 0,this.map.cameraDidStopZooming()}),ad))}this.map.scaleCameraAroundMapPoint(Math.pow(2,s),this._lastScaleCenter),si(this)}resetWheelEventGesture(){gd(this,kd).resetGesture()}_handleWheelZoom(t){const e=this.map;gd(this,kd).pannable=this.pannable,gd(this,kd).zoomable=this.zoomable,gd(this,kd).allowWheelToZoom=e.allowWheelToZoom,gd(this,kd).allowWheelToZoom2=e.allowWheelToZoom2;const i=gd(this,kd).classifyWheelEvent(t);if(!i)return;if("pan"===i.is){if(i.isFirstEvent){e.currentGestureType="wheel";if(!e.cameraWillStartPanning())return;this._wheelPanning=!0}else if(!this._wheelPanning)return;return e.setCameraAnimated(e.camera.translate(i.translation)),this._wheelEndTimeoutId&&(clearTimeout(this._wheelEndTimeoutId),this._wheelEndTimeoutId=void 0),void(this._wheelEndTimeoutId=setTimeout((()=>{this._wheelEndTimeoutId=void 0,this._wheelPanning=!1,e.cameraWillStopPanning(),e.cameraDidStopPanning()}),ad))}const s=i.scale;if(1===s||s>1&&e.camera.zoom===e.currentMaxZoomLevel||s<1&&e.camera.zoom===e.currentMinZoomLevel)return;const o=new Pe(t.pageX,t.pageY);this._lastScaleCenter=e.usesInteractionCenter?e.interactionCenter:this._mapPointFromCentroid(o),e.snapsToIntegralZoomLevels?this._integralZoomToScale(s,this._lastScaleCenter,t.timeStamp,i.isFirstEvent):this._wheelZoomToScale(s,i.isFirstEvent),_d&&performance.measure("mapkit-map-zoom-interaction",{start:t.timeStamp,detail:"changed"})}_mapPointFromCentroid(t){const e=this.map;let i=e.node.convertPointFromPage(t);i=e.camera.transformGestureCenter(i);const s=e.visibleMapRect,o=e.camera.viewportSize;return new it(s.minX()+i.x/o.width*s.size.width,s.minY()+i.y/o.height*s.size.height)}_integralZoomToScale(t,e,i){this._lastUpdateTime=i;const s=Math.log2(t);if(this.zoomsIn=s>0,this._lastScaleCenter=e,this._previousZoomLevelDelta.push({delta:s,timestamp:i}),this._animating)return void(this._accumulatedDesiredZoomLevelDelta=this._accumulatedDesiredZoomLevelDelta+s);
2if(this._cleanupPreviousZoomLevelDelta(),Cd<=s&&s<=wd&&this._previousZoomLevelDelta.length<=1)return;const o=this.map;if(!(this._animating||this._animationEndingTimeoutId)){if(this._cancelledWheelGestureTimeoutId)return clearTimeout(this._cancelledWheelGestureTimeoutId),void(this._cancelledWheelGestureTimeoutId=setTimeout((()=>{this._cancelledWheelGestureTimeoutId=void 0}),ad));o.currentGestureType="wheel";if(!o.cameraWillStartZooming(wt.Scroll))return clearTimeout(this._cancelledWheelGestureTimeoutId),void(this._cancelledWheelGestureTimeoutId=setTimeout((()=>{this._cancelledWheelGestureTimeoutId=void 0}),ad))}this._animating=!0,this._accumulatedZoomLevelDelta=0,this._accumulatedDesiredZoomLevelDelta=s,this._timeAtLastFrame=i,this._animationEndingTimeoutId&&(clearTimeout(this._animationEndingTimeoutId),this._animationEndingTimeoutId=void 0),si(this)}_cleanupPreviousZoomLevelDelta(){const t=performance.now()-100,e=this.zoomsIn?1:-1,i=[];for(const{timestamp:s,delta:o}of this._previousZoomLevelDelta)s<t||o*e<0||i.push({timestamp:s,delta:o});this._previousZoomLevelDelta=i}_getEstimatedSpeedPerMS(){if(this._cleanupPreviousZoomLevelDelta(),this._previousZoomLevelDelta.length<=1)return this._previousEstimatedSpeedPerMS?this._previousEstimatedSpeedPerMS:this.zoomsIn?vd:bd;let t=this._previousZoomLevelDelta.reduce(((t,e)=>t+e.delta),0)/100;return yd<t&&t<fd&&(t=this.zoomsIn?fd:yd),this._previousEstimatedSpeedPerMS=t,t}_wheelZoomToScale(t,e){const i=this.map;if(e){i.currentGestureType="wheel";if(!i.cameraWillStartZooming(wt.Scroll))return;this._wheelZooming=!0}else if(!this._wheelZooming)return;i.scaleCameraAroundMapPoint(t,this._lastScaleCenter),this._wheelEndTimeoutId&&(clearTimeout(this._wheelEndTimeoutId),this._wheelEndTimeoutId=void 0),this._wheelEndTimeoutId=setTimeout((()=>{this._wheelEndTimeoutId=void 0,this._wheelZooming=!1,i.cameraDidStopZooming()}),ad)}}function Ld(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Md=Oe.performanceMarkers.interactions,Ad=Math.pow(1e-4,2.5);class Td extends gh{constructor(t){super(t),Ld(this,"_pinchRecognizer",void 0),Ld(this,"_doubleTapWithOneFingerRecognizer",void 0),Ld(this,"_singleTapWithTwoFingersRecognizer",void 0),Ld(this,"decelerating",!1),Ld(this,"_lastScaleCenter",void 0),Ld(this,"_startTime",void 0),Ld(this,"_scale",void 0),Ld(this,"_initialScale",void 0),Ld(this,"_initialVelocity",void 0),Ld(this,"_decelerationFactor",void 0),Ld(this,"_decelerationDuration",void 0),Ld(this,"_scaleAtDecelerationEnd",void 0),Ld(this,"_adjustedScaleAtDecelerationEnd",void 0),Ld(this,"_scaleAdjustment",void 0),this._pinchRecognizer=this.addRecognizer(new ul),this._pinchRecognizer.scaleThreshold=.1,this._doubleTapWithOneFingerRecognizer=this.addRecognizer(new Fa),this._doubleTapWithOneFingerRecognizer.numberOfTouchesRequired=1,this._doubleTapWithOneFingerRecognizer.numberOfTapsRequired=2,this._singleTapWithTwoFingersRecognizer=this.addRecognizer(new Fa),this._singleTapWithTwoFingersRecognizer.numberOfTouchesRequired=2,this._singleTapWithTwoFingersRecognizer.numberOfTapsRequired=1}stopDecelerating(){this.decelerating&&this._decelerationEnded()}destroy(){super.destroy(),delete this._pinchRecognizer,delete this._doubleTapWithOneFingerRecognizer,delete this._singleTapWithTwoFingersRecognizer,this.stopDecelerating()}get active(){return xd(this._pinchRecognizer)||xd(this._doubleTapWithOneFingerRecognizer)||xd(this._singleTapWithTwoFingersRecognizer)}handleEvent(t){const e=t.target;switch(e){case this._pinchRecognizer:this._handlePinchChange(e);break;case this._doubleTapWithOneFingerRecognizer:this._handleDoubleTapWithOneFingerChange(e);break;case this._singleTapWithTwoFingersRecognizer:this._handleSingleTapWithTwoFingersChange(e)}Md&&performance.measure("mapkit-map-zoom-interaction",{start:e.lastEventTimeStamp,detail:e.state})}performScheduledUpdate(t){const e=Md?performance.now():void 0;if(!this.decelerating)return;if(null==t)return void this._decelerationEnded();const i=this.map,s=t-this._startTime;if(s>=this._decelerationDuration)return i.scaleCameraAroundMapPoint(this._adjustedScaleAtDecelerationEnd/this._scale,this._lastScaleCenter),this._decelerationEnded(),void(Md&&performance.measure("mapkit-map-zoom-deceleration",{start:e}));let o=this._scaleAtTime(s);const n=(o-this._initialScale)/(this._scaleAtDecelerationEnd-this._initialScale);o+=this._scaleAdjustment*n,i.scaleCameraAroundMapPoint(o/this._scale,this._lastScaleCenter);const a=i.camera.zoom;a===i.currentMinZoomLevel||a===i.currentMaxZoomLevel?this.stopDecelerating():(this._scale=o,this._schedule()),Md&&performance.measure("mapkit-map-zoom-deceleration",{start:e})}_handlePinchChange(t){const e=this.map,i=e.camera,s=i.zoom;if(t.state===ds.Began)this._singleTapWithTwoFingersRecognizer.enabled=!1,this.map.currentGestureType="pinch",e.cameraWillStartZooming(wt.Pinch);else if(t.state===ds.Ended||t.state===ds.Changed){const i=t.scale;this._lastScaleCenter=this.centerForGesture(t),(i>1&&s!==e.currentMaxZoomLevel||i<1&&s!==e.currentMinZoomLevel)&&(e.scaleCameraAroundMapPoint(i,this._lastScaleCenter),t.scale=1)}if((t.state===ds.Ended||t.state===ds.Failed)&&(this._singleTapWithTwoFingersRecognizer.enabled=!0,this._startDeceleratingWithVelocity(t),!this.decelerating)){const t=e.snapsToIntegralZoomLevels?Math.round(s):s,o=w(t,e.currentMinZoomLevel,e.currentMaxZoomLevel);s===o?e.cameraDidStopZooming():this._lastScaleCenter?e.scaleCameraAroundMapPoint(Math.pow(2,o-s),this._lastScaleCenter,!0):e.setCameraAnimated(new hh(i.center,o,i.viewportSize,i.rotation),!0)}}_handleDoubleTapWithOneFingerChange(t){t.state===ds.Recognized&&this._zoomWithTapRecognizer(t,t.modifierKeys.alt)}_handleSingleTapWithTwoFingersChange(t){t.state===ds.Recognized&&this._zoomWithTapRecognizer(t,!0)}_zoomWithTapRecognizer(t,e){const i=this.map,s=i.camera.zoom,o=e?-1:1,n=(e?Math.floor(s+.5):Math.ceil(s-.5))+o,a=s-w(n,i.currentMinZoomLevel,i.currentMaxZoomLevel);this.map.currentGestureType="double-tap",Math.abs(a)<.5||!i.cameraWillStartZooming(wt.DoubleTap,!0,!0)||(i.setCameraAnimated(i.camera.withNewMapRect(i.visibleMapRect.scale(Math.pow(2,a),this.centerForGesture(t))),!0),Md&&performance.measure("mapkit-map-zoom-interaction",{start:t.lastEventTimeStamp,detail:t.state}))}_startDeceleratingWithVelocity(t){let e=t.velocity;Math.abs(e)<1||(8<e&&(e=8),e<-8&&(e=-8),this.decelerating=!0,this._startTime=t.lastEventTimeStamp,this._initialScale=this._scale=1,this._initialVelocity=e/1e3,this._decelerationFactor=.98875,this._decelerationDuration=Math.log(Ad/Math.pow(this._initialVelocity,2))/(2*Math.log(this._decelerationFactor)),this._scaleAtDecelerationEnd=this._scaleAtTime(this._decelerationDuration),this._adjustedScaleAtDecelerationEnd=this._adjustScaleAtDecelerationEnd(this._scaleAtDecelerationEnd/this._scale),this._scaleAdjustment=this._adjustedScaleAtDecelerationEnd-this._scaleAtDecelerationEnd,this._schedule())}_adjustScaleAtDecelerationEnd(t){const e=this.map,i=e.camera.zoom;let s=i+Math.log2(t);if(e.snapsToIntegralZoomLevels){let t=Math.round(s);s>i&&t<=i?t=Math.ceil(s):s<i&&t>=i&&(t=Math.floor(s)),s=t}const o=w(s,e.currentMinZoomLevel,e.currentMaxZoomLevel);return Math.pow(2,o-i)}_schedule(){si(this)}_scaleAtTime(t){return Math.max(this._initialScale+this._decelerationFactor*this._initialVelocity*(Math.pow(this._decelerationFactor,t)-1)/(this._decelerationFactor-1),0)}_decelerationEnded(){this.decelerating=!1;const t=this.map;if(t.snapsToIntegralZoomLevels){const e=t.camera,i=t.snapsToIntegralZoomLevels?Math.round(e.zoom):e.zoom;t.setCameraAnimated(new hh(e.center,i,e.viewportSize,e.rotation))}t.cameraDidStopZooming()}}function xd(t){return t.state===ds.Began||t.state===ds.Changed}function Ed(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Id=1-Math.pow(2,-52),Od=Math.PI/3,Pd=Math.tan(Od/2);class Rd{get fontSizeRatio(){return 1}set fontSizeRatio(t){}rotateCameraAroundMapPoint(){}get camera(){return this._camera}set camera(t){this._camera=t}constructor(t){Ed(this,"node",void 0),Ed(this,"_configuration",null),Ed(this,"_debug",!1),Ed(this,"_language",null),Ed(this,"allowWheelToZoom",!1),Ed(this,"allowWheelToZoom2",!0),Ed(this,"_pointOfInterestFilter",null),Ed(this,"_showsDefaultTiles",!0),Ed(this,"_tileOverlays",[]),Ed(this,"_filteredPois",new Set),Ed(this,"_",{[eh]:!1}),Ed(this,"_camera",new hh),Ed(this,"_element",document.createElement("div")),Ed(this,"_initialInteractionController",null),Ed(this,"_panController",null),Ed(this,"_wheelEventHandler",null),Ed(this,"_zoomController",null),Ed(this,"_rotationController",null),Ed(this,"minZoomLevel",Rd.DEFAULT_MIN_ZOOM_LEVEL),Ed(this,"maxZoomLevel",Rd.DEFAULT_MAX_ZOOM_LEVEL),Ed(this,"currentMinZoomLevel",this.minZoomLevel),Ed(this,"currentMaxZoomLevel",this.maxZoomLevel),Ed(this,"usesInteractionCenter",!1),Ed(this,"currentGestureType",!1),Ed(this,"cameraAnimation",null),Ed(this,"_isRotationEnabled",!1),Ed(this,"isRotationLocked",!0),Ed(this,"_snapsToIntegralZoomLevels",!1),Ed(this,"_tint",void 0),Ed(this,"_tileTint",void 0),Ed(this,"_emphasis",void 0),Ed(this,"_visibleMapRect",void 0),Ed(this,"_panning",!1),Ed(this,"_zooming",!1),Ed(this,"_rotating",!1),Ed(this,"_backgroundGridTheme",void 0),Ed(this,"_cameraBoundaryRect",void 0),Ed(this,"_cameraBeforeBoundaryChange",void 0),Ed(this,"_pendingCameraDistance",void 0),Ed(this,"_cameraDistance",void 0),Ed(this,"_cameraZoomRange",void 0),Ed(this,"_cameraZoomLevelLimit",void 0),Ed(this,"_pendingCameraDrawingReadiness",void 0),Ed(this,"_pointAdjustmentReference",void 0),Ed(this,"_suspendedZoom",void 0),Ed(this,"_nextCameraZoomRange",void 0),Ed(this,"restrictIncomingRotation",!1),Ed(this,"restrictedCamera",void 0),Ed(this,"cameraChangesHaveStarted",void 0),Ed(this,"_cameraWillChangeAnimated",void 0),this.node=t}
2get element(){return this._element}deactivate(){this.pannable=!1,this.zoomable=!1,this.node.delegate=null}destroy(t){!t&&this.cameraAnimation&&this.cameraAnimation.cancel(),this._tileOverlays.forEach((t=>{t.removeEventListener(Eh.RELOAD_EVENT,this)})),this._initialInteractionController&&(this._initialInteractionController.destroy(),this._initialInteractionController=null),this._panController&&(this._panController.destroy(),this._panController=null),this._wheelEventHandler&&(this._wheelEventHandler.destroy(),this._wheelEventHandler=null),this._zoomController&&(this._zoomController.destroy(),this._zoomController=null),this._rotationController&&(this._rotationController.destroy(),this._rotationController=null),this.node.delegate=null}get isRotationEnabled(){return this._isRotationEnabled}set isRotationEnabled(t){this._isRotationEnabled=t}get snapsToIntegralZoomLevels(){return this._snapsToIntegralZoomLevels}set snapsToIntegralZoomLevels(t){this._snapsToIntegralZoomLevels=t}get configuration(){return this._configuration}set configuration(t){this._configuration!==t&&this.updateConfiguration(t)}get tint(){return this._tint}get tileTint(){return this._tileTint}get emphasis(){return this._emphasis}setTintAndEmphasis(t,e,i){t===this._tint&&e===this._tileTint&&i===this._emphasis||(this._tint=t,this._tileTint=e,this._emphasis=i,this.updateTintAndEmphasis(t,e,i))}get language(){return this._language}set language(t){this._language!==t&&(this._language=t,this.refresh())}get pointOfInterestFilter(){return this._pointOfInterestFilter}set pointOfInterestFilter(t){this._pointOfInterestFilter!==t&&(this._pointOfInterestFilter=t,this.updatePointOfInterestFilter())}get size(){return this.camera.viewportSize.copy()}set size(t){this.adjustForSize(t.copy()),t.width>0&&t.height>0&&this._updateZoom(!1)}adjustForSize(t){if(this._visibleMapRect&&this._visibleMapRect.size.width>0&&this._visibleMapRect.size.height>0&&t.width>0&&t.height>0){const e=this._visibleMapRect;delete this._visibleMapRect,this.setCameraAnimated(this.camera.withNewMapRect(e,this.snapsToIntegralZoomLevels,t))}else{let e=null;this._pendingCameraDistance&&(e=this._pendingCameraDistance);const i=this.camera;this.setCameraAnimated(new hh(i.center,i.zoom,t,i.rotation)),null!==e&&this.setCameraDistanceAnimated(e,!1)}}get cameraIsPanning(){return!!this._panning}get pannable(){return!!this._panController}set pannable(t){if(!t&&this._panController?(this._panController.destroy(),this._panController=null):t&&!this._panController&&(this._initialInteractionController||(this._initialInteractionController=new ph(this)),this._panController=new bh(this)),!t&&!this.zoomable&&this._wheelEventHandler)return this._wheelEventHandler.destroy(),void(this._wheelEventHandler=null);this._wheelEventHandler||(this._wheelEventHandler=new Sd(this)),this._wheelEventHandler.zoomable=this.zoomable,this._wheelEventHandler.pannable=t}get cameraIsZooming(){return!!this._zooming||!!this._suspendedZoom}get zoomable(){return!!this._zoomController}set zoomable(t){if(!t&&this._zoomController?(this._zoomController.destroy(),this._zoomController=null):t&&!this._zoomController&&(this._initialInteractionController||(this._initialInteractionController=new ph(this)),this._zoomController=new Td(this)),!t&&!this.pannable&&this._wheelEventHandler)return this._wheelEventHandler.destroy(),void(this._wheelEventHandler=null);this._wheelEventHandler||(this._wheelEventHandler=new Sd(this)),this._wheelEventHandler.zoomable=t,this._wheelEventHandler.pannable=this.pannable}get cameraIsRotating(){return!!this._rotating}get backgroundGridTheme(){return this._backgroundGridTheme}set backgroundGridTheme(t){this._backgroundGridTheme=t}get visibleMapRect(){return this._visibleMapRect||this.camera.toMapRect()}set visibleMapRect(t){this.setVisibleMapRectAnimated(t)}setVisibleMapRectAnimated(t,e){if(this.camera.viewportSize.equals(at.Zero))this._visibleMapRect=t.copy();else{const i=this.camera.withNewMapRect(t,this.snapsToIntegralZoomLevels);i.rotation=0,this.setCameraAnimated(i,!!e)}}setCenterAnimated(t,e){const i=t.toMapPoint();
2if(this._visibleMapRect)this._visibleMapRect=new ot(i.x-this._visibleMapRect.size.width/2,i.y-this._visibleMapRect.size.height/2,this._visibleMapRect.size.width,this._visibleMapRect.size.height);else{const t=this.camera.copy();t.center=i,this.setCameraAnimated(t,e)}}setCameraBoundaryAnimated(t,e){t?(this._cameraBeforeBoundaryChange=this.camera,this._cameraBoundaryRect=new ot(t.origin.x,t.origin.y,w(t.size.width,0,1),Math.max(t.size.height,0)),this.setCameraAnimated(this.camera.copy(),e),delete this._cameraBeforeBoundaryChange):delete this._cameraBoundaryRect}constrainCamera(t){this._cameraBoundaryRect&&(t.center=this._constrainCenterWithinBounds(t.center)),this._updateMinAndMaxZoomLevelsAtY(t.center.y),t.zoom=w(t.zoom,this.currentMinZoomLevel,this.currentMaxZoomLevel)}constrainCameraRotation(t){const e=this.isRotationLocked;if(this.isRotationLocked=t.zoom<7,0!==t.rotation&&this.isRotationLocked){const i=this.restrictIncomingRotation?Js(t.rotation):0,s=i!==t.rotation;return t.rotation=i,!e&&s}return!1}get transformCenter(){const t=this.node.delegate;return t&&"function"==typeof t.mapTransformCenter?t.mapTransformCenter(this.node):this.camera.center}get interactionCenter(){const t=this.node.delegate;return t&&"function"==typeof t.mapInteractionCenter?t.mapInteractionCenter(this.node):this.camera.center}get zoomLevel(){return this.camera.zoom}set zoomLevel(t){this.setZoomLevelAnimated(t)}setZoomLevelAnimated(t,e){if(delete this._cameraDistance,this._suspendedZoom)return this._suspendedZoom.animated=this._suspendedZoom.animated||this._suspendedZoom.level!==t,void(this._suspendedZoom.level=t);if(this.cameraAnimation&&!e)return void(this.cameraAnimation.additiveZoom=t);const i=this.zoomLevel,s=w(t,this.currentMinZoomLevel,this.currentMaxZoomLevel);if(i===s)return;const o=this.interactionCenter,n=this.camera;o.equals(n.center)?this.setCameraAnimated(new hh(n.center,s,n.viewportSize,n.rotation),e):this.scaleCameraAroundMapPoint(Math.pow(2,s-i),this.interactionCenter,e)}setCameraDistanceAnimated(t,e){if(0===this.camera.viewportSize.width)return void(this._pendingCameraDistance=t);let i=this.zoomLevelForCameraDistanceAtY(t,this.camera.center.y);this.snapsToIntegralZoomLevels&&(i=Qs(i)),this.setZoomLevelAnimated(i,e),this._cameraDistance=t}getCurrentCameraDistance(){return this.visibleMapRect.size.width/2/H(this.camera.center.toCoordinate().latitude)/Pd}get cameraZoomRange(){return this._cameraZoomRange?this._cameraZoomRange.copy():new nt}setCameraZoomRangeAnimated(t,e){t?(this._cameraZoomRange=t.copy(),delete this._cameraZoomLevelLimit):delete this._cameraZoomRange,this._updateZoom(e)}setCameraZoomLevelLimitAnimated(t,e){t?(this._cameraZoomLevelLimit={minZoomLevel:t.minZoomLevel,maxZoomLevel:t.maxZoomLevel},delete this._cameraZoomRange):delete this._cameraZoomLevelLimit,this._updateZoom(e)}zoomLevelForCameraDistanceAtY(t,e){return this._zoomLevelForCameraDistanceAtLatitude(t,U(e))}adjustMapItemPoint(t){if(this.cameraIsZooming||this._pendingCameraDrawingReadiness)return t;if(!this._pointAdjustmentReference){const t=this.camera.zoom,e=this.visibleMapRect.origin,i=new $h(this.camera),s=i.zoom,o=i.mapRect.origin,n=Math.pow(2,t-s),a=K(s)*n;this._pointAdjustmentReference=new Pe((o.x-e.x)*a,(o.y-e.y)*a)}return t.x=Ns(this._pointAdjustmentReference.x)+Ns(t.x-this._pointAdjustmentReference.x),t.y=Ns(this._pointAdjustmentReference.y)+Ns(t.y-this._pointAdjustmentReference.y),t}scaleCameraAroundMapPoint(t,e,i){const s=K(this.currentMinZoomLevel),o=this.camera.viewportSize,n=this.visibleMapRect,a=n.size,r=1/t,l=s>0?o.width/(a.width*s):r,h=s>0?o.height/(a.height*s):r,d=K(this.currentMaxZoomLevel),c=o.width/(a.width*d),u=o.height/(a.height*d),p=Math.max(Math.min(r,l,h),c,u),m=e.x+(e.x<1?1:-1);m>=n.origin.x&&m<=n.maxX()&&(e=new it(m,e.y));const g=this.camera.withNewMapRect(n.scale(p,e),!1);this.setCameraAnimated(g,i)}setCameraAnimated(t,e,i,s){if(0===t.viewportSize.width||0===t.viewportSize.height)return this._pendingCameraDrawingReadiness=!0,void(this.camera=t);delete this._pendingCameraDistance;const o=this.camera;t.viewportSize.equals(o.viewportSize)||(this._updateMinAndMaxZoomLevels(t.viewportSize),!e&&this.cameraAnimation&&this.cameraAnimation.updateViewportSize(t.viewportSize)),s||this.constrainCamera(t);const n=this.constrainCameraRotation(t),a=t.toMapRect().size,r=a.width/2,l=a.height/2;if(t.center.x=b(t.center.x-r,1)+r,t.center.y=w(t.center.y,l,Id-l),this._pendingCameraDrawingReadiness||!t.equals(o))if(delete this._pendingCameraDrawingReadiness,this._cameraWillChange(!!e),!e&&!n||this.cameraAnimation)delete this._pointAdjustmentReference,this.camera=t,this.cameraZoomWasSet(),this._cameraDidChange();else{let s;e?s=this._cameraBeforeBoundaryChange||o:(s=t.copy(),s.rotation=o.rotation),this._cameraChangesMayHaveStarted(),this.cameraAnimation=new ch(this,s,t,i),this._cameraBeforeBoundaryChange&&(this.cameraAnimation.unconstrained=!0),this.cameraAnimation.rotating&&(this._rotating=!0),this.cameraAnimation.zooming&&this.cameraZoomWasSet(t)}}cameraWillStartZooming(t,e,i){const s=this.node.delegate,o=()=>!!s&&"function"==typeof s.mapCanStartZooming&&!s.mapCanStartZooming(this.node);return this.cameraAnimation?!(this._zoomController.active||this.cameraAnimation.zooming||o())&&(this._suspendedZoom={animated:!!e,zoomType:t,offCenter:!!i,level:this.zoomLevel,completed:!1},!0):o()?(this._zoomController.interrupt(),!1):(this._cameraWillStartZooming(s,t,e,i),!0)}_cameraWillStartZooming(t,e,i,s){t&&"function"==typeof t.mapWillStartZooming&&t.mapWillStartZooming(this.node,e,i,s),this._cameraChangesMayHaveStarted(),this._zooming=!0,this.beforeCameraZoomChange(!0),this._cameraWillChange(!!i)}cameraDidStopZooming(){if(this.snapsToIntegralZoomLevels&&(this.camera.zoom=Math.round(this.camera.zoom)),this._suspendedZoom)return void(this._suspendedZoom.completed=!0);this._zooming=!1,this.beforeCameraZoomChange(!1),this._cameraDidChange(),this._cameraChangesMayHaveEnded();const t=this.node.delegate;t&&"function"==typeof t.mapDidStopZooming&&t.mapDidStopZooming(this.node)}cameraWillStartRotating(){const t=this.node.delegate;!!t&&"function"==typeof t.mapCanStartRotating&&!t.mapCanStartRotating(this.node)||(this._cameraChangesMayHaveStarted(),this._rotating=!0,this._cameraWillChange())}cameraDidStopRotating(){if(!this._rotating)return;this._rotating=!1,this._cameraDidChange(),this._cameraChangesMayHaveEnded();const t=this.node.delegate;t&&"function"==typeof t.mapDidStopRotating&&t.mapDidStopRotating(this.node)}
2setPoiFiltered(t,e){e?(this._filteredPois.has(t)&&console.warn("[MapKit] Multiple annotations linked to a single place have been added to the map, display instability may occur."),this._filteredPois.add(t)):this._filteredPois.delete(t),this.updatePointOfInterestFilter()}migrateStateTo(t){t.configuration=this.node.configuration,t.setTintAndEmphasis(this.node.tint,this.node.tileTint,this.node.emphasis),t.language=this.node.language,t.pannable=this.node.pannable,t.allowWheelToZoom=this.node.allowWheelToZoom,t.allowWheelToZoom2=this.node.allowWheelToZoom2,t.pointOfInterestFilter=this.node._impl.pointOfInterestFilter,t.showsDefaultTiles=this.node.showsDefaultTiles,t.tileOverlays=this.node.tileOverlays,t.size=this.node.size,t.usesInteractionCenter=this.node.usesInteractionCenter;const e=this.node.visibleMapRect;e.size.width>0&&e.size.height>0&&(t.visibleMapRect=e),t.zoomable=this.node.zoomable,t.isRotationEnabled=this.isRotationEnabled,t.rotation=this.rotation,t[eh]=this[eh],this._cameraZoomRange&&t.setCameraZoomRangeAnimated(this._cameraZoomRange,!1),this._cameraZoomLevelLimit&&t.setCameraZoomLevelLimitAnimated(this._cameraZoomLevelLimit,!1),void 0!==this._cameraDistance&&this._cameraDistance>=0&&t.setCameraDistanceAnimated(this._cameraDistance,!1),this._cameraBoundaryRect&&t.setCameraBoundaryAnimated(this._cameraBoundaryRect,!1),t._impl._filteredPois=this._filteredPois,t._impl.updatePointOfInterestFilter(),t._impl.debug=this.debug,t._impl.isRotationLocked=this.isRotationLocked,this.cameraAnimation&&(this.cameraAnimation.map=t._impl,t._impl.cameraAnimation=this.cameraAnimation,this.cameraChangesHaveStarted&&(t._impl.cameraChangesHaveStarted=!0))}createLabelRegion(){}updatedLabelRegion(){}unregisterLabelRegion(){}get debug(){return this._debug}set debug(t){this._debug!==!!t&&(this._debug=!!t,this.refresh())}updateConfiguration(t){this._configuration=t,this._updateMinAndMaxZoomLevels(this.camera.viewportSize),this.setCameraAnimated(this.camera),this.refresh()}updatePointOfInterestFilter(){this.refresh()}refresh(){}beforeCameraZoomChange(){}cameraZoomWasSet(){}prepareLayer(){}cleanupLayer(){}addLayer(){}insertLayerBefore(){}insertLayerAfter(){}removeLayer(){}get showsDefaultTiles(){return this._showsDefaultTiles}set showsDefaultTiles(t){this._showsDefaultTiles!==t&&(this._showsDefaultTiles=t,this._tileOverlaysDidChange())}get tileOverlays(){return this._tileOverlays}set tileOverlays(t){if(0===this._tileOverlays.length&&0===t.length)return;M(t,"[MapKit] Map.tileOverlays should be an array, got `"+t+"` instead."),t.forEach((t=>{L(t,Jh,"[MapKit] Map.tileOverlays can only contain TileOverlays, but got `"+t+"` instead.")})),this._tileOverlays.forEach((t=>{t.removeEventListener(Eh.RELOAD_EVENT,this)})),this._tileOverlays=t,this._tileOverlays.forEach((t=>{t.addEventListener(Eh.RELOAD_EVENT,this)})),this._tileOverlaysDidChange()}addTileOverlay(t){return L(t,Jh,"[MapKit] Map.addTileOverlay expected a TileOverlay, but got `"+t+"` instead."),this.addTileOverlays([t]),t}addTileOverlays(t){return M(t,"[MapKit] Map.addTileOverlays expected an array, but got `"+t+"` instead."),t.forEach((t=>{if(L(t,Jh,"[MapKit] Map.addTileOverlays expected only TileOverlays, but got `"+t+"` instead."),"number"==typeof t.minimumZ&&t.minimumZ<this.currentMinZoomLevel){const e=Math.ceil(100*this.currentMinZoomLevel)/100;console.warn("[MapKit] This TileOverlay has its minimumZ set to "+t.minimumZ+", but this map can only zoom to a minimum value of "+e+". As a result, some zoom levels supported by the TileOverlay cannot be viewed on this map.")}})),this.tileOverlays=this.tileOverlays.concat(t),t}removeTileOverlay(t){return L(t,Jh,"[MapKit] Map.removeTileOverlay expected a TileOverlay, but got `"+t+"` instead."),this.tileOverlays=this.tileOverlays.filter((e=>e!==t)),t}removeTileOverlays(t){return M(t,"[MapKit] Map.removeTileOverlays expected an array, but got `"+t+"` instead."),t.forEach((t=>{L(t,Jh,"[MapKit] Map.removeTileOverlays expected only TileOverlays, but got `"+t+"` instead."),this.removeTileOverlay(t)})),t}handleEvent(){}cameraWillStartPanning(){const t=this.node.delegate;return this.cameraAnimation||(()=>!!t&&"function"==typeof t.mapCanStartPanning&&!t.mapCanStartPanning(this.node))()?(this._panController.interrupt(),!1):(t&&"function"==typeof t.mapWillStartPanning&&t.mapWillStartPanning(this.node),this.refresh(),this._cameraChangesMayHaveStarted(),this._panning=!0,this._cameraWillChange(),!0)}cameraWillStopPanning(){const t=this.node.delegate;t&&"function"==typeof t.mapWillStopPanning&&t.mapWillStopPanning(this.node)}cameraDidStopPanning(){this._panning=!1,this._cameraDidChange(),this._cameraChangesMayHaveEnded();const t=this.node.delegate;t&&"function"==typeof t.mapDidStopPanning&&t.mapDidStopPanning(this.node)}cameraAnimationDidProgress(t,e){this.setCameraAnimated(t,!1,void 0,e)}cameraAnimationDidEnd(){const t=this.cameraAnimation;this.cameraAnimation=null;let e=!1;if(t.zooming&&!t.zoomIsAdditive&&(this.cameraDidStopZooming(),e=!0),t.rotating&&(this.cameraDidStopRotating(),e=!0),e||this._cameraDidChange(),this._cameraChangesMayHaveEnded(),this._suspendedZoom){const t=this._suspendedZoom;delete this._suspendedZoom,this._cameraWillStartZooming(this.node.delegate,t.zoomType,t.animated),t.completed&&(this.setZoomLevelAnimated(t.level,t.animated),t.animated||this.cameraDidStopZooming())}this._nextCameraZoomRange&&(this.setCameraZoomRangeAnimated(this._nextCameraZoomRange,!1),delete this._nextCameraZoomRange)}interactionDidStart(){this._panController&&this._panController.stopDecelerating(),this._zoomController&&this._zoomController.stopDecelerating(),this._rotationController&&this._rotationController.stopDecelerating()}beganRecognizingRotation(){this._zoomController&&(this._zoomController._singleTapWithTwoFingersRecognizer.enabled=!1),this.isRotationLocked&&(this.restrictedCamera=this.camera.copy(),this.restrictIncomingRotation=!0)}finishedRecognizingRotation(){this._zoomController&&(this._zoomController._singleTapWithTwoFingersRecognizer.enabled=!0),this.resetRestrictedCamera()}compassRotationWillStart(){this.isRotationLocked&&(this.restrictedCamera=this.camera.copy(),this.restrictIncomingRotation=!1)}compassRotationDidEnd(){this.resetRestrictedCamera()}resetRestrictedCamera(){this.restrictedCamera&&(this.restrictedCamera.rotation=0,this.setCameraAnimated(this.restrictedCamera,!0),delete this.restrictedCamera,this.restrictIncomingRotation=!1)}tileGridDidFinishRendering(){const t=this.node.delegate;t&&"function"==typeof t.mapDidFinishRendering&&t.mapDidFinishRendering(this.node)}tileAccessForbidden(){const t=this.node.delegate;
2t&&"function"==typeof t.tileAccessForbidden&&t.tileAccessForbidden(this.node)}updateMinAndMaxZoomLevelsWhenConfigurationChanges(){this.minZoomLevel=Rd.DEFAULT_MIN_ZOOM_LEVEL,this.maxZoomLevel=Rd.DEFAULT_MAX_ZOOM_LEVEL,this._configuration.tileSources.forEach((t=>{this.minZoomLevel=Math.max(this.minZoomLevel,t.minZoomLevel),this.maxZoomLevel=Math.min(this.maxZoomLevel,t.maxZoomLevel)})),this.minAndMaxZoomLevelsWereUpdated(),this.currentMinZoomLevel=this.minZoomLevel,this.currentMaxZoomLevel=this.maxZoomLevel}minAndMaxZoomLevelsWereUpdated(){}_updateMinAndMaxZoomLevels(t){if(t.width<=0||t.height<=0)return!1;this._configuration&&this.updateMinAndMaxZoomLevelsWhenConfigurationChanges(),this.minZoomLevel=Math.max(this.minZoomLevel,this.minZoomLevelForViewportSize(t,z)),this.snapsToIntegralZoomLevels&&(this.minZoomLevel=Math.ceil(this.minZoomLevel)),this.currentMinZoomLevel=Math.max(this.currentMinZoomLevel,this.minZoomLevel),this.adjustForSize(this.size)}_cameraChangesMayHaveStarted(t){if(!(this.cameraChangesHaveStarted||this._panning||this._zooming||this._rotating||this.cameraAnimation)){this.cameraChangesHaveStarted=!0;const e=this.node.delegate;e&&"function"==typeof e.mapCameraChangesWillStart&&e.mapCameraChangesWillStart(this.node,t)}}_cameraWillChange(t){this._cameraChangesMayHaveStarted(t),this._cameraWillChangeAnimated=!!t;const e=this.node.delegate;e&&"function"==typeof e.mapCameraWillChange&&e.mapCameraWillChange(this.node,!!t)}_cameraDidChange(){const t=this.node.delegate;t&&"function"==typeof t.mapCameraDidChange&&t.mapCameraDidChange(this.node,!!this._cameraWillChangeAnimated),delete this._cameraWillChangeAnimated,this._cameraChangesMayHaveEnded()}_cameraChangesMayHaveEnded(){if(this.cameraChangesHaveStarted&&!this._panning&&!this._zooming&&!this._rotating&&!this.cameraAnimation){delete this.cameraChangesHaveStarted;const t=this.node.delegate;return t&&"function"==typeof t.mapCameraChangesDidEnd&&t.mapCameraChangesDidEnd(this.node),!0}}isMapPointWithinBounds(t){if(!this._cameraBoundaryRect)return!0;const e=this._constrainCenterWithinBounds(t);return t.x===e.x&&t.y===e.y}_constrainCenterWithinBounds(t){if(0===this.camera.viewportSize.width||0===this.camera.viewportSize.height)return t;const e=this.camera.center,i=this.transformCenter,s=e.x-i.x,o=e.y-i.y,n=b(this._cameraBoundaryRect.origin.x+s,1),a=n+this._cameraBoundaryRect.size.width;let r=b(t.x,1);if(r<n&&(r+=1),r>a){let t=r-n;t>.5&&(t=1-t);let e=r-a;e>.5&&(e=1-e),r=t<e?n:a}const l=w(t.y,this._cameraBoundaryRect.minY()+o,this._cameraBoundaryRect.maxY()+o);return r!==t.x||l!==t.y?new it(r,l):t}_updateMinAndMaxZoomLevelsAtY(t){let e=this.minZoomLevel,i=this.maxZoomLevel;if(this._cameraZoomRange){const s=U(t);e=w(this._zoomLevelForCameraDistanceAtLatitude(this._cameraZoomRange.maxCameraDistance,s),e,i),i=w(this._zoomLevelForCameraDistanceAtLatitude(this._cameraZoomRange.minCameraDistance,s),e,i),this.snapsToIntegralZoomLevels&&(e=Math.ceil(e),i=Math.floor(i))}else this._cameraZoomLevelLimit&&(e=w(this._cameraZoomLevelLimit.minZoomLevel,e,i),i=w(this._cameraZoomLevelLimit.maxZoomLevel,e,i));this.currentMinZoomLevel=e,this.currentMaxZoomLevel=i}_updateZoom(t){this._updateMinAndMaxZoomLevelsAtY(this.camera.center.y);const e=w(this.camera.zoom,this.currentMinZoomLevel,this.currentMaxZoomLevel);if(e!==this.camera.zoom)t&&(this._nextCameraZoomRange=this._cameraZoomRange,delete this._cameraZoomRange),this.setZoomLevelAnimated(e,t);else{const t=this.node.delegate;t&&"function"==typeof t.mapMinAndMaxZoomLevelsDidChange&&t.mapMinAndMaxZoomLevelsDidChange(this.node)}}_zoomLevelForCameraDistanceAtLatitude(t,e){return $(t,e,this.camera.viewportSize.width)}get[eh](){return this._[eh]}set[eh](t){this._[eh]=t}[ih](){throw new Error}}Ed(Rd,"DEFAULT_MIN_ZOOM_LEVEL",-1/0),Ed(Rd,"DEFAULT_MAX_ZOOM_LEVEL",1/0);const zd="rgba(0, 0, 0, 0.5)",Dd="white",Nd="rgba(255, 255, 255, 0.75)",Fd="black";class Ud extends lo{draw(t){const e=this._node.size.width,i="standard"===this._node.tile.settings.configuration.name;t.fillStyle=i?zd:Nd,t.fillRect(0,0,e,1),t.fillRect(0,1,1,e-1);const s=["x","y","z"].map((t=>t+" = "+this._node.tile[t]));t.font="12px -apple-system-font",t.beginPath(),t.moveTo(1,1);let o=1,n=1;
2s.forEach(((e,i)=>{const s=t.measureText(e).width;o=1+s+16,t.lineTo(o,n),n+=20,0===i&&(n+=8),t.lineTo(o,n)})),t.lineTo(1,n),t.closePath(),t.fill(),t.fillStyle=i?Dd:Fd,t.textBaseline="hanging",s.forEach(((i,s)=>{t.fillText(i,9,9+20*s,e)}))}}class Wd extends ts{constructor(t){var e,i,s;super(),s=void 0,(i="_tile")in(e=this)?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,this._tile=t,this._renderer=new Ud(this)}get tile(){return this._tile}stringInfo(){return"DebugNode<x:"+this.tile.x+",y:"+this.tile.y+",z:"+this.tile.z+">"}}class Gd extends go{constructor(t){var e,i,s;super(),s=void 0,(i="_tileSource")in(e=this)?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,this._tileSource="_public"in t?t._public:void 0,this._tileSource&&"function"==typeof this._tileSource.addEventListener&&this._tileSource.addEventListener(Eh.OPACITY_EVENT,this)}handleEvent(){this._tileSource&&(this.opacity=this._tileSource.opacity)}wasRemoved(){setTimeout((()=>{this.parent&&this.parent.scene||this._tileSource&&"function"==typeof this._tileSource.removeEventListener&&this._tileSource.removeEventListener(Eh.OPACITY_EVENT,this)}),0)}}function Bd(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Zd=Ut,jd=new gi,Kd=new at(z,z);class Hd extends uo{constructor(t){super(),Bd(this,"_scale",1),Bd(this,"_nodesByTileKey",{}),Bd(this,"_fadingNodes",[]),Bd(this,"_fadingNodesStartTime",new WeakMap),Bd(this,"_debug",void 0),Bd(this,"stale",!1),Bd(this,"fullyRendered",!1),Bd(this,"_pendingTileCount",0),Bd(this,"_tileData",null),Bd(this,"_failedTileAndImage",void 0),this._debug=!!t}get locked(){return this.wantsLayerBacking}set locked(t){t!==this.wantsLayerBacking&&(t&&this._fadingNodes.length>0?this.wantsLayerBacking=!0:!t&&this._wantsLayerBacking?this.wantsLayerBacking=!1:this.frozen=t)}get tileData(){return this._tileData}setTileDataAnimated(t,e){this._fadingNodes=[],delete this._failedTileAndImage;const i=t.tiles,s=t.range.min,o=Math.pow(2,s.z);this._tileData&&this._tileData.tiles.forEach((t=>{if(t.removeEventListener(Gh.Events.LoadSuccess,this),t.removeEventListener(Gh.Events.LoadFail,this),!i.includes(t)){const e=t.key,i=this._nodesByTileKey[e];i&&(i.remove(),delete this._nodesByTileKey[e])}})),this._tileData=t,this.fullyRendered=!1,this._pendingTileCount=i.length;const n=this.childCount,a=t.range.min.x,r=t.range.max.x-a===o,l=o*z;
2i.forEach((t=>{const i=new Pe(b(t.x-s.x,o)*z,(t.y-s.y)*z),h=this._ensureNodeForTile(t);h.position=i,h.opacity=0,r&&t.x===a&&(h.repeatOffset=l),this.addChild(h),t.loaded?((n>0||!e)&&(h.opacity=1),this._tileDidLoad(t)):(e||(h.opacity=1),t.addEventListener(Gh.Events.LoadSuccess,this),t.addEventListener(Gh.Events.LoadFail,this))}))}get pendingTileCount(){return this._pendingTileCount}set scale(t){t!==this._scale&&(this._scale=t,this.transform=1===t?jd:(new gi).scale(t))}get debug(){return this._debug}stringInfo(){return"TileGridNode"+(this.tileData?"<range:("+this.tileData.range.toString()+")>":"")}get cssBackgroundProperty(){if(!this.fullyRendered)return"";const t=this.position;return Array.prototype.concat.apply([],this._tileData.tiles.map((e=>{const i=this._nodesByTileKey[e.key];return e.tileImages.reduce(((e,s,o)=>"url("+s.url+") "+(t.x+i.position.x)+"px "+(t.y+i.position.y)+"px / "+z+"px no-repeat"+(0===o?"":", ")+e),"")}))).join(", ")}handleEvent(t){const e=t.target;switch(t.type){case Gh.Events.LoadSuccess:e.removeEventListener(Gh.Events.LoadSuccess,this),this._tileDidLoad(e);break;case Gh.Events.LoadFail:this._tileLoadFail(e,t.tileImage)}}performScheduledUpdate(){this._updateFadingNodes(),0===this._pendingTileCount&&0===this._fadingNodes.length&&this._allTilesDidDraw()}_tileDidLoad(t){this._pendingTileCount--,0===this._pendingTileCount&&this._failedTileAndImage&&(this._failedTileAndImage.tile._requestTileImageLoadStatus(this._failedTileAndImage.tileImage,(t=>this._handleTileImageLoadStatus(t))),delete this._failedTileAndImage);const e=this._nodesByTileKey[t.key];if(0===e.childCount){const i=t.tileImages;if(e.children=i.map(qd),this.debug){const i=new Wd(t);i.size=Kd,e.addChild(i)}}e.opacity<1?(this._fadingNodes.push(e),ii(this)):0===this._pendingTileCount&&this._allTilesDidDraw()}_tileLoadFail(t,e){this._failedTileAndImage={tile:t,tileImage:e}}_handleTileImageLoadStatus(t){403===t.target.status&&this.parent&&this.parent.tileAccessForbidden(this)}_updateFadingNodes(){const t=Date.now();this._fadingNodes=this._fadingNodes.filter((e=>{if(this._fadingNodesStartTime.has(e)){const i=this._fadingNodesStartTime.get(e);e.opacity=Math.min(1,(t-i)/150)}else 0===e.opacity&&this._fadingNodesStartTime.set(e,t);return 1!==e.opacity||(this._fadingNodesStartTime.delete(e),!1)})),this._fadingNodes.length>0?si(this):this._wantsLayerBacking&&(this.wantsLayerBacking=!1,this.frozen=!0)}_allTilesDidDraw(){this.fullyRendered=!0,this.parent&&this.parent.tileGridDidFinishRendering(this)}_ensureNodeForTile(t){const e=t.key;let i=this._nodesByTileKey[e];return i?delete i.repeatOffset:i=this._nodesByTileKey[e]=new uo,i}}function qd(t){const e=new Gd(t.tileSource);return e.size=Kd,t.loaderState===Zd.Succeeded&&(e.setImage(t.image,t.url),e.opacity=t.preferredOpacity),e}function Vd(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Yd extends uo{constructor(t){super(),Vd(this,"_map",void 0),Vd(this,"fullyRendered",!1),Vd(this,"_tileDataAtZoomCompletion",void 0),this._map=t}scheduleRefresh(){this.children.forEach((t=>{t.stale=!0})),this.invalidate()}destroy(){this._releaseChildren(!0)}invalidate(){this.fullyRendered=!1,ii(this)}stringInfo(){return"TileGridsGroupNode"}get cssBackgroundProperty(){return this.fullyRendered?this.lastChild.cssBackgroundProperty:""}handleEvent(){this.scheduleRefresh()}performScheduledUpdate(){if(!this._canDraw())return;const t=this._map,e=t.camera,i=this.lastChild,s=!!i&&i.debug!==this._map.debug,o=!!i&&i.tileData.settings.showsDefaultTiles!==this._map.showsDefaultTiles;if(!this._tileDataAtZoomCompletion){let n;if(Math.round(e.zoom)!==e.zoom&&t.tileSettings.showsLabels){if(!i)return;n=i.tileData}else n=new $h(e,t.tileSettings);if(i){if((i.stale||!i.locked)&&(!n.equals(i.tileData)||s||o)){const t=i.tileData;t.tiles.forEach((t=>{n.tiles.includes(t)||t.unschedule()}));const e=n.settings.configuration===t.settings.configuration,o=n.sameSettings(t)&&n.resolution===t.resolution&&!s;if(e?!o:n.sharesTileSourcesWithTileData(t))i.locked=!0,this._addNewTileGridAnimated(n,!0);else if(!i.locked){const t=e&&this._children.length>1;i.stale=!1,i.setTileDataAnimated(n,t);const s=this._children[this._children.length-2];s&&!n.sharesTileSourcesWithTileData(s.tileData)&&(this._releaseChildren(!1),this._children=[i])}}}else this._addNewTileGridAnimated(n,!1)}const n=e.zoom,a=t.visibleMapRect,r=a.origin,l=a.size,h=this.children,d=h.length;for(let t=0;t<d;++t){const e=h[t],i=e.tileData,s=i.zoom,o=i.mapRect.origin,a=Math.pow(2,n-s),c=Math.pow(2,s)*(z*a);let u=o.x-r.x;if(u>l.width)u--;else{const t=i.mapRect.size.width;t>0&&u+t<0&&u++}
2e.scale=a,e.position=new Pe(Ns(u*c),Ns((o.y-r.y)*c)),t<d-1&&i.cancel()}const c=this.children[d-1];this.fullyRendered=!!c?.fullyRendered}cameraWillStartZooming(t){if(!this._canDraw())return;const e=this._map;t&&(this._tileDataAtZoomCompletion=new $h(t,e.tileSettings),this._tileDataAtZoomCompletion.load()),this.children.forEach((t=>{t.locked=!0}))}cameraDidStopZooming(){if(this._canDraw())if(this._tileDataAtZoomCompletion)this._addNewTileGridAnimated(this._tileDataAtZoomCompletion,!0,!0),delete this._tileDataAtZoomCompletion;else{const t=this._map,e=this.lastChild;if(e&&e.tileData&&t.camera.zoom===e.tileData.zoom)e.locked=!1;else{const e=new $h(t.camera,t.tileSettings);this._addNewTileGridAnimated(e,!0,!0)}}}tileGridDidFinishRendering(){const t=this.children,e=t.length,i=t[e-1];if(i.fullyRendered&&!i.locked){for(let i=0;i<e-1;++i){t[i].tileData.releaseTiles()}e>1&&(this.children=[i]),this.fullyRendered=!0,this._map.tileGridDidFinishRendering()}}tileAccessForbidden(){this._map.tileAccessForbidden()}_canDraw(){const t=this._map;return t&&!!t.configuration&&!!t.language}_addNewTileGridAnimated(t,e,i){const s=new Hd(this._map.debug),o=this.lastChild;o&&o.tileData&&!t.sharesTileSourcesWithTileData(o.tileData)?(this._releaseChildren(!0),this.children=[s]):this.addChild(s),s.setTileDataAnimated(t,e),i&&ii(this)}_releaseChildren(t){for(let e=this.childCount-(t?1:2);e>=0;--e){const t=this.children[e].tileData;t.cancel(),t.releaseTiles()}}}function Xd(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function $d(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Jd(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Qd(t,e,"set"),i),i}function Qd(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var tc=new WeakMap;class ec extends Rd{constructor(t){super(t),$d(this,"_backgroundGrid",void 0),$d(this,"_tileGridsGroup",void 0),$d(this,"_labels",!0),Xd(this,tc,{writable:!0,value:0}),this._backgroundGrid=this.node.addChild(new nc),this._tileGridsGroup=this.node.addChild(new Yd(this)),this.rotation=0,this._backgroundGrid.initialRendering=!0,this._tileGridsGroup.opacity=0,setTimeout((()=>{this._backgroundGrid.initialRendering=!1,this._tileGridsGroup.opacity=1}),0)}get rotation(){return function(t,e){return e.get?e.get.call(t):e.value}(t=this,Qd(t,tc,"get"));var t}set rotation(t){Jd(this,tc,t)}stringInfo(){return"MapNode<camera:"+this.camera.toString()+">"}get tileSettings(){return{configuration:this._configuration,tint:this._tileTint,emphasis:this._emphasis,language:this._language,showsPOI:this._showsPOI(),showsLabels:this._labels,showsDefaultTiles:this._showsDefaultTiles,showsTileInfo:this._debug,tileOverlays:this._tileOverlays}}get fullyRendered(){return this._tileGridsGroup.fullyRendered}get cssBackgroundProperty(){return this._tileGridsGroup.cssBackgroundProperty}get labels(){return this._labels}set labels(t){this._labels=!!t,this.refresh()}destroy(t){super.destroy(t),this._tileGridsGroup.destroy()}updateTintAndEmphasis(t){this._backgroundGrid.updateThemeFromTint(t),this.refresh()}refresh(){this._tileGridsGroup.scheduleRefresh()}cameraZoomWasSet(t){t?this._tileGridsGroup.cameraWillStartZooming(t):this._tileGridsGroup.invalidate()}tileGridDidFinishRendering(){this._tileOverlays.forEach((t=>{t._impl.reloadComplete()})),super.tileGridDidFinishRendering()}handleEvent(){this._tileGridsGroup.scheduleRefresh()}beforeCameraZoomChange(t){t?this._tileGridsGroup.cameraWillStartZooming():this._tileGridsGroup.cameraDidStopZooming()}devicePixelRatioDidChange(){return this._tileGridsGroup.scheduleRefresh(),!0}minZoomLevelForViewportSize(t,e){const i=Math.max(t.width,t.height)/e;return Math.log2(i)}minAndMaxZoomLevelsWereUpdated(){this.tileOverlays.forEach((t=>{"number"!=typeof t.minimumZ||isNaN(t.minimumZ)||(this.minZoomLevel=Math.min(this.minZoomLevel,t.minimumZ)),"number"!=typeof t.maximumZ||isNaN(t.maximumZ)||(this.maxZoomLevel=Math.max(this.maxZoomLevel,t.maximumZ))}))}_tileOverlaysDidChange(){this._updateMinAndMaxZoomLevels(this.camera.viewportSize),this._tileGridsGroup.scheduleRefresh()}_showsPOI(){return(null==this._pointOfInterestFilter||null==this._pointOfInterestFilter._includes&&0===this._pointOfInterestFilter._excludes?.length)&&this.labels}}class ic extends rh{constructor(...t){var e,i,s;super(...t),e=this,i="_impl",s=new ec(this),i in e?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s}
2get cssBackgroundProperty(){return this._impl.cssBackgroundProperty}get labels(){return this._impl.labels}set labels(t){this._impl.labels=t}get pointOfInterestFilter(){return null===this._impl._pointOfInterestFilter?null:null===this._impl._pointOfInterestFilter._includes&&0===this._impl._pointOfInterestFilter._excludes?.length?this._impl._pointOfInterestFilter:Ql}set pointOfInterestFilter(t){this._impl.pointOfInterestFilter=t}get rotation(){return 0}set rotation(t){this._impl.rotation=t}rotateCameraAroundMapPoint(t,e){this._impl.rotation+=e}}function sc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const oc=rt({light:{fillColor:[248,245,236],lineColor:[149,148,144]},dark:{fillColor:[44,45,47],lineColor:[56,64,66]}});class nc extends ts{constructor(){super(),sc(this,"_theme",void 0),sc(this,"initialRendering",!1),this._renderer=new jl(this),this._theme=oc.light}get size(){return this.parent.size}get zoom(){return this.parent.zoomLevel}get origin(){return this.parent.visibleMapRect.origin}get theme(){return this._theme}updateThemeFromTint(t){const e=oc[t];e!==this._theme&&(this._theme=e,this.needsDisplay=!0)}stringInfo(){return"BackgroundGridNode"+(this.initialRendering?"!":"")+(this._theme===oc.light?"":"<dark>")}}function ac(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const rc=rt({Uninitialized:0,Initializing:1,Ready:2,Deactivated:3,DestroyPending:4,Destroyed:5});let lc=0;function hc(){throw new Error("[MapKit] The specified reference layer has not been added to the map.")}const dc=Oe.performanceMarkers.rendering,cc=Oe.performanceMarkers["frame-updates"];class uc{get node(){return this._node}constructor(t){ac(this,"_node",void 0),ac(this,"_id",void 0),ac(this,"_state",rc.Uninitialized),ac(this,"_unregisteredLabelRegions",[]),ac(this,"_unregisteredLayers",[]),ac(this,"_baseLoadedOnce",!1),ac(this,"_fullyLoadedOnce",!1),ac(this,"_fullyRenderedOnce",!1),ac(this,"availability",void 0),ac(this,"SyrupRenderer",void 0),ac(this,"Camera",void 0),ac(this,"_initialDisplayOptions",void 0),ac(this,"_initialPoiFilter",void 0),ac(this,"_syrupRenderer",void 0),ac(this,eh,void 0),ac(this,ih,void 0),ac(this,"_drawPasses",void 0),ac(this,"_canvas",void 0),ac(this,"frozen",!1),delete this[eh],delete this[ih],this._node=t,this._id=lc++}init(t,e,i,s,o,n,a){this._state=rc.Initializing,this.SyrupRenderer=e,this.Camera=i,this.Camera.hasRotationLock=!0,this._initialDisplayOptions=o,this._initialPoiFilter=n,this.initRenderer(e,t,s).then((()=>this.syrupInitHandler(a))).catch((t=>this.syrupInitErrorHandler(a,t)))}initRenderer(t,e,i){const s=new t(i);return this._syrupRenderer=s,this._canvas=i.element,s.on("invalid-access-key",(()=>{e.accessKeyHasExpired()}),pc),s.on("zoom-support-did-change",(()=>this._node.didReconfigure()),mc),s.init(e)}syrupInitErrorHandler(t,e){if(this._state===rc.DestroyPending)return this._state=rc.Uninitialized,void this.destroy();this._state=rc.Uninitialized,t(e||new Error)}syrupInitHandler(t){if(this._state===rc.DestroyPending)return this._state=rc.Deactivated,void this.destroy();this._state=rc.Ready;const e=this._syrupRenderer.DrawPasses;e&&(this._drawPasses=[e.BaseMap,e.Roads,e.Borders,e.Buildings,e.Icons,e.Labels]);const i=this._syrupRenderer;i.setDeterministicCollisions(!0),i.setLanguage(this._node.language),i.setDeterministicCollisions(!1),i.setPixelRatio(zs()),this._canvas=i.element(),this.updateConfiguration(this._node.configuration,this._initialDisplayOptions),this._initialDisplayOptions=null,this._initialPoiFilter&&(this.updatePointOfInterestFilter(this._initialPoiFilter),this._initialPoiFilter=null),this.performScheduledDraw(),this[eh]&&this[eh](this._node[eh]),this._unregisteredLabelRegions.forEach((t=>{i.registerLabelRegion(t)})),delete this._unregisteredLabelRegions;const s=this._unregisteredLayers;delete this._unregisteredLayers,s.forEach((t=>{this.prepareLayer(t),t._impl.syrupToken=i.addLayer(t._impl.syrupLayer)})),t()}deactivate(){this._state!==rc.Initializing?this._state!==rc.DestroyPending&&(this._state=rc.Deactivated):this._state=rc.DestroyPending}destroy(){this._state!==rc.Initializing?this._state!==rc.DestroyPending&&this._state!==rc.Destroyed&&(this._state=rc.Destroyed,this._syrupRenderer&&(this._syrupRenderer.off("invalid-access-key",null,pc),this._syrupRenderer.off("zoom-support-did-change",null,mc),"function"==typeof this._syrupRenderer.destroy&&this._syrupRenderer.destroy(),this._syrupRenderer=null)):this._state=rc.DestroyPending}get snapsToIntegralZoomLevels(){return!!this._syrupRenderer&&!this._syrupRenderer.supportsNonIntegralZoomLevels()}getMapFeatureRegions(){return this._syrupRenderer&&this._syrupRenderer.getMapFeatureRegions?this._syrupRenderer.getMapFeatureRegions():[]}performScheduledDraw(t){if(this._state!==rc.Ready&&this._state!==rc.Deactivated)return;const e=[this._node.size.width,this._node.size.height];if(0===e[0]||0===e[1])return;this._node.delegate&&this._node.delegate.mapCustomCanvasWillRender&&this._node.delegate.mapCustomCanvasWillRender(this._node);const i=new(0,this.Camera)(e[0]/e[1]),s=this._node.zoomLevel,o=[this._node.camera.center.x,1-this._node.camera.center.y,0];i.setTarget(o),i.setZoomLevel(s),i.setRotation(this._node.camera.rotation*gc*-1);const n=cc?performance.now():void 0;let a;this._syrupRenderer.update(i,e,void 0,void 0,t);const r=this.SyrupRenderer.StatusType;if(cc&&(a=this._syrupRenderer.status(),performance.measure("mapkit-syrup-update-frame",{start:n,detail:{syrupStatus:a,timestamp:t,baseLoa
2ded:a>=r.BASE_LOADED,fullyLoaded:a>=r.FULLY_LOADED}})),this._state!==rc.Destroyed){for(const t of uc.PostUpdateHandlers)t.call(this);dc&&!this._fullyRenderedOnce&&this._syrupRenderer.status&&(a||(a=this._syrupRenderer.status()),!this._baseLoadedOnce&&a>=r.BASE_LOADED&&(this._baseLoadedOnce=!0,performance.measure("mapkit-map-land-cover-rendered","mapkit-map-start")),!this._fullyLoadedOnce&&a>=r.FULLY_LOADED&&(this._fullyLoadedOnce=!0,performance.measure("mapkit-map-base-map-loaded","mapkit-map-start")),!this._fullyRenderedOnce&&a>=r.FULLY_RENDERED&&(this._fullyRenderedOnce=!0,performance.measure("mapkit-map-base-map-rendered","mapkit-map-start"))),this._syrupRenderer.mapFullyRendered()?this._node._impl.tileGridDidFinishRendering():this._node.needsDisplay=!0}}forceRerender(){this._state===rc.Ready&&this._syrupRenderer.forceRerender()}devicePixelRatioDidChange(){this._syrupRenderer?.setPixelRatio(zs())}get element(){return this.canvas}get canvas(){return this._canvas}get fullyRendered(){return!(!this._syrupRenderer||!this._syrupRenderer.mapFullyRendered())}set language(t){this._syrupRenderer&&this._syrupRenderer.setLanguage(t)}set fontSizeRatio(t){this._syrupRenderer&&this._syrupRenderer.setFontSize(t)}updateNetworkConfiguration(t){this._syrupRenderer&&this._syrupRenderer.updateNetworkConfiguration(t)}updateConfiguration(t,e){this._syrupRenderer&&(e.mode=t.name,this._syrupRenderer.setDisplayOptions(e),t.countryCode&&this._syrupRenderer.setLocationInfo(t.countryCode,t.countryCode))}updatePointOfInterestFilter(t){this._syrupRenderer?this._syrupRenderer.setPOIFilter(t):this._initialPoiFilter=t}createLabelRegion(){if(!this._syrupRenderer)return;const t=this._syrupRenderer.createLabelRegion();return this._unregisteredLabelRegions?this._unregisteredLabelRegions.push(t):this._syrupRenderer.registerLabelRegion(t),t}unregisterLabelRegion(t){this._unregisteredLabelRegions?this._unregisteredLabelRegions.splice(this._unregisteredLabelRegions.indexOf(t),1):this._syrupRenderer&&this._syrupRenderer.unregisterLabelRegion(t)}prepareLayer(t){if(this._unregisteredLayers)return;if(!t._impl.syrupLayer||t._impl.rendererId!==this._id){const e={},i=t._impl.blendMode;if(void 0!==i){if(!C(i,mt))throw new Error("Invalid blendMode: "+i);e.blendMode=i}const s=t._impl.backdropFilter;if(void 0!==s){if(!C(s,gt))throw new Error("Invalid backdropFilter: "+s);e.backdropFilter=s}t._impl.rendererId=this._id,t._impl.syrupLayer=this._syrupRenderer.createWebGLLayer(t._impl,e)}const e=this._drawPasses[t._impl.passIndex];t._impl.syrupLayer.setDrawPass(e+t._impl.passOffset)}cleanupLayer(t){t._impl.syrupLayer=void 0}addLayer(t){const e=this._unregisteredLayers;if(e){const i=e.indexOf(t);i>=0&&e.splice(i,1),e.push(t)}else{const e=this._syrupRenderer,i=t._impl,s=t=>{i.syrupToken=e.addLayer(t)};i.syrupToken?i.syrupToken.then(s):s(i.syrupLayer)}}insertBefore(t,e){const i=this._unregisteredLayers;if(i){const s=i.indexOf(e);if(s<0)return void hc();const o=i.indexOf(t);o!==s&&(o>=0&&i.splice(o,1),i.splice(s,0,t))}else{const i=this._syrupRenderer,s=e._impl.syrupToken;if(!s)return void hc();s.then((e=>{const s=t._impl,o=t=>{s.syrupToken=i.insertBefore(t,e)};s.syrupToken?s.syrupToken.then(o):o(s.syrupLayer)}))}}insertAfter(t,e){const i=this._unregisteredLayers;if(i){const s=i.indexOf(e);if(s<0)return void hc();const o=i.indexOf(t);o!==s&&(o>=0&&i.splice(o,1),i.splice(s+1,0,t))}else{const i=this._syrupRenderer,s=e._impl.syrupToken;if(!s)return void hc();s.then((e=>{const s=t._impl,o=t=>{s.syrupToken=i.insertAfter(t,e)};s.syrupToken?s.syrupToken.then(o):o(s.syrupLayer)}))}}removeLayer(t){if(this._unregisteredLayers){const e=this._unregisteredLayers.indexOf(t);if(e<0)return void hc();this._unregisteredLayers.splice(e,1)}else{const e=this._syrupRenderer,i=t._impl.syrupToken;if(!i)return void hc();t._impl.syrupToken=void 0,i.then((t=>{e.removeLayer(t)}))}}getMemoryStatistics(){const t=this._syrupRenderer;return t&&t.getMemoryStatistics?t.getMemoryStatistics():{}}
2}ac(uc,"PostUpdateHandlers",[]);const pc="mapkit-re-bootstrap-notification",mc="mapkit-zoom-support-notification",gc=Math.PI/180;function _c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const fc=Oe.performanceMarkers.interactions,yc=180/Math.PI,vc=3*yc,bc=1e-4*yc*1e3,wc=.995;class Cc extends gh{constructor(t){super(t),_c(this,"_recognizer",void 0),_c(this,"decelerating",!1),_c(this,"_restricted",void 0),_c(this,"_lastRotationCenter",void 0),_c(this,"_timeAtPreviousFrame",void 0),_c(this,"_velocity",void 0),this._recognizer=this.addRecognizer(new pl)}stopDecelerating(){this.decelerating&&this._decelerationEnded()}destroy(){super.destroy(),this.stopDecelerating(),this._recognizer=null}handleEvent(t){const e=t.target;e===this._recognizer&&(e.state===ds.Began&&(this.map.beganRecognizingRotation(),this.map.currentGestureType="rotate",this.map.cameraWillStartRotating()),e.state===ds.Ended&&(delete this._restricted,this.map.finishedRecognizingRotation(),this._startDeceleratingWithVelocity(e)),this._handleRotationChange(e),fc&&performance.measure("mapkit-map-rotate-interaction",{start:e.lastEventTimeStamp,detail:e.state}))}_handleRotationChange(t){this._lastRotationCenter=this.centerForGesture(t);const e=this.map.cameraIsRotating&&t.state===ds.Changed,i=2===t.numberOfTouches&&Math.abs(t.rotation)<=150/t._distance();e&&!i&&(this.map.rotateCameraAroundMapPoint(this._lastRotationCenter,t.rotation),t.rotation=0)}performScheduledUpdate(t){const e=fc?performance.now():void 0;if(!this.decelerating)return;if(null==t)return void this._decelerationEnded();const i=t-this._timeAtPreviousFrame;if(i>300)return void this._decelerationEnded();let s=this._velocity/1e3;const o=Math.pow(wc,i),n=wc*s*(o-1)/-.0050000000000000044;if(s*=o,this.map.cameraAnimation?this.map.cameraAnimation.adjustRotation(this._lastRotationCenter,n):this.map.rotateCameraAroundMapPoint(this._lastRotationCenter,n),this._velocity*=o,Math.abs(this._velocity)<=bc)this._decelerationEnded();else{if(this._velocity*=o,Math.abs(this._velocity)<=bc)return this._decelerationEnded(),void(fc&&performance.measure("mapkit-map-rotate-deceleration",{start:e}));this._timeAtPreviousFrame=t,this._schedule(),fc&&performance.measure("mapkit-map-rotate-deceleration",{start:e})}}_startDeceleratingWithVelocity(t){const e=t.velocity;if(Math.abs(e)>1440||isNaN(e))this.map.cameraDidStopRotating();else{if(Math.abs(e)<vc)return this.decelerating=!1,void this.map.cameraDidStopRotating();this._velocity=e,this.decelerating=!0,this._timeAtPreviousFrame=t.lastEventTimeStamp,this._schedule()}}_schedule(){si(this)}_decelerationEnded(){this.decelerating=!1,this.map.cameraDidStopRotating()}}function kc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Sc={fontFamily:"-apple-system-font, sans-serif",margin:"2em auto",width:"20em",borderRadius:"0.5em",color:"#f8f9f0",backgroundColor:"rgba(0, 0, 0, 0.7)",padding:"1em",textAlign:"center",position:"relative"},Lc={listStyleType:"none",margin:"0",paddingLeft:"0"},Mc={width:"1em",height:"1em",position:"absolute",top:"0.5em",left:"0.5em"};class Ac{constructor(t,e){kc(this,"_element",Tc(document.createElement("div"),Sc)),kc(this,"_items",void 0);const i=Tc(this._element.appendChild(document.createElement("ul")),Lc);this._items=[function(t){const e=t.center.toCoordinate();return"Center: "+e.latitude.toFixed(6)+", "+e.longitude.toFixed(6)},function(t){return"Zoom: "+t.zoom.toFixed(6)+", rotation: "+t.rotation.toFixed(6)},function(t){const e=Math.floor(t.zoom),i=Math.pow(2,e);return"Center tile: x="+Math.floor(b(t.center.x,1)*i)+", y="+Math.floor(t.center.y*i)+", z="+e},function(t){return"Viewport: "+t.viewportSize.width+"×"+t.viewportSize.height}].map((t=>{const e=i.appendChild(document.createElement("li"));return function(i){e.textContent=t(i)}}));const s=Us("svg",{viewBox:"-16 -16 32 32"},Us("circle",{r:16,fill:"#ccc"}),Us("g",{"stroke-width":4,stroke:"#222"},Us("line",{x1:-8,y1:-8,x2:8,y2:8}),Us("line",{x1:8,y1:-8,x2:-8,y2:8})));this._element.appendChild(Tc(s,Mc)),s.addEventListener("click",t),this.update(e),this.update=Oo((t=>this.update(t)),50,this)}attachTo(t){t.appendChild(this._element)}detach(){this._element.remove()}
2update(t){this._items.forEach((e=>{e(t)}))}}function Tc(t,e){for(const i in e)t.style[i]=e[i];return t}function xc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Ec extends Rd{_fallback(){this._requiresFallback=!0}constructor(t){super(t),xc(this,"_renderer",void 0),xc(this,"_requiresFallback",!1),xc(this,"forcedSnapsToIntegralZoomLevels",!1),xc(this,"_debugPanel",void 0),this._renderer=new uc(t)}init(t,e,i,s,o){if(this._requiresFallback)return void t.syrupRequestedFallback?.(li.FEATURE_ERROR);this._fallback=()=>{t.syrupRequestedFallback?.(li.FEATURE_ERROR)};const n={tint:this.tileTint,emphasis:this.emphasis};this._renderer.init(this.networkConfigurationFor(t),e,i,s,n,this._getRendererPoiFilter(),(t=>{this._updateMinAndMaxZoomLevels(this.camera.viewportSize),o(t)}))}get isRotationEnabled(){return this._isRotationEnabled}set isRotationEnabled(t){!t&&this._rotationController?(this._rotationController.destroy(),this._rotationController=null):t&&!this._rotationController&&(this._initialInteractionController||(this._initialInteractionController=new ph(this)),this._rotationController=new Cc(this)),this._isRotationEnabled=t}get rotation(){return this.camera.rotation}set rotation(t){if(this._cameraWillChange(),this.camera.rotation=t,this._updateDisplay(),this._cameraDidChange(),this.cameraAnimation&&this.cameraAnimation.rotating)return;const e=this.node.delegate;e&&"function"==typeof e.mapRotationDidChange&&e.mapRotationDidChange(this.node)}set fontSizeRatio(t){this._renderer.fontSizeRatio=t,this._updateDisplay()}updateNetworkConfiguration(t){this._renderer.updateNetworkConfiguration(this.networkConfigurationFor(t))}forceRerender(){this._renderer.forceRerender()}prepareLayer(t){this._renderer.prepareLayer(t)}cleanupLayer(t){this._renderer.cleanupLayer(t)}addLayer(t){this._renderer.addLayer(t)}insertLayerBefore(t,e){this._renderer.insertBefore(t,e)}insertLayerAfter(t,e){this._renderer.insertAfter(t,e)}removeLayer(t){this._renderer.removeLayer(t)}getMemoryStatistics(){return this._renderer.getMemoryStatistics()}adjustForSize(t){super.adjustForSize(t),this.forceRerender()}adjustMapItemPoint(t){return this.cameraIsZooming||this.cameraIsPanning||this.cameraIsRotating||(t.x=Ns(t.x),t.y=Ns(t.y)),t}networkConfigurationFor(t){let e,i=!1;return t.customMadabaUrl||(e=t.getProxyPrefix(),i=t.urlWithCredentials(e)),{madabaDomains:t.madabaDomains.slice(0),rasterTiles:t.rasterTilesForSyrup,proxyPrefixes:e?[e]:null,withCredentials:i,tileGroup:t.tileGroup,accessKey:t.accessKey,accessKeyHasExpired:()=>t.accessKeyHasExpired()}}rotateCameraAroundMapPoint(t,e){if(this.isRotationLocked){if(!this.restrictedCamera)return;if(this.restrictIncomingRotation){const t=b(this.camera.rotation+e,360),i=Js(t);i!==t&&(e=i-this.camera.rotation)}}if(0===e)return;this._cameraWillChange(),this.camera.rotateAroundCenter(t,e),this.constrainCamera(this.camera),this._updateDisplay(),this._cameraDidChange();const i=this.node.delegate;i&&"function"==typeof i.mapRotationDidChange&&i.mapRotationDidChange(this.node)}deactivate(){super.deactivate(),this.isRotationEnabled=!1,this._renderer.deactivate()}getMapFeatureRegions(){return this._renderer.getMapFeatureRegions()}destroy(t){super.destroy(t),this._renderer&&(this._renderer.destroy(),this._renderer=null)}stringInfo(){return"SyrupNode<camera:"+this.camera.toString()+">"}get fullyRendered(){return this._renderer.fullyRendered}get customCanvas(){return this._renderer&&this._renderer.canvas}get camera(){return this._camera}set camera(t){this._camera=t,this.node.needsDisplay=!0}get language(){return this._language}set language(t){this._language!==t&&(this._language=t,this._renderer&&(this._renderer.language=t,this.node.needsDisplay=!0))}updateConfiguration(t){const e=this._configuration&&(t.name!==this._configuration.name||t.provider!==this._configuration.provider||t.countryCode!==this._configuration.countryCode);super.updateConfiguration(t),e&&this._renderer&&(this._renderer.updateConfiguration(t,{}),this.node.needsDisplay=!0)}updateTintAndEmphasis(t,e,i){this._renderer._node.pendingConfigurationUpdates?(this._renderer._node.pendingConfigurationUpdates.tint=t,this._renderer._node.pendingConfigurationUpdates.tileTint=e,this._renderer._node.pendingConfigurationUpdates.emphasis=i):this._renderer&&this._configuration&&(this._renderer.updateConfiguration(this._configuration,{tint:e,emphasis:i}),this.node.needsDisplay=!0)}updatePointOfInterestFilter(){this._renderer&&(this._renderer.updatePointOfInterestFilter(this._getRendererPoiFilter()),this.node.needsDisplay=!0)}makePendingConfigurationUpdates(){const t=this._renderer._node.pendingConfigurationUpdates;t&&(delete this._renderer._node.pendingConfigurationUpdates,t.tint&&t.emp
2hasis&&this.updateTintAndEmphasis(t.tint,t.tileTint,t.emphasis),t.poiFilter&&this.updatePointOfInterestFilter())}devicePixelRatioDidChange(){return!this._renderer}get snapsToIntegralZoomLevels(){return!!(this.forcedSnapsToIntegralZoomLevels||this._renderer&&this._renderer.snapsToIntegralZoomLevels)}set snapsToIntegralZoomLevels(t){}get debug(){return this._debug}set debug(t){this._debug!==!!t&&(this._debug=!!t,this._debug?this._showDebugPanel():this._hideDebugPanel())}minZoomLevelForViewportSize(t,e){return this._renderer?.Camera?this._renderer.Camera.getMinZoomLevel([t.width,t.height],e):this.minZoomLevel}createLabelRegion(){return this._renderer.createLabelRegion()}updatedLabelRegion(){this.forceRerender(),this.node.needsDisplay=!0}unregisterLabelRegion(t){this._renderer.unregisterLabelRegion(t),this.node.needsDisplay=!0}_tileOverlaysDidChange(){this._fallback()}_showDebugPanel(){this._debugPanel=new Ac((()=>{this.debug=!1}),this.camera),this._debugPanel.attachTo(this._element)}_hideDebugPanel(){this._debugPanel.detach(),delete this._debugPanel}_updateDisplay(){this.forceRerender(),this.node.needsDisplay=!0}_getRendererPoiFilter(){const t=null!==this.pointOfInterestFilter,e=0!==this._filteredPois.size,i={};return t&&(i.categoryInclude=this.pointOfInterestFilter._includes,i.categoryExclude=this.pointOfInterestFilter._excludes),e&&(i.muidExclude=Array.from(this._filteredPois)),t||e?i:null}_cameraDidChange(){super._cameraDidChange(),this._debugPanel&&this._debugPanel.update(this.camera)}get[eh](){return this._[eh]}set[eh](t){this._[eh]=t,this._renderer[eh]?.(t)}[ih](t){return this._renderer[ih]?.(t)}}function Ic(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Oc extends rh{constructor(){super(),Ic(this,"_impl",void 0),Ic(this,"pendingConfigurationUpdates",void 0),this._impl=new Ec(this)}get isRotationEnabled(){return this._impl.isRotationEnabled}set isRotationEnabled(t){this._impl.isRotationEnabled=t}get customCanvas(){return this._impl.customCanvas}set needsDisplay(t){t&&oi(this._impl._renderer)}get forcedSnapsToIntegralZoomLevels(){return this._impl.forcedSnapsToIntegralZoomLevels}set forcedSnapsToIntegralZoomLevels(t){this._impl.forcedSnapsToIntegralZoomLevels=t}init(t,e,i,s,o){this._impl.init(t,e,i,s,o)}updateNetworkConfiguration(t){this._impl.updateNetworkConfiguration(t)}forceRerender(){this._impl.forceRerender()}forceDraw(){this._impl.forceRerender(),this._impl._renderer.performScheduledDraw()}requireRender(){this._impl.forceRerender(),oi(this._impl._renderer)}rotateCameraAroundMapPoint(t,e){this._impl.rotateCameraAroundMapPoint(t,e)}makePendingConfigurationUpdates(){this._impl.makePendingConfigurationUpdates()}didReconfigure(){this.dispatchEvent(new n.Event("reconfigured"))}getMapFeatureRegions(){return this._impl.getMapFeatureRegions()}getMemoryStatistics(){return this._impl.getMemoryStatistics()}}function Pc(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function Rc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function zc(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}const Dc=St,Nc={sg_grid:{"global-configuration":"sg_ready",upgrade:"syrup_insert"},sg_insert:{"global-configuration":"sg_ready",upgrade:"syrup_insert",recreate:"sg_insert"},syrup_insert:{"global-configuration":"syrup_need_load",fallback:"sg_insert",recreate:"syrup_insert"},syrup_need_load:{"syrup-load":"syrup_init",fallback:"sg_insert",recreate:"syrup_insert"},syrup_init:{"global-configuration":"syrup_network_stalled",fallback:"sg_insert",recreate:"syrup_insert","syrup-complete":"syrup_ready"},syrup_network_stalled:{"global-configuration":"syrup_network_stalled",fallback:"sg_insert",recreate:"syrup_insert","syrup-complete":"syrup_ready"},sg_ready:{"global-configuration":"sg_ready",upgrade:"syrup_insert",recreate:"sg_insert","map-configuration":"sg_ready"},syrup_ready:{"global-configuration":"syrup_ready",upgrade:"syrup_insert",fallback:"sg_insert",recreate:"syrup_insert","map-configuration":"syrup_ready","print-match":"syrup_printing"},syrup_printing:{"print-unmatch":"syrup_ready"}},Fc=Object.values(pt);var Uc=new WeakMap;class Wc{constructor(t,e){Rc(this,"_state",void 0),Rc(this,"_map",void 0),Rc(this,"_previousNode",void 0),Rc(this,"node",void 0),Rc(this,"_initialOptions",void 0),Rc(this,"_displayCanvas",void 0),Rc(this,"_layers",void 0),Rc(this,"loadPriority",void 0),Rc(this,"initialContextType",void 0),Rc(this,"_previousCanRunCSR",void 0),Rc(this,"_switchedToLoCSR",void 0),Rc(this,"_fallbackInfo",void 0),Pc(this,Uc,{writable:!0,value:{sg_grid:()=>this._enter_sg_grid(),sg_insert:()=>this._enter_sg_insert(),sg_ready:()=>this._enter_sg_ready(),syrup_init:()=>this._enter_syrup_init(),syrup_insert:()=>this._enter_syrup_insert(),syrup_need_load:()=>this._enter_syrup_need_load(),syrup_network_stalled:()=>this._enter_syrup_network_stalled(),syrup_printing:()=>this._enter_syrup_printing(),syrup_ready:()=>this._enter_syrup_ready()}}),this._map=t,this._previousNode=null,this.node=null,this._initialOptions=e,this._displayCanvas=null,this._layers=[],this.loadPriority=_t.LandCover,void 0!==e.loadPriority&&(C(e.loadPriority,_t)?this.loadPriority=e.loadPriority:console.warn("[MapKit] Unknown value for `loadPriority`. Choose from mapkit.Map.LoadPriorities.")),this.initialContextType=e.contextType,this._previousCanRunCSR=!1;this._updateState("sg_grid")}get usingSSR(){return"sg_insert"===this._state||"sg_ready"===this._state}get csrCapable(){return"HYBRID"===Oe.forcedRenderingMode||"CLIENT"===Oe.forcedRenderingMode||!!this.displayCanvas.context}get displayCanvas(){return null===this._displayCanvas&&(this._displayCanvas=new Wl(this._map.element,this.initialContextType)),this._displayCanvas}get renderingMode(){return this.usingSSR?"SERVER":this._switchedToLoCSR?"HYBRID":"CLIENT"}configurationDidBecomeAvailable(t){const e=this._previousCanRunCSR,i=!!Oe.canRunCSR;this._previousCanRunCSR=i,!e||i||this.usingSSR?!e&&i?this.handleUpgrade():t||this.handleGlobalConfigurationChange():this.handleFallback(li.CONFIG_CHANGE)}forceSyrup(){this._transition("upgrade")}_findLayerIndex(t){let e;const i=this._layers;if("string"==typeof t)for(e=i.length;e--&&i[e]?._impl.name!==t;);else e=i.indexOf(t);if(e<0)throw new Error("[MapKit] Layer not found");return e}_addLayer(t,e,i){const s=this._layers;let o;const n=Fc.indexOf(e);if(n<0){o=this._findLayerIndex(e);const n=s[o];t._impl.passIndex=n._impl.passIndex,t._impl.passOffset=n._impl.passOffset,o+=i}else{o=0;let e=s[o];for(;e&&e._impl.passIndex&&e._impl.passIndex<n+i;)o++,e=s[o];t._impl.passIndex=n,t._impl.passOffset=i-1}if(this.node._impl.prepareLayer(t),o===s.length)this.node._impl.addLayer(t);else if(0===o)this.node._impl.insertLayerBefore(t,s[0]);else{const e=s[o-1];this.node._impl.insertLayerAfter(t,e)}s.splice(o,0,t)}_addedLayer(t){this.usingSSR?t._impl.contextFailed():this.node.requireRender()}addLayerAbove(t,e){void 0===e?(t._impl.passIndex=Fc.length-1,t._impl.passOffset=0,this.node._impl.prepareLayer(t),this.node._impl.addLayer(t),this._layers.push(t)):this._addLayer(t,e,1),this._addedLayer(t)}addLayerBelow(t,e){if(void 0===e)throw new Error("[MapKit] Relative layer not specified");this._addLayer(t,e,0),this._addedLayer(t)}removeLayer(t){const e=this._findLayerIndex(t);this._layers.splice(e,1),this.node._impl.removeLayer(t),this.node.requireRender()}requireRender(){this.node.requireRender()}updateSize(t){this.node.size=t,this._previousNode&&(this._previousNode.size=t)}
2destroy(){this.node&&(this._layers.forEach((t=>{this.node._impl.removeLayer(t)})),this.node.removeEventListener("reconfigured",this),this.node.destroy(),this.node.delegate=null,this.node=null),this._previousNode&&(this._previousNode.destroy(),this._previousNode=null),this.displayCanvas?.destroy()}handleEvent(t){"reconfigured"===t.type&&(this._switchedToLoCSR=this.node.snapsToIntegralZoomLevels,this._map.didReconfigureMapNode(this.node))}handleGlobalConfigurationChange(){this._transition("global-configuration")}handleSyrupLoad(){this._transition("syrup-load")}handleFallback(t,e){const i=Oe.didFallback&&Oe.fallbackType||t;i&&this._logFallback(i,e),this._fallbackInfo={reason:t,message:e},this._displayCanvas?.destroy(),this._transition("fallback")}handleUpgrade(){this._fallbackInfo=void 0,this._displayCanvas?.destroyed&&(this._displayCanvas=null),this._transition("upgrade")}handleRecreate(){this._transition("recreate")}handleMapConfigurationChange(){if(this._transition("map-configuration"),this._previousNode&&this._previousNode.configuration){const t=Oe.types[this._map.mapType];this._previousNode.language=Oe.language,this._previousNode.configuration=t}}handleSyrupComplete(){this._transition("syrup-complete")}handlePrintMatch(){this._transition("print-match")}handlePrintUnmatch(){this._transition("print-unmatch")}handleMapRendered(){this.node instanceof Oc&&(this.node.forcedSnapsToIntegralZoomLevels=!1,this._removePreviousMapNode(!0))}setPointOfInterestFilter(t){this._previousNode&&(this._previousNode.pointOfInterestFilter=t)}setTintAndEmphasis(t,e,i){this._previousNode&&this._previousNode.setTintAndEmphasis(t,e,i)}mapCameraDidChange(){this._previousNode&&this._previousNode.setCameraAnimated(this.node.camera.copy())}_transition(t){const e=Nc[this._state][t];e&&this._updateState(e)}_updateState(t){this._state=t;(0,zc(this,Uc)[t])()}_loadSyrupIfNeeded(t){Ml().then((()=>{t.call(this,!!window.Syrup)}))}_insertSceneGraphNode(){this.usingSSR&&(this.node.isRotationEnabled=!1);const t=new ic;this._insertNewMapNode(t),this._map.didFinishMapNodeInitialization(t)}_enter_sg_grid(){this._insertSceneGraphNode(),Oe.ready&&!Oe.canRunCSR&&this._updateState("sg_ready")}_enter_sg_insert(){this._insertSceneGraphNode(),Oe.ready&&this._updateState("sg_ready")}_enter_syrup_insert(){const t=new Oc;t.pendingConfigurationUpdates={},this._insertNewMapNode(t),Oe.state===Oe.States.READY&&this._updateState("syrup_need_load")}_insertNewMapNode(t){const e=this._initialOptions||{};this._initialOptions||this.node._impl._cameraWillChange(!1);const i=this.node;if(i)this._removePreviousMapNode(),i.migrateStateTo(t),i.removeEventListener("reconfigured",this),i.deactivate(),this._layers.forEach((t=>{i._impl.cleanupLayer(t),i._impl.removeLayer(t)})),this._previousNode=i,this._map.didSetPreviousMapNode(i);else{t.allowWheelToZoom=void 0!==e._allowWheelToZoom&&!!e._allowWheelToZoom,t.allowWheelToZoom2=void 0===e._allowWheelToZoom2||!!e._allowWheelToZoom2,t.pannable=void 0===e.isScrollEnabled||!!e.isScrollEnabled,t.zoomable=void 0===e.isZoomEnabled||!!e.isZoomEnabled,void 0!==e.pointOfInterestFilter?(void 0!==e.showsPointsOfInterest&&console.warn("[MapKit] `showsPointsOfInterest` is ignored because `pointOfInterestFilter` is set."),null!==e.pointOfInterestFilter&&L(e.pointOfInterestFilter,$l,"[MapKit] Unknown value for `pointOfInterestFilter`. It must be an instance of mapkit.PointOfInterestFilter."),t.pointOfInterestFilter=e.pointOfInterestFilter):void 0!==e.showsPointsOfInterest&&(e.showsPointsOfInterest?t.pointOfInterestFilter=null:t.pointOfInterestFilter=Ql),t.showsDefaultTiles=void 0===e._showsDefaultTiles||!!e._showsDefaultTiles;for(const i of Wc.InitialOptionsHandlers)i.call(this,t,e)}this.node=t,this.node.addEventListener("reconfigured",this),this._map.didInsertNewMapNode(t),this._layers.forEach((e=>{t._impl.prepareLayer(e),t._impl.addLayer(e)})),this._initialOptions?delete this._initialOptions:this.node._impl._cameraDidChange()}_removePreviousMapNode(t){if(this._previousNode)if(t){if(this._previousNode.animators&&this._previousNode.animators.length)return;const t=this._previousNode;new Gc({node:this._previousNode,duration:150,from:1,to:0,customCanvas:this._previousNode instanceof Oc?this._previousNode.customCanvas??void 0:void 0,done:()=>{t===this._previousNode&&this._removePreviousMapNode(!1)}}).begin()}else this._previousNode.destroy(!0),this._previousNode.remove(),this._previousNode=null}_enter_syrup_need_load(){if(this.displayCanvas.context){if(this.loadPriority&&this._previousNode&&this._previousNode instanceof ic&&!this._previousNode.configuration)if(0!==this.node.rotation)0;else{const t=this.loadPriority===_t.PointsOfInterest;this._previousNode.snapsToIntegralZoomLevels=t,this._previousNode.labels=t,t&&(this.node.forcedSnapsToIntegralZoomLevels=!0,this.node.setZoomLevelAnimated(Qs(this.node.zoomLevel))),this._previousNode.language=Oe.language;const e=Oe.types[this._map.mapType];this._previousNode.configuration=e,this._previousNode.delegate={mapDidFinishRendering:t=>this._map.previousMapDidFinishRendering(t)},this._previousNode.setCameraBoundaryAnimated(),this._previousNode.setCameraZoomRangeAnimated()}this._loadSyrupIfNeeded((t=>{t?this.handleSyrupLoad():(Oe.syrupRequestedFallback(),this.handleFallback(li.NETWORK_E
2RROR))}))}else this.handleFallback(li.BROWSER_SUPPORT_ERROR)}_enter_syrup_init(){if(!this.node)return;if(!Oe.madabaDomains||!Oe.madabaDomains.length)return this._csrWarning("Network error"),void this.handleFallback(li.CONFIG_MISSING);const t="object"==typeof window.Syrup?window.Syrup.SyrupRenderer:void 0,e="object"==typeof window.Syrup?window.Syrup.Camera:void 0;this._switchedToLoCSR=!1,Oe.forcedRenderingMode&&(this._switchedToLoCSR="HYBRID"===Oe.forcedRenderingMode);const i=this.node;this._reConfigureMapNode();const s=this.displayCanvas,o=Oe.performanceMarkers.rendering?performance.now():void 0;i.init(Oe,t,e,{startInLoCSR:this._switchedToLoCSR,context:s.context,contextType:s.type,element:s.element,performanceMarkers:Oe.performanceMarkers.rendering},(t=>{Oe.performanceMarkers.rendering&&performance.measure("mapkit-syrup-init",{start:o}),t?(this._csrWarning(t),this.handleFallback(t.type||li.UNKNOWN_ERROR,t.message)):(i.customCanvas&&i.customCanvas!==this.displayCanvas.element&&this.displayCanvas.destroy(),this._reConfigureMapNode(),i.needsDisplay=!0,this._map.didFinishMapNodeInitialization(i),this.handleSyrupComplete())}))}_csrWarning(t){console.warn("[MapKit] CSR is unavailable. "+t.toString())}_enter_syrup_network_stalled(){this.node.updateNetworkConfiguration(Oe)}_enter_sg_ready(){this._removePreviousMapNode(),this.node.snapsToIntegralZoomLevels=!0,this.node.isRotationEnabled=!1,"HYBRID"!==Oe.forcedRenderingMode&&"CLIENT"!==Oe.forcedRenderingMode||(this._map.mapNodeDidFail(this._fallbackInfo),console.warn("[MapKit] Not rendering raster tiles under forced client rendering."),this.node.showsDefaultTiles=!1),this._reConfigureMapNode(),this._map.mapNodeReady(!1),this._layers.forEach((t=>{t._impl.contextFailed()}))}_enter_syrup_ready(){const t=Oe.types[this._map.mapType];!this.node.fullyRendered&&this._previousNode&&this._previousNode.configuration?(this._previousNode.language=Oe.language,this._previousNode.configuration=t):this._removePreviousMapNode(),this._reConfigureMapNode(),this.node.updateNetworkConfiguration(Oe),this.node.makePendingConfigurationUpdates(),this._map.mapNodeReady(!0)}_reConfigureMapNode(){const t=Oe.types[this._map.mapType];this.node.language=Oe.language,this.node.configuration=t,this.node._impl.debug||(this.node._impl.debug=!!Oe.showsTileInfo),this._map.didReconfigureMapNode(this.node)}_enter_syrup_printing(){this.node.forceRerender(),this.node.needsDisplay=!0}_sendAnalytics(t){const e=Oe.applyProxyPrefix("https://gsp10.apple-mapkit.com/hvr/mw/v1/spile"),i={};t&&(i.ssrFallback=t);const s=new Gt(e,{getDataToSend:function(t){return t.setRequestHeader("Content-Type","text/plain"),t.responseType="text",JSON.stringify(i)}},{method:"POST",priority:Dc.Low,withCredentials:Oe.urlWithCredentials(e)});s.schedule()}_logFallback(t,e){const i=yn.uaParserInfo.browserInfo,s=yn.uaParserInfo.deviceInfo,o=this._usingCSRAPI();this._sendAnalytics({reason:t,message:e,usingCSRAPI:o,devicePlatform:s.platform,deviceOs:s.os,browserName:i.name,browserVersion:i.version})}_usingCSRAPI(){return!(this._map._showsCompass!==yt.Visible&&(this._map._showsCompass!==yt.Adaptive||this._map._usingDefaultShowsCompassValue)&&0===this._map.rotation&&this._map._annotationsController&&!this._map._annotationsController.containsMarkerAnnotation())}}Rc(Wc,"InitialOptionsHandlers",[]);class Gc extends So{constructor(t){super(t),Rc(this,"customCanvas",void 0),this.customCanvas=t.customCanvas}update(t){this.customCanvas&&(this.customCanvas.style.opacity=this.valueAt(t).toString()),super.update(t)}}function Bc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Zc{constructor(...t){if(Bc(this,"top",0),Bc(this,"right",0),Bc(this,"bottom",0),Bc(this,"left",0),"object"==typeof t[0]){this.top=0,this.right=0,this.bottom=0,this.left=0;const e=t[0];Object.keys(e).forEach((t=>{"top"===t||"right"===t||"bottom"===t||"left"===t?this[t]=e[t]:console.warn("[MapKit] Unknown property `"+t+"` for Padding constructor.")}))}else this.top=t.length>0?t[0]:0,this.right=t.length>1?t[1]:0,this.bottom=t.length>2?t[2]:0,this.left=t.length>3?t[3]:0;S(this.top,"number","[MapKit] Expected a number for `top` in Padding constructor but got `"+this.top+"` instead."),S(this.left,"number","[MapKit] Expected a number for `left` in Padding constructor but got `"+this.left+"` instead."),S(this.bottom,"number","[MapKit] Expected a number for `bottom` in Padding constructor but got `"+this.bottom+"` instead."),S(this.right,"number","[MapKit] Expected a number for `right` in Padding constructor but got `"+this.right+"` instead.")}toString(){return"Padding("+[this.top,this.right,this.bottom,this.left].join(", ")+")"}copy(){return new Zc(this.top,this.right,this.bottom,this.left)}equals(t){return this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left}}Bc(Zc,"Zero",new Zc);function jc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Kc=(t,e,i)=>{const s=t.createShader(e);t.shaderSource(s,i),t.compileShader(s);if(t.getShaderParameter(s,t.COMPILE_STATUS))return s;t.deleteShader(s)};class Hc{constructor(t){jc(this,"scene",void 0),jc(this,"failed",!1),jc(this,"program",void 0),jc(this,"passOffset",0),this.scene=t}prepare(t){if(this.failed)return;const e=Kc(t,t.VERTEX_SHADER,"\nattribute vec2 a_position;\nvarying vec2 v_texcoord;\nvoid main() {\n gl_Position = vec4((a_position * 2.0 - 1.0) * vec2(1, -1), 0, 1);\n v_texcoord = a_position;\n}\n"),i=Kc(t,t.FRAGMENT_SHADER,"precision mediump float;\nvarying vec2 v_texcoord;\nuniform sampler2D u_texture;\nvoid main() {\n gl_FragColor = texture2D(u_texture, v_texcoord);\n}");
2this.program=function(t,e,i){const s=t.createProgram();if(t.attachShader(s,e),t.attachShader(s,i),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS))return s;t.deleteProgram(s)}(t,e,i)}release(t){this.failed||t.deleteProgram(this.program)}added(t){this.prepare(t)}removed(t){this.release(t)}render(t){if(this.failed)return;const e=this.program,i=t.getAttribLocation(e,"a_position"),s=t.getUniformLocation(e,"u_texture"),o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o);const n=t.canvas.width,a=t.canvas.height;t.viewport(0,0,n,a),t.useProgram(this.program),t.enableVertexAttribArray(i),t.bindBuffer(t.ARRAY_BUFFER,o);const r=t.createTexture();t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.scene.element),t.generateMipmap(t.TEXTURE_2D),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),t.STATIC_DRAW),t.vertexAttribPointer(i,2,t.FLOAT,!1,0,0),t.uniform1i(s,0),t.enable(t.BLEND),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA),t.drawArrays(t.TRIANGLES,0,6)}contextFailed(){this.failed=!0}}class qc{constructor(t){jc(this,"_impl",void 0),this._impl=new Hc(t)}}function Vc(t,e){S(e,"object","[MapKit] MapRect.pad expects a padding object with top, left, bottom, right but got `"+String(e)+"` instead");const i=e.left||0,s=e.top||0;return new ot(t.origin.x-i,t.origin.y-s,t.size.width+i+(e.right||0),t.size.height+s+(e.bottom||0))}function Yc(t,e){const i=e.origin.x,s=e.origin.y,o=t.maxX(),n=t.maxY();return i>=t.origin.x&&i<=o&&s>=t.origin.y&&s<=n&&e.maxX()<=o&&e.maxY()<=n}function Xc(t){if(0===t.length)return new ot;if(1===t.length){const e=t[0],i=e.minX();return i>=0&&i<1?e:new ot(b(i,1),e.minY(),e.size.width,e.size.height)}const e=t[0],i=[[e.minX(),e.maxX()]];let s=e.minY(),o=e.maxY();for(let e=1,n=t.length,a=0;e<n;++e){const n=i[a],r=t[e];s=Math.min(s,r.minY()),o=Math.max(o,r.maxY()),r.minX()<=n[1]?i[a]=[n[0],Math.max(n[1],r.maxX())]:(i.push([r.minX(),r.maxX()]),++a)}const n=i.length;if(1===n)return new ot(i[0][0],s,Math.min(i[0][1]-i[0][0],1),o-s);const a=i[n-1];let r=1+i[0][0]-a[1],l=i[0][0];for(let t=1;t<n;++t){const e=i[t],s=i[t-1],o=e[0]-s[1];o>r&&(r=o,l=e[0])}return new ot(b(l,1),s,1-r,o-s)}function $c(t,e){const i={};for(const s of e)void 0!==t[s]&&(i[s]=t[s]);return i}function Jc(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Qc=ys(),tu=new ot(0,0,1,1),eu="mk-panning",iu="mk-dragging-cursor",su="mk-dragging-annotation",ou="InitializedWithoutConfiguration",nu="Initialized",au="ReadyWithoutConfiguration",ru="Ready",lu="Rendered",hu="Switched",du="Destroyed",cu={padding:"rw",isScrollEnabled:"rw",isZoomEnabled:"rw",center:"rw",region:"rw",rotation:"rw",isRotationEnabled:"rw",showsCompass:"rw",visibleMapRect:"rw",tintColor:"rw",annotations:"rw",selectedAnnotation:"rw",overlays:"rw",selectedOverlay:"rw",showsUserLocation:"rw",tracksUserLocation:"rw",mapType:"rw",contextType:"rw",colorScheme:"rw",_allowWheelToZoom:"rw",_allowWheelToZoom2:"rw",_showsDefaultTiles:"rw",_internalAppDelegate:"rw",loadPriority:"rw",showsPointsOfInterest:"rw",showsMapTypeControl:"rw",showsZoomControl:"rw",showsScale:"rw",showsUserLocationControl:"rw",pointOfInterestFilter:"rw",annotationForCluster:"rw",cameraDistance:"rw",cameraZoomRange:"rw",cameraZoomLimit:"rw",cameraBoundary:"rw",distances:"rw",tileOverlays:"rw",selectableMapFeatures:"rw",selectableMapFeatureSelectionAccessory:"rw",annotationForMapFeature:"rw",_unifiedCanvas:"rw",_textZoom:"rw",element:"ro",userLocationAnnotation:"ro"};function uu(t,e){return new Error(1===e.length?`[MapKit] mapkit.Map.${t} is available after loading the following library: ${e.join(", ")}.`:`[MapKit] mapkit.Map.${t} is available after loading one of the following libraries: ${e.join(", ")}.`)}const pu=Oe.performanceMarkers.loading,mu=Oe.performanceMarkers.rendering,gu=Oe.performanceMarkers["frame-updates"];gu&&Zi.setPerformanceMeasureName("mapkit-dom-update-frame");const _u="mk-dark-mode",fu="zoom-start",yu="zoom-end",vu="select",bu="deselect",wu="region-change-start",Cu="region-change-end",ku="scroll-start",Su="scroll-end",Lu="map-type-change",Mu="rotation-start",Au="rotation-change",Tu="rotation-end",xu="single-tap",Eu="double-tap",Iu="long-press",Ou="map-node-change",Pu="map-node-ready",Ru="complete",zu="error",Du="start-up-complete",Nu="user-location-change",Fu="user-location-error";class Uu extends Mh{constructor(t,e,i){super(t),this.reason=e,this.message=i}}class Wu extends Mh{constructor(t,e){super(t),this.annotation=e}}class Gu extends Mh{constructor(t,e,i){super(t),this.annotation=e,this.coordinate=i}}class Bu extends Mh{constructor(t,e){super(t),this.overlay=e}}class Zu extends Mh{constructor(t,e,i){super(Nu),this.coordinate=t,this.timestamp=e,this.floorLevel=i}}class ju extends Mh{constructor(t,e){super(Fu),this.code=t,this.message=e}}class Ku extends Mh{constructor(t,e,i){super(t),this.pointOnPage=e,this.domEvents=i}}class Hu{constructor(t,e,i){Jc(this,"_annotationForMapFeature",void 0),Jc(this,"_annotationsController",void 0),Jc(this,"_bootstrapSize",void 0),Jc(this,"_cameraBoundary",void 0),Jc(this,"_canvas2dLayer",void 0),Jc(this,"_colorScheme",Hu.ColorSchemes.Light),Jc(this,"_colorSchemeHandle",null),Jc(this,"_controlsLayer",void 0),Jc(this,"_delayedShowItems",void 0),Jc(this,"_distances",Hu.Distances.Adaptive),Jc(this,"_dppxMediaQueryList",null),Jc(this,"_firstCameraUpdateToTrackUserLocationPending",void 0),Jc(this,"_iframe",null),Jc(this,"_linearZoomController",null),Jc(this,"_loadControl
2sLayerHasFailed",void 0),Jc(this,"_mapFeaturesLayerController",void 0),Jc(this,"_mapNodeController",void 0),Jc(this,"_mapRoot",null),Jc(this,"_mapType",Hu.MapTypes.Standard),Jc(this,"_mapUserInteractionController",void 0),Jc(this,"_overlaysController",void 0),Jc(this,"_padding",new Zc),Jc(this,"_adjustedPadding",new Zc),Jc(this,"_panningWasPrevented",void 0),Jc(this,"_printMediaQueryList",void 0),Jc(this,"_renderingFrame",void 0),Jc(this,"_resizeObserver",null),Jc(this,"_scene",null),Jc(this,"_selectableMapFeatures",void 0),Jc(this,"_selectableMapFeatureSelectionAccessory",void 0),Jc(this,"_showsCompass",yt.Adaptive),Jc(this,"_showsMapTypeControl",!Qc),Jc(this,"_showsScale",yt.Hidden),Jc(this,"_showsUserLocationControl",!1),Jc(this,"_showsZoomControl",!Qc),Jc(this,"_textZoomDetector",null),Jc(this,"_updateInitialControlsLayerStateCalled",void 0),Jc(this,"_userLocationController",void 0),Jc(this,"_usingDefaultShowsCompassValue",!0),Jc(this,"_visibleFrame",void 0),Jc(this,"_visibleMapRect",tu),Jc(this,"_zoomLevelWhenCameraChangeStarted",void 0),Jc(this,"contextType",void 0),Jc(this,"controlsLayer",null),Jc(this,"isInConstructor",void 0),Jc(this,"mapNodeCameraBeforeChange",void 0),Jc(this,"public",void 0),Jc(this,"rootNode",null),Jc(this,"blurLayer",void 0),Jc(this,"state",void 0),Jc(this,"_showsUserLocation",!1),Jc(this,"_tracksUserLocation",!1),Jc(this,"_tintColor",""),Jc(this,"_annotationForCluster",null),Jc(this,"_emphasis",ft.Standard),Jc(this,"currentColorScheme",null),Jc(this,"tint",null),Jc(this,"_forcedInteractionCenter",null),Jc(this,"shouldDispatchRotationChangeEvent",!1),Jc(this,"selectionMayChange",!0),Jc(this,"_delayedTapFunction",void 0),Jc(this,"unifiedCanvas",!1),Jc(this,"_boundDarkModeDidChange",(()=>{this._updateMapNodeTintAndEmphasis(this._mapNode)})),Jc(this,"_completedOnce",!1),Jc(this,"_boundDevicePixelRatioDidChange",(()=>this._devicePixelRatioDidChange())),Jc(this,"_boundPrintMediaQueryChanged",(()=>this._printMediaQueryChanged())),Jc(this,"_mapStabilizationTimeout",null),pu&&performance.mark("mapkit-map-start"),Oe.state!==Oe.States.UNINITIALIZED&&Ml(),Oe.state===Oe.States.READY?this.state=nu:this.state=ou,t._impl=this;try{(e=this._checkParent(e))&&(this._bootstrapSize=new at(e.offsetWidth,e.offsetHeight)),this.public=t,Hu.maps.push(this.public),i=A(i),this._checkOptions(i),void 0!==i._internalAppDelegate&&(this.public._internalAppDelegate=i._internalAppDelegate),this._setDefaultState(i),this._setupScene(),this._setupRenderTree(),this._setupControllers(i),this._flushToDOM(e),this._setIsRotationEnabled(void 0===i.isRotationEnabled||i.isRotationEnabled,void 0!==i.isRotationEnabled),void 0!==i.selectableMapFeatures&&(this.selectableMapFeatures=i.selectableMapFeatures),void 0!==i.selectableMapFeatureSelectionAccessory&&(this.selectableMapFeatureSelectionAccessory=i.selectableMapFeatureSelectionAccessory),this._handleOptions(i,e),this._setupListeners(),si(this)}catch(t){throw this.destroy(),t}finally{0,pu&&performance.measure("mapkit-map-constructor","mapkit-map-start")}}get padding(){return this._padding.copy()}set padding(t){if(L(t,Zc,"[MapKit] The `padding` parameter passed to `Map.padding` is not a Padding."),this._padding.equals(t))return;this._padding=t.copy();const e=this.ensureRenderingFrame();if(!e.equals(ze.Zero)){this.rotation=0;const t=this._mapRectAccountingForPadding(),i=t.midX(),s=t.midY();this._setRenderingFrameValue(e);const o=this._mapRectAccountingForPadding(),n=i-o.midX(),a=s-o.midY(),r=new ot(o.minX()+n,o.minY()+a,o.size.width,o.size.height);this.setVisibleMapRectAnimated(r,!1)}this.controlsLayer&&this.controlsLayer.mapPaddingDidChange(this._adjustedPadding)}get isScrollEnabled(){return this._mapNode.pannable}set isScrollEnabled(t){this._mapNode.pannable=!!t,this._mapUserInteractionController.updateGestureEnableState()}get isZoomEnabled(){return this._mapNode.zoomable}set isZoomEnabled(t){this._mapNode.zoomable=!!t,this.controlsLayer&&this.controlsLayer.updateZoomControl(),this._mapUserInteractionController.updateGestureEnableState()}get snapsToIntegralZoomLevels(){return this._mapNode.snapsToIntegralZoomLevels}set snapsToIntegralZoomLevels(t){this._mapNode.snapsToIntegralZoomLevels=!!t}get showsZoomControl(){return this._showsZoomControl}set showsZoomControl(t){(t=!!t)!==this._showsZoomControl&&(this._showsZoomControl=t,this.controlsLayer&&(this.controlsLayer.updateZoomControl(),this.controlsLayer.updateScale()))}get showsScale(){return this._showsScale}set showsScale(t){C(t,yt)?t!==this._showsScale&&(this._showsScale=t,this.controlsLayer&&this.controlsLayer.updateScale()):console.warn("[MapKit] value passed to `Map.showsScale` setter must be part of the mapkit.FeatureVisibility enum.")}get mapType(){return this._mapType}set mapType(t){t!==this._mapType&&(Vu(t,Hu.MapTypes,"mapType","Map.MapTypes"),this._setMapTypeAndEmphasis(t,this._emphasis))}getMapTypeWithEmphasis(){return this._mapType===Hu.MapTypes.Standard&&this._emphasis===ft.Muted?Hu.MapTypes.MutedStandard:this._mapType}setMapTypeWithEmphasis(t){let e=ft.Standard;t===Hu.MapTypes.MutedStandard?(t=Hu.MapTypes.Standard,e=ft.Muted):Vu(t,Hu.MapTypes,"mapType","Map.MapTypes"),e===this._emphasis&&t===this._mapType||this._setMapTypeAndEmphasis(t,e)}_setMapTypeAndEmphasis(t,e){this._mapType=t,this._emphasis=e,this._annotationsController&&this._annotationsController.mapTypeDidChange(),this._updateMapNodeTintAndEmphasis(this._mapNode),this._mapNodeController.handleMapConfigurationChange(),this.controlsLayer&&this.controlsLayer.update(
2),this.public.dispatchEvent(new Mh(Lu)),this._logWithMap(yn.Events.MapTypeChange)}get distances(){return this._distances}set distances(t){t!==this._distances&&(Vu(t,Hu.Distances,"distances","Map.Distances"),this._distances=t,this.controlsLayer&&this.controlsLayer.updateScale())}get colorScheme(){return this._colorScheme}set colorScheme(t){t!==this._colorScheme&&(Vu(t,Hu.ColorSchemes,"colorScheme","Map.ColorSchemes"),this._colorScheme===Ko.Adaptive&&(this._colorSchemeHandle.removeEventListener("change",this._boundDarkModeDidChange),qo.removeHandle(this._colorSchemeHandle),this._colorSchemeHandle=null),this._colorScheme=t,t===Ko.Adaptive&&(this._colorSchemeHandle=qo.addHandle(),this._boundDarkModeDidChange=()=>{this._updateMapNodeTintAndEmphasis(this._mapNode)},this._colorSchemeHandle.addEventListener("change",this._boundDarkModeDidChange)),this._updateMapNodeTintAndEmphasis(this._mapNode))}get tileTint(){return this._mapNode.tileTint}get _allowWheelToZoom(){return this._mapNode.allowWheelToZoom}set _allowWheelToZoom(t){this._mapNode.allowWheelToZoom=t}get _allowWheelToZoom2(){return this._mapNode.allowWheelToZoom2}set _allowWheelToZoom2(t){this._mapNode.allowWheelToZoom2=t}get loadPriority(){return this._mapNodeController.loadPriority}set loadPriority(t){C(t,Hu.LoadPriorities)?this._mapNodeController.loadPriority=t:console.warn("[MapKit] Unknown value for `loadPriority`. Choose from mapkit.Map.LoadPriorities.")}get _showsTileInfo(){return this._mapNode._impl.debug}set _showsTileInfo(t){this._mapNode._impl.debug=t}get _showsDefaultTiles(){return this._mapNode.showsDefaultTiles}set _showsDefaultTiles(t){this._mapNode.showsDefaultTiles=t}get tileOverlays(){return this._mapNode.tileOverlays}set tileOverlays(t){this._mapNode.tileOverlays=t,this.controlsLayer&&this.controlsLayer.updateZoomControl()}addTileOverlay(t){if(!this._overlaysController)throw uu("addTileOverlay",["overlays"]);const e=this._mapNode.addTileOverlay(t);return this.controlsLayer&&this.controlsLayer.updateZoomControl(),e}addTileOverlays(t){if(!this._overlaysController)throw uu("addTileOverlays",["overlays"]);const e=this._mapNode.addTileOverlays(t);return this.controlsLayer&&this.controlsLayer.updateZoomControl(),e}removeTileOverlay(t){if(!this._overlaysController)throw uu("removeTileOverlay",["overlays"]);const e=this._mapNode.removeTileOverlay(t);return this.controlsLayer&&this.controlsLayer.updateZoomControl(),e}removeTileOverlays(t){if(!this._overlaysController)throw uu("removeTileOverlays",["overlays"]);const e=this._mapNode.removeTileOverlays(t);return this.controlsLayer&&this.controlsLayer.updateZoomControl(),e}get showsMapTypeControl(){return this._showsMapTypeControl}set showsMapTypeControl(t){(t=!!t)!==this._showsMapTypeControl&&(this._showsMapTypeControl=t,this.controlsLayer&&this.controlsLayer.updateMapTypeControl())}get showsUserLocationControl(){return!!this._userLocationController&&this._showsUserLocationControl}set showsUserLocationControl(t){if((t=!!t)!==this._showsUserLocationControl){if(!this._userLocationController)throw uu("showsUserLocationControl",["user-location"]);this._showsUserLocationControl=t,this.controlsLayer&&(this.controlsLayer.updateUserLocationControl(),this.controlsLayer.updateScale())}}get showsPointsOfInterest(){return null===this.pointOfInterestFilter||null===this.pointOfInterestFilter._includes&&0===this.pointOfInterestFilter._excludes?.length}set showsPointsOfInterest(t){if(t){if(null===this.pointOfInterestFilter)return;this.pointOfInterestFilter=null}else{if(this.pointOfInterestFilter===Ql)return;this.pointOfInterestFilter=Ql}}get pointOfInterestFilter(){return this._mapNode.pointOfInterestFilter}set pointOfInterestFilter(t){null!==t&&L(t,$l,"[MapKit] Value passed to `Map.pointOfInterestFilter` setter must be an instance of mapkit.PointOfInterestFilter."),this._mapNode.pointOfInterestFilter=t,this._mapNodeController.setPointOfInterestFilter(t)}setPoiFiltered(t,e){this._mapNode.setPoiFiltered(t,e)}get element(){return this.rootNode?.element??null}set element(t){console.warn("[MapKit] The `element` property is read-only.")}get renderingMapRect(){return this._mapNode.visibleMapRect}get visibleMapRect(){return this._visibleMapRect||(this._visibleMapRect=this._mapRectAccountingForPadding()),this._visibleMapRect}set visibleMapRect(t){this.setVisibleMapRectAnimated(t,!1)}setVisibleMapRectAnimated(t,e,i){k(t,"[MapKit] Missing `visibleMapRect` parameter in call to `Map.setVisibleMapRectAnimated()`."),L(t,ot,"[MapKit] The `visibleMapRect` parameter passed to `Map.setVisibleMapRectAnimated()` is not a MapRect.");const s=this.ensureRenderingFrame();if(0===s.size.width||0===s.size.height)this._visibleMapRect=t;else{delete this._visibleMapRect;const e=this._visibleFrame;let i=t;const o=this._adjustedPadding;if(!o.equals(Zc.Zero)){const n=s.size.width/e.size.width,a=s.size.height/e.size.height;i=new ot(t.minX()-o.left*n*t.size.width,t.minY()-o.top*a*t.size.height,t.size.width*n,t.size.height*a)}const n=new it(t.midX(),t.midY());let a=j(i,s.size,z);a=w(this._mapNode.snapsToIntegralZoomLevels?Qs(a):a,this.minZoomLevel,this.maxZoomLevel);const r=Math.pow(2,Math.ceil(a))*(z*Math.pow(2,a-Math.ceil(a))),l=new st(e.size.width/r,e.size.height/r);t=new ot(n.x-l.width/2,n.y-l.height/2,l.width,l.height)}return e=null==e||!!e,this._setVisibleMapRect(t,e,i),delete this._delayedShowItems,this.public}get region(){return this.visibleMapRect.toCoordinateRegion()}set region(t){this.setRegionAnimated(t,!1)}setRegionAnimated(t,e,i){return k(t,"[MapKit] Tried to set `Map.region` property to a non-existent value."),L(t,J,"[MapKit] Region passed to `Map.region` setter is not a CoordinateRegion."),this.region.equals(t)||this.setVisibleMapRectAnimated(t.toMapRect(),e,i),this.public}get isRotationAvailable(){return"HYBRID"===Oe.forcedRenderingMode||"CLIENT"===Oe.forcedRenderingMode?!Oe.didFallback&&this.csrCapable:Oe.ready||Oe.didFallback?Oe.canRunCSR&&this.csrCapable:this.csrCapable}set isRotationAvailable(t){console.warn("[MapKit] Map.isRotationAvailable is a read-only property")}get isRotationEnabled(){return this._mapNode.isRotationEnabled}set isRotationEnabled(t){this._setIsRotationEnabled(t,!0)}get isRotationLocked(){return this._mapNode.isRotationLocked}get rotation(){return this._mapNode.rotation}set rotation(t){this.setRotationAnimated(t,!1),this.controlsLayer&&this.controlsLayer.updateRotationControl()}get heading(){const t=this._mapNode.rotation;return 0===t?0:360-t}get showsCompass(){return this.usingCSR?this._showsCompass:yt.Hidden}set showsCompass(t){C(t,yt)?(this.isRotationEnabled||t!==yt.Visible&&t!==yt.Adaptive||c
2onsole.warn("[MapKit] The compass cannot be shown when `Map.isRotationEnabled` is false."),this._usingDefaultShowsCompassValue=!1,t!==this._showsCompass&&(this._showsCompass=t,this.controlsLayer&&this.controlsLayer.updateRotationControl())):console.warn("[MapKit] value passed to `Map.showsCompass` setter must be part of the MapKit.FeatureVisibility enum.")}get usingCSR(){return!this._mapNodeController.usingSSR}compassRotate(t,e){if(e){if(this.isRotationLocked){const e=b(t,360),i=Js(e);t=e<180?i+.025*(e-i):i-.025*(i-e)}Math.abs(t)<5&&(t=0)}else this.isRotationLocked&&(t=Js(b(t,360)));return this.setRotationAnimated(t,!1,!0),t}setRotationAnimated(t,e,i){if(!this.isRotationAvailable)return void console.warn("[MapKit] Rotation is not available.");if(k(t,"[MapKit] Tried to set `Map.rotation` property to a non-existent value."),"number"!=typeof t||!isFinite(t))return void console.warn("[MapKit] Argument for `Map.rotation` is not a finite number.");this.isRotationLocked&&0!==t&&console.warn("[MapKit] Rotation is not available on this zoom.");const s=this.forcedInteractionCenter?this.forcedInteractionCenter:this._centerMapPoint(),o=b(t,360)-this._mapNode.getRotation();if(!o)return;const n=(e||null==e||!i)&&this.mapCanStartRotating();if((e||null==e)&&n){const t=this.camera.copy();t.rotateAroundCenter(s,o),this._mapNode.setCameraAnimated(t,!0,s)}else(n||i)&&this._mapNode.rotateCameraAroundMapPoint(s,o),i||this.mapDidStopRotating();return this.public}get center(){return this._centerMapPoint().toCoordinate()}set center(t){this.setCenterAnimated(t,!1)}setCenterAnimated(t,e,i){k(t,"[MapKit] Tried to set `Map.center` property to a non-existent value."),L(t,tt,"[MapKit] Value passed to `Map.center` setter is not a Coordinate object.");const s=this.ensureRenderingFrame();if(0!==s.size.width&&0!==s.size.height){const e=this._offsetCenterWithPaddingAndRotation(t.toMapPoint(),-1);e&&(t=e.toCoordinate())}return this._mapNode.setCenterAnimated(t,null==e||!!e),delete this._visibleMapRect,i||(this.tracksUserLocation=!1),this.public}get cameraZoomLevelLimit(){return this._mapNode?{minZoomLevel:this._mapNode.minZoomLevel,maxZoomLevel:this._mapNode.maxZoomLevel}:null}set cameraZoomLevelLimit(t){this.setCameraZoomLevelLimitAnimated(t,!1)}setCameraZoomLevelLimitAnimated(t,e){return this._mapNode.setCameraZoomLevelLimitAnimated(t,null==e||!!e),this.public}get cameraZoomRange(){return this._mapNode.cameraZoomRange}set cameraZoomRange(t){this.setCameraZoomRangeAnimated(t,!1)}setCameraZoomRangeAnimated(t,e){return null!=t&&L(t,nt,"[MapKit] Expected a `mapkit.CameraZoomRange` object for `Map.cameraZoomRange`, but got `"+t.toString()+"` instead."),this._mapNode.setCameraZoomRangeAnimated(t,null==e||!!e),this.public}get cameraDistance(){return this._mapNode.getCurrentCameraDistance()}set cameraDistance(t){this.setCameraDistanceAnimated(t,!1)}setCameraDistanceAnimated(t,e){if(!(t>=0))throw new Error("[MapKit] Expected a number for Map.cameraDistance, but got `"+t+"` instead");return this._mapNode.setCameraDistanceAnimated(t,null==e||!!e),this.public}get cameraBoundary(){const t=this._cameraBoundary;return t?{region:"toCoordinateRegion"in t?t.toCoordinateRegion():t.copy(),mapRect:"toMapRect"in t?t.toMapRect():t.copy()}:null}set cameraBoundary(t){this.setCameraBoundaryAnimated(t,!1)}setCameraBoundaryAnimated(t,e){let i=null;if(null==t)delete this._cameraBoundary;else if(t instanceof J)i=t.toMapRect(),this._cameraBoundary=t.copy();else{if(!(t instanceof ot))throw new Error("[MapKit] `Map.cameraBoundaryRect` expected a CoordinateRegion or a MapRect, but got `"+t.toString()+"` instead.");i=t,this._cameraBoundary=i.copy()}const s=this._centerMapPoint();return this._mapNode.setCameraBoundaryAnimated(i,null==e||!!e),this.tracksUserLocation&&!this._mapNode.isMapPointWithinBounds(s)&&(this.tracksUserLocation=!1),this.public}get overlays(){return this._overlaysController?this._overlaysController.items:[]}set overlays(t){if(!this._overlaysController)throw uu("overlays",["overlays"]);this._overlaysController.items=t}get selectedOverlay(){return this._overlaysController?this._overlaysController.selectedItem:null}set selectedOverlay(t){if(!this._overlaysController)throw uu("selectedOverlay",["overlays"]);this._overlaysController.selectedItem=t}addOverlay(t){if(this._overlaysController)return this._overlaysController.addItem(t);throw uu("addOverlay",["overlays"])}addOverlays(t){if(this._overlaysController)return this._overlaysController.addItems(t),t;throw uu("addOverlays",["overlays"])}removeOverlay(t){if(this._overlaysController)return this._overlaysController.removeItem(t);throw uu("removeOverlay",["overlays"])}removeOverlays(t){if(this._overlaysController)return this._overlaysController.removeItems(t);throw uu("removeOverlays",["overlays"])}topOverlayAtPoint(t){if(!this._overlaysController)throw uu("topOverlayAtPoint",["overlays"]);L(t,window.DOMPoint,"[MapKit] Map.topOverlayAtPoint expected a DOMPoint, but got `"+t.toString()+"` instead.");const e=this.rootNode.convertPointFromPage(t),i=this._overlaysController.pickableItemsCloseToPoint(this.overlays,e,0),s=this.selectedOverlay;return s&&i.indexOf(s)>0?s:i[0]}overlaysAtPoint(t){if(!this._overlaysController)throw uu("overlaysAtPoint",["overlays"]);L(t,window.DOMPoint,"[MapKit] Map.overlaysAtPoint expected a DOMPoint, but got `"+t.toString()+"` instead.");const e=this.rootNode.convertPointFromPage(t);return this._overlaysController.pickableItemsCloseToPoint(this.overlays,e,0).reverse()}get annotations(){if(this._annotationsController)return this._annotationsController.items;throw uu("annotations",["annotations"])}set annotations(t){if(!this._annotationsController)throw uu("annotations",["annotations"]);this._annotationsController.items=t}get selectedAnnotation(){if(this._annotationsController)return this._annotationsController.selectedItem;throw uu("selectedAnnotation",["annotations"])}set selectedAnnotation(t){if(!this._annotationsController)throw uu("selectedAnnotation",["annotations"]);this._annotationsController.selectedItem=t}addAnnotation(t){if(this._annotationsController)return this._annotationsController.addItem(t);throw uu("addAnnotation",["annotations"])}addAnnotations(t){if(this._annotationsController)return this._annotationsController.addItems(t);throw uu("addAnnotations",["annotations"])}removeAnnotation(t){if(this._annotationsController)return this._annotationsController.removeItem(t);throw uu("removeAnnotation",["annotations"])}removeAnnotations(t){if(this._annotationsController)return this._annotationsController.removeItems(t);throw uu("removeAnnotations",["annotations"])}showItems(t,e){if(!Hu.LayerItemsController||!Hu.ItemCollection)throw uu("showItems",["annotations","overlays","user-location"]);const i=new Hu.ItemCollection(t).getFlattenedItemList();e=Hu.LayerItemsController.checkShowItemsParameters(i,e);const s=[],o=[];
2return i.forEach((t=>{Hu.OverlaysController&&t instanceof Hu.OverlaysController.Overlay&&!t.map&&(t._impl._map=this.public,s.push(t)),Hu.AnnotationsController&&t instanceof Hu.AnnotationsController.Annotation&&this._annotationsController&&this._annotationsController.preAddedAnnotation(t)&&o.push(t)})),this.isRooted()&&Hu.LayerItemsController.setRegionForItems(this,i,e)||(this._delayedShowItems=[i,e]),s.forEach((t=>{t._impl._map=null})),o.forEach((t=>{this._annotationsController.resetAnnotation(t)})),this._addItems(i),t}addItems(t){if(!Hu.ItemCollection)throw uu("addItems",["annotations","overlays","user-location"]);const e=new Hu.ItemCollection(t).getFlattenedItemList();return this._addItems(e),t}removeItems(t){if(!Hu.ItemCollection)throw uu("removeItems",["annotations","overlays","user-location"]);const e=new Hu.ItemCollection(t).getFlattenedItemList(),i=[],s=[];return e.forEach(((t,e)=>{const o=Hu.OverlaysController&&t instanceof Hu.OverlaysController.Overlay,n=Hu.AnnotationsController&&t instanceof Hu.AnnotationsController.Annotation;if(!o&&!n)throw new Error("[MapKit] Map.removeItems expected an Annotation, Overlay, ItemCollection, or Array of valid items at index "+e+", but got `"+t.toString()+"` instead.");o?i.push(t):s.push(t)})),this.removeOverlays(i),this.removeAnnotations(s),t}addLayerAbove(t,e){return this._mapNodeController.addLayerAbove(t,e)}addLayerBelow(t,e){return this._mapNodeController.addLayerBelow(t,e)}removeLayer(t){return this._mapNodeController.removeLayer(t)}requireRender(){return this._mapNodeController.requireRender()}getMemoryStatistics(){return this._mapNode.getMemoryStatistics()}annotationsInMapRect(t){if(this._annotationsController)return this._annotationsController.annotationsInMapRect(t);throw uu("annotationsInMapRect",["annotations"])}updateSize(){return console.warn("[MapKit] Map resizing is now automatic, the Map.updateSize() method has been deprecated and will be removed in a future version."),this.public}convertCoordinateToPointOnPage(t){L(t,tt,"[MapKit] Map.convertCoordinateToPointOnPage expected a Coordinate, but got `"+t.toString()+"` instead.");const e=t.toMapPoint();this.wrapMapPointToViewport(e);const i=this.camera.transformMapPoint(e),s=this.rootNode.convertPointToPage(i);return new window.DOMPoint(s.x,s.y)}wrapMapPointToViewport(t){t.x<this.camera.minX()&&t.x+1<this.camera.maxX()&&(t.x+=1),t.x>this.camera.maxX()&&t.x-1>this.camera.minX()&&(t.x-=1)}convertPointOnPageToCoordinate(t){L(t,window.DOMPoint,"[MapKit] Map.convertPointOnPageToCoordinate expected a DOMPoint, but got `"+t.toString()+"` instead.");const e=this.camera.transformGestureCenter(this.rootNode.convertPointFromPage(new Pe(t.x,t.y))),i=this.renderingMapRect.origin;return new tt(U(i.y+e.y/this.worldSize),G(i.x+e.x/this.worldSize))}get showsUserLocation(){return!!this._userLocationController&&this._userLocationController.showsUserLocation}set showsUserLocation(t){if((t=!!t)!==this.showsUserLocation){if(!this._userLocationController)throw uu("showsUserLocation",["user-location"]);this._userLocationController.showsUserLocation=t,t||(this._removeUserLocationDisplay(),this.tracksUserLocation=!1),this.showsUserLocationControl&&this.controlsLayer&&(this.controlsLayer.updateUserLocationControl(),this.controlsLayer.updateScale())}}get userLocationAnnotation(){return this._userLocationController?this._annotationsController.userLocationAnnotation:null}get tracksUserLocation(){return!!this._userLocationController&&this._userLocationController.tracksUserLocation}set tracksUserLocation(t){if((t=!!t)!==this.tracksUserLocation){if(!this._userLocationController)throw uu("tracksUserLocation",["user-location"]);this._userLocationController.tracksUserLocation=t,this._mapNode.usesInteractionCenter=!(!t&&!this.forcedInteractionCenter),t?this.showsUserLocation=!0:this.userLocationAnnotation||(this.showsUserLocation=!1),this._firstCameraUpdateToTrackUserLocationPending=t,this._updateCameraToTrackUserLocation(this._userLocationController.userLocation),this._userLocationController.tracksUserLocation===t&&(this.controlsLayer&&this.controlsLayer.updateUserLocationControl(),this._userLocationTrackingDelegate&&"function"==typeof this._userLocationTrackingDelegate.mapUserLocationTrackingDidChange&&this._userLocationTrackingDelegate.mapUserLocationTrackingDidChange(this.public))}}get forcedInteractionCenter(){return this._forcedInteractionCenter}set forcedInteractionCenter(t){this._forcedInteractionCenter=t,this._mapNode.usesInteractionCenter=!(!this.tracksUserLocation&&!t)}get tintColor(){return this._tintColor}set tintColor(t){if(t!==this._tintColor){if(null!=t){if(S(t,"string","[MapKit] Expected a string value for Map.tintColor, but got `"+t+"` instead"),""!==t&&!qs(t))return void console.warn("[MapKit] value passed to `Map.tintColor` is not a valid color value. Ignoring: "+t);this._tintColor=t}else this._tintColor="";
2this.controlsLayer&&this.controlsLayer.update()}}get tintColorForControls(){return $s(this.mapNodeTint)?"":this._tintColor}get minZoomLevel(){return this._mapNode.minZoomLevel}get maxZoomLevel(){return this._mapNode.maxZoomLevel}get zoomLevel(){return this._mapNode.zoomLevel}get canZoomIn(){const t=this.snapsToIntegralZoomLevels?Math.floor(this.maxZoomLevel):this.maxZoomLevel-.01;return this.zoomLevel<t}get canZoomOut(){const t=this.snapsToIntegralZoomLevels?Math.ceil(this.minZoomLevel):this.minZoomLevel+.01;return this.zoomLevel>t}set zoomLevel(t){this._mapNode.zoomLevel=t}get worldSize(){return K(this._mapNode.zoomLevel)}get camera(){return this._mapNode.camera}get cameraIsPanning(){return this._mapNode.cameraIsPanning}get cameraIsZooming(){return this._mapNode.cameraIsZooming}get cameraIsRotating(){return this._mapNode.cameraIsRotating}get cameraIsAnimating(){return this._mapNode.cameraIsAnimating}get cameraIsMoving(){return this.cameraIsPanning||this.cameraIsZooming||this.cameraIsRotating||this.cameraIsAnimating}get _mapNode(){return this._mapNodeController.node}get csrCapable(){return this._mapNodeController.csrCapable}destroy(){if(this.state===du)return void console.warn("[MapKit] Map was already destroyed.");this.state=du,this._annotationsController&&this.removeAnnotations(this.annotations),this._overlaysController&&this.removeOverlays(this.overlays),this._stopStabilizationTimeout(),this._linearZoomController?.stop(),this.showsUserLocation&&this._removeUserLocationDisplay(),this.controlsLayer?.mapWasDestroyed(),this.controlsLayer=null,this._mapUserInteractionController?.mapWasDestroyed(),this._overlaysController?.mapWasDestroyed(),this._annotationsController?.mapWasDestroyed(),this._userLocationController?.mapWasDestroyed(),this._linearZoomController?.mapWasDestroyed(),this._linearZoomController=null,this._colorSchemeHandle&&(qo.removeHandle(this._colorSchemeHandle),this._colorSchemeHandle=null),Oe.removeEventListener(Oe.Events.Initialized,this),Oe.removeEventListener(Oe.Events.Changed,this),Nn.removeEventListener(Nn.Events.LocaleChanged,this),this._dppxMediaQueryList?.removeListener(this._boundDevicePixelRatioDidChange),this._dppxMediaQueryList=null,this._boundDevicePixelRatioDidChange=null,this._iframe&&(this._iframe.removeEventListener("load",this),this._iframe.contentWindow&&this._iframe.contentWindow.removeEventListener("resize",this),this.element.removeChild(this._iframe),this._iframe=null),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._mapNodeController?.destroy(),this._mapRoot?.remove(),this._mapRoot=null,this._scene?.destroy(),this._scene=null,this._removePrintListener(),this.textZoom&&(this.textZoom=!1),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.rootNode?.remove(),this.rootNode=null;const t=Hu.maps.indexOf(this.public);t>=0&&Hu.maps.splice(t,1)}adjustMapItemPoint(t){return this._mapNode.adjustMapItemPoint(t)}get annotationForCluster(){return this._annotationForCluster}set annotationForCluster(t){if(null==t)this._annotationForCluster=null;else{if("function"!=typeof t)throw new Error("[MapKit] annotationForCluster must be a function or null");this._annotationForCluster=t}}get selectableMapFeatures(){return this._selectableMapFeatures?Oe.ready&&(Oe.didFallback||!Oe.canRunCSR)||!this.csrCapable||"SERVER"===Oe.forcedRenderingMode?[]:this._selectableMapFeatures.slice():[]}set selectableMapFeatures(t){if(null==t)return delete this._selectableMapFeatures,void this._mapFeaturesLayerController.node.remove();if(!Hu.MapFeatureType)throw uu("selectableMapFeatures",["annotations"]);M(t,"[MapKit] Map.selectableMapFeatures expected an array of values, but got `"+t.toString()+"` instead."),t.forEach((t=>{Vu(t,Hu.MapFeatureType,"MapFeatureType","mapkit.MapFeatureType")}));const e=[];if(Object.values(Hu.MapFeatureType).forEach((i=>{t.includes(i)&&e.push(i)})),0===e.length)return delete this._selectableMapFeatures,void this._mapFeaturesLayerController.node.remove();(!Oe.ready||!Oe.didFallback&&Oe.canRunCSR)&&this.csrCapable&&"SERVER"!==Oe.forcedRenderingMode||console.warn("[MapKit] Selectable map features is not available."),this._selectableMapFeatures=e,this._updateMapFeatureRegionLayer()}get selectableMapFeatureSelectionAccessory(){return this._selectableMapFeatureSelectionAccessory?this._selectableMapFeatureSelectionAccessory:null}set selectableMapFeatureSelectionAccessory(t){if(!Hu.PlaceSelectionAccessory)throw uu("selectableMapFeatureSelectionAccessory",["annotations"]);null!==t&&L(t,Hu.PlaceSelectionAccessory,"[MapKit] The `selectableMapFeatureSelectionAccessory` parameter passed to `Map.selectableMapFeatureSelectionAccessory` is not a PlaceSelectionAccessory."),this._selectableMapFeatureSelectionAccessory=t}get annotationForMapFeature(){return this._annotationForMapFeature}set annotationForMapFeature(t){if(null==t)delete this._annotationForMapFeature;else{if("function"!=typeof t)throw new Error("[MapKit] annotationForMapFeature must be a function or null");this._annotationForMapFeature=t}}handleEvent(t){const e=Hu.ControlsLayer?Hu.ControlsLayer.ZoomControl.EVENTS.ZOOM_START:void 0,i=Hu.ControlsLayer?Hu.ControlsLayer.ZoomControl.EVENTS.ZOOM_END:void 0;switch(t.type){case Oe.Events.Initialized:Ml();break;case Oe.Events.Changed:this._configurationDidBecomeAvailable();break;case e:this.zoomControlStart(t.zoomIn);break;case i:this.zoomControlEnd();break;case Nn.Events.LocaleChanged:this._handleLocaleChange();break;case"load":this._iframeDidLoad();break;case"resize":this._sizeDidChange()}}elementShouldPreventDragstart(t){return!!this._annotationsController&&!this._annotationsController.isElementInCustomCallout(t)}elementWantsTextSelection(t){return this._annotationsController?.isElementInAccessory(t)??!1}elementWantsDefaultBrowserBehaviorForTouchEvent(t,e,i){return 1===i&&!this.isScrollEnabled||(2===i&&!this.isZoomEnabled&&!this.isRotationEnabled||(this._annotationsController?.isElementInAccessory(t)??!1))}getEventTargetFromSubShadowDOM(t){const e="touches"in t?t.touches[0]?.target:t.target;return ks&&this._annotationsController?.node&&e===this._annotationsController.node.element&&this._annotationsController.getShadowDOMTargetFromEvent(t)||e}tileAccessForbidden(){Oe.accessKeyHasExpired()}previousMapDidFinishRendering(t){pu&&performance.measure("mapkit-map-start-up-rendered","mapkit-map-start"),this.state!==du&&this.public.dispatchEvent(new Mh(Du))}mapDidFinishRendering(){this.state!==du&&(this.state=lu,this._controlsLayer||setTimeout((()=>
2this._loadControlsLayer(!1))),this._mapNodeController.handleMapRendered(),this.addWaitingAnnotations(),this._startStabilizationTimeoutIfNeeded())}mapCanStartPanning(){return this._panningWasPrevented?(delete this._panningWasPrevented,!1):!(this.tracksUserLocation&&this.cameraIsZooming||this._annotationsController&&this._annotationsController.dragging||this._isInitialInteractionTargetInUIElement()||!this.public.dispatchEvent(new Mh(ku)))}mapWillStartPanning(t){this._stopStabilizationTimeout(),this.tracksUserLocation=!1,this.rootNode.classList.add(eu),"drag"===t.currentGestureType&&this.rootNode.classList.add(iu),this._annotationsController&&this._annotationsController.node.classList.add(eu),yn._trackPanEvent&&this._logWithMap(yn.Events.Pan)}mapWillStopPanning(){this.rootNode.classList.remove(iu)}mapDidStopPanning(){this._startStabilizationTimeoutIfNeeded(),this.rootNode.classList.remove(eu),this._annotationsController&&this._annotationsController.node.classList.remove(eu),this.public.dispatchEvent(new Mh(Su))}mapCanStartZooming(){return!(this._isInitialInteractionTargetInUIElement()||!this.public.dispatchEvent(new Mh(fu)))}mapWillStartZooming(t,e,i,s){this._stopStabilizationTimeout(),s&&(this.tracksUserLocation=!1),this._logWithMap(yn.Events.Zoom,{eventValue:e})}mapDidStopZooming(){this._startStabilizationTimeoutIfNeeded(),this.public.dispatchEvent(new Mh(yu)),this.controlsLayer&&this.controlsLayer.scaleDidChange()}mapCameraWillChange(t){this.mapNodeCameraBeforeChange=t.camera}mapCameraDidChange(t){if(this.state===du)return;const e=this.mapNodeCameraBeforeChange;delete this.mapNodeCameraBeforeChange,delete this._visibleMapRect,this._mapNodeController.mapCameraDidChange(),this._overlaysController&&this._overlaysController.mapCameraDidChange(),this._annotationsController&&this._annotationsController.updateVisibleAnnotations();const i=!e||e.rotation!==t.camera.rotation;i&&this._dispatchRotationChangeEvent(),this.controlsLayer&&(this.controlsLayer.scaleDidChange(),i&&this.controlsLayer.updateRotationControl())}mapCameraChangesWillStart(){this._mapFeaturesLayerController&&this._mapFeaturesLayerController.node.remove(),this._zoomLevelWhenCameraChangeStarted=this.zoomLevel,this._annotationsController&&this._annotationsController.mapRegionChangeWillStart(),this.public.dispatchEvent(new Mh(wu))}mapCameraChangesDidEnd(){this.state!==du&&(this._zoomLevelWhenCameraChangeStarted!==this.zoomLevel&&this.controlsLayer&&this.controlsLayer.zoomLevelDidChange(),delete this._zoomLevelWhenCameraChangeStarted,this._annotationsController&&this._annotationsController.mapRegionChangeDidEnd(),this.public.dispatchEvent(new Mh(Cu)))}mapMinAndMaxZoomLevelsDidChange(){this.controlsLayer&&this.controlsLayer.zoomLevelDidChange()}mapCanStartRotating(){return this.public.dispatchEvent(new Mh(Mu))}mapRotationDidChange(){this.controlsLayer&&this.controlsLayer.updateRotationControl(),this._dispatchRotationChangeEvent()}mapDidStopRotating(){this.public.dispatchEvent(new Mh(Tu))}mapCustomCanvasWillRender(){this.state!==du&&this._canvas2dLayer&&this._scene.flush()}mapInteractionCenter(){return this._forcedInteractionCenter?this._forcedInteractionCenter:this._centerMapPoint()}mapTransformCenter(){return this._centerMapPoint()}userWillTap(t){const e=t.locationInElement();if(this._isInitialInteractionTargetInUIElement())return void(ys()&&(this._delayedTapFunction=()=>{this._elementWasTapped(this._mapUserInteractionController.initialEventTargetForCurrentInteraction)}));const i=this.rootNode.convertPointFromPage(e),s=this._annotationsController?this._annotationsController.enabledItemCloseToPoint(i):void 0;if(s)return void(this._delayedTapFunction=()=>qu.call(this,s));let o=!1;if(this._overlaysController){const t=this._overlaysController.enabledItemCloseToPoint(i);if(t){if(t!==this._overlaysController.userLocationAccuracyRingOverlay)return void(this._delayedTapFunction=()=>{t.selected=!0});o=!0}}if(this._annotationsController&&this._selectableMapFeatures&&"getMapFeatureRegions"in this._mapNode){const t=this._mapNode.getMapFeatureRegions(),e=this._selectableMapFeatures.includes(Hu.MapFeatureType.PointOfInterest),s=this._selectableMapFeatures.includes(Hu.MapFeatureType.Territory),o=this._selectableMapFeatures.includes(Hu.MapFeatureType.PhysicalFeature),n=t.filter((t=>!!["Poi","Territory","PhysicalFeature"].includes(t.category)&&(!(!e&&"Poi"===t.category)&&(!(!s&&"Territory"===t.category)&&!(!o&&"PhysicalFeature"===t.category))))),a=this._annotationsController.mapFeatureRegionCloseToPoint(i,n);if(a){const t=this._annotationsController.getMapFeatureAnnotationForRegion(a,this.selectableMapFeatureSelectionAccessory);return void(this._delayedTapFunction=()=>{this._annotationsController.mapFeatureDidSelect(t),this._logWithMap(yn.Events.MapFeatureSelect,{eventValue:a.category})})}}if(o)return void(this._delayedTapFunction=()=>{const t=this.userLocationAnnotation;t&&qu.call(this,t)});const n=Yu(xu,t);this._delayedTapFunction=()=>{this.public.dispatchEvent(n),n.defaultPrevented||(this._annotationsController&&(this._annotationsController.selectedItem=null),this._overlaysController&&(this._overlaysController.selectedItem=null))}}shouldDelaySingleTap(){if(this.isZoomEnabled)return!0;
2if(!this.public._listeners)return!1;const t=this.public._listeners[xu];if(t&&t.length>0)return!0;const e=this.public._listeners[Eu];return!!(e&&e.length>0)}userDidTap(){this._delayedTapFunction&&(this._delayedTapFunction(),delete this._delayedTapFunction)}userCanceledTap(){delete this._delayedTapFunction}userDidDoubleTap(t){const e=t.modifierKeys.alt;(!this.isZoomEnabled||e&&this.zoomLevel===this._mapNode.minZoomLevel||!e&&this.zoomLevel===this._mapNode.maxZoomLevel)&&this.public.dispatchEvent(Yu(Eu,t))}userDidLongPress(t){if(this._isInitialInteractionTargetInUIElement())return!1;const e=t.locationInElement(),i=this._annotationsController?this._annotationsController.enabledItemCloseToPoint(this.rootNode.convertPointFromPage(e),!0):void 0;if(!i){const e=Yu(Iu,t);return this.public.dispatchEvent(e),e.defaultPrevented&&(this._panningWasPrevented=!0),ys()}return i._impl.isDraggable()&&!this.cameraIsMoving?(this._annotationsController.startDraggingAnnotation(i,e),!0):ys()?(qu.call(this,i),!0):ys()}userMayStartPanningAfterLongPress(){delete this._panningWasPrevented}userDidPanAfterLongPress(t){this._annotationsController&&this._annotationsController.annotationDraggingDidChange(t)}userDidStopPanningAfterLongPress(t){this._annotationsController&&this._annotationsController.annotationDraggingDidEnd(t)}linearZoomControllerDidZoom(t){this.cameraIsZooming&&(this.zoomLevel=t,(t<=this.minZoomLevel&&!this._linearZoomController.zoomsIn||t>=this.maxZoomLevel&&this._linearZoomController.zoomsIn)&&this._mapNode.cameraDidStopZooming())}linearZoomControllerDidStop(){this._mapNode.cameraDidStopZooming()}userLocationDidChange(t){this._updateUserLocationDisplay(t.target),this.controlsLayer&&this.controlsLayer.userLocationDidChange(t.target),this.tracksUserLocation&&this._updateCameraToTrackUserLocation(t.target),this.public.dispatchEvent(new Zu(t.coordinate,t.timestamp,t.floorLevel))}userLocationDidError(t){this._updateUserLocationDisplay(t.target),this.controlsLayer&&this.controlsLayer.userLocationDidError(t.target),this.public.dispatchEvent(new ju(t.code,t.message))}get mapNodeTint(){const t=this._mapNodeController&&this._mapNodeController.node;return t?t.tint:ri.Light}isRooted(){return this.element&&this.element.ownerDocument.body.contains(this.element)}stopDraggingAnnotation(){this._mapUserInteractionController._stopDraggingAnnotation()}translateVisibleMapRectAnimated(t,e){const i=this.visibleMapRect;this._setVisibleMapRect(new ot(i.minX()+t.x/this.worldSize,i.minY()+t.y/this.worldSize,i.size.width,i.size.height),!!e)}translateCameraAnimated(t,e){this._mapNode.setCameraAnimated(this.camera.translate(t),!!e)}setCameraAnimated(t,e){this._mapNode.setCameraAnimated(t,!!e)}shouldWaitForTilesAndControls(){return!(this.state===lu&&this.controlsLayer&&!this.controlsLayer.controlsPending)}ensureRenderingFrame(){return this._renderingFrame||new ze}ensureVisibleFrame(){return this._visibleFrame||new ze}annotationDraggingWillStart(){this.rootNode.classList.add(su),this._loadControlsLayer(!1),this.controlsLayer&&(this.controlsLayer.classList.add(su),this.controlsLayer.canShowTooltips=!1)}annotationDraggingDidEnd(){this.rootNode.classList.remove(su),this.controlsLayer&&(this.controlsLayer.classList.remove(su),this.controlsLayer.canShowTooltips=!0)}get useMetric(){switch(this.distances){case Hu.Distances.Adaptive:return Wn();case Hu.Distances.Metric:return!0;case Hu.Distances.Imperial:return!1}return Wn()}get isCompassHidden(){return this.showsCompass===yt.Hidden||ys()&&this.showsCompass===yt.Adaptive&&0===this.rotation||!this.isRotationEnabled}get fontSizeRatio(){return this._textZoomDetector?this._textZoomDetector.ratio:1}get textZoom(){return!!this._textZoomDetector}set textZoom(t){t&&!this._textZoomDetector?this._textZoomDetector=new Eo({container:this.element,fontSizeDidChange:()=>{this._mapNode&&(this._mapNode.fontSizeRatio=this.fontSizeRatio),this.controlsLayer&&this.controlsLayer.fontSizeDidChange(),this._annotationsController&&this._annotationsController.fontSizeDidChange()}}):!t&&this._textZoomDetector&&(this._textZoomDetector.destroy(),this._textZoomDetector=null,this._mapNode&&(this._mapNode.fontSizeRatio=this.fontSizeRatio)),this.controlsLayer&&(this.controlsLayer.textZoom=!!t),this._annotationsController&&(this._annotationsController.textZoom=!!t)}compassRotationWillStart(t){return t&&this.rootNode.classList.add(iu),this._mapNodeController.node.compassRotationWillStart()}compassRotationDidEnd(){this.rootNode.classList.remove(iu),this._mapNodeController.node.compassRotationDidEnd()}panningDuringAnnotationDrag(){this._annotationsController?.mapPanningDuringAnnotationDrag()}padMapRect(t,e,i){S(e,"object","[MapKit] padding must be an object with any of `top`, `left`, `bottom`, `right`"),["top","left","bottom","right"].forEach((t=>{if(t in e){const i=e[t];if("number"!=typeof i||i<0)throw new Error("[MapKit] property `"+t+"` of padding must be a number >= 0; got `"+i+"`")}else e[t]=0}));const s=this.ensureRenderingFrame().size;let o=Math.log2(Math.min((s.width-(e.left+e.right))/(t.size.width*z),(s.height-(e.top+e.bottom))/(t.size.height*z)));const n=Math.max(K(o),1),a=Vc(t,{top:e.top/n,left:e.left/n,bottom:e.bottom/n,right:e.right/n}
2);if(void 0!==i&&i>=0){o=this._mapNode.zoomLevelForCameraDistanceAtY(i,a.midY());const t=n/K(o);return a.scale(t,new it(a.midX(),a.midY()))}return a}supportsLabelRegions(){return!this._mapNodeController.usingSSR}createLabelRegion(){return this._mapNode.createLabelRegion()}updatedLabelRegion(){this._mapNode.updatedLabelRegion()}unregisterLabelRegion(t){this._mapNode.unregisterLabelRegion(t)}annotationPlaceSelectionAccessoryDidReveal(t,e){this._logWithMap(yn.Events.PlaceAccessoryReveal,{eventValue:t,eventTarget:"PLACECARD_TRAY",states:{PLACE_CARD:()=>e}})}annotationPlaceSelectionAccessoryOpenInMapsClicked(t,e){this._logWithMap(yn.Events.PlaceAccessoryOpenAppleMaps,{eventTarget:"PLACECARD_TRAY",states:{PLACE_CARD:()=>e}})}_addItems(t){const e=[];return t.forEach(((t,i)=>{const s=Hu.OverlaysController&&t instanceof Hu.OverlaysController.Overlay,o=Hu.AnnotationsController&&t instanceof Hu.AnnotationsController.Annotation;if(!s&&!o)throw new Error("[MapKit] Map.addItems expected an Annotation, Overlay, ItemCollection, or Array of valid items at index "+i+", but got `"+t.toString()+"` instead.");t.map||(s?this.addOverlay(t):e.push(t))})),this._annotationsController&&this.addAnnotations(e),t}_configurationDidBecomeAvailable(t){let e=t&&this.state===nu;t||(this.state===ou?(this.state=nu,e=!0):this.state===au&&(this.state=ru,e=!0)),this._mapNodeController.configurationDidBecomeAvailable(t),e&&this._logWithMap(yn.Events.MapsLoad),this.controlsLayer&&this.controlsLayer.update(),this.public._internalAppDelegate&&"function"==typeof this.public._internalAppDelegate.networkConfigurationUpdated&&this.public._internalAppDelegate.networkConfigurationUpdated({madabaDomains:Oe.madabaDomains,tileGroup:Oe.tileGroup,accessKey:Oe.accessKey})}_setupScene(){this._scene=new bo,this._scene.sceneDidUpdate=(t,e)=>this._sceneDidUpdate(t,e),gu&&(this._scene.performanceMeasureName="mapkit-scene-graph-update-frame");const t=this._scene.element;t.className="rt-root",Nn.activeLocale&&(t.lang=Nn.localeId,t.dir=Nn.activeLocale.rtl?"rtl":"ltr"),this._scene.element.setAttribute("aria-hidden","true")}_sceneDidUpdate(t,e){if(this.state===du)return;const i=this._scene.hasPixels();if(e)return void(this._scene.element.hidden=!i||!!this._canvas2dLayer);this.unifiedCanvas&&this._mapNode&&this._mapNode.customCanvas&&!this._scene.isTainted()?(this._canvas2dLayer||(this._canvas2dLayer=new qc(this._scene),this.addLayerAbove(this._canvas2dLayer,pt.Labels)),this._mapNode.forceDraw()):this._canvas2dLayer&&(console.warn("[MapKit] Fallback to 2D rendering because canvas is tainted, or CSR became unavailable."),this.removeLayer(this._canvas2dLayer),this._canvas2dLayer=void 0),this._scene.element.hidden=!i||!!this._canvas2dLayer}_checkOptions(t){S(t,"object","[MapKit] The `options` object is invalid.");for(const e in t){let i=cu[e];if(void 0===i){const s=Bt(e);i=cu[s],void 0!==i&&(i=cu[s],void 0!==i&&Object.assign(t,{[s]:t[e]}))}"rw"===i||("ro"===i?console.warn("[MapKit] `"+e+"` is read-only and can't be set on a Map."):console.warn("[MapKit] `"+e+"` is not a valid property of Map."))}}_checkParent(t){if(null==t)return;const e="string"==typeof t?document.getElementById(t):t;if(!e||!Dt(e))throw new Error("[MapKit] `parent` must either be a DOM element or its ID.");return e}_setDefaultState(t){this._showsZoomControl=void 0!==t.showsZoomControl?!!t.showsZoomControl:this._showsZoomControl,this._showsMapTypeControl=void 0!==t.showsMapTypeControl?!!t.showsMapTypeControl:this._showsMapTypeControl,this._showsUserLocationControl=void 0!==t.showsUserLocationControl?!!t.showsUserLocationControl:this._showsUserLocationControl,this._showsUserLocationControl&&!Hu.UserLocationController&&console.warn("[MapKit] mapkit.Map.showsUserLocationControl is available after loading the following library: user-location.");const e=t.mapType||this._mapType;Vu(e,Hu.MapTypes,"mapType","Map.MapTypes"),e===Hu.MapTypes.MutedStandard?(this._emphasis=ft.Muted,this._mapType=Hu.MapTypes.Standard):(this._emphasis=ft.Standard,this._mapType=e);const i=t.colorScheme||this._colorScheme;Vu(i,Hu.ColorSchemes,"colorScheme","Map.ColorSchemes"),this._colorScheme=i,i===Ko.Adaptive&&(this._colorSchemeHandle=qo.addHandle(),this._colorSchemeHandle.addEventListener("change",this._boundDarkModeDidChange))}_setIsRotationEnabled(t,e){"boolean"==typeof t?(this.isRotationAvailable?this._mapNode.isRotationEnabled=t:e&&t&&console.warn("[MapKit] Rotation can't be enabled because it's not available."),this.controlsLayer&&this.controlsLayer.updateRotationControl(),this._mapUserInteractionController.updateGestureEnableState()):console.warn("[MapKit] Value passed to `Map.isRotationEnabled` is not a Boolean.")}_setupRenderTree(){const t=document.createElement("div");t.className="mk-map-view",t.appendChild(this._scene.element),this.rootNode=new Ri(t)}
2_setupControllers(t){this._loadControlsLayer(!0),Hu.OverlaysController&&this.addOverlaysController(),Hu.MapFeaturesLayerController&&this.addMapFeaturesLayerController(),Hu.AnnotationsController&&this.addAnnotationsController(),Hu.UserLocationController&&this.addUserLocationController(),this._mapNodeController=new Wc(this,t),this._linearZoomController=new dl(this._mapNode.snapsToIntegralZoomLevels,this),this._mapUserInteractionController=new Sl(this.rootNode.element,this)}addOverlaysController(){this.state===du||this._overlaysController||(this._overlaysController=new Hu.OverlaysController(this),this._scene.insertAfter(this._overlaysController.sceneGraphNode,this._mapNodeController?.node??void 0))}addMapFeaturesLayerController(){this._mapFeaturesLayerController=new Hu.MapFeaturesLayerController(this),this._startStabilizationTimeoutIfNeeded()}addAnnotationsController(){this.state===du||this._annotationsController||(this._annotationsController=new Hu.AnnotationsController(this),this._mapRoot&&this._mapRoot.insertAfter(this._annotationsController.node,this._mapFeaturesLayerController.node),this._scene.insertAfter(this._annotationsController.sceneGraphNode,this._overlaysController?this._overlaysController.sceneGraphNode:this._mapNodeController?.node??void 0))}addUserLocationController(){this._userLocationController=new Hu.UserLocationController(this),this._showsUserLocationControl&&this.controlsLayer&&(this.controlsLayer.updateUserLocationControl(),this.controlsLayer.updateScale())}getControlBounds(){return this.controlsLayer?this.controlsLayer.controlBounds():[]}_loadControlsLayer(t){if(!this._loadControlsLayerHasFailed)return!t&&Hu.ControlsLayer?(this._insertControlsLayer(),void this._updateInitialControlsLayerState()):void ll((e=>{if(!e)return this._showsDefaultTiles=!1,Object.defineProperty(this,"_showsDefaultTiles",{get:function(){return!1},set:function(){throw new Error("[MapKit] Default tiles are not shown because map controls has failed to load.")},configurable:!0}),void(this._loadControlsLayerHasFailed=!0);Hu.ControlsLayer=e,t?(ai((()=>this._insertControlsLayer()),Ue.Highest),ai((()=>this._updateInitialControlsLayerState()),Ue.Highest)):(this._insertControlsLayer(),this._updateInitialControlsLayerState())}))}_insertControlsLayer(){if(this.state!==du&&!this.controlsLayer&&(this.controlsLayer=new Hu.ControlsLayer(this),this._mapRoot.insertAfter(this.controlsLayer,this._annotationsController?this._annotationsController.node:void 0),mu)){const t=()=>{Zi.removeEventListener("update",t),performance.measure("mapkit-map-controls-inserted","mapkit-map-start")};Zi.addEventListener("update",t)}}_updateInitialControlsLayerState(){this.state===du||this._updateInitialControlsLayerStateCalled||(this._updateInitialControlsLayerStateCalled=!0,this.controlsLayer.update(),this.controlsLayer.mapPaddingDidChange(this._adjustedPadding))}_handleOptions(t,e){void 0!==t.contextType&&(this.contextType=t.contextType),void 0!==t.showsScale&&(this.showsScale=t.showsScale),void 0!==t.showsCompass&&(this.showsCompass=t.showsCompass),void 0!==t.padding&&(this.padding=t.padding),void 0!==t.cameraZoomRange&&(this.cameraZoomRange=t.cameraZoomRange),void 0!==t.cameraBoundary&&(this.cameraBoundary=t.cameraBoundary),void 0!==t.visibleMapRect?this.visibleMapRect=t.visibleMapRect:void 0!==t.region?this.region=t.region:(void 0!==t.center&&(this.center=t.center),void 0!==t.cameraDistance&&(this.cameraDistance=t.cameraDistance)),void 0!==t.rotation&&(this.rotation=t.rotation);const i=[],s=void 0===t.visibleMapRect&&void 0===t.region&&void 0===t.center&&e;if(void 0!==t.overlays&&(M(t.overlays,"[MapKit] Map constructor overlays option expected an array of overlays, but got `"+t.overlays.toString()+"` instead."),s?i.push(...t.overlays):this.overlays=t.overlays),void 0!==t.annotations&&(M(t.annotations,"[MapKit] Map constructor annotations option expected an array of annotations, but got `"+t.annotations.toString()+"` instead."),s?i.push(...t.annotations):this.annotations=t.annotations),i.length>0){const e={};void 0!==t.cameraDistance&&(e.cameraDistance=t.cameraDistance),this.showItems(i,e)}void 0!==t.selectedOverlay&&(this.selectedOverlay=t.selectedOverlay),void 0!==t.selectedAnnotation&&(this.selectedAnnotation=t.selectedAnnotation),void 0!==t.distances&&(this.distances=t.distances),void 0!==t.tintColor&&(this.tintColor=t.tintColor),void 0!==t.showsUserLocation&&(this.showsUserLocation=t.showsUserLocation),void 0!==t.tracksUserLocation&&(this.tracksUserLocation=t.tracksUserLocation),void 0!==t.tileOverlays&&(this.tileOverlays=t.tileOverlays),void 0!==t.annotationForCluster&&(this.annotationForCluster=t.annotationForCluster),void 0!==t.annotationForMapFeature&&(this.annotationForMapFeature=t.annotationForMapFeature),void 0!==t._unifiedCanvas&&(this.unifiedCanvas=!!t._unifiedCanvas),void 0!==t._textZoom?this.textZoom=!!t._textZoom:this.textZoom=!0}_flushToDOM(t){this._addMapToParent(t),ni(),this._ensureContainerIsPositioned()}_addMapToParent(t){null!=t&&(t.appendChild(this.element),this._bootstrapSize.width&&this._bootstrapSize.height&&this._updateRenderingFrameSize(this._bootstrapSize),delete this._bootstrapSize)}performScheduledUpdate(){if(this.state===du)return;const t=this._mapNode.camera.zoom;t%1!=0&&(this.state===ou||this.state===nu)&&("SERVER"===Oe.forcedRenderingMode||Oe.ready&&(Oe.didFallback||!Oe.canRunCSR)||!this.csrCapable||"HYBRID"===Oe.forcedRenderingMode||this._mapNodeController.loadPriority===_t.PointsOfInterest)&&this._mapNode.setZoomLevelAnimated(Qs(t)),this.state===ou?this.state=au:this.state===nu&&(this.state=ru),this._loadResizeDetector()}_loadResizeDetector(){if(!this._iframe&&!this._resizeObserver){if(window.ResizeObserver)return this._resizeObserver=new window.ResizeObserver((()=>this._sizeDidChange())),this._resizeObserver.observe(this.rootNode.element),void this._resizeDetectorDidInstall();this._iframe=Fs("iframe",{tabindex:-1,"aria-hidden":!0}),this._iframe.addEventListener("load",this),this.element.insertBefore(this._iframe,this.element.firstChild)}}_updateUserLocationDisplay(t){this._annotationsController.updateUserLocationAnnotation(t),this._overlaysController.updateUserLocationAccuracyRingOverlay(t)}_removeUserLocationDisplay(){this._annotationsController.removeUserLocationAnnotation(),this._overlaysController.removeUserLocationAccuracyRingOverlay()}_updateCameraToTrackUserLocation(t){let e,i;if(this.tracksUserLocation&&this.showsUserLocation&&t.coordinate){if(this._mapNode.isMapPointWithinBounds(t.coordinate.toMapPoint()))if(this._firstCameraUpdateToTrackUserLocationPending&&this.zoomLevel<9.5){let s=14;if(t.location.accuracy>0){const e=5*t.location.accuracy*H(t.location.latitude),i=new ot(0,0,e,e),o=this.ensureVisibleFrame().size;s=Math.max(this.zoomLevel,j(i,o,z))}e=this._mapRectForCenterAndZoomLevel(t.coordinate.toMapPoint(),s),this._userLocationTrackingDelegate&&"function"==typeof this._userLocationTrackingDelegate.mapRegionWillChangeToTrackUserLocation&&(i=e.toCoordinateRegion(),this._userLocationTrackingDelegate.mapRegionWillChangeToTrackUserLocation(this.public,i),e=i.toMapRect()),this._mapNode.setCameraAnimated(this.camera.withNewMapRect(e),!0)}else this._userLocationTrackingDelegate&&"function"==typeof this._userLocationTrackingDelegate.mapRegionWillChangeToTrackUserLocation?(e=this._mapRectForCenterAndZoomLevel(t.coordinate.toMapPoint(),this.zoomLevel),i=e.toCoordinateRegion(),this._userLocationTrackingDelegate.mapRegionWillChangeToTrackUserLocation(this.public,i),this._mapNode.setCameraAnimated(this.camera.withNewMapRect(e),!0)):this.setCenterAnimated(t.coordinate,!0,!0);else this.setCenterAnimated(t.coordinate,!0,!0),this._userLocationController.tracksUserLocation=!1,this._mapNode.usesInteractionCenter=!1,this.controlsLayer&&this.controlsLayer.updateUserLocationControl();delete this._firstCameraUpdateToTrackUserLocationPending}}_updateRenderingFrameFromElement(){const t=this.element,e=t.offsetWidth,i=t.offsetHeight;0!==e&&0!==i&&this._updateRenderingFrameSize(new at(e,i))}_setRenderingFrameValue(t){this._renderingFrame=t,this._visibleFrame=t;
2const e=this._adjustedPadding.copy(),i=this._adjustedPaddingForMapSize(t.size);this._adjustedPadding=i,i.equals(Zc.Zero)||(this._visibleFrame=new ze(t.origin.x+i.left,t.origin.y+i.top,t.size.width-i.left-i.right,t.size.height-i.top-i.bottom)),!i.equals(e)&&this.controlsLayer&&this.controlsLayer.mapPaddingDidChange(i)}_adjustedPaddingForMapSize(t){const e=new at(Math.min(Ct.minimumSizeToShowLogo.width,t.width),Math.min(Ct.minimumSizeToShowLogo.height,t.height)),i=this._padding.copy();i.top<0&&(i.top=0),i.left<0&&(i.left=0),i.bottom<0&&(i.bottom=0),i.right<0&&(i.right=0);const s=i.left+i.right,o=i.top+i.bottom,n=s+e.width-t.width,a=o+e.height-t.height;if(n>0&&s>0){const t=(s-n)/s;i.left*=t,i.right*=t}if(a>0&&o>0){const t=(o-a)/o;i.top*=t,i.bottom*=t}return i}_iframeDidLoad(){try{this._iframe.contentWindow.addEventListener("resize",this)}catch{console.warn("[MapKit] Map resize detection is disabled when loaded in a sandboxed iframe.")}this._resizeDetectorDidInstall()}_resizeDetectorDidInstall(){const t=this._visibleMapRect&&this._visibleMapRect.copy(),e=this.rotation,i=this._padding&&!this._padding.equals(Zc.Zero);this._ensureContainerIsPositioned(),this._sizeDidChange(),t&&i&&(t.size.width>0||t.size.height>0?(this.setVisibleMapRectAnimated(t,!1),e&&this.setRotationAnimated(e,!1)):this.setCenterAnimated(new it(t.midX(),t.midY()).toCoordinate()))}_sizeDidChange(){this._printMediaQueryList&&this._printMediaQueryList.matches||this._updateRenderingFrameFromElement()}_updateRenderingFrameSize(t){0===t.width||0===t.height||this._renderingFrame?.size.equals(t)||(this._setRenderingFrameValue(new ze(0,0,t.width,t.height)),this._scene.size=t,this._mapRoot.size=t,this._mapNodeController.updateSize(t),this._delayedShowItems&&(Hu.LayerItemsController.setRegionForItems(this,this._delayedShowItems[0],this._delayedShowItems[1]),delete this._delayedShowItems),this.controlsLayer&&this.controlsLayer.sizeDidChange(),this._annotationsController&&this._annotationsController.mapSizeDidUpdate())}_mapRectForCenterAndZoomLevel(t,e){const i=this.ensureVisibleFrame().size,s=K(e),o=i.width/s,n=i.height/s;return new ot(t.x-o/2,t.y-n/2,o,n)}_isInitialInteractionTargetInUIElement(){const t=this._mapUserInteractionController.initialEventTargetForCurrentInteraction;return!!t&&(!(!this._annotationsController||!this._annotationsController.isElementInAccessory(t))||!(!this.controlsLayer||!this.controlsLayer.element.contains(t)))}zoomControlStart(t){t&&!this.canZoomIn||!t&&!this.canZoomOut||this._linearZoomController.start(this.zoomLevel,t)&&this._mapNode.cameraWillStartZooming(wt.Button)}zoomControlEnd(){this._linearZoomController.stop()}_centerMapPoint(){if(0!==this.rotation){const t=this.renderingMapRect,e=new it(t.midX(),t.midY()),i=this._offsetCenterWithPaddingAndRotation(e,1);if(i)return i}const t=this.visibleMapRect;return new it(t.midX(),t.midY())}_offsetCenterWithPaddingAndRotation(t,e){const i=2*e*this.worldSize,s=(this._adjustedPadding.right-this._adjustedPadding.left)/i,o=(this._adjustedPadding.bottom-this._adjustedPadding.top)/i;if(0!==s||0!==o){const e=-this.rotation/180*Math.PI;return new it(t.x-s*Math.cos(e)+o*Math.sin(e),t.y-s*Math.sin(e)-o*Math.cos(e))}}_setVisibleMapRect(t,e,i){i||(this.tracksUserLocation=!1);let s=t;const o=this._adjustedPadding,n=this.ensureRenderingFrame(),a=this.ensureVisibleFrame();o.equals(Zc.Zero)||a.equals(ze.Zero)||(s=new ot(t.minX()-o.left/a.size.width*t.size.width,t.minY()-o.top/a.size.height*t.size.height,t.size.width*(n.size.width/a.size.width),t.size.height*(n.size.height/a.size.height))),this._mapNode.setVisibleMapRectAnimated(s,e)}_ensureContainerIsPositioned(){const t=this.rootNode.element;"static"===t.ownerDocument.defaultView.getComputedStyle(t).position&&(t.style.position="relative")}didSetPreviousMapNode(){this._annotationsController?.mapSupportForLabelRegionsRemoved()}didInsertNewMapNode(t){t.delegate=this,this.state===lu&&(this.state=hu),this._updateMapRoot(t),this._updateMapNodeTintAndEmphasis(t),this._annotationsController?.mapSupportForLabelRegionsAdded(),this.controlsLayer?.updateRotationControl(),window.setTimeout((()=>this.public.dispatchEvent(new Mh(Ou))),0)}didReconfigureMapNode(t){t.snapsToIntegralZoomLevels&&t.zoomLevel%1!=0&&!t.cameraIsAnimating&&(t.zoomLevel=Qs(t.zoomLevel)),this._linearZoomController&&(this._linearZoomController.snapsToIntegralZoomLevels=t.snapsToIntegralZoomLevels),t.fontSizeRatio=this.fontSizeRatio,this.controlsLayer&&this.controlsLayer.updateZoomControl()}didFinishMapNodeInitialization(t){if(t.customCanvas){const e=t.customCanvas;e.parentNode||this.element.insertBefore(e,this.element.firstChild)}else this._scene.addChild(t,0)}mapNodeDidFail(t){const e=t?new Uu(zu,t.reason,t.message):new Uu(zu);this.public.dispatchEvent(e)}mapNodeReady(t){window.setTimeout((()=>{const e=new Mh(Pu);e.usingCSR=t,this.public.dispatchEvent(e),this._logWithMap(yn.Events.MapNodeReady)}),0),this._annotationsController?.mapSupportForLabelRegionsUpdated()}_updateMapRoot(t){this._mapRoot&&this._mapRoot.remove(),this._mapRoot=this.rootNode.insertBefore(new Ri(t.element),this.rootNode.firstChild),t.element.className="mk-map-node-element",this._mapRoot.size=t.size=this._scene.size,this._annotationsController&&this._mapRoot.addChild(this._annotationsController.node),this.controlsLayer&&this._mapRoot.addChild(this.controlsLayer)}_updateMapNodeTintAndEmphasis(t){const e=this._colorScheme===Ko.Adaptive?qo.currentColorScheme:this._colorScheme;this.currentColorScheme=e;const i=this._mapType===Hu.MapTypes.Standard?e:ri.Dark;this.tint=i;let s=e;this._mapType!==Hu.MapTypes.Hybrid&&this._mapType!==Hu.MapTypes.Satellite||(s=ri.Light),t.setTintAndEmphasis(i,s,this._emphasis),this._mapNodeController&&this._mapNodeController.setTintAndEmphasis(i,s,this._emphasis),this.controlsLayer&&this.controlsLayer.update(
2),this._annotationsController&&(this._annotationsController.mapNodeTintWasSet(i),this._annotationsController.node.classList.toggle(_u,$s(i))),this.rootNode.classList.toggle(_u,$s(i))}overlaySelectionDidChange(t){t.selected&&this._annotationsController&&(this._annotationsController.selectedItem=null);const e=new Bu(t.selected?vu:bu,t);this.selectionMayChange=!1,this.public.dispatchEvent(e),this.selectionMayChange=!0}annotationSelectionDidChange(t){t.selected&&this._overlaysController&&(this._overlaysController.selectedItem=null),this.selectionMayChange=!1,this.public.dispatchEvent(new Wu(t.selected?vu:bu,t)),this.selectionMayChange=!0}dispatchEventWithAnnotation(t,e,i){const s=new Gu(t,e,i?.coordinate);this.public.dispatchEvent(s)}addWaitingAnnotations(){this.shouldWaitForTilesAndControls()||(this._annotationsController?this._annotationsController.addWaitingAnnotations((()=>this._dispatchCompleteEvent())):this._dispatchCompleteEvent())}_dispatchCompleteEvent(){this._completedOnce||(this._completedOnce=!0,mu&&performance.measure("mapkit-map-annotations-rendered","mapkit-map-start")),this._mapNode.fullyRendered&&this.public.dispatchEvent(new Mh(Ru))}_dispatchRotationChangeEvent(){this.shouldDispatchRotationChangeEvent&&this.public.dispatchEvent(new Mh(Au))}_handleLocaleChange(){const t=this._scene.element;t.lang=Nn.localeId,t.dir=Nn.activeLocale.rtl?"rtl":"ltr",this._mapNodeController.handleMapConfigurationChange(),this._annotationsController&&(this._annotationsController.localeChanged(),this._userLocationController&&this._annotationsController.updateUserLocationAnnotation(this._userLocationController.userLocation,!0));const e=this.ensureRenderingFrame();0!==e.size.width&&0!==e.size.height&&this._setRenderingFrameValue(e)}_elementWasTapped(t){for(;null!==t;t=t.parentNode)if("localName"in(e=t)&&("a"===e.localName||"button"===e.localName||"input"===e.localName&&"button"===e.type))return void t.click();var e}_devicePixelRatioDidChange(){this._scene.needsDisplay=!0,this.controlsLayer&&this.controlsLayer.devicePixelRatioDidChange(),this._annotationsController&&this._annotationsController.devicePixelRatioDidChange(),this._mapNode.devicePixelRatioDidChange()||this._mapNodeController.handleRecreate()}_mapRectAccountingForPadding(){const t=this.renderingMapRect;if(this._adjustedPadding.equals(Zc.Zero))return t.copy();const e=this.ensureVisibleFrame(),i=this.ensureRenderingFrame();return new ot(t.minX()+this._adjustedPadding.left/i.size.width*t.size.width,t.minY()+this._adjustedPadding.top/i.size.height*t.size.height,t.size.width*(e.size.width/i.size.width),t.size.height*(e.size.height/i.size.height))}_setupListeners(){Oe.state===Oe.States.READY&&this._configurationDidBecomeAvailable(!0),Oe.addEventListener(Oe.Events.Initialized,this),Oe.addEventListener(Oe.Events.Changed,this),Nn.activeLocale&&this._handleLocaleChange(),Nn.addEventListener(Nn.Events.LocaleChanged,this),this._dppxMediaQueryList=window.matchMedia("(-webkit-device-pixel-ratio: 1)"),this._dppxMediaQueryList.addListener(this._boundDevicePixelRatioDidChange),this._printMediaQueryList=window.matchMedia("print"),this._printMediaQueryList.addListener(this._boundPrintMediaQueryChanged)}_removePrintListener(){this._printMediaQueryList?.removeListener(this._boundPrintMediaQueryChanged),this._boundPrintMediaQueryChanged=null,this._printMediaQueryList=void 0}_printMediaQueryChanged(){const t=this._mapNode;this._printMediaQueryList.matches?(this.rootNode.element.style.background=this.rootNode.element.parentNode.dataset.mapPrintingBackgroun
2d??"",t.fullyRendered?this._ensureMapCenterDuringPrint(!0):(t.opacity=0,this._annotationsController&&this._annotationsController.addWaitingAnnotations()),this._loadControlsLayer(!1),this._mapNodeController.handlePrintMatch(),ni()):(this._mapNodeController.handlePrintUnmatch(),t.opacity=1,this.rootNode.element.style.background="",this._ensureMapCenterDuringPrint(!1))}_ensureMapCenterDuringPrint(t){const e=[this._scene.element];if(this._mapNode.customCanvas){const t=this._mapNode.customCanvas;e.push(t)}e.forEach((e=>{if(t){const t=this._scene.size;e.style.left="50%",e.style.marginLeft="-"+t.width/2+"px",e.style.top="50%",e.style.marginTop="-"+t.height/2+"px"}else e.style.left="",e.style.marginLeft="",e.style.top="",e.style.marginTop=""}))}_startStabilizationTimeoutIfNeeded(){this._mapNodeController&&this._mapNode&&this._mapNode.fullyRendered&&!this.cameraIsMoving&&(this._stopStabilizationTimeout(),this._mapStabilizationTimeout=setTimeout((()=>ai((()=>this._mapIsStabilized()))),500))}_stopStabilizationTimeout(){this._mapStabilizationTimeout&&(window.clearTimeout(this._mapStabilizationTimeout),this._mapStabilizationTimeout=null)}_mapIsStabilized(){this._updateMapFeatureRegionLayer(),this._updatePrintingBackgroun
2d()}_updatePrintingBackground(){this._mapNode&&"cssBackgroundProperty"in this._mapNode&&this._mapNode.fullyRendered&&this.isRooted()&&(this.rootNode.element.parentNode.dataset.mapPrintingBackground=this._mapNode.cssBackgroundProperty)}_updateMapFeatureRegionLayer(){if(!(this._selectableMapFeatures&&this._mapNode&&"getMapFeatureRegions"in this._mapNode&&this._mapFeaturesLayerController))return;if(!this._mapNode.fullyRendered||!this.isRooted())return;const t=this._selectableMapFeatures.includes(Hu.MapFeatureType.PointOfInterest),e=this._selectableMapFeatures.includes(Hu.MapFeatureType.Territory),i=this._selectableMapFeatures.includes(Hu.MapFeatureType.PhysicalFeature),s=this._mapNode.getMapFeatureRegions().filter((s=>t&&"Poi"===s.category||e&&"Territory"===s.category||i&&"PhysicalFeature"===s.category));this._mapFeaturesLayerController.update(s,this._mapNode.camera),this._mapRoot.addChild(this._mapFeaturesLayerController.node,0)}_logWithMap(t,e={}){if(this.state===du)return;const i={map:this,eventTarget:e.eventTarget||yn.EventTarget};Object.assign(i,e),yn.log(t,i)}}function qu(t){t.selected=!0,this._logWithMap(yn.Events.AnnotationClick)}function Vu(t,e,i,s){if(!C(t,e))throw new Error("[MapKit] Unknown value for `"+i+"`. Choose from "+s+".")}function Yu(t,e){const i=e.locationInElement();return new Ku(t,new DOMPoint(i.x,i.y),e.domEvents.slice())}Jc(Hu,"MapTypes",dt),Jc(Hu,"Distances",ut),Jc(Hu,"ColorSchemes",Ko),Jc(Hu,"LoadPriorities",_t),Jc(Hu,"MapProperties",cu),Jc(Hu,"AnnotationsController",void 0),Jc(Hu,"ControlsLayer",void 0),Jc(Hu,"ItemCollection",void 0),Jc(Hu,"LayerItemsController",void 0),Jc(Hu,"MapFeaturesLayerController",void 0),Jc(Hu,"MapFeatureType",void 0),Jc(Hu,"OverlaysController",void 0),Jc(Hu,"PlaceSelectionAccessory",void 0),Jc(Hu,"UserLocationController",void 0),Jc(Hu,"maps",[]);const Xu=["LayerItemsController","ItemCollection","OverlaysController","MapFeaturesLayerController","AnnotationsController","PlaceSelectionAccessory","UserLocationController","MapFeatureType"];function $u(){let t=!0;for(let e=0;e<Xu.length;e++){const i=Xu[e];!Hu[i]&&u.jsModules[i]?Object.assign(Hu,$c(u.jsModules,[i])):t=!1}Hu.OverlaysController&&Hu.maps.forEach((t=>{t._impl.addOverlaysController()})),Hu.MapFeaturesLayerController&&Hu.maps.forEach((t=>{t._impl.addMapFeaturesLayerController()})),Hu.AnnotationsController&&Hu.maps.forEach((t=>{t._impl.addAnnotationsController()})),Hu.UserLocationController&&Hu.maps.forEach((t=>{t._impl.addUserLocationController()})),t&&u.removeEventListener("load",$u)}u.addEventListener("load",$u),$u();function Ju(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Qu extends Ah{constructor(t,e){super(),Object.defineProperty(this,"_impl",{value:new Hu(this,t,e)})}get padding(){return this._impl.padding}set padding(t){this._impl.padding=t}get isScrollEnabled(){return this._impl.isScrollEnabled}set isScrollEnabled(t){this._impl.isScrollEnabled=t}get isZoomEnabled(){return this._impl.isZoomEnabled}set isZoomEnabled(t){this._impl.isZoomEnabled=t}get showsZoomControl(){return this._impl.showsZoomControl}set showsZoomControl(t){this._impl.showsZoomControl=t}get showsScale(){return this._impl.showsScale}set showsScale(t){this._impl.showsScale=t}get mapType(){return this._impl.getMapTypeWithEmphasis()}set mapType(t){this._impl.setMapTypeWithEmphasis(t)}get colorScheme(){return this._impl.colorScheme}set colorScheme(t){this._impl.colorScheme=t}get distances(){return this._impl.distances}set distances(t){this._impl.distances=t}get _allowWheelToZoom(){return this._impl._allowWheelToZoom}set _allowWheelToZoom(t){this._impl._allowWheelToZoom=t}get _showsTileInfo(){return this._impl._showsTileInfo}set _showsTileInfo(t){this._impl._showsTileInfo=t}get _showsDefaultTiles(){return this._impl._showsDefaultTiles}set _showsDefaultTiles(t){this._impl._showsDefaultTiles=t}get loadPriority(){return this._impl.loadPriority}set loadPriority(t){this._impl.loadPriority=t}get tileOverlays(){return this._impl.tileOverlays}set tileOverlays(t){this._impl.tileOverlays=t}addTileOverlay(t){return this._impl.addTileOverlay(t)}addTileOverlays(t){return this._impl.addTileOverlays(t)}removeTileOverlay(t){return this._impl.removeTileOverlay(t)}removeTileOverlays(t){return this._impl.removeTileOverlays(t)}get showsMapTypeControl(){return this._impl.showsMapTypeControl}set showsMapTypeControl(t){this._impl.showsMapTypeControl=t}get showsUserLocationControl(){return this._impl.showsUserLocationControl}set showsUserLocationControl(t){this._impl.showsUserLocationControl
2=t}get showsPointsOfInterest(){return this._impl.showsPointsOfInterest}set showsPointsOfInterest(t){this._impl.showsPointsOfInterest=t}get pointOfInterestFilter(){return this._impl.pointOfInterestFilter}set pointOfInterestFilter(t){this._impl.pointOfInterestFilter=t}get element(){return this._impl.element}set element(t){this._impl.element=t}get visibleMapRect(){return this._impl.visibleMapRect}set visibleMapRect(t){this._impl.visibleMapRect=t}setVisibleMapRectAnimated(t,e){return this._impl.setVisibleMapRectAnimated(t,e)}get region(){return this._impl.region}set region(t){this._impl.region=t}setRegionAnimated(t,e){return this._impl.setRegionAnimated(t,e)}get isRotationAvailable(){return this._impl.isRotationAvailable}set isRotationAvailable(t){this._impl.isRotationAvailable=t}get isRotationEnabled(){return this._impl.isRotationEnabled}set isRotationEnabled(t){this._impl.isRotationEnabled=t}get rotation(){return this._impl.rotation}set rotation(t){this._impl.rotation=t}get showsCompass(){return this._impl.showsCompass}set showsCompass(t){this._impl.showsCompass=t}setRotationAnimated(t,e){return this._impl.setRotationAnimated(t,e)}get center(){return this._impl.center}set center(t){this._impl.center=t}setCenterAnimated(t,e){return this._impl.setCenterAnimated(t,e)}get cameraZoomRange(){return this._impl.cameraZoomRange}set cameraZoomRange(t){this._impl.cameraZoomRange=t}setCameraZoomRangeAnimated(t,e){return this._impl.setCameraZoomRangeAnimated(t,e)}get cameraDistance(){return this._impl.cameraDistance}set cameraDistance(t){this._impl.cameraDistance=t}setCameraDistanceAnimated(t,e){return this._impl.setCameraDistanceAnimated(t,e)}get cameraBoundary(){return this._impl.cameraBoundary}set cameraBoundary(t){this._impl.cameraBoundary=t}setCameraBoundaryAnimated(t,e){return this._impl.setCameraBoundaryAnimated(t,e)}get overlays(){return this._impl.overlays}set overlays(t){this._impl.overlays=t}get selectedOverlay(){return this._impl.selectedOverlay}set selectedOverlay(t){this._impl.selectedOverlay=t}addOverlay(t){return this._impl.addOverlay(t)}addOverlays(t){return this._impl.addOverlays(t)}removeOverlay(t){return this._impl.removeOverlay(t)}removeOverlays(t){return this._impl.removeOverlays(t)}topOverlayAtPoint(t){return this._impl.topOverlayAtPoint(t)}overlaysAtPoint(t){return this._impl.overlaysAtPoint(t)}get annotations(){return this._impl.annotations}set annotations(t){this._impl.annotations=t}get selectedAnnotation(){return this._impl.selectedAnnotation}set selectedAnnotation(t){this._impl.selectedAnnotation=t}addAnnotation(t){return this._impl.addAnnotation(t)}addAnnotations(t){return this._impl.addAnnotations(t)}removeAnnotation(t){return this._impl.removeAnnotation(t)}removeAnnotations(t){return this._impl.removeAnnotations(t)}showItems(t,e){return this._impl.showItems(t,e)}addItems(t){return this._impl.addItems(t)}removeItems(t){return this._impl.removeItems(t)}annotationsInMapRect(t){return this._impl.annotationsInMapRect(t)}updateSize(){return this._impl.updateSize()}convertCoordinateToPointOnPage(t){return this._impl.convertCoordinateToPointOnPage(t)}convertPointOnPageToCoordinate(t){return this._impl.convertPointOnPageToCoordinate(t)}get showsUserLocation(){return this._impl.showsUserLocation}set showsUserLocation(t){this._impl.showsUserLocation=t}get userLocationAnnotation(){return this._impl.userLocationAnnotation}get tracksUserLocation(){return this._impl.tracksUserLocation}set tracksUserLocation(t){this._impl.tracksUserLocation=t}get tintColor(){return this._impl.tintColor}set tintColor(t){this._impl.tintColor=t}destroy(){this._impl.destroy()}get annotationForCluster(){return this._impl.annotationForCluster}set annotationForCluster(t){this._impl.annotationForCluster=t}get selectableMapFeatures(){return this._impl.selectableMapFeatures}set selectableMapFeatures(t){this._impl.selectableMapFeatures=t}get selectableMapFeatureSelectionAccessory(){return this._impl.selectableMapFeatureSelectionAccessory}set selectableMapFeatureSelectionAccessory(t){this._impl.selectableMapFeatureSelectionAccessory=t}get annotationForMapFeature(){return this._impl.annotationForMapFeature}set annotationForMapFeature(t){this._impl.annotationForMapFeature=t}}Ju(Qu,"MapTypes",Hu.MapTypes),Ju(Qu,"ColorSchemes",Hu.ColorSchemes),Ju(Qu,"Distances",Hu.Distances),Ju(Qu,"LoadPriorities",Hu.LoadPriorities),Ju(Qu,"ContextTypes",void 0),Ju(Qu,"Layers",void 0),Ju(Qu,"BlendModes",void 0),Ju(Qu,"BackdropFilters",void 0);
2function tp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ep(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function ip(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}var sp=new WeakMap;class op{_(t){if(t!==ne)throw new Error("");return ip(this,sp)}constructor(t){let e,i;ep(this,sp,{writable:!0,value:{resultProviderId:void 0,formattedAddressLines:void 0}}),tp(this,"id",void 0),tp(this,"alternateIds",void 0),tp(this,"muid",void 0),tp(this,"_wpURL",void 0),tp(this,"_styleAttributes",void 0),tp(this,"pointOfInterestCategory",void 0),tp(this,"name",void 0),tp(this,"_providerId",void 0),tp(this,"_providerItemId",void 0),tp(this,"region",void 0),tp(this,"coordinate",void 0),tp(this,"formattedAddress",void 0),tp(this,"countryCode",void 0),tp(this,"telephone",void 0),tp(this,"urls",void 0),tp(this,"country",void 0),tp(this,"administrativeArea",void 0),tp(this,"administrativeAreaCode",void 0),tp(this,"locality",void 0),tp(this,"postCode",void 0),tp(this,"subLocality",void 0),tp(this,"thoroughfare",void 0),tp(this,"subThoroughfare",void 0),tp(this,"fullThoroughfare",void 0),tp(this,"areasOfInterest",void 0),tp(this,"dependentLocalities",void 0),tp(this,"timezone",void 0),tp(this,"timezoneSecondsFromGmt",void 0),t.id&&(this.id=t.id,this.alternateIds=t.alternateIds||[]),t.muid&&(this.muid=t.muid),t.mapsId?.resultProviderId&&(ip(this,sp).resultProviderId=t.mapsId.resultProviderId),t.placecardUrl&&(this._wpURL=t.placecardUrl),t.style&&t.style.attributes&&(this._styleAttributes=t.style.attributes.map((t=>t.key+":"+t.value)).join(","),t.poiCategory&&Mi(t.poiCategory,Vl)&&(this.pointOfInterestCategory=Vl[t.poiCategory])),t.name&&(this.name=t.name),t.attribution&&(this._providerId=t.attribution.vendorId,this._providerItemId=t.attribution.externalItemId),t.displayMapRegion&&(e=t.displayMapRegion,i=new et(e.northLat,e.eastLng,e.southLat,e.westLng),this.region=i.toCoordinateRegion(),this.coordinate=this.region.center),t.formattedAddressLines&&(this.formattedAddress=t.formattedAddressLines.join(", "),ip(this,sp).formattedAddressLines=[...t.formattedAddressLines]),t.center&&(this.coordinate=new tt(t.center.lat,t.center.lng)),t.countryCode&&(this.countryCode=t.countryCode),this.telephone=t.telephone,this.urls=t.urls||[],this.country=t.country,this.administrativeArea=t.administrativeArea,this.administrativeAreaCode=t.administrativeAreaCode,this.locality=t.locality,this.postCode=t.postCode,this.subLocality=t.subLocality,this.thoroughfare=t.thoroughfare,this.subThoroughfare=t.subThoroughfare,this.fullThoroughfare=t.fullThoroughfare,this.areasOfInterest=t.areasOfInterest,this.dependentLocalities=t.dependentLocalities,this.timezone=t.timezone,this.timezoneSecondsFromGmt=t.timezoneSecondsFromGmt}}tp(op,"isConstructable",void 0),op.isConstructable=!1;const np=function(t){if(op.isConstructable)return new op(t);throw new TypeError("[MapKit] Place may not be constructed.")};op.prototype.constructor=np,np.prototype=op.prototype;function ap(t,e){const i=new Uint8Array(atob(t).split("").map((t=>t.charCodeAt(0)))),s=new Uint8Array(atob(e).split("").map((t=>t.charCodeAt(0))));return btoa(String.fromCharCode(...i.map(((t,e)=>t^s[e%s.length]))))}const rp=btoa("Copyright (c) Apple Inc. All rights reserved.");function lp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const hp=new WeakMap;class dp{constructor(t,e){lp(this,"_delegate",void 0),lp(this,"_container",void 0),lp(this,"_iframeElement",void 0),lp(this,"_iframeContentWindowReady",void 0),lp(this,"_iframeLoadingTimeout",void 0),lp(this,"_handleLocaleChangedListener",(()=>this._handleLocaleChanged())),lp(this,"_handleConfigChangedListener",(()=>this._handleConfigChanged())),lp(this,"_handleMessageEventListener",(t=>this._handleMessageEvent(t))),this._delegate=e,Oe.addEventListener(Oe.Events.Changed,this._handleConfigChangedListener),Nn.addEventListener(Nn.Events.LocaleChanged,this._handleLocaleChangedListener),this._container=t}update(){this._delegate.place&&Oe.ready?this._renderPlaceIframe():this._removeIframeElement()}destroy(){this._removeIframeElement(),Oe.removeEventListener(Oe.Events.Changed,this._handleConfigChangedListener),Nn.removeEventListener(Nn.Events.LocaleChanged,this._handleLocaleChangedListener)}_handleLocaleChanged(){this.update()}_handleConfigChanged(){this.update()}_getPlaceAsUrlParams(){const e=this._delegate.place,i=new URLSearchParams;return i.append("uiStyle",this._delegate.uiStyle),e.muid&&i.append("auid",e.muid),e.formattedAddress&&i.append("address",e.formattedAddress),e.coordinate&&i.append("ll",`${e.coordinate.latitude},${e.coordinate.longitude}`),e.name&&i.append("q",e.name),i.append("countryCode",Oe.countryCode||""),i.append("lang",Nn.localeId),i.append("mapkitVersion",t.version),Oe.enableSourceMap&&i.append("sourcemap","1"),`${Oe.uiBaseUrl}/v1/place?${i.toString()}`}_renderPlaceIframe(){this._iframeElement||(this._iframeElement=document.createElement("iframe"),this._container.appendChild(this._iframeElement),window.addEventListener("message",this._handleMessageEventListener),this._iframeElement.style.display="block",this._iframeElement.style.width="100%",this._iframeElement.style.height="0",this._iframeElement.style.border="none","standalone"===this._delegate.uiStyle&&(this._iframeElement.style.maxWidth="380px",this._iframeElement.style.minWidth="240px",this._iframeElement.style.margin="0 auto",this._iframeElement.style.borderRadius="18px"),this._iframeC
2ontentWindowReady=!1);const e=this._getPlaceAsUrlParams();if(e!==this._iframeElement.src)this._iframeElement.src=e,this._iframeLoadingTimeout=setTimeout((()=>this._frameLoadingDidFail()),3e4);else{const e=hp.get(this);this._postMessage({action:"set-options",placeKey:e,mapkitVersion:t.version,colorScheme:this._delegate.colorScheme,displaysMap:this._delegate.displaysMap})}}_postMessage(t){if(!this._iframeContentWindowReady)return;const e=this._iframeElement.contentWindow;e&&e.postMessage(t,new URL(this._iframeElement.src).origin)}_handleMessageEvent(e){if(e.source===this._iframeElement.contentWindow)switch(e.data.action&&(clearTimeout(this._iframeLoadingTimeout),this._iframeContentWindowReady=!0),e.data.action){case"ready":{const i=ap(rp,e.data.key);hp.set(this,i);const s={action:"render-place",placeKey:i,accessToken:Oe.accessToken,mapkitVersion:t.version,colorScheme:this._delegate.colorScheme,displaysMap:this._delegate.displaysMap};Oe._showMapsLogo||(s.showMapsLogo=!1),this._postMessage(s);break}case"update-size":{const t=e.data.width,i=e.data.height;this._iframeElement.style.height=`${i}px`,this._delegate.placeCardSizeDidChange?.(t,i);break}case"place-card-did-reveal":this._delegate.placeCardDidReveal&&this._delegate.placeCardDidReveal(e.data.analyticsState);break;case"open-in-maps-clicked":this._delegate.placeCardOpenInMapsClicked&&this._delegate.placeCardOpenInMapsClicked(e.data.analyticsState)}}_frameLoadingDidFail(){this._delegate.loadingDidFail?.()}_removeIframeElement(){this._iframeElement&&(this._container.removeChild(this._iframeElement),window.removeEventListener("message",this._handleMessageEventListener),clearTimeout(this._iframeLoadingTimeout),this._iframeElement=void 0)}}function cp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function up(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function pp(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,gp(t,e,"get"))}function mp(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,gp(t,e,"set"),i),i}
2function gp(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const _p=new Set;var fp=new WeakMap;class yp{constructor(t){up(this,fp,{writable:!0,value:void 0}),cp(this,"uiStyle","standalone"),mp(this,fp,t)}get place(){return pp(this,fp).place}get colorScheme(){return pp(this,fp).colorScheme}get displaysMap(){return pp(this,fp).displaysMap}placeCardDidReveal(t){yn.log(yn.Events.PlaceDetailReveal,{eventValue:"LARGE",eventTarget:"PLACECARD_TRAY",states:{PLACE_CARD:()=>t}})}placeCardOpenInMapsClicked(t){yn.log(yn.Events.PlaceDetailOpenAppleMaps,{eventTarget:"PLACECARD_TRAY",states:{PLACE_CARD:()=>t}})}}var vp=new WeakMap,bp=new WeakMap,wp=new WeakMap,Cp=new WeakMap,kp=new WeakMap,Sp=new WeakMap,Lp=new WeakMap;class Mp{constructor(t,e=null,i={}){if(up(this,vp,{writable:!0,value:!1}),up(this,bp,{writable:!0,value:void 0}),up(this,wp,{writable:!0,value:void 0}),up(this,Cp,{writable:!0,value:void 0}),up(this,kp,{writable:!0,value:null}),up(this,Sp,{writable:!0,value:Ko.Light}),up(this,Lp,{writable:!0,value:!0}),!t||!Dt(t))throw new Error("[MapKit] `parent` must be a DOM element.");mp(this,bp,t),mp(this,wp,t.attachShadow({mode:Oe.shadowDOMMode||"closed"})),mp(this,Cp,new dp(pp(this,wp),new yp(this))),void 0!==i.colorScheme?this.colorScheme=i.colorScheme:this.colorScheme=Ko.Light,void 0!==i.displaysMap?this.displaysMap=i.displaysMap:this.displaysMap=!0,this.place=e,_p.add(this)}get element(){return pp(this,bp)}get place(){return pp(this,kp)}set place(t){pp(this,vp)||t!==pp(this,kp)&&(null!==t&&L(t,op,"[MapKit] The `place` parameter must be a Place."),mp(this,kp,t),pp(this,Cp).update())}get colorScheme(){return pp(this,Sp)}set colorScheme(t){if(!pp(this,vp)&&t!==pp(this,Sp)){if(!C(t,Ko))throw new Error("[MapKit] Unknown value for `colorScheme`. Choose from `PlaceDetail.ColorSchemes`.");mp(this,Sp,t),pp(this,Cp).update()}}get displaysMap(){return pp(this,Lp)}set displaysMap(t){pp(this,vp)||t!==pp(this,Lp)&&(mp(this,Lp,!!t),pp(this,Cp).update())}destroy(){pp(this,vp)||(mp(this,vp,!0),pp(this,Cp).destroy(),_p.delete(this))}}cp(Mp,"ColorSchemes",Ko);const Ap={MapInternal:Hu,css:".mk-map-view{width:100%;height:100%;overflow:hidden;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none;cursor:default}.mk-map-view.mk-dragging-annotation{cursor:none}.mk-map-view.mk-disable-all-gestures{touch-action:none}.mk-map-view.mk-disable-pinch-gestures{touch-action:pan-x pan-y}.mk-map-view.mk-disable-zoom-gestures{touch-action:manipulation}.mk-map-view.mk-disable-pan-gestures{touch-action:none;touch-action:pinch-zoom}div.mk-map-view.mk-map-view img,div.mk-map-view.mk-map-view svg{margin:0;padding:0}.mk-annotation-container,.mk-map-view{z-index:0}.mk-map-view>*{position:absolute;left:0;-webkit-user-select:none;user-select:none}.mk-map-view .rt-root{letter-spacing:initial}.mk-map-view .mk-font-size-detector{position:absolute;height:1em;visibility:hidden;left:-100%;-webkit-text-size-adjust:none}.mk-controls-container{position:absolute;overflow:hidden;top:0;bottom:0;left:0;right:0;z-index:3;pointer-events:none}.mk-map-view.mk-dragging-cursor{cursor:grabbing}.mk-map-view>iframe{width:100%;height:100%;pointer-events:none;opacity:0;border:0}",htmlElement:Fs,mapkit:{FeatureVisibility:yt,CoordinateRegion:J,CoordinateSpan:Q,Coordinate:tt,BoundingRegion:et,MapPoint:it,MapRect:ot,MapSize:st,Padding:Zc,CameraZoomRange:nt,Map:Qu,get maps(){return Hu.maps},PointOfInterestCategory:Vl,PointOfInterestFilter:th,filterIncludingAllCategories:Jl,filterExcludingAllCategories:Ql,PlaceDetail:Mp,get placeDetails(){return[..._p]}}};function Tp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class xp{constructor(t){Tp(this,"_annotation",void 0),Tp(this,"_liftAnimationStartDate",void 0),Tp(this,"_liftAnimationProgress",void 0),Tp(this,"_dropAfterLiftAnimationStartDate",void 0),Tp(this,"_dropAnimationStartP",void 0),Tp(this,"_dropAnimationRevert",void 0),Tp(this,"liftDurationMs",200),Tp(this,"liftOpacity",.5),Tp(this,"liftAmount",void 0),Tp(this,"translation",void 0),this._annotation=t}animateLift(){const t=Math.min((Date.now()-this._liftAnimationStartDate)/this.liftDurationMs,1);this._annotation.translate(this.translation.x,this.translation.y-this.liftAmount*t),this._annotation.opacity=1-(1-this.liftOpacity)*t,t<1?(si(this),this._liftAnimationProgress=t):(this._liftAnimationStartDate=void 0,this._liftAnimationProgress=void 0)}animateDropAfterLift(){const t=Math.max(this._dropAnimationStartP-Math.min((Date.now()-this._dropAfterLiftAnimationStartDate)/this.liftDurationMs,1),0);this._dropAnimationRevert&&this._annotation.translate(0,-this.liftAmount*t),this._annotation.opacity=1-(1-this.liftOpacity)*t,t>0?si(this):this._annotation.droppedAfterLift()}dropAnnotationAfterDraggingAndRevertPosition(t){this._liftAnimationStartDate?(this._dropAnimationStartP=this._liftAnimationProgress,delete this._liftAnimationStartDate,delete this._liftAnimationProgress):this._dropAnimationStartP=1,t?this._annotation.resetNodeTransform():this._annotation.draggingDidEnd(),this._dropAfterLiftAnimationStartDate=Date.now(),this._dropAnimationRevert=t,si(this)}lift(t){this.liftAmount=t,this.translation=new Pe,t>0?(this._liftAnimationStartDate=Date.now(),this._liftAnimationProgress=0,si(this)):this._annotation.opacity=this.liftOpacity}getTranslation(){return new Pe(this.translation.x,this.translation.y-this.liftAmount)}setTranslation(t){this.translation=t,this._liftAnimationStartDate||this._annotation.translate(this.translation.x+this._annotation.dragOffset.x,this.translation.y-this.liftAmount+this._annotation.dragOffset.y)}performScheduledUpdate(){this._liftAnimationStartDate?this.animateLift():this._dropAfterLiftAnimationStartDate&&this.animateDropAfterLift()}}const Ep=(t,e,i)=>{const s=[];for(let o=0;o<t.length;o+=1){let n=parseInt(t.charAt(o),e),a=0;for(;n||a<s.length;){n+=(s[a]||0)*e;const t=n%i;s[a]=t,n=(n-t)/i,a+=1}}return s.reduce(((t,e)=>e.toString(i).toUpperCase()+t),"")},Ip=(t,e)=>e?`${t}${Ep(e.toString(),10,16)}`:"",Op=t=>Ip("G",t.protocolVersion)+Ip("H",t.sourceId)+Ip("I",t.muid),Pp=t=>{const e={};let i=0,s=0;for(let o=0;o<=t.length;o+=1){const n=t.charCodeAt(o),a=isNaN(n)||n>=71&&n<=90;if(i!==s||a||(s=o),i!==s&&a){e[t.substring(i,s)]=t.substring(s,o),i=o,s=o}}const o=e.I;return o?{sourceId:e.H?parseInt(e.H,16):0,protocolVersion:e.G?parseInt(e.G,16):0,muid:Ep(o,16,10)}:null};function Rp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class zp{constructor(t){if(Rp(this,"displayLines",void 0),Rp(this,"id",void 0),Rp(this,"alternateIds",void 0),Rp(this,"muid",void 0),Rp(this,"coordinate",void 0),Rp(this,"_completionUrl",void 0),Rp(this,"_providerId",void 0),Rp(this,"_providerItemId",void 0),Rp(this,"name",void 0),Rp(this,"telephone",void 0),Rp(this,"urls",void 0),Rp(this,"country",void 0),Rp(this,"administrativeArea",void 0),Rp(this,"administrativeAreaCode",void 0),Rp(this,"locality",void 0),Rp(this,"postCode",void 0),Rp(this,"subLocality",void 0),Rp(this,"thoroughfare",void 0),Rp(this,"subThoroughfare",void 0),Rp(this,"fullThoroughfare",void 0),Rp(this,"areasOfInterest",void 0),Rp(this,"depen
2dentLocalities",void 0),Rp(this,"timezone",void 0),Rp(this,"timezoneSecondsFromGmt",void 0),this.displayLines=t.displayLines,"id"in t&&t.id&&(this.id="id"in t?t.id:void 0,this.alternateIds=t.alternateIds||[]),"muid"in t&&t.muid&&(this.muid="muid"in t?t.muid:void 0),"location"in t&&t.location&&(this.coordinate=new tt(t.location.lat,t.location.lng)),this._completionUrl=t.completionUrl,"attribution"in t&&"object"==typeof t.attribution&&t.attribution){const e=t.attribution;"vendorId"in e&&(this._providerId=String(e.vendorId)),"externalItemId"in e&&(this._providerItemId=String(e.externalItemId))}this.name="name"in t?String(t.name):void 0,this.telephone="telephone"in t?t.telephone:void 0,this.urls="urls"in t?t.urls:[],this.country="country"in t?t.country:void 0,this.administrativeArea="administrativeArea"in t?t.administrativeArea:void 0,this.administrativeAreaCode="administrativeAreaCode"in t?t.administrativeAreaCode:void 0,this.locality="locality"in t?t.locality:void 0,this.postCode="postCode"in t?t.postCode:void 0,this.subLocality="subLocality"in t?t.subLocality:void 0,this.thoroughfare="thoroughfare"in t?t.thoroughfare:void 0,this.subThoroughfare="subThoroughfare"in t?t.subThoroughfare:void 0,this.fullThoroughfare="fullThoroughfare"in t?t.fullThoroughfare:void 0,this.areasOfInterest="areasOfInterest"in t?t.areasOfInterest:void 0,this.dependentLocalities="dependentLocalities"in t?t.dependentLocalities:void 0,this.timezone="timezone"in t?t.timezone:void 0,this.timezoneSecondsFromGmt="timezoneSecondsFromGmt"in t?t.timezoneSecondsFromGmt:void 0}}Rp(zp,"isConstructable",void 0),zp.isConstructable=!1;const Dp=function(t){if(zp.isConstructable)return new zp(t);throw new TypeError("[MapKit] SearchAutocompleteResult may not be constructed.")};zp.prototype.constructor=Dp,Dp.prototype=zp.prototype;function Np(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Fp=rt({Automatic:"automatic",Callout:"callout",FullCallout:"fullCallout",CompactCallout:"compactCallout",OpenInMaps:"openInMaps"});class Up{constructor({style:t}={}){Np(this,"_impl",void 0),this._impl={},this.style=t||Fp.Automatic}get style(){return this._impl.style}set style(t){if(!C(t,Fp))throw new Error("[MapKit] value passed to `PlaceSelectionAccessory.style` must be a value of `PlaceSelectionAccessory.Styles` enum.");this._impl.style=t}}function Wp(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function Gp(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Bp(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,jp(t,e,"get"))}function Zp(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,jp(t,e,"set"),i),i}function jp(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}Np(Up,"Styles",Fp);const Kp=Object.freeze({element:"ro",map:"ro",coordinate:"ro",id:"rw",place:"rw",title:"rw",subtitle:"rw",data:"rw",accessibilityLabel:"rw",anchorOffset:"rw",calloutOffset:"rw",size:"rw",callout:"rw",selectionAccessory:"rw",selectionAccessoryOffset:"rw",visible:"rw",enabled:"rw",selected:"rw",calloutEnabled:"rw",animates:"rw",appearanceAnimation:"rw",collisionMode:"rw",padding:"rw",draggable:"rw",displayPriority:"rw",clusteringIdentifier:"rw"}),Hp=rt({DragStart:"drag-start",Dragging:"dragging",DragEnd:"drag-end"}),qp=rt({Low:250,High:750,Required:1e3}),Vp=rt({Rectangle:"rectangle",Circle:"circle",None:"none"});class Yp extends Mh{constructor(t,e){super(t),this.coordinate=e}}function Xp(t){var e,i=new WeakMap;class s extends t{constructor(t,e,s,o){super(t),Gp(this,"_calloutOffset",void 0),Gp(this,"_unsized",void 0),Gp(this,"occluded",void 0),Gp(this,"_coordinate",void 0),Gp(this,"_place",void 0),Gp(this,"_id",void 0),Gp(this,"muid",void 0),Gp(this,"_userSetSize",void 0),Gp(this,"_removedFromMap",void 0),Gp(this,"_occludedAnimation",void 0),Gp(this,"_clusteringAnimation",void 0),Gp(this,"_isMoving",void 0),Gp(this,"isWaiting",void 0),Gp(this,"_isAnimating",void 0),Gp(this,"_isLifted",void 0),Gp(this,"_calloutAnchorPoint",void 0),Gp(this,"_dragController",void 0),Gp(this,"x",void 0),Gp(this,"y",void 0),Gp(this,"delayRank",void 0),Gp(this,"delayMs",void 0),Gp(this,"cluster",void 0),Gp(this,"previousCluster",void 0),Gp(this,"wasCollided",void 0),Gp(this,"distance",void 0),Gp(this,"index",void 0),Gp(this,"isPending",void 0),Gp(this,"canAnimate",void 0),Gp(this,"timeout",void 0),Gp(this,"visibleX",void 0),Wp(this,i,{writable:!0,value:void 0}),Gp(this,"_data",{}),Gp(this,"delegate",null),Gp(this,"dragOffset",Pe.Zero),Zp(this,i,[t,e,s,o])}init(){let t=Bp(this,i)[1];const e=Bp(this,i)[2];let o=Bp(this,i)[3];Zp(this,i,void 0),this._calloutOffset=this._calloutOffset?this._calloutOffset:new window.DOMPoint(0,1),this._padding=this._padding?this._padding:new Zc,this._selectionAccessoryOffset=this._selectionAccessoryOffset?this._selectionAccessoryOffset:new window.DOMPoint(0,0),super.init(),A(o),(t instanceof op||t instanceof zp)&&(o=o?{...o}:{},o.place=t,t=t.coordinate),this._setCoordinate(t),this._unsized=!0,this.occluded=!1,this._setNode(t,e,o);const n=s.OptionSetters;if(o){for(const t of a(this.ConstructorOptions)){const e=this.ConstructorOptions[t];if(void 0!==o[t])if("ro"!==e){if(Mi(t,n)){if("clusteringIdentifier"===t){n[t].call(this,o[t]);continue}if("displayPriority"===t){n[t].call(this,o[t]);continue}}Object.assign(this,{[t]:o[t]})}else console.warn("[MapKit] `"+t+"` is read-only and can't be set on the Annotation.")}
2Object.keys(o).forEach((t=>{this.isAKnownOption(t)||console.warn("[MapKit] Unknown option for annotation: "+t+" (use the `data` property instead)")}))}Nn.addEventListener(Nn.Events.LocaleChanged,this),this.updateLocalizedText()}_setNode(){throw new Error("Method not implemented.")}get map(){return this.delegate&&this.delegate.mapForAnnotation(this._public)}set map(t){console.warn("[MapKit] The `map` property is read-only.")}get coordinate(){return this._coordinate}set coordinate(t){this.memberAnnotations||this._setCoordinate(t)}get id(){return this._place&&this._place.id||this._id}set id(t){this._id=t}get place(){return this._place}set place(t){if(!(t instanceof op)&&!(t instanceof zp))throw new TypeError("[MapKit] Expected a Place for Annotation.place, but got `"+t+"` instead");this._place=t}get title(){return this._title}set title(t){null!=t?(S(t,"string","[MapKit] Expected a string value for Annotation.title, but got `"+t+"` instead"),this._title=t):delete this._title,this.updateLocalizedText(),this._updatedProperty("title")}get subtitle(){return this._subtitle}set subtitle(t){null!=t?(S(t,"string","[MapKit] Expected a string value for Annotation.subtitle, but got `"+t+"` instead"),this._subtitle=t):delete this._subtitle,this.updateLocalizedText(),this._updatedProperty("subtitle")}get accessibilityLabel(){return this._accessibilityLabel}set accessibilityLabel(t){null!=t?(S(t,"string","[MapKit] Expected a string value for Annotation.accessibilityLabel, but got `"+t+"` instead"),this._accessibilityLabel=t):delete this._accessibilityLabel,this.updateLocalizedText()}get data(){return this._data}set data(t){this._data=t}get enabled(){return this._enabled}set enabled(t){this._enabled=!!t}get calloutEnabled(){return this._calloutEnabled}set calloutEnabled(t){this._calloutEnabled=!!t}get selected(){return this._selected}set selected(t){const e=!!t;if(e!==this._selected){if(this.delegate&&!this.delegate.selectionMayChange)return void console.warn("[MapKit] Selection may not change in select/deselect event handler.");this._selected=e,this._updatedProperty("selected")}}get animates(){return this._animates}set animates(t){this._animates=!!t}get calloutOffset(){return this._calloutOffset}set calloutOffset(t){L(t,window.DOMPoint,"[MapKit] Annotation.calloutOffset expected a DOMPoint, but got `"+String(t)+"` instead."),this._calloutOffset=new window.DOMPoint(t.x,t.y),this._updatedProperty("calloutOffset")}get callout(){return this._callout}set callout(t){null!==t&&S(t,"object","[MapKit] Annotation.callout expected an object, but got `"+String(t)+"` instead."),this._callout=t}get selectionAccessory(){return this._selectionAccessory}set selectionAccessory(t){if(!this.place&&!this.muid)throw new Error("[MapKit] Selection Accessory can only be set on an annotation with an associated `place`.");null!==t&&L(t,Up,"[MapKit] The `selectionAccessory` parameter passed to `Annotation.selectionAccessory` is not a PlaceSelectionAccessory."),this._selectionAccessory=t}get selectionAccessoryOffset(){return this._selectionAccessoryOffset}set selectionAccessoryOffset(t){L(t,window.DOMPoint,"[MapKit] Annotation.selectionAccessoryOffset expected a DOMPoint, but got `"+String(t)+"` instead."),this._selectionAccessoryOffset=new window.DOMPoint(t.x,t.y),this._updatedProperty("selectionAccessoryOffset")}get draggable(){return this._draggable}set draggable(t){this.memberAnnotations||this._setDraggable(t)}get draggingLift(){return this._draggingLift}set draggingLift(t){if(S(t,"number","[MapKit] Annotation.draggingLift expected a number, but got `"+t+"` instead."),t<0)throw new Error("[MapKit] Annotation.draggingLift must be zero or more.");this._draggingLift=t}get size(){if(this._updateSize(),!this._unsized)return{width:this._node.size.width,height:this._node.size.height}}set size(t){const e="[MapKit] Annotation size expects a size object with width and height properties";S(t,"object",e),S(t.width,"number",e),S(t.height,"number",e),this.setSize(new at(t.width,t.height)),this._userSetSize=!0,this.updateSize()}get opacity(){return this.sceneGraphNode?this.sceneGraphNode.opacity:this.node.opacity}set opacity(t){this.sceneGraphNode?this.sceneGraphNode.opacity=t:this.node.opacity=t}get displayPriority(){return this._displayPriority}set displayPriority(t){this.memberAnnotations||this._setDisplayPriority(t)}isRequired(){return this.selected||this.displayPriority===qp.Required}get collisionMode(){return this._collisionMode}set collisionMode(t){if(!C(t,Vp))throw new Error("[MapKit] Unknown value for `collisionMode`. Choose from Annotation.CollisionMode.");t!==this._collisionMode&&(this._collisionMode=t,this._updatedProperty("collisionMode"))}get clusteringIdentifier(){return this._clusteringIdentifier}set clusteringIdentifier(t){this.memberAnnotations||this._setClusteringIdentifier(t)}get padding(){return this._padding.copy()}set padding(t){L(t,Zc,"[MapKit] The `padding` parameter passed to `Annotation.padding` is not a Padding."),this._padding.equals(t)||(this._padding=t.copy(),this._updatedProperty("padding"))}get needsLayout(){return!!this._sceneGraphNode&&"needsLayout"in this._sceneGraphNode&&!!this._sceneGraphNode.needsLayout}get elementInAnnotationDOM(){return this._node.element.firstChild}getMuidList(){const t=[],e=this.id,i=e?Pp(e):null,s=i&&i.muid||this.place&&this.place.muid||this.muid;
2s&&t.push(s);const o=this.place&&this.place.alternateIds||[];for(const e of o){const i=e?Pp(e):null;i&&i.muid&&t.push(i.muid)}return t}centerOffsetForSelectionAccessory(){const t=this.size;return new Pe(-t.width/2,-t.height/2)}removedFromMap(){this._removedFromMap=!0,Nn.removeEventListener(Nn.Events.LocaleChanged,this),this._occludedAnimation&&this._occludedAnimation.end(),this._clusteringAnimation&&this._clusteringAnimation.end()}addedToMap(){this._removedFromMap&&(this._removedFromMap=!1,Nn.addEventListener(Nn.Events.LocaleChanged,this),this.updateLocalizedText())}setDelegate(t){this.delegate=t}updateLayout(){}get isAppStyle(){return!1}get isPlaceStyle(){return!1}doesAnimate(){return this._animates&&!!this._appearanceAnimationName}willMoveToMap(){this._isMoving=this.doesAnimate(),this._updateSize()}didMoveToMap(){this._isMoving&&this._appearanceAnimationName&&this._visible&&(this.element.style.animation=this._appearanceAnimation,this.element.style.animationName&&(this._animating=!0,this.element.addEventListener("animationend",this))),delete this._isMoving}isStable(){return!(this.isWaiting||this._isMoving||this._isAnimating||this._isLifted)}canShowCallout(){return this._calloutEnabled&&this.isStable()}canShowSelectionAccessory(){return this.isStable()}selectionAccessoryWillAppear(){}selectionAccessoryWillDisappear(){}canBePicked(){return this._shown&&this._visible&&!this._isMoving&&!this._isAnimating&&!this._isLifted&&!this.occluded}draggingDidStart(){this._public.dispatchEvent(new Mh(Hp.DragStart))}isDraggable(){return this.draggable&&!this._isLifted}isLifted(){return this._isLifted}dispatchDraggingEvent(){const t=new Yp(s.Events.Dragging,this._coordinateDuringDrag());return this._public.dispatchEvent(t),t}positionForCallout(){let t=this._calloutAnchorPoint;if(!t){const e=this._userSetSize?this._node.size:this.delegate?.sizeForElement(this.elementInAnnotationDOM);t=new Pe(-e.width/2,0)}const e=this.nodePosition();return new Pe(e.x-t.x-this._calloutOffset.x,e.y-t.y-this._calloutOffset.y)}positionForSelectionAccessory(t,e){const i=this.centerOffsetForSelectionAccessory();i.x-=this._selectionAccessoryOffset.x,i.y-=this._selectionAccessoryOffset.y;const s=this.nodePosition(),o=this.size;let n;switch(t){case"top":n=new Pe(i.x,e);break;case"left":n=new Pe(e,i.y);break;case"right":n=new Pe(-o.width-e,i.y);break;case"bottom":n=new Pe(i.x,-o.height-e)}return new Pe(s.x-n.x,s.y-n.y)}setDraggingTranslationForMapFrameSize(t,e){this._dragController.setTranslation(this.clampDraggingTranslationForMapFrameSize(t,e))}dropAfterDraggingAndRevertPosition(t){this._dragController.dropAnnotationAfterDraggingAndRevertPosition(t)}distanceToPoint(t){const e=this._node.position.x,i=e+this._node.size.width,s=e-t.x,o=i-t.x,n=s<=0&&o>=0?0:Math.min(Math.abs(s),Math.abs(o)),a=this._node.position.y,r=a+this._node.size.height,l=a-t.y,h=r-t.y,d=l<=0&&h>=0?0:Math.min(Math.abs(l),Math.abs(h));return n*n+d*d}lift(){this._isLifted=!0,this._dragController.lift(this._draggingLift),this._updatedProperty("")}translate(t,e){this.sceneGraphNode?this.sceneGraphNode.transform=(new gi).translate(t,e):this._node.transform=(new hi).translate(t,e)}translatedPosition(){const t=this._dragController.getTranslation();return new Pe(this._position.x-this._anchorPoint.x-this._anchorOffset.x+t.x,this._position.y-this._anchorPoint.y-this._anchorOffset.y+t.y)}updatedPosition(){this.x=W(B(this.coordinate.longitude)),this.y=F(this.coordinate.latitude)}get sceneGraphNode(){return this._sceneGraphNode}mayBeDrawn(){return!!this.sceneGraphNode&&this._shown&&this.visible&&!this.isWaiting}isDrawn(){return(!this.occluded||this._occludedAnimation)&&this.mayBeDrawn()}animateOcclusion(){const t=this.occluded?0:1;this._sceneGraphNode&&(this._occludedAnimation&&this._occludedAnimation.end(),this._occludedAnimation=new So({node:this._sceneGraphNode,from:1-t,to:t,duration:200,done:()=>{delete this._occludedAnimation}}).begin()),this.cluster,this.previousCluster;const e=this.occluded&&this.cluster&&this.cluster._impl&&!this.cluster._impl.occluded,i=!this.occluded&&this.previousCluster&&!this.previousCluster._impl.wasOccluded;(e||i)&&this._animateClustering()}
2positionWasUpdated(){this._sceneGraphNode&&(this._sceneGraphNode.needsDisplay=!0)}handleEvent(t){switch(t.type){case Nn.Events.LocaleChanged:this.updateLocalizedText();break;case"animationend":if(t.animationName!==this._appearanceAnimationName)return;this.element.style.animation="",this.element.removeEventListener("animationend",this),this.finishedAnimating()}}updateLocalizedText(){this._node&&this._node.element&&this._node.element.setAttribute("aria-label",this.altText())}altText(){return this._accessibilityLabel||(this.title&&this.subtitle?Nn.get("Annotation.Generic.AccessibilityLabel",{title:this.title,subtitle:this.subtitle}):this.title||this.subtitle||"")}updateSize(){delete this._unsized,this._selected&&this.delegate&&this.delegate.selectedAnnotationDidMoveToMap(this._public)}clampDraggingTranslationForMapFrameSize(t,e){const i=this._anchorPoint.x+this._anchorOffset.x-this._position.x,s=e.width-this._node.size.width+i,o=this._anchorPoint.y+this._anchorOffset.y+this._dragController.liftAmount-this._position.y,n=e.height-this._node.size.height+o;return new Pe(w(t.x,i,s),w(t.y,o,n))}droppedAfterLift(){delete this._isLifted,this._selected&&this.delegate&&this.delegate.selectedAnnotationDidMoveToMap(this._public),this._updatedProperty("")}draggingDidEnd(){this.coordinate=this._coordinateDuringDrag(),this.resetNodeTransform(),this._public.dispatchEvent(new Mh(s.Events.DragEnd))}resetNodeTransform(){this.node.transform=new hi}finishedAnimating(){delete this._isAnimating,this._selected&&this.delegate&&this.delegate.selectedAnnotationDidMoveToMap(this._public),this._visible||this._updateVisibility(),this.delegate?.annotationFinishedAnimating(this._public)}isAKnownOption(t){return Object.keys(this.ConstructorOptions).includes(t)}_animateClustering(){if(this._sceneGraphNode){const t={annotation:this,node:this._sceneGraphNode,duration:200,done:()=>delete this._clusteringAnimation,from:void 0,to:void 0};this.cluster?(t.from=this.coordinate.toMapPoint(),t.to=this.cluster.coordinate.toMapPoint()):(t.from=this.previousCluster.coordinate.toMapPoint(),t.to=this.coordinate.toMapPoint());const e=t.to.x-t.from.x;e<-.5?t.to.x+=1:e>.5&&(t.from.x+=1),this._clusteringAnimation&&this._clusteringAnimation.end(),this._clusteringAnimation=new $p(t).begin()}}_setCoordinate(t){L(t,tt,"[MapKit] Annotation.coordinate expected a Coordinate value."),this._coordinate=t.copy(),this._updatedProperty("coordinate")}_setDraggable(t){const e=!!t;e!==this._draggable&&(this._draggable=e,this._updatedProperty("draggable"))}_setDisplayPriority(t){const e="[MapKit] Annotation displayPriority expects a number between 0 and "+qp.Required;S(t,"number",e);const i=w(t,0,qp.Required);if(i!==t)console.warn(e+", value was normalized");else if(i===this._displayPriority)return;this._displayPriority=i,this._updatedProperty("displayPriority")}_setClusteringIdentifier(t){null!==t&&S(t,"string","[MapKit] Annotation clusteringIdentifier expects a string"),this._clusteringIdentifier!==t&&(this._clusteringIdentifier=t,this._updatedProperty("clusteringIdentifier"))}_coordinateDuringDrag(){let t=0,e=0;this.sceneGraphNode&&(t=this._dragController.translation.x,e=this._dragController.translation.y-this._dragController.liftAmount);const i=this.node.convertPointToPage(new Pe(t+this.dragOffset.x+this._anchorPoint.x+this.anchorOffset.x,e+this.dragOffset.y+this._anchorPoint.y+this.anchorOffset.y));return this.delegate._map.convertPointOnPageToCoordinate(new window.DOMPoint(i.x,i.y))}_updateSize(){if(!this._unsized||this._userSetSize||!this.delegate)return;const t=this.delegate.sizeForElement(this.elementInAnnotationDOM);t&&(delete this._unsized,this.setSize(t))}_updatedProperty(t){this.delegate&&this.delegate.annotationPropertyDidChange(this,t)}get labelOccluded(){return!1}set labelOccluded(t){}get shouldPreventDrag(){return!1}setSize(t){this.delegate?.annotationPropertyDidChange(this,"size"),super.setSize(t)}}return(e=s).prototype._calloutOffset=void 0,e.prototype._enabled=!0,e.prototype._selected=!1,e.prototype._calloutEnabled=!0,e.prototype._draggable=!1,e.prototype._title="",e.prototype._subtitle="",e.prototype._accessibilityLabel=null,e.prototype._displayPriority=qp.Required,e.prototype._collisionMode=Vp.Rectangle,e.prototype._clusteringIdentifier=null,e.prototype._sceneGraphNode=null,e.prototype._padding=void 0,e.prototype._draggingLift=40,e.prototype.shouldHideLabels=!1,e.prototype._callout=null,e.prototype._selectionAccessory=null,e.prototype._selectionAccessoryOffset=void 0,e.prototype._animates=!1,e.prototype.ConstructorOptions=Kp,Gp(s,"Events",Hp),Gp(s,"DisplayPriority",qp),Gp(s,"CollisionMode",Vp),Gp(s,"OptionSetters",Object.freeze({displayPriority:e.prototype._setDisplayPriority,clusteringIdentifier:e.prototype._setClusteringIdentifier})),s}class $p extends ko{constructor(t){super(t),Gp(this,"annotation",void 0),this.annotation=t.annotation}update(t){const e=this.annotation;if(null==e.delegate)return;const i=e.delegate._map,s=i.camera.toRenderingMapRect(),o=Z((1-t)*this.from.x+t*this.to.x,s.midX()),n=(1-t)*this.from.y+t*this.to.y,a=i.adjustMapItemPoint(i.camera.transformMapPoint(new Pe(o,n)));this.node.transform=(new gi).translate(a.x-e._position.x,a.y-e._position.y)}stringInfo(){return super.stringInfo("translation*")}}var Jp;const Qp="mk-hidden",tm="mk-invisible";class em{constructor(t){var e,i,s;s=null,(i="delegate")in(e=this)?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,t&&(this._public=t),this._position=this._position?this._position:new Pe,this._anchorPoint=this._anchorPoint?this._anchorPoint:new Pe,this._anchorOffset=this._anchorOffset?this._anchorOffset:new window.DOMPoint}init(){}get itemType(){return"annotation"}get node(){return this._node}
2get element(){return this._element}set element(t){console.warn("[MapKit] The `element` property is read-only.")}get anchorOffset(){return this._anchorOffset}set anchorOffset(t){L(t,window.DOMPoint,"[MapKit] Annotation.anchorOffset expected a DOMPoint, but got `"+String(t)+"` instead."),this._anchorOffset=new window.DOMPoint(t.x,t.y),this.updatePosition()}get anchorPoint(){return this._anchorPoint}get visible(){return this._visible}set visible(t){t=!!t,this._visible!==t&&(this._visible=t,this._updateVisibility())}get appearanceAnimation(){return this._appearanceAnimation}set appearanceAnimation(t){if(S(t,"string","[MapKit] Annotation.appearanceAnimation expected a string, but got `"+t+"` instead."),""===t)return void(this._appearanceAnimation=this._appearanceAnimationName="");const e=document.createElement("div");e.style.animation=t,this._appearanceAnimationName=e.style.animationName,this._appearanceAnimationName?this._appearanceAnimation=t:console.warn("[MapKit] Annotation.appearanceAnimation expects an animation style value with an animation name, but got `"+t+"` instead.")}nodePosition(){return this._nodePosition||this._node.position}calculateNodePosition(){const t=this.position();return new Pe(t.x-this.anchorPoint.x-this.anchorOffset.x,t.y-this.anchorPoint.y-this.anchorOffset.y)}updatePosition(){const t=this.calculateNodePosition();!this.renderedByDOMElement&&this.map&&this.map._impl.cameraIsMoving?this._nodePosition=t:(delete this._nodePosition,this._node.position=t),this.positionWasUpdated(t)}setShown(t){t=!!t,this._shown!==t&&(this._shown=t,this._node.element&&this._node.classList.toggle(Qp,!t),this.shownPropertyWasUpdated(t))}shownPropertyWasUpdated(){}positionWasUpdated(){}isShown(){return this._shown}position(){return this._position}setPosition(t){this._position=t,this.updatePosition()}updateVisibility(t){this._node.classList.toggle(tm,t)}setSize(t){this._node.size=t,this._anchorPoint=new Pe(t.width/2,t.height),this.updatePosition()}_updateVisibility(){!this._visible&&this._animating||(this.updateVisibility(!this._visible),this.delegate&&this.delegate.annotationPropertyDidChange(this,"visible"))}}(Jp=em).prototype._shown=!0,Jp.prototype._visible=!0,Jp.prototype._position=void 0,Jp.prototype._anchorPoint=void 0,Jp.prototype._anchorOffset=void 0,Jp.prototype._appearanceAnimation="",Jp.prototype.renderedByDOMElement=!0,Jp.prototype.isMapFeature=!1;function im(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const sm=Xp(em);class om extends sm{constructor(...t){super(...t),im(this,"_animates",!0),im(this,"needsColliding",void 0),im(this,"wasOccluded",void 0),im(this,"_toBeRemoved",void 0),im(this,"floating",void 0),im(this,"labelRegion",void 0),im(this,"boundingBox",void 0)}_setNode(t,e,i){S(e,"function");const s=jt(e,window,[t,i]);zt(s,"[MapKit] Annotation element factory must return a DOM element, got `"+String(s)+"` instead."),this._element=s;let o=s;if(ks){const t="mk-slot-"+Math.random().toString(32).substr(2,8);s.slot=t,o=Fs("slot"),o.name=t}this._node=new Ri(Fs("div",o)),this._node.wantsHardwareCompositing=this.renderedByDOMElement,this._dragController||(this._dragController=new xp(this))}}im(om,"div",(()=>document.createElement("div")));function nm(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class am extends Ah{constructor(t,e,i){super(),new.target===am&&(Object.defineProperty(this,"_impl",{value:new om(this,t,e,i)}),this._impl.init())}get map(){return this._impl.map}set map(t){this._impl.map=t}get element(){return this._impl.element}set element(t){this._impl.element=t}get coordinate(){return this._impl.coordinate}set coordinate(t){this._impl.coordinate=t}get id(){return this._impl.id}get visible(){return this._impl.visible}set visible(t){this._impl.visible=t}get appearanceAnimation(){return this._impl.appearanceAnimation}set appearanceAnimation(t){this._impl.appearanceAnimation=t}get title(){return this._impl.title}set title(t){this._impl.title=t}get subtitle(){return this._impl.subtitle}
2set subtitle(t){this._impl.subtitle=t}get accessibilityLabel(){return this._impl.accessibilityLabel}set accessibilityLabel(t){this._impl.accessibilityLabel=t}get data(){return this._impl.data}set data(t){this._impl.data=t}get enabled(){return this._impl.enabled}set enabled(t){this._impl.enabled=t}get calloutEnabled(){return this._impl.calloutEnabled}set calloutEnabled(t){this._impl.calloutEnabled=t}get selectionAccessory(){return this._impl.selectionAccessory}set selectionAccessory(t){this._impl.selectionAccessory=t}get selectionAccessoryOffset(){return this._impl.selectionAccessoryOffset}set selectionAccessoryOffset(t){this._impl.selectionAccessoryOffset=t}get selected(){return this._impl.selected}set selected(t){this._impl.selected=t}get animates(){return this._impl.animates}set animates(t){this._impl.animates=t}get anchorOffset(){return this._impl.anchorOffset}set anchorOffset(t){this._impl.anchorOffset=t}get calloutOffset(){return this._impl.calloutOffset}set calloutOffset(t){this._impl.calloutOffset=t}get callout(){return this._impl.callout}set callout(t){this._impl.callout=t}get draggable(){return this._impl.draggable}set draggable(t){this._impl.draggable=t}get size(){return this._impl.size}set size(t){this._impl.size=t}get displayPriority(){return this._impl.displayPriority}set displayPriority(t){this._impl.displayPriority=t}get collisionMode(){return this._impl.collisionMode}set collisionMode(t){this._impl.collisionMode=t}get clusteringIdentifier(){return this._impl.clusteringIdentifier}set clusteringIdentifier(t){this._impl.clusteringIdentifier=t}get padding(){return this._impl.padding}set padding(t){this._impl.padding=t}get memberAnnotations(){return this._impl.memberAnnotations}}nm(am,"EVENTS",Hp),nm(am,"DisplayPriority",qp),nm(am,"CollisionMode",Vp);function rm(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const lm=new Q(.001,.001),hm=new Zc(12,12,12,12),dm="select",cm="deselect";class um{constructor(t){rm(this,"_map",null),rm(this,"_items",void 0),rm(this,"itemName",void 0),rm(this,"capitalizedItemName",void 0),rm(this,"itemConstructor",void 0),rm(this,"_previousPointForPickingItem",void 0),rm(this,"_closeItems",void 0),rm(this,"_closeItemIndex",void 0),rm(this,"_selectedItem",null),rm(this,"_selectionDistance",10),rm(this,"_node",void 0),rm(this,"_sceneGraphNode",void 0),this._map=t,this._items=[]}static checkShowItemsParameters(t,e){return M(t,"[MapKit] Map.showItems expects an array of items as its first parameter."),e=A(e,"[MapKit] Map.showItems expects an object as optional second parameter."),Object.keys(e).forEach((t=>{switch(t){case"animate":break;case"padding":if(void 0===e.padding)break;L(e.padding,Zc,"[MapKit] Map.showItems expects a Padding object for `options.padding`.");break;case"minimumSpan":if(void 0===e.minimumSpan)break;L(e.minimumSpan,Q,"[MapKit] Map.showItems expects a CoordinateSpan for `options.minimumSpan`.");break;case"cameraDistance":if(void 0===e.cameraDistance)break;S(e.cameraDistance,"number","[MapKit] Map.showItems expects a number for `options.cameraDistance`.");break;default:console.warn("[MapKit] `"+t+"` is not a valid option of Map.showItems.")}})),e}static getRegionForItems(t,e,i){let s=i.padding||hm;const o=i.minimumSpan||lm;let n=0,a=0,r=0,l=0;const h=[];for(let i=0,s=e.length;i<s;++i){const s=e[i];if(s.map===t.public)if("overlay"===s._impl.itemType){const t=s._impl._boundingRect||s._impl.boundingRectAtScale&&s._impl.boundingRectAtScale(1),e=s._impl.style._impl.halfStrokeWidthAtResolution();n=Math.max(n,e),a=Math.max(a,e),r=Math.max(r,e),l=Math.max(l,e),h.push(t)}else{s._impl.updateLayout(!0);const t=s._impl.delegate.paddingForAnnotation(s);n=Math.max(n,t.top),a=Math.max(a,t.right),r=Math.max(r,t.bottom),l=Math.max(l,t.left),h.push(new ot(s._impl.x,s._impl.y,0,0))}}if(0===h.length)return null;s=new Zc(s.top+n,s.right+a,s.bottom+r,s.left+l);const d=function(t,e){const i=t.toCoordinateRegion();if(i.span.latitudeDelta>=e.latitudeDelta&&i.span.longitudeDelta>=e.longitudeDelta)return t;i.span.latitudeDelta=Math.max(i.span.latitudeDelta,e.latitudeDelta),i.span.longitudeDelta=Math.max(i.span.longitudeDelta,e.longitudeDelta);const s=i.span.latitudeDelta/2,o=i.span.longitudeDelta/2,n=new it(W(i.center.longitude-o),F(i.center.latitude+s)),a=new it(W(i.center.longitude+o),F(i.center.latitude-s));n.x>a.x&&n.x--;return new ot(n.x,n.y,Math.min(a.x-n.x,1),a.y-n.y)}(Xc(h.sort(((t,e)=>t.minX()-e.minX()))),o);return t.padMapRect(d,s,i.cameraDistance)}
2static setRegionForItems(t,e,i){if(t.ensureRenderingFrame().size.height<=0||t.ensureRenderingFrame().size.width<=0)return!1;if(0===e.length)return!0;const s=!!i.animate,o=um.getRegionForItems(t,e,i);return!o||(t.setVisibleMapRectAnimated(o,s),!0)}get node(){return this._node}get sceneGraphNode(){return this._sceneGraphNode}get items(){return this._items.filter((t=>this.isItemExposed(t)),this)}set items(t){M(t,"[MapKit] Map."+this.itemName+"s expected an array of "+this.itemName+"s, but got `"+t.toString()+"` instead."),t.forEach(((t,e)=>{L(t,this.itemConstructor,"[MapKit] Map."+this.itemName+"s expected an "+this.itemName+" at index "+e+", but got `"+t.toString()+"` instead.")})),t=t.filter((t=>!t.map||t.map._impl===this._map||(console.warn("[MapKit] Map."+this.capitalizedItemName+"s: "+this.itemName+" is already in another map."),!1)));const e=[...this._items];t=[...this._items.filter((t=>!this.isItemExposed(t))),...t];let i=0,s=0,o=!1;for(;i<t.length;){const n=t[i],a=e[s];a!==n?!a||t.includes(a)?(n.map&&n.map._impl===this._map?e.splice(e.indexOf(n),1):(this.addedItem(n,!0),o=!0),i++):(this.removedItem(a,!0),o=!0,s++):(i++,s++)}for(;s<e.length;){const t=e[s];this.removedItem(t,!0),o=!0,s++}
2t=t.filter((t=>t.map)),this._items=t,o&&this.manyItemsChanged(t,!0)}get selectedItem(){return this._selectedItem}set selectedItem(t){if(t!==this._selectedItem){if(null!=t&&(L(t,this.itemConstructor,"[MapKit] Map.selected"+this.capitalizedItemName+" expected an "+this.itemName+" or `null`, but got `"+t.toString()+"` instead."),t.map!==this._map.public))throw new Error("[MapKit] Map.selected"+this.capitalizedItemName+" cannot be set to an "+this.itemName+" that is not in the map.");if(this._selectedItem){const t=this._selectedItem;this._selectedItem=null,t.selected=!1,this._map.selectionMayChange=!1,t.dispatchEvent(new Mh(cm)),this._map.selectionMayChange=!0}t&&(this._selectedItem=t,t.selected=!0,this._map.selectionMayChange=!1,t.dispatchEvent(new Mh(dm)),this._map.selectionMayChange=!0)}}addItem(t,e){L(t,this.itemConstructor,"[MapKit] Map.add"+this.capitalizedItemName+" expected an "+this.itemName+", but got `"+t.toString()+"` instead.");const i=this.addItemToList(t,!1,e);return i&&this.manyItemsAdded([i],!1),i}addItems(t){M(t,"[MapKit] Map.add"+this.capitalizedItemName+"s expected an array of "+this.itemName+"s, but got `"+t.toString()+"` instead.");const e=t.filter(((t,e)=>(L(t,this.itemConstructor,"[MapKit] Map.add"+this.capitalizedItemName+"s expected an "+this.itemName+" at index "+e+", but got `"+t.toString()+"` instead."),!!this.addItemToList(t,!0))));return e.length>0&&this.manyItemsAdded(e,!0),e}shouldAddItem(t,e){return t.map?(t.map._impl!==this._map&&console.warn("[MapKit] Map."+this.capitalizedItemName+(e?"s":"")+": "+this.itemName+" is already in another map."),!1):!t._impl.isMapFeature||(console.warn("[MapKit] Map."+this.capitalizedItemName+(e?"s":"")+": "+this.itemName+" cannot be added to another map."),!1)}removeItem(t){return L(t,this.itemConstructor,"[MapKit] Map.remove"+this.capitalizedItemName+" expected an "+this.itemName+", but got `"+t.toString()+"` instead."),this.isItemExposed(t)?t.map!==this._map.public?console.warn("[MapKit] Map.remove"+this.capitalizedItemName+": cannot remove "+this.itemName+" as it is not attached to this map."):this.removeAnyItem(t):console.warn("[MapKit] Map.remove"+this.capitalizedItemName+": cannot remove "+this.itemName),t}removeAnyItem(t){const e=this._items.indexOf(t);return e>=0&&(this._items.splice(e,1),this.removedItem(t),this.manyItemsRemoved([t],!1)),t}removeItems(t){return M(t,"[MapKit] Map.remove"+this.capitalizedItemName+"s expected an array of "+this.itemName+"s, but got `"+t.toString()+"` instead."),t.forEach(((t,e)=>{L(t,this.itemConstructor,"[MapKit] Map.remove"+this.capitalizedItemName+"s expected an "+this.itemName+" at index "+e+", but got `"+t.toString()+"` instead."),this.isItemExposed(t)?t.map!==this._map.public?console.warn("[MapKit] Map.remove"+this.capitalizedItemName+"s: cannot remove "+this.itemName+" at index "+e+" as it is not attached to this map."):t._impl._toBeRemoved=!0:console.warn("[MapKit] Map.remove"+this.capitalizedItemName+"s: cannot remove "+this.itemName+" at index "+e)}),this),this._items=this._items.filter((t=>!t._impl._toBeRemoved)),t.forEach((t=>{t._impl._toBeRemoved&&(delete t._impl._toBeRemoved,this.removedItem(t,!0))})),t.length>0&&this.manyItemsRemoved(t,!0),t}enabledItemCloseToPoint(t,e){return this._previousPointForPickingItem&&this._previousPointForPickingItem.equals(t)?(e||(this._closeItemIndex=(this._closeItemIndex+1)%this._closeItems.length),this._closeItems[this._closeItemIndex]):(this._previousPointForPickingItem=t,this._closeItems=this._itemsCloseToPoint(t).filter((t=>t.enabled)),this._closeItemIndex=!e&&this._closeItems.length>1&&this._closeItems[0]?.selected?1:0,this._closeItems[this._closeItemIndex])}get selectionMayChange(){return!this._map||this._map.selectionMayChange}addItemToList(t,e,i){if(this.shouldAddItem(t,e))return(void 0===i||i<0||i>this._items.length)&&(i=this._items.length),this._items.splice(i,0,t),this.addedItem(t,e),t}manyItemsAdded(){}removedItem(t){t.selected=!1,t._impl.delegate=null}manyItemsRemoved(){}manyItemsChanged(){}mapWasDestroyed(){this._map=null,this.removedReferenceToMap()}_deletePreviousPointForPickingItem(){delete this._previousPointForPickingItem,delete this._closeItems,delete this._closeItemIndex}_itemsCloseToPoint(t){const e=this._items.filter((t=>t._impl.canBePicked()));return 0===e.length?[]:this.pickableItemsCloseToPoint(e,t)}}function pm(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class mm extends Ri{toString(){return this.stringInfo()+" →"}}class gm{constructor(t){pm(this,"hostNode",void 0),pm(this,"_elementNodeMap",{}),this.hostNode=t}appendAssignedElement(t,e){const i=t.slot,s=new mm(t);this._elementNodeMap[i]=s,this.hostNode.addChild(s),e||this.hostNode.element.appendChild(t)}removeAssignedElement(t,e){const i=t.name,s=this._elementNodeMap[i];delete this._elementNodeMap[i],this.hostNode.removeChild(s),e||this.hostNode.element.removeChild(s.element)}getAssignedElement(t){const e=this._elementNodeMap[t.name];return e?e.element:null}}function _m(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class fm{constructor(t){_m(this,"_element",void 0),_m(this,"delegate",null),this._element=Fs("div",{class:"mk-style-helper"}),this.delegate=t}
2get element(){return this._element}sizeForElement(t){const e=t.cloneNode(!0),i=[],s=[];!function(t,e,i){if(ks){if("slot"===t.localName)e.push(t),i.push(t.name);else for(const s of Array.from(t.getElementsByTagName("slot")))e.push(s),i.push(s.name);e.forEach((t=>{t.name="mk-slot-disabled"}))}}(t,i,s),this._element.appendChild(e),this.delegate&&this.delegate.styleHelperNodeDidMoveToParent&&this.delegate.styleHelperNodeDidMoveToParent(e);let o=e;ks&&"slot"===t.localName&&(o=e.assignedNodes()[0]);const n=function(t){if(!t||t.nodeType!==window.Node.ELEMENT_NODE)return;const e=window.getComputedStyle(t),i=parseFloat(e.marginLeft),s=parseFloat(e.marginTop),o=parseFloat(e.marginRight),n=parseFloat(e.marginBottom),a=ze.rectFromClientRect(t.getBoundingClientRect()).inset(-i,-s,-o,-n);return a}(o);return this._element.removeChild(e),function(t,e){ks&&t.forEach(((t,i)=>{const s=e[i];t.name=s}))}(i,s),n&&n.size}backgroundColorForElement(t,e){this._element.appendChild(t),this.delegate&&this.delegate.styleHelperNodeDidMoveToParent&&this.delegate.styleHelperNodeDidMoveToParent(t);let i=t;if(ks&&"slot"===t.localName&&(i=t.assignedNodes()[0],!i))return this._element.removeChild(t),null;const s=window.getComputedStyle(i).backgroundColor;return e&&(i.style.backgroundColor="transparent"),this._element.removeChild(t),/^transparent|initial|rgba\(.*, 0\)$/.test(s)?null:s}setAnimationForElement(t,e,i){let s=t;if(ks&&"slot"===t.localName&&(s=t.assignedNodes()[0],!s))return;s.style.animation=e;const o=function(t){t.animationName===i&&(s.style.animation="",s.removeEventListener("animationend",o))};s.addEventListener("animationend",o)}}function ym(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class vm{constructor(t){ym(this,"_map",void 0),ym(this,"_direction",void 0),ym(this,"_startTime",void 0),ym(this,"_initialSpeed",void 0),ym(this,"panning",!1),this._map=t,this.panning=!1}update(t,e){if(!this._map?.isScrollEnabled)return;const i=t._impl.translatedPosition(),s=i.x,o=s+e.size.width,n=i.y,a=n+e.size.height,r=this._map.ensureVisibleFrame();this._direction=new Pe,s<=r.minX()?this._direction.x=1:o>=r.maxX()&&(this._direction.x=-1),n<=r.minY()+5?this._direction.y=1:a>=r.maxY()-5&&(this._direction.y=-1);const l=0!==this._direction.x||0!==this._direction.y;!this.panning&&l?(this.panning=!0,this._startTime=Date.now(),this._initialSpeed=Math.floor(1/104.1*(r.size.width+r.size.height)/2),si(this)):this.panning&&!l&&this.stop()}stop(){this.panning&&(this.panning=!1,this._direction=void 0,this._startTime=void 0,this._initialSpeed=void 0)}performScheduledUpdate(){if(!this.panning)return;let t=this._initialSpeed;const e=Date.now()-this._startTime;e>4e3?t*=3:e>1e3&&(t*=1.5),this._map.translateCameraAnimated(new Pe(this._direction.x*t,this._direction.y*t),!1),this._map.panningDuringAnnotationDrag(),si(this)}mapWasDestroyed(){this._map=void 0}}class bm extends uo{constructor(t){var e,i,s;super(),s=void 0,(i="_controllerElement")in(e=this)?Object.defineProperty(e,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[i]=s,this._controllerElement=t}get element(){return this._controllerElement}stringInfo(){return"AnnotationsControllerNode"}}function wm(t,e){let i;if("function"!=typeof t.getImageUrl){const s=t;return i=function(t){if(!t||"object"!=typeof t)return;let e;const i=Object.keys(t).filter((e=>!!t[e])).map(parseFloat).filter((t=>!isNaN(t))).sort(),s=Ds();for(const t of i.reverse())if((!e||t>=s)&&(e=t),t<=s)break;return e}(s),i?void e({ratio:i,glyphImageUrl:s[i]}):void e()}i=Ds();const s=t;jt(s.getImageUrl,s,[i,function(t){setTimeout((()=>e(t?{ratio:i,glyphImageUrl:t}:void 0)))}])}class Cm extends lo{pathForSquareDot(t,e){const i=.6*e,s=.4*e;t.moveTo(e,0),t.lineTo(e+s,0),t.arc(e+s,i,i,Math.PI/2*3,0),t.lineTo(2*e,e+s),t.arc(e+s,e+s,i,0,Math.PI/2),t.lineTo(i,2*e),t.arc(i,e+s,i,Math.PI/2,Math.PI),t.lineTo(0,e-s),t.arc(i,i,i,Math.PI,Math.PI/2*3),t.lineTo(e,0)}}function km(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Sm(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Lm(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}let Mm;const Am=["size3","size4"];let Tm=[],xm=" ",Em="default-loading";
2var Im=new WeakSet,Om=new WeakSet,Pm=new WeakSet,Rm=new WeakSet;class zm extends Cm{constructor(...t){super(...t),km(this,Rm),km(this,Pm),km(this,Om),km(this,Im),Sm(this,"renderType",void 0),Sm(this,"glyphImageSrc",null),Sm(this,"isTainted",!1)}static loadMarkerResources(){Zm()}draw(t){this._sharedLayer&&(this._sharedLayer.renderer=this);const e=this._node,i=e.state,s=e.annotation,o=e.params;if(s.balloonVisible){switch(!s.warnOnUnselectedGlyphImageAccess||"default"!==i&&"lifted"!==i||console.warn("[MapKit] Unselected glyph image style is not available for this annotation."),this.glyphImageSrc=null,this.isTainted=!1,delete this.renderType,t.save(),o.style){case"bubble":Lm(this,Om,Nm).call(this,t,i,s,o),Lm(this,Pm,Fm).call(this,t,i,s,o),Lm(this,Rm,Um).call(this,t,i,s,o);break;case void 0:t.beginPath(),this.drawDotUnderCallout(t,s.selectedFillColor,o.radius);break;case"default":case"poi":case"balloon":t.save(),Lm(this,Im,Dm).call(this,t,o),Lm(this,Om,Nm).call(this,t,i,s,o),t.restore(),Lm(this,Pm,Fm).call(this,t,i,s,o),Lm(this,Rm,Um).call(this,t,i,s,o)}t.restore()}}get isFallbackGlyphTextPending(){return!Mm}addPendingNode(t){Tm.includes(t)||Tm.push(t),Zm()}get fallbackGlyphText(){return xm}get rendererForSharedLayer(){return this._sharedLayer?this._sharedLayer.renderer:this}drawDotUnderCallout(){}pathForBalloon(){}pathForMask(){}}function Dm(t,e){t.shadowOffsetY=e.shadowOffsetY*e.balloonRadius,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor}function Nm(t,e,i,s){t.beginPath(),this.pathForBalloon(t,s.balloonRadius,s.style),t.fillStyle="selected"===e?i.selectedStrokeColor:i.strokeColor,t.fill()}function Fm(t,e,i,s){t.save();const o="selected"===e?i.selectedFillColor:i.fillColor;t.beginPath();const n=s.balloonRadius-s.borderWidth;if(this.pathForMask(t,s.balloonRadius,n),i.fillWithGradient)if(i.gradientColors){const e=t.createLinearGradient(0,0,0,2*s.balloonRadius);e.addColorStop(0,i.gradientColors.start),e.addColorStop(1,i.gradientColors.end),t.fillStyle=e,t.fill()}else{t.fillStyle=o,t.fill(),t.globalCompositeOperation="overlay";const e=t.createLinearGradient(0,0,0,2*s.balloonRadius);e.addColorStop(0,"#a5a5a5"),e.addColorStop(1,"#4d4d4d"),t.fillStyle=e,t.fill()}else t.fillStyle=o,t.fill();t.restore()}function Um(t,e,i,s){if(delete this.glyphFontSize,i.glyphText)this.glyphFontSize=Wm(t,i,s),this.renderType="glyphText";else{const[o,n]=function(t,e,i,s,o,n){let a,r=!o,l=o?2*s.balloonRadius:s.glyphImageSize,h=Ns((e.size.width-l)/2),d=!1;a="default"===i||"lifted"===i?e.glyphImage:e.selectedGlyphImage||e.glyphImage;0;if(!a&&e.enablesDefaultGlyphImage){if(xm)return Zm(),Tm.includes(e)||Tm.push(e),Wm(t,e.annotation,s,xm),[null,!1];a=Mm[(t=>"selected"===t?"size4":"size3")(i)],l=2*s.balloonRadius,h=Ns((e.size.width-l)/2),r=!0,d=!0}try{if(!a)return[null,!1];let i;return i=r?function(t,e,i){Km.get(t)||Km.set(t,{});const s=Km.get(t);s[e]||(s[e]=[]);const o=i*zs();if(!s[e][o]){const i=Ft();i.width=o,i.height=o;const n=i.getContext("2d");n.fillStyle=e,n.fillRect(0,0,o,o),n.globalCompositeOperation="destination-in",n.drawImage(t,0,0,o,o),s[e][o]=i}return s[e][o]}(a,e.annotation.glyphColor,l):function(t,e,i,s){jm.get(t)||jm.set(t,{});const o=jm.get(t);const n=zs(),a=e*n;if(!o[a]){const e=i*n/2,r=Ft();r.width=a,r.height=a;const l=r.getContext("2d");l.beginPath(),s(l,a/2,e),l.clip(),l.drawImage(t,0,0,a,a),o[a]=r}return o[a]}(a,l,2*(s.balloonRadius-s.borderWidth),n),t.drawImage(i,h,h,l,l),d?[null,!1]:[a.src,null===a.crossOrigin]}catch{return e.glyphImageError(i),[null,!1]}}(t,this.node,e,s,i.isPlaceStyle,((t,e,i)=>this.pathForMask(t,e,i)));this.glyphImageSrc=o,this.isTainted=n,this.renderType=this.glyphImageSrc?"glyphImage":Em}}function Wm(t,e,i,s){null==s&&(s=e.glyphText),t.save(),t.fillStyle=e.glyphColor;let o,n=i.glyphFontSize;do{t.font=n--+"px "+bt,o=t.measureText(s).width}while(o>i.glyphImageSize&&n>0);t.textBaseline="alphabetic";const a=i.balloonRadius+.35*n;let r;return"1"===s?(t.textAlign="left",r=i.balloonRadius-o/2-o/16,t.fillText(s,r,a,i.glyphImageSize)):(t.textAlign="center",t.fillText(s,i.balloonRadius,a,i.glyphImageSize)),t.restore(
2),n+1}function Gm(){const t=Math.min(Ds(),3),e=(t>1?"_"+t+"x":"")+".png",i={};let s=Am.length;function o(){--s,0===s&&(Mm=i,xm="",Em="default",Tm.forEach((t=>{t.freeze(),t.needsDisplay=!0})),Tm=void 0)}Am.forEach((t=>{!function(t){const s=Do.createImageUrl("pins/marker"+(t?"-":"")+t+e),n=new Sh(St.Highest,{urlForImageLoader:s,loaderDidSucceed:function(){i[t]=n.image,o()},loaderDidFail:function(){console.warn("[MapKit] Error loading marker annotation image "+n.url+"; marker annotations may not display correctly."),xm="?",Em="default-error",o()}});n.crossOrigin=ra(Oe.urlWithCredentials(s)),n.schedule()}(t)}))}Sm(zm,"needsExtraRenderingWorkaround",void 0);let Bm=!1;function Zm(){Bm||(Bm=!0,Oe.state!==Oe.States.PENDING&&Oe.state!==Oe.States.READY?Oe.addEventListener(Oe.Events.Initialized,(function t(){Oe.removeEventListener(Oe.Events.Initialized,t),Gm()})):Gm())}const jm=new WeakMap;const Km=new WeakMap;class Hm extends zm{drawDotUnderCallout(t,e,i){t.strokeStyle=e,t.lineWidth=i,t.arc(i,i,i/2,0,2*Math.PI),t.stroke()}pathForBalloon(t,e,i){switch(i){case"balloon":t.save(),t.scale(e/256,e/256),t.moveTo(327.439,501.776),t.lineTo(327.525,501.776),t.bezierCurveTo(301.142,509.276,279.265,526.476,266.881,550.341),t.bezierCurveTo(263.709,556.456,261.65,562.811,255.956,562.811),t.bezierCurveTo(250.262,562.811,248.204,556.456,245.03,550.341),t.bezierCurveTo(232.648,526.471,210.771,509.272,184.388,501.776),t.lineTo(184.561,501.776),t.bezierCurveTo(77.943,470.858,0,372.507,0,255.944),t.bezierCurveTo(0,114.59,114.615,0,256,0),t.bezierCurveTo(397.385,0,512,114.59,512,255.944),t.bezierCurveTo(512,372.507,434.057,470.858,327.439,501.775),t.closePath(),t.restore();break;case"default":{const i=e/13.5*5,s=i/6,o=i/3,n=2*e,a=.448*e,r=.385*e;t.moveTo(n,e),t.bezierCurveTo(n,1.5*e,n-r,n-i/3,e+i/2+o,n),t.bezierCurveTo(e+i/3,n+i/3,e+s,n+i,e,n+i),t.bezierCurveTo(e-s,n+i,e-i/3,n+i/3,e-(i/2+o),n),t.bezierCurveTo(r,n-i/3,0,1.5*e,0,e),t.bezierCurveTo(0,a,a,0,e,0),t.bezierCurveTo(n-a,0,n,a,n,e),t.closePath();break}default:t.arc(e,e,e,0,2*Math.PI)}}pathForMask(t,e,i){t.arc(e,e,i,0,2*Math.PI)}}class qm extends zm{drawDotUnderCallout(t,e,i){t.fillStyle=e,this.pathForSquareDot(t,i),t.fill()}pathForBalloon(t,e,i){t.save(),t.scale(e/256,e/256),t.moveTo(424.278,512.1),"balloon"!==i&&"default"!==i||(t.lineTo(363.104,512.1),t.bezierCurveTo(302.97,513.623,278.509,528.747,266.778,551.35),t.bezierCurveTo(263.607,557.462,261.548,563.819,255.857,563.819),t.bezierCurveTo(250.167,563.819,248.107,557.462,244.937,551.35),t.bezierCurveTo(233.205,528.747,208.743,513.623,148.61,512.1)),t.lineTo(87.723,512.1),t.bezierCurveTo(39.475,512.099,0,472.713,0,424.573),t.lineTo(0,87.525),t.bezierCurveTo(0,39.387,39.475,0,87.723,0),t.lineTo(424.278,0),t.bezierCurveTo(472.525,0,512,39.387,512,87.525),t.lineTo(512,424.573),t.bezierCurveTo(512,472.713,472.525,512.099,424.278,512.099),t.closePath(),t.restore()}pathForMask(t,e,i){t.save();const s=e-i;t.translate(s,s),t.scale(i/256,i/256),t.moveTo(424.278,512.1),t.lineTo(87.723,512.1),t.bezierCurveTo(39.475,512.099,0,472.713,0,424.573),t.lineTo(0,87.525),t.bezierCurveTo(0,39.387,39.475,0,87.723,0),t.lineTo(424.278,0),t.bezierCurveTo(472.525,0,512,39.387,512,87.525),t.lineTo(512,424.573),t.bezierCurveTo(512,472.713,472.525,512.099,424.278,512.099),t.closePath(),t.restore()}}function Vm(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function Ym(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Xm(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Jm(t,e,"get"))}function $m(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Jm(t,e,"set"),i),i}function Jm(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var Qm=new WeakMap,tg=new WeakMap;class eg extends ts{constructor(t,e){super(),Ym(this,"_renderer",void 0),Ym(this,"annotation",void 0),Ym(this,"state",void 0),Ym(this,"params",void 0),Vm(this,Qm,{writable:!0,value:void 0}),Vm(this,tg,{writable:!0,value:void 0}),Ym(this,"glyphText",void 0),Ym(this,"glyphImage",void 0),Ym(this,"selectedGlyphImage",void 0),t.useSquareBalloon?this._renderer=new qm(this):this._renderer=new Hm(this),this.annotation=t,this.state="selected",this.params=e;const i=2*e.balloonRadius;$m(this,Qm,new at(i,i)),$m(this,tg,new ze(0,0,this.size.width,this.size.height))}get frozen(){return!0}get size(){return Xm(this,Qm)}get layerBounds(){return Xm(this,tg)}get enablesDefaultGlyphImage(){return this.annotation.enablesDefaultGlyphImage}draw(){!this.annotation.glyph&&this.enablesDefaultGlyphImage&&this._renderer.isFallbackGlyphTextPending&&this._renderer.addPendingNode(this);const t=this._renderer.layer;t.hidden=!1,t.style.width=t.style.height=this.size.width+"px";const e=t.getContext("2d");this._renderer.draw(e)}getLayer(){return this._renderer.layer}glyphImageError(t){"selected"===t&&this.selectedGlyphImage?delete this.selectedGlyphImage:delete this.glyphImage}updateGlyphImage(t){this.glyphImage=t??void 0}updateSelectedGlyphImage(t){this.selectedGlyphImage=t??void 0}freeze(){this.draw()}stringInfo(){return"MarkerAnnotationCalloutBubbleNode"}}function ig(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class sg extends lo{constructor(t){super(t),ig(this,"_scale",1),ig(this,"_params",void 0),this._params=rg()}get params(){const t=(this.node?this.node.fontSizeRatio:0)||this._scale;return this.node&&this._scale!==t&&(this._scale=t,ag(this._scale,this._params)),this._params}_setTextProperties(t){const e=this._node,i=this.params[e.kind];t.font=i.font,t.textAlign=this.params.textAlign,t.textBaseline="bottom",t.shadowBlur=this.params[e.kind].shadowBlur,t.shadowOffsetY=this.params[e.kind].shadowOffsetY,t.shadowColor=this.params[e.kind].shadowColor,t.miter
2Limit=this.params.miterLimit}draw(t){const e=this._node,i=this.params[e.kind];t.save(),this._setTextProperties(t);const s=e.colorScheme;t.fillStyle=i.color[s],t.strokeStyle=this.params.haloColor[s],t.lineWidth=this.params.haloSize;const o=e.size.width/2,n=i.height-i.yPadding-i.yMargin;t.strokeText(e.text,o,n),t.fillText(e.text,o,n),t.restore()}}const og=Object.freeze({title:{font:"600 11px "+bt,weight:600,fontWeight:600,fontFamily:bt,height:26,fontSize:11,lineHeight:12,yPadding:1,yMargin:5,shadowBlur:8,shadowOffsetY:.5,shadowColor:"rgba(0, 0, 0, .1)"},subtitle:{font:"500 10px "+bt,weight:500,fontWeight:500,fontFamily:bt,height:25,fontSize:10,lineHeight:11,yPadding:1,yMargin:5,shadowBlur:8,shadowOffsetY:.5,shadowColor:"rgba(0, 0, 0, .1)"}}),ng=(t,e,i)=>{const s=og[t],o=s.fontFamily||bt,n=s.fontWeight||500,a=(s.fontSize||11)*e,r=`${n} ${a}px ${o}`;if(i){const t=(s.height||16)*e,o=(s.lineHeight||12)*e;i.weight=n,i.fontSize=a,i.height=t,i.lineHeight=o,i.font=r}return r},ag=(t,e)=>{ng("title",t,e.title),ng("subtitle",t,e.subtitle)},rg=()=>{const t={haloColor:{light:"rgba(255, 255, 255, .8)",dark:"black"},haloSize:2,miterLimit:2,textAlign:"center",title:Object.assign({},og.title,{color:{light:"#2b2b2b",dark:"#e7e6e4"}}),subtitle:Object.assign({},og.subtitle,{color:{light:"#4c4c4c",dark:"#e7e6e4"}})};return ag(1,t),t};function lg(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class hg extends ts{constructor(t,e,i,s,o,n){super(),lg(this,"text",void 0),lg(this,"kind",void 0),lg(this,"textAscent",void 0),lg(this,"textDescent",void 0),lg(this,"fontSizeRatio",void 0),lg(this,"colorScheme",void 0),lg(this,"_renderer",void 0),this.text=t,this.kind=e,this._renderer=new sg(this),this.textAscent=s.actualBoundingBoxAscent||0,this.textDescent=s.actualBoundingBoxDescent||0;const a=this.textDescent>0?Math.ceil(this.textDescent):0;this.fontSizeRatio=n,this.size=new at(i,this._renderer.params[this.kind].height+a),this.colorScheme=o?"dark":"light",this.keyForFrozenLayer=this.colorScheme+(1!==n?`-${n}`:"")+"-"+e+"#"+this.text}stringInfo(){return"MarkerAnnotationLabelNode<"+this.kind+'> "'+this.text+'"'}get yMargin(){return this._renderer.params[this.kind].yMargin}get fontSize(){return this._renderer.params[this.kind].fontSize}get lineHeight(){return this._renderer.params[this.kind].lineHeight}}function dg(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const cg=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);class ug extends ts{constructor(t,e){super(),dg(this,"annotation",void 0),dg(this,"delegate",null),dg(this,"_renderer",null),dg(this,"injectedDefaultImage",void 0),dg(this,"injectedDefaultImageScale",void 0),dg(this,"glyphImage",void 0),dg(this,"selectedGlyphImage",void 0),this.annotation=t,e&&(this._state=e)}get enablesDefaultGlyphImage(){return this.annotation.enablesDefaultGlyphImage}set enablesDefaultGlyphImage(t){this.annotation.enablesDefaultGlyphImage=t}setDelegate(t){this.delegate=t}isTainted(){return this._renderer.isTainted}stringInfo(){const t=this._renderer.rendererForSharedLayer,e=cg(this,"_state")?`<${this.state}>`:"",i=cg(t,"glyphFontSize")?` "${this.annotation.glyphText}"@${t.glyphFontSize}`:"",s=[];this._renderer instanceof qm&&s.push("⏹"),this.annotation.balloonVisible||s.push("👻"),this.annotation.isAppStyle&&s.push("⭕️"),this.annotation.isPlaceStyle&&s.push("📍");const o=s.length?` ${s.join(" ")}`:"",n=t.glyphImageSrc?" 🖼 "+t.glyphImageSrc:"";return"MarkerAnnotationBalloonNode"+e+("selected"===this.state?`<color: ${this.annotation.selectedFillColor}${this.annotation.selectedStrokeColor!==this.annotation.defaultStrokeColor?`/${this.annotation.selectedStrokeColor}`:""}>`:`<color: ${this.annotation.fillColor}${this.annotation.strokeColor!==this.annotation.defaultStrokeColor?`/${this.annotation.strokeColor}`:""}>`)+i+n+o}get state(){return cg(this,"_state")?this._state:this.delegate.state}get params(){return this.delegate.getParamsFromState(this.state)}get layerBounds(){const t=Math.ceil(this.size.width/2),e=Math.ceil(this.size.height/4);return new ze(-t,-e,this.size.width+2*t,Math.ceil(1.5*this.size.height)+e)}glyphImageError(t){"selected"===t&&this.selectedGlyphImage?delete this.selectedGlyphImage:delete this.glyphImage,this.needsDisplay=!0}setBalloonStyle(){if(this.annotation.useSquareBalloon){if(this._renderer&&this._renderer.constructor===qm)return;this._renderer=new qm(this)}else{if(this._renderer&&this._renderer.constructor===Hm)return;this._renderer=new Hm(this)}}freeze(){if("default"!==this.state&&"lifted"!==this.state)return void(this.keyForFrozenLayer="");const t=this._renderer,e=this.annotation;!e.glyph&&this.enablesDefaultGlyphImage&&t.isFallbackGlyphTextPending&&t.addPendingNode(this),this.keyForFrozenLayer="balloon-"+[`${e.fillColor}/${this.annotation.strokeColor}`,e.glyph?e.glyph:t.fallbackGlyphText,e.glyphColor,e.useSquareBalloon?"square":""].join("-"),this.annotation.fillWithGradient||(this.keyForFrozenLayer+="-flat"),this.annotation.balloonVisible||(this.keyForFrozenLayer+="-nonv
2isible"),this.annotation.isPlaceStyle&&(this.keyForFrozenLayer+="-place"),this.annotation.isAppStyle&&(this.keyForFrozenLayer+="-app")}}class pg extends Cm{draw(t){const e=this._node,i=e.annotation;if(!i.balloonVisible)return;const s=e.params;t.save(),t.beginPath(),t.translate(-s.dotBorderWidth/2,-s.dotBorderWidth/2),this.pathForDot(t,s.dotRadius*s.dotScale+s.dotBorderWidth/2),t.fillStyle=i.selectedStrokeColor,t.fill(),t.restore(),t.save(),t.beginPath(),t.translate(s.dotBorderWidth/2,s.dotBorderWidth/2),this.pathForDot(t,s.dotRadius*s.dotScale-s.dotBorderWidth/2),i.fillWithGradient?i.gradientColors?(t.fillStyle=i.gradientColors.end,t.fill()):(t.fillStyle=i.selectedFillColor,t.fill(),t.globalCompositeOperation="overlay",t.fillStyle="#4d4d4d",t.fill()):(t.fillStyle=i.selectedFillColor,t.fill()),t.restore()}pathForDot(){}}class mg extends pg{pathForDot(t,e){t.arc(e,e,e,0,2*Math.PI)}}class gg extends pg{pathForDot(t,e){this.pathForSquareDot(t,e)}}function _g(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class fg extends ts{constructor(t,e){super(),_g(this,"annotation",void 0),_g(this,"params",void 0),_g(this,"_renderer",void 0),this.annotation=t,this.params=e,t.useSquareBalloon?this._renderer=new gg(this):this._renderer=new mg(this)}stringInfo(){const t=this._renderer instanceof gg?" ⏹":"";return"MarkerAnnotationDotNode<color: "+this.annotation.fillColor+">"+t}}var yg;function vg(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const bg=1e-12,wg={borderWidth:3,dotBorderWidth:2.5,labelWidthPadding:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetY:.5,transitionDuration:500,dotAnimationDuration:100,dotScale:1.5,anchorPointOffset:0},Cg=Object.assign({},wg,{borderWidth:1.5,balloonRadius:13.5,shadowBlur:11.25,dotRadius:0,glyphFontSize:15,glyphImageSize:20,offset:0,style:"default",height:32}),kg=11.5,Sg=Object.assign({},wg,{borderWidth:1.5,balloonRadius:kg,transitionDuration:250,shadowBlur:5,shadowOffsetY:0,dotRadius:0,glyphFontSize:15,glyphImageSize:16,offset:0,style:"poi",height:23,anchorPointOffset:-11.5}),Lg=[];for(let t=2;t<=6;t++){const e=12+.5*t;Lg[t]=Object.assign({},Sg,{balloonRadius:e,height:2*e})}const Mg=Object.assign({},wg,{balloonRadius:30,shadowBlur:25,dotRadius:3,glyphFontSize:32,glyphImageSize:40,offset:8,style:"balloon",height:66}),Ag=Object.assign({},wg,{radius:4.5,style:void 0,shadowOffsetY:0,shadowBlur:0,shadowColor:"transparent"}),Tg=Object.assign({},wg,{balloonRadius:20,dotRadius:3,glyphFontSize:28,glyphImageSize:30,offset:0,style:"bubble",height:40});class xg extends uo{constructor(t){super(),vg(this,"_balloon",void 0),vg(this,"_animateFromState",void 0),vg(this,"_animationPrevented",void 0),vg(this,"_dot",void 0),vg(this,"_prevTitle",void 0),vg(this,"_prevSubtitle",void 0),vg(this,"annotation",null),vg(this,"_needsLayout",!1),vg(this,"_usingStaticStyle",!1),vg(this,"state",void 0),this.annotation=t,this._balloon=this.addChild(new ug(t)),this._balloon.setDelegate(this)}get position(){return this.annotation.nodePosition()}stringInfo(){return"MarkerAnnotationNode"+("default"!==this.state?"<"+this.state+">":"")}get enablesDefaultGlyphImage(){return this.annotation.enablesDefaultGlyphImage}set enablesDefaultGlyphImage(t){this.annotation.enablesDefaultGlyphImage=t}set needsLayout(t){t&&!this._needsLayout&&ii(this),this._needsLayout=t}get needsLayout(){return this._needsLayout}getParamsFromState(t){const e=this.annotation.isAppStyle,i=e?xg.POIIconParams:xg.Params;if("default"!==t||!this.annotation.n||!e)return i[t];return Lg[Math.min(this.annotation.n,6)]}balloonNodeSize(t){if(!this.annotation.balloonVisible)return new at(0,0);t||(t=this.state);const e=this.getParamsFromState(t);if("callout"===t){const t=e;return new at(2*t.radius,2*t.radius)}const i=e,s=2*i.balloonRadius;return new at(s,i.height+i.offset)}updateAppearance(t){this._balloon.freeze(),t&&(this.needsDisplay=!0)}updateState(t){if(this._usingStaticStyle)return;const e=this.annotation;this.state!==t&&(!e.selected&&"selected"!==this.state&&"callout"!==this.state||!this.state||this._animateFromState||(this._animateFromState=this.state),this.state=t,this.updateSizeAndAppearance())}updateSizeAndAppearance(){this.annotation._node.size=this._size=this._balloon.size=this.balloonNodeSize(),this.updateAppearance(),this.needsLayout=!0}performScheduledUpdate(){this.annotation&&this.updateLayout(!1)}updateLayout(t){this._needsLayout&&(this._layoutSubNodes(t),this._needsLayout=!1)}updateGlyphText(){this.updateAppearance(!0),this._balloon.needsDisplay=!0}updateGlyphImage(t){this.updateAppearance(),this._balloon.glyphImage=t??void 0,this._balloon.needsDisplay=!0}updateSelectedGlyphImage(t){this._balloon.selectedGlyphImage=t??void 0,this._balloon.needsDisplay=!0}glyphImageError(){this.updateAppearance(),this._balloon.glyphImageError(this.state)}animateAppearance(t){const e=this.getParamsFromState(this.state);
2if(this.children.forEach((t=>{this.annotation.isAppStyle||t===this._balloon||Og(t,e)})),!this.annotation.isAppStyle||this.annotation.selected)zg(this._balloon,e,bg,1,new Pe(this._balloon.size.width/2,this._balloon.size.height),void 0,t);else{const i=new Pe(this._balloon.size.width/2,this._balloon.size.height/2);Rg(this._balloon,e,bg,1,i,t)}}fadeInLabels(){const t=this.children.filter((t=>t instanceof hg)),e=this.getParamsFromState(this.state);t.forEach((t=>{Og(t,e)}))}preventAnimation(){this._animationPrevented=!0,this.needsLayout=!0}_layoutSubNodes(t){this.updateAppearance();const e=this.children.slice();this.children=[this._balloon],this._dot&&this.addChild(this._dot);let i=this._balloon.size.width;const s=this.annotation,o=this.state,n=this.getParamsFromState(o),a=s.map&&!this._animationPrevented;delete this._animationPrevented;const r=s&&s.map&&s.map._impl.fontSizeRatio||1,l=(t,i)=>{e.forEach((e=>{e instanceof hg&&e.kind===t&&(this.addChild(e),function(t,e){Pg.add(t),new To.Opacity({node:t,duration:e.transitionDuration,from:1,to:0,done:function(){Pg.delete(t),t.remove()}}).begin()}(e,n))})),delete this[i]};let h=0;const d=(t,e)=>{const o=ng(t,r),l=s[t],d=a&&!!this.parent&&l!==e&&(!l||!e),c=this.annotation.darkColorScheme;return function(t,e,i){t.font=i;const s=e.trim().split(/[\r\n]+/),o=[];for(const e of s){const i=e.split(/[\f\t\v\u0020\u2000-\u200b\u205f\u3000]+/);for(;i.length>0;){const e=[i.shift()];let s=e.join(" ").length;for(;i.length>0&&s<=16;)e.push(i.shift()),s=e.join(" ").length;if(s>16&&e.length>1){const t=e.pop();i.unshift(t)}const n=e.join(" "),a=t.measureText(n),r=a.width+wg.labelWidthPadding;o.push([n,r,a])}}return o}(this.scene?this.scene.contextForMeasurement:Ig(),l,o).forEach((([e,s,o])=>{const a=new hg(e,t,s,o,c,r);i=Math.max(i,s),h=a.lineHeight/2,this.addChild(a),d&&Og(a,n)}),this),l},c="callout"!==o&&"lifted"!==o&&!("default"===o&&s.selected)&&s.labelsCanBeShown(),u=c&&s.titleCanBeShown();u?this._prevTitle=d("title",this._prevTitle):l("title","_prevTitle"),c&&s.subtitleCanBeShown(u)?this._prevSubtitle=d("subtitle",this._prevSubtitle):l("subtitle","_prevSubtitle");let p=this._balloon.size.height;if("callout"===o&&s.isAppStyle){0!==this.children.filter((t=>t instanceof hg)).length&&(p+=this.getParamsFromState("default").balloonRadius)}let m=p,g=0;this.children.forEach((t=>{let e=0;if(t instanceof hg){const i=Math.ceil(t.textAscent-t.fontSize);if(i>0&&(e+=i),g>0){e+=Math.ceil(g)}}t.position=new Pe((i-t.size.width)/2,t instanceof hg?m-t.yMargin+e:0),t instanceof hg&&(m+=t.lineHeight+e,Pg.has(t)||(p+=t.lineHeight+e,h=Math.round(t.lineHeight/2+(t.textDescent>0?t.textDescent:0))),g=t.textDescent)})),s._anchorPoint=new Pe(i/2,this._balloon.size.height+n.anchorPointOffset),s._node.size=this.size=new at(i,p+h),s.updatePosition();const _=s._position.x-s._anchorPoint.x-s._anchorOffset.x,f=this.position.x;if(this.children.forEach((t=>{t.position=new Pe(Ns(_+t.position.x)-f,t.position.y)})),"selected"===o){const t=n;this._dot||(this._dot=this.addChild(new fg(this.annotation,t),1)),this._dot.size=new at(2*t.dotRadius*t.dotScale,2*t.dotRadius*t.dotScale),this._dot.position=new Pe(this._balloon.position.x+t.balloonRadius-t.dotRadius,this._balloon.size.height-2*t.dotRadius),this._dot.transform=(new gi).scale(1/t.dotScale)}else this._dot&&(this._dot.remove(),delete this._dot);if(a&&this._animateFromState){const t=this.getParamsFromState(this._animateFromState);if("callout"===o||"callout"===this._animateFromState){const e=Object.assign({},n);e.transitionDuration/=2;const i=this.addChild(new ug(this.annotation,this._animateFromState));let s;i.setDelegate(this),i.glyphImage=this._balloon.glyphImage,i.selectedGlyphImage=this._balloon.selectedGlyphImage,i.setBalloonStyle(),i.size=this.balloonNodeSize(i.state),this._balloon.transform=(new gi).scale(bg),"callout"===o?(i.position=new Pe((this.size.width-i.size.width)/2,this._balloon.size.height/2-i.size.height-t.anchorPointOffset+4.5),s=new Pe(i.size.width/2,i.size.height+t.anchorPointOffset),Rg(i,e,1,bg,s,(()=>{i.remove();const t=Object.assign({},n);t.transitionDuration/=2,Rg(this._balloon,t,bg,1,new Pe(this._balloon.size.width/2,this._balloon.size.height/2))}
2))):(i.position=new Pe((this.size.width-i.size.width)/2,this._balloon.size.height+n.anchorPointOffset-i.size.height/2-4.5),s=new Pe(i.size.width/2,i.size.height/2),this.annotation.isAppStyle?Rg(i,e,1,bg,s,(()=>{i.remove();const t=new Pe(this._balloon.size.width/2,this._balloon.size.height/2);Rg(this._balloon,n,bg,1,t)})):Rg(i,e,1,bg,s,(()=>{i.remove(),zg(this._balloon,n,bg,1,new Pe(this._balloon.size.width/2,this._balloon.size.height))})))}else{let e,i,a,r=0;if(s.isAppStyle){const s=n;if(e=t.balloonRadius/s.balloonRadius,r=Mg.height-Mg.balloonRadius+Mg.offset,"selected"===o){const t=n;i=new Pe(t.balloonRadius,t.balloonRadius+r/(1-e)),a=new Pe(this._balloon.size.width/2,this._balloon.size.height)}else i=new Pe(s.balloonRadius,s.balloonRadius-r/(1-e))}else e=this.balloonNodeSize(this._animateFromState).height/this.balloonNodeSize().height,i=new Pe(this._balloon.size.width/2,this._balloon.size.height);1!==e&&zg(this._balloon,n,e,1,i,a);const l=this._dot;l&&Og(l,{transitionDuration:n.dotAnimationDuration});let h=0;if(1!==e&&s.isAppStyle&&(h=(e<1?1:-1)*this.getParamsFromState("default").balloonRadius),0!==h){const t=new Pe(0,0),e=new Pe(0,h);this.children.forEach((i=>{i instanceof hg&&function(t,e,i,s){new To.Translation({node:t,duration:e.transitionDuration,from:i,to:s,pop:!0}).begin()}(i,n,e,t)}))}}delete this._animateFromState}t||s.updatedLayout()}}let Eg;yg=xg,vg(xg,"Params",{default:Cg,lifted:Cg,selected:Mg,bubble:Tg,callout:Ag}),vg(xg,"POIIconParams",Object.assign({},yg.Params,{default:Sg,lifted:Sg})),vg(xg,"FeatureVisibility",yt);const Ig=function(){Eg||(Eg=Ft());return Eg.getContext("2d")};function Og(t,e){new To.Opacity({node:t,duration:e.transitionDuration}).begin()}const Pg=new WeakSet;function Rg(t,e,i,s,o,n){new To.Scale({node:t,duration:e.transitionDuration,from:i,to:s,center:o,done:n}).begin()}function zg(t,e,i,s,o,n,a){new To.Float({node:t,duration:e.transitionDuration,from:i,to:s,center:o,floatCenter:n,done:a}).begin()}function Dg(t,e,i){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,i)}function Ng(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function Fg(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Wg(t,e,"set"),i),i}function Ug(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Wg(t,e,"get"))}function Wg(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const Gg={light:"#ff5b40",dark:"#e6523b"},Bg={light:{start:"#fe6fa8",end:"#d70d2e"},dark:{start:"#ff9ea0",end:"#b03a4b"}},Zg={light:"white",dark:"#e7e6e4"},jg={light:"white",dark:"rgba(34, 40, 52, 0.8)"},Kg={light:"white",dark:"black"},Hg=rt({Default:"default",Dot:"dot",Large:"large"});function qg(t){var e,i=new WeakMap;class s extends t{constructor(e,s,o){super(e,s,t.div,o),Ng(this,"_sceneGraphNode",null),Ng(this,"_calloutWithSelectedState",!1),Ng(this,"_labelOccluded",!1),Ng(this,"isLoadingIconMetadata",!1),Ng(this,"_labelRect",void 0),Ng(this,"_anchorPointWithLabel",void 0),Dg(this,i,{writable:!0,value:!0}),Ng(this,"_glyph",void 0),Ng(this,"_glyphImageElement",void 0),Ng(this,"_selectedGlyphImageElement",void 0),Ng(this,"_glyphImageElementLoader",void 0),Ng(this,"_selectedGlyphImageElementLoader",void 0),Ng(this,"_staticStyle",void 0),Ng(this,"useSquareBalloon",void 0)}init(){this._sceneGraphNode=new xg(this);try{super.init()}catch(t){throw this._sceneGraphNode.annotation=null,t}this.updateGlyph(),this._setBalloonStyle(),this._userSetSize=!0,this._calloutWithSelectedState||(this._calloutAnchorPoint=new window.DOMPoint(-xg.Params.callout.radius,1));const t=this.selected?this.canShowCallout()?this.selectedStateForSceneGraphNode():"selected":"default";this._sceneGraphNode.updateState(t)}get size(){return{width:this._sceneGraphNode.size.width,height:this._sceneGraphNode.size.height}}set size(t){console.warn("[MapKit] The `size` property of a marker annotation cannot be set.")}get color(){return null!==this._color?this._color:this.map?Gg[this.map._impl.currentColorScheme]:Gg.light}set color(t){null!==t&&S(t,"string","[MapKit] Expected a string value for MarkerAnnotation.color, but got `"+t+"` instead"),t!==this._color&&(this._color=t,this._sceneGraphNode.updateAppearance(!0),this._drawCalloutAccessory())}
2get selectedFillColor(){return this.color}get fillColor(){return this.color}get gradientColors(){return null!==this._color?null:this.map?Bg[this.map._impl.currentColorScheme]:Bg.light}get fillWithGradient(){return!0}get selectedStrokeColor(){return this.defaultStrokeColor}get strokeColor(){return this.defaultStrokeColor}get defaultStrokeColor(){return this.map?this.isPlaceStyle?jg[this.map._impl.tint]:jg[this.map._impl.currentColorScheme]:jg.light}get glyphColor(){return null!==this._glyphColor?this._glyphColor:this.map?this.isPlaceStyle?Kg[this.map._impl.tint]:Zg[this.map._impl.currentColorScheme]:Zg.light}set glyphColor(t){null!==t&&S(t,"string","[MapKit] Expected a string value for MarkerAnnotation.glyphColor, but got `"+t+"` instead"),t!==this._glyphColor&&(this._glyphColor=t,this._sceneGraphNode.updateAppearance(!0),this._drawCalloutAccessory())}get glyphImage(){return this._glyphImage}set glyphImage(t){this._setGlyphImage("_glyphImage","updateGlyphImage",t)}get selectedGlyphImage(){return this._selectedGlyphImage}set selectedGlyphImage(t){this._setGlyphImage("_selectedGlyphImage","updateSelectedGlyphImage",t)}updateGlyphImages(){this._setGlyphImage("_glyphImage","updateGlyphImage",this._glyphImage),this._setGlyphImage("_selectedGlyphImage","updateSelectedGlyphImage",this._selectedGlyphImage)}get glyphText(){return this._glyphText}
2set glyphText(t){S(t,"string","[MapKit] Expected a string value for MarkerAnnotation.glyphText, but got `"+t+"` instead"),t!==this._glyphText&&(this._glyphText=t,this.updateLocalizedText(),this.updateGlyph(),this._sceneGraphNode.updateGlyphText(),this._drawCalloutAccessory())}get glyph(){return this._glyph}get titleVisibility(){return this._titleVisibility}set titleVisibility(t){if(!C(t,xg.FeatureVisibility))throw new Error("[MapKit] Expected one of Hidden, Visible or Adaptive for MarkerAnnotation.titleVisibility");t!==this._titleVisibility&&(this._titleVisibility=t,this._sceneGraphNode.needsLayout=!0)}get subtitleVisibility(){return this._subtitleVisibility}set subtitleVisibility(t){if(!C(t,xg.FeatureVisibility))throw new Error("[MapKit] Expected one of Hidden, Visible or Adaptive for MarkerAnnotation.subtitleVisibility");t!==this._subtitleVisibility&&(this._subtitleVisibility=t,this._sceneGraphNode.needsLayout=!0)}get labelOccluded(){return this._labelOccluded}set labelOccluded(t){this._labelOccluded!==t&&(this._sceneGraphNode.needsLayout=!0),this._labelOccluded=t}labelsCanBeShown(){return!!this.delegate&&this.delegate.supportsLabelRegions()}titleCanBeShown(){return!(!this.title||this.labelOccluded||this._titleVisibility===xg.FeatureVisibility.Hidden)}subtitleCanBeShown(t){return!(!this.subtitle||this.labelOccluded||!(this._subtitleVisibility===xg.FeatureVisibility.Visible||this._subtitleVisibility===xg.FeatureVisibility.Adaptive&&(this._public.memberAnnotations||this.selected&&t)))}updateLayout(t,e){!e&&t||(this._sceneGraphNode.needsLayout=!0),(e||t)&&this._sceneGraphNode.updateLayout(t)}updatedLayout(){this._updatedProperty("")}calculateNodePosition(){return new Pe(Ns(this._position.x-this._anchorPoint.x-this._anchorOffset.x),this._position.y-this._anchorPoint.y-this._anchorOffset.y)}animateOcclusion(){if(!this.isLoadingIconMetadata)return super.animateOcclusion()}get darkColorScheme(){return!!this.map&&$s(this.map._impl.mapNodeTint)}get isAppStyle(){return!!(this._glyphImage&&this._glyphImage.isPOIIcon||this._selectedGlyphImage&&this._selectedGlyphImage.isPOIIcon)}get isPlaceStyle(){return this.isAppStyle}get balloonVisible(){return!0}iconRect(){const t=this.nodePosition(),e=this._sceneGraphNode._balloon.position,i=this._sceneGraphNode._balloon.size;return new ze(t.x+e.x,t.y+e.y,i.width,i.width)}labelRect(){if(!this._labelRect){const t=this._sceneGraphNode.children.filter((t=>t instanceof hg)).map((t=>new ze(t.position.x,t.position.y,t.size.width,t.size.height)));this._labelRect=t.length?ze.unionOfRects(t):new ze(0,0,0,0),this._anchorPointWithLabel=this._anchorPoint.copy()}const t=new Pe(Ns(this._position.x-this._anchorPointWithLabel.x-this._anchorOffset.x),this._position.y-this._anchorPointWithLabel.y-this._anchorOffset.y);return new ze(t.x+this._labelRect.origin.x,t.y+this._labelRect.origin.y,this._labelRect.size.width,this._labelRect.size.height)}get warnOnUnselectedGlyphImageAccess(){return!1}
2get enablesDefaultGlyphImage(){return Ug(this,i)}set enablesDefaultGlyphImage(t){t!==Ug(this,i)&&(Fg(this,i,t),t&&this._sceneGraphNode?.updateAppearance())}setDelegate(t){super.setDelegate(t),this.labelsCanBeShown()&&this._updatedProperty("title")}doesAnimate(){return this._animates}willMoveToMap(t){this._isMoving=t&&this.animates}didMoveToMap(){const t=this._isMoving;if(super.didMoveToMap(),this.isLoadingIconMetadata)return this._sceneGraphNode.opacity=0,void(this._isMoving=t);this.animateAppearance(t)}animateAppearance(t,e=!1){this.delegate&&t&&this.visible&&!this._appearanceAnimation&&this._shown?(this._isAnimating=!0,this._sceneGraphNode.animateAppearance((t=>{t.node.annotation.finishedAnimating()})),e&&this._sceneGraphNode.fadeInLabels()):this._sceneGraphNode.preventAnimation()}iconMetadataLoaded(){this.isLoadingIconMetadata&&(this.isLoadingIconMetadata=!1,this._sceneGraphNode.updateAppearance(),this._sceneGraphNode.opacity=1,this.animateAppearance(this._isMoving,!0),delete this._isMoving)}lift(){this._sceneGraphNode.updateState("lifted"),super.lift()}droppedAfterLift(){this._sceneGraphNode.updateState("default"),super.droppedAfterLift()}canShowCallout(){return(!!this.callout||!!this.delegate&&!this.delegate.supportsLabelRegions())&&super.canShowCallout()}centerOffsetForSelectionAccessory(){return new Pe(-this._node.size.width/2,-xg.Params.selected.balloonRadius)}selectedStateForSceneGraphNode(){return this.selectionAccessory||this._calloutWithSelectedState?"selected":"callout"}selectionAccessoryWillAppear(t){const e=t?this.selectedStateForSceneGraphNode():"selected";this.isStable()&&this._sceneGraphNode.updateState(e)}selectionAccessoryWillDisappear(){this.selected||(delete this._calloutAccessoryNode,this._sceneGraphNode.updateState("default"))}canvasForCalloutAccessory(){if(!this.callout||this.selectionAccessory||!(this.callout.calloutElementForAnnotation||this.callout.calloutContentForAnnotation||this.callout.calloutLeftAccessoryForAnnotation||this.callout.calloutRightAccessoryForAnnotation))return this._calloutAccessoryNode||(this._calloutAccessoryNode=new eg(this,xg.Params.bubble),this._calloutAccessoryNode.glyphImage=this._sceneGraphNode._balloon.glyphImage,this._calloutAccessoryNode.selectedGlyphImage=this._sceneGraphNode._balloon.selectedGlyphImage,this._calloutAccessoryNode.glyphText=this._glyphText,this._drawCalloutAccessory()),this._calloutAccessoryNode.getLayer();delete this._calloutAccessoryNode}get ignoreCalloutCornerRadiusForLeftAccessory(){return!0}altText(){return super.altText()||Nn.get("Annotation.Marker.AccessibilityLabel")}resetNodeTransform(){this.sceneGraphNode.transform=new gi}updateGlyph(){this._glyph=this.glyphText||(this._glyphImageElement?this._glyphImageElement.src:"")}get staticStyle(){return this._staticStyle}set staticStyle(t){let e;switch(t){case Hg.Dot:e="callout";break;case Hg.Large:e="selected";break;default:t=Hg.Default,e="default"}this._staticStyle=t,this._sceneGraphNode.updateState(e),this._sceneGraphNode._usingStaticStyle=!0}loadGlyphImage(t,e,i,s){wm(s,(o=>{if(this[e]===s)return o?void function(t,e,i,s){const o=`${i}Loader`;t[o]&&t[o].unschedule();if(t[o]=new Sh(St.Highest,{urlForImageLoader:e,loaderDidSucceed:function(e){t[o]===e&&(delete t[o],t[i]=e.image??void 0,t.updateGlyph(),t._sceneGraphNode[s](e.image),t._calloutAccessoryNode&&(t._calloutAccessoryNode[s](e.image),t._drawCalloutAccessory()))},loaderDidFail:function(e){t[o]===e&&(delete t[o],delete t[i],t.updateGlyph(),t._sceneGraphNode[s](null),t._calloutAccessoryNode&&(t._calloutAccessoryNode[s](null),t._drawCalloutAccessory()))}}),t.isGlyphImageInternal){const i=!Oe.customMadabaUrl&&Oe.urlWithCredentials(e);t[o].crossOrigin=ra(i)}t[o].schedule()}(this,o.glyphImageUrl,t,i):(delete this[t],this._sceneGraphNode.glyphImageError(),void(this._calloutAccessoryNode&&this._calloutAccessoryNode.glyphImageError("_selectedGlyphImage"===e?"selected":"default")))}))}_setBalloonStyle(){this.useSquareBalloon=!(!this._glyphImage||!this._glyphImage.useSquareBalloon)||!(!this._selectedGlyphImage||!this._selectedGlyphImage.useSquareBalloon),this._sceneGraphNode._balloon.setBalloonStyle()}_setGlyphImage(t,e,i){null!=i&&S(i,"object","[MapKit] Expected a hash value or an Image delegate for MarkerAnnotation."+t.replace(/^_/,"")+", but got `"+String(i)+"` instead"),this[t]=i;const s=`${t}Element`;if(this._setBalloonStyle(),!i){delete this[s];const t=`${s}Loader`;return this[t]&&(this[t].unschedule(),delete this[t]),this._sceneGraphNode[e](null),void(this._calloutAccessoryNode&&(this._calloutAccessoryNode[e](null),this._drawCalloutAccessory()))}this.loadGlyphImage(s,t,e,i)}
2_updatedProperty(t){"title"!==t&&"subtitle"!==t||(this._labelRect=void 0,this._anchorPointWithLabel=void 0,this._sceneGraphNode&&(this._sceneGraphNode.needsLayout=!0)),super._updatedProperty(t)}_drawCalloutAccessory(){this._calloutAccessoryNode&&this._calloutAccessoryNode.draw()}}return e=s,Ng(s,"StaticStyles",Hg),e.prototype._animates=!0,e.prototype._glyphImage=null,e.prototype._selectedGlyphImage=null,e.prototype._glyphText="",e.prototype._color=null,e.prototype._glyphColor=null,e.prototype._titleVisibility=xg.FeatureVisibility.Adaptive,e.prototype._subtitleVisibility=xg.FeatureVisibility.Adaptive,e.prototype.shouldHideLabels=!0,e.prototype.renderedByDOMElement=!1,e.prototype.isGlyphImageInternal=!1,e.prototype.ConstructorOptions=Object.freeze(Object.assign({},t.prototype.ConstructorOptions,{color:"rw",glyphColor:"rw",glyphImage:"rw",selectedGlyphImage:"rw",glyphText:"rw",titleVisibility:"rw",subtitleVisibility:"rw",_calloutWithSelectedState:"rw"})),Ng(s,"DefaultColor",Gg),s}qg.StaticStyles=Hg,qg.DefaultColor=Gg,qg.DefaultStrokeColor=jg,qg.DefaultGlyphColor=Zg;const Vg=qg(om);class Yg extends Vg{}const Xg=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);class $g extends Yg{constructor(t,e,i,s){var o,n,a;super(t,e,s),a=void 0,(n="_memberAnnotations")in(o=this)?Object.defineProperty(o,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[n]=a,this._memberAnnotations=i}get memberAnnotations(){return this._memberAnnotations}get n(){return this._memberAnnotations.length}get title(){return Xg(this,"_title")?this._title:this._topAnnotation.title}set title(t){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(om.prototype),"title").set.call(this,t)}get subtitle(){const t=this.n-1;return Xg(this,"_subtitle")?this._subtitle:Nn.get("Annotation.Clustering.More"+(t>1?".Plural":""),{n:Nn.digits(t)})}set subtitle(t){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(om.prototype),"subtitle").set.call(this,t)}get glyphText(){return Xg(this,"_glyphText")?this._glyphText:Xg(this,"_glyphImage")||Xg(this,"_selectedGlyphImage")?"":Nn.digits(this.n)}set glyphText(t){Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Yg.prototype),"glyphText").set.call(this,t)}get draggable(){return!1}set draggable(t){}get displayPriority(){return this._topAnnotation.displayPriority}set displayPriority(t){}get clusteringIdentifier(){return this._topAnnotation.clusteringIdentifier}set clusteringIdentifier(t){}get _topAnnotation(){return this._memberAnnotations[0]}get _showDefaultAltText(){return Xg(this,"_glyphText")||Xg(this,"_glyphImage")||Xg(this,"_selectedGlyphImage")}get isAppStyle(){return!!this._topAnnotation._impl.isAppStyle}get isPlaceStyle(){const t=this.isAppStyle;return t||!1}updateLocalizedText(){super.updateLocalizedText(),this.updateGlyph(),this._sceneGraphNode.updateAppearance(!0)}altText(){return this._showDefaultAltText?super.altText():this.title?Nn.get("Annotation.Clustering.AccessibilityLabel",{n:this.glyphText,title:this.title,subtitle:this.subtitle}):Nn.get("Annotation.Clustering.NoTitle.AccessibilityLabel",{n:this.glyphText,subtitle:this.subtitle})}}class Jg extends am{constructor(t,e){super(t,om.div),new.target===Jg&&(Object.defineProperty(this,"_impl",{value:new Yg(this,t,e)}),this._impl.init())}get size(){return this._impl.size}set size(t){this._impl.size=t}get color(){return this._impl.color}set color(t){this._impl.color=t}get glyphColor(){return this._impl.glyphColor}set glyphColor(t){this._impl.glyphColor=t}get glyphImage(){return this._impl.glyphImage}set glyphImage(t){this._impl.glyphImage=t}get selectedGlyphImage(){return this._impl.selectedGlyphImage}set selectedGlyphImage(t){this._impl.selectedGlyphImage=t}get glyphText(){return this._impl.glyphText}set glyphText(t){this._impl.glyphText=t}get titleVisibility(){return this._impl.titleVisibility}set titleVisibility(t){this._impl.titleVisibility=t}get subtitleVisibility(){return this._impl.subtitleVisibility}set subtitleVisibility(t){this._impl.subtitleVisibility=t}}class Qg extends Jg{constructor(t,e,i){super(t),Object.defineProperty(this,"_impl",{value:new $g(this,t,e,i)}),this._impl.init()}get memberAnnotations(){return this._impl.memberAnnotations}}const t_=function(){throw new TypeError("[MapKit] ClusterAnnotation may not be constructed.")};Qg.prototype.constructor=t_,t_.prototype=Qg.prototype;function e_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const i_=Oe.performanceMarkers.frameUpdates;class s_{constructor(t){e_(this,"_annotationsController",void 0),e_(this,"_cluster
2s",void 0),e_(this,"_previousClusters",void 0),e_(this,"_previousOverlaps",void 0),e_(this,"_previousAnnotations",void 0),e_(this,"_frameCounter",void 0),e_(this,"_locked",void 0),e_(this,"_annotations",void 0),e_(this,"_zoomLevel",void 0),e_(this,"_rotation",void 0),e_(this,"_changesSinceLastCollision",void 0),e_(this,"_previousZoomLevel",void 0),e_(this,"_previousRotation",void 0),e_(this,"_overlaps",void 0),this._annotationsController=t,this._clusters=[],this._previousClusters=[],this._previousOverlaps=[],this._previousAnnotations=[],this._frameCounter=0}collideAnnotations(t,e,i,s){this._locked||(this._annotations=t,this._zoomLevel=e,this._rotation=i,this._changesSinceLastCollision=s||this._changesSinceLastCollision,ii(this))}setRequiredClusterAnnotationProperties(t,e){return t!==e&&(t||(t=e),t.coordinate=e.coordinate,t.draggable=!1,t.displayPriority=e.memberAnnotations[0].displayPriority,t.clusteringIdentifier=e.memberAnnotations[0].clusteringIdentifier,t._impl.memberAnnotations=e.memberAnnotations),t.animates=e.memberAnnotations.some((t=>!t._impl.wasCollided)),t.selected=!1,t}removedAnnotation(t){t.memberAnnotations||(this._previousClusters=this._previousClusters.filter((e=>{if(!e.memberAnnotations.includes(t))return!0;this._annotationsController.removeAnyItem(e)})))}mapWasDestroyed(){this._annotationsController=null}performScheduledUpdate(){const t=i_?performance.now():void 0;if(!this._annotationsController)return;if(this._frameCounter=(this._frameCounter+1)%10,1!==this._frameCounter)return void si(this);const e=this._needsUpdate();if(!e)return;this._changesSinceLastCollision=!1,this._previousZoomLevel=this._zoomLevel,this._previousRotation=this._rotation,this._previousAnnotations=this._annotations.slice(),this._locked=!0,this._annotationsController.willUpdateCollisions(),"region"===e&&this._annotationsController.deselectClusterAnnotation(),this._overlaps=[];let i=0;for(let t=0,e=this._annotations.length;t<e;++t){const e=this._annotations[t];if(e._impl.needsLayout)return this._frameCounter=0,this._locked=!1,void si(this);e._impl.index=t,e._impl.occluded=!1,e._impl.previousCluster=e._impl.cluster,delete e._impl.cluster,e._impl.collisionMode!==am.CollisionMode.None&&(e._impl.boundingBox=r_(e),i=Math.max(i,e._impl.boundingBox.x2-e._impl.boundingBox.x1))}const s=this._annotations.sort(a_),o={};s.forEach((t=>{if(t.selected||t._impl.collisionMode===am.CollisionMode.None)return;const e=t.clusteringIdentifier;e&&(o[e]?o[e].push(t):o[e]=[t])}));const n=this._clusters;this._clusters=[];for(const t in o)o[t].length>1&&(i=this._clusterAnnotationsWithMaxWidth(o[t],i));n.forEach((t=>{this._clusters.includes(t)||(c_(t,!0),t.selected&&(t.selected=!1))})),this._collideAnnotationsAndClusters(s,i),this._collideAnnotationLabels([...s,...this._clusters]),this._previousOverlaps=this._overlaps,this._annotationsController.didUpdateCollisions(),this._locked=!1,i_&&performance.measure("mapkit-map-collision",{start:t})}_clusterAnnotationsWithMaxWidth(t,e){for(let i=0;i<t.length;){const s=t[i];if(s._impl.cluster){++i;continue}const o=s._impl.boundingBox.x2;let n=[s],a=i+1,r=t[a];if(s.memberAnnotations&&i>0){const o=s._impl.boundingBox.x1-e;for(a=i-1,r=t[a];a>0&&r._impl.boundingBox.x1>=o;)a-=1,r=t[a]}for(;a<t.length&&(r=t[a],r._impl.boundingBox.x1<=o);++a){const t=r;!t._impl.cluster&&a!==i&&this._annotationsOverlapExcludingSelected(s,t)&&n.push(t)}if(n.length>1){n=n.reduce(((t,e)=>(e.memberAnnotations?(t=t.concat(e.memberAnnotations),e._impl.cluster=!0,c_(e,!0)):t.push(e),t)),[]).sort(n_);const s=this._clusterAnnotationForMemberAnnotations(n);let o;for(s._impl.occluded=!1,s._impl.collisionMode!==am.CollisionMode.None&&(s._impl.boundingBox=r_(s),e=Math.max(e,s._impl.boundingBox.x2-s._impl.boundingBox.x1)),delete s._impl.cluster,a=0;a<n.length;++a)o=n[a],o._impl.occluded=!0,o._impl.cluster=s;for(a=0,o=t[a];a<t.length&&o._impl.boundingBox&&s._impl.boundingBox&&o._impl.boundingBox.x1<s._impl.boundingBox.x1;)a+=1,o=t[a];t.splice(a,0,s),i=Math.min(i+1,a)}else++i}return t.forEach((t=>{t.memberAnnotations&&!t._impl.cluster&&(this._clusters.push(t),t.map||this._annotationsController.addItem(t))})),e}_collideAnnotationsAndClusters(t,e){let i=!1;const s=[];
2for(let e=0,o=0,n=t.length,a=this._clusters.length;e<n||o<a;){const n=t[e],a=this._clusters[o];n?n._impl.cluster||n._impl.collisionMode===am.CollisionMode.None?++e:a&&a._impl.boundingBox&&n._impl.boundingBox&&a._impl.boundingBox.x1<n._impl.boundingBox.x1?(a._impl.isRequired()||(i=!0),s.push(a),++o):(n._impl.isRequired()||(i=!0),s.push(n),++e):(a._impl.isRequired()||(i=!0),s.push(a),++o)}i&&this._collideAnnotationsWithMaxWidth(s,e)}_collideAnnotationsWithMaxWidth(t){const e=[];for(let i=0,s=t.length;i<s;++i){const o=t[i],n=o._impl.boundingBox.x2;for(let a=i+1;a<s;++a){const i=t[a];if(i._impl.boundingBox.x1>n)break;if((!o._impl.isRequired()||!i._impl.isRequired())&&this._annotationsOverlap(o,i)){const t=o_(o,i);e.push(t<0?[o,i]:[i,o])}}}e.sort(((t,e)=>o_(t[0],e[0]))).forEach((t=>{t[0]._impl.occluded||(t[1]._impl.occluded=!0)}))}_annotationsOverlapExcludingSelected(t,e){return!t.selected&&!e.selected&&this._annotationsOverlap(t,e)}_annotationsOverlap(t,e){if(t._impl.isLifted()||e._impl.isLifted())return!1;const i=[t,e];let s;for(let t=0,e=this._previousOverlaps.length;t<e&&!s;++t){const e=this._previousOverlaps[t];e[0]===i[0]&&e[1]===i[1]&&(s=e)}const o=function(t,e,i){let s=t._impl.boundingBox,o=e._impl.boundingBox;i&&(s=l_(s),o=l_(o));return d_(s,o)}(t,e,!!s);return o&&this._overlaps.push(i),o}_clusterAnnotationForMemberAnnotations(t){let e;const i=function(t,e){for(let i=0,s=t.length;i<s;++i){const s=t[i],o=e.length;if(s.memberAnnotations.length===o){let t=0;for(;t<o&&e[t]===s.memberAnnotations[t];)t+=1;if(t===o)return i}}return-1}(this._previousClusters,t);if(i>=0)e=this._previousClusters[i],e._impl.resetNodeTransform();else{const i=function(t){let e=0,i=0,s=0;t.forEach((t=>{e+=t.coordinate.latitude;const o=B(t.coordinate.longitude)/180*Math.PI;i+=Math.cos(o),s+=Math.sin(o)}));const o=t.length,n=e/o,a=0===i?s<0?-90:90:180*Math.atan(s/i)/Math.PI+(i<0?180:0);return new tt(n,a)}(t);e=this._annotationsController.addCluster(new Qg(i,t)),this._previousClusters.push(e)}return e}_collideAnnotationLabels(t){for(const e of t){if(e._impl.collisionMode===am.CollisionMode.None){e._impl.labelOccluded=!1;continue}const i=e._impl.boundingBox;if(e._impl.occluded){e._impl.labelOccluded="labelBoundingBox"in i&&!!i.labelBoundingBox;continue}if(!("labelBoundingBox"in i)||!i.labelBoundingBox){e._impl.labelOccluded=!1;continue}const s=l_(i.labelBoundingBox);let o=!1;for(const i of t){if(e===i)continue;if(e._impl.occluded||i._impl.occluded||i._impl.collisionMode===am.CollisionMode.None)continue;if(d_(s,"iconBoundingBox"in i._impl.boundingBox&&i._impl.boundingBox.iconBoundingBox?i._impl.boundingBox.iconBoundingBox:i._impl.boundingBox)){o=!0;break}if("labelBoundingBox"in i._impl.boundingBox&&i._impl.boundingBox.labelBoundingBox&&!i._impl.labelOccluded&&d_(s,l_(i._impl.boundingBox.labelBoundingBox))){o=!0;break}}e._impl.labelOccluded=o}}_needsUpdate(){if(this._zoomLevel!==this._previousZoomLevel||this._rotation!==this._previousRotation)return"region";if(this._changesSinceLastCollision)return"annotations";const t=this._annotations.length;if(this._previousAnnotations.length!==t)return"annotations";for(let e=0;e<t;++e)if(this._annotations[e]!==this._previousAnnotations[e])return"annotations";return""}}function o_(t,e){if(t===e)return 0;const i=am.DisplayPriority.Required,s=t.selected?i:t.displayPriority,o=(e.selected?i:e.displayPriority)-s;return o||e._impl.index-t._impl.index}function n_(t,e){const i=e.displayPriority-t.displayPriority;return i||t._impl.index-e._impl.index}function a_(t,e){return t._impl.collisionMode===am.CollisionMode.None||e._impl.collisionMode===am.CollisionMode.None?0:t._impl.boundingBox.x1-e._impl.boundingBox.x1}function r_(t){const e=t._impl.node,i=t._impl.nodePosition(),s=t.padding,o=e.size,n=o.width,a=o.height,r=i.x+s.left,l=i.x+n-s.right,h=i.y+s.top,d=i.y+a-s.bottom;if(t._impl.isAppStyle&&!t.selected){const e=t._impl.iconRect(),i=t._impl.labelRect(),s=Math.min(e.size.width,e.size.height)/2;return{boundType:"circle",x1:e.origin.x,x2:e.origin.x+e.size.width,y1:e.origin.y,y2:e.origin.y+e.size.height,cx:e.origin.x+e.size.width/2,cy:e.origin.y+e.size.height/2,r:s/2,padding:0,iconBoundingBox:{boundType:"circle",x1:e.origin.x,x2:e.origin.x+e.size.width,y1:e.origin.y,y2:e.origin.y+e.size.height,cx:e.origin.x+e.size.width/2,cy:e.origin.y+e.size.height/2,r:s,padding:0},labelBoundingBox:{boundType:"rect",x1:i.origin.x,x2:i.origin.x+i.size.width,y1:i.origin.y,y2:i.origin.y+i.size.height,padding:1}}}return t._impl.collisionMode===am.CollisionMode.Circle?{boundType:"circle",x1:r,x2:l,y1:h,y2:d,cx:(r+l)/2,cy:(h+d)/2,r:Math.min(n,a)/2,padding:5}:{boundType:"rect",x1:r,x2:l,y1:h,y2:d,padding:5}}function l_(t){switch(t.boundType){case"circle":return{boundType:t.boun
2dType,x1:t.x1-t.padding,x2:t.x2+t.padding,y1:t.y1-t.padding,y2:t.y2+t.padding,cx:t.cx,cy:t.cy,r:t.r+t.padding,padding:0};case"rect":return{boundType:t.boundType,x1:t.x1-t.padding,x2:t.x2+t.padding,y1:t.y1-t.padding,y2:t.y2+t.padding,padding:0}}}function h_(t,e){const i=t.cx-w(t.cx,e.x1,e.x2),s=t.cy-w(t.cy,e.y1,e.y2);return i*i+s*s<=t.r*t.r}function d_(t,e){if(!(e.x2>=t.x1&&e.x1<=t.x2&&e.y2>=t.y1&&e.y1<=t.y2))return!1;if("circle"===t.boundType){if("circle"===e.boundType){const i=t.cx-e.cx,s=t.cy-e.cy,o=Math.sqrt(i*i+s*s);return t.r+e.r>=o}return h_(t,e)}return"circle"!==e.boundType||h_(e,t)}function c_(t,e){t._impl.occluded=e,t._impl.updateVisibility(e)}const u_=rt({PointOfInterest:"PointOfInterest",Territory:"Territory",PhysicalFeature:"PhysicalFeature"}),p_=function(t,e){e=e||ri.Light;const i=t===dt.Hybrid||t===dt.Satellite?ct.Hybrid:ct.Standard;i===ct.Hybrid&&(e=ri.Light);return{iconStyle:i,tint:e,emphasis:t===dt.MutedStandard?ft.Muted:ft.Standard}};for(xe.prototype.appendServiceAuthOptions=function(t){return this.appendAuthOptions(t)},xe.prototype._checkJwtToken=Ie;Oe._jwtTokensToCheck.length;){const t=Oe._jwtTokensToCheck.shift();Oe._checkJwtToken?.(t)}function m_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class g_{constructor(){m_(this,"_requests",{}),m_(this,"_types",{}),m_(this,"_counter",1)}add(t,e){const i=this._counter;return this._counter+=1,this._requests[i]=t,this._types[i]=e,i}get(t){return this._requests[t]}typeForId(t){return this._types[t]}idsByType(t){return Object.keys(this._requests).filter((e=>this._types[parseInt(e)]===t)).map((t=>parseInt(t)))}remove(t){return!!this.get(t)&&(delete this._requests[t],delete this._types[t],!0)}}function __(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const f_={enableHighAccuracy:!1,timeout:8e3,maximumAge:9e5};class y_{constructor(t,e={}){__(this,"_name",void 0),__(this,"_configFailed",void 0),__(this,"_requestMap",void 0),__(this,"_getsUserLocation",!1),__(this,"_language",null),__(this,"_watchingConfiguration",!1),this._name=t,this._requestMap=new g_,Oe.state===Oe.States.ERROR&&(this._configFailed=!0),this.language=e.language??null,void 0!==e.getsUserLocation&&(this.getsUserLocation=!!e.getsUserLocation)}get getsUserLocation(){return this._getsUserLocation}set getsUserLocation(t){this._getsUserLocation=!!t}get language(){return this._language}set language(t){this._language=null==t?null:this._bestLanguage(t)}cancel(t){k(t,"[MapKit] Missing `id` in call to `"+this._name+".cancel()`."),S(t,"number","[MapKit] `id` passed to `"+this._name+".cancel()` is not a number.");const e=this._requestMap.typeForId(t);if(e)switch(e){case"query":case"geo":return this._requestMap.remove(t);case"xhr":{const e=this._requestMap.get(t);if(e)return e.unschedule(),this._requestMap.remove(t);break}default:throw new Error("Unknown type: "+e)}return!1}handleEvent(t){switch(t.type){case Oe.Events.Error:this._configFailed=!0;case Oe.Events.Changed:this._requestMap.idsByType("query").forEach((t=>{const e=this._requestMap.get(t);this._send(e.path,e.parameters,e.callback,e.transform,e.name),this._requestMap.remove(t)}))}0===this._requestMap.idsByType("query").length&&this._stopWatchingConfiguration()}_watchConfiguration(){this._watchingConfiguration||(this._watchingConfiguration=!0,Oe.addEventListener(Oe.Events.Changed,this),Oe.addEventListener(Oe.Events.Error,this))}_stopWatchingConfiguration(){this._watchingConfiguration&&(this._watchingConfiguration=!1,Oe.removeEventListener(Oe.Events.Changed,this),Oe.removeEventListener(Oe.Events.Error,this))}_logNetworkEvent(t,e){let i;switch(t){case"search":i=yn.Events.Search;break;case"autocomplete":i=yn.Events.SearchAC;break;case"placeLookup":i=yn.Events.PlaceLookup;break;case"geocode":i=yn.Events.ForwardGeocoder;break;case"reverseGeocode":i=yn.Events.ReverseGeocoder;break;case"directions":i=yn.Events.Directions;break;case"nearbyPoi":i=yn.Events.PointsOfInterestSearch;break;default:return}yn.log(i,e)}_send(e,i,s,o,n){const a=this._requestMap;if(!Oe.apiBaseUrl||Oe.state===Oe.States.PENDING)return this._configFailed?(setTimeout((()=>{jt(s,null,[new Error("MapKit failed to initialize.")])}
2)),0):(this._watchConfiguration(),a.add({path:e,parameters:i,callback:s,transform:o,name:n},"query"));let r;r=0===e.search(/\/v?[0-9]+\//)?Oe.apiBaseUrl.replace(/\/v?[0-9]+\//,"")+e:Oe.apiBaseUrl+e,(i=i||{}).mkjsVersion=t.version;const l=new URLSearchParams;for(const[t,e]of Object.entries(i))e&&l.append(t,e);const h=l.toString();""!==h&&(r+=(e.includes("?")?"&":"?")+h);const d={loaderDidSucceed:(t,e)=>{if(this._logNetworkEvent(n,{responseCode:e.status}),a.remove(p),e.status<200||e.status>=300){let t;try{t=JSON.parse(e.responseText)}catch{return void jt(s,null,[new Error("HTTP error: "+e.status)])}return void(t?.error?.message?(/categor(y|ies)/i.test(t.error.message)&&console.warn("[MapKit] The version of MapKit may be deprecated."),jt(s,null,[new Error("HTTP error: "+e.status+". Message: "+t.error.message+".")])):jt(s,null,[new Error("HTTP error: "+e.status)]))}let r;try{r=JSON.parse(e.responseText)}catch{return void jt(s,null,[new Error("Failed to parse response: "+e.responseText)])}jt(s,null,[null,o(i,r)])},loaderDidFail:(t,e)=>{this._logNetworkEvent(n,{responseCode:e.status}),a.remove(p);let i=Oe.ErrorStatus.Unknown;0===e.status?i=Oe.ErrorStatus.NetworkError:e.status===Oe.HTTP.UNAUTHORIZED?i=Oe.ErrorStatus.Unauthorized:e.status===Oe.HTTP.TOO_MANY_REQUESTS?i=Oe.ErrorStatus.TooManyRequests:e.status===Oe.HTTP.BAD_REQUEST&&(i=Oe.ErrorStatus.BadRequest),jt(s,null,[new Error(i)])}},c=Oe.appendServiceAuthOptions?.({});c.withCredentials=Oe.urlWithCredentials(r);const u=new Gt(r,d,c);u.schedule();const p=a.add(u,"xhr");return p}_sendImmediatelyOrWithUserLocation(t,e,i,s,o){return this.getsUserLocation?this._sendWithUserLocation(t,e,i,s,o):this._send(t,e,i,s,o)}_sendWithUserLocation(t,e,i,s,o){const n=this._requestMap.add({path:t,parameters:e,callback:i,transform:s,name:o},"geo");return this._locate(((t,e)=>{const i=this._requestMap.get(n);i&&(t?console.warn("[MapKit] Unable to get current location:",t.message):i.parameters.userLocation=`${e.latitude},${e.longitude}`,this._send(i.path,i.parameters,i.callback,i.transform,i.name),this._requestMap.remove(n))})),n}_checkOptions(t,e){S(t,"object","[MapKit] The `options` object is invalid."),Object.keys(t).forEach((t=>{e.includes(t)||console.warn("[MapKit] `"+t+"` is not a valid option.")}))}
2_bestLanguage(t){S(t,"string","[MapKit] `language` is not a string."),"zh"===t.toLowerCase()&&(console.warn("[MapKit] `zh` is an ambiguous language ID. Please specify a script or reginal variant: `zh-Hans`, `zh-Hant`, or `zh-HK`."),Oe.countryCode&&(t="zh-"+Oe.countryCode));const e=Qt.bestMatch(t);return null===e&&console.warn("[MapKit] "+this._name+": “"+t+"” is not supported."),e}_locate(t){k(t,"Missing callback"),S(t,"function"),y_.userLocation.locate((function(e){const i=e.coords;t(null,new tt(i.latitude,i.longitude))}),(function(e){let i;switch(e.code){case e.PERMISSION_DENIED:i="PERMISSION_DENIED";break;case e.POSITION_UNAVAILABLE:i="POSITION_UNAVAILABLE";break;case e.TIMEOUT:i="TIMEOUT";break;default:throw new Error("Unknown PositionError code: "+e.code)}t(new Error(i),null)}),f_)}}__(y_,"userLocation",void 0),u.jsModules.userLocation?y_.userLocation=u.jsModules.userLocation:u.addEventListener("load",(function t(e){e.jsModules.userLocation&&(y_.userLocation=e.jsModules.userLocation,u.removeEventListener("load",t))}));class v_ extends y_{constructor(){super("PlaceData",{})}fetch(t,e){const i={mapsId:JSON.stringify({muid:t}),lang:Oe.language};return this._send("placedata",i,e,((t,e)=>{if(e&&e.result)return new op(e.result)}),"placedata")}}function b_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function w_(t){var e;class i extends t{constructor(t,e,i){super(t,e,i),b_(this,"featureType",""),b_(this,"pointOfInterestCategory",null),this._cachedIconMetadata={}}get initFromPlace(){return!1}fetchPlace(t){k(t,"[MapKit] Missing `callback` in call to `MapFeatureAnnotation.fetch()`."),S(t,"function","[MapKit] `callback` passed to `MapFeatureAnnotation.fetch()` is not a function.");return(new v_).fetch(this.muid,t)}get isAppStyle(){return!0}}return e=i,b_(i,"StaticStyles",t.StaticStyles),e.prototype.ConstructorOptions=Object.freeze(Object.assign({},t.prototype.ConstructorOptions,{color:"rw",glyphColor:"rw",glyphImage:"rw",selectedGlyphImage:"rw",draggable:"rw",appearanceAnimation:"rw",anchorOffset:"rw",padding:"rw",size:"rw",glyphText:"rw",titleVisibility:"rw",subtitleVisibility:"rw",_calloutWithSelectedState:"rw"})),i}const C_=rt({Search:"mapsearch",Callout:"callout"});function k_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function S_(t=[void 0,void 0,void 0,void 0]){if(void 0!==t[0]&&void 0!==t[1]&&void 0!==t[2])return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${void 0===t[3]?1:t[3]/255})`}class L_{constructor(t){k_(this,"results",void 0),k_(this,"completeCallback",void 0),k_(this,"pendingRequestsCount",void 0),k_(this,"loaderData",void 0),this.results={},this.completeCallback=t,this.pendingRequestsCount=0,this.loaderData=new Map}static fillGraphImageUrlPath(t,e=!1){let i=L_._CALLOUT_GLYPH_IMAGE_ENDPOINT_URL_PATH;return Oe.tileGroup&&(i=i.replace("{{tileGroup}}",Oe.tileGroup)),i=i.replace("{{attributes}}",e?t.styleAttributes:encodeURIComponent(t.styleAttributes)),i}static keyFromFetchOptions(t){const e=p_(t.mapType,t.colorScheme);return t.styleAttributes+t.iconContext+e.iconStyle+e.tint+e.emphasis}fetch(t){const e=new Map(t.map((t=>{const e=p_(t.mapType,t.colorScheme),i=Oe.tileGroup||t.tileGroup;return[t,L_.fillGraphImageUrlPath(t,!0).replace("&accessKey={{accessKey}}","").replace("{{scale}}","2").replace("{{size}}",t.iconContext===C_.Search?"3":"4").replace("{{context}}",t.iconContext).replace("{{style}}",e.iconStyle).replace("{{tint}}",e.tint).replace("{{emphasis}}",e.emphasis).replace("{{tileGroup}}",i)]})));t.sort(((t,i)=>{const s=e.get(t),o=e.get(i);return s>o?1:s<o?-1:0}));const i=[];for(let e=0;e<t.length;e+=1)i.push(t.slice(e,e+1));const s=Oe.getMadabaDomainFromStringHash?.(t[0].styleAttributes);let o=s+L_.ATLAS_URL.replace("{{accessKey}}",encodeURIComponent(Oe.accessKey||""));Oe.customMadabaUrl||(o=Oe.applyProxyPrefix(o)),this.pendingRequestsCount=i.length;for(const t of i){const i=t.map((t=>e.get(t))),s=o.replace("{{entries}}",encodeURIComponent(JSON.stringify({requests:i}))),n={withCredentials:Oe.urlWithCredentials(s)&&!Oe.customMadabaUrl,headers:{}};0;const a=new Gt(s,this,n);this.loaderData.set(a,[i,t]),a.schedule()}}loaderDidSucceed(t,e){this.pendingRequestsCount--;const i=this.loaderData.get(t),[s,o]=i;this.loaderData.delete(t);const n=JSON.parse(e.responseText);
2s.forEach(((t,e)=>{const i=n.urls[t];if(!i)return void 0;const s=n["icon-metadata"][i],a=o[e].styleAttributes,r=L_.keyFromFetchOptions(o[e]),l=p_(o[e].mapType,o[e].colorScheme),h=!("labelIconSource"in s)||0!==s.labelIconSource,d=!("labelTextVisibility"in s)||"Never"!==s.labelTextVisibility;this.results[r]={context:o[e].iconContext,styleAttributes:a,iconStyle:l.iconStyle,tint:l.tint,emphasis:l.emphasis,badgeColor:S_(s.badgeColor),calloutColor:S_(s.calloutColor),gradientStartColor:S_(s.gradientStartColor),gradientEndColor:S_(s.gradientEndColor),calloutHaloColor:S_(s.calloutHaloColor),haloColor:S_(s.haloColor),calloutShape:s.calloutShape?s.calloutShape:"Circle",fillType:s.fillType,iconVisibility:h,labelVisibility:d}})),0===this.pendingRequestsCount&&this.completeCallback(this.results)}loaderDidFail(t,e){this.loaderData.delete(t),this.pendingRequestsCount--,0===this.pendingRequestsCount&&this.completeCallback(this.results)}}k_(L_,"ATLAS_URL",void 0),k_(L_,"_CALLOUT_GLYPH_IMAGE_ENDPOINT_URL_PATH",void 0),L_.ATLAS_URL="/md/v1/atlas?data=false&dimension=1&entries={{entries}}&format=json&metadata=true&origin=top&type=icon&urls=true&accessKey={{accessKey}}",L_._CALLOUT_GLYPH_IMAGE_ENDPOINT_URL_PATH="/md/v1/icon?subtype=poi&style={{style}}&context={{context}}&tint={{tint}}&emphasis={{emphasis}}&attributes={{attributes}}&v={{tileGroup}}&accessKey={{accessKey}}&scale={{scale}}&size={{size}}&glyph=true";class M_{constructor(){k_(this,"_deferredFetchOptionsMap",void 0),this._deferredFetchOptionsMap=null}static fillGraphImageUrlPath(t){return L_.fillGraphImageUrlPath(t)}static keyFromFetchOptions(t){return L_.keyFromFetchOptions(t)}fetchAll(t,e){if(!t.length)return void setTimeout((()=>e({})));new L_(e).fetch(t)}fetchDeferred(t,e){if(!this._deferredFetchOptionsMap)if(this._deferredFetchOptionsMap={},Oe.state!==Oe.States.READY){const t=()=>{Oe.removeEventListener(Oe.Events.Changed,t),setTimeout((()=>this._startDeferredFetch()),0)};Oe.addEventListener(Oe.Events.Changed,t)}else setTimeout((()=>this._startDeferredFetch()),0);const i=M_.keyFromFetchOptions(t);this._deferredFetchOptionsMap[i]||(this._deferredFetchOptionsMap[i]={fetchOptions:t,callbacks:[]});this._deferredFetchOptionsMap[i].callbacks.push(e)}_startDeferredFetch(){const t=this._deferredFetchOptionsMap;this._deferredFetchOptionsMap=null,this.fetchAll(Object.values(t).map((t=>t.fetchOptions)),(e=>{Object.entries(t).forEach((([t,i])=>{const s=e[t];i.callbacks.forEach((t=>t.call(null,s)))}))}))}}k_(M_,"madabaBaseUrl",void 0),k_(M_,"sharedMadabaIconMetadata",void 0),M_.sharedMadabaIconMetadata=new M_;function A_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class T_{constructor(t,e,i,s,o){A_(this,"annotation",void 0),A_(this,"_url",void 0),A_(this,"useSquareBalloon",void 0),this.annotation=t,this._url=e.replace("{{size}}",i.toString()).replace("{{context}}",s),this.useSquareBalloon=o}getImageUrl(t,e){let i,s,o;if(this.annotation.map){const t=p_(this.annotation.map.mapType,this.annotation.map._impl.tint);i=t.iconStyle,s=t.tint,o=t.emphasis}else if(this.annotation._impl.iconMetadata){const t=this.annotation._impl.iconMetadata;
2i=t.iconStyle,s=t.tint,o=t.emphasis}else i=ct.Standard,s=ri.Light,o=ft.Standard;t=Math.ceil(Math.min(Math.max(t,1),3)),e(this._url.replace("{{accessKey}}",encodeURIComponent(Oe.accessKey)).replace("{{scale}}",t.toString()).replace("{{style}}",String(i)).replace("{{tint}}",s.toString()).replace("{{emphasis}}",o.toString()))}}function x_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const E_=M_.sharedMadabaIconMetadata,I_=Symbol(""),O_="load",P_="error";function R_(t){var e;class i extends t{constructor(t,e,i){super(t,e,i),x_(this,"styleAttributesHasIcon",!0),x_(this,"styleAttributes",""),x_(this,"iconContext",void 0),x_(this,"iconMetadata",void 0),x_(this,"isLoadingIconMetadata",!1),x_(this,"_cachedIconMetadata",{})}get initFromPlace(){return!0}init(){if(this.enablesDefaultGlyphImage=!1,super.init(),this._cachedIconMetadata={},this.initFromPlace){if(!this.place)throw new Error("[MapKit] Expected a Place for PlaceAnnotation.");if(!this.place.coordinate)throw new Error("[MapKit] Expected a Place with coordinate.");this.coordinate.equals(this.place.coordinate)||(this.coordinate=this.place.coordinate),this.styleAttributes="_styleAttributes"in this.place?this.place._styleAttributes:void 0,this.iconContext=C_.Search,this.styleAttributes||(this.styleAttributesHasIcon=!1,this.enablesDefaultGlyphImage=!0),this.title||(this.title=this.place.name)}}get isAppStyle(){return!1}get isPlaceStyle(){return!(this.iconMetadata&&!this.iconMetadata.iconVisibility)}get balloonVisible(){return!(this.iconMetadata&&!this.iconMetadata.iconVisibility)}titleCanBeShown(){return!(this.iconMetadata&&!this.iconMetadata.labelVisibility)&&super.titleCanBeShown()}subtitleCanBeShown(){return!(this.iconMetadata&&!this.iconMetadata.labelVisibility)&&super.subtitleCanBeShown()}get _color(){return this.iconMetadata?this.iconMetadata&&!this.iconMetadata.iconVisibility?this.map?t.DefaultColor[this.map._impl.currentColorScheme]:t.DefaultColor.light:this.selected||this.staticStyle===i.StaticStyles.Large||this.staticStyle===i.StaticStyles.Dot?this.iconMetadata.calloutColor??null:this.iconMetadata.badgeColor??null:null}get selectedFillColor(){return this.iconMetadata&&this.iconMetadata.iconVisibility&&this.iconMetadata.calloutColor||super.selectedFillColor}get fillColor(){return this.iconMetadata&&this.iconMetadata.iconVisibility&&this.iconMetadata.badgeColor||super.fillColor}get gradientColors(){return this.iconMetadata&&this.iconMetadata.iconVisibility&&this.iconMetadata.gradientStartColor&&this.iconMetadata.gradientEndColor?{start:this.iconMetadata.gradientStartColor,end:this.iconMetadata.gradientEndColor}:null}get fillWithGradient(){return this.iconMetadata?"None"!==this.iconMetadata.fillType&&super.fillWithGradient:super.fillWithGradient}get selectedStrokeColor(){return this.iconMetadata?this.iconMetadata&&!this.iconMetadata.iconVisibility?this.defaultStrokeColor:this.iconMetadata.calloutHaloColor||this.defaultStrokeColor:this.defaultStrokeColor}get strokeColor(){return this.iconMetadata?this.iconMetadata&&!this.iconMetadata.iconVisibility?this.defaultStrokeColor:this.iconMetadata.haloColor||this.defaultStrokeColor:this.defaultStrokeColor}get warnOnUnselectedGlyphImageAccess(){return!(!this.iconMetadata||"callout"!==this.iconMetadata.context)}loadGlyphImage(t,e,i,s){(this.map||this.iconMetadata)&&super.loadGlyphImage(t,e,i,s)}updateLayout(t){this.updateGlyphImages(),this.updateIconMetadata(!0),super.updateLayout(t)}addedToMap(){super.addedToMap(),this.updateIconMetadata(!1),this.updateGlyphImages()}updateIconMetadata(t){if(!this.map)return;if(!this.styleAttributesHasIcon)return;const e=p_(this.map.mapType,this.map._impl.tint??void 0),i=this._cachedIconMetadata[e.iconStyle+e.tint+e.emphasis];return this.iconMetadata&&i===this.iconMetadata?void 0:i&&i!==I_?(this.iconMetadata=i,void this._sceneGraphNode.updateAppearance(t)):void this.fetchIconMetadata(this.map._impl.tint,this.map.mapType)}setIconMetadata(t,e){if(this._cachedIconMetadata[t.iconStyle+t.tint+t.emphasis]=t,!this.iconMetadata){if(this.iconMetadata=t,this.iconMetadata.iconVisibility){const i=e||M_.fillGraphImageUrlPath({styleAttributes:this.styleAttributes});let s=Oe.getMadabaDomainFromStringHash?.(this.styleAttributes)+i;Oe.customMadabaUrl||(s=Oe.applyProxyPrefix(s));const o="Square"===t.calloutShape;this.selectedGlyphImage=new T_(this._public,s,4,t.context,o),t.context!==C_.Callout&&(this.glyphImage=new T_(this._public,s,3,t.context,o))}else this._sceneGraphNode.updateSizeAndAppearance(),this.enablesDefaultGlyphImage=!0;setTimeout((()=>{this._public.dispatchEvent(new Mh(O_))}))}this.updateIconMetadata(!!this.map)}
2fetchIconMetadata(t,e,i){this.iconMetadata||(this.isLoadingIconMetadata=!0);const s={colorScheme:t,styleAttributes:this.styleAttributes,iconContext:this.iconContext,mapType:e},o=p_(s.mapType,s.colorScheme),n=o.iconStyle+o.tint+o.emphasis;this._cachedIconMetadata[n]!==I_&&(this._cachedIconMetadata[n]=I_,E_.fetchDeferred(s,(t=>{this._cachedIconMetadata[n]=void 0,t?this.setIconMetadata(t):(console.warn("[MapKit] Unable to fetch icon style for annotation."),this.iconMetadata=void 0,this.enablesDefaultGlyphImage=!0,this.glyphImage=this.selectedGlyphImage=null,setTimeout((()=>{this._public.dispatchEvent(new Mh(P_))}))),this.iconMetadataLoaded(),"function"==typeof i&&i(this._public)})))}}return e=i,x_(i,"StaticStyles",t.StaticStyles),e.prototype.isGlyphImageInternal=!0,e.prototype.ConstructorOptions=Object.freeze(Object.assign({},t.prototype.ConstructorOptions,{color:"ro",glyphColor:"ro",glyphImage:"ro",selectedGlyphImage:"ro",draggable:"ro",appearanceAnimation:"ro",anchorOffset:"ro",padding:"ro",size:"ro",glyphText:"ro",titleVisibility:"rw",subtitleVisibility:"rw",_calloutWithSelectedState:"rw"})),i}const z_=R_(Yg);class D_ extends z_{}const N_=w_(D_);class F_ extends N_{}function U_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class W_{constructor(t,e){U_(this,"_selected",void 0),U_(this,"_impl",void 0),this._selected=e;const i=e?t.selectedGlyphImage:t.glyphImage;this._impl=i}getImageUrl(t,e){if(("number"!=typeof t||isNaN(t))&&(t=Ds()),"function"!=typeof e)throw new Error("[MapKit] Expects a callback to be provided.");HTMLCanvasElement.prototype.toBlob?this._impl.getImageUrl(t,(t=>{const i=new Sh(St.Highest,{urlForImageLoader:t,loaderDidSucceed:t=>{const i=this._selected?this._impl.annotation._impl.selectedFillColor:this._impl.annotation._impl.fillColor,s=t.image,o=document.createElement("canvas");o.width=s.naturalWidth,o.height=s.naturalHeight;const n=o.getContext("2d");i&&(n.fillStyle=i,n.fillRect(0,0,o.width,o.height)),n.drawImage(s,0,0),o.toBlob((t=>{jt(e,null,[URL.createObjectURL(t)])}))},loaderDidFail:()=>{setTimeout((()=>{jt(e,null)}))}}),s=!Oe.customMadabaUrl&&Oe.urlWithCredentials(t);i.crossOrigin=ra(s),i.schedule()})):setTimeout((()=>{jt(e,null)}))}}const G_=function(){throw new Error("[MapKit] `MapFeatureAnnotationGlyphImage` may not be constructed directly.")};W_.prototype.constructor=G_,G_.prototype=W_.prototype;class B_ extends Jg{constructor(t,e){super(t,e),new.target===B_&&(Object.defineProperty(this,"_impl",{value:new D_(this,t,e)}),this._impl.init())}get element(){return this._impl.element}get coordinate(){return this._impl.coordinate}get draggable(){return this._impl.draggable}get appearanceAnimation(){return this._impl.appearanceAnimation}get anchorOffset(){return this._impl.anchorOffset}get padding(){return this._impl.padding}get size(){return this._impl.size}get glyphText(){return this._impl.glyphText}get color(){return this._impl.color}get glyphColor(){return this._impl.glyphColor}get glyphImage(){return this._impl.glyphImage?(this._impl._glyphImagePublic||(this._impl._glyphImagePublic=new W_(this._impl,!1)),this._impl._glyphImagePublic):null}get selectedGlyphImage(){return this._impl.selectedGlyphImage?(this._impl._selectedGlyphImagePublic||(this._impl._selectedGlyphImagePublic=new W_(this._impl,!0)),this._impl._selectedGlyphImagePublic):null}}class Z_ extends B_{constructor(t,e){super(t,e),Object.defineProperty(this,"_impl",{value:new F_(this,t,e)}),this._impl.init(),this._impl.styleAttributesHasIcon=!1,this._impl.enablesDefaultGlyphImage=!0}get featureType(){return this._impl.featureType}fetchPlace(t){return this._impl.fetchPlace(t)}get pointOfInterestCategory(){return this._impl.pointOfInterestCategory}get map(){return this._impl.map}get collisionMode(){return this._impl.collisionMode}get title(){return this._impl.title}get subtitle(){return this._impl.subtitle}get titleVisibility(){return this._impl.titleVisibility}get subtitleVisibility(){return this._impl.subtitleVisibility}get accessibilityLabel(){return this._impl.accessibilityLabel}
2static fromMapFeatureRegion(t,e,i){const s=!!(t.calloutGlyphImageUrlTemplate&&t.metadata&&t.metadata.calloutColor),o=new Z_(new it(t.position[0],t.position[1]).toCoordinate(),{selected:!0,id:Op({muid:t.muid}),title:t.title});switch(t.annotation&&(o._impl.subtitle=t.annotation),o._impl.muid=t.muid,o._impl.styleAttributes=t.styleAttributes,t.category){case"Poi":o._impl.featureType=u_.PointOfInterest;break;case"Territory":o._impl.featureType=u_.Territory;break;case"PhysicalFeature":o._impl.featureType=u_.PhysicalFeature}if(s){o._impl.styleAttributesHasIcon=!0;const s=t.metadata;s.iconVisibility=!("labelIconSource"in s)||0!==s.labelIconSource,s.labelVisibility=!("labelTextVisibility"in s)||"Never"!==s.labelTextVisibility,s.styleAttributes=t.styleAttributes;const n=(/context=(\w+)/.exec(t.calloutGlyphImageUrlTemplate)||[])[1];s.context=n,o._impl.iconContext=s.context;const{iconStyle:a,tint:r,emphasis:l}=p_(e,i);s.iconStyle=a,s.tint=r,s.emphasis=l;const h=t.calloutGlyphImageUrlTemplate.replace(/emphasis=(standard|muted)/,"emphasis={{emphasis}}").replace(/style=\d+/,"style={{style}}");o._impl.setIconMetadata(s,h),o._impl.enablesDefaultGlyphImage=!1,t.poiType&&Mi(t.poiType,Vl)&&Vl[t.poiType]&&(o._impl.pointOfInterestCategory=t.poiType)}return o}}var j_,K_,H_;function q_(t,e){if(Z_.isConstructable)return new Z_(t,e);throw new TypeError("[MapKit] MapFeatureAnnotation may not be constructed.")}function V_(){u.jsModules.fromStyleAttributes&&(Z_.isConstructable=!0,q_.fromStyleAttributes=u.jsModules.fromStyleAttributes,q_.IconContext=u.jsModules.IconContext,u.removeEventListener("load",V_))}H_=!1,(K_="isConstructable")in(j_=Z_)?Object.defineProperty(j_,K_,{value:H_,enumerable:!0,configurable:!0,writable:!0}):j_[K_]=H_,q_.fromStyleAttributes=void 0,q_.IconContext=void 0,Z_.prototype.constructor=q_,q_.prototype=Z_.prototype,u.addEventListener("load",V_),V_();class Y_{constructor(t){!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"_annotationsController",void 0),this._annotationsController=t}getMapFeatureAnnotationForRegion(t,e){const i=this._annotationsController.map,s=Z_.fromMapFeatureRegion(t,i.mapType,i.tileTint);let o=s;const n=i.annotationForMapFeature;return"function"==typeof n&&(o=jt(n,i.public,[s])||o),o._impl.selected=!0,e&&(o._impl.selectionAccessory=e),o}mapFeatureDidSelect(t){this._annotationsController.addItem(t,0),t._impl.isMapFeature=!0}mapTypeDidChange(){const t=this._annotationsController.selectedItem;t&&t._impl.isMapFeature&&this._annotationsController.items.includes(t)&&this._annotationsController.removeItem(t)}annotationSelectionDidChange(t){!t.selected&&t._impl.isMapFeature&&this._annotationsController.items.includes(t)&&this._annotationsController.removeItem(t)}}function X_(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const $_=10.5,J_=3.5826363,Q_=3.58028186,tf=8e3/60,ef=5e3/60,sf=5e3/60,of=30/249,nf=277/249,af=237/249,rf="white",lf={left:10,right:10,content:{left:4,right:4}},hf={left:7.5,right:10},df={left:7.5,right:7.5},cf=5.5,uf=0,pf="mk-callout",mf="mk-bubble",gf="mk-title",_f="mk-subtitle",ff="mk-no-subtitle",yf="mk-no-accessories",vf="mk-standard",bf="mk-standard-content",wf="mk-callout-accessory",Cf="mk-callout-content",kf="mk-custom-content",Sf="mk-callout-accessory-content",Lf="mk-rtl";class Mf extends Ri{constructor(t){super(Fs("div",{class:pf,style:"direction: ltr"})),X_(this,"_callout",void 0),this._callout=t}didMoveToParent(t){null===t&&this._callout.didRemoveFromParent()}}class Af extends em{constructor(t,e){super(),X_(this,"delegate",void 0),X_(this,"_rtl",!1),X_(this,"_containerElement",void 0),X_(this,"_customElement",void 0),X_(this,"_containerElementNode",void 0),X_(this,"_ignoreCalloutCornerRadiusForLeftAccessory",void 0),X_(this,"_tailScale",1),X_(this,"_bubbleElement",void 0),X_(this,"_svgElement",void 0),X_(this,"_containerContentElement",void 0),X_(this,"_leftAccessoryBackgroundColor",void 0),X_(this,"_leftAccessory",void 0),X_(this,"_rightAccessoryBackgroundColor",void 0),X_(this,"_rightAccessory",void 0),X_(this,"_calloutId",void 0),X_(this,"_linearGradientElement",void 0),X_(this,"_contentElement",void 0),X_(this,"_tailShift",0),X_(this,"_accessoryHeight",0),X_(this,"_leftAccessoryWidth",void 0),X_(this,"_rightAccessoryWidth",void 0),X_(this,"_bubbleSize",void 0),X_(this,"_scaleXOffset",void 0),X_(this,"_scaleYOff
2set",void 0),X_(this,"_scaleAnimationParameterIndex",void 0),X_(this,"_scaleAnimationStartDate",void 0),X_(this,"_fadeoutAnimationStartDate",void 0),X_(this,"_tailAnimation",void 0),X_(this,"_anchorOffsetAnimation",void 0),X_(this,"_scaleAnimationParameters",[[tf,of,nf],[ef,nf,af],[sf,af,1]]),super.init(),this.delegate=t,this._rtl=e.rtl,this._node=new Mf(this);const i=this._node.element;if(e.customElement){this._containerElement=this._customElement=e.customElement;const t=this.delegate.sizeForElement(this._customElement);this.setSize(t),i.appendChild(e.customElement)}else this._ignoreCalloutCornerRadiusForLeftAccessory=e.ignoreCalloutCornerRadiusForLeftAccessory,this._tailScale=e.tailScale||1,this._bubbleElement=Us("path"),this._svgElement=i.appendChild(Us("svg",{class:mf},this._bubbleElement)),this._containerElement=Fs("div"),this._containerElementNode=new Ri(this._containerElement),e.leftAccessory&&(this._leftAccessoryBackgroundColor=s(e.leftAccessory),this._leftAccessory=o(e.leftAccessory,!this._rtl&&this._ignoreCalloutCornerRadiusForLeftAccessory),this._containerElement.appendChild(this._leftAccessory)),this._containerContentElement=this._containerElement.appendChild(Fs("div")),this._containerContentElement.className=Cf,e.rightAccessory&&(this._rightAccessoryBackgroundColor=s(e.rightAccessory),this._rightAccessory=o(e.rightAccessory,this._rtl&&this._ignoreCalloutCornerRadiusForLeftAccessory),this._containerElement.appendChild(this._rightAccessory)),(this._leftAccessoryBackgroundColor||this._rightAccessoryBackgroundColor)&&(this._calloutId=xf(),this._linearGradientElement=Us("linearGradient",{id:this._calloutId}),this._svgElement.appendChild(Us("defs",this._linearGradientElement))),e.contentElement?this._setContentElement(e.contentElement):(this._containerElementNode.classList.add(vf),e.rtl&&(this._containerContentElement.className+=" "+Lf)),i.appendChild(this._containerElement);function s(e){return t.backgroundColorForElement(e,!0)}function o(t,e){const i=Fs("div",{class:Sf},t);i.style.maxWidth="186.5px",e&&(i.style.padding="0");return Fs("div",{class:wf},i)}e.position&&this.setPosition(e.position),this._node.wantsHardwareCompositing=!0}get node(){return this._node}get boundingRect(){const t=this._node.position;return new ze(t.x,t.y,this._node.size.width,this._node.size.height)}willMoveToMap(){this._node.transform=(new hi).scale(0)}setAnchorOffset(t){this._anchorOffset=t?new window.DOMPoint(t.x,t.y):new window.DOMPoint}containsElement(t){if(t===this._svgElement)return!1;if(this._containerElement.contains(t))return!0;if(!ks||!this.isCustomCallout())return!1;const e=this.customOrContentElement.assignedNodes()[0];return!!e&&e.contains(t)}isCustomCallout(){return!!this.customOrContentElement}get customOrContentElement(){return this._customElement||this._contentElement}get customLeftAccessory(){if(this._leftAccessory)return this._leftAccessory.firstChild.firstChild}get customRightAccessory(){if(this._rightAccessory)return this._rightAccessory.firstChild.firstChild}updateInfo(t,e){if(this.isCustomCallout())return!0;if(!t||!t.title)return!1;this._containerContentElement.innerHTML="",this._containerElement.style.width="",this._containerContentElement.classList.add(bf),this._containerContentElement.appendChild(Fs("div",{class:gf,dir:"auto"},t.title)),t.subtitle?(this._containerContentElement.appendChild(Fs("div",{class:_f,dir:"auto"},t.subtitle)),this._containerElementNode.classList.remove(ff)):(this._containerElementNode.classList.add(ff),this._containerElementNode.classList.toggle(yf,!this._leftAccessory&&!this._rightAccessory)),this._updateAccessoryViews(),this._containerElement.className=this._containerElementNode.classList.toString();const i=this.delegate.sizeForElement(this._containerElement),s=t.map._impl.ensureVisibleFrame().size.width-2*e-this._extraWidth(this._ignoreCalloutCornerRadiusForLeftAccessory);return i.width=w(i.width,74,w(s,74,373)),0!==this._accessoryHeight&&(i.height=Math.max(this._accessoryHeight,i.height)),this._updateSize(i,!1),this.updatePosition(),!0}shiftTailBy(t){if(this._customElement)return 0;const e=Math.max(0,(this._bubbleSize.width-74-$_)/2);return this._tailShift=t<0?Math.min(e,-t):-Math.min(e,t),this._bubbleElement.setAttribute("d",Tf(this._bubbleSize,this._tailScale,this._tailShift)),this._node.position=new Pe
2(this._node.position.x+this._tailShift,this._node.position.y),this._tailShift}animateIn(){if(!this.animates||this.animates&&this._customElement&&!this.appearanceAnimation)this._node.transform=new hi;else{if(this._appearanceAnimationName)return this._node.transform=new hi,void this.delegate.setAnimationForElement(this._containerElement,this._appearanceAnimation,this._appearanceAnimationName);this._scaleXOffset=-this._tailShift,this._scaleYOffset=this._node.size.height/2,this._scaleAnimationParameterIndex=0,this._scaleAnimationStartDate=Date.now(),si(this)}}animateOut(t){!t&&this.visible?(this._scaleAnimationStartDate&&this._finishAnimatingScale(),this._fadeoutAnimationStartDate=Date.now(),si(this)):this._node.remove()}mapNodeTintWasSet(){}performScheduledUpdate(){this._scaleAnimationStartDate&&this._animateScale(),this._fadeoutAnimationStartDate&&this._animateFadeout(),this._tailAnimation&&this._animateTail(),this._anchorOffsetAnimation&&this._animateAnchorOffset()}didRemoveFromParent(){this.delegate.accessoryNodeDidRemove(this)}setSize(t){this._svgElement&&(this._svgElement.style.width=t.width+"px",this._svgElement.style.height=t.height+"px",this._svgElement.setAttribute("viewBox","-0.5 -0.5 "+t.width+" "+t.height)),super.setSize(t)}_updateSize(t,e){const i=this._ignoreCalloutCornerRadiusForLeftAccessory,s=t.width-this.node.size.width-22;this._tailShift=Math.max(0,this._tailShift+Math.min(0,s)),this._containerElement.style.width=t.width+"px";const o=this._extraWidth(i),n=13*this._tailScale,a=22+n;t.width+=o;const r=t.height,l=(i?55:50)+n;t.height+=a,t.height-=$_,t.height=e?t.height:Math.max(t.height,l);const h=e?uf:cf,d=(t.height-r-n)/2;this._containerElement.style.top=r/2+Math.max(h,d)+"px";const c=df.left,u=df.right;let p;this._containerElement.style.left=c+"px",this.setSize(t),this._bubbleSize=new at(t.width-22,t.height-22-n),this._bubbleElement.setAttribute("d",Tf(this._bubbleSize,this._tailScale,this._tailShift)),this._leftAccessoryBackgroundColor&&(p=100*(this._leftAccessoryWidth+c)/t.width,this._updateAccessoryViewBackground(p,this._leftAccessoryBackgroundColor,rf)),this._rightAccessoryBackgroundColor&&(p=100-100*(this._rightAccessoryWidth+u)/t.width,this._updateAccessoryViewBackground(p,rf,this._rightAccessoryBackgroundColor))}_extraWidth(t){return t?hf.left+hf.right:lf.left+lf.right-lf.content.left}_updateAccessoryViews(){if(this._accessoryHeight=0,this._leftAccessory){const t=this._leftAccessory.children[0],e=this.delegate.sizeForElement(t);this._leftAccessoryWidth=(!this._rtl&&this._ignoreCalloutCornerRadiusForLeftAccessory?0:$_)+e.width,this._accessoryHeight=e.height,this._leftAccessory.style.width=this._leftAccessoryWidth+"px",this._ignoreCalloutCornerRadiusForLeftAccessory&&!this._rtl&&(this._leftAccessory.style.height=this._leftAccessoryWidth+"px",this._leftAccessory.style.overflow="visible"),this._containerContentElement.style.marginLeft=this._leftAccessoryWidth+"px"}if(this._rightAccessory){const t=this._rightAccessory.children[0],e=this.delegate.sizeForElement(t);this._rightAccessoryWidth=(this._rtl&&this._ignoreCalloutCornerRadiusForLeftAccessory?0:$_)+e.width,this._accessoryHeight=Math.max(this._accessoryHeight,e.height),this._rightAccessory.style.width=this._rightAccessoryWidth+"px",this._ignoreCalloutCornerRadiusForLeftAccessory&&this._rtl&&(this._rightAccessory.style.height=this._rightAccessoryWidth+"px",this._rightAccessory.style.overflow="visible"),this._containerContentElement.style.marginRight=this._rightAccessoryWidth+"px"}}_updateAccessoryViewBackground(t,e,i){this._linearGradientElement.appendChild(Us("stop",{offset:t+"%","stop-color":""+e})),this._linearGradientElement.appendChild(Us("stop",{offset:t+"%","stop-color":""+i})),this._bubbleElement.style.fill="url(#"+this._calloutId+")"}_setContentElement(t){this._updateAccessoryViews(),this._contentElement=t,this._containerContentElement.appendChild(Fs("div",t)),this._containerElementNode.classList.add(kf),this._containerElement.className=this._containerElementNode.classList.toString();const e=this.delegate.sizeForElement(this._containerElement);e.height=Math.max(e.height,this._accessoryHeight),this._updateSize(e,!0)}_animateScale(){const t=this._scaleAnimationParameters[this._scaleAnimationParameterIndex],e=t[0],i=t[1],s=t[2],o=Date.now(),n=Math.min((o-this._scaleAnimationStartDate)/e,1),a=i+(s-i)*n;if(this._node.transform=(new hi).translate(this._scaleXOffset,this._scaleYOff
2set).scale(a).translate(this._scaleXOffset?-this._scaleXOffset:void 0,this._scaleYOffset?-this._scaleYOffset:void 0),1===n){if(++this._scaleAnimationParameterIndex,!(this._scaleAnimationParameterIndex<this._scaleAnimationParameters.length))return void this._finishAnimatingScale();this._scaleAnimationStartDate=o}si(this)}_finishAnimatingScale(){delete this._scaleXOffset,delete this._scaleYOffset,delete this._scaleAnimationStartDate,delete this._scaleAnimationParameterIndex}_animateFadeout(){const t=(Date.now()-this._fadeoutAnimationStartDate)/100,e=Math.max(0,1-t);0!==e?(this._node.opacity=e,si(this)):this._node.remove()}animateTailScale(t,e){const i=(new Date).getTime();e=e||0===e?e:500,this._tailAnimation={timeStart:i,timeEnd:i+e,valueStart:this._tailScale,valueEnd:t},this._animateTail()}_animateTail(){if(!this._tailAnimation)return;const t=(new Date).getTime(),e=this._tailAnimation.timeStart,i=this._tailAnimation.timeEnd,s=this._tailAnimation.valueStart,o=this._tailAnimation.valueEnd,n=Xs(Ys(w(i<=e?1:(t-e)/(i-e),0,1)),s,o),a=13*(n-this._tailScale);this._tailScale=n,this.setSize(new at(this.node.size.width,this.node.size.height+a)),this._bubbleElement.setAttribute("d",Tf(this._bubbleSize,this._tailScale,this._tailShift)),t<i?si(this):this._tailAnimation=null}animateAnchorOffset(t,e){const i=(new Date).getTime();e=e||0===e?e:500,this._anchorOffsetAnimation={timeStart:i,timeEnd:i+e,startX:this._anchorOffset.x,startY:this._anchorOffset.y,endX:t.x,endY:t.y},this._animateAnchorOffset()}_animateAnchorOffset(){if(!this._anchorOffsetAnimation)return;const t=(new Date).getTime(),e=this._anchorOffsetAnimation.timeStart,i=this._anchorOffsetAnimation.timeEnd,s=this._anchorOffsetAnimation.startX,o=this._anchorOffsetAnimation.endX,n=this._anchorOffsetAnimation.startY,a=this._anchorOffsetAnimation.endY,r=Ys(w(i<=e?1:(t-e)/(i-e),0,1)),l=Xs(r,s,o),h=Xs(r,n,a);this._anchorOffset.x=l,this._anchorOffset.y=h,this.updatePosition(),t<i?si(this):this._anchorOffsetAnimation=null}getCenterOffset(t){const e=13*this._tailScale,i=this._node.size;return new Pe(0,(e-i.height-(t?13:0))/2)}}function Tf(t,e,i){const s=17*e,o=13*e,n=t.width/2-s,a=10*e,r=12*e;return"M0,10.5c0,-6.9197181400000005 3.5826363,-10.5 10.5,-10.5h"+t.width+"c6.9173637,0 "+$_+","+Q_+" "+$_+","+$_+"v"+t.height+"c0,6.9197181400000005 "+-J_+","+$_+" "+"-10.5,"+$_+"h"+(-i-n)+"c"+-a+",0 "+-r+","+o+" "+-s+","+o+"c"+(r-s)+",0 "+(a-s)+","+-o+" "+-s+","+-o+"h"+(i-n)+"c"+"-6.9173637,0 "+"-10.5,"+-Q_+" "+"-10.5,"+"-10.5z"}function xf(){const t=Math.random().toString(36).substr(2);return document.getElementById(t)?xf():t}function Ef(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const If="mk-selection-accessory-badge",Of="mk-selection-accessory-badge-content",Pf="mk-fade-out";class Rf extends em{constructor(t,{place:e={},muid:i,coordinate:s,title:o}){super(),Ef(this,"delegate",void 0),Ef(this,"style",void 0),Ef(this,"placeUrl",void 0),Ef(this,"_containerElement",void 0),Ef(this,"handleLinkClickedListener",void 0),Ef(this,"_containerElementNode",void 0),Ef(this,"_handleLocaleChangedListener",void 0),Ef(this,"_textElement",void 0),Ef(this,"analyticsState",void 0),super.init(),this.style=Fp.OpenInMaps,this.placeUrl=this._getPlaceUrl(e,i,s,o),this.delegate=t,this._node=new Ri(Fs("div",{class:If}));const n=this._node.element;this._containerElement=Fs("button",{role:"link",dir:"auto",type:"button",class:Of}),this.handleLinkClickedListener=()=>this._handleLinkClicked(),this._containerElement.addEventListener("click",this.handleLinkClickedListener),this._containerElementNode=new Ri(this._containerElement),this._handleLocaleChangedListener=t=>this._handleLocaleChanged(t),Nn.addEventListener(Nn.Events.LocaleChanged,this._handleLocaleChangedListener),this._textElement=this._containerElement.appendChild(Fs("span")),this._textElement.textContent=Nn.get("OpenInAppleMaps.Label"),n.appendChild(this._containerElement);const a=this.delegate.sizeForElement(n);this.setSize(a),this._node.wantsHardwareCompositing=!0,this.analyticsState={place_action_details:{businessID:e.muid??i}},this.delegate.placeCardDidReveal("SMALL",this.analyticsState)}get node(){return this._node}
2get boundingRect(){const t=this._node.position;return new ze(t.x,t.y,this._node.size.width,this._node.size.height)}setPosition(t){t.y+=this._node.size.height,super.setPosition(t)}willMoveToMap(){}setAnchorOffset(t){this._anchorOffset=t?new window.DOMPoint(t.x,t.y):new window.DOMPoint}containsElement(t){return!!this._containerElement.contains(t)}isCustomCallout(){return!1}updateInfo(){return!0}shiftTailBy(){return 0}animateIn(){}animateOut(t){!t&&this.visible||this._node.remove(),this._containerElementNode.classList.add(Pf),setTimeout((()=>this._node.remove()),500)}mapNodeTintWasSet(){}didRemoveFromParent(){this.delegate.accessoryNodeDidRemove(this),Nn.removeEventListener(Nn.Events.LocaleChanged,this._handleLocaleChangedListener),this._containerElement.removeEventListener("click",this.handleLinkClickedListener)}_getPlaceUrl(t={},e,i,s){const o=new URLSearchParams,n=t.name||s;n&&o.append("name",n);const a=t.muid||e;return a&&o.append("place-id",Op({muid:a})),t.formattedAddress&&o.append("address",t.formattedAddress),i=t.coordinate||i,o.append("coordinate",`${i.latitude},${i.longitude}`),`https://maps.apple.com/place?${o.toString()}`}_handleLinkClicked(){window.open(this.placeUrl,"_blank","noopener"),this.delegate.placeCardOpenInMapsClicked("SMALL",this.analyticsState)}_handleLocaleChanged(){this._textElement.textContent=Nn.get("OpenInAppleMaps.Label");const t=this.delegate.sizeForElement(this._containerElement);this.setSize(t)}animateTailScale(){}animateAnchorOffset(){}getCenterOffset(){}}function zf(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Df=18,Nf=8.028,Ff=12,Uf=8e3/60,Wf=5e3/60,Gf=5e3/60,Bf=30/249,Zf=277/249,jf=237/249,Kf="mk-selection-accessory",Hf="mk-selection-accessory-bubble",qf="mk-selection-accessory-content",Vf="mk-selection-accessory-loading",Yf="mk-selection-accessory-failed",Xf="mk-failed-labels",$f="mk-rtl",Jf=new at(243,311),Qf=new at(180,70);class ty extends em{constructor(t,{place:e,muid:i,uiStyle:s,side:o,rtl:n}){super(),zf(this,"delegate",void 0),zf(this,"_tailScale",void 0),zf(this,"_bubbleElement",void 0),zf(this,"_svgElement",void 0),zf(this,"_containerElement",void 0),zf(this,"_containerElementNode",void 0),zf(this,"_containerContentElement",void 0),zf(this,"uiStyle",void 0),zf(this,"_controller",void 0),zf(this,"side",void 0),zf(this,"_rtl",void 0),zf(this,"_loadingCanvasElement",void 0),zf(this,"placeCardSize",void 0),zf(this,"animatedIn",void 0),zf(this,"_scaleAnimationParameterIndex",void 0),zf(this,"_scaleAnimationStartDate",void 0),zf(this,"_fadeoutAnimationStartDate",void 0),zf(this,"_loadingFailureLabel",null),zf(this,"_scaleXOffset",void 0),zf(this,"_scaleYOffset",void 0),zf(this,"_bubbleSize",void 0),zf(this,"_tailXAxisShift",0),zf(this,"_scaleAnimationParameters",[[Uf,Bf,Zf],[Wf,Zf,jf],[Gf,jf,1]]),super.init(),this.delegate=t,this._node=new Ri(Fs("div",{class:`${Kf} mk-ui-style-${s}`}));const a=this._node.element;this._tailScale=1,this._bubbleElement=Us("path"),this._svgElement=a.appendChild(Us("svg",{class:Hf},this._bubbleElement)),this._containerElement=Fs("div"),this._containerElementNode=new Ri(this._containerElement),this._containerContentElement=this._containerElement.appendChild(Fs("div"));this.uiStyle=s,this._controller=new dp(this._containerContentElement,{get colorScheme(){return t.tint},get place(){return e||{muid:i}},get displaysMap(){return!1},placeCardSizeDidChange:(t,e)=>this._placeCardSizeDidChange(t,e),loadingDidFail:()=>this._placeCardFrameLoadingDidFail(),uiStyle:s,placeCardDidReveal:t=>this.delegate.placeCardDidReveal("full"===s?"LARGE":"MEDIUM",t),placeCardOpenInMapsClicked:t=>this.delegate.placeCardOpenInMapsClicked("full"===s?"LARGE":"MEDIUM",t)}),this.side=o,this._controller.update(),this._containerElementNode.classList.add(qf),n&&this._containerElementNode.classList.add($f),a.appendChild(this._containerElement),this._rtl=n,this._loadingCanvasElement=Fs("canvas",{"aria-hidden":"true",class:Vf}),this._containerElement.appendChild(this._loadingCanvasElement),this._node.wantsHardwareCompositing=!0}get node(){return this._node}
2get boundingRect(){const t=this._node.position;return new ze(t.x,t.y,this._node.size.width,this._node.size.height)}willMoveToMap(){this._node.transform=(new hi).scale(0)}setAnchorOffset(){}containsElement(t){return t!==this._svgElement&&!!this._containerElement.contains(t)}isCustomCallout(){return!1}updateInfo(){const t=this.placeCardSize?this.placeCardSize.copy():"full"===this.uiStyle?Jf.copy():Qf.copy();return this._updateSize(t),this.updatePosition(),!0}setPositionWithSide(t,e){switch(this.side=e,e){case"top":t.y+=-12*this._tailScale;break;case"left":t.x-=this._node.size.width/2+Ff*this._tailScale,t.y+=this._node.size.height/2;break;case"right":t.x+=this._node.size.width/2+Ff*this._tailScale,t.y+=this._node.size.height/2;break;case"bottom":t.y+=this._node.size.height+Ff*this._tailScale}return this.setPosition(t)}shiftTailBy(t){if("left"===this.side||"right"===this.side)return this._tailXAxisShift=0,this._bubbleElement.setAttribute("d",ey(this._bubbleSize,this._tailScale,this.side,this._tailXAxisShift)),0;const e=Math.max(0,(this._bubbleSize.width-36)/2);return this._tailXAxisShift=t<0?Math.min(e,-t):-Math.min(e,t),this._bubbleElement.setAttribute("d",ey(this._bubbleSize,this._tailScale,this.side,this._tailXAxisShift)),this._node.position=new Pe(this._node.position.x+this._tailXAxisShift,this._node.position.y),this._tailXAxisShift}animateIn(){if(!this.animates)return this.animatedIn=!0,void(this._node.transform=new hi);this.animatedIn||(this.animatedIn=!0,this._setScaleOffsets(),this._scaleAnimationParameterIndex=0,this._scaleAnimationStartDate=Date.now(),si(this))}animateOut(t){!t&&this.visible?(this._scaleAnimationStartDate&&this._finishAnimatingScale(),this._fadeoutAnimationStartDate=Date.now(),si(this)):this._node.remove()}mapNodeTintWasSet(){this.updateInfo(),this._controller.update()}performScheduledUpdate(){this._scaleAnimationStartDate&&this._animateScale(),this._fadeoutAnimationStartDate&&this._animateFadeout()}didRemoveFromParent(){this.delegate.accessoryNodeDidRemove(this)}setSize(t){const e=Ff*this._tailScale,i=t.width+20+2*e,s=t.height+20+2*e,o=-10.5-e,n=-10.5-e;this._svgElement.style.width=i+"px",this._svgElement.style.height=s+"px",this._svgElement.style.top=o+"px",this._svgElement.style.left=n+"px",this._svgElement.setAttribute("viewBox",`${n} ${o} ${i} ${s}`),super.setSize(t)}_placeCardSizeDidChange(t,e){if(0===t||0===e)return;let i;switch(this._placeCardDidLoad(),this.uiStyle){case"full":i=new at(Jf.width,Math.min(600,this.delegate.getMaximumSizeForAccessory().height,e));break;case"compact":i=new at(t,e);break;default:i=new at}this.placeCardSize=i.copy(),this._updateSize(i),this.delegate.accessorySizeDidChange(this)}_updateLoadingCanvas(t){const e=this._loadingCanvasElement;if(!e)return;e.width=t.width*zs(),e.height=t.height*zs();const i=e.getContext("2d");if(i.scale(zs(),zs()),this._rtl&&(i.translate(t.width,0),i.scale(-1,1)),"full"===this.uiStyle){const e=t.width-18-.2*t.width*Math.random();i.roundRect(9,12,e,20,5);const s=t.width-18-.2*t.width*Math.random();i.roundRect(9,36,s,13,5),i.fillStyle=this.delegate.tint===ri.Light?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",i.fill();const o=t.width-18,n=61,a=46,r=t.height-n-12-a-12,l=n+r+12;i.beginPath(),i.roundRect(9,n,o,r,10),i.roundRect(9,l,o,a,10),i.fillStyle=this.delegate.tint===ri.Light?"#ffffff":"#242628",i.fill();const h=50,d=[1,1,1,1];let c=Math.floor(4*Math.random());d[c]+=1,c=Math.floor(4*Math.random()),d[c]+=1;let u=n+9;i.beginPath();for(const e of d){i.roundRect(21,u,h,11,5),u+=13;for(let s=0;s<e;s++)i.roundRect(21,u,t.width-42-.2*t.width*Math.random(),13,5),u+=13+(s+1===e?9:2)}i.arc(35,l+9+14,14,0,2*Math.PI),i.roundRect(58,l+9+7,t.width-42-37-.2*t.width*Math.random(),14,5),i.fillStyle=this.delegate.tint===ri.Light?"rgba(0, 0, 0, 0.03)":"rgba(255, 255, 255, 0.03)",i.fill()}else{let e=12;for(;e<=t.height-12;){const s=t.width-32-.2*t.width*Math.random();i.roundRect(16,e,s,12,5),e+=18}i.fillStyle=this.delegate.tint===ri.Light?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)",i.fill()}}_placeCardDidLoad(){this._removeLoadingCanvas(),this._removeLoadingFailureLabel()}_removeLoadingCanvas(){this._loadingCanvasElement&&(this._containerElement.removeChild(this._loadingCanvasElement),this._loadingCanvasElement=null)}_placeCardFrameLoadingDidFail(){this._removeLoadingCanvas(),this._loadingFailureLabel=Fs("div",{class:Yf}),this._containerElement.appendChild(this._loadingFailureLabel);const t=this._loadingFailureLabel.appendChild(Fs("div",{class:Xf}));t.appendChild(Fs("p",Nn.get("Place.Error.Title"))),t.appendChild(Fs("p",Nn.get("Place.Error.Message")));const e="full"===this.uiStyle?Jf.copy():Qf.copy();e.height=t.offsetHeight,this._updateSize(e),this.delegate.accessorySizeDidChange(this)}_removeLoadingFailureLabel(){this._loadingFailureLabel&&(this._containerElement.removeChild(this._loadingFailureLabel),this._loadingFailureLabel=null)}_updateSize(t){this._updateLoadingCanvas(t);const e=t.width-this.node.size.width;this._tailXAxisShift=Math.max(0,this._tailXAxisShift+Math.min(0,e)),this._containerElement.style.width=t.width+"px",this._containerElement.style.height=t.height+"px",t.he
2ight+=36,t.height-=36,this.setSize(t),this._bubbleSize=new at(t.width-36,t.height-36),this._bubbleElement.setAttribute("d",ey(this._bubbleSize,this._tailScale,this.side,this._tailXAxisShift));(this._scaleXOffset||this._scaleYOffset)&&this._setScaleOffsets()}_setScaleOffsets(){const t=this._node.size,e=Ff*this._tailScale;switch(this.side){case"top":this._scaleXOffset=-this._tailXAxisShift,this._scaleYOffset=t.height/2;break;case"left":this._scaleXOffset=t.width/2+e,this._scaleYOffset=-e/2;break;case"right":this._scaleXOffset=-t.width/2-e,this._scaleYOffset=-e/2;break;case"bottom":this._scaleXOffset=-this._tailXAxisShift,this._scaleYOffset=-t.height/2}}_animateScale(){const t=this._scaleAnimationParameters[this._scaleAnimationParameterIndex],e=t[0],i=t[1],s=t[2],o=Date.now(),n=Math.min((o-this._scaleAnimationStartDate)/e,1),a=i+(s-i)*n;if(this._node.transform=(new hi).translate(this._scaleXOffset,this._scaleYOffset).scale(a).translate(this._scaleXOffset?-this._scaleXOffset:void 0,this._scaleYOffset?-this._scaleYOffset:void 0),1===n){if(++this._scaleAnimationParameterIndex,!(this._scaleAnimationParameterIndex<this._scaleAnimationParameters.length))return void this._finishAnimatingScale();this._scaleAnimationStartDate=o}si(this)}_finishAnimatingScale(){delete this._scaleXOffset,delete this._scaleYOffset,delete this._scaleAnimationStartDate,delete this._scaleAnimationParameterIndex}_animateFadeout(){const t=(Date.now()-this._fadeoutAnimationStartDate)/100,e=Math.max(0,1-t);0!==e?(this._node.opacity=e,si(this)):this._node.remove()}animateTailScale(){}animateAnchorOffset(){}getCenterOffset(){}}function ey(t,e,i,s){const o=15*e,n=Ff*e,a=t.width/2-o,r=t.height/2-o,l=10*e,h=12*e;return"M0,18c0,-9.972 8.028,-18 18,-18"+("bottom"===i?"h"+(-s+a)+"c"+l+",0 "+h+","+-n+" "+o+","+-n+"c"+(-h+o)+",0 "+(-l+o)+","+n+" "+o+","+n+"h"+(s+a):"h"+t.width)+"c9.972,0 "+"18,"+Nf+" "+"18,"+Df+("left"===i?"v"+r+"c0,"+l+" "+n+","+h+" "+n+","+o+"c0,"+(-h+o)+" "+-n+","+(-l+o)+" "+-n+","+o+"v"+r:"v"+t.height)+"c0,9.972 "+"-8.028,"+"18 "+"-18,"+Df+("top"===i?"h"+(-s-a)+"c"+-l+",0 "+-h+","+n+" "+-o+","+n+"c"+(h-o)+",0 "+(l-o)+","+-n+" "+-o+","+-n+"h"+(s-a):"h"+-t.width)+"c"+"-9.972,0 "+"-18,"+"-8.028 "+"-18,"+-18+("right"===i?"v"+-r+"c0,"+-l+" "+-n+","+-h+" "+-n+","+-o+"c0,"+(h-o)+" "+n+","+(l-o)+" "+n+","+-o+"v"+-r:"z")}zf(ty,"DEFAULT_FULL_SIZE",Jf),zf(ty,"DEFAULT_COMPACT_SIZE",Qf),zf(ty,"TAIL_LENGTH",Ff),zf(ty,"TAIL_DISTANCE_TO_ANCHOR",8);function iy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const sy="mk-selection-accessories",oy="mk-selected";class ny{constructor(t){iy(this,"delegate",void 0),iy(this,"node",void 0),iy(this,"_accessory",void 0),iy(this,"_oldCenterMode",void 0),iy(this,"_waitingForRegionChangeToEnd",void 0),iy(this,"_waitingForRegionChangeToStart",void 0),iy(this,"_nudgeStarted",void 0),this.delegate=t,this._oldCenterMode=!1,this.node=new Ri(Fs("div")),this.node.classList.add(sy),this._waitingForRegionChangeToEnd=0}get accessoryIsShown(){return!!this._accessory}
2getAccessoryBoundingRect(){if(this._accessory)return this._accessory.boundingRect}selectedAnnotationVisibilityDidChange(t){this._accessory?this._accessory.visible=t.visible:t.visible&&this.showAccessoryForAnnotation(t,!0)}isElementInAccessory(t){return!!this._accessory&&this._accessory.containsElement(t)}isElementInCustomCallout(t){return!!this._accessory&&this._accessory.isCustomCallout()&&this._accessory.node.element.contains(t)}showAccessoryForAnnotation(t,e){this.hideAccessory(t,e);const{showsSelectionAccessory:i,showsCallout:s,calloutDelegate:o,customCalloutElement:n,customCalloutContentElement:a}=this._canShowSelectionAccessoryForAnnotation(t);if(!i&&!s)return void t._impl.selectionAccessoryWillAppear(!1);t._impl.selectionAccessoryWillAppear(!0);let r=n;if(ks&&r){const t="mk-slot-"+Math.random().toString(32).substring(2,10);r.slot=t;const e=Fs("slot");e.name=t,this.delegate.appendElementAssignedToSlot(r),r=e}if(s){const{ignoreCalloutCornerRadiusForLeftAccessory:e,leftAccessory:i,rightAccessory:s}=this._getCalloutPartElements(t,o);this._accessory=new Af(this,{customElement:r,contentElement:a,ignoreCalloutCornerRadiusForLeftAccessory:e,leftAccessory:this.delegate.rtl?s:i,rightAccessory:this.delegate.rtl?i:s,rtl:this.delegate.rtl})}else if(i){const e=t._impl.selectionAccessory.style;if(e===Fp.OpenInMaps)this._accessory=new Rf(this,{place:t._impl.place,muid:t._impl.muid,coordinate:t.coordinate,title:t.title});else if(e===Fp.CompactCallout||e===Fp.FullCallout){const i=e===Fp.CompactCallout;this._accessory=new ty(this,{place:t._impl.place,muid:t._impl.muid,uiStyle:i?"compact":"full",side:this._findSideForAccessorySize(i?ty.DEFAULT_COMPACT_SIZE:ty.DEFAULT_FULL_SIZE)||(this.delegate.rtl?"right":"left"),rtl:this.delegate.rtl})}else{const i=this._findSideForAccessorySize(ty.DEFAULT_FULL_SIZE),s=this._findSideForAccessorySize(ty.DEFAULT_COMPACT_SIZE),o=i?"full":"compact",n=i||s;n||e===Fp.Callout?this._accessory=new ty(this,{place:t._impl.place,muid:t._impl.muid,uiStyle:o,side:n||(this.delegate.rtl?"right":"left"),rtl:this.delegate.rtl}):this._accessory=new Rf(this,{place:t._impl.place,muid:t._impl.muid,coordinate:t.coordinate,title:t.title})}}this._accessory.animates=!e&&(!Li(o,"calloutShouldAnimateForAnnotation")||!!jt(o.calloutShouldAnimateForAnnotation,o,[t],!0));const l=r&&this._accessory.animates&&Li(o,"calloutAppearanceAnimationForAnnotation")?jt(o.calloutAppearanceAnimationForAnnotation,o,[t],""):"";if(S(l,"string","[MapKit] calloutAppearanceAnimationForAnnotation() must return a string, but returned `"+l+"` instead."),this._accessory.appearanceAnimation=l,r){let e;Li(o,"calloutAnchorOffsetForAnnotation")&&(e=jt(o.calloutAnchorOffsetForAnnotation,o,[t,this._accessory.node.size]),L(e,window.DOMPoint,"[MapKit] calloutAnchorOffsetForAnnotation() must return a DOMPoint, but returned `"+String(e)+"` instead.")),this._accessory.setAnchorOffset(e)}if(this.updateAccessoryInfo(t),t===this.delegate.userLocationAnnotation){const t=this.delegate.constructor.AccuracyRingOverlay.getMode(this.delegate.map.worldSize,100);if(this._oldCenterMode=t,t){const t=this._accessory.getCenterOffset(!0);this._accessory.animateAnchorOffset(t,-1),this._accessory.animateTailScale(0,-1)}else this._accessory.animateAnchorOffset(new Pe(0,0),-1),this._accessory.animateTailScale(1,-1)}this.updateAccessoryPositionWithTailShift(t,!1);const h=!e&&this._nudgeMapToShowAccessory();this._accessory.willMoveToMap(),this._accessory.node.classList.add(oy),this.node.addChild(this._accessory.node),this._accessory.appearanceAnimation&&this.node.element.appendChild(this._accessory.node.element),h||this._accessory.animateIn()}hideAccessory(t,e){t._impl.selectionAccessoryWillDisappear(),this._accessory&&(this._accessory.node.classList.remove(oy),this._accessory.animateOut(e),delete this._accessory)}updateCenterMode(){const t=this.delegate.selectedItem===this.delegate.userLocationAnnotation,e=this.delegate.constructor.AccuracyRingOverlay.getMode(this.delegate.map.worldSize,100),i=this._oldCenterMode!==e;if(this._oldCenterMode=e,this._accessory&&t&&i)if(this._accessory.animateTailScale(e?0:1),e){const t=this._accessory.getCenterOffset();t.y=t.y-this.delegate.userLocationAnnotation._impl._node.size.height/4,this._accessory.animateAnchorOffset(t)}else this._accessory.animateAnchorOffset(new Pe(0,0))}sizeForElement(t){return this.delegate.sizeForElement(t)}backgroundColorForElement(t){return this.delegate.backgroundColorForElement(t)}setAnimationForElement(t,e,i){return this.delegate.setAnimationForElement(t,e,i)}annotationPropertyDidChange(){}accessorySizeDidChange(){this._nudgeMapToShowAccessory()}accessoryNodeDidRemove(t){ks&&t instanceof Af&&(t.isCustomCallout()&&"slot"===t.customOrContentElement?.localName&&this.delegate.removeElementAssignedToSlot(t.customOrContentElement),t.customLeftAccessory&&Si(t.customLeftAccessory,HTMLElement)&&"slot"===t.customLeftAccessory.localName&&this.delegate.removeElementAssignedToSlot(t.customLeftAccessory),t.customRightAccessory&&Si(t.customRightAccessory,HTMLElement)&&"slot"===t.customRightAccessory.localName&&this.delegate.removeElementAssignedToSlot(t.customRightAccessory))}updateAccessoryPositionWithTailShift(t,e){if(this.delegate.selectedItem===t&&this._accessory&&(this._accessory.setShown(t._impl.isShown()),this._accessory instanceof Af?this._accessory.setPosition(t._impl.positionForCallout()):this._accessory instanceof Rf?this._accessory.setPosition(t._impl.positionForSelectionAccessory("bottom",4)):this._accessory.setPositionWithSide(t._impl.positionForSelectionAccessory(this._accessory.side,ty.TAIL_DISTANCE_TO_ANCHOR),this._accessory.side),e)){return this.updateAccessoryTailShift(e)||void 0}}updateAccessoryInfo(t){this._accessory?this._accessory.updateInfo(t,12)||this.hideAccessory(t,!1):this.showAccessoryForAnnotation(t)}updateAccessoryTailShift(t){if(!this._accessory)return!1;const e=t?this._accessory.boundingRect.pad(12):this._boundingRectForSelectedAnnotationAndAccessory().pad(12),i=this._totalMapNudgingTranslation(e,this.delegate.map.ensureVisibleFrame(),t),s=i.x,o=i.y,n=this._accessory.shiftTailBy(s);return(0!==s||0!==o)&&new Pe(-(s+n),-o)}get tint(){return this.delegate.map.tint}mapNodeTintWasSet(t){this._accessory&&this._accessory.mapNodeTintWasSet(t)}mapRegionChangeWillStart(){this._waitingForRegionChangeToStart&&(this._nudgeStarted=!0,this._waitingForRegionChangeToEnd++)}mapRegionChangeDidEnd(){if(!this._waitingForRegionChangeToEnd)return;this._waitingForRegionChangeToEnd--;0!==this._waitingForRegionChangeToEnd&&this._nudgeMapToShowAccessory()?this._waitingForRegionChangeToEnd=1:(this._waitingForRegionChangeToEnd=0,this.updateAccessoryPositionWithTailShift(this.delegate.selectedItem,!0),this._accessory&&this._accessory.animateIn())}getMaximumSizeForAccessory(){const t=this.delegate.selectedItem._impl._node.size,e=this.delegate.map.ensureVisibleFrame().size.copy();return"left"===this._accessory.side||"right"===this._accessory.side?(e.width-=t.width+50+ty.TAIL_LENGTH+ty.TAIL_DISTANCE_TO_ANCHOR,e.height-=50):(e.width-=50,e.height-=t.height+50+ty.TAIL_LENGTH+ty.TAIL_DISTANCE_TO_ANCHOR),e}placeCardDidReveal(t,e){this.delegate.placeCardDidReveal(t,e)}placeCardOpenInMapsClicked(t,e){this.delegate.placeCardOpenInMapsClicked(t,e)}_findSideForAccessorySize(t){const e=this.delegate.selectedItem,i=e._impl._node,s=new ze(i.position.x,i.position.y,i.size.width,i.size.height).round(),o=this.delegate.map.ensureVisibleFrame(),n=e._impl.positionForSelectionAccessory("left",ty.TAIL_DISTANCE_TO_ANCHOR).y,a=s.minX()-o.minX(),r=o.maxX()-s.maxX();if(n+t.height/2<o.maxY()&&n-t.height/2>o.minY()){const e=t.width<a,i=t.width<r;if(e&&i)return a===r?this.delegate.rtl?"right":"left":a>r?"left":"right";if(e)return"left";if(i)return"right"}const l=s.minY()-o.minY();if(t.height<l)return"top";const h=o.maxY()-s.maxY();return t.height<h?"bottom":o.size.width-s.size.width>t.width+ty.TAIL_LENGTH+ty.TAIL_DISTANCE_TO_ANCHOR?a>=r?"left":"right":o.size.height-s.size.height>t.height+ty.TAIL_LENGTH+ty.TAIL_DISTANCE_TO_ANCHOR?l>=h?"top":"bottom":null}_canShowSelectionAccessoryForAnnotation(t){const e=t._impl.place;if(t._impl.selectionAccessory&&(e&&e.name&&e.coordinate||t.title&&t._impl.muid&&t.coordinate))return t._impl.canShowSelectionAccessory()?{showsSelectionAccessory:!0}:{showsSelectionAccessory:!1,showsCallout:!1};if(!t._impl.canShowCallout())return{showsSelectionAccessory:!1,showsCallout:!1};const i=t._impl.callout;if(i&&"function"==typeof i.calloutShouldAppearForAnnotation&&!jt(i.calloutShouldAppearForAnnotation.bind(i),i,[t],!0))return{showsSelectionAccessory:!1,showsCallout:!1};let s,o;
2if(Li(i,"calloutElementForAnnotation")&&(s=jt(i.calloutElementForAnnotation,i,[t]),zt(s,"[MapKit] calloutElementForAnnotation() must return a DOM element, but returned `"+String(s)+"` instead.")),!s){if(Li(i,"calloutContentForAnnotation")&&(o=jt(i.calloutContentForAnnotation,i,[t]),zt(o,"[MapKit] contentElementForAnnotation() must return a DOM element, but returned `"+String(o)+"` instead."),ks)){const t="mk-slot-"+Math.random().toString(32).substring(2,10);o.slot=t;const e=Fs("slot");e.name=t,this.delegate.appendElementAssignedToSlot(o),o=e}if(!Li(i,"calloutContentForAnnotation")&&!t.title)return{showsSelectionAccessory:!1,showsCallout:!1}}return{showsSelectionAccessory:!1,showsCallout:!0,calloutDelegate:i??void 0,customCalloutElement:s,customCalloutContentElement:o}}_getCalloutPartElements(t,e){let i,s;if(Li(e,"calloutLeftAccessoryForAnnotation")&&(i=jt(e.calloutLeftAccessoryForAnnotation,e,[t]),zt(i,"[MapKit] calloutLeftAccessoryForAnnotation() must return a DOM element, but returned `"+String(i)+"` instead."),ks)){const t="mk-slot-"+Math.random().toString(32).substr(2,8);i.slot=t;const e=Fs("slot");e.name=t,this.delegate.appendElementAssignedToSlot(i),i=e}if(Li(e,"calloutRightAccessoryForAnnotation")&&(s=jt(e.calloutRightAccessoryForAnnotation,e,[t]),zt(s,"[MapKit] calloutRightAccessoryForAnnotation() must return a DOM element, but returned `"+String(s)+"` instead."),ks)){const t="mk-slot-"+Math.random().toString(32).substring(2,10);s.slot=t;const e=Fs("slot");e.name=t,this.delegate.appendElementAssignedToSlot(s),s=e}const o=!(!function(t,e){return t&&e in t}(t._impl,"ignoreCalloutCornerRadiusForLeftAccessory")||!t._impl.ignoreCalloutCornerRadiusForLeftAccessory||Li(e,"calloutLeftAccessoryForAnnotation")||Li(e,"calloutRightAccessoryForAnnotation")),n=t._impl;return!Li(e,"calloutLeftAccessoryForAnnotation")&&"canvasForCalloutAccessory"in n&&n.canvasForCalloutAccessory&&(i=n.canvasForCalloutAccessory()),{ignoreCalloutCornerRadiusForLeftAccessory:o,leftAccessory:i,rightAccessory:s}}_boundingRectForSelectedAnnotationAndAccessory(){const t=this.getAccessoryBoundingRect
2(),e=this.delegate.selectedItem._impl.position(),i=Math.min(t.minX(),e.x),s=Math.min(t.minY(),e.y),o=Math.max(t.maxX(),e.x)-i,n=Math.max(t.maxY(),e.y)-s;return new ze(i,s,o,n)}_translationToFitInFrame(t,e){const i={x:0,y:0};return(t.maxX()>e.maxX()||t.minX()<e.minX()||t.maxY()>e.maxY()||t.minY()<e.minY())&&(i.x=t.minX()<e.minX()?t.minX()-e.minX():t.maxX()>e.maxX()?t.maxX()-e.maxX():0,i.y=t.minY()<e.minY()?t.minY()-e.minY():t.maxY()>e.maxY()?t.maxY()-e.maxY():0),i}_totalMapNudgingTranslation(t,e,i){const s=this._translationToFitInFrame(t,e),o=this.delegate.map.getControlBounds(),n=e.midX(),a=e.midY();let r=0,l=0;return t=ay(t,s.x,s.y),o.forEach((e=>{if(t.minX()<e.maxX()&&t.maxX()>e.minX()&&t.minY()<e.maxY()&&t.maxY()>e.minY()){if(r+=e.maxX()<n?t.minX()-e.maxX():t.maxX()-e.minX(),l+=e.maxY()<a?t.minY()-e.maxY():t.maxY()-e.minY(),i)return;0!==l&&Math.abs(r)>Math.abs(l)?r=0:l=0,t=ay(t,r,l)}}),this),s.x+=r,s.y+=l,s}_nudgeMapToShowAccessory(){if(this.delegate.map.cameraIsMoving)return this._waitingForRegionChangeToEnd++,!0;if(!this.delegate.selectedItem||!this.delegate.selectedItem._impl.isShown())return!1;const t=this.updateAccessoryPositionWithTailShift(this.delegate.selectedItem,!0);if(!t)return!1;this._waitingForRegionChangeToStart=!0,this.delegate.map.translateCameraAnimated(t,!0);const e=this._nudgeStarted;return delete this._nudgeStarted,this._waitingForRegionChangeToStart=!1,!!e}}function ay(t,e,i){return new ze(t.origin.x-e,t.origin.y-i,t.size.width,t.size.height)}function ry(t,e){hy(t,e),e.add(t)}function ly(t,e,i){hy(t,e),e.set(t,i)}function hy(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function cy(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function uy(t,e){var i=function(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}(t,e,"get");return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,i)}const py="mk-annotation-container",my="mk-annotations",gy="mk-dragging",_y="mk-selected",fy="mk-lifted",yy="mk-text-zoom";let vy=null;var by=new WeakMap,wy=new WeakSet,Cy=new WeakMap,ky=new WeakSet,Sy=new WeakMap,Ly=new WeakSet,My=new WeakMap,Ay=new WeakSet;class Ty extends um{constructor(t){super(t),ry(this,Ay),ry(this,Ly),ry(this,ky),ry(this,wy),dy(this,"_pendingAnnotations",void 0),dy(this,"_mapFeatureAnnotationController",void 0),dy(this,"_clustersController",void 0),dy(this,"_sceneGraphNode",void 0),dy(this,"_shadowDOMSlotController",void 0),dy(this,"_shadowRootNode",void 0),dy(this,"_annotationsNode",void 0),dy(this,"_selectionAccessoryController",void 0),dy(this,"_styleHelper",void 0),dy(this,"_annotationDraggingMapPanningController",void 0),dy(this,"_draggedAnnotation",void 0),dy(this,"_waitingAnnotations",void 0),dy(this,"_completionCallback",void 0),dy(this,"_lastGeocoderRequestCoordinate",void 0),dy(this,"_lastUserLocationAnnotationSubtitle",void 0),dy(this,"_pendingDragStart",void 0),dy(this,"_mapWasDestroyed",void 0),dy(this,"_annotationsDidChangeSinceLastCollision",void 0),dy(this,"itemConstructor",am),dy(this,"itemName","annotation"),dy(this,"capitalizedItemName","Annotation"),dy(this,"_rtl",!1),dy(this,"_selectionDistanceSquared",Math.pow(this._selectionDistance,2)),dy(this,"_userLocationAnnotation",null),dy(this,"_tileLoadingTimeout",void 0),ly(this,by,{writable:!0,value:()=>cy(this,wy,xy).call(this)}),ly(this,Cy,{writable:!0,value:()=>cy(this,ky,Ey).call(this)}),ly(this,Sy,{writable:!0,value:()=>cy(this,Ly,Iy).call(this)}),ly(this,My,{writable:!0,value:()=>cy(this,Ay,Oy).call(this)}),dy(this,"_geocoderRequestId",void 0),this._pendingAnnotations=[],this._mapFeatureAnnotationController=new Y_(this),this._clustersController=new s_(this),Nn.activeLocale&&(this._rtl=Nn.activeLocale.rtl),this._node=new Ri(Fs("div",{class:py})),Nn.activeLocale&&this._node.element.setAttribute("lang",Nn.localeId),this._shadowDOMSlotController=new gm(this._node);const e=Fs("div",{class:my});this._sceneGraphNode=new bm(e),this._shadowRootNode=Bs(this._node,Oe.shadowDOMMode,':host(.mk-annotation-container.mk-dragging) ::selection,div.mk-annotations ::selection{background:0 0}.mk-invisible{opacity:0;pointer-events:none}.mk-hidden{display:none}div.mk-annotations,div.mk-annotations>div,div.mk-selection-accessories,div.mk-style-helper{position:absolute;top:0;left:0}.mk-selected{z-index:1}.mk-lifted{z-index:2}.mk-callout,.mk-selection-accessory{position:absolute;top:0;left:0;-webkit-user-select:auto;user-select:text}.mk-callout:not(.mk-invisible),.mk-selection-accessory:not(.mk-invisible){pointer-events:auto}:host(.mk-annotation-container) .mk-selection-accessory,:host(.mk-annotation-container) .mk-selection-accessory-badge{font:16px s
2ans-serif;--font-size-default:16}:host(.mk-dark-mode) .mk-callout,:host(.mk-dark-mode) .mk-selection-accessory{color:#fff}:host(.mk-annotation-container.mk-text-zoom) .mk-selection-accessory,:host(.mk-annotation-container.mk-text-zoom) .mk-selection-accessory-badge{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-annotation-container.mk-text-zoom) .mk-selection-accessory,:host(.mk-annotation-container.mk-text-zoom) .mk-selection-accessory-badge{font:-apple-system-body;--font-size-default:17}}.mk-callout>*{position:absolute;top:0;left:0}svg.mk-bubble{display:block;width:100%;height:100%}svg.mk-selection-accessory-bubble{position:absolute;display:block;filter:drop-shadow(0 0 5px rgb(0 0 0 / 30%))}div.mk-callout-accessory{position:absolute;top:50%;transform:translateY(-50%);overflow:hidden}div.mk-callout-accessory-content{white-space:nowrap;position:relative;text-align:center;font-size:12px}div.mk-callout-accessory:first-child{left:0}div.mk-callout-accessory:last-child{right:0}div.mk-callout-accessory:first-child .mk-callout-accessory-content{padding-right:8px}div.mk-callout-accessory:last-child .mk-callout-accessory-content{padding-left:8px}div.mk-standard{font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif;box-sizing:border-box;position:relative}:host(.mk-annotation-container) .mk-standard-content{font:16px sans-serif;--font-size-default:16}:host(.mk-annotation-container.mk-text-zoom) .mk-standard-content{font:initial}@supports (font:-apple-system-body) and (-webkit-touch-callout:default){:host(.mk-annotation-container.mk-text-zoom) .mk-standard-content{font:-apple-system-body;--font-size-default:17}}div.mk-selection-accessory-content{box-sizing:border-box;position:relative;overflow:auto;color-scheme:light;top:0;left:0;border-radius:18px}div.mk-selection-accessory-content.mk-rtl{direction:rtl}.mk-ui-style-compact div.mk-selection-accessory-content{overflow:hidden}:host(.mk-dark-mode) div.mk-selection-accessory-content{color-scheme:dark}:host(.mk-panning) div.mk-selection-accessory-content{pointer-events:none}.mk-ui-style-compact div.mk-selection-accessory-content>div{width:243px}div.mk-custom-content,div.mk-standard{transform:translateY(-50%)}div.mk-standard .mk-callout-content>div{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}div.mk-standard .mk-callout-content{padding:0 4px}.mk-callout-content.mk-rtl{direction:rtl}.mk-callout-content.mk-rtl *{text-align:right}div.mk-callout-accessory:first-child+.mk-callout-content{padding-left:8px}div.mk-standard .mk-callout-content:nth-last-child(2){padding-right:8px}div.mk-standard .mk-title{font-size:calc(100% * 17 / var(--font-size-default));font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;color:#000;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.025em}:host(.mk-dark-mode) div.mk-standard .mk-title{color:#fff}div.mk-standard .mk-subtitle{font-size:calc(100% * 13 / var(--font-size-default));font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,sans-serif;color:rgb(0 0 0 / 70%);letter-spacing:.025em}:host(.mk-dark-mode) div.mk-standard .mk-subtitle{color:rgb(255 255 255 / 70%)}svg.mk-bubble path{fill:white;stroke:rgb(0 0 0 / 20%)}svg.mk-selection-accessory-bubble path{fill:rgb(239 239 239);stroke:rgb(239 239 239 / 70%);stroke-width:2px}:host(.mk-dark-mode) svg.mk-bubble path{fill:#3e3e3e;stroke:rgb(0 0 0 / 50%)}:host(.mk-dark-mode) svg.mk-selection-accessory-bubble path{fill:rgb(54 54 54);stroke:rgb(54 54 54 / 70%);stroke-width:2px}.mk-selection-accessory-loading{display:block;width:100%;height:100%}.mk-selection-accessory-failed{display:flex;height:100%;align-items:center;justify-content:center;color:#000;opacity:.55;font-family:-apple-system-font,"Helvetica Neue",Helvetica,Arial,sans-serif}:host(.mk-dark-mode) .mk-selection-accessory-failed{color:#fff}.mk-selection-accessory-failed .mk-failed-labels{padding:0 20px}.mk-ui-style-compact .mk-selection-accessory-failed .mk-failed-labels{flex-grow:1}.mk-selection-accessory-failed p{margin:0;font-size:calc(100% * 12 / var(--font-size-default));font-weight:400}.mk-ui-style-full .mk-selection-accessory-failed p{margin:2px 0;text-align:center}.mk-selection-accessory-failed p:first-child{font-size:calc(100% * 14 / var(--font-size-default));font-weight:500}.mk-ui-style-compact .mk-selection-accessory-failed p:first-child{margin-top:10px}.mk-ui-style-compact .mk-selection-accessory-failed p:last-child{margin-bottom:10px}.mk-ui-style-full .mk-selection-accessory-failed p:first-child{margin-top:60px}.mk-ui-style-full .mk-selection-accessory-failed p:last-child{margin-bottom:60px}.mk-selection-accessory-badge-content{cursor:pointer;padding:4px 8px;font-size:calc(100% * 13 / var(--font-size-default));font-family:13px -apple-system-font,HelveticaNeue-Medium,Helvetica,Arial,sans-serif;font-weight:500;border:1px solid rgb(0 0 0 / 10%);border-radius:13px;color:#007aff;background-color:rgb(255 255 255);box-shadow:0 0 5px 0 rgb(0 0 0 / 30%);animation:fade-in .5s}.mk-selection-accessory-badge-content.mk-fade-out{transition:visibility .5s,opacity .5s;opacity:0;visibility:hidden}.mk-selection-accessory-badge-content span{opacity:.8}.mk-selection-accessory-badge-content:hover span{opacity:1}.mk-selection-accessory-badge-content:active{background-color:rgb(229 229 229)}.mk-selection-accessory-badge-content:focus-visible{outline:0;background-color:rgb(204 229 255);box-shadow:0 0 5px 0 rgb(0 0 0 / 30%),0 0 0 2px rgb(0 124 255)}.mk-selection-accessory-badge-content:active:focus-visible{background-color:rgb(127 189 255)}@keyframes fade-in{from{opacity:0}
2to{opacity:1}}:host(.mk-dark-mode) .mk-selection-accessory-badge-content{color:#0a84ff;background-color:rgb(54 54 54)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:active{background-color:rgb(42 42 42)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:focus-visible{background-color:rgb(12 49 89)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:active:focus-visible{color:#64b1ff;background-color:rgb(3 102 207)}@supports ((backdrop-filter:blur(30px)) or (-webkit-backdrop-filter:blur(30px))){.mk-selection-accessory-badge-content{-webkit-backdrop-filter:blur(30px);backdrop-filter:blur(30px);background-color:rgb(255 255 255 / 75%)}.mk-selection-accessory-badge-content:active{background-color:rgb(229 229 229 / 60%)}.mk-selection-accessory-badge-content:focus-visible{background-color:rgb(204 229 255 / 60%)}.mk-selection-accessory-badge-content:active:focus-visible{background-color:rgb(127 189 255 / 60%)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content{background-color:rgb(18 18 18 / 60%)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:active{background-color:rgb(42 42 42 / 60%)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:focus-visible{background-color:rgb(12 49 89 / 60%)}:host(.mk-dark-mode) .mk-selection-accessory-badge-content:active:focus-visible{background-color:rgb(3 102 207 / 60%)}}',Oe.nonce),this._annotationsNode=this._shadowRootNode.addChild(new Ri(e)),this._selectionAccessoryController=new ny(this),this._shadowRootNode.addChild(this._selectionAccessoryController.node),this._styleHelper=new fm(this),this._shadowRootNode.addChild(new Ri(this._styleHelper.element)),this._annotationDraggingMapPanningController=new vm(t),this.textZoom=t.textZoom}isItemExposed(t){return t!==this._userLocationAnnotation&&!t.memberAnnotations}get map(){return this._map}get userLocationAnnotation(){return this._userLocationAnnotation}get dragging(){return!!this._draggedAnnotation}get rtl(){return this._rtl}set rtl(t){this._rtl!==t&&(this._rtl=t,this._selectedItem&&this._selectionAccessoryController&&this._selectionAccessoryController.accessoryIsShown&&this._selectionAccessoryController.showAccessoryForAnnotation(this._selectedItem,!0))}get textZoom(){return this._node.classList.contains(yy)}set textZoom(t){this._node.classList.toggle(yy,t)}preAddedAnnotation(t){t._impl.updatedPosition();const e=!t.map,i=ks&&this._annotationsNode&&t._impl.renderedByDOMElement&&!t.element.parentNode;return i&&this._shadowDOMSlotController.appendAssignedElement(t.element,!1),e&&t._impl.setDelegate(this),e||i}resetAnnotation(t){ks&&this._annotationsNode&&t._impl.renderedByDOMElement&&t.element.parentNode&&this._shadowDOMSlotController.removeAssignedElement(t._impl.elementInAnnotationDOM,!1),this._items.includes(t)||(t._impl.delegate=null)}addItems(t){t=super.addItems(t);if(this._shouldAnnotationBePending())return t;t.sort(((t,e)=>e.coordinate.latitude-t.coordinate.latitude));const e=this._map.camera.toMapRect(),i=e.size.width,s=e.size.height,o=e.origin.x-i,n=o+3*i,a=e.origin.y-s,r=a+3*s;let l=0;t.forEach((t=>{if(t._impl.doesAnimate()&&t.visible){t._impl.x+(t._impl.x<o?1:0)<=n&&t._impl.y>=a&&t._impl.y<=r&&(t._impl.delayRank=l,++l)}}));const h=Math.min(50*l,3e3),d=0===l?0:h/l;return t.forEach((t=>{t._impl.delayMs=t._impl.delayRank*d,delete t._impl.delayRank})),t}addWaitingAnnotations(t){if(this._completionCallback=t,!this._waitingAnnotations)return void this._checkCompletion();window.clearTimeout(this._tileLoadingTimeout),delete this._tileLoadingTimeout;const e="function"==typeof t;this._waitingAnnotations.forEach((t=>{t.map&&this._addAnnotationWaitingForTiles(t,!1,!e)})),this._updateSceneGraph(),delete this._waitingAnnotations,si((()=>this._updateAfterCompletion()))}annotationsInMapRect(t){L(t,ot,"[MapKit] Map.annotationsInMapRect expects a MapRect as its argument, got `"+String(t)+"` instead.");const e=b(t.origin.x,1),i=e+t.size.width,s=t.origin.y,o=s+t.size.height;return this._items.filter((t=>{if(!this.isItemExposed(t))return!1;const n=t._impl.x+(t._impl.x<e?1:0),a=t._impl.y;return n>=e&&n<=i&&a>=s&&a<=o}))}removeItem(t){return t===this._userLocationAnnotation?(console.warn("[MapKit] Map.removeAnnotation: the user location annotation cannot be removed. Set showsUserLocation to fal
2se instead."),t):super.removeItem(t)}removeUserLocationAnnotation(){this._userLocationAnnotation&&(this._userLocationAnnotation._impl.removedFromMap(),super.removeAnyItem(this._userLocationAnnotation),this._userLocationAnnotation=null)}updateUserLocationAnnotation(t,e){if(!t.coordinate)return;const i=this._userLocationAnnotation||new Ty.UserLocationAnnotation(t);if(this._userLocationAnnotation||(this._userLocationAnnotation=i,this.addItem(i,0)),t.stale)return delete this._lastGeocoderRequestCoordinate,delete this._lastUserLocationAnnotationSubtitle,void(i._impl.stale=!0);if(i._impl.stale=!1,i._impl.setCoordinate(t.coordinate),vy){if(!e&&this._lastGeocoderRequestCoordinate&&this._lastGeocoderRequestCoordinate.latitude===i._impl.coordinate.latitude&&this._lastGeocoderRequestCoordinate.longitude===i._impl.coordinate.longitude)return void(this._userLocationAnnotation.subtitle=this._lastUserLocationAnnotationSubtitle)}else vy=new Ty.Geocoder;this._lastGeocoderRequestCoordinate=i._impl.coordinate.copy(),Py(vy,i,this)}mapSizeDidUpdate(){if(0===this._pendingAnnotations.length)return;const t=this._map.shouldWaitForTilesAndControls();this._pendingAnnotations.forEach((e=>{e._impl.isPending&&this._addAnnotationWaitingForTiles(e,t)})),this._updateSceneGraph(),this._pendingAnnotations=[]}updateVisibleAnnotations(){0!==this._items.length&&(this._updateVisibleAnnotations(this._items),this._updateSceneGraph())}startDraggingAnnotation(t){this._map.annotationDraggingWillStart(),this._draggedAnnotation=t,this._pendingDragStart=!0,t.selected&&this._selectionAccessoryController.hideAccessory(t),this._node.classList.add(gy),this._draggedAnnotation._impl.node.classList.add(fy),this._draggedAnnotation._impl.lift(),this._updateSceneGraph()}mapNodeTintWasSet(t){this._items.forEach((t=>{t._impl.updateLayout()})),this._selectionAccessoryController.mapNodeTintWasSet(t)}mapTypeDidChange(){this._mapFeatureAnnotationController.mapTypeDidChange()}fontSizeDidChange(){this._items.forEach((t=>{t._impl.updateLayout(!1,!0)}))}devicePixelRatioDidChange(){this._items.forEach((t=>{"updateGlyphImages"in t._impl&&t._impl.updateGlyphImages()}))}styleHelperNodeDidMoveToParent(t){if(!ks)return;const e="assignedNodes"in t?t:t.querySelector("slot"),i=e&&this._shadowDOMSlotController.getAssignedElement(e);e&&i&&i.parentNode&&0===e.assignedNodes().length&&(this._node.element.removeChild(i),this._node.element.appendChild(i))}getShadowDOMTargetFromEvent(t){if(this._shadowRootNode.domNode)return Ws(this._shadowRootNode.domNode,t)}performScheduledUpdate(){this.dispatchDraggingEvent()}dispatchDraggingEvent(){if(!this._draggedAnnotation||this._mapWasDestroyed)return;const t=this._draggedAnnotation._impl.dispatchDraggingEvent();this._map.dispatchEventWithAnnotation(t.type,this._draggedAnnotation,{coordinate:t.coordinate})}addedItem(t,e){for(const e of t._impl.getMuidList())this.map.setPoiFiltered(e,!0);t._impl.setDelegate(this),t._impl.addedToMap(),t._impl.isWaiting=!0,e&&(t._impl.delayRank=0);const i=this._shouldAnnotationBePending(t);i&&(t._impl.isPending=!0,this._pendingAnnotations.push(t)),this._updateAnnotation(t),t._impl.selected&&this._didSelectAnnotation(t),i||this._addAnnotationWaitingForTiles(t,this._map.shouldWaitForTilesAndControls())}manyItemsAdded(){this._updateSceneGraph()}removedItem(t,e){for(const e of t._impl.getMuidList())this.map.setPoiFiltered(e,!1);delete t._impl.wasCollided,ks&&t._impl.node.parent&&this._shadowDOMSlotController.removeAssignedElement(t._impl.elementInAnnotationDOM,!t._impl.renderedByDOMElement),t._impl.node.remove(),super.removedItem(t),t._impl.removedFromMap(),t._impl.labelRegion&&this._removeLabelRegionForAnnotation(t),e||this._updateVisibleAnnotations([t]),this._clustersController.removedAnnotation(t),t.memberAnnotations||this._updateCollisions(this._items)}manyItemsRemoved(){this._updateVisibleAnnotations(this.items),this._updateSceneGraph()}manyItemsChanged(){this._updateVisibleAnnotations(this.items),this._updateSceneGraph()}removedReferenceToMap(){this._userLocationAnnotation&&this._userLocationAnnotation._impl.removedFromMap()}pickableItemsCloseToPoint(t,e){const i=t.filter(((t,i)=>{const s=t._impl.distanceToPoint(e);return s<=this._selectionDistanceSquared&&(t._impl.distance=s,t._impl.index=i,!0)})).sort(((t,e)=>t._impl.distance-e._impl.distance||e._impl.index-t._impl.index));
2return i.forEach((t=>{delete t._impl.distance,delete t._impl.index})),i}annotationDraggingDidChange(t){this._draggedAnnotation&&!this._draggedAnnotation._impl.shouldPreventDrag&&(this._pendingDragStart&&(delete this._pendingDragStart,this._draggedAnnotation._impl.draggingDidStart(),this._map.dispatchEventWithAnnotation(Hp.DragStart,this._draggedAnnotation)),ii(this),this._draggedAnnotation._impl.setDraggingTranslationForMapFrameSize(t,this._map.ensureRenderingFrame().size),this._annotationDraggingMapPanningController.update(this._draggedAnnotation,this._draggedAnnotation._impl.node))}annotationDraggingDidEnd(t){this._draggedAnnotation&&(this._annotationDraggingMapPanningController.stop(),this._draggedAnnotation._impl.dropAfterDraggingAndRevertPosition(!t),this._draggedAnnotation._impl.node.classList.remove(fy),this._node.classList.remove(gy),this._map.annotationDraggingDidEnd(),this._map.dispatchEventWithAnnotation(Hp.DragEnd,this._draggedAnnotation),delete this._draggedAnnotation,this._updateSceneGraph())}annotationPropertyDidChange(t,e){const i=t._public;switch(e){case"selected":i.selected?this._didSelectAnnotation(i):this._didDeselectAnnotation(i);break;case"coordinate":i._impl.updatedPosition();break;case"":case"collisionMode":case"padding":case"size":break;case"calloutOffset":0,this._selectionAccessoryController.updateAccessoryPositionWithTailShift(i,!0);break;case"selectionAccessoryOffset":0;break;case"clusteringIdentifier":case"displayPriority":case"visible":this._selectedItem===i&&this._selectionAccessoryController.selectedAnnotationVisibilityDidChange(i),i._impl.needsColliding=!0;break;case"draggable":this._draggedAnnotation!==i||i.draggable||this._map.stopDraggingAnnotation();break;case"title":case"subtitle":this._selectedItem===i&&(this._selectionAccessoryController.updateAccessoryInfo(i),this._selectionAccessoryController.updateAccessoryTailShift())}i.map&&i.map===this._map.public&&(this._annotationsDidChangeSinceLastCollision=!0,this._updateVisibleAnnotations([i]),this._updateSceneGraph(),this._updateLabelRegionForAnnotation(i))}mapForAnnotation(){return this._map?this._map.public:null}sizeForElement(t){if(this._map.isRooted())return this._styleHelper.sizeForElement(t)}backgroundColorForElement(t,e){return this._styleHelper.backgroundColorForElement(t,e)}setAnimationForElement(t,e,i){return this._styleHelper.setAnimationForElement(t,e,i)}selectedAnnotationDidMoveToMap(t){this._updateSceneGraph(),this._selectionAccessoryController.showAccessoryForAnnotation(t)}supportsLabelRegions(){return this._map.supportsLabelRegions()}annotationFinishedAnimating(){this._updateAfterCompletion()}isElementInAccessory(t){return this._selectionAccessoryController.isElementInAccessory(t)}isElementInCustomCallout(t){return this._selectionAccessoryController.isElementInCustomCallout(t)}mapPanningDuringAnnotationDrag(){this.dispatchDraggingEvent()}mapSupportForLabelRegionsAdded(){this._items.forEach((t=>{t._impl.updateLayout(),this._updateLabelRegionForAnnotation(t)}))}mapSupportForLabelRegionsUpdated(){this.mapSupportForLabelRegionsAdded()}mapSupportForLabelRegionsRemoved(){this._items.forEach((t=>{delete t._impl.labelRegion}))}containsMarkerAnnotation(){return this._items.some((t=>"glyphText"in t))}paddingForAnnotation(t){let e=0,i=0;t.size?(e=t.size.width,i=t.size.height):console.warn("[MapKit] Computing padding for showItems() when an annotation was not yet added the DOM can cause the annotation to not be entirely visible. The `size` property of the annotation can be changed to ensure that it shows up properly.");const s={top:t._impl._anchorPoint.y,right:e-t._impl._anchorPoint.x,bottom:i-t._impl._anchorPoint.y,left:t._impl._anchorPoint.x};if(t===this.selectedItem&&(this._selectionAccessoryController,this._selectionAccessoryController.accessoryIsShown)){const e=this._selectionAccessoryController.getAccessoryBoundingRect
2(),i=t._impl.position();s.top=Math.max(s.top,i.y-e.minY()),s.right=Math.max(s.right,e.maxX()-i.x),s.bottom=Math.max(s.bottom,e.maxY()-i.y),s.left=Math.max(s.left,i.x-e.minX())}return s}appendElementAssignedToSlot(t){this._shadowDOMSlotController.appendAssignedElement(t)}removeElementAssignedToSlot(t){this._shadowDOMSlotController.removeAssignedElement(t)}mapFeatureRegionCloseToPoint(t,e){if(!e.length)return;let i,s,o=1/0;for(const n of e){const e=new it(n.position[0],n.position[1]);this.map.wrapMapPointToViewport(e);const a=this.map.camera.transformMapPoint(e);for(const e of n.rects){const r=e.size,l=a.x+e.offset[0],h=a.y+e.offset[1];if(l<t.x&&t.x<l+r[0]&&h<t.y&&t.y<h+r[1]){i=n;break}const d=l,c=d+r[0],u=d-t.x,p=c-t.x,m=u<=0&&p>=0?0:Math.min(Math.abs(u),Math.abs(p)),g=h,_=g+r[1],f=g-t.y,y=_-t.y,v=f<=0&&y>=0?0:Math.min(Math.abs(f),Math.abs(y)),b=m*m+v*v;o>b&&(o=b,s=n)}if(i)break;if(n.circles&&n.circles.length){const e=this.map.ensureRenderingFrame().size.height;for(const a of n.circles){const r=a.x,l=e-a.y,h=a.radius,d=Math.abs(t.x-r),c=Math.abs(t.y-l),u=d*d+c*c;if(u<h*h){i=n;break}o>u&&(o=u,s=n)}}if(i)break}return i||(s&&o<this._selectionDistanceSquared?s:void 0)}getMapFeatureAnnotationForRegion(t,e){return this._mapFeatureAnnotationController.getMapFeatureAnnotationForRegion(t,e)}mapFeatureDidSelect(t){this._mapFeatureAnnotationController.mapFeatureDidSelect(t)}mapRegionChangeWillStart(){this._selectionAccessoryController.mapRegionChangeWillStart()}mapRegionChangeDidEnd(){this._selectionAccessoryController.mapRegionChangeDidEnd()}localeChanged(){this._node.setAttribute("lang",Nn.localeId),this.rtl=Nn.activeLocale.rtl}placeCardDidReveal(t,e){this._map.annotationPlaceSelectionAccessoryDidReveal(t,e)}placeCardOpenInMapsClicked(t,e){this._map.annotationPlaceSelectionAccessoryOpenInMapsClicked(t,e)}_addAnnotationToMapAsync(t){this._addAnnotationToMap(t,!1),this._updateSceneGraph()}_addAnnotationToMap(t,e){if(this._shouldAnnotationBePending())return void(t._impl.isPending=!0);ks&&this._annotationsNode&&this._shadowDOMSlotController.appendAssignedElement(t.element,!t._impl.renderedByDOMElement),t._impl.willMoveToMap(t._impl.canAnimate&&!e),delete t._impl.timeout,delete t._impl.isWaiting,delete t._impl.canAnimate,delete t._impl.delayMs;const i=this._items.indexOf(t);this._annotationsNode&&this._annotationsNode.addChild(t._impl.node,i),t._impl.sceneGraphNode&&this._sceneGraphNode.addChild(t._impl.sceneGraphNode,i),this._updateAnnotation(t),t.selected&&this._selectionAccessoryController.showAccessoryForAnnotation(t),this._updateLabelRegionForAnnotation(t),t._impl.didMoveToMap()}_addAnnotationWaitingForTiles(t,e,i){if(void 0===t._impl.canAnimate&&(t._impl.canAnimate=!t._impl.isPending),delete t._impl.isPending,e&&t!==this._userLocationAnnotation){if(!this._items.some((t=>t!==this._userLocationAnnotation&&t._impl.mayBeDrawn())))return void(this._waitingAnnotations?this._waitingAnnotations.push(t):(this._waitingAnnotations=[t],this._tileLoadingTimeout=setTimeout((()=>this.addWaitingAnnotations(v)),3e3)))}!i&&t._impl.doesAnimate()&&void 0!==t._impl.delayMs&&t._impl.delayMs>0?t._impl.timeout=setTimeout((()=>this._addAnnotationToMapAsync(t)),t._impl.delayMs):this._addAnnotationToMap(t,i)}_didDeselectAnnotation(t){t._impl.node.classList.remove(_y),this.selectedItem=null,this._selectionAccessoryController.hideAccessory(t),this._map.annotationSelectionDidChange(t),this._mapFeatureAnnotationController.annotationSelectionDidChange(t)}_didSelectAnnotation(t){t._impl.node.classList.add(_y),this.selectedItem=t,this._map.annotationSelectionDidChange(t),this._mapFeatureAnnotationController.annotationSelectionDidChange(t),t._impl.visible&&this._selectionAccessoryController.showAccessoryForAnnotation(t)}_shouldAnnotationBePending(){return!this._map.isRooted()}mapWasDestroyed(){super.mapWasDestroyed(),this._annotationDraggingMapPanningController&&this._annotationDraggingMapPanningController.mapWasDestroyed(),this._clustersController.mapWasDestroyed(),this._mapWasDestroyed=!0}_updateLabelRegionForAnnotation(t){const e=t._impl;if(!e.shouldHideLabels||void 0===e.x||void 0===e.y)return;e.labelRegion||(e.labelRegion=this._map.createLabelRegion());const i=e.labelRegion;if(i){const t=e.node.size,s=t.width,o=t.height;i.x=null==e.visibleX?e.x:e.visibleX,i.y=1-e.y,i.width=s,i.height=o,i.xOffset=s/2-e._anchorPoint.x-e._anchorOffset.x,i.yOffset=e._anchorPoint.y+e._anchorOffset.y-o/2,this._map.updatedLabelRegion()}}_removeLabelRegionForAnnotation(t){this._map.unregisterLabelRegion(t._impl.labelRegion),delete t._impl.labelRegion}_updateVisibleAnnotations(t,e){e||this._deletePreviousPointForPickingItem();const i=this._userLocationAnnotation,s=this._map;if(i){0;const t=Ty.AccuracyRingOverlay.getMode(s.worldSize);i._impl.isRingMode=t,this._selectionAccessoryController.updateCenterMode()}const o=s.camera.toRenderingMapRect(),n=o.size.width,a=Math.min(1.5*n,.5),r=o.midX(),l=o.size.height,h=o.minY()-l,d=h+3*l;t.forEach((t=>{if(t===this._draggedAnnotation&&this._annotationDraggingMapPanningController.panning)return;let e=NaN;const i=t._impl.y;if(n>0&&l>0&&void 0!==i&&i>=h&&i<=d){const i=t._impl.x,o=t.anchorOffset.x/s.worldSize;let n=a;for(let t=-1;t<=1;++t){const s=Math.abs(i-o+t-r);s<n&&(n=s,e=i+t)}}isNaN(e)?t._impl.setShown(!1):(t._impl.isShown()||t!==this._selectedItem||this._selectionAccessoryController.showAccessoryForAnnotation(t,!0),t._impl.setShown(!0),t._impl.setPosition(s.adjustMapItemPoint(s.camera.transformMapPoint(new Pe(e,i)))),t._impl.visibleX!==e&&(t._impl.visibleX=e,this._updateLabelRegionForAnnotation(t)))})),this._selectionAccessoryController.updateAccessoryPositionWithTailShift(this._selectedItem,!0),e||this._updateCollisions(t)}_updateCollisions(){ii(uy(this,by))}addCluster(t){let e="function"==typeof this._map.annotationForCluster?jt(this._map.annotationForCluster,this._map.public,[t],void 0):t;return e&&e instanceof am||(console.warn("[MapKit] Expects Map.annotationForCluster to return an annotation."),e=t),e=this._cluster
2sController.setRequiredClusterAnnotationProperties(e,t),this.addItem(e),e._impl.updateLayout(!0),this._updateLabelRegionForAnnotation(e),e}willUpdateCollisions(){this._items.forEach((t=>{t._impl.wasOccluded=t._impl.occluded,t._impl.previousCluster=t._impl.cluster}))}didUpdateCollisions(){this._items.forEach((t=>{const e=t._impl;e.wasCollided||e.occluded||(e.wasCollided=!0),t.memberAnnotations&&t.memberAnnotations[0]&&t.memberAnnotations[0]._impl.cluster!==t&&(e.cluster=e.memberAnnotations[0]._impl.cluster),e.updateVisibility(e.occluded),e.occluded!==e.wasOccluded&&e.animateOcclusion(),delete e.previousCluster,e.shouldHideLabels&&(e.occluded||e.labelRegion?e.occluded&&e.labelRegion&&this._removeLabelRegionForAnnotation(t):this._updateLabelRegionForAnnotation(t))})),this._items.forEach((t=>{delete t._impl.wasOccluded})),this._updateVisibleAnnotations(this._items,!0),this._updateSceneGraph()}deselectClusterAnnotation(){this._selectedItem&&this._selectedItem.memberAnnotations&&(this._selectedItem.selected=!1)}_updateAnnotation(t){t._impl.updatedPosition(),this._updateVisibleAnnotations([t])}_updateSceneGraph(){ii(uy(this,Cy))}_checkCompletion(){this._mapWasDestroyed||ii(uy(this,My))}_updateAfterCompletion(){this._mapWasDestroyed||ii(uy(this,Sy))}}function xy(){if(this._mapWasDestroyed)return;let t=!1;const e=this._items.filter((e=>{const i=e.visible&&e._impl.isShown(),s=i||e._impl.needsColliding;return s&&(e._impl.needsColliding||e.displayPriority<am.DisplayPriority.Required||e.clusteringIdentifier)&&(t=!0),delete e._impl.needsColliding,s&&i&&!e.memberAnnotations}));if(t&&e.length){const t=this._map;this._clustersController.collideAnnotations(e,t.zoomLevel,t.rotation,this._annotationsDidChangeSinceLastCollision)}this._annotationsDidChangeSinceLastCollision=!1}function Ey(){if(this._mapWasDestroyed)return;const t=this._selectedItem,e=this._draggedAnnotation,i=this._items.filter((i=>i._impl.isDrawn()&&i!==t&&i!==e)).map((t=>t._impl.sceneGraphNode));t&&t._impl.isDrawn()&&i.push(t._impl.sceneGraphNode),e&&e._impl.isDrawn()&&i.push(e._impl.sceneGraphNode),this._sceneGraphNode.children=i}function Iy(){this._mapWasDestroyed||(this._annotationsDidChangeSinceLastCollision=!0,this._updateVisibleAnnotations(this._items),this._updateSceneGraph(),this._checkCompletion())}function Oy(){if(this._mapWasDestroyed)return;if(!this._completionCallback)return;const t=this._items.some((t=>!t._impl.isStable()));t||"function"!=typeof this._completionCallback||(this._completionCallback(),delete this._completionCallback)}dy(Ty,"Geocoder",void 0),dy(Ty,"Annotation",void 0),dy(Ty,"AccuracyRingOverlay",void 0),dy(Ty,"UserLocationAnnotation",void 0),Ty.Annotation=am;const Py=Oo(((t,e,i)=>{i._geocoderRequestId&&t.cancel(i._geocoderRequestId);const s=t.reverseLookup(e._impl.coordinate,((t,o)=>{if(s===i._geocoderRequestId)if(delete i._geocoderRequestId,t)console.error("[MapKit] Error getting address for user location: "+t.message),delete e.subtitle;else if(o&&o.results.length>0){const t=o.results[0];i._lastUserLocationAnnotationSubtitle=e.subtitle=t.formattedAddress}else delete e.subtitle}));i._geocoderRequestId=s}),1e3),Ry=["UserLocationAnnotation","AccuracyRingOverlay","Geocoder"];function zy(){let t=!0;for(let e=0;e<Ry.length;e++){const i=Ry[e];!Ty[i]&&u.jsModules[i]?Object.assign(Ty,$c(u.jsModules,[i])):t=!1}t&&u.removeEventListener("load",zy)}u.addEventListener("load",zy),zy();function Dy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Ny{constructor(t){Dy(this,"_realAnnotation",void 0),Dy(this,"selected",!1),Dy(this,"warnOnUnselectedGlyphImageAccess",!1),Dy(this,"glyphText",""),Dy(this,"gradientColors",null),Dy(this,"useSquareBalloon",!1),this._realAnnotation=t}get map(){return this._realAnnotation.map}get glyphColor(){const t=this._realAnnotation.map;return t?qg.DefaultGlyphColor[t._impl.currentColorScheme]:qg.DefaultGlyphColor.light}get isAppStyle(){return!1}get isPlaceStyle(){return!1}get balloonVisible(){return!0}get selectedFillColor(){return this.fillColor}get fillColor(){const t=this._realAnnotation.map;return t?qg.DefaultColor[t._impl.currentColorScheme]:qg.DefaultColor.light}get fillWithGradient(){return!0}get selectedStrokeColor(){return this.defaultStrokeColor}get strokeColor(){return this.defaultStrokeColor}get defaultStrokeColor(){const t=this._realAnnotation.map;return t?qg.DefaultStrokeColor[t._impl.currentColorScheme]:qg.DefaultStrokeColor.light}}class Fy extends ts{constructor(t){super(),Dy(this,"_realAnnotation",void 0),Dy(this,"annotation",void 0),Dy(this,"_renderer",void 0),Dy(this,"enablesDefaultGlyphImage",!0),Dy(this,"state","default"),Dy(this,"selected",!1),Dy(this,"warnOnUnselectedGlyphImageAccess",!1),Dy(this,"glyphImage",void 0),Dy(this,"selectedGlyphImage",void 0),Dy(this,"params",xg.Params.default),this._realAnnotation=t,this.annotation=new Ny(t),this._renderer=new Hm(this);const e=2*this.params.balloonRadius;this.size=new at(e,this.params.height+this.params.offset),this._renderer.isFallbackGlyphTextPending&&this._renderer.addPendingNode(this),this.needsDisplay=!0}get position(){return this._realAnnotation.nodePosition()}get frozen(){return!0}glyphImageError(){}stringInfo(){return"ImageAnnotationFallbackNode"}freeze(){}}function Uy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Wy extends go{injectDefaultImage(t,e){0}constructor(t){super(),Uy(this,"_annotation",void 0),Uy(this,"injectedDefaultImage",void 0),Uy(this,"injectedDefaultImageScale",void 0),this._annotation=t}get position(){return this._annotation.nodePosition()}}function Gy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function By(t){var e;class i extends t{constructor(e,i,s){super(e,i,t.div,s),Gy(this,"_waitingForImageSize",void 0),Gy(this,"_url",void 0),Gy(this,"_pendingGlyphImage",void 0),Gy(this,"_ratio",void 0),Gy(this,"_pendingImage",null)}init(){if(this._sceneGraphNode=new Wy(this),super.init(),!this.url)throw new Error("[MapKit] No URL for image of ImageAnnotation");this._waitingForImageSize=!this._userSetSize,this._setSceneGraphNode()}get url(){return this._url}set url(t){this._pendingGlyphImage=t,wm(t,(e=>
2{if(this._pendingGlyphImage!==t)return;if(delete this._pendingGlyphImage,!e)throw new Error("[MapKit] No URL for image of ImageAnnotation");const i=e.ratio,s=e.glyphImageUrl;this._ratio=i,this._url=t,this._setSceneGraphNode(),this._removeImageEventListener();const o=Fs("img",{src:s});o.complete?(this._sceneGraphNode.setImage(o,s),this.updateSize()):(this._userSetSize||(this._waitingForImageSize=!0),this._pendingImage={image:o,url:s},this._addImageEventListener())})),this._url=t}centerOffsetForSelectionAccessory(){return this._sceneGraphNode instanceof Wy?super.centerOffsetForSelectionAccessory():new Pe(-this._sceneGraphNode.params.balloonRadius,-this._sceneGraphNode.params.balloonRadius)}positionForCallout(){if(this._sceneGraphNode instanceof Wy)return super.positionForCallout();const t=this._node.size,e=new Pe(-t.width/2,0),i=this.nodePosition(),s=new Pe(0,1);return new Pe(i.x-e.x-s.x,i.y-e.y-s.y)}calculateNodePosition(){return this._sceneGraphNode instanceof Wy?super.calculateNodePosition():new Pe(this._position.x-this._anchorPoint.x,this._position.y-this._anchorPoint.y)}handleEvent(t){switch(t.type){case"load":this._removeImageEventListener(),this._sceneGraphNode.setImage(this._pendingImage.image,this._pendingImage.url),this._pendingImage=null,this._handleImageLoaded();break;case"error":this._removeImageEventListener(),this._sceneGraphNode.setImage(this._pendingImage.image,this._pendingImage.url),this._pendingImage=null,this._handleImageError();break;default:return void super.handleEvent(t)}}resetNodeTransform(){this.sceneGraphNode.transform=new gi}updateSize(){let t;if(this._waitingForImageSize=!1,this._sceneGraphNode instanceof Wy){if(this._userSetSize)t=this._node.size;else{const e=this._sceneGraphNode.image;t=e instanceof HTMLImageElement?new at(e.naturalWidth/this._ratio,e.naturalHeight/this._ratio):new at(e.width,e.height),this.setSize(t)}this._sceneGraphNode.size=t}else t=this._sceneGraphNode.size,this._userSetSize&&console.warn("[MapKit] Size set on the ImageAnnotation is removed."),this.setSize(t),this._userSetSize=!1;this._setElementSize(t),super.updateSize()}willMoveToMap(){this._isMoving=this.doesAnimate()}canShowCallout(){return!this._waitingForImageSize&&super.canShowCallout()}_addImageEventListener(){this._pendingImage.image.addEventListener("load",this),this._pendingImage.image.addEventListener("error",this)}_removeImageEventListener(){this._pendingImage&&(this._pendingImage.image.removeEventListener("load",this),this._pendingImage.image.removeEventListener("error",this))}_handleImageLoaded(){this.updateSize()}_handleImageError(){this._sceneGraphNode.image&&console.error("[MapKit] Could not load image for ImageAnnotation at URL: "+this._sceneGraphNode.url),this._setSceneGraphNodeToFallback(),this.updatePosition(),this.updateSize()}_setElementSize(t){this._element.style.width=t.width+"px",this._element.style.height=t.height+"px"}_setSceneGraphNode(){if(this._sceneGraphNode instanceof Wy)return;const t=this._sceneGraphNode;this._sceneGraphNode=new Wy(this),t.parent&&t.parent.replaceChild(this._sceneGraphNode,t)}_setSceneGraphNodeToFallback(){if(this._sceneGraphNode instanceof Fy)return;this._removeImageEventListener();const t=this._sceneGraphNode;this._sceneGraphNode=new Fy(this),t.parent&&t.parent.replaceChild(this._sceneGraphNode,t)}}return(e=i).prototype.renderedByDOMElement=!1,e.prototype.ConstructorOptions=Object.freeze(Object.assign({},t.prototype.ConstructorOptions,{url:"rw"})),i}const Zy=By(om);class jy extends Zy{}class Ky extends am{constructor(t,e){super(t,om.div),Object.defineProperty(this,"_impl",{value:new jy(this,t,e)}),this._impl.init()}get url(){return this._impl._url}set url(t){this._impl.url=t}}function Hy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const qy="mk-map-features-container",Vy="mk-map-features";class Yy{constructor(t){Hy(this,"map",void 0),Hy(this,"node",void 0),Hy(this,"_shadowRootNode",void 0),Hy(this,"_featuresContainer",void 0),this.map=t,window.document&&(this.node=new Ri(Fs("div",{class:qy})),this._shadowRootNode=Bs(this.node,Oe.shadowDOMMode,":host(.mk-map-features-container) .mk-map-features>div{position:absolute;top:0;left:0}",Oe.nonce),this._featuresContainer=this._shadowRootNode.addChild(new Ri(Fs("div",{class:Vy}))))}update(t,e){this._featuresContainer.children=[];for(let i=0;i<t.length;i++){const s=t[i];let o,n;const a=new it(s.position[0],s.position[1]);a.x<e.minX()&&(a.x+=1);const r=e.transformMapPoint(a);if(s.rects&&s.rects.length){let t=1/0,e=0,i=1/0,a=0;for(const o of s.rects){const s=r.x+o.offset[0],n=s+o.size[0],l=r.y+o.offset[1],h=l+o.size[1];t>s&&(t=s),e<n&&(e=n),i>l&&(i=l),a<h&&(a=h)}o=new at(e-t,a-i),n=new Pe(t,i)}else if(s.circles&&s.circles.length){let t=1/0,e=0,i=1/0,a=0;const r=this.map.ensureRenderingFrame().size.height;for(const o of s.circles){const s=o.x-o.radius,n=o.x+o.radius,r=o.y-o.radius,l=o.y+o.radius;t>s&&(t=s),e<n&&(e=n),i>r&&(i=r),a<l&&(a=l)}o=new at(e-t,a-i),n=new Pe(t,r-a)}if(!o||!n)continue;const l=new Ri(Fs("div",{"aria-label":s.title}));l.position=n,l.size=o,this._featuresContainer.addChild(l)}}}
2function Xy(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class $y{constructor(t,e){Xy(this,"_items",void 0),Xy(this,"_data",void 0),this._items=this._toItemsList(t),this._data=e}get data(){return this._data}set data(t){this._data=t}get items(){return this._items}set items(t){this._items=this._toItemsList(t)}_toItemsList(t){return t instanceof Array?t:null===t?[]:[t]}getFlattenedItemList(){return this.items.reduce(((t,e)=>("object"==typeof e&&null!==e&&"getFlattenedItemList"in e&&"function"==typeof e.getFlattenedItemList?t=[...t,...e.getFlattenedItemList()]:t.push(e),t)),[])}}class Jy{constructor(t,e){Object.defineProperty(this,"_impl",{value:new $y(t,e)})}get data(){return this._impl.data}set data(t){this._impl.data=t}get items(){return this._impl.items}set items(t){this._impl.items=t}getFlattenedItemList(){return this._impl.getFlattenedItemList()}}const Qy={MapFeatureType:u_,Annotation:am,PlaceAnnotation:B_,PlaceSelectionAccessory:Up,ImageAnnotation:Ky,MarkerAnnotation:Jg,MapFeatureAnnotation:Z_.prototype.constructor},tv={AnnotationsController:Ty,MapFeaturesLayerController:Yy,LayerItemsController:um,ItemCollection:Jy,PlaceSelectionAccessory:Up,MapFeatureType:u_,mapkit:Qy};function ev(t){return nv(ov(t))}let iv;const sv={};function ov(t){if(t in sv)return sv[t];const e=/#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i.exec(t);if(e){const i=[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),1];return sv[t]=i,i}const i=/rgba\(([\d]+), ?([\d]+), ?([\d]+), ?([\d.]+)\)/i.exec(t);if(i){const e=[parseInt(i[1]),parseInt(i[2]),parseInt(i[3]),Math.round(255*parseFloat(i[4]))];return sv[t]=e,e}if(!iv){const t=Ft().getContext("2d",{willReadFrequently:!0});iv=t}iv.canvas.width=iv.canvas.height=1,iv.fillStyle=t,iv.fillRect(0,0,1,1);const s=iv.getImageData(0,0,1,1).data,o=[s[0],s[1],s[2],s[3]];return sv[t]=o,o}function nv(t){return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]/255})`}class av extends lo{draw(t){if(!this._node.overlay.map)return;const e=this._node.overlay.map._impl.camera;this.render(t,e)}render(t,e,i){let s=this._node.overlay.style;"number"==typeof i&&(s=s._impl.styleForHitTesting(i));const o=this._node.closed&&!!s._impl.shouldFill(),n=s._impl.shouldStroke();(o||n)&&this.drawShapes(t,s,o,n,e)}drawShapes(t,e,i,s,o){e._impl.lineGradient&&this._node.supportsLineGradient?s&&this.drawGradient(t,e,o):(t.beginPath(),this._node.shapesForRenderer.forEach((e=>{e.forEach((i=>{let s=o.transformMapPoint(new Pe(i[0].x+e.xOffset,i[0].y));t.moveTo(s.x,s.y);for(let n=1,a=i.length;n<a;n++){const a=i[n];s=o.transformMapPoint(new Pe(a.x+e.xOffset,a.y)),t.lineTo(s.x,s.y)}this._node.closed&&t.closePath()}))})),i&&this._node.overlay.fillPath(t,e),s&&this._node.overlay.strokePath(t,e,1))}drawGradient(t,e,i){const s=e._impl.colorStopsForOverlay(this._node.overlay);let o=0;this._node.shapesForRenderer.forEach((n=>{n.forEach((a=>{const r=[];let l,h=s[o];for(;a[0]._offset>h[0];)++o,h=s[o],l=h[0];for(let t=0,d=a.length;t<d;){const d=a[t],c=d._offset,u=i.transformMapPoint(new Pe(d.x+n.xOffset,d.y));h=s[o],l=h[0];const p=ev(h[1]||e.strokeColor);if(c===l)r.push({offset:c,point:u,color:p,stops:[]}),++t,++o;else if(c<l){const i=s[o-1],n=i[0],a=nv(rv(ov(i[1]||e.strokeColor),ov(p),(c-n)/(l-n)));r.push({offset:c,point:u,color:a,stops:[]}),++t}else{r[r.length-1].stops.push([l,p]),++o}}this.strokePathForLineEvents(t,r,e)}))}))}strokePathForLineEvents(t,e,i){for(let s=0,o=e.length-1;s<o;++s){t.beginPath();const o=e[s],n=o.point,a=e[s+1],r=a.point;t.moveTo(n.x,n.y),t.lineTo(r.x,r.y);const l=t.createLinearGradient(n.x,n.y,r.x,r.y);if(l.addColorStop(0,o.color),o.stops.length>0){const t=o.offset,e=a.offset-t;for(let s=0;s<o.stops.length;++s){const n=o.stops[s];l.addColorStop(w((n[0]-t)/e,0,1),n[1]||i.strokeColor)}}l.addColorStop(1,a.color),this._node.overlay.strokePath(t,i,1,l)}}}function rv(t,e,i){const s=1-i;return[Math.round(t[0]*s+e[0]*i),Math.round(t[1]*s+e[1]*i),Math.round(t[2]*s+e[2]*i),Math.round(t[3]*s+e[3]*i)]}const lv=2*Math.PI;class hv extends av{drawShapes(t,e,i,s,o){const n=this._node.overlay;
2this._node.shapes.forEach((a=>{const r=a[0],l=n._mapRadius,h=l*o.worldSize;h<.5||this.drawClipped(t,e,i,s,o,r,l,a.xOffset)||(dv(t,o,r,a.xOffset,h),i&&n.fillPath(t,e),s&&n.strokePath(t,e,1))}))}drawClipped(t,e,i,s,o,n,a,r){const l=o.toRenderingMapRect();if(!s||a<l.size.width||a<l.size.height)return!1;const h=e._impl.halfStrokeWidthAtResolution()/o.worldSize,d=l.minX()-h-r,c=l.maxX()+h-r,u=l.minY()-h,p=l.maxY()+h,m=n.x,g=n.y;function _(t,e){const i=m-t,s=g-e;return i*i+s*s<=a*a}const f=[];let y;_(c,p)&&f.push(new it(c,p));const v=Math.acos((c-m)/a);if(!isNaN(v)){let t=g+a*Math.sin(v);t>=u&&t<=p&&(y=new it(c,t),y.angle=v,f.push(y)),t=g-a*Math.sin(v),t>=u&&t<=p&&(y=new it(c,t),y.angle=lv-v,f.push(y))}_(c,u)&&f.push(new it(c,u));const b=Math.asin((u-g)/a);if(!isNaN(b)){let t=m+a*Math.cos(b);t>=d&&t<=c&&(y=new it(t,u),y.angle=(b+lv)%lv,f.push(y)),t=m-a*Math.cos(b),t>=d&&t<=c&&(y=new it(t,u),y.angle=Math.PI-b,f.push(y))}_(d,u)&&f.push(new it(d,u));const w=Math.acos((d-m)/a);if(!isNaN(w)){let t=g-a*Math.sin(w);t>=u&&t<=p&&(y=new it(d,t),y.angle=lv-w,f.push(y)),t=g+a*Math.sin(w),t>=u&&t<=p&&(y=new it(d,t),y.angle=w,f.push(y))}_(d,p)&&f.push(new it(d,p));const C=Math.asin((p-g)/a);if(!isNaN(C)){let t=m-a*Math.cos(C);t>=d&&t<=c&&(y=new it(t,p),y.angle=Math.PI-C,f.push(y)),t=m+a*Math.cos(C),t>=d&&t<=c&&(y=new it(t,p),y.angle=(C+lv)%lv,f.push(y))}const k=f.length;let S=1;for(;k>2&&S<k&&(!isNaN(f[S-1]?.angle??NaN)||isNaN(f[S]?.angle??NaN)||isNaN(f[(S+1)%k]?.angle??NaN));)S+=1;if(S<k){let l=(S+1)%k;for(;k>2&&!isNaN(f[l]?.angle??NaN)&&!isNaN(f[(l+1)%k]?.angle??NaN);)l=(l+1)%k;const h=a*o.worldSize,d=f[S],c=d.angle,u=f[l],p=u.angle,m=Math.abs(c-p),g=h*m-2*h*Math.sin(m/2)>.001,_=o.transformMapPoint(new Pe(d.x+r,d.y)),y=o.transformMapPoint(new Pe(u.x+r,u.y));if(i){g?dv(t,o,n,r,h,c,p):(t.beginPath(),t.moveTo(_.x,_.y),t.lineTo(y.x,y.y));for(let e=(l+1)%k;isNaN(f[e]?.angle??NaN);e=(e+1)%k){const i=f[e],s=o.transformMapPoint(new Pe(i.x+r,i.y));t.lineTo(s.x,s.y)}this._node.overlay.fillPath(t,e)}s&&(g?dv(t,o,n,r,h,c,p):(t.beginPath(),t.moveTo(_.x,_.y),t.lineTo(y.x,y.y)),this._node.overlay.strokePath(t,e))}else k>0&&i&&(t.fillStyle=e.fillColor,t.globalAlpha=e.fillOpacity,t.fillRect(0,0,l.size.width*o.worldSize,l.size.height*o.worldSize));return!0}}function dv(t,e,i,s,o,n,a){t.beginPath();const r=e.transformMapPoint(new Pe(i.x+s,i.y));n&&(n+=e.rotation),a&&(a-=e.rotation),t.arc(r.x,r.y,o,n||0,a||lv,!0)}function cv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class uv extends ts{constructor(t){super(),cv(this,"overlay",void 0),cv(this,"shapes",void 0),this.overlay=t}}function pv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class mv extends uv{constructor(t,e,i=!0){super(t),pv(this,"_closed",void 0),pv(this,"supportsLineGradient",void 0),pv(this,"_renderer",null),this._closed=!!e,i&&(this._renderer=new av(this))}get closed(){return this._closed}}class gv extends mv{constructor(t){super(t,!0,!1),this._renderer=new hv(this)}get shapesForRenderer(){throw new Error}stringInfo(){const t=this.overlay;return"CircleOverlayNode<radius:"+t.radius+","+t.coordinate.toString().toLowerCase()+">"+(t.style.toString()?"["+t.style.toString()+"]":"")}}function _v(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const fv=["visible","enabled","selected","data"];class yv{get itemType(){return"overlay"}constructor(t,e){_v(this,"_public",void 0),_v(this,"shown",void 0),_v(this,"_node",void 0),_v(this,"isMapFeature",void 0),_v(this,"_toBeRemoved",void 0),_v(this,"setDelegate",void 0),_v(this,"addedToMap",void 0),_v(this,"removedFromMap",void 0),_v(this,"_boundingRect",void 0),_v(this,"delegate",null),_v(this,"_map",null),_v(this,"_visible",!0),_v(this,"_enabled",!0),_v(this,"_selected",!1),_v(this,"_data",{}),this._public=t,e=A(e),Object.assign(this,$c(e,fv)),Object.keys(e).forEach((t=>{this.knownOptions.includes(t)||console.warn("[MapKit] Unknown option: "+t+". Use the data property to store custom data.")}))}get knownOptions(){return fv}get map(){return this._map}set map(t){console.warn("[MapKit] The `map` property of an overlay is read-only. Use map.addOverlay() instead.")}get data(){return this._data}set data(t){this._data=t}get visible(){return this._visible}set visible(t){const e=!!t;this._visible!==e&&(this._visible=e,this.updatedProperty("visible"))}get enabled(){return this._enabled}set enabled(t){this._enabled=!!t}get selected(){return this._selected}set selected(t){const e=!!t;if(e!==this._selected){if(this.delegate&&!this.delegate.selectionMayChange)return void console.warn("[MapKit] Selection may not change in select/deselect event handler.");this._selected=e,this.updatedProperty("selected")}}canBePicked(){return this.shown&&this._visible}setMap(t){t?this._map=t:this._map&&(this._map=null)}handleEvent(){}updatedProperty(t){this.delegate&&this.delegate.overlayPropertyDidChange(this._public,t)}visibleAfterClipping(t,e,i,s,o){this._node.shapes=[];const n=this.visibilityToleranceAtScale(i),a=this._boundingRect||this.boundingRectAtScale(i);if(!this.visible||a.maxY()+n<t.minY()||a.minY()-n>t.maxY())return!1;const r=a.minX()-n,l=a.maxX()+n,h=r<0?1:0,d=1+h;for(let n=h-1;n<=d;++n){const a=0===n?t:new ot(t.origin.x-n,t.origin.y,t.size.width,t.size.height);if(l>=a.minX()&&r<=a.maxX()){const t=this.clipOverlay(a,e,i,s,o);t.length>0&&(t.xOffset=n,this._node.shapes.push(t))}}return this._node.shapes.length>0}boundingRectAtScale(){throw new Error("Method not implemented.")}clipOverlay(){throw new Error("Method not implemented.")}visibilityToleranceAtScale(){return 0}}function vv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let bv=0;class wv extends e{constructor(t){if(super(),vv(this,"_offsets",void 0),vv(this,"_indices",void 0),vv(this,"_lastUpdate",void 0),this._offsets=[[0],[1]],this._indices=[],this._lastUpdate=bv++,"object"==typeof t)for(const[e,i]of Object.entries(t))this.addColorStop(parseFloat(e),i)}get offsets(){return this._offsets}get indices(){return this._indices}get lastUpdate(){return this._lastUpdate}addColorStop(t,e){if("number"!=typeof t||!(t>=0&&t<=1))throw new Error("[MapKit] Expected a number between 0 and 1 for offset of LineGradient.addColorStop, but got `"+t+"` instead.");S(e,"string","[MapKit] Expected a string value for color in LineGradient.addColorStop, but got `"+e+"` instead."),this._addColorStop(this._offsets,t,e)}addColorStopAtIndex(t,e){if("number"!=typeof t||t<0||t%1!=0)throw new Error("[MapKit] Expected a integer greater than or equal to 0 for index of LineGradient.addColorStopAtIndex, but got `"+t+"` instead.");S(e,"string","[MapKit] Expected a string value for color in LineGradient.addColorStopAtIndex, but got `"+e+"` instead."),this._addColorStop(this._indices,t,e)}toString(){return"LineGradient"}_addColorStop(t,e,s){const o=t.length;let n=0,a=t[n];for(n=0;n<o&&a&&a[0]<e;)++n,a=t[n];n<o&&a&&a[0]===e?a[1]=s:t.splice(n,0,[e,s]),this._lastUpdate=bv++,this.dispatchEvent(new i(wv.UPDATE_EVENT))}}vv(wv,"UPDATE_EVENT","update-color-stop");class Cv{constructor(t){Object.defineProperty(this,"_impl",{value:new wv(t)})}addColorStop(t,e){this._impl.addColorStop(t,e)}addColorStopAtIndex(t,e){this._impl.addColorStopAtIndex(t,e)}toString(){return this._impl.toString()}}const kv=["butt","round","square"],Sv=["miter","round","bevel"],Lv=["nonzero","evenodd"];var Mv;const Av="rgb(0, 122, 255)",Tv=["strokeColor","strokeOpacity","strokeStart","strokeEnd","lineWidth","lineCap","lineJoin","lineDash","lineDashOffset","lineGradient","fillColor","fillOpacity","fillRule"];class xv extends e{constructor(t={}){let e;for(e in super(),t=A(t),Object.assign(this,$c(t,Tv)),t)Tv.includes(e)||console.warn("[MapKit] Style has no property named `"+e+"`, ignoring.")}get strokeColor(){return this._strokeColor}set strokeColor(t){null!=t&&S(t,"string","[MapKit] Expected a string value for Style.strokeColor, but got `"+t+"` instead."),this._strokeColor!==t&&(this._strokeColor=t,this._updated())}get strokeOpacity(){return this._strokeOpacity}set strokeOpacity(t){S(t,"number","[MapKit] Expected a number value for Style.strokeOpacity, but got `"+t+"` instead.");const e=w(t,0,1);this._strokeOpacity!==e&&(this._strokeOpacity=e,this._warnLineGradientComparability(),this._updated())}get strokeStart(){return this._strokeStart}set strokeStart(t){if("number"!=typeof t||!(t>=0&&t<=1))throw new Error("[MapKit] Expected a number between 0 and 1 for Style.strokeStart, but got `"+t+"` instead.");this._strokeStart!==t&&(this._strokeStart=t,this._updated())}get strokeEnd(){return this._strokeEnd}set strokeEnd(t){if("number"!=typeof t||!(t>=0&&t<=1))throw new Error("[MapKit] Expected a number between 0 and 1 for Style.strokeEnd, but got `"+t+"` instead.");this._strokeEnd!==t&&(this._strokeEnd=t,this._updated())}get lineWidth(){return this._lineWidth}set lineWidth(t){S(t,"number","[MapKit] Expected a number value for Style.lineWidth, but got `"+t+"` instead.");const e=Math.max(0,t);this._lineWidth!==e&&(this._lineWidth=e,this._updated())}get lineCap(){return this._lineCap}set lineCap(t){const e=kv,i="[MapKit] Expected one of "+e.map((t=>"`"+t+"`")).join(", ")+" for Style.lineCap, but got `"+t+"` instead.";if(S(t,"string",i),!e.includes(t))throw new TypeError(i);this._lineCap!==t&&(this._lineCap=t,this._warnLineGradientComparability(),this._updated())}get lineJoin(){return this._lineJoin}set lineJoin(t){const e=Sv,i="[MapKit] Expected one of "+e.map((t=>"`"+t+"`")).join(", ")+" for Style.lineJoin, but got `"+t+"` instead.";if(S(t,"string",i),!e.includes(t))throw new TypeError(i);this._lineJoin!==t&&(this._lineJoin=t,this._warnLineGradientComparability(),this._updated())}get lineDash(){return this._lineDash}set lineDash(t){M(t,"[MapKit] Expected an array of numbers for Style.lineDash, but got `"+t.toString()+"` instead."),t.forEach(((t,e)=>{S(t,"number","[MapKit] Expected an array of numbers for Style.lineDash, but got `"+t+"` at index "+e+" instead.")})),this._lineDash=t.slice(),this._warnLineGradientComparability(),this._updated()}get lineDashOffset(){return this._lineDashOffset}set lineDashOffset(t){S(t,"number","[MapKit] Expected a number value for Style.lineDashOffset, but got `"+t+"` instead."),this._lineDashOffset!==t&&(this._lineDashOffset=t,this._updated())}get lineGradient(){return this._lineGradient}set lineGradient(t){null!==t&&L(t,Cv,"[MapKit] Expected a LineGradient object value (or null) for Style.lineGradient, but got `"+t.toString()+"` instead."),this._lineGradient!==t&&(this._lineGradient&&this._lineGradient._impl.removeEventListener(wv.UPDATE_EVENT,this),this._lineGradient=t,this._lineGradient&&this._lineGradient._impl.addEventListener(wv.UPDATE_EVENT,this),this._warnLineGradientComparability(),this._updated())}colorStopsForOverlay(t){if(!this._lineGradient)return null;const e=this._lineGradient;return 0===e._impl.indices.length?e._impl.offsets:t.getColorStops(e._impl)}get fillColor(){return this._fillColor}set fillColor(t){null!=t&&S(t,"string","[MapKit] Expected a string value for Style.fillColor, but got `"+t+"` instead."),this._fillColor!==t&&(this._fillColor=t,this._updated())}get fillOpacity(){return this._fillOpacity}set fillOpacity(t){S(t,"number","[MapKit] Expected a number value for Style.fillOpacity, but got `"+t+"` instead.");const e=w(t,0,1);this._fillOpacity!==e&&(this._fillOpacity=e,this._updated())}get fillRule(){return this._fillRule}set fillRule(t){const e=Lv,i="[MapKit] Expected one of "+e.map((t=>"`"+t+"`")).join(", ")+" for Style.fillRule, but got `"+t+"` instead.";if(S(t,"string",i),!e.includes(t))throw new TypeError(i);this._fillRule!==t&&(this._fillRule=t,this._updated())}shouldStroke(){return!!((this.strokeColor||this.lineGradient)&&this.strokeOpacity>0&&this.lineWidth>0)}shouldFill(){return this.fillColor&&this.fillOpacity>0}halfStrokeWidthAtResolution(){return this.strokeColor&&this.strokeOpacity>0?this.lineWidth/2*zs():0}styleForHitTesting(t){const e=Object.create(this);null!=this._fillColor&&(e._fillColor=Av,e._fillOpacity=1),e._strokeColor=Av,e._strokeOpacity=1,e._lineWidth=this.lineWidth+t;const i=Object.create(Ev.prototype);return i._impl=e,i}toString(){return Tv.filter((t=>Object.prototype.hasOwnProperty.call(this,"_"+t))).map((t=>t+":"+(Array.isArray(this[t])?JSON.stringify(this[t]):function(t){return null!==t&&"object"==typeof t}(this[t])?this[t].toString():this[t]))).join(",")}handleEvent(t){t.type===wv.UPDATE_EVENT&&this._updated()}_warnLineGradientComparability(){if(!this.lineGradient)return;const t=[];1!==this.strokeOpacity&&t.push("strokeOpacity"),"round"!==this.lineCap&&t.push("lineCap"),"round"!==this.lineJoin&&t.push("lineJoin"),0!==this.lineDash.length&&t.push("lineDash"),0!==t.length&&(1===t.length?console.warn("[MapKit] lineGradient is incompatible with the following style property: "+t[0]+"."):console.warn("[MapKit] lineGradient is incompatible with the following style properties: "+t.join(", ")+"."))}_updated(){this.dispatchEvent(new i(xv.UPDATE_EVENT))}}(Mv=xv).prototype._strokeColor=Av,Mv.prototype._strokeOpacity=1,Mv.prototype._strokeStart=0,Mv.prototype._strokeEnd=1,Mv.prototype._lineWidth=1,Mv.prototype._lineCap="round",Mv.prototype._lineJoin="round",Mv.prototype._lineDash=[],Mv.prototype._lineDashOffset=0,Mv.prototype._lineGradient=null,Mv.prototype._fillColor=Av,Mv.prototype._fillOpacity=.1,Mv.prototype._fillRule="nonzero",function(t,e,
2i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(xv,"UPDATE_EVENT","update-style");class Ev{constructor(t){Object.defineProperty(this,"_impl",{value:new xv(t)})}get strokeColor(){return this._impl.strokeColor}set strokeColor(t){this._impl.strokeColor=t}get strokeOpacity(){return this._impl.strokeOpacity}set strokeOpacity(t){this._impl.strokeOpacity=t}get strokeStart(){return this._impl.strokeStart}set strokeStart(t){this._impl.strokeStart=t}get strokeEnd(){return this._impl.strokeEnd}set strokeEnd(t){this._impl.strokeEnd=t}get lineWidth(){return this._impl.lineWidth}set lineWidth(t){this._impl.lineWidth=t}get lineCap(){return this._impl.lineCap}set lineCap(t){this._impl.lineCap=t}get lineJoin(){return this._impl.lineJoin}set lineJoin(t){this._impl.lineJoin=t}get lineDash(){return this._impl.lineDash}set lineDash(t){this._impl.lineDash=t}get lineDashOffset(){return this._impl.lineDashOffset}set lineDashOffset(t){this._impl.lineDashOffset=t}get lineGradient(){return this._impl.lineGradient}set lineGradient(t){this._impl.lineGradient=t}get fillColor(){return this._impl.fillColor}set fillColor(t){this._impl.fillColor=t}get fillOpacity(){return this._impl.fillOpacity}set fillOpacity(t){this._impl.fillOpacity=t}get fillRule(){return this._impl.fillRule}set fillRule(t){this._impl.fillRule=t}toString(){return this._impl.toString()}}function Iv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Ov extends yv{constructor(t,e={}){super(t,e),Iv(this,"_simplifiedShapeLevel",void 0),Iv(this,"_hasPoints",void 0),Iv(this,"_simplifiedShape",null),Iv(this,"clippedShape",void 0),Iv(this,"_boundingRect",void 0),Iv(this,"delegate",null),Iv(this,"_fillable",!0),Iv(this,"fadeInOutOpacity",void 0),Iv(this,"_style",void 0),void 0!==e.style&&(this.style=e.style)}get knownOptions(){return[...super.knownOptions,"style"]}get style(){return this._style||(this._style=new Ev,this._style._impl.addEventListener(xv.UPDATE_EVENT,this)),this._style}set style(t){if(this._style){if(this._style===t)return;this._style._impl.removeEventListener(xv.UPDATE_EVENT,this)}L(t,Ev,"[MapKit] Expected a mapkit.Style value for Overlay.style, but got `"+t.toString()+"` instead."),this._style!==t&&(this._style=t,this._style&&this._style._impl.addEventListener(xv.UPDATE_EVENT,this),this.updatedProperty("style"))}visibilityToleranceAtScale(t){return this.style._impl.halfStrokeWidthAtResolution()/t}clipOverlay(t,e,i,s,o){if(this._simplifiedShapeLevel!==s){const t=void 0===this._simplifiedShapeLevel?NaN:Math.abs(this._simplifiedShapeLevel-s),e=!!this._hasPoints,i=this._simplifiedShape,[o,n]=this.simplifyShapeAtLevel(s);this._simplifiedShape=o,this._simplifiedShapeLevel=s,this._hasPoints=n,1===t&&e!==this._hasPoints&&(this.delegate.fadeOverlayTo(this,e?0:1),e&&(this.fadeInOutOpacity.previousShape=this.clip(i)))}const n=this.fadeInOutOpacity?.previousShape||(e||!this.clippedShape?this.clip(this._simplifiedShape,t,this.style._impl.halfStrokeWidthAtResolution()/i):this.clippedShape);return o&&(this.clippedShape=n),n}setFadeInOutOpacity(t){this.fadeInOutOpacity.value=t,this.updatedProperty("style")}handleEvent(t){t.type===xv.UPDATE_EVENT&&this.updatedProperty("style")}fillPath(t,e){t.save(),t.fillStyle=e.fillColor;const i=this.fadeInOutOpacity?this.fadeInOutOpacity.value:1;t.globalAlpha=e.fillOpacity*i*this.node.opacity,t.fill(e.fillRule),t.restore()}strokePath(t,e,i,s){t.save(),t.strokeStyle=s||e.strokeColor;const o=this.fadeInOutOpacity?this.fadeInOutOpacity.value:1;t.globalAlpha=e.strokeOpacity*o*this.node.opacity;const n=i||zs();t.lineWidth=e.lineWidth*n,e.lineDash.length>0&&"function"==typeof t.setLineDash&&(t.setLineDash(e.lineDash.map((t=>t*n))),t.lineDashOffset=e.lineDashOffset*n),t.lineJoin=e.lineJoin,t.lineCap=e.lineCap,t.stroke(),t.restore()}updateGeometry(){const t=this.calculateBoundingRect();t&&(this._boundingRect=t,this.updatedProperty("geometry"))}}function Pv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Rv extends Ov{constructor(t,e,i,s){super(t,s),Pv(this,"_coordinate",void 0),Pv(this,"_radius",void 0),Pv(this,"_center",void 0),Pv(this,"_mapRadius",void 0),Pv(this,"_node",void 0),Pv(this,"delegate",null),this._node=new gv(this),this.coordinate=e,this._coordinate=this.coordinate,this.radius=i,this._radius=this.radius}get node(){return this._node}get coordinate(){return this._coordinate}set coordinate(t){L(t,tt,"[MapKit] CircleOverlayInternal.coordinate expected a Coordinate value, but got `"+t.toString()+"` instead."),this._coordinate&&this._coordinate.latitude===t.latitude&&this._coordinate.longitude===t.longitude||(this._coordinate=t.copy(),this.updateGeometry())}get radius(){return this._radius}
2set radius(t){const e="[MapKit] CircleOverlayInternal.radius expected a non-negative number (radius in meters), but got `"+t+"` instead.";S(t,"number",e),t<0&&console.warn(e);const i=Math.max(0,t);this._radius!==i&&(this._radius=i,this.updateGeometry())}calculateBoundingRect(){if(!this._coordinate||isNaN(this._radius))return null;const t=this._coordinate.toMapPoint();this._center=t;const e=this._radius*H(this._coordinate.latitude);return this._mapRadius=e,new ot(t.x-e,t.y-e,2*e,2*e)}simplifyShapeAtLevel(){return[this._coordinate.toMapPoint(),!0]}clip(){return[this._coordinate.toMapPoint()]}getColorStops(){throw new Error}}function zv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Dv=rt({Select:"select",Deselect:"deselect"});class Nv extends Ah{constructor(...t){super(...t),zv(this,"_impl",void 0)}get style(){return this._impl.style}set style(t){this._impl.style=t}get map(){return this._impl.map}set map(t){this._impl.map=t}get data(){return this._impl.data}set data(t){this._impl.data=t}get visible(){return this._impl.visible}set visible(t){this._impl.visible=t}get enabled(){return this._impl.enabled}set enabled(t){this._impl.enabled=t}get selected(){return this._impl.selected}set selected(t){this._impl.selected=t}}zv(Nv,"Events",Dv);class Fv extends Nv{constructor(t,e,i={}){super(),Object.defineProperty(this,"_impl",{value:new Rv(this,t,e,i)})}get coordinate(){return this._impl.coordinate}set coordinate(t){this._impl.coordinate=t}get radius(){return this._impl.radius}set radius(t){this._impl.radius=t}}class Uv{constructor(){!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"_overlays",void 0),this._overlays=[]}fadeOverlayTo(t,e){t.fadeInOutOpacity?(t.fadeInOutOpacity.durationMs=350*Math.abs(t.fadeInOutOpacity.value-t.fadeInOutOpacity.end),t.fadeInOutOpacity.start=t.fadeInOutOpacity.value,t.fadeInOutOpacity.end=e,t.fadeInOutOpacity.startTime=Date.now()):(t.fadeInOutOpacity={start:1,value:1,end:e,startTime:Date.now(),durationMs:350},t.setFadeInOutOpacity(1-e),this._overlays.push(t)),ii(this)}performScheduledUpdate(){const t=Date.now();this._overlays=this._overlays.filter((e=>(e.setFadeInOutOpacity(w(e.fadeInOutOpacity.start+(e.fadeInOutOpacity.end-e.fadeInOutOpacity.start)*((t-e.fadeInOutOpacity.startTime)/e.fadeInOutOpacity.durationMs),0,1)),e.fadeInOutOpacity.value!==e.fadeInOutOpacity.end||(delete e.fadeInOutOpacity,!1)))),this._overlays.length>0&&si(this)}}class Wv extends uo{constructor(t){super(),function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"_controller",void 0),this._controller=t}stringInfo(){return"OverlaysControllerNode"}}function Gv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class Bv extends um{constructor(t){super(t),Gv(this,"_fadeAnimationController",void 0),Gv(this,"_userLocationAccuracyRingOverlay",void 0),Gv(this,"_sceneGraphNode",void 0),Gv(this,"itemConstructor",Nv),Gv(this,"itemName","overlay"),Gv(this,"capitalizedItemName","Overlay"),this._sceneGraphNode=new Wv(this),this._fadeAnimationController=new Uv}get map(){return this._map}get userLocationAccuracyRingOverlay(){return this._userLocationAccuracyRingOverlay}isItemExposed(t){return t!==this._userLocationAccuracyRingOverlay}removeUserLocationAccuracyRingOverlay(){this._userLocationAccuracyRingOverlay&&(this.removeAnyItem(this._userLocationAccuracyRingOverlay),delete this._userLocationAccuracyRingOverlay)}removedReferenceToMap(){this._items.forEach((t=>{t._impl.setMap(null)}))}mapCameraDidChange(){0!==this._items.length&&(ii(this),this._deletePreviousPointForPickingItem())}overlayPropertyDidChange(t,e){switch(e){case"selected":t.selected?this.selectedItem=t:this.selectedItem=null,this._map.overlaySelectionDidChange(t),ii(this);break;case"style":case"visible":case"geometry":ii(this)}}fadeOverlayTo(t,e){this._fadeAnimationController.fadeOverlayTo(t,e)}updateUserLocationAccuracyRingOverlay(t){t.coordinate&&(this._userLocationAccuracyRingOverlay?this._userLocationAccuracyRingOverlay.updateForUserLocation():this._userLocationAccuracyRingOverlay=this.addItem(new Bv.AccuracyRingOverlay(t)))}addedItem(t){t._impl.delegate=this,t._impl.setMap(this._map.public),t.selected&&(this.selectedItem=t),ii(this)}removedItem(t){t._impl.setMap(null),super.removedItem(t),ii(this)}pickableItemsCloseToPoint(t,e,i){const s=document.createElement("canvas"),o=s.getContext("2d",{willReadFrequently:!0});s.width=1,s.height=1;const n=this._map.camera,a=.5,r=e.x-a,l=e.y-a;o.translate(-r,-l);const h="number"==typeof i?i:this._selectionDistance/zs();let d=!1;return t.filter((t=>{if(!t._impl.shown)return!1;d&&(o.clearRect(r,l,s.width,s.height),d=!1),t._impl.node._renderer.render(o,n,h),d=!0;return!!o.getImageData(Math.floor(a),Math.floor(a),1,1).data[3]}),this).reverse()}performScheduledUpdate(){const t=this.map;if(!t)return void(this._sceneGraphNode.children=[]);const e=t.camera.toRenderingMapRect(),i=t.worldSize,s=Math.ceil(Math.log2(i)),o=[],n=this._items;for(let a=0,r=n.length;a<r;++a){const r=n[a];if(r._impl.shown=r._impl.visibleAfterClipping(e,true,i,s,!0),r===this._userLocationAccuracyRingOverlay){const e=t.mapType,i=e===dt.Satellite||e===dt.Hybrid?"satellite":t.tint;
2this._userLocationAccuracyRingOverlay.updateIsShown(t.region,t.worldSize,i)}r._impl.shown&&!r.selected&&(o.push(r._impl.node),r._impl.node.needsDisplay=!0)}const a=this.selectedItem;a&&a._impl.shown&&(o.push(a._impl.node),a._impl.node.needsDisplay=!0),this._sceneGraphNode.children=o}}Gv(Bv,"AccuracyRingOverlay",void 0),Gv(Bv,"Overlay",Nv),u.jsModules.AccuracyRingOverlay?Bv.AccuracyRingOverlay=u.jsModules.AccuracyRingOverlay:u.addEventListener("load",(function t(e){e.jsModules.AccuracyRingOverlay&&(Bv.AccuracyRingOverlay=e.jsModules.AccuracyRingOverlay,u.removeEventListener("load",t))}));const Zv=function(t,e){const i=[];function s(t){const e=i.length;t._index=e,i.push(t),n(e)}function o(t,e){const s=i[t];return i[t]=i[e],i[e]=s,i[t]._index=t,i[e]._index=e,e}function n(t){for(;t>0;){const e=Math.floor((t-1)/2),s=i[t];if(i[e]._area<=s._area)return;t=o(t,e)}}function a(t){for(;;){const e=2*t+1,s=2*t+2,n=i[t]._area,a=i[e]?i[e]._area:1/0,r=i[s]?i[s]._area:1/0;if(n<=a&&n<=r)return;t=o(t,a<=n&&a<=r?e:s)}}function r(){const t=i[0],e=i.pop();return i.length>0&&e&&(i[0]=e,e._index=0,a(0)),t}function l(t){const e=t._prev,i=t,s=t._next;return Math.abs((e.x-s.x)*(i.y-e.y)-(e.x-i.x)*(s.y-e.y))/2}function h(t,e){const i=t._area;t._area=Math.max(l(t),e),t._area<i?n(t._index):a(t._index)}const d=t;let c=d.length-1,u=!1,p=!1;if(e&&c>1){const t=d[c],e=d[0];t.equals?.(e)||(d.push(e.copy()),u=!0,++c),p=!0;const i=d[c-1];d.unshift(i.copy()),++c}d[0]._area=1/0,d[c]._area=1/0;for(let t=1;t<c;++t){const e=d[t];e._prev=d[t-1],e._next=d[t+1],e._area=l(e),s(e)}for(p&&d.shift(),u&&d.pop();i.length>0;){const t=r(),e=t._prev,i=t._next;e._prev&&(e._next=i,h(e,t._area)),i._next&&(i._prev=e,h(i,t._area)),delete t._index,delete t._next,delete t._prev}},jv=function(t,e){const i=1/(e*e),s=t.filter((t=>t._area>i));if(2===s.length){const t=s[0].x-s[1].x,e=s[0].y-s[1].y;if(t*t+e*e<1*i)return[]}return s};class Kv extends mv{constructor(t){super(t,!0)}get shapesForRenderer(){return this.shapes?.map((t=>{const e=t.xOffset,i=[...t[0]];return i.xOffset=e,i}))}stringInfo(){const t=this.overlay;return"PolygonOverlayNode<points:"+(t.points.map((t=>t.map((t=>t.toString())).join(","))).join("|")+">")+(t.style.toString()?"["+t.style.toString()+"]":"")}}function Hv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class qv extends Ov{constructor(t,e,i){super(t,i),Hv(this,"_node",void 0),Hv(this,"_points",void 0),Hv(this,"_polygons",void 0),this._node=new Kv(this),this.points=e,this.updateGeometry()}get node(){return this._node}get points(){return this._points.map((t=>t.slice()))}set points(t){M(t,"[MapKit] PolygonOverlay.points expected an array of Coordinates."),Array.isArray(t[0])||(t=[t]),this._points=t.map(((t,e)=>(M(t,"[MapKit] PolygonOverlay.points expected an array at index: "+e),t.slice()))),this._polygons=this._points.map(((t,e)=>t.map(((t,i)=>(L(t,tt,"[MapKit] PolygonOverlay.points expected a Coordinate at index: "+e+", "+i),t.toUnwrappedMapPoint()))))),this.updateGeometry()}calculateBoundingRect(){const t=Xc(this._polygons.filter((t=>t.length>2)).map((t=>{const e=t.reduce(((t,e)=>(e.x<t.xMin&&(t.xMin=e.x),e.x>t.xMax&&(t.xMax=e.x),e.y<t.yMin&&(t.yMin=e.y),e.y>t.yMax&&(t.yMax=e.y),t)),{xMin:1/0,xMax:-1/0,yMin:1,yMax:0});return new ot(e.xMin,e.yMin,e.xMax-e.xMin,e.yMax-e.yMin)})).sort(((t,e)=>t.minX()-e.minX())));return delete this._simplifiedShapeLevel,t.size.width>1&&console.warn("[MapKit] Polygon overlay spans over 360º in longitude and may not render correctly."),this._polygons.forEach((e=>{0!==e.length&&(e.forEach((e=>{const i=b(e.x,1);e.x=i+(i<t.minX()?1:0)})),Zv(e,!0))})),t}simplifyShapeAtLevel(t){const e=void 0!==this._simplifiedShapeLevel&&this._simplifiedShapeLevel>t?this._simplifiedShape:this._polygons,i=Math.pow(2,t),s=e.reduce(((t,e)=>{const s=jv(e,i);return s.length>0&&t.push(s),t}),[]);return[s,s.length>0]}clip(t,e,i){return!e||Yc(e,this._boundingRect)?[t]:function(t,e,i){const s=e.minX()-i,o=e.minY()-i,n=e.maxX()+i,a=e.maxY()+i,r=[];for(let e=0,i=t.length;e<i;++e){const i=t[e],l=[];for(let t=0,e=i.length;t<e;++t){const o=i[t],n=i[(t-1+e)%e];if(o.x>=s){if(n.x<s){const t=(s-o.x)/(n.x-o.x),e=Object.create(it.prototype);e.x=s,e.y=(1-t)*o.y+t*n.y,l.push(e)}l.push(o)}else if(n.x>=s){const t=(s-o.x)/(n.x-o.x),e=Object.create(it.prototype);e.x=s,e.y=(1-t)*o.y+t*n.y,l.push(e)}}const h=[];for(let t=0,e=l.length;t<e;++t){const i=l[t],s=l[(t-1+e)%e];if(i.y>=o){if(s.y<o){const t=(o-i.y)/(s.y-i.y),e=Object.create(it.prototype);e.x=(1-t)*i.x+t*s.x,e.y=o,h.push(e)}h.push(i)}else if(s.y>=o){const t=(o-i.y)/(s.y-i.y),e=Object.create(it.prototype);e.x=(1-t)*i.x+t*s.x,e.y=o,h.push(e)}}const d=[];for(let t=0,e=h.length;t<e;++t){const i=h[t],s=h[(t-1+e)%e];if(i.x<=n){if(s.x>n){const t=(n-i.x)/(s.x-i.x),e=Object.create(it.prototype);e.x=n,e.y=(1-t)*i.y+t*s.y,d.push(e)}d.push(i)}else if(s.x<=n){const t=(n-i.x)/(s.x-i.x),e=Object.create(it.prototype);e.x=n,e.y=(1-t)*i.y+t*s.y,d.push(e)}}const c=[];for(let t=0,e=d.length;t<e;++t){const i=d[t],s=d[(t-1+e)%e];if(i.y<=a){if(s.y>a){const t=(a-i.y)/(s.y-i.y),e=Object.create(it.prototype);e.x=(1-t)*i.x+t*s.x,e.y=a,c.push(e)}c.push(i)}else if(s.y<=a){const t=(a-i.y)/(s.y-i.y),e=Object.create(it.prototype);e.x=(1-t)*i.x+t*s.x,e.y=a,c.push(e)}}c.length>2&&r.push(c)}return[r]}(t,e,i)}getColorStops(){throw new Error}}
2class Vv extends Nv{constructor(t,e={}){super(),Object.defineProperty(this,"_impl",{value:new qv(this,t,e)})}get points(){return this._impl.points}set points(t){this._impl.points=t}}class Yv extends mv{constructor(t){super(t,!1),function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"supportsLineGradient",!0)}get shapesForRenderer(){return this.shapes}stringInfo(){const t=this.overlay;return"PolylineOverlayNode<points:"+(t.points.map((t=>t.toString())).join(",")+">")+(t.style.toString()?"["+t.style.toString()+"]":"")}}function Xv(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const $v=1e3;class Jv extends Ov{constructor(t,e,i){super(t,i),Xv(this,"_node",void 0),Xv(this,"_points",void 0),Xv(this,"_mapPoints",void 0),Xv(this,"_pointsNeedRemapping",void 0),Xv(this,"_distances",void 0),Xv(this,"_colorStops",void 0),Xv(this,"_length",void 0),Xv(this,"_fillable",!1),this._node=new Yv(this),this.points=e,this.updateGeometry()}get points(){return this._points.slice()}get node(){return this._node}set points(t){L(t,Array,"[MapKit] PolylineOverlay.points expected an array of Coordinates."),this._points=t.slice(),this._mapPoints=this._points.map(((t,e)=>(L(t,tt,"[MapKit] PolylineOverlay.points expected a Coordinate at index: "+e),t.toUnwrappedMapPoint()))),this._pointsNeedRemapping=!0,delete this._distances,delete this._colorStops,this.updateGeometry()}calculateBoundingRect(){if(0===this._mapPoints.length)return new ot(0,0,0,0);const t=this._mapPoints.reduce(((t,e)=>(e.x<t.xMin&&(t.xMin=e.x),e.x>t.xMax&&(t.xMax=e.x),e.y<t.yMin&&(t.yMin=e.y),e.y>t.yMax&&(t.yMax=e.y),t)),{xMin:1/0,xMax:-1/0,yMin:1,yMax:0}),e=t.xMax-t.xMin,i=b(t.xMin,1);if(this._pointsNeedRemapping){delete this._pointsNeedRemapping,e>1&&console.warn("[MapKit] Polyline overlay spans over 360º in longitude and may not render correctly.");const s=t.xMin-i;this._mapPoints.forEach((t=>{t.x-=s})),Zv(this._mapPoints),delete this._simplifiedShapeLevel}return new ot(i,t.yMin,e,t.yMax-t.yMin)}simplifyShapeAtLevel(t){delete this._distances;const e=void 0!==this._simplifiedShapeLevel&&this._simplifiedShapeLevel>t?this._simplifiedShape:this._mapPoints,i=jv(e,Math.pow(2,t));return[i,i.length>0]}clip(t,e,i){return t.length>0&&(t=this.clipShapeByStyleProperties(t)),!e||Yc(e,this._boundingRect)?0===t.length?[]:[t]:function(t,e,i){const s=e.minX()-i,o=e.minY()-i,n=e.maxX()+i,a=e.maxY()+i,r=$v*e.size.width,l=$v*e.size.height,h=[];let d,c;for(let i=0,u=t.length;i<u-1;++i){const u=t[i];c=t[i+1];const p=c.x-u.x;let m,g=!1;if(0!==p){const t=(s-u.x)/p,e=(n-u.x)/p;g=!(t<0&&e<0||t>1&&e>1)}else g=u.x>=s&&u.x<=n;if(g)if(m=c.y-u.y,0!==m){const t=(o-u.y)/m,e=(a-u.y)/m;g=!(t<0&&e<0||t>1&&e>1)}else g=u.y>=o&&u.y<=a;const _=Math.abs(p)>r||void 0!==m&&Math.abs(m)>l;g?(d||(d=[]),_?(d.push(tb(u,c,p,m,e)),d.push(tb(c,u,-p,-m,e)),h.push(d),d=void 0):d.push(u)):d&&(_?(d.push(tb(u,c,p,m,e)),d.push(tb(c,u,-p,-m,e))):d.push(u),h.push(d),d=void 0)}d&&(d.push(c),h.push(d));return h}(t,e,i)}clipShapeByStyleProperties(t){const e=this.style.strokeStart,i=this.style.strokeEnd,s=this.style.lineGradient;if(0!==e||1!==i||s){if(!this._distances||s&&!this._colorStops){this._length=0,this._distances=[];const e=t.length;for(let i=0;i<e-1;++i){const e=t[i],s=t[i+1],o=Math.sqrt(Math.pow(e.x-s.x,2)+Math.pow(e.y-s.y,2));this._length+=o,this._distances.push(o)}if(s){if(s._impl.indices.length>0&&void 0!==this._mapPoints[0]._offset)for(let t=0,e=this._mapPoints.length;t<e;++t){delete this._mapPoints[t]._offset}for(let i=0,s=0;i<e-1;++i){t[i]._offset=s/this._length;s+=this._distances[i]}if(e>0){t[e-1]._offset=1}}}0===e&&1===i||(t=function(t,e,i,s){if(i>=s)return[];let o=0,n=!1;const a=[];let r;for(let l=0,h=t.length;l<h-1;++l){let h=t[l];r=t[l+1];const d=e[l];if(o+=d,!n&&o>=i){n=!0;const t=(o-i)/d,e=Object.create(it.prototype);e.x=t*h.x+(1-t)*r.x,e.y=t*h.y+(1-t)*r.y,void 0!==h._offset&&void 0!==r._offset&&(e._offset=t*h._offset+(1-t)*r._offset),h=e}if(n&&(a.push(h),o>=s)){const t=(o-s)/d,e=Object.create(it.prototype);e.x=t*h.x+(1-t)*r.x,e.y=t*h.y+(1-t)*r.y,void 0!==h._offset&&void 0!==r._offset&&(e._offset=t*h._offset+(1-t)*r._offset),r=e;break}}return a.push(r),a}(t,this._distances,e*this._length,i*this._length))}return t}getColorStops(t){if(!this._colorStops||this._colorStops.lastUpdate!==t.lastUpdate){const e=t.offsets,i=t.indices;this._colorStops=e.slice(),this._colorStops.lastUpdate=t.lastUpdate;let s=0;const o=this._mapPoints.length;for(let t=0,e=i.length;s<this._colorStops.length&&t<e;++s,++t){const e=i[t],n=e[0];if(!(n<o))break;{const t=this._mapPoints[n];void 0===t._offset&&Qv(this._mapPoints,this._length,n);const i=t._offset,o=e[1];let a=this._colorStops[s];for(;a[0]<i;)++s,a=this._colorStops[s];a[0]===i?a[1]=o:this._colorStops.splice(s,0,[i,o])}}}return this._colorStops}}function Qv(t,e,i){const s=t[i];let o=null;for(let e=i-1;!o;--e){const i=t[e];void 0!==i._offset&&(o=i)}let n=null;for(let e=i+1;!n;++e){const i=t[e];void 0!==i._offset&&(n=i)}const a=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2));s._offset=Math.min(o._offset+a/e,n._offset)}function tb(t,e,i,s,o){let n,a=o.minX()-o.size.width;if(t.x<a)return n=(a-t.x)/i,eb(a,(1-n)*t.y+n*e.y,t,e,i,s);if(a=o.maxX()+o.size.width,t.x>a)return n=(a-t.x)/i,eb(a,(1-n)*t.y+n*e.y,t,e,i,s);let r=o.minY()-o.size.height;
2return t.y<r?(n=(r-t.y)/s,eb((1-n)*t.x+n*e.x,r,t,e,i,s)):(r=o.maxY()+o.size.height,t.y>r?(n=(r-t.y)/s,eb((1-n)*t.x+n*e.x,r,t,e,i,s)):t)}function eb(t,e,i,s,o,n){const a=Object.create(it.prototype);if(a.x=t,a.y=e,"number"==typeof i._offset&&"number"==typeof s._offset){const r=Math.sqrt(o*o+n*n),l=Math.sqrt(Math.pow(t-i.x,2)+Math.pow(e-i.y,2));a._offset=i._offset+(s._offset-i._offset)*(l/r)}return a}class ib extends Nv{constructor(t,e){super(),Object.defineProperty(this,"_impl",{value:new Jv(this,t,e)})}get points(){return this._impl.points}set points(t){this._impl.points=t}}const sb={OverlaysController:Bv,LayerItemsController:um,ItemCollection:Jy,mapkit:{Style:Ev,LineGradient:Cv,CircleOverlay:Fv,PolylineOverlay:ib,PolygonOverlay:Vv,TileOverlay:Jh}},ob=[],nb=function t(){if(ob.length>0){for(const t of ob)ii(t);si(t)}},ab={setIsAnimated:function(t,e){const i=ob.indexOf(t);e&&i<0&&(ob.push(t),1===ob.length&&ii(nb)),!e&&i>-1&&ob.splice(i,1)},getIsAnimated:function(t){return ob.includes(t)}};function rb(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class lb extends lo{constructor(t){super(t),rb(this,"opacity",void 0),rb(this,"opacityTime",void 0),this.opacity=null,this.opacityTime=0}draw(t){const e=this._node._annotation.stale,i=this._node._annotation.style,s=Date.now(),o=s-this.opacityTime,n=Xs(Math.min(o,500)/500,1-this.opacity,this.opacity);if(n>0){const o=i.ANIMATION_HALF_DURATION_MS,h=s%i.ANIMATION_DURATION_MS,d=Ys(h<o?1-h/o:(h-o)/o),c=Xs(d,i.ANIMATION_SCALE_TO,i.ANIMATION_SCALE_FROM),u=t.globalAlpha,p=i.INNER_RADIUS*c,m=i.OUTER_RADIUS-p,g=p+m/2,_=i.TOTAL_RADIUS,f=i.TOTAL_RADIUS;t.save(),t.globalAlpha=n,t.beginPath(),t.arc(_,f,g,0,2*Math.PI),t.strokeStyle="rgb("+i.OUTER_FILL.join(",")+")",t.shadowColor="rgba("+i.SHADOW_COLOR.join(",")+")",t.shadowBlur=i.SHADOW_BLUR,t.lineWidth=m,t.stroke(),t.restore(),t.globalAlpha=n,t.beginPath(),t.arc(_,f,p,0,2*Math.PI),t.fillStyle=e?"rgb("+i.STALE_FILL.join(",")+")":(a=i.ANIMATION_FILL_FROM,r=i.ANIMATION_FILL_TO,l=d,"rgb("+a.map(((t,e)=>Math.round(t+(r[e]-t)*l))).join(", ")+")"),t.fill(),t.globalAlpha=u}var a,r,l}}function hb(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class db extends ts{constructor(t){super(),hb(this,"_annotation",void 0),hb(this,"_renderer",void 0),this._annotation=t,this._renderer=new lb(this)}stringInfo(){return"UserLocationAnnotationNode< "+(this._renderer.stale?"stale ":"live ")+(1!==this._renderer.opacity?`opacity: ${this._renderer.opacity} `:"")+">"}get size(){return this._annotation.node.size}get position(){return this._annotation.nodePosition()}}const cb=vt.default,ub={INNER_RADIUS:8,OUTER_RADIUS:11,SHADOW_BLUR:10,TOTAL_RADIUS:0,OUTER_FILL:[255,255,255],STALE_FILL:cb.gray2,SHADOW_COLOR:[0,0,0,.25],ANIMATION_DURATION_MS:3e3,ANIMATION_HALF_DURATION_MS:0,ANIMATION_SCALE_FROM:1,ANIMATION_SCALE_TO:.81,ANIMATION_FILL_FROM:cb.blue,ANIMATION_FILL_TO:cb.blue};ub.TOTAL_RADIUS=ub.OUTER_RADIUS+ub.SHADOW_BLUR,ub.ANIMATION_HALF_DURATION_MS=ub.ANIMATION_DURATION_MS/2;class pb extends om{constructor(t,e){super(t,e.coordinate,om.div),function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"_collisionMode",om.CollisionMode.None)}init(){const t=ub.TOTAL_RADIUS,e=ub.SHADOW_BLUR,i=window.DOMPoint;super.init(),this.style=ub,this.stale=!1,this._animationScheduler=ab,this._anchorOffset=new i(0,-t),this._calloutAnchorPoint=new i(-t,-e),this._updateTitleAndSubtitleForLocale();const s=2*t;this.setSize(new at(s,s)),this._userSetSize=!0,this._sceneGraphNode=new db(this),this.shownPropertyWasUpdated(!0)}get coordinate(){return this._coordinate}set coordinate(t){this._coordinate?console.warn("[MapKit] The `coordinate` property of the user location annotation cannot be set."):this._coordinate=t.copy()}get draggable(){return!1}set draggable(t){console.warn("[MapKit] The `draggable` property of the user location annotation cannot be set.")}get size(){return{width:this._node.size.width,height:this._node.size.height}}set size(t){console.warn("[MapKit] The `size` property of the user location annotation cannot be set.")}get node(){return this._node}handleEvent(t){t.type===Nn.Events.LocaleChanged&&this._updateTitleAndSubtitleForLocale()}set isRingMode(t){this.enabled=!t;const e=this._sceneGraphNode._renderer,i=t?0:1;i!==e.opacity&&(e.opacity=i,e.opacityTime=Date.now())}shownPropertyWasUpdated(t){ab.setIsAnimated(this,t)}removedFromMap(){ab.setIsAnimated(this,!1),Nn.removeEventListener(Nn.Events.LocaleChanged,this)}setCoordinate(t){super.coordinate=t}performScheduledUpdate(){const t=this.map&&this.map._impl.tint,e=this.map&&this.map.mapType,i=vt.default,s=vt[ri.Light],o=vt[ri.Dark],n=vt[t]||i,a=e===dt.Satellite||e===dt.Hybrid?"satellite":t;this.style.OUTER_FILL=a===ri.Dark?s.gray3:[255,255,255],this.style.STALE_FILL=a===ri.Light?s.gray:o.gray2,this.style.ANIMATION_FILL_FROM=n.blue,this.style.ANIMATION_FILL_TO=n.blue,this.style.SHADOW_COLOR=[0,0,0,a===ri.Light?.25:.3],this._sceneGraphNode.needsDisplay=!0}_updateTitleAndSubtitleForLocale(){this.title=Nn.get("Location.Title"),this.subtitle=Nn.get("Location.Subtitle")}}pb.prototype.renderedByDOMElement=!1;class mb extends am{constructor(t){super(t.coordinate,om.div),Object.defineProperty(this,"_impl",{value:new pb(this,t)}),this._impl.init()}set coordinate(t){this._impl.coordinate=t}
2get coordinate(){return this._impl.coordinate}get draggable(){return this._impl.draggable}set draggable(t){this._impl.draggable=t}get size(){return this._impl.size}set size(t){this._impl.size=t}}const gb=function(){throw new TypeError("[MapKit] UserLocationAnnotation may not be constructed.")};mb.prototype.constructor=gb,gb.prototype=mb.prototype;const _b=Math.pow(2,21);function fb(t){const e=t.toMapPoint(),i=_b*z;return{x:Math.floor(e.x*i),y:Math.floor(e.y*i),z:21}}const yb={shift:function(t,e){const i=Oe.locationShiftUrl;!function(t,e,i){const s={getDataToSend:function(){return t},loaderDidSucceed:function(t,e){if(e.status<200||e.status>=300)i(new Error("HTTP error:"+e.status));else try{i(null,JSON.parse(e.responseText))}catch(t){return void i(t instanceof SyntaxError?new Error("Failed to parse response: "+e.responseText):new Error)}},loaderDidFail:function(t,e){i(new Error("Network error"))}},o=new Gt(e,s,{method:"POST",withCredentials:Oe.urlWithCredentials(e)});0;o.schedule()}(JSON.stringify({pixelPoint:fb(t)}),i,(function(t,i){t?e(new Error,void 0):i&&i.shiftedPixelPoint?e(null,function(t){function e(t){return t/_b/z}const i=new it(e(t.x),e(t.y));return i.toCoordinate()}(i.shiftedPixelPoint)):e(new Error,void 0)}))}};function vb(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const bb=Object.freeze({Change:"user-location-change",Error:"user-location-error"});let wb;let Cb=null;const kb=new class extends e{constructor(){super(),vb(this,"_location",void 0),vb(this,"_coordinate",void 0),vb(this,"_stale",void 0),vb(this,"_watchId",void 0),vb(this,"_watchers",void 0),vb(this,"errorCode",void 0),vb(this,"Events",bb),this._location=null,this._coordinate=null,this._stale=!1,this._watchers=0,this.errorCode=0,Oe.addEventListener(Oe.Events.Changed,this),Oe.addEventListener(Oe.Events.Error,this)}get location(){return this._location}get coordinate(){return this._coordinate}get stale(){return this._stale}get mapAccuracyRadius(){const t=this.location;return!this.stale&&t.accuracy>0?t.accuracy:0}get isAvailable(){return window.navigator.geolocation&&"function"==typeof window.navigator.geolocation.watchPosition&&"function"==typeof window.navigator.geolocation.getCurrentPosition}getMapRect(){const t=this.location&&this.location.accuracy||0,e=this.coordinate.latitude,i=this.coordinate.toMapPoint(),s=t*H(e);return new ot(i.x-s,i.y-s,2*s,2*s)}watch(){this._watchId||(window.navigator.geolocation.watchPosition?(Lb(),this._watchId=window.navigator.geolocation.watchPosition(Ab,xb),wb=setTimeout((()=>{Lb(),xb({code:3,message:"Timeout expired"})}),15e3)):console.warn("[MapKit] User location is unavailable."))}locate(t,e,i){window.navigator.geolocation.getCurrentPosition?Sb&&this._watchId?Mb(Sb,t,e):window.navigator.geolocation.getCurrentPosition((i=>Mb(i,t,e)),e,i):console.warn("[MapKit] User location is unavailable.")}addEventListener(t,e,i){const s=super.addEventListener(t,e,i);return s&&++this._watchers,s}removeEventListener(t,e,i){const s=super.removeEventListener(t,e,i);return s?(--this._watchers,0===this._watchers&&this._watchId&&(window.navigator.geolocation.clearWatch(this._watchId),this._watchId=void 0),s):s}handleEvent(t){switch(t.type){case Oe.Events.Changed:case Oe.Events.Error:if(Cb&&(Sb=Cb,Cb=null),!Sb)return;Ab(Sb)}}reset(){Lb(),this._watchers=0,this._watchId=void 0,Sb=null}};let Sb=null;function Lb(){clearTimeout(wb),wb=void 0}function Mb(t,e,i){if("AutoNavi"===Oe.tileProvider){const s=new tt(t.coords.latitude,t.coords.longitude);
2yb.shift(s,((s,o)=>{if(s)return void(i&&i({message:"Position Unavailable",code:2,POSITION_UNAVAILABLE:2,PERMISSION_DENIED:1,TIMEOUT:3}));const n={coords:{accuracy:t.coords.accuracy,altitude:t.coords.altitude,altitudeAccuracy:t.coords.altitudeAccuracy,heading:t.coords.heading,floorLevel:t.coords.floorLevel,speed:t.coords.speed,latitude:o.latitude,longitude:o.longitude,toJSON(){return JSON.stringify(this)}},timestamp:t.timestamp,toJSON(){return JSON.stringify(this)}};e&&e(n)}))}else e&&e(t)}function Ab(t){Lb(),Sb=t,Oe.error?xb({code:4,message:"MapKit not initialized."}):Oe.ready?!kb._stale&&kb._coordinate&&t.coords.latitude===kb._coordinate.latitude&&t.coords.longitude===kb._coordinate.longitude||Mb(t,Tb,xb):Cb=t}function Tb(t){kb._stale=!1,kb._location=t.coords,kb._coordinate=new tt(t.coords.latitude,t.coords.longitude),kb.errorCode=0,kb.dispatchEvent(new Eb(kb._coordinate,t.coords.floorLevel))}function xb(t){Cb=null,Sb=null,kb._stale=!0,kb.errorCode=t.code,kb.dispatchEvent(new Ib(t))}class Eb extends i{constructor(t,e){super(bb.Change),vb(this,"coordinate",void 0),vb(this,"floorLevel",void 0),vb(this,"timestamp",void 0),this.coordinate=t,this.floorLevel=e,this.timestamp=new Date}}class Ib extends i{constructor(t){super(bb.Error),vb(this,"code",void 0),vb(this,"message",void 0),this.code=t.code,this.message=t.message}}function Ob(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Pb=new Ev({lineWidth:2,strokeColor:"white"}),Rb=function(t,e){const i=kb.location,s=void 0===e?56:e,o=(i&&i.accuracy||0)<=3e4;return kb.getMapRect().size.width*t>=s&&o},zb=function(t,e,i){return w((t-e)/(i-e),0,1)},Db=function(){const t=kb.location,e=t&&t.accuracy||0;return e>3e4?0:e};class Nb extends Fv{constructor(t){super(t.coordinate,Db(),{style:Pb}),Ob(this,"_isRingMode",void 0),Ob(this,"_isShown",void 0),Ob(this,"_fadeClock",void 0),Ob(this,"_mapRegion",void 0),Ob(this,"_worldSize",void 0),Ob(this,"_colorSchemeOrSatellite",void 0),ab.setIsAnimated(this,!0),this._isRingMode=!1,this._isShown=!1,this._fadeClock=0}updateIsShown(t,e,i){const s=Date.now(),o=Rb(e),n=o!==this._isRingMode?s:this._fadeClock,a=s-n<1e3,r=!!this._impl.shown&&(o||a);r!==this._isShown&&ab.setIsAnimated(this,r),this._impl.shown=r,this._fadeClock=n,this._isRingMode=o,this._isShown=r,this._mapRegion=t,this._worldSize=e,this._colorSchemeOrSatellite=i}performScheduledUpdate(){const t=Date.now(),e=kb.stale,i=this._mapRegion&&this._mapRegion.toMapRect(),s=i?i.size.width*this._worldSize:0,o=kb.getMapRect().size.width*this._worldSize,n=vt[ri.Light],a=vt[ri.Dark],r=this._colorSchemeOrSatellite===ri.Light?e?n.gray:n.blue:e?a.gray:a.blue;this.style.fillColor="rgb("+r.join(",")+")",this.style.strokeColor=this._colorSchemeOrSatellite===ri.Dark?"rgba("+n.gray3.join(",")+", 0.5)":"white";const l=zb(o,56,940),h=(e?.2:.14)*("satellite"===this._colorSchemeOrSatellite?2:1);this.style.fillOpacity=Math.pow(1-l,2)*h;const d=t-this._fadeClock,c=zb(d,0,1e3),u=this._isRingMode?c:1-c;this._impl.node.opacity=u;const p=zb(o,56,s),m=Xs(p,2,2.5),g=Xs(p,4,5),_=t%2e3/2e3,f=Ys(1-Math.abs(2*_-1));this.style.lineWidth=Xs(f,m,g)}updateForUserLocation(){const t=kb.coordinate;this.coordinate=t,this.radius=Db()}}Ob(Nb,"getMode",Rb);const Fb=["language","getsUserLocation"],Ub=["language","region","coordinate","limitToCountries"],Wb=["language"];class Gb extends y_{constructor(t){super("Geocoder",t=A(t)),this._checkOptions(t,Fb)}lookup(t,e,i={}){const s={q:t};i=A(i),this._checkOptions(i,Ub),k(t,"[MapKit] Missing `address` in call to `Geocoder.lookup()`."),S(t,"string","[MapKit] `address` passed to `Geocoder.lookup()` is not a string."),k(e,"[MapKit] Missing `callback` in call to `Geocoder.lookup()`."),S(e,"function","[MapKit] `callback` passed to `Geocoder.lookup()` is not a function.");const o=i.region,n=i.coordinate,a=i.limitToCountries;let r=this.language||Oe.language;if(o){const t=o.toBoundingRegion();s.searchRegion=`${t.northLatitude},${t.eastLongitude},${t.southLatitude},${t.westLongitude}`}else n&&(s.searchLocation=`${n.latitude},${n.longitude}`);return i.language&&(r=this._bestLanguage(i.language)),r&&(s.lang=r),a&&(S(a,"string","[MapKit] `limitToCountries` is not a string."),s.limitToCountries=a),this._sendImmediatelyOrWithUserLocation("geocode",s,e,((t,e)=>this._transform(t,e)),"geocode")}
2reverseLookup(t,e,i={}){const s={loc:`${t.latitude},${t.longitude}`};let o=this.language||Oe.language;return i=A(i),this._checkOptions(i,Wb),k(t,"[MapKit] Missing `coordinate` in call to `Geocoder.reverseLookup()`."),L(t,tt,"[MapKit] `coordinate` passed to `Geocoder.reverseLookup()` is not a Coordinate."),k(e,"[MapKit] Missing `callback` in call to `Geocoder.reverseLookup()`."),S(e,"function","[MapKit] `callback` passed to `Geocoder.reverseLookup()` is not a function."),i.language&&(o=this._bestLanguage(i.language)),o&&(s.lang=o),this._send("reverseGeocode",s,e,((t,e)=>this._transform(t,e)),"reverseGeocode")}_transform(t,e){const i={status:e.status,results:[]};return e.results&&(i.results=e.results.map((t=>new op(t)))),i}}class Bb{constructor(t,e){new.target===Bb&&Object.defineProperty(this,"_impl",{value:new y_(t,e)})}get getsUserLocation(){return this._impl.getsUserLocation}set getsUserLocation(t){this._impl.getsUserLocation=t}get language(){return this._impl.language}set language(t){this._impl.language=t}cancel(t){return this._impl.cancel(t)}}class Zb extends Bb{constructor(t){super("Geocoder"),Object.defineProperty(this,"_impl",{value:new Gb(t)})}lookup(t,e,i={}){return this._impl.lookup(t,e,i)}reverseLookup(t,e,i={}){return this._impl.reverseLookup(t,e,i)}}function jb(t,e){Hb(t,e),e.add(t)}function Kb(t,e,i){Hb(t,e),e.set(t,i)}function Hb(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function qb(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function Vb(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Xb(t,e,"get"))}function Yb(t,e,i){return function(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,Xb(t,e,"set"),i),i}function Xb(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var $b=new WeakMap,Jb=new WeakMap,Qb=new WeakMap,tw=new WeakSet,ew=new WeakMap,iw=new WeakSet;class sw{constructor(t){jb(this,iw),jb(this,tw),function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"_delegate",void 0),Kb(this,$b,{writable:!0,value:void 0}),Kb(this,Jb,{writable:!0,value:void 0}),Kb(this,Qb,{writable:!0,value:t=>qb(this,tw,ow).call(this,t)}),Kb(this,ew,{writable:!0,value:t=>qb(this,iw,nw).call(this,t)}),this._delegate=t,Yb(this,$b,!1),Yb(this,Jb,!1)}get showsUserLocation(){return Vb(this,$b)}set showsUserLocation(t){!t||kb.isAvailable?(Yb(this,$b,t),t?(kb.addEventListener(kb.Events.Change,Vb(this,Qb)),kb.addEventListener(kb.Events.Error,Vb(this,ew)),kb.watch()):(kb.removeEventListener(kb.Events.Change,Vb(this,Qb)),kb.removeEventListener(kb.Events.Error,Vb(this,ew)))):console.warn("[MapKit] User location is unavailable.")}get tracksUserLocation(){return Vb(this,Jb)}set tracksUserLocation(t){!t||kb.isAvailable?(Yb(this,Jb,t),t?(kb.addEventListener(kb.Events.Change,Vb(this,Qb)),kb.addEventListener(kb.Events.Error,Vb(this,ew)),kb.watch()):(kb.removeEventListener(kb.Events.Change,Vb(this,Qb)),kb.removeEventListener(kb.Events.Error,Vb(this,ew)))):console.warn("[MapKit] User location is unavailable.")}get userLocation(){return kb}mapWasDestroyed(){this._delegate=null,kb.removeEventListener(kb.Events.Change,Vb(this,Qb)),kb.removeEventListener(kb.Events.Error,Vb(this,ew))}}function ow(t){kb.errorCode=0,this._delegate.userLocationDidChange(t)}function nw(t){kb.errorCode=t.code,this._delegate.userLocationDidError(t)}const aw={AnnotationsController:Ty,MapFeaturesLayerController:Yy,OverlaysController:Bv,UserLocationController:sw,LayerItemsController:um,ItemCollection:Jy,AccuracyRingOverlay:Nb,UserLocationAnnotation:mb,Geocoder:Zb,userLocation:kb,mapkit:{}},rw={...r(Ap,["mapkit"]),...r(sb,["mapkit"]),...r(tv,["mapkit"]),...r(aw,["mapkit"]),mapkit:{}};[Ap,sb,tv,aw].forEach((t=>{if(t.mapkit){a(t.mapkit).forEach((e=>{const i=Object.getOwnPropertyDescriptor(t.mapkit,e);Object.defineProperty(rw.mapkit,e,i)}))}}));const lw={Feature:"Feature",FeatureCollection:"FeatureCollection",GeometryCollection:"GeometryCollection",MultiPoint:"MultiPoint",MultiLineString:"MultiLineString",MultiPolygon:"MultiPolygon",Point:"Point",LineString:"LineString",Polygon:"Polygon",Position:"Position"},hw=function(t){return vw(t,t.geometry&&t.geometry.type)},dw=function(t){if(!(t instanceof Object&&t.features instanceof Array))return!1;for(const e of t.features)if(e.geometry&&!vw(e,e.geometry.type))return!1;return!0},cw=function(t){return function(t){if(!Array.isArray(t)||t.length<2)return!1;for(let e=0;e<2;++e){const i=t[e];if("number"!=typeof i||void 0===i||isNaN(i))return!1}return!0}(t)},uw=function(t){return bw(t,lw.Point)},pw=function(t){return bw(t,lw.MultiPoint)},mw=function(t){return bw(t,lw.LineString)},gw=function(t){return bw(t,lw.MultiLineString)},_w=function(t){return bw(t,lw.Polygon)},fw=function(t){return bw(t,lw.MultiPolygon)},yw=function(t){if(!(t instanceof Object&&t.geometries instanceof Array))return!1;for(const e of t.geometries)if(!bw(e,e.type))return!1;return!0};function vw(t,e){return t instanceof Object&&(t.type===lw.Feature&&!!bw(t.geometry,e))}function bw(t,e){return t instanceof Object&&((!e||t.type===e)&&(!!function(t){return"string"==typeof t}(t.type)&&(t.type===lw.GeometryCollection?yw(t):t.type===lw.MultiLineString||t.type===lw.MultiPolygon||t.type===lw.MultiPoint?function(t){for(let e=0;e<t.length;e+=1)if(!(t[e]instanceof Array))return!1;return!0}(t.coordinates):t.coordinates instanceof Array)))}const ww={isValid:function(t){switch(t.type){case"Point":return uw(t);case"MultiPoint":return pw(t);case"LineString":return mw(t);case"MultiLineString":return gw(t);case"Polygon":return _w(t);case"MultiPolygon":return fw(t);case"GeometryCollection":return yw(t);case"Feature":return hw(t);case"FeatureCollection":return dw(t);default:return!1}},isPosition:function(t){return cw(t)}},Cw={MultiPoint:lw.Point,MultiLineString:lw.LineString,MultiPolygon:lw.Polygon},kw=[lw.MultiPoint,lw.MultiLineString,lw.MultiPolygon];
2class Sw extends Error{constructor(t){super(t)}}function Lw(t,e,i){const s=()=>{let e;e=s.collection?s.collection._impl.items[s.index]:t.scheduledTaskItem;const o=i(e);s.collection?s.collection._impl.items[s.index]=o:t.scheduledTaskItem=o};return e&&(s.collection=e,s.index=e.items.length),ai(s,Ue.Highest),s}function Mw(t){if(!ww.isPosition(t))throw new Sw("[MapKit] Expected a GeoJSON Position type, instead got "+t.toString());return new tt(t[1],t[0])}function Aw(t,e,i){const s=kw.includes(t.type),o=t.type===lw.GeometryCollection;if(s||o){const o=new Jy([],t);return s?t.coordinates.forEach((i=>{const s=Aw({type:Cw[t.type],coordinates:i},e,o);o._impl.items.push(s)})):t.geometries.forEach((t=>{const i=Aw(t,e,o);o._impl.items.push(i)})),e.hasCallbackOrDelegate&&Lw(e,i,(()=>{o._impl.items=o._impl.items.filter((t=>!!t));const i=t.type===lw.MultiPoint?e.delegate?.itemForMultiPoint?jt(e.delegate.itemForMultiPoint.bind(e.delegate),e.delegate,[o,t],o):o:t.type===lw.MultiLineString?e.delegate?.itemForMultiLineString?jt(e.delegate.itemForMultiLineString.bind(e.delegate),e.delegate,[o,t],o):o:t.type===lw.MultiPolygon?e.delegate?.itemForMultiPolygon?jt(e.delegate.itemForMultiPolygon.bind(e.delegate),e.delegate,[o,t],o):o:t.type===lw.GeometryCollection?e.delegate?.itemForGeometryCollection?jt(e.delegate.itemForGeometryCollection.bind(e.delegate),e.delegate,[o,t],o):o:void 0;if(Array.isArray(i)){const e=new Jy([],t);return e._impl.items=i,e}return i})),o}const n=function(t,e){switch(e){case lw.MultiPoint:case lw.LineString:return t.map((t=>Mw(t)));case lw.Polygon:return t.map((t=>t.map((t=>Mw(t)))));case lw.Point:return Mw(t)}}(t.coordinates,t.type);function a(){const i=t.type===lw.Point?new Jg(n,{data:t}):t.type===lw.LineString?new ib(n,{data:t}):t.type===lw.Polygon?new Vv(n,{data:t}):void 0,s=t.type===lw.Point?e.delegate?.itemForPoint?jt(e.delegate.itemForPoint.bind(e.delegate),e.delegate,[n,t],i):i:t.type===lw.LineString?e.delegate?.itemForLineString?jt(e.delegate.itemForLineString.bind(e.delegate),e.delegate,[i,t],i):i:t.type===lw.Polygon?e.delegate?.itemForPolygon?jt(e.delegate.itemForPolygon.bind(e.delegate),e.delegate,[i,t],i):i:void 0;return s?(++e.itemCount,e.delegate?.styleForOverlay&&(t.type===lw.LineString&&(s.style=jt(e.delegate.styleForOverlay.bind(e.delegate),e.delegate,[s,t],s.style)),t.type===lw.Polygon&&(s.style=jt(e.delegate.styleForOverlay.bind(e.delegate),e.delegate,[s,t],s.style))),s):null}return e.hasCallbackOrDelegate?Lw(e,i,a):a()}function Tw(t,e,i){let s=null;switch(t.type){case lw.Feature:return s=function(t,e,i){if(null===t.geometry)return e.hasCallbackOrDelegate?Lw(e,i,(()=>null)):null;if(!ww.isValid(t))throw new Sw("[MapKit] Expected a GeoJSON "+t.type+" type, instead got "+t.toString());const s=Aw(t.geometry,e,i);if(!s)throw new Sw("[MapKit] "+t.toString()+" is an unknown GeoJSON type.");return s}(t,e,i),e.delegate?.itemForFeature&&Lw(e,i,(i=>jt(e.delegate.itemForFeature.bind(e.delegate),e.delegate,[i,t],i))),s;case lw.FeatureCollection:return s=new Jy([],t),t.features.forEach((t=>{const i=Tw(t,e,s);i&&s._impl.items.push(i)})),e.hasCallbackOrDelegate&&Lw(e,i,(()=>{if(s._impl.items=s._impl.items.filter((t=>!!t)),e.delegate.itemForFeatureCollection){const i=jt(e.delegate.itemForFeatureCollection.bind(e.delegate),e.delegate,[s,t],s);if(Array.isArray(i)){const e=new Jy([],t);return e._impl.items=i,e}return i}return s})),s;case lw.GeometryCollection:case lw.MultiPoint:case lw.MultiLineString:case lw.MultiPolygon:case lw.Point:case lw.LineString:case lw.Polygon:return Aw(t,e,i);default:throw"type"in t&&"string"==typeof t.type?new Sw('[MapKit] "'+t.type+'" is an unknown GeoJSON type.'):new Sw("[MapKit] importGeoJSON expects an object with a known GeoJSON `type` property.")}}function xw(t,e){const i={itemCount:0,hasCallbackOrDelegate:!1};e&&(i.delegate="function"==typeof e?{geoJSONDidComplete(t){e(null,t)},geoJSONDidError(t,i){e(t,i)}}:e,i.hasCallbackOrDelegate=!0);try{const e="[MapKit] importGeoJSON expects an Object and was passed ";if(!t)throw new Sw(e+"a falsy value");if(!(t instanceof Object))throw new Sw(e+t.toString());if(Array.isArray(t))throw new Sw(e+"an array");let s=Tw(t,i);if(i.hasCallbackOrDelegate)return void ai((()=>{let e=void 0===i.scheduledTaskItem?s:i.scheduledTaskItem;if(!(e instanceof Jy)){const i=new Jy([],t);i._impl.items=e,e=i}i.delegate.geoJSONDidComplete?(0===i.itemCount&&console.warn("[MapKit] No item is imported with importGeoJSON, either because GeoJSON has no geometries, or the delegate methods did not return any item."),jt(i.delegate.geoJSONDidComplete.bind(i.delegate),i.delegate,[e,t])):console.warn("[MapKit] importGeoJSON was called asynchronously with a delegate object but no `geoJSONDidComplete` method was defined.")}),Ue.Highest);if(!(s instanceof Jy)){const e=new Jy([],t);e._impl.items=s,s=e}return s}catch(e){if(!(e instanceof Sw))throw e;i.delegate&&"function"==typeof i.delegate.geoJSONDidError?jt(i.delegate.geoJSONDidError.bind(i.delegate),i.delegate,[e,t]):console.error(e.message)}}
2const Ew={importGeoJSON:xw,constants:lw,validate:ww};function Iw(t,e){const i="function"==typeof e,s="object"==typeof e&&null!==e,o="string"==typeof t;if(o&&!i&&!s)throw new Error("[MapKit] For GeoJSON file imports, a callback must be provided as a second argument");if(!o)return Ew.importGeoJSON(t,e);!function(t,e){const i=new Gt(t,{loaderDidSucceed:function(i,s){let o;try{o=JSON.parse(s.responseText)}catch(i){if(i instanceof SyntaxError)return void e(new Error("[MapKit] The response of "+t+" does not appear to be valid JSON:"+s.responseText));throw i}e(null,o)},loaderDidFail:function(i,s){e(new Error("[MapKit] Failed to load "+t))}});i.schedule()}(t,((t,o)=>{t?s&&e.geoJSONDidError?jt(e.geoJSONDidError.bind(e),e,[t]):i&&jt(e,null,[t,void 0]):Ew.importGeoJSON(o,e)}))}const Ow={mapkit:{importGeoJSON:Iw}};function Pw(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Rw=[1,2,3,2,1],zw=Math.tan(.820304748437335);const Dw=class extends xp{constructor(...t){super(...t),Pw(this,"_bounceAnimationFrameIndex",void 0),Pw(this,"_shadowLiftDamping",void 0),Pw(this,"_pinVerticalTranslation",void 0),Pw(this,"_shadowHorizontalTranslation",void 0),Pw(this,"_shadowVerticalTranslation",void 0),Pw(this,"_dropDurationMs",void 0),Pw(this,"_dropAnimationStartDate",void 0),Pw(this,"_animationQueue",void 0),Pw(this,"nominalLiftAmount",void 0)}get isBouncing(){return"number"==typeof this._bounceAnimationFrameIndex&&this._bounceAnimationFrameIndex>=0}animateDropAfterLift(){const t=Math.max(this._dropAnimationStartP-Math.min((Date.now()-this._dropAfterLiftAnimationStartDate)/this.liftDurationMs,1),0);let e=this.liftAmount*t;this._annotation.sceneGraphNode.transform=(new gi).translate(0,-e),this._dropAnimationRevert||(e*=1.25),this._annotation.sceneGraphNode.shadowTransform=(new gi).translate(zw
2*e,-e),0===t&&(delete this._annotation.floating,this._annotation.sceneGraphNode.updateState(),delete this._dropAfterLiftAnimationStartDate,delete this._dropAnimationStartP,delete this._dropAnimationRevert,this._dequeueNextAnimation()),si(this)}animateLift(){const t=Math.min((Date.now()-this._liftAnimationStartDate)/this.liftDurationMs,1);let e=this.liftAmount*t;this._annotation.sceneGraphNode.transform=(new gi).translate(this.translation.x,this.translation.y-e),this._shadowLiftDamping&&(e=this.liftAmount*(1+.25*t)),this._annotation.sceneGraphNode.shadowTransform=(new gi).translate(zw*e,-e),t<1?(si(this),this._liftAnimationProgress=t):(delete this._liftAnimationStartDate,delete this._liftAnimationProgress,delete this._shadowLiftDamping,this._dequeueNextAnimation())}drop(){const t=this._annotation.position().y;this._pinVerticalTranslation=-t-4,this._shadowHorizontalTranslation=zw*-this._pinVerticalTranslation,this._shadowVerticalTranslation=this._pinVerticalTranslation;const e=t/this._annotation.delegate.mapForAnnotation(this._annotation._public)._impl.ensureRenderingFrame().size.height;this._dropDurationMs=1e3*Math.min(.35*(e+(1-e)/2),3),this._dropAnimationStartDate=Date.now(),this._annotation.floating=!0,this._annotation.sceneGraphNode.updateState(),this._animateDrop(),this._annotation._isAnimating=!0,this._animationQueue=[()=>this._bounce(),()=>this._annotation.finishedAnimating()],si(this)}dropAnnotationAfterDraggingAndRevertPosition(t){const e=()=>this._annotation.droppedAfterLift();this.isBouncing?this._animationQueue=[e]:(this._liftAnimationStartDate?(this._dropAnimationStartP=this._liftAnimationProgress,delete this._liftAnimationStartDate,delete this._liftAnimationProgress):this._dropAnimationStartP=1,t?(this._dropAfterLift(),this._animationQueue=[()=>this._bounce(),e]):(this._annotation.draggingDidEnd(),this._shadowLiftDamping=!0,this._animationQueue=[()=>this._dropAfterLift(),()=>this._bounce(),e],super.lift(this.nominalLiftAmount)),this._dropAnimationRevert=t,si(this))}lift(t){this.nominalLiftAmount=t,this._animationQueue=[()=>this._liftAfterBounce()],this._bounce(),si(this)}setTranslation(t){this.translation=t,this.isBouncing||this._liftAnimationStartDate||(this._annotation.sceneGraphNode.transform=(new gi).translate(t.x,t.y-this.liftAmount),this._annotation.sceneGraphNode.shadowTransform=(new gi).translate(zw
2*this.liftAmount,-this.liftAmount))}performScheduledUpdate(){this._dropAnimationStartDate?this._animateDrop():this.isBouncing?this._animateBounce():super.performScheduledUpdate()}_animateBounce(){(function(t){return"number"==typeof t})(this._bounceAnimationFrameIndex)&&this._bounceAnimationFrameIndex<Rw.length?(this._annotation.sceneGraphNode.updateState("down"+Rw[this._bounceAnimationFrameIndex]),++this._bounceAnimationFrameIndex):(delete this._bounceAnimationFrameIndex,this._dequeueNextAnimation()),si(this)}_animateDrop(){const t=Math.min((Date.now()-this._dropAnimationStartDate)/this._dropDurationMs,1),e=1-t;this._annotation.sceneGraphNode.transform=(new gi).translate(0,e*this._pinVerticalTranslation),this._annotation.sceneGraphNode.shadowTransform=(new gi).translate(e*this._shadowHorizontalTranslation,e*this._shadowVerticalTranslation),1===t&&(delete this._pinVerticalTranslation,delete this._shadowHorizontalTranslation,delete this._shadowVerticalTranslation,delete this._dropAnimationStartDate,delete this._dropDurationMs,this._annotation.floating=!1,this._annotation.sceneGraphNode.updateState(),this._dequeueNextAnimation()),si(this)}_bounce(){this._bounceAnimationFrameIndex=0}_dequeueNextAnimation(){if(this._animationQueue&&this._animationQueue.length>0){const t=this._animationQueue.shift();t&&t.call(this)}}_dropAfterLift(){this.translation=void 0,this._dropAfterLiftAnimationStartDate=Date.now(),si(this)}_liftAfterBounce(){super.lift(this.nominalLiftAmount),this._annotation.floating=!0,this._annotation.sceneGraphNode.updateState()}},Nw=Math.min(Ds(),3),Fw=(Nw>1?"_"+Nw+"x":"")+".png";let Uw;const Ww={};let Gw=[],Bw=!1;class Zw extends lo{constructor(t){super(t),function(){if(Kw)return;if(Kw=!0,Oe.state===Oe.States.PENDING||Oe.state===Oe.States.READY)return void jw();Oe.addEventListener(Oe.Events.Initialized,(function t(){Oe.removeEventListener(Oe.Events.Initialized,t),jw()}))}()}draw(t){if(!Uw)return void(Gw.includes(this._node)||Gw.push(this._node));const e=this._node,i=e.size.width,s=e.size.height;if(Bw){return void function(t,e,i,s){t.strokeStyle="#ff4040",t.lineWidth=2,t.strokeRect(0,e,i,s-e),t.beginPath(),t.moveTo(0,e),t.lineTo(i,s),t.moveTo(0,s),t.lineTo(i,e),t.stroke()}(t,s-e._annotation.size.height,e._annotation.size.width,s)}const o=e._state,n=e._annotation.color;if(Ww[n]||(Ww[n]={}),!Ww[n][o]){const t=document.createElement("canvas");t.width=i*Nw,t.height=s*Nw;const e=t.getContext("2d");e.fillStyle=n,e.fillRect(0,0,t.width,t.height),e.save(),e.globalCompositeOperation="destination-in",e.drawImage(Uw[o].head,0,0),e.restore(),e.drawImage(Uw[o].base,0,0),Ww[n][o]=t}if(e.shadowTransform){const o=Uw[""]?.shadow;t.drawImage(o,e.shadowTransform.e,e.shadowTransform.f,i,s)}t.drawImage(Ww[n][o],0,0,i,s)}}function jw(){const t={};function e(e,s){const o=Do.createImageUrl("pins/pin"+(e?"-":"")+e+"-"+s+Fw),n=Fs("img",{src:o}),a={handleEvent:function(o){switch(n.removeEventListener("load",a),n.removeEventListener("error",a),o.type){case"load":t[e][s]=n;break;case"error":console.warn("[MapKit] Error loading pin annotation image "+o.target.src+"; pin annotations may not display correctly."),Bw=!0}--i,0===i&&(Uw=t,Gw.forEach((t=>{t.needsDisplay=!0})),Gw=[])}};n.crossOrigin=ra(Oe.urlWithCredentials(o)),n.addEventListener("load",a),n.addEventListener("error",a)}let i=["","floating","down1","down2","down3"].reduce(((i,s)=>(t[s]={},e(s,"base"),e(s,"head"),i+2)),1);e("","shadow")}let Kw=!1;function Hw(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const qw=class extends ts{constructor(t){super(),Hw(this,"_annotation",void 0),Hw(this,"_state",""),Hw(this,"shadowTransform",void 0),this.size=new at(32,39),this._annotation=t,this._renderer=new Zw(this),this.updateState()}get position(){return this._annotation.nodePosition()}stringInfo(){return"PinAnnotationNode"+(this._state?"<"+String(this._state)+">":"")}updateState(t){t=this._annotation.floating?"floating":t||"",this._state!==t&&(this._state=t,this.needsDisplay=!0)}};function Vw(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const Yw=new at(15,36),Xw={Red:"#ff3d38",Green:"#54d669",Purple:"#c969e0"},$w=new Pe(8,35),Jw=new window.DOMPoint(-8,0);function Qw(t){var e;class i extends t{constructor(e,i,s){super(e,i,t.div,s),Vw(this,"dragOffset",new Pe(0,2))}init(){this._animationController=new Dw(this),this._dragController=this._animationController,this._sceneGraphNode=new qw(this),super.init(),this.setSize(Yw)}get size(){return Yw.copy()}set size(t){console.warn("[MapKit] The `size` property of a pin annotation cannot be set.")}get color(){return this._color}
2set color(t){S(t,"string","[MapKit] Expected a string value for PinAnnotation.color, but got `"+t+"` instead"),t!==this._color&&(this._color=t,this.updateLocalizedText(),this._sceneGraphNode.needsDisplay=!0)}centerOffsetForSelectionAccessory(){return new Pe(-8,-2)}get shouldPreventDrag(){return this._animationController.isBouncing}doesAnimate(){return this._animates}willMoveToMap(t){this._isMoving=t&&this.animates}didMoveToMap(){const t=this._isMoving;super.didMoveToMap(),this.delegate&&t&&this.visible&&!this._appearanceAnimation&&this._shown&&(this._isAnimating=!0,this._animationController.drop())}droppedAfterLift(){this.resetNodeTransform(),this._sceneGraphNode.updateState(),super.droppedAfterLift()}finishedAnimating(){this._sceneGraphNode.updateState(),super.finishedAnimating()}altText(){return super.altText()||(this._color===Xw.Green?Nn.get("Annotation.Pin.Green.AccessibilityLabel"):this._color===Xw.Purple?Nn.get("Annotation.Pin.Purple.AccessibilityLabel"):this._color===Xw.Red?Nn.get("Annotation.Pin.Red.AccessibilityLabel"):Nn.get("Annotation.Pin.AccessibilityLabel"))}draggingDidEnd(){super.draggingDidEnd(),super.updatePosition()}resetNodeTransform(){this.sceneGraphNode.transform=new gi}}return e=i,Vw(i,"Colors",Xw),e.prototype._animates=!0,e.prototype._color=Xw.Red,e.prototype._anchorPoint=$w,e.prototype._calloutAnchorPoint=Jw,e.prototype.renderedByDOMElement=!1,e.prototype.ConstructorOptions=Object.freeze(Object.assign({},t.prototype.ConstructorOptions,{color:"rw"})),i}Qw.Colors=Xw;const tC=Qw(om);class eC extends tC{}class iC extends am{constructor(t,e){super(t,om.div),console.warn("[MapKit] mapkit.PinAnnotation is deprecated and will be removed in a future release. Please use the newer mapkit.MarkerAnnotation class instead."),Object.defineProperty(this,"_impl",{value:new eC(this,t,e)}),this._impl.init()}get size(){return this._impl.size}set size(t){this._impl.size=t}get color(){return this._impl._color}set color(t){this._impl.color=t}}!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(iC,"Colors",Qw.Colors);const sC={mapkit:{PinAnnotation:iC}},oC=rt({Country:"Country",AdministrativeArea:"AdministrativeArea",SubAdministrativeArea:"SubAdministrativeArea",Locality:"Locality",SubLocality:"SubLocality",PostalCode:"PostalCode"});function nC(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function aC(t){return t.map((t=>{if(!C(t,oC))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.AddressCategory.");return t}))}class rC{constructor(t={}){if(nC(this,"_includes",null),nC(this,"_excludes",null),void 0!==(t=A(t)).includes&&void 0!==t.excludes)throw new Error("[MapKit] `includes` and `excludes` may not be specified at the same time.");if(void 0===t.includes&&void 0===t.excludes)throw new Error("[MapKit] Either `includes` or `excludes` should be specified.");void 0!==t.includes&&(this._includes=aC(t.includes)),void 0!==t.excludes&&(this._excludes=aC(t.excludes))}includesCategory(t){if(!C(t,oC))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.AddressCategory.");return this._includes?this._includes.includes(t):!!this._excludes&&!this._excludes.includes(t)}excludesCategory(t){if(!C(t,oC))throw new Error("[MapKit] Unknown category `"+t+"`. Choose from mapkit.AddressCategory.");return this._includes?!this._includes.includes(t):!!this._excludes&&this._excludes.includes(t)}static including(t){return M(t,"[MapKit] AddressFilter.including expected an array of categories."),new rC({includes:t})}static excluding(t){return M(t,"[MapKit] AddressFilter.excluding expected an array of categories."),new rC({excludes:t})}}nC(rC,"excludingAllCategories",void 0),nC(rC,"includingAllCategories",void 0);const lC=rC.excluding([]),hC=rC.including([]),dC=function(){throw new Error("[MapKit] `AddressFilter` may not be constructed directly. Use the mapkit.AddressFilter.including or the mapkit.AddressFilter.excluding methods.")};rC.prototype.constructor=dC,dC.prototype=rC.prototype,Object.defineProperties(dC,{including:{get:function(){return rC.including.bind(rC)},configurable:!0},excluding:{get:function(){return rC.excluding.bind(rC)},configurable:!0},includingAllCategories:{get:function(){return lC},configurable:!0},excludingAllCategories:{get:function(){return hC},configurable:!0}});function cC(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const uC=["language"],pC=["origin","destination","transportType","requestsAlternateRoutes","arrivalDate","departureDate","avoidTolls"],mC=["origin","destinations","transportType","departureDate"],gC=rt({Automobile:"AUTOMOBILE",Walking:"WALKING",Cycling:"CYCLING"});
2class _C extends y_{constructor(t){super("Directions",t=A(t)),this._checkOptions(t,uC)}eta(t,e){if(k(t,"[MapKit] Missing `request` in call to `Directions.eta()`."),A(t,"[MapKit] `request` is not a valid object."),k(e,"[MapKit] Missing `callback` in call to `Directions.eta()`."),S(e,"function","[MapKit] `callback` passed to `Directions.eta()` is not a function."),this._checkOptions(t,mC),k(t.origin,"[MapKit] Missing required property `origin` in `request` object."),k(t.destinations,"[MapKit] Missing required property `destinations` in `request` object."),!Array.isArray(t.destinations))throw new Error("[MapKit] Required property `destinations` in `request` object must be an array.");if(t.destinations.length>10)throw new Error("[MapKit] `destinations` array must be less than 10 destinations.");L(t.origin,tt,"[MapKit] `origin` property in `request` is not a Coordinate."),t.destinations.forEach((t=>{L(t,tt,"[MapKit] One of the values in `destinations` property in `request` is not a Coordinate.")}));const i={origin:`${t.origin.latitude},${t.origin.longitude}`,destinations:t.destinations.map((t=>t.latitude+","+t.longitude)).join("|")},s=t.transportType;if(s){for(const t in _C.Transport){const e=_C.Transport[t];e&&s===e&&(i.transportType=e)}if(!i.transportType)throw new TypeError("[MapKit] transportType must be a value of `Directions.Transport`.")}const o=t.departureDate;o&&(fC(o,"departureDate"),i.departureDate=o.toISOString());const n=this.language||Oe.language;return n&&(i.lang=n),this._send("etas",i,e,((e,i)=>this._handleEtaResponse(t,e,i)),"etas")}route(t,e){k(t,"[MapKit] Missing `request` in call to `Directions.route()`."),A(t,"[MapKit] `request` is not a valid object."),k(e,"[MapKit] Missing `callback` in call to `Directions.route()`."),S(e,"function","[MapKit] `callback` passed to `Directions.route()` is not a function."),this._checkOptions(t,pC);const i=t.origin,s=t.destination,o=t.transportType,n=t.arrivalDate,a=t.departureDate,r=t.avoidTolls,l=o===_C.Transport.Automobile,h=o===_C.Transport.Walking,d=o===_C.Transport.Cycling;k(i,"[MapKit] Missing required property `origin` in `request` object."),k(s,"[MapKit] Missing required property `destination` in `request` object.");const c={wps:JSON.stringify([yC(i),yC(s)])};if(o){if(!(l||h||d))throw new TypeError("[MapKit] transportType must be a value of `Directions.Transport`.");c.transport=o}n&&a?console.warn("[MapKit] `Directions.route()` should not be sent an `arrivalDate` and `departureDate` in the same request. These parameters have been dropped from the request."):"CN"===Oe.countryCode&&(n||a)?console.warn("[MapKit] `arrivalDate` and `departureDate` are not supported in China yet. These parameters have been dropped from the request."):n?(fC(n,"arrivalDate"),c.arrivalDate=n.toISOString()):a&&(fC(a,"departureDate"),c.departureDate=a.toISOString()),void 0!==t.requestsAlternateRoutes?c.n=t.requestsAlternateRoutes?"3":"1":c.n="1";const u=this.language||Oe.language;return u&&(c.lang=u),r&&h?console.warn("[MapKit] When `transportType` is `Directions.Transport.Walking`, the `avoidTolls` parameter has no effect. The `avoidTolls` parameter has been dropped from the request."):r&&d?console.warn("[MapKit] When `transportType` is `Directions.Transport.Cycling`, the `avoidTolls` parameter has no effect. The `avoidTolls` parameter has been dropped from the request."):r&&"CN"===Oe.countryCode?console.warn("[MapKit] `avoidTolls` is not supported in China yet. This parameter has been dropped from the request."):r&&(c.avoid="tolls"),this._send("directions",c,e,((e,i)=>this._handleResponse(t,e,i)),"directions")}_handleEtaResponse(t,e,i){return{request:e,origin:t.origin.copy(),etas:i.etas.map(((e,i)=>({destination:t.destinations[i]?t.destinations[i].copy():void 0,transportType:e.transportType,distance:e.distanceMeters,expectedTravelTime:e.expectedTravelTimeSeconds,staticTravelTime:e.staticTravelTimeSeconds})))}}_handleResponse(t,e,i){const s=i.stepPaths.map((t=>t.map((t=>new tt(t.lat,t.lng))))),o=i.steps.map((t=>new SC(t,s,i.shieldDomains))),n=i.routes.map((t=>new bC(t,o,s)));return{request:e,origin:vC(t.origin,i.origin),destination:vC(t.destination,i.destination),routes:n}}}function fC(t,e){if(!(t instanceof Date)||isNaN(t.getTime()))throw new TypeError("[MapKit] Expected a `Date` object for `"+e+"`, but got `"+t.toString()+"` instead.")}function yC(t){if("string"==typeof t)return{q:t};if(t instanceof op){if(t.muid)return{muid:t.muid};t.coordinate&&(t=t.coordinate)}if(t instanceof tt)return{loc:{lat:t.latitude,lng:t.longitude}};throw new Error("[MapKit] Location must be an address (string), Coordinate object or Place object.")}function vC(t,e){return e?new op(e):t instanceof op?t:t instanceof tt?t.copy():void 0}cC(_C,"Route",void 0),cC(_C,"Transport",gC);class bC{constructor(t,e,i){cC(this,"name",void 0),cC(this,"distance",void 0),cC(this,"expectedTravelTime",void 0),cC(this,"transportType",void 0),cC(this,"hasTolls",void 0),cC(this,"_path",void 0),cC(this,"steps",void 0),cC(this,"_polyline",void 0),this.name=t.name,this.distance=t.distanceMeters,this.expectedTravelTime=t.durationSeconds,this.transportType=t.transportType;const s=t.avoidTolls;this.hasTolls="boolean"==typeof s?!s:void 0,this._path=t.stepIndexes.map((t=>i[t])),this.steps=t.stepIndexes.map((t=>e[t]))}get path(){return console.warn("[MapKit] The `Route.path` property is deprecated and will be removed in a future release."),this._path}get polyline(){throw new Error("[MapKit] Route.polyline is available after loading the following library: overlays.")}}const wC=function(){throw new TypeError("[MapKit] Route may not be constructed.")};function CC(t){Object.defineProperty(bC.prototype,"polyline",{enumerable:!0,configurable:!0,get:function(){if(!this._polyline){const e=this._path.reduce(((t,e)=>t.concat(e)),[]);this._polyline=new t(e)}return this._polyline}})}bC.prototype.constructor=wC,wC.prototype=bC.prototype,u.jsModules.mapkit.PolylineOverlay?CC(u.jsModules.mapkit.PolylineOverlay):u.addEventListener("load",(function t(){u.jsModules.mapkit&&u.jsModules.mapkit.PolylineOverlay&&(u.removeEventListener("load",t),CC(u.jsModules.mapkit.PolylineOverlay))})),_C.Route=bC;const kC=["ON_RAMP","OFF_RAMP","HIGHWAY_OFF_RAMP_LEFT","HIGHWAY_OFF_RAMP_RIGHT","CHANGE_HIGHWAY","CHANGE_HIGHWAY_LEFT","CHANGE_HIGHWAY_RIGHT"];class SC{constructor(t,e,i){if(cC(this,"instructions",void 0),cC(this,"pathIndex",void 0),cC(this,"distance",void 0),cC(this,"transportType",void 0),cC(this,"path",void 0),cC(this,"_imageUrl",void 0),this.instructions=t.instructions,this.pathIndex=t.stepPathIndex,this.distance=t.distanceMeters,this.transportType=t.transportType,this.path=e[t.stepPathIndex],!i||!i.length||!t.maneuver)return;const s=i[t.stepPathIndex%i.length],o=t.maneuver;let n,a;if(o.names&&o.names.length){const t=o.names.filter((t=>t.type&&t.shieldUrl));t.length&&(n="//"+s+t[0].shieldUrl)}o.arrowUrl&&(a="//"+s+o.arrowUrl);const r=n&&kC.includes(o.type);this._imageUrl=r?n:a}}SC.prototype.constructor=wC,SC.prototype;class LC extends Bb{constructor(t){super("Directions"),Object.defineProperty(this,"_impl",{value:new _C(t)})}eta(t,e){return this._impl.eta(t,e)}route(t,e){return this._impl.route(t,e)}}
2!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(LC,"Transport",_C.Transport);const MC=["language"],AC=["language"];class TC extends y_{constructor(t){super("PlaceLookup",t=A(t)),this._checkOptions(t,MC)}getPlace(t,e,i){if(i=A(i),this._checkOptions(i,AC),"string"!=typeof t)throw new Error("[MapKit] `id` argument is not a string.");const s=i.language?this._bestLanguage(i.language):this.language||Oe.language,o=s?{lang:s}:{};return this._send(`place/${t}`,o,((t,i)=>e(t,i)),((t,e)=>this._transform(t,e)),"placeLookup")}_transform(t,e){return new op(e)}}class xC extends Bb{constructor(t={}){super("PlaceLookup"),Object.defineProperty(this,"_impl",{value:new TC(t)})}getPlace(t,e,i={}){return this._impl.getPlace(t,e,i)}}function EC(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const IC=["language","getsUserLocation","center","radius","region","pointOfInterestFilter"];class OC extends y_{constructor(t){super("PointsOfInterestsSearch",t=A(t)),EC(this,"_center",null),EC(this,"_radius",null),EC(this,"_region",null),EC(this,"_pointOfInterestFilter",null),this._checkOptions(t,IC),void 0!==t.center&&(this.center=t.center),void 0!==t.radius&&(this.radius=t.radius),void 0!==t.region&&(this.region=t.region),t.pointOfInterestFilter&&(this.pointOfInterestFilter=t.pointOfInterestFilter)}get center(){return this._center}set center(t){null!=t&&(L(t,tt,"[MapKit] PointsOfInterestSearch.center expected a Coordinate value."),t=t.copy()),this._center=t||null}get radius(){return this._radius}set radius(t){null!=t&&S(t,"number","[MapKit] PointsOfInterestSearch.radius expected a number value."),this._radius=t||null}get region(){return this._region}set region(t){null!=t&&(L(t,J,"[MapKit] PointsOfInterestSearch.region expected a CoordinateRegion value."),t=t.copy()),this._region=t||null}get getsUserLocation(){return!1}set getsUserLocation(t){throw new TypeError("[MapKit] getsUserLocation on PointsOfInterestSearch has not effect.")}get pointOfInterestFilter(){return this._pointOfInterestFilter}set pointOfInterestFilter(t){t&&L(t,$l,"[MapKit] Unknown value for `pointOfInterestFilter`. It must be an instance of mapkit.PointOfInterestFilter."),this._pointOfInterestFilter=t||null}search(t,e={}){if(e=A(e),this._checkOptions(e,IC),"object"==typeof t){const e=t;t=function(t,i){const s=e.searchDidError,o=e.searchDidComplete;t?"function"==typeof s&&s.call(e,t):"function"==typeof o&&o.call(e,i)}}if("CN"===Oe.countryCode)return void setTimeout((()=>{const e=new Error("[MapKit] PointsOfInterestSearch is not supported in China yet.");jt(t,null,[e])}));const i={};e.pointOfInterestFilter&&L(e.pointOfInterestFilter,$l,"[MapKit] Unknown value for `pointOfInterestFilter`. It must be an instance of mapkit.PointOfInterestFilter."),k(t,"[MapKit] Missing `callback` in call to `search`."),S(t,"function","[MapKit] `callback` passed to `search` is not a function.");const s=e.center||this.center,o=e.radius||this.radius,n=e.region||this.region;if((s||o)&&n)return void setTimeout((()=>{const e=new Error("[MapKit] Setting both `center`/`radius` and region are not allowed. Expects either a circular region defined by `center`/`radius` or a rectangular region defined by `region`.");jt(t,null,[e])}));if(!s&&!o&&!n)return void setTimeout((()=>{const e=new Error("[MapKit] No search region specified. Expects either a circular region defined by `center`/`radius` or a rectangular region defined by `region`.");jt(t,null,[e])}));if(s||o)L(s,tt,"[MapKit] `center` should be a Coordinate when specify a circular search region."),i.center=`${s.latitude},${s.longitude}`,o&&(i.radius=`${o}`);else if(n){L(n,J,"[MapKit] `region` should be a CoordinateRegion when specify a rectangular search region.");const t=n.toBoundingRegion();i.mapRegion=`${t.northLatitude},${t.eastLongitude},${t.southLatitude},${t.westLongitude}`}if(void 0!==e.getsUserLocation)throw Error("[MapKit] getsUserLocation on PointsOfInterestSearch has not effect.");let a=this.language||Oe.language;e.language&&(a=this._bestLanguage(e.language)),a&&(i.lang=a);const r=e.pointOfInterestFilter||this.pointOfInterestFilter;if(r){if(r._includes){if(0===r._includes.length)return void setTimeout((()=>jt(t,null,[null,this._nearbyPoiTransform({},{})])));i.includePoiCategories=r._includes.join(",")}r._excludes&&(i.excludePoiCategories=r._excludes.join(","))}return this._send("nearbyPoi",i,t,((t,e)=>this._nearbyPoiTransform(t,e)),"nearbyPoi")}_checkOptions(t,e){if((void 0!==t.center||void 0!==t.radius)&&void 0!==t.region)throw new Error("[MapKit] Setting both `center`/`radius` and region are not allowed. Expects either a circular region defined by `center`/`radius` or a rectangular region defined by `region`.");return super._checkOptions(t,e)}_nearbyPoiTransform(t,e){const i={places:[]};return e.results&&(i.places=e.results.map((t=>new op(t)))),i}}class PC extends Bb{constructor(t={}){super("PointsOfInterestSearch"),Object.defineProperty(this,"_impl",{value:new OC(t)})}get center(){return this._impl.center}set center(t){this._impl.center=t}get radius(){return this._impl.radius}set radius(t){this._impl.radius=t}get region(){return this._impl.region}set region(t){this._impl.region=t}get pointOfInterestFilter(){return this._impl.pointOfInterestFilter}set pointOfInterestFilter(t){this._impl.pointOfInterestFilter=t}search(t,e={}){return this._impl.search(t,e)}}
2!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(PC,"MaxRadius",2e3);const RC=rt({Default:"default",Required:"required"});function zC(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const DC=["language","getsUserLocation","coordinate","region","includeAddresses","includePointsOfInterest","includePhysicalFeatures","includeQueries","pointOfInterestFilter","addressFilter","limitToCountries","regionPriority"],NC=["language","coordinate","region","includeAddresses","includePointsOfInterest","includePhysicalFeatures","pointOfInterestFilter","addressFilter","limitToCountries","regionPriority"],FC=NC.concat(["includeQueries"]);class UC extends y_{constructor(t={}){super("Search",t=A(t)),zC(this,"_coordinate",null),zC(this,"_region",null),zC(this,"_includeAddresses",!0),zC(this,"_includePointsOfInterest",!0),zC(this,"_includePhysicalFeatures",void 0),zC(this,"_includeQueries",!0),zC(this,"_pointOfInterestFilter",null),zC(this,"_addressFilter",null),zC(this,"_limitToCountries",null),zC(this,"_regionPriority",RC.Default),this._checkOptions(t,DC),this.coordinate=t.coordinate??null,this.region=t.region??null,void 0!==t.includeAddresses&&(this.includeAddresses=t.includeAddresses),void 0!==t.includePointsOfInterest&&(this.includePointsOfInterest=t.includePointsOfInterest),void 0!==t.includePhysicalFeatures&&(this.includePhysicalFeatures=t.includePhysicalFeatures),void 0!==t.includeQueries&&(this.includeQueries=t.includeQueries),void 0!==t.pointOfInterestFilter&&(this.pointOfInterestFilter=t.pointOfInterestFilter),void 0!==t.addressFilter&&(this.addressFilter=t.addressFilter),void 0!==t.limitToCountries&&(this.limitToCountries=t.limitToCountries),void 0!==t.regionPriority&&(this.regionPriority=t.regionPriority)}get coordinate(){return this._coordinate}set coordinate(t){null!=t&&(L(t,tt,"[MapKit] Search.coordinate expected a Coordinate value."),t=t.copy()),this._coordinate=t||null}get region(){return this._region}set region(t){null!=t&&(L(t,J,"[MapKit] Search.region expected a CoordinateRegion value."),t=t.copy()),this._region=t||null}get includeAddresses(){return this._includeAddresses}set includeAddresses(t){this._includeAddresses=!!t}get includePointsOfInterest(){return this._includePointsOfInterest}set includePointsOfInterest(t){this._includePointsOfInterest=!!t}get includePhysicalFeatures(){return void 0===this._includePhysicalFeatures?this._includePointsOfInterest:this._includePhysicalFeatures}set includePhysicalFeatures(t){this._includePhysicalFeatures=!!t}get includeQueries(){return this._includeQueries}set includeQueries(t){this._includeQueries=!!t}get pointOfInterestFilter(){return this._pointOfInterestFilter}set pointOfInterestFilter(t){t&&L(t,$l,"[MapKit] Unknown value for `pointOfInterestFilter`. It must be an instance of mapkit.PointOfInterestFilter."),this._pointOfInterestFilter=t||null}get addressFilter(){return this._addressFilter}set addressFilter(t){t&&L(t,rC,"[MapKit] Unknown value for `addressFilter`. It must be an instance of mapkit.AddressFilter."),this._addressFilter=t||null}get limitToCountries(){return this._limitToCountries}set limitToCountries(t){t&&S(t,"string","[MapKit] `limitToCountries` is not a string."),this._limitToCountries=t||null}get regionPriority(){return this._regionPriority}set regionPriority(t){if(t&&!C(t,RC))throw new Error("[MapKit] Unknown value for `Search.regionPriority`. Choose from Search.RegionPriority.");this._regionPriority=t}search(t,e,i){return i=A(i),this._checkOptions(i,NC),this._request("search","search",((t,e)=>this._searchTransform(t,e)),t,e,i)}autocomplete(t,e,i){return i=A(i),this._checkOptions(i,FC),this._request("autocomplete","searchAutocomplete",((t,e)=>this._autocompleteTransform(t,e)),t,e,i)}_request(t,e,i,s,o,n){if("object"==typeof o){const e=o;o=function(i,s){const o="search"===t?"searchDidError":"autocompleteDidError",n="search"===t?"searchDidComplete":"autocompleteDidComplete";i?"function"==typeof e[o]&&e[o](i):"function"==typeof e[n]&&("search"===t?e.searchDidComplete(s):e.autocompleteDidComplete(s))}}const a={},r="Search."+t+"()";if(k(s,"[MapKit] Missing `query` in call to `"+r+"`."),k(o,"[MapKit] Missing `callback` in call to `"+r+"`."),S(o,"function","[MapKit] `callback` passed to `"+r+"` is not a function."),s instanceof zp)e=s._completionUrl;else{if("string"!=typeof s)throw new TypeError("[MapKit] `query` passed to `"+r+"` is neither a string nor SearchAutocompleteResult.");a.q=s}const l=n.region||this.region,h=n.coordinate||this.coordinate;let d=this.language||Oe.language;if(l){const t=l.toBoundingRegion();a.searchRegion=`${t.northLatitude},${t.eastLongitude},${t.southLatitude},${t.westLongitude}`}else h&&(a.searchLocation=`${h.latitude},${h.longitude}`);if(n.language&&(d=this._bestLanguage(n.language)),d&&(a.lang=d),n.pointOfInterestFilter&&L(n.pointOfInterestFilter,$l,"[MapKit] Unknown value for `pointOfInterestFilter`. It must be an instance of mapkit.PointOfInterestFilter."),n.addressFilter&&L(n.addressFilter,rC,"[MapKit] Unknown value for `addressFilter`. It must be an instance of mapkit.AddressFilter."),n.limitToCountries&&S(n.limitToCountries,"string","[MapKit] `limitToCountries` is not a string."),(n.limitToCountries||this.limitToCountries)&&(a.limitToCountries=(n.limitToCountries||this.limitToCountries)??void 0),n.regionPriority&&!C(n.regionPriority,RC))throw new Error("[MapKit] Unknown value for `regionPriority`. Choose from Search.RegionPriority.");a.searchRegionPriority=n.regionPriority||this.regionPriority;const c=n.pointOfInterestFilter||this.pointOfInterestFilter;let u=!0;c&&(n.includePointsOfInterest||this.includePointsOfInterest||console.warn("[MapKit] `includePointsOfInterest` is false but `pointOfInterestFilter` is set."),c._includes&&(0===c._includes.length?u=!1:a.includePoiCategories=c._includes.join(",")),c._excludes&&(a.excludePoiCategories=c._excludes.join(",")));const p=n.addressFilter||this.addressFilter;let m=!0;p&&(n.includeAddresses||this.includeAddresses||console.warn("[MapKit] `includeAddresses` is false but `addressFilter` is set."),p._includes&&(0===p._includes.length?m=!1:a.includeAddressCategories=p._includes.join(",")),p._excludes&&(a.excludeAddressCategories=p._excludes.join(",")));const g=[],_=UC.ResultTypeFilterValueMap;
2if(p?m&&g.push(_.address):void 0!==n.includeAddresses?n.includeAddresses&&g.push(_.address):this.includeAddresses&&g.push(_.address),c?u&&g.push(_.poi):void 0!==n.includePointsOfInterest?n.includePointsOfInterest&&g.push(_.poi):this.includePointsOfInterest&&g.push(_.poi),void 0!==n.includePhysicalFeatures)n.includePhysicalFeatures&&g.push(_.physicalFeature);else switch(this._includePhysicalFeatures){case!0:g.push(_.physicalFeature);break;case!1:break;case void 0:c?u&&g.push(_.physicalFeature):void 0!==n.includePointsOfInterest?n.includePointsOfInterest&&g.push(_.physicalFeature):this.includePointsOfInterest&&g.push(_.physicalFeature)}if("searchAutocomplete"===e&&(void 0!==n.includeQueries?n.includeQueries&&g.push(_.query):this.includeQueries&&g.push(_.query)),0===g.length)throw new Error("[MapKit] At least one of the types needs to be included in the search/autocomplete request.");return a.resultTypeFilter=g.join(","),"autocomplete"===t?this._sendImmediatelyOrWithUserLocation(e,a,o,i,t):this._sendImmediatelyOrWithUserLocation(e,a,((t,e)=>o(t,e)),((t,e)=>i(t,e)),t)}_searchTransform(t,e){const i={places:[]};if(t.q&&(i.query=t.q),e.displayMapRegion){const t=new et(e.displayMapRegion.northLat,e.displayMapRegion.eastLng,e.displayMapRegion.southLat,e.displayMapRegion.westLng);i.boundingRegion=t.toCoordinateRegion()}return e.results&&(i.places=e.results.map((t=>new op(t)))),i}_autocompleteTransform(t,e){const i={query:t.q,results:[]};return e.results&&(i.results=e.results.map((t=>new zp(t)))),i}}zC(UC,"ResultTypeFilterValueMap",rt({address:"Address",poi:"PointOfInterest",physicalFeature:"PhysicalFeature",query:"Query"}));class WC extends Bb{constructor(t={}){super("Search"),Object.defineProperty(this,"_impl",{value:new UC(t)})}get coordinate(){return this._impl.coordinate}set coordinate(t){this._impl.coordinate=t}get region(){return this._impl.region}set region(t){this._impl.region=t}get regionPriority(){return this._impl.regionPriority}set regionPriority(t){this._impl.regionPriority=t}get includeAddresses(){return this._impl.includeAddresses}set includeAddresses(t){this._impl.includeAddresses=t}get includePointsOfInterest(){return this._impl.includePointsOfInterest}set includePointsOfInterest(t){this._impl.includePointsOfInterest=t}get includePhysicalFeatures(){return this._impl.includePhysicalFeatures}set includePhysicalFeatures(t){this._impl.includePhysicalFeatures=t}get includeQueries(){return this._impl.includeQueries}set includeQueries(t){this._impl.includeQueries=t}get addressFilter(){return this._impl.addressFilter}set addressFilter(t){this._impl.addressFilter=t}get pointOfInterestFilter(){return this._impl.pointOfInterestFilter}set pointOfInterestFilter(t){this._impl.pointOfInterestFilter=t}get limitToCountries(){return this._impl.limitToCountries}set limitToCountries(t){this._impl.limitToCountries=t}search(t,e,i={}){return this._impl.search(t,e,i)}autocomplete(t,e,i={}){return this._impl.autocomplete(t,e,i)}}!function(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(WC,"RegionPriority",RC);const GC={CoordinateRegion:J,CoordinateSpan:Q,Coordinate:tt,BoundingRegion:et,MapPoint:it,MapRect:ot,MapSize:st,Geocoder:Zb,Search:WC,PlaceLookup:xC,Directions:LC,PointsOfInterestSearch:PC,Place:op.prototype.constructor,SearchAutocompleteResult:zp.prototype.constructor,PointOfInterestCategory:Vl,PointOfInterestFilter:th,filterIncludingAllCategories:Jl,filterExcludingAllCategories:Ql,AddressCategory:oC,AddressFilter:dC},BC={userLocation:kb,mapkit:GC},ZC={...r(rw,["mapkit"]),...r(BC,["mapkit"]),...r(Ow,["mapkit"]),...r(sC,["mapkit"]),mapkit:{}};[rw,sC,Ow,BC].forEach((t=>{if(t.mapkit){a(t.mapkit).forEach((e=>{const i=Object.getOwnPropertyDescriptor(t.mapkit,e);Object.defineProperty(ZC.mapkit,e,i)}))}}));function jC(t){t.loadAll=function(){this._chunkLoaded(ZC,(()=>this._dispatchLoadEndEvent(["all"])))}}const KC=t=>{if(!t)return null;try{return JSON.parse((e=ap(t.trim(),rp),(new TextDecoder).decode(new Uint8Array(atob(e).split("").map((t=>t.charCodeAt(0)))))))}catch(t){if(t instanceof DOMException)return null;if(t instanceof SyntaxError)return null;throw t}var e};function HC(t){const e=window[t];return"function"==typeof e?e:null}function qC(t){if(!t)return;const e=t.dataset.callback,i=t.dataset.language,s=t.dataset.libraries,o=void 0!==t.dataset.token?t.dataset.token:t.dataset.initialToken,n=t.dataset.distUrl,a=t.dataset.proxyPrefixes,r=t.dataset.proxyPrefix,l=t.dataset.countryCode,h=!("false"===t.dataset.shouldLogin),d=t.dataset.teamId,c=KC(t.dataset.options),u={_shouldLogin:h,_teamId:d,...c};for(const[e,i]of Object.entries(t.dataset))"`ha\\aHe_"===Bt(e)&&(u["_"+e]=i);if(t.src&&t.src.includes("sourcemap=1")&&(Oe.enableSourceMap=!0),Oe.setPerformanceMarkers(t.dataset.performanceMarkers),!(e||i||s||void 0!==o||n||r||l||d||c))return;i&&(u.language=i);if((o||""===o&&r)&&(u.authorizationCallback=function(t){t(o)}),n&&(u._distUrl=n),a){const t={};
2new URLSearchParams(a).forEach(((e,i)=>{t[i]=e})),u._proxyPrefixes=t}else r&&(u._proxyPrefixes={"*":r});l&&(u.countryCode=l),Oe.init(u,!0),e&&setTimeout((()=>HC(e)?.call(window)))}function VC(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class YC extends Ah{constructor(){throw super(),new TypeError("[MapKit] MapKit may not be constructed.")}init(t){Oe.init(t),Oe.addEventListener(Oe.Events.Changed,(t=>{const e=new $C(t.status);e.responseIdentifier=t.responseIdentifier,ik.dispatchEvent(e)})),Oe.addEventListener(Oe.Events.Error,(t=>{const e=new JC(t.status,t.message);e.responseIdentifier=t.responseIdentifier,ik.dispatchEvent(e)}))}get version(){return t.version}get build(){return t.build+""+Oe.buildTags}get language(){return Oe.language}set language(t){Oe.language=t}toString(){return["MapKit JS",this.version,"("+this.build+")"].join(" ")}get _tileProvider(){return Oe.tileProvider}get _countryCode(){return Oe.countryCode}set _countryCode(t){Oe._c(ne).setForcedCountryCode(t)}_login(){Oe.login()}_restore(){Oe._restore()}get _environment(){return Oe.environment}get Libraries(){}get loadedLibraries(){}load(t){u.load(t)}importGeoJSON(){throw TypeError()}get FeatureVisibility(){throw XC("FeatureVisibility",["map","look-around"])}get CoordinateRegion(){throw XC("CoordinateRegion",["map","services"])}get CoordinateSpan(){throw XC("CoordinateSpan",["map","services"])}get Coordinate(){throw XC("Coordinate",["map","services","look-around"])}get BoundingRegion(){throw XC("BoundingRegion",["map","services"])}get MapPoint(){throw XC("MapPoint",["map","services"])}get MapRect(){throw XC("MapRect",["map","services"])}get MapSize(){throw XC("MapSize",["map","services"])}get Padding(){throw XC("Padding",["map","look-around"])}get CameraZoomRange(){throw XC("CameraZoomRange",["map"])}get MapFeatureType(){throw XC("MapFeatureType",["annotations"])}get Style(){throw XC("Style",["overlays"])}get LineGradient(){throw XC("LineGradient",["overlays"])}get CircleOverlay(){throw XC("CircleOverlay",["overlays"])}get PolylineOverlay(){throw XC("PolylineOverlay",["overlays"])}get PolygonOverlay(){throw XC("PolygonOverlay",["overlays"])}get Geocoder(){throw XC("Geocoder",["services"])}get Search(){throw XC("Search",["services"])}get PlaceLookup(){throw XC("PlaceLookup",["services"])}get Directions(){throw XC("Directions",["services"])}get PointsOfInterestSearch(){throw XC("PointsOfInterestSearch",["services"])}get Map(){throw XC("Map",["map"])}get maps(){throw XC("maps",["map"])}get Annotation(){throw XC("Annotation",["annotations"])}get PlaceAnnotation(){throw XC("PlaceAnnotation",["annotations"])}get PinAnnotation(){throw XC("PinAnnotation",["annotations"])}get ImageAnnotation(){throw XC("ImageAnnotation",["annotations"])}get MarkerAnnotation(){throw XC("MarkerAnnotation",["annotations"])}get MapFeatureAnnotation(){throw XC("MapFeatureAnnotation",["annotations"])}get TileOverlay(){throw XC("TileOverlay",["overlays"])}get Place(){throw XC("Place",["services"])}get SearchAutocompleteResult(){throw XC("SearchAutocompleteResult",["services"])}get PointOfInterestCategory(){throw XC("PointOfInterestCategory",["map","services"])}get PointOfInterestFilter(){throw XC("PointOfInterestFilter",["map","services"])}get filterIncludingAllCategories(){throw XC("filterIncludingAllCategories",["map","services"])}get filterExcludingAllCategories(){throw XC("filterExcludingAllCategories",["map","services"])}get AddressCategory(){throw XC("AddressCategory",["services"])}get AddressFilter(){throw XC("AddressFilter",["services"])}get PlaceDetail(){throw XC("PlaceDetail",["map"])}get PlaceSelectionAccessory(){throw XC("PlaceSelectionAccessory",["annotations"])}get placeDetails(){throw XC("placeDetails",["map"])}get LookAround(){throw XC("LookAround",["look-around"])}get LookAroundPreview(){throw XC("LookAroundPreview",["look-around"])}get LookAroundScene(){throw XC("LookAroundScene",["look-around"])}get lookAroundViews(){throw XC("lookAroundViews",["look-around"])}}function XC(t,e){return new Error(1===e.length?`[MapKit] mapkit.${t} is available after loading the following library: ${e.join(", ")}.`:`[MapKit] mapkit.${t} is available after loading one of the following libraries: ${e.join(", ")}.`)}VC(YC,"__l",void 0),Object.defineProperty(YC.prototype,"importGeoJSON",{get(){throw XC("importGeoJSON",["geojson"])},configurable:!0,enumerable:!1});class $C extends Mh{constructor(t){super(Oe.Events.Changed),this.status=t,VC(this,"responseIdentifier",void 0)}}class JC extends Mh{constructor(t,e){super(Oe.Events.Error),this.status=t,this.message=e,VC(this,"responseIdentifier",void 0)}}const QC=["importGeoJSON","FeatureVisibility","CoordinateRegion","Co
2ordinateSpan","Coordinate","BoundingRegion","MapPoint","MapRect","MapSize","Padding","CameraZoomRange","MapFeatureType","Style","LineGradient","CircleOverlay","PolylineOverlay","PolygonOverlay","Geocoder","Search","PlaceLookup","Directions","PointsOfInterestSearch","Map","maps","Annotation","PinAnnotation","ImageAnnotation","MarkerAnnotation","PlaceAnnotation","MapFeatureAnnotation","TileOverlay","Place","SearchAutocompleteResult","PointOfInterestCategory","PointOfInterestFilter","filterIncludingAllCategories","filterExcludingAllCategories","AddressCategory","AddressFilter","PlaceDetail","PlaceSelectionAccessory","placeDetails","LookAround","LookAroundPreview","LookAroundScene","lookAroundViews"];let tk=!1;jC(u),u.addEventListener(u.Events.LOAD,(t=>{const e=t.jsModules;if(e.mapkit)for(const t of Object.keys(e.mapkit)){const i=QC.indexOf(t);-1!==i&&(delete YC.prototype[t],QC.splice(i,1));const s=Object.getOwnPropertyDescriptor(e.mapkit,t);Object.defineProperty(YC.prototype,t,s)}if(!tk&&u.jsModules.css&&u.jsModules.htmlElement){const t=u.jsModules.htmlElement("style",u.jsModules.css);t.nonce=Oe.nonce,document.head.appendChild(t),tk=!0}}));const ek=Do.findScriptAndSetBasePath();ek&&ek.nonce&&(Oe.nonce=ek.nonce,Oe.scriptBaseUrl=Do.scriptBaseUrl);delete YC.prototype.load,u.loadAll(),qC(ek),Oe.state!==Oe.States.UNINITIALIZED&&(Oe.addEventListener(Oe.Events.Changed,(t=>{const e=new $C(t.status);e.responseIdentifier=t.responseIdentifier,ik.dispatchEvent(e)})),Oe.addEventListener(Oe.Events.Error,(t=>{const e=new JC(t.status,t.message);e.responseIdentifier=t.responseIdentifier,ik.dispatchEvent(e)})));const ik=Object.create(YC.prototype);Oe.performanceMarkers.loading&&performance.mark("mapkit-core-load");window.mapkit&&"init"in window.mapkit&&console.warn("[MapKit] Mapkit namespace already exists; did you import MapKit more than once?"),window.mapkit=ik})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.