@mappedin/mappedin-js 6.0.1-beta.29 → 6.0.1-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +1 -1
- package/lib/esm/{GLTFExporter-Y7BSZVBH.js → GLTFExporter-2HAV72SJ.js} +1 -1
- package/lib/esm/{GLTFLoader-K67N4RFF.js → GLTFLoader-IS3L5KUS.js} +1 -1
- package/lib/esm/{browser-JCMKWIF4.js → browser-64MRL2ZR.js} +1 -1
- package/lib/esm/{chunk-PDOJBYQZ.js → chunk-A3CEQIQD.js} +1 -1
- package/lib/esm/{chunk-EXW3BL3F.js → chunk-JNSM5T55.js} +1 -1
- package/lib/esm/chunk-ODQ3775R.js +1 -0
- package/lib/esm/{chunk-IJDVDF27.js → chunk-OFHRQORP.js} +1 -1
- package/lib/esm/{chunk-IKRJZNLL.js → chunk-OSMCRNNF.js} +1 -1
- package/lib/esm/{chunk-3RUMFBSI.js → chunk-VD44EZOA.js} +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-JWG7GWP6.js → inspector-RQUC7XBE.js} +1 -1
- package/lib/esm/{internal-5XNJMK3S.js → internal-FFMF4P2Y.js} +1 -1
- package/lib/esm/{outdoor-context-v4-XK734ARV.js → outdoor-context-v4-E3KR4IBA.js} +1 -1
- package/lib/esm/{text3d-ZKED4HTQ.js → text3d-7MFD4QFJ.js} +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-GDH3UII5.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as fr,i as un,j as cn}from"./chunk-IJDVDF27.js";import{a as dn}from"./chunk-3RUMFBSI.js";import{$a as ln,A as Gt,Aa as an,H as z,Ha as sn,K as gt,M as ye,N as ae,P as Qr,S as en,Z as tn,b as Yr,c as qr,d as Kr,e as mt,ka as rn,n as Xr,o as Jr,oa as nn,pa as on,ra as Nt,w as dr}from"./chunk-EXW3BL3F.js";import{a as f,b as x}from"./chunk-IKRJZNLL.js";import{b as Bi,d as zi,e as u,f as E,g as V,h as P}from"./chunk-H2E2454S.js";var oi=Bi((Mt,ot)=>{f();var Yo=200,jn="__lodash_hash_undefined__",qo=800,Ko=16,Bn=9007199254740991,zn="[object Arguments]",Xo="[object Array]",Jo="[object AsyncFunction]",Qo="[object Boolean]",ea="[object Date]",ta="[object Error]",Fn="[object Function]",ra="[object GeneratorFunction]",na="[object Map]",ia="[object Number]",oa="[object Null]",Vn="[object Object]",aa="[object Proxy]",sa="[object RegExp]",la="[object Set]",ua="[object String]",ca="[object Undefined]",da="[object WeakMap]",fa="[object ArrayBuffer]",pa="[object DataView]",ha="[object Float32Array]",ma="[object Float64Array]",ga="[object Int8Array]",ya="[object Int16Array]",ba="[object Int32Array]",va="[object Uint8Array]",xa="[object Uint8ClampedArray]",_a="[object Uint16Array]",Ta="[object Uint32Array]",Sa=/[\\^$.*+?()[\]{}|]/g,Ma=/^\[object .+?Constructor\]$/,ka=/^(?:0|[1-9]\d*)$/,O={};O[ha]=O[ma]=O[ga]=O[ya]=O[ba]=O[va]=O[xa]=O[_a]=O[Ta]=!0;O[zn]=O[Xo]=O[fa]=O[Qo]=O[pa]=O[ea]=O[ta]=O[Fn]=O[na]=O[ia]=O[Vn]=O[sa]=O[la]=O[ua]=O[da]=!1;var Un=typeof global=="object"&&global&&global.Object===Object&&global,wa=typeof self=="object"&&self&&self.Object===Object&&self,Dt=Un||wa||Function("return this")(),Hn=typeof Mt=="object"&&Mt&&!Mt.nodeType&&Mt,kt=Hn&&typeof ot=="object"&&ot&&!ot.nodeType&&ot,Zn=kt&&kt.exports===Hn,xr=Zn&&Un.process,En=function(){try{var t=kt&&kt.require&&kt.require("util").types;return t||xr&&xr.binding&&xr.binding("util")}catch{}}(),In=En&&En.isTypedArray;function $n(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Da(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ca(t){return function(e){return t(e)}}function Ea(t,e){return t==null?void 0:t[e]}function Ia(t,e){return function(r){return t(e(r))}}var Oa=Array.prototype,Aa=Function.prototype,Yt=Object.prototype,_r=Dt["__core-js_shared__"],qt=Aa.toString,fe=Yt.hasOwnProperty,On=function(){var t=/[^.]+$/.exec(_r&&_r.keys&&_r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Wn=Yt.toString,Pa=qt.call(Object),Ra=RegExp("^"+qt.call(fe).replace(Sa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=Zn?Dt.Buffer:void 0,An=Dt.Symbol,Pn=Dt.Uint8Array,Rn=$t?$t.allocUnsafe:void 0,Yn=Ia(Object.getPrototypeOf,Object),Ln=Object.create,La=Yt.propertyIsEnumerable,Ga=Oa.splice,Ze=An?An.toStringTag:void 0,Wt=function(){try{var t=Cr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Na=$t?$t.isBuffer:void 0,Gn=Math.max,ja=Date.now,qn=Cr(Dt,"Map"),wt=Cr(Object,"create"),Ba=function(){function t(){}return function(e){if(!de(e))return{};if(Ln)return Ln(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function $e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function za(){this.__data__=wt?wt(null):{},this.size=0}function Fa(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Va(t){var e=this.__data__;if(wt){var r=e[t];return r===jn?void 0:r}return fe.call(e,t)?e[t]:void 0}function Ua(t){var e=this.__data__;return wt?e[t]!==void 0:fe.call(e,t)}function Ha(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=wt&&e===void 0?jn:e,this}$e.prototype.clear=za;$e.prototype.delete=Fa;$e.prototype.get=Va;$e.prototype.has=Ua;$e.prototype.set=Ha;function pe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Za(){this.__data__=[],this.size=0}function $a(t){var e=this.__data__,r=Kt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ga.call(e,r,1),--this.size,!0}function Wa(t){var e=this.__data__,r=Kt(e,t);return r<0?void 0:e[r][1]}function Ya(t){return Kt(this.__data__,t)>-1}function qa(t,e){var r=this.__data__,n=Kt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}pe.prototype.clear=Za;pe.prototype.delete=$a;pe.prototype.get=Wa;pe.prototype.has=Ya;pe.prototype.set=qa;function at(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ka(){this.size=0,this.__data__={hash:new $e,map:new(qn||pe),string:new $e}}function Xa(t){var e=Jt(this,t).delete(t);return this.size-=e?1:0,e}function Ja(t){return Jt(this,t).get(t)}function Qa(t){return Jt(this,t).has(t)}function es(t,e){var r=Jt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}at.prototype.clear=Ka;at.prototype.delete=Xa;at.prototype.get=Ja;at.prototype.has=Qa;at.prototype.set=es;function st(t){var e=this.__data__=new pe(t);this.size=e.size}function ts(){this.__data__=new pe,this.size=0}function rs(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ns(t){return this.__data__.get(t)}function is(t){return this.__data__.has(t)}function os(t,e){var r=this.__data__;if(r instanceof pe){var n=r.__data__;if(!qn||n.length<Yo-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new at(n)}return r.set(t,e),this.size=r.size,this}st.prototype.clear=ts;st.prototype.delete=rs;st.prototype.get=ns;st.prototype.has=is;st.prototype.set=os;function as(t,e){var r=kr(t),n=!r&&Mr(t),i=!r&&!n&&ei(t),o=!r&&!n&&!i&&ri(t),a=r||n||i||o,s=a?Da(t.length,String):[],l=s.length;for(var c in t)(e||fe.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Jn(c,l)))&&s.push(c);return s}function Tr(t,e,r){(r!==void 0&&!Qt(t[e],r)||r===void 0&&!(e in t))&&wr(t,e,r)}function ss(t,e,r){var n=t[e];(!(fe.call(t,e)&&Qt(n,r))||r===void 0&&!(e in t))&&wr(t,e,r)}function Kt(t,e){for(var r=t.length;r--;)if(Qt(t[r][0],e))return r;return-1}function wr(t,e,r){e=="__proto__"&&Wt?Wt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ls=xs();function Xt(t){return t==null?t===void 0?ca:oa:Ze&&Ze in Object(t)?_s(t):Ds(t)}function Nn(t){return Ct(t)&&Xt(t)==zn}function us(t){if(!de(t)||ks(t))return!1;var e=Ir(t)?Ra:Ma;return e.test(Os(t))}function cs(t){return Ct(t)&&ti(t.length)&&!!O[Xt(t)]}function ds(t){if(!de(t))return ws(t);var e=Qn(t),r=[];for(var n in t)n=="constructor"&&(e||!fe.call(t,n))||r.push(n);return r}function Dr(t,e,r,n,i){t!==e&&ls(e,function(o,a){if(i||(i=new st),de(o))fs(t,e,a,r,Dr,n,i);else{var s=n?n(Sr(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),Tr(t,a,s)}},ni)}function fs(t,e,r,n,i,o,a){var s=Sr(t,r),l=Sr(e,r),c=a.get(l);if(c){Tr(t,r,c);return}var d=o?o(s,l,r+"",t,e,a):void 0,m=d===void 0;if(m){var w=kr(l),D=!w&&ei(l),I=!w&&!D&&ri(l);d=l,w||D||I?kr(s)?d=s:As(s)?d=ys(s):D?(m=!1,d=hs(l,!0)):I?(m=!1,d=gs(l,!0)):d=[]:Ps(l)||Mr(l)?(d=s,Mr(s)?d=Rs(s):(!de(s)||Ir(s))&&(d=Ts(l))):m=!1}m&&(a.set(l,d),i(d,l,n,o,a),a.delete(l)),Tr(t,r,d)}function Kn(t,e){return Es(Cs(t,e,ii),t+"")}var ps=Wt?function(t,e){return Wt(t,"toString",{configurable:!0,enumerable:!1,value:Ns(e),writable:!0})}:ii;function hs(t,e){if(e)return t.slice();var r=t.length,n=Rn?Rn(r):new t.constructor(r);return t.copy(n),n}function ms(t){var e=new t.constructor(t.byteLength);return new Pn(e).set(new Pn(t)),e}function gs(t,e){var r=e?ms(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ys(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function bs(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=n?n(r[s],t[s],s,r,t):void 0;l===void 0&&(l=t[s]),i?wr(r,s,l):ss(r,s,l)}return r}function vs(t){return Kn(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&Ss(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,o)}return e})}function xs(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var l=a[t?s:++i];if(r(o[l],l,o)===!1)break}return e}}function Xn(t,e,r,n,i,o){return de(t)&&de(e)&&(o.set(e,t),Dr(t,e,void 0,Xn,o),o.delete(e)),t}function Jt(t,e){var r=t.__data__;return Ms(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Cr(t,e){var r=Ea(t,e);return us(r)?r:void 0}function _s(t){var e=fe.call(t,Ze),r=t[Ze];try{t[Ze]=void 0;var n=!0}catch{}var i=Wn.call(t);return n&&(e?t[Ze]=r:delete t[Ze]),i}function Ts(t){return typeof t.constructor=="function"&&!Qn(t)?Ba(Yn(t)):{}}function Jn(t,e){var r=typeof t;return e=e==null?Bn:e,!!e&&(r=="number"||r!="symbol"&&ka.test(t))&&t>-1&&t%1==0&&t<e}function Ss(t,e,r){if(!de(r))return!1;var n=typeof e;return(n=="number"?Er(r)&&Jn(e,r.length):n=="string"&&e in r)?Qt(r[e],t):!1}function Ms(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ks(t){return!!On&&On in t}function Qn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Yt;return t===r}function ws(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Ds(t){return Wn.call(t)}function Cs(t,e,r){return e=Gn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Gn(n.length-e,0),a=Array(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),$n(t,this,s)}}function Sr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Es=Is(ps);function Is(t){var e=0,r=0;return function(){var n=ja(),i=Ko-(n-r);if(r=n,i>0){if(++e>=qo)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Os(t){if(t!=null){try{return qt.call(t)}catch{}try{return t+""}catch{}}return""}function Qt(t,e){return t===e||t!==t&&e!==e}var Mr=Nn(function(){return arguments}())?Nn:function(t){return Ct(t)&&fe.call(t,"callee")&&!La.call(t,"callee")},kr=Array.isArray;function Er(t){return t!=null&&ti(t.length)&&!Ir(t)}function As(t){return Ct(t)&&Er(t)}var ei=Na||js;function Ir(t){if(!de(t))return!1;var e=Xt(t);return e==Fn||e==ra||e==Jo||e==aa}function ti(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Bn}function de(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ct(t){return t!=null&&typeof t=="object"}function Ps(t){if(!Ct(t)||Xt(t)!=Vn)return!1;var e=Yn(t);if(e===null)return!0;var r=fe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qt.call(r)==Pa}var ri=In?Ca(In):cs;function Rs(t){return bs(t,ni(t))}var Ls=Kn(function(t){return t.push(void 0,Xn),$n(Gs,void 0,t)});function ni(t){return Er(t)?as(t,!0):ds(t)}var Gs=vs(function(t,e,r,n){Dr(t,e,r,n)});function Ns(t){return function(){return t}}function ii(t){return t}function js(){return!1}ot.exports=Ls});f();var jt="[MappedinJS]",Fi=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Fi||{});function Xl(t){0<=t&&t<=3&&(fn.logState=t)}var fn={logState:x.env.NODE_ENV==="test"?3:0,log(...t){this.logState<=0&&console.log(jt,...t)},warn(...t){this.logState<=1&&console.warn(jt,...t)},error(...t){this.logState<=2&&console.error(jt,...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)},throw(t,e){throw new Error("".concat(jt," ").concat(t),e)}},se=fn;f();f();var De=class extends Error{};De.prototype.name="InvalidTokenError";function Vi(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Ui(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Vi(e)}catch{return atob(e)}}function pn(t,e){if(typeof t!="string")throw new De("Invalid token specified: must be a string");e||(e={});let r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new De("Invalid token specified: missing part #".concat(r+1));let i;try{i=Ui(n)}catch(o){throw new De("Invalid token specified: invalid base64 for part #".concat(r+1," (").concat(o.message,")"))}try{return JSON.parse(i)}catch(o){throw new De("Invalid token specified: invalid json for part #".concat(r+1," (").concat(o.message,")"))}}f();var Ce=63710088e-1;function au(t){var r,n;let e=pn(t);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(r=e.aud)!=null?r:[],capabilities:(n=e.capabilities)!=null?n:{}}}function be(t){return t*(Math.PI/180)}function Hi(t){return t*(180/Math.PI)}function hn(t,e){return(t%e+e)%e}function su([t,e],[r,n]){let i=be(n-e),o=be(r-t),a=be(e),s=be(n),l=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(s),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return Ce*c}function lu([t,e],[r,n]){let i=be(e),o=be(t),a=be(n),l=be(r)-o,c=Math.sin(l)*Math.cos(a),d=Math.cos(i)*Math.sin(a)-Math.sin(i)*Math.cos(a)*Math.cos(l);return Hi((Math.atan2(c,d)+Math.PI*2)%(Math.PI*2))}function uu(t,e){let r=hn(t,Math.PI*2),n=hn(e,Math.PI*2),i=n-r,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:r,end:o}}f();function fu(t,e,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&t(...o);let a=()=>{(!r||i>1)&&t(...o),n=null,i=0};clearTimeout(n),n=setTimeout(a,e)}}f();f();var yt=class{constructor(){u(this,"_subscribers",{})}publish(e,r){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(r)})}on(e,r){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(r)}off(e,r){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(r);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};f();f();var pr=[0,4,6,8,10],N=()=>{let t=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<t.length;n++)n>0&&!(n&3)&&(e=Math.random()*4294967296),t[n]=e>>>((n&3)<<3)&255;let r=t.map(n=>n.toString(16).padStart(2,"0"));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],pr.map((n,i)=>r.slice(n,i===pr.length-1?void 0:pr[i+1]).join("")).join("-")};var mn="mi-session-data",gn="mi-local-data",Ee,q,K,Bt=class Bt{constructor(){V(this,q,void 0);V(this,K,void 0);try{let e=sessionStorage.getItem(mn);e?P(this,q,JSON.parse(e)):P(this,q,{id:N()})}catch{P(this,q,{id:N()})}try{let e=localStorage.getItem(gn);e?P(this,K,JSON.parse(e)):P(this,K,{deviceId:N()})}catch{P(this,K,{deviceId:N()})}E(this,q).id||(E(this,q).id=N()),E(this,K).deviceId||(E(this,K).deviceId=N())}static getInstance(){return E(this,Ee)||P(this,Ee,new Bt),E(this,Ee)}static ___clearInstance(){P(this,Ee,void 0)}saveSessionData(e,r){E(this,q)[e]=r;try{return sessionStorage.setItem(mn,JSON.stringify(E(this,q))),!0}catch{return!1}}loadSessionData(e){let r=E(this,q)[e];if(r!=null)return r}saveLocalData(e,r){E(this,K)[e]=r;try{return localStorage.setItem(gn,JSON.stringify(E(this,K))),!0}catch{return!1}}loadLocalData(e){let r=E(this,K)[e];if(r!=null)return r}};Ee=new WeakMap,q=new WeakMap,K=new WeakMap,V(Bt,Ee,void 0);var hr=Bt;f();var k;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},t.find=(i,o)=>{for(let a of i)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(k||(k={}));var gr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(gr||(gr={}));var y=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=t=>{switch(typeof t){case"undefined":return y.undefined;case"string":return y.string;case"number":return isNaN(t)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(t)?y.array:t===null?y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?y.promise:typeof Map<"u"&&t instanceof Map?y.map:typeof Set<"u"&&t instanceof Set?y.set:typeof Date<"u"&&t instanceof Date?y.date:y.object;default:return y.unknown}},p=k.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Zi=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),U=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};U.create=t=>new U(t);var Qe=(t,e)=>{let r;switch(t.code){case p.invalid_type:t.received===y.undefined?r="Required":r="Expected ".concat(t.expected,", received ").concat(t.received);break;case p.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(t.expected,k.jsonStringifyReplacer));break;case p.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(k.joinValues(t.keys,", "));break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(k.joinValues(t.options));break;case p.invalid_enum_value:r="Invalid enum value. Expected ".concat(k.joinValues(t.options),", received '").concat(t.received,"'");break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?r='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?r='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):k.assertNever(t.validation):t.validation!=="regex"?r="Invalid ".concat(t.validation):r="Invalid";break;case p.too_small:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):r="Invalid input";break;case p.too_big:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?r="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r="Number must be a multiple of ".concat(t.multipleOf);break;case p.not_finite:r="Number must be finite";break;default:r=e.defaultError,k.assertNever(t)}return{message:r}},vn=Qe;function $i(t){vn=t}function zt(){return vn}var Ft=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...i,path:o,message:s}},Wi=[];function g(t,e){let r=zt(),n=Ft({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Qe?void 0:Qe].filter(i=>!!i)});t.common.issues.push(n)}var R=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return T;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,a=await i.value;n.push({key:o,value:a})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return T;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),Je=t=>({status:"dirty",value:t}),j=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",xt=t=>t.status==="valid",_t=t=>typeof Promise<"u"&&t instanceof Promise;function Vt(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function xn(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var v;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));var bt,vt,Y=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yn=(t,e)=>{if(xt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new U(t.common.issues);return this._error=r,this._error}}};function S(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:(a,s)=>{var l,c;let{message:d}=t;return a.code==="invalid_enum_value"?{message:d!=null?d:s.defaultError}:typeof s.data>"u"?{message:(l=d!=null?d:n)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(c=d!=null?d:r)!==null&&c!==void 0?c:s.defaultError}},description:i}}var M=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ve(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new R,ctx:{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(_t(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},o=this._parseSync({data:e,path:i.path,parent:i});return yn(i,o)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(_t(i)?i:Promise.resolve(i));return yn(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let a=e(i),s=()=>o.addIssue({code:p.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new H({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this,this._def)}promise(){return Te.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ne.create(this,e,this._def)}transform(e){return new H({...S(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ve({...S(this._def),innerType:this,defaultValue:r,typeName:_.ZodDefault})}brand(){return new Tt({typeName:_.ZodBranded,type:this,...S(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ue({...S(this._def),innerType:this,catchValue:r,typeName:_.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return St.create(this,e)}readonly(){return He.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yi=/^c[^\s-]{8,}$/i,qi=/^[0-9a-z]+$/,Ki=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ji=/^[a-z0-9_-]{21}$/i,Qi=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,to="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",mr,ro=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,no=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,io=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_n="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oo=new RegExp("^".concat(_n,"$"));function Tn(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}function ao(t){return new RegExp("^".concat(Tn(t),"$"))}function Sn(t){let e="".concat(_n,"T").concat(Tn(t)),r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(r.join("|"),")"),new RegExp("^".concat(e,"$"))}function so(t,e){return!!((e==="v4"||!e)&&ro.test(t)||(e==="v6"||!e)&&no.test(t))}var xe=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.string,received:o.parsedType}),T}let n=new R,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(e,i),a?g(i,{code:p.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&g(i,{code:p.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")eo.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"email",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")mr||(mr=new RegExp(to,"u")),mr.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"emoji",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Xi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"uuid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ji.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"nanoid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Yi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")qi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid2",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ki.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ulid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),g(i,{validation:"url",code:p.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"regex",code:p.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Sn(o).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?oo.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ao(o).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Qi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"duration",code:p.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?so(e.data,o.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ip",code:p.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?io.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64",code:p.invalid_string,message:o.message}),n.dirty()):k.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:p.invalid_string,...v.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...v.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...v.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...v.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...v.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...v.errToObj(r)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};xe.create=t=>{var e;return new xe({checks:[],typeName:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...S(t)})};function lo(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}var Ie=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.number,received:o.parsedType}),T}let n,i=new R;for(let o of this._def.checks)o.kind==="int"?k.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:p.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?lo(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_finite,message:o.message}),i.dirty()):k.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ie.create=t=>new Ie({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...S(t)});var Oe=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==y.bigint){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.bigint,received:o.parsedType}),T}let n,i=new R;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):k.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Oe.create=t=>{var e;return new Oe({checks:[],typeName:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...S(t)})};var Ae=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.boolean,received:n.parsedType}),T}return j(e.data)}};Ae.create=t=>new Ae({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...S(t)});var Pe=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.date,received:o.parsedType}),T}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_date}),T}let n=new R,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):k.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Pe.create=t=>new Pe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...S(t)});var et=class extends M{_parse(e){if(this._getType(e)!==y.symbol){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.symbol,received:n.parsedType}),T}return j(e.data)}};et.create=t=>new et({typeName:_.ZodSymbol,...S(t)});var Re=class extends M{_parse(e){if(this._getType(e)!==y.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.undefined,received:n.parsedType}),T}return j(e.data)}};Re.create=t=>new Re({typeName:_.ZodUndefined,...S(t)});var Le=class extends M{_parse(e){if(this._getType(e)!==y.null){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.null,received:n.parsedType}),T}return j(e.data)}};Le.create=t=>new Le({typeName:_.ZodNull,...S(t)});var _e=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}};_e.create=t=>new _e({typeName:_.ZodAny,...S(t)});var ue=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}};ue.create=t=>new ue({typeName:_.ZodUnknown,...S(t)});var X=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:y.never,received:r.parsedType}),T}};X.create=t=>new X({typeName:_.ZodNever,...S(t)});var tt=class extends M{_parse(e){if(this._getType(e)!==y.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.void,received:n.parsedType}),T}return j(e.data)}};tt.create=t=>new tt({typeName:_.ZodVoid,...S(t)});var ce=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==y.array)return g(r,{code:p.invalid_type,expected:y.array,received:r.parsedType}),T;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(g(r,{code:a?p.too_big:p.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(g(r,{code:p.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(g(r,{code:p.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new Y(r,a,r.path,s)))).then(a=>R.mergeArray(n,a));let o=[...r.data].map((a,s)=>i.type._parseSync(new Y(r,a,r.path,s)));return R.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:v.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:v.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:v.toString(r)}})}nonempty(e){return this.min(1,e)}};ce.create=(t,e)=>new ce({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...S(e)});function Xe(t){if(t instanceof F){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=W.create(Xe(n))}return new F({...t._def,shape:()=>e})}else return t instanceof ce?new ce({...t._def,type:Xe(t.element)}):t instanceof W?W.create(Xe(t.unwrap())):t instanceof re?re.create(Xe(t.unwrap())):t instanceof te?te.create(t.items.map(e=>Xe(e))):t}var F=class t extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=k.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==y.object){let c=this._getOrReturnCtx(e);return g(c,{code:p.invalid_type,expected:y.object,received:c.parsedType}),T}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof X&&this._def.unknownKeys==="strip"))for(let c in i.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let d=o[c],m=i.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Y(i,m,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof X){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(c==="strict")s.length>0&&(g(i,{code:p.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of s){let m=i.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Y(i,m,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of l){let m=await d.key,w=await d.value;c.push({key:m,value:w,alwaysSet:d.alwaysSet})}return c}).then(c=>R.mergeObjectSync(n,c)):R.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,a,s;let l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=v.errToObj(e).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return k.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return k.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Xe(this)}partial(e){let r={};return k.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return k.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof W;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return Mn(k.objectKeys(this.shape))}};F.create=(t,e)=>new F({shape:()=>t,unknownKeys:"strip",catchall:X.create(),typeName:_.ZodObject,...S(e)});F.strictCreate=(t,e)=>new F({shape:()=>t,unknownKeys:"strict",catchall:X.create(),typeName:_.ZodObject,...S(e)});F.lazycreate=(t,e)=>new F({shape:t,unknownKeys:"strip",catchall:X.create(),typeName:_.ZodObject,...S(e)});var Ge=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new U(s.ctx.common.issues));return g(r,{code:p.invalid_union,unionErrors:a}),T}if(r.common.async)return Promise.all(n.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let l of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new U(l));return g(r,{code:p.invalid_union,unionErrors:s}),T}}get options(){return this._def.options}};Ge.create=(t,e)=>new Ge({options:t,typeName:_.ZodUnion,...S(e)});var le=t=>t instanceof je?le(t.schema):t instanceof H?le(t.innerType()):t instanceof Be?[t.value]:t instanceof ze?t.options:t instanceof Fe?k.objectValues(t.enum):t instanceof Ve?le(t._def.innerType):t instanceof Re?[void 0]:t instanceof Le?[null]:t instanceof W?[void 0,...le(t.unwrap())]:t instanceof re?[null,...le(t.unwrap())]:t instanceof Tt||t instanceof He?le(t.unwrap()):t instanceof Ue?le(t._def.innerType):[],Ut=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.object)return g(r,{code:p.invalid_type,expected:y.object,received:r.parsedType}),T;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let a=le(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let s of a){if(i.has(s))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(s)));i.set(s,o)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...S(n)})}};function vr(t,e){let r=ve(t),n=ve(e);if(t===e)return{valid:!0,data:t};if(r===y.object&&n===y.object){let i=k.objectKeys(e),o=k.objectKeys(t).filter(s=>i.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=vr(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===y.array&&n===y.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=vr(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===y.date&&n===y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ne=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,a)=>{if(yr(o)||yr(a))return T;let s=vr(o.value,a.value);return s.valid?((br(o)||br(a))&&r.dirty(),{status:r.value,value:s.data}):(g(n,{code:p.invalid_intersection_types}),T)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ne.create=(t,e,r)=>new Ne({left:t,right:e,typeName:_.ZodIntersection,...S(r)});var te=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.array)return g(n,{code:p.invalid_type,expected:y.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return g(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Y(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>R.mergeArray(r,a)):R.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};te.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new te({items:t,typeName:_.ZodTuple,rest:null,...S(e)})};var Ht=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.object)return g(n,{code:p.invalid_type,expected:y.object,received:n.parsedType}),T;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in n.data)i.push({key:o._parse(new Y(n,s,n.path,s)),value:a._parse(new Y(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?R.mergeObjectAsync(r,i):R.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:_.ZodRecord,...S(n)}):new t({keyType:xe.create(),valueType:e,typeName:_.ZodRecord,...S(r)})}},rt=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.map)return g(n,{code:p.invalid_type,expected:y.map,received:n.parsedType}),T;let i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],c)=>({key:i._parse(new Y(n,s,n.path,[c,"key"])),value:o._parse(new Y(n,l,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return T;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(c.value,d.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return T;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(c.value,d.value)}return{status:r.value,value:s}}}};rt.create=(t,e,r)=>new rt({valueType:e,keyType:t,typeName:_.ZodMap,...S(r)});var nt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.set)return g(n,{code:p.invalid_type,expected:y.set,received:n.parsedType}),T;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(g(n,{code:p.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(g(n,{code:p.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let d of l){if(d.status==="aborted")return T;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((l,c)=>o._parse(new Y(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:v.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:v.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};nt.create=(t,e)=>new nt({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...S(e)});var Zt=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.function)return g(r,{code:p.invalid_type,expected:y.function,received:r.parsedType}),T;function n(s,l){return Ft({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zt(),Qe].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function i(s,l){return Ft({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zt(),Qe].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Te){let s=this;return j(async function(...l){let c=new U([]),d=await s._def.args.parseAsync(l,o).catch(D=>{throw c.addIssue(n(l,D)),c}),m=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(m,o).catch(D=>{throw c.addIssue(i(m,D)),c})})}else{let s=this;return j(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new U([n(l,c.error)]);let d=Reflect.apply(a,this,c.data),m=s._def.returns.safeParse(d,o);if(!m.success)throw new U([i(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:te.create(e).rest(ue.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||te.create([]).rest(ue.create()),returns:r||ue.create(),typeName:_.ZodFunction,...S(n)})}},je=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};je.create=(t,e)=>new je({getter:t,typeName:_.ZodLazy,...S(e)});var Be=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:p.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};Be.create=(t,e)=>new Be({value:t,typeName:_.ZodLiteral,...S(e)});function Mn(t,e){return new ze({values:t,typeName:_.ZodEnum,...S(e)})}var ze=class t extends M{constructor(){super(...arguments),bt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{expected:k.joinValues(n),received:r.parsedType,code:p.invalid_type}),T}if(Vt(this,bt,"f")||xn(this,bt,new Set(this._def.values),"f"),!Vt(this,bt,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),T}return j(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};bt=new WeakMap;ze.create=Mn;var Fe=class extends M{constructor(){super(...arguments),vt.set(this,void 0)}_parse(e){let r=k.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==y.string&&n.parsedType!==y.number){let i=k.objectValues(r);return g(n,{expected:k.joinValues(i),received:n.parsedType,code:p.invalid_type}),T}if(Vt(this,vt,"f")||xn(this,vt,new Set(k.getValidEnumValues(this._def.values)),"f"),!Vt(this,vt,"f").has(e.data)){let i=k.objectValues(r);return g(n,{received:n.data,code:p.invalid_enum_value,options:i}),T}return j(e.data)}get enum(){return this._def.values}};vt=new WeakMap;Fe.create=(t,e)=>new Fe({values:t,typeName:_.ZodNativeEnum,...S(e)});var Te=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.promise&&r.common.async===!1)return g(r,{code:p.invalid_type,expected:y.promise,received:r.parsedType}),T;let n=r.parsedType===y.promise?r.data:Promise.resolve(r.data);return j(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Te.create=(t,e)=>new Te({type:t,typeName:_.ZodPromise,...S(e)});var H=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:a=>{g(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return T;let l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?T:l.status==="dirty"||r.value==="dirty"?Je(l.value):l});{if(r.value==="aborted")return T;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"||r.value==="dirty"?Je(s.value):s}}if(i.type==="refinement"){let a=s=>{let l=i.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?T:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xt(a))return a;let s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>xt(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):a);k.assertNever(i)}};H.create=(t,e,r)=>new H({schema:t,typeName:_.ZodEffects,effect:e,...S(r)});H.createWithPreprocess=(t,e,r)=>new H({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...S(r)});var W=class extends M{_parse(e){return this._getType(e)===y.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W.create=(t,e)=>new W({innerType:t,typeName:_.ZodOptional,...S(e)});var re=class extends M{_parse(e){return this._getType(e)===y.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:_.ZodNullable,...S(e)});var Ve=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ve.create=(t,e)=>new Ve({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});var Ue=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _t(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new U(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new U(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ue.create=(t,e)=>new Ue({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});var it=class extends M{_parse(e){if(this._getType(e)!==y.nan){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};it.create=t=>new it({typeName:_.ZodNaN,...S(t)});var uo=Symbol("zod_brand"),Tt=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},St=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?T:o.status==="dirty"?(r.dirty(),Je(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?T:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:_.ZodPipeline})}},He=class extends M{_parse(e){let r=this._def.innerType._parse(e),n=i=>(xt(i)&&(i.value=Object.freeze(i.value)),i);return _t(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};He.create=(t,e)=>new He({innerType:t,typeName:_.ZodReadonly,...S(e)});function kn(t,e={},r){return t?_e.create().superRefine((n,i)=>{var o,a;if(!t(n)){let s=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(a=(o=s.fatal)!==null&&o!==void 0?o:r)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:l})}}):_e.create()}var co={object:F.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var fo=(t,e={message:"Input not instance of ".concat(t.name)})=>kn(r=>r instanceof t,e),wn=xe.create,Dn=Ie.create,po=it.create,ho=Oe.create,Cn=Ae.create,mo=Pe.create,go=et.create,yo=Re.create,bo=Le.create,vo=_e.create,xo=ue.create,_o=X.create,To=tt.create,So=ce.create,Mo=F.create,ko=F.strictCreate,wo=Ge.create,Do=Ut.create,Co=Ne.create,Eo=te.create,Io=Ht.create,Oo=rt.create,Ao=nt.create,Po=Zt.create,Ro=je.create,Lo=Be.create,Go=ze.create,No=Fe.create,jo=Te.create,bn=H.create,Bo=W.create,zo=re.create,Fo=H.createWithPreprocess,Vo=St.create,Uo=()=>wn().optional(),Ho=()=>Dn().optional(),Zo=()=>Cn().optional(),$o={string:t=>xe.create({...t,coerce:!0}),number:t=>Ie.create({...t,coerce:!0}),boolean:t=>Ae.create({...t,coerce:!0}),bigint:t=>Oe.create({...t,coerce:!0}),date:t=>Pe.create({...t,coerce:!0})},Wo=T,h=Object.freeze({__proto__:null,defaultErrorMap:Qe,setErrorMap:$i,getErrorMap:zt,makeIssue:Ft,EMPTY_PATH:Wi,addIssueToContext:g,ParseStatus:R,INVALID:T,DIRTY:Je,OK:j,isAborted:yr,isDirty:br,isValid:xt,isAsync:_t,get util(){return k},get objectUtil(){return gr},ZodParsedType:y,getParsedType:ve,ZodType:M,datetimeRegex:Sn,ZodString:xe,ZodNumber:Ie,ZodBigInt:Oe,ZodBoolean:Ae,ZodDate:Pe,ZodSymbol:et,ZodUndefined:Re,ZodNull:Le,ZodAny:_e,ZodUnknown:ue,ZodNever:X,ZodVoid:tt,ZodArray:ce,ZodObject:F,ZodUnion:Ge,ZodDiscriminatedUnion:Ut,ZodIntersection:Ne,ZodTuple:te,ZodRecord:Ht,ZodMap:rt,ZodSet:nt,ZodFunction:Zt,ZodLazy:je,ZodLiteral:Be,ZodEnum:ze,ZodNativeEnum:Fe,ZodPromise:Te,ZodEffects:H,ZodTransformer:H,ZodOptional:W,ZodNullable:re,ZodDefault:Ve,ZodCatch:Ue,ZodNaN:it,BRAND:uo,ZodBranded:Tt,ZodPipeline:St,ZodReadonly:He,custom:kn,Schema:M,ZodSchema:M,late:co,get ZodFirstPartyTypeKind(){return _},coerce:$o,any:vo,array:So,bigint:ho,boolean:Cn,date:mo,discriminatedUnion:Do,effect:bn,enum:Go,function:Po,instanceof:fo,intersection:Co,lazy:Ro,literal:Lo,map:Oo,nan:po,nativeEnum:No,never:_o,null:bo,nullable:zo,number:Dn,object:Mo,oboolean:Zo,onumber:Ho,optional:Bo,ostring:Uo,pipeline:Vo,preprocess:Fo,promise:jo,record:Io,set:Ao,strictObject:ko,string:wn,symbol:go,transformer:bn,tuple:Eo,undefined:yo,union:wo,unknown:xo,void:To,NEVER:Wo,ZodIssueCode:p,quotelessJson:Zi,ZodError:U});f();function er(t){return(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}f();f();var We=class extends ye{},he=class{constructor(e,r){u(this,"id");u(this,"positionDirty",!0);u(this,"object3d",new We);u(this,"components");u(this,"disposed",!1);u(this,"worldPosition",new z);this.id=e.id||N(),this.components=[e],this.object3d=new We,this.object3d.position.copy(r),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};f();f();f();f();f();f();f();var B=63710088e-1,si={centimeters:B*100,centimetres:B*100,degrees:B/111325,feet:B*3.28084,inches:B*39.37,kilometers:B/1e3,kilometres:B/1e3,meters:B,metres:B,miles:B/1609.344,millimeters:B*1e3,millimetres:B*1e3,nauticalmiles:B/1852,radians:1,yards:B*1.0936},Fu={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/B,yards:1.0936133};function Ye(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function Bs(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ai(t[0])||!ai(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Ye(n,e,r)}function Vu(t,e,r){r===void 0&&(r={});for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return Ye(s,e,r)}function li(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Ye(n,e,r)}function Uu(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function Hu(t,e,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:t};return Ye(n,e,r)}function Zu(t,e){e===void 0&&(e="kilometers");var r=si[e];if(!r)throw new Error(e+" units is invalid");return t*r}function $u(t,e){e===void 0&&(e="kilometers");var r=si[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Wu(t){var e=t%(2*Math.PI);return e*180/Math.PI}function Yu(t){var e=t%360;return e*Math.PI/180}function ai(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function tr(t,e,r){if(t!==null)for(var n,i,o,a,s,l,c,d=0,m=0,w,D=t.type,I=D==="FeatureCollection",C=D==="Feature",L=I?t.features.length:1,G=0;G<L;G++){c=I?t.features[G].geometry:C?t.geometry:t,w=c?c.type==="GeometryCollection":!1,s=w?c.geometries.length:1;for(var ee=0;ee<s;ee++){var $=0,we=0;if(a=w?c.geometries[ee]:c,a!==null){l=a.coordinates;var ge=a.type;switch(d=r&&(ge==="Polygon"||ge==="MultiPolygon")?1:0,ge){case null:break;case"Point":if(e(l,m,G,$,we)===!1)return!1;m++,$++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(e(l[n],m,G,$,we)===!1)return!1;m++,ge==="MultiPoint"&&$++}ge==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-d;i++){if(e(l[n][i],m,G,$,we)===!1)return!1;m++}ge==="MultiLineString"&&$++,ge==="Polygon"&&we++}ge==="Polygon"&&$++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(we=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-d;o++){if(e(l[n][i][o],m,G,$,we)===!1)return!1;m++}we++}$++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(tr(a.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Qu(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function zs(t,e){var r,n,i,o,a,s,l,c,d,m,w=0,D=t.type==="FeatureCollection",I=t.type==="Feature",C=D?t.features.length:1;for(r=0;r<C;r++){for(s=D?t.features[r].geometry:I?t.geometry:t,c=D?t.features[r].properties:I?t.properties:{},d=D?t.features[r].bbox:I?t.bbox:void 0,m=D?t.features[r].id:I?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(o=l?s.geometries[i]:s,o===null){if(e(null,w,c,d,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,w,c,d,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],w,c,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}function Fs(t,e){zs(t,function(r,n,i,o,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ye(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var c=0;c<r.coordinates.length;c++){var d=r.coordinates[c],m={type:l,coordinates:d};if(e(Ye(m,i),n,c)===!1)return!1}})}function Vs(t,e){Fs(t,function(r,n,i){var o=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,c=0,d=0;if(tr(r,function(m,w,D,I,C){if(s===void 0||n>l||I>c||C>d){s=m,l=n,c=I,d=C,o=0;return}var L=li([s,m],r.properties);if(e(L,n,i,C,o)===!1)return!1;o++,s=m})===!1)return!1}}})}function ec(t,e,r){var n=r,i=!1;return Vs(t,function(o,a,s,l,c){i===!1&&r===void 0?n=o:n=e(n,o,a,s,l,c),i=!0}),n}function Or(t){var e=[1/0,1/0,-1/0,-1/0];return tr(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}Or.default=Or;var ui=Or;function ci(t){return ui(t)}f();var Ar="#ffffff";var Pr=class{constructor(e={}){u(this,"initialColor",Ar);u(this,"color",Ar);u(this,"topColor");u(this,"topTexture");u(this,"texture");u(this,"hoverColor");u(this,"dirty",!0);u(this,"visible",!0);u(this,"opacity",1);u(this,"width",.1);u(this,"height",.1);u(this,"initialHeight",.1);u(this,"altitude",0);u(this,"join","round");u(this,"cap","round");u(this,"outline",!0);u(this,"showImage",!0);u(this,"flipImageToFaceCamera",!0);u(this,"url");u(this,"side","double");u(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};var Se=class extends nn{constructor(){super(...arguments);u(this,"type","entityBatchedMesh");u(this,"userData",{entities:{}})}},Et,It,qe,ne=class{constructor(e){u(this,"mesh");u(this,"focusMesh");u(this,"outline");u(this,"imageMesh");u(this,"textMesh");u(this,"textEntityId");u(this,"type","geometry");u(this,"dirty",!0);u(this,"detached",!1);u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"currentHeight",.1);u(this,"focusable",!1);u(this,"color",new ae);u(this,"topColor",new ae);u(this,"position",new z);V(this,Et,0);V(this,It,1);V(this,qe,void 0);u(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,r){this.color.set(e),this.topColor.set(r),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return E(this,Et)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,Et,e))}get opacity(){return E(this,It)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let r=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of r)n.opacity=e,n.needsUpdate=!0}P(this,It,e)}get texture(){var e,r;return(r=(e=this.material)==null?void 0:e.texture)==null?void 0:r.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,r;return(r=(e=this.material)==null?void 0:e.topTexture)==null?void 0:r.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return E(this,qe)?E(this,qe):(P(this,qe,ci(this.feature)),E(this,qe))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Et=new WeakMap,It=new WeakMap,qe=new WeakMap;f();var Hs="#ffffff",Me,rr=class{constructor(e={}){u(this,"color",Hs);u(this,"topColor");u(this,"opacity",1);u(this,"height");V(this,Me,void 0);u(this,"outline",!0);u(this,"texture");u(this,"topTexture");u(this,"dirty",!0);var r,n;this.color=(r=e==null?void 0:e.color)!=null?r:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return E(this,Me)}set shading(e){var r;if(!e){P(this,Me,void 0);return}P(this,Me,(r=E(this,Me))!=null?r:{start:0,end:0,intensity:0}),Object.assign(E(this,Me),e)}};Me=new WeakMap;f();f();function lt(t){var r;let e=(r=t.parent)==null?void 0:r.children.find(n=>n.userData.outlineOfEntityId===t.userData.entityId);return e instanceof Nt?e:void 0}f();f();f();f();var ut=class{constructor(){u(this,"hover",!1);u(this,"dirty",!1)}};f();f();var di=["","","low","medium","high","always-visible"];function fi(t){return Math.min(5,Math.max(2,t))}function ct(t){if(typeof t=="number")return fi(t);let e=di.indexOf(t);return e===-1?3:e}function Ec(t){let e=fi(t);return di[e]}var nr=4,Rr=h.object({rank:h.union([h.enum(["low","medium","high","always-visible"]),h.number()]).optional(),interactive:h.union([h.boolean(),h.literal("pointer-events-auto")]).optional(),id:h.string().optional(),anchor:h.union([h.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),h.array(h.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:h.boolean().optional(),zIndex:h.number().optional()});function Nc(t,e,r){h.array(h.number()).refine(n=>n.length===2||n.length===3,{message:"Array length must be either 2 or 3"}).parse(t),h.string().parse(e),Rr.parse(r)}var dt=class dt{constructor(e,r={}){u(this,"id");u(this,"type","marker");u(this,"rank",0);u(this,"initialRank",0);u(this,"activeAnchor","center");u(this,"pointerEvents","none");u(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,zIndex:void 0});u(this,"projection",new Gt);u(this,"enabled",!0);u(this,"canShow",!1);u(this,"visible",!0);u(this,"offscreen",!1);u(this,"strategyIndex",-1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"containerEl");u(this,"contentEl",null);u(this,"contentHtml","");u(this,"style",{top:"0px",left:"0px"});u(this,"dirty",!1);u(this,"collisionDirty",!0);u(this,"visibilityNeedsUpdate","show");u(this,"animation",null);u(this,"currentStrategyIndex",-1);u(this,"onStrategySelected",(e,r=!1)=>{if(this.currentStrategyIndex===e||r)return;this.currentStrategyIndex=e,this.activeAnchor=this.strategies[e].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:n,height:i}=this.dimensions,o=-i/2+"px",a=-n/2+"px";switch(this.style.top=o,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-i+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-n+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-i+"px",this.style.left=-n+"px";break}case"top-right":{this.style.top=-i+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-n+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(r==null?void 0:r.id)||N(),this.options={...this.options,...r},typeof r.rank=="string")this.rank=ct(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let i=Math.trunc(x.env.NODE_ENV==="test"?dt.testId:dt.testId*10)/10;dt.testId+=.001,this.rank=i}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let n=document.createElement("div");n.style.opacity="0",n.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=n.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,r){if(e!=null&&r!=null)this.dimensions={width:e,height:r};else{let{width:n,height:i}=this.containerEl.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){let{width:e,height:r}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:()=>{let o=r/2,a=r/2,s=e/2,l=e/2;switch(i){case"top":{o=r,a=0;break}case"bottom":{o=0,a=r;break}case"left":{s=e,l=0;break}case"right":{s=0,l=e;break}case"top-left":{o=r,s=e,a=0,l=0;break}case"top-right":{o=r,l=e,a=0,s=0;break}case"bottom-left":{a=r,s=e,o=0,l=0;break}case"bottom-right":{a=r,l=e,o=0,s=0;break}}return[o+nr,a+nr,s+nr,l+nr]}}))}toPackedMessage(e=!1){return this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0,this.visible&&e&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,n)=>[...r.getBoundingBox(),n]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(dt,"testId",0);var pi=dt;f();var ke=class t extends ye{constructor(r){super();u(this,"childrenIds",new Set);u(this,"children",[]);u(this,"type","group-container");u(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});u(this,"components",[]);this.userData.entityId=r}addEntity(r){r instanceof t?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof he?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id)):r instanceof oe?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof ie&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof t?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof he?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof oe?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof ie&&r.object3d&&(this.childrenIds.delete(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(r){this.visible=r,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(r){this.position.z=r,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};f();f();function ir(t){"@babel/helpers - typeof";return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(t)}var Zs=/^\s+/,$s=/\s+$/;function b(t,e){if(t=t||"",e=e||{},t instanceof b)return t;if(!(this instanceof b))return new b(t,e);var r=Ws(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,o,a,s;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*a+.0722*s},setAlpha:function(e){return this._a=xi(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=mi(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=mi(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=hi(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=hi(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return gi(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Xs(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(A(this._r,255)*100)+"%",g:Math.round(A(this._g,255)*100)+"%",b:Math.round(A(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(A(this._r,255)*100)+"%, "+Math.round(A(this._g,255)*100)+"%, "+Math.round(A(this._b,255)*100)+"%)":"rgba("+Math.round(A(this._r,255)*100)+"%, "+Math.round(A(this._g,255)*100)+"%, "+Math.round(A(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ul[gi(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+yi(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=b(e);n="#"+yi(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return b(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(tl,arguments)},brighten:function(){return this._applyModification(rl,arguments)},darken:function(){return this._applyModification(nl,arguments)},desaturate:function(){return this._applyModification(Js,arguments)},saturate:function(){return this._applyModification(Qs,arguments)},greyscale:function(){return this._applyModification(el,arguments)},spin:function(){return this._applyModification(il,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(sl,arguments)},complement:function(){return this._applyCombination(ol,arguments)},monochromatic:function(){return this._applyCombination(ll,arguments)},splitcomplement:function(){return this._applyCombination(al,arguments)},triad:function(){return this._applyCombination(bi,[3])},tetrad:function(){return this._applyCombination(bi,[4])}};b.fromRatio=function(t,e){if(ir(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Ot(t[n]));t=r}return b(t,e)};function Ws(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=pl(t)),ir(t)=="object"&&(me(t.r)&&me(t.g)&&me(t.b)?(e=Ys(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):me(t.h)&&me(t.s)&&me(t.v)?(n=Ot(t.s),i=Ot(t.v),e=Ks(t.h,n,i),a=!0,s="hsv"):me(t.h)&&me(t.s)&&me(t.l)&&(n=Ot(t.s),o=Ot(t.l),e=qs(t.h,n,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=xi(r),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function Ys(t,e,r){return{r:A(t,255)*255,g:A(e,255)*255,b:A(r,255)*255}}function hi(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),o,a,s=(n+i)/2;if(n==i)o=a=0;else{var l=n-i;switch(a=s>.5?l/(2-n-i):l/(n+i),n){case t:o=(e-r)/l+(e<r?6:0);break;case e:o=(r-t)/l+2;break;case r:o=(t-e)/l+4;break}o/=6}return{h:o,s:a,l:s}}function qs(t,e,r){var n,i,o;t=A(t,360),e=A(e,100),r=A(r,100);function a(c,d,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?c+(d-c)*6*m:m<1/2?d:m<2/3?c+(d-c)*(2/3-m)*6:c}if(e===0)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:n*255,g:i*255,b:o*255}}function mi(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),o,a,s=n,l=n-i;if(a=n===0?0:l/n,n==i)o=0;else{switch(n){case t:o=(e-r)/l+(e<r?6:0);break;case e:o=(r-t)/l+2;break;case r:o=(t-e)/l+4;break}o/=6}return{h:o,s:a,v:s}}function Ks(t,e,r){t=A(t,360)*6,e=A(e,100),r=A(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,c=[r,a,o,o,s,r][l],d=[s,r,r,a,o,o][l],m=[o,o,s,r,r,a][l];return{r:c*255,g:d*255,b:m*255}}function gi(t,e,r,n){var i=[Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Xs(t,e,r,n,i){var o=[Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16)),Q(_i(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function yi(t,e,r,n){var i=[Q(_i(n)),Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16))];return i.join("")}b.equals=function(t,e){return!t||!e?!1:b(t).toRgbString()==b(e).toRgbString()};b.random=function(){return b.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Js(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.s-=e/100,r.s=or(r.s),b(r)}function Qs(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.s+=e/100,r.s=or(r.s),b(r)}function el(t){return b(t).desaturate(100)}function tl(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.l+=e/100,r.l=or(r.l),b(r)}function rl(t,e){e=e===0?0:e||10;var r=b(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),b(r)}function nl(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.l-=e/100,r.l=or(r.l),b(r)}function il(t,e){var r=b(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,b(r)}function ol(t){var e=b(t).toHsl();return e.h=(e.h+180)%360,b(e)}function bi(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=b(t).toHsl(),n=[b(t)],i=360/e,o=1;o<e;o++)n.push(b({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}function al(t){var e=b(t).toHsl(),r=e.h;return[b(t),b({h:(r+72)%360,s:e.s,l:e.l}),b({h:(r+216)%360,s:e.s,l:e.l})]}function sl(t,e,r){e=e||6,r=r||30;var n=b(t).toHsl(),i=360/r,o=[b(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(b(n));return o}function ll(t,e){e=e||6;for(var r=b(t).toHsv(),n=r.h,i=r.s,o=r.v,a=[],s=1/e;e--;)a.push(b({h:n,s:i,v:o})),o=(o+s)%1;return a}b.mix=function(t,e,r){r=r===0?0:r||50;var n=b(t).toRgb(),i=b(e).toRgb(),o=r/100,a={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return b(a)};b.readability=function(t,e){var r=b(t),n=b(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};b.isReadable=function(t,e,r){var n=b.readability(t,e),i,o;switch(o=!1,i=hl(r),i.level+i.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o};b.mostReadable=function(t,e,r){var n=null,i=0,o,a,s,l;r=r||{},a=r.includeFallbackColors,s=r.level,l=r.size;for(var c=0;c<e.length;c++)o=b.readability(t,e[c]),o>i&&(i=o,n=b(e[c]));return b.isReadable(t,n,{level:s,size:l})||!a?n:(r.includeFallbackColors=!1,b.mostReadable(t,["#fff","#000"],r))};var Lr=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ul=b.hexNames=cl(Lr);function cl(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function xi(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function A(t,e){dl(t)&&(t="100%");var r=fl(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function or(t){return Math.min(1,Math.max(0,t))}function Z(t){return parseInt(t,16)}function dl(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function fl(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Q(t){return t.length==1?"0"+t:""+t}function Ot(t){return t<=1&&(t=t*100+"%"),t}function _i(t){return Math.round(parseFloat(t)*255).toString(16)}function vi(t){return Z(t)/255}var J=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function me(t){return!!J.CSS_UNIT.exec(t)}function pl(t){t=t.replace(Zs,"").replace($s,"").toLowerCase();var e=!1;if(Lr[t])t=Lr[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=J.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=J.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=J.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=J.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=J.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=J.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=J.hex8.exec(t))?{r:Z(r[1]),g:Z(r[2]),b:Z(r[3]),a:vi(r[4]),format:e?"name":"hex8"}:(r=J.hex6.exec(t))?{r:Z(r[1]),g:Z(r[2]),b:Z(r[3]),format:e?"name":"hex"}:(r=J.hex4.exec(t))?{r:Z(r[1]+""+r[1]),g:Z(r[2]+""+r[2]),b:Z(r[3]+""+r[3]),a:vi(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=J.hex3.exec(t))?{r:Z(r[1]+""+r[1]),g:Z(r[2]+""+r[2]),b:Z(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function hl(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var Gr=zi(oi());var jr=h.object({rank:h.union([h.enum(["low","medium","high","always-visible"]),h.number()]).optional(),interactive:h.boolean().optional(),appearance:h.object({margin:h.number().min(6).optional(),text:h.object({numLines:h.number().optional(),lineHeight:h.number().optional(),size:h.number().optional(),maxWidth:h.number().optional(),foregroundColor:h.string().optional(),backgroundColor:h.string().optional()}).optional(),marker:h.object({size:h.number().optional(),foregroundColor:h.object({active:h.string().optional(),inactive:h.string().optional()}).optional(),backgroundColor:h.object({active:h.string().optional(),inactive:h.string().optional()}).optional()}).optional()}).optional()});function td(t,e,r){h.array(h.number()).length(2).parse(t),h.string().parse(e),jr.parse(r||{})}var ft={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},ml={lightOnDark:{...ft,text:{...ft.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...ft.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...ft,text:{...ft.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...ft.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},gl="LOW_PRIORITY",Ti=4,yl=6,bl=20,vl=2.5,xl=2,_l="cover",Si=.5,Mi=6.5,ki={heightAbovePolygon:0,appearance:ml.darkOnLight};var pt=class pt{constructor(e,r,n){u(this,"lines",0);u(this,"id");u(this,"rank");u(this,"type","label");u(this,"initialRank");u(this,"contextConfigured",!1);u(this,"fillText");u(this,"newStyle",{});u(this,"opacity",0);u(this,"visibilityNeedsUpdate",!1);u(this,"text");u(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});u(this,"projection",new Gt);u(this,"_cache",{});u(this,"appearance");u(this,"options");u(this,"visible",!0);u(this,"enabled",!0);u(this,"offscreen",!1);u(this,"canShow",!1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"currentStrategyIndex",-1);u(this,"totalMarkerSize",0);u(this,"dirty",!0);u(this,"collisionDirty",!0);u(this,"lastTextAlign");u(this,"imageHash");u(this,"markerSize",0);u(this,"iconVisible",!1);u(this,"zoomProportion",0);u(this,"dp");u(this,"animate",!0);u(this,"onStrategySelected",e=>{if(this.currentStrategyIndex===e)return;let r=this.strategies[e];r&&r.onStrategySelected(this),this.currentStrategyIndex=e;let n=this.style;this.style=this.newStyle,this.newStyle=n});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=r.id)!=null?o:N(),this.options=(0,Gr.default)({},r,ki),this.text=e,this.dp=(s=1)=>s*n.pixelRatio,typeof r.rank=="string")this.rank=ct(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let s=Math.trunc(x.env.NODE_ENV==="test"?pt.testId:pt.testId*10)/10;pt.testId+=.001,this.rank=s,this.initialRank=s}let i=(0,Gr.default)({},this.options.appearance,ki.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||b(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||b(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||bl,iconPadding:(a=i.marker.iconPadding)!=null?a:xl,iconFit:i.marker.iconFit||_l,iconVisibilityThreshold:i.marker.iconVisibilityThreshold==null?Si:i.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=Si}=this.appearance.marker,r=this.dp();this.zoomProportion<=e&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(Mi)),this.totalMarkerSize=Math.ceil((this.markerSize+vl)/r)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:r}=this.dimensions,{margin:n}=this.appearance;this.calculateMarkerSize();let i=Math.max(yl,n),o=this.iconVisible?i/2:0,a=this.iconVisible?this.totalMarkerSize:Mi*2,s=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+Ti,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-e-this.totalMarkerSize/2-Ti,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[r+this.totalMarkerSize/2/l+i,this.totalMarkerSize/2+i,e/2+i,e/2+i]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:gl,getBoundingBox:()=>[a/2+o,a/2+o,a/2+o,a/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:s}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,n)=>[...r.getBoundingBox(),n]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(pt,"testId",0);var Nr=pt,rd=Nr;f();f();var wi=class extends yt{constructor(r,n){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"textSet",new Set);u(this,"batchedTextMap",new Map);u(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var s,l,c;let n,i,o,a=[];for(let d of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(d),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let m=(s=i.mesh)==null?void 0:s.parent;if(!m||!(m instanceof ke)||!(i instanceof sr))continue;if((l=i.feature.properties)!=null&&l.textArea&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((c=i.feature.properties)==null?void 0:c.textArea.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Fr().then(({BatchedText:I})=>{let C=new I;return C.type="batchedtext",m.add(C),C}));let D=this.batchedTextMap.get(m);if(!D)throw new Error("batched text required");a.push(Tl({entityId:d,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:D,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let w=this.batchedTextMap.get(m);i.textMesh&&w&&Promise.all([w,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([D,{meshComponent:I,styleComponent:C}])=>{let{textMesh:L}=I;if(D&&L){let G=Vr(D,L);I.visible&&!G?D.add(L):!I.visible&&G&&D.remove(L)}C.flipToFaceCamera&&this.flipIfNeeded(I,r)})}return Promise.all(a)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let o=i.rotation.z,a=er(o+n);a>Math.PI/2&&a<3*Math.PI/2&&(i.rotation.z=er(o+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"){n=r.components[0];let o=n.feature.properties.textArea;if(!o)continue;let a=new tn(o.maxWidth,o.maxHeight),s=new en(a,new Qr({color:"pink"})),{textMesh:l}=n;if(!l)continue;let c=this.convertTo3DMapPosition(o.position,At);s.position.copy(c),s.position.z=l.position.z-.1,s.rotation.z=l.rotation.z,Br.identity(),Br.makeRotationAxis(new z(0,0,1),l.userData.rotationZ),At.set(o.maxWidth/2,0,0),At.applyMatrix4(Br),s.position.x-=At.x,s.position.y-=At.y,this.rendererState.entityScene.add(s),this.debugTextAreaMesh.set(i,s)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}},Br=new gt,At=new z,zr;async function fd(t){let{preloadFont:e}=await Fr();return e(t)}function Fr(){return zr||(zr=import("./text3d-ZKED4HTQ.js").then(t=>t)),zr}async function Tl({entityId:t,textComponent:e,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o}){return Promise.all([Fr(),Promise.resolve({entityId:t,meshComponent:e,styleComponent:r})]).then(([{createTroikaText:a},s])=>a(s.entityId,s.meshComponent,s.styleComponent,n)).catch(a=>{se.warn("Trouble creating text: ",a)}).then(a=>{if(a!=null&&a.text){if(e.polygonEntityId){let s=o.geometry3DMap.get(e.polygonEntityId);if((s==null?void 0:s.type)==="geometry"){let l=s.components[0],c=s.components[1];l.textMesh=a.text,l.mesh!=null&&(a.text.position.z=c.altitude+c.height+Sl)}}return Promise.all([Promise.resolve(a.text),i])}}).then(a=>{if(!a)return;let[s,l]=a;l.add(s),e.batchedText||(e.batchedText=l)})}function Vr(t,e){return t._members.has(e)}var Sl=.5;var Ml=h.object({visible:h.boolean(),color:h.string(),flipToFaceCamera:h.boolean(),font:h.string().optional(),fontSize:h.number(),margin:h.union([h.number(),h.tuple([h.number(),h.number(),h.number(),h.number()])]),outlineColor:h.string(),outlineOpacity:h.number(),outlineBlur:h.union([h.number(),h.string()]),outlineWidth:h.number(),outlineOffsetX:h.number(),outlineOffsetY:h.number(),strokeWidth:h.number(),maxWidth:h.number().optional(),maxHeight:h.number().optional(),strokeOpacity:h.number(),strokeColor:h.string(),fillOpacity:h.number(),hoverColor:h.string().optional(),id:h.union([h.string(),h.number()]),type:h.literal("text3d"),position:h.tuple([h.number(),h.number(),h.number()]),content:h.string()}),Di=Ml.partial().omit({id:!0,type:!0}).strict(),Ci=Di.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),vd=h.object({appearance:Di.optional(),parentId:h.string().optional()}).strict(),sr=class{constructor(e){u(this,"mesh",new Ke);u(this,"textMesh");u(this,"type","text3d");u(this,"feature");u(this,"parent");u(this,"batchedText");u(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?Vr(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};function Pt(t,e,r){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="marker"||t.type==="label"||t.type==="geometry"||t.type==="group-container")return e===!0?(t instanceof he&&t.components[1]===void 0?(t.components[1]=new ut,t.components[1].dirty=!0):t instanceof ie&&t.components[2]===void 0?(t.components[2]=new ut,t.components[2].dirty=!0):t instanceof ke&&t.components[1]===void 0&&(t.components[1]=new ut,t.components[1].dirty=!0),!0):(t instanceof he?t.components[1]=void 0:t instanceof ie?t.components[2]=void 0:t instanceof ke&&(t.components[1]=void 0),!0);if(t.type==="geometry-group"){let n;for(let i of t.userData.entities3D.values())n=r.geometry3DMap.get(i),Pt(n,e,r);return!0}}return!1}function Ld(t,e,r){if(!(!(r!=null&&r.color)&&!(r!=null&&r.topColor))){if(r!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let n,i,o=t.components[0];for(let a of t.userData.entities3D.values())n=e.geometry3DMap.get(a),n&&(i=n.components[1],i.color===o.color&&(i.initialColor=r.color||o.color,i.color=r.color||o.color,i.dirty=!0),i.topColor===o.topColor&&(i.topColor=r.topColor||o.topColor,i.dirty=!0));return r.color!==void 0&&(o.color=r.color,o.dirty=!0),r.topColor!==void 0&&(o.topColor=r.topColor,o.dirty=!0),!0}return!1}}function Gd(t,e){if(e!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let r=t.components[0];return r.shading=r.shading||{},r.shading&&(e.start!==r.shading.start||e.end!==r.shading.end||e.intensity!==r.shading.intensity)&&(Object.assign(r.shading,e),t.userData.shadingDirty=!0),!0}return!1}function Nd(t,e){e!==void 0&&t.type==="geometry"&&(e.showImage!==void 0&&(t.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(t.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}function jd(t,e,r){var n;if(r!==void 0){if(t.type==="geometry"){let i=t.components[1];if(i.height!==r)return i.height=r,i.dirty=!0,((n=t.parentObject3D)==null?void 0:n.type)==="geometry-group"&&(t.parentObject3D.userData.outlineDirty=!0),!0}else if(t.type==="geometry-group"){let i=t.components[0];for(let o of t.userData.entities3D.values()){let a=e.geometry3DMap.get(o),s;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(s=a.components[1],s.height===i.height&&(a.components[1].height=r,a.components[1].dirty=!0))}return t.components[0].height=r,t.userData.outlineDirty=!0,!0}}return!1}function wl(t,e){e!==void 0&&(t.type==="path"||t.type==="geometry")&&(e.initialColor!==void 0&&(t.components[1].initialColor=e.initialColor),e.color!==void 0&&(t.components[1].color=e.color),e.topColor!==void 0&&(t.components[1].topColor=e.topColor),t.components[1].dirty=!0)}function Bd(t,e,r){e!==void 0&&(t.type==="label"||t.type==="marker"?(t.object3d.position.copy(r(e[1],e[0],e[2]||0)),t.positionDirty=!0):t.type==="custom-geometry"&&t.components[0].position.copy(r(e[1],e[0],e[2]||0)))}function zd(t,e){var r;return e!==void 0&&(t.type==="marker"||t.type==="label"||t.type==="custom-geometry")&&t.parentObject3D!==e&&t.parentObject3D instanceof ke?((r=t.parentObject3D)==null||r.removeEntity(t),e.addEntity(t),!0):!1}function Fd(t,e){e!==void 0&&(t.type==="marker"||t.type==="label")&&t.components[0].enabled!==e&&(t.components[0].enabled=e)}function Vd(t,e,r){if(e!==void 0&&t.type==="marker"){let n=t.components[0];if(e.contentHTML!==void 0)return n.containerEl.innerHTML=e.contentHTML,!0;if(e.anchor!==void 0&&(n.options.anchor=e.anchor,n.collisionDirty=!0),e.dynamicResize!==void 0)return n.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{Rr.parse(e.options||{})}catch(i){return se.error(i),!1}return e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Pt(t,!1,r)):(n.pointerEvents="none",Pt(t,e.options.interactive,r)),Ei(t,e.options.rank),!0}}return!1}function Ei(t,e){return e!==void 0&&(t.type==="marker"||t.type==="label")?(t.components[0].rank=ct(e),!0):!1}function Ud(t,e,r){var n,i,o,a,s;if(e!==void 0&&t.type==="label"){let l=t.components[0];e.text!==void 0&&(l.text=e.text,l.dirty=!0);try{jr.parse(e.options||{})}catch(c){se.error(c);return}((n=e.options)==null?void 0:n.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Hr(l.appearance,((o=e.options)==null?void 0:o.appearance)||{}),l.dirty=!0),Pt(t,(a=e.options)==null?void 0:a.interactive,r),Ei(t,(s=e.options)==null?void 0:s.rank)}}function Hd(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].hoverColor=e,t.components[1].dirty=!0)}function Zd(t,e){if(e!==void 0){let r=t.components[2];if(t.type==="geometry"&&r!=null)return r.hover=e,r.dirty=!0,!0}return!1}function $d(t,e){e!==void 0&&t.type==="image"&&(t.components[1].flipImageToFaceCamera=e)}function Ii(t,e){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry"||t.type==="image"||t.type==="text3d"){t.components[1].visible=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof oe&&(r.userData.outlineDirty=!0)}else t.type==="group-container"||t.type==="geometry-group"?t.setVisible(e):t.type==="label"&&(t.components[0].visible=e);return!0}return!1}function Wd(t,e,r){if(r!==void 0&&t.type==="geometry-group"){let n=t.components[0];for(let i of t.userData.entities3D.values()){let o=e.geometry3DMap.get(i),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===n.opacity&&(o.components[1].opacity=r,o.components[1].dirty=!0))}return t.setOpacity(r),n.opacity=r,!0}return!1}function Yd(t,e){if(e!==void 0&&t.type==="geometry-group"){let r=t.components[0];(e==null?void 0:e.texture)!=null&&r.texture!==(e==null?void 0:e.texture)&&(r.texture=e.texture,r.dirty=!0),(e==null?void 0:e.topTexture)!=null&&r.topTexture!==(e==null?void 0:e.topTexture)&&(r.topTexture=e.topTexture,r.dirty=!0)}}function qd(t,e){if(t.type==="geometry"){let r=!1,n=t.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,r=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,r=!0),r&&t.components[0]instanceof ne){let i=t.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}function Kd(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.opacity!==e){r.opacity=e;let n=t.components[0];n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=t.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}function Xd(t,e){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry")t.components[1].altitude=e,t.components[1].dirty=!0;else if(t.type==="group-container"&&t.altitude!==e)return t.setAltitude(e),!0}return!1}function Jd(t,e){if(e!==void 0){if(t.type==="geometry-group"&&t.components[0]!=null)t.components[0].outline=e,t.userData.outlineDirty=!0;else if(t.type==="geometry"){t.components[1].outline=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof oe&&(r.userData.outlineDirty=!0)}return!0}return!1}function Qd(t,e){return e!==void 0&&t.type==="geometry"&&t.components[0]&&t.components[0]instanceof ne?(t.components[0].focusable=e,!0):!1}function ef(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.renderOrder!==e){r.renderOrder=e;let n=t.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=e+1),r.dirty=!0,!0}}return!1}function tf(t,e){let{visible:r,color:n}=e;if(t.type!=="path")return;let i=t.components[0];r!=null&&Ii(t,r),n!=null&&wl(t,{color:n}),Object.assign(i,Dl(e)),Ur(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}function Dl(t){return lr(t,Cl)}var Cl=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function rf(t){if(!(t instanceof ie&&t.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var El=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function nf(t,e){Ii(t,e.visible);let r=t.components[1],n=lr(e,El);"margin"in e&&se.warn("update to margin is not supported atm"),"content"in e&&se.warn("content update is not supported atm");try{Ci.parse(n)}catch(i){se.error(i);return}Object.keys(n).length>0&&(Object.assign(r,n),r.dirty=!0)}f();f();f();f();var ur=class extends rn{constructor(r){let n=r,i=3,o=i*4;super(new Float32Array(r*o),i,r,Jr,Xr);u(this,"_width");u(this,"_height");u(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(r,n,i){let o=this.image.data,a=r*this._width;o[a]=n.r,o[a+1]=n.g,o[a+2]=n.b,o[a+3]=0,o[a+4]=i.r,o[a+5]=i.g,o[a+6]=i.b,o[a+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,o=new ae(n[i],n[i+1],n[i+2]),a=new ae(n[i+4],n[i+5],n[i+6]);return{color:o,topColor:a}}setTexture(r,n,i){let o=this.image.data,a=r*this._width;o[a+8]=n?1:0,o[a+9]=i?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};var Oi="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Ai="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var Pl=-.05,Rl=1,Rt=class extends sn{constructor(r,n,i=1){super(r);u(this,"propertiesTexture");u(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});u(this,"showTextures",r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)});this.propertiesTexture=new ur(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,s=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,c=this.uniforms.uTopTexture,d=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=Oi,o.fragmentShader=Ai,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:s,uGradientStart:l,uMinSideAlpha:{value:Pl},uMaxSideAlpha:{value:Rl},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:c,uTexture:d,uRepeatYFactor:m})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=mt,r.wrapT=mt,r.colorSpace=dr,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=mt,r.wrapT=mt,r.colorSpace=dr,this.uniforms.uTopTexture.value=r}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};f();var Pi="mappedin";var Gl=80;function jf(t,e){var s,l,c;let r=0;for(let d of t)r+=((l=(s=d.components[0])==null?void 0:s.geometry)==null?void 0:l.attributes.position.count)||0;let n=new ae(e.color),i;i=new Rt({color:n,side:e.side==="back"?qr:e.side==="front"?Yr:Kr,opacity:(c=e.opacity)!=null?c:1,transparent:e.opacity!==void 0?e.opacity<1:!1},t.length);let o=new Se(t.length,r,0,i),a;for(let d of t)a=d.components[0],!(!(a instanceof ne)||!a.geometry)&&(a.mesh=o,a.material=i,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=d.id,i instanceof Rt&&i.setColor(a.instanceIndex,n,e.topColor?new ae(e.topColor):n));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}function Zr(t,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let r=new an(t,Gl),n=Nl(e.color.getHexString()),i=new on({linewidth:1,color:n,transparent:!0}),o=new Nt(r,i);return o.layers.set(1),o}function Nl(t){return b(t).darken(30).toRgbString()}f();function Ri(t){t&&(t.map&&(t.map.dispose(),t.map=void 0),t.dispose())}function cr(t){for(let e=t.children.length-1;e>=0;e--)cr(t.children[e]);"geometry"in t&&t.geometry&&t.geometry.dispose(),t.parent&&t.parent.remove(t),"material"in t&&Array.isArray(t.material)?t.material.forEach(function(e){Ri(e)}):"material"in t&&typeof t.material<"u"&&Ri(t.material)}var Lt,ht,$r=class{constructor(e){u(this,"rendererState");u(this,"dirty",!0);V(this,Lt,!0);V(this,ht,0);this.rendererState=e}get geometries3DDirty(){return E(this,Lt)}set geometries3DDirty(e){P(this,Lt,e)}update(e,r=!1){var o,a;let n;if(this.geometries3DDirty){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(l),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let c=n.children[0];n.userData.outlineDirty=!1;let d=lt(n);if(d&&cr(d),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let m;if(c instanceof Se){let I=[],C,L,G,ee;for(let $ of n.userData.entities3D)ee=this.rendererState.geometry3DMap.get($),(ee==null?void 0:ee.type)==="geometry"&&(L=ee.components[0],G=ee.components[1],L instanceof ne&&G.visible&&G.opacity>0&&G.outline&&!L.detached&&(C=L==null?void 0:L.geometry,C&&I.push(C)));I.length>0&&(m=dn(I))}else m=c.geometry;m&&(s=Zr(m,c.material),s.position.z=n.altitude,s.userData.outlineOfEntityId=n.userData.entityId);let w,D;for(let I of n.userData.entities3D.values()){let C=this.rendererState.geometry3DMap.get(I);(C==null?void 0:C.type)==="geometry"&&(w=C.components[0],D=C.components[1],s&&(C==null?void 0:C.type)==="geometry"&&!w.detached?(C.components[0].outline=s,(o=n.parent)==null||o.add(s)):(C==null?void 0:C.type)==="geometry"&&w.geometry!=null&&w.material!=null&&w.detached&&(w.outline&&cr(w.outline),D&&D.opacity>0&&D.visible&&D.outline&&(w.outline=Zr(w.geometry,w.material),(a=n.parent)==null||a.add(w.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=r?Li(e,16,19,0,1):E(this,ht);if((i!==E(this,ht)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(s=this.rendererState.geometry3DMap.get(l),(s==null?void 0:s.type)==="geometry-group"&&s.components[0]!=null&&s.components[0].outline&&s.visible){let c=lt(s);if(c&&c.visible){let d=Array.isArray(c.material)?c.material:[c.material];for(let m of d)m.opacity=Math.min(i,s.components[0].opacity)}}else if((s==null?void 0:s.type)==="geometry"&&s.components[0]instanceof ne&&s.components[0].detached){let c=s.components[0].outline;if(c){let d=Array.isArray(c.material)?c.material:[c.material];for(let m of d)m.opacity=Math.min(i,s.components[1].opacity)}}}P(this,ht,i),this.dirty=!1}};Lt=new WeakMap,ht=new WeakMap;var oe=class extends ye{constructor(r,n=new rr){super();u(this,"visible",!0);u(this,"type","geometry-group");u(this,"components");u(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=r}setVisible(r){this.visible=r;let n=lt(this);n&&(n.visible=r),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(r){this.userData.opacity=r}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let r;for(let i of this.children)if(!i.userData.detached){r=i;break}return r instanceof Se?Object.values(r.userData.entities)[0]:void 0}setAltitude(r){this.position.z=r,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};var Ke=class extends ye{constructor(){super(...arguments);u(this,"type","geometry");u(this,"userData",{entityId:"",type:"geometry"})}},ie=class{constructor(e,r){u(this,"id",N());u(this,"components");u(this,"entities2D",new Map);this.components=[e,r]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}addEntity(e){this.parentObject3D instanceof oe?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var r;(r=e.parentObject3D)==null||r.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};f();function zl(t){let e=t.min,r=t.max,n=new z(e.x,e.y,e.z),i=new z(r.x,e.y,e.z),o=new z(e.x,r.y,e.z),a=new z(r.x,r.y,e.z);return[n,i,o,a]}f();function Fl(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}f();function Vl(t,e,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&t(...o);let a=()=>{(!r||i>1)&&t(...o),n=null,i=0};clearTimeout(n),n=setTimeout(a,e)}}f();var Ul=(()=>{let t;return{getDeviceType(){if(t)return t;let{userAgent:e,platform:r,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),o=r==="iPad"||r.indexOf("Mac")===0&&n>0&&!window.MSStream,a=/android/i.test(e);return t={isIpad:o,isMobile:a||i||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},t},_reset(){t=void 0}}})(),Gi=Ul.getDeviceType,Ni=(()=>{let t,e,r;function n(){if(e!==void 0)return e;t||(t=document.createElement("canvas"));let o=t.getContext("webgl")||t.getContext("experimental-webgl");if(!o)return e;try{let a=Gi().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let s=new Error("Failed getting device info");throw s.name="FailedGettingDeviceInfo",s}}function i(){var a,s;if(!Gi().isWindows)return!1;if(r!==void 0)return r;let o=(s=(a=Hl())==null?void 0:a.toLowerCase())!=null?s:"";return r=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),r}return{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){t=o,e=void 0,r=void 0}}})(),Hl=Ni.getInfo,Zl=Ni.shouldDisableOffscreenCanvas;f();function lr(t,e){let r={};for(let n=0;n<e.length;n++){let i=e[n];i in t&&(r[i]=t[i])}return r}function Ur(t){return Object.keys(t).length===0}f();var $l=t=>e=>{if(!e.includes("mappedin")){let r={};for(let n in t){let i=t[n];e.includes("mappedin")||(t[n]=i)}return{url:e,headers:r}}return{url:e,headers:t}};function jp(t,e,r,n){let i=t*(Math.PI/180),o=n/Ce,a=t+o*180/Math.PI,s=r/Ce/Math.cos(i),l=e+s*180/Math.PI;return{lat:a,lon:l}}function Bp(t,e,r,n){let i=r*(Math.PI/180),o=n*(Math.PI/180),a=t*(Math.PI/180),s=e*(Math.PI/180),l=i-a,c=o-s,d=Ce*c*Math.cos(a),m=Ce*l;return{x:d,y:m}}var Wl=(t,e)=>{var r;if(t.children&&t.visible)for(let n of t.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((r=n.userData)!=null&&r.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let i of n.userData.entities3D.values())e.add(i)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof Ke)&&e.add(n.userData.entityId);Wl(n,e)}return e},Yl=(t,e)=>{var r;if(t.children&&t.visible&&!((r=t.userData)!=null&&r.hidden))for(let n of t.children)n.visible&&n instanceof We&&e.add(n.userData.entityId),Yl(n,e);return e};function Hr(t,e){for(let r in e){if(e[r]==null){t[r]=void 0;continue}typeof e[r]=="object"?Hr(t[r],e[r]):t[r]=e[r]}return t}function zp(t,e,r,n){let i={translateX:t.x,translateY:t.y,translateZ:t.z,scale:t.meterInMercatorCoordinateUnits()},o=new gt,a=new z(i.scale,-i.scale,i.scale),s=new gt().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(a),l=r.elevation;return{id:Pi,type:"custom",renderingMode:"3d",render:(c,d)=>{if(o.fromArray(d),l!==r.elevation){let m=cn.fromLngLat(t.toLngLat(),r.elevation);s.makeTranslation(i.translateX,i.translateY,-m.z).scale(a)}e.projectionMatrix=o.multiply(s),l=r.elevation,n()}}}function ql(t){return fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function Fp(t){let e=await ql(t),{access_token:r}=await e.json();return{"x-mappedin-tiles-key":r}}function Vp(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i=0,o;i<t.length;i++)o=t.charCodeAt(i),r=Math.imul(r^o,2654435761),n=Math.imul(n^o,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)}var Kl=t=>t;var Up=t=>1-Math.cos(t*Math.PI/2);function Li(t,e,r,n,i,o=Kl){t=Math.max(e,Math.min(t,r));let a=(t-Math.min(e,r))/Math.abs(r-e),s=o(a);return n+s*(i-n)}function Hp(t,e,r){let n=t*(Math.PI/180)/2,i=e/2;return r*Math.tan(n)/i}function Zp(t,e){let r;return typeof e=="string"||typeof e=="number"?(r=t.geometry2DMap.get(e),r==null&&(r=t.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(r=t.geometry2DMap.get(e.id),r==null&&(r=t.geometry3DMap.get(e.id))):r=e,r}function $p(t){return new un(new fr(t[0][0],t[0][1]),new fr(t[1][0],t[1][1])).getCenter().toArray()}function Wp(t){return Number.isFinite(t.min.x)&&Number.isFinite(t.min.y)&&Number.isFinite(t.max.x)&&Number.isFinite(t.max.y)&&(t instanceof ln||Number.isFinite(t.min.z)&&Number.isFinite(t.max.z))}f();var Wr=class{constructor(e){u(this,"visible");u(this,"altitude");u(this,"color");u(this,"dirty",!0);u(this,"maxWidth");u(this,"maxHeight");u(this,"hoverByPolygon");u(this,"flipToFaceCamera",ji.flipToFaceCamera);u(this,"font");u(this,"fillOpacity");u(this,"fontSize");u(this,"margin");u(this,"outlineWidth");u(this,"outlineBlur");u(this,"outlineOffsetX");u(this,"strokeColor");u(this,"strokeOpacity");u(this,"strokeWidth");u(this,"hoverColor");u(this,"outlineOffsetY");u(this,"outlineColor");u(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let r={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(r[n]=this[n]);return r}},ji=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});f();export{Fi as a,Xl as b,se as c,Ce as d,au as e,su as f,lu as g,uu as h,fu as i,yt as j,N as k,hr as l,Ye as m,Bs as n,Vu as o,li as p,Uu as q,Hu as r,Zu as s,$u as t,Wu as u,Yu as v,Qu as w,Fs as x,ec as y,ui as z,h as A,oi as B,Ar as C,Pr as D,Se as E,ne as F,rr as G,lt as H,Ec as I,Nc as J,pi as K,he as L,Ke as M,ie as N,Pi as O,zl as P,Fl as Q,Vl as R,Zl as S,lr as T,$l as U,er as V,jp as W,Bp as X,Wl as Y,Yl as Z,zp as _,Fp as $,Vp as aa,Kl as ba,Up as ca,Li as da,Hp as ea,Zp as fa,$p as ga,Wp as ha,b as ia,td as ja,rd as ka,Wr as la,ji as ma,wi as na,fd as oa,vd as pa,sr as qa,Pt as ra,Ld as sa,Gd as ta,Nd as ua,jd as va,wl as wa,Bd as xa,zd as ya,Fd as za,Vd as Aa,Ud as Ba,Hd as Ca,Zd as Da,$d as Ea,Ii as Fa,Wd as Ga,Yd as Ha,qd as Ia,Kd as Ja,Xd as Ka,Jd as La,Qd as Ma,ef as Na,tf as Oa,Dl as Pa,rf as Qa,El as Ra,nf as Sa,Rt as Ta,jf as Ua,Nl as Va,cr as Wa,$r as Xa,oe as Ya,ke as Za};
|
|
1
|
+
import{h as fr,i as un,j as cn}from"./chunk-OFHRQORP.js";import{a as dn}from"./chunk-VD44EZOA.js";import{$a as ln,A as Gt,Aa as an,H as z,Ha as sn,K as gt,M as ye,N as ae,P as Qr,S as en,Z as tn,b as Yr,c as qr,d as Kr,e as mt,ka as rn,n as Xr,o as Jr,oa as nn,pa as on,ra as Nt,w as dr}from"./chunk-JNSM5T55.js";import{a as f,b as x}from"./chunk-OSMCRNNF.js";import{b as Bi,d as zi,e as u,f as E,g as V,h as P}from"./chunk-H2E2454S.js";var oi=Bi((Mt,ot)=>{f();var Yo=200,jn="__lodash_hash_undefined__",qo=800,Ko=16,Bn=9007199254740991,zn="[object Arguments]",Xo="[object Array]",Jo="[object AsyncFunction]",Qo="[object Boolean]",ea="[object Date]",ta="[object Error]",Fn="[object Function]",ra="[object GeneratorFunction]",na="[object Map]",ia="[object Number]",oa="[object Null]",Vn="[object Object]",aa="[object Proxy]",sa="[object RegExp]",la="[object Set]",ua="[object String]",ca="[object Undefined]",da="[object WeakMap]",fa="[object ArrayBuffer]",pa="[object DataView]",ha="[object Float32Array]",ma="[object Float64Array]",ga="[object Int8Array]",ya="[object Int16Array]",ba="[object Int32Array]",va="[object Uint8Array]",xa="[object Uint8ClampedArray]",_a="[object Uint16Array]",Ta="[object Uint32Array]",Sa=/[\\^$.*+?()[\]{}|]/g,Ma=/^\[object .+?Constructor\]$/,ka=/^(?:0|[1-9]\d*)$/,O={};O[ha]=O[ma]=O[ga]=O[ya]=O[ba]=O[va]=O[xa]=O[_a]=O[Ta]=!0;O[zn]=O[Xo]=O[fa]=O[Qo]=O[pa]=O[ea]=O[ta]=O[Fn]=O[na]=O[ia]=O[Vn]=O[sa]=O[la]=O[ua]=O[da]=!1;var Un=typeof global=="object"&&global&&global.Object===Object&&global,wa=typeof self=="object"&&self&&self.Object===Object&&self,Dt=Un||wa||Function("return this")(),Hn=typeof Mt=="object"&&Mt&&!Mt.nodeType&&Mt,kt=Hn&&typeof ot=="object"&&ot&&!ot.nodeType&&ot,Zn=kt&&kt.exports===Hn,xr=Zn&&Un.process,En=function(){try{var t=kt&&kt.require&&kt.require("util").types;return t||xr&&xr.binding&&xr.binding("util")}catch{}}(),In=En&&En.isTypedArray;function $n(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Da(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Ca(t){return function(e){return t(e)}}function Ea(t,e){return t==null?void 0:t[e]}function Ia(t,e){return function(r){return t(e(r))}}var Oa=Array.prototype,Aa=Function.prototype,Yt=Object.prototype,_r=Dt["__core-js_shared__"],qt=Aa.toString,fe=Yt.hasOwnProperty,On=function(){var t=/[^.]+$/.exec(_r&&_r.keys&&_r.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Wn=Yt.toString,Pa=qt.call(Object),Ra=RegExp("^"+qt.call(fe).replace(Sa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=Zn?Dt.Buffer:void 0,An=Dt.Symbol,Pn=Dt.Uint8Array,Rn=$t?$t.allocUnsafe:void 0,Yn=Ia(Object.getPrototypeOf,Object),Ln=Object.create,La=Yt.propertyIsEnumerable,Ga=Oa.splice,Ze=An?An.toStringTag:void 0,Wt=function(){try{var t=Cr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Na=$t?$t.isBuffer:void 0,Gn=Math.max,ja=Date.now,qn=Cr(Dt,"Map"),wt=Cr(Object,"create"),Ba=function(){function t(){}return function(e){if(!de(e))return{};if(Ln)return Ln(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function $e(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function za(){this.__data__=wt?wt(null):{},this.size=0}function Fa(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Va(t){var e=this.__data__;if(wt){var r=e[t];return r===jn?void 0:r}return fe.call(e,t)?e[t]:void 0}function Ua(t){var e=this.__data__;return wt?e[t]!==void 0:fe.call(e,t)}function Ha(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=wt&&e===void 0?jn:e,this}$e.prototype.clear=za;$e.prototype.delete=Fa;$e.prototype.get=Va;$e.prototype.has=Ua;$e.prototype.set=Ha;function pe(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Za(){this.__data__=[],this.size=0}function $a(t){var e=this.__data__,r=Kt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Ga.call(e,r,1),--this.size,!0}function Wa(t){var e=this.__data__,r=Kt(e,t);return r<0?void 0:e[r][1]}function Ya(t){return Kt(this.__data__,t)>-1}function qa(t,e){var r=this.__data__,n=Kt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}pe.prototype.clear=Za;pe.prototype.delete=$a;pe.prototype.get=Wa;pe.prototype.has=Ya;pe.prototype.set=qa;function at(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Ka(){this.size=0,this.__data__={hash:new $e,map:new(qn||pe),string:new $e}}function Xa(t){var e=Jt(this,t).delete(t);return this.size-=e?1:0,e}function Ja(t){return Jt(this,t).get(t)}function Qa(t){return Jt(this,t).has(t)}function es(t,e){var r=Jt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}at.prototype.clear=Ka;at.prototype.delete=Xa;at.prototype.get=Ja;at.prototype.has=Qa;at.prototype.set=es;function st(t){var e=this.__data__=new pe(t);this.size=e.size}function ts(){this.__data__=new pe,this.size=0}function rs(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function ns(t){return this.__data__.get(t)}function is(t){return this.__data__.has(t)}function os(t,e){var r=this.__data__;if(r instanceof pe){var n=r.__data__;if(!qn||n.length<Yo-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new at(n)}return r.set(t,e),this.size=r.size,this}st.prototype.clear=ts;st.prototype.delete=rs;st.prototype.get=ns;st.prototype.has=is;st.prototype.set=os;function as(t,e){var r=kr(t),n=!r&&Mr(t),i=!r&&!n&&ei(t),o=!r&&!n&&!i&&ri(t),a=r||n||i||o,s=a?Da(t.length,String):[],l=s.length;for(var c in t)(e||fe.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Jn(c,l)))&&s.push(c);return s}function Tr(t,e,r){(r!==void 0&&!Qt(t[e],r)||r===void 0&&!(e in t))&&wr(t,e,r)}function ss(t,e,r){var n=t[e];(!(fe.call(t,e)&&Qt(n,r))||r===void 0&&!(e in t))&&wr(t,e,r)}function Kt(t,e){for(var r=t.length;r--;)if(Qt(t[r][0],e))return r;return-1}function wr(t,e,r){e=="__proto__"&&Wt?Wt(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ls=xs();function Xt(t){return t==null?t===void 0?ca:oa:Ze&&Ze in Object(t)?_s(t):Ds(t)}function Nn(t){return Ct(t)&&Xt(t)==zn}function us(t){if(!de(t)||ks(t))return!1;var e=Ir(t)?Ra:Ma;return e.test(Os(t))}function cs(t){return Ct(t)&&ti(t.length)&&!!O[Xt(t)]}function ds(t){if(!de(t))return ws(t);var e=Qn(t),r=[];for(var n in t)n=="constructor"&&(e||!fe.call(t,n))||r.push(n);return r}function Dr(t,e,r,n,i){t!==e&&ls(e,function(o,a){if(i||(i=new st),de(o))fs(t,e,a,r,Dr,n,i);else{var s=n?n(Sr(t,a),o,a+"",t,e,i):void 0;s===void 0&&(s=o),Tr(t,a,s)}},ni)}function fs(t,e,r,n,i,o,a){var s=Sr(t,r),l=Sr(e,r),c=a.get(l);if(c){Tr(t,r,c);return}var d=o?o(s,l,r+"",t,e,a):void 0,m=d===void 0;if(m){var w=kr(l),D=!w&&ei(l),I=!w&&!D&&ri(l);d=l,w||D||I?kr(s)?d=s:As(s)?d=ys(s):D?(m=!1,d=hs(l,!0)):I?(m=!1,d=gs(l,!0)):d=[]:Ps(l)||Mr(l)?(d=s,Mr(s)?d=Rs(s):(!de(s)||Ir(s))&&(d=Ts(l))):m=!1}m&&(a.set(l,d),i(d,l,n,o,a),a.delete(l)),Tr(t,r,d)}function Kn(t,e){return Es(Cs(t,e,ii),t+"")}var ps=Wt?function(t,e){return Wt(t,"toString",{configurable:!0,enumerable:!1,value:Ns(e),writable:!0})}:ii;function hs(t,e){if(e)return t.slice();var r=t.length,n=Rn?Rn(r):new t.constructor(r);return t.copy(n),n}function ms(t){var e=new t.constructor(t.byteLength);return new Pn(e).set(new Pn(t)),e}function gs(t,e){var r=e?ms(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ys(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function bs(t,e,r,n){var i=!r;r||(r={});for(var o=-1,a=e.length;++o<a;){var s=e[o],l=n?n(r[s],t[s],s,r,t):void 0;l===void 0&&(l=t[s]),i?wr(r,s,l):ss(r,s,l)}return r}function vs(t){return Kn(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,a&&Ss(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var s=r[n];s&&t(e,s,n,o)}return e})}function xs(t){return function(e,r,n){for(var i=-1,o=Object(e),a=n(e),s=a.length;s--;){var l=a[t?s:++i];if(r(o[l],l,o)===!1)break}return e}}function Xn(t,e,r,n,i,o){return de(t)&&de(e)&&(o.set(e,t),Dr(t,e,void 0,Xn,o),o.delete(e)),t}function Jt(t,e){var r=t.__data__;return Ms(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Cr(t,e){var r=Ea(t,e);return us(r)?r:void 0}function _s(t){var e=fe.call(t,Ze),r=t[Ze];try{t[Ze]=void 0;var n=!0}catch{}var i=Wn.call(t);return n&&(e?t[Ze]=r:delete t[Ze]),i}function Ts(t){return typeof t.constructor=="function"&&!Qn(t)?Ba(Yn(t)):{}}function Jn(t,e){var r=typeof t;return e=e==null?Bn:e,!!e&&(r=="number"||r!="symbol"&&ka.test(t))&&t>-1&&t%1==0&&t<e}function Ss(t,e,r){if(!de(r))return!1;var n=typeof e;return(n=="number"?Er(r)&&Jn(e,r.length):n=="string"&&e in r)?Qt(r[e],t):!1}function Ms(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ks(t){return!!On&&On in t}function Qn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Yt;return t===r}function ws(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Ds(t){return Wn.call(t)}function Cs(t,e,r){return e=Gn(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Gn(n.length-e,0),a=Array(o);++i<o;)a[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=r(a),$n(t,this,s)}}function Sr(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var Es=Is(ps);function Is(t){var e=0,r=0;return function(){var n=ja(),i=Ko-(n-r);if(r=n,i>0){if(++e>=qo)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Os(t){if(t!=null){try{return qt.call(t)}catch{}try{return t+""}catch{}}return""}function Qt(t,e){return t===e||t!==t&&e!==e}var Mr=Nn(function(){return arguments}())?Nn:function(t){return Ct(t)&&fe.call(t,"callee")&&!La.call(t,"callee")},kr=Array.isArray;function Er(t){return t!=null&&ti(t.length)&&!Ir(t)}function As(t){return Ct(t)&&Er(t)}var ei=Na||js;function Ir(t){if(!de(t))return!1;var e=Xt(t);return e==Fn||e==ra||e==Jo||e==aa}function ti(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Bn}function de(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Ct(t){return t!=null&&typeof t=="object"}function Ps(t){if(!Ct(t)||Xt(t)!=Vn)return!1;var e=Yn(t);if(e===null)return!0;var r=fe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&qt.call(r)==Pa}var ri=In?Ca(In):cs;function Rs(t){return bs(t,ni(t))}var Ls=Kn(function(t){return t.push(void 0,Xn),$n(Gs,void 0,t)});function ni(t){return Er(t)?as(t,!0):ds(t)}var Gs=vs(function(t,e,r,n){Dr(t,e,r,n)});function Ns(t){return function(){return t}}function ii(t){return t}function js(){return!1}ot.exports=Ls});f();var jt="[MappedinJS]",Fi=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Fi||{});function Xl(t){0<=t&&t<=3&&(fn.logState=t)}var fn={logState:x.env.NODE_ENV==="test"?3:0,log(...t){this.logState<=0&&console.log(jt,...t)},warn(...t){this.logState<=1&&console.warn(jt,...t)},error(...t){this.logState<=2&&console.error(jt,...t)},assert(...t){console.assert(...t)},time(t){console.time(t)},timeEnd(t){console.timeEnd(t)},throw(t,e){throw new Error("".concat(jt," ").concat(t),e)}},se=fn;f();f();var De=class extends Error{};De.prototype.name="InvalidTokenError";function Vi(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let n=r.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Ui(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Vi(e)}catch{return atob(e)}}function pn(t,e){if(typeof t!="string")throw new De("Invalid token specified: must be a string");e||(e={});let r=e.header===!0?0:1,n=t.split(".")[r];if(typeof n!="string")throw new De("Invalid token specified: missing part #".concat(r+1));let i;try{i=Ui(n)}catch(o){throw new De("Invalid token specified: invalid base64 for part #".concat(r+1," (").concat(o.message,")"))}try{return JSON.parse(i)}catch(o){throw new De("Invalid token specified: invalid json for part #".concat(r+1," (").concat(o.message,")"))}}f();var Ce=63710088e-1;function au(t){var r,n;let e=pn(t);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(r=e.aud)!=null?r:[],capabilities:(n=e.capabilities)!=null?n:{}}}function be(t){return t*(Math.PI/180)}function Hi(t){return t*(180/Math.PI)}function hn(t,e){return(t%e+e)%e}function su([t,e],[r,n]){let i=be(n-e),o=be(r-t),a=be(e),s=be(n),l=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(a)*Math.cos(s),c=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return Ce*c}function lu([t,e],[r,n]){let i=be(e),o=be(t),a=be(n),l=be(r)-o,c=Math.sin(l)*Math.cos(a),d=Math.cos(i)*Math.sin(a)-Math.sin(i)*Math.cos(a)*Math.cos(l);return Hi((Math.atan2(c,d)+Math.PI*2)%(Math.PI*2))}function uu(t,e){let r=hn(t,Math.PI*2),n=hn(e,Math.PI*2),i=n-r,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:r,end:o}}f();function fu(t,e,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&t(...o);let a=()=>{(!r||i>1)&&t(...o),n=null,i=0};clearTimeout(n),n=setTimeout(a,e)}}f();f();var yt=class{constructor(){u(this,"_subscribers",{})}publish(e,r){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(r)})}on(e,r){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(r)}off(e,r){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(r);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};f();f();var pr=[0,4,6,8,10],N=()=>{let t=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<t.length;n++)n>0&&!(n&3)&&(e=Math.random()*4294967296),t[n]=e>>>((n&3)<<3)&255;let r=t.map(n=>n.toString(16).padStart(2,"0"));return r[6]="4"+r[6][1],r[8]=["8","9","a","b"].includes(r[7][0])?r[7]:"a"+r[7][1],pr.map((n,i)=>r.slice(n,i===pr.length-1?void 0:pr[i+1]).join("")).join("-")};var mn="mi-session-data",gn="mi-local-data",Ee,q,K,Bt=class Bt{constructor(){V(this,q,void 0);V(this,K,void 0);try{let e=sessionStorage.getItem(mn);e?P(this,q,JSON.parse(e)):P(this,q,{id:N()})}catch{P(this,q,{id:N()})}try{let e=localStorage.getItem(gn);e?P(this,K,JSON.parse(e)):P(this,K,{deviceId:N()})}catch{P(this,K,{deviceId:N()})}E(this,q).id||(E(this,q).id=N()),E(this,K).deviceId||(E(this,K).deviceId=N())}static getInstance(){return E(this,Ee)||P(this,Ee,new Bt),E(this,Ee)}static ___clearInstance(){P(this,Ee,void 0)}saveSessionData(e,r){E(this,q)[e]=r;try{return sessionStorage.setItem(mn,JSON.stringify(E(this,q))),!0}catch{return!1}}loadSessionData(e){let r=E(this,q)[e];if(r!=null)return r}saveLocalData(e,r){E(this,K)[e]=r;try{return localStorage.setItem(gn,JSON.stringify(E(this,K))),!0}catch{return!1}}loadLocalData(e){let r=E(this,K)[e];if(r!=null)return r}};Ee=new WeakMap,q=new WeakMap,K=new WeakMap,V(Bt,Ee,void 0);var hr=Bt;f();var k;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let a of i)o[a]=a;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(let s of o)a[s]=i[s];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},t.find=(i,o)=>{for(let a of i)if(o(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(a=>typeof a=="string"?"'".concat(a,"'"):a).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(k||(k={}));var gr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(gr||(gr={}));var y=k.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ve=t=>{switch(typeof t){case"undefined":return y.undefined;case"string":return y.string;case"number":return isNaN(t)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(t)?y.array:t===null?y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?y.promise:typeof Map<"u"&&t instanceof Map?y.map:typeof Set<"u"&&t instanceof Set?y.set:typeof Date<"u"&&t instanceof Date?y.date:y.object;default:return y.unknown}},p=k.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Zi=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),U=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,l=0;for(;l<a.path.length;){let c=a.path[l];l===a.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(r(a))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,k.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};U.create=t=>new U(t);var Qe=(t,e)=>{let r;switch(t.code){case p.invalid_type:t.received===y.undefined?r="Required":r="Expected ".concat(t.expected,", received ").concat(t.received);break;case p.invalid_literal:r="Invalid literal value, expected ".concat(JSON.stringify(t.expected,k.jsonStringifyReplacer));break;case p.unrecognized_keys:r="Unrecognized key(s) in object: ".concat(k.joinValues(t.keys,", "));break;case p.invalid_union:r="Invalid input";break;case p.invalid_union_discriminator:r="Invalid discriminator value. Expected ".concat(k.joinValues(t.options));break;case p.invalid_enum_value:r="Invalid enum value. Expected ".concat(k.joinValues(t.options),", received '").concat(t.received,"'");break;case p.invalid_arguments:r="Invalid function arguments";break;case p.invalid_return_type:r="Invalid function return type";break;case p.invalid_date:r="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r='Invalid input: must include "'.concat(t.validation.includes,'"'),typeof t.validation.position=="number"&&(r="".concat(r," at one or more positions greater than or equal to ").concat(t.validation.position))):"startsWith"in t.validation?r='Invalid input: must start with "'.concat(t.validation.startsWith,'"'):"endsWith"in t.validation?r='Invalid input: must end with "'.concat(t.validation.endsWith,'"'):k.assertNever(t.validation):t.validation!=="regex"?r="Invalid ".concat(t.validation):r="Invalid";break;case p.too_small:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"more than"," ").concat(t.minimum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at least":"over"," ").concat(t.minimum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(t.minimum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(t.minimum))):r="Invalid input";break;case p.too_big:t.type==="array"?r="Array must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"less than"," ").concat(t.maximum," element(s)"):t.type==="string"?r="String must contain ".concat(t.exact?"exactly":t.inclusive?"at most":"under"," ").concat(t.maximum," character(s)"):t.type==="number"?r="Number must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="bigint"?r="BigInt must be ".concat(t.exact?"exactly":t.inclusive?"less than or equal to":"less than"," ").concat(t.maximum):t.type==="date"?r="Date must be ".concat(t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(t.maximum))):r="Invalid input";break;case p.custom:r="Invalid input";break;case p.invalid_intersection_types:r="Intersection results could not be merged";break;case p.not_multiple_of:r="Number must be a multiple of ".concat(t.multipleOf);break;case p.not_finite:r="Number must be finite";break;default:r=e.defaultError,k.assertNever(t)}return{message:r}},vn=Qe;function $i(t){vn=t}function zt(){return vn}var Ft=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],a={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let s="",l=n.filter(c=>!!c).slice().reverse();for(let c of l)s=c(a,{data:e,defaultError:s}).message;return{...i,path:o,message:s}},Wi=[];function g(t,e){let r=zt(),n=Ft({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Qe?void 0:Qe].filter(i=>!!i)});t.common.issues.push(n)}var R=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return T;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,a=await i.value;n.push({key:o,value:a})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return T;o.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(n[o.value]=a.value)}return{status:e.value,value:n}}},T=Object.freeze({status:"aborted"}),Je=t=>({status:"dirty",value:t}),j=t=>({status:"valid",value:t}),yr=t=>t.status==="aborted",br=t=>t.status==="dirty",xt=t=>t.status==="valid",_t=t=>typeof Promise<"u"&&t instanceof Promise;function Vt(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function xn(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var v;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));var bt,vt,Y=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},yn=(t,e)=>{if(xt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new U(t.common.issues);return this._error=r,this._error}}};function S(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:i}:{errorMap:(a,s)=>{var l,c;let{message:d}=t;return a.code==="invalid_enum_value"?{message:d!=null?d:s.defaultError}:typeof s.data>"u"?{message:(l=d!=null?d:n)!==null&&l!==void 0?l:s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:(c=d!=null?d:r)!==null&&c!==void 0?c:s.defaultError}},description:i}}var M=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return ve(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new R,ctx:{common:e.parent.common,data:e.data,parsedType:ve(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(_t(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},o=this._parseSync({data:e,path:i.path,parent:i});return yn(i,o)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ve(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(_t(i)?i:Promise.resolve(i));return yn(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let a=e(i),s=()=>o.addIssue({code:p.custom,...n(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new H({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this,this._def)}promise(){return Te.create(this,this._def)}or(e){return Ge.create([this,e],this._def)}and(e){return Ne.create(this,e,this._def)}transform(e){return new H({...S(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ve({...S(this._def),innerType:this,defaultValue:r,typeName:_.ZodDefault})}brand(){return new Tt({typeName:_.ZodBranded,type:this,...S(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ue({...S(this._def),innerType:this,catchValue:r,typeName:_.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return St.create(this,e)}readonly(){return He.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yi=/^c[^\s-]{8,}$/i,qi=/^[0-9a-z]+$/,Ki=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xi=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ji=/^[a-z0-9_-]{21}$/i,Qi=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eo=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,to="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",mr,ro=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,no=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,io=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_n="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oo=new RegExp("^".concat(_n,"$"));function Tn(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e="".concat(e,"\\.\\d{").concat(t.precision,"}"):t.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}function ao(t){return new RegExp("^".concat(Tn(t),"$"))}function Sn(t){let e="".concat(_n,"T").concat(Tn(t)),r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(r.join("|"),")"),new RegExp("^".concat(e,"$"))}function so(t,e){return!!((e==="v4"||!e)&&ro.test(t)||(e==="v6"||!e)&&no.test(t))}var xe=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.string,received:o.parsedType}),T}let n=new R,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let a=e.data.length>o.value,s=e.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(e,i),a?g(i,{code:p.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&g(i,{code:p.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")eo.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"email",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")mr||(mr=new RegExp(to,"u")),mr.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"emoji",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Xi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"uuid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ji.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"nanoid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Yi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")qi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid2",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Ki.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ulid",code:p.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),g(i,{validation:"url",code:p.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"regex",code:p.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Sn(o).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?oo.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ao(o).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:p.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Qi.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"duration",code:p.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?so(e.data,o.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ip",code:p.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?io.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64",code:p.invalid_string,message:o.message}),n.dirty()):k.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:p.invalid_string,...v.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...v.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...v.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...v.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...v.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...v.errToObj(r)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};xe.create=t=>{var e;return new xe({checks:[],typeName:_.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...S(t)})};function lo(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}var Ie=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==y.number){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.number,received:o.parsedType}),T}let n,i=new R;for(let o of this._def.checks)o.kind==="int"?k.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:p.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?lo(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_finite,message:o.message}),i.dirty()):k.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&k.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Ie.create=t=>new Ie({checks:[],typeName:_.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...S(t)});var Oe=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==y.bigint){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.bigint,received:o.parsedType}),T}let n,i=new R;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),g(n,{code:p.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):k.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,v.toString(r))}gt(e,r){return this.setLimit("min",e,!1,v.toString(r))}lte(e,r){return this.setLimit("max",e,!0,v.toString(r))}lt(e,r){return this.setLimit("max",e,!1,v.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:v.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Oe.create=t=>{var e;return new Oe({checks:[],typeName:_.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...S(t)})};var Ae=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.boolean,received:n.parsedType}),T}return j(e.data)}};Ae.create=t=>new Ae({typeName:_.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...S(t)});var Pe=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_type,expected:y.date,received:o.parsedType}),T}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return g(o,{code:p.invalid_date}),T}let n=new R,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:p.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):k.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Pe.create=t=>new Pe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_.ZodDate,...S(t)});var et=class extends M{_parse(e){if(this._getType(e)!==y.symbol){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.symbol,received:n.parsedType}),T}return j(e.data)}};et.create=t=>new et({typeName:_.ZodSymbol,...S(t)});var Re=class extends M{_parse(e){if(this._getType(e)!==y.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.undefined,received:n.parsedType}),T}return j(e.data)}};Re.create=t=>new Re({typeName:_.ZodUndefined,...S(t)});var Le=class extends M{_parse(e){if(this._getType(e)!==y.null){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.null,received:n.parsedType}),T}return j(e.data)}};Le.create=t=>new Le({typeName:_.ZodNull,...S(t)});var _e=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return j(e.data)}};_e.create=t=>new _e({typeName:_.ZodAny,...S(t)});var ue=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return j(e.data)}};ue.create=t=>new ue({typeName:_.ZodUnknown,...S(t)});var X=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return g(r,{code:p.invalid_type,expected:y.never,received:r.parsedType}),T}};X.create=t=>new X({typeName:_.ZodNever,...S(t)});var tt=class extends M{_parse(e){if(this._getType(e)!==y.undefined){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.void,received:n.parsedType}),T}return j(e.data)}};tt.create=t=>new tt({typeName:_.ZodVoid,...S(t)});var ce=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==y.array)return g(r,{code:p.invalid_type,expected:y.array,received:r.parsedType}),T;if(i.exactLength!==null){let a=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(a||s)&&(g(r,{code:a?p.too_big:p.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(g(r,{code:p.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(g(r,{code:p.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>i.type._parseAsync(new Y(r,a,r.path,s)))).then(a=>R.mergeArray(n,a));let o=[...r.data].map((a,s)=>i.type._parseSync(new Y(r,a,r.path,s)));return R.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:v.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:v.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:v.toString(r)}})}nonempty(e){return this.min(1,e)}};ce.create=(t,e)=>new ce({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...S(e)});function Xe(t){if(t instanceof F){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=W.create(Xe(n))}return new F({...t._def,shape:()=>e})}else return t instanceof ce?new ce({...t._def,type:Xe(t.element)}):t instanceof W?W.create(Xe(t.unwrap())):t instanceof re?re.create(Xe(t.unwrap())):t instanceof te?te.create(t.items.map(e=>Xe(e))):t}var F=class t extends M{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=k.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==y.object){let c=this._getOrReturnCtx(e);return g(c,{code:p.invalid_type,expected:y.object,received:c.parsedType}),T}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof X&&this._def.unknownKeys==="strip"))for(let c in i.data)a.includes(c)||s.push(c);let l=[];for(let c of a){let d=o[c],m=i.data[c];l.push({key:{status:"valid",value:c},value:d._parse(new Y(i,m,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof X){let c=this._def.unknownKeys;if(c==="passthrough")for(let d of s)l.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(c==="strict")s.length>0&&(g(i,{code:p.unrecognized_keys,keys:s}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let d of s){let m=i.data[d];l.push({key:{status:"valid",value:d},value:c._parse(new Y(i,m,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let d of l){let m=await d.key,w=await d.value;c.push({key:m,value:w,alwaysSet:d.alwaysSet})}return c}).then(c=>R.mergeObjectSync(n,c)):R.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,a,s;let l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&a!==void 0?a:n.defaultError;return r.code==="unrecognized_keys"?{message:(s=v.errToObj(e).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return k.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return k.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Xe(this)}partial(e){let r={};return k.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return k.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof W;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return Mn(k.objectKeys(this.shape))}};F.create=(t,e)=>new F({shape:()=>t,unknownKeys:"strip",catchall:X.create(),typeName:_.ZodObject,...S(e)});F.strictCreate=(t,e)=>new F({shape:()=>t,unknownKeys:"strict",catchall:X.create(),typeName:_.ZodObject,...S(e)});F.lazycreate=(t,e)=>new F({shape:t,unknownKeys:"strip",catchall:X.create(),typeName:_.ZodObject,...S(e)});var Ge=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let s of o)if(s.result.status==="valid")return s.result;for(let s of o)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(s=>new U(s.ctx.common.issues));return g(r,{code:p.invalid_union,unionErrors:a}),T}if(r.common.async)return Promise.all(n.map(async o=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(i);{let o,a=[];for(let l of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=l._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let s=a.map(l=>new U(l));return g(r,{code:p.invalid_union,unionErrors:s}),T}}get options(){return this._def.options}};Ge.create=(t,e)=>new Ge({options:t,typeName:_.ZodUnion,...S(e)});var le=t=>t instanceof je?le(t.schema):t instanceof H?le(t.innerType()):t instanceof Be?[t.value]:t instanceof ze?t.options:t instanceof Fe?k.objectValues(t.enum):t instanceof Ve?le(t._def.innerType):t instanceof Re?[void 0]:t instanceof Le?[null]:t instanceof W?[void 0,...le(t.unwrap())]:t instanceof re?[null,...le(t.unwrap())]:t instanceof Tt||t instanceof He?le(t.unwrap()):t instanceof Ue?le(t._def.innerType):[],Ut=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.object)return g(r,{code:p.invalid_type,expected:y.object,received:r.parsedType}),T;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(g(r,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let a=le(o.shape[e]);if(!a.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let s of a){if(i.has(s))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(s)));i.set(s,o)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...S(n)})}};function vr(t,e){let r=ve(t),n=ve(e);if(t===e)return{valid:!0,data:t};if(r===y.object&&n===y.object){let i=k.objectKeys(e),o=k.objectKeys(t).filter(s=>i.indexOf(s)!==-1),a={...t,...e};for(let s of o){let l=vr(t[s],e[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===y.array&&n===y.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let a=t[o],s=e[o],l=vr(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return r===y.date&&n===y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ne=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,a)=>{if(yr(o)||yr(a))return T;let s=vr(o.value,a.value);return s.valid?((br(o)||br(a))&&r.dirty(),{status:r.value,value:s.data}):(g(n,{code:p.invalid_intersection_types}),T)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ne.create=(t,e,r)=>new Ne({left:t,right:e,typeName:_.ZodIntersection,...S(r)});var te=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.array)return g(n,{code:p.invalid_type,expected:y.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return g(n,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(g(n,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((a,s)=>{let l=this._def.items[s]||this._def.rest;return l?l._parse(new Y(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(o).then(a=>R.mergeArray(r,a)):R.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};te.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new te({items:t,typeName:_.ZodTuple,rest:null,...S(e)})};var Ht=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.object)return g(n,{code:p.invalid_type,expected:y.object,received:n.parsedType}),T;let i=[],o=this._def.keyType,a=this._def.valueType;for(let s in n.data)i.push({key:o._parse(new Y(n,s,n.path,s)),value:a._parse(new Y(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?R.mergeObjectAsync(r,i):R.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:_.ZodRecord,...S(n)}):new t({keyType:xe.create(),valueType:e,typeName:_.ZodRecord,...S(r)})}},rt=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.map)return g(n,{code:p.invalid_type,expected:y.map,received:n.parsedType}),T;let i=this._def.keyType,o=this._def.valueType,a=[...n.data.entries()].map(([s,l],c)=>({key:i._parse(new Y(n,s,n.path,[c,"key"])),value:o._parse(new Y(n,l,n.path,[c,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let l of a){let c=await l.key,d=await l.value;if(c.status==="aborted"||d.status==="aborted")return T;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(c.value,d.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let l of a){let c=l.key,d=l.value;if(c.status==="aborted"||d.status==="aborted")return T;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),s.set(c.value,d.value)}return{status:r.value,value:s}}}};rt.create=(t,e,r)=>new rt({valueType:e,keyType:t,typeName:_.ZodMap,...S(r)});var nt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==y.set)return g(n,{code:p.invalid_type,expected:y.set,received:n.parsedType}),T;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(g(n,{code:p.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(g(n,{code:p.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function a(l){let c=new Set;for(let d of l){if(d.status==="aborted")return T;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}let s=[...n.data.values()].map((l,c)=>o._parse(new Y(n,l,n.path,c)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:v.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:v.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};nt.create=(t,e)=>new nt({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...S(e)});var Zt=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.function)return g(r,{code:p.invalid_type,expected:y.function,received:r.parsedType}),T;function n(s,l){return Ft({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zt(),Qe].filter(c=>!!c),issueData:{code:p.invalid_arguments,argumentsError:l}})}function i(s,l){return Ft({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zt(),Qe].filter(c=>!!c),issueData:{code:p.invalid_return_type,returnTypeError:l}})}let o={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof Te){let s=this;return j(async function(...l){let c=new U([]),d=await s._def.args.parseAsync(l,o).catch(D=>{throw c.addIssue(n(l,D)),c}),m=await Reflect.apply(a,this,d);return await s._def.returns._def.type.parseAsync(m,o).catch(D=>{throw c.addIssue(i(m,D)),c})})}else{let s=this;return j(function(...l){let c=s._def.args.safeParse(l,o);if(!c.success)throw new U([n(l,c.error)]);let d=Reflect.apply(a,this,c.data),m=s._def.returns.safeParse(d,o);if(!m.success)throw new U([i(d,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:te.create(e).rest(ue.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||te.create([]).rest(ue.create()),returns:r||ue.create(),typeName:_.ZodFunction,...S(n)})}},je=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};je.create=(t,e)=>new je({getter:t,typeName:_.ZodLazy,...S(e)});var Be=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:p.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}};Be.create=(t,e)=>new Be({value:t,typeName:_.ZodLiteral,...S(e)});function Mn(t,e){return new ze({values:t,typeName:_.ZodEnum,...S(e)})}var ze=class t extends M{constructor(){super(...arguments),bt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{expected:k.joinValues(n),received:r.parsedType,code:p.invalid_type}),T}if(Vt(this,bt,"f")||xn(this,bt,new Set(this._def.values),"f"),!Vt(this,bt,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return g(r,{received:r.data,code:p.invalid_enum_value,options:n}),T}return j(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};bt=new WeakMap;ze.create=Mn;var Fe=class extends M{constructor(){super(...arguments),vt.set(this,void 0)}_parse(e){let r=k.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==y.string&&n.parsedType!==y.number){let i=k.objectValues(r);return g(n,{expected:k.joinValues(i),received:n.parsedType,code:p.invalid_type}),T}if(Vt(this,vt,"f")||xn(this,vt,new Set(k.getValidEnumValues(this._def.values)),"f"),!Vt(this,vt,"f").has(e.data)){let i=k.objectValues(r);return g(n,{received:n.data,code:p.invalid_enum_value,options:i}),T}return j(e.data)}get enum(){return this._def.values}};vt=new WeakMap;Fe.create=(t,e)=>new Fe({values:t,typeName:_.ZodNativeEnum,...S(e)});var Te=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==y.promise&&r.common.async===!1)return g(r,{code:p.invalid_type,expected:y.promise,received:r.parsedType}),T;let n=r.parsedType===y.promise?r.data:Promise.resolve(r.data);return j(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Te.create=(t,e)=>new Te({type:t,typeName:_.ZodPromise,...S(e)});var H=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:a=>{g(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let a=i.transform(n.data,o);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return T;let l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?T:l.status==="dirty"||r.value==="dirty"?Je(l.value):l});{if(r.value==="aborted")return T;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?T:s.status==="dirty"||r.value==="dirty"?Je(s.value):s}}if(i.type==="refinement"){let a=s=>{let l=i.refinement(s,o);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?T:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?T:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!xt(a))return a;let s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>xt(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:r.value,value:s})):a);k.assertNever(i)}};H.create=(t,e,r)=>new H({schema:t,typeName:_.ZodEffects,effect:e,...S(r)});H.createWithPreprocess=(t,e,r)=>new H({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...S(r)});var W=class extends M{_parse(e){return this._getType(e)===y.undefined?j(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W.create=(t,e)=>new W({innerType:t,typeName:_.ZodOptional,...S(e)});var re=class extends M{_parse(e){return this._getType(e)===y.null?j(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:_.ZodNullable,...S(e)});var Ve=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===y.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ve.create=(t,e)=>new Ve({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});var Ue=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _t(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new U(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new U(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ue.create=(t,e)=>new Ue({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});var it=class extends M{_parse(e){if(this._getType(e)!==y.nan){let n=this._getOrReturnCtx(e);return g(n,{code:p.invalid_type,expected:y.nan,received:n.parsedType}),T}return{status:"valid",value:e.data}}};it.create=t=>new it({typeName:_.ZodNaN,...S(t)});var uo=Symbol("zod_brand"),Tt=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},St=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?T:o.status==="dirty"?(r.dirty(),Je(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?T:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:_.ZodPipeline})}},He=class extends M{_parse(e){let r=this._def.innerType._parse(e),n=i=>(xt(i)&&(i.value=Object.freeze(i.value)),i);return _t(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};He.create=(t,e)=>new He({innerType:t,typeName:_.ZodReadonly,...S(e)});function kn(t,e={},r){return t?_e.create().superRefine((n,i)=>{var o,a;if(!t(n)){let s=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(a=(o=s.fatal)!==null&&o!==void 0?o:r)!==null&&a!==void 0?a:!0,c=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...c,fatal:l})}}):_e.create()}var co={object:F.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var fo=(t,e={message:"Input not instance of ".concat(t.name)})=>kn(r=>r instanceof t,e),wn=xe.create,Dn=Ie.create,po=it.create,ho=Oe.create,Cn=Ae.create,mo=Pe.create,go=et.create,yo=Re.create,bo=Le.create,vo=_e.create,xo=ue.create,_o=X.create,To=tt.create,So=ce.create,Mo=F.create,ko=F.strictCreate,wo=Ge.create,Do=Ut.create,Co=Ne.create,Eo=te.create,Io=Ht.create,Oo=rt.create,Ao=nt.create,Po=Zt.create,Ro=je.create,Lo=Be.create,Go=ze.create,No=Fe.create,jo=Te.create,bn=H.create,Bo=W.create,zo=re.create,Fo=H.createWithPreprocess,Vo=St.create,Uo=()=>wn().optional(),Ho=()=>Dn().optional(),Zo=()=>Cn().optional(),$o={string:t=>xe.create({...t,coerce:!0}),number:t=>Ie.create({...t,coerce:!0}),boolean:t=>Ae.create({...t,coerce:!0}),bigint:t=>Oe.create({...t,coerce:!0}),date:t=>Pe.create({...t,coerce:!0})},Wo=T,h=Object.freeze({__proto__:null,defaultErrorMap:Qe,setErrorMap:$i,getErrorMap:zt,makeIssue:Ft,EMPTY_PATH:Wi,addIssueToContext:g,ParseStatus:R,INVALID:T,DIRTY:Je,OK:j,isAborted:yr,isDirty:br,isValid:xt,isAsync:_t,get util(){return k},get objectUtil(){return gr},ZodParsedType:y,getParsedType:ve,ZodType:M,datetimeRegex:Sn,ZodString:xe,ZodNumber:Ie,ZodBigInt:Oe,ZodBoolean:Ae,ZodDate:Pe,ZodSymbol:et,ZodUndefined:Re,ZodNull:Le,ZodAny:_e,ZodUnknown:ue,ZodNever:X,ZodVoid:tt,ZodArray:ce,ZodObject:F,ZodUnion:Ge,ZodDiscriminatedUnion:Ut,ZodIntersection:Ne,ZodTuple:te,ZodRecord:Ht,ZodMap:rt,ZodSet:nt,ZodFunction:Zt,ZodLazy:je,ZodLiteral:Be,ZodEnum:ze,ZodNativeEnum:Fe,ZodPromise:Te,ZodEffects:H,ZodTransformer:H,ZodOptional:W,ZodNullable:re,ZodDefault:Ve,ZodCatch:Ue,ZodNaN:it,BRAND:uo,ZodBranded:Tt,ZodPipeline:St,ZodReadonly:He,custom:kn,Schema:M,ZodSchema:M,late:co,get ZodFirstPartyTypeKind(){return _},coerce:$o,any:vo,array:So,bigint:ho,boolean:Cn,date:mo,discriminatedUnion:Do,effect:bn,enum:Go,function:Po,instanceof:fo,intersection:Co,lazy:Ro,literal:Lo,map:Oo,nan:po,nativeEnum:No,never:_o,null:bo,nullable:zo,number:Dn,object:Mo,oboolean:Zo,onumber:Ho,optional:Bo,ostring:Uo,pipeline:Vo,preprocess:Fo,promise:jo,record:Io,set:Ao,strictObject:ko,string:wn,symbol:go,transformer:bn,tuple:Eo,undefined:yo,union:wo,unknown:xo,void:To,NEVER:Wo,ZodIssueCode:p,quotelessJson:Zi,ZodError:U});f();function er(t){return(t%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}f();f();var We=class extends ye{},he=class{constructor(e,r){u(this,"id");u(this,"positionDirty",!0);u(this,"object3d",new We);u(this,"components");u(this,"disposed",!1);u(this,"worldPosition",new z);this.id=e.id||N(),this.components=[e],this.object3d=new We,this.object3d.position.copy(r),this.object3d.userData.entityId=this.id,this.object3d.userData.type=this.type}get type(){return this.components[0].type}get parentObject3D(){return this.object3d.parent}get position(){return this.object3d.getWorldPosition(this.worldPosition),this.worldPosition}setAltitude(e){this.object3d.position.z=e}};f();f();f();f();f();f();f();var B=63710088e-1,si={centimeters:B*100,centimetres:B*100,degrees:B/111325,feet:B*3.28084,inches:B*39.37,kilometers:B/1e3,kilometres:B/1e3,meters:B,metres:B,miles:B/1609.344,millimeters:B*1e3,millimetres:B*1e3,nauticalmiles:B/1852,radians:1,yards:B*1.0936},Fu={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/B,yards:1.0936133};function Ye(t,e,r){r===void 0&&(r={});var n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function Bs(t,e,r){if(r===void 0&&(r={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!ai(t[0])||!ai(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Ye(n,e,r)}function Vu(t,e,r){r===void 0&&(r={});for(var n=0,i=t;n<i.length;n++){var o=i[n];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<o[o.length-1].length;a++)if(o[o.length-1][a]!==o[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return Ye(s,e,r)}function li(t,e,r){if(r===void 0&&(r={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Ye(n,e,r)}function Uu(t,e){e===void 0&&(e={});var r={type:"FeatureCollection"};return e.id&&(r.id=e.id),e.bbox&&(r.bbox=e.bbox),r.features=t,r}function Hu(t,e,r){r===void 0&&(r={});var n={type:"MultiLineString",coordinates:t};return Ye(n,e,r)}function Zu(t,e){e===void 0&&(e="kilometers");var r=si[e];if(!r)throw new Error(e+" units is invalid");return t*r}function $u(t,e){e===void 0&&(e="kilometers");var r=si[e];if(!r)throw new Error(e+" units is invalid");return t/r}function Wu(t){var e=t%(2*Math.PI);return e*180/Math.PI}function Yu(t){var e=t%360;return e*Math.PI/180}function ai(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function tr(t,e,r){if(t!==null)for(var n,i,o,a,s,l,c,d=0,m=0,w,D=t.type,I=D==="FeatureCollection",C=D==="Feature",L=I?t.features.length:1,G=0;G<L;G++){c=I?t.features[G].geometry:C?t.geometry:t,w=c?c.type==="GeometryCollection":!1,s=w?c.geometries.length:1;for(var ee=0;ee<s;ee++){var $=0,we=0;if(a=w?c.geometries[ee]:c,a!==null){l=a.coordinates;var ge=a.type;switch(d=r&&(ge==="Polygon"||ge==="MultiPolygon")?1:0,ge){case null:break;case"Point":if(e(l,m,G,$,we)===!1)return!1;m++,$++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(e(l[n],m,G,$,we)===!1)return!1;m++,ge==="MultiPoint"&&$++}ge==="LineString"&&$++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-d;i++){if(e(l[n][i],m,G,$,we)===!1)return!1;m++}ge==="MultiLineString"&&$++,ge==="Polygon"&&we++}ge==="Polygon"&&$++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(we=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-d;o++){if(e(l[n][i][o],m,G,$,we)===!1)return!1;m++}we++}$++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(tr(a.geometries[n],e,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Qu(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var r=0;r<t.features.length&&e(t.features[r],r)!==!1;r++);}function zs(t,e){var r,n,i,o,a,s,l,c,d,m,w=0,D=t.type==="FeatureCollection",I=t.type==="Feature",C=D?t.features.length:1;for(r=0;r<C;r++){for(s=D?t.features[r].geometry:I?t.geometry:t,c=D?t.features[r].properties:I?t.properties:{},d=D?t.features[r].bbox:I?t.bbox:void 0,m=D?t.features[r].id:I?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,i=0;i<a;i++){if(o=l?s.geometries[i]:s,o===null){if(e(null,w,c,d,m)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,w,c,d,m)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],w,c,d,m)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}w++}}function Fs(t,e){zs(t,function(r,n,i,o,a){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return e(Ye(r,i,{bbox:o,id:a}),n,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var c=0;c<r.coordinates.length;c++){var d=r.coordinates[c],m={type:l,coordinates:d};if(e(Ye(m,i),n,c)===!1)return!1}})}function Vs(t,e){Fs(t,function(r,n,i){var o=0;if(r.geometry){var a=r.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,c=0,d=0;if(tr(r,function(m,w,D,I,C){if(s===void 0||n>l||I>c||C>d){s=m,l=n,c=I,d=C,o=0;return}var L=li([s,m],r.properties);if(e(L,n,i,C,o)===!1)return!1;o++,s=m})===!1)return!1}}})}function ec(t,e,r){var n=r,i=!1;return Vs(t,function(o,a,s,l,c){i===!1&&r===void 0?n=o:n=e(n,o,a,s,l,c),i=!0}),n}function Or(t){var e=[1/0,1/0,-1/0,-1/0];return tr(t,function(r){e[0]>r[0]&&(e[0]=r[0]),e[1]>r[1]&&(e[1]=r[1]),e[2]<r[0]&&(e[2]=r[0]),e[3]<r[1]&&(e[3]=r[1])}),e}Or.default=Or;var ui=Or;function ci(t){return ui(t)}f();var Ar="#ffffff";var Pr=class{constructor(e={}){u(this,"initialColor",Ar);u(this,"color",Ar);u(this,"topColor");u(this,"topTexture");u(this,"texture");u(this,"hoverColor");u(this,"dirty",!0);u(this,"visible",!0);u(this,"opacity",1);u(this,"width",.1);u(this,"height",.1);u(this,"initialHeight",.1);u(this,"altitude",0);u(this,"join","round");u(this,"cap","round");u(this,"outline",!0);u(this,"showImage",!0);u(this,"flipImageToFaceCamera",!0);u(this,"url");u(this,"side","double");u(this,"renderOrder",0);this.color=(e==null?void 0:e.color)!==void 0?e.color:this.color,this.initialColor=this.color,this.width=(e==null?void 0:e.width)!==void 0?e.width:this.width,this.opacity=(e==null?void 0:e.opacity)!==void 0?e.opacity:this.opacity,this.visible=(e==null?void 0:e.visible)!==void 0?e.visible:this.visible,this.height=(e==null?void 0:e.height)!==void 0?e.height:this.height,this.initialHeight=this.height,this.altitude=(e==null?void 0:e.altitude)!==void 0?e.altitude:this.altitude,this.join=(e==null?void 0:e.join)!==void 0?e.join:this.join,this.cap=(e==null?void 0:e.cap)!==void 0?e.cap:this.cap,this.topColor=e==null?void 0:e.topColor,this.texture=e==null?void 0:e.texture,this.topTexture=e==null?void 0:e.topTexture,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline,this.showImage=(e==null?void 0:e.showImage)!==void 0?e.showImage:this.showImage,this.flipImageToFaceCamera=(e==null?void 0:e.flipImageToFaceCamera)!==void 0?e.flipImageToFaceCamera:this.flipImageToFaceCamera,this.url=e==null?void 0:e.url,this.side=(e==null?void 0:e.side)!==void 0?e.side:this.side,this.renderOrder=(e==null?void 0:e.renderOrder)!==void 0?e.renderOrder:this.renderOrder}};var Se=class extends nn{constructor(){super(...arguments);u(this,"type","entityBatchedMesh");u(this,"userData",{entities:{}})}},Et,It,qe,ne=class{constructor(e){u(this,"mesh");u(this,"focusMesh");u(this,"outline");u(this,"imageMesh");u(this,"textMesh");u(this,"textEntityId");u(this,"type","geometry");u(this,"dirty",!0);u(this,"detached",!1);u(this,"instanceIndex",-1);u(this,"geometry");u(this,"material");u(this,"feature");u(this,"currentHeight",.1);u(this,"focusable",!1);u(this,"color",new ae);u(this,"topColor",new ae);u(this,"position",new z);V(this,Et,0);V(this,It,1);V(this,qe,void 0);u(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.mesh.setVisibleAt(this.instanceIndex,e)}get renderOrder(){return this.mesh?this.mesh.renderOrder:0}set renderOrder(e){this.mesh&&(this.mesh.renderOrder=e)}setColor(e,r){this.color.set(e),this.topColor.set(r),this.material&&this.material.setColor(this.instanceIndex,this.color,this.topColor)}getColor(){var e;return(e=this.material)==null?void 0:e.getColor(this.instanceIndex)}get altitude(){return E(this,Et)}set altitude(e){this.mesh&&(this.mesh.position.z=e,P(this,Et,e))}get opacity(){return E(this,It)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let r=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of r)n.opacity=e,n.needsUpdate=!0}P(this,It,e)}get texture(){var e,r;return(r=(e=this.material)==null?void 0:e.texture)==null?void 0:r.image.src}set texture(e){this.material&&(this.material.texture=e)}get textureInstance(){var e;return(e=this.material)==null?void 0:e.texture}set topTexture(e){this.material&&(this.material.topTexture=e)}get topTexture(){var e,r;return(r=(e=this.material)==null?void 0:e.topTexture)==null?void 0:r.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return E(this,qe)?E(this,qe):(P(this,qe,ci(this.feature)),E(this,qe))}showTextures(){this.material&&(this.material.showTextures(this.instanceIndex),this.texturesVisible=!0)}hideTextures(){this.material&&(this.material.hideTextures(this.instanceIndex),this.texturesVisible=!1)}removeSideTexture(){this.material&&this.material.removeSideTexture(this.instanceIndex)}removeTopTexture(){this.material&&this.material.removeTopTexture(this.instanceIndex)}};Et=new WeakMap,It=new WeakMap,qe=new WeakMap;f();var Hs="#ffffff",Me,rr=class{constructor(e={}){u(this,"color",Hs);u(this,"topColor");u(this,"opacity",1);u(this,"height");V(this,Me,void 0);u(this,"outline",!0);u(this,"texture");u(this,"topTexture");u(this,"dirty",!0);var r,n;this.color=(r=e==null?void 0:e.color)!=null?r:this.color,this.topColor=e==null?void 0:e.topColor,this.opacity=(n=e==null?void 0:e.opacity)!=null?n:this.opacity,this.height=e==null?void 0:e.height,this.shading=e==null?void 0:e.shading,this.outline=(e==null?void 0:e.outline)!==void 0?!!e.outline:this.outline}get shading(){return E(this,Me)}set shading(e){var r;if(!e){P(this,Me,void 0);return}P(this,Me,(r=E(this,Me))!=null?r:{start:0,end:0,intensity:0}),Object.assign(E(this,Me),e)}};Me=new WeakMap;f();f();function lt(t){var r;let e=(r=t.parent)==null?void 0:r.children.find(n=>n.userData.outlineOfEntityId===t.userData.entityId);return e instanceof Nt?e:void 0}f();f();f();f();var ut=class{constructor(){u(this,"hover",!1);u(this,"dirty",!1)}};f();f();var di=["","","low","medium","high","always-visible"];function fi(t){return Math.min(5,Math.max(2,t))}function ct(t){if(typeof t=="number")return fi(t);let e=di.indexOf(t);return e===-1?3:e}function Ec(t){let e=fi(t);return di[e]}var nr=4,Rr=h.object({rank:h.union([h.enum(["low","medium","high","always-visible"]),h.number()]).optional(),interactive:h.union([h.boolean(),h.literal("pointer-events-auto")]).optional(),id:h.string().optional(),anchor:h.union([h.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),h.array(h.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:h.boolean().optional(),zIndex:h.number().optional()});function Nc(t,e,r){h.array(h.number()).refine(n=>n.length===2||n.length===3,{message:"Array length must be either 2 or 3"}).parse(t),h.string().parse(e),Rr.parse(r)}var dt=class dt{constructor(e,r={}){u(this,"id");u(this,"type","marker");u(this,"rank",0);u(this,"initialRank",0);u(this,"activeAnchor","center");u(this,"pointerEvents","none");u(this,"options",{rank:"low",interactive:!1,id:"",anchor:"center",dynamicResize:!1,zIndex:void 0});u(this,"projection",new Gt);u(this,"enabled",!0);u(this,"canShow",!1);u(this,"visible",!0);u(this,"offscreen",!1);u(this,"strategyIndex",-1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"containerEl");u(this,"contentEl",null);u(this,"contentHtml","");u(this,"style",{top:"0px",left:"0px"});u(this,"dirty",!1);u(this,"collisionDirty",!0);u(this,"visibilityNeedsUpdate","show");u(this,"animation",null);u(this,"currentStrategyIndex",-1);u(this,"onStrategySelected",(e,r=!1)=>{if(this.currentStrategyIndex===e||r)return;this.currentStrategyIndex=e,this.activeAnchor=this.strategies[e].name,this.containerEl.getAttribute("data-anchor")!==this.activeAnchor&&this.containerEl.setAttribute("data-anchor",this.activeAnchor);let{width:n,height:i}=this.dimensions,o=-i/2+"px",a=-n/2+"px";switch(this.style.top=o,this.style.left=a,this.activeAnchor){case"top":{this.style.top=-i+"px";break}case"bottom":{this.style.top="0px";break}case"left":{this.style.left=-n+"px";break}case"right":{this.style.left="0px";break}case"top-left":{this.style.top=-i+"px",this.style.left=-n+"px";break}case"top-right":{this.style.top=-i+"px",this.style.left="0px";break}case"bottom-left":{this.style.top="0px",this.style.left=-n+"px";break}case"bottom-right":{this.style.top="0px",this.style.left="0px";break}default:this.style.top=o,this.style.left=a}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(r==null?void 0:r.id)||N(),this.options={...this.options,...r},typeof r.rank=="string")this.rank=ct(r.rank);else if(r.rank!=null&&r.rank>0)this.rank=r.rank;else{let i=Math.trunc(x.env.NODE_ENV==="test"?dt.testId:dt.testId*10)/10;dt.testId+=.001,this.rank=i}typeof r.interactive=="string"&&(this.pointerEvents=r.interactive==="pointer-events-auto"?"auto":"none"),this.contentHtml=e,this.initialRank=this.rank;let n=document.createElement("div");n.style.opacity="0",n.innerHTML='<div class="mappedin-marker">'.concat(this.contentHtml,"</div>"),this.containerEl=n.querySelector(".mappedin-marker"),this.containerEl.setAttribute("data-marker-id",this.id.toString()),this.contentEl=this.containerEl?this.containerEl.firstElementChild:null}updateDimensions(e,r){if(e!=null&&r!=null)this.dimensions={width:e,height:r};else{let{width:n,height:i}=this.containerEl.getBoundingClientRect();this.dimensions={width:n,height:i}}Object.assign(this.containerEl,{width:this.dimensions.width+"px",height:this.dimensions.height+"px"}),this.currentStrategyIndex=-1}get strategies(){let{width:e,height:r}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:()=>{let o=r/2,a=r/2,s=e/2,l=e/2;switch(i){case"top":{o=r,a=0;break}case"bottom":{o=0,a=r;break}case"left":{s=e,l=0;break}case"right":{s=0,l=e;break}case"top-left":{o=r,s=e,a=0,l=0;break}case"top-right":{o=r,l=e,a=0,s=0;break}case"bottom-left":{a=r,s=e,o=0,l=0;break}case"bottom-right":{a=r,l=e,o=0,s=0;break}}return[o+nr,a+nr,s+nr,l+nr]}}))}toPackedMessage(e=!1){return this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.packedMessage.shouldCollideWithScreenEdges=!0,this.visible&&e&&this.currentStrategyIndex!==-1?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,n)=>[...r.getBoundingBox(),n]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(dt,"testId",0);var pi=dt;f();var ke=class t extends ye{constructor(r){super();u(this,"childrenIds",new Set);u(this,"children",[]);u(this,"type","group-container");u(this,"userData",{entityId:"",entities2D:new Set,dirty:!0});u(this,"components",[]);this.userData.entityId=r}addEntity(r){r instanceof t?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof he?(this.childrenIds.add(r.id),this.add(r.object3d),this.userData.entities2D.add(r.id)):r instanceof oe?(this.childrenIds.add(r.userData.entityId),this.add(r)):r instanceof ie&&r.object3d&&(this.childrenIds.add(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(r){r instanceof t?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof he?(this.childrenIds.delete(r.id),this.userData.entities2D.delete(r.id),this.remove(r.object3d)):r instanceof oe?(this.childrenIds.delete(r.userData.entityId),this.remove(r)):r instanceof ie&&r.object3d&&(this.childrenIds.delete(r.id),this.add(r.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(r){this.visible=r,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(r){this.position.z=r,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};f();f();function ir(t){"@babel/helpers - typeof";return ir=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ir(t)}var Zs=/^\s+/,$s=/\s+$/;function b(t,e){if(t=t||"",e=e||{},t instanceof b)return t;if(!(this instanceof b))return new b(t,e);var r=Ws(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,o,a,s;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?o=r/12.92:o=Math.pow((r+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),i<=.03928?s=i/12.92:s=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*a+.0722*s},setAlpha:function(e){return this._a=xi(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=mi(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=mi(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=hi(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=hi(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return gi(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return Xs(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(A(this._r,255)*100)+"%",g:Math.round(A(this._g,255)*100)+"%",b:Math.round(A(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(A(this._r,255)*100)+"%, "+Math.round(A(this._g,255)*100)+"%, "+Math.round(A(this._b,255)*100)+"%)":"rgba("+Math.round(A(this._r,255)*100)+"%, "+Math.round(A(this._g,255)*100)+"%, "+Math.round(A(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:ul[gi(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+yi(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=b(e);n="#"+yi(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return o?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return b(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(tl,arguments)},brighten:function(){return this._applyModification(rl,arguments)},darken:function(){return this._applyModification(nl,arguments)},desaturate:function(){return this._applyModification(Js,arguments)},saturate:function(){return this._applyModification(Qs,arguments)},greyscale:function(){return this._applyModification(el,arguments)},spin:function(){return this._applyModification(il,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(sl,arguments)},complement:function(){return this._applyCombination(ol,arguments)},monochromatic:function(){return this._applyCombination(ll,arguments)},splitcomplement:function(){return this._applyCombination(al,arguments)},triad:function(){return this._applyCombination(bi,[3])},tetrad:function(){return this._applyCombination(bi,[4])}};b.fromRatio=function(t,e){if(ir(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=Ot(t[n]));t=r}return b(t,e)};function Ws(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,a=!1,s=!1;return typeof t=="string"&&(t=pl(t)),ir(t)=="object"&&(me(t.r)&&me(t.g)&&me(t.b)?(e=Ys(t.r,t.g,t.b),a=!0,s=String(t.r).substr(-1)==="%"?"prgb":"rgb"):me(t.h)&&me(t.s)&&me(t.v)?(n=Ot(t.s),i=Ot(t.v),e=Ks(t.h,n,i),a=!0,s="hsv"):me(t.h)&&me(t.s)&&me(t.l)&&(n=Ot(t.s),o=Ot(t.l),e=qs(t.h,n,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=xi(r),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function Ys(t,e,r){return{r:A(t,255)*255,g:A(e,255)*255,b:A(r,255)*255}}function hi(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),o,a,s=(n+i)/2;if(n==i)o=a=0;else{var l=n-i;switch(a=s>.5?l/(2-n-i):l/(n+i),n){case t:o=(e-r)/l+(e<r?6:0);break;case e:o=(r-t)/l+2;break;case r:o=(t-e)/l+4;break}o/=6}return{h:o,s:a,l:s}}function qs(t,e,r){var n,i,o;t=A(t,360),e=A(e,100),r=A(r,100);function a(c,d,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?c+(d-c)*6*m:m<1/2?d:m<2/3?c+(d-c)*(2/3-m)*6:c}if(e===0)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;n=a(l,s,t+1/3),i=a(l,s,t),o=a(l,s,t-1/3)}return{r:n*255,g:i*255,b:o*255}}function mi(t,e,r){t=A(t,255),e=A(e,255),r=A(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),o,a,s=n,l=n-i;if(a=n===0?0:l/n,n==i)o=0;else{switch(n){case t:o=(e-r)/l+(e<r?6:0);break;case e:o=(r-t)/l+2;break;case r:o=(t-e)/l+4;break}o/=6}return{h:o,s:a,v:s}}function Ks(t,e,r){t=A(t,360)*6,e=A(e,100),r=A(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),l=n%6,c=[r,a,o,o,s,r][l],d=[s,r,r,a,o,o][l],m=[o,o,s,r,r,a][l];return{r:c*255,g:d*255,b:m*255}}function gi(t,e,r,n){var i=[Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function Xs(t,e,r,n,i){var o=[Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16)),Q(_i(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}function yi(t,e,r,n){var i=[Q(_i(n)),Q(Math.round(t).toString(16)),Q(Math.round(e).toString(16)),Q(Math.round(r).toString(16))];return i.join("")}b.equals=function(t,e){return!t||!e?!1:b(t).toRgbString()==b(e).toRgbString()};b.random=function(){return b.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function Js(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.s-=e/100,r.s=or(r.s),b(r)}function Qs(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.s+=e/100,r.s=or(r.s),b(r)}function el(t){return b(t).desaturate(100)}function tl(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.l+=e/100,r.l=or(r.l),b(r)}function rl(t,e){e=e===0?0:e||10;var r=b(t).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(e/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(e/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(e/100)))),b(r)}function nl(t,e){e=e===0?0:e||10;var r=b(t).toHsl();return r.l-=e/100,r.l=or(r.l),b(r)}function il(t,e){var r=b(t).toHsl(),n=(r.h+e)%360;return r.h=n<0?360+n:n,b(r)}function ol(t){var e=b(t).toHsl();return e.h=(e.h+180)%360,b(e)}function bi(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var r=b(t).toHsl(),n=[b(t)],i=360/e,o=1;o<e;o++)n.push(b({h:(r.h+o*i)%360,s:r.s,l:r.l}));return n}function al(t){var e=b(t).toHsl(),r=e.h;return[b(t),b({h:(r+72)%360,s:e.s,l:e.l}),b({h:(r+216)%360,s:e.s,l:e.l})]}function sl(t,e,r){e=e||6,r=r||30;var n=b(t).toHsl(),i=360/r,o=[b(t)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(b(n));return o}function ll(t,e){e=e||6;for(var r=b(t).toHsv(),n=r.h,i=r.s,o=r.v,a=[],s=1/e;e--;)a.push(b({h:n,s:i,v:o})),o=(o+s)%1;return a}b.mix=function(t,e,r){r=r===0?0:r||50;var n=b(t).toRgb(),i=b(e).toRgb(),o=r/100,a={r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a};return b(a)};b.readability=function(t,e){var r=b(t),n=b(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};b.isReadable=function(t,e,r){var n=b.readability(t,e),i,o;switch(o=!1,i=hl(r),i.level+i.size){case"AAsmall":case"AAAlarge":o=n>=4.5;break;case"AAlarge":o=n>=3;break;case"AAAsmall":o=n>=7;break}return o};b.mostReadable=function(t,e,r){var n=null,i=0,o,a,s,l;r=r||{},a=r.includeFallbackColors,s=r.level,l=r.size;for(var c=0;c<e.length;c++)o=b.readability(t,e[c]),o>i&&(i=o,n=b(e[c]));return b.isReadable(t,n,{level:s,size:l})||!a?n:(r.includeFallbackColors=!1,b.mostReadable(t,["#fff","#000"],r))};var Lr=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},ul=b.hexNames=cl(Lr);function cl(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function xi(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function A(t,e){dl(t)&&(t="100%");var r=fl(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function or(t){return Math.min(1,Math.max(0,t))}function Z(t){return parseInt(t,16)}function dl(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function fl(t){return typeof t=="string"&&t.indexOf("%")!=-1}function Q(t){return t.length==1?"0"+t:""+t}function Ot(t){return t<=1&&(t=t*100+"%"),t}function _i(t){return Math.round(parseFloat(t)*255).toString(16)}function vi(t){return Z(t)/255}var J=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function me(t){return!!J.CSS_UNIT.exec(t)}function pl(t){t=t.replace(Zs,"").replace($s,"").toLowerCase();var e=!1;if(Lr[t])t=Lr[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=J.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=J.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=J.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=J.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=J.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=J.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=J.hex8.exec(t))?{r:Z(r[1]),g:Z(r[2]),b:Z(r[3]),a:vi(r[4]),format:e?"name":"hex8"}:(r=J.hex6.exec(t))?{r:Z(r[1]),g:Z(r[2]),b:Z(r[3]),format:e?"name":"hex"}:(r=J.hex4.exec(t))?{r:Z(r[1]+""+r[1]),g:Z(r[2]+""+r[2]),b:Z(r[3]+""+r[3]),a:vi(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=J.hex3.exec(t))?{r:Z(r[1]+""+r[1]),g:Z(r[2]+""+r[2]),b:Z(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function hl(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}var Gr=zi(oi());var jr=h.object({rank:h.union([h.enum(["low","medium","high","always-visible"]),h.number()]).optional(),interactive:h.boolean().optional(),appearance:h.object({margin:h.number().min(6).optional(),text:h.object({numLines:h.number().optional(),lineHeight:h.number().optional(),size:h.number().optional(),maxWidth:h.number().optional(),foregroundColor:h.string().optional(),backgroundColor:h.string().optional()}).optional(),marker:h.object({size:h.number().optional(),foregroundColor:h.object({active:h.string().optional(),inactive:h.string().optional()}).optional(),backgroundColor:h.object({active:h.string().optional(),inactive:h.string().optional()}).optional()}).optional()}).optional()});function td(t,e,r){h.array(h.number()).length(2).parse(t),h.string().parse(e),jr.parse(r||{})}var ft={margin:6,text:{numLines:2,lineHeight:1.2,size:11.5,maxWidth:150,foregroundColor:"white",backgroundColor:"#333"},marker:{size:5,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},ml={lightOnDark:{...ft,text:{...ft.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...ft.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...ft,text:{...ft.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...ft.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},gl="LOW_PRIORITY",Ti=4,yl=6,bl=20,vl=2.5,xl=2,_l="cover",Si=.5,Mi=6.5,ki={heightAbovePolygon:0,appearance:ml.darkOnLight};var pt=class pt{constructor(e,r,n){u(this,"lines",0);u(this,"id");u(this,"rank");u(this,"type","label");u(this,"initialRank");u(this,"contextConfigured",!1);u(this,"fillText");u(this,"newStyle",{});u(this,"opacity",0);u(this,"visibilityNeedsUpdate",!1);u(this,"text");u(this,"style",{top:0,left:0,textLabelVisible:!0,pinVisibility:1,textAlign:"left"});u(this,"projection",new Gt);u(this,"_cache",{});u(this,"appearance");u(this,"options");u(this,"visible",!0);u(this,"enabled",!0);u(this,"offscreen",!1);u(this,"canShow",!1);u(this,"activeBoundingBox",{x:0,y:0,w:0,h:0});u(this,"dimensions",{width:0,height:0});u(this,"currentStrategyIndex",-1);u(this,"totalMarkerSize",0);u(this,"dirty",!0);u(this,"collisionDirty",!0);u(this,"lastTextAlign");u(this,"imageHash");u(this,"markerSize",0);u(this,"iconVisible",!1);u(this,"zoomProportion",0);u(this,"dp");u(this,"animate",!0);u(this,"onStrategySelected",e=>{if(this.currentStrategyIndex===e)return;let r=this.strategies[e];r&&r.onStrategySelected(this),this.currentStrategyIndex=e;let n=this.style;this.style=this.newStyle,this.newStyle=n});u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,a;if(this.id=(o=r.id)!=null?o:N(),this.options=(0,Gr.default)({},r,ki),this.text=e,this.dp=(s=1)=>s*n.pixelRatio,typeof r.rank=="string")this.rank=ct(r.rank),this.initialRank=this.rank;else if(r.rank!=null&&r.rank>0)this.rank=r.rank,this.initialRank=r.rank;else{let s=Math.trunc(x.env.NODE_ENV==="test"?pt.testId:pt.testId*10)/10;pt.testId+=.001,this.rank=s,this.initialRank=s}let i=(0,Gr.default)({},this.options.appearance,ki.appearance);this.appearance={margin:i.margin,text:{lineHeight:i.text.lineHeight,numLines:i.text.numLines,size:i.text.size,maxWidth:i.text.maxWidth,foregroundColor:i.text.foregroundColor,backgroundColor:i.text.backgroundColor},marker:{foregroundColor:{active:i.marker.foregroundColor.active,inactive:i.marker.foregroundColor.inactive||b(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||b(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||bl,iconPadding:(a=i.marker.iconPadding)!=null?a:xl,iconFit:i.marker.iconFit||_l,iconVisibilityThreshold:i.marker.iconVisibilityThreshold==null?Si:i.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=Si}=this.appearance.marker,r=this.dp();this.zoomProportion<=e&&typeof this.appearance.marker.iconSize<"u"&&this.imageHash?(this.markerSize=this.dp(this.appearance.marker.iconSize),this.iconVisible=!0):(this.iconVisible=!1,this.markerSize=this.dp(Mi)),this.totalMarkerSize=Math.ceil((this.markerSize+vl)/r)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:r}=this.dimensions,{margin:n}=this.appearance;this.calculateMarkerSize();let i=Math.max(yl,n),o=this.iconVisible?i/2:0,a=this.iconVisible?this.totalMarkerSize:Mi*2,s=[{name:"RIGHT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=this.totalMarkerSize/2+Ti,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let l=Math.max(this.totalMarkerSize,r);return[l/2+i,l/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-r/2,this.newStyle.left=-e-this.totalMarkerSize/2-Ti,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let l=this.dp();return[r+this.totalMarkerSize/2/l+i,this.totalMarkerSize/2+i,e/2+i,e/2+i]},onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textAlign="center",this.newStyle.textLabelVisible=!0,this.newStyle.top=-r-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:gl,getBoundingBox:()=>[a/2+o,a/2+o,a/2+o,a/2+o],onStrategySelected:()=>{this.newStyle.pinVisibility=.5,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}];return this.text===""?[{name:"ICON_ONLY",getBoundingBox:()=>[this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+i],onStrategySelected:()=>{this.newStyle.pinVisibility=1,this.newStyle.textLabelVisible=!1,this.newStyle.top=0,this.newStyle.left=0}}]:s}updatePosition(){}disable(){this.visible=!1}toPackedMessage(e=!1){return this.visible&&e&&this.currentStrategyIndex!=null&&this.currentStrategyIndex!==-1&&this.currentStrategyIndex!==this.lowPriorityStrategyIndex?this.packedMessage.lockedToStrategyIndex=this.currentStrategyIndex:this.packedMessage.lockedToStrategyIndex=-1,this.packedMessage.x=this.projection.x,this.packedMessage.y=this.projection.y,this.packedMessage.enabled=this.enabled,this.packedMessage.rank=this.rank,this.collisionDirty?(this.packedMessage.bboxes=this.strategies.map((r,n)=>[...r.getBoundingBox(),n]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};u(pt,"testId",0);var Nr=pt,rd=Nr;f();f();var wi=class extends yt{constructor(r,n){super();u(this,"rendererState");u(this,"convertTo3DMapPosition");u(this,"textSet",new Set);u(this,"batchedTextMap",new Map);u(this,"debugTextAreaMesh",new Map);this.rendererState=r,this.convertTo3DMapPosition=n}remove(r){this.textSet.delete(r)}update(r){var s,l,c;let n,i,o,a=[];for(let d of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(d),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let m=(s=i.mesh)==null?void 0:s.parent;if(!m||!(m instanceof ke)||!(i instanceof sr))continue;if((l=i.feature.properties)!=null&&l.textArea&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((c=i.feature.properties)==null?void 0:c.textArea.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(m)||this.batchedTextMap.set(m,Fr().then(({BatchedText:I})=>{let C=new I;return C.type="batchedtext",m.add(C),C}));let D=this.batchedTextMap.get(m);if(!D)throw new Error("batched text required");a.push(Tl({entityId:d,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:D,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let w=this.batchedTextMap.get(m);i.textMesh&&w&&Promise.all([w,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([D,{meshComponent:I,styleComponent:C}])=>{let{textMesh:L}=I;if(D&&L){let G=Vr(D,L);I.visible&&!G?D.add(L):!I.visible&&G&&D.remove(L)}C.flipToFaceCamera&&this.flipIfNeeded(I,r)})}return Promise.all(a)}flipIfNeeded(r,n){let i=r.textMesh;if(!i)return!1;let o=i.rotation.z,a=er(o+n);a>Math.PI/2&&a<3*Math.PI/2&&(i.rotation.z=er(o+Math.PI))}showTextAreaMesh(){let r,n;for(let i of this.rendererState.geometry3DIdsInScene)if(r=this.rendererState.geometry3DMap.get(i),(r==null?void 0:r.type)==="text3d"){n=r.components[0];let o=n.feature.properties.textArea;if(!o)continue;let a=new tn(o.maxWidth,o.maxHeight),s=new en(a,new Qr({color:"pink"})),{textMesh:l}=n;if(!l)continue;let c=this.convertTo3DMapPosition(o.position,At);s.position.copy(c),s.position.z=l.position.z-.1,s.rotation.z=l.rotation.z,Br.identity(),Br.makeRotationAxis(new z(0,0,1),l.userData.rotationZ),At.set(o.maxWidth/2,0,0),At.applyMatrix4(Br),s.position.x-=At.x,s.position.y-=At.y,this.rendererState.entityScene.add(s),this.debugTextAreaMesh.set(i,s)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(r=>{this.rendererState.entityScene.remove(r)}),this.debugTextAreaMesh.clear(),this.publish("render")}},Br=new gt,At=new z,zr;async function fd(t){let{preloadFont:e}=await Fr();return e(t)}function Fr(){return zr||(zr=import("./text3d-7MFD4QFJ.js").then(t=>t)),zr}async function Tl({entityId:t,textComponent:e,styleComponent:r,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o}){return Promise.all([Fr(),Promise.resolve({entityId:t,meshComponent:e,styleComponent:r})]).then(([{createTroikaText:a},s])=>a(s.entityId,s.meshComponent,s.styleComponent,n)).catch(a=>{se.warn("Trouble creating text: ",a)}).then(a=>{if(a!=null&&a.text){if(e.polygonEntityId){let s=o.geometry3DMap.get(e.polygonEntityId);if((s==null?void 0:s.type)==="geometry"){let l=s.components[0],c=s.components[1];l.textMesh=a.text,l.mesh!=null&&(a.text.position.z=c.altitude+c.height+Sl)}}return Promise.all([Promise.resolve(a.text),i])}}).then(a=>{if(!a)return;let[s,l]=a;l.add(s),e.batchedText||(e.batchedText=l)})}function Vr(t,e){return t._members.has(e)}var Sl=.5;var Ml=h.object({visible:h.boolean(),color:h.string(),flipToFaceCamera:h.boolean(),font:h.string().optional(),fontSize:h.number(),margin:h.union([h.number(),h.tuple([h.number(),h.number(),h.number(),h.number()])]),outlineColor:h.string(),outlineOpacity:h.number(),outlineBlur:h.union([h.number(),h.string()]),outlineWidth:h.number(),outlineOffsetX:h.number(),outlineOffsetY:h.number(),strokeWidth:h.number(),maxWidth:h.number().optional(),maxHeight:h.number().optional(),strokeOpacity:h.number(),strokeColor:h.string(),fillOpacity:h.number(),hoverColor:h.string().optional(),id:h.union([h.string(),h.number()]),type:h.literal("text3d"),position:h.tuple([h.number(),h.number(),h.number()]),content:h.string()}),Di=Ml.partial().omit({id:!0,type:!0}).strict(),Ci=Di.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),vd=h.object({appearance:Di.optional(),parentId:h.string().optional()}).strict(),sr=class{constructor(e){u(this,"mesh",new Ke);u(this,"textMesh");u(this,"type","text3d");u(this,"feature");u(this,"parent");u(this,"batchedText");u(this,"polygonEntityId");this.feature=e}get visible(){return this.batchedText&&this.textMesh?Vr(this.batchedText,this.textMesh):this.textMesh?this.textMesh.visible:!1}set visible(e){this.batchedText&&this.textMesh?e?this.batchedText.addText(this.textMesh):this.batchedText.removeText(this.textMesh):this.textMesh&&(this.textMesh.visible=e),this.mesh.visible=e}};function Pt(t,e,r){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="marker"||t.type==="label"||t.type==="geometry"||t.type==="group-container")return e===!0?(t instanceof he&&t.components[1]===void 0?(t.components[1]=new ut,t.components[1].dirty=!0):t instanceof ie&&t.components[2]===void 0?(t.components[2]=new ut,t.components[2].dirty=!0):t instanceof ke&&t.components[1]===void 0&&(t.components[1]=new ut,t.components[1].dirty=!0),!0):(t instanceof he?t.components[1]=void 0:t instanceof ie?t.components[2]=void 0:t instanceof ke&&(t.components[1]=void 0),!0);if(t.type==="geometry-group"){let n;for(let i of t.userData.entities3D.values())n=r.geometry3DMap.get(i),Pt(n,e,r);return!0}}return!1}function Ld(t,e,r){if(!(!(r!=null&&r.color)&&!(r!=null&&r.topColor))){if(r!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let n,i,o=t.components[0];for(let a of t.userData.entities3D.values())n=e.geometry3DMap.get(a),n&&(i=n.components[1],i.color===o.color&&(i.initialColor=r.color||o.color,i.color=r.color||o.color,i.dirty=!0),i.topColor===o.topColor&&(i.topColor=r.topColor||o.topColor,i.dirty=!0));return r.color!==void 0&&(o.color=r.color,o.dirty=!0),r.topColor!==void 0&&(o.topColor=r.topColor,o.dirty=!0),!0}return!1}}function Gd(t,e){if(e!==void 0&&t.type==="geometry-group"&&t.components[0]!=null){let r=t.components[0];return r.shading=r.shading||{},r.shading&&(e.start!==r.shading.start||e.end!==r.shading.end||e.intensity!==r.shading.intensity)&&(Object.assign(r.shading,e),t.userData.shadingDirty=!0),!0}return!1}function Nd(t,e){e!==void 0&&t.type==="geometry"&&(e.showImage!==void 0&&(t.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(t.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}function jd(t,e,r){var n;if(r!==void 0){if(t.type==="geometry"){let i=t.components[1];if(i.height!==r)return i.height=r,i.dirty=!0,((n=t.parentObject3D)==null?void 0:n.type)==="geometry-group"&&(t.parentObject3D.userData.outlineDirty=!0),!0}else if(t.type==="geometry-group"){let i=t.components[0];for(let o of t.userData.entities3D.values()){let a=e.geometry3DMap.get(o),s;((a==null?void 0:a.type)==="geometry"||(a==null?void 0:a.type)==="model")&&(s=a.components[1],s.height===i.height&&(a.components[1].height=r,a.components[1].dirty=!0))}return t.components[0].height=r,t.userData.outlineDirty=!0,!0}}return!1}function wl(t,e){e!==void 0&&(t.type==="path"||t.type==="geometry")&&(e.initialColor!==void 0&&(t.components[1].initialColor=e.initialColor),e.color!==void 0&&(t.components[1].color=e.color),e.topColor!==void 0&&(t.components[1].topColor=e.topColor),t.components[1].dirty=!0)}function Bd(t,e,r){e!==void 0&&(t.type==="label"||t.type==="marker"?(t.object3d.position.copy(r(e[1],e[0],e[2]||0)),t.positionDirty=!0):t.type==="custom-geometry"&&t.components[0].position.copy(r(e[1],e[0],e[2]||0)))}function zd(t,e){var r;return e!==void 0&&(t.type==="marker"||t.type==="label"||t.type==="custom-geometry")&&t.parentObject3D!==e&&t.parentObject3D instanceof ke?((r=t.parentObject3D)==null||r.removeEntity(t),e.addEntity(t),!0):!1}function Fd(t,e){e!==void 0&&(t.type==="marker"||t.type==="label")&&t.components[0].enabled!==e&&(t.components[0].enabled=e)}function Vd(t,e,r){if(e!==void 0&&t.type==="marker"){let n=t.components[0];if(e.contentHTML!==void 0)return n.containerEl.innerHTML=e.contentHTML,!0;if(e.anchor!==void 0&&(n.options.anchor=e.anchor,n.collisionDirty=!0),e.dynamicResize!==void 0)return n.options.dynamicResize=e.dynamicResize,!0;if(e.options!=null){try{Rr.parse(e.options||{})}catch(i){return se.error(i),!1}return e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",Pt(t,!1,r)):(n.pointerEvents="none",Pt(t,e.options.interactive,r)),Ei(t,e.options.rank),!0}}return!1}function Ei(t,e){return e!==void 0&&(t.type==="marker"||t.type==="label")?(t.components[0].rank=ct(e),!0):!1}function Ud(t,e,r){var n,i,o,a,s;if(e!==void 0&&t.type==="label"){let l=t.components[0];e.text!==void 0&&(l.text=e.text,l.dirty=!0);try{jr.parse(e.options||{})}catch(c){se.error(c);return}((n=e.options)==null?void 0:n.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Hr(l.appearance,((o=e.options)==null?void 0:o.appearance)||{}),l.dirty=!0),Pt(t,(a=e.options)==null?void 0:a.interactive,r),Ei(t,(s=e.options)==null?void 0:s.rank)}}function Hd(t,e){e!==void 0&&t.type==="geometry"&&(t.components[1].hoverColor=e,t.components[1].dirty=!0)}function Zd(t,e){if(e!==void 0){let r=t.components[2];if(t.type==="geometry"&&r!=null)return r.hover=e,r.dirty=!0,!0}return!1}function $d(t,e){e!==void 0&&t.type==="image"&&(t.components[1].flipImageToFaceCamera=e)}function Ii(t,e){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry"||t.type==="image"||t.type==="text3d"){t.components[1].visible=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof oe&&(r.userData.outlineDirty=!0)}else t.type==="group-container"||t.type==="geometry-group"?t.setVisible(e):t.type==="label"&&(t.components[0].visible=e);return!0}return!1}function Wd(t,e,r){if(r!==void 0&&t.type==="geometry-group"){let n=t.components[0];for(let i of t.userData.entities3D.values()){let o=e.geometry3DMap.get(i),a;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(a=o.components[1],a.opacity===n.opacity&&(o.components[1].opacity=r,o.components[1].dirty=!0))}return t.setOpacity(r),n.opacity=r,!0}return!1}function Yd(t,e){if(e!==void 0&&t.type==="geometry-group"){let r=t.components[0];(e==null?void 0:e.texture)!=null&&r.texture!==(e==null?void 0:e.texture)&&(r.texture=e.texture,r.dirty=!0),(e==null?void 0:e.topTexture)!=null&&r.topTexture!==(e==null?void 0:e.topTexture)&&(r.topTexture=e.topTexture,r.dirty=!0)}}function qd(t,e){if(t.type==="geometry"){let r=!1,n=t.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,r=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,r=!0),r&&t.components[0]instanceof ne){let i=t.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}function Kd(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.opacity!==e){r.opacity=e;let n=t.components[0];n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?r.visible=!1:r.visible=!0,r.dirty=!0;let i=t.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}function Xd(t,e){if(e!==void 0){if(t.type==="model"||t.type==="path"||t.type==="geometry"||t.type==="custom-geometry")t.components[1].altitude=e,t.components[1].dirty=!0;else if(t.type==="group-container"&&t.altitude!==e)return t.setAltitude(e),!0}return!1}function Jd(t,e){if(e!==void 0){if(t.type==="geometry-group"&&t.components[0]!=null)t.components[0].outline=e,t.userData.outlineDirty=!0;else if(t.type==="geometry"){t.components[1].outline=e,t.components[1].dirty=!0;let r=t.parentObject3D;r instanceof oe&&(r.userData.outlineDirty=!0)}return!0}return!1}function Qd(t,e){return e!==void 0&&t.type==="geometry"&&t.components[0]&&t.components[0]instanceof ne?(t.components[0].focusable=e,!0):!1}function ef(t,e){if(e!==void 0&&t.type==="geometry"){let r=t.components[1];if(r.renderOrder!==e){r.renderOrder=e;let n=t.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=e+1),r.dirty=!0,!0}}return!1}function tf(t,e){let{visible:r,color:n}=e;if(t.type!=="path")return;let i=t.components[0];r!=null&&Ii(t,r),n!=null&&wl(t,{color:n}),Object.assign(i,Dl(e)),Ur(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}function Dl(t){return lr(t,Cl)}var Cl=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function rf(t){if(!(t instanceof ie&&t.type==="text3d"))throw new Error("expect target is TextGeometry3D")}var El=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function nf(t,e){Ii(t,e.visible);let r=t.components[1],n=lr(e,El);"margin"in e&&se.warn("update to margin is not supported atm"),"content"in e&&se.warn("content update is not supported atm");try{Ci.parse(n)}catch(i){se.error(i);return}Object.keys(n).length>0&&(Object.assign(r,n),r.dirty=!0)}f();f();f();f();var ur=class extends rn{constructor(r){let n=r,i=3,o=i*4;super(new Float32Array(r*o),i,r,Jr,Xr);u(this,"_width");u(this,"_height");u(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(r,n,i){let o=this.image.data,a=r*this._width;o[a]=n.r,o[a+1]=n.g,o[a+2]=n.b,o[a+3]=0,o[a+4]=i.r,o[a+5]=i.g,o[a+6]=i.b,o[a+7]=0,this.needsUpdate=!0}getColor(r){let n=this.image.data,i=r*this._width,o=new ae(n[i],n[i+1],n[i+2]),a=new ae(n[i+4],n[i+5],n[i+6]);return{color:o,topColor:a}}setTexture(r,n,i){let o=this.image.data,a=r*this._width;o[a+8]=n?1:0,o[a+9]=i?1:0,o[a+10]=0,o[a+11]=0,this.needsUpdate=!0}};var Oi="#define LAMBERT\nvarying vec3 vViewPosition;\nvarying vec4 vPosition;\nvarying vec2 vUv;\nvarying vec4 finalPosition;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\nvarying float vBatchId;\n\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n vBatchId = batchId + 0.5;\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n #include <beginnormal_vertex>\n #include <morphnormal_vertex>\n #include <skinbase_vertex>\n #include <skinnormal_vertex>\n #include <defaultnormal_vertex>\n #include <normal_vertex>\n #include <begin_vertex>\n #include <morphtarget_vertex>\n #include <skinning_vertex>\n #include <displacementmap_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n #include <clipping_planes_vertex>\n vViewPosition = - mvPosition.xyz;\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n // vertex normal relative to world space\n worldNormal = normal;\n vUv = uv;\n // world position\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Ai="#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nuniform float uGradientEnd;\nuniform float uGradientIntensity;\nuniform float uMinSideAlpha;\nuniform float uMaxSideAlpha;\nuniform float uGradientStart;\nuniform highp sampler2D uPropertiesTexture;\nuniform highp sampler2D uTopTexture;\nuniform highp sampler2D uTexture;\nuniform float uRepeatYFactor;\nvarying float vBatchId;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition;\nvarying vec3 worldNormal;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n #include <clipping_planes_fragment>\n\n // get the normalized world normal of vertex fragment\n vec3 surfaceNormal = normalize(worldNormal);\n\n // get angle relative to Z up\n float angle = degrees(acos(abs(dot(surfaceNormal, vec3(0.0, 0.0, 1.0)))));\n\n int idx = int(vBatchId) * 1;\n vec3 diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(0, idx), 0).rgb);\n bool shouldShowTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).r == 1.0;\n\n if(shouldShowTexture) {\n diffuse = texture2D(uTexture, vec2(vUv.x, vUv.y * uRepeatYFactor)).rgb;\n }\n\n // if this is a fragment facing upwards, use topColor\n if(angle == 0.0) {\n bool shouldShowTopTexture = texelFetch(uPropertiesTexture, ivec2(2, idx), 0).g == 1.0;\n\n if(shouldShowTopTexture) {\n diffuse = texture2D(uTopTexture, vUv).rgb;\n } else {\n diffuse = vec3(texelFetch(uPropertiesTexture, ivec2(1, idx), 0).rgb);\n }\n }\n\n vec4 diffuseColor = vec4(diffuse, opacity);\n\n // only for vertical surfaces\n if(angle > 89.0 && angle < 91.0) {\n\n // get the percentage of the z position from the ground, up\n float percentFromZeroZ = max((abs(vWorldPosition.z) - uGradientStart) / uGradientEnd, 0.0);\n\n // gradient based on percentage\n float alpha = smoothstep(uMinSideAlpha, uMaxSideAlpha, percentFromZeroZ);\n\n // mix the shadow color with the diffuse color based on the alpha and opacity\n diffuseColor = vec4(mix(diffuseColor.rgb, diffuseColor.rgb * (1.0 - uGradientIntensity), 1.0 - alpha), opacity);\n }\n\n ReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n vec3 totalEmissiveRadiance = emissive;\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n #include <aomap_fragment>\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n #include <envmap_fragment>\n #include <opaque_fragment>\n #include <tonemapping_fragment>\n #include <colorspace_fragment>\n #include <fog_fragment>\n #include <premultiplied_alpha_fragment>\n #include <dithering_fragment>\n}\n";var Pl=-.05,Rl=1,Rt=class extends sn{constructor(r,n,i=1){super(r);u(this,"propertiesTexture");u(this,"uniforms",{uGradientIntensity:{value:0},uGradientEnd:{value:0},uGradientStart:{value:0},uTopTexture:{value:null},uTexture:{value:null},uRepeatYFactor:{value:1}});u(this,"showTextures",r=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,n,i),this.needsUpdate=!0)});this.propertiesTexture=new ur(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let a=this.uniforms.uGradientIntensity,s=this.uniforms.uGradientEnd,l=this.uniforms.uGradientStart,c=this.uniforms.uTopTexture,d=this.uniforms.uTexture,m=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=Oi,o.fragmentShader=Ai,Object.assign(this.uniforms,{uGradientIntensity:a,uGradientEnd:s,uGradientStart:l,uMinSideAlpha:{value:Pl},uMaxSideAlpha:{value:Rl},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:c,uTexture:d,uRepeatYFactor:m})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(r){r!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=r,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(r){r.wrapS=mt,r.wrapT=mt,r.colorSpace=dr,this.uniforms.uTexture.value=r}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(r){r.wrapS=mt,r.wrapT=mt,r.colorSpace=dr,this.uniforms.uTopTexture.value=r}setGradientShading(r,n,i){this.uniforms.uGradientStart.value=r,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(r,n,i){this.propertiesTexture.setColor(r,n,i)}getColor(r){return this.propertiesTexture.getColor(r)}hideTextures(r){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(r,!1,!1),this.needsUpdate=!0)}removeSideTexture(r){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(r,!1,n),this.needsUpdate=!0}}removeTopTexture(r){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(r,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};f();var Pi="mappedin";var Gl=80;function jf(t,e){var s,l,c;let r=0;for(let d of t)r+=((l=(s=d.components[0])==null?void 0:s.geometry)==null?void 0:l.attributes.position.count)||0;let n=new ae(e.color),i;i=new Rt({color:n,side:e.side==="back"?qr:e.side==="front"?Yr:Kr,opacity:(c=e.opacity)!=null?c:1,transparent:e.opacity!==void 0?e.opacity<1:!1},t.length);let o=new Se(t.length,r,0,i),a;for(let d of t)a=d.components[0],!(!(a instanceof ne)||!a.geometry)&&(a.mesh=o,a.material=i,a.instanceIndex=o.addGeometry(a.geometry),o.userData.entities[a.instanceIndex]=d.id,i instanceof Rt&&i.setColor(a.instanceIndex,n,e.topColor?new ae(e.topColor):n));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}function Zr(t,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let r=new an(t,Gl),n=Nl(e.color.getHexString()),i=new on({linewidth:1,color:n,transparent:!0}),o=new Nt(r,i);return o.layers.set(1),o}function Nl(t){return b(t).darken(30).toRgbString()}f();function Ri(t){t&&(t.map&&(t.map.dispose(),t.map=void 0),t.dispose())}function cr(t){for(let e=t.children.length-1;e>=0;e--)cr(t.children[e]);"geometry"in t&&t.geometry&&t.geometry.dispose(),t.parent&&t.parent.remove(t),"material"in t&&Array.isArray(t.material)?t.material.forEach(function(e){Ri(e)}):"material"in t&&typeof t.material<"u"&&Ri(t.material)}var Lt,ht,$r=class{constructor(e){u(this,"rendererState");u(this,"dirty",!0);V(this,Lt,!0);V(this,ht,0);this.rendererState=e}get geometries3DDirty(){return E(this,Lt)}set geometries3DDirty(e){P(this,Lt,e)}update(e,r=!1){var o,a;let n;if(this.geometries3DDirty){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(l),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let c=n.children[0];n.userData.outlineDirty=!1;let d=lt(n);if(d&&cr(d),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let m;if(c instanceof Se){let I=[],C,L,G,ee;for(let $ of n.userData.entities3D)ee=this.rendererState.geometry3DMap.get($),(ee==null?void 0:ee.type)==="geometry"&&(L=ee.components[0],G=ee.components[1],L instanceof ne&&G.visible&&G.opacity>0&&G.outline&&!L.detached&&(C=L==null?void 0:L.geometry,C&&I.push(C)));I.length>0&&(m=dn(I))}else m=c.geometry;m&&(s=Zr(m,c.material),s.position.z=n.altitude,s.userData.outlineOfEntityId=n.userData.entityId);let w,D;for(let I of n.userData.entities3D.values()){let C=this.rendererState.geometry3DMap.get(I);(C==null?void 0:C.type)==="geometry"&&(w=C.components[0],D=C.components[1],s&&(C==null?void 0:C.type)==="geometry"&&!w.detached?(C.components[0].outline=s,(o=n.parent)==null||o.add(s)):(C==null?void 0:C.type)==="geometry"&&w.geometry!=null&&w.material!=null&&w.detached&&(w.outline&&cr(w.outline),D&&D.opacity>0&&D.visible&&D.outline&&(w.outline=Zr(w.geometry,w.material),(a=n.parent)==null||a.add(w.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=r?Li(e,16,19,0,1):E(this,ht);if((i!==E(this,ht)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let s;for(let l of this.rendererState.geometry3DIdsInScene)if(s=this.rendererState.geometry3DMap.get(l),(s==null?void 0:s.type)==="geometry-group"&&s.components[0]!=null&&s.components[0].outline&&s.visible){let c=lt(s);if(c&&c.visible){let d=Array.isArray(c.material)?c.material:[c.material];for(let m of d)m.opacity=Math.min(i,s.components[0].opacity)}}else if((s==null?void 0:s.type)==="geometry"&&s.components[0]instanceof ne&&s.components[0].detached){let c=s.components[0].outline;if(c){let d=Array.isArray(c.material)?c.material:[c.material];for(let m of d)m.opacity=Math.min(i,s.components[1].opacity)}}}P(this,ht,i),this.dirty=!1}};Lt=new WeakMap,ht=new WeakMap;var oe=class extends ye{constructor(r,n=new rr){super();u(this,"visible",!0);u(this,"type","geometry-group");u(this,"components");u(this,"userData",{entityId:"",entities3D:new Set,opacity:1,dirty:!0,outlineDirty:!0,shadingDirty:!0});this.components=[n],this.userData.entityId=r}setVisible(r){this.visible=r;let n=lt(this);n&&(n.visible=r),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(r){this.userData.opacity=r}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let r;for(let i of this.children)if(!i.userData.detached){r=i;break}return r instanceof Se?Object.values(r.userData.entities)[0]:void 0}setAltitude(r){this.position.z=r,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};var Ke=class extends ye{constructor(){super(...arguments);u(this,"type","geometry");u(this,"userData",{entityId:"",type:"geometry"})}},ie=class{constructor(e,r){u(this,"id",N());u(this,"components");u(this,"entities2D",new Map);this.components=[e,r]}get object3d(){return this.components[0].mesh}get parentObject3D(){var e;return(e=this.components[0].mesh)==null?void 0:e.parent}get type(){return this.components[0].type}addEntity(e){this.parentObject3D instanceof oe?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var r;(r=e.parentObject3D)==null||r.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};f();function zl(t){let e=t.min,r=t.max,n=new z(e.x,e.y,e.z),i=new z(r.x,e.y,e.z),o=new z(e.x,r.y,e.z),a=new z(r.x,r.y,e.z);return[n,i,o,a]}f();function Fl(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}f();function Vl(t,e,r=!1){let n=null,i=0;return function(...o){i++,i===1&&r===!0&&t(...o);let a=()=>{(!r||i>1)&&t(...o),n=null,i=0};clearTimeout(n),n=setTimeout(a,e)}}f();var Ul=(()=>{let t;return{getDeviceType(){if(t)return t;let{userAgent:e,platform:r,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),o=r==="iPad"||r.indexOf("Mac")===0&&n>0&&!window.MSStream,a=/android/i.test(e);return t={isIpad:o,isMobile:a||i||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},t},_reset(){t=void 0}}})(),Gi=Ul.getDeviceType,Ni=(()=>{let t,e,r;function n(){if(e!==void 0)return e;t||(t=document.createElement("canvas"));let o=t.getContext("webgl")||t.getContext("experimental-webgl");if(!o)return e;try{let a=Gi().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=a?o.getParameter(a.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let s=new Error("Failed getting device info");throw s.name="FailedGettingDeviceInfo",s}}function i(){var a,s;if(!Gi().isWindows)return!1;if(r!==void 0)return r;let o=(s=(a=Hl())==null?void 0:a.toLowerCase())!=null?s:"";return r=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),r}return{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){t=o,e=void 0,r=void 0}}})(),Hl=Ni.getInfo,Zl=Ni.shouldDisableOffscreenCanvas;f();function lr(t,e){let r={};for(let n=0;n<e.length;n++){let i=e[n];i in t&&(r[i]=t[i])}return r}function Ur(t){return Object.keys(t).length===0}f();var $l=t=>e=>{if(!e.includes("mappedin")){let r={};for(let n in t){let i=t[n];e.includes("mappedin")||(t[n]=i)}return{url:e,headers:r}}return{url:e,headers:t}};function jp(t,e,r,n){let i=t*(Math.PI/180),o=n/Ce,a=t+o*180/Math.PI,s=r/Ce/Math.cos(i),l=e+s*180/Math.PI;return{lat:a,lon:l}}function Bp(t,e,r,n){let i=r*(Math.PI/180),o=n*(Math.PI/180),a=t*(Math.PI/180),s=e*(Math.PI/180),l=i-a,c=o-s,d=Ce*c*Math.cos(a),m=Ce*l;return{x:d,y:m}}var Wl=(t,e)=>{var r;if(t.children&&t.visible)for(let n of t.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((r=n.userData)!=null&&r.entities3D)&&n.type==="geometry-group"){e.add(n.userData.entityId);for(let i of n.userData.entities3D.values())e.add(i)}else(n.type==="group-container"||n.type==="custom-geometry"||n instanceof Ke)&&e.add(n.userData.entityId);Wl(n,e)}return e},Yl=(t,e)=>{var r;if(t.children&&t.visible&&!((r=t.userData)!=null&&r.hidden))for(let n of t.children)n.visible&&n instanceof We&&e.add(n.userData.entityId),Yl(n,e);return e};function Hr(t,e){for(let r in e){if(e[r]==null){t[r]=void 0;continue}typeof e[r]=="object"?Hr(t[r],e[r]):t[r]=e[r]}return t}function zp(t,e,r,n){let i={translateX:t.x,translateY:t.y,translateZ:t.z,scale:t.meterInMercatorCoordinateUnits()},o=new gt,a=new z(i.scale,-i.scale,i.scale),s=new gt().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(a),l=r.elevation;return{id:Pi,type:"custom",renderingMode:"3d",render:(c,d)=>{if(o.fromArray(d),l!==r.elevation){let m=cn.fromLngLat(t.toLngLat(),r.elevation);s.makeTranslation(i.translateX,i.translateY,-m.z).scale(a)}e.projectionMatrix=o.multiply(s),l=r.elevation,n()}}}function ql(t){return fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}async function Fp(t){let e=await ql(t),{access_token:r}=await e.json();return{"x-mappedin-tiles-key":r}}function Vp(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i=0,o;i<t.length;i++)o=t.charCodeAt(i),r=Math.imul(r^o,2654435761),n=Math.imul(n^o,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)}var Kl=t=>t;var Up=t=>1-Math.cos(t*Math.PI/2);function Li(t,e,r,n,i,o=Kl){t=Math.max(e,Math.min(t,r));let a=(t-Math.min(e,r))/Math.abs(r-e),s=o(a);return n+s*(i-n)}function Hp(t,e,r){let n=t*(Math.PI/180)/2,i=e/2;return r*Math.tan(n)/i}function Zp(t,e){let r;return typeof e=="string"||typeof e=="number"?(r=t.geometry2DMap.get(e),r==null&&(r=t.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(r=t.geometry2DMap.get(e.id),r==null&&(r=t.geometry3DMap.get(e.id))):r=e,r}function $p(t){return new un(new fr(t[0][0],t[0][1]),new fr(t[1][0],t[1][1])).getCenter().toArray()}function Wp(t){return Number.isFinite(t.min.x)&&Number.isFinite(t.min.y)&&Number.isFinite(t.max.x)&&Number.isFinite(t.max.y)&&(t instanceof ln||Number.isFinite(t.min.z)&&Number.isFinite(t.max.z))}f();var Wr=class{constructor(e){u(this,"visible");u(this,"altitude");u(this,"color");u(this,"dirty",!0);u(this,"maxWidth");u(this,"maxHeight");u(this,"hoverByPolygon");u(this,"flipToFaceCamera",ji.flipToFaceCamera);u(this,"font");u(this,"fillOpacity");u(this,"fontSize");u(this,"margin");u(this,"outlineWidth");u(this,"outlineBlur");u(this,"outlineOffsetX");u(this,"strokeColor");u(this,"strokeOpacity");u(this,"strokeWidth");u(this,"hoverColor");u(this,"outlineOffsetY");u(this,"outlineColor");u(this,"outlineOpacity");e&&Object.assign(this,e)}getState(e=!1){let r={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(r[n]=this[n]);return r}},ji=Object.freeze({visible:!0,color:"black",flipToFaceCamera:!0,fillOpacity:1,font:void 0,fontSize:2,margin:[.2,1,.2,1.5],outlineColor:"black",outlineOpacity:1,outlineWidth:0,outlineOffsetX:0,outlineOffsetY:0,outlineBlur:0,strokeOpacity:1,strokeWidth:0,maxWidth:void 0,maxHeight:void 0,strokeColor:"black",hoverColor:void 0});f();export{Fi as a,Xl as b,se as c,Ce as d,au as e,su as f,lu as g,uu as h,fu as i,yt as j,N as k,hr as l,Ye as m,Bs as n,Vu as o,li as p,Uu as q,Hu as r,Zu as s,$u as t,Wu as u,Yu as v,Qu as w,Fs as x,ec as y,ui as z,h as A,oi as B,Ar as C,Pr as D,Se as E,ne as F,rr as G,lt as H,Ec as I,Nc as J,pi as K,he as L,Ke as M,ie as N,Pi as O,zl as P,Fl as Q,Vl as R,Zl as S,lr as T,$l as U,er as V,jp as W,Bp as X,Wl as Y,Yl as Z,zp as _,Fp as $,Vp as aa,Kl as ba,Up as ca,Li as da,Hp as ea,Zp as fa,$p as ga,Wp as ha,b as ia,td as ja,rd as ka,Wr as la,ji as ma,wi as na,fd as oa,vd as pa,sr as qa,Pt as ra,Ld as sa,Gd as ta,Nd as ua,jd as va,wl as wa,Bd as xa,zd as ya,Fd as za,Vd as Aa,Ud as Ba,Hd as Ca,Zd as Da,$d as Ea,Ii as Fa,Wd as Ga,Yd as Ha,qd as Ia,Kd as Ja,Xd as Ka,Jd as La,Qd as Ma,ef as Na,tf as Oa,Dl as Pa,rf as Qa,El as Ra,nf as Sa,Rt as Ta,jf as Ua,Nl as Va,cr as Wa,$r as Xa,oe as Ya,ke as Za};
|