diff --git a/dist-demo/assets/bluedot-B8SR7m2V.png b/dist-demo/assets/bluedot-B8SR7m2V.png deleted file mode 100644 index ad42888c..00000000 Binary files a/dist-demo/assets/bluedot-B8SR7m2V.png and /dev/null differ diff --git a/dist-demo/assets/browser-ponyfill-BPb-pMC3.js b/dist-demo/assets/browser-ponyfill-BPb-pMC3.js deleted file mode 100644 index a8af952a..00000000 --- a/dist-demo/assets/browser-ponyfill-BPb-pMC3.js +++ /dev/null @@ -1,2 +0,0 @@ -import{g as z}from"./index-pmvz9BtM.js";function G(w,d){for(var b=0;by[h]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var A={exports:{}},R;function X(){return R||(R=1,(function(w,d){var b=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis,y=(function(){function p(){this.fetch=!1,this.DOMException=b.DOMException}return p.prototype=b,new p})();(function(p){(function(u){var a=typeof p<"u"&&p||typeof self<"u"&&self||typeof a<"u"&&a,f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function j(e){return e&&DataView.prototype.isPrototypeOf(e)}if(f.arrayBuffer)var S=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],F=ArrayBuffer.isView||function(e){return e&&S.indexOf(Object.prototype.toString.call(e))>-1};function v(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function E(e){return typeof e!="string"&&(e=String(e)),e}function T(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return f.iterable&&(t[Symbol.iterator]=function(){return t}),t}function s(e){this.map={},e instanceof s?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}s.prototype.append=function(e,t){e=v(e),t=E(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},s.prototype.delete=function(e){delete this.map[v(e)]},s.prototype.get=function(e){return e=v(e),this.has(e)?this.map[e]:null},s.prototype.has=function(e){return this.map.hasOwnProperty(v(e))},s.prototype.set=function(e,t){this.map[v(e)]=E(t)},s.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},s.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),T(e)},s.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),T(e)},s.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),T(e)},f.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);function B(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function P(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function I(e){var t=new FileReader,r=P(t);return t.readAsArrayBuffer(e),r}function M(e){var t=new FileReader,r=P(t);return t.readAsText(e),r}function q(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?t:e}function m(e,t){if(!(this instanceof m))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof m){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new s(t.headers)),this.method=L(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}m.prototype.clone=function(){return new m(this,{body:this._bodyInit})};function C(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function k(e){var t=new s,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(` -`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var _=i.join(":").trim();t.append(o,_)}}),t}x.call(m.prototype);function c(e,t){if(!(this instanceof c))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new s(t.headers),this.url=t.url||"",this._initBody(e)}x.call(c.prototype),c.prototype.clone=function(){return new c(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},c.error=function(){var e=new c(null,{status:0,statusText:""});return e.type="error",e};var N=[301,302,303,307,308];c.redirect=function(e,t){if(N.indexOf(t)===-1)throw new RangeError("Invalid status code");return new c(null,{status:t,headers:{location:e}})},u.DOMException=a.DOMException;try{new u.DOMException}catch{u.DOMException=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function O(e,t){return new Promise(function(r,n){var i=new m(e,t);if(i.signal&&i.signal.aborted)return n(new u.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function _(){o.abort()}o.onload=function(){var l={status:o.status,statusText:o.statusText,headers:k(o.getAllResponseHeaders()||"")};l.url="responseURL"in o?o.responseURL:l.headers.get("X-Request-URL");var g="response"in o?o.response:o.responseText;setTimeout(function(){r(new c(g,l))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new u.DOMException("Aborted","AbortError"))},0)};function V(l){try{return l===""&&a.location.href?a.location.href:l}catch{return l}}o.open(i.method,V(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(f.blob?o.responseType="blob":f.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof s)?Object.getOwnPropertyNames(t.headers).forEach(function(l){o.setRequestHeader(l,E(t.headers[l]))}):i.headers.forEach(function(l,g){o.setRequestHeader(g,l)}),i.signal&&(i.signal.addEventListener("abort",_),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",_)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}return O.polyfill=!0,a.fetch||(a.fetch=O,a.Headers=s,a.Request=m,a.Response=c),u.Headers=s,u.Request=m,u.Response=c,u.fetch=O,u})({})})(y),y.fetch.ponyfill=!0,delete y.fetch.polyfill;var h=b.fetch?b:y;d=h.fetch,d.default=h.fetch,d.fetch=h.fetch,d.Headers=h.Headers,d.Request=h.Request,d.Response=h.Response,w.exports=d})(A,A.exports)),A.exports}var U=X();const J=z(U),Q=G({__proto__:null,default:J},[U]);export{Q as b}; diff --git a/dist-demo/assets/favicon-BCgXh-r7.png b/dist-demo/assets/favicon-BCgXh-r7.png deleted file mode 100644 index 6f201918..00000000 Binary files a/dist-demo/assets/favicon-BCgXh-r7.png and /dev/null differ diff --git a/dist-demo/assets/gsi-PqYiP5VA.jpg b/dist-demo/assets/gsi-PqYiP5VA.jpg deleted file mode 100644 index d0ae37d7..00000000 Binary files a/dist-demo/assets/gsi-PqYiP5VA.jpg and /dev/null differ diff --git a/dist-demo/assets/gsi_ortho-ScnbiFIR.jpg b/dist-demo/assets/gsi_ortho-ScnbiFIR.jpg deleted file mode 100644 index bfde2cf1..00000000 Binary files a/dist-demo/assets/gsi_ortho-ScnbiFIR.jpg and /dev/null differ diff --git a/dist-demo/assets/index-gQLVKqGw.css b/dist-demo/assets/index-gQLVKqGw.css deleted file mode 100644 index 6ede4ea4..00000000 --- a/dist-demo/assets/index-gQLVKqGw.css +++ /dev/null @@ -1 +0,0 @@ -.maplat :root,.maplat :host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.maplat .ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.maplat .ol-mouse-position{top:8px;right:8px;position:absolute}.maplat .ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.maplat .ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.maplat .ol-scale-bar{position:absolute;bottom:8px;left:8px}.maplat .ol-scale-bar-inner{display:flex}.maplat .ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.maplat .ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.maplat .ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.maplat .ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.maplat .ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.maplat .ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.maplat .ol-unsupported{display:none}.maplat .ol-viewport,.maplat .ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.maplat .ol-viewport canvas{all:unset;overflow:hidden}.maplat .ol-viewport{touch-action:pan-x pan-y}.maplat .ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.maplat .ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.maplat .ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.maplat .ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.maplat .ol-zoom{top:.5em;left:.5em}.maplat .ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.maplat .ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.maplat .ol-zoom-extent{top:4.643em;left:.5em}.maplat .ol-full-screen{right:.5em;top:.5em}.maplat .ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.maplat .ol-control button::-moz-focus-inner{border:none;padding:0}.maplat .ol-zoom-extent button{line-height:1.4em}.maplat .ol-compass{display:block;font-weight:400;will-change:transform}.maplat .ol-touch .ol-control button{font-size:1.5em}.maplat .ol-touch .ol-zoom-extent{top:5.5em}.maplat .ol-control button:hover,.maplat .ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.maplat .ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.maplat .ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.maplat .ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.maplat .ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.maplat .ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.maplat .ol-attribution li{display:inline;list-style:none}.maplat .ol-attribution li:not(:last-child):after{content:" "}.maplat .ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.maplat .ol-attribution button{flex-shrink:0}.maplat .ol-attribution.ol-collapsed ul{display:none}.maplat .ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.maplat .ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.maplat .ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.maplat .ol-attribution.ol-uncollapsible button{display:none}.maplat .ol-zoomslider{top:4.5em;left:.5em;height:200px}.maplat .ol-zoomslider button{position:relative;height:10px}.maplat .ol-touch .ol-zoomslider{top:5.5em}.maplat .ol-overviewmap{left:.5em;bottom:.5em}.maplat .ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.maplat .ol-overviewmap .ol-overviewmap-map,.maplat .ol-overviewmap button{display:block}.maplat .ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.maplat .ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.maplat .ol-overviewmap.ol-collapsed .ol-overviewmap-map,.maplat .ol-overviewmap.ol-uncollapsible button{display:none}.maplat .ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.maplat .ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.maplat .ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.maplat .ol-overviewmap .ol-viewport:hover{cursor:pointer}.maplat *{-webkit-tap-highlight-color:rgba(0,0,0,0)} diff --git a/dist-demo/assets/index-pmvz9BtM.js b/dist-demo/assets/index-pmvz9BtM.js deleted file mode 100644 index fb307a2f..00000000 --- a/dist-demo/assets/index-pmvz9BtM.js +++ /dev/null @@ -1,28 +0,0 @@ -var id=Object.defineProperty;var nd=(r,t,e)=>t in r?id(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var T=(r,t,e)=>nd(r,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function e(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=e(n);fetch(n.href,s)}})();function ti(r){"@babel/helpers - typeof";return ti=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ti(r)}function gi(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function rd(r,t){if(ti(r)!="object"||!r)return r;var e=r[Symbol.toPrimitive];if(e!==void 0){var i=e.call(r,t);if(ti(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(r)}function kh(r){var t=rd(r,"string");return ti(t)=="symbol"?t:t+""}function jl(r,t){for(var e=0;er.length)&&(t=r.length);for(var e=0,i=Array(t);e1&&arguments[1]!==void 0?arguments[1]:{};gi(this,r),this.init(t,e)}return mi(r,[{key:"init",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=i.prefix||"i18next:",this.logger=e||hd,this.options=i,this.debug=i.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,i=new Array(e),n=0;n1?i-1:0),s=1;s-1?a.replace(/###/g,"."):a}function n(){return!r||typeof r=="string"}for(var s=typeof t!="string"?[].concat(t):t.split(".");s.length>1;){if(n())return{};var o=i(s.shift());!r[o]&&e&&(r[o]=new e),Object.prototype.hasOwnProperty.call(r,o)?r=r[o]:r={}}return n()?{}:{obj:r,k:i(s.shift())}}function Wl(r,t,e){var i=La(r,t,Object),n=i.obj,s=i.k;n[s]=e}function dd(r,t,e,i){var n=La(r,t,Object),s=n.obj,o=n.k;s[o]=s[o]||[],s[o].push(e)}function Ds(r,t){var e=La(r,t),i=e.obj,n=e.k;if(i)return i[n]}function Xl(r,t,e){var i=Ds(r,e);return i!==void 0?i:Ds(t,e)}function Fh(r,t,e){for(var i in t)i!=="__proto__"&&i!=="constructor"&&(i in r?typeof r[i]=="string"||r[i]instanceof String||typeof t[i]=="string"||t[i]instanceof String?e&&(r[i]=t[i]):Fh(r[i],t[i],e):r[i]=t[i]);return r}function Rn(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var gd={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function md(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,function(t){return gd[t]}):r}var to=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,pd=[" ",",","?","!",";"];function _d(r,t,e){t=t||"",e=e||"";var i=pd.filter(function(a){return t.indexOf(a)<0&&e.indexOf(a)<0});if(i.length===0)return!0;var n=new RegExp("(".concat(i.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),s=!n.test(r);if(!s){var o=r.indexOf(e);o>0&&!n.test(r.substring(0,o))&&(s=!0)}return s}function Yl(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function cs(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nh(r,t){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(r){if(r[t])return r[t];for(var i=t.split(e),n=r,s=0;ss+o;)o++,a=i.slice(s,s+o).join(e),l=n[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=i.slice(s+o).join(e);return c?Nh(l,c,e):void 0}n=n[i[s]]}return n}}var wd=(function(r){Qs(e,r);var t=yd(e);function e(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return gi(this,e),n=t.call(this),to&&Vi.call(Xi(n)),n.data=i||{},n.options=s,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.options.ignoreJSONStructure===void 0&&(n.options.ignoreJSONStructure=!0),n}return mi(e,[{key:"addNamespaces",value:function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}},{key:"removeNamespaces",value:function(n){var s=this.options.ns.indexOf(n);s>-1&&this.options.ns.splice(s,1)}},{key:"getResource",value:function(n,s,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,h=[n,s];o&&typeof o!="string"&&(h=h.concat(o)),o&&typeof o=="string"&&(h=h.concat(l?o.split(l):o)),n.indexOf(".")>-1&&(h=n.split("."));var u=Ds(this.data,h);return u||!c||typeof o!="string"?u:Nh(this.data&&this.data[n]&&this.data[n][s],o,l)}},{key:"addResource",value:function(n,s,o,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var h=[n,s];o&&(h=h.concat(c?o.split(c):o)),n.indexOf(".")>-1&&(h=n.split("."),a=s,s=h[1]),this.addNamespaces(s),Wl(this.data,h,a),l.silent||this.emit("added",n,s,o,a)}},{key:"addResources",value:function(n,s,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in o)(typeof o[l]=="string"||Object.prototype.toString.apply(o[l])==="[object Array]")&&this.addResource(n,s,l,o[l],{silent:!0});a.silent||this.emit("added",n,s,o)}},{key:"addResourceBundle",value:function(n,s,o,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},h=[n,s];n.indexOf(".")>-1&&(h=n.split("."),a=o,o=s,s=h[1]),this.addNamespaces(s);var u=Ds(this.data,h)||{};a?Fh(u,o,l):u=cs(cs({},u),o),Wl(this.data,h,u),c.silent||this.emit("added",n,s,o)}},{key:"removeResourceBundle",value:function(n,s){this.hasResourceBundle(n,s)&&delete this.data[n][s],this.removeNamespaces(s),this.emit("removed",n,s)}},{key:"hasResourceBundle",value:function(n,s){return this.getResource(n,s)!==void 0}},{key:"getResourceBundle",value:function(n,s){return s||(s=this.options.defaultNS),this.options.compatibilityAPI==="v1"?cs(cs({},{}),this.getResource(n,s)):this.getResource(n,s)}},{key:"getDataByLanguage",value:function(n){return this.data[n]}},{key:"hasLanguageSomeTranslations",value:function(n){var s=this.getDataByLanguage(n),o=s&&Object.keys(s)||[];return!!o.find(function(a){return s[a]&&Object.keys(s[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),e})(Vi),jh={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,e,i,n,s){var o=this;return t.forEach(function(a){o.processors[a]&&(e=o.processors[a].process(e,i,n,s))}),e}};function Zl(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function pe(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vl={},Kl=(function(r){Qs(e,r);var t=xd(e);function e(i){var n,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return gi(this,e),n=t.call(this),to&&Vi.call(Xi(n)),fd(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i,Xi(n)),n.options=s,n.options.keySeparator===void 0&&(n.options.keySeparator="."),n.logger=li.create("translator"),n}return mi(e,[{key:"changeLanguage",value:function(n){n&&(this.language=n)}},{key:"exists",value:function(n){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(n==null)return!1;var o=this.resolve(n,s);return o&&o.res!==void 0}},{key:"extractFromKey",value:function(n,s){var o=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");var a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,l=s.ns||this.options.defaultNS||[],c=o&&n.indexOf(o)>-1,h=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!_d(n,o,a);if(c&&!h){var u=n.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:n,namespaces:l};var f=n.split(o);(o!==a||o===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),n=f.join(a)}return typeof l=="string"&&(l=[l]),{key:n,namespaces:l}}},{key:"translate",value:function(n,s,o){var a=this;if(ti(s)!=="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),s||(s={}),n==null)return"";Array.isArray(n)||(n=[String(n)]);var l=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,h=this.extractFromKey(n[n.length-1],s),u=h.key,f=h.namespaces,d=f[f.length-1],g=s.lng||this.language,m=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(m){var p=s.nsSeparator||this.options.nsSeparator;return l?(_.res="".concat(d).concat(p).concat(u),_):"".concat(d).concat(p).concat(u)}return l?(_.res=u,_):u}var _=this.resolve(n,s),y=_&&_.res,x=_&&_.usedKey||u,v=_&&_.exactUsedKey||u,b=Object.prototype.toString.apply(y),C=["[object Number]","[object Function]","[object RegExp]"],R=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,O=typeof y!="string"&&typeof y!="boolean"&&typeof y!="number";if(I&&y&&O&&C.indexOf(b)<0&&!(typeof R=="string"&&b==="[object Array]")){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var G=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,y,pe(pe({},s),{},{ns:f})):"key '".concat(u," (").concat(this.language,")' returned an object instead of string.");return l?(_.res=G,_):G}if(c){var W=b==="[object Array]",H=W?[]:{},K=W?v:x;for(var $ in y)if(Object.prototype.hasOwnProperty.call(y,$)){var st="".concat(K).concat(c).concat($);H[$]=this.translate(st,pe(pe({},s),{joinArrays:!1,ns:f})),H[$]===st&&(H[$]=y[$])}y=H}}else if(I&&typeof R=="string"&&b==="[object Array]")y=y.join(R),y&&(y=this.extendTranslation(y,n,s,o));else{var D=!1,tt=!1,Q=s.count!==void 0&&typeof s.count!="string",ot=e.hasDefaultValue(s),ct=Q?this.pluralResolver.getSuffix(g,s.count,s):"",at=s["defaultValue".concat(ct)]||s.defaultValue;!this.isValidLookup(y)&&ot&&(D=!0,y=at),this.isValidLookup(y)||(tt=!0,y=u);var B=s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Bt=B&&tt?void 0:y,Lt=ot&&at!==y&&this.options.updateMissing;if(tt||D||Lt){if(this.logger.log(Lt?"updateKey":"missingKey",g,d,u,Lt?at:y),c){var kt=this.resolve(u,pe(pe({},s),{},{keySeparator:!1}));kt&&kt.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var zt=[],Nt=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Nt&&Nt[0])for(var Kt=0;Kt1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,h,u;return typeof n=="string"&&(n=[n]),n.forEach(function(f){if(!s.isValidLookup(a)){var d=s.extractFromKey(f,o),g=d.key;l=g;var m=d.namespaces;s.options.fallbackNS&&(m=m.concat(s.options.fallbackNS));var p=o.count!==void 0&&typeof o.count!="string",_=p&&!o.ordinal&&o.count===0&&s.pluralResolver.shouldUseIntlApi(),y=o.context!==void 0&&(typeof o.context=="string"||typeof o.context=="number")&&o.context!=="",x=o.lngs?o.lngs:s.languageUtils.toResolveHierarchy(o.lng||s.language,o.fallbackLng);m.forEach(function(v){s.isValidLookup(a)||(u=v,!Vl["".concat(x[0],"-").concat(v)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(u)&&(Vl["".concat(x[0],"-").concat(v)]=!0,s.logger.warn('key "'.concat(l,'" for languages "').concat(x.join(", "),`" won't get resolved as namespace "`).concat(u,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),x.forEach(function(b){if(!s.isValidLookup(a)){h=b;var C=[g];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(C,g,b,v,o);else{var R;p&&(R=s.pluralResolver.getSuffix(b,o.count,o));var I="".concat(s.options.pluralSeparator,"zero");if(p&&(C.push(g+R),_&&C.push(g+I)),y){var O="".concat(g).concat(s.options.contextSeparator).concat(o.context);C.push(O),p&&(C.push(O+R),_&&C.push(O+I))}}for(var G;G=C.pop();)s.isValidLookup(a)||(c=G,a=s.getResource(b,v,G,o))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:h,usedNS:u}}},{key:"isValidLookup",value:function(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}},{key:"getResource",value:function(n,s,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(n,s,o,a):this.resourceStore.getResource(n,s,o,a)}}],[{key:"hasDefaultValue",value:function(n){var s="defaultValue";for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&s===o.substring(0,s.length)&&n[o]!==void 0)return!0;return!1}}]),e})(Vi);function So(r){return r.charAt(0).toUpperCase()+r.slice(1)}var bd=(function(){function r(t){gi(this,r),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=li.create("languageUtils")}return mi(r,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var i=e.split("-");return i.length===2||(i.pop(),i[i.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(i.join("-"))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var i=e.split("-");return this.formatLanguageCode(i[0])}},{key:"formatLanguageCode",value:function(e){if(typeof e=="string"&&e.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map(function(s){return s.toLowerCase()}):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=So(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),i.indexOf(n[1].toLowerCase())>-1&&(n[1]=So(n[1].toLowerCase())),i.indexOf(n[2].toLowerCase())>-1&&(n[2]=So(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var i=this;if(!e)return null;var n;return e.forEach(function(s){if(!n){var o=i.formatLanguageCode(s);(!i.options.supportedLngs||i.isSupportedCode(o))&&(n=o)}}),!n&&this.options.supportedLngs&&e.forEach(function(s){if(!n){var o=i.getLanguagePartFromCode(s);if(i.isSupportedCode(o))return n=o;n=i.options.supportedLngs.find(function(a){if(a.indexOf(o)===0)return a})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}},{key:"getFallbackCodes",value:function(e,i){if(!e)return[];if(typeof e=="function"&&(e=e(i)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!i)return e.default||[];var n=e[i];return n||(n=e[this.getScriptPartFromCode(i)]),n||(n=e[this.formatLanguageCode(i)]),n||(n=e[this.getLanguagePartFromCode(i)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,i){var n=this,s=this.getFallbackCodes(i||this.options.fallbackLng||[],e),o=[],a=function(c){c&&(n.isSupportedCode(c)?o.push(c):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof e=="string"&&e.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):typeof e=="string"&&a(this.formatLanguageCode(e)),s.forEach(function(l){o.indexOf(l)<0&&a(n.formatLanguageCode(l))}),o}}]),r})(),Ad=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Cd={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},Sd=["v1","v2","v3"],Hl={zero:0,one:1,two:2,few:3,many:4,other:5};function Rd(){var r={};return Ad.forEach(function(t){t.lngs.forEach(function(e){r[e]={numbers:t.nr,plurals:Cd[t.fc]}})}),r}var Id=(function(){function r(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};gi(this,r),this.languageUtils=t,this.options=e,this.logger=li.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Rd()}return mi(r,[{key:"addRule",value:function(e,i){this.rules[e]=i}},{key:"getRule",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:i.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(e,i);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(function(s){return"".concat(i).concat(s)})}},{key:"getSuffixes",value:function(e){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=this.getRule(e,n);return s?this.shouldUseIntlApi()?s.resolvedOptions().pluralCategories.sort(function(o,a){return Hl[o]-Hl[a]}).map(function(o){return"".concat(i.options.prepend).concat(o)}):s.numbers.map(function(o){return i.getSuffix(e,o,n)}):[]}},{key:"getSuffix",value:function(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=this.getRule(e,n);return s?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(s.select(i)):this.getSuffixRetroCompatible(s,i):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,i){var n=this,s=e.noAbs?e.plurals(i):e.plurals(Math.abs(i)),o=e.numbers[s];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));var a=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?"_plural_".concat(o.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?a():this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString()}},{key:"shouldUseIntlApi",value:function(){return!Sd.includes(this.options.compatibilityJSON)}}]),r})();function ql(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function He(r){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};gi(this,r),this.logger=li.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return mi(r,[{key:"init",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var i=e.interpolation;this.escape=i.escape!==void 0?i.escape:md,this.escapeValue=i.escapeValue!==void 0?i.escapeValue:!0,this.useRawValueToEscape=i.useRawValueToEscape!==void 0?i.useRawValueToEscape:!1,this.prefix=i.prefix?Rn(i.prefix):i.prefixEscaped||"{{",this.suffix=i.suffix?Rn(i.suffix):i.suffixEscaped||"}}",this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||",",this.unescapePrefix=i.unescapeSuffix?"":i.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":i.unescapeSuffix||"",this.nestingPrefix=i.nestingPrefix?Rn(i.nestingPrefix):i.nestingPrefixEscaped||Rn("$t("),this.nestingSuffix=i.nestingSuffix?Rn(i.nestingSuffix):i.nestingSuffixEscaped||Rn(")"),this.nestingOptionsSeparator=i.nestingOptionsSeparator?i.nestingOptionsSeparator:i.nestingOptionsSeparator||",",this.maxReplaces=i.maxReplaces?i.maxReplaces:1e3,this.alwaysFormat=i.alwaysFormat!==void 0?i.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var i="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(i,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,i,n,s){var o=this,a,l,c,h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}var f=function(_){if(_.indexOf(o.formatSeparator)<0){var y=Xl(i,h,_);return o.alwaysFormat?o.format(y,void 0,n,He(He(He({},s),i),{},{interpolationkey:_})):y}var x=_.split(o.formatSeparator),v=x.shift().trim(),b=x.join(o.formatSeparator).trim();return o.format(Xl(i,h,v),b,n,He(He(He({},s),i),{},{interpolationkey:v}))};this.resetRegExp();var d=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,m=[{regex:this.regexpUnescape,safeValue:function(_){return u(_)}},{regex:this.regexp,safeValue:function(_){return o.escapeValue?u(o.escape(_)):u(_)}}];return m.forEach(function(p){for(c=0;a=p.regex.exec(e);){var _=a[1].trim();if(l=f(_),l===void 0)if(typeof d=="function"){var y=d(e,a,s);l=typeof y=="string"?y:""}else if(s&&s.hasOwnProperty(_))l="";else if(g){l=a[0];continue}else o.logger.warn("missed to pass in variable ".concat(_," for interpolating ").concat(e)),l="";else typeof l!="string"&&!o.useRawValueToEscape&&(l=Ul(l));var x=p.safeValue(l);if(e=e.replace(a[0],x),g?(p.regex.lastIndex+=l.length,p.regex.lastIndex-=a[0].length):p.regex.lastIndex=0,c++,c>=o.maxReplaces)break}}),e}},{key:"nest",value:function(e,i){var n=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,a,l=He({},s);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,g){var m=this.nestingOptionsSeparator;if(d.indexOf(m)<0)return d;var p=d.split(new RegExp("".concat(m,"[ ]*{"))),_="{".concat(p[1]);d=p[0],_=this.interpolate(_,l);var y=_.match(/'/g),x=_.match(/"/g);(y&&y.length%2===0&&!x||x.length%2!==0)&&(_=_.replace(/'/g,'"'));try{l=JSON.parse(_),g&&(l=He(He({},g),l))}catch(v){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),v),"".concat(d).concat(m).concat(_)}return delete l.defaultValue,d}for(;o=this.nestingRegexp.exec(e);){var h=[],u=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){var f=o[1].split(this.formatSeparator).map(function(d){return d.trim()});o[1]=f.shift(),h=f,u=!0}if(a=i(c.call(this,o[1].trim(),l),l),a&&o[0]===e&&typeof a!="string")return a;typeof a!="string"&&(a=Ul(a)),a||(this.logger.warn("missed to resolve ".concat(o[1]," for nesting ").concat(e)),a=""),u&&(a=h.reduce(function(d,g){return n.format(d,g,s.lng,He(He({},s),{},{interpolationkey:o[1].trim()}))},a.trim())),e=e.replace(o[0],a),this.regexp.lastIndex=0}return e}}]),r})();function $l(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function Li(r){for(var t=1;t-1){var i=r.split("(");t=i[0].toLowerCase().trim();var n=i[1].substring(0,i[1].length-1);if(t==="currency"&&n.indexOf(":")<0)e.currency||(e.currency=n.trim());else if(t==="relativetime"&&n.indexOf(":")<0)e.range||(e.range=n.trim());else{var s=n.split(";");s.forEach(function(o){if(o){var a=o.split(":"),l=cd(a),c=l[0],h=l.slice(1),u=h.join(":").trim().replace(/^'+|'+$/g,"");e[c.trim()]||(e[c.trim()]=u),u==="false"&&(e[c.trim()]=!1),u==="true"&&(e[c.trim()]=!0),isNaN(u)||(e[c.trim()]=parseInt(u,10))}})}}return{formatName:t,formatOptions:e}}function In(r){var t={};return function(i,n,s){var o=n+JSON.stringify(s),a=t[o];return a||(a=r(n,s),t[o]=a),a(i)}}var Ld=(function(){function r(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gi(this,r),this.logger=li.create("formatter"),this.options=t,this.formats={number:In(function(e,i){var n=new Intl.NumberFormat(e,i);return function(s){return n.format(s)}}),currency:In(function(e,i){var n=new Intl.NumberFormat(e,Li(Li({},i),{},{style:"currency"}));return function(s){return n.format(s)}}),datetime:In(function(e,i){var n=new Intl.DateTimeFormat(e,Li({},i));return function(s){return n.format(s)}}),relativetime:In(function(e,i){var n=new Intl.RelativeTimeFormat(e,Li({},i));return function(s){return n.format(s,i.range||"day")}}),list:In(function(e,i){var n=new Intl.ListFormat(e,Li({},i));return function(s){return n.format(s)}})},this.init(t)}return mi(r,[{key:"init",value:function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},n=i.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,i){this.formats[e.toLowerCase().trim()]=i}},{key:"addCached",value:function(e,i){this.formats[e.toLowerCase().trim()]=In(i)}},{key:"format",value:function(e,i,n,s){var o=this,a=i.split(this.formatSeparator),l=a.reduce(function(c,h){var u=Md(h),f=u.formatName,d=u.formatOptions;if(o.formats[f]){var g=c;try{var m=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},p=m.locale||m.lng||s.locale||s.lng||n;g=o.formats[f](c,p,Li(Li(Li({},d),s),m))}catch(_){o.logger.warn(_)}return g}else o.logger.warn("there was no format function for ".concat(f));return c},e);return l}}]),r})();function Jl(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function Ql(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Dd(r,t){r.pending[t]!==void 0&&(delete r.pending[t],r.pendingCount--)}var kd=(function(r){Qs(e,r);var t=Pd(e);function e(i,n,s){var o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return gi(this,e),o=t.call(this),to&&Vi.call(Xi(o)),o.backend=i,o.store=n,o.services=s,o.languageUtils=s.languageUtils,o.options=a,o.logger=li.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(s,a.backend,a),o}return mi(e,[{key:"queueLoad",value:function(n,s,o,a){var l=this,c={},h={},u={},f={};return n.forEach(function(d){var g=!0;s.forEach(function(m){var p="".concat(d,"|").concat(m);!o.reload&&l.store.hasResourceBundle(d,m)?l.state[p]=2:l.state[p]<0||(l.state[p]===1?h[p]===void 0&&(h[p]=!0):(l.state[p]=1,g=!1,h[p]===void 0&&(h[p]=!0),c[p]===void 0&&(c[p]=!0),f[m]===void 0&&(f[m]=!0)))}),g||(u[d]=!0)}),(Object.keys(c).length||Object.keys(h).length)&&this.queue.push({pending:h,pendingCount:Object.keys(h).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(h),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(n,s,o){var a=n.split("|"),l=a[0],c=a[1];s&&this.emit("failedLoading",l,c,s),o&&this.store.addResourceBundle(l,c,o),this.state[n]=s?-1:2;var h={};this.queue.forEach(function(u){dd(u.loaded,[l],c),Dd(u,n),s&&u.errors.push(s),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(function(f){h[f]||(h[f]={});var d=u.loaded[f];d.length&&d.forEach(function(g){h[f][g]===void 0&&(h[f][g]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(function(u){return!u.done})}},{key:"read",value:function(n,s,o){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,h=arguments.length>5?arguments[5]:void 0;if(!n.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:s,fcName:o,tried:l,wait:c,callback:h});return}return this.readingCalls++,this.backend[o](n,s,function(u,f){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&f&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof n=="string"&&(n=this.languageUtils.toResolveHierarchy(n)),typeof s=="string"&&(s=[s]);var c=this.queueLoad(n,s,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(h){o.loadOne(h)})}},{key:"load",value:function(n,s,o){this.prepareLoading(n,s,{},o)}},{key:"reload",value:function(n,s,o){this.prepareLoading(n,s,{reload:!0},o)}},{key:"loadOne",value:function(n){var s=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=n.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(h,u){h&&s.logger.warn("".concat(o,"loading namespace ").concat(c," for language ").concat(l," failed"),h),!h&&u&&s.logger.log("".concat(o,"loaded namespace ").concat(c," for language ").concat(l),u),s.loaded(n,h,u)})}},{key:"saveMissing",value:function(n,s,o,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(s)){this.logger.warn('did not save key "'.concat(o,'" as the namespace "').concat(s,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}o==null||o===""||(this.backend&&this.backend.create&&this.backend.create(n,s,o,a,null,Ql(Ql({},c),{},{isUpdate:l})),!(!n||!n[0])&&this.store.addResource(n[0],s,o,a))}}]),e})(Vi);function Fd(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var e={};if(ti(t[1])==="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),ti(t[2])==="object"||ti(t[3])==="object"){var i=t[3]||t[2];Object.keys(i).forEach(function(n){e[n]=i[n]})}return e},interpolation:{escapeValue:!0,format:function(t,e,i,n){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function tc(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function ec(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function si(r){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hs(){}function Gd(r){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(r));t.forEach(function(e){typeof r[e]=="function"&&(r[e]=r[e].bind(r))})}var ks=(function(r){Qs(e,r);var t=Nd(e);function e(){var i,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;if(gi(this,e),i=t.call(this),to&&Vi.call(Xi(i)),i.options=tc(n),i.services={},i.logger=li,i.modules={external:[]},Gd(Xi(i)),s&&!i.isInitialized&&!n.isClone){if(!i.options.initImmediate)return i.init(n,s),Kr(i,Xi(i));setTimeout(function(){i.init(n,s)},0)}return i}return mi(e,[{key:"init",value:function(){var n=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;typeof s=="function"&&(o=s,s={}),!s.defaultNS&&s.defaultNS!==!1&&s.ns&&(typeof s.ns=="string"?s.defaultNS=s.ns:s.ns.indexOf("translation")<0&&(s.defaultNS=s.ns[0]));var a=Fd();this.options=si(si(si({},a),this.options),tc(s)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=si(si({},a.interpolation),this.options.interpolation)),s.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=s.keySeparator),s.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=s.nsSeparator);function l(_){return _?typeof _=="function"?new _:_:null}if(!this.options.isClone){this.modules.logger?li.init(l(this.modules.logger),this.options):li.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Ld);var h=new bd(this.options);this.store=new wd(this.options.resources,this.options);var u=this.services;u.logger=li,u.resourceStore=this.store,u.languageUtils=h,u.pluralResolver=new Id(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(u.formatter=l(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Td(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new kd(l(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(_){for(var y=arguments.length,x=new Array(y>1?y-1:0),v=1;v1?y-1:0),v=1;v0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(_){n[_]=function(){var y;return(y=n.store)[_].apply(y,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(_){n[_]=function(){var y;return(y=n.store)[_].apply(y,arguments),n}});var m=cr(),p=function(){var y=function(v,b){n.isInitialized&&!n.initializedStoreOnce&&n.logger.warn("init: i18next is already initialized. You should call init just once!"),n.isInitialized=!0,n.options.isClone||n.logger.log("initialized",n.options),n.emit("initialized",n.options),m.resolve(b),o(v,b)};if(n.languages&&n.options.compatibilityAPI!=="v1"&&!n.isInitialized)return y(null,n.t.bind(n));n.changeLanguage(n.options.lng,y)};return this.options.resources||!this.options.initImmediate?p():setTimeout(p,0),m}},{key:"loadResources",value:function(n){var s=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hs,a=o,l=typeof n=="string"?n:this.language;if(typeof n=="function"&&(a=n),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],h=function(d){if(d){var g=s.services.languageUtils.toResolveHierarchy(d);g.forEach(function(m){c.indexOf(m)<0&&c.push(m)})}};if(l)h(l);else{var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.forEach(function(f){return h(f)})}this.options.preload&&this.options.preload.forEach(function(f){return h(f)}),this.services.backendConnector.load(c,this.options.ns,function(f){!f&&!s.resolvedLanguage&&s.language&&s.setResolvedLanguage(s.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(n,s,o){var a=cr();return n||(n=this.languages),s||(s=this.options.ns),o||(o=hs),this.services.backendConnector.reload(n,s,function(l){a.resolve(),o(l)}),a}},{key:"use",value:function(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&jh.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}},{key:"setResolvedLanguage",value:function(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1))for(var s=0;s-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}}},{key:"changeLanguage",value:function(n,s){var o=this;this.isLanguageChangingTo=n;var a=cr();this.emit("languageChanging",n);var l=function(f){o.language=f,o.languages=o.services.languageUtils.toResolveHierarchy(f),o.resolvedLanguage=void 0,o.setResolvedLanguage(f)},c=function(f,d){d?(l(d),o.translator.changeLanguage(d),o.isLanguageChangingTo=void 0,o.emit("languageChanged",d),o.logger.log("languageChanged",d)):o.isLanguageChangingTo=void 0,a.resolve(function(){return o.t.apply(o,arguments)}),s&&s(f,function(){return o.t.apply(o,arguments)})},h=function(f){!n&&!f&&o.services.languageDetector&&(f=[]);var d=typeof f=="string"?f:o.services.languageUtils.getBestMatchFromCodes(f);d&&(o.language||l(d),o.translator.language||o.translator.changeLanguage(d),o.services.languageDetector&&o.services.languageDetector.cacheUserLanguage(d)),o.loadResources(d,function(g){c(g,d)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?h(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(h):h(n),a}},{key:"getFixedT",value:function(n,s,o){var a=this,l=function c(h,u){var f;if(ti(u)!=="object"){for(var d=arguments.length,g=new Array(d>2?d-2:0),m=2;m1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var h=function(d,g){var m=s.services.backendConnector.state["".concat(d,"|").concat(g)];return m===-1||m===2};if(o.precheck){var u=o.precheck(this,h);if(u!==void 0)return u}return!!(this.hasResourceBundle(a,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||h(a,n)&&(!l||h(c,n)))}},{key:"loadNamespaces",value:function(n,s){var o=this,a=cr();return this.options.ns?(typeof n=="string"&&(n=[n]),n.forEach(function(l){o.options.ns.indexOf(l)<0&&o.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),s&&s(l)}),a):(s&&s(),Promise.resolve())}},{key:"loadLanguages",value:function(n,s){var o=cr();typeof n=="string"&&(n=[n]);var a=this.options.preload||[],l=n.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){o.resolve(),s&&s(c)}),o):(s&&s(),Promise.resolve())}},{key:"dir",value:function(n){if(n||(n=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!n)return"rtl";var s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return s.indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var n=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hs,a=si(si(si({},this.options),s),{isClone:!0}),l=new e(a);(s.debug!==void 0||s.prefix!==void 0)&&(l.logger=l.logger.clone(s));var c=["store","services","language"];return c.forEach(function(h){l[h]=n[h]}),l.services=si({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Kl(l.services,l.options),l.translator.on("*",function(h){for(var u=arguments.length,f=new Array(u>1?u-1:0),d=1;d0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ks(r,t)});var ce=ks.createInstance();ce.createInstance=ks.createInstance;ce.createInstance;ce.init;ce.loadResources;ce.reloadResources;ce.use;ce.changeLanguage;ce.getFixedT;ce.t;ce.exists;ce.setDefaultNamespace;ce.hasLoadedNamespace;ce.loadNamespaces;ce.loadLanguages;function aa(r){"@babel/helpers - typeof";return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(r)}function Gh(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":aa(XMLHttpRequest))==="object"}function Bd(r){return!!r&&typeof r.then=="function"}function zd(r){return Bd(r)?r:Promise.resolve(r)}const Ud="modulepreload",Wd=function(r,t){return new URL(r,t).href},ic={},Xd=function(t,e,i){let n=Promise.resolve();if(e&&e.length>0){let o=function(h){return Promise.all(h.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));n=o(e.map(h=>{if(h=Wd(h,i),h in ic)return;ic[h]=!0;const u=h.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(!!i)for(let m=a.length-1;m>=0;m--){const p=a[m];if(p.href===h&&(!u||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const g=document.createElement("link");if(g.rel=u?"stylesheet":Ud,u||(g.as="script"),g.crossOrigin="",g.href=h,c&&g.setAttribute("nonce",c),document.head.appendChild(g),u)return new Promise((m,p)=>{g.addEventListener("load",m),g.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return n.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};function nc(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function rc(r){for(var t=1;timport("./browser-ponyfill-BPb-pMC3.js").then(r=>r.b),[],import.meta.url).then(function(r){Ki=r.default}).catch(function(){})}catch{}var la=function(t,e){if(e&&mn(e)==="object"){var i="";for(var n in e)i+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n]);if(!i)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+i.slice(1)}return t},sc=function(t,e,i,n){var s=function(l){if(!l.ok)return i(l.statusText||"Error",{status:l.status});l.text().then(function(c){i(null,{status:l.status,data:c})}).catch(i)};if(n){var o=n(t,e);if(o instanceof Promise){o.then(s).catch(i);return}}typeof fetch=="function"?fetch(t,e).then(s).catch(i):Ki(t,e).then(s).catch(i)},oc=!1,Kd=function(t,e,i,n){t.queryStringParams&&(e=la(e,t.queryStringParams));var s=rc({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof globalThis<"u"&&typeof globalThis.process<"u"&&globalThis.process.versions&&globalThis.process.versions.node&&(s["User-Agent"]="i18next-http-backend (node/".concat(globalThis.process.version,"; ").concat(globalThis.process.platform," ").concat(globalThis.process.arch,")")),i&&(s["Content-Type"]="application/json");var o=typeof t.requestOptions=="function"?t.requestOptions(i):t.requestOptions,a=rc({method:i?"POST":"GET",body:i?t.stringify(i):void 0,headers:s},oc?{}:o),l=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{sc(e,a,n,l)}catch(c){if(!o||Object.keys(o).length===0||!c.message||c.message.indexOf("not implemented")<0)return n(c);try{Object.keys(o).forEach(function(h){delete a[h]}),sc(e,a,n,l),oc=!0}catch(h){n(h)}}},Hd=function(t,e,i,n){i&&mn(i)==="object"&&(i=la("",i).slice(1)),t.queryStringParams&&(e=la(e,t.queryStringParams));try{var s=Ir?new Ir:new Fs("MSXML2.XMLHTTP.3.0");s.open(i?"POST":"GET",e,1),t.crossDomain||s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.withCredentials=!!t.withCredentials,i&&s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.overrideMimeType&&s.overrideMimeType("application/json");var o=t.customHeaders;if(o=typeof o=="function"?o():o,o)for(var a in o)s.setRequestHeader(a,o[a]);s.onreadystatechange=function(){s.readyState>3&&n(s.status>=400?s.statusText:null,{status:s.status,data:s.responseText})},s.send(i)}catch(l){console&&console.log(l)}},qd=function(t,e,i,n){if(typeof i=="function"&&(n=i,i=void 0),n=n||function(){},Ki&&e.indexOf("file:")!==0)return Kd(t,e,i,n);if(Gh()||typeof ActiveXObject=="function")return Hd(t,e,i,n);n(new Error("No fetch and no xhr implementation found!"))};function Kn(r){"@babel/helpers - typeof";return Kn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kn(r)}function ac(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),e.push.apply(e,i)}return e}function Ro(r){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};$d(this,r),this.services=t,this.options=e,this.allOptions=i,this.type="backend",this.init(t,e,i)}return Qd(r,[{key:"init",value:function(e){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=e,this.options=Ro(Ro(Ro({},eg()),this.options||{}),n),this.allOptions=s,this.services&&this.options.reloadInterval){var o=setInterval(function(){return i.reload()},this.options.reloadInterval);Kn(o)==="object"&&typeof o.unref=="function"&&o.unref()}}},{key:"readMulti",value:function(e,i,n){this._readAny(e,e,i,i,n)}},{key:"read",value:function(e,i,n){this._readAny([e],e,[i],i,n)}},{key:"_readAny",value:function(e,i,n,s,o){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(e,n)),l=zd(l),l.then(function(c){if(!c)return o(null,{});var h=a.services.interpolator.interpolate(c,{lng:e.join("+"),ns:n.join("+")});a.loadUrl(h,o,i,s)})}},{key:"loadUrl",value:function(e,i,n,s){var o=this,a=typeof n=="string"?[n]:n,l=typeof s=="string"?[s]:s,c=this.options.parseLoadPayload(a,l);this.options.request(this.options,e,c,function(h,u){if(u&&(u.status>=500&&u.status<600||!u.status))return i("failed loading "+e+"; status code: "+u.status,!0);if(u&&u.status>=400&&u.status<500)return i("failed loading "+e+"; status code: "+u.status,!1);if(!u&&h&&h.message){var f=h.message.toLowerCase(),d=["failed","fetch","network","load"].find(function(p){return f.indexOf(p)>-1});if(d)return i("failed loading "+e+": "+h.message,!0)}if(h)return i(h,!1);var g,m;try{typeof u.data=="string"?g=o.options.parse(u.data,n,s):g=u.data}catch{m="failed parsing "+e+" to json"}if(m)return i(m,!1);i(null,g)})}},{key:"create",value:function(e,i,n,s,o){var a=this;if(this.options.addPath){typeof e=="string"&&(e=[e]);var l=this.options.parsePayload(i,n,s),c=0,h=[],u=[];e.forEach(function(f){var d=a.options.addPath;typeof a.options.addPath=="function"&&(d=a.options.addPath(f,i));var g=a.services.interpolator.interpolate(d,{lng:f,ns:i});a.options.request(a.options,g,l,function(m,p){c+=1,h.push(m),u.push(p),c===e.length&&typeof o=="function"&&o(h,u)})})}}},{key:"reload",value:function(){var e=this,i=this.services,n=i.backendConnector,s=i.languageUtils,o=i.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],c=function(u){var f=s.toResolveHierarchy(u);f.forEach(function(d){l.indexOf(d)<0&&l.push(d)})};c(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return c(h)}),l.forEach(function(h){e.allOptions.ns.forEach(function(u){n.read(h,u,"read",null,null,function(f,d){f&&o.warn("loading namespace ".concat(u," for language ").concat(h," failed"),f),!f&&d&&o.log("loaded namespace ".concat(u," for language ").concat(h),d),n.loaded("".concat(h,"|").concat(u),f,d)})})})}}}])})();Uh.type="backend";class Me{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}let Ae=class extends Me{constructor(e,i){super(e);T(this,"detail");this.detail=i}};const ig=()=>{const r=window.navigator.userAgent.toLowerCase();try{let t;return r.indexOf("chrome")!=-1?(t=(navigator.languages[0]||navigator.browserLanguage||navigator.language||navigator.userLanguage).split(";"),t[0]):(t=(navigator.browserLanguage||navigator.language||navigator.userLanguage).split(";"),t[0])}catch{return""}},ng=["ALL","OFF"],Cr={ALL:-99,DEBUG:-1,INFO:0,WARN:1,ERROR:2,OFF:99};class rg{constructor(t=Cr.INFO){this.level=t,this.make()}make(){const t=Object.keys(Cr).filter(e=>!ng.includes(e));for(const e of t){const i=Cr[e],n=e.toLowerCase();this[n]=this.level<=i?console.log:()=>{}}}}function Wh(...r){console.warn(...r)}const ee={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function lc(r){const t=We();for(let e=0,i=r.length;en&&(l=l|ee.RIGHT),as&&(l=l|ee.ABOVE),l===ee.UNKNOWN&&(l=ee.INTERSECTING),l}function We(){return[1/0,1/0,-1/0,-1/0]}function Ri(r,t,e,i,n){return n?(n[0]=r,n[1]=t,n[2]=e,n[3]=i,n):[r,t,e,i]}function eo(r){return Ri(1/0,1/0,-1/0,-1/0,r)}function Zh(r,t){const e=r[0],i=r[1];return Ri(e,i,e,i,t)}function Da(r,t,e,i,n){const s=eo(n);return Vh(s,r,t,e,i)}function Tr(r,t){return r[0]==t[0]&&r[2]==t[2]&&r[1]==t[1]&&r[3]==t[3]}function sg(r,t){return t[0]r[2]&&(r[2]=t[2]),t[1]r[3]&&(r[3]=t[3]),r}function Sr(r,t){t[0]r[2]&&(r[2]=t[0]),t[1]r[3]&&(r[3]=t[1])}function Vh(r,t,e,i,n){for(;et[0]?i[0]=r[0]:i[0]=t[0],r[1]>t[1]?i[1]=r[1]:i[1]=t[1],r[2]=t[0]&&r[1]<=t[3]&&r[3]>=t[1]}function no(r){return r[2]=o&&m<=l),!i&&s&ee.RIGHT&&!(n&ee.RIGHT)&&(p=d-(f-l)*g,i=p>=a&&p<=c),!i&&s&ee.BELOW&&!(n&ee.BELOW)&&(m=f-(d-a)/g,i=m>=o&&m<=l),!i&&s&ee.LEFT&&!(n&ee.LEFT)&&(p=d-(f-o)*g,i=p>=a&&p<=c)}return i}function Hh(r,t){const e=t.getExtent(),i=pn(r);if(t.canWrapX()&&(i[0]=e[2])){const n=Dt(e),o=Math.floor((i[0]-e[0])/n)*n;r[0]-=o,r[2]-=o}return r}function qh(r,t,e){if(t.canWrapX()){const i=t.getExtent();if(!isFinite(r[0])||!isFinite(r[2]))return[[i[0],r[1],i[2],r[3]]];Hh(r,t);const n=Dt(i);if(Dt(r)>n&&!e)return[[i[0],r[1],i[2],r[3]]];if(r[0]i[2])return[[r[0],r[1],i[2],r[3]],[i[0],r[1],r[2]-n,r[3]]]}return[r]}function Xt(r,t,e){return Math.min(Math.max(r,t),e)}function hg(r,t,e,i,n,s){const o=n-e,a=s-i;if(o!==0||a!==0){const l=((r-e)*o+(t-i)*a)/(o*o+a*a);l>1?(e=n,i=s):l>0&&(e+=o*l,i+=a*l)}return Wn(r,t,e,i)}function Wn(r,t,e,i){const n=e-r,s=i-t;return n*n+s*s}function ug(r){const t=r.length;for(let i=0;is&&(s=l,n=a)}if(s===0)return null;const o=r[n];r[n]=r[i],r[i]=o;for(let a=i+1;a=0;i--){e[i]=r[i][t]/r[i][i];for(let n=i-1;n>=0;n--)r[n][t]-=r[n][i]*e[i]}return e}function cc(r){return r*180/Math.PI}function Ei(r){return r*Math.PI/180}function dn(r,t){const e=r%t;return e*t<0?e+t:e}function Pe(r,t,e){return r+e*(t-r)}function ro(r,t){const e=Math.pow(10,t);return Math.round(r*e)/e}function us(r,t){return Math.floor(ro(r,t))}function fs(r,t){return Math.ceil(ro(r,t))}function fa(r,t,e){if(r>=t&&r=0;--i)if(r[i]!=t[i]){e=!1;break}return e}function Fa(r,t){const e=Math.cos(t),i=Math.sin(t),n=r[0]*e-r[1]*i,s=r[1]*e+r[0]*i;return r[0]=n,r[1]=s,r}function dg(r,t){return r[0]*=t,r[1]*=t,r}function $h(r,t){if(t.canWrapX()){const e=Dt(t.getExtent()),i=gg(r,t,e);i&&(r[0]-=i*e)}return r}function gg(r,t,e){const i=t.getExtent();let n=0;return t.canWrapX()&&(r[0]i[2])&&(e=e||Dt(i),n=Math.floor((r[0]-i[0])/e)),n}const Na={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class qn{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Na[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const $r=6378137,Un=Math.PI*$r,mg=[-Un,-Un,Un,Un],pg=[-180,-85,180,85],ds=$r*Math.log(Math.tan(Math.PI/2));class Tn extends qn{constructor(t){super({code:t,units:"m",extent:mg,global:!0,worldExtent:pg,getPointResolution:function(e,i){return e/Math.cosh(i[1]/$r)}})}}const hc=[new Tn("EPSG:3857"),new Tn("EPSG:102100"),new Tn("EPSG:102113"),new Tn("EPSG:900913"),new Tn("http://www.opengis.net/def/crs/EPSG/0/3857"),new Tn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function _g(r,t,e,i){const n=r.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let s=0;sds?o=ds:o<-ds&&(o=-ds),t[s+1]=o}return t}function yg(r,t,e,i){const n=r.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=r.slice():t=new Array(n));for(let s=0;smc&&(t=mc);const i=Ei(t),n=Math.sin(i),s=Math.cos(i),o=n/s,a=o*o,l=a*a,c=Ei(r),h=eu(e.number),u=Ei(h),f=Gs/Math.sqrt(1-Ue*n**2),d=an*s**2,g=s*fa(c-u,-Math.PI,Math.PI),m=g*g,p=m*g,_=p*g,y=_*g,x=y*g,v=Gs*(tu*i-bg*Math.sin(2*i)+Ag*Math.sin(4*i)-Cg*Math.sin(6*i)),b=js*f*(g+p/6*(1-a+d)+y/120*(5-18*a+l+72*d-58*an))+5e5;let C=js*(v+f*o*(m/2+_/24*(5-a+9*d+4*d**2)+x/720*(61-58*a+l+600*d-330*an)));return e.north||(C+=1e7),[b,C]}function eu(r){return(r-1)*6-180+3}const Dg=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function iu(r){let t=0;for(const n of Dg){const s=r.match(n);if(s){t=parseInt(s[1]);break}}if(!t)return null;let e=0,i=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(i=!0,e=t-32600),e?{number:e,north:i}:null}function pc(r,t){return function(e,i,n,s){const o=e.length;n=n>1?n:2,s=s??n,i||(n>2?i=e.slice():i=new Array(o));for(let a=0;a=l?t[o+c]:a[c]}return e})}function Bs(r,t,e,i){const n=de(r),s=de(t);_n(n,s,ma(e)),_n(s,n,ma(i))}function Mr(r,t){const e=fe(r,t!==void 0?t:"EPSG:3857","EPSG:4326"),i=e[0];return(i<-180||i>180)&&(e[0]=dn(i+180,360)-180),e}function Ms(r,t){if(r===t)return!0;const e=r.getUnits()===t.getUnits();return(r.getCode()===t.getCode()||Ua(r,t)===Ba)&&e}function Ua(r,t){const e=r.getCode(),i=t.getCode();let n=Io(e,i);if(n)return n;let s=null,o=null;for(const l of jg)s||(s=l(r)),o||(o=l(t));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)n=Mo(s.inverse,o.forward);else{const l=Io(e,a);l&&(n=Mo(l,o.forward))}else{const l=Io(a,i);l&&(n=Mo(s.inverse,l))}return n&&(Qn(r),Qn(t),_n(r,t,n)),n}function Mo(r,t){return function(e,i,n,s){return i=r(e,i,n,s),t(i,i,n,s)}}function gn(r,t){const e=de(r),i=de(t);return Ua(e,i)}function fe(r,t,e){const i=gn(t,e);if(!i){const n=de(t).getCode(),s=de(e).getCode();throw new Error(`No transform available between ${n} and ${s}`)}return i(r,void 0,r.length)}function pa(r,t){return r}function vi(r,t){return ga&&!Ns(r,[0,0])&&r[0]>=-180&&r[0]<=180&&r[1]>=-90&&r[1]<=90&&(ga=!1,Wh("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),r}function nu(r,t){return r}function zi(r,t){return r}function Wg(){vc(hc),vc(fc),Ug(fc,hc,_g,yg)}Wg();const Vt=20037508342789244e-9,wc=[[0,0],[0,1],[1,0],[0,-1],[-1,0]],ru="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAAB3RJTUUH3QgIBToaSbAjlwAAABd0RVh0U29mdHdhcmUAR0xEUE5HIHZlciAzLjRxhaThAAAACHRwTkdHTEQzAAAAAEqAKR8AAAAEZ0FNQQAAsY8L/GEFAAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAAFRJREFUeNrtwQEBAAAAgJD+r+4ICgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgBDwABHHIJwwAAAABJRU5ErkJggg==",nn=256,Xg=``;async function xc(r){return typeof r=="string"?new Promise((t,e)=>{const i=r.match(/\//)?r:`pois/${r}`,n=new XMLHttpRequest;n.open("GET",i,!0),n.responseType="json",n.onload=function(s){if(this.status==200||this.status==0)try{let o=this.response;typeof o=="string"&&(o=JSON.parse(o)),t(o)}catch(o){e(o)}else e("Fail to load poi json")},n.send()}):r}async function su(r,t){if(r=await xc(r),Array.isArray(r))r=await Promise.all(r.map(async e=>await xc(e))),r.length>0&&r[0].type==="FeatureCollection"?r=r.reduce((e,i,n)=>{let s=i.id||i.properties&&i.properties.id;if(!s)if(n===0)s="main";else throw"POI layers include bad key setting";return e[s]=rn(i,s,t),e},{}):r={main:rn(r,"main",t)};else if(r.type==="FeatureCollection"){const e=r.id||r.properties&&r.properties.id||"main";r={[e]:rn(r,e,t)}}else Object.keys(r).map(e=>{r[e]=rn(r[e],e,t)});return r.main||(r.main=rn([],"main",t)),Object.keys(r).map(e=>{Wa(r,e,t)}),r}function rn(r,t,e){if(Array.isArray(r))r={pois:r.map(i=>Lr(i))};else if(r.type==="FeatureCollection"){const i=Object.assign({},r.properties||{});r.name&&(i.name=r.name),i.pois=r.features.map(n=>Lr(n)),r=i}if(typeof r.id>"u")r.id=t;else if(r.id!==t)throw"POI layers include bad key setting";return r.namespaceID||(r.namespaceID=`${e.namespace?`${e.namespace}#`:""}${t}`),r.name||(r.name=t==="main"?e.name:t),r.pois||(r.pois=[]),r}function Lr(r){if(r.type==="Feature"){const t=Object.assign({},r.properties||{});t.lnglat=r.geometry.coordinates,t.id||(t.id=r.id),t.name||(t.name=r.name),r=t}return r.lnglat||(r.lnglat=[r.lng||r.longitude,r.lat||r.latitude]),delete r.lng,delete r.lat,delete r.longitude,delete r.latitude,r}function Wa(r,t,e){if(!r[t])return;const i=r[t],n=i.pois;i.__nextId||(i.__nextId=0),n.map(s=>{s.id||(s.id=`${t}_${i.__nextId}`,i.__nextId++),s.namespaceID||(s.namespaceID=`${e.namespace?`${e.namespace}#`:""}${s.id}`)})}function Pr(r,t,e={}){const i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=t||{},i.geometry=r,i}function ou(r,t,e={}){if(!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bc(r[0])||!bc(r[1]))throw new Error("coordinates must contain numbers");return Pr({type:"Point",coordinates:r},t,e)}function Ls(r,t,e={}){for(const n of r){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let s=0;sc==h>-c?(s=c,c=t[++u]):(s=h,h=i[++f]);let d=0;if(uc==h>-c?(o=c+s,a=s-(o-c),c=t[++u]):(o=h+s,a=s-(o-h),h=i[++f]),s=o,a!==0&&(n[d++]=a);uc==h>-c?(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=t[++u]):(o=s+h,l=o-s,a=s-(o-l)+(h-l),h=i[++f]),s=o,a!==0&&(n[d++]=a);for(;u=$||-K>=$||(u=r-O,a=r-(O+u)+(u-n),u=e-G,c=e-(G+u)+(u-n),u=t-W,l=t-(W+u)+(u-s),u=i-H,h=i-(H+u)+(u-s),a===0&&l===0&&c===0&&h===0)||($=Jg*o+Kg*Math.abs(K),K+=O*h+H*a-(W*c+G*l),K>=$||-K>=$))return K;v=a*H,f=he*a,d=f-(f-a),g=a-d,f=he*H,m=f-(f-H),p=H-m,b=g*p-(v-d*m-g*m-d*p),C=l*G,f=he*l,d=f-(f-l),g=l-d,f=he*G,m=f-(f-G),p=G-m,R=g*p-(C-d*m-g*m-d*p),_=b-R,u=b-_,_e[0]=b-(_+u)+(u-R),y=v+_,u=y-v,x=v-(y-u)+(_-u),_=x-C,u=x-_,_e[1]=x-(_+u)+(u-C),I=y+_,u=I-y,_e[2]=y-(I-u)+(_-u),_e[3]=I;const st=Lo(4,Mn,4,_e,Ac);v=O*h,f=he*O,d=f-(f-O),g=O-d,f=he*h,m=f-(f-h),p=h-m,b=g*p-(v-d*m-g*m-d*p),C=W*c,f=he*W,d=f-(f-W),g=W-d,f=he*c,m=f-(f-c),p=c-m,R=g*p-(C-d*m-g*m-d*p),_=b-R,u=b-_,_e[0]=b-(_+u)+(u-R),y=v+_,u=y-v,x=v-(y-u)+(_-u),_=x-C,u=x-_,_e[1]=x-(_+u)+(u-C),I=y+_,u=I-y,_e[2]=y-(I-u)+(_-u),_e[3]=I;const D=Lo(st,Ac,4,_e,Cc);v=a*h,f=he*a,d=f-(f-a),g=a-d,f=he*h,m=f-(f-h),p=h-m,b=g*p-(v-d*m-g*m-d*p),C=l*c,f=he*l,d=f-(f-l),g=l-d,f=he*c,m=f-(f-c),p=c-m,R=g*p-(C-d*m-g*m-d*p),_=b-R,u=b-_,_e[0]=b-(_+u)+(u-R),y=v+_,u=y-v,x=v-(y-u)+(_-u),_=x-C,u=x-_,_e[1]=x-(_+u)+(u-C),I=y+_,u=I-y,_e[2]=y-(I-u)+(_-u),_e[3]=I;const tt=Lo(D,Cc,4,_e,Sc);return Sc[tt-1]}function tm(r,t,e,i,n,s){const o=(t-s)*(e-n),a=(r-n)*(i-s),l=o-a,c=Math.abs(o+a);return Math.abs(l)>=qg*c?l:-Qg(r,t,e,i,n,s,c)}function em(r,t){var e,i,n=0,s,o,a,l,c,h,u,f=r[0],d=r[1],g=t.length;for(e=0;e=0||o<=0&&l>=0)return 0}else if(c>=0&&a<=0||c<=0&&a>=0){if(s=tm(o,l,a,c,0,0),s===0)return 0;(s>0&&c>0&&a<=0||s<0&&c<=0&&a>0)&&n++}h=u,a=c,o=l}}return n%2!==0}function im(r){if(!r)throw new Error("coord is required");if(!Array.isArray(r)){if(r.type==="Feature"&&r.geometry!==null&&r.geometry.type==="Point")return[...r.geometry.coordinates];if(r.type==="Point")return[...r.coordinates]}if(Array.isArray(r)&&r.length>=2&&!Array.isArray(r[0])&&!Array.isArray(r[1]))return[...r];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function nm(r){return r.type==="Feature"?r.geometry:r}function rm(r,t,e={}){if(!r)throw new Error("point is required");if(!t)throw new Error("polygon is required");const i=im(r),n=nm(t),s=n.type,o=t.bbox;let a=n.coordinates;if(o&&sm(i,o)===!1)return!1;s==="Polygon"&&(a=[a]);let l=!1;for(var c=0;c=r[0]&&t[3]>=r[1]}var Ps=rm;class lu{constructor(t=[],e=om){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,n=e[t];for(;t>0;){const s=t-1>>1,o=e[s];if(i(n,o)>=0)break;e[t]=o,t=s}e[t]=n}_down(t){const{data:e,compare:i}=this,n=this.length>>1,s=e[t];for(;t=0)break;e[t]=a,t=o}e[t]=s}}function om(r,t){return rt?1:0}function cu(r,t){return r.p.x>t.p.x?1:r.p.xt.p.y?1:-1:1}function am(r,t){return r.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:r.rightSweepEvent.p.x0?(h.isLeftEndpoint=!0,c.isLeftEndpoint=!1):(c.isLeftEndpoint=!0,h.isLeftEndpoint=!1),t.push(c),t.push(h),o=a,ps=ps+1}}gs=gs+1}class cm{constructor(t){this.leftSweepEvent=t,this.rightSweepEvent=t.otherEvent}}function hm(r,t){if(r===null||t===null||r.leftSweepEvent.ringId===t.leftSweepEvent.ringId&&(r.rightSweepEvent.isSamePoint(t.leftSweepEvent)||r.rightSweepEvent.isSamePoint(t.leftSweepEvent)||r.rightSweepEvent.isSamePoint(t.rightSweepEvent)||r.leftSweepEvent.isSamePoint(t.leftSweepEvent)||r.leftSweepEvent.isSamePoint(t.rightSweepEvent)))return!1;const e=r.leftSweepEvent.p.x,i=r.leftSweepEvent.p.y,n=r.rightSweepEvent.p.x,s=r.rightSweepEvent.p.y,o=t.leftSweepEvent.p.x,a=t.leftSweepEvent.p.y,l=t.rightSweepEvent.p.x,c=t.rightSweepEvent.p.y,h=(c-a)*(n-e)-(l-o)*(s-i),u=(l-o)*(i-a)-(c-a)*(e-o),f=(n-e)*(i-a)-(s-i)*(e-o);if(h===0)return!1;const d=u/h,g=f/h;if(d>=0&&d<=1&&g>=0&&g<=1){const m=e+d*(n-e),p=i+d*(s-i);return[m,p]}return!1}function um(r,t){t=t||!1;const e=[],i=new lu([],am);for(;r.length;){const n=r.pop();if(n.isLeftEndpoint){const s=new cm(n);for(let o=0;o{const h=c.join(",");l[h]||(l[h]=!0,a.push(c))})}else a=o;return Ec(a.map(l=>ou(l)))}var mm=gm;function hu(r){class t extends r{constructor(){super(...arguments);T(this,"weiwudi");T(this,"_map");T(this,"homePosition");T(this,"mercZoom");T(this,"pois");T(this,"officialTitle","");T(this,"title","");T(this,"mapID","");T(this,"label","");T(this,"initialWait");T(this,"maxZoom");T(this,"minZoom");T(this,"envelope");T(this,"centroid");T(this,"homeMarginPixels",0);T(this,"thumbnail");T(this,"poiTemplate");T(this,"poiStyle");T(this,"iconTemplate");T(this,"startFrom");T(this,"controls");T(this,"northUp");T(this,"tapDuration");T(this,"mercatorXShift",0);T(this,"mercatorYShift",0);T(this,"icon");T(this,"selectedIcon")}initialize(n){var a;if(n=hi(n),this.mapID=n.mapID,this.homePosition=n.homePosition,this.mercZoom=n.mercZoom,this.label=n.label,this.maxZoom=n.maxZoom,this.minZoom=n.minZoom,this.poiTemplate=n.poiTemplate,this.poiStyle=n.poiStyle,this.iconTemplate=n.iconTemplate,this.icon=n.icon,this.selectedIcon=n.selectedIcon,this.mercatorXShift=n.mercatorXShift,this.mercatorYShift=n.mercatorYShift,this.weiwudi=n.weiwudi,n.envelopeLngLats){const c=n.envelopeLngLats.map(h=>fe(h,"EPSG:4326","EPSG:3857"));c.push(c[0]),this.envelope=Ls([c]),this.centroid=(a=Vg(this.envelope).geometry)==null?void 0:a.coordinates}for(let l=0;l{this.thumbnail=n.thumbnail,l(void 0)}):new Promise(l=>{this.thumbnail=`./tmbs/${n.mapID}.jpg`,fetch(this.thumbnail).then(c=>{c.ok||(this.thumbnail=`./tmbs/${n.mapID}_menu.jpg`),l(void 0)}).catch(c=>{this.thumbnail=`./tmbs/${n.mapID}_menu.jpg`,l(void 0)})}).catch(l=>{this.thumbnail=`./tmbs/${n.mapID||n.sourceID}_menu.jpg`}),o=this.resolvePois(n.pois);this.initialWait=Promise.all([o,s]),ym(this)}static isBasemap(){return this.isBasemap_}static isWmts(){return this.isWmts_}static isMapbox(){return!!this.isMapbox_}static isMapLibre(){return!!this.isMapLibre_}isBasemap(){return this.constructor.isBasemap()}isWmts(){return this.constructor.isWmts()}isMapbox(){return this.constructor.isMapbox()}isMapLibre(){return this.constructor.isMapLibre&&this.constructor.isMapLibre()}getCacheEnable(){return!!this.weiwudi}async getTileCacheStatsAsync(){if(!this.weiwudi)return{};try{return await this.weiwudi.stats()}catch{return{}}}async getTileCacheSizeAsync(){return(await this.getTileCacheStatsAsync()).size||0}async fetchAllTileCacheAsync(n){if(this.weiwudi)try{const s=a=>{n(a.type,a.detail)},o=a=>{this.weiwudi.removeEventListener("proceed",s),this.weiwudi.removeEventListener("finish",o),this.weiwudi.removeEventListener("stop",o),this.weiwudi.removeEventListener("canceled",o),s(a)};this.weiwudi.addEventListener("proceed",s),this.weiwudi.addEventListener("finish",o),this.weiwudi.addEventListener("stop",o),this.weiwudi.addEventListener("canceled",o),await this.weiwudi.fetchAll()}catch{}}async cancelTileCacheAsync(){if(this.weiwudi)try{await this.weiwudi.cancel()}catch{}}async clearTileCacheAsync(){if(this.weiwudi)try{await this.weiwudi.clean()}catch{}}getMap(){return this._map}setMap(n){this._map=n}setViewpointRadian(n){let s,o;const a=n.mercZoom,l=n.zoom,c=n.direction,h=n.rotation,u=this.getMap(),f=u==null?void 0:u.getView();n.latitude!==void 0&&n.longitude!==void 0&&(s=fe([n.longitude,n.latitude],"EPSG:4326","EPSG:3857")),n.x!==void 0&&n.y!=null&&(o=[n.x,n.y]),this.viewpoint2MercsAsync().then(d=>this.mercs2MercViewpoint(d)).then(d=>{const g=this.mercViewpoint2Mercs([s||d[0],a||d[1]||17,c??h??d[2]]);this.mercs2ViewpointAsync(g).then(m=>{s!=null?f==null||f.setCenter(m[0]):o!=null&&(f==null||f.setCenter(o)),a!=null?f==null||f.setZoom(m[1]):l!=null&&(f==null||f.setZoom(l)),c!=null?f==null||f.setRotation(m[2]):h!=null&&(f==null||f.setRotation(h))})})}setViewpoint(n){const s={...n};s.rotation&&(s.rotation=s.rotation*Math.PI/180),s.direction&&(s.direction=s.direction*Math.PI/180),this.setViewpointRadian(s)}goHome(){const s=this.getMap();let o=s.getTarget();typeof o=="string"&&(o=document.getElementById(o));const a=s.homeMarginPixels,l=[(o.clientWidth-a-10)*1,(o.clientHeight-a-10)*1],c={longitude:this.homePosition[0],latitude:this.homePosition[1],zoom:this.defZoom(l)};this.getMap().northUp?c.direction=0:c.rotation=0,this.setViewpointRadian(c)}resetRotation(){this.setViewpointRadian({rotation:0})}resetDirection(){this.setViewpointRadian({direction:0})}resetCirculation(){this.getMap().northUp?this.resetDirection():this.resetRotation()}setGPSMarkerAsync(n,s=!1){const o=this.getMap(),a=o==null?void 0:o.getView();if(!n)return new Promise((c,h)=>{o==null||o.setGPSPosition(null),c(!0)});const l=this.mercsFromGPSValue(n.lnglat,n.acc);return this.mercs2SysCoordsAsync_multiLayer([l]).then(c=>{const h=!c[0],u=h?c[1]:c[0],f=h?null:c[1],d={xy:u[0][0]};if(!this.insideCheckSysCoord(u[0][0]))return!1;const g=u[0].slice(1);return d.rad=g.reduce((m,p,_)=>{const y=m+Math.sqrt(Math.pow(p[0]-d.xy[0],2)+Math.pow(p[1]-d.xy[1],2));return _===3?y/4:y},0),s||a==null||a.setCenter(d.xy),o==null||o.setGPSPosition(d,h?"hide":null),f&&(o==null||o.setGPSPosition({xy:f[0][0]},"sub")),!0}).catch(c=>{throw c})}setGPSMarker(n,s=!1){this.setGPSMarkerAsync(n,s).then(()=>{})}mercsFromGPSValue(n,s){const o=fe(n,"EPSG:4326","EPSG:3857"),a=n[1]*Math.PI/180,l=s/Math.cos(a);return wc.map(c=>[c[0]*l+o[0],c[1]*l+o[1]])}rotateMatrix(n,s){s===void 0&&(s=this.getMap().getView().getRotation());const o=[];for(let a=0;a{this.pois[o].pois.map((a,l)=>{a.id===n&&(s=this.pois[o].pois[l])})}),s}addPoi(n,s){if(s||(s="main"),this.pois[s])return n=Lr(n),this.pois[s].pois.push(n),Wa(this.pois,s,{name:this.officialTitle||this.title,namespace:this.mapID}),n.namespaceID}removePoi(n){Object.keys(this.pois).map(s=>{this.pois[s].pois.map((o,a)=>{o.id===n&&delete this.pois[s].pois[a]})})}clearPoi(n){n||(n="main"),n==="all"?Object.keys(this.pois).map(s=>{this.pois[s].pois=[]}):this.pois[n]&&(this.pois[n].pois=[])}listPoiLayers(n=!1,s=!1){return Object.keys(this.pois).sort((o,a)=>o==="main"?-1:a==="main"?1:oa?1:0).map(o=>this.pois[o]).filter(o=>s?n?o.pois.length&&o.hide:o.pois.length:n?o.hide:!0)}getPoiLayer(n){return this.pois[n]}addPoiLayer(n,s){n!=="main"&&(this.pois[n]||(this.pois[n]=rn(s||[],n,{name:this.officialTitle||this.title,namespace:this.mapID})))}removePoiLayer(n){n!=="main"&&this.pois[n]&&delete this.pois[n]}merc2SysCoordAsync_ignoreBackground(n){return this.merc2XyAsync_ignoreBackground(n).then(s=>s?this.xy2SysCoord(s):void 0)}merc2SysCoordAsync(n){return this.merc2XyAsync(n).then(s=>s&&this.xy2SysCoord(s))}sysCoord2MercAsync(n){const s=this.sysCoord2Xy(n);return this.xy2MercAsync(s)}zoom2Radius(n,s){const o=Math.floor(Math.min(n[0],n[1])/4);return s===void 0&&(s=this.getMap().getView().getDecimalZoom()),o*Vt/128/Math.pow(2,s)}viewpoint2SysCoords(n,s){return this.mercViewpoint2Mercs(n,s)}mercViewpoint2Mercs(n,s){let o=n?n[0]:void 0;const a=n?n[1]:void 0,l=n?n[2]:void 0;o===void 0&&(o=this.getMap().getView().getCenter()),s===void 0&&(s=this.getMap().getSize());const c=this.zoom2Radius(s,a);return[this.rotateMatrix(wc,l).map(f=>[f[0]*c+o[0],f[1]*c+o[1]]),s]}sysCoords2Viewpoint(n){return this.mercs2MercViewpoint(n)}mercs2MercViewpoint(n){const s=n[0][0];let o=n[1];const l=n[0].slice(1,5).map(_=>[_[0]-s[0],_[1]-s[1]]),c=[[0,1],[1,0],[0,-1],[-1,0]];let h=0,u=0,f=0;for(let _=0;_<4;_++){const y=l[_],x=c[_],v=Math.sqrt(Math.pow(y[0],2)+Math.pow(y[1],2));h+=v;const b=y[0]*x[1]-y[1]*x[0],C=Math.acos((y[0]*x[0]+y[1]*x[1])/v),R=b>0?-1*C:C;u+=Math.cos(R),f+=Math.sin(R)}const d=h/4,g=Math.atan2(f,u);o||(o=this.getMap().getSize());const m=Math.floor(Math.min(o[0],o[1])/4),p=Math.log(m*Vt/128/d)/Math.log(2);return[s,p,g]}sysCoords2Xys(n){return[n[0].map(s=>this.sysCoord2Xy(s)),n[1]]}xys2SysCoords(n){return[n[0].map(s=>this.xy2SysCoord(s)),n[1]]}mercs2XysAsync(n){return Promise.all(n[0].map(s=>this.merc2XyAsync(s))).then(s=>[s,n[1]])}xys2MercsAsync(n){return Promise.all(n[0].map(s=>this.xy2MercAsync(s))).then(s=>[s,n[1]])}static async createAsync(n){return new this(n)}}return T(t,"isBasemap_",!1),T(t,"isWmts_",!0),T(t,"isMapbox_",!1),T(t,"isMapLibre_",!1),t}function uu(r){class t extends hu(r){insideCheckXy(i){return this.envelope?Ps(i,this.envelope):!0}insideCheckSysCoord(i){return this.insideCheckXy(i)}modulateXyInside(i){if(!this.centroid)return i;const n=Yg([i,this.centroid]),s=mm(this.envelope,n);return s.features.length>0&&s.features[0].geometry?s.features[0].geometry.coordinates:i}modulateSysCoordInside(i){return this.modulateXyInside(i)}merc2XyAsync(i){return Promise.resolve(i)}merc2XyAsync_ignoreBackground(i){return this.merc2XyAsync(i)}xy2MercAsync(i){return Promise.resolve(i)}xy2SysCoord(i){return i}sysCoord2Xy(i){return i}viewpoint2MercsAsync(i,n){const s=this.viewpoint2SysCoords(i,n),o=this.sysCoords2Xys(s);return this.xys2MercsAsync(o)}mercs2ViewpointAsync(i){return this.mercs2XysAsync(i).then(n=>{const s=this.xys2SysCoords(n);return this.sysCoords2Viewpoint(s)})}mercs2SysCoordsAsync_multiLayer(i){return Promise.all(i[0].map(n=>this.merc2SysCoordAsync(n))).then(n=>[[n,i[1]]])}defZoom(){return this.mercZoom}}return T(t,"isBasemap_",!0),T(t,"isWmts_",!0),t}function pm(r){class t extends hu(r){constructor(){super(...arguments);T(this,"width",0);T(this,"height",0);T(this,"_maxxy",0)}insideCheckXy(n){return!(n[0]<0||n[0]>this.width||n[1]<0||n[1]>this.height)}insideCheckSysCoord(n){return this.insideCheckXy(this.sysCoord2Xy(n))}modulateXyInside(n){const s=n[0]/(this.width/2)-1,o=n[1]/(this.height/2)-1,a=Math.max(Math.abs(s),Math.abs(o));return[(s/a+1)*this.width/2,(o/a+1)*this.height/2]}modulateSysCoordInside(n){const s=this.sysCoord2Xy(n),o=this.modulateXyInside(s);return this.xy2SysCoord(o)}xy2SysCoord(n){const s=n[0]*(2*Vt)/this._maxxy-Vt,o=-1*(n[1]*(2*Vt)/this._maxxy-Vt);return[s,o]}sysCoord2Xy(n){const s=(n[0]+Vt)*this._maxxy/(2*Vt),o=(-n[1]+Vt)*this._maxxy/(2*Vt);return[s,o]}defZoom(n){const s=n[0],o=n[1],a=Math.log2((s-10)/this.width),l=Math.log2((o-10)/this.height),c=this.maxZoom;let h;return l>a?h=l:h=a,c+h}}return T(t,"isBasemap_",!1),T(t,"isWmts_",!1),t}const Or=["title","officialTitle","author","createdAt","era","contributor","mapper","license","dataLicense","attr","dataAttr","reference","description"],_m=["title","official_title","author","created_at","era","contributor","mapper","license","data_license","attr","data_attr","reference","description"];function fu(r){return r=hi(r),r.imageExtension||(r.imageExtension="jpg"),r.mapID&&!r.url&&!r.urls&&(r.url=r.tms?`tiles/${r.mapID}/{z}/{x}/{-y}.${r.imageExtension}`:`tiles/${r.mapID}/{z}/{x}/{y}.${r.imageExtension}`),r}function ym(r){const t=r;r.setTileLoadFunction((function(){const e=t.getTileLoadFunction(),i=function(n,s,o,a,l,c,h){return new Promise((u,f)=>{const d=function(g,m=void 0){const p=document.createElement("img");p.crossOrigin="Anonymous",p.onload=p.onerror=function(){if(p.width&&p.height){const _=o.getContext("2d"),y=a===0?256-c:0,x=l===0?256-h:0;c=a+c>p.width?p.width-a:c,h=l+h>p.height?p.height-l:h,_.drawImage(p,a,l,c,h,y,x,c,h),u(void 0)}else m?d(m):u("tileLoadError")},p.src=g};d(s)})};return function(n,s){const o=n.tileCoord[0];let a=n.tileCoord[1],l=n.tileCoord[2],c=Math.round((t.mercatorXShift||0)*128*Math.pow(2,o)/Vt),h=Math.round((t.mercatorYShift||0)*-128*Math.pow(2,o)/Vt);for(;c<0||c>=256;)c<0?(c=c+256,a++):(c=c-256,a--);for(;h<0||h>=256;)h<0?(h=h+256,l++):(h=h-256,l--);const u=document.createElement("div");u.innerHTML=Xg;const f=u.childNodes[0],d=[[[o,a,l],0,0,256-c,256-h]];c!==0&&d.push([[o,a-1,l],256-c,0,c,256-h]),h!==0&&(d.push([[o,a,l-1],0,256-h,256-c,h]),c!==0&&d.push([[o,a-1,l-1],256-c,256-h,c,h])),Promise.all(d.map(g=>{const m=t.tileUrlFunction(g[0],t.tilePixelRatio_,t.projection_);return i(g[0],m,f,g[1],g[2],g[3],g[4])})).then(g=>{if(g.reduce((p,_)=>p&&_,!0))n.handleImageError_();else{const p=f.toDataURL(),_=n.getImage();_.crossOrigin=null,e(n,p)}}).catch(g=>{n.handleImageError_()})}})())}function hr(r){const t=document,e=t.createDocumentFragment(),i=[];r=r.replace(/(<\/?)d([ >])/g,"$1div$2").replace(/(<\/?)s([ >])/g,"$1span$2").replace(/ din="/g,' data-i18n="').replace(/ dinh="/g,' data-i18n-html="').replace(/ c="/g,' class="');const n=e.appendChild(t.createElement("div"));n.innerHTML=r;for(let s=0;s-180);){const t=r>0?-1:1;r=r+t*360}return r}function Mc(r){if(!r)return;const t={mapID:r.mapID};for(let e=0;e{if(e[i]!==void 0)throw new Error(`Invalid Maplat option key: ${i}. Use "${t[i]}" instead.`);return e},r)}class ao{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function vm(r,t,e){let i,n;e=e||Ai;let s=0,o=r.length,a=!1;for(;s>1),n=+e(r[i],t),n<0?s=i+1:(o=i,a=!n);return a?s:~s}function Ai(r,t){return r>t?1:rt?-1:0}function Xa(r,t,e){if(r[0]<=t)return 0;const i=r.length;if(t<=r[i-1])return i-1;if(typeof e=="function"){for(let n=1;n0?n-1:n}return i-1}if(e>0){for(let n=1;n0||o===0)})}function Dr(){return!0}function co(){return!1}function kr(){}function du(r){let t,e,i;return function(){const n=Array.prototype.slice.call(arguments);return(!e||this!==i||!qi(n,e))&&(i=this,e=n,t=r.apply(this,arguments)),t}}function bm(r){function t(){let e;try{e=r()}catch(i){return Promise.reject(i)}return e instanceof Promise?e:Promise.resolve(e)}return t()}class ts extends ao{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,n=this.listeners_&&this.listeners_[i];if(!n)return;const s=e?new Me(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=n.length;c0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);n!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=kr,++this.pendingRemovals_[t]):(i.splice(n,1),i.length===0&&delete this.listeners_[t]))}}const Ce={ADD:"add",REMOVE:"remove"},tr={PROPERTYCHANGE:"propertychange"},_t={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function Ct(r,t,e,i,n){if(n){const o=e;e=function(a){return r.removeEventListener(t,e),o.call(i??this,a)}}else i&&i!==r&&(e=e.bind(i));const s={target:r,type:t,listener:e};return r.addEventListener(t,e),s}function zs(r,t,e,i){return Ct(r,t,e,i,!0)}function Gt(r){r&&r.target&&(r.target.removeEventListener(r.type,r.listener),Jr(r))}class es extends ts{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(_t.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let s=0;s0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new _s(Ce.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new _s(Ce.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new _s(Ce.REMOVE,n,t)),this.dispatchEvent(new _s(Ce.ADD,e,t))}updateLength_(){this.set(Pc.LENGTH,this.array_.length)}assertUnique_(t,e){const i=this.array_;for(let n=0,s=i.length;n{if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return At()}closestPointXY(t,e,i,n){return At()}containsXY(t,e){return this.closestPointXY(t,e,Dm,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return At()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&eo(e),this.extentRevision_=this.getRevision()}return lg(this.extent_,t)}rotate(t,e){At()}scale(t,e,i){At()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return At()}getType(){return At()}applyTransform(t){At()}intersectsExtent(t){return At()}translate(t,e){At()}transform(t,e){const i=de(t),n=i.getUnits()=="tile-pixels"?function(s,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=xe(c)/xe(l);Ii(Oc,c[0],c[3],h,-h,0,0,0);const u=Yi(s,0,s.length,a,Oc,o),f=gn(i,e);return f?f(u,u,a):u}:gn(i,e);return this.applyTransform(n),this}}class is extends km{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return Da(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return At()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(f>0){for(let d=0;dn&&(n=c),s=a,o=l}return n}function Gm(r,t,e,i,n){for(let s=0,o=e.length;s0;){const u=c.pop(),f=c.pop();let d=0;const g=r[f],m=r[f+1],p=r[u],_=r[u+1];for(let y=f+i;yd&&(h=y,d=b)}d>n&&(l[(h-t)/i]=1,f+i0&&m>d)&&(g<0&&p0&&p>g)){c=u,h=f;continue}s[o++]=c,s[o++]=h,a=c,l=h,c=u,h=f}return s[o++]=c,s[o++]=h,o}function _u(r,t,e,i,n,s,o,a){for(let l=0,c=e.length;ls&&(c-a)*(s-l)-(n-a)*(h-l)>0&&o++:h<=s&&(c-a)*(s-l)-(n-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function yu(r,t,e,i,n,s){if(e.length===0||!cn(r,t,e[0],i,n,s))return!1;for(let o=1,a=e.length;o_&&(c=(h+u)/2,yu(r,t,e,i,c,g)&&(p=c,_=y)),h=u}return isNaN(p)&&(p=n[s]),o?(o.push(p,g,_),o):[p,g,_]}function Ym(r,t,e,i,n){let s=[];for(let o=0,a=e.length;o=n[0]&&s[2]<=n[2]||s[1]>=n[1]&&s[3]<=n[3]?!0:vu(r,t,e,i,function(o,a){return cg(n,o,a)}):!1}function wu(r,t,e,i,n){return!!($a(r,t,e,i,n)||cn(r,t,e,i,n[0],n[1])||cn(r,t,e,i,n[0],n[3])||cn(r,t,e,i,n[2],n[1])||cn(r,t,e,i,n[2],n[3]))}function Zm(r,t,e,i,n){if(!wu(r,t,e[0],i,n))return!1;if(e.length===1)return!0;for(let s=1,o=e.length;s0}function Km(r,t,e,i,n){n=n!==void 0?n:!1;for(let s=0,o=e.length;s1?o:2,s=s||new Array(o);for(let h=0;h>1;n0?t.childNodes[0]:null:Reflect.get(t,e,i)}})}function Ui(r){return typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas}const Qa=[NaN,NaN,NaN,0];let Oo;function ip(){return Oo||(Oo=Jt(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Oo}const np=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,rp=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,sp=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,op=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function ys(r,t){return r.endsWith("%")?Number(r.substring(0,r.length-1))/t:Number(r)}function Rr(r){throw new Error('failed to parse "'+r+'" as color')}function Su(r){if(r.toLowerCase().startsWith("rgb")){const s=r.match(rp)||r.match(np)||r.match(sp);if(s){const o=s[4],a=100/255;return[Xt(ys(s[1],a)+.5|0,0,255),Xt(ys(s[2],a)+.5|0,0,255),Xt(ys(s[3],a)+.5|0,0,255),o!==void 0?Xt(ys(o,100),0,1):1]}Rr(r)}if(r.startsWith("#")){if(op.test(r)){const s=r.substring(1),o=s.length<=4?1:2,a=[0,0,0,255];for(let l=0,c=s.length;l.0031308?Math.pow(r,1/2.4)*269.025-14.025:r*3294.6}function Fo(r){return r>.2068965?Math.pow(r,3):(r-4/29)*(108/841)}function No(r){return r>10.314724?Math.pow((r+14.025)/269.025,2.4):r/3294.6}function jo(r){return r>.0088564?Math.pow(r,1/3):r/(108/841)+4/29}function Bc(r){const t=No(r[0]),e=No(r[1]),i=No(r[2]),n=jo(t*.222488403+e*.716873169+i*.06060791),s=500*(jo(t*.452247074+e*.399439023+i*.148375274)-n),o=200*(n-jo(t*.016863605+e*.117638439+i*.865350722)),a=Math.atan2(o,s)*(180/Math.PI);return[116*n-16,Math.sqrt(s*s+o*o),a<0?a+360:a,r[3]]}function hp(r){const t=(r[0]+16)/116,e=r[1],i=r[2]*Math.PI/180,n=Fo(t),s=Fo(t+e/500*Math.cos(i)),o=Fo(t-e/200*Math.sin(i)),a=ko(s*3.021973625-n*1.617392459-o*.404875592),l=ko(s*-.943766287+n*1.916279586+o*.027607165),c=ko(s*.069407491-n*.22898585+o*1.159737864);return[Xt(a+.5|0,0,255),Xt(l+.5|0,0,255),Xt(c+.5|0,0,255),r[3]]}function tl(r){if(r==="none")return Qa;if(ur.hasOwnProperty(r))return ur[r];if(Do>=lp){let e=0;for(const i in ur)(e++&3)===0&&(delete ur[i],--Do)}const t=Su(r);t.length!==4&&Rr(r);for(const e of t)isNaN(e)&&Rr(r);return ur[r]=t,++Do,t}function er(r){return Array.isArray(r)?r:tl(r)}function el(r){let t=r[0];t!=(t|0)&&(t=t+.5|0);let e=r[1];e!=(e|0)&&(e=e+.5|0);let i=r[2];i!=(i|0)&&(i=i+.5|0);const n=r[3]===void 0?1:Math.round(r[3]*1e3)/1e3;return"rgba("+t+","+e+","+i+","+n+")"}function up(r,t,e){const i=r;let n=!0,s=!1,o=!1;const a=[zs(i,_t.LOAD,function(){o=!0,s||t()})];return i.src&&bu?(s=!0,i.decode().then(function(){n&&t()}).catch(function(l){n&&(o?t():e())})):a.push(zs(i,_t.ERROR,e)),function(){n=!1,a.forEach(Gt)}}function fp(r,t){return new Promise((e,i)=>{function n(){o(),e(r)}function s(){o(),i(new Error("Image load error"))}function o(){r.removeEventListener("load",n),r.removeEventListener("error",s)}r.addEventListener("load",n),r.addEventListener("error",s)})}function dp(r,t){return t&&(r.src=t),r.src&&bu?new Promise((e,i)=>r.decode().then(()=>e(r)).catch(n=>r.complete&&r.width?e(r):i(n))):fp(r)}class gp{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];(t++&3)===0&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const n=Go(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){const n=Go(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,n,s){const o=Go(t,e,i),a=o in this.cache_;this.cache_[o]=n,s&&(n.getImageState()===pt.IDLE&&n.load(),n.getImageState()===pt.LOADING?n.ready().then(()=>{this.patternCache_[o]=Xs().createPattern(n.getImage(1),"repeat")}):this.patternCache_[o]=Xs().createPattern(n.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Go(r,t,e){const i=e?er(e):"null";return t+":"+r+":"+i}const ze=new gp;let fr=null;class Ru extends ts{constructor(t,e,i,n,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=s,this.imageState_=n===void 0?pt.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===pt.LOADED){fr||(fr=Jt(1,1,void 0,{willReadFrequently:!0})),fr.drawImage(this.image_,0,0);try{fr.getImageData(0,0,1,1),this.tainted_=!1}catch{fr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(_t.CHANGE)}handleImageError_(){this.imageState_=pt.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=pt.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=Jt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===pt.IDLE){this.image_||this.initializeImage_(),this.imageState_=pt.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&dp(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==pt.LOADED)return;const e=this.image_,i=Jt(Math.ceil(e.width*t),Math.ceil(e.height*t)),n=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=ap(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===pt.LOADED||this.imageState_===pt.ERROR)t();else{const e=()=>{(this.imageState_===pt.LOADED||this.imageState_===pt.ERROR)&&(this.removeEventListener(_t.CHANGE,e),t())};this.addEventListener(_t.CHANGE,e)}})),this.ready_}}function Ys(r,t,e,i,n,s){let o=t===void 0?void 0:ze.get(t,e,n);return o||(o=new Ru(r,r&&"src"in r?r.src||void 0:t,e,i,n),ze.set(t,e,n,o,s)),s&&o&&!ze.getPattern(t,e,n)&&ze.set(t,e,n,o,s),o}function ci(r){return r?Array.isArray(r)?el(r):typeof r=="object"&&"src"in r?mp(r):r:null}function mp(r){if(!r.offset||!r.size)return ze.getPattern(r.src,"anonymous",r.color);const t=r.src+":"+r.offset,e=ze.getPattern(t,void 0,r.color);if(e)return e;const i=ze.get(r.src,"anonymous",null);if(i.getImageState()!==pt.LOADED)return null;const n=Jt(r.size[0],r.size[1]);return n.drawImage(i.getImage(1),r.offset[0],r.offset[1],r.size[0],r.size[1],0,0,r.size[0],r.size[1]),Ys(n.canvas,t,void 0,pt.LOADED,r.color,!0),ze.getPattern(t,void 0,r.color)}class Iu{drawCustom(t,e,i,n,s){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const vs="ol-hidden",fo="ol-unselectable",il="ol-control",zc="ol-collapsed",pp=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(""),"i"),Uc=["style","variant","weight","size","lineHeight","family"],va={normal:400,bold:700},wa=function(r){const t=r.match(pp);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,n=Uc.length;ii.trim().replace(/^['"]|['"]$/g,"")),e},Tu="10px sans-serif",Se="#000",ir="round",Ci=[],Si=0,nr="round",jr=10,Gr="#000",Br="center",Zs="middle",hn=[0,0,0,0],zr=1,jn=new ni;let dr=null,Wc;const xa={},_p=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function yp(r,t,e){return`${r} ${t} 16px "${e}"`}const vp=(function(){let t,e;async function i(s){await e.ready;const o=await e.load(s);if(o.length===0)return!1;const a=wa(s),l=a.families[0].toLowerCase(),c=a.weight;return o.some(h=>{const u=h.family.replace(/^['"]|['"]$/g,"").toLowerCase(),f=va[h.weight]||h.weight;return u===l&&h.style===a.style&&f==c})}async function n(){await e.ready;let s=!0;const o=jn.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const c=a[l];let h=o[c];h<100&&(await i(c)?(Jr(xa),jn.set(c,100)):(h+=10,jn.set(c,h,!0),h<100&&(s=!1)))}t=void 0,s||(t=setTimeout(n,100))}return async function(s){e||(e=Be?self.fonts:document.fonts);const o=wa(s);if(!o)return;const a=o.families;let l=!1;for(const c of a){if(_p.has(c))continue;const h=yp(o.style,o.weight,c);jn.get(h)===void 0&&(jn.set(h,0,!0),l=!0)}l&&(clearTimeout(t),t=setTimeout(n,100))}})(),wp=(function(){let r;return function(t){let e=xa[t];if(e==null){if(Be){const i=wa(t),n=Mu(t,"Žg");e=(isNaN(Number(i.lineHeight))?1.2:Number(i.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else r||(r=document.createElement("div"),r.innerHTML="M",r.style.minHeight="0",r.style.maxHeight="none",r.style.height="auto",r.style.padding="0",r.style.border="none",r.style.position="absolute",r.style.display="block",r.style.left="-99999px"),r.style.font=t,document.body.appendChild(r),e=r.offsetHeight,document.body.removeChild(r);xa[t]=e}return e}})();function Mu(r,t){return dr||(dr=Jt(1,1)),r!=Wc&&(dr.font=r,Wc=dr.font),dr.measureText(t)}function Lu(r,t){return Mu(r,t).width}function Xc(r,t,e){if(t in e)return e[t];const i=t.split(` -`).reduce((n,s)=>Math.max(n,Lu(r,s)),0);return e[t]=i,i}function xp(r,t){const e=[],i=[],n=[];let s=0,o=0,a=0,l=0;for(let c=0,h=t.length;c<=h;c+=2){const u=t[c];if(u===` -`||c===h){s=Math.max(s,o),n.push(o),o=0,a+=l,l=0;continue}const f=t[c+1]||r.font,d=Lu(f,u);e.push(d),o+=d;const g=wp(f);i.push(g),l=Math.max(l,g)}return{width:s,height:a,widths:e,heights:i,lineWidths:n}}function Ep(r,t,e,i,n,s,o,a,l,c,h){r.save(),e!==1&&(r.globalAlpha===void 0?r.globalAlpha=u=>u.globalAlpha*=e:r.globalAlpha*=e),t&&r.transform.apply(r,t),i.contextInstructions?(r.translate(l,c),r.scale(h[0],h[1]),bp(i,r)):h[0]<0||h[1]<0?(r.translate(l,c),r.scale(h[0],h[1]),r.drawImage(i,n,s,o,a,0,0,o,a)):r.drawImage(i,n,s,o,a,l,c,o*h[0],a*h[1]),r.restore()}function bp(r,t){const e=r.contextInstructions;for(let i=0,n=e.length;iu*this.pixelRatio_),lineDashOffset:(o||Si)*this.pixelRatio_,lineJoin:a!==void 0?a:nr,lineWidth:(l!==void 0?l:zr)*this.pixelRatio_,miterLimit:c!==void 0?c:jr,strokeStyle:ci(i||Gr)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),s=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=s[0],this.imageOriginY_=s[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/i,o[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const d=e.getColor();this.textFillState_={fillStyle:ci(d||Se)}}const i=t.getStroke();if(!i)this.textStrokeState_=null;else{const d=i.getColor(),g=i.getLineCap(),m=i.getLineDash(),p=i.getLineDashOffset(),_=i.getLineJoin(),y=i.getWidth(),x=i.getMiterLimit();this.textStrokeState_={lineCap:g!==void 0?g:ir,lineDash:m||Ci,lineDashOffset:p||Si,lineJoin:_!==void 0?_:nr,lineWidth:y!==void 0?y:zr,miterLimit:x!==void 0?x:jr,strokeStyle:ci(d||Gr)}}const n=t.getFont(),s=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),c=t.getScaleArray(),h=t.getText(),u=t.getTextAlign(),f=t.getTextBaseline();this.textState_={font:n!==void 0?n:Tu,textAlign:u!==void 0?u:Br,textBaseline:f!==void 0?f:Zs},this.text_=h!==void 0?Array.isArray(h)?h.reduce((d,g,m)=>d+=m%2?" ":g,""):h:"",this.textOffsetX_=s!==void 0?this.pixelRatio_*s:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}}const Cp=.5,Pu={Point:Op,LineString:Mp,Polygon:kp,MultiPoint:Dp,MultiLineString:Lp,MultiPolygon:Pp,GeometryCollection:Tp,Circle:Rp};function Sp(r,t){return parseInt(St(r),10)-parseInt(St(t),10)}function Yc(r,t){const e=Ou(r,t);return e*e}function Ou(r,t){return Cp*r/t}function Rp(r,t,e,i,n){const s=e.getFill(),o=e.getStroke();if(s||o){const l=r.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(s,o),l.drawCircle(t,i,n)}const a=e.getText();if(a&&a.getText()){const l=r.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,i)}}function Zc(r,t,e,i,n,s,o,a){const l=[],c=e.getImage();if(c){let f=!0;const d=c.getImageState();d==pt.LOADED||d==pt.ERROR?f=!1:d==pt.IDLE&&c.load(),f&&l.push(c.ready())}const h=e.getFill();h&&h.loading()&&l.push(h.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>n(null)),Ip(r,t,e,i,s,o,a),u}function Ip(r,t,e,i,n,s,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(i,n);if(e.getRenderer())Du(r,l,e,t,o);else{const h=Pu[l.getType()];h(r,l,e,t,o,s)}}function Du(r,t,e,i,n){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a=200&&a.status<300){const c=t.getType();try{let h;c=="text"||c=="json"?h=a.responseText:c=="xml"?h=a.responseXML||a.responseText:c=="arraybuffer"&&(h=a.response),h?s(t.readFeatures(h,{extent:e,featureProjection:n}),t.readProjection(h)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function Vc(r,t){return function(e,i,n,s,o){Np(r,t,e,i,n,(a,l)=>{this.addFeatures(a),s!==void 0&&s(a)},()=>{this.changed(),o!==void 0&&o()})}}function jp(r,t){return[[-1/0,-1/0,1/0,1/0]]}function Gp(r,t,e,i){const n=[];let s=We();for(let o=0,a=e.length;o=i[0]||t[1]<=i[1]&&t[3]>=i[1]?!0:ka(t,this.intersectsCoordinate.bind(this))}return!1}setCenter(t){const e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let s=1;s{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=ho(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=Um(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=_u(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n);break}return n&&(this.simplifiedGeometry_=new $e(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}$e.prototype.getFlatCoordinates=$e.prototype.getOrientedFlatCoordinates;function ku(r,t,e=0,i=r.length-1,n=Bp){for(;i>e;){if(i-e>600){const l=i-e+1,c=t-e+1,h=Math.log(l),u=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),d=Math.max(e,Math.floor(t-c*u/l+f)),g=Math.min(i,Math.floor(t+(l-c)*u/l+f));ku(r,t,d,g,n)}const s=r[t];let o=e,a=i;for(gr(r,e,t),n(r[i],s)>0&&gr(r,e,i);o0;)a--}n(r[e],s)===0?gr(r,e,a):(a++,gr(r,a,i)),a<=t&&(e=a+1),t<=a&&(i=a-1)}}function gr(r,t,e){const i=r[t];r[t]=r[e],r[e]=i}function Bp(r,t){return rt?1:0}let Fu=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!xs(t,e))return i;const n=this.toBBox,s=[];for(;e;){for(let o=0;o=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(n,s,e)}_split(t,e){const i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);const o=this._chooseSplitIndex(i,s,n),a=Gn(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,Ln(i,this.toBBox),Ln(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=Gn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Ln(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,s=1/0,o=1/0;for(let a=e;a<=i-e;a++){const l=_r(t,0,a,this.toBBox),c=_r(t,a,i,this.toBBox),h=Yp(l,c),u=Bo(l)+Bo(c);h=e;c--){const h=t.children[c];yr(a,t.leaf?s(h):h),l+=ws(a)}return l}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)yr(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():Ln(t[e],this.toBBox)}};function zp(r,t,e){if(!e)return t.indexOf(r);for(let i=0;i=r.minX&&t.maxY>=r.minY}function Gn(r){return{children:r,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Hc(r,t,e,i,n){const s=[t,e];for(;s.length;){if(e=s.pop(),t=s.pop(),e-t<=i)continue;const o=t+Math.ceil((e-t)/i/2)*i;ku(r,o,t,e,n),s.push(t,o,o,e)}}class qc{constructor(t){this.rbush_=new Fu(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[St(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,s=e.length;nr):null}const Ne={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Pi extends Me{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Es extends Nu{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=kr,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(Mt(this.format_,"`format` must be set when `url` is set"),this.loader_=Vc(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:jp;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new qc:null,this.loadedExtentsRtree_=new qc,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let i,n;Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),!e&&i===void 0&&(i=new je(n)),n!==void 0&&this.addFeaturesInternal(n),i!==void 0&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=St(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Pi(Ne.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof $e||(this.featureChangeKeys_[t]=[Ct(e,_t.CHANGE,this.handleFeatureChange_,this),Ct(e,tr.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(e.getId()!==void 0){const n=String(e.getId());if(!(n in this.idIndex_))this.idIndex_[n]=e;else if(e instanceof $e){const s=this.idIndex_[n];s instanceof $e?Array.isArray(s)?s.push(e):this.idIndex_[n]=[s,e]:i=!1}else i=!1}return i&&(Mt(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let s=0,o=t.length;s{e||(e=!0,this.addFeature(i.element),e=!1)}),t.addEventListener(Ce.REMOVE,i=>{e||(e=!0,this.removeFeature(i.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Gt);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(i=>{this.removeFeatureInternal(i)});for(const i in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Pi(Ne.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,function(n){const s=n.getGeometry();if(s instanceof $e||s.intersectsCoordinate(t))return e(n)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(i){const n=i.getGeometry();if(n instanceof $e||n.intersectsExtent(t)){const s=e(i);if(s)return s}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),$n(this.nullGeometryFeatures_)||lo(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(i){e.push(i)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=qh(t,e);return[].concat(...n.map(s=>this.featuresRtree_.getInExtent(s)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let s=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Dr,this.featuresRtree_.forEachInExtent(l,function(c){if(e(c)){const h=c.getGeometry(),u=a;if(a=h instanceof $e?0:h.closestPointXY(i,n,o,a),a{--this.loadingExtentsCount_,this.dispatchEvent(new Pi(Ne.FEATURESLOADEND,void 0,h))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pi(Ne.FEATURESLOADERROR))}),n.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,i=e.forEachInExtent(t,function(n){if(Tr(n.extent,t))return n});i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;i{this.patternImage_=null}),e.getImageState()===pt.IDLE&&e.load(),e.getImageState()===pt.LOADING&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?St(t):typeof t=="object"&&"src"in t?t.src+":"+t.offset:er(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}class wn{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new wn({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}function Jc(r){return r[0]>0&&r[1]>0}function Zp(r,t,e){return e===void 0&&(e=[0,0]),e[0]=r[0]*t+.5|0,e[1]=r[1]*t+.5|0,e}function Te(r,t){return Array.isArray(r)?r:(t===void 0?t=[r,r]:(t[0]=r,t[1]=r),t)}class go{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Te(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new go({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return At()}getImage(t){return At()}getHitDetectionImage(){return At()}getPixelRatio(t){return 1}getImageState(){return At()}getImageSize(){return At()}getOrigin(){return At()}getSize(){return At()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Te(t)}listenImageChange(t){At()}load(){At()}unlistenImageChange(t){At()}ready(){return Promise.resolve()}}class mo extends go{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?pt.LOADING:pt.LOADED,this.imageState_===pt.LOADING&&this.ready().then(()=>this.imageState_=pt.LOADED),this.render()}clone(){const t=this.getScale(),e=new mo({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){var s,o;const e=(s=this.fill_)==null?void 0:s.getKey(),i=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(",");let n=(o=ze.get(i,null,null))==null?void 0:o.getImage(1);if(!n){const a=this.renderOptions_,l=Math.ceil(a.size*t),c=Jt(l,l);this.draw_(a,c,t),n=c.canvas,ze.set(i,null,null,new Ru(n,void 0,null,pt.LOADED,null))}return n}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let n=this.radius,s=this.radius2_===void 0?n:this.radius2_;if(nl&&(this.instructions.push([nt.CUSTOM,l,h,t,i,ln,s]),this.hitDetectionInstructions.push([nt.CUSTOM,l,h,t,n||i,ln,s]));break;case"Point":c=t.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),h=this.coordinates.length,this.instructions.push([nt.CUSTOM,l,h,t,i,void 0,s]),this.hitDetectionInstructions.push([nt.CUSTOM,l,h,t,n||i,void 0,s]);break}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[nt.BEGIN_GEOMETRY,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[nt.BEGIN_GEOMETRY,e,0,t,i],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const i=t.length;let n,s,o=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const i=this.state;this.fillStyleToState(t,i),this.strokeStyleToState(e,i)}createFill(t){const e=t.fillStyle,i=[nt.SET_FILL_STYLE,e];return typeof e!="string"&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[nt.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;(typeof i!="string"||t.currentFillStyle!=i)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,s=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,c=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||s!=t.currentLineDash&&!qi(t.currentLineDash,s)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=c)&&(e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=s,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=c)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[nt.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xh(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Pa(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class Hp extends ns{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,i){if(!this.image_||this.maxExtent&&!Hn(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(n,s);this.instructions.push([nt.DRAW_IMAGE,o,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([nt.DRAW_IMAGE,o,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),s=[];for(let l=0,c=n.length;l=r){const g=(r-a+d)/d,m=Pe(c,u,g),p=Pe(h,f,g);l.push(m,p),s.push(l),l=[m,p],a==r&&(o+=n),a=0}else if(a0&&s.push(l),s}function Jp(r,t,e,i,n){let s=e,o=e,a=0,l=0,c=e,h,u,f,d,g,m,p,_,y,x;for(u=e;ur&&(l>a&&(a=l,s=c,o=u),l=0,c=u-n)),f=d,p=y,_=x),g=v,m=b}return l+=d,l>a?[c,u]:[s,o]}const Vs={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class Qp extends ns{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Se]={fillStyle:Se},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,i){const n=this.textFillState_,s=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!n&&!s)return;const a=this.coordinates;let l=a.length;const c=t.getType();let h=null,u=t.getStride();if(o.placement==="line"&&(c=="LineString"||c=="MultiLineString"||c=="Polygon"||c=="MultiPolygon")){if(!we(this.maxExtent,t.getExtent()))return;let f;if(h=t.getFlatCoordinates(),c=="LineString")f=[h.length];else if(c=="MultiLineString")f=t.getEnds();else if(c=="Polygon")f=t.getEnds().slice(0,1);else if(c=="MultiPolygon"){const p=t.getEndss();f=[];for(let _=0,y=p.length;_{const R=a[(v+C)*2]===h[C*u]&&a[(v+C)*2+1]===h[C*u+1];return R||--v,R})}this.saveTextStates_();const g=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,m=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(t,e,i);let p=o.padding;if(p!=hn&&(o.scale[0]<0||o.scale[1]<0)){let v=o.padding[0],b=o.padding[1],C=o.padding[2],R=o.padding[3];o.scale[0]<0&&(b=-b,R=-R),o.scale[1]<0&&(v=-v,C=-C),p=[v,b,C,R]}const _=this.pixelRatio;this.instructions.push([nt.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==hn?hn:p.map(function(v){return v*_}),g,m,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]);const y=1/_,x=g?g.slice(0):null;x&&(x[1]=Se),this.hitDetectionInstructions.push([nt.DRAW_IMAGE,l,d,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[y,y],NaN,this.declutterMode_,this.declutterImageWithText_,p,x,m,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Se:this.fillKey_,this.textOffsetX_,this.textOffsetY_,f]),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const s=this.textKey_;s in this.textStates||(this.textStates[s]={font:e.font,textAlign:e.textAlign||Br,justify:e.justify,textBaseline:e.textBaseline||Zs,scale:e.scale});const o=this.fillKey_;i&&(o in this.fillStates||(this.fillStates[o]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,s=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,c=Vs[n.textBaseline],h=this.textOffsetY_*l,u=this.text_,f=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([nt.DRAW_CHARS,t,e,c,n.overflow,a,n.maxAngle,l,h,s,f*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([nt.DRAW_CHARS,t,e,c,n.overflow,a&&Se,n.maxAngle,l,h,s,f*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let i,n,s;if(!t)this.text_="";else{const o=t.getFill();o?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=ci(o.getColor()||Se)):(n=null,this.textFillState_=n);const a=t.getStroke();if(!a)s=null,this.textStrokeState_=s;else{s=this.textStrokeState_,s||(s={},this.textStrokeState_=s);const m=a.getLineDash(),p=a.getLineDashOffset(),_=a.getWidth(),y=a.getMiterLimit();s.lineCap=a.getLineCap()||ir,s.lineDash=m?m.slice():Ci,s.lineDashOffset=p===void 0?Si:p,s.lineJoin=a.getLineJoin()||nr,s.lineWidth=_===void 0?zr:_,s.miterLimit=y===void 0?jr:y,s.strokeStyle=ci(a.getColor()||Gr)}i=this.textState_;const l=t.getFont()||Tu;vp(l);const c=t.getScaleArray();i.overflow=t.getOverflow(),i.font=l,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||Zs,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||hn,i.scale=c===void 0?[1,1]:c;const h=t.getOffsetX(),u=t.getOffsetY(),f=t.getRotateWithView(),d=t.getKeepUpright(),g=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=h===void 0?0:h,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=f===void 0?!1:f,this.textKeepUpright_=d===void 0?!0:d,this.textRotation_=g===void 0?0:g,this.strokeKey_=s?(typeof s.strokeStyle=="string"?s.strokeStyle:St(s.strokeStyle))+s.lineCap+s.lineDashOffset+"|"+s.lineWidth+s.lineJoin+s.miterLimit+"["+s.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n&&n.fillStyle?typeof n.fillStyle=="string"?n.fillStyle:"|"+St(n.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const t_={Circle:eh,Default:ns,Image:Hp,LineString:qp,Polygon:eh,Text:Qp};class e_{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const s=i[n].finish();t[e][n]=s}}return t}getBuilder(t,e){const i=t!==void 0?t.toString():"0";let n=this.buildersByZIndex_[i];n===void 0&&(n={},this.buildersByZIndex_[i]=n);let s=n[e];if(s===void 0){const o=t_[e];s=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=s}return s}}function i_(r,t,e,i,n,s,o,a,l,c,h,u,f=!0){let d=r[t],g=r[t+1],m=0,p=0,_=0,y=0;function x(){m=d,p=g,t+=i,d=r[t],g=r[t+1],y+=_,_=Math.sqrt((d-m)*(d-m)+(g-p)*(g-p))}do x();while(ttt[2]}else H=b>G;const K=Math.PI,$=[],st=R+i===t;t=R,_=0,y=I,d=r[t],g=r[t+1];let D;if(st){x(),D=Math.atan2(g-p,d-m),H&&(D+=D>0?-K:K);const tt=(G+b)/2,Q=(W+C)/2;return $[0]=[tt,Q,(O-s)/2,D,n],$}n=n.replace(/\n/g," ");for(let tt=0,Q=n.length;tt0?-K:K),D!==void 0){let kt=ot-D;if(kt+=kt>K?-2*K:kt<-K?2*K:0,Math.abs(kt)>o)return null}D=ot;const ct=tt;let at=0;for(;tt(this.push_(t),this));this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Xs(),{get:(t,e)=>{if(typeof Xs()[e]=="function")return this.push_(e),this.pushMethodArgs_},set:(t,e,i)=>(this.push_(e,i),!0)})}push_(...t){const e=this.instructions_,i=this.zIndex+this.offset_;e[i]||(e[i]=[]),e[i].push(...t)}pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let i=0,n=e.length;i0&&r.push(` -`,""),r.push(t,""),r}function r_(r,t,e){return e%2===0&&(r+=t),r}class s_{constructor(t,e,i,n,s){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=ei(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=s?new Gu:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,i,n){const s=t+e+i+n;if(this.labels_[s])return this.labels_[s];const o=n?this.strokeStates[n]:null,a=i?this.fillStates[i]:null,l=this.textStates[e],c=this.pixelRatio,h=[l.scale[0]*c,l.scale[1]*c],u=l.justify?Vs[l.justify]:Wo(Array.isArray(t)?t[0]:t,l.textAlign||Br),f=n&&o.lineWidth?o.lineWidth:0,d=Array.isArray(t)?t:String(t).split(` -`).reduce(n_,[]),{width:g,height:m,widths:p,heights:_,lineWidths:y}=xp(l,d),x=g+f,v=[],b=(x+2)*h[0],C=(m+f)*h[1],R={width:b<0?Math.floor(b):Math.ceil(b),height:C<0?Math.floor(C):Math.ceil(C),contextInstructions:v};(h[0]!=1||h[1]!=1)&&v.push("scale",h),n&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",f),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)),i&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");const I=.5-u;let O=u*x+I*f;const G=[],W=[];let H=0,K=0,$=0,st=0,D;for(let tt=0,Q=d.length;ttt?t-c:s,v=o+h>e?e-h:o,b=g[3]+x*f[0]+g[1],C=g[0]+v*f[1]+g[2],R=_-g[3],I=y-g[0];(m||u!==0)&&(Oi[0]=R,Di[0]=R,Oi[1]=I,pi[1]=I,pi[0]=R+b,_i[0]=pi[0],_i[1]=I+C,Di[1]=_i[1]);let O;return u!==0?(O=Ii(ei(),i,n,1,1,u,-i,-n),ie(O,Oi),ie(O,pi),ie(O,_i),ie(O,Di),Ri(Math.min(Oi[0],pi[0],_i[0],Di[0]),Math.min(Oi[1],pi[1],_i[1],Di[1]),Math.max(Oi[0],pi[0],_i[0],Di[0]),Math.max(Oi[1],pi[1],_i[1],Di[1]),Pn)):Ri(Math.min(R,R+b),Math.min(I,I+C),Math.max(R,R+b),Math.max(I,I+C),Pn),d&&(_=Math.round(_),y=Math.round(y)),{drawImageX:_,drawImageY:y,drawImageW:x,drawImageH:v,originX:c,originY:h,declutterBox:{minX:Pn[0],minY:Pn[1],maxX:Pn[2],maxY:Pn[3],value:p},canvasTransform:O,scale:f}}replayImageOrLabel_(t,e,i,n,s,o,a){const l=!!(o||a),c=n.declutterBox,h=a?a[2]*n.scale[0]/2:0;return c.minX-h<=e[0]&&c.maxX+h>=0&&c.minY-h<=e[1]&&c.maxY+h>=0&&(l&&this.replayTextBackground_(t,Oi,pi,_i,Di,o,a),Ep(t,n.canvasTransform,s,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=ie(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,i,n){const s=this.textStates[e],o=this.createLabel(t,e,n,i),a=this.strokeStates[i],l=this.pixelRatio,c=Wo(Array.isArray(t)?t[0]:t,s.textAlign||Br),h=Vs[s.textBaseline||Zs],u=a&&a.lineWidth?a.lineWidth:0,f=o.width/l-2*s.scale[0],d=c*f+2*(.5-c)*u,g=h*o.height/l+2*(.5-h)*u;return{label:o,anchorX:d,anchorY:g}}execute_(t,e,i,n,s,o,a,l){const c=this.zIndexContext_;let h;this.pixelCoordinates_&&qi(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Yi(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Rm(this.renderedTransform_,i));let u=0;const f=n.length;let d=0,g,m,p,_,y,x,v,b,C,R,I,O,G,W=0,H=0;const K=this.coordinateCache_,$=this.viewRotation_,st=Math.round(Math.atan2(-i[1],i[0])*1e12)/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:$},tt=this.instructions!=n||this.overlaps?0:200;let Q,ot,ct,at;for(;utt&&(this.fill_(t),W=0),H>tt&&(t.stroke(),H=0),!W&&!H&&(t.beginPath(),y=NaN,x=NaN),++u;break;case nt.CIRCLE:d=B[1];const Lt=h[d],kt=h[d+1],zt=h[d+2],Nt=h[d+3],Kt=zt-Lt,Yt=Nt-kt,Ut=Math.sqrt(Kt*Kt+Yt*Yt);t.moveTo(Lt+Ut,kt),t.arc(Lt,kt,Ut,0,2*Math.PI,!0),++u;break;case nt.CLOSE_PATH:t.closePath(),++u;break;case nt.CUSTOM:d=B[1],g=B[2];const vt=B[3],Xe=B[4],Le=B[5];D.geometry=vt,D.feature=Q,u in K||(K[u]=[]);const Ee=K[u];Le?Le(h,d,g,2,Ee):(Ee[0]=h[d],Ee[1]=h[d+1],Ee.length=2),c&&(c.zIndex=B[6]),Xe(Ee,D),++u;break;case nt.DRAW_IMAGE:d=B[1],g=B[2],C=B[3],m=B[4],p=B[5];let te=B[6];const ge=B[7],me=B[8],Ye=B[9],Ze=B[10];let Oe=B[11];const Ve=B[12];let Ke=B[13];_=B[14]||"declutter";const Wt=B[15];if(!C&&B.length>=20){R=B[19],I=B[20],O=B[21],G=B[22];const dt=this.drawLabelWithPointPlacement_(R,I,O,G);C=dt.label,B[3]=C;const xt=B[23];m=(dt.anchorX-xt)*this.pixelRatio,B[4]=m;const wt=B[24];p=(dt.anchorY-wt)*this.pixelRatio,B[5]=p,te=C.height,B[6]=te,Ke=C.width,B[13]=Ke}let re;B.length>25&&(re=B[25]);let $i,E,A;B.length>17?($i=B[16],E=B[17],A=B[18]):($i=hn,E=null,A=null),Ze&&st?Oe+=$:!Ze&&!st&&(Oe-=$);let M=0;for(;d!Bu.includes(r));class a_{constructor(t,e,i,n,s,o,a){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=ei(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(s,a)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t,e){for(const i in t){let n=this.executorsByZIndex_[i];n===void 0&&(n={},this.executorsByZIndex_[i]=n);const s=t[i];for(const o in s){const a=s[o];n[o]=new s_(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let n=0,s=t.length;n0){if(!o||R==="none"||d!=="Image"&&d!=="Text"||o.includes(b)){const W=(f[O]-3)/4,H=n-W%a,K=n-(W/a|0),$=s(b,C,H*H+K*K);if($)return $}h.clearRect(0,0,a,a);break}}const m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Ai);let p,_,y,x,v;for(p=m.length-1;p>=0;--p){const b=m[p].toString();for(y=this.executorsByZIndex_[b],_=sn.length-1;_>=0;--_)if(d=sn[_],x=y[d],x!==void 0&&(v=x.executeHitDetection(h,l,i,g,u),v))return v}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],s=e[2],o=e[3],a=[i,n,i,o,s,o,s,n];return Yi(a,0,8,2,t,a),a}isEmpty(){return $n(this.executorsByZIndex_)}execute(t,e,i,n,s,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?wm:Ai),o=o||sn;const c=sn.length;for(let h=0,u=l.length;h_.execute(b,e,i,n,s,a)),v&&x.restore(),y){y.offset();const b=l[h]*c+sn.indexOf(p);this.deferredZIndexContexts_[b]||(this.deferredZIndexContexts_[b]=[]),this.deferredZIndexContexts_[b].push(y)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(Ai);for(let i=0,n=e.length;i{s.draw(this.renderedContext_),s.clear()}),t[e[i]].length=0}}const Xo={};function l_(r){if(Xo[r]!==void 0)return Xo[r];const t=r*2+1,e=r*r,i=new Array(e+1);for(let s=0;s<=r;++s)for(let o=0;o<=r;++o){const a=s*s+o*o;if(a>e)break;let l=i[a];l||(l=[],i[a]=l),l.push(((r+s)*t+(r+o))*4+3),s>0&&l.push(((r-s)*t+(r+o))*4+3),o>0&&(l.push(((r+s)*t+(r-o))*4+3),s>0&&l.push(((r-s)*t+(r-o))*4+3))}const n=[];for(let s=0,o=i.length;s0,"A defined and non-empty `src` or `image` must be provided"),Mt(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=pt.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?pt.LOADED:pt.IDLE:l=pt.LOADING:l=pt.LOADED),this.color_=t.color!==void 0?er(t.color):null,this.iconImage_=Ys(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let c,h;if(t.size)[c,h]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)c=u.width,h=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const f=()=>{if(this.unlistenImageChange(f),!this.initialOptions_)return;const d=this.iconImage_.getSize();this.setScale(rh(d[0],d[1],t.width,t.height))};this.listenImageChange(f);return}}c!==void 0&&this.setScale(rh(c,h,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new fi({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const n=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!n)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=n[0]),this.anchorYUnits_=="fraction"&&(t[1]*=n[1])}if(this.anchorOrigin_!="top-left"){if(!n)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+n[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+n[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=i[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(t){this.iconImage_=Ys(null,t,this.crossOrigin_,pt.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==pt.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==pt.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(_t.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(_t.CHANGE,t)}ready(){return this.iconImage_.ready()}}const ai=.5;function c_(r,t,e,i,n,s,o,a,l){const c=n,h=r[0]*ai,u=r[1]*ai,f=Jt(h,u);f.imageSmoothingEnabled=!1;const d=f.canvas,g=new Ap(f,ai,n,null,o,a,null),m=e.length,p=Math.floor((256*256*256-1)/m),_={};for(let x=1;x<=m;++x){const v=e[x-1],b=v.getStyleFunction()||i;if(!b)continue;let C=b(v,s);if(!C)continue;Array.isArray(C)||(C=[C]);const I=(x*p).toString(16).padStart(7,"#00000");for(let O=0,G=C.length;Othis.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return At()}getData(t){return null}prepareFrame(t){return At()}renderFrame(t,e){return At()}forEachFeatureAtCoordinate(t,e,i,n,s){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===pt.LOADED||e.getState()===pt.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=pt.LOADED&&e!=pt.ERROR&&t.addEventListener(_t.CHANGE,this.boundHandleImageChange_),e==pt.IDLE&&(t.load(),e=t.getState()),e==pt.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const sh=[];let Bn=null;function d_(){Bn=Jt(1,1,void 0,{willReadFrequently:!0})}class Uu extends f_{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=ei(),this.pixelTransform=ei(),this.inversePixelTransform=ei(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,i){Bn||d_(),Bn.clearRect(0,0,1,1);let n;try{Bn.drawImage(t,e,i,1,1,0,0,1,1),n=Bn.getImageData(0,0,1,1).data}catch{return Bn=null,null}return n}getBackground(t){let i=this.getLayer().getBackground();return typeof i=="function"&&(i=i(t.viewState.resolution)),i||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let s,o;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&qi(er(t.style.backgroundColor),er(i)))){const a=t.firstElementChild;Ui(a)&&(o=a.getContext("2d"))}if(o&&Lm(o.canvas.style.transform,e)?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){s=Be?Cu():document.createElement("div"),s.className=n;let a=s.style;a.position="absolute",a.width="100%",a.height="100%",o=Jt();const l=o.canvas;s.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=s,this.context=o}!this.containerReused&&i&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=bn(i),s=qr(i),o=io(i),a=Hr(i);ie(e.coordinateToPixelTransform,n),ie(e.coordinateToPixelTransform,s),ie(e.coordinateToPixelTransform,o),ie(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;ie(l,n),ie(l,s),ie(l,o),ie(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}prepareContainer(t,e){const i=t.extent,n=t.viewState.resolution,s=t.viewState.rotation,o=t.pixelRatio,a=Math.round(Dt(i)/n*o),l=Math.round(xe(i)/n*o);Ii(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,s,-a/2,-l/2),gu(this.inversePixelTransform,this.pixelTransform);const c=Mm(this.pixelTransform);if(this.useContainer(e,c,this.getBackground(t)),!this.containerReused){const h=this.context.canvas;h.width!=a||h.height!=l?(h.width=a,h.height=l):this.context.clearRect(0,0,a,l),c!==h.style.transform&&(h.style.transform=c)}}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const s=new zu(t,this.inversePixelTransform,i,e);n.dispatchEvent(s)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Ge.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Ge.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Gu),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Ge.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Ge.POSTRENDER,this.context,t))}getRenderTransform(t,e,i,n,s,o,a){const l=s/2,c=o/2,h=n/e,u=-h,f=-t[0]+a,d=-t[1];return Ii(this.tempTransform,l,c,h,u,-i,f,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class g_ extends Uu{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=We(),this.wrappedRenderedExtent_=We(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,s=e.viewState,o=s.center,a=s.resolution,l=s.projection,c=s.rotation,h=l.getExtent(),u=this.getLayer().getSource(),f=this.getLayer().getDeclutter(),d=e.pixelRatio,g=e.viewHints,m=!(g[ne.ANIMATING]||g[ne.INTERACTING]),p=this.context,_=Math.round(Dt(n)/a*d),y=Math.round(xe(n)/a*d),x=u.getWrapX()&&l.canWrapX(),v=x?Dt(h):null,b=x?Math.ceil((n[2]-h[2])/v)+1:1;let C=x?Math.floor((n[0]-h[0])/v):0;do{let R=this.getRenderTransform(o,a,0,d,_,y,C*v);e.declutter&&(R=R.slice(0)),t.execute(p,[p.canvas.width,p.canvas.height],R,c,m,i===void 0?sn:i?Bu:o_,i?f&&e.declutter[f]:void 0)}while(++C{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const i=this.frameState.size.slice(),n=this.renderedCenter_,s=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,c=this.getLayer(),h=[],u=i[0]*ai,f=i[1]*ai;h.push(this.getRenderTransform(n,s,o,ai,u,f,0).slice());const d=c.getSource(),g=a.getExtent();if(d.getWrapX()&&a.canWrapX()&&!pr(g,l)){let m=l[0];const p=Dt(g);let _=0,y;for(;mg[2];)++_,y=p*_,h.push(this.getRenderTransform(n,s,o,ai,u,f,y).slice()),m-=p}this.hitDetectionImageData_=c_(i,h,this.renderedFeatures_,c.getStyleFunction(),l,s,o,Yc(s,this.renderedPixelRatio_))}e(h_(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,i,n,s){var f,d;if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),c={},h=function(g,m,p){const _=St(g),y=c[_];if(y){if(y!==!0&&pg.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[ne.ANIMATING],s=t.viewHints[ne.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&n||!a&&s)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,c=t.viewState,h=c.projection,u=c.resolution,f=t.pixelRatio,d=e.getRevision(),g=e.getRenderBuffer();let m=e.getRenderOrder();m===void 0&&(m=Sp);const p=c.center.slice(),_=Pa(l,g*u),y=_.slice(),x=[_.slice()],v=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!pr(v,t.extent)){const $=Dt(v),st=Math.max(Dt(_)/2,$);_[0]=v[0]-st,_[2]=v[2]+st,$h(p,h);const D=Hh(x[0],h);D[0]v[0]&&D[2]>v[2]&&x.push([D[0]-$,D[1],D[2]-$,D[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==d&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!t.declutter&&pr(this.wrappedRenderedExtent_,_))return qi(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=p,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const b=new e_(Ou(u,f),_,u,f);let C;for(let $=0,st=x.length;${let D;const tt=$.getStyleFunction()||e.getStyleFunction();if(tt&&(D=tt($,u)),D){const Q=this.renderFeature($,R,D,b,C,this.getLayer().getDeclutter(),st);I=I&&!Q}}),G=nu(_),W=i.getFeaturesInExtent(G);m&&W.sort(m);for(let $=0,st=W.length;$",GreaterThanOrEqualTo:">=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},y_={[L.Get]:ht(mt(1,1/0),oh),[L.Var]:ht(mt(1,1),v_),[L.Has]:ht(mt(1,1/0),oh),[L.Id]:ht(w_,On),[L.Concat]:ht(mt(2,1/0),It(Re)),[L.GeometryType]:ht(x_,On),[L.LineMetric]:ht(On),[L.Resolution]:ht(Yo,On),[L.Zoom]:ht(Yo,On),[L.Time]:ht(Yo,On),[L.Any]:ht(mt(2,1/0),It(ve)),[L.All]:ht(mt(2,1/0),It(ve)),[L.Not]:ht(mt(1,1),It(ve)),[L.Equal]:ht(mt(2,2),It(As)),[L.NotEqual]:ht(mt(2,2),It(As)),[L.GreaterThan]:ht(mt(2,2),It(bt)),[L.GreaterThanOrEqualTo]:ht(mt(2,2),It(bt)),[L.LessThan]:ht(mt(2,2),It(bt)),[L.LessThanOrEqualTo]:ht(mt(2,2),It(bt)),[L.Multiply]:ht(mt(2,1/0),ah),[L.Coalesce]:ht(mt(2,1/0),ah),[L.Divide]:ht(mt(2,2),It(bt)),[L.Add]:ht(mt(2,1/0),It(bt)),[L.Subtract]:ht(mt(2,2),It(bt)),[L.Clamp]:ht(mt(3,3),It(bt)),[L.Mod]:ht(mt(2,2),It(bt)),[L.Pow]:ht(mt(2,2),It(bt)),[L.Abs]:ht(mt(1,1),It(bt)),[L.Floor]:ht(mt(1,1),It(bt)),[L.Ceil]:ht(mt(1,1),It(bt)),[L.Round]:ht(mt(1,1),It(bt)),[L.Sin]:ht(mt(1,1),It(bt)),[L.Cos]:ht(mt(1,1),It(bt)),[L.Atan]:ht(mt(1,2),It(bt)),[L.Sqrt]:ht(mt(1,1),It(bt)),[L.Match]:ht(mt(4,1/0),lh,b_),[L.Between]:ht(mt(3,3),It(bt)),[L.Interpolate]:ht(mt(6,1/0),lh,A_),[L.Case]:ht(mt(3,1/0),E_,C_),[L.In]:ht(mt(2,2),S_),[L.Number]:ht(mt(1,1/0),It(As)),[L.String]:ht(mt(1,1/0),It(As)),[L.Array]:ht(mt(1,1/0),It(bt)),[L.Color]:ht(mt(1,4),It(bt)),[L.Band]:ht(mt(1,3),It(bt)),[L.Palette]:ht(mt(2,2),R_),[L.ToString]:ht(mt(1,1),It(ve|bt|Re|Je))};function oh(r,t,e){const i=r.length-1,n=new Array(i);for(let s=0;st){const a=t===1/0?`${r} or more`:`${r} to ${t}`;throw new Error(`expected ${a} arguments for ${s}, got ${o}`)}}}function ah(r,t,e){const i=r.length-1,n=new Array(i);for(let s=0;si.featureId;case L.GeometryType:return i=>i.geometryType;case L.Concat:{const i=r.args.map(n=>ii(n));return n=>"".concat(...i.map(s=>s(n).toString()))}case L.Resolution:return i=>i.resolution;case L.Any:case L.All:case L.Between:case L.In:case L.Not:return P_(r);case L.Equal:case L.NotEqual:case L.LessThan:case L.LessThanOrEqualTo:case L.GreaterThan:case L.GreaterThanOrEqualTo:return L_(r);case L.Multiply:case L.Divide:case L.Add:case L.Subtract:case L.Clamp:case L.Mod:case L.Pow:case L.Abs:case L.Floor:case L.Ceil:case L.Round:case L.Sin:case L.Cos:case L.Atan:case L.Sqrt:return O_(r);case L.Case:return D_(r);case L.Match:return k_(r);case L.Interpolate:return F_(r);case L.ToString:return N_(r);default:throw new Error(`Unsupported operator ${e}`)}}function T_(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o{const s=r.args;let o=n.properties[i];for(let a=1,l=s.length;an.variables[i];case L.Has:return n=>{const s=r.args;if(!(i in n.properties))return!1;let o=n.properties[i];for(let a=1,l=s.length;ai(s)===n(s);case L.NotEqual:return s=>i(s)!==n(s);case L.LessThan:return s=>i(s)i(s)<=n(s);case L.GreaterThan:return s=>i(s)>n(s);case L.GreaterThanOrEqualTo:return s=>i(s)>=n(s);default:throw new Error(`Unsupported comparison operator ${e}`)}}function P_(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s{for(let o=0;o{for(let o=0;o{const o=n[0](s),a=n[1](s),l=n[2](s);return o>=a&&o<=l};case L.In:return s=>{const o=n[0](s);for(let a=1;a!n[0](s);default:throw new Error(`Unsupported logical operator ${e}`)}}function O_(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s{let o=1;for(let a=0;an[0](s)/n[1](s);case L.Add:return s=>{let o=0;for(let a=0;an[0](s)-n[1](s);case L.Clamp:return s=>{const o=n[0](s),a=n[1](s);if(ol?l:o};case L.Mod:return s=>n[0](s)%n[1](s);case L.Pow:return s=>Math.pow(n[0](s),n[1](s));case L.Abs:return s=>Math.abs(n[0](s));case L.Floor:return s=>Math.floor(n[0](s));case L.Ceil:return s=>Math.ceil(n[0](s));case L.Round:return s=>Math.round(n[0](s));case L.Sin:return s=>Math.sin(n[0](s));case L.Cos:return s=>Math.cos(n[0](s));case L.Atan:return i===2?s=>Math.atan2(n[0](s),n[1](s)):s=>Math.atan(n[0](s));case L.Sqrt:return s=>Math.sqrt(n[0](s));default:throw new Error(`Unsupported numeric operator ${e}`)}}function D_(r,t){const e=r.args.length,i=new Array(e);for(let n=0;n{for(let s=0;s{const s=i[0](n);for(let o=1;o{const s=i[0](n),o=i[1](n);let a,l;for(let c=2;c=o)return c===2?u:f?j_(s,o,a,l,h,u):Er(s,o,a,l,h,u);a=h,l=u}return l}}function N_(r,t){const e=r.operator,i=r.args.length,n=new Array(i);for(let s=0;s{const o=n[0](s);return r.args[0].type===Je?el(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function Er(r,t,e,i,n,s){const o=n-e;if(o===0)return i;const a=t-e,l=r===1?a/o:(Math.pow(r,a)-1)/(Math.pow(r,o)-1);return i+l*(s-i)}function j_(r,t,e,i,n,s){if(n-e===0)return i;const a=Bc(i),l=Bc(s);let c=l[2]-a[2];c>180?c-=360:c<-180&&(c+=360);const h=[Er(r,t,e,a[0],n,l[0]),Er(r,t,e,a[1],n,l[1]),a[2]+Er(r,t,e,0,n,c),Er(r,t,e,i[3],n,s[3])];return hp(h)}function G_(r){return!0}function B_(r){const t=Wu(),e=z_(r,t),i=Yu();return function(n,s){if(i.properties=n.getPropertiesInternal(),i.resolution=s,t.featureId){const o=n.getId();o!==void 0?i.featureId=o:i.featureId=null}return t.geometryType&&(i.geometryType=Xu(n.getGeometry())),e(i)}}function ch(r){const t=Wu(),e=r.length,i=new Array(e);for(let o=0;onull;i=ol(r,t+"fill-color",e)}if(!i)return null;const n=new Ti;return function(s){const o=i(s);return o===Qa?null:(n.setColor(o),n)}}function Wr(r,t,e){const i=Ie(r,t+"stroke-width",e),n=ol(r,t+"stroke-color",e);if(!i&&!n)return null;const s=xi(r,t+"stroke-line-cap",e),o=xi(r,t+"stroke-line-join",e),a=Zu(r,t+"stroke-line-dash",e),l=Ie(r,t+"stroke-line-dash-offset",e),c=Ie(r,t+"stroke-miter-limit",e),h=new wn;return function(u){if(n){const f=n(u);if(f===Qa)return null;h.setColor(f)}if(i&&h.setWidth(i(u)),s){const f=s(u);if(f!=="butt"&&f!=="round"&&f!=="square")throw new Error("Expected butt, round, or square line cap");h.setLineCap(f)}if(o){const f=o(u);if(f!=="bevel"&&f!=="round"&&f!=="miter")throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(f)}return a&&h.setLineDash(a(u)),l&&h.setLineDashOffset(l(u)),c&&h.setMiterLimit(c(u)),h}}function U_(r,t){const e="text-",i=xi(r,e+"value",t);if(!i)return null;const n=Ur(r,e,t),s=Ur(r,e+"background-",t),o=Wr(r,e,t),a=Wr(r,e+"background-",t),l=xi(r,e+"font",t),c=Ie(r,e+"max-angle",t),h=Ie(r,e+"offset-x",t),u=Ie(r,e+"offset-y",t),f=Yn(r,e+"overflow",t),d=xi(r,e+"placement",t),g=Ie(r,e+"repeat",t),m=_o(r,e+"scale",t),p=Yn(r,e+"rotate-with-view",t),_=Ie(r,e+"rotation",t),y=xi(r,e+"align",t),x=xi(r,e+"justify",t),v=xi(r,e+"baseline",t),b=Yn(r,e+"keep-upright",t),C=Zu(r,e+"padding",t),R=yo(r,e+"declutter-mode"),I=new rl({declutterMode:R});return function(O){if(I.setText(i(O)),n&&I.setFill(n(O)),s&&I.setBackgroundFill(s(O)),o&&I.setStroke(o(O)),a&&I.setBackgroundStroke(a(O)),l&&I.setFont(l(O)),c&&I.setMaxAngle(c(O)),h&&I.setOffsetX(h(O)),u&&I.setOffsetY(u(O)),f&&I.setOverflow(f(O)),d){const G=d(O);if(G!=="point"&&G!=="line")throw new Error("Expected point or line for text-placement");I.setPlacement(G)}if(g&&I.setRepeat(g(O)),m&&I.setScale(m(O)),p&&I.setRotateWithView(p(O)),_&&I.setRotation(_(O)),y){const G=y(O);if(G!=="left"&&G!=="center"&&G!=="right"&&G!=="end"&&G!=="start")throw new Error("Expected left, right, center, start, or end for text-align");I.setTextAlign(G)}if(x){const G=x(O);if(G!=="left"&&G!=="right"&&G!=="center")throw new Error("Expected left, right, or center for text-justify");I.setJustify(G)}if(v){const G=v(O);if(G!=="bottom"&&G!=="top"&&G!=="middle"&&G!=="alphabetic"&&G!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");I.setTextBaseline(G)}return C&&I.setPadding(C(O)),b&&I.setKeepUpright(b(O)),I}}function W_(r,t){return"icon-src"in r?X_(r,t):"shape-points"in r?Y_(r,t):"circle-radius"in r?Z_(r,t):null}function X_(r,t){const e="icon-",i=e+"src",n=Vu(r[i],i),s=Ks(r,e+"anchor",t),o=_o(r,e+"scale",t),a=Ie(r,e+"opacity",t),l=Ks(r,e+"displacement",t),c=Ie(r,e+"rotation",t),h=Yn(r,e+"rotate-with-view",t),u=uh(r,e+"anchor-origin"),f=fh(r,e+"anchor-x-units"),d=fh(r,e+"anchor-y-units"),g=$_(r,e+"color"),m=H_(r,e+"cross-origin"),p=q_(r,e+"offset"),_=uh(r,e+"offset-origin"),y=Hs(r,e+"width"),x=Hs(r,e+"height"),v=K_(r,e+"size"),b=yo(r,e+"declutter-mode"),C=new fi({src:n,anchorOrigin:u,anchorXUnits:f,anchorYUnits:d,color:g,crossOrigin:m,offset:p,offsetOrigin:_,height:x,width:y,size:v,declutterMode:b});return function(R){return a&&C.setOpacity(a(R)),l&&C.setDisplacement(l(R)),c&&C.setRotation(c(R)),h&&C.setRotateWithView(h(R)),o&&C.setScale(o(R)),s&&C.setAnchor(s(R)),C}}function Y_(r,t){const e="shape-",i=e+"points",n=e+"radius",s=ba(r[i],i),o=ba(r[n],n),a=Ur(r,e,t),l=Wr(r,e,t),c=_o(r,e+"scale",t),h=Ks(r,e+"displacement",t),u=Ie(r,e+"rotation",t),f=Yn(r,e+"rotate-with-view",t),d=Hs(r,e+"radius2"),g=Hs(r,e+"angle"),m=yo(r,e+"declutter-mode"),p=new mo({points:s,radius:o,radius2:d,angle:g,declutterMode:m});return function(_){return a&&p.setFill(a(_)),l&&p.setStroke(l(_)),h&&p.setDisplacement(h(_)),u&&p.setRotation(u(_)),f&&p.setRotateWithView(f(_)),c&&p.setScale(c(_)),p}}function Z_(r,t){const e="circle-",i=Ur(r,e,t),n=Wr(r,e,t),s=Ie(r,e+"radius",t),o=_o(r,e+"scale",t),a=Ks(r,e+"displacement",t),l=Ie(r,e+"rotation",t),c=Yn(r,e+"rotate-with-view",t),h=yo(r,e+"declutter-mode"),u=new po({radius:5,declutterMode:h});return function(f){return s&&u.setRadius(s(f)),i&&u.setFill(i(f)),n&&u.setStroke(n(f)),a&&u.setDisplacement(a(f)),l&&u.setRotation(l(f)),c&&u.setRotateWithView(c(f)),o&&u.setScale(o(f)),u}}function Ie(r,t,e){if(!(t in r))return;const i=Mi(r[t],bt,e);return function(n){return ba(i(n),t)}}function xi(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Re,e);return function(n){return Vu(i(n),t)}}function V_(r,t,e){const i=xi(r,t+"pattern-src",e),n=hh(r,t+"pattern-offset",e),s=hh(r,t+"pattern-size",e),o=ol(r,t+"color",e);return function(a){return{src:i(a),offset:n&&n(a),size:s&&s(a),color:o&&o(a)}}}function Yn(r,t,e){if(!(t in r))return null;const i=Mi(r[t],ve,e);return function(n){const s=i(n);if(typeof s!="boolean")throw new Error(`Expected a boolean for ${t}`);return s}}function ol(r,t,e){if(!(t in r))return null;const i=Mi(r[t],Je,e);return function(n){return Ku(i(n),t)}}function Zu(r,t,e){if(!(t in r))return null;const i=Mi(r[t],xn,e);return function(n){return rs(i(n),t)}}function Ks(r,t,e){if(!(t in r))return null;const i=Mi(r[t],xn,e);return function(n){const s=rs(i(n),t);if(s.length!==2)throw new Error(`Expected two numbers for ${t}`);return s}}function hh(r,t,e){if(!(t in r))return null;const i=Mi(r[t],xn,e);return function(n){return Hu(i(n),t)}}function _o(r,t,e){if(!(t in r))return null;const i=Mi(r[t],xn|bt,e);return function(n){return J_(i(n),t)}}function Hs(r,t){const e=r[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function K_(r,t){const e=r[t];if(e!==void 0){if(typeof e=="number")return Te(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function H_(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function uh(r,t){const e=r[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function fh(r,t){const e=r[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function q_(r,t){const e=r[t];if(e!==void 0)return rs(e,t)}function yo(r,t){const e=r[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function $_(r,t){const e=r[t];if(e!==void 0)return Ku(e,t)}function rs(r,t){if(!Array.isArray(r))throw new Error(`Expected an array for ${t}`);const e=r.length;for(let i=0;i4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Hu(r,t){const e=rs(r,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function J_(r,t){return typeof r=="number"?r:Hu(r,t)}const qe={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function dh(r,t,e){return(function(i,n,s,o,a){if(!i)return;if(!n&&!t)return i;const l=t?0:s[0]*n,c=t?0:s[1]*n,h=a?a[0]:0,u=a?a[1]:0;let f=r[0]+l/2+h,d=r[2]-l/2+h,g=r[1]+c/2+u,m=r[3]-c/2+u;f>d&&(f=(d+f)/2,d=f),g>m&&(g=(m+g)/2,m=g);let p=Xt(i[0],f,d),_=Xt(i[1],g,m);if(o&&e&&n){const y=30*n;p+=-y*Math.log(1+Math.max(0,f-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-d)/y),_+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-m)/y)}return[p,_]})}function Q_(r){return r}function qu(r){return Math.pow(r,3)}function sr(r){return 1-qu(1-r)}function ty(r){return 3*r*r-2*r*r*r}function ey(r){return r}function al(r,t,e,i){const n=Dt(t)/e[0],s=xe(t)/e[1];return i?Math.min(r,Math.max(n,s)):Math.min(r,Math.min(n,s))}function ll(r,t,e){let i=Math.min(r,t);const n=50;return i*=Math.log(1+n*Math.max(0,r/t-1))/n+1,e&&(i=Math.max(i,e),i/=Math.log(1+n*Math.max(0,e/r-1))/n+1),Xt(i,e/2,t*2)}function iy(r,t,e,i){return t=t!==void 0?t:!0,(function(n,s,o,a){if(n!==void 0){const l=r[0],c=r[r.length-1],h=e?al(l,e,o,i):l;if(a)return t?ll(n,h,c):Xt(n,c,h);const u=Math.min(h,n),f=Math.floor(Xa(r,u,s));return r[f]>h&&f1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let n=0;for(;n0}getInteracting(){return this.hints_[ne.INTERACTING]>0}cancelAnimations(){this.setHint(ne.ANIMATING,-this.hints_[ne.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){const n=this.animations_[i];let s=!0;for(let o=0,a=n.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):s=!1;const u=l.easing(h);if(l.sourceCenter){const f=l.sourceCenter[0],d=l.sourceCenter[1],g=l.targetCenter[0],m=l.targetCenter[1];this.nextCenter_=l.targetCenter;const p=f+u*(g-f),_=d+u*(m-d);this.targetCenter_=[p,_]}if(l.sourceResolution&&l.targetResolution){const f=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const d=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(f,0,d,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=f,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const f=u===1?dn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const d=this.constraints_.rotation(f,!0);this.targetCenter_=this.calculateCenterRotate(d,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=f}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(s){this.animations_[i]=null,this.setHint(ne.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=n[0].callback;o&&Cs(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return n!==void 0&&(i=[n[0]-e[0],n[1]-e[1]],Fa(i,t-this.getRotation()),fg(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),s=this.getResolution();if(n!==void 0&&s!==void 0){const o=e[0]-t*(e[0]-n[0])/s,a=e[1]-t*(e[1]-n[1])/s;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&pa(t,this.getProjection())}getCenterInternal(){return this.get(qe.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return nu(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Mt(e,"The view center is not defined");const i=this.getResolution();Mt(i!==void 0,"The view resolution is not defined");const n=this.getRotation();return Mt(n!==void 0,"The view rotation is not defined"),ua(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(qe.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(zi(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Dt(t)/e[0],n=xe(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return(function(s){return e/Math.pow(t,s*n)})}getRotation(){return this.get(qe.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(i/n)/e;return(function(o){return Math.log(i/o)/e/s})}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const s=this.padding_;if(s){const o=this.getViewportSizeMinusPadding_();n=Vo(n,this.getViewportSize_(),[o[0]/2+s[3],o[1]/2+s[0]],e,i)}return{center:n.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,n;if(this.resolutions_){const s=Xa(this.resolutions_,t,1);e=s,i=this.resolutions_[s],s==this.resolutions_.length-1?n=2:n=i/this.resolutions_[s+1]}else i=this.maxResolution_,n=this.zoomFactor_;return e+Math.log(i/t)/Math.log(n)}getResolutionForZoom(t){var e;if((e=this.resolutions_)!=null&&e.length){if(this.resolutions_.length===1)return this.resolutions_[0];const i=Xt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[i]/this.resolutions_[i+1];return this.resolutions_[i]/Math.pow(n,Xt(t-i,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(Mt(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Mt(!no(t),"Cannot fit empty extent provided as `geometry`");const n=zi(t,this.getProjection());i=jc(n)}else if(t.getType()==="Circle"){const n=zi(t.getExtent(),this.getProjection());i=jc(n),i.rotate(this.getRotation(),pn(n))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),s=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,f=s.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Qe?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let n;if(e.layerStatesArray){if(n=e.layerStatesArray.find(o=>o.layer===this),!n)return!1}else n=this.getLayerState();const s=this.getExtent();return ul(n,e.viewState)&&(!s||we(s,e.extent))}getAttributions(t){var s;if(!this.isVisible(t))return[];const e=(s=this.getSource())==null?void 0:s.getAttributions();if(!e)return[];const i=t instanceof Qe?t.getViewStateAndExtent():t;let n=e(i);return Array.isArray(n)||(n=[n]),n}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(Ot.MAP,t)}getMapInternal(){return this.get(Ot.MAP)}setMap(t){this.mapPrecomposeKey_&&(Gt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Gt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Ct(t,Ge.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=Ct(this,_t.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Mt(!e.some(n=>n.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(Ot.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function ul(r,t){if(!r.visible)return!1;const e=t.resolution;if(e=r.maxResolution)return!1;const i=t.zoom;return i>r.minZoom&&i<=r.maxZoom}const ph={RENDER_ORDER:"renderOrder"};class Ju extends or{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(ph.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter||(t.declutter[i]=new Fu(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(ph.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?ju:t;const e=uy(t);this.styleFunction_=t===null?void 0:Vp(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function uy(r){if(r===void 0)return ju;if(!r)return null;if(typeof r=="function"||r instanceof ae)return r;if(!Array.isArray(r))return ch([r]);if(r.length===0)return[];const t=r.length,e=r[0];if(e instanceof ae){const n=new Array(t);for(let s=0;st)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){At()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(!i)i=e,this.transitionStarts_[t]=i;else if(i===-1)return 1;const n=e-i+1e3/60;return n>=this.transition_?1:qu(n/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class Qu extends fl{constructor(t,e,i,n,s,o){super(t,e,o),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_,Be?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,n!==null&&(this.image_.crossOrigin=n)),this.unlisten_=null,this.tileLoadFunction_=s}getImage(){return this.image_}setImage(t){this.image_=t,this.state=rt.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=rt.ERROR,this.unlistenImage_(),this.image_=fy(),this.changed()}handleImageLoad_(){if(Be)this.state=rt.LOADED;else{const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=rt.LOADED:this.state=rt.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==rt.ERROR&&(this.state=rt.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==rt.IDLE&&(this.state=rt.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=up(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}function fy(){const r=Jt(1,1);return r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1),r.canvas}class dy{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const s=this.points_[e]-this.points_[i],o=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(o,s),this.initialVelocity_=Math.sqrt(s*s+o*o)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}class zn extends Me{constructor(t,e,i){super(t),this.map=e,this.frameState=i!==void 0?i:null}}class ji extends zn{constructor(t,e,i,n,s,o){super(t,e,s),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=n!==void 0?n:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const Zt={SINGLECLICK:"singleclick",CLICK:_t.CLICK,DBLCLICK:_t.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Aa={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class gy extends ts{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=Ct(i,Aa.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=Ct(i,Aa.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(_t.TOUCHMOVE,this.boundHandleTouchMove_,Au?{passive:!1}:!1)}emulateClick_(t){let e=new ji(Zt.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new ji(Zt.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const i=new ji(Zt.SINGLECLICK,this.map_,t);this.dispatchEvent(i)},250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Zt.POINTERUP||e.type==Zt.POINTERCANCEL){delete this.trackedTouches_[i];for(const n in this.trackedTouches_)if(this.trackedTouches_[n].target!==e.target){delete this.trackedTouches_[n];break}}else(e.type==Zt.POINTERDOWN||e.type==Zt.POINTERMOVE)&&(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new ji(Zt.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(Gt),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new ji(Zt.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Ct(i,Zt.POINTERMOVE,this.handlePointerMove_,this),Ct(i,Zt.POINTERUP,this.handlePointerUp_,this),Ct(this.element_,Zt.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(Ct(this.element_.getRootNode(),Zt.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new ji(Zt.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new ji(Zt.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Gt(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(_t.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Gt(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Gt),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Gi={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},ue={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},qs=1/0;class my{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Jr(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){Mt(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=qs?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,s=e[t],o=i[t],a=t;for(;t>1;){const l=this.getLeftChildIndex_(t),c=this.getRightChildIndex_(t),h=ct;){const a=this.getParentIndex_(e);if(n[a]>o)i[e]=i[a],n[e]=n[a],e=a;else break}i[e]=s,n[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const s=e.length;let o,a,l;for(a=0;at.apply(null,i),i=>i[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(_t.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===rt.LOADED||i===rt.ERROR||i===rt.EMPTY){i!==rt.ERROR&&e.removeEventListener(_t.CHANGE,this.boundHandleTileChange_);const n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0;for(;this.tilesLoading_0;){const n=this.dequeue()[0],s=n.getKey();n.getState()===rt.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++i,n.load())}}}function _y(r,t,e,i,n){if(!r||!(e in r.wantedTiles)||!r.wantedTiles[e][t.getKey()])return qs;const s=r.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(n)+Math.sqrt(o*o+a*a)/n}class dl extends ni{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){var t;(t=this.element)==null||t.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){var e;this.map_&&((e=this.element)==null||e.remove());for(let i=0,n=this.listenerKeys.length;in.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(n=>i.add(n)):i.add(this.attributions_)),!this.overrideCollapsible_){const n=!e.some(s=>{var o;return((o=s.getSource())==null?void 0:o.getAttributionsCollapsible())===!1});this.setCollapsible(n)}return Array.from(i)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(n=>bm(()=>n))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!qi(e,this.renderedAttributions_)){tp(this.ulElement_);for(let n=0,s=e.length;n0&&i%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:sr}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const n="rotate("+i+"rad)";if(this.autoHide_){const s=this.element.classList.contains(vs);!s&&i===0?this.element.classList.add(vs):s&&i!==0&&this.element.classList.remove(vs)}this.label_.style.transform=n}this.rotation_=i}}class wy extends dl{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",i=t.delta!==void 0?t.delta:1,n=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",s=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",c=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=n,h.setAttribute("type","button"),h.title=l,h.appendChild(typeof o=="string"?document.createTextNode(o):o),h.addEventListener(_t.CLICK,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=s,u.setAttribute("type","button"),u.title=c,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(_t.CLICK,this.handleClick_.bind(this,-i),!1);const f=e+" "+fo+" "+il,d=this.element;d.className=f,d.appendChild(h),d.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const i=this.getMap().getView();if(!i)return;const n=i.getZoom();if(n!==void 0){const s=i.getConstrainedZoom(n+t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({zoom:s,duration:this.duration_,easing:sr})):i.setZoom(s)}}}function xy(r){r=r||{};const t=new je;return(r.zoom!==void 0?r.zoom:!0)&&t.push(new wy(r.zoomOptions)),(r.rotate!==void 0?r.rotate:!0)&&t.push(new vy(r.rotateOptions)),(r.attribution!==void 0?r.attribution:!0)&&t.push(new yy(r.attributionOptions)),t}const _h={ACTIVE:"active"};class ss extends ni{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(_h.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(_h.ACTIVE,t)}setMap(t){this.map_=t}}function Ey(r,t,e){const i=r.getCenterInternal();if(i){const n=[i[0]+t[0],i[1]+t[1]];r.animateInternal({duration:e!==void 0?e:250,easing:ey,center:r.getConstrainedCenter(n)})}}function gl(r,t,e,i){const n=r.getZoom();if(n===void 0)return;const s=r.getConstrainedZoom(n+t),o=r.getResolutionForZoom(s);r.getAnimating()&&r.cancelAnimations(),r.animate({resolution:o,anchor:e,duration:i!==void 0?i:250,easing:sr})}class by extends ss{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==Zt.DBLCLICK){const i=t.originalEvent,n=t.map,s=t.coordinate,o=i.shiftKey?-this.delta_:this.delta_,a=n.getView();gl(a,o,s,this.duration_),i.preventDefault(),e=!0}return!e}}function Ca(r){const t=arguments;return function(e){let i=!0;for(let n=0,s=t.length;n0}}else if(t.type==Zt.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Zt.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function ml(r){const t=r.length;let e=0,i=0;for(let n=0;n0&&this.condition_(t)){const i=t.map.getView();return this.lastCentroid=null,i.getAnimating()&&i.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Ly extends ar{constructor(t){t=t||{},super({stopDown:co}),this.condition_=t.condition?t.condition:Cy,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!Zn(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===cl)return;const n=e.getSize(),s=t.pixel,o=Math.atan2(n[1]/2-s[1],s[0]-n[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;i.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return Zn(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return Zn(t)&&ef(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Py extends ao{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new yn([n])}getGeometry(){return this.geometry_}}const Dn={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class mr extends Me{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class Oy extends ar{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Py(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??ef,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],s=i[1]-e[1];return n*n+s*s>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new mr(Dn.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new mr(e?Dn.BOXEND:Dn.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new mr(Dn.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new mr(Dn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new mr(Dn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class Dy extends Oy{constructor(t){t=t||{};const e=t.condition?t.condition:rf;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const i=this.getMap().getView();let n=this.getGeometry();if(this.out_){const s=i.rotatedExtentForGeometry(n),o=i.getResolutionForExtentInternal(s),a=i.getResolution()/o;n=n.clone(),n.scale(a*a)}i.fitInternal(n,{duration:this.duration_,easing:sr})}}const tn={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class ky extends ss{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return nf(e)&&sf(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==_t.KEYDOWN){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==tn.DOWN||n==tn.LEFT||n==tn.RIGHT||n==tn.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,c=0;n==tn.DOWN?c=-a:n==tn.LEFT?l=-a:n==tn.RIGHT?l=a:c=a;const h=[l,c];Fa(h,o.getRotation()),Ey(o,h,this.duration_),i.preventDefault(),e=!0}}return!e}}class Fy extends ss{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Iy(e)&&sf(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==_t.KEYDOWN||t.type==_t.KEYPRESS){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==="+"||n==="-")){const s=t.map,o=n==="+"?this.delta_:-this.delta_,a=s.getView();gl(a,o,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}const Ny=40,jy=300;class Gy extends ss{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:Ry;this.condition_=t.onFocusOnly?Ca(tf,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==_t.WHEEL)return!0;const i=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let s=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:s*=Ny;break;case WheelEvent.DOM_DELTA_PAGE:s*=jy;break}if(s===0)return!1;this.lastDelta_=s;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?"trackpad":"wheel");const a=i.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-s/this.deltaPerZoom_,this.lastAnchor_?i.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=s;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,i),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-Xt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),gl(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class By extends ar{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=co),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],n=this.targetPointers[1],s=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(this.lastAngle_!==void 0){const l=s-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=s;const o=t.map,a=o.getView();a.getConstraints().rotation!==cl&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(ml(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class zy extends ar{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=co),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],n=this.targetPointers[1],s=i.clientX-n.clientX,o=i.clientY-n.clientY,a=Math.sqrt(s*s+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,c=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(ml(this.targetPointers))),l.render(),c.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function Sa(r){r=r||{};const t=new je,e=new dy(-.005,.05,100);return(r.altShiftDragRotate!==void 0?r.altShiftDragRotate:!0)&&t.push(new Ly),(r.doubleClickZoom!==void 0?r.doubleClickZoom:!0)&&t.push(new by({delta:r.zoomDelta,duration:r.zoomDuration})),(r.dragPan!==void 0?r.dragPan:!0)&&t.push(new My({onFocusOnly:r.onFocusOnly,kinetic:e})),(r.pinchRotate!==void 0?r.pinchRotate:!0)&&t.push(new By),(r.pinchZoom!==void 0?r.pinchZoom:!0)&&t.push(new zy({duration:r.zoomDuration})),(r.keyboard!==void 0?r.keyboard:!0)&&(t.push(new ky),t.push(new Fy({delta:r.zoomDelta,duration:r.zoomDuration}))),(r.mouseWheelZoom!==void 0?r.mouseWheelZoom:!0)&&t.push(new Gy({onFocusOnly:r.onFocusOnly,duration:r.zoomDuration})),(r.shiftDragZoom!==void 0?r.shiftDragZoom:!0)&&t.push(new Dy({duration:r.zoomDuration})),t}const Fi={ADDLAYER:"addlayer",REMOVELAYER:"removelayer"};class Bi extends Me{constructor(t,e){super(t),this.layer=e}}const Ko={LAYERS:"layers"};class Cn extends $u{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Ko.LAYERS,this.handleLayersChanged_),i?Array.isArray(i)?i=new je(i.slice(),{unique:!0}):Mt(typeof i.getArray=="function","Expected `layers` to be an array or a `Collection`"):i=new je(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Gt),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(Ct(t,Ce.ADD,this.handleLayersAdd_,this),Ct(t,Ce.REMOVE,this.handleLayersRemove_,this));for(const i in this.listenerKeys_)this.listenerKeys_[i].forEach(Gt);Jr(this.listenerKeys_);const e=t.getArray();for(let i=0,n=e.length;i=0;--b){const C=m[b],R=C.layer;if(R.hasRenderer()&&ul(C,h)&&a.call(l,R)){const I=R.getRenderer(),O=R.getSource();if(I&&O){const G=O.getWrapX()?d:t,W=u.bind(null,C.managed);y[0]=G[0]+g[v][0],y[1]=G[1]+g[v][1],c=I.forEachFeatureAtCoordinate(y,e,i,W,_)}if(c)return c}}if(_.length===0)return;const x=1/_.length;return _.forEach((v,b)=>v.distanceSq+=b*x),_.sort((v,b)=>v.distanceSq-b.distanceSq),_.some(v=>c=v.callback(v.feature,v.layer,v.geometry)),c}hasFeatureAtCoordinate(t,e,i,n,s,o){return this.forEachFeatureAtCoordinate(t,e,i,n,Dr,this,s,o)!==void 0}getMap(){return this.map_}renderFrame(t){At()}scheduleExpireIconCache(t){ze.canExpireCache()&&t.postRenderFunctions.push(Wy)}}function Wy(r,t){ze.expire()}class Xy extends Uy{constructor(t){super(t),this.fontChangeListenerKey_=Ct(jn,tr.PROPERTYCHANGE,t.redrawText,t),this.element_=Be?Cu():document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=fo+" ol-layers";const i=t.getViewport();i&&i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new zu(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){Gt(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Ge.PRECOMPOSE,t);const e=t.layerStatesArray.sort((c,h)=>c.zIndex-h.zIndex);e.some(c=>c.layer instanceof Ju&&c.layer.getDeclutter())&&(t.declutter={});const n=t.viewState;this.children_.length=0;const s=[];let o=null;for(let c=0,h=e.length;c0)&&(c.fillStyle=f,c.fillRect(0,0,l.width,l.height)),Ui(u)&&u.width>0){const d=h.style.opacity||u.style.opacity;c.globalAlpha=d===""?1:Number(d);const g=u.style.transform;if(g)c.setTransform(..._a(g));else{const m=parseFloat(u.style.width)/u.width,p=parseFloat(u.style.height)/u.height;c.setTransform(m,0,0,p,0,0)}c.drawImage(u,0,0)}}c.globalAlpha=1,c.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent(Ge.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let i=e.length-1;i>=0;--i){const n=e[i],s=n.layer;s.getDeclutter()&&s.renderDeclutter(t,n)}e.forEach(i=>i.layer.renderDeferred(t))}}}function of(r){if(r instanceof or){r.setMapInternal(null);return}r instanceof Cn&&r.getLayers().forEach(of)}function af(r,t){if(r instanceof or){r.setMapInternal(t);return}if(r instanceof Cn){const e=r.getLayers().getArray();for(let i=0,n=e.length;ithis.updateSize())),this.controls=e.controls||(Be?new je:xy()),this.interactions=e.interactions||(Be?new je:Sa({onFocusOnly:!0})),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new py(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(ue.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(ue.VIEW,this.handleViewChanged_),this.addChangeListener(ue.SIZE,this.handleSizeChanged_),this.addChangeListener(ue.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const i=this;t.view&&!(t.view instanceof Qe)&&t.view.then(function(n){i.setView(new Qe(n))}),this.controls.addEventListener(Ce.ADD,n=>{n.element.setMap(this)}),this.controls.addEventListener(Ce.REMOVE,n=>{n.element.setMap(null)}),this.interactions.addEventListener(Ce.ADD,n=>{n.element.setMap(this)}),this.interactions.addEventListener(Ce.REMOVE,n=>{n.element.setMap(null)}),this.overlays_.addEventListener(Ce.ADD,n=>{this.addOverlayInternal_(n.element)}),this.overlays_.addEventListener(Ce.REMOVE,n=>{const s=n.element.getId();s!==void 0&&delete this.overlayIdIndex_[s.toString()],n.element.setMap(null)}),this.controls.forEach(n=>{n.setMap(this)}),this.interactions.forEach(n=>{n.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){af(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){var t;this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),(t=this.resizeObserver_)==null||t.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t);i=i!==void 0?i:{};const s=i.hitTolerance!==void 0?i.hitTolerance:0,o=i.layerFilter!==void 0?i.layerFilter:Dr,a=i.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,s,a,e,null,o,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,function(n){i.push(n)},e),i}getAllLayers(){const t=[];function e(i){i.forEach(function(n){n instanceof Cn?e(n.getLayers()):t.push(n)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const n=e.layerFilter!==void 0?e.layerFilter:Dr,s=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,s,o,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const i=this.viewport_.getBoundingClientRect(),n=this.getSize(),s=i.width/n[0],o=i.height/n[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-i.left)/s,(a.clientY-i.top)/o]}getTarget(){return this.get(ue.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return pa(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?ie(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(ue.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof je){e.setLayers(t);return}const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e=0;s--){const o=n[s];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,s=n;if(t){const o=t.viewHints;if(o[ne.ANIMATING]||o[ne.INTERACTING]){const a=Date.now()-t.time>8;n=a?0:8,s=a?0:2}}e.getTilesLoading(){this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Bi("removelayer",e)),this.set(ue.LAYERGROUP,t)}setSize(t){this.set(ue.SIZE,t)}setTarget(t){this.set(ue.TARGET,t)}setView(t){if(!t||t instanceof Qe){this.set(ue.VIEW,t);return}this.set(ue.VIEW,new Qe);const e=this;t.then(function(i){e.setView(new Qe(i))})}updateSize(){const t=this.getTargetElement();let e;if(t){let n,s;if(Ui(t))n=t.width,s=t.height;else{const o=getComputedStyle(t);n=t.offsetWidth-parseFloat(o.borderLeftWidth)-parseFloat(o.paddingLeft)-parseFloat(o.paddingRight)-parseFloat(o.borderRightWidth),s=t.offsetHeight-parseFloat(o.borderTopWidth)-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom)-parseFloat(o.borderBottomWidth)}!isNaN(n)&&!isNaN(s)&&(e=[Math.max(0,n),Math.max(0,s)],!Jc(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Wh("No map visible because the map container's width or height are 0."))}const i=this.getSize();e&&(!i||!qi(e,i))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}}function Zy(r){let t=null;r.keyboardEventTarget!==void 0&&(t=typeof r.keyboardEventTarget=="string"?document.getElementById(r.keyboardEventTarget):r.keyboardEventTarget);const e={},i=r.layers&&typeof r.layers.getLayers=="function"?r.layers:new Cn({layers:r.layers});e[ue.LAYERGROUP]=i,e[ue.TARGET]=r.target,e[ue.VIEW]=r.view instanceof Qe?r.view:new Qe;let n;r.controls!==void 0&&(Array.isArray(r.controls)?n=new je(r.controls.slice()):(Mt(typeof r.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),n=r.controls));let s;r.interactions!==void 0&&(Array.isArray(r.interactions)?s=new je(r.interactions.slice()):(Mt(typeof r.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),s=r.interactions));let o;return r.overlays!==void 0?Array.isArray(r.overlays)?o=new je(r.overlays.slice()):(Mt(typeof r.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=r.overlays):o=new je,{controls:n,interactions:s,keyboardEventTarget:t,overlays:o,values:e}}class pl{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function kn(r,t,e,i,n){return n!==void 0?(n.minX=r,n.maxX=t,n.minY=e,n.maxY=i,n):new pl(r,t,e,i)}Qe.prototype.getDecimalZoom=function(){const r=this.getResolution(),t=Math.log(this.maxResolution_/r)/Math.log(2);return t!==void 0?this.minZoom_+t:t};function Ra(r){return r instanceof Image||r instanceof HTMLCanvasElement||r instanceof HTMLVideoElement||r instanceof ImageBitmap?r:null}const Vy=new Error("disposed"),Ky=[256,256];class yh extends fl{constructor(t){const e=rt.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=Ra(this.data_);return t?[t.width,t.height]:Ky}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==rt.IDLE&&this.state!==rt.ERROR)return;this.state=rt.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=rt.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=rt.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(Vy),this.controller_=null),super.disposeInternal()}}let Ho;const Vn=[];function vh(r,t,e,i,n){r.beginPath(),r.moveTo(0,0),r.lineTo(t,e),r.lineTo(i,n),r.closePath(),r.save(),r.clip(),r.fillRect(0,0,Math.max(t,i)+1,Math.max(e,n)),r.restore()}function qo(r,t){return Math.abs(r[t*4]-210)>2||Math.abs(r[t*4+3]-.75*255)>2}function Hy(){if(Ho===void 0){const r=Jt(6,6,Vn);r.globalCompositeOperation="lighter",r.fillStyle="rgba(210, 0, 0, 0.75)",vh(r,4,5,4,0),vh(r,4,5,0,5);const t=r.getImageData(0,0,3,3).data;Ho=qo(t,0)||qo(t,4)||qo(t,8),uo(r),Vn.push(r.canvas)}return Ho}function wh(r,t,e,i){const n=fe(e,t,r);let s=yc(t,i,e);const o=t.getMetersPerUnit();o!==void 0&&(s*=o);const a=r.getMetersPerUnit();a!==void 0&&(s/=a);const l=r.getExtent();if(!l||Hn(l,n)){const c=yc(r,s,n)/s;isFinite(c)&&c>0&&(s/=c)}return s}function qy(r,t,e,i){const n=pn(e);let s=wh(r,t,n,i);return(!isFinite(s)||s<=0)&&ka(e,function(o){return s=wh(r,t,o,i),isFinite(s)&&s>0}),s}function $y(r,t,e,i,n,s,o,a,l,c,h,u,f,d){const g=Jt(Math.round(e*r),Math.round(e*t),Vn);if(u||(g.imageSmoothingEnabled=!1),l.length===0)return g.canvas;g.scale(e,e);function m(b){return Math.round(b*e)/e}g.globalCompositeOperation="lighter";const p=We();l.forEach(function(b,C,R){sg(p,b.extent)});let _;const y=e/i,x=(u?1:1+Math.pow(2,-24))/y;_=Jt(Math.round(Dt(p)*y),Math.round(xe(p)*y),Vn),u||(_.imageSmoothingEnabled=!1),l.forEach(function(b,C,R){if(b.image.width>0&&b.image.height>0){if(b.clipExtent){_.save();const H=(b.clipExtent[0]-p[0])*y,K=-(b.clipExtent[3]-p[3])*y,$=Dt(b.clipExtent)*y,st=xe(b.clipExtent)*y;_.rect(u?H:Math.round(H),u?K:Math.round(K),u?$:Math.round(H+$)-Math.round(H),u?st:Math.round(K+st)-Math.round(K)),_.clip()}const I=(b.extent[0]-p[0])*y,O=-(b.extent[3]-p[3])*y,G=Dt(b.extent)*y,W=xe(b.extent)*y;_.drawImage(b.image,c,c,b.image.width-2*c,b.image.height-2*c,u?I:Math.round(I),u?O:Math.round(O),u?G:Math.round(I+G)-Math.round(I),u?W:Math.round(O+W)-Math.round(O)),b.clipExtent&&_.restore()}});const v=bn(o);return a.getTriangles().forEach(function(b,C,R){const I=b.source,O=b.target;let G=I[0][0],W=I[0][1],H=I[1][0],K=I[1][1],$=I[2][0],st=I[2][1];const D=m((O[0][0]-v[0])/s),tt=m(-(O[0][1]-v[1])/s),Q=m((O[1][0]-v[0])/s),ot=m(-(O[1][1]-v[1])/s),ct=m((O[2][0]-v[0])/s),at=m(-(O[2][1]-v[1])/s),B=G,Bt=W;G=0,W=0,H-=B,K-=Bt,$-=B,st-=Bt;const Lt=[[H,K,0,0,Q-D],[$,st,0,0,ct-D],[0,0,H,K,ot-tt],[0,0,$,st,at-tt]],kt=ug(Lt);if(!kt)return;if(g.save(),g.beginPath(),Hy()||!u){g.moveTo(Q,ot);const Nt=4,Kt=D-Q,Yt=tt-ot;for(let Ut=0;Utie(a,fe(x,this.targetProj_,this.sourceProj_))):gn(this.targetProj_,this.sourceProj_);this.transformInv_=function(x){const v=x[0]+"/"+x[1];return l[v]||(l[v]=c(x)),l[v]},this.maxSourceExtent_=n,this.errorThresholdSquared_=s*s,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Dt(n)>=Dt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Dt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Dt(this.targetProj_.getExtent()):null;const h=bn(i),u=qr(i),f=io(i),d=Hr(i),g=this.transformInv_(h),m=this.transformInv_(u),p=this.transformInv_(f),_=this.transformInv_(d),y=Jy+(o?Math.max(0,Math.ceil(Math.log2(ha(i)/(o*o*256*256)))):0);if(this.addQuad_(h,u,f,d,g,m,p,_,y),this.wrapsXInSource_){let x=1/0;this.triangles_.forEach(function(v,b,C){x=Math.min(x,v.source[0][0],v.source[1][0],v.source[2][0])}),this.triangles_.forEach(v=>{if(Math.max(v.source[0][0],v.source[1][0],v.source[2][0])-x>this.sourceWorldWidth_/2){const b=[[v.source[0][0],v.source[0][1]],[v.source[1][0],v.source[1][1]],[v.source[2][0],v.source[2][1]]];b[0][0]-x>this.sourceWorldWidth_/2&&(b[0][0]-=this.sourceWorldWidth_),b[1][0]-x>this.sourceWorldWidth_/2&&(b[1][0]-=this.sourceWorldWidth_),b[2][0]-x>this.sourceWorldWidth_/2&&(b[2][0]-=this.sourceWorldWidth_);const C=Math.min(b[0][0],b[1][0],b[2][0]);Math.max(b[0][0],b[1][0],b[2][0])-C.5&&u<1;let g=!1;if(c>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const p=lc([t,e,i,n]);g=Dt(p)/this.targetWorldWidth_>xh||g}!d&&this.sourceProj_.isGlobal()&&u&&(g=u>xh||g)}if(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!we(h,this.maxSourceExtent_))return;let m=0;if(!g&&(!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(c>0)g=!0;else if(m=(!isFinite(s[0])||!isFinite(s[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!g){const p=[(t[0]+i[0])/2,(t[1]+i[1])/2],_=this.transformInv_(p);let y;d?y=(dn(s[0],f)+dn(a[0],f))/2-dn(_[0],f):y=(s[0]+a[0])/2-_[0];const x=(s[1]+a[1])/2-_[1];g=y*y+x*x>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const p=[(e[0]+i[0])/2,(e[1]+i[1])/2],_=this.transformInv_(p),y=[(n[0]+t[0])/2,(n[1]+t[1])/2],x=this.transformInv_(y);this.addQuad_(t,e,p,y,s,o,_,x,c-1),this.addQuad_(y,p,i,n,x,_,a,l,c-1)}else{const p=[(t[0]+e[0])/2,(t[1]+e[1])/2],_=this.transformInv_(p),y=[(i[0]+n[0])/2,(i[1]+n[1])/2],x=this.transformInv_(y);this.addQuad_(t,p,y,n,s,_,x,l,c-1),this.addQuad_(p,e,i,y,_,o,a,x,c-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(t,i,n,s,a,l),(m&14)==0&&this.addTriangle_(t,i,e,s,a,o),m&&((m&13)==0&&this.addTriangle_(e,n,t,o,l,s),(m&7)==0&&this.addTriangle_(e,n,i,o,l,a))}calculateSourceExtent(){const t=We();return this.triangles_.forEach(function(e,i,n){const s=e.source;Sr(t,s[0]),Sr(t,s[1]),Sr(t,s[2])}),t}getTriangles(){return this.triangles_}}const t0=.5;class lf extends fl{constructor(t,e,i,n,s,o,a,l,c,h,u,f){super(s,rt.IDLE,f),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=o||s,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const d=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let m=this.sourceTileGrid_.getExtent();const p=g?fn(d,g):d;if(ha(p)===0){this.state=rt.EMPTY;return}const _=t.getExtent();_&&(m?m=fn(m,_):m=_);const y=n.getResolution(this.wrappedTileCoord_[0]),x=qy(t,i,p,y);if(!isFinite(x)||x<=0){this.state=rt.EMPTY;return}const v=h!==void 0?h:t0;if(this.triangulation_=new Qy(t,i,p,m,x*v,y),this.triangulation_.getTriangles().length===0){this.state=rt.EMPTY;return}this.sourceZ_=e.getZForResolution(x);let b=this.triangulation_.calculateSourceExtent();if(m&&(t.canWrapX()?(b[1]=Xt(b[1],m[1],m[3]),b[3]=Xt(b[3],m[1],m[3])):b=fn(b,m)),!ha(b))this.state=rt.EMPTY;else{let C=0,R=0;t.canWrapX()&&(C=Dt(_),R=Math.floor((b[0]-_[0])/C)),qh(b.slice(),t,!0).forEach(O=>{const G=e.getTileRangeForExtentAndZ(O,this.sourceZ_);for(let W=G.minX;W<=G.maxX;W++)for(let H=G.minY;H<=G.maxY;H++){const K=c(this.sourceZ_,W,H,a);if(K){const $=R*C;this.sourceTiles_.push({tile:K,offset:$})}}++R}),this.sourceTiles_.length===0&&(this.state=rt.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{var n;const i=e.tile;if(i&&i.getState()==rt.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const o=(n=this.clipExtent_)==null?void 0:n.slice();o&&(o[0]+=e.offset,o[2]+=e.offset),t.push({extent:s,clipExtent:o,image:i.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=rt.ERROR;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n=typeof i=="number"?i:i[0],s=typeof i=="number"?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=$y(n,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=rt.LOADED}this.changed()}load(){if(this.state==rt.IDLE){this.state=rt.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const i=e.getState();if(i==rt.IDLE||i==rt.LOADING){t++;const n=Ct(e,_t.CHANGE,s=>{const o=e.getState();(o==rt.LOADED||o==rt.ERROR||o==rt.EMPTY)&&(Gt(n),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},i,n){e.getState()==rt.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Gt),this.sourcesListenerKeys_=null}release(){this.canvas_&&(uo(this.canvas_.getContext("2d")),Vn.push(this.canvas_),this.canvas_=null),super.release()}}class Eh{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof ao&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return Mt(i!==void 0,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return Mt(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.key_;return t}getValues(){const t=new Array(this.count_);let e=0,i;for(i=this.newest_;i;i=i.older)t[e++]=i.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){var e;return(e=this.entries_[t])==null?void 0:e.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){Mt(!(t in this.entries_),"Tried to set a value for a key that is used already");const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}function $s(r,t,e,i){return i!==void 0?(i[0]=r,i[1]=t,i[2]=e,i):[r,t,e]}function e0(r,t,e){return r+"/"+t+"/"+e}function Os(r,t,e,i,n){return`${St(r)},${t},${e0(e,i,n)}`}function i0(r){return n0(r[0],r[1],r[2])}function n0(r,t,e){return(t<e||e>t.getMaxZoom())return!1;const s=t.getFullTileRange(e);return s?s.containsXY(i,n):!0}function $o(r,t,e){if(!(e in r))return r[e]=new Set([t]),!0;const i=r[e],n=i.has(t);return n||i.add(t),!n}function s0(r,t,e){const i=r[e];return i?i.delete(t):!1}function bh(r,t){const e=r.layerStatesArray[r.layerIndex];e.extent&&(t=fn(t,zi(e.extent,r.viewState.projection)));const i=e.layer.getRenderSource();if(!i.getWrapX()){const n=i.getTileGridForProjection(r.viewState.projection).getExtent();n&&(t=fn(t,n))}return t}class o0 extends Uu{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=We(),this.tempTileRange_=new pl(0,0,0,0),this.tempTileCoord_=$s(0,0,0);const i=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new Eh(i),this.sourceTileCache_=null,this.maxStaleKeys=i*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new Eh(512)),this.sourceTileCache_}getOrCreateTile(t,e,i,n){const s=this.tileCache_,a=this.getLayer().getSource(),l=Os(a,a.getKey(),t,e,i);let c;if(s.containsKey(l))c=s.get(l);else{const h=n.viewState.projection,u=a.getProjection();if(c=a.getTile(t,e,i,n.pixelRatio,h,!u||Ms(u,h)?void 0:this.getSourceTileCache()),!c)return null;s.set(l,c)}return c}getTile(t,e,i,n){const s=this.getOrCreateTile(t,e,i,n);return s||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=ie(e.pixelToCoordinateTransform,t.slice()),s=i.getExtent();if(s&&!Hn(s,n))return null;const o=e.viewState,a=i.getRenderSource(),l=a.getTileGridForProjection(o.projection),c=a.getTilePixelRatio(e.pixelRatio);for(let h=l.getZForResolution(o.resolution);h>=l.getMinZoom();--h){const u=l.getTileCoordForCoordAndZ(n,h),f=this.getTile(h,u[1],u[2],e);if(!f||f.getState()!==rt.LOADED)continue;const d=l.getOrigin(h),g=Te(l.getTileSize(h)),m=l.getResolution(h);let p;if(f instanceof Qu||f instanceof lf)p=f.getImage();else if(f instanceof yh){if(p=Ra(f.getData()),!p)continue}else continue;const _=Math.floor(c*((n[0]-d[0])/m-u[1]*g[0])),y=Math.floor(c*((d[1]-n[1])/m-u[2]*g[1])),x=Math.round(c*a.getGutterForProjection(o.projection));return this.getImageData(p,_+x,y+x)}return null}prepareFrame(t){var n;this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===e.getKey()&&(this.tileCache_.clear(),(n=this.sourceTileCache_)==null||n.clear())):this.renderedSourceRevision_=i,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(t,e,i,n,s){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),c=l.getTileGridForProjection(o.projection),h=St(l);h in t.wantedTiles||(t.wantedTiles[h]={});const u=t.wantedTiles[h],f=a.getMapInternal(),d=Math.max(i-s,c.getMinZoom(),c.getZForResolution(Math.min(a.getMaxResolution(),f?f.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):c.getResolution(0)),l.zDirection)),g=o.rotation,m=g?Kh(o.center,o.resolution,g,t.size):void 0;for(let p=i;p>=d;--p){const _=c.getTileRangeForExtentAndZ(e,p,this.tempTileRange_),y=c.getResolution(p);for(let x=_.minX;x<=_.maxX;++x)for(let v=_.minY;v<=_.maxY;++v){if(g&&!c.tileCoordIntersectsViewport([p,x,v],m))continue;const b=this.getTile(p,x,v,t);if(!b||!$o(n,b,p))continue;const R=b.getKey();if(u[R]=!0,b.getState()===rt.IDLE&&!t.tileQueue.isKeyQueued(R)){const I=$s(p,x,v,this.tempTileCoord_);t.tileQueue.enqueue([b,h,c.getTileCoordCenter(I),y])}}}}findStaleTile_(t,e){const i=this.tileCache_,n=t[0],s=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l0&&setTimeout(()=>{this.enqueueTiles(t,O,f-1,R,I-1)},0),!(f in R))return this.container;const G=St(this),W=t.time;for(const Q of R[f]){const ot=Q.getState();if(ot===rt.EMPTY)continue;const ct=Q.tileCoord;if(ot===rt.LOADED&&Q.getAlpha(G,W)===1){Q.endTransition(G);continue}if(ot!==rt.ERROR&&(this.renderComplete=!1),this.findStaleTile_(ct,R)){s0(R,Q,f),t.animate=!0;continue}if(this.findAltTiles_(u,ct,f+1,R))continue;const Bt=u.getMinZoom();for(let Lt=f-1;Lt>=Bt&&!this.findAltTiles_(u,ct,Lt,R);--Lt);}const H=d/o*l/p,K=this.getRenderContext(t);Ii(this.tempTransform,_/2,y/2,H,H,0,-_/2,-y/2),i.extent&&this.clipUnrotated(K,t,x),h.getInterpolate()||(K.imageSmoothingEnabled=!1),this.preRender(K,t);const $=Object.keys(R).map(Number);$.sort(Ai);let st;const D=[],tt=[];for(let Q=$.length-1;Q>=0;--Q){const ot=$[Q],ct=h.getTilePixelSize(ot,l,s),B=u.getResolution(ot)/d,Bt=ct[0]*B*H,Lt=ct[1]*B*H,kt=u.getTileCoordForCoordAndZ(bn(C),ot),zt=u.getTileCoordExtent(kt),Nt=ie(this.tempTransform,[p*(zt[0]-C[0])/d,p*(C[3]-zt[3])/d]),Kt=p*h.getGutterForProjection(s);for(const Yt of R[ot]){if(Yt.getState()!==rt.LOADED)continue;const Ut=Yt.tileCoord,vt=kt[1]-Ut[1],Xe=Math.round(Nt[0]-(vt-1)*Bt),Le=kt[2]-Ut[2],Ee=Math.round(Nt[1]-(Le-1)*Lt),te=Math.round(Nt[0]-vt*Bt),ge=Math.round(Nt[1]-Le*Lt),me=Xe-te,Ye=Ee-ge,Ze=$.length===1;let Oe=!1;st=[te,ge,te+me,ge,te+me,ge+Ye,te,ge+Ye];for(let Ve=0,Ke=D.length;Ve{var Lt;const at=St(h),B=ct.wantedTiles[at],Bt=B?Object.keys(B).length:0;this.updateCacheSize(Bt),this.tileCache_.expireCache(),(Lt=this.sourceTileCache_)==null||Lt.expireCache()};t.postRenderFunctions.push(Q)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,i,n,s,o,a,l){let c;if(t instanceof yh){if(c=Ra(t.getData()),!c)throw new Error("Rendering array data is not yet supported")}else c=this.getTileImage(t);if(!c)return;const h=this.getRenderContext(e),u=St(this),f=e.layerStatesArray[e.layerIndex],d=f.opacity*(l?t.getAlpha(u,e.time):1),g=d!==h.globalAlpha;g&&(h.save(),h.globalAlpha=d),h.drawImage(c,a,a,c.width-2*a,c.height-2*a,i,n,s,o),g&&h.restore(),d!==f.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const n=St(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}}const Rs={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class a0 extends or{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Rs.PRELOAD)}setPreload(t){this.set(Rs.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Rs.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Rs.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class Jo extends a0{constructor(t){super(t)}createRenderer(){return new o0(this,{cacheSize:this.getCacheSize()})}}const Fn=[0,0,0],Ni=5;class cf{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,Mt(Em(this.resolutions_,(n,s)=>s-n),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let n=0,s=this.resolutions_.length-1;n{const o=new pl(Math.min(0,n[0]),Math.max(n[0]-1,-1),Math.min(0,n[1]),Math.max(n[1]-1,-1));if(i){const a=this.getTileRangeForExtentAndZ(i,s);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let s=n.minX,o=n.maxX;s<=o;++s)for(let a=n.minY,l=n.maxY;a<=l;++a)i([e,s,a])}forEachTileCoordParentTileRange(t,e,i,n){let s,o,a,l=null,c=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,n);c>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),s=kn(o,o,a,a,i)):s=this.getTileRangeForExtentAndZ(l,c,i),e(c,s))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]this.maxZoom||e0?i:Math.max(s/e[0],n/e[1]);const o=t+1,a=new Array(o);for(let l=0;lthis.getTileInternal(g,m,p,_,a,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=c,d}getTileInternal(t,e,i,n,s,o){const a=this.getKey(),l=Os(this,a,t,e,i);if(o&&o.containsKey(l))return o.get(l);const c=this.createTile_(t,e,i,n,s,a);return o==null||o.set(l,c),c}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const i=de(t);if(i){const n=St(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}}}function x0(r,t){if(Be){const e=r.getCrossOrigin();let i="same-origin",n="same-origin";e==="anonymous"||e===""?(i="cors",n="omit"):e==="use-credentials"&&(i="cors",n="include"),fetch(t,{mode:i,credentials:n}).then(s=>{if(!s.ok)throw new Error(`HTTP ${s.status}`);return s.blob()}).then(s=>createImageBitmap(s)).then(s=>{var l;const o=r.getImage();o.width=s.width,o.height=s.height,o.getContext("2d").drawImage(s,0,0),(l=s.close)==null||l.call(s),o.dispatchEvent(new Event("load"))}).catch(()=>{r.getImage().dispatchEvent(new Event("error"))});return}r.getImage().src=t}class gf extends df{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",i=t.tileGrid!==void 0?t.tileGrid:uf({extent:vo(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}function E0(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}const b0=22;class A0 extends df{constructor(t){const e=!!t.highDpi;super({attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,projection:"EPSG:3857",reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,zDirection:t.zDirection}),this.apiKey_=t.key,this.error_=null;const i={mapType:t.mapType||"roadmap",language:t.language||"en-US",region:t.region||"US"};t.imageFormat&&(i.imageFormat=t.imageFormat),t.scale&&(i.scale=t.scale),e&&(i.highDpi=!0),t.layerTypes&&(i.layerTypes=t.layerTypes),t.styles&&(i.styles=t.styles),t.overlay===!0&&(i.overlay=!0),t.apiOptions&&(i.apiOptions=t.apiOptions),this.sessionTokenRequest_=i,this.sessionTokenValue_,this.sessionRefreshId_,this.previousViewportAttribution_,this.previousViewportExtent_;const n=t.url||"https://tile.googleapis.com/";this.createSessionUrl_=n+"v1/createSession",this.tileUrl_=n+"v1/2dtiles",this.attributionUrl_=n+"tile/v1/viewport",this.createSession_()}getError(){return this.error_}fetchSessionToken(t,e){return fetch(t,e)}async createSession_(){const t=this.createSessionUrl_+"?key="+this.apiKey_,e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionTokenRequest_)},i=await this.fetchSessionToken(t,e);if(!i.ok){try{const f=await i.json();this.error_=new Error(f.error.message)}catch{this.error_=new Error("Error fetching session token")}this.setState("error");return}const n=await i.json(),s=this.getTilePixelRatio(1),o=[n.tileWidth/s,n.tileHeight/s];this.tileGrid=uf({extent:vo(this.getProjection()),maxZoom:b0,tileSize:o});const a=n.session;this.sessionTokenValue_=a;const l=this.apiKey_,c=this.tileUrl_;this.tileUrlFunction=function(f,d,g){const m=f[0],p=f[1],_=f[2];return`${c}/${m}/${p}/${_}?session=${a}&key=${l}`};const h=parseInt(n.expiry,10)*1e3,u=Math.max(h-Date.now()-60*1e3,1);this.sessionRefreshId_=setTimeout(()=>this.createSession_(),u),this.setAttributions(this.fetchAttributions_.bind(this)),this.setState("ready")}async fetchAttributions_(t){if(t.viewHints[ne.ANIMATING]||t.viewHints[ne.INTERACTING]||t.animate)return this.previousViewportAttribution_;const[e,i]=Mr(Hr(t.extent),t.viewState.projection),[n,s]=Mr(qr(t.extent),t.viewState.projection),l=`zoom=${this.getTileGrid().getZForResolution(t.viewState.resolution,this.zDirection)}&north=${s}&south=${i}&east=${n}&west=${e}`;if(this.previousViewportExtent_==l)return this.previousViewportAttribution_;this.previousViewportExtent_=l;const c=this.sessionTokenValue_,h=this.apiKey_,f=`${this.attributionUrl_}?session=${c}&key=${h}&${l}`;return this.previousViewportAttribution_=await fetch(f).then(d=>d.json()).then(d=>d.copyright),this.previousViewportAttribution_}disposeInternal(){clearTimeout(this.sessionRefreshId_),super.disposeInternal()}}class rr extends uu(gf){constructor(t={}){const e=fu(t);if(super(e),t.mapID&&(this.mapID=t.mapID),t.mapID==="morioka_ndl_affine"){const i=this.getTileUrlFunction();this.setTileUrlFunction((n,s,o)=>i(n,s,o))}this.initialize(t)}}class Xr extends rr{constructor(e={}){super(e);T(this,"style","");T(this,"accessToken","");T(this,"mapboxMap");this.style=e.style,this.mapboxMap=e.mapboxMap,this.accessToken=e.accessToken}}T(Xr,"isMapbox_",!0);class Yr extends rr{constructor(e={}){super(e);T(this,"style","");T(this,"maplibreMap");this.style=e.style||"https://tile.openstreetmap.jp/styles/osm-bright/style.json",this.maplibreMap=e.maplibreMap}}T(Yr,"isMapLibre_",!0);class Ta extends uu(A0){constructor(t={}){const e=Object.assign({},t);e.mapType=t.maptype.match(/^google_(.+)$/)?RegExp.$1:"roadmap",e.layerTypes=(t.layers||[]).map(i=>`layer${i.charAt(0).toUpperCase()}${i.slice(1).toLowerCase()}`),super(e),t.mapID&&(this.mapID=t.mapID),this.initialize(t)}}class C0 extends or{constructor(t){const e=function(i){const n=this.getSource(),s=n.mapboxMap;if(!s)return console.error("MapboxLayer: mapboxMap is undefined!"),null;s.setStyle(n.style);const o=s.getCanvas(),a=i.viewState,l=this.getVisible();o.style.display=l?"block":"none";const c=this.getOpacity();o.style.opacity=c;const h=a.rotation*-180/Math.PI,u=Mr(a.center),f=a.zoom-1,d=s.getBearing(),g=s.getCenter().toArray(),m=s.getZoom();return h==d&&u[0]==g[0]&&u[1]==g[1]&&f==m||(h!=d&&s.rotateTo(h,{animate:!1}),(u[0]!=g[0]||u[1]!=g[1]||f!=m)&&s.jumpTo({center:u,zoom:f,animate:!1}),s._frame&&(s._frame.cancel(),s._frame=null),s._render()),o};super({render:e,source:t.source})}}class S0 extends or{constructor(t){const e=function(i){const n=this.getSource(),s=n.maplibreMap;if(!s)return console.error("MapLibreLayer: maplibreMap is undefined!"),null;s.setStyle(n.style);const o=s.getCanvas(),a=i.viewState,l=this.getVisible();o.style.display=l?"block":"none";const c=this.getOpacity();o.style.opacity=c;const u=-a.rotation*180/Math.PI,f=s.getBearing();Math.abs(u-f)>.01&&(s.stop(),s.setBearing(u));const d=Mr(a.center),g=a.zoom-1;if((s.getCenter().toArray().toString()!==d.toString()||s.getZoom()!==g)&&s.jumpTo({center:d,zoom:g,animate:!1}),s._frame&&(s._frame.cancel(),s._frame=null),i.size){const[m,p]=i.size;(o.width!==m||o.height!==p)&&s.resize()}return s._render(),Math.abs(s.getZoom()-g)>.01&&s.setZoom(g),o.style.position="absolute",o.style.left="0",o.style.top="0",o};super({render:e,source:t.source})}}const mf=""+new URL("bluedot-B8SR7m2V.png",import.meta.url).href,pf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjE8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KD0UqkwAACBNJREFUWAnNWN9vXMUVPmfm3l3vrtdeO3FA4ATiEtEI4iSKigQvpUlfeEDqQ5F44al/VJ8r+lCJhz4lLUQqQn2goLqRINBIAYfQWBBMbMfLen/dmdPvm7t3s01QE9QHeuzxzJ0f53zznTPnzrXI/4noo+MwlRdlrrl30Cl87JgLjUy0JqqZBImFxJE6P/DR3+27/R356LG+iMZH1f9wIK+Zb3/c7Qy8W1Wxk1HsbAyyIiqZmGYmlqtZEKcjGI1O9a6qXQGGqzXLbvXmWndkQ8cPA/RfgJiTc7vtfFA7bhYvRJN1c9qUlheZz0XqUI2m5FARTISmCpReEOmOBaaHTuNmnsulbKTXu6fae/KWYvD75fuBnLO8UfSPFGF8PkQ9bzU/L8s1kWVMd1BEAEkAoBI26QjWNNdF2QWgXtH3zj50an8aDhZvyWc6xMgD8iCQZ6xen98/Fkb66xjstB2pe3k8KxkAlgSkWkUmKsNVNFSACIYM7QXRr0bmnHzh1P1+1G5dl/cV8fOfUqkse8FEPew/HYb6G+hdsycaKkcwpYFhgmCZZYOG6JLKKJpTVgiM/Sycs40w2hndAZjfjoeta/czQ6InYq4x7j+WmCCINYB4HCDmMcyyjHIU5TjKkyjzGKujzKFNcCx4LNtAweccNcLJLaCczCSu1A4h3t6ot7pPCTaNGVMB5xNBYBaD7EJyx2pTZQFamxhroRxCeRaYVyfPPdRbKJ/D0LeYV5u4iCxQFHM9Hqz0U4Q/XcvE/dRL/EaOyUh+1Qq930HN7XKB4AhSXrYs3z1YCyH8PMXEISinO1gIhiDOoH6SRlHzoB6mEfT3YJD0kwG6YFYwXTzmxSiaYe4xFf1ZQ+OHg/Wg9qw8Y3uVizAq0u52OxbCL63h27ICbCSNhcqXUMgEQPyhabKBzME6gaKrOF6DRR5nuqlax7UUgnEEDWmY+DNe7GheL4K92mj2V8qBtCVzg4FbRZJ6TpYAghxxF6lwMQrdAyZOoDobovwEdWKGbDF+CKACMwWEPbKPgBIzYI66EGv+LOIl2iry4FoVK07WbzfUwnOWaUsWsaoCwMWUAQpjAu64jmrDO7mGOrmnzKUJlAMYB0OOriMYFraR8ByTHtqefdiUh6vtcJ4V0V6UwX4bvZI1x+2FkQvr0gQI0J7yBEfIJvPEXSjZQhsx8TrcQ0ORALYRfNuoR9gpDXLnHnNz9KMrxc3ISWTQMoYaYAggHBmEuKfgom+L4/XMlpDhdrKQhwUbg7AGNJEFFgoXszD18HQQ4a5JpCKsdLdRf1V249VXzk2BiTbwG8FCpQMYMayvXMwaogAS/yHNaFnJSAxuDupzybEAv1MhCCpjoPGIDqCMxps4ipw0xEkgvsQEarbxgk4osFbZz3jjZLjTM5e0cGrACsn2T4CtaLUsiw0etkxcgde4zyYHGV0ToWKCYYwwT5AZAHJzGAADiYUKBGtKwoE/dGk1xn4Ylw6GsQnGTtpAG/OQZoGdcB8wz757QiCET2HAVSk9LUUfDaPtZ48sQWBdqMCh9gDh+MIkILqxIAjUM4JzlBWAWMAIY3oipGMys2JmDAMEgKIBiggSShMIKicYLokYw9yEYzLH4cgqIoGnKlIH2e1BX7SoptyeZM7HARLf2MawGGdhzoCZdLspQ1DCE1LRTxAEw2fOobBmYIMFXcHcBSgBEAegyFkStqAfl6kiuvQmdn7s9/Fq2JE+RqE/FWKYNtIDO8odQ2dJFiazzZNCoARRuYjPbCMO3GFMaiPAeVrARtJG0zdN1OTAacGbi7iDvLuPS8vHcgAgVMyZFaDU4LSJVGMVNr7UuHNc31LN8Ocz9Di8ND1eltoBKjCjdDxZhCNsF9Nu4NLk5cbQFE/cCy65Zv6qFnbADOq4M7qIvk4CI/AdcwF/pkBpsCoEMMK8IQokHVMEqCyVIDzZYLrn8D5C6BNclrbHReb0fZlbKBkB1liv2RZuUP+UbSQOnPWU/UhtqbdsVEZRp2TFHDNbGHKg3jEmZkAkl8xNNoWNGpKg/bUQ5/SWqt+sLtb0pnzn5vc082/rfujKFg5RohV+7Xj4Fkowi2k7BSuMpzt5BYwKGKi4KPlFJKxDmLx4jwmdgDBk4/g12LhciG2OR5nqpf5BY5vLKTxMeJPpeHxuZzMvsvfC9eEr0vFen4dSJrKArMikRna4MTIFf3vmBFLOY4mgVGROmQcAngyMK9/IjAkIGYy3oeoDfABd7uNjQD7y6j6t7iKcUwJha2Opmz3f/ws+nFbjRv+0LjfUn0TAzIMKxg1PBwW2yEBiCkaVYPhCm7x9qVGr1z+WGE4ImbBrJsU7cEmQL5HH/9jLWjtUV8k9IIiVft2+rhfdt+D7NpCvyRBgXgAKZkbePZDeU2qvwTDdgZ2n1z7aSqYyMEDQFLBg35Ugwt8IAh1fju6ouTeHvdZNsMEQn0rJ3fQRDX5O4HKLS/RrMcZTenbOZ+dz5AMYW4RyBmNiAXOxDUcANE4QFMYO44GH8hvg+TM+Rt+FO6LcdNG9+WifE1RE4QcWbvRFKC7gQvYL6/iWX6+JfwnB24FBAEpgyAoLgRAANi1gQfbweCVI8QEC89Zo4M3+DpdcHA4X/jUbF5g5lQcZmQ7hk/PM3kJu+OQMAbd7OYWv3KY7moue8OKZtpfhIr7M+giG7SgB9xXZRL2Jk9ePQxfjjdzLxSzXz7pr7d0f/sk5BYPGj/8RPouG7fv+LaGhictMjfcJ3C/C//pvifut/WjP/wZbyT3jNC/KbwAAAABJRU5ErkJggg==",_f="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACC2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOlJlc29sdXRpb25Vbml0PjI8L3RpZmY6UmVzb2x1dGlvblVuaXQ+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjE8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KD0UqkwAABSJJREFUSA3lVU1sVUUU/mbmvvvu+ykt/aUFLImhsQWMPxAVY4wGNbpxZ9gTjYkxMSa4MTEsXLhxZ4wxMcawMmEFmrhwQ0ANBoxGSSkBq6JCKVBa6Ot7796Z43emtE0BCSs3Tt7cmTkz53znfOfMPOA/auaucTacqyCpl5HNO5TqAWmjhRNDjbvVvzPQlov1JMcDFuGFYMyDENTFoMKxZSwaRsxJ58Khpst+wM9dM3cC/RcgsdnY1FNFbl4NqXteqqUaaglQsoCjSghALkCjgJnPWzb3h52RD1q1ga9wwuS3A7wViBQllfS14Oxb0pP1obcMZFS1NMwfhJ+gE7ZA9TbnVz3MpYW5xPsP20X6Hn7tnl08sPJdDbRpMkvS6j7v7F5sqFv0MYqM3peooCc9jaq/Go1GRR4jcGFhFii73Ia52v7Ee/cmzvTMrcDQz5WFmFKa7SHIG9hEkEEHrBXIiIE8YiHbeLSXhjW6EkfDrlGqhRIpXEPRGNPXlexJJN+Lh0XdW248vdjS0QtbC3FfyFBtGOsI0kH5fRbuaYds2KCgf63vPfAd+ywBmhoVOxiZckqx66dtUilHr18xubxYnO4/umh9OSKx3uMV6SwPo1uTzu0a1Ucsto8CP3YWeGdjgGyl+/0GJtPOCFKe07MalbpsPOwIndxW7TYhvI4tJ/VEbHoE5dHpe8XaZ9BFLUsPHT1URXWY7YbPUWaUNgWq3ugVjmX2hHLqmTqH+1OESvJE4nu3L1oA6H5kYKdkyWY1AEPrmmRSY84GHB93eGg4gZ+ngTPkp8X9KrsCcmkKjm2qMF+mxqIg5aZi4YdKgzjrH6X5bxUjAokPG0zqnDDqCFRwbNPAZEDBCrs+SAOag8uMjWJoFKk6xF9OQZNiWjKdlHdyn47awQQygX6uYotA1qIS9CKqkRuJjUC8M/YPihWgwi0ybjQn0SGOvEdMOqPhXOnUquyI2QDWsFKNVLkTWwTijKd1HT9xI94VXaZULjhRo2pDwXiHIxeMUpqUc9tUSN0A56ROlA1WJOfLBiMQ6+kaPL3WrMc93aeShqhyr8Yosxw1IkYXR6WY24ZsmH4L20uKmSdZoJUZViDsNZ6ILcbpYE6h6ec1D7EQlsH0jLq71LlcuqRKH7U1OqMlr3nsomMa7VUSdM57seY3rmKLQEnJHDOt4qTSRZWY+Pi0CN3Vrs+NXk4dY6FwrheWP7uWfhPE9hCID4qwCv0ZcnShfdYmOLIKaP6XgSk6fQAzbVgeBstTXxhR42qY75toWbO6IkCLo0bTza55YRFoxcUi+ZP+HF6APZ8fbB3vm1gFpItyavabK61v5GIOt74EuzGB7aYB1o3mI+akRDBd9xi4dYxigKT3KWVE5b2SaT5VXzYRjjVOu2dLHy+B6Eg3Vlo2OrWrneMzu7M+5HaUISmff82PEqxPTo3Aa6jCbjs46uvAO6V5lYsM/muPYv/sNUw2X/ZX1n++YvkmIN1IN17YXZTN+3YHwZ7MYNdRWA3xyYkXVe+TgvLZifySxnCOIAeb8IcXZux0/nY+2f/RoodqcbHx9K0t6flrl1TdPmyuPG53EGyMNLKyNBKlMvLAfMllQTjl4Y+SrvHGT4mEd9sTgwdutXibiJYOVZ+bHsyP5btDr3sJXckWc0/agW7mQ29+g+U761nCxYJcysf5z3rIluTT5vjQ70v6N4+3jWjVoZG/e8vBPsYrtg2F6RQRZkVaSOycTcJEYpMjjfG+86t0/heLfwDVxeXi8JpGRAAAAABJRU5ErkJggg==",yl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAwCAYAAAALiLqjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAHq0lEQVR42oyW349dVRXHP2vvfc65v+bOnbml02H6c6AogVooYoSogaCR8IAREhOCURMh/gP6ROyT+iAmPvhGIhoT9M0XQIWQQOyDv7CKLZYisdPaDu208/v+OvfsvZcP55a2Kt67k/WwV9Za373Xd629tlR3THN1CYGCFtmu+2kNThExzS3z6QdSw2eTXYeOXFqbnTW+sHvmV9e2zx0/WYTtV2Yam6/bpLZ66coqobNEunAnwrXl+B9LtItmN39xwz3xzbz28H0dPyt0cqjmRIacXS+g/ugnnd14SodvHG/bt36Anv8FREAA/SCWddV0pFDQgohNtPngM93m0R8Nkof2q2ZCloMLpZkRyBTskKjCMN4639N9j2t+ZkqKC8dco+0RMwISbK21gLU1jKlQm55jOPW57+RTR48G3WfJtjFzQxo7I+kseCdoHsEr2AAyANMhxhrB3XU/Lm+lycqvrt1CsfWZ3RiTYlFs856n+u1nvx9DG7ItqrvhyEcs9x90HLzZ4mrCWg6hA0QF4yEWIF1Qh2aHP5EVf+1U14/9zg1WcP33sUmlTvR9vHG7O61vPVeYu9roOkwLtyxaHrvb8dUHUu5ddBRD5ey2sLmuMIhgI+gQYg7SAdr4uOOOdPDbl530VxGLybsb+N4qtn7nY0V230HMKqhiEpitCbcvWI4sOu5ZtNw2b5muAwmjHAMipaiCrBPcxxa09Zkni2jJC4PJu+vkg37VtB99Au9Bu0AgFrA1gH9eUk5fUE4vB5auRLr9q+kZFUYciUbQHHGBQfXzj2+udprbl1ZwtdYMQVv713sHD1PvAh7EQVdZWg68fEI4u6r4qJw4H7hwUaEHECAGiBGIIAoElAG93sJtM+3FOzK39nvXaM5kQXbOF+RJDDmYCM5D7umehz8U8Pa/Ahphe0vxlwMUvrQJw5IDfNkCViB6rPGm3t53IKGy5CqZVguhJloIoQ8WMA6cgYEyPBdZS6RMQxid3OYQB6A56KAEEQADEgEVk1YrzjQz19+60CkMm2E6KMkQgh81lIJNQFPwpiTUBJCiDOh7EHvAsMy/2BFIgmJ12Lm8gaxsu+7m0Huzcsbt1E0v2kZHDt6DpGDT8mRQ5jrko7TkoL1yL64Ua0Ayom71OlfOnErM5qrpDUCL3vmbKm++SqiVsTSH2IWwDcUG+K1ShlvgO1CMJF4NnoKzkGZgGlSzU8cH3cvvbax1sbXWzbgkJe9v5H76oS9RbRrcALQoSQx5edrYh9AH7UMclnWPg6QCmYVaBZI2bG7q9OYPn5mqdd6qN2cwaepJUkPqT71W7770KnEOqbWRZgPqCSQWdPQkxAJCKAO7DLIa1CvYmSq22QLaZP1Xjkm+9GKIdWJMsI2pFGMiRr2vmOVTQzv/cKgdalVaFapTCVLNIKmgaQUqFajUoVbHNirU2jVm2g2yxgyDfAe6fOxyrfvTbwj+vUBGJEGae24dEagYlzDw0w8OGk//3B74wq6b5qGV9XESGPqI9xGLkKaWSsWQuIQNX2fpQsLg1Etryflnv5Y1ixeR9Lp5MLMblQSVlIgQfG+pMjj+Rpr37l7rH1hwrTlaMzPsmk3Zv1Bjz3yTmeka3ra52Kly9u+XMWd/edKd+96XJT/zmm3M3TC8XNmCV0dmWcfGxD83ey8/op2lr6yuHPn6lfahvclNtzSqw22sM+RZk3zlRLdYee9CtfPKz2Yqy8+vWn1f5b8HpNT33XltIzAcKqk4mmmLoU4zWF+uDvTSR+cOPvmTQwcfOSwmcvL0r/928Z0XnjbJ7W/XGrFbrcD6+jKxf4lk5y03ABj+z1JSomT9alz/yz3zb/7j+ec+zgs/vpdPLf7p3Sm79scoWVclQ24Y8/xnij4suEF1QKtZoMMp2c4bjW4fQjBs96cardaUVF1X82EgUkE/BMRdry7HtFAxBRWzRiorOOnT85YkgdkqJFYRA14TppKz1MQRTIOQdNnsC3LdjwLAzbn+jSevghFF6I9MBUMgswWZjaNDeGIMhAAiniSu0WoYmrVpkPUbAYzohyRJkOum4tVfgirEGFEtXwu9nsoP7K4DUFXGLlVCiIRYlnSMOkrFeF8XJ4gfVVBVohYjPCWqMInvZABAiBB8aRxiqZsIQDSONRKNiEZi9DfsJ/F1KhNQIBCJFMVwdKOISqkfC4CaCRAMqkLwwxEHAmqYxNfpBNdUjUQN5CGMSA+oRibxdXECpmKEGJToSw5i0FI3ga8TM95IjIJEvC+QCCIR6xRjJwCA8UyJCBqFwpd/Jo0jhidg2cUYJ0hRJMaAL8ofXIiBEK919pgbTNAtKEokjPpAiXZ0BR0PECaIH0CDMhyRrEEDAZ3E1zEBUeWHOOJHfYCJpc5O9NhNUKaqhKgMfTF6i5SopUzwFo3vRqMGoqB+lJMoGDXIRJ0sE3SyiUSJ+KudLBE1kUl8nZHxtWxEsBB98FfnVxQRZAJfd/H9y2ONvC/Yv7jfhTBEEFTVXb50BeeSCUgOk9QpTYG5/qBfdjXsBJoxhs2xAAvze8a8pIqI2bt3z4G9p0+/y7AI7Jjduf/AvsW9wImxAGklGQtgxLxj1X77tn2Hj15ZXXW/Off6d13iThkzvor+PQADkAvGWj3+bAAAAABJRU5ErkJggg==",R0=new ae({image:new fi({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:mf})}),I0=new ae({image:new fi({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:pf})}),T0=new ae({image:new fi({anchor:[.5,.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:_f})}),M0=new ae({fill:new Ti({color:[128,128,256,.2]}),stroke:new wn({color:[128,128,256,1],width:3})}),L0=new ae({image:new fi({anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",src:yl})});class Zr extends Yy{constructor(e){e=hi(e||{});const i=new Ss({source:new Es({wrapX:!1})});i.set("name","gps");const n=new Ss({source:new Es({wrapX:!1})});n.set("name","marker");const s=new Ss({source:new Es({wrapX:!1})});s.set("name","feature");const o=new Ss({source:new Es({wrapX:!1})});o.set("name","envelope");const a=Zr.spawnLayer(null,e.source,e.target),l=new Cn;l.set("name","overlay");const h={controls:e.controls?e.controls:[],layers:[a,l,o,s,i,n],target:e.div,view:new Qe({center:e.defaultCenter||[0,0],zoom:e.defaultZoom||2,rotation:e.defaultRotation||0,multiWorld:!0})};e.interactions&&(h.interactions=e.interactions);super(h);T(this,"fakeGps");T(this,"fakeRadius");T(this,"geolocation");T(this,"homePosition");T(this,"northUp");T(this,"tapDuration");T(this,"homeMarginPixels");T(this,"tapUIVanish");T(this,"alwaysGpsOn");T(this,"__ignore_first_move");this.fakeGps=e.fakeGps,this.fakeRadius=e.fakeRadius,this.homePosition=e.homePosition,this.northUp=e.northUp,this.tapDuration=e.tapDuration,this.homeMarginPixels=e.homeMarginPixels,this.tapUIVanish=e.tapUIVanish,this.alwaysGpsOn=e.alwaysGpsOn||!1;const u=this.getView();this.__ignore_first_move=!0;const f=()=>{this.__ignore_first_move||this.dispatchEvent("movestart"),this.__ignore_first_move=!1,u.un("propertychange",f)};u.on("propertychange",f),this.on("moveend",()=>{u.on("propertychange",f)}),u.on("change:resolution",()=>{this.getSource()})}static spawnLayer(e,i,n){return i instanceof Xr||i instanceof Yr||!(e instanceof Jo)?(i instanceof Xr?e=new C0({style:i.style,accessToken:i.accessToken,container:n,source:i}):i instanceof Yr?e=new S0({style:i.style,container:n,source:i}):e=new Jo({source:i}),e.set("name","base")):e.setSource(i),e}getLayer(e="base"){const i=n=>{const s=n.getArray().map(o=>{if(o.get("name")==e)return o;if(o.getLayers)return i(o.getLayers())}).filter(o=>o);if(s.length!=0)return s[0]};return i(this.getLayers())}getSource(e="base"){const i=this.getLayer(e);if(i)return i.getSource()}setFeature(e,i,n){const s=this.getSource(n),o=new Ya(e);return i&&o.setStyle(i),s.addFeature(o),o}removeFeature(e,i){this.getSource(i).removeFeature(e)}resetFeature(e){this.getSource(e).clear()}setGPSPosition(e,i=void 0){const n=i=="sub"?T0:i=="hide"?I0:R0;i!="sub"&&this.resetFeature("gps"),e&&(this.setFeature({geometry:new Nr(e.xy)},n,"gps"),i||this.setFeature({geometry:new nl(e.xy,e.rad)},M0,"gps"))}setMarker(e,i,n,s){return s||(s="marker"),i.geometry=new Nr(e),n?typeof n=="string"?n=new ae({image:new fi({anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",src:n})}):n instanceof ae||(n=new ae({image:new fi(n)})):n=L0,this.setFeature(i,n,s)}resetMarker(e){e||(e="marker"),this.resetFeature(e)}setLine(e,i,n){return this.setVector(e,"Line",i?{stroke:i}:null,n)}setVector(e,i="Line",n,s){s||(s="feature");const o={};n.stroke!=null&&(o.stroke=new wn(n.stroke)),n.fill!=null&&(o.fill=new Ti(n.fill));const a=new ae(o),l=i==="Line"?new Ws(e):new yn(e);return this.setFeature({geometry:l,name:i},a,s)}resetLine(e){this.resetVector(e)}resetVector(e){e||(e="feature"),this.resetFeature(e)}setEnvelope(e,i,n){return n||(n="envelope"),this.setLine(e,i,n)}removeEnvelope(e,i){i||(i="envelope"),this.removeFeature(e,i)}resetEnvelope(e){e||(e="envelope"),this.resetFeature(e)}setFillEnvelope(e,i,n,s){s||(s="envelope");let o;if(i!=null||n!=null){const a={};i!=null&&(a.stroke=new wn(i)),n!=null&&(a.fill=new Ti(n)),o=new ae(a)}return this.setFeature({geometry:new yn([e])},o,s)}exchangeSource(e=void 0){const i=this.getLayers(),n=i.item(0),s=Zr.spawnLayer(n,e,this.getTarget());s!=n&&i.setAt(0,s),e&&e.setMap(this)}setLayer(e=void 0){const i=this.getLayer("overlay").getLayers();if(i.clear(),e){const n=new Jo({source:e});i.push(n)}}setTransparency(e){const i=(100-e)/100,n=this.getSource();n instanceof rr||n instanceof Ta?(this.getLayers().item(0).setOpacity(1),this.getLayers().item(1).setOpacity(i)):this.getLayers().item(0).setOpacity(i)}setGPSMarker(e,i){this.getLayers().item(0).getSource().setGPSMarker(e,i)}}class P0 extends ar{constructor(t){t=t||{},super(t),this.condition_=t.condition?t.condition:rf,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=t.duration!==void 0?t.duration:400}handleDragEvent(t){if(!Zn(t))return;const e=t.map,i=e.getSize(),n=t.pixel,s=n[0]-i[0]/2,o=i[1]/2-n[1],a=Math.atan2(o,s),l=Math.sqrt(s*s+o*o),c=e.getView();if(this.lastAngle_!==void 0){const h=this.lastAngle_-a;c.adjustRotationInternal(h)}this.lastAngle_=a,this.lastMagnitude_!==void 0&&c.adjustResolutionInternal(this.lastMagnitude_/l),this.lastMagnitude_!==void 0&&(this.lastScaleDelta_=this.lastMagnitude_/l),this.lastMagnitude_=l}handleUpEvent(t){if(!Zn(t))return!0;const i=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return i.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1}handleDownEvent(t){return Zn(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0):!1}}for(let r=0;r<9;r++){const t=`ZOOM:${r}`,e=256*Math.pow(2,r);(function(i,n){const s=new qn({code:i,extent:[0,0,n,n],units:"m"});Qn(s),Bs("EPSG:3857",s,o=>{const a=(o[0]+Vt)*n/(2*Vt),l=(-o[1]+Vt)*n/(2*Vt);return[a,l]},o=>{const a=o[0]*(2*Vt)/n-Vt,l=-1*(o[1]*(2*Vt)/n-Vt);return[a,l]})})(t,e)}class yf extends pm(gf){constructor(t={}){t=fu(t),t.wrapX=!1;const e=Math.log2(t.width/nn),i=Math.log2(t.height/nn);t.maxZoom=Math.ceil(Math.max(e,i)),t.tileUrlFunction=t.tileUrlFunction||function(n){const s=n[0],o=n[1],a=n[2];return o*nn*Math.pow(2,this.maxZoom-s)>=this.width||a*nn*Math.pow(2,this.maxZoom-s)>=this.height||o<0||a<0?ru:this._tileUrlFunction(n)},super(t),t.mapID&&(this.mapID=t.mapID),t.urls?this._tileUrlFunction=Ia(t.urls):t.url&&(this._tileUrlFunction=Ia(Array.isArray(t.url)?t.url:[t.url])),this.width=t.width,this.height=t.height,this.maxZoom=t.maxZoom,this._maxxy=Math.pow(2,this.maxZoom)*nn,this.initialize(t)}}class Vr extends rr{constructor(t={}){super(Object.assign(t,{opaque:!1}))}}T(Vr,"isBasemap_",!1);const yi="https://weiwudi.example.com/api/";let ta,Nn;class O0{constructor(){this.listeners={}}addEventListener(t,e){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push(e)}removeEventListener(t,e){if(!(t in this.listeners))return;const i=this.listeners[t];for(let n=0,s=i.length;n{n.state==="activated"&&!s&&window.location.reload()})),i.onupdatefound=()=>{i.update()},await wi.swCheck(),i}catch(i){throw`Error: Service worker registration failed with ${i}`}else throw"Error: Service worker is not supported"}static async swCheck(){return Nn!==void 0?Nn:(ta===void 0&&(ta=new Promise((t,e)=>{fetch(`${yi}ping`).then(i=>{Nn=!!i,t(Nn)}).catch(i=>{Nn=!1,t(Nn)})})),ta)}static async registerMap(t,e){if(!await wi.swCheck())throw"Weiwudi service worker is not implemented.";let i;const n=["type","url","width","height","tileSize","minZoom","maxZoom","maxLng","maxLat","minLng","minLat"].reduce((o,a)=>(typeof e[a]<"u"&&(e[a]instanceof Array?e[a].map(l=>{o.append(a,l)}):o.append(a,String(e[a]))),o),new URLSearchParams);n.append("mapID",t);const s=new URL(`${yi}add`);if(s.search=n.toString(),i=await(await fetch(s.href)).text(),i.match(/^Error: /))throw i;return new wi(t,JSON.parse(i))}static async retrieveMap(t){if(!await wi.swCheck())throw"Weiwudi service worker is not implemented.";let e;if(e=await(await fetch(`${yi}info?mapID=${t}`)).text(),e.match(/^Error: /))throw e;return console.log(e),new wi(t,JSON.parse(e))}static async removeMap(t){if(!await wi.swCheck())throw"Weiwudi service worker is not implemented.";let e;if(e=await(await fetch(`${yi}delete?mapID=${t}`)).text(),e.match(/^Error: /))throw e}constructor(t,e){if(super(),!t)throw"MapID is necessary.";this.mapID=t,e&&Object.assign(this,e),this.url=`${yi}cache/${t}/{z}/{x}/{y}`,this.listener=i=>{i.data.mapID===t&&this.dispatchEvent(new CustomEvent(i.data.type,{detail:i.data}))},navigator.serviceWorker.addEventListener("message",this.listener)}release(){navigator.serviceWorker.removeEventListener("message",this.listener),delete this.mapID}checkAspect(){if(!this.mapID)throw"This instance is already released."}async stats(){let t;if(this.checkAspect(),t=await(await fetch(`${yi}stats?mapID=${this.mapID}`)).text(),typeof t=="string"&&t.match(/^Error: /))throw t;return JSON.parse(t)}async clean(){let t;if(this.checkAspect(),t=await(await fetch(`${yi}clean?mapID=${this.mapID}`)).text(),t.match(/^Error: /))throw t}async fetchAll(){let t;if(this.checkAspect(),t=await(await fetch(`${yi}fetchAll?mapID=${this.mapID}`)).text(),t.match(/^Error: /))throw t}async remove(){this.checkAspect(),this.mapID&&await wi.removeMap(this.mapID),this.release()}async cancel(){let t;if(this.checkAspect(),t=await(await fetch(`${yi}cancel?mapID=${this.mapID}`)).text(),t.match(/^Error: /))throw t}}function Is(r,t,e){const i=typeof r=="string"?r:r.getCode(),n=typeof t=="string"?t:t.getCode();let s=gn(r,t);if(s==To&&i!=n){const o=gn(r,"EPSG:3857"),a=gn("EPSG:3857",t);if(o==To&&i!="EPSG:3857")throw"Transform of Source projection is not defined.";if(a==To&&n!="EPSG:3857")throw"Transform of Distination projection is not defined.";s=function(c){return fe(fe(c,r,"EPSG:3857"),"EPSG:3857",t)},Bs(r,t,s,function(c){return fe(fe(c,t,"EPSG:3857"),"EPSG:3857",r)})}if(e)return s(e)}var br={exports:{}},D0=br.exports,Ah;function k0(){return Ah||(Ah=1,(function(r,t){(function(e,i){i(t)})(D0,(function(e){var i=Object.defineProperty,n=(E,A,M)=>A in E?i(E,A,{enumerable:!0,configurable:!0,writable:!0,value:M}):E[A]=M,s=(E,A,M)=>n(E,typeof A!="symbol"?A+"":A,M);function o(E,A,M={}){const P={type:"Feature"};return(M.id===0||M.id)&&(P.id=M.id),M.bbox&&(P.bbox=M.bbox),P.properties=A||{},P.geometry=E,P}function a(E,A,M={}){if(!E)throw new Error("coordinates is required");if(!Array.isArray(E))throw new Error("coordinates must be an Array");if(E.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!h(E[0])||!h(E[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:E},A,M)}function l(E,A,M={}){for(const P of E){if(P.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(P[P.length-1].length!==P[0].length)throw new Error("First and last Position are not equivalent.");for(let Z=0;Z=2&&!Array.isArray(E[0])&&!Array.isArray(E[1]))return[...E];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function f(E){if(Array.isArray(E))return E;if(E.type==="Feature"){if(E.geometry!==null)return E.geometry.coordinates}else if(E.coordinates)return E.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function d(E){return E.type==="Feature"?E.geometry:E}const g=11102230246251565e-32,m=134217729,p=(3+8*g)*g;function _(E,A,M,P,Z){let F,Y,q,U,J=A[0],et=P[0],j=0,V=0;et>J==et>-J?(F=J,J=A[++j]):(F=et,et=P[++V]);let it=0;if(jJ==et>-J?(Y=J+F,q=F-(Y-J),J=A[++j]):(Y=et+F,q=F-(Y-et),et=P[++V]),F=Y,q!==0&&(Z[it++]=q);jJ==et>-J?(Y=F+J,U=Y-F,q=F-(Y-U)+(J-U),J=A[++j]):(Y=F+et,U=Y-F,q=F-(Y-U)+(et-U),et=P[++V]),F=Y,q!==0&&(Z[it++]=q);for(;j=Ji||-De>=Ji||(j=E-jt,q=E-(jt+j)+(j-Z),j=M-Et,J=M-(Et+j)+(j-Z),j=A-Tt,U=A-(Tt+j)+(j-F),j=P-Ft,et=P-(Ft+j)+(j-F),q===0&&U===0&&J===0&&et===0)||(Ji=C*Y+p*Math.abs(De),De+=jt*et+Ft*q-(Tt*J+Et*U),De>=Ji||-De>=Ji))return De;xt=q*Ft,V=m*q,it=V-(V-q),ft=q-it,V=m*Ft,X=V-(V-Ft),z=Ft-X,wt=ft*z-(xt-it*X-ft*X-it*z),lt=U*Et,V=m*U,it=V-(V-U),ft=U-it,V=m*Et,X=V-(V-Et),z=Et-X,yt=ft*z-(lt-it*X-ft*X-it*z),k=wt-yt,j=wt-k,W[0]=wt-(k+j)+(j-yt),ut=xt+k,j=ut-xt,dt=xt-(ut-j)+(k-j),k=dt-lt,j=dt-k,W[1]=dt-(k+j)+(j-lt),Pt=ut+k,j=Pt-ut,W[2]=ut-(Pt-j)+(k-j),W[3]=Pt;const wo=_(4,R,4,W,I);xt=jt*et,V=m*jt,it=V-(V-jt),ft=jt-it,V=m*et,X=V-(V-et),z=et-X,wt=ft*z-(xt-it*X-ft*X-it*z),lt=Tt*J,V=m*Tt,it=V-(V-Tt),ft=Tt-it,V=m*J,X=V-(V-J),z=J-X,yt=ft*z-(lt-it*X-ft*X-it*z),k=wt-yt,j=wt-k,W[0]=wt-(k+j)+(j-yt),ut=xt+k,j=ut-xt,dt=xt-(ut-j)+(k-j),k=dt-lt,j=dt-k,W[1]=dt-(k+j)+(j-lt),Pt=ut+k,j=Pt-ut,W[2]=ut-(Pt-j)+(k-j),W[3]=Pt;const xo=_(wo,I,4,W,O);xt=q*et,V=m*q,it=V-(V-q),ft=q-it,V=m*et,X=V-(V-et),z=et-X,wt=ft*z-(xt-it*X-ft*X-it*z),lt=U*J,V=m*U,it=V-(V-U),ft=U-it,V=m*J,X=V-(V-J),z=J-X,yt=ft*z-(lt-it*X-ft*X-it*z),k=wt-yt,j=wt-k,W[0]=wt-(k+j)+(j-yt),ut=xt+k,j=ut-xt,dt=xt-(ut-j)+(k-j),k=dt-lt,j=dt-k,W[1]=dt-(k+j)+(j-lt),Pt=ut+k,j=Pt-ut,W[2]=ut-(Pt-j)+(k-j),W[3]=Pt;const Eo=_(xo,O,4,W,G);return G[Eo-1]}function K(E,A,M,P,Z,F){const Y=(A-F)*(M-Z),q=(E-Z)*(P-F),U=Y-q,J=Math.abs(Y+q);return Math.abs(U)>=v*J?U:-H(E,A,M,P,Z,F,J)}function $(E,A){var M,P,Z=0,F,Y,q,U,J,et,j,V=E[0],it=E[1],ft=A.length;for(M=0;M=0||Y<=0&&U>=0)return 0}else if(J>=0&&q<=0||J<=0&&q>=0){if(F=K(Y,U,q,J,0,0),F===0)return 0;(F>0&&J>0&&q<=0||F<0&&J<=0&&q>0)&&Z++}et=j,q=J,Y=U}}return Z%2!==0}function st(E,A,M={}){if(!E)throw new Error("point is required");if(!A)throw new Error("polygon is required");const P=u(E),Z=d(A),F=Z.type,Y=A.bbox;let q=Z.coordinates;if(Y&&D(P,Y)===!1)return!1;F==="Polygon"&&(q=[q]);let U=!1;for(var J=0;J=E[0]&&A[3]>=E[1]}function tt(E,A){for(let M=0;MA.features[dt]))}U=tt(E,A)}return q&&q(U),U?Q(E,U,F):ot(E,P,Z,F)}function at(E,A,M,P){let Z=Math.floor((E-A)/M);return Z>=P&&(Z=P-1),Z}function B(E,A){let M=Bt(E-A[0]),P=Math.PI*2,Z;for(let F=0;F=0&&P-1*Math.PI&&P<=Math.PI)};for(;M(E);)E=E+2*Math.PI*(E>0?-1:1);return E}function Lt(E,A){return A&&A>=2.00703||Array.isArray(E[0])?E:E.map(M=>[M.illstNodes,M.mercNodes,M.startEnd])}function kt(E){const A=E.features;for(let M=0;ME.properties[F].geom),M=E.geometry.coordinates[0],P=E.properties,Z={a:{geom:M[0],index:P.a.index},b:{geom:M[1],index:P.b.index},c:{geom:M[2],index:P.c.index}};return l([A],Z)}function Nt(E){const A=[0,1,2,0].map(P=>E[P][0][0]),M={a:{geom:E[0][0][1],index:E[0][1]},b:{geom:E[1][0][1],index:E[1][1]},c:{geom:E[2][0][1],index:E[2][1]}};return l([A],M)}function Kt(E,A,M,P,Z,F=!1,Y){const q=E.map(U=>{(!Y||Y<2.00703)&&(U=Yt(U));const J=isFinite(U)?A[U]:U==="c"?P:U==="b0"?Z[0]:U==="b1"?Z[1]:U==="b2"?Z[2]:U==="b3"?Z[3]:(function(){const et=U.match(/e(\d+)/);if(et){const j=parseInt(et[1]);return M[j]}throw"Bad index value for indexesToTri"})();return F?[[J[1],J[0]],U]:[[J[0],J[1]],U]});return Nt(q)}function Yt(E){return typeof E=="number"?E:E.replace(/^(c|e|b)(?:ent|dgeNode|box)(\d+)?$/,"$1$2")}const Ut=2.00703;function vt(E){return!!(E.version||!E.tins&&E.points&&E.tins_points)}function Xe(E){return{points:E.points,pointsWeightBuffer:Ee(E),strictStatus:te(E),verticesParams:ge(E),centroid:Ye(E),edges:Lt(E.edges||[]),edgeNodes:E.edgeNodes||[],tins:Ze(E),kinks:Oe(E.kinks_points),yaxisMode:E.yaxisMode??"invert",strictMode:E.strictMode??"auto",vertexMode:E.vertexMode,bounds:E.bounds,boundsPolygon:E.boundsPolygon,wh:E.wh,xy:E.bounds?E.xy:[0,0]}}function Le(E){const A=Ve(E),M=A.tins;return{compiled:A,tins:M,points:Ke(M),strictStatus:A.strict_status,pointsWeightBuffer:A.weight_buffer,verticesParams:A.vertices_params,centroid:A.centroid,kinks:A.kinks}}function Ee(E){return!E.version||E.version{const P=E.weight_buffer[M];return P&&(A[M]=Object.keys(P).reduce((Z,F)=>{const Y=Yt(F);return Z[Y]=P[F],Z},{})),A},{}):E.weight_buffer}function te(E){return E.strict_status?E.strict_status:E.kinks_points?"strict_error":E.tins_points.length===2?"loose":"strict"}function ge(E){const A={forw:[E.vertices_params[0]],bakw:[E.vertices_params[1]]};return A.forw[1]=me(E,!1),A.bakw[1]=me(E,!0),A}function me(E,A){return[0,1,2,3].map(M=>{const P=(M+1)%4,Z=Kt(["c",`b${M}`,`b${P}`],E.points,E.edgeNodes||[],E.centroid_point,E.vertices_points,A,Ut);return c([Z])})}function Ye(E){return{forw:a(E.centroid_point[0],{target:{geom:E.centroid_point[1],index:"c"}}),bakw:a(E.centroid_point[1],{target:{geom:E.centroid_point[0],index:"c"}})}}function Ze(E){const A=E.tins_points.length===1?0:1;return{forw:c(E.tins_points[0].map(M=>Kt(M,E.points,E.edgeNodes||[],E.centroid_point,E.vertices_points,!1,E.version))),bakw:c(E.tins_points[A].map(M=>Kt(M,E.points,E.edgeNodes||[],E.centroid_point,E.vertices_points,!0,E.version)))}}function Oe(E){if(E)return{bakw:c(E.map(A=>a(A)))}}function Ve(E){return JSON.parse(JSON.stringify(E).replace('"cent"','"c"').replace(/"bbox(\d+)"/g,'"b$1"'))}function Ke(E){const A=[],M=E.forw.features;for(let P=0;P{const q=Z.geometry.coordinates[0][Y],U=Z.properties[F].geom,J=Z.properties[F].index;typeof J=="number"&&(A[J]=[q,U])})}return A}const Wt=Ut,re=class oi{constructor(){s(this,"points",[]),s(this,"pointsWeightBuffer"),s(this,"strict_status"),s(this,"vertices_params"),s(this,"centroid"),s(this,"edgeNodes"),s(this,"edges"),s(this,"tins"),s(this,"kinks"),s(this,"yaxisMode",oi.YAXIS_INVERT),s(this,"strictMode",oi.MODE_AUTO),s(this,"vertexMode",oi.VERTEX_PLAIN),s(this,"bounds"),s(this,"boundsPolygon"),s(this,"wh"),s(this,"xy"),s(this,"indexedTins"),s(this,"stateFull",!1),s(this,"stateTriangle"),s(this,"stateBackward")}setCompiled(A){if(vt(A)){this.applyModernState(Xe(A));return}this.applyLegacyState(Le(A))}applyModernState(A){this.points=A.points,this.pointsWeightBuffer=A.pointsWeightBuffer,this.strict_status=A.strictStatus,this.vertices_params=A.verticesParams,this.centroid=A.centroid,this.edges=A.edges,this.edgeNodes=A.edgeNodes||[],this.tins=A.tins,this.addIndexedTin(),this.kinks=A.kinks,this.yaxisMode=A.yaxisMode??oi.YAXIS_INVERT,this.vertexMode=A.vertexMode??oi.VERTEX_PLAIN,this.strictMode=A.strictMode??oi.MODE_AUTO,A.bounds?(this.bounds=A.bounds,this.boundsPolygon=A.boundsPolygon,this.xy=A.xy,this.wh=A.wh):(this.bounds=void 0,this.boundsPolygon=void 0,this.xy=A.xy??[0,0],A.wh&&(this.wh=A.wh))}applyLegacyState(A){this.tins=A.tins,this.addIndexedTin(),this.strict_status=A.strictStatus,this.pointsWeightBuffer=A.pointsWeightBuffer,this.vertices_params=A.verticesParams,this.centroid=A.centroid,this.kinks=A.kinks,this.points=A.points}addIndexedTin(){const A=this.tins,M=A.forw,P=A.bakw,Z=Math.ceil(Math.sqrt(M.features.length));if(Z<3){this.indexedTins=void 0;return}let F=[],Y=[];const q=M.features.map(X=>{let z=[];return f(X)[0].map(k=>{F.length===0?F=[Array.from(k),Array.from(k)]:(k[0]F[1][0]&&(F[1][0]=k[0]),k[1]F[1][1]&&(F[1][1]=k[1])),z.length===0?z=[Array.from(k),Array.from(k)]:(k[0]z[1][0]&&(z[1][0]=k[0]),k[1]z[1][1]&&(z[1][1]=k[1]))}),z}),U=(F[1][0]-F[0][0])/Z,J=(F[1][1]-F[0][1])/Z,et=q.reduce((X,z,k)=>{const ut=at(z[0][0],F[0][0],U,Z),dt=at(z[1][0],F[0][0],U,Z),xt=at(z[0][1],F[0][1],J,Z),wt=at(z[1][1],F[0][1],J,Z);for(let lt=ut;lt<=dt;lt++){X[lt]||(X[lt]=[]);for(let yt=xt;yt<=wt;yt++)X[lt][yt]||(X[lt][yt]=[]),X[lt][yt].push(k)}return X},[]),j=P.features.map(X=>{let z=[];return f(X)[0].map(k=>{Y.length===0?Y=[Array.from(k),Array.from(k)]:(k[0]Y[1][0]&&(Y[1][0]=k[0]),k[1]Y[1][1]&&(Y[1][1]=k[1])),z.length===0?z=[Array.from(k),Array.from(k)]:(k[0]z[1][0]&&(z[1][0]=k[0]),k[1]z[1][1]&&(z[1][1]=k[1]))}),z}),V=(Y[1][0]-Y[0][0])/Z,it=(Y[1][1]-Y[0][1])/Z,ft=j.reduce((X,z,k)=>{const ut=at(z[0][0],Y[0][0],V,Z),dt=at(z[1][0],Y[0][0],V,Z),xt=at(z[0][1],Y[0][1],it,Z),wt=at(z[1][1],Y[0][1],it,Z);for(let lt=ut;lt<=dt;lt++){X[lt]||(X[lt]=[]);for(let yt=xt;yt<=wt;yt++)X[lt][yt]||(X[lt][yt]=[]),X[lt][yt].push(k)}return X},[]);this.indexedTins={forw:{gridNum:Z,xOrigin:F[0][0],yOrigin:F[0][1],xUnit:U,yUnit:J,gridCache:et},bakw:{gridNum:Z,xOrigin:Y[0][0],yOrigin:Y[0][1],xUnit:V,yUnit:it,gridCache:ft}}}transform(A,M,P){if(M&&this.strict_status==oi.STATUS_ERROR)throw'Backward transform is not allowed if strict_status == "strict_error"';this.yaxisMode==oi.YAXIS_FOLLOW&&M&&(A=[A[0],-1*A[1]]);const Z=a(A);if(this.bounds&&!M&&!P&&!st(Z,this.boundsPolygon))return!1;const F=M?this.tins.bakw:this.tins.forw,Y=M?this.indexedTins.bakw:this.indexedTins.forw,q=M?this.vertices_params.bakw:this.vertices_params.forw,U=M?this.centroid.bakw:this.centroid.forw,J=M?this.pointsWeightBuffer.bakw:this.pointsWeightBuffer.forw;let et,j;this.stateFull&&(this.stateBackward==M?et=this.stateTriangle:(this.stateBackward=M,this.stateTriangle=void 0),j=it=>{this.stateTriangle=it});let V=ct(Z,F,Y,q,U,J,et,j);if(this.bounds&&M&&!P){const it=a(V);if(!st(it,this.boundsPolygon))return!1}else this.yaxisMode==oi.YAXIS_FOLLOW&&!M&&(V=[V[0],-1*V[1]]);return V}};s(re,"VERTEX_PLAIN","plain"),s(re,"VERTEX_BIRDEYE","birdeye"),s(re,"MODE_STRICT","strict"),s(re,"MODE_AUTO","auto"),s(re,"MODE_LOOSE","loose"),s(re,"STATUS_STRICT","strict"),s(re,"STATUS_ERROR","strict_error"),s(re,"STATUS_LOOSE","loose"),s(re,"YAXIS_FOLLOW","follow"),s(re,"YAXIS_INVERT","invert");let $i=re;e.Transform=$i,e.counterTri=zt,e.format_version=Wt,e.normalizeEdges=Lt,e.rotateVerticesTriangle=kt,e.transformArr=ct,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}))})(br,br.exports)),br.exports}var Ch=k0();const F0=["title","attr","officialTitle","dataAttr","author","createdAt","era","license","dataLicense","contributor","mapper","reference","description","url","lang","imageExtension","homePosition","mercZoom"];async function N0(r){return j0(r,!1,!0)}async function j0(r,t,e){var s,o;const i=e?r:{},n=[];if(F0.forEach(a=>{i[a]=r[a]}),(r.imageExtention||r.imageExtension)&&(i.imageExtension=r.imageExtension||r.imageExtention),r.compiled){let a=new Ch.Transform;a.setCompiled(r.compiled),a.addIndexedTin();const l=a;i.strictMode=l.strictMode,i.vertexMode=l.vertexMode,i.yaxisMode=l.yaxisMode,i.width=(s=l.wh)==null?void 0:s[0],i.height=(o=l.wh)==null?void 0:o[1],i.gcps=l.points,i.edges=l.edges,n.push(a)}else{i.strictMode=r.strictMode,i.vertexMode=r.vertexMode,i.yaxisMode=r.yaxisMode,i.width=r.width,i.height=r.height,i.gcps=r.gcps,i.edges=r.edges;let a=await Sh(r.strictMode,r.vertexMode,r.yaxisMode,r.gcps,r.edges,[r.width,r.height]);n.push(a)}if(r.sub_maps){const a=[];for(let l=0;ln.tins[0].transform(o,!1),o=>n.tins[0].transform(o,!0)),Is("EPSG:4326",s),e.sub_maps&&e.sub_maps.map((o,a)=>{const l=a+1,c=`Illst:${n.mapID}#${l}`,h=n.tins[l],u=new qn({code:c,extent:[h.xy[0],h.xy[1],h.wh[0],h.wh[1]],units:"m"});Qn(u),Bs(u,"EPSG:3857",p=>h.transform(p,!1,!0),p=>h.transform(p,!0,!0)),Is("EPSG:4326",u);const f=Object.assign([],o.bounds);f.push(o.bounds[0]);const d=f.map(p=>h.transform(p,!1)),g=Ls([f]),m=Ls([d]);h.xyBounds=g,h.mercBounds=m}),n}xy2MercAsync_specifyLayer(e,i){const n=`Illst:${this.mapID}${i?`#${i}`:""}`;return new Promise((s,o)=>{s(Is(n,"EPSG:3857",e))})}merc2XyAsync_specifyLayer(e,i){const n=`Illst:${this.mapID}${i?`#${i}`:""}`;return new Promise((s,o)=>{s(Is("EPSG:3857",n,e))})}xy2MercAsync_returnLayer(e){return new Promise((i,n)=>{const s=this.tins.map((o,a)=>[a,o]).sort((o,a)=>o[1].priority{i([a,c])}).catch(c=>{n(c)});break}}})}merc2XyAsync_returnLayer(e){return Promise.all(this.tins.map((i,n)=>new Promise((s,o)=>{this.merc2XyAsync_specifyLayer(e,n).then(a=>{n===0||Ps(a,i.xyBounds)?s([i,n,a]):s([i,n])}).catch(a=>{o(a)})}))).then(i=>i.sort((n,s)=>n[0].priority{const l=s[0],c=s[1],h=s[2];if(!h)return n;for(let u=0;uu[2].importancef<2))},[]).map(n=>{if(n)return[n[0],n[1]]}))}setupMapParameter(e){const i=[this.width/2,this.height/2];this.xy2MercAsync_returnLayer(i).then(n=>{const s=n[0],o=n[1],a=[[i[0]-150,i[1]],[i[0]+150,i[1]],[i[0],i[1]-150],[i[0],i[1]+150]],l=[[0,0],[this.width,0],[this.width,this.height],[0,this.height]],c=[];for(let h=0;h<9;h++){const u=h<4?this.xy2MercAsync_specifyLayer(a[h],s):h==4?Promise.resolve(o):this.xy2MercAsync_specifyLayer(l[h-5],0);c.push(u)}Promise.all(c).then(h=>{const u=Math.sqrt(Math.pow(h[0][0]-h[1][0],2)+Math.pow(h[0][1]-h[1][1],2)),f=Math.sqrt(Math.pow(h[2][0]-h[3][0],2)+Math.pow(h[2][1]-h[3][1],2)),d=(u+f)/2;this.mercZoom||(this.mercZoom=Math.log(300*(2*Vt)/256/d)/Math.log(2)-3),this.homePosition||(this.homePosition=Mr(h[4])),this.envelope=Ls([[h[5],h[6],h[7],h[8],h[5]]]),e(this)}).catch(h=>{throw h})}).catch(n=>{throw n})}mercs2SysCoordsAsync_multiLayer(e){return this.merc2XyAsync_returnLayer(e[0][0]).then(n=>{let s=!1;return Promise.all(n.map((o,a)=>{if(!o){s=!0;return}const l=o[0],c=o[1];return a!==0&&!s?Promise.resolve([c]):Promise.all(e[0].map((h,u)=>u===0?Promise.resolve(c):this.merc2XyAsync_specifyLayer(h,l)))}))}).then(n=>n.map(s=>{if(s)return[s.map(o=>this.xy2SysCoord(o)),e[1]]}))}merc2XyAsync_base(e,i){return this.merc2XyAsync_returnLayer(e).then(n=>{if(!(i&&!n[0]))return n[0]?n[0][1]:n[1][1]})}merc2XyAsync_ignoreBackground(e){return this.merc2XyAsync_base(e,!0)}merc2XyAsync(e){return this.merc2XyAsync_base(e,!1)}xy2MercAsync(e){return this.xy2MercAsync_returnLayer(e).then(i=>i[1])}viewpoint2MercsAsync(e,i){const n=this.viewpoint2SysCoords(e,i),s=this.sysCoords2Xys(n);return this.xy2MercAsync_returnLayer(s[0][0]).then(a=>{const l=a[0],c=a[1],h=s[0].map((u,f)=>f===0?Promise.resolve(c):this.xy2MercAsync_specifyLayer(u,l));return Promise.all(h).then(u=>[u,i])})}mercs2ViewpointAsync(e){return this.merc2XyAsync_returnLayer(e[0][0]).then(n=>{const s=n[0]||n[1],o=s[0],a=s[1];return Promise.all(e[0].map((l,c)=>c===0?a:this.merc2XyAsync_specifyLayer(l,o)))}).then(n=>{const s=this.xys2SysCoords([n,e[1]]);return this.sysCoords2Viewpoint(s)})}}var oe=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||{},ye={searchParams:"URLSearchParams"in oe,iterable:"Symbol"in oe&&"iterator"in Symbol,blob:"FileReader"in oe&&"Blob"in oe&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in oe,arrayBuffer:"ArrayBuffer"in oe};function G0(r){return r&&DataView.prototype.isPrototypeOf(r)}if(ye.arrayBuffer)var B0=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],z0=ArrayBuffer.isView||function(r){return r&&B0.indexOf(Object.prototype.toString.call(r))>-1};function lr(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function vl(r){return typeof r!="string"&&(r=String(r)),r}function wl(r){var t={next:function(){var e=r.shift();return{done:e===void 0,value:e}}};return ye.iterable&&(t[Symbol.iterator]=function(){return t}),t}function Qt(r){this.map={},r instanceof Qt?r.forEach(function(t,e){this.append(e,t)},this):Array.isArray(r)?r.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(t){this.append(t,r[t])},this)}Qt.prototype.append=function(r,t){r=lr(r),t=vl(t);var e=this.map[r];this.map[r]=e?e+", "+t:t};Qt.prototype.delete=function(r){delete this.map[lr(r)]};Qt.prototype.get=function(r){return r=lr(r),this.has(r)?this.map[r]:null};Qt.prototype.has=function(r){return this.map.hasOwnProperty(lr(r))};Qt.prototype.set=function(r,t){this.map[lr(r)]=vl(t)};Qt.prototype.forEach=function(r,t){for(var e in this.map)this.map.hasOwnProperty(e)&&r.call(t,this.map[e],e,this)};Qt.prototype.keys=function(){var r=[];return this.forEach(function(t,e){r.push(e)}),wl(r)};Qt.prototype.values=function(){var r=[];return this.forEach(function(t){r.push(t)}),wl(r)};Qt.prototype.entries=function(){var r=[];return this.forEach(function(t,e){r.push([e,t])}),wl(r)};ye.iterable&&(Qt.prototype[Symbol.iterator]=Qt.prototype.entries);function ea(r){if(!r._noBody){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}}function vf(r){return new Promise(function(t,e){r.onload=function(){t(r.result)},r.onerror=function(){e(r.error)}})}function U0(r){var t=new FileReader,e=vf(t);return t.readAsArrayBuffer(r),e}function W0(r){var t=new FileReader,e=vf(t),i=/charset=([A-Za-z0-9_-]+)/.exec(r.type),n=i?i[1]:"utf-8";return t.readAsText(r,n),e}function X0(r){for(var t=new Uint8Array(r),e=new Array(t.length),i=0;i-1?t:r}function En(r,t){if(!(this instanceof En))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var e=t.body;if(r instanceof En){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,t.headers||(this.headers=new Qt(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!e&&r._bodyInit!=null&&(e=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new Qt(t.headers)),this.method=Z0(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||(function(){if("AbortController"in oe){var s=new AbortController;return s.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&e)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(e),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var i=/([?&])_=[^&]*/;if(i.test(this.url))this.url=this.url.replace(i,"$1_="+new Date().getTime());else{var n=/\?/;this.url+=(n.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}En.prototype.clone=function(){return new En(this,{body:this._bodyInit})};function V0(r){var t=new FormData;return r.trim().split("&").forEach(function(e){if(e){var i=e.split("="),n=i.shift().replace(/\+/g," "),s=i.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(s))}}),t}function K0(r){var t=new Qt,e=r.replace(/\r?\n[\t ]+/g," ");return e.split("\r").map(function(i){return i.indexOf(` -`)===0?i.substr(1,i.length):i}).forEach(function(i){var n=i.split(":"),s=n.shift().trim();if(s){var o=n.join(":").trim();try{t.append(s,o)}catch(a){console.warn("Response "+a.message)}}}),t}wf.call(En.prototype);function di(r,t){if(!(this instanceof di))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new Qt(t.headers),this.url=t.url||"",this._initBody(r)}wf.call(di.prototype);di.prototype.clone=function(){return new di(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Qt(this.headers),url:this.url})};di.error=function(){var r=new di(null,{status:200,statusText:""});return r.ok=!1,r.status=0,r.type="error",r};var H0=[301,302,303,307,308];di.redirect=function(r,t){if(H0.indexOf(t)===-1)throw new RangeError("Invalid status code");return new di(null,{status:t,headers:{location:r}})};var on=oe.DOMException;try{new on}catch{on=function(t,e){this.message=t,this.name=e;var i=Error(t);this.stack=i.stack},on.prototype=Object.create(Error.prototype),on.prototype.constructor=on}function xf(r,t){return new Promise(function(e,i){var n=new En(r,t);if(n.signal&&n.signal.aborted)return i(new on("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var c={statusText:s.statusText,headers:K0(s.getAllResponseHeaders()||"")};n.url.indexOf("file://")===0&&(s.status<200||s.status>599)?c.status=200:c.status=s.status,c.url="responseURL"in s?s.responseURL:c.headers.get("X-Request-URL");var h="response"in s?s.response:s.responseText;setTimeout(function(){e(new di(h,c))},0)},s.onerror=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){i(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){i(new on("Aborted","AbortError"))},0)};function a(c){try{return c===""&&oe.location.href?oe.location.href:c}catch{return c}}if(s.open(n.method,a(n.url),!0),n.credentials==="include"?s.withCredentials=!0:n.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(ye.blob?s.responseType="blob":ye.arrayBuffer&&(s.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof Qt||oe.Headers&&t.headers instanceof oe.Headers)){var l=[];Object.getOwnPropertyNames(t.headers).forEach(function(c){l.push(lr(c)),s.setRequestHeader(c,vl(t.headers[c]))}),n.headers.forEach(function(c,h){l.indexOf(h)===-1&&s.setRequestHeader(h,c)})}else n.headers.forEach(function(c,h){s.setRequestHeader(h,c)});n.signal&&(n.signal.addEventListener("abort",o),s.onreadystatechange=function(){s.readyState===4&&n.signal.removeEventListener("abort",o)}),s.send(typeof n._bodyInit>"u"?null:n._bodyInit)})}xf.polyfill=!0;oe.fetch||(oe.fetch=xf,oe.Headers=Qt,oe.Request=En,oe.Response=di);const Ef=""+new URL("osm-D9kb_3bx.jpg",import.meta.url).href,bf=""+new URL("gsi-PqYiP5VA.jpg",import.meta.url).href,Af=""+new URL("gsi_ortho-ScnbiFIR.jpg",import.meta.url).href,q0={osm:{mapID:"osm",title:{ja:"オープンストリートマップ",en:"OpenStreetMap"},label:{ja:"OSM(現在)",en:"OSM(Now)"},attr:"©︎ OpenStreetMap contributors",maptype:"base",thumbnail:Ef,urls:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png","https://c.tile.openstreetmap.org/{z}/{x}/{y}.png"]},gsi:{mapID:"gsi",title:{ja:"地理院地図",en:"Geospatial Information Authority of Japan Map"},label:{ja:"地理院地図",en:"GSI Map"},attr:{ja:"国土地理院",en:"The Geospatial Information Authority of Japan"},maptype:"base",url:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",maxZoom:18,thumbnail:bf},gsi_ortho:{mapID:"gsi_ortho",title:{ja:"地理院地図オルソ航空写真",en:"Geospatial Information Authority of Japan Ortho aerial photo"},label:{ja:"地理院オルソ",en:"GSI Ortho"},attr:{ja:"国土地理院",en:"The Geospatial Information Authority of Japan"},maptype:"base",url:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg",maxZoom:18,thumbnail:Af}},Ih=r=>(r||"").match(/^(?:base|overlay|google(?:_(?:roadmap|satellite|hybrid|terrain))?|mapbox|maplibre|osm)$/);async function $0(r,t){if(typeof r=="string"&&(r=q0[r]),r=hi(Object.assign(r,t)),r.label=r.label||r.year,Ih(r.maptype)){const e=r.maptype==="base"?rr:r.maptype==="overlay"?Vr:r.maptype==="mapbox"?Xr:r.maptype==="maplibre"?Yr:Ta;e.isBasemap()?(r.homePosition=r.homePos,r.mercZoom=r.defZoom):(r.homePosition||(r.homePosition=r.homePos),r.mercZoom||(r.mercZoom=r.defZoom)),delete r.homePos,delete r.defZoom,r.zoomRestriction&&(r.maxZoom=r.maxZoom||r.mercMaxZoom,r.minZoom=r.minZoom||r.mercMinZoom),r.zoomRestriction=r.mercMaxZoom=r.mercMinZoom=void 0,r.translator&&(r.url=r.translator(r.url)),r.imageExtension||(r.imageExtension="jpg"),r.mapID&&!r.url&&!r.urls&&(r.url=r.tms?`tiles/${r.mapID}/{z}/{x}/{-y}.${r.imageExtension}`:`tiles/${r.mapID}/{z}/{x}/{y}.${r.imageExtension}`),r.weiwudi=await ia(r),r.weiwudi&&(r.url=r.weiwudi.url,delete r.urls);const i=await e.createAsync(r);return await i.initialWait,i}else if(r.noload)return r.mercMaxZoom=r.mercMinZoom=void 0,new Js(r);return new Promise((e,i)=>{const n=r.settingFile||`maps/${r.mapID}.json`,s=new XMLHttpRequest;s.open("GET",n,!0),s.responseType="json",s.onload=async function(o){if(this.status===200||this.status===0)try{let a=this.response;if(typeof a!="object"&&(a=JSON.parse(a)),r=hi(Object.assign(a,r)),r.label=r.label||a.year,r.translator&&(r.url=r.translator(r.url)),r.maptype||(r.maptype="maplat"),Ih(r.maptype)){const l=r.maptype==="base"?rr:r.maptype==="overlay"?Vr:r.maptype==="mapbox"?Xr:r.maptype==="maplibre"?Yr:Ta;l.isBasemap()?(r.homePosition=r.homePos,r.mercZoom=r.defZoom):(r.homePosition||(r.homePosition=r.homePos),r.mercZoom||(r.mercZoom=r.defZoom)),delete r.homePos,delete r.defZoom,r.zoomRestriction&&(r.maxZoom=r.maxZoom||r.mercMaxZoom,r.minZoom=r.minZoom||r.mercMinZoom),r.zoomRestriction=r.mercMaxZoom=r.mercMinZoom=void 0;try{r.imageExtension||(r.imageExtension="jpg"),r.mapID&&!r.url&&!r.urls&&(r.url=r.tms?`tiles/${r.mapID}/{z}/{x}/{-y}.${r.imageExtension}`:`tiles/${r.mapID}/{z}/{x}/{y}.${r.imageExtension}`),r.weiwudi=await ia(r),r.weiwudi&&(r.url=r.weiwudi.url,delete r.urls);const c=await l.createAsync(r);try{await c.initialWait,e(c)}catch{e(c)}}catch(c){i(c)}return}try{if(delete r.homePos,delete r.defZoom,r.imageExtension||(r.imageExtension="jpg"),r.mapID&&!r.url&&!r.urls&&(r.url=`tiles/${r.mapID}/{z}/{x}/{y}.${r.imageExtension}`),!r.compiled||!r.compiled.wh){console.error(`[Maplat] Missing compiled.wh for mapID=${r.mapID}. Check map setting file: ${n}`),i(new Error(`Map ${r.mapID} is missing compiled data.`));return}r.width=r.width||r.compiled.wh[0],r.height=r.height||r.compiled.wh[1],r.weiwudi=await ia(r),r.weiwudi&&(r.url=r.weiwudi.url,delete r.urls);const l=await Js.createAsync(r);try{await l.initialWait,l.setupMapParameter(e)}catch{l.setupMapParameter(e)}}catch(l){i(l)}}catch(a){i(a)}else i("Fail to load map json")},s.send()})}async function ia(r){const t={};if(r.maptype==="mapbox"||r.maptype==="maplibre"||r.maptype==="google"||!r.enableCache)return;r.maptype==="base"||r.maptype==="overlay"?t.type="wmts":t.type="xyz",t.url=r.urls?r.urls:r.url,t.width=r.width,t.height=r.height,t.maxZoom=r.maxZoom,t.minZoom=r.minZoom;const e=r.envelopeLngLats;if(e){const n=e.reduce((s,o)=>(s[0]=s[0]>o[0]?o[0]:s[0],s[1]=s[1]o[1]?o[1]:s[2],s[3]=s[3]{t[s]=n[o]})}let i;try{i=await wi.registerMap(r.mapID,t)}catch{}return i}function na(r,t){return r+(Math.random()-.5)*t}function Ma(r,t){if(r instanceof Array)return r.map(i=>Ma(i,t));const e=Math.pow(10,t);return Math.round(r*e)/e}const Th={};var Ar={exports:{}},ra,Mh;function Cf(){if(Mh)return ra;Mh=1;var r=/<%=([\s\S]+?)%>/g;return ra=r,ra}var sa,Lh;function J0(){if(Lh)return sa;Lh=1;var r=Cf(),t="[object Null]",e="[object Symbol]",i="[object Undefined]",n=/[&<>"']/g,s=RegExp(n.source),o=/<%-([\s\S]+?)%>/g,a=/<%([\s\S]+?)%>/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,h=typeof self=="object"&&self&&self.Object===Object&&self,u=c||h||Function("return this")();function f(D,tt){for(var Q=-1,ot=D==null?0:D.length,ct=Array(ot);++Q1?N[Rt-1]:void 0,ke=Rt>2?N[2]:void 0;for(qt=w.length>3&&typeof qt=="function"?(Rt--,qt):void 0,ke&&Cl(N[0],N[1],ke)&&(qt=Rt<3?void 0:qt,Rt=1),S=Object(S);++gt-1&&w%1==0&&w0){if(++S>=n)return arguments[0]}else S=0;return w.apply(void 0,arguments)}}function Bf(w){if(w!=null){try{return q.call(w)}catch{}try{return w+""}catch{}}return""}function bo(w,S){return w===S||w!==w&&S!==S}var zf=De((function(){return arguments})())?De:function(w){return Sn(w)&&U.call(w,"callee")&&!z.call(w,"callee")},Rl=Array.isArray;function Ao(w){return w!=null&&Ml(w.length)&&!Tl(w)}var Uf=dt||Jf;function Il(w){if(!Sn(w))return!1;var S=Ft(w);return S==d||S==f||typeof w.message=="string"&&typeof w.name=="string"&&!Wf(w)}function Tl(w){if(!os(w))return!1;var S=Ft(w);return S==g||S==m||S==c||S==v}function Ml(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=o}function os(w){var S=typeof w;return w!=null&&(S=="object"||S=="function")}function Sn(w){return w!=null&&typeof w=="object"}function Wf(w){if(!Sn(w)||Ft(w)!=x)return!1;var S=X(w);if(S===null)return!0;var N=U.call(S,"constructor")&&S.constructor;return typeof N=="function"&&N instanceof N&&q.call(N)==j}function Xf(w){return typeof w=="symbol"||Sn(w)&&Ft(w)==I}var Yf=Ve?$i(Ve):wo;function Zf(w){return w==null?"":El(w)}var Ll=Lf(function(w,S,N,gt){Mf(S,Kf(S),w,gt)});function Vf(w){return Ao(w)?jt(w):xo(w)}function Kf(w){return Ao(w)?jt(w,!0):Eo(w)}function Hf(w,S,N){var gt=i.imports._.templateSettings||i;N&&Cl(w,S,N)&&(S=void 0),w=Zf(w),S=Ll({},S,gt,bl);var Rt=Ll({},S.imports,gt.imports,bl),qt=Vf(Rt),ke=E(Rt,qt),Ht,ri,Fe=0,Ol=S.interpolate||Yt,be="__p += '",Qf=RegExp((S.escape||Yt).source+"|"+Ol.source+"|"+(Ol===e?zt:Yt).source+"|"+(S.evaluate||Yt).source+"|$","g"),td=U.call(S,"sourceURL")?"//# sourceURL="+(S.sourceURL+"").replace(/[\r\n]/g," ")+` -`:"";w.replace(Qf,function(Dl,kl,ls,ed,Fl,Nl){return ls||(ls=ed),be+=w.slice(Fe,Nl).replace(Ut,A),kl&&(Ht=!0,be+=`' + -__e(`+kl+`) + -'`),Fl&&(ri=!0,be+=`'; -`+Fl+`; -__p += '`),ls&&(be+=`' + -((__t = (`+ls+`)) == null ? '' : __t) + -'`),Fe=Nl+Dl.length,Dl}),be+=`'; -`;var Co=U.call(S,"variable")&&S.variable;Co||(be=`with (obj) { -`+be+` -} -`),be=(ri?be.replace(B,""):be).replace(Bt,"$1").replace(Lt,"$1;"),be="function("+(Co||"obj")+`) { -`+(Co?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(Ht?", __e = _.escape":"")+(ri?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+be+`return __p -}`;var as=qf(function(){return Function(qt,td+"return "+be).apply(void 0,ke)});if(as.source=be,Il(as))throw as;return as}var qf=xl(function(w,S){try{return Ke(w,void 0,S)}catch(N){return Il(N)?N:new Error(N)}});function $f(w){return function(){return w}}function Pl(w){return w}function Jf(){return!1}r.exports=Hf})(Ar,Ar.exports)),Ar.exports}var tv=Q0();const Sf=E0(tv);function Oh(r,...t){const e=hi(Object.assign({},r));if(e.icon)return e;const i=t.reduce((n,s)=>{if(n)return n;const o=s.iconTemplate;if(o)return JSON.parse(Sf(o)(e));if(s.icon)return{icon:s.icon,selectedIcon:s.selectedIcon}},void 0);return i&&(e.icon=i.icon,e.selectedIcon=i.selectedIcon),e}function Dh(r,...t){return r=hi(r),r.html?r:t.reduce((e,i)=>{if(e)return e;const n=i.poiTemplate;if(n)return r.html=Sf(n)(r),r.poiStyle=r.poiStyle||i.poiStyle,r},void 0)||r}const se={ACCURACY:"accuracy",ALTITUDE:"altitude",ALTITUDE_ACCURACY:"altitudeAccuracy",HEADING:"heading",POSITION:"position",SPEED:"speed",TRACKING:"tracking",TRACKING_OPTIONS:"trackingOptions"},ev={ERROR:"error"};class iv extends Me{constructor(e){super(ev.ERROR);T(this,"code");T(this,"message");this.code=e.code,this.message=e.message}}class nv extends ni{constructor(e){super();T(this,"task_id_");T(this,"timer_base_",!1);T(this,"home_position_",!1);e=e||{},this.timer_base_=e.timerBase!==void 0?e.timerBase:!1,this.task_id_=void 0,this.home_position_=e.homePosition!==void 0?e.homePosition:!1,this.addChangeListener(se.TRACKING,this.handleTrackingChanged_),e.trackingOptions!==void 0?this.setTrackingOptions(e.trackingOptions):this.setTrackingOptions({enableHighAccuracy:!0,timeout:5e3,maximumAge:1e3}),this.setTracking(e.tracking!==void 0?e.tracking:!1)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleTrackingChanged_(){if(this.timer_base_){const e=this.getTracking(),i=this.getTrackingOptions();e&&this.task_id_===void 0?window.confirm("Allow GPS?")?this.task_id_=setInterval(this.timerPositionChange_.bind(this),i.maximumAge):setTimeout(this.timerPositionError_.bind(this),i.maximumAge*10):!e&&this.task_id_!==void 0&&(clearInterval(this.task_id_),this.task_id_=void 0)}else if("geolocation"in navigator){const e=this.getTracking();e&&this.task_id_===void 0?this.task_id_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.task_id_!==void 0&&(navigator.geolocation.clearWatch(this.task_id_),this.task_id_=void 0)}}timerPositionChange_(){const e={longitude:na(this.home_position_[0],.05),latitude:na(this.home_position_[1],.05),accuracy:na(15,10)};this.positionChange_({coords:e})}positionChange_(e){const i=e.coords;this.set(se.ACCURACY,i.accuracy),this.set(se.ALTITUDE,i.altitude===null?void 0:i.altitude),this.set(se.ALTITUDE_ACCURACY,i.altitudeAccuracy===null?void 0:i.altitudeAccuracy),this.set(se.HEADING,i.heading===null?void 0:Ei(i.heading)),this.set(se.POSITION,[i.longitude,i.latitude]),this.set(se.SPEED,i.speed===null?void 0:i.speed),this.changed()}timerPositionError_(){const e=Math.floor(Math.random()*3)+1,i={code:e,message:e===1?"User denied Geolocation":e===2?"Position unavailable":"Timeout expired"};this.positionError_(i)}positionError_(e){const i=new iv(e);this.dispatchEvent(i)}getAccuracy(){return this.get(se.ACCURACY)}getAltitude(){return this.get(se.ALTITUDE)}getAltitudeAccuracy(){return this.get(se.ALTITUDE_ACCURACY)}getHeading(){return this.get(se.HEADING)}getPosition(){return this.get(se.POSITION)}getSpeed(){return this.get(se.SPEED)}getTracking(){return this.get(se.TRACKING)}getTrackingOptions(){return this.get(se.TRACKING_OPTIONS)}setTracking(e){this.set(se.TRACKING,e)}setTrackingOptions(e){this.set(se.TRACKING_OPTIONS,e)}}const Rf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjcyNTIxMjZFMDJBMTExRTBCOTNGRTVBRkM1QzM1Qjc5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjcyNTIxMjZGMDJBMTExRTBCOTNGRTVBRkM1QzM1Qjc5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NzI1MjEyNkMwMkExMTFFMEI5M0ZFNUFGQzVDMzVCNzkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzI1MjEyNkQwMkExMTFFMEI5M0ZFNUFGQzVDMzVCNzkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4RaveOAAAB1UlEQVR42qzUTyikcRzH8d+OsUNbSOTvgW2LREqjHKSk9FjZxAGXlXJQDsqNokRzcebiRC5mT8tllBE7LlzYKBHFJpKMkD+7hvH+6ftMT4M0Y3/1uswzz+d5nu/3+/t9CAaD6n8uu/L5lHK5XroWjwI4kYWP8GMdv3H47A6nk8CDA6U8nvBLX/Ed+TjDEe7lAS24wE+M4zR0180NgXa7NSgOvajHKvqwZglMxBfUoBmVlv/wTXxU0O1WuoqIgQvLaIJDfn9NISbhRd7Tb4ahbJa3a0QthjCFv2/UfwNduJKv0jUOBSajDb8wE0FTdf1GUAzDGliOdExEMSleedsGxJiBZdiVC5GuABbxGZm2p1lUKg1/dOOjnGf9IglIsUkxY3H+jg1yIc136MBb6WjqOwLNe6904AP2kSuDG80qkW15YjZlCdkojSLsEyqwiWMzcAVbaJV6RrK+IQc/dB3NwGuMohAdEYQVoROz8FkHW68FCW1Hv4zS68eeUnWyS/YwLL1Q9rA/jsn4dEtd5mRo9WlzJ03Tda6S7TaPQWmIPCkQCH+6Ww5RfR5WowmX+IckOca2MYBp2SmW8zCb5hpGeKjuWA8yZEulSbP8sqN2JPjZif0owACin4C7wCjG6AAAAABJRU5ErkJggg==",If="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAwCAYAAAALiLqjAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAHkUlEQVR42oyWa6hdRxXHf2tm9j77PHLuq2kak+bRmlKbhpi0FBsqiBRaBJUqFEqlIq2I3xUEafGDilgfn0QQtEWwxS9+0SoVSwsVX8TU2kdsWpM0pm1y0/s+955z9p5Zyw/7pM3t65yBYTPDrPXf/7X+s9bIdGOGiyMhTMchNxc5L053CVXs3qKrn6CR3XrANQ7PrpybrbzzC1t3Lx7rLT+/NoiPr7Rnn2yFsLBw7jynVbm+sQWQt3wG3jFMYB3HDtE77vJLX7u9Wd4869ZkmGDYgVIT1dpJPuP42HLT3/eU2rFn2fqDs+YeVRQB7BJ/QS9ZRYyhke2z4Te+Kr37rymGWVXCcAOSgGtABtgQBg4aJG4La4f39weP9MTfMG/+/gR9fwmA39Fu0wpCEWBbs8WtOvz2A93eA7vz5NdWoVwKqGyBWCC9iHrDGpAiDBR6CVooH23EI8OS6XnX/r1IzcIAv7PdIXeCieNwIfc92F77/lymrK4B/Tb+wCHCLUfw+/YhFuDcAuQJ8xAVKoP1BMHDwUxv+pdlvaeD++u8GG84w7ezjA1NhCru/Lpb+9nBUM0tRZA1wV/5YcKdd5B/8R7CTTdiWiEn/4etLKFN0AilwNCgV8FcDlul2v90yh/ru2zBi+CWBwMWyorrm+5zR0K5b7ECM8AcMjuDv+5awqHD+MM34PddA1PTkKTWiYBYrRkTWKrgQEg7Pt7wd/sUcdUQt1QO6ZfD5qebclflaroJwCmsrWH/PYm9/BLpxEvo6dP1nhhmozhLPVVgmCAp3Mb653u9pe58b5Uwk7eZJu7ZN1w6uA7EBCEDaxrp1ZPIb/+AnTmDVZH0zHPY+bPQhmT1VAEFTGulDRR2uPVrrpqa27/o87+FmW6ncbnF7UNfZcOoKBBLiAWgPTj6d9ILLwKG9VdJzZKYQRxCCZRWJxupQxUNYnBud9HeW7j8dLBmq0kqW1VC+tTaCgauBGuB5gNkOMAEmK7DN6xgAAwVBlIDIeAM1MAQaTpfdEPWCK+t9ntQrqRCrbT6DzCwBNkAcg+uGJUShSpBqbBBPUutw+RHdpkDb2YXynJ5vmItlP21OG/xlOVhxYhzpdZ/ET3kBnkEN7qVCgxHYRmOQIajehOk1kVDYbXSjVOD1eMrPl9wlOtsqJ092rnij61QexkqrCusGSwDq5fMnkEP6MnIuUDuwEdoJOgIHLf2sQv9wSvrq0v4DxVNcu9Z7g+Gt/p0ZzeaG1RQyegSUV+kvkGf+luO5BmAQsGXUESYA1aa2I9l6pu9ovvsTKuNb7WnkZAx7/IzUw134ydDuU/XBaJgcaQMqSWYRmHKgDxBUUGjglwzptRxWaH82hVPP6HFtwqx0mP4RmcKdZ7oXHzdF8e3p+r2AxqnC9cka3RoqFBUUFRKUUK7gnYlFDHQylp0ujPMZAWX2QZPey48nDpfiSKvNFTJVAmzZclInWjlnvlJGb5UBh75LOUV3fY0/ZntpODRskJThXiPz3Jc0STLM9qLy2Svn+Z3Li0+GLN7K+HPMxbfLtc7Q0FmRm6GqLIR0+ljvnhqo5sf2ttb2LFNAzMz0+Tbt9PatZfujl205maYS0rz3DkuzJ/iN7l//rul+8Ip5U/bfLapgQW9dCVCBqi4fz7W7H7qNHrP4Wrh3gMn3tx1tcs7a1MFzjm6vchzabD+iqteezwvfvl6Z/YXtvHmG6GuYpsB3tUyAQ80TN+8kBU/eijx0/PD8tq7d84+9Kkj+w+qc/z8L8//+1dn17/8kW54QX2+7kzxmzrx28PxASM3o6HaXyoazxy97tDLN37vYW764aMcPXzLicX2ln80kq43zJD3dP0+DGoahsMYYFStabbkJp1+r0N/AzGjs7Ha2dKdknUKS+WQwhQxex8AkU05EBGqosGiazAfcvri8VUfQg6zM1iWgTiyFHm12SWESMeU9e4WZHkVk81sQn/bzLuSYA76CLg6rkmEKsvRRgNEiAgpKaRIRFgUj+tOM9XpsvROBubeO37yjsXFVwKmmGrdV+veirPN5zYDvE/sNpMyVFPtGFDTulW+lwTflYMJAMQMU6OK9VlTq5M6gW3AlPEUDDNFUxotL4ZovG1Qk7GH1AQziHoRoN6bxDbIeJaI1WEpy+qSENX74wEmOFWfMcqY3sqmiDGJbUgTJCqZkZKRhnUHSmr13iRJvii9D06CopaIWtd5TQlUmcQ2IH48gPOYCVWM4KwuBy4wiW1wjKfpAIdSVRHEcKY46oI4XqZpPE1NSkpKVVUwqkM6muMBmCAF1A/dOHKYDK8gyngKAUkTXISEkYhlHIk0JSTZJLZBzU9QKTxJHWWMozeqw8wziW0QnazYSVKqEQNJdQebxDaImwDAGTglXXzvOEWcMYltMB1fsEwdmoRUpZGqBFPHJLYBJxNcNAGHxpRqSQlqTrAJbMOF82+MPVTFyJ49V4WyTIgDw8LChfOEECYodjqBTKGLsK3fH+CcgHE50FXVlbEAO3dsHyNRwznZtXfPlbtOnHiJVFVcvnV2z1VX794FPDcWIG8UkwD8xzm7/+D+3Q8sLCyEJ584853gs+POubHU/z8AvZAksib10AQAAAAASUVORK5CYII=",rv={osm:Ef,gsi:bf,gsi_ortho:Af,redcircle:Rf,defaultpin_selected:If,defaultpin:yl,bluedot:mf,bluedot_transparent:pf,bluedot_small:_f};class sv extends Me{constructor(e){super("gps_error");T(this,"detail");this.detail=e}}class Ts extends Me{constructor(e){super("gps_result");T(this,"detail");this.detail=e}}class ov extends Me{constructor(){super("gps_request")}}class Zi extends ts{constructor(e){super();T(this,"appid");T(this,"translateUI",!1);T(this,"noRotate",!1);T(this,"initialRestore",{});T(this,"mapDiv","map_div");T(this,"restoreSession",!1);T(this,"enableCache");T(this,"stateBuffer",{});T(this,"mobileMapMoveBuffer");T(this,"overlay",!0);T(this,"waitReady");T(this,"changeMapSeq");T(this,"i18n");T(this,"t");T(this,"lang");T(this,"appData");T(this,"appLang","ja");T(this,"backMap");T(this,"mercSrc");T(this,"mercBuffer");T(this,"timer");T(this,"appName");T(this,"cacheHash");T(this,"currentPosition");T(this,"startFrom","");T(this,"from");T(this,"vectors",[]);T(this,"mapDivDocument");T(this,"mapObject");T(this,"mapboxMap");T(this,"maplibreMap");T(this,"googleApiKey");T(this,"pois");T(this,"poiTemplate");T(this,"poiStyle");T(this,"iconTemplate");T(this,"logger");T(this,"icon");T(this,"selectedIcon");T(this,"fakeGps",!1);T(this,"fakeRadius");T(this,"homePosition");T(this,"geolocation");T(this,"moveTo_",!1);T(this,"gpsEnabled_",!1);T(this,"alwaysGpsOn",!1);T(this,"firstGpsRequest_",!1);T(this,"__backMapMoving",!1);T(this,"__selectedMarker");T(this,"__init",!0);T(this,"__redrawMarkerBlock",!1);T(this,"__redrawMarkerThrottle",[]);T(this,"__transparency");T(this,"lastClickEvent");e=hi(e),this.appid=e.appid||"sample";const i=e.mapboxgl||(typeof window<"u"?window.mapboxgl:void 0);i&&e.mapboxToken&&(i.accessToken=e.mapboxToken),e.googleApiKey&&(this.googleApiKey=e.googleApiKey),this.mapDiv=e.div||"map_div",this.mapDivDocument=document.querySelector(`#${this.mapDiv}`),this.mapDivDocument.classList.add("maplat"),this.logger=new rg(e.debug?Cr.ALL:Cr.INFO),this.enableCache=e.enableCache||!1,this.icon=e.icon,this.selectedIcon=e.selectedIcon,this.translateUI=e.translateUI;const n=e.setting;if(this.lang=e.lang,this.lang||(this.lang=ig()),(this.lang.toLowerCase()=="zh-hk"||this.lang.toLowerCase()=="zh-hant")&&(this.lang="zh-TW"),e.restore)e.restoreSession&&(this.restoreSession=!0),this.initialRestore=e.restore;else if(e.restoreSession){this.restoreSession=!0;const a=parseInt(localStorage.getItem("epoch")||"0"),l=Math.floor(new Date().getTime()/1e3);a&&l-a<3600&&(this.initialRestore.mapID=localStorage.getItem("mapID")||localStorage.getItem("sourceID")||void 0,this.initialRestore.backgroundID=localStorage.getItem("backgroundID")||localStorage.getItem("backID")||void 0,this.initialRestore.position={x:parseFloat(localStorage.getItem("x")||"0"),y:parseFloat(localStorage.getItem("y")||"0"),zoom:parseFloat(localStorage.getItem("zoom")||"0"),rotation:parseFloat(localStorage.getItem("rotation")||"0")},this.initialRestore.transparency=parseFloat(localStorage.getItem("transparency")||"0"),this.initialRestore.hideMarker=parseInt(localStorage.getItem("hideMarker")||"0"),this.initialRestore.hideLayer=localStorage.getItem("hideLayer")||void 0)}const s=hr(``);for(let a=s.length-1;a>=0;a--)this.mapDivDocument.insertBefore(s[a],this.mapDivDocument.firstChild);const o=this.mapDivDocument.querySelectorAll(".prevent-default");for(let a=0;a{c.preventDefault()});this.overlay="overlay"in e?e.overlay:!0,this.overlay&&this.mapDivDocument.classList.add("with-opacity"),this.waitReady=this.settingLoader(n).then(a=>this.handleSetting(a,e))}async settingLoader(e){return e||new Promise((i,n)=>{const s=new XMLHttpRequest;s.open("GET",`apps/${this.appid}.json`,!0),s.responseType="json",s.onload=function(o){let a=this.response;typeof a!="object"&&(a=JSON.parse(a)),i(a)},s.send()})}async i18nLoader(){return new Promise((e,i)=>{const n=Object.keys(Th).length!=0;(this.translateUI&&!n?ce.use(Uh):ce).init({lng:this.lang,fallbackLng:["en"],backend:{loadPath:"assets/locales/{{lng}}/{{ns}}.json"},resources:n?Th:void 0},(o,a)=>{e([a,ce])})})}async sourcesLoader(e){const i=this.appData.sources,n=[],s={homePos:e.homePos,defZoom:e.defZoom,zoomRestriction:e.zoomRestriction,mercMinZoom:e.mercMinZoom,mercMaxZoom:e.mercMaxZoom,enableCache:this.enableCache,key:this.googleApiKey,translator:o=>this.translate(o),mapboxMap:this.mapboxMap,maplibreMap:this.maplibreMap};for(let o=0;othis.handleI18n(n,i)).then(()=>this.initGeolocation(i))}initGeolocation(e){this.alwaysGpsOn=e.alwaysGpsOn||!1;const i=this.geolocation=new nv({timerBase:e.fake,homePosition:this.appData.homePosition});this.alwaysGpsOn?(i.setTracking(!0),this.gpsEnabled_=!0):(i.setTracking(!1),this.gpsEnabled_=!1),i.on("change",()=>{const n=this.mapObject,s=n.getLayer("overlay").getLayers().item(0),o=n.getLayers().item(0),a=s?s.getSource():o.getSource(),l=i.getPosition(),c=i.getAccuracy();!l||!c||a.setGPSMarkerAsync({lnglat:l,acc:c},!this.moveTo_&&!this.firstGpsRequest_).then(h=>{if(this.moveTo_=!1,this.firstGpsRequest_=!1,!h){if(!this.alwaysGpsOn){this.handleGPS(!1,!1);return}a.setGPSMarker()}this.dispatchEvent(new Ts(h?{lnglat:l,acc:c}:{error:"gps_out"}))})}),i.on("error",n=>{const s=n.code;if(s===3)return;i.setTracking(!1),this.gpsEnabled_=!1;const o=this.mapObject,a=o.getLayer("overlay").getLayers().item(0),l=o.getLayers().item(0);(a?a.getSource():l.getSource()).setGPSMarker(),this.dispatchEvent(new sv(s===1?"user_gps_deny":s===2?"gps_miss":"gps_timeout")),this.dispatchEvent(new Ts({error:"gps_off"}))}),this.addEventListener("mapChanged",()=>{if(i.getTracking()){const n=this.mapObject,s=n.getLayer("overlay").getLayers().item(0),o=n.getLayers().item(0),a=s?s.getSource():o.getSource(),l=i.getPosition(),c=i.getAccuracy();if(!l||!c)return;a.setGPSMarkerAsync({lnglat:l,acc:c},!0).then(h=>{if(!h){if(!this.alwaysGpsOn){this.handleGPS(!1,!1);return}a.setGPSMarker()}this.dispatchEvent(new Ts(h?{lnglat:l,acc:c}:{error:"gps_out"}))})}})}handleGPS(e,i=!1){if(this.geolocation){if(e)if(!this.alwaysGpsOn)this.firstGpsRequest_=!0,this.geolocation.setTracking(!0),this.gpsEnabled_=!0,this.dispatchEvent(new ov);else{this.moveTo_=!0;const n=this.geolocation.getPosition(),s=this.geolocation.getAccuracy();if(n&&s){const o=this.mapObject,a=o.getLayer("overlay").getLayers().item(0),l=o.getLayers().item(0),c=a?a.getSource():l.getSource();c.setGPSMarkerAsync({lnglat:n,acc:s},!1).then(h=>{h||c.setGPSMarker()})}}else if(!this.alwaysGpsOn){this.geolocation.setTracking(!1),this.gpsEnabled_=!1;const n=this.mapObject,s=n.getLayer("overlay").getLayers().item(0),o=n.getLayers().item(0);(s?s.getSource():o.getSource()).setGPSMarker(),i||this.dispatchEvent(new Ts({error:"gps_off"}))}}}getGPSEnabled(){return this.gpsEnabled_}handleI18n(e,i){e||(e=[()=>"",{}]),this.i18n=e[1],this.t=e[0];const n=this.prepareMap(i);return su(this.appData.pois||[],this).then(s=>this.handlePois(s,n))}prepareMap(e){e=hi(e),this.mercBuffer=null;const i=this.appData.homePosition,n=this.appData.defaultZoom,s=this.appData.zoomRestriction,o=this.appData.minZoom,a=this.appData.maxZoom;this.appName=this.appData.appName;const l=e.fake?this.appData.fakeGps:!1,c=e.fake?this.appData.fakeRadius:!1;this.appLang=this.appData.lang||"ja",this.noRotate=e.noRotate||this.appData.noRotate||!1,this.poiTemplate=e.poiTemplate||this.appData.poiTemplate||!1,this.poiStyle=e.poiStyle||this.appData.poiStyle||!1,this.iconTemplate=e.iconTemplate||this.appData.iconTemplate||!1,this.currentPosition=null,this.__init=!0,this.dispatchEvent(new Ae("uiPrepare"));const h=`${this.mapDiv}_front`;let u=hr(`
`)[0];this.mapDivDocument.insertBefore(u,this.mapDivDocument.firstChild),this.fakeGps=l,this.fakeRadius=c,this.homePosition=i,this.mapObject=new Zr({div:h,controls:this.appData.controls||[],interactions:this.noRotate?Sa({altShiftDragRotate:!1,pinchRotate:!1}):Sa().extend([new P0({condition:Ay})]),fakeGps:l,fakeRadius:c,homePosition:i,northUp:e.northUp||this.appData.northUp||!1,tapDuration:e.tapDuration||this.appData.tapDuration||3e3,homeMarginPixels:e.homeMarginPixels||this.appData.homeMarginPixels||50,tapUIVanish:e.tapUIVanish||this.appData.tapUIVanish||!1,alwaysGpsOn:e.alwaysGpsOn||!1});let f=null;this.overlay&&(f=`${this.mapDiv}_back`,u=hr(`
`)[0],this.mapDivDocument.insertBefore(u,this.mapDivDocument.firstChild),this.backMap=new Zr({off_control:!0,div:f}));const d=e.mapboxgl||(typeof window<"u"?window.mapboxgl:void 0);if(d){const m=`${this.mapDiv}_mapbox`;u=hr(``)[0],this.mapDivDocument.insertBefore(u,this.mapDivDocument.firstChild),this.mapboxMap=new d.Map({attributionControl:!1,boxZoom:!1,container:m,doubleClickZoom:!1,dragPan:!1,dragRotate:!1,interactive:!1,keyboard:!1,pitchWithRotate:!1,scrollZoom:!1,touchZoomRotate:!1})}const g=e.maplibregl||(typeof window<"u"?window.maplibregl:void 0);if(g){const m=`${this.mapDiv}_maplibre`;u=hr(``)[0],this.mapDivDocument.insertBefore(u,this.mapDivDocument.firstChild),this.maplibreMap=new g.Map({attributionControl:!1,boxZoom:!1,container:m,doubleClickZoom:!1,dragPan:!1,dragRotate:!1,interactive:!1,keyboard:!1,pitchWithRotate:!1,scrollZoom:!1,touchZoomRotate:!1,style:{version:8,sources:{},layers:[]}})}return this.startFrom=this.appData.startFrom,{homePos:i,defZoom:n,zoomRestriction:s,mercMinZoom:o,mercMaxZoom:a}}handlePois(e,i){return this.pois=e,this.sourcesLoader(i).then(n=>this.handleSources(n))}async handleSources(e){this.mercSrc=e.reduce((n,s)=>{if(n)return n;if(s.isBasemap())return s},null);const i=[];this.cacheHash={};for(let n=0;nn?!(n instanceof yf)&&s.mapID!=i?s:n:s.mapID!=i?s:n,void 0),await this.changeMap(i,this.initialRestore)}setMapClick(){this.mapObject.on("click",e=>{this.logger.debug(e.pixel),this.lastClickEvent=e;const i=[];if(e.target.forEachFeatureAtPixel(e.pixel,n=>{this.logger.debug(e.pixel),n.get("datum")&&i.push(n.get("datum"))}),i.length>0)this.dispatchEvent(new Ae("clickMarker",i[0])),this.dispatchEvent(new Ae("clickMarkers",i));else{const n=e.coordinate;this.dispatchEvent(new Ae("clickMapXy",n)),this.from.sysCoord2MercAsync(n).then(s=>{this.dispatchEvent(new Ae("clickMapMerc",s));const o=fe(s,"EPSG:3857","EPSG:4326");this.dispatchEvent(new Ae("clickMap",{longitude:o[0],latitude:o[1]}))})}})}setPointerEvents(){let e,i=!1,n=!1;const s={},o=a=>{this.dispatchEvent(new Ae("pointerMoveOnMapXy",a)),this.from.sysCoord2MercAsync(a).then(l=>{if(this.dispatchEvent(new Ae("pointerMoveOnMapMerc",l)),e){const c=e;e=!1,o(c)}else i=!1})};this.mapObject.on("pointermove",a=>{n||(i?e=a.coordinate:(i=!0,o(a.coordinate)))}),this.mapObject.on("pointerdown",a=>{a.originalEvent&&a.originalEvent.pointerId!=null&&(s[a.originalEvent.pointerId]=!0),n=!0}),this.mapObject.on("pointerdrag",a=>{a.originalEvent&&a.originalEvent.pointerId!=null&&(s[a.originalEvent.pointerId]=!0),n=!0}),this.mapObject.on("pointerup",a=>{a.originalEvent&&a.originalEvent.pointerId!=null?(delete s[a.originalEvent.pointerId],Object.keys(s).length==0&&(n=!1)):a.originalEvent&&a.originalEvent.touches?a.originalEvent.touches.length==0&&(n=!1):n=!1})}setMapOnOff(){let e;this.mapObject.on("click",()=>{e&&(clearTimeout(e),e=void 0);const i=this.mapDivDocument.querySelectorAll(".ol-control");if(!this.mapObject.tapUIVanish||i.length&&i[0].classList.contains("fade"))for(let n=0;n{e=void 0;const n=this.mapDivDocument.querySelectorAll(".ol-control");for(let s=0;s{e&&(clearTimeout(e),e=void 0);const i=this.mapDivDocument.querySelectorAll(".ol-control");for(let n=0;n{e&&(clearTimeout(e),e=void 0),e=setTimeout(()=>{e=void 0;const i=this.mapDivDocument.querySelectorAll(".ol-control");for(let n=0;n{const s=n.target.getEventPixel(n.originalEvent),o=n.target.hasFeatureAtPixel(s),a=n.target.getTarget();if(o){const l=n.target.forEachFeatureAtPixel(n.pixel,c=>{if(c.get("datum"))return c});this.mapDivDocument.querySelector(`#${a}`).style.cursor=l?"pointer":"";return}this.mapDivDocument.querySelector(`#${a}`).style.cursor=""};this.mapObject.on("pointermove",e);const i=n=>{let s=n.frameState.viewState.center;const o=this.from;o.insideCheckSysCoord(s)||(s=o.modulateSysCoordInside(s),n.target.getView().setCenter(s))};this.mapObject.on("moveend",i)}setBackMapBehavior(){const e=i=>{if(!this.backMap)return;if(this.__backMapMoving){this.logger.debug("Backmap moving skipped");return}const n=this.backMap.getSource();n&&(this.__backMapMoving=!0,this.logger.debug("Backmap moving started"),this.convertParametersFromCurrent(n,s=>{const o=this.backMap.getView();o.setCenter(s[0]),o.setZoom(s[1]),o.setRotation(this.noRotate?0:s[2]),this.logger.debug("Backmap moving ended"),this.__backMapMoving=!1}))};this.mapObject.on("postrender",e)}raiseChangeViewpoint(){this.mapObject.on("postrender",async e=>{const i=this.mapObject.getView(),n=i.getCenter(),s=i.getDecimalZoom(),o=Tc(i.getRotation()*180/Math.PI),a=await this.from.viewpoint2MercsAsync(),l=await this.mercSrc.mercs2ViewpointAsync(a);if(this.mobileMapMoveBuffer&&this.mobileMapMoveBuffer[0][0]==l[0][0]&&this.mobileMapMoveBuffer[0][1]==l[0][1]&&this.mobileMapMoveBuffer[1]==l[1]&&this.mobileMapMoveBuffer[2]==l[2])return;this.mobileMapMoveBuffer=l;const c=fe(l[0],"EPSG:3857","EPSG:4326"),h=Tc(l[2]*180/Math.PI);this.dispatchEvent(new Ae("changeViewpoint",{x:n[0],y:n[1],longitude:c[0],latitude:c[1],mercator_x:l[0][0],mercator_y:l[0][1],zoom:s,mercZoom:l[1],direction:h,rotation:o})),this.requestUpdateState({position:{x:n[0],y:n[1],zoom:s,rotation:o}})})}currentMapInfo(){return Mc(this.from)}mapInfo(e){return Mc(this.cacheHash[e])}async clientPointToLngLat(e,i){if(!this.from||!this.mapObject)return;const s=this.mapObject.getViewport().getBoundingClientRect(),o=[e-s.left,i-s.top],a=this.mapObject.getCoordinateFromPixel(o);if(!a)return;const l=await this.from.sysCoord2MercAsync(a),c=fe(l,"EPSG:3857","EPSG:4326");return{longitude:c[0],latitude:c[1]}}async lngLatToClientPoint(e,i){if(!this.from||!this.mapObject)return;const n=fe([e,i],"EPSG:4326","EPSG:3857"),s=await this.from.merc2SysCoordAsync(n),o=this.mapObject.getPixelFromCoordinate(s);if(!o)return;const a=this.mapObject.getViewport().getBoundingClientRect();return{x:o[0]+a.left,y:o[1]+a.top}}setMarker(e){this.logger.debug(e);const i=e.lnglat||[e.lng||e.longitude,e.lat||e.latitude],n=e.x,s=e.y,o=e.coordinates,a=this.from,l=e.icon?this.__selectedMarker==e.namespaceID&&e.selectedIcon?e.selectedIcon:e.icon:this.__selectedMarker==e.namespaceID?If:yl;return(o?(function(){return a.merc2SysCoordAsync_ignoreBackground(o)})():n&&s?new Promise(h=>{h(a.xy2SysCoord([n,s]))}):(function(){const h=fe(i,"EPSG:4326","EPSG:3857");return a.merc2SysCoordAsync_ignoreBackground(h)})()).then(h=>{h&&a.insideCheckSysCoord(h)&&this.mapObject.setMarker(h,{datum:e},l)})}resetMarker(){this.mapObject.resetMarker()}setLine(e){e.type="Line",!e.style&&e.stroke&&(e.style={stroke:e.stroke}),this.setVector(e)}setVector(e){this.logger.debug(e);let i;const n=(s,o=!1)=>Promise.all(s.map(a=>Array.isArray(a[0])?n(a,o):(o&&(a=fe(a,"EPSG:4326","EPSG:3857")),this.from.merc2SysCoordAsync(a))));e.coordinates?i=n(e.coordinates):i=n(e.lnglats,!0),i.then(s=>{this.mapObject.setVector(s,e.type,e.style)})}resetLine(){this.resetVector()}resetVector(){this.mapObject.resetVector()}redrawMarkers(e=void 0){if(e||(e=this.from),this.__redrawMarkerBlock){this.__redrawMarkerThrottle||(this.__redrawMarkerThrottle=[]);const n=this.__redrawMarkerThrottle;if(n.length==0||n[n.length-1]!==e){n.push(e);return}}this.__redrawMarkerBlock=!0;const i=n=>{const s=[];this.resetMarker();let o;this.stateBuffer.hideMarker||(Object.keys(this.pois).map(l=>{const c=this.pois[l];c.hide||c.pois.map(h=>{const u=Oh(h,c,this);Dh(u,c,this),this.__selectedMarker==u.namespaceID?o=u:s.push(this.setMarker(u))})}),n.pois&&Object.keys(n.pois).map(l=>{const c=n.pois[l];c.hide||c.pois.map(h=>{const u=Oh(h,c,n,this);Dh(u,c,n,this),this.__selectedMarker==u.namespaceID?o=u:s.push(this.setMarker(u))})}));let a=Promise.all(s);o&&(a=a.then(()=>this.setMarker(o))),a.then(()=>{this.__redrawMarkerThrottle&&this.__redrawMarkerThrottle.length>0?i(this.__redrawMarkerThrottle.shift()):this.__redrawMarkerBlock=!1})};i(e)}selectMarker(e){const i=this.getMarker(e);if(!i)return;this.__selectedMarker=e;const n={latitude:i.lnglat?i.lnglat[1]:i.lat?i.lat:i.latitude,longitude:i.lnglat?i.lnglat[0]:i.lng?i.lng:i.longitude};this.setViewpoint(n),this.redrawMarkers()}unselectMarker(){delete this.__selectedMarker,this.redrawMarkers()}getMarker(e){if(e.indexOf("#")<0){let i;return Object.keys(this.pois).map(n=>{this.pois[n].pois.map((s,o)=>{s.id==e&&(i=this.pois[n].pois[o])})}),i}else{const i=e.split("#"),n=this.cacheHash[i[0]];if(n)return n.getPoi(i[1])}}updateMarker(e,i,n){const s=this.getMarker(e);s&&(i=Lr(i||{}),n?(Object.keys(s).map(o=>{o!="id"&&o!="namespaceID"&&delete s[o]}),Object.assign(s,i)):Object.keys(i).map(o=>{o=="id"||o=="namespaceID"||(i[o]=="____delete____"?delete s[o]:s[o]=i[o])}),this.redrawMarkers())}addMarker(e,i){if(i||(i="main"),i.indexOf("#")<0){if(this.pois[i])return this.pois[i].pois.push(Lr(e)),Wa(this.pois,i,{name:this.appName}),this.dispatchPoiNumber(),this.redrawMarkers(),e.namespaceID}else{const n=i.split("#"),s=this.cacheHash[n[0]];if(s){const o=s.addPoi(e,n[1]);return this.dispatchPoiNumber(),this.redrawMarkers(),o}}}removeMarker(e){if(e.indexOf("#")<0)Object.keys(this.pois).map(i=>{this.pois[i].pois.map((n,s)=>{n.id==e&&(delete this.pois[i].pois[s],this.dispatchPoiNumber(),this.redrawMarkers())})});else{const i=e.split("#"),n=this.cacheHash[i[0]];n&&(n.removePoi(i[1]),this.dispatchPoiNumber(),this.redrawMarkers())}}clearMarker(e){if(e||(e="main"),e.indexOf("#")<0){if(e=="all")Object.keys(this.pois).map(i=>{this.pois[i].pois=[]});else if(this.pois[e])this.pois[e].pois=[];else return;this.dispatchPoiNumber(),this.redrawMarkers()}else{const i=e.split("#"),n=this.cacheHash[i[0]];n&&(n.clearPoi(i[1]),this.dispatchPoiNumber(),this.redrawMarkers())}}showAllMarkers(){this.requestUpdateState({hideMarker:0}),this.redrawMarkers()}hideAllMarkers(){this.requestUpdateState({hideMarker:1}),this.redrawMarkers()}dispatchPoiNumber(){this.dispatchEvent(new Ae("poi_number",this.listPoiLayers(!1,!0).reduce((e,i)=>e+i.pois.length,0)))}listPoiLayers(e=!1,i=!1){const n=Object.keys(this.pois).sort((o,a)=>o=="main"?-1:a=="main"?1:oa?1:0).map(o=>this.pois[o]).filter(o=>i?e?o.pois.length&&o.hide:o.pois.length:e?o.hide:!0),s=this.from.listPoiLayers(e,i);return n.concat(s)}showPoiLayer(e){const i=this.getPoiLayer(e);i&&(delete i.hide,this.requestUpdateState({hideLayer:this.listPoiLayers(!0).map(n=>n.namespaceID).join(",")}),this.redrawMarkers())}hidePoiLayer(e){const i=this.getPoiLayer(e);i&&(i.hide=!0,this.requestUpdateState({hideLayer:this.listPoiLayers(!0).map(n=>n.namespaceID).join(",")}),this.redrawMarkers())}getPoiLayer(e){if(e.indexOf("#")<0)return this.pois[e];{const i=e.split("#"),n=this.cacheHash[i[0]];if(n)return n.getPoiLayer(i[1])}}addPoiLayer(e,i){if(e!="main"&&!this.pois[e])if(e.indexOf("#")<0)this.pois[e]=rn(i||[],e,{name:this.appName}),this.redrawMarkers();else{const n=e.split("#"),s=this.cacheHash[n[0]];s&&(s.addPoiLayer(n[1],i),this.redrawMarkers())}}removePoiLayer(e){if(e!="main"&&this.pois[e])if(e.indexOf("#")<0)delete this.pois[e],this.requestUpdateState({hideLayer:this.listPoiLayers(!0).map(i=>i.namespaceID).join(",")}),this.dispatchPoiNumber(),this.redrawMarkers();else{const i=e.split("#"),n=this.cacheHash[i[0]];n&&(n.removePoiLayer(i[1]),this.requestUpdateState({hideLayer:this.listPoiLayers(!0).map(s=>s.namespaceID).join(",")}),this.dispatchPoiNumber(),this.redrawMarkers())}}addLine(e){this.vectors.push(e),this.setLine(e)}addVector(e){this.vectors.push(e),this.setVector(e)}clearLine(){this.vectors=[],this.resetLine()}clearVector(){this.vectors=[],this.resetVector()}setGPSMarker(e){this.currentPosition=e,this.from.setGPSMarker(e,!0)}changeMap(e,i){i===void 0&&(i={});const n=this.mercSrc,s=this.cacheHash[e];return this.changeMapSeq||(this.changeMapSeq=Promise.resolve()),this.changeMapSeq=this.changeMapSeq.then(()=>new Promise((o,a)=>{this.convertParametersFromCurrent(s,l=>{let c=null,h=null;const u=i.backgroundID?this.cacheHash[i.backgroundID]:void 0;if(this.backMap&&(c=this.backMap.getSource(),s.isWmts()?this.backMap.exchangeSource():(u?(h=u,this.backMap.exchangeSource(h)):c?h=c:(h=n,this.from.isWmts()&&(h=this.from instanceof Vr?this.mapObject.getSource():this.from),this.backMap.exchangeSource(h)),this.requestUpdateState({backgroundID:h.mapID}))),s instanceof Vr){if(this.mapObject.setLayer(s),u)this.mapObject.exchangeSource(u);else if(!this.from.isWmts()){const g=c||n;this.mapObject.exchangeSource(g)}this.requestUpdateState({backgroundID:this.mapObject.getSource().mapID})}else this.mapObject.setLayer(),this.mapObject.exchangeSource(s);const f={mapID:s.mapID};s.isBasemap()&&(f.backgroundID="____delete____"),this.requestUpdateState(f),this.from=s,this.dispatchPoiNumber();const d=this.mapObject.getView();this.appData.zoomRestriction&&(d.setMaxZoom(s.maxZoom),d.setMinZoom(s.minZoom||0)),l&&s.insideCheckSysCoord(l[0])?(d.setCenter(l[0]),d.setZoom(l[1]),d.setRotation(this.noRotate?0:l[2])):this.__init?l||this.goHome(s):(this.dispatchEvent(new Ae("outOfMap",{})),this.goHome(s)),s.setGPSMarker(this.currentPosition,!0),i.hideLayer&&(i.hideLayer.split(",").map(m=>{const p=this.getPoiLayer(m);p&&(p.hide=!0)}),this.requestUpdateState({hideLayer:i.hideLayer})),i.hideMarker?this.hideAllMarkers():this.redrawMarkers(),this.resetVector();for(let g=0;g{this.setVector(m)})(this.vectors[g]);this.dispatchEvent(new Ae("mapChanged",this.getMapMeta(s.mapID))),this.mapObject.updateSize(),this.mapObject.render(),i.position&&(this.__init=!1,s.setViewpoint(i.position)),i.transparency&&this.setTransparency(i.transparency),this.__init?(this.__init=!1,this.goHome(s)):this.backMap&&h&&this.convertParametersFromCurrent(h,g=>{const m=this.backMap.getView();m.setCenter(g[0]),m.setZoom(g[1]),m.setRotation(this.noRotate?0:g[2]),this.backMap.updateSize(),this.backMap.render()}),o(void 0)})}))}requestUpdateState(e){if(this.stateBuffer=Object.assign(this.stateBuffer,e),this.stateBuffer.backgroundID=="____delete____"&&delete this.stateBuffer.backgroundID,this.restoreSession){const i=Math.floor(new Date().getTime()/1e3);localStorage.setItem("epoch",`${i}`);const n=function(s){Object.keys(s).map(o=>{o=="position"?n(s[o]):o=="backgroundID"&&s[o]=="____delete____"?localStorage.removeItem(o):localStorage.setItem(o,s[o])})};n(e)}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>{this.timer=void 0,this.dispatchEvent(new Ae("updateState",this.stateBuffer))},50)}setTransparency(e){this.__transparency=e,this.mapObject.setTransparency(e),this.requestUpdateState({transparency:e})}getTransparency(){return this.__transparency==null?0:this.__transparency}setViewpoint(e){this.from.setViewpoint(e)}goHome(e){(e||this.from).goHome()}resetRotation(){this.from.resetRotation()}resetDirection(){this.from.resetDirection()}resetCirculation(){this.from.resetCirculation()}getMapMeta(e){let i;if(e?i=this.cacheHash[e]:i=this.from,!!i)return Or.reduce((n,s)=>(n[s]=i.get(s),n),{mapID:i.mapID,label:i.label})}getMapCacheEnable(e){let i;return e?i=this.cacheHash[e]:i=this.from,i?i.getCacheEnable():!1}async getMapTileCacheStatsAsync(e){let i;return e?i=this.cacheHash[e]:i=this.from,i?await i.getTileCacheStatsAsync():{}}async getMapTileCacheSizeAsync(e){return(await this.getMapTileCacheStatsAsync(e)).size||0}async clearMapTileCacheAsync(e){let i;e?i=this.cacheHash[e]:i=this.from,i&&await i.clearTileCacheAsync()}async fetchAllMapTileCacheAsync(e,i){let n;if(e?n=this.cacheHash[e]:n=this.from,!n){i("stop",{});return}await n.fetchAllTileCacheAsync(i)}async cancelMapTileCacheAsync(e){let i;e?i=this.cacheHash[e]:i=this.from,i&&await i.cancelTileCacheAsync()}convertParametersFromCurrent(e,i){const n=this.mapObject.getView();if(!this.from){i&&i();return}let s=this.from.viewpoint2MercsAsync();const o=Ma([n.getCenter(),n.getZoom(),n.getRotation()],10);if(this.mercBuffer&&this.mercBuffer.mercs&&this.mercBuffer.buffer[this.from.mapID]){const a=this.mercBuffer.buffer[this.from.mapID];a[0][0]==o[0][0]&&a[0][1]==o[0][1]&&a[1]==o[1]&&a[2]==o[2]?(this.logger.debug(a),this.logger.debug(o),this.logger.debug("From: Use buffer"),s=new Promise((l,c)=>{l(this.mercBuffer.mercs)})):(this.mercBuffer={buffer:{}},this.mercBuffer.buffer[this.from.mapID]=o)}else this.mercBuffer={buffer:{}},this.mercBuffer.buffer[this.from.mapID]=o;this.logger.debug(`From: Center: ${o[0]} Zoom: ${o[1]} Rotation: ${o[2]}`),this.logger.debug(`From: ${this.from.mapID}`),s.then(a=>{this.mercBuffer.mercs=a,this.logger.debug(`Mercs: ${a}`);let l=e.mercs2ViewpointAsync(a);const c=e.mapID;this.mercBuffer.buffer[c]&&(this.logger.debug("To: Use buffer"),l=new Promise((h,u)=>{h(this.mercBuffer.buffer[c])})),l.then(h=>{this.logger.debug(`To: Center: ${h[0]} Zoom: ${h[1]} Rotation: ${h[2]}`),this.logger.debug(`To: ${e.mapID}`),this.mercBuffer.buffer[e.mapID]=Ma(h,10),i(h)}).catch(h=>{throw h})}).catch(a=>{throw a})}translate(e){if(!e||typeof e=="string")return e;const i=Object.keys(e);let n=i.reduce((s,o,a,l)=>(o==this.appLang?s=[e[o],!0]:(!s||o=="en"&&!s[1])&&(s=[e[o],!1]),a==l.length-1?s[0]:s),void 0);if(n=typeof n=="string"?n:`${n}`,this.i18n.exists(n,{ns:"translation",nsSeparator:"__X__yX__X__"}))return this.t(n,{ns:"translation",nsSeparator:"__X__yX__X__"});for(let s=0;s{const e=new Zi(r);e.waitReady.then(()=>{t(e)})})};if(typeof window<"u"){const r={createObject:Zi.createObject};window.Maplat=r,window.MaplatApp=Zi,window.assets=rv}window.addEventListener("DOMContentLoaded",async()=>{window.MaplatApp=Zi,window.Maplat=Zi;for(var r={mapboxgl,maplibregl,mapboxToken:"pk.eyJ1IjoicmVraXNoaWtva3VkbyIsImEiOiJjazRoMmF3dncwODU2M2ttdzI2aDVqYXVwIn0.8Hb9sekgjfck6Setxk5uVg",startFrom:"morioka_ndl2",restore:{mapID:"morioka_ndl2"}},t=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),e=0;e - - - - - Maplat - Vite Dev Mode TEST - - - - - - - - - - - - - - - - - -

VITE TEST VERSION

-
-
-
-
- - - - - - - - - - - - - - - - - - -
- - - - - - - - \ No newline at end of file diff --git a/dist-demo/parts_test/blue_marker.png b/dist-demo/parts_test/blue_marker.png deleted file mode 100644 index 4baf3be0..00000000 Binary files a/dist-demo/parts_test/blue_marker.png and /dev/null differ diff --git a/dist-demo/parts_test/red_marker.png b/dist-demo/parts_test/red_marker.png deleted file mode 100644 index 7145f6b6..00000000 Binary files a/dist-demo/parts_test/red_marker.png and /dev/null differ