@mappedin/react-sdk 6.0.1-beta.30 → 6.0.1-beta.31

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.
@@ -0,0 +1 @@
1
+ import{h as Er,i as yi,j as bi}from"./chunk-OEHAWF4S.js";import{a as vi}from"./chunk-UAHZ2VYJ.js";import{C as qt,Ca as mi,J as F,M as _t,O as ve,P as le,R as li,U as ui,Ya as gi,c as ni,d as ii,e as oi,ea as ci,g as xt,ja as di,ka as fi,ma as Kt,p as ai,q as si,ua as pi,xa as hi,y as Cr}from"./chunk-JBOWQKFZ.js";import{a as f,b as _}from"./chunk-XGFP4AXW.js";import{a,c as qo,e as Ko,f as u,g as I,h as U,i as R}from"./chunk-J5IUISYU.js";var ho=qo((Lt,ft)=>{f();var ns=200,Zi="__lodash_hash_undefined__",is=800,os=16,Wi=9007199254740991,Yi="[object Arguments]",as="[object Array]",ss="[object AsyncFunction]",ls="[object Boolean]",us="[object Date]",cs="[object Error]",qi="[object Function]",ds="[object GeneratorFunction]",fs="[object Map]",ps="[object Number]",hs="[object Null]",Ki="[object Object]",ms="[object Proxy]",gs="[object RegExp]",ys="[object Set]",bs="[object String]",vs="[object Undefined]",xs="[object WeakMap]",_s="[object ArrayBuffer]",Ts="[object DataView]",Ss="[object Float32Array]",Ms="[object Float64Array]",ks="[object Int8Array]",ws="[object Int16Array]",Ds="[object Int32Array]",Cs="[object Uint8Array]",Es="[object Uint8ClampedArray]",Is="[object Uint16Array]",Os="[object Uint32Array]",As=/[\\^$.*+?()[\]{}|]/g,Ps=/^\[object .+?Constructor\]$/,Rs=/^(?:0|[1-9]\d*)$/,A={};A[Ss]=A[Ms]=A[ks]=A[ws]=A[Ds]=A[Cs]=A[Es]=A[Is]=A[Os]=!0;A[Yi]=A[as]=A[_s]=A[ls]=A[Ts]=A[us]=A[cs]=A[qi]=A[fs]=A[ps]=A[Ki]=A[gs]=A[ys]=A[bs]=A[xs]=!1;var Xi=typeof global=="object"&&global&&global.Object===Object&&global,Ls=typeof self=="object"&&self&&self.Object===Object&&self,jt=Xi||Ls||Function("return this")(),Ji=typeof Lt=="object"&&Lt&&!Lt.nodeType&&Lt,Gt=Ji&&typeof ft=="object"&&ft&&!ft.nodeType&&ft,Qi=Gt&&Gt.exports===Ji,dn=Qi&&Xi.process,Ni=function(){try{var r=Gt&&Gt.require&&Gt.require("util").types;return r||dn&&dn.binding&&dn.binding("util")}catch{}}(),ji=Ni&&Ni.isTypedArray;function eo(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}a(eo,"apply");function Gs(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}a(Gs,"baseTimes");function Ns(r){return function(e){return r(e)}}a(Ns,"baseUnary");function js(r,e){return r==null?void 0:r[e]}a(js,"getValue");function Bs(r,e){return function(t){return r(e(t))}}a(Bs,"overArg");var zs=Array.prototype,Fs=Function.prototype,fr=Object.prototype,fn=jt["__core-js_shared__"],pr=Fs.toString,he=fr.hasOwnProperty,Bi=function(){var r=/[^.]+$/.exec(fn&&fn.keys&&fn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),to=fr.toString,Vs=pr.call(Object),Us=RegExp("^"+pr.call(he).replace(As,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),cr=Qi?jt.Buffer:void 0,zi=jt.Symbol,Fi=jt.Uint8Array,Vi=cr?cr.allocUnsafe:void 0,ro=Bs(Object.getPrototypeOf,Object),Ui=Object.create,Hs=fr.propertyIsEnumerable,$s=zs.splice,Ye=zi?zi.toStringTag:void 0,dr=function(){try{var r=vn(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Zs=cr?cr.isBuffer:void 0,Hi=Math.max,Ws=Date.now,no=vn(jt,"Map"),Nt=vn(Object,"create"),Ys=function(){function r(){}return a(r,"object"),function(e){if(!pe(e))return{};if(Ui)return Ui(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}();function qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(qe,"Hash");function qs(){this.__data__=Nt?Nt(null):{},this.size=0}a(qs,"hashClear");function Ks(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}a(Ks,"hashDelete");function Xs(r){var e=this.__data__;if(Nt){var t=e[r];return t===Zi?void 0:t}return he.call(e,r)?e[r]:void 0}a(Xs,"hashGet");function Js(r){var e=this.__data__;return Nt?e[r]!==void 0:he.call(e,r)}a(Js,"hashHas");function Qs(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nt&&e===void 0?Zi:e,this}a(Qs,"hashSet");qe.prototype.clear=qs;qe.prototype.delete=Ks;qe.prototype.get=Xs;qe.prototype.has=Js;qe.prototype.set=Qs;function me(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(me,"ListCache");function el(){this.__data__=[],this.size=0}a(el,"listCacheClear");function tl(r){var e=this.__data__,t=hr(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():$s.call(e,t,1),--this.size,!0}a(tl,"listCacheDelete");function rl(r){var e=this.__data__,t=hr(e,r);return t<0?void 0:e[t][1]}a(rl,"listCacheGet");function nl(r){return hr(this.__data__,r)>-1}a(nl,"listCacheHas");function il(r,e){var t=this.__data__,n=hr(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}a(il,"listCacheSet");me.prototype.clear=el;me.prototype.delete=tl;me.prototype.get=rl;me.prototype.has=nl;me.prototype.set=il;function pt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}a(pt,"MapCache");function ol(){this.size=0,this.__data__={hash:new qe,map:new(no||me),string:new qe}}a(ol,"mapCacheClear");function al(r){var e=gr(this,r).delete(r);return this.size-=e?1:0,e}a(al,"mapCacheDelete");function sl(r){return gr(this,r).get(r)}a(sl,"mapCacheGet");function ll(r){return gr(this,r).has(r)}a(ll,"mapCacheHas");function ul(r,e){var t=gr(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}a(ul,"mapCacheSet");pt.prototype.clear=ol;pt.prototype.delete=al;pt.prototype.get=sl;pt.prototype.has=ll;pt.prototype.set=ul;function ht(r){var e=this.__data__=new me(r);this.size=e.size}a(ht,"Stack");function cl(){this.__data__=new me,this.size=0}a(cl,"stackClear");function dl(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}a(dl,"stackDelete");function fl(r){return this.__data__.get(r)}a(fl,"stackGet");function pl(r){return this.__data__.has(r)}a(pl,"stackHas");function hl(r,e){var t=this.__data__;if(t instanceof me){var n=t.__data__;if(!no||n.length<ns-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new pt(n)}return t.set(r,e),this.size=t.size,this}a(hl,"stackSet");ht.prototype.clear=cl;ht.prototype.delete=dl;ht.prototype.get=fl;ht.prototype.has=pl;ht.prototype.set=hl;function ml(r,e){var t=gn(r),n=!t&&mn(r),i=!t&&!n&&lo(r),o=!t&&!n&&!i&&co(r),s=t||n||i||o,l=s?Gs(r.length,String):[],c=l.length;for(var d in r)(e||he.call(r,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||ao(d,c)))&&l.push(d);return l}a(ml,"arrayLikeKeys");function pn(r,e,t){(t!==void 0&&!yr(r[e],t)||t===void 0&&!(e in r))&&yn(r,e,t)}a(pn,"assignMergeValue");function gl(r,e,t){var n=r[e];(!(he.call(r,e)&&yr(n,t))||t===void 0&&!(e in r))&&yn(r,e,t)}a(gl,"assignValue");function hr(r,e){for(var t=r.length;t--;)if(yr(r[t][0],e))return t;return-1}a(hr,"assocIndexOf");function yn(r,e,t){e=="__proto__"&&dr?dr(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}a(yn,"baseAssignValue");var yl=El();function mr(r){return r==null?r===void 0?vs:hs:Ye&&Ye in Object(r)?Il(r):Gl(r)}a(mr,"baseGetTag");function $i(r){return Bt(r)&&mr(r)==Yi}a($i,"baseIsArguments");function bl(r){if(!pe(r)||Rl(r))return!1;var e=_n(r)?Us:Ps;return e.test(zl(r))}a(bl,"baseIsNative");function vl(r){return Bt(r)&&uo(r.length)&&!!A[mr(r)]}a(vl,"baseIsTypedArray");function xl(r){if(!pe(r))return Ll(r);var e=so(r),t=[];for(var n in r)n=="constructor"&&(e||!he.call(r,n))||t.push(n);return t}a(xl,"baseKeysIn");function bn(r,e,t,n,i){r!==e&&yl(e,function(o,s){if(i||(i=new ht),pe(o))_l(r,e,s,t,bn,n,i);else{var l=n?n(hn(r,s),o,s+"",r,e,i):void 0;l===void 0&&(l=o),pn(r,s,l)}},fo)}a(bn,"baseMerge");function _l(r,e,t,n,i,o,s){var l=hn(r,t),c=hn(e,t),d=s.get(c);if(d){pn(r,t,d);return}var p=o?o(l,c,t+"",r,e,s):void 0,g=p===void 0;if(g){var D=gn(c),C=!D&&lo(c),O=!D&&!C&&co(c);p=c,D||C||O?gn(l)?p=l:Fl(l)?p=wl(l):C?(g=!1,p=Sl(c,!0)):O?(g=!1,p=kl(c,!0)):p=[]:Vl(c)||mn(c)?(p=l,mn(l)?p=Ul(l):(!pe(l)||_n(l))&&(p=Ol(c))):g=!1}g&&(s.set(c,p),i(p,c,n,o,s),s.delete(c)),pn(r,t,p)}a(_l,"baseMergeDeep");function io(r,e){return jl(Nl(r,e,po),r+"")}a(io,"baseRest");var Tl=dr?function(r,e){return dr(r,"toString",{configurable:!0,enumerable:!1,value:Zl(e),writable:!0})}:po;function Sl(r,e){if(e)return r.slice();var t=r.length,n=Vi?Vi(t):new r.constructor(t);return r.copy(n),n}a(Sl,"cloneBuffer");function Ml(r){var e=new r.constructor(r.byteLength);return new Fi(e).set(new Fi(r)),e}a(Ml,"cloneArrayBuffer");function kl(r,e){var t=e?Ml(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}a(kl,"cloneTypedArray");function wl(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}a(wl,"copyArray");function Dl(r,e,t,n){var i=!t;t||(t={});for(var o=-1,s=e.length;++o<s;){var l=e[o],c=n?n(t[l],r[l],l,t,r):void 0;c===void 0&&(c=r[l]),i?yn(t,l,c):gl(t,l,c)}return t}a(Dl,"copyObject");function Cl(r){return io(function(e,t){var n=-1,i=t.length,o=i>1?t[i-1]:void 0,s=i>2?t[2]:void 0;for(o=r.length>3&&typeof o=="function"?(i--,o):void 0,s&&Al(t[0],t[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var l=t[n];l&&r(e,l,n,o)}return e})}a(Cl,"createAssigner");function El(r){return function(e,t,n){for(var i=-1,o=Object(e),s=n(e),l=s.length;l--;){var c=s[r?l:++i];if(t(o[c],c,o)===!1)break}return e}}a(El,"createBaseFor");function oo(r,e,t,n,i,o){return pe(r)&&pe(e)&&(o.set(e,r),bn(r,e,void 0,oo,o),o.delete(e)),r}a(oo,"customDefaultsMerge");function gr(r,e){var t=r.__data__;return Pl(e)?t[typeof e=="string"?"string":"hash"]:t.map}a(gr,"getMapData");function vn(r,e){var t=js(r,e);return bl(t)?t:void 0}a(vn,"getNative");function Il(r){var e=he.call(r,Ye),t=r[Ye];try{r[Ye]=void 0;var n=!0}catch{}var i=to.call(r);return n&&(e?r[Ye]=t:delete r[Ye]),i}a(Il,"getRawTag");function Ol(r){return typeof r.constructor=="function"&&!so(r)?Ys(ro(r)):{}}a(Ol,"initCloneObject");function ao(r,e){var t=typeof r;return e=e==null?Wi:e,!!e&&(t=="number"||t!="symbol"&&Rs.test(r))&&r>-1&&r%1==0&&r<e}a(ao,"isIndex");function Al(r,e,t){if(!pe(t))return!1;var n=typeof e;return(n=="number"?xn(t)&&ao(e,t.length):n=="string"&&e in t)?yr(t[e],r):!1}a(Al,"isIterateeCall");function Pl(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}a(Pl,"isKeyable");function Rl(r){return!!Bi&&Bi in r}a(Rl,"isMasked");function so(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||fr;return r===t}a(so,"isPrototype");function Ll(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}a(Ll,"nativeKeysIn");function Gl(r){return to.call(r)}a(Gl,"objectToString");function Nl(r,e,t){return e=Hi(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,o=Hi(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var l=Array(e+1);++i<e;)l[i]=n[i];return l[e]=t(s),eo(r,this,l)}}a(Nl,"overRest");function hn(r,e){if(!(e==="constructor"&&typeof r[e]=="function")&&e!="__proto__")return r[e]}a(hn,"safeGet");var jl=Bl(Tl);function Bl(r){var e=0,t=0;return function(){var n=Ws(),i=os-(n-t);if(t=n,i>0){if(++e>=is)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}a(Bl,"shortOut");function zl(r){if(r!=null){try{return pr.call(r)}catch{}try{return r+""}catch{}}return""}a(zl,"toSource");function yr(r,e){return r===e||r!==r&&e!==e}a(yr,"eq");var mn=$i(function(){return arguments}())?$i:function(r){return Bt(r)&&he.call(r,"callee")&&!Hs.call(r,"callee")},gn=Array.isArray;function xn(r){return r!=null&&uo(r.length)&&!_n(r)}a(xn,"isArrayLike");function Fl(r){return Bt(r)&&xn(r)}a(Fl,"isArrayLikeObject");var lo=Zs||Wl;function _n(r){if(!pe(r))return!1;var e=mr(r);return e==qi||e==ds||e==ss||e==ms}a(_n,"isFunction");function uo(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Wi}a(uo,"isLength");function pe(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}a(pe,"isObject");function Bt(r){return r!=null&&typeof r=="object"}a(Bt,"isObjectLike");function Vl(r){if(!Bt(r)||mr(r)!=Ki)return!1;var e=ro(r);if(e===null)return!0;var t=he.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&pr.call(t)==Vs}a(Vl,"isPlainObject");var co=ji?Ns(ji):vl;function Ul(r){return Dl(r,fo(r))}a(Ul,"toPlainObject");var Hl=io(function(r){return r.push(void 0,oo),eo($l,void 0,r)});function fo(r){return xn(r)?ml(r,!0):xl(r)}a(fo,"keysIn");var $l=Cl(function(r,e,t,n){bn(r,e,t,n)});function Zl(r){return function(){return r}}a(Zl,"constant");function po(r){return r}a(po,"identity");function Wl(){return!1}a(Wl,"stubFalse");ft.exports=Hl});f();function ac(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(ac,"debounce");f();f();var Xt="[MappedinJS]",Xo=(i=>(i[i.LOG=0]="LOG",i[i.WARN=1]="WARN",i[i.ERROR=2]="ERROR",i[i.SILENT=3]="SILENT",i))(Xo||{});function cc(r){0<=r&&r<=3&&(xi.logState=r)}a(cc,"setLoggerLevel");var xi={logState:_.env.NODE_ENV==="test"?3:0,log(...r){this.logState<=0&&console.log(Xt,...r)},warn(...r){this.logState<=1&&console.warn(Xt,...r)},error(...r){this.logState<=2&&console.error(Xt,...r)},assert(...r){console.assert(...r)},time(r){console.time(r)},timeEnd(r){console.timeEnd(r)},throw(r,e){throw new Error("".concat(Xt," ").concat(r),e)}},ue=xi;f();f();var Ir=class Ir extends Error{};a(Ir,"InvalidTokenError");var Ee=Ir;Ee.prototype.name="InvalidTokenError";function Jo(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}a(Jo,"b64DecodeUnicode");function Qo(r){let e=r.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 Jo(e)}catch{return atob(e)}}a(Qo,"base64UrlDecode");function _i(r,e){if(typeof r!="string")throw new Ee("Invalid token specified: must be a string");e||(e={});let t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new Ee("Invalid token specified: missing part #".concat(t+1));let i;try{i=Qo(n)}catch(o){throw new Ee("Invalid token specified: invalid base64 for part #".concat(t+1," (").concat(o.message,")"))}try{return JSON.parse(i)}catch(o){throw new Ee("Invalid token specified: invalid json for part #".concat(t+1," (").concat(o.message,")"))}}a(_i,"jwtDecode");f();var Ie=63710088e-1;function _c(r){var t,n;let e=_i(r);if(e.sub==null)throw new Error("Access token is missing sub claim.");return{sub:e.sub,aud:typeof e.aud=="string"?[e.aud]:(t=e.aud)!=null?t:[],capabilities:(n=e.capabilities)!=null?n:{}}}a(_c,"decodeAccessToken");function xe(r){return r*(Math.PI/180)}a(xe,"toRadians");function ea(r){return r*(180/Math.PI)}a(ea,"toDegrees");function Ti(r,e){return(r%e+e)%e}a(Ti,"euclideanModulo");function Tc([r,e],[t,n]){let i=xe(n-e),o=xe(t-r),s=xe(e),l=xe(n),c=Math.sin(i/2)*Math.sin(i/2)+Math.sin(o/2)*Math.sin(o/2)*Math.cos(s)*Math.cos(l),d=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c));return Ie*d}a(Tc,"haversineDistance");function Sc([r,e],[t,n]){let i=xe(e),o=xe(r),s=xe(n),c=xe(t)-o,d=Math.sin(c)*Math.cos(s),p=Math.cos(i)*Math.sin(s)-Math.sin(i)*Math.cos(s)*Math.cos(c);return ea((Math.atan2(d,p)+Math.PI*2)%(Math.PI*2))}a(Sc,"getForwardBearing");function Mc(r,e){let t=Ti(r,Math.PI*2),n=Ti(e,Math.PI*2),i=n-t,o=n+(i>Math.PI?-Math.PI*2:i<-Math.PI?Math.PI*2:0);return{start:t,end:o}}a(Mc,"shortestTweenRotation");f();f();var Or=class Or{constructor(){u(this,"_subscribers",{})}publish(e,t){!this._subscribers||!this._subscribers[e]||this._subscribers[e].forEach(function(n){typeof n=="function"&&n(t)})}on(e,t){this._subscribers||(this._subscribers={}),this._subscribers[e]=this._subscribers[e]||[],this._subscribers[e].push(t)}off(e,t){if(!this._subscribers||this._subscribers[e]==null)return;let n=this._subscribers[e].indexOf(t);n!==-1&&this._subscribers[e].splice(n,1)}destroy(){this._subscribers={}}};a(Or,"PubSub");var Tt=Or;f();f();var Ar=[0,4,6,8,10],j=a(()=>{let r=new Array(16).fill(0),e=Math.random()*4294967296;for(let n=0;n<r.length;n++)n>0&&!(n&3)&&(e=Math.random()*4294967296),r[n]=e>>>((n&3)<<3)&255;let t=r.map(n=>n.toString(16).padStart(2,"0"));return t[6]="4"+t[6][1],t[8]=["8","9","a","b"].includes(t[7][0])?t[7]:"a"+t[7][1],Ar.map((n,i)=>t.slice(n,i===Ar.length-1?void 0:Ar[i+1]).join("")).join("-")},"randomId");var Si="mi-session-data",Mi="mi-local-data",Oe,X,J,St=class St{constructor(){U(this,X,void 0);U(this,J,void 0);try{let e=sessionStorage.getItem(Si);e?R(this,X,JSON.parse(e)):R(this,X,{id:j()})}catch{R(this,X,{id:j()})}try{let e=localStorage.getItem(Mi);e?R(this,J,JSON.parse(e)):R(this,J,{deviceId:j()})}catch{R(this,J,{deviceId:j()})}I(this,X).id||(I(this,X).id=j()),I(this,J).deviceId||(I(this,J).deviceId=j())}static getInstance(){return I(this,Oe)||R(this,Oe,new St),I(this,Oe)}static ___clearInstance(){R(this,Oe,void 0)}saveSessionData(e,t){I(this,X)[e]=t;try{return sessionStorage.setItem(Si,JSON.stringify(I(this,X))),!0}catch{return!1}}loadSessionData(e){let t=I(this,X)[e];if(t!=null)return t}saveLocalData(e,t){I(this,J)[e]=t;try{return localStorage.setItem(Mi,JSON.stringify(I(this,J))),!0}catch{return!1}}loadLocalData(e){let t=I(this,J)[e];if(t!=null)return t}};Oe=new WeakMap,X=new WeakMap,J=new WeakMap,a(St,"SafeStorage"),U(St,Oe,void 0);var Pr=St;f();var w;(function(r){r.assertEqual=i=>i;function e(i){}a(e,"assertIs"),r.assertIs=e;function t(i){throw new Error}a(t,"assertNever"),r.assertNever=t,r.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},r.getValidEnumValues=i=>{let o=r.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(let l of o)s[l]=i[l];return r.objectValues(s)},r.objectValues=i=>r.objectKeys(i).map(function(o){return i[o]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},r.find=(i,o)=>{for(let s of i)if(o(s))return s},r.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(s=>typeof s=="string"?"'".concat(s,"'"):s).join(o)}a(n,"joinValues"),r.joinValues=n,r.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(w||(w={}));var Lr;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Lr||(Lr={}));var b=w.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_e=a(r=>{switch(typeof r){case"undefined":return b.undefined;case"string":return b.string;case"number":return isNaN(r)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(r)?b.array:r===null?b.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?b.promise:typeof Map<"u"&&r instanceof Map?b.map:typeof Set<"u"&&r instanceof Set?b.set:typeof Date<"u"&&r instanceof Date?b.date:b.object;default:return b.unknown}},"getParsedType"),h=w.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"]),ta=a(r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),ir=class ir extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(o){return o.message},n={_errors:[]},i=a(o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let l=n,c=0;for(;c<s.path.length;){let d=s.path[c];c===s.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(t(s))):l[d]=l[d]||{_errors:[]},l=l[d],c++}}},"processError");return i(this),n}static assert(e){if(!(e instanceof ir))throw new Error("Not a ZodError: ".concat(e))}toString(){return this.message}get message(){return JSON.stringify(this.issues,w.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let i of this.issues)i.path.length>0?(t[i.path[0]]=t[i.path[0]]||[],t[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};a(ir,"ZodError");var $=ir;$.create=r=>new $(r);var at=a((r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===b.undefined?t="Required":t="Expected ".concat(r.expected,", received ").concat(r.received);break;case h.invalid_literal:t="Invalid literal value, expected ".concat(JSON.stringify(r.expected,w.jsonStringifyReplacer));break;case h.unrecognized_keys:t="Unrecognized key(s) in object: ".concat(w.joinValues(r.keys,", "));break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t="Invalid discriminator value. Expected ".concat(w.joinValues(r.options));break;case h.invalid_enum_value:t="Invalid enum value. Expected ".concat(w.joinValues(r.options),", received '").concat(r.received,"'");break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t='Invalid input: must include "'.concat(r.validation.includes,'"'),typeof r.validation.position=="number"&&(t="".concat(t," at one or more positions greater than or equal to ").concat(r.validation.position))):"startsWith"in r.validation?t='Invalid input: must start with "'.concat(r.validation.startsWith,'"'):"endsWith"in r.validation?t='Invalid input: must end with "'.concat(r.validation.endsWith,'"'):w.assertNever(r.validation):r.validation!=="regex"?t="Invalid ".concat(r.validation):t="Invalid";break;case h.too_small:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"more than"," ").concat(r.minimum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at least":"over"," ").concat(r.minimum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(r.minimum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than ").concat(new Date(Number(r.minimum))):t="Invalid input";break;case h.too_big:r.type==="array"?t="Array must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"less than"," ").concat(r.maximum," element(s)"):r.type==="string"?t="String must contain ".concat(r.exact?"exactly":r.inclusive?"at most":"under"," ").concat(r.maximum," character(s)"):r.type==="number"?t="Number must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="bigint"?t="BigInt must be ".concat(r.exact?"exactly":r.inclusive?"less than or equal to":"less than"," ").concat(r.maximum):r.type==="date"?t="Date must be ".concat(r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"," ").concat(new Date(Number(r.maximum))):t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t="Number must be a multiple of ".concat(r.multipleOf);break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,w.assertNever(r)}return{message:t}},"errorMap"),Di=at;function ra(r){Di=r}a(ra,"setErrorMap");function Jt(){return Di}a(Jt,"getErrorMap");var Qt=a(r=>{let{data:e,path:t,errorMaps:n,issueData:i}=r,o=[...t,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let l="",c=n.filter(d=>!!d).slice().reverse();for(let d of c)l=d(s,{data:e,defaultError:l}).message;return{...i,path:o,message:l}},"makeIssue"),na=[];function y(r,e){let t=Jt(),n=Qt({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===at?void 0:at].filter(i=>!!i)});r.common.issues.push(n)}a(y,"addIssueToContext");var or=class or{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let i of t){if(i.status==="aborted")return S;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let i of t){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return or.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let i of t){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return S;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}};a(or,"ParseStatus");var L=or,S=Object.freeze({status:"aborted"}),nt=a(r=>({status:"dirty",value:r}),"DIRTY"),B=a(r=>({status:"valid",value:r}),"OK"),Gr=a(r=>r.status==="aborted","isAborted"),Nr=a(r=>r.status==="dirty","isDirty"),Ot=a(r=>r.status==="valid","isValid"),At=a(r=>typeof Promise<"u"&&r instanceof Promise,"isAsync");function er(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}a(er,"__classPrivateFieldGet");function Ci(r,e,t,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"?r!==e||!i:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,t):i?i.value=t:e.set(r,t),t}a(Ci,"__classPrivateFieldSet");var x;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));var Mt,kt,Br=class Br{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,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}};a(Br,"ParseInputLazyPath");var K=Br,ki=a((r,e)=>{if(Ot(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new $(r.common.issues);return this._error=t,this._error}}},"handleResult");function M(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:i}=r;if(e&&(t||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,l)=>{var c,d;let{message:p}=r;return s.code==="invalid_enum_value"?{message:p!=null?p:l.defaultError}:typeof l.data>"u"?{message:(c=p!=null?p:n)!==null&&c!==void 0?c:l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:(d=p!=null?p:t)!==null&&d!==void 0?d:l.defaultError}},"customMap"),description:i}}a(M,"processCreateParams");var zr=class zr{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 _e(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new L,ctx:{common:e.parent.common,data:e.data,parsedType:_e(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(At(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;let i={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},o=this._parseSync({data:e,path:i.path,parent:i});return ki(i,o)}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:_e(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(At(i)?i:Promise.resolve(i));return ki(n,o)}refine(e,t){let n=a(i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t,"getIssueProperties");return this._refinement((i,o)=>{let s=e(i),l=a(()=>o.addIssue({code:h.custom,...n(i)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(e,t){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof t=="function"?t(n,i):t),!1))}_refinement(e){return new Z({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return q.create(this,this._def)}nullable(){return ie.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fe.create(this,this._def)}promise(){return Me.create(this,this._def)}or(e){return Be.create([this,e],this._def)}and(e){return ze.create(this,e,this._def)}transform(e){return new Z({...M(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new $e({...M(this._def),innerType:this,defaultValue:t,typeName:T.ZodDefault})}brand(){return new Pt({typeName:T.ZodBranded,type:this,...M(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ze({...M(this._def),innerType:this,catchValue:t,typeName:T.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rt.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};a(zr,"ZodType");var k=zr,ia=/^c[^\s-]{8,}$/i,oa=/^[0-9a-z]+$/,aa=/^[0-9A-HJKMNP-TV-Z]{26}$/,sa=/^[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,la=/^[a-z0-9_-]{21}$/i,ua=/^[-+]?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)?)??$/,ca=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,da="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rr,fa=/^(?:(?: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])$/,pa=/^(([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})))$/,ha=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ei="((\\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])))",ma=new RegExp("^".concat(Ei,"$"));function Ii(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e="".concat(e,"\\.\\d{").concat(r.precision,"}"):r.precision==null&&(e="".concat(e,"(\\.\\d+)?")),e}a(Ii,"timeRegexSource");function ga(r){return new RegExp("^".concat(Ii(r),"$"))}a(ga,"timeRegex");function Oi(r){let e="".concat(Ei,"T").concat(Ii(r)),t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e="".concat(e,"(").concat(t.join("|"),")"),new RegExp("^".concat(e,"$"))}a(Oi,"datetimeRegex");function ya(r,e){return!!((e==="v4"||!e)&&fa.test(r)||(e==="v6"||!e)&&pa.test(r))}a(ya,"isValidIP");var Ae=class Ae extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.string,received:o.parsedType}),S}let n=new L,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.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),y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,l=e.data.length<o.value;(s||l)&&(i=this._getOrReturnCtx(e,i),s?y(i,{code:h.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&y(i,{code:h.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")ca.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"email",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rr||(Rr=new RegExp(da,"u")),Rr.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"emoji",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")sa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"uuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")la.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"nanoid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ia.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")oa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"cuid2",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")aa.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ulid",code:h.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),y(i,{validation:"url",code:h.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),y(i,{validation:"regex",code:h.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),y(i,{code:h.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),y(i,{code:h.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Oi(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?ma.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ga(o).test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{code:h.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?ua.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"duration",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?ya(e.data,o.version)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"ip",code:h.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ha.test(e.data)||(i=this._getOrReturnCtx(e,i),y(i,{validation:"base64",code:h.invalid_string,message:o.message}),n.dirty()):w.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(i=>e.test(i),{validation:t,code:h.invalid_string,...x.errToObj(n)})}_addCheck(e){return new Ae({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}datetime(e){var t,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:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...x.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,...x.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...x.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ae({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Ae,"ZodString");var Te=Ae;Te.create=r=>{var e;return new Te({checks:[],typeName:T.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...M(r)})};function ba(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=t>n?t:n,o=parseInt(r.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}a(ba,"floatSafeRemainder");var wt=class wt extends k{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)!==b.number){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.number,received:o.parsedType}),S}let n,i=new L;for(let o of this._def.checks)o.kind==="int"?w.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.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),y(n,{code:h.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),y(n,{code:h.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ba(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:h.not_finite,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new wt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new wt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&w.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};a(wt,"ZodNumber");var Pe=wt;Pe.create=r=>new Pe({checks:[],typeName:T.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...M(r)});var Dt=class Dt extends k{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)!==b.bigint){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.bigint,received:o.parsedType}),S}let n,i=new L;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),y(n,{code:h.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),y(n,{code:h.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),y(n,{code:h.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):w.assertNever(o);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,n,i){return new Dt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:x.toString(i)}]})}_addCheck(e){return new Dt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};a(Dt,"ZodBigInt");var Re=Dt;Re.create=r=>{var e;return new Re({checks:[],typeName:T.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...M(r)})};var Fr=class Fr extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.boolean,received:n.parsedType}),S}return B(e.data)}};a(Fr,"ZodBoolean");var Le=Fr;Le.create=r=>new Le({typeName:T.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...M(r)});var ar=class ar extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_type,expected:b.date,received:o.parsedType}),S}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return y(o,{code:h.invalid_date}),S}let n=new L,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),y(i,{code:h.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),y(i,{code:h.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):w.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ar({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};a(ar,"ZodDate");var Ge=ar;Ge.create=r=>new Ge({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:T.ZodDate,...M(r)});var Vr=class Vr extends k{_parse(e){if(this._getType(e)!==b.symbol){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.symbol,received:n.parsedType}),S}return B(e.data)}};a(Vr,"ZodSymbol");var st=Vr;st.create=r=>new st({typeName:T.ZodSymbol,...M(r)});var Ur=class Ur extends k{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.undefined,received:n.parsedType}),S}return B(e.data)}};a(Ur,"ZodUndefined");var Ne=Ur;Ne.create=r=>new Ne({typeName:T.ZodUndefined,...M(r)});var Hr=class Hr extends k{_parse(e){if(this._getType(e)!==b.null){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.null,received:n.parsedType}),S}return B(e.data)}};a(Hr,"ZodNull");var je=Hr;je.create=r=>new je({typeName:T.ZodNull,...M(r)});var $r=class $r extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}};a($r,"ZodAny");var Se=$r;Se.create=r=>new Se({typeName:T.ZodAny,...M(r)});var Zr=class Zr extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}};a(Zr,"ZodUnknown");var de=Zr;de.create=r=>new de({typeName:T.ZodUnknown,...M(r)});var Wr=class Wr extends k{_parse(e){let t=this._getOrReturnCtx(e);return y(t,{code:h.invalid_type,expected:b.never,received:t.parsedType}),S}};a(Wr,"ZodNever");var Q=Wr;Q.create=r=>new Q({typeName:T.ZodNever,...M(r)});var Yr=class Yr extends k{_parse(e){if(this._getType(e)!==b.undefined){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.void,received:n.parsedType}),S}return B(e.data)}};a(Yr,"ZodVoid");var lt=Yr;lt.create=r=>new lt({typeName:T.ZodVoid,...M(r)});var it=class it extends k{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),i=this._def;if(t.parsedType!==b.array)return y(t,{code:h.invalid_type,expected:b.array,received:t.parsedType}),S;if(i.exactLength!==null){let s=t.data.length>i.exactLength.value,l=t.data.length<i.exactLength.value;(s||l)&&(y(t,{code:s?h.too_big:h.too_small,minimum:l?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(y(t,{code:h.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(y(t,{code:h.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,l)=>i.type._parseAsync(new K(t,s,t.path,l)))).then(s=>L.mergeArray(n,s));let o=[...t.data].map((s,l)=>i.type._parseSync(new K(t,s,t.path,l)));return L.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new it({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new it({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new it({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}};a(it,"ZodArray");var fe=it;fe.create=(r,e)=>new fe({type:r,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...M(e)});function rt(r){if(r instanceof V){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=q.create(rt(n))}return new V({...r._def,shape:()=>e})}else return r instanceof fe?new fe({...r._def,type:rt(r.element)}):r instanceof q?q.create(rt(r.unwrap())):r instanceof ie?ie.create(rt(r.unwrap())):r instanceof ne?ne.create(r.items.map(e=>rt(e))):r}a(rt,"deepPartialify");var H=class H extends k{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(),t=w.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==b.object){let d=this._getOrReturnCtx(e);return y(d,{code:h.invalid_type,expected:b.object,received:d.parsedType}),S}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof Q&&this._def.unknownKeys==="strip"))for(let d in i.data)s.includes(d)||l.push(d);let c=[];for(let d of s){let p=o[d],g=i.data[d];c.push({key:{status:"valid",value:d},value:p._parse(new K(i,g,i.path,d)),alwaysSet:d in i.data})}if(this._def.catchall instanceof Q){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of l)c.push({key:{status:"valid",value:p},value:{status:"valid",value:i.data[p]}});else if(d==="strict")l.length>0&&(y(i,{code:h.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of l){let g=i.data[p];c.push({key:{status:"valid",value:p},value:d._parse(new K(i,g,i.path,p)),alwaysSet:p in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of c){let g=await p.key,D=await p.value;d.push({key:g,value:D,alwaysSet:p.alwaysSet})}return d}).then(d=>L.mergeObjectSync(n,d)):L.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new H({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var i,o,s,l;let c=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,t,n).message)!==null&&s!==void 0?s:n.defaultError;return t.code==="unrecognized_keys"?{message:(l=x.errToObj(e).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new H({...this._def,unknownKeys:"strip"})}passthrough(){return new H({...this._def,unknownKeys:"passthrough"})}extend(e){return new H({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new H({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:T.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new H({...this._def,catchall:e})}pick(e){let t={};return w.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}omit(e){let t={};return w.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new H({...this._def,shape:()=>t})}deepPartial(){return rt(this)}partial(e){let t={};return w.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}),new H({...this._def,shape:()=>t})}required(e){let t={};return w.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof q;)o=o._def.innerType;t[n]=o}}),new H({...this._def,shape:()=>t})}keyof(){return Ai(w.objectKeys(this.shape))}};a(H,"ZodObject");var V=H;V.create=(r,e)=>new V({shape:()=>r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...M(e)});V.strictCreate=(r,e)=>new V({shape:()=>r,unknownKeys:"strict",catchall:Q.create(),typeName:T.ZodObject,...M(e)});V.lazycreate=(r,e)=>new V({shape:r,unknownKeys:"strip",catchall:Q.create(),typeName:T.ZodObject,...M(e)});var qr=class qr extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function i(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return t.common.issues.push(...l.ctx.common.issues),l.result;let s=o.map(l=>new $(l.ctx.common.issues));return y(t,{code:h.invalid_union,unionErrors:s}),S}if(a(i,"handleResults"),t.common.async)return Promise.all(n.map(async o=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let d={...t,common:{...t.common,issues:[]},parent:null},p=c._parseSync({data:t.data,path:t.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!o&&(o={result:p,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let l=s.map(c=>new $(c));return y(t,{code:h.invalid_union,unionErrors:l}),S}}get options(){return this._def.options}};a(qr,"ZodUnion");var Be=qr;Be.create=(r,e)=>new Be({options:r,typeName:T.ZodUnion,...M(e)});var ce=a(r=>r instanceof Fe?ce(r.schema):r instanceof Z?ce(r.innerType()):r instanceof Ve?[r.value]:r instanceof Ue?r.options:r instanceof He?w.objectValues(r.enum):r instanceof $e?ce(r._def.innerType):r instanceof Ne?[void 0]:r instanceof je?[null]:r instanceof q?[void 0,...ce(r.unwrap())]:r instanceof ie?[null,...ce(r.unwrap())]:r instanceof Pt||r instanceof We?ce(r.unwrap()):r instanceof Ze?ce(r._def.innerType):[],"getDiscriminator"),sr=class sr extends k{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.object)return y(t,{code:h.invalid_type,expected:b.object,received:t.parsedType}),S;let n=this.discriminator,i=t.data[n],o=this.optionsMap.get(i);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),S)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let i=new Map;for(let o of t){let s=ce(o.shape[e]);if(!s.length)throw new Error("A discriminator value for key `".concat(e,"` could not be extracted from all schema options"));for(let l of s){if(i.has(l))throw new Error("Discriminator property ".concat(String(e)," has duplicate value ").concat(String(l)));i.set(l,o)}}return new sr({typeName:T.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...M(n)})}};a(sr,"ZodDiscriminatedUnion");var tr=sr;function jr(r,e){let t=_e(r),n=_e(e);if(r===e)return{valid:!0,data:r};if(t===b.object&&n===b.object){let i=w.objectKeys(e),o=w.objectKeys(r).filter(l=>i.indexOf(l)!==-1),s={...r,...e};for(let l of o){let c=jr(r[l],e[l]);if(!c.valid)return{valid:!1};s[l]=c.data}return{valid:!0,data:s}}else if(t===b.array&&n===b.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<r.length;o++){let s=r[o],l=e[o],c=jr(s,l);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===b.date&&n===b.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}a(jr,"mergeValues");var Kr=class Kr extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=a((o,s)=>{if(Gr(o)||Gr(s))return S;let l=jr(o.value,s.value);return l.valid?((Nr(o)||Nr(s))&&t.dirty(),{status:t.value,value:l.data}):(y(n,{code:h.invalid_intersection_types}),S)},"handleParsed");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,s])=>i(o,s)):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}))}};a(Kr,"ZodIntersection");var ze=Kr;ze.create=(r,e,t)=>new ze({left:r,right:e,typeName:T.ZodIntersection,...M(t)});var lr=class lr extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.array)return y(n,{code:h.invalid_type,expected:b.array,received:n.parsedType}),S;if(n.data.length<this._def.items.length)return y(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),S;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let o=[...n.data].map((s,l)=>{let c=this._def.items[l]||this._def.rest;return c?c._parse(new K(n,s,n.path,l)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>L.mergeArray(t,s)):L.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new lr({...this._def,rest:e})}};a(lr,"ZodTuple");var ne=lr;ne.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ne({items:r,typeName:T.ZodTuple,rest:null,...M(e)})};var Ct=class Ct extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.object)return y(n,{code:h.invalid_type,expected:b.object,received:n.parsedType}),S;let i=[],o=this._def.keyType,s=this._def.valueType;for(let l in n.data)i.push({key:o._parse(new K(n,l,n.path,l)),value:s._parse(new K(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?L.mergeObjectAsync(t,i):L.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof k?new Ct({keyType:e,valueType:t,typeName:T.ZodRecord,...M(n)}):new Ct({keyType:Te.create(),valueType:e,typeName:T.ZodRecord,...M(t)})}};a(Ct,"ZodRecord");var rr=Ct,Xr=class Xr extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.map)return y(n,{code:h.invalid_type,expected:b.map,received:n.parsedType}),S;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([l,c],d)=>({key:i._parse(new K(n,l,n.path,[d,"key"])),value:o._parse(new K(n,c,n.path,[d,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let c of s){let d=await c.key,p=await c.value;if(d.status==="aborted"||p.status==="aborted")return S;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),l.set(d.value,p.value)}return{status:t.value,value:l}})}else{let l=new Map;for(let c of s){let d=c.key,p=c.value;if(d.status==="aborted"||p.status==="aborted")return S;(d.status==="dirty"||p.status==="dirty")&&t.dirty(),l.set(d.value,p.value)}return{status:t.value,value:l}}}};a(Xr,"ZodMap");var ut=Xr;ut.create=(r,e,t)=>new ut({valueType:e,keyType:r,typeName:T.ZodMap,...M(t)});var Et=class Et extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==b.set)return y(n,{code:h.invalid_type,expected:b.set,received:n.parsedType}),S;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(y(n,{code:h.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(y(n,{code:h.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let o=this._def.valueType;function s(c){let d=new Set;for(let p of c){if(p.status==="aborted")return S;p.status==="dirty"&&t.dirty(),d.add(p.value)}return{status:t.value,value:d}}a(s,"finalizeSet");let l=[...n.data.values()].map((c,d)=>o._parse(new K(n,c,n.path,d)));return n.common.async?Promise.all(l).then(c=>s(c)):s(l)}min(e,t){return new Et({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Et({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};a(Et,"ZodSet");var ct=Et;ct.create=(r,e)=>new ct({valueType:r,minSize:null,maxSize:null,typeName:T.ZodSet,...M(e)});var ot=class ot extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.function)return y(t,{code:h.invalid_type,expected:b.function,received:t.parsedType}),S;function n(l,c){return Qt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jt(),at].filter(d=>!!d),issueData:{code:h.invalid_arguments,argumentsError:c}})}a(n,"makeArgsIssue");function i(l,c){return Qt({data:l,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jt(),at].filter(d=>!!d),issueData:{code:h.invalid_return_type,returnTypeError:c}})}a(i,"makeReturnsIssue");let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Me){let l=this;return B(async function(...c){let d=new $([]),p=await l._def.args.parseAsync(c,o).catch(C=>{throw d.addIssue(n(c,C)),d}),g=await Reflect.apply(s,this,p);return await l._def.returns._def.type.parseAsync(g,o).catch(C=>{throw d.addIssue(i(g,C)),d})})}else{let l=this;return B(function(...c){let d=l._def.args.safeParse(c,o);if(!d.success)throw new $([n(c,d.error)]);let p=Reflect.apply(s,this,d.data),g=l._def.returns.safeParse(p,o);if(!g.success)throw new $([i(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ot({...this._def,args:ne.create(e).rest(de.create())})}returns(e){return new ot({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ot({args:e||ne.create([]).rest(de.create()),returns:t||de.create(),typeName:T.ZodFunction,...M(n)})}};a(ot,"ZodFunction");var nr=ot,Jr=class Jr extends k{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};a(Jr,"ZodLazy");var Fe=Jr;Fe.create=(r,e)=>new Fe({getter:r,typeName:T.ZodLazy,...M(e)});var Qr=class Qr extends k{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),S}return{status:"valid",value:e.data}}get value(){return this._def.value}};a(Qr,"ZodLiteral");var Ve=Qr;Ve.create=(r,e)=>new Ve({value:r,typeName:T.ZodLiteral,...M(e)});function Ai(r,e){return new Ue({values:r,typeName:T.ZodEnum,...M(e)})}a(Ai,"createZodEnum");var It=class It extends k{constructor(){super(...arguments),Mt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:w.joinValues(n),received:t.parsedType,code:h.invalid_type}),S}if(er(this,Mt,"f")||Ci(this,Mt,new Set(this._def.values),"f"),!er(this,Mt,"f").has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:h.invalid_enum_value,options:n}),S}return B(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return It.create(e,{...this._def,...t})}exclude(e,t=this._def){return It.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}};a(It,"ZodEnum");var Ue=It;Mt=new WeakMap;Ue.create=Ai;var en=class en extends k{constructor(){super(...arguments),kt.set(this,void 0)}_parse(e){let t=w.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==b.string&&n.parsedType!==b.number){let i=w.objectValues(t);return y(n,{expected:w.joinValues(i),received:n.parsedType,code:h.invalid_type}),S}if(er(this,kt,"f")||Ci(this,kt,new Set(w.getValidEnumValues(this._def.values)),"f"),!er(this,kt,"f").has(e.data)){let i=w.objectValues(t);return y(n,{received:n.data,code:h.invalid_enum_value,options:i}),S}return B(e.data)}get enum(){return this._def.values}};a(en,"ZodNativeEnum");var He=en;kt=new WeakMap;He.create=(r,e)=>new He({values:r,typeName:T.ZodNativeEnum,...M(e)});var tn=class tn extends k{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return y(t,{code:h.invalid_type,expected:b.promise,received:t.parsedType}),S;let n=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return B(n.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};a(tn,"ZodPromise");var Me=tn;Me.create=(r,e)=>new Me({type:r,typeName:T.ZodPromise,...M(e)});var rn=class rn extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{y(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async l=>{if(t.value==="aborted")return S;let c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?S:c.status==="dirty"||t.value==="dirty"?nt(c.value):c});{if(t.value==="aborted")return S;let l=this._def.schema._parseSync({data:s,path:n.path,parent:n});return l.status==="aborted"?S:l.status==="dirty"||t.value==="dirty"?nt(l.value):l}}if(i.type==="refinement"){let s=a(l=>{let c=i.refinement(l,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value),{status:t.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?S:(l.status==="dirty"&&t.dirty(),s(l.value).then(()=>({status:t.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ot(s))return s;let l=i.transform(s.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>Ot(s)?Promise.resolve(i.transform(s.value,o)).then(l=>({status:t.value,value:l})):s);w.assertNever(i)}};a(rn,"ZodEffects");var Z=rn;Z.create=(r,e,t)=>new Z({schema:r,typeName:T.ZodEffects,effect:e,...M(t)});Z.createWithPreprocess=(r,e,t)=>new Z({schema:e,effect:{type:"preprocess",transform:r},typeName:T.ZodEffects,...M(t)});var nn=class nn extends k{_parse(e){return this._getType(e)===b.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(nn,"ZodOptional");var q=nn;q.create=(r,e)=>new q({innerType:r,typeName:T.ZodOptional,...M(e)});var on=class on extends k{_parse(e){return this._getType(e)===b.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};a(on,"ZodNullable");var ie=on;ie.create=(r,e)=>new ie({innerType:r,typeName:T.ZodNullable,...M(e)});var an=class an extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===b.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};a(an,"ZodDefault");var $e=an;$e.create=(r,e)=>new $e({innerType:r,typeName:T.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...M(e)});var sn=class sn extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return At(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};a(sn,"ZodCatch");var Ze=sn;Ze.create=(r,e)=>new Ze({innerType:r,typeName:T.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...M(e)});var ln=class ln extends k{_parse(e){if(this._getType(e)!==b.nan){let n=this._getOrReturnCtx(e);return y(n,{code:h.invalid_type,expected:b.nan,received:n.parsedType}),S}return{status:"valid",value:e.data}}};a(ln,"ZodNaN");var dt=ln;dt.create=r=>new dt({typeName:T.ZodNaN,...M(r)});var va=Symbol("zod_brand"),un=class un extends k{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};a(un,"ZodBranded");var Pt=un,ur=class ur extends k{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return a(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?S:o.status==="dirty"?(t.dirty(),nt(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})},"handleAsync")();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?S:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,t){return new ur({in:e,out:t,typeName:T.ZodPipeline})}};a(ur,"ZodPipeline");var Rt=ur,cn=class cn extends k{_parse(e){let t=this._def.innerType._parse(e),n=a(i=>(Ot(i)&&(i.value=Object.freeze(i.value)),i),"freeze");return At(t)?t.then(i=>n(i)):n(t)}unwrap(){return this._def.innerType}};a(cn,"ZodReadonly");var We=cn;We.create=(r,e)=>new We({innerType:r,typeName:T.ZodReadonly,...M(e)});function Pi(r,e={},t){return r?Se.create().superRefine((n,i)=>{var o,s;if(!r(n)){let l=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(s=(o=l.fatal)!==null&&o!==void 0?o:t)!==null&&s!==void 0?s:!0,d=typeof l=="string"?{message:l}:l;i.addIssue({code:"custom",...d,fatal:c})}}):Se.create()}a(Pi,"custom");var xa={object:V.lazycreate},T;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(T||(T={}));var _a=a((r,e={message:"Input not instance of ".concat(r.name)})=>Pi(t=>t instanceof r,e),"instanceOfType"),Ri=Te.create,Li=Pe.create,Ta=dt.create,Sa=Re.create,Gi=Le.create,Ma=Ge.create,ka=st.create,wa=Ne.create,Da=je.create,Ca=Se.create,Ea=de.create,Ia=Q.create,Oa=lt.create,Aa=fe.create,Pa=V.create,Ra=V.strictCreate,La=Be.create,Ga=tr.create,Na=ze.create,ja=ne.create,Ba=rr.create,za=ut.create,Fa=ct.create,Va=nr.create,Ua=Fe.create,Ha=Ve.create,$a=Ue.create,Za=He.create,Wa=Me.create,wi=Z.create,Ya=q.create,qa=ie.create,Ka=Z.createWithPreprocess,Xa=Rt.create,Ja=a(()=>Ri().optional(),"ostring"),Qa=a(()=>Li().optional(),"onumber"),es=a(()=>Gi().optional(),"oboolean"),ts={string:r=>Te.create({...r,coerce:!0}),number:r=>Pe.create({...r,coerce:!0}),boolean:r=>Le.create({...r,coerce:!0}),bigint:r=>Re.create({...r,coerce:!0}),date:r=>Ge.create({...r,coerce:!0})},rs=S,m=Object.freeze({__proto__:null,defaultErrorMap:at,setErrorMap:ra,getErrorMap:Jt,makeIssue:Qt,EMPTY_PATH:na,addIssueToContext:y,ParseStatus:L,INVALID:S,DIRTY:nt,OK:B,isAborted:Gr,isDirty:Nr,isValid:Ot,isAsync:At,get util(){return w},get objectUtil(){return Lr},ZodParsedType:b,getParsedType:_e,ZodType:k,datetimeRegex:Oi,ZodString:Te,ZodNumber:Pe,ZodBigInt:Re,ZodBoolean:Le,ZodDate:Ge,ZodSymbol:st,ZodUndefined:Ne,ZodNull:je,ZodAny:Se,ZodUnknown:de,ZodNever:Q,ZodVoid:lt,ZodArray:fe,ZodObject:V,ZodUnion:Be,ZodDiscriminatedUnion:tr,ZodIntersection:ze,ZodTuple:ne,ZodRecord:rr,ZodMap:ut,ZodSet:ct,ZodFunction:nr,ZodLazy:Fe,ZodLiteral:Ve,ZodEnum:Ue,ZodNativeEnum:He,ZodPromise:Me,ZodEffects:Z,ZodTransformer:Z,ZodOptional:q,ZodNullable:ie,ZodDefault:$e,ZodCatch:Ze,ZodNaN:dt,BRAND:va,ZodBranded:Pt,ZodPipeline:Rt,ZodReadonly:We,custom:Pi,Schema:k,ZodSchema:k,late:xa,get ZodFirstPartyTypeKind(){return T},coerce:ts,any:Ca,array:Aa,bigint:Sa,boolean:Gi,date:Ma,discriminatedUnion:Ga,effect:wi,enum:$a,function:Va,instanceof:_a,intersection:Na,lazy:Ua,literal:Ha,map:za,nan:Ta,nativeEnum:Za,never:Ia,null:Da,nullable:qa,number:Li,object:Pa,oboolean:es,onumber:Qa,optional:Ya,ostring:Ja,pipeline:Xa,preprocess:Ka,promise:Wa,record:Ba,set:Fa,strictObject:Ra,string:Ri,symbol:ka,transformer:wi,tuple:ja,undefined:wa,union:La,unknown:Ea,void:Oa,NEVER:rs,ZodIssueCode:h,quotelessJson:ta,ZodError:$});f();function br(r){return(r%(2*Math.PI)+2*Math.PI)%(2*Math.PI)}a(br,"normalizeAngle");f();f();var Tn=class Tn extends ve{};a(Tn,"Geometry2DObject3D");var Ke=Tn,Sn=class Sn{constructor(e,t){u(this,"id");u(this,"positionDirty",!0);u(this,"object3d",new Ke);u(this,"components");u(this,"disposed",!1);u(this,"worldPosition",new F);this.id=e.id||j(),this.components=[e],this.object3d=new Ke,this.object3d.position.copy(t),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}};a(Sn,"Geometry2D");var ge=Sn;f();f();f();f();f();f();f();var z=63710088e-1,go={centimeters:z*100,centimetres:z*100,degrees:z/111325,feet:z*3.28084,inches:z*39.37,kilometers:z/1e3,kilometres:z/1e3,meters:z,metres:z,miles:z/1609.344,millimeters:z*1e3,millimetres:z*1e3,nauticalmiles:z/1852,radians:1,yards:z*1.0936},ld={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/z,yards:1.0936133};function Xe(r,e,t){t===void 0&&(t={});var n={type:"Feature"};return(t.id===0||t.id)&&(n.id=t.id),t.bbox&&(n.bbox=t.bbox),n.properties=e||{},n.geometry=r,n}a(Xe,"feature");function Yl(r,e,t){if(t===void 0&&(t={}),!r)throw new Error("coordinates is required");if(!Array.isArray(r))throw new Error("coordinates must be an Array");if(r.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!mo(r[0])||!mo(r[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:r};return Xe(n,e,t)}a(Yl,"point");function ud(r,e,t){t===void 0&&(t={});for(var n=0,i=r;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 s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:r};return Xe(l,e,t)}a(ud,"polygon");function yo(r,e,t){if(t===void 0&&(t={}),r.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:r};return Xe(n,e,t)}a(yo,"lineString");function cd(r,e){e===void 0&&(e={});var t={type:"FeatureCollection"};return e.id&&(t.id=e.id),e.bbox&&(t.bbox=e.bbox),t.features=r,t}a(cd,"featureCollection");function dd(r,e,t){t===void 0&&(t={});var n={type:"MultiLineString",coordinates:r};return Xe(n,e,t)}a(dd,"multiLineString");function fd(r,e){e===void 0&&(e="kilometers");var t=go[e];if(!t)throw new Error(e+" units is invalid");return r*t}a(fd,"radiansToLength");function pd(r,e){e===void 0&&(e="kilometers");var t=go[e];if(!t)throw new Error(e+" units is invalid");return r/t}a(pd,"lengthToRadians");function hd(r){var e=r%(2*Math.PI);return e*180/Math.PI}a(hd,"radiansToDegrees");function md(r){var e=r%360;return e*Math.PI/180}a(md,"degreesToRadians");function mo(r){return!isNaN(r)&&r!==null&&!Array.isArray(r)}a(mo,"isNumber");function vr(r,e,t){if(r!==null)for(var n,i,o,s,l,c,d,p=0,g=0,D,C=r.type,O=C==="FeatureCollection",E=C==="Feature",G=O?r.features.length:1,N=0;N<G;N++){d=O?r.features[N].geometry:E?r.geometry:r,D=d?d.type==="GeometryCollection":!1,l=D?d.geometries.length:1;for(var re=0;re<l;re++){var Y=0,Ce=0;if(s=D?d.geometries[re]:d,s!==null){c=s.coordinates;var be=s.type;switch(p=t&&(be==="Polygon"||be==="MultiPolygon")?1:0,be){case null:break;case"Point":if(e(c,g,N,Y,Ce)===!1)return!1;g++,Y++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(e(c[n],g,N,Y,Ce)===!1)return!1;g++,be==="MultiPoint"&&Y++}be==="LineString"&&Y++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-p;i++){if(e(c[n][i],g,N,Y,Ce)===!1)return!1;g++}be==="MultiLineString"&&Y++,be==="Polygon"&&Ce++}be==="Polygon"&&Y++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(Ce=0,i=0;i<c[n].length;i++){for(o=0;o<c[n][i].length-p;o++){if(e(c[n][i][o],g,N,Y,Ce)===!1)return!1;g++}Ce++}Y++}break;case"GeometryCollection":for(n=0;n<s.geometries.length;n++)if(vr(s.geometries[n],e,t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}a(vr,"coordEach");function _d(r,e){if(r.type==="Feature")e(r,0);else if(r.type==="FeatureCollection")for(var t=0;t<r.features.length&&e(r.features[t],t)!==!1;t++);}a(_d,"featureEach");function ql(r,e){var t,n,i,o,s,l,c,d,p,g,D=0,C=r.type==="FeatureCollection",O=r.type==="Feature",E=C?r.features.length:1;for(t=0;t<E;t++){for(l=C?r.features[t].geometry:O?r.geometry:r,d=C?r.features[t].properties:O?r.properties:{},p=C?r.features[t].bbox:O?r.bbox:void 0,g=C?r.features[t].id:O?r.id:void 0,c=l?l.type==="GeometryCollection":!1,s=c?l.geometries.length:1,i=0;i<s;i++){if(o=c?l.geometries[i]:l,o===null){if(e(null,D,d,p,g)===!1)return!1;continue}switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(o,D,d,p,g)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<o.geometries.length;n++)if(e(o.geometries[n],D,d,p,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}D++}}a(ql,"geomEach");function Kl(r,e){ql(r,function(t,n,i,o,s){var l=t===null?null:t.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return e(Xe(t,i,{bbox:o,id:s}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var d=0;d<t.coordinates.length;d++){var p=t.coordinates[d],g={type:c,coordinates:p};if(e(Xe(g,i),n,d)===!1)return!1}})}a(Kl,"flattenEach");function Xl(r,e){Kl(r,function(t,n,i){var o=0;if(t.geometry){var s=t.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var l,c=0,d=0,p=0;if(vr(t,function(g,D,C,O,E){if(l===void 0||n>c||O>d||E>p){l=g,c=n,d=O,p=E,o=0;return}var G=yo([l,g],t.properties);if(e(G,n,i,E,o)===!1)return!1;o++,l=g})===!1)return!1}}})}a(Xl,"segmentEach");function Td(r,e,t){var n=t,i=!1;return Xl(r,function(o,s,l,c,d){i===!1&&t===void 0?n=o:n=e(n,o,s,l,c,d),i=!0}),n}a(Td,"segmentReduce");function Mn(r){var e=[1/0,1/0,-1/0,-1/0];return vr(r,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}a(Mn,"bbox");Mn.default=Mn;var bo=Mn;function vo(r){return bo(r)}a(vo,"getBoundingBoxFromFeature");f();var kn="#ffffff";var Dn=class Dn{constructor(e={}){u(this,"initialColor",kn);u(this,"color",kn);u(this,"initialTopColor");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.initialTopColor=this.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}};a(Dn,"StyleComponent");var wn=Dn;var Cn=class Cn extends di{constructor(){super(...arguments);u(this,"type","entityBatchedMesh");u(this,"userData",{entities:{}})}};a(Cn,"EntityBatchedMesh");var ke=Cn,zt,Ft,Je,En=class En{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 le);u(this,"topColor",new le);u(this,"position",new F);U(this,zt,0);U(this,Ft,1);U(this,Je,void 0);u(this,"texturesVisible",!1);this.feature=e}get visible(){return this.mesh&&this.instanceIndex!==-1?this.mesh.getVisibleAt(this.instanceIndex):!1}set visible(e){this.mesh&&this.instanceIndex!==-1&&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,t){this.color.set(e),this.topColor.set(t),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 I(this,zt)}set altitude(e){this.mesh&&(this.mesh.position.z=e,R(this,zt,e))}get opacity(){return I(this,Ft)}set opacity(e){if(this.material&&(this.material.opacity=e,this.material.transparent=e<1,this.material.needsUpdate=!0),this.imageMesh){let t=Array.isArray(this.imageMesh.material)?this.imageMesh.material:[this.imageMesh.material];for(let n of t)n.opacity=e,n.needsUpdate=!0}R(this,Ft,e)}get texture(){var e,t;return(t=(e=this.material)==null?void 0:e.texture)==null?void 0:t.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,t;return(t=(e=this.material)==null?void 0:e.topTexture)==null?void 0:t.image.src}get topTextureInstance(){var e;return(e=this.material)==null?void 0:e.topTexture}get featureBbox(){return I(this,Je)?I(this,Je):(R(this,Je,vo(this.feature)),I(this,Je))}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)}};zt=new WeakMap,Ft=new WeakMap,Je=new WeakMap,a(En,"MeshComponent");var oe=En;f();var xo="#ffffff",we,In=class In{constructor(e={}){u(this,"color",xo);u(this,"initialColor",xo);u(this,"topColor");u(this,"initialTopColor");u(this,"opacity",1);u(this,"height");U(this,we,void 0);u(this,"outline",!0);u(this,"texture");u(this,"topTexture");u(this,"dirty",!0);var t,n;this.color=(t=e==null?void 0:e.color)!=null?t:this.color,this.initialColor=this.color,this.topColor=e==null?void 0:e.topColor,this.initialTopColor=this.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 I(this,we)}set shading(e){var t;if(!e){R(this,we,void 0);return}R(this,we,(t=I(this,we))!=null?t:{start:0,end:0,intensity:0}),Object.assign(I(this,we),e)}};we=new WeakMap,a(In,"GeometryGroupStyleComponent");var xr=In;f();f();function mt(r){var t;let e=(t=r.parent)==null?void 0:t.children.find(n=>n.userData.outlineOfEntityId===r.userData.entityId);return e instanceof Kt?e:void 0}a(mt,"findOutline");f();f();f();f();var On=class On{constructor(){u(this,"hover",!1);u(this,"dirty",!1)}};a(On,"InteractionComponent");var gt=On;f();f();var _o=["","","low","medium","high","always-visible"];function To(r){return Math.min(5,Math.max(2,r))}a(To,"clampTierNumber");function yt(r){if(typeof r=="number")return To(r);let e=_o.indexOf(r);return e===-1?3:e}a(yt,"convertCollisionRankingTierToNumber");function tf(r){let e=To(r);return _o[e]}a(tf,"convertNumberToCollisionRankingTier");var _r=4,An=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.union([m.boolean(),m.literal("pointer-events-auto")]).optional(),id:m.string().optional(),anchor:m.union([m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]),m.array(m.enum(["top","bottom","left","right","center","top-left","top-right","bottom-left","bottom-right"]))]).optional(),dynamicResize:m.boolean().optional(),zIndex:m.number().optional()});function df(r,e,t){m.array(m.number()).refine(n=>n.length===2||n.length===3,{message:"Array length must be either 2 or 3"}).parse(r),m.string().parse(e),An.parse(t)}a(df,"validateMarker");var Qe=class Qe{constructor(e,t={}){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 qt);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",a((e,t=!1)=>{if(this.currentStrategyIndex===e||t)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",s=-n/2+"px";switch(this.style.top=o,this.style.left=s,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=s}this.containerEl.style.top=this.style.top,this.containerEl.style.left=this.style.left},"onStrategySelected"));u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],lockedToStrategyIndex:-1,shouldCollideWithScreenEdges:!1});if(this.id=(t==null?void 0:t.id)||j(),this.options={...this.options,...t},typeof t.rank=="string")this.rank=yt(t.rank);else if(t.rank!=null&&t.rank>0)this.rank=t.rank;else{let i=Math.trunc(_.env.NODE_ENV==="test"?Qe.testId:Qe.testId*10)/10;Qe.testId+=.001,this.rank=i}typeof t.interactive=="string"&&(this.pointerEvents=t.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,t){if(e!=null&&t!=null)this.dimensions={width:e,height:t};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:t}=this.dimensions;return(Array.isArray(this.options.anchor)?this.options.anchor:[this.options.anchor]).map(i=>({name:i,getBoundingBox:()=>{let o=t/2,s=t/2,l=e/2,c=e/2;switch(i){case"top":{o=t,s=0;break}case"bottom":{o=0,s=t;break}case"left":{l=e,c=0;break}case"right":{l=0,c=e;break}case"top-left":{o=t,l=e,s=0,c=0;break}case"top-right":{o=t,c=e,s=0,l=0;break}case"bottom-left":{s=t,l=e,o=0,c=0;break}case"bottom-right":{s=t,c=e,o=0,l=0;break}}return[o+_r,s+_r,l+_r,c+_r]}}))}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((t,n)=>[...t.getBoundingBox(),n]),this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(Qe,"MarkerComponent"),u(Qe,"testId",0);var So=Qe;f();var Vt=class Vt extends ve{constructor(t){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=t}addEntity(t){t instanceof Vt?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ge?(this.childrenIds.add(t.id),this.add(t.object3d),this.userData.entities2D.add(t.id)):t instanceof se?(this.childrenIds.add(t.userData.entityId),this.add(t)):t instanceof ae&&t.object3d&&(this.childrenIds.add(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childadded",child:this})}removeEntity(t){t instanceof Vt?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ge?(this.childrenIds.delete(t.id),this.userData.entities2D.delete(t.id),this.remove(t.object3d)):t instanceof se?(this.childrenIds.delete(t.userData.entityId),this.remove(t)):t instanceof ae&&t.object3d&&(this.childrenIds.delete(t.id),this.add(t.object3d)),this.dispatchEvent({type:"childremoved",child:this})}setVisible(t){this.visible=t,this.dispatchEvent({type:"childremoved",child:this})}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Vt,"GroupContainerObject3D");var De=Vt;f();f();function Tr(r){"@babel/helpers - typeof";return Tr=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},Tr(r)}a(Tr,"_typeof");var Ql=/^\s+/,eu=/\s+$/;function v(r,e){if(r=r||"",e=e||{},r instanceof v)return r;if(!(this instanceof v))return new v(r,e);var t=tu(r);this._originalInput=r,this._r=t.r,this._g=t.g,this._b=t.b,this._a=t.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||t.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=t.ok}a(v,"tinycolor");v.prototype={isDark:a(function(){return this.getBrightness()<128},"isDark"),isLight:a(function(){return!this.isDark()},"isLight"),isValid:a(function(){return this._ok},"isValid"),getOriginalInput:a(function(){return this._originalInput},"getOriginalInput"),getFormat:a(function(){return this._format},"getFormat"),getAlpha:a(function(){return this._a},"getAlpha"),getBrightness:a(function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},"getBrightness"),getLuminance:a(function(){var e=this.toRgb(),t,n,i,o,s,l;return t=e.r/255,n=e.g/255,i=e.b/255,t<=.03928?o=t/12.92:o=Math.pow((t+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?l=i/12.92:l=Math.pow((i+.055)/1.055,2.4),.2126*o+.7152*s+.0722*l},"getLuminance"),setAlpha:a(function(e){return this._a=Io(e),this._roundA=Math.round(100*this._a)/100,this},"setAlpha"),toHsv:a(function(){var e=ko(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},"toHsv"),toHsvString:a(function(){var e=ko(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+t+", "+n+"%, "+i+"%)":"hsva("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHsvString"),toHsl:a(function(){var e=Mo(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},"toHsl"),toHslString:a(function(){var e=Mo(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+t+", "+n+"%, "+i+"%)":"hsla("+t+", "+n+"%, "+i+"%, "+this._roundA+")"},"toHslString"),toHex:a(function(e){return wo(this._r,this._g,this._b,e)},"toHex"),toHexString:a(function(e){return"#"+this.toHex(e)},"toHexString"),toHex8:a(function(e){return ou(this._r,this._g,this._b,this._a,e)},"toHex8"),toHex8String:a(function(e){return"#"+this.toHex8(e)},"toHex8String"),toRgb:a(function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},"toRgb"),toRgbString:a(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+")"},"toRgbString"),toPercentageRgb:a(function(){return{r:Math.round(P(this._r,255)*100)+"%",g:Math.round(P(this._g,255)*100)+"%",b:Math.round(P(this._b,255)*100)+"%",a:this._a}},"toPercentageRgb"),toPercentageRgbString:a(function(){return this._a==1?"rgb("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%)":"rgba("+Math.round(P(this._r,255)*100)+"%, "+Math.round(P(this._g,255)*100)+"%, "+Math.round(P(this._b,255)*100)+"%, "+this._roundA+")"},"toPercentageRgbString"),toName:a(function(){return this._a===0?"transparent":this._a<1?!1:yu[wo(this._r,this._g,this._b,!0)]||!1},"toName"),toFilter:a(function(e){var t="#"+Do(this._r,this._g,this._b,this._a),n=t,i=this._gradientType?"GradientType = 1, ":"";if(e){var o=v(e);n="#"+Do(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+t+",endColorstr="+n+")"},"toFilter"),toString:a(function(e){var t=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,o=!t&&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())},"toString"),clone:a(function(){return v(this.toString())},"clone"),_applyModification:a(function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},"_applyModification"),lighten:a(function(){return this._applyModification(uu,arguments)},"lighten"),brighten:a(function(){return this._applyModification(cu,arguments)},"brighten"),darken:a(function(){return this._applyModification(du,arguments)},"darken"),desaturate:a(function(){return this._applyModification(au,arguments)},"desaturate"),saturate:a(function(){return this._applyModification(su,arguments)},"saturate"),greyscale:a(function(){return this._applyModification(lu,arguments)},"greyscale"),spin:a(function(){return this._applyModification(fu,arguments)},"spin"),_applyCombination:a(function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},"_applyCombination"),analogous:a(function(){return this._applyCombination(mu,arguments)},"analogous"),complement:a(function(){return this._applyCombination(pu,arguments)},"complement"),monochromatic:a(function(){return this._applyCombination(gu,arguments)},"monochromatic"),splitcomplement:a(function(){return this._applyCombination(hu,arguments)},"splitcomplement"),triad:a(function(){return this._applyCombination(Co,[3])},"triad"),tetrad:a(function(){return this._applyCombination(Co,[4])},"tetrad")};v.fromRatio=function(r,e){if(Tr(r)=="object"){var t={};for(var n in r)r.hasOwnProperty(n)&&(n==="a"?t[n]=r[n]:t[n]=Ut(r[n]));r=t}return v(r,e)};function tu(r){var e={r:0,g:0,b:0},t=1,n=null,i=null,o=null,s=!1,l=!1;return typeof r=="string"&&(r=_u(r)),Tr(r)=="object"&&(ye(r.r)&&ye(r.g)&&ye(r.b)?(e=ru(r.r,r.g,r.b),s=!0,l=String(r.r).substr(-1)==="%"?"prgb":"rgb"):ye(r.h)&&ye(r.s)&&ye(r.v)?(n=Ut(r.s),i=Ut(r.v),e=iu(r.h,n,i),s=!0,l="hsv"):ye(r.h)&&ye(r.s)&&ye(r.l)&&(n=Ut(r.s),o=Ut(r.l),e=nu(r.h,n,o),s=!0,l="hsl"),r.hasOwnProperty("a")&&(t=r.a)),t=Io(t),{ok:s,format:r.format||l,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:t}}a(tu,"inputToRGB");function ru(r,e,t){return{r:P(r,255)*255,g:P(e,255)*255,b:P(t,255)*255}}a(ru,"rgbToRgb");function Mo(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=(n+i)/2;if(n==i)o=s=0;else{var c=n-i;switch(s=l>.5?c/(2-n-i):c/(n+i),n){case r:o=(e-t)/c+(e<t?6:0);break;case e:o=(t-r)/c+2;break;case t:o=(r-e)/c+4;break}o/=6}return{h:o,s,l}}a(Mo,"rgbToHsl");function nu(r,e,t){var n,i,o;r=P(r,360),e=P(e,100),t=P(t,100);function s(d,p,g){return g<0&&(g+=1),g>1&&(g-=1),g<1/6?d+(p-d)*6*g:g<1/2?p:g<2/3?d+(p-d)*(2/3-g)*6:d}if(a(s,"hue2rgb"),e===0)n=i=o=t;else{var l=t<.5?t*(1+e):t+e-t*e,c=2*t-l;n=s(c,l,r+1/3),i=s(c,l,r),o=s(c,l,r-1/3)}return{r:n*255,g:i*255,b:o*255}}a(nu,"hslToRgb");function ko(r,e,t){r=P(r,255),e=P(e,255),t=P(t,255);var n=Math.max(r,e,t),i=Math.min(r,e,t),o,s,l=n,c=n-i;if(s=n===0?0:c/n,n==i)o=0;else{switch(n){case r:o=(e-t)/c+(e<t?6:0);break;case e:o=(t-r)/c+2;break;case t:o=(r-e)/c+4;break}o/=6}return{h:o,s,v:l}}a(ko,"rgbToHsv");function iu(r,e,t){r=P(r,360)*6,e=P(e,100),t=P(t,100);var n=Math.floor(r),i=r-n,o=t*(1-e),s=t*(1-i*e),l=t*(1-(1-i)*e),c=n%6,d=[t,s,o,o,l,t][c],p=[l,t,t,s,o,o][c],g=[o,o,l,t,t,s][c];return{r:d*255,g:p*255,b:g*255}}a(iu,"hsvToRgb");function wo(r,e,t,n){var i=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).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("")}a(wo,"rgbToHex");function ou(r,e,t,n,i){var o=[te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16)),te(Oo(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("")}a(ou,"rgbaToHex");function Do(r,e,t,n){var i=[te(Oo(n)),te(Math.round(r).toString(16)),te(Math.round(e).toString(16)),te(Math.round(t).toString(16))];return i.join("")}a(Do,"rgbaToArgbHex");v.equals=function(r,e){return!r||!e?!1:v(r).toRgbString()==v(e).toRgbString()};v.random=function(){return v.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function au(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s-=e/100,t.s=Sr(t.s),v(t)}a(au,"_desaturate");function su(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.s+=e/100,t.s=Sr(t.s),v(t)}a(su,"_saturate");function lu(r){return v(r).desaturate(100)}a(lu,"_greyscale");function uu(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l+=e/100,t.l=Sr(t.l),v(t)}a(uu,"_lighten");function cu(r,e){e=e===0?0:e||10;var t=v(r).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),v(t)}a(cu,"_brighten");function du(r,e){e=e===0?0:e||10;var t=v(r).toHsl();return t.l-=e/100,t.l=Sr(t.l),v(t)}a(du,"_darken");function fu(r,e){var t=v(r).toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,v(t)}a(fu,"_spin");function pu(r){var e=v(r).toHsl();return e.h=(e.h+180)%360,v(e)}a(pu,"_complement");function Co(r,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var t=v(r).toHsl(),n=[v(r)],i=360/e,o=1;o<e;o++)n.push(v({h:(t.h+o*i)%360,s:t.s,l:t.l}));return n}a(Co,"polyad");function hu(r){var e=v(r).toHsl(),t=e.h;return[v(r),v({h:(t+72)%360,s:e.s,l:e.l}),v({h:(t+216)%360,s:e.s,l:e.l})]}a(hu,"_splitcomplement");function mu(r,e,t){e=e||6,t=t||30;var n=v(r).toHsl(),i=360/t,o=[v(r)];for(n.h=(n.h-(i*e>>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(v(n));return o}a(mu,"_analogous");function gu(r,e){e=e||6;for(var t=v(r).toHsv(),n=t.h,i=t.s,o=t.v,s=[],l=1/e;e--;)s.push(v({h:n,s:i,v:o})),o=(o+l)%1;return s}a(gu,"_monochromatic");v.mix=function(r,e,t){t=t===0?0:t||50;var n=v(r).toRgb(),i=v(e).toRgb(),o=t/100,s={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 v(s)};v.readability=function(r,e){var t=v(r),n=v(e);return(Math.max(t.getLuminance(),n.getLuminance())+.05)/(Math.min(t.getLuminance(),n.getLuminance())+.05)};v.isReadable=function(r,e,t){var n=v.readability(r,e),i,o;switch(o=!1,i=Tu(t),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};v.mostReadable=function(r,e,t){var n=null,i=0,o,s,l,c;t=t||{},s=t.includeFallbackColors,l=t.level,c=t.size;for(var d=0;d<e.length;d++)o=v.readability(r,e[d]),o>i&&(i=o,n=v(e[d]));return v.isReadable(r,n,{level:l,size:c})||!s?n:(t.includeFallbackColors=!1,v.mostReadable(r,["#fff","#000"],t))};var Pn=v.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"},yu=v.hexNames=bu(Pn);function bu(r){var e={};for(var t in r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e}a(bu,"flip");function Io(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}a(Io,"boundAlpha");function P(r,e){vu(r)&&(r="100%");var t=xu(r);return r=Math.min(e,Math.max(0,parseFloat(r))),t&&(r=parseInt(r*e,10)/100),Math.abs(r-e)<1e-6?1:r%e/parseFloat(e)}a(P,"bound01");function Sr(r){return Math.min(1,Math.max(0,r))}a(Sr,"clamp01");function W(r){return parseInt(r,16)}a(W,"parseIntFromHex");function vu(r){return typeof r=="string"&&r.indexOf(".")!=-1&&parseFloat(r)===1}a(vu,"isOnePointZero");function xu(r){return typeof r=="string"&&r.indexOf("%")!=-1}a(xu,"isPercentage");function te(r){return r.length==1?"0"+r:""+r}a(te,"pad2");function Ut(r){return r<=1&&(r=r*100+"%"),r}a(Ut,"convertToPercentage");function Oo(r){return Math.round(parseFloat(r)*255).toString(16)}a(Oo,"convertDecimalToHex");function Eo(r){return W(r)/255}a(Eo,"convertHexToDecimal");var ee=function(){var r="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",t="(?:"+e+")|(?:"+r+")",n="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",i="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),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 ye(r){return!!ee.CSS_UNIT.exec(r)}a(ye,"isValidCSSUnit");function _u(r){r=r.replace(Ql,"").replace(eu,"").toLowerCase();var e=!1;if(Pn[r])r=Pn[r],e=!0;else if(r=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t;return(t=ee.rgb.exec(r))?{r:t[1],g:t[2],b:t[3]}:(t=ee.rgba.exec(r))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ee.hsl.exec(r))?{h:t[1],s:t[2],l:t[3]}:(t=ee.hsla.exec(r))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ee.hsv.exec(r))?{h:t[1],s:t[2],v:t[3]}:(t=ee.hsva.exec(r))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ee.hex8.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),a:Eo(t[4]),format:e?"name":"hex8"}:(t=ee.hex6.exec(r))?{r:W(t[1]),g:W(t[2]),b:W(t[3]),format:e?"name":"hex"}:(t=ee.hex4.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),a:Eo(t[4]+""+t[4]),format:e?"name":"hex8"}:(t=ee.hex3.exec(r))?{r:W(t[1]+""+t[1]),g:W(t[2]+""+t[2]),b:W(t[3]+""+t[3]),format:e?"name":"hex"}:!1}a(_u,"stringInputToObject");function Tu(r){var e,t;return r=r||{level:"AA",size:"small"},e=(r.level||"AA").toUpperCase(),t=(r.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),t!=="small"&&t!=="large"&&(t="small"),{level:e,size:t}}a(Tu,"validateWCAG2Parms");var Rn=Ko(ho());var Gn=m.object({rank:m.union([m.enum(["low","medium","high","always-visible"]),m.number()]).optional(),interactive:m.boolean().optional(),appearance:m.object({margin:m.number().min(6).optional(),text:m.object({numLines:m.number().optional(),lineHeight:m.number().optional(),size:m.number().optional(),maxWidth:m.number().optional(),foregroundColor:m.string().optional(),backgroundColor:m.string().optional()}).optional(),marker:m.object({size:m.number().optional(),foregroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional(),backgroundColor:m.object({active:m.string().optional(),inactive:m.string().optional()}).optional()}).optional()}).optional()});function If(r,e,t){m.array(m.number()).length(2).parse(r),m.string().parse(e),Gn.parse(t||{})}a(If,"validateLabel");var bt={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}}},Su={lightOnDark:{...bt,text:{...bt.text,foregroundColor:"white",backgroundColor:"#333"},marker:{...bt.marker,foregroundColor:{active:"white",inactive:void 0},backgroundColor:{active:"#333",inactive:void 0}}},darkOnLight:{...bt,text:{...bt.text,foregroundColor:"#333",backgroundColor:"white"},marker:{...bt.marker,foregroundColor:{active:"#333",inactive:void 0},backgroundColor:{active:"white",inactive:void 0}}}},Mu="LOW_PRIORITY",Ao=4,ku=6,wu=20,Du=2.5,Cu=2,Eu="cover",Po=.5,Ro=6.5,Lo={heightAbovePolygon:0,appearance:Su.darkOnLight};var et=class et{constructor(e,t,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 qt);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",a(e=>{if(this.currentStrategyIndex===e)return;let t=this.strategies[e];t&&t.onStrategySelected(this),this.currentStrategyIndex=e;let n=this.style;this.style=this.newStyle,this.newStyle=n},"onStrategySelected"));u(this,"packedMessage",{x:0,y:0,enabled:!1,rank:0,bboxes:[],shouldCollideWithScreenEdges:!1,lockedToStrategyIndex:-1});var o,s;if(this.id=(o=t.id)!=null?o:j(),this.options=(0,Rn.default)({},t,Lo),this.text=e,this.dp=(l=1)=>l*n.pixelRatio,typeof t.rank=="string")this.rank=yt(t.rank),this.initialRank=this.rank;else if(t.rank!=null&&t.rank>0)this.rank=t.rank,this.initialRank=t.rank;else{let l=Math.trunc(_.env.NODE_ENV==="test"?et.testId:et.testId*10)/10;et.testId+=.001,this.rank=l,this.initialRank=l}let i=(0,Rn.default)({},this.options.appearance,Lo.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||v(i.marker.foregroundColor.active).setAlpha(.5).toRgbString()},backgroundColor:{active:i.marker.backgroundColor.active,inactive:i.marker.backgroundColor.inactive||v(i.marker.backgroundColor.active).setAlpha(.5).toRgbString()},icon:i.marker.icon,iconSize:i.marker.iconSize||wu,iconPadding:(s=i.marker.iconPadding)!=null?s:Cu,iconFit:i.marker.iconFit||Eu,iconVisibilityThreshold:i.marker.iconVisibilityThreshold==null?Po:i.marker.iconVisibilityThreshold}},this.calculateMarkerSize()}setEntity(){}calculateMarkerSize(){let{iconVisibilityThreshold:e=Po}=this.appearance.marker,t=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(Ro)),this.totalMarkerSize=Math.ceil((this.markerSize+Du)/t)}get lowPriorityStrategyIndex(){return this.text===""?-1:3}get strategies(){let{width:e,height:t}=this.dimensions,{margin:n}=this.appearance;this.calculateMarkerSize();let i=Math.max(ku,n),o=this.iconVisible?i/2:0,s=this.iconVisible?this.totalMarkerSize:Ro*2,l=[{name:"RIGHT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,t);return[c/2+i,c/2+i,this.totalMarkerSize/2+i,this.totalMarkerSize/2+e+i]},onStrategySelected:()=>{this.newStyle.textAlign="left",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=this.totalMarkerSize/2+Ao,this.newStyle.textLabelVisible=!0}},{name:"LEFT",getBoundingBox:()=>{let c=Math.max(this.totalMarkerSize,t);return[c/2+i,c/2+i,this.totalMarkerSize/2+e+i,this.totalMarkerSize/2+i]},onStrategySelected:()=>{this.newStyle.textAlign="right",this.newStyle.pinVisibility=1,this.newStyle.top=-t/2,this.newStyle.left=-e-this.totalMarkerSize/2-Ao,this.newStyle.textLabelVisible=!0}},{name:"TOP",getBoundingBox:()=>{let c=this.dp();return[t+this.totalMarkerSize/2/c+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=-t-this.totalMarkerSize/2,this.newStyle.left=-e/2}},{name:Mu,getBoundingBox:()=>[s/2+o,s/2+o,s/2+o,s/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}}]:l}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((t,n)=>[...t.getBoundingBox(),n]),this.packedMessage.shouldCollideWithScreenEdges=!1,this.collisionDirty=!1,this.packedMessage):this.packedMessage}destroy(){}};a(et,"LabelComponent"),u(et,"testId",0);var Ln=et,Of=Ln;f();f();var Fn=class Fn extends Tt{constructor(t,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=t,this.convertTo3DMapPosition=n}remove(t){this.textSet.delete(t)}update(t){var l,c,d;let n,i,o,s=[];for(let p of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(p),(n==null?void 0:n.type)==="text3d"){i=n.components[0],o=n.components[1];let g=(l=i.mesh)==null?void 0:l.parent;if(!g||!(g instanceof De)||!(i instanceof kr))continue;if((c=i.feature.properties)!=null&&c.textArea&&i.mesh!=null&&i.polygonEntityId!=null&&i.textMesh==null&&i.mesh.parent!=null&&((d=i.feature.properties)==null?void 0:d.textArea.position)!=null){if(this.textSet.has(i.polygonEntityId))continue;this.textSet.add(i.polygonEntityId),this.batchedTextMap.has(g)||this.batchedTextMap.set(g,Bn().then(({BatchedText:O})=>{let E=new O;return E.type="batchedtext",g.add(E),E}));let C=this.batchedTextMap.get(g);if(!C)throw new Error("batched text required");s.push(Iu({entityId:p,textComponent:i,styleComponent:o,convertTo3DMapPosition:this.convertTo3DMapPosition,batchedMeshPromise:C,rendererState:this.rendererState}).then(()=>{this.publish("render")}))}let D=this.batchedTextMap.get(g);i.textMesh&&D&&Promise.all([D,Promise.resolve({meshComponent:i,styleComponent:o})]).then(([C,{meshComponent:O,styleComponent:E}])=>{let{textMesh:G}=O;if(C&&G){let N=zn(C,G);O.visible&&!N?C.add(G):!O.visible&&N&&C.remove(G)}E.flipToFaceCamera&&this.flipIfNeeded(O,t)})}return Promise.all(s)}flipIfNeeded(t,n){let i=t.textMesh;if(!i)return!1;let o=i.rotation.z,s=br(o+n);s>Math.PI/2&&s<3*Math.PI/2&&(i.rotation.z=br(o+Math.PI))}showTextAreaMesh(){let t,n;for(let i of this.rendererState.geometry3DIdsInScene)if(t=this.rendererState.geometry3DMap.get(i),(t==null?void 0:t.type)==="text3d"){n=t.components[0];let o=n.feature.properties.textArea;if(!o)continue;let s=new hi(o.maxWidth,o.maxHeight),l=new ui(s,new li({color:"pink"})),{textMesh:c}=n;if(!c)continue;let d=this.convertTo3DMapPosition(o.position,Ht);l.position.copy(d),l.position.z=c.position.z-.1,l.rotation.z=c.rotation.z,Nn.identity(),Nn.makeRotationAxis(new F(0,0,1),c.userData.rotationZ),Ht.set(o.maxWidth/2,0,0),Ht.applyMatrix4(Nn),l.position.x-=Ht.x,l.position.y-=Ht.y,this.rendererState.entityScene.add(l),this.debugTextAreaMesh.set(i,l)}this.publish("render")}hideTextAreaMesh(){this.debugTextAreaMesh.forEach(t=>{this.rendererState.entityScene.remove(t)}),this.debugTextAreaMesh.clear(),this.publish("render")}};a(Fn,"Text3DSystem");var Go=Fn,Nn=new _t,Ht=new F,jn;async function Ff(r){let{preloadFont:e}=await Bn();return e(r)}a(Ff,"preloadFont");function Bn(){return jn||(jn=import("./text3d-QVBDFM4E.js").then(r=>r)),jn}a(Bn,"getText3DService");async function Iu({entityId:r,textComponent:e,styleComponent:t,convertTo3DMapPosition:n,batchedMeshPromise:i,rendererState:o}){return Promise.all([Bn(),Promise.resolve({entityId:r,meshComponent:e,styleComponent:t})]).then(([{createTroikaText:s},l])=>s(l.entityId,l.meshComponent,l.styleComponent,n)).catch(s=>{ue.warn("Trouble creating text: ",s)}).then(s=>{if(s!=null&&s.text){if(e.polygonEntityId){let l=o.geometry3DMap.get(e.polygonEntityId);if((l==null?void 0:l.type)==="geometry"){let c=l.components[0],d=l.components[1];c.textMesh=s.text,c.mesh!=null&&(s.text.position.z=d.altitude+d.height+Ou)}}return Promise.all([Promise.resolve(s.text),i])}}).then(s=>{if(!s)return;let[l,c]=s;c.add(l),e.batchedText||(e.batchedText=c)})}a(Iu,"createText");function zn(r,e){return r._members.has(e)}a(zn,"doesBatchedTextContainsText");var Ou=.5;var Au=m.object({visible:m.boolean(),color:m.string(),flipToFaceCamera:m.boolean(),font:m.string().optional(),fontSize:m.number(),margin:m.union([m.number(),m.tuple([m.number(),m.number(),m.number(),m.number()])]),outlineColor:m.string(),outlineOpacity:m.number(),outlineBlur:m.union([m.number(),m.string()]),outlineWidth:m.number(),outlineOffsetX:m.number(),outlineOffsetY:m.number(),strokeWidth:m.number(),maxWidth:m.number().optional(),maxHeight:m.number().optional(),strokeOpacity:m.number(),strokeColor:m.string(),fillOpacity:m.number(),hoverColor:m.string().optional(),id:m.union([m.string(),m.number()]),type:m.literal("text3d"),position:m.tuple([m.number(),m.number(),m.number()]),content:m.string()}),No=Au.partial().omit({id:!0,type:!0}).strict(),jo=No.omit({margin:!0,position:!0,maxWidth:!0,maxHeight:!0,content:!0}).strict(),Yf=m.object({appearance:No.optional(),parentId:m.string().optional()}).strict(),Vn=class Vn{constructor(e){u(this,"mesh",new tt);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?zn(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}};a(Vn,"Text3DComponent");var kr=Vn;function $t(r,e,t){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="marker"||r.type==="label"||r.type==="geometry"||r.type==="group-container")return e===!0?(r instanceof ge&&r.components[1]===void 0?(r.components[1]=new gt,r.components[1].dirty=!0):r instanceof ae&&r.components[2]===void 0?(r.components[2]=new gt,r.components[2].dirty=!0):r instanceof De&&r.components[1]===void 0&&(r.components[1]=new gt,r.components[1].dirty=!0),!0):(r instanceof ge?r.components[1]=void 0:r instanceof ae?r.components[2]=void 0:r instanceof De&&(r.components[1]=void 0),!0);if(r.type==="geometry-group"){let n;for(let i of r.userData.entities3D.values())n=t.geometry3DMap.get(i),$t(n,e,t);return!0}}return!1}a($t,"updateInteractivity");function cp(r,e,t){if(!(!(t!=null&&t.color)&&!("topColor"in t))){if(t!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let n,i,o=r.components[0];for(let s of r.userData.entities3D.values())n=e.geometry3DMap.get(s),n&&(i=n.components[1],i.color===o.color&&(i.initialColor=t.color||o.color,i.color=t.color||o.color,i.dirty=!0),i.topColor===o.topColor&&(i.topColor=t.topColor||o.topColor,i.dirty=!0));return t.color!==void 0&&(o.color=t.color,o.dirty=!0),"topColor"in t&&(o.topColor=t.topColor,o.dirty=!0),!0}return!1}}a(cp,"updateGroupColor");function dp(r,e){if(e!==void 0&&r.type==="geometry-group"&&r.components[0]!=null){let t=r.components[0];return t.shading=t.shading||{},t.shading&&(e.start!==t.shading.start||e.end!==t.shading.end||e.intensity!==t.shading.intensity)&&(Object.assign(t.shading,e),r.userData.shadingDirty=!0),!0}return!1}a(dp,"updateGroupShading");function fp(r,e){e!==void 0&&r.type==="geometry"&&(e.showImage!==void 0&&(r.components[1].showImage=e.showImage),e.flipImageToFaceCamera!==void 0&&(r.components[1].flipImageToFaceCamera=e.flipImageToFaceCamera))}a(fp,"updateImageProps");function pp(r,e,t){var n;if(t!==void 0){if(r.type==="geometry"){let i=r.components[1];if(i.height!==t)return i.height=t,i.dirty=!0,((n=r.parentObject3D)==null?void 0:n.type)==="geometry-group"&&(r.parentObject3D.userData.outlineDirty=!0),!0}else if(r.type==="geometry-group"){let i=r.components[0];for(let o of r.userData.entities3D.values()){let s=e.geometry3DMap.get(o),l;((s==null?void 0:s.type)==="geometry"||(s==null?void 0:s.type)==="model")&&(l=s.components[1],l.height===i.height&&(s.components[1].height=t,s.components[1].dirty=!0))}return r.components[0].height=t,r.userData.outlineDirty=!0,!0}}return!1}a(pp,"updateHeight");function Ru(r,e){e!==void 0&&(r.type==="path"||r.type==="geometry")&&(e.initialColor!==void 0&&(r.components[1].initialColor=e.initialColor),e.color!==void 0&&(r.components[1].color=e.color),"topColor"in e&&(r.components[1].topColor=e.topColor),r.components[1].dirty=!0)}a(Ru,"updateColor");function hp(r,e,t){e!==void 0&&(r.type==="label"||r.type==="marker"?(r.object3d.position.copy(t(e[1],e[0],e[2]||0)),r.positionDirty=!0):r.type==="custom-geometry"&&r.components[0].position.copy(t(e[1],e[0],e[2]||0)))}a(hp,"updatePosition");function mp(r,e){var t;return e!==void 0&&(r.type==="marker"||r.type==="label"||r.type==="custom-geometry")&&r.parentObject3D!==e&&r.parentObject3D instanceof De?((t=r.parentObject3D)==null||t.removeEntity(r),e.addEntity(r),!0):!1}a(mp,"updateParent");function gp(r,e){e!==void 0&&(r.type==="marker"||r.type==="label")&&r.components[0].enabled!==e&&(r.components[0].enabled=e)}a(gp,"updateEnabled");function yp(r,e,t){if(e!==void 0&&r.type==="marker"){let n=r.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{An.parse(e.options||{})}catch(i){return ue.error(i),!1}return e.options.interactive==="pointer-events-auto"?(n.pointerEvents="auto",$t(r,!1,t)):(n.pointerEvents="none",$t(r,e.options.interactive,t)),Bo(r,e.options.rank),!0}}return!1}a(yp,"updateMarker");function Bo(r,e){return e!==void 0&&(r.type==="marker"||r.type==="label")?(r.components[0].rank=yt(e),!0):!1}a(Bo,"updateRank");function bp(r,e,t){var n,i,o,s,l;if(e!==void 0&&r.type==="label"){let c=r.components[0];e.text!==void 0&&(c.text=e.text,c.dirty=!0);try{Gn.parse(e.options||{})}catch(d){ue.error(d);return}((n=e.options)==null?void 0:n.appearance)!==void 0&&Object.keys((i=e.options)==null?void 0:i.appearance).length>0&&(Hn(c.appearance,((o=e.options)==null?void 0:o.appearance)||{}),c.dirty=!0),$t(r,(s=e.options)==null?void 0:s.interactive,t),Bo(r,(l=e.options)==null?void 0:l.rank)}}a(bp,"updateLabel");function vp(r,e){e!==void 0&&r.type==="geometry"&&(r.components[1].hoverColor=e,r.components[1].dirty=!0)}a(vp,"updateHoverColor");function xp(r,e){if(e!==void 0){let t=r.components[2];if(r.type==="geometry"&&t!=null)return t.hover=e,t.dirty=!0,!0}return!1}a(xp,"updateHovered");function _p(r,e){e!==void 0&&r.type==="image"&&(r.components[1].flipImageToFaceCamera=e)}a(_p,"updateFlipImageToFaceCamera");function zo(r,e){if(e!==void 0){if(r.type==="model"||r.type==="path"||r.type==="geometry"||r.type==="custom-geometry"||r.type==="image"||r.type==="text3d"){r.components[1].visible=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}else r.type==="group-container"||r.type==="geometry-group"?r.setVisible(e):r.type==="label"&&(r.components[0].visible=e);return!0}return!1}a(zo,"updateVisibility");function Tp(r,e,t){if(t!==void 0&&r.type==="geometry-group"){let n=r.components[0];for(let i of r.userData.entities3D.values()){let o=e.geometry3DMap.get(i),s;((o==null?void 0:o.type)==="geometry"||(o==null?void 0:o.type)==="model")&&(s=o.components[1],(!s.opacity||s.opacity===n.opacity)&&(s.opacity=t,s.dirty=!0))}return r.setOpacity(t),n.opacity=t,!0}return!1}a(Tp,"updateOpacity");function Sp(r,e){if(e!==void 0&&r.type==="geometry-group"){let t=r.components[0];(e==null?void 0:e.texture)!=null&&t.texture!==(e==null?void 0:e.texture)&&(t.texture=e.texture,t.dirty=!0),(e==null?void 0:e.topTexture)!=null&&t.topTexture!==(e==null?void 0:e.topTexture)&&(t.topTexture=e.topTexture,t.dirty=!0)}}a(Sp,"updateGroupTexture");function Mp(r,e){if(r.type==="geometry"){let t=!1,n=r.components[1];if((e==null?void 0:e.texture)!=null&&n.texture!==(e==null?void 0:e.texture)&&(n.texture=e.texture,t=!0),(e==null?void 0:e.topTexture)!=null&&n.topTexture!==(e==null?void 0:e.topTexture)&&(n.topTexture=e.topTexture,t=!0),t&&r.components[0]instanceof oe){let i=r.components[0];return i.detached===!1&&(i.detached=!0,i.dirty=!0),!0}}return!1}a(Mp,"updateIndividualGeometryTexture");function kp(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.opacity!==e){t.opacity=e;let n=r.components[0];n.detached===!1&&(n.detached=!0,n.dirty=!0),e===0?t.visible=!1:t.visible=!0,t.dirty=!0;let i=r.parentObject3D;return(i==null?void 0:i.type)==="geometry-group"&&(i.userData.outlineDirty=!0,i.userData.shadingDirty=!0),!0}}return!1}a(kp,"updateIndividualGeometryOpacity");function wp(r,e){if(e!==void 0){if(r.type==="path"||r.type==="geometry"||r.type==="custom-geometry")r.components[1].altitude=e,r.components[1].dirty=!0;else if(r.type==="group-container"&&r.altitude!==e)return r.setAltitude(e),!0}return!1}a(wp,"updateAltitude");function Dp(r,e){if(e!==void 0){if(r.type==="geometry-group"&&r.components[0]!=null)r.components[0].outline=e,r.userData.outlineDirty=!0;else if(r.type==="geometry"){r.components[1].outline=e,r.components[1].dirty=!0;let t=r.parentObject3D;t instanceof se&&(t.userData.outlineDirty=!0)}return!0}return!1}a(Dp,"updateOutline");function Cp(r,e){return e!==void 0&&r.type==="geometry"&&r.components[0]&&r.components[0]instanceof oe?(r.components[0].focusable=e,!0):!1}a(Cp,"updateFocusable");function Ep(r,e){if(e!==void 0&&r.type==="geometry"){let t=r.components[1];if(t.renderOrder!==e){t.renderOrder=e;let n=r.components[0];return n.detached===!1&&(n.detached=!0,n.dirty=!0),n.imageMesh&&(n.imageMesh.renderOrder=e+1),t.dirty=!0,!0}}return!1}a(Ep,"updateIndividualGeometryRenderOrder");function Ip(r,e){let{visible:t,color:n}=e;if(r.type!=="path")return;let i=r.components[0];t!=null&&zo(r,t),n!=null&&Ru(r,{color:n}),Object.assign(i,Lu(e)),Un(e)||(i.materialDirty=!0,(e.nearRadius!=null||e.farRadius!=null)&&(i.dirty=!0))}a(Ip,"handlePathUpdate");function Lu(r){return Zt(r,Gu)}a(Lu,"pickPathOptions");var Gu=["animateArrowsOnPath","displayArrowsOnPath","nearRadius","farRadius","accentColor","completeFraction"];function Op(r){if(!(r instanceof ae&&r.type==="text3d"))throw new Error("expect target is TextGeometry3D")}a(Op,"assetGeometryIsText3D");var Nu=["visible","color","strokeWidth","outlineOffsetX","outlineOffsetY","outlineWidth","outlineBlur","outlineOpacity","outlineColor","strokeWidth","strokeColor","strokeOpacity","maxWidth","maxHeight","font","hoverColor","fillOpacity","fontSize","flipToFaceCamera"];function Ap(r,e){zo(r,e.visible);let t=r.components[1],n=Zt(e,Nu);"margin"in e&&ue.warn("update to margin is not supported atm"),"content"in e&&ue.warn("content update is not supported atm");try{jo.parse(n)}catch(i){ue.error(i);return}Object.keys(n).length>0&&(Object.assign(t,n),t.dirty=!0)}a(Ap,"handleText3DUpdate");var ju=["material","opacity","verticalOffset"];function Pp(r,e){let t=Zt(e,ju),n=r.components[1];Object.keys(t).length>0&&(t.material&&(n.material=t.material),t.opacity!=null&&(n.opacity=t.opacity),t.verticalOffset!=null&&(n.verticalOffset=t.verticalOffset),n.dirty=!0)}a(Pp,"handleModelStyleUpdate");f();f();f();f();var $n=class $n extends ci{constructor(t){let n=t,i=3,o=i*4;super(new Float32Array(t*o),i,t,si,ai);u(this,"_width");u(this,"_height");u(this,"_propertiesLength");this._width=o,this._height=n,this._propertiesLength=i}setColor(t,n,i){let o=this.image.data,s=t*this._width;o[s]=n.r,o[s+1]=n.g,o[s+2]=n.b,o[s+3]=0,o[s+4]=i.r,o[s+5]=i.g,o[s+6]=i.b,o[s+7]=0,this.needsUpdate=!0}getColor(t){let n=this.image.data,i=t*this._width,o=new le(n[i],n[i+1],n[i+2]),s=new le(n[i+4],n[i+5],n[i+6]);return{color:o,topColor:s}}setTexture(t,n,i){let o=this.image.data,s=t*this._width;o[s+8]=n?1:0,o[s+9]=i?1:0,o[s+10]=0,o[s+11]=0,this.needsUpdate=!0}};a($n,"BatchedPropertiesTexture");var wr=$n;var Fo="#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>\n\nvoid main() {\n\n #include <uv_vertex>\n #include <color_vertex>\n #include <morphinstance_vertex>\n #include <morphcolor_vertex>\n #include <batching_vertex>\n\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\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\n vViewPosition = - mvPosition.xyz;\n\n #include <worldpos_vertex>\n #include <envmap_vertex>\n #include <shadowmap_vertex>\n #include <fog_vertex>\n \n vBatchId = getIndirectIndex(gl_DrawID);\n vViewPosition = - mvPosition.xyz;\n worldNormal = normal;\n vUv = uv;\n vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n}";var Vo="#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 <alphahash_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\n #include <logdepthbuf_fragment>\n #include <map_fragment>\n #include <color_fragment>\n #include <alphamap_fragment>\n #include <alphatest_fragment>\n #include <alphahash_fragment>\n #include <specularmap_fragment>\n #include <normal_fragment_begin>\n #include <normal_fragment_maps>\n #include <emissivemap_fragment>\n\n // accumulation\n #include <lights_lambert_fragment>\n #include <lights_fragment_begin>\n #include <lights_fragment_maps>\n #include <lights_fragment_end>\n\n // modulation\n #include <aomap_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\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 Vu=-.05,Uu=1,Zn=class Zn extends mi{constructor(t,n,i=1){super(t);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",a(t=>{let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,n,i),this.needsUpdate=!0)},"showTextures"));this.propertiesTexture=new wr(n),this.uniforms.uRepeatYFactor.value=i,this.onBeforeCompile=o=>{let s=this.uniforms.uGradientIntensity,l=this.uniforms.uGradientEnd,c=this.uniforms.uGradientStart,d=this.uniforms.uTopTexture,p=this.uniforms.uTexture,g=this.uniforms.uRepeatYFactor;this.uniforms=o.uniforms,o.vertexShader=Fo,o.fragmentShader=Vo,Object.assign(this.uniforms,{uGradientIntensity:s,uGradientEnd:l,uGradientStart:c,uMinSideAlpha:{value:Vu},uMaxSideAlpha:{value:Uu},uPropertiesTexture:{value:this.propertiesTexture},uTopTexture:d,uTexture:p,uRepeatYFactor:g})}}get repeatYFactor(){return this.uniforms.uRepeatYFactor.value}set repeatYFactor(t){t!==this.uniforms.uRepeatYFactor.value&&(this.uniforms.uRepeatYFactor.value=t,this.needsUpdate=!0)}get texture(){return this.uniforms.uTexture.value}set texture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTexture.value=t}get topTexture(){return this.uniforms.uTopTexture.value}set topTexture(t){t.wrapS=xt,t.wrapT=xt,t.colorSpace=Cr,this.uniforms.uTopTexture.value=t}setGradientShading(t,n,i){this.uniforms.uGradientStart.value=t,this.uniforms.uGradientEnd.value=n,this.uniforms.uGradientIntensity.value=i}setColor(t,n,i){this.propertiesTexture.setColor(t,n,i)}getColor(t){return this.propertiesTexture.getColor(t)}hideTextures(t){let n=!!this.uniforms.uTexture.value,i=!!this.uniforms.uTopTexture.value;(n||i)&&(this.propertiesTexture.setTexture(t,!1,!1),this.needsUpdate=!0)}removeSideTexture(t){if(this.texture){this.texture.dispose(),this.uniforms.uTexture.value=null;let n=!!this.uniforms.uTopTexture.value;this.propertiesTexture.setTexture(t,!1,n),this.needsUpdate=!0}}removeTopTexture(t){if(this.topTexture){this.topTexture.dispose(),this.uniforms.uTopTexture.value=null;let n=!!this.uniforms.uTexture.value;this.propertiesTexture.setTexture(t,n,!1),this.needsUpdate=!0}}dispose(){super.dispose(),this.propertiesTexture.dispose()}};a(Zn,"BatchedStandardMaterial");var Wt=Zn;f();var Uo="mappedin";var $u=80;function hh(r,e){var l,c,d;let t=0;for(let p of r)t+=((c=(l=p.components[0])==null?void 0:l.geometry)==null?void 0:c.attributes.position.count)||0;let n=new le(e.color),i;i=new Wt({color:n,side:e.side==="back"?ii:e.side==="front"?ni:oi,opacity:(d=e.opacity)!=null?d:1,transparent:e.opacity!==void 0?e.opacity<1:!1},r.length);let o=new ke(r.length,t,0,i),s;for(let p of r)s=p.components[0],!(!(s instanceof oe)||!s.geometry)&&(s.mesh=o,s.material=i,s.instanceIndex=o.addGeometry(s.geometry),o.addInstance(s.instanceIndex),o.userData.entities[s.instanceIndex]=p.id,i instanceof Wt&&i.setColor(s.instanceIndex,n,e.topColor?new le(e.topColor):n));return o.perObjectFrustumCulled=!0,o.matrixAutoUpdate=!1,o}a(hh,"batchGeometries");function Wn(r,e){e.polygonOffset=!0,e.polygonOffsetFactor=1,e.polygonOffsetUnits=1;let t=new pi(r,$u),n=Zu(e.color.getHexString()),i=new fi({linewidth:1,color:n,transparent:!0}),o=new Kt(t,i);return o.layers.set(1),o}a(Wn,"createOutlines");function Zu(r){return v(r).darken(30).toRgbString()}a(Zu,"darkenColorForOutline");f();function Ho(r){r&&(r.map&&(r.map.dispose(),r.map=void 0),r.dispose())}a(Ho,"scrubMaterial");function Dr(r){for(let e=r.children.length-1;e>=0;e--)Dr(r.children[e]);"geometry"in r&&r.geometry&&r.geometry.dispose(),r.parent&&r.parent.remove(r),"material"in r&&Array.isArray(r.material)?r.material.forEach(function(e){Ho(e)}):"material"in r&&typeof r.material<"u"&&Ho(r.material)}a(Dr,"destroyObject3D");var Yt,vt,qn=class qn{constructor(e){u(this,"rendererState");u(this,"dirty",!0);U(this,Yt,!0);U(this,vt,0);this.rendererState=e}get geometries3DDirty(){return I(this,Yt)}set geometries3DDirty(e){R(this,Yt,e)}update(e,t=!1){var o,s;let n;if(this.geometries3DDirty){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(n=this.rendererState.geometry3DMap.get(c),n&&n.type==="geometry-group"&&n.userData.modelURL===void 0&&n.userData.dirty===!1&&n.userData.outlineDirty===!0){let d=n.children[0];n.userData.outlineDirty=!1;let p=mt(n);if(p&&Dr(p),!n.components[0].outline||!n.visible)continue;if(n.children.length>0){let g;if(d instanceof ke){let O=[],E,G,N,re;for(let Y of n.userData.entities3D)re=this.rendererState.geometry3DMap.get(Y),(re==null?void 0:re.type)==="geometry"&&(G=re.components[0],N=re.components[1],G instanceof oe&&N.visible&&N.opacity>0&&N.outline&&!G.detached&&(E=G==null?void 0:G.geometry,E&&O.push(E)));O.length>0&&(g=vi(O))}else g=d.geometry;g&&(l=Wn(g,d.material),l.position.z=n.altitude,l.userData.outlineOfEntityId=n.userData.entityId);let D,C;for(let O of n.userData.entities3D.values()){let E=this.rendererState.geometry3DMap.get(O);(E==null?void 0:E.type)==="geometry"&&(D=E.components[0],C=E.components[1],l&&(E==null?void 0:E.type)==="geometry"&&!D.detached?(E.components[0].outline=l,(o=n.parent)==null||o.add(l)):(E==null?void 0:E.type)==="geometry"&&D.geometry!=null&&D.material!=null&&D.detached&&(D.outline&&Dr(D.outline),C&&C.opacity>0&&C.visible&&C.outline&&(D.outline=Wn(D.geometry,D.material),(s=n.parent)==null||s.add(D.outline))))}}this.dirty=!0}this.geometries3DDirty=!1}let i=t?$o(e,16,19,0,1):I(this,vt);if((i!==I(this,vt)||this.dirty)&&this.rendererState.geometry3DIdsInScene.size>0){let l;for(let c of this.rendererState.geometry3DIdsInScene)if(l=this.rendererState.geometry3DMap.get(c),(l==null?void 0:l.type)==="geometry-group"&&l.components[0]!=null&&l.components[0].outline&&l.visible){let d=mt(l);if(d&&d.visible){let p=Array.isArray(d.material)?d.material:[d.material];for(let g of p)g.opacity=Math.min(i,l.components[0].opacity)}}else if((l==null?void 0:l.type)==="geometry"&&l.components[0]instanceof oe&&l.components[0].detached){let d=l.components[0].outline;if(d){let p=Array.isArray(d.material)?d.material:[d.material];for(let g of p)g.opacity=Math.min(i,l.components[1].opacity)}}}R(this,vt,i),this.dirty=!1}};Yt=new WeakMap,vt=new WeakMap,a(qn,"OutlineInterpolationSystem");var Yn=qn;var Kn=class Kn extends ve{constructor(t,n=new xr){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=t}setVisible(t){this.visible=t;let n=mt(this);n&&(n.visible=t),this.dispatchEvent({type:"childremoved",child:this})}getOpacity(){return this.userData.opacity}setOpacity(t){this.userData.opacity=t}removeEntity(){this.dispatchEvent({type:"childremoved",child:this})}getfirstChildEntityId(){let t;for(let i of this.children)if(!i.userData.detached){t=i;break}return t instanceof ke?Object.values(t.userData.entities)[0]:void 0}setAltitude(t){this.position.z=t,this.dispatchEvent({type:"childremoved",child:this})}get altitude(){return this.position.z}};a(Kn,"GeometryGroupObject3D");var se=Kn;var Xn=class Xn extends ve{constructor(){super(...arguments);u(this,"type","geometry");u(this,"userData",{entityId:"",type:"geometry"})}};a(Xn,"Geometry3DObject3D");var tt=Xn,Jn=class Jn{constructor(e,t){u(this,"id",j());u(this,"components");u(this,"entities2D",new Map);this.components=[e,t]}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 se?(this.parentObject3D.add(e.object3d),e.object3d.userData.parentEntityId=this.id):this.entities2D.set(e.id,e)}removeEntity(e){var t;(t=e.parentObject3D)==null||t.remove(e.object3d),this.entities2D.delete(e.id)}removeAllEntities(){for(let e of this.entities2D.values())this.removeEntity(e)}};a(Jn,"Geometry3D");var ae=Jn;f();function qu(r){let e=r.min,t=r.max,n=new F(e.x,e.y,e.z),i=new F(t.x,e.y,e.z),o=new F(e.x,t.y,e.z),s=new F(t.x,t.y,e.z);return[n,i,o,s]}a(qu,"getCornersOfBoundingBox");f();function Ku(){return typeof window>"u"?1:Math.min(window.devicePixelRatio,2)}a(Ku,"getPixelRatio");f();function Xu(r,e,t=!1){let n=null,i=0;return function(...o){i++,i===1&&t===!0&&r(...o);let s=a(()=>{(!t||i>1)&&r(...o),n=null,i=0},"later");clearTimeout(n),n=setTimeout(s,e)}}a(Xu,"debounce");f();var Ju=(()=>{let r;return{getDeviceType(){if(r)return r;let{userAgent:e,platform:t,maxTouchPoints:n}=window.navigator,i=/(iphone|ipod|ipad)/i.test(e),o=t==="iPad"||t.indexOf("Mac")===0&&n>0&&!window.MSStream,s=/android/i.test(e);return r={isIpad:o,isMobile:s||i||o,isSafari12:/Version\/12.+Safari/.test(e),isFirefox:/Firefox/.test(e),isWindows:/windows/i.test(e)},r},_reset(){r=void 0}}})(),Zo=Ju.getDeviceType,Wo=(()=>{let r,e,t;function n(){if(e!==void 0)return e;r||(r=document.createElement("canvas"));let o=r.getContext("webgl")||r.getContext("experimental-webgl");if(!o)return e;try{let s=Zo().isFirefox?null:o.getExtension("WEBGL_debug_renderer_info");return e=s?o.getParameter(s.UNMASKED_RENDERER_WEBGL):o.getParameter(o.RENDERER),e}catch{let l=new Error("Failed getting device info");throw l.name="FailedGettingDeviceInfo",l}}a(n,"getInfo");function i(){var s,l;if(!Zo().isWindows)return!1;if(t!==void 0)return t;let o=(l=(s=Qu())==null?void 0:s.toLowerCase())!=null?l:"";return t=o.includes("intel")&&(o.includes("uhd")||o.includes("iris")),t}return a(i,"shouldDisableOffscreenCanvas"),{getInfo:n,shouldDisableOffscreenCanvas:i,_setCanvas(o){r=o,e=void 0,t=void 0}}})(),Qu=Wo.getInfo,ec=Wo.shouldDisableOffscreenCanvas;f();function Zt(r,e){let t={};for(let n=0;n<e.length;n++){let i=e[n];i in r&&(t[i]=r[i])}return t}a(Zt,"pick");function Un(r){return Object.keys(r).length===0}a(Un,"isEmpty");f();var tc=a(r=>e=>{if(!e.includes("mappedin")){let t={};for(let n in r){let i=r[n];e.includes("mappedin")||(r[n]=i)}return{url:e,headers:t}}return{url:e,headers:r}},"transformRequest");function Tm(r,e,t,n){let i=r*(Math.PI/180),o=n/Ie,s=r+o*180/Math.PI,l=t/Ie/Math.cos(i),c=e+l*180/Math.PI;return{lat:s,lon:c}}a(Tm,"cartesianToGeographic");function Sm(r,e,t,n){let i=t*(Math.PI/180),o=n*(Math.PI/180),s=r*(Math.PI/180),l=e*(Math.PI/180),c=i-s,d=o-l,p=Ie*d*Math.cos(s),g=Ie*c;return{x:p,y:g}}a(Sm,"geographicToCartesian");var rc=a((r,e)=>{var t;if(r.children&&r.visible)for(let n of r.children){if(n.visible&&n.type)if("entities3D"in n.userData&&((t=n.userData)!=null&&t.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 tt)&&e.add(n.userData.entityId);rc(n,e)}return e},"populateGeometry3DIdsInScene"),nc=a((r,e)=>{var t;if(r.children&&r.visible&&!((t=r.userData)!=null&&t.hidden))for(let n of r.children)n.visible&&n instanceof Ke&&e.add(n.userData.entityId),nc(n,e);return e},"populateGeometry2DIdsInScene");function Hn(r,e){for(let t in e){if(e[t]==null){r[t]=void 0;continue}typeof e[t]=="object"?Hn(r[t],e[t]):r[t]=e[t]}return r}a(Hn,"mergeObjects");function Mm(r,e,t,n){let i={translateX:r.x,translateY:r.y,translateZ:r.z,scale:r.meterInMercatorCoordinateUnits()},o=new _t,s=new F(i.scale,-i.scale,i.scale),l=new _t().makeTranslation(i.translateX,i.translateY,i.translateZ).scale(s),c=t.elevation;return{id:Uo,type:"custom",renderingMode:"3d",render:(d,p)=>{if(o.fromArray(p),c!==t.elevation){let g=bi.fromLngLat(r.toLngLat(),t.elevation);l.makeTranslation(i.translateX,i.translateY,-g.z).scale(s)}e.projectionMatrix=o.multiply(l),c=t.elevation,n()}}}a(Mm,"createCustomLayer");function ic(r){return fetch(r,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({grant_type:"client_credentials"})})}a(ic,"fetchToken");async function km(r){let e=await ic(r),{access_token:t}=await e.json();return{"x-mappedin-tiles-key":t}}a(km,"getRequestHeaders");function wm(r,e=0){let t=3735928559^e,n=1103547991^e;for(let i=0,o;i<r.length;i++)o=r.charCodeAt(i),t=Math.imul(t^o,2654435761),n=Math.imul(n^o,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&n)+(t>>>0)}a(wm,"cyrb53");var oc=a(r=>r,"linearEase");var Dm=a(r=>1-Math.cos(r*Math.PI/2),"easeIn");function $o(r,e,t,n,i,o=oc){r=Math.max(e,Math.min(r,t));let s=(r-Math.min(e,t))/Math.abs(t-e),l=o(s);return n+l*(i-n)}a($o,"interpolate");function Cm(r,e,t){let n=r*(Math.PI/180)/2,i=e/2;return t*Math.tan(n)/i}a(Cm,"getProjectionScaleFactor");function Em(r,e){let t;return typeof e=="string"||typeof e=="number"?(t=r.geometry2DMap.get(e),t==null&&(t=r.geometry3DMap.get(e))):typeof(e==null?void 0:e.id)=="string"||typeof(e==null?void 0:e.id)=="number"?(t=r.geometry2DMap.get(e.id),t==null&&(t=r.geometry3DMap.get(e.id))):t=e,t}a(Em,"getGeometryByGeometryId");function Im(r){return new yi(new Er(r[0][0],r[0][1]),new Er(r[1][0],r[1][1])).getCenter().toArray()}a(Im,"getBoundingBoxCenter");function Om(r){return Number.isFinite(r.min.x)&&Number.isFinite(r.min.y)&&Number.isFinite(r.max.x)&&Number.isFinite(r.max.y)&&(r instanceof gi||Number.isFinite(r.min.z)&&Number.isFinite(r.max.z))}a(Om,"isFiniteBox");f();var ei=class ei{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",Yo.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 t={};for(let n in this)!e&&n==="dirty"||this[n]!==void 0&&(t[n]=this[n]);return t}};a(ei,"Text3DStyleComponent");var Qn=ei,Yo=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();f();var ri=class ri{constructor(e){u(this,"dirty",!0);u(this,"visible",!0);u(this,"opacity",1);u(this,"verticalOffset",0);u(this,"material");e&&Object.assign(this,e)}};a(ri,"ModelStyleComponnet");var ti=ri;export{Xo as a,cc as b,ue as c,Ie as d,_c as e,Tc as f,Sc as g,Mc as h,ac as i,Tt as j,j as k,Pr as l,Xe as m,Yl as n,ud as o,yo as p,cd as q,dd as r,fd as s,pd as t,hd as u,md as v,_d as w,Kl as x,Td as y,bo as z,m as A,ho as B,kn as C,wn as D,ke as E,oe as F,xr as G,mt as H,tf as I,df as J,So as K,ge as L,tt as M,ae as N,Uo as O,qu as P,Ku as Q,Xu as R,ec as S,Zt as T,tc as U,br as V,Tm as W,Sm as X,rc as Y,nc as Z,Mm as _,km as $,wm as aa,oc as ba,Dm as ca,$o as da,Cm as ea,Em as fa,Im as ga,Om as ha,v as ia,If as ja,Of as ka,Qn as la,Yo as ma,ti as na,Go as oa,Ff as pa,Yf as qa,kr as ra,$t as sa,cp as ta,dp as ua,fp as va,pp as wa,Ru as xa,hp as ya,mp as za,gp as Aa,yp as Ba,bp as Ca,vp as Da,xp as Ea,_p as Fa,zo as Ga,Tp as Ha,Sp as Ia,Mp as Ja,kp as Ka,wp as La,Dp as Ma,Cp as Na,Ep as Oa,Ip as Pa,Lu as Qa,Op as Ra,Nu as Sa,Ap as Ta,Pp as Ua,Wt as Va,hh as Wa,Zu as Xa,Dr as Ya,Yn as Za,se as _a,De as $a};